var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var l=0;return function(){return l<a.length?{done:!1,value:a[l++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var l="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return l?l.call(a):$jscomp.arrayIterator(a)};
define("mixins/token_iterator",["require","exports","module"],function(a,l,m){var g=a("ace/token_iterator").TokenIterator,k=a("ace/range").Range;(function(){function a(c,a){return 1===c.length&&("{"===c||"("===c||"["===c||!!a&&"<"===c)}function f(c,a){return 1===c.length&&("}"===c||")"===c||"]"===c||!!a&&">"===c)}function d(c,a,b,d,e){for(var n=1,p,q=c.clone();p=b.call(q);)if(p=a(p),p===e){if(n--,0===n)return c.moveToTokenIterator(q),!0}else p===d&&n++;return!1}var b={"(":")","{":"}","[":"]","<":">",
")":"(","}":"{","]":"[",">":"<"};this.moveToPreviousToken=function(){var c=this.$rowTokens,a=this.$tokenIndex-1;if(0<=a)return this.$tokenIndex--,c[a];a=this.$session;var b=this.$row;if(0>b)return null;for(;;){b--;if(0>b)return null;if((c=a.getTokens(b))&&c.length)return this.$row=b,this.$tokenIndex=c.length-1,this.$rowTokens=c,c[c.length-1]}};this.moveToNextToken=function(){var c=this.$rowTokens,a=this.$tokenIndex+1;if(a<c.length)return this.$tokenIndex++,c[a];a=this.$session;var b=a.getLength(),
d=this.$row;if(d>=b)return null;for(;;){d++;if(d>=b)return null;if((c=a.getTokens(d))&&c.length)return this.$row=d,this.$tokenIndex=0,this.$rowTokens=c,c[0]}};this.moveToNextSignificantToken=function(){if(!this.moveToNextToken())return!1;for(var c=this.getCurrentToken();/^\s+$/.test(c.value)||/\bcomment\b/.test(c.type);){if(!this.moveToNextToken())return!1;c=this.getCurrentToken()}return!0};this.moveToPreviousSignificantToken=function(){if(!this.moveToPreviousToken())return!1;for(var c=this.getCurrentToken();/^\s+$/.test(c.value)||
/\bcomment\b/.test(c.type);){if(!this.moveToPreviousToken())return!1;c=this.getCurrentToken()}return!0};this.moveToStartOfRow=function(){this.$tokenIndex=0;return this.getCurrentToken()};this.moveToEndOfRow=function(){this.$tokenIndex=this.$rowTokens.length-1;return this.getCurrentToken()};this.moveToStartOfNextRowWithTokens=function(){for(var c=this.$row,a=this.$session,b=a.getLength();;){c++;if(c>=b)return null;var d=a.getTokens(c);if(d&&d.length)return this.$row=c,this.$tokenIndex=0,this.$rowTokens=
d,this.getCurrentToken()}};var e,c=0,r=0;this.tokenizeUpToRow=function(a){var b=this.$session.bgTokenizer;c=Math.min(c,b.currentLine);r=Math.max(r,a);for(var d=b.currentLine;d<=a;d++)b.$tokenizeRow(d);clearTimeout(e);e=setTimeout(function(){b.fireUpdateEvent(c,r);c=r;r=0},700)};this.moveToPosition=function(c,a){this.tokenizeUpToRow(c.row);var b=this.$session.getTokenAt(c.row,c.column);b&&a&&b.column<c.column&&(b=this.$session.getTokenAt(c.row,c.column+1));if(null==b){if(a)return this.$row=c.row,this.$rowTokens=
this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1,this.moveToNextToken();this.$row=c.row+1;this.$tokenIndex=0;this.$rowTokens=this.$session.getTokens(this.$row);return this.moveToPreviousToken()}this.$row=c.row;this.$rowTokens=this.$session.getTokens(this.$row);this.$tokenIndex=b.index;return this.getCurrentToken()};this.clone=function(){var c=new g(this.$session,0,0);c.moveToTokenIterator(this);return c};this.moveToTokenIterator=function(c){for(var a in c)c.hasOwnProperty(a)&&
(this[a]=c[a])};this.peekFwd=function(c){for(var a=this.clone(),b=null,d=0;d<c;d++)b=a.moveToNextToken();return b};this.peekBwd=function(c){for(var a=this.clone(),b=null,d=0;d<c;d++)b=a.moveToPreviousToken();return b};this.getCurrentToken=function(){var c=this.$rowTokens[this.$tokenIndex];c&&(c.row=this.$row);return c};this.getCurrentTokenValue=function(){return this.getCurrentToken().value};this.getCurrentTokenPosition=function(){return{row:this.getCurrentTokenRow(),column:this.getCurrentTokenColumn()}};
this.getCurrentTokenRange=function(){var c=this.getCurrentTokenPosition(),a={row:c.row,column:c.column+this.getCurrentToken().value.length};return k.fromPoints(c,a)};this.fwdToMatchingToken=function(){var c=this.getCurrentToken();return a(c.value,!0)?d(this,function(c){return c.value},this.moveToNextToken,c.value,b[c.value]):"support.function.codebegin"===c.type?d(this,function(c){return c.type},this.moveToNextToken,"support.function.codebegin","support.function.codeend"):!1};this.bwdToMatchingToken=
function(){var c=this.getCurrentToken();return f(c.value,!0)?d(this,function(c){return c.value},this.moveToPreviousToken,c.value,b[c.value]):"support.function.codeend"===c.type?d(this,function(c){return c.type},this.moveToPreviousToken,"support.function.codeend","support.function.codebegin"):!1};this.findTokenValueBwd=function(c,a){a=!!a;do if(!(a&&this.bwdToMatchingToken()||this.getCurrentToken().value!==c))return!0;while(this.moveToPreviousToken());return!1};this.findTokenValueFwd=function(c,a){a=
!!a;do if(!(a&&this.fwdToMatchingToken()||this.getCurrentToken().value!==c))return!0;while(this.moveToNextToken());return!1};this.findTokenTypeBwd=function(c,a){a=!!a;do if(!(a&&this.bwdToMatchingToken()||this.getCurrentToken().type!==c))return!0;while(this.moveToPreviousToken());return!1};this.findTokenTypeFwd=function(c,a){a=!!a;do if(!(a&&this.fwdToMatchingToken()||this.getCurrentToken().type!==c))return!0;while(this.moveToNextToken());return!1}}).call(g.prototype)});define("ace/token_tooltip",["require","exports","module"],function(a,l,m){function g(a){a.tokenTooltip||(f.call(this,a.container),a.tokenTooltip=this,this.editor=a,this.update=this.update.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseOut=this.onMouseOut.bind(this),k.addListener(a.renderer.scroller,"mousemove",this.onMouseMove),k.addListener(a.renderer.content,"mouseout",this.onMouseOut))}a("ace/lib/dom");m=a("ace/lib/oop");var k=a("ace/lib/event"),h=a("ace/range").Range,f=a("ace/tooltip").Tooltip;
m.inherits(g,f);(function(){this.token={};this.range=new h;this.update=function(){this.$timer=null;var a=this.editor.renderer;1E3<this.lastT-(a.timeStamp||0)&&(a.rect=null,a.timeStamp=this.lastT,this.maxHeight=window.innerHeight,this.maxWidth=window.innerWidth);var b=a.rect||(a.rect=a.scroller.getBoundingClientRect()),e=Math.floor((this.y+a.scrollTop-b.top)/a.lineHeight),c=this.editor.session;a=c.screenToDocumentPosition(e,Math.round((this.x+a.scrollLeft-b.left-a.$padding)/a.characterWidth));(b=c.getTokenAt(a.row,
a.column))||c.getLine(a.row)||(b={type:"",value:"",state:c.bgTokenizer.getState(0)});b?(e=JSON.stringify(c.getState(e))+"| "+b.type,this.tokenText!=e&&(this.setText(e),this.width=this.getWidth(),this.height=this.getHeight(),this.tokenText=e),this.show(null,this.x,this.y),this.token=b,c.removeMarker(this.marker),this.range=new h(a.row,b.start,a.row,b.start+b.value.length),this.marker=c.addMarker(this.range,"ace_bracket","text")):(c.removeMarker(this.marker),this.hide())};this.onMouseMove=function(a){this.x=
a.clientX;this.y=a.clientY;this.isOpen&&(this.lastT=a.timeStamp,this.setPosition(this.x,this.y));this.$timer||(this.$timer=setTimeout(this.update,100))};this.onMouseOut=function(a){a&&a.currentTarget.contains(a.relatedTarget)||(this.hide(),this.editor.session.removeMarker(this.marker),this.$timer=clearTimeout(this.$timer))};this.setPosition=function(a,b){a+10+this.width>this.maxWidth&&(a=window.innerWidth-this.width-10);if(b>.75*window.innerHeight||b+20+this.height>this.maxHeight)b=b-this.height-
30;f.prototype.setPosition.call(this,a+10,b+20)};this.destroy=function(){this.onMouseOut();k.removeListener(this.editor.renderer.scroller,"mousemove",this.onMouseMove);k.removeListener(this.editor.renderer.content,"mouseout",this.onMouseOut);delete this.editor.tokenTooltip}}).call(g.prototype);l.TokenTooltip=g});define("mode/auto_brace_insert",["require","exports","module"],function(a,l,m){var g=a("ace/range").Range,k=a("ace/mode/text").Mode;(function(){this.$complements={"(":")","[":"]",'"':'"',"{":"}"};this.$reOpen=/^[(["{]$/;this.$reClose=/^[)\]"}]$/;this.$reStop=/^[;,\s)\]}]$/;this.wrapInsert=function(a,f,d,b){if(!this.insertMatching)return f.call(a,d,b);var e=a.selection.getCursor();if(e=a.selection.isEmpty()&&d.row==e.row&&d.column==e.column){var c=g.fromPoints(d,{row:d.row,column:d.column+1}),r=a.doc.getTextRange(c);
if(this.$reClose.test(r)&&r==b){a.selection.moveCursorTo(c.end.row,c.end.column,!1);return}}c=null;e&&(c=this.$moveLeft(a.doc,d),c=a.doc.getTextRange(g.fromPoints(c,d)));f=f.call(a,d,b);e&&this.$reOpen.test(b)?(d=g.fromPoints(f,{row:f.row,column:f.column+1}),d=a.doc.getTextRange(d),(this.$reStop.test(d)||0==d.length)&&this.allowAutoInsert(a,f,this.$complements[b])&&(a.doc.insert(f,this.$complements[b]),a.selection.moveCursorTo(f.row,f.column,!1))):e&&"\n"===b&&(b=this.$moveRight(a.doc,f),b=a.doc.getTextRange(g.fromPoints(f,
b)),e=c,b=(c=a.getTokenAt(d.row,d.column-1))&&"function"===c.value?!1:"{"===e&&"}"===b||"("===e&&")"===b||"["===e&&"]"===b,b&&(d=this.getIndentForOpenBrace?this.getIndentForOpenBrace(this.$moveLeft(a.doc,d)):this.$getIndent(a.doc.getLine(f.row-1)),a.doc.insert(f,"\n"+d),a.selection.moveCursorTo(f.row,f.column,!1)));return f};this.allowAutoInsert=function(a,f,d){return null==a.renderer.$ghostText};this.smartAllowAutoInsert=function(a,f,d){return null!=a.renderer.$ghostText?!1:"'"!==d&&'"'!==d&&"`"!==
d?!0:"`"===d?(f=a.doc.getTextRange({start:{row:f.row,column:0},end:f}),f=f.replace(/\\./g,""),0!=f.match(/`/g).length%2):0==f.column?!0:(a=this.codeModel.getTokenForPos(f,!1,!0))&&"string"===a.type&&a.column===f.column-1};this.wrapRemove=function(a,f,d){var b=a.selection.getCursor(),e=a.session.getDocument();if(!this.insertMatching||"left"!=d||!a.selection.isEmpty()||a.$readOnly||0==b.column||e.getLine(b.row).length<=b.column)return f.call(a,d);var c=g.fromPoints(this.$moveLeft(e,b),b);b=g.fromPoints(b,
this.$moveRight(e,b));c=e.getTextRange(c);e=this.$reOpen.test(c)&&this.$complements[c]==e.getTextRange(b);f.call(a,d);e&&f.call(a,"right")};this.$moveLeft=function(a,f){if(0==f.row&&0==f.column)return f;var d=f.row,b=f.column;b?b--:(d--,b=a.getLine(d).length);return{row:d,column:b}};this.$moveRight=function(a,f){var d=f.row,b=f.column;a.getLine(d).length!=b?b++:(d++,b=0);return d>=a.getLength()?f:{row:d,column:b}}}).call(k.prototype);l.setInsertMatching=function(a){k.prototype.insertMatching=a}});define("mode/c_cpp",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("ace/tokenizer").Tokenizer,h=a("ace/range").Range;a("mode/r_highlight_rules");var f=a("mode/c_cpp_highlight_rules").c_cppHighlightRules,d=a("mode/c_cpp_matching_brace_outdent").CppMatchingBraceOutdent,b=a("mode/behaviour/cstyle").CStyleBehaviour,e=null;window.NodeWebkit||(e=a("mode/c_cpp_fold_mode").FoldMode);var c=a("mode/r_code_model").RCodeModel,r=a("mode/r_matching_brace_outdent").RMatchingBraceOutdent,
p=a("mode/cpp_code_model").CppCodeModel;a("mode/token_cursor");var q=a("mode/utils");a=function(a,q){this.$session=q;this.$doc=q.getDocument();this.$tokenizer=new k((new f).getRules());this.r_codeModel=new c(q,this.$tokenizer,/^r-/,/^\s*\/\*{3,}\s*([Rr])\s*$/,/^\s*\*+\//);this.$r_outdent=new r(this.r_codeModel);this.codeModel=new p(q,this.$tokenizer);this.$behaviour=new b(this.codeModel);this.$cpp_outdent=new d(this.codeModel);window.NodeWebkit||(this.foldingRules=new e);this.$tokens=this.codeModel.$tokens;
this.getLineSansComments=this.codeModel.getLineSansComments};m.inherits(a,g);(function(){this.wrapInsert=function(a,c,b,e){return this.cursorInRLanguageMode()?g.prototype.wrapInsert(a,c,b,e):c.call(a,b,e)};this.wrapRemove=function(a,c,b){return this.cursorInRLanguageMode()?g.prototype.wrapRemove(a,c,b):c.call(a,b)};this.insertChunkInfo={value:"/*** R\n\n*/\n",position:{row:1,column:0},content_position:{row:1,column:0}};this.toggleCommentLines=function(a,c,b,e){var d=!0;a=/^(\s*)\/\//;for(var n=b;n<=
e;n++)if(!a.test(c.getLine(n))){d=!1;break}if(d)for(d=new h(0,0,0,0),n=b;n<=e;n++)b=c.getLine(n).match(a),d.start.row=n,d.end.row=n,d.end.column=b[0].length,c.replace(d,b[1]);else c.indentRows(b,e,"//")};this.getLanguageMode=function(a){return q.getPrimaryState(this.$session,a.row).match(/^r-/)?"R":"C_CPP"};this.cursorInRLanguageMode=function(){return"R"===this.getLanguageMode(this.$session.getSelection().getCursor())};this.inRLanguageMode=function(a){if(!a)return null;"object"===typeof a&&a.hasOwnProperty("length")&&
0<a.length&&(a=a[0]);return a.match(/^r-/)};this.getNextLineIndent=function(a,c,b,e,d){a=q.primaryState(a);return this.inRLanguageMode(a)?this.r_codeModel.getNextLineIndent(a,c,b,e):this.codeModel.getNextLineIndent(a,c,b,e,d)};this.checkOutdent=function(a,c,b){return this.inRLanguageMode(a)?this.$r_outdent.checkOutdent(a,c,b):this.$cpp_outdent.checkOutdent(a,c,b)};this.autoOutdent=function(a,c,b){return this.inRLanguageMode(a)?this.$r_outdent.autoOutdent(a,c,b,this.r_codeModel):this.$cpp_outdent.autoOutdent(a,
c,b)};this.$transformAction=this.transformAction;this.transformAction=function(a,c,b,e,d){a=q.primaryState(a);if(!this.inRLanguageMode(a))return this.$transformAction(a,c,b,e,d)};this.$id="mode/c_cpp"}).call(a.prototype);l.Mode=a});define("mode/c_cpp_fold_mode",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/range").Range;a=a("ace/mode/folding/fold_mode").FoldMode;l=l.FoldMode=function(){};m.inherits(l,a);(function(){function a(a,e,c,d){a=a.doc.$lines;for(var b=e+d,f=a[b],n=0<d?"*/":"/*",r;null!=f;){var h=f.indexOf(n);if(-1!==h){r=0<d?new g(e,c,b,h):new g(b,f.length,e,c);break}b+=d;f=a[b]}return r}function h(a,e,c,d,p){for(var b=e+p,n=a.doc.$lines;0<=b&&b<a.getLength();){for(var f=a.getTokens(b),
r=n[b],h=0;h<f.length;h++)if(f[h].type===d)return 0<p?new g(e,c,b,0):new g(b,r.length,e,c);b+=p}}var f=/(\{|\[)[^\}\]]*$/,d=/^[^\[\{]*(\}|\])/;this.getFoldWidget=function(a,e,c){e="markbeginend"===e?"end":"";c=a.getLine(c);if(f.test(c))return"start";if(d.test(c))return e;a=c.indexOf("/*");c=c.indexOf("*/");return-1!==a&&(-1===c||a>c)?"start":-1!==c&&(-1===a||c<a)?e:""};this.getFoldWidgetRange=function(b,e,c){var r=b.getLine(c),p;if(p=r.match(f))return this.openingBracketBlock(b,p[1],c,p.index);if(p=
"markbeginend"===e&&r.match(d))return this.closingBracketBlock(b,p[1],c,p.index+p[0].length);e=b.getTokens(c);for(p=0;p<e.length;p++){var q=e[p];if("support.function.codebegin"===q.type)return h(b,c,r.length,"support.function.codeend",1);if("support.function.codeend"===q.type)return h(b,c,0,"support.function.codebegin",-1)}e=r.indexOf("/*");if(-1!==e)return a(b,c,r.length,1);e=r.indexOf("*/");if(-1!==e)return a(b,c,e,-1)}}).call(l.prototype)});define("mode/c_cpp_highlight_rules",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/lib/lang"),k=a("mode/doc_comment_highlight_rules").DocCommentHighlightRules,h=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/tex_highlight_rules").TexHighlightRules,d=a("mode/r_highlight_rules").RHighlightRules,b=a("mode/rainbow_paren_highlight_rules").RainbowParenHighlightRules;a=function(){function a(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}
var c=g.arrayToMap("alignas alignof and and_eq asm auto bitand bitor bool break case catch char char16_t char32_t class compl const constexpr const_cast continue decltype default delete do double dynamic_cast else enum explicit export extern false float for friend goto if inline int in long mutable namespace new noexcept not not_eq nullptr or or_eq private protected public register reinterpret_cast return short signed sizeof sizeof... static static_assert static_cast struct switch template this thread_local throw true try typedef typeid typeof typename union unsigned using virtual void volatile wchar_t while xor xor_eq".split(" ")),
r=g.arrayToMap(["NULL"]),p="new delete >>= <<= ->* ... << >> && || == != <= >= :: *= += -= /= ++ -- &= ^= %= -> .* ! $ & | + - * / ^ ~ = %".split(" "),q=p.map(function(c){return a(c)}).join("|");p=["->*"].concat(p).concat("< > , () [] ->".split(" ")).map(function(c){return a(c)});p=["new\\s*\\[\\]","delete\\s*\\[\\]"].concat(p);p="operator\\s*(?:"+p.join("|")+")|operator\\s+[\\w_]+(?:&&|&|\\*)?";this.$rules={start:[{token:"comment.doc.tag",regex:"\\/\\/\\s*\\[\\[.*\\]\\].*$"},{token:"comment.doc.tag",
regex:"^\\s*\\[\\[(.*)\\]\\]"},{token:"comment",regex:"\\/\\/'",next:"rdoc-start"},{token:"comment",regex:"\\/\\/.*$"},k.getStartRule("doc-start"),{token:"comment",merge:!0,regex:"\\/\\*",next:"comment"},{token:"string",regex:'(?:R|L|u8|u|U)?["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",merge:!0,regex:'(?:R|L|u8|u|U)?["].*\\\\$',next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",merge:!0,regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",
regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"0[bB][01']+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(?:(?:[fF])|(?:(?:[uU]?(?:(?:l?l?)|(?:L?L?))?)|(?:(?:(?:l?l?)|(?:L?L?))[uU]?))|(?:_\\w+))?\\b"},{token:["keyword.preproc","text","string"],regex:"(#\\s*include)(\\s*)(<[^>]*>)"},{token:"keyword.preproc",regex:"#\\s*include\\b"},{token:"keyword.preproc",regex:"(?:"+"include pragma line define defined undef ifdef ifndef if else elif endif warning error".split(" ").map(function(a){return"#\\s*"+
a+"\\b"}).join("|")+")"},{token:"variable.language",regex:"\\b__\\S+__\\b"},{token:"keyword",regex:p},{token:function(a){return"this"==a?"variable.language":c.hasOwnProperty(a)?"keyword":r.hasOwnProperty(a)?"constant.language":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",merge:!1,regex:q},{token:"keyword.punctuation.operator",merge:!1,regex:"\\?|\\:|\\,|\\;|\\.|\\\\"},b.getParenRule(),{token:"paren.keyword.operator",merge:!1,regex:"[<>]"},{token:"text",regex:"\\s+"}],
comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",merge:!0,regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",merge:!0,regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",merge:!0,regex:".+"}]};q=(new f("comment")).getRules();for(p=0;p<q.start.length;p++)q.start[p].token+=".virtual-comment";this.addRules(q,"rdoc-");this.$rules["rdoc-start"].unshift({token:"text",regex:"^",
next:"start"});this.$rules["rdoc-start"].unshift({token:"keyword",regex:"@(?!@)[^ ]*"});this.$rules["rdoc-start"].unshift({token:"comment",regex:"@@"});this.$rules["rdoc-start"].push({token:"comment",regex:"[^%\\\\[({\\])}]+"});this.embedRules(k,"doc-",[k.getEndRule("start")]);this.$rules.start.unshift({token:"support.function.codebegin",regex:"^\\s*\\/\\*{3,}\\s*[Rr]\\s*$",next:"r-start"});q=(new d).getRules();this.addRules(q,"r-");this.$rules["r-start"].unshift({token:"support.function.codeend",
regex:"\\*\\/",next:"start"})};m.inherits(a,h);l.c_cppHighlightRules=a});define("mode/c_cpp_matching_brace_outdent",["require","exports","module"],function(a,l,m){var g=a("ace/range").Range,k=a("mode/token_cursor").CppTokenCursor;m=function(a){this.codeModel=a};var h=a("mode/utils"),f=!0,d=!0,b=!0,e=!0,c=!0,r=!0,p=!0,q=!0,n=!0,w=!0,B=!0,u=!0;(function(){this.setIndent=function(a,c,b,e,d){a=a.getDocument();e="string"===typeof e?e:"";var n=a.$lines[b];b=this.$getIndent(a.$lines[c]);n=this.$getIndent(n);("function"!==typeof d||d(b,n))&&a.replace(new g(c,0,c,b.length),n+e)};
this.checkOutdent=function(a,c,b){return h.endsWith(a,"start")&&(":"===b||/^\s*[#\{\}>\]\)<.:]/.test(b)||"="===b)||h.endsWith(a,"comment")&&"/"==b?!0:!1};this.escapeRegExp=function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")};this.alignStartToken=function(a,c,b,e,d){return null===d||null===e?!1:(new RegExp("^\\s*"+this.escapeRegExp(a))).test(e)&&(a=d.indexOf(a),0<=a)?(c=c.getDocument(),e=this.$getIndent(e),a=Array(a+1).join(" "),c.replace(new g(b,0,b,e.length),a),!0):!1};this.alignEquals=
function(a,c,b,e){if(null===e||null===b)return!1;var d=b.indexOf("=");if(d!==b.lastIndexOf("="))return!1;var n=e.indexOf("=");if(-1!==d&&-1!==n&&/,\s*$/.test(e)){a=a.getDocument();b=this.$getIndent(b);if(b.length>=n)return!1;d=n-d;if(0>=d)return!1;d=Array(b.length+d+1).join(" ");a.replace(new g(c,0,c,b.length),d);return!0}return!1};this.autoOutdent=function(a,q,t){a=q.doc;var z=a.getLine(t),x=null;0<t&&(x=a.getLine(t-1));if(!w||!this.alignStartToken("<<",q,t,z,x))if(!n||!this.alignStartToken(">>",
q,t,z,x))if(!p||!this.alignStartToken(".",q,t,z,x)){if(f&&/^\s*:/.test(a.getLine(t))&&!/^\s*::/.test(a.getLine(t))&&this.codeModel.$tokenUtils.$tokenizeUpToRow(t)){var y=new k(this.codeModel.$tokens,t,0),l=-1,A=y.cloneCursor();if(")"===A.peekBwd().currentValue()||"keyword"===A.peekBwd().currentType()){do{y=A.currentType();var H=A.currentValue();if("identifier"===y||";"===H){l=A.$row;break}"keyword"!==y&&A.bwdToMatchingToken()}while(A.moveToPreviousToken())}else y.moveToPreviousToken(),y.bwdOverClassySpecifiers()&&
(l=y.$row);0<=l&&this.setIndent(q,t,l,q.getTabString(),function(a,c){return a===c})}if(r&&/^\s*>/.test(z)&&!/^\s*>>/.test(z)&&(l=this.codeModel.getRowForMatchingEOLArrows(q,a,t),0<=l)){this.setIndent(q,t,l);return}if(e&&/^\s*\}/.test(z)&&(l=q.findMatchingBracket({row:t,column:z.indexOf("}")+1}),null!==l)){if(/^\s*\{/.test(a.$lines[l.row])){this.setIndent(q,t,l.row);return}l=this.codeModel.getRowForOpenBraceIndent(q,l.row);if(0<=l){this.setIndent(q,t,l);return}}if(d&&/^\s*\)/.exec(z)&&(l=q.findMatchingBracket({row:t,
column:z.indexOf(")")+1}))){this.setIndent(q,t,l.row);return}if(c&&/^\s*\]/.exec(z)&&(l=q.findMatchingBracket({row:t,column:z.indexOf("]")+1}))){this.setIndent(q,t,l.row);return}if(B&&/^\s*public\s*:\s*$|^\s*private\s*:\s*$|^\s*protected\s*:\s*$/.test(z)&&(A=q.$findOpeningBracket("}",{row:t,column:z.length},h.getTokenTypeRegex("paren")))){l=this.codeModel.getRowForOpenBraceIndent(q,A.row);0<=l?this.setIndent(q,t,l):this.setIndent(q,t,A.row);return}if(u&&(/^\s*case.+:/.test(z)||/^\s*default\s*:/.test(z))&&
(A=q.$findOpeningBracket("}",{row:t,column:/(\S)/.exec(z).index+1},h.getTokenTypeRegex("paren")))){l=this.codeModel.getRowForOpenBraceIndent(q,A.row);0<=l?this.setIndent(q,t,l):this.setIndent(q,t,A.row);return}if(b&&/^\s*\{/.test(z)&&!/;\s*$/.test(x)){if(this.codeModel.$tokenUtils.$tokenizeUpToRow(t)&&(y=new k(this.codeModel.$tokens),y.$row=t,y.$offset=0,y.moveToPreviousToken()&&"="===y.currentValue()))return;x=this.codeModel.getRowForOpenBraceIndent(q,t);if(0<=x){this.setIndent(q,t,x);return}}/^\s*#/.test(z)&&
(q=this.$getIndent(z),a.replace(new g(t,0,t,q.length),""))}};this.$getIndent=function(a){return(a=a.match(/^(\s+)/))?a[1]:""}}).call(m.prototype);l.CppMatchingBraceOutdent=m;l.getOutdentColon=function(){return f};l.setOutdentColon=function(a){f=a};l.getOutdentRightParen=function(){return d};l.setOutdentRightParen=function(a){d=a};l.getOutdentLeftBrace=function(){return b};l.setOutdentLeftBrace=function(a){b=a};l.getOutdentRightBrace=function(){return e};l.setOutdentRightBrace=function(a){e=a};l.getOutdentRightBracket=
function(){return c};l.setOutdentRightBracket=function(a){c=a};l.getOutdentRightArrow=function(){return r};l.setOutdentRightArrow=function(a){r=a};l.getAlignDots=function(){return p};l.setAlignDots=function(a){p=a};l.getAlignEquals=function(){return q};l.setAlignEquals=function(a){q=a};l.getAlignStreamIn=function(){return n};l.setAlignStreamIn=function(a){n=a};l.getAlignStreamOut=function(){return w};l.setAlignStreamOut=function(a){w=a};l.getAlignClassAccessModifiers=function(){return B};l.setAlignClassAccessModifiers=
function(a){B=a};l.getAlignCase=function(){return u};l.setAlignCase=function(a){u=a}});define("mode/behaviour/cstyle",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/mode/behaviour").Behaviour;a("mode/cpp_code_model");a("mode/token_cursor");a("ace/mode/text");var k=a("mode/utils"),h=!0;a=function(a){var d=a.$complements,b=function(a,b,e,q){var c=d[a];if(b==a)return b=e.getSelectionRange(),q=q.doc.getTextRange(b),""!==q?{text:a+q+c,selection:!1}:{text:a+c,selection:[1,1]};if(b==c&&(a=e.getCursorPosition(),q.doc.getLine(a.row)[a.column]==c&&(">"===c||null!==
q.findMatchingBracket({row:a.row,column:a.column+1}))))return{text:"",selection:[1,1]}},e=function(a,b,e){var c=d[a],n=e.doc.getTextRange(b);if(!b.isMultiLine()&&n==a&&e.doc.getLine(b.start.row).substring(b.start.column+1,b.start.column+2)==c)return b.end.column++,b};this.add("R","insertion",function(a,b,e,d,n){if("R"===n||"r"===n)if(a=e.getCursorPosition(),d=(new String(d.doc.getLine(a.row))).match(/^(\s*)\/\*{3,}\s*/))return{text:"R\n"+d[1]+"\n"+d[1]+"*/",selection:[1,d[1].length,1,d[1].length]}});
this.add("newline","insertion",function(c,b,e,d,n){if("\n"===n){var f=e.getCursorPosition();n=f.row;var p=f.column;b=d.getTabString();var q=d.doc.$lines;e=q[n];if(!this.codeModel.inMacro(q,n-1)){var r=/^(\s*\/\/'\s*)/.exec(e);if(r&&p>=r[1].length)return{text:"\n"+r[1]};if(/^\s*[/][*]+\s*$/.test(e)&&!/^\s*[*]/.test(q[n+1]||""))return d=this.$getIndent(e),b=d+" * ",{text:"\n"+b+"\n"+d+" */",selection:[1,b.length,1,b.length]};if(k.endsWith(c,"comment")||k.endsWith(c,"doc-start")){f&&f.row==n&&(e=e.substring(0,
f.column));if(c=/^(\s*)(\/\*)/.exec(e))return{text:"\n"+c[1]+" * "};if(c=/^(\s*\*+\s*)/.exec(e))return{text:"\n"+c[1],selection:[1,c[1].length,1,c[1].length]}}for(c=p-1;/\s/.test(e[c]);)--c;c=e[c];p=e[p];if(r=e.match(/\s*namespace\s*\w*\s*{/))return d=this.$getIndent(e),{text:"\n"+d,selection:[1,d.length,1,d.length]};if("("==c&&")"==p||"["==c&&"]"==p)return e=this.$getIndent(e),d=e+b,{text:"\n"+d+"\n"+e,selection:[1,d.length,1,d.length]};if("{"==c&&"}"==p){if(/^\s*{/.test(e))return e=this.$getIndent(e),
d=e+d.getTabString(),{text:"\n"+d+"\n"+e,selection:[1,d.length,1,d.length]};n=a.getRowForOpenBraceIndent(d,n);if(null!==n&&0<=n)return e=this.$getIndent(d.getDocument().getLine(n)),d=e+d.getTabString(),{text:"\n"+d+"\n"+e,selection:[1,d.length,1,d.length]};e=this.$getIndent(e);d=e+b;return{text:"\n"+d+"\n"+e,selection:[1,d.length,1,d.length]}}}}});this.add("braces","insertion",function(a,e,d,f,n){if(this.insertMatching){if("{"==n&&(a=d.getSelectionRange(),""===f.doc.getTextRange(a))){a=this.codeModel.getTokenCursor();
if(!a.moveToPosition(d.getCursorPosition()))return b("{",n,d,f);do if(!a.bwdToMatchingArrow()){e=a.currentValue();if(!e||!e.length)break;if("namespace"===e)return{text:"{",selection:[1,1]};if("class"===e||"struct"===e||"="===e)return{text:"{};",selection:[1,1]};if(h&&"do"===e)return{text:"{} while ();",selection:[1,1]};if(";"===e||"["===e||"]"===e||"("===e||")"===e||"{"===e||"}"===e||"if"===e||"else"===e||"#"===e[0])return{text:"{}",selection:[1,1]}}while(a.moveToPreviousToken())}return b("{",n,d,
f)}});this.add("braces","deletion",function(a,b,e,d,n){if(this.insertMatching&&(a=d.doc.getTextRange(n),!n.isMultiLine()&&"{"==a)){a=d.doc.getLine(n.start.row);if(/^\s*do\s*\{\} while \(\);\s*$/.test(a))return n.end.column=a.length,n;d=a.substring(n.end.column,n.end.column+1);a=a.substring(n.end.column+1,n.end.column+2);if("}"==d)return n.end.column++,";"==a&&n.end.column++,n}});this.add("parens","insertion",function(a,e,d,f,n){if(this.insertMatching)return b("(",n,d,f)});this.add("parens","deletion",
function(a,b,d,f,n){if(this.insertMatching)return e("(",n,f)});this.add("brackets","insertion",function(a,e,d,f,n){if(this.insertMatching)return b("[",n,d,f)});this.add("brackets","deletion",function(a,b,d,f,n){if(this.insertMatching)return e("[",n,f)});this.add("arrows","insertion",function(a,e,d,f,n){if(this.insertMatching&&(a=f.getLine(d.getCursorPosition().row),/^\s*#\s*include/.test(a)))return b("<",n,d,f)});this.add("arrows","deletion",function(a,b,d,f,n){if(this.insertMatching)return e("<",
n,f)});this.add("string_dquotes","insertion",function(a,b,e,d,n){if(this.insertMatching&&('"'==n||"'"==n)){a=e.getSelectionRange();b=d.doc.getTextRange(a);if(""!==b)return{text:n+b+n,selection:!1};e=e.getCursorPosition();b=d.doc.getLine(e.row);if("\\"==b.substring(e.column-1,e.column))return null;d=d.getTokens(a.start.row);for(var c=0,f,p=-1,h=0;h<d.length;h++){f=d[h];"string"==f.type?p=-1:0>p&&(p=f.value.indexOf(n));if(f.value.length+c>a.start.column)break;c+=d[h].value.length}if(!f||0>p&&"comment"!==
f.type&&("string"!==f.type||a.start.column!==f.value.length+c-1&&f.value.lastIndexOf(n)===f.value.length-1))return{text:n+n,selection:[1,1]};if(f&&"string"===f.type&&b.substring(e.column,e.column+1)==n)return{text:"",selection:[1,1]}}});this.add("string_dquotes","deletion",function(a,b,e,d,n){if(this.insertMatching&&(a=d.doc.getTextRange(n),!n.isMultiLine()&&('"'==a||"'"==a)&&(d=d.doc.getLine(n.start.row).substring(n.start.column+1,n.start.column+2),'"'===d||"'"===d)))return n.end.column++,n});this.add("punctuation.operator",
"insertion",function(a,b,e,d,n){if(this.insertMatching&&";"===n&&(a=e.selection.getCursor(),";"==d.getLine(a.row)[a.column]))return{text:"",selection:[1,1]}});this.add("macro","insertion",function(a,b,e,d,n){b=e.getPrintMarginColumn();b=Math.min(62,b);var c=d.getDocument().$lines,f=e.getCursorPosition(),h=f.row,p=c[h];e=p.substring(0,f.column);if(/^\s*#\s*define[^\\]*$/.test(p)&&"\\"==n)return a=b-e.length+1,0<=a?{text:Array(a+1).join(" ")+"\\\n"+this.$getIndent(p)+d.getTabString(),selection:!1}:
{text:"\\\n"+d.getTabString(),selection:!1};if(/^\s*#\s*define/.test(p)||this.codeModel.inMacro(c,h-1)){if("\\"==n&&/^\s*$/.test(p.substring(e.length,p.length)))return a=b-e.length+1,0<=a?{text:Array(a+1).join(" ")+"\\",selection:!1}:{text:"\\",selection:!1};if("\n"==n){if(/^\s*$/.test(p)||/^\s*#\s*define/.test(p)&&!/\\\s*$/.test(p))return{text:"\n",selection:!1};if(/\\\s*$/.test(p)&&!/\\\s*$/.test(e))return{text:"",selection:[1,f.column,1,f.column]};d=d.getMode().getNextLineIndent(a,p+"\\",d.getTabString(),
h,!1);a=b-e.length+1;n=/\\\s*$/.test(e)?"":"\\";return 0<=a?{text:Array(a+1).join(" ")+n+"\n"+d,selection:!1}:{text:n+"\n"+d,selection:!1}}}})};m.inherits(a,g);l.CStyleBehaviour=a;l.setFillinDoWhile=function(a){h=a};l.getFillinDoWhile=function(){return h}});define("mode/cpp_code_model",["require","exports","module"],function(a,l,m){a("ace/lib/oop");var g=a("ace/range").Range,k=a("mode/token_utils").TokenUtils;a("ace/token_iterator");var h=a("mode/token_cursor").CppTokenCursor,f=a("mode/cpp_scope_tree").CppScopeNode,d=a("mode/cpp_scope_tree").CppScopeManager,b=a("mode/r_code_model").getVerticallyAlignFunctionArgs,e=a("mode/utils");a=function(a,b,e,h,n){this.$session=a;this.$doc=a.getDocument();this.$tokenizer=b;this.$tokens=Array(this.$doc.getLength());
this.$statePattern=e;this.$codeBeginPattern=h;this.$codeEndPattern=n;this.$tokenUtils=new k(this.$doc,this.$tokenizer,this.$tokens,this.$statePattern,this.$codeBeginPattern);this.$scopes=new d(f);var c=!0,p=function(a,b){c?c=!1:(this.$doc.off("change",g),this.$session.off("changeMode",p))}.bind(this),g=function(a){this.$onDocChange(a)}.bind(this);this.$session.on("changeMode",p);this.$doc.on("change",g)};(function(){var a=e.contains;this.getTokenCursor=function(){return new h(this.$tokens,0,0,this)};
this.$tokenizeUpToRow=function(a){this.$tokenUtils.$tokenizeUpToRow(a)};var d=function(c,b){for(;;){var e=c.currentValue(),d=b.$doc.getLine(c.$row);if(a(["{","}",";"],e))break;if(":"===e&&(e=c.peekBwd().currentValue(),a(["public","private","protected"],e)))break;if(/^\s*#/.test(d))break;if(!c.moveToPreviousToken())break}},f="if else for do while struct class try catch switch".split(" "),q=function(a){a=a.trim();return a=a.replace(/[\n\s]+/g," ")},n=function(a,c){var b=q(a),e=c;"undefined"===typeof e&&
(e=80);b.length>e&&(b=b.substring(0,e)+"...");return b};this.$complements={"<":">",">":"<","{":"}","}":"{","[":"]","]":"[","(":")",")":"(","'":"'",'"':'"'};this.alignContinuationSlashes=function(a,c){"undefined"===typeof c&&(c={start:0,end:a.getLength()});var b=a.$lines;if(!(b instanceof Array))return!1;for(var e=c.start;e<c.end;e++)if(l.test(b[e])){var d=e;for(e+=1;l.test(b[e])&&e<=c.end;)e++;for(var n=e,f=b.slice(d,n).map(function(a){return a.lastIndexOf("\\")}),h=Math.max.apply(null,f),p=0;p<n-
d;p++){var g={row:d+p,column:f[p]},q=Array(h-f[p]+1).join(" ");a.insert(g,q)}}return!0};this.allIndicesOf=function(a,c){for(var b=[],e=0;e<a.length;e++)a[e]==c&&b.push(e);return b};this.getRowForMatchingEOLArrows=function(a,c,b){a=0;for(var e,d=1;100>d;d++){e=this.getLineSansComments(c,b-d);if(/;\s*$/.test(e))break;if(/<\s*$/.test(e)&&!/<<\s*$/.test(e)){if(0===a)return b-d;a--}else/^\s*>/.test(e)&&!/^\s*>>/.test(e)&&a++}return-1};var k=/^\s*#\s*define/,l=/\\\s*$/,u=/^\s*[+\-/&^%$!<>.?|=~]|^\s*\*[^/]|^\s*\/[^\*]/,
m=/[+\-*&^%$!<>.?|=~]\s*$|\*[^/]\s*$|\/[^\*]\s*$/,E=function(a){return u.test(a)||m.test(a)};this.inMacro=function(a,c){var b=a[c];return 0>c?!1:l.test(b)?k.test(b)?!0:this.inMacro(a,c-1):!1};this.$buildScopeTreeUpToRow=function(a){a=Math.min(a+30,this.$doc.getLength()-1);this.$tokenUtils.$tokenizeUpToRow(a);var c=this.getTokenCursor();if(c.seekToNearestToken(this.$scopes.parsePos,a)){do{this.$scopes.parsePos=c.currentPosition();this.$scopes.parsePos.column+=c.currentValue().length;var b=c.currentToken().type;
if(/\bsectionhead\b/.test(b)){if(b=/^\/\/'?[-=#\s]*(.*?)\s*[-=#]+\s*$/.exec(c.currentValue()))b=""+b[1],0==b.length&&(b="(Untitled)"),50<b.length&&(b=b.substring(0,50)+"..."),this.$scopes.onSectionStart(b,c.currentPosition())}else if(/\bcodebegin\b/.test(b)){b=c.currentPosition();var e={row:b.row+1,column:0};this.$scopes.getTopLevelScopeCount();this.$scopes.onChunkStart("(R Code Chunk)","(R Code Chunk)",b,e)}else if(/\bcodeend\b/.test(b)){for(b=c.currentPosition();this.$scopes.onScopeEnd(b););b.column+=
c.currentValue().length;this.$scopes.onChunkEnd(b)}else if("{"===c.currentValue())if(b=c.cloneCursor(),e=b.currentPosition(),b.isFirstSignificantTokenOnLine()&&(e.column=0),"namespace"===b.peekBwd(2).currentValue())b.moveToPreviousToken(),e=b.currentValue(),this.$scopes.onNamespaceScopeStart("namespace "+e,b.currentPosition(),c.currentPosition(),e);else if("namespace"===b.peekBwd().currentValue())this.$scopes.onNamespaceScopeStart("anonymous namespace",e,c.currentPosition(),"<anonymous>");else if("class"===
b.peekBwd(2).currentValue()||"struct"===b.peekBwd(2).currentValue()||b.bwdOverClassInheritance()){b.moveToPreviousToken();var f=b.cloneCursor();d(f,this);f=f.peekFwd().currentPosition();e=this.$session.getTextRange(new g(f.row,f.column,e.row,e.column));e=q(e);this.$scopes.onClassScopeStart(e,b.currentPosition(),c.currentPosition(),e)}else if(b.bwdOverConstNoexceptDecltype()&&b.bwdOverInitializationList()&&b.moveBackwardOverMatchingParens()||b.moveBackwardOverMatchingParens())if("identifier"===b.peekBwd().currentType()||
"]"===b.peekBwd().currentValue()||/^operator/.test(b.peekBwd().currentValue()))if("]"===b.peekBwd().currentValue())b=b.currentPosition(),b=this.$session.getTextRange(new g(b.row,b.column,e.row,e.column-1)),b=q("lambda "+b),this.$scopes.onLambdaScopeStart(b,e,c.currentPosition());else{if(b.moveToPreviousToken()){var p="";e=b.currentValue();f="";var h=this.$scopes.getActiveScopes(b.currentPosition());null!=h&&(h=h[h.length-1],h.isClass()&&h.label==="class "+e?"~"===b.peekBwd().currentValue()&&(e="~"+
e):(p=b.cloneCursor(),d(p,this),p.moveToNextToken(),p=p.currentPosition(),h=b.currentPosition(),p=this.$session.getTextRange(new g(p.row,p.column,h.row,h.column))));var r=b.peekFwd();h=r.currentPosition();r.fwdToMatchingToken()&&("const"===r.peekFwd().currentValue()&&r.moveToNextToken(),"noexcept"===r.peekFwd().currentValue()&&r.moveToNextToken(),"noexcept"===r.currentValue()&&"("===r.peekFwd().currentValue()&&(r.moveToNextToken(),r.fwdToMatchingToken()),(r=r.peekFwd().currentPosition())&&(f=this.$session.getTextRange(new g(h.row,
h.column,r.row,r.column))));p=0<p.length?n(e.trim()+f.trim()+": "+p.trim()):n(e.trim()+f.trim());this.$scopes.onFunctionScopeStart(p,b.currentPosition(),c.currentPosition(),e.trim(),f.split(","))}}else this.$scopes.onScopeStart(e);else this.$scopes.onScopeStart(e);else"}"===c.currentValue()&&(b=c.currentPosition(),c.isLastSignificantTokenOnLine()?b.column=this.$doc.getLine(b.row).length+1:b.column++,this.$scopes.onScopeEnd(b))}while(c.moveToNextToken(a))}};this.getCurrentScope=function(a,b){b||(b=
function(a){return!0});if(!a)return"";this.$buildScopeTreeUpToRow(a.row);var c=this.$scopes.getActiveScopes(a);if(c)for(var e=c.length-1;0<=e;e--)if(b(c[e]))return c[e];return null};this.getScopeTree=function(){this.$buildScopeTreeUpToRow(this.$doc.getLength()-1);return this.$scopes.getScopeList()};this.getRowForOpenBraceIndent=function(b,c,e){if(1>=b.getDocument().$lines.length)return-1;if(this.$tokenUtils.$tokenizeUpToRow(c))try{for(var d=Array(this.$tokens.length),n=0;n<this.$tokens.length;n++)if(null!=
this.$tokens[n]&&0<this.$tokens[n].length){var p=this.$tokens[n];"\\"===p[p.length-1].value&&(d[n]=this.$tokens[n].splice(p.length-1,1)[0])}var h=this.getTokenCursor();if(e){var g=b.getSelection().getCursor();if(!h.moveToPosition(g))return 0}else for(h.$row=c,n=h.$tokens[c].length-1,n=h.$tokens[c].length-1;0<=n&&(h.$offset=n,"{"!==h.currentValue());n--);if("{"===h.peekBwd().currentValue()||";"===h.currentValue())return-1;h.bwdOverInitializationList();h.bwdOverClassInheritance();if("{"===h.currentValue()&&
!h.moveToPreviousToken()||"{"===h.currentValue())return-1;for(;"keyword"===h.currentType();){var r=h.currentValue();if(a(f,r)||0===h.$row&&0===h.$offset)return h.$row;if(!h.moveToPreviousToken())return-1}if(":"===h.currentValue()){var q=h.peekBwd().currentValue();if(a(["public","private","protected"],q))return h.moveToNextToken(),h.$row}if(":"===h.currentValue())for(;h.moveToPreviousToken();){if(h.bwdToMatchingToken())if("keyword"===h.peekBwd().currentType())continue;else break;if("identifier"===
h.currentType())break}if(")"===h.currentValue()&&!h.bwdToMatchingToken()||"("===h.currentValue()&&!h.moveToPreviousToken())return-1;"="===h.currentValue()&&h.moveToPreviousToken();return h.$row}finally{for(n=0;n<d.length;n++)"undefined"!==typeof d[n]&&this.$tokens[n].push(d[n])}return-1};this.getLineSansComments=function(a,b,c){if(0>b)return"";a=a.getLine(b);var e=/(?!\\)"/g,d=a,n;for(b=[];n=e.exec(d);)b.push(n.index);if(0<b.length&&0===b.length%2)for(e=0;e<b.length/2;e+=2)d=b[e+1],a=a.substring(0,
b[e]+1)+a.substring(d,a.length);b=a.indexOf("//");-1!=b&&(a=a.substring(0,b));l.test(a)&&(a=a.substring(0,a.lastIndexOf("\\")));c&&(a=a.replace(/\bconst\b/,"").replace(/\bnoexcept\b/,""));return a};this.findStartOfCommentBlock=function(a,b,c){for(var e=0,d=/^\s*\/+\*/;0<=b&&e<c;){if(d.test(a[b]))return b;--b;++e}return-1};this.getNextLineIndent=function(c,d,n,f,h){var p=b(),g=this.$session,r=g.getTabSize(),q=g.getDocument();"number"!==typeof f&&(f=g.getSelection().getCursor().row-1);if(-1===f)return d=
q.getLine(0),0<d.length?this.$getIndent(d):"";if(0===d.length||/^\s*#/.test(d))return this.getNextLineIndent(e.getPrimaryState(g,f-1),q.getLine(f-1),n,f-1,h);var w=this.$getIndent(d),u=this.$getUnindent(d,r),t=q.$lines;if(e.endsWith(c,"comment")||e.endsWith(c,"doc-start")){m&&m.row==f&&(d=d.substring(0,m.column));if(/^\s*$/.test(d))return this.$getIndent(t[f]);m=this.findStartOfCommentBlock(t,f,200);if(null!==m)return this.$getIndent(t[m])+" "}if(e.endsWith(c,"start")){if(k.test(d))return/\\\s*$/.test(d)?
w+n:w;if(/^\s*#\s*\S/.test(d))return w;if(this.inMacro(t,f-1)&&!l.test(d))return u;d=this.getLineSansComments(q,f);var m=g.getSelection().getCursor();m&&m.row==f&&!h&&(d=d.substring(0,m.column));c=this.getLineSansComments(q,f-1);if("string"!==typeof d)return"";if(0===d.length||/^\s*$/.test(d))return this.$getIndent(t[f]);if(/\*\/\s*$/.test(d)&&(u=this.findStartOfCommentBlock(t,f,200),0<=u))return this.$getIndent(t[u]);if(/^\s*<</.test(d)){for(d=f-1;/^\s*<</.test(t[d]);)d--;return this.$getIndent(t[d])}if(/^\s*\./.test(d)){for(d=
f-1;/^\s*\./.test(t[d]);)d--;return this.$getIndent(t[d])}if(/\bnamespace\b.*\{\s*$/.test(d)||/\bswitch\b.*\{\s*$/.test(d))return w;if(d.match(/\(\s*$/))return-1!==d.indexOf("=")||/^\s*(return\s+)?[a-zA-Z0-9_.->:]+\(\s*$/.test(d)?w+n:w+n+n;if(/^\s*(class|struct)\s*[\w]+\s*$/.test(d)||/^\s*(class|struct).*\{\s*$/.test(d)||/^\s*(class|struct)\s+.+:\s*$/.test(d))return w+n;if((u=d.match(/(^\s*(?:class|struct)\s+.*\w[^:]):[^:]\s*.+/))&&!/,\s*/.test(d)||(u=d.match(/^(\s*(class|struct).*:\s*).*,\s*$/))||
(u=d.match(/^(\s*:\s*)(\w+).*,\s*$/))||(u=d.match(/^(\s*)[:,]\s*[\w\s]*$/)))return p?Array(u[1].length+1).join(" "):w+n;if(/<\s*$/.test(d))return w+n;if(/^\s*".*"\s*$/.test(d)||/^\s*template\s*<.*>\s*$/.test(d)&&d.split(">").length==d.split("<").length)return w;if(/([\[\{\(<]).+,\s*$/.exec(d)){var B=["(","{","[","<"];for(u=0;u<B.length;u++){var y=B[u],x=this.$complements[y];y=this.allIndicesOf(d,y);if(y.length&&(x=this.allIndicesOf(d,x),x=y.length-x.length-1,!(0>x)))return t=y[x],p?(d=d.substr(t+
1).match(/([^\s])/),Array(t+d.index+2).join(" ")):w+n}}for(u=f-1;0<=u&&/^\s*$|^\s*#/.test(c);)c=this.getLineSansComments(q,u),u--;if(/^\s*__attribute__\(\(.*\)\)\s*$/.test(d)||/^\s*[\w\s]+\s*$/.test(d)&&!/(class|struct|for|while|do|if|else|try)/.test(d)||E(d)&&E(c))return this.$getIndent(d);if(this.$tokenUtils.$tokenizeUpToRow(f+2)){B=Array(this.$tokens.length);try{for(u=0;u<this.$tokens.length;u++)if(null!=this.$tokens[u]&&0<this.$tokens[u].length){var z=this.$tokens[u];"\\"===z[z.length-1].value&&
(B[u]=this.$tokens[u].splice(z.length-1,1)[0])}var v=this.getTokenCursor();h?(v.$row=f,v.$offset=this.$tokens[f].length-1):v.moveToPosition(m);for(;0>v.$offset&&0<v.$row;)v.$row--,v.$offset=v.$tokens[v.$row].length-1;for(;0<v.$row&&/^\s*#/.test(q.getLine(v.$row));)v.$row--,v.$offset=v.$tokens[v.$row].length-1;h="";var I=v.cloneCursor(),F=I.currentValue(),P=I.currentType();if("keyword"===P||a(["{",")",">",":"],F))h=n;for(;";"===v.currentValue()&&v.moveToPreviousToken(););var M=v.cloneCursor();if(p&&
v.isLastSignificantTokenOnLine()&&("keyword.operator"===v.currentType()||"punctuation.operator"===v.currentType())){var Q=v.cloneCursor();Q.$offset=0;if("keyword"===Q.currentType()){var N=d.split("(").length-d.split(")").length;if(0<N){var L=d.match(/.*?\(\s*(\S)/);if(L)return Array(L[0].length).join(" ")}}}if(","===v.currentValue()){if(p){var G=v.peekBwd();if("]"===G.currentValue()&&G.bwdToMatchingToken())return Array(G.currentPosition().column+1).join(" ");N=d.split("(").length-d.split(")").length;
if(0<N&&(L=d.match(/.*?\(\s*(\S)/)))return Array(L[0].length).join(" ")}if(/[,(]\s*$/.test(d)&&/[,(]\s*$/.test(c))return this.$getIndent(d);var C=v.cloneCursor();return C.findOpeningBracket("{",!1)&&C.bwdOverClassySpecifiers()&&"enum"===C.currentValue()?this.$getIndent(t[C.$row])+n:-1!==d.indexOf("=")?this.$getIndent(d)+n:this.$getIndent(d)}if("keyword.operator"===P&&":"!==F)return this.$getIndent(t[f])+n;for(;;){if("undefined"===typeof v.currentValue())return"undefined"!==typeof M.currentValue()?
this.$getIndent(t[M.$row])+h:h;M=v.cloneCursor();if(";"===v.currentValue()&&v.moveToNextToken()){for(f=v.$row;null!=t[f]&&/^\s*#/.test(t[f]);)++f;return this.$getIndent(t[f])+h}if(a(["for","while","do","try"],v.currentValue())&&";"!==F)return this.$getIndent(t[v.$row])+h;G=v.peekBwd();if(":"===v.currentValue()){if(a(["public","private","protected"],G.currentValue()))return this.$getIndent(t[G.$row])+n;var D=t[v.$row];if(/^\s*case/.test(D))return this.$getIndent(D)+n;if(")"===G.currentValue()&&(C=
G.cloneCursor(),C.bwdToMatchingToken())){var J=C.peekBwd(1),R=C.peekBwd(2);if(null!==J&&"identifier"===J.currentType()&&null!==R&&!/\boperator\b/.test(R.currentType()))return this.$getIndent(t[C.peekBwd().$row])+h}}if("]"===v.currentValue()&&"("===v.peekFwd().currentValue()&&(C=v.cloneCursor(),C.bwdToMatchingToken()))return this.$getIndent(t[C.$row])+h;if("("===v.currentValue()&&"for"===G.currentValue()&&";"===F)return v.peekFwd().cloneCursor(),p?Array(v.peekFwd().currentPosition().column+1).join(" "):
this.$getIndent(t[v.peekFwd().$row])+n;if(p&&"("===v.currentValue()&&!v.isLastSignificantTokenOnLine())return v.moveToNextToken(),Array(v.currentPosition().column+1+r).join(" ");if("if"===v.currentValue()||"else"===v.currentValue()||"template"===v.currentValue()&&"<"===v.peekFwd().currentValue())return this.$getIndent(t[v.$row])+h;if("{"===v.currentValue()){var S=this.getRowForOpenBraceIndent(g,v.$row);return 0<=S?(d=this.getLineSansComments(q,S),w=this.$getIndent(d),/\bnamespace\b/.test(d)?w:w+n):
this.$getIndent(t[v.$row])+n}if(0===v.$row&&0===v.$offset)return this.$getIndent(t[0])+h;if(">"===v.currentValue()&&(C=v.cloneCursor(),C.bwdToMatchingArrow()&&"template"===C.peekBwd().currentValue()))return">"===F&&(h=""),this.$getIndent(t[C.$row])+h;v.bwdToMatchingToken();if(!v.moveToPreviousToken())break;for(;0<v.$row&&/^\s*#/.test(t[v.$row]);)v.$row--,v.$offset=this.$tokens[v.$row].length-1}}finally{for(u=0;u<B.length;u++)"undefined"!==typeof B[u]&&this.$tokens[u].push(B[u])}}}return w};this.$onDocChange=
function(a){"insert"===a.action?this.$tokenUtils.$insertNewRows(a.start.row,a.end.row-a.start.row):this.$tokenUtils.$removeRows(a.start.row,a.end.row-a.start.row);this.$tokenUtils.$invalidateRow(a.start.row);this.$scopes.invalidateFrom(a.start)};this.$getIndent=function(a){return(a=/^([ \t]*)/.exec(a))?a[1]:""};this.$padIndent=function(a,b,c){b=Array(b+1).join(" ");b=a.replace("\t",b);return b>=c?a:a+Array(c-b+1).join(" ")};this.$getUnindent=function(a,b){var c=this.$getIndent(a);if(null===c||0===
c.length)return"";var d=c.indexOf("\t");if(-1!=d)return c.substring(0,d)+c.substring(d+1,c.length);for(var e=d=0;e<b&&e<c.length;e++)" "===c[e]&&d++;return c.substring(d,c.length)}}).call(a.prototype);l.CppCodeModel=a});define("mode/cpp_scope_tree",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("mode/r_scope_tree");a=g.ScopeManager;var k=g.ScopeNode,h=function(a,d,b,e,c,h){this.label=a;this.start=d;this.preamble=b||d;this.end=null;this.scopeType=e;this.scopeCategory=c;this.attributes=h||{};this.parentScope=null;this.$children=[]};m.mixin(h.prototype,k.prototype);h.CATEGORY_CLASS=1;h.CATEGORY_NAMESPACE=2;h.CATEGORY_FUNCTION=3;h.CATEGORY_LAMBDA=4;h.CATEGORY_ANON=5;(function(){this.isClass=
function(){return this.scopeType==k.TYPE_BRACE&&this.scopeCategory==h.CATEGORY_CLASS};this.isNamespace=function(){return this.scopeType==k.TYPE_BRACE&&this.scopeCategory==h.CATEGORY_NAMESPACE};this.isFunction=function(){return this.scopeType==k.TYPE_BRACE&&this.scopeCategory==h.CATEGORY_FUNCTION};this.isLambda=function(){return this.scopeType==k.TYPE_BRACE&&this.scopeCategory==h.CATEGORY_LAMBDA}}).call(h.prototype);g=function(a){this.$ScopeNodeFactory=a;this.parsePos={row:0,column:0};this.$root=new a("(Top Level)",
this.parsePos,null,k.TYPE_ROOT)};m.mixin(g.prototype,a.prototype);(function(){this.onClassScopeStart=function(a,d,b,e){a=new this.$ScopeNodeFactory(a,b,d,k.TYPE_BRACE,h.CATEGORY_CLASS,{name:e});this.$root.addNode(a);this.printScopeTree()};this.onNamespaceScopeStart=function(a,d,b,e){a=new this.$ScopeNodeFactory(a,b,d,k.TYPE_BRACE,h.CATEGORY_NAMESPACE,{name:e});this.$root.addNode(a);this.printScopeTree()};this.onFunctionScopeStart=function(a,d,b,e,c){a=new this.$ScopeNodeFactory(a,b,d,k.TYPE_BRACE,
h.CATEGORY_FUNCTION,{name:e,args:c});this.$root.addNode(a);this.printScopeTree()};this.onLambdaScopeStart=function(a,d,b,e){a=new this.$ScopeNodeFactory(a,b,d,k.TYPE_BRACE,h.CATEGORY_LAMBDA,{args:e});this.$root.addNode(a);this.printScopeTree()};this.onScopeStart=function(a){this.$root.addNode(new this.$ScopeNodeFactory(null,a,null,k.TYPE_BRACE));this.printScopeTree()};this.onScopeEnd=function(a){a=this.$root.closeScope(a,k.TYPE_BRACE);this.printScopeTree();return a}}).call(g.prototype);l.CppScopeManager=
g;l.CppScopeNode=h});define("mode/dcf",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("ace/tokenizer").Tokenizer,h=a("mode/dcf_highlight_rules").DcfHighlightRules;a=function(){this.$tokenizer=new k((new h).getRules())};m.inherits(a,g);(function(){this.getNextLineIndent=function(a,d,b){return this.$getIndent(d)}}).call(a.prototype);l.Mode=a});define("mode/dcf_highlight_rules",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){this.$rules={start:[{token:["keyword","text"],regex:"^([^:]+)(:)"},{token:"text",regex:".+"}]}};m.inherits(g,a);l.DcfHighlightRules=g});define("mode/doc_comment_highlight_rules",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"[@\\\\][\\w\\d_]+"},{token:"comment.doc",merge:!0,regex:"\\s+"},{token:"comment.doc",merge:!0,regex:"TODO"},{token:"comment.doc",merge:!0,regex:"[^@\\\\\\*]+"},{token:"comment.doc",merge:!0,regex:"."}]}};m.inherits(g,a);g.getStartRule=function(a){return{token:"comment.doc",
merge:!0,regex:"\\/\\*[\\*\\!]",next:a}};g.getEndRule=function(a){return{token:"comment.doc",merge:!0,regex:"\\*\\/",next:a}};l.DocCommentHighlightRules=g});define("util/expand_selection",["require","exports","module"],function(a,l,m){l=a("ace/editor").Editor;var g=a("ace/range").Range;a("ace/keyboard/vim");var k=a("ace/token_iterator").TokenIterator,h=a("mode/utils");(function(){function a(a,b){for(var c=a.session.getTokens(b),d=0;d<c.length;d++){var e=c[d];if(!/^\s*$/.test(e.value))return/\bcomment\b/.test(e.type)}return!1}function d(a,b){var c=a.start.row<b.start.row||a.start.row===b.start.row&&a.start.column<b.start.column,d=a.start.row===b.start.row&&
a.start.column===b.start.column,e=a.end.row>b.end.row||a.end.row===b.end.row&&a.end.column>b.end.column,n=a.end.row===b.end.row&&a.end.column===b.end.column;return c?e||n:e?c||d:!1}function b(a,b){for(var c=a.getCurrentToken(),d=a.getCurrentTokenRow();a.moveToPreviousSignificantToken();){var e=a.getCurrentToken();if(d!==a.getCurrentTokenRow()&&0!==e.type.indexOf("keyword.operator")){if(!a.moveToNextSignificantToken())return!1;break}if(r.test(c.value)&&(r.test(e.value)||h.isOpeningBracket(e.value)||
h.contains(b,e.value))){if(!a.moveToNextSignificantToken())return!1;break}a.bwdToMatchingToken();c=a.getCurrentToken();d=a.getCurrentTokenRow()}return!0}function e(a,b,c){q.push({name:a,immediate:b,execute:c})}var c=this,r=/['"\w.]/,p=!1;this.$onClearSelectionHistory=function(){return c.$clearSelectionHistory()};this.$clearSelectionHistory=function(){this.$selectionRangeHistory=null;this.off("change",this.$clearSelectionHistory)};this.$acceptSelection=function(a,b,c){null==this.$selectionRangeHistory&&
(this.$selectionRangeHistory=[]);a.setSelectionRange(b);a.getRange().isEqual(c)||this.$selectionRangeHistory.push(c);this.isRowFullyVisible(b.start.row)&&this.isRowFullyVisible(b.end.row)||this.centerSelection(a);return b};var q=[];e("string",!0,function(a,b,c,d){return(a=b.getTokenAt(d.start.row,d.start.column+1))&&/\bstring\b/.test(a.type)?new g(d.start.row,a.column+1,d.start.row,a.column+a.value.length-1):null});e("token",!0,function(a,b,c,d){return(a=b.getTokenAt(d.start.row,d.start.column+1))&&
/[\d\w]/.test(a.value)?new g(d.start.row,a.column,d.start.row,a.column+a.value.length):null});e("comment",!0,function(b,c,d,e){c=e.start.row;e=e.end.row;for(d=c;d<=e;d++)if(!a(b,d))return null;for(;a(b,c);)c--;for(;a(b,e);)e++;b=b.getSession().getLine(e-1).length;return new g(c+1,0,e-1,b)});e("includeBoundaries",!0,function(a,b,c,d){a=new k(b);c=a.moveToPosition(d.start);0===d.start.column&&(c=a.moveToPreviousToken());b=new k(b);d=b.moveToPosition(d.end,!0);if(c&&d){var e="support.function.codebegin"===
c.type&&"support.function.codeend"===d.type;e||(e=h.isOpeningBracket(c.value)&&h.getComplement(c.value)===d.value);if(e)return a=a.getCurrentTokenPosition(),c=b.getCurrentTokenPosition(),c.column+=d.value.length,g.fromPoints(a,c)}return null});e("matching",!1,function(a,b,c,d){a=new k(b);d=a.moveToPosition(d.start);if(null==d)return null;do{if(null==d)break;if(!a.bwdToMatchingToken()&&(h.isOpeningBracket(d.value)||"support.function.codebegin"===d.type)){c=a.getCurrentTokenPosition();"support.function.codebegin"===
d.type?(c.row++,c.column=0):c.column+=d.value.length;var e=a.clone();if(e.fwdToMatchingToken())return a=e.getCurrentTokenPosition(),"support.function.codebegin"===d.type&&(a.row--,a.column=b.getLine(a.row).length),g.fromPoints(c,a)}}while(d=a.stepBackward());return null});e("statement",!1,function(a,c,d,e){a=new k(c);if(!a.moveToPosition(e.start,!0))return null;c=new k(c);if(!(d=!c.moveToPosition(e.end)||!b(a,[";",",","=","<-","<<-"]))){a:{d=[";",","];for(var f=c.getCurrentToken(),n=c.getCurrentTokenRow();c.moveToNextSignificantToken();){var p=
c.getCurrentToken();if(n!==c.getCurrentTokenRow()&&0!==f.type.indexOf("keyword.operator")){if(!c.moveToPreviousSignificantToken()){d=!1;break a}break}if(r.test(f.value)||h.isClosingBracket(f.value))if(r.test(p.value)||h.isClosingBracket(p.value)||h.contains(d,p.value)){if(!c.moveToPreviousSignificantToken()){d=!1;break a}break}c.fwdToMatchingToken();f=c.getCurrentToken();n=c.getCurrentTokenRow()}d=!0}d=!d}if(d)return null;d=a.getCurrentTokenPosition();f=c.getCurrentTokenPosition();if(d.row===e.start.row&&
d.column===e.start.column&&f.row===e.end.row&&f.column<=e.end.column&&!b(a,[";",","]))return null;e=a.getCurrentTokenPosition();a=c.getCurrentTokenPosition();a.column+=c.getCurrentTokenValue().length;return g.fromPoints(e,a)});e("scope",!1,function(a,c,b,d){b=c.getMode();if(null==b.codeModel||null==b.codeModel.getCurrentScope)return null;a=[];for(d=b.codeModel.getCurrentScope(d.start);null!=d;){b=d.preamble;var e=d.end;if(null==e&&d.parentScope)for(var f=d.parentScope.$children,h=f.length-2;0<=h;h--)if(f[h].equals(d)){e=
f[h+1].preamble;break}null==e&&(e={row:c.getLength(),column:0});a.push(g.fromPoints(b,e));d=d.parentScope}return 0===a.length?null:a});e("everything",!1,function(a,c,b,d){a=c.getLength();if(0===a)return new g(0,0,0,0);c=c.getLine(a-1);return new g(0,0,a-1,c.length)});this.$expandSelection=function(){p||(c.on("change",c.$onClearSelectionHistory),p=!0);for(var a=this.getSession(),b=this.getSelection(),e=b.getRange(),f=[],g=0;g<q.length;g++){var r=q[g],k=r.execute(this,a,b,e);h.isArray(k)||(k=[k]);for(var l=
0;l<k.length;l++){var m=k[l];if(m&&r.immediate&&d(m,e))return this.$acceptSelection(b,m,e);m&&d(m,e)&&f.push({name:r.name,range:m})}}f.sort(function(a,c){a=a.range;c=c.range;var b=a.end.row-a.start.row,d=c.end.row-c.start.row;return b!==d?b>d:a.end.column-a.start.column>c.end.column-c.start.column});return this.$acceptSelection(b,f[0].range,e)};this.$shrinkSelection=function(){var a=this.$selectionRangeHistory;if(a&&a.length)return a=a.pop(),this.getSelection().setSelectionRange(a),this.isRowFullyVisible(a.start.row)&&
this.isRowFullyVisible(a.end.row)||this.centerSelection(this.getSelection()),a;p&&(c.off("change",c.$onClearSelectionHistory),p=!1);return this.getSelectionRange()}}).call(l.prototype)});define("mode/markdown",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("ace/mode/javascript").Mode,h=a("ace/mode/xml").Mode,f=a("ace/mode/html").Mode,d=a("mode/markdown_highlight_rules").MarkdownHighlightRules,b=a("mode/markdown_folding").FoldMode;a=function(){this.HighlightRules=d;this.createModeDelegates({"js-":k,"xml-":h,"html-":f});this.foldingRules=new b};m.inherits(a,g);(function(){this.type="text";this.blockComment={start:"\x3c!--",end:"--\x3e"};
this.getNextLineIndent=function(a,c,b){return this.$getIndent(c)};this.$id="mode/markdown"}).call(a.prototype);l.Mode=a});define("mode/markdown_folding",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/mode/folding/fold_mode").FoldMode,k=a("ace/range").Range;l=l.FoldMode=function(){};var h=a("mode/utils");m.inherits(l,g);(function(){this.foldingStartMarker=/^(?:[=-]+\s*$|#{1,6} |`{3})/;this.getFoldWidget=function(a,d,b){d="markbeginend"===d?"end":"";var e=a.getLine(b);return this.foldingStartMarker.test(e)?"`"==e[0]?"start"===h.getPrimaryState(a,b)?d:"start":"":""};this.getFoldWidgetRange=
function(a,d,b){function e(c){return(l=a.getTokens(c)[0])&&0===l.type.lastIndexOf(m,0)}function c(){var a=l.value[0];return"="==a?6:"-"==a?5:7-l.value.search(/[^#]/)}var f=a.getLine(b);d=f.length;var p=a.getLength(),g=b,n=b;if(f.match(this.foldingStartMarker)){if("`"==f[0]){if("start"!==h.getPrimaryState(a,b)){for(;++b<p&&!(f=a.getLine(b),"`"==f[0]&"```"==f.substring(0,3)););return new k(g,d,b,0)}for(;0<b--&&!(f=a.getLine(b),"`"==f[0]&"```"==f.substring(0,3)););return new k(b,f.length,g,0)}var l,
m="markup.heading";if(e(b)){for(n=c();++b<p&&!(e(b)&&c()>=n););n=b-(l&&-1!=["=","-"].indexOf(l.value[0])?2:1);if(n>g)for(;n>g&&/^\s*$/.test(a.getLine(n));)n--;if(n>g)return b=a.getLine(n).length,new k(g,d,n,b)}}}}).call(l.prototype)});define("mode/markdown_highlight_rules",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/lib/lang"),k=a("ace/mode/text_highlight_rules").TextHighlightRules;a("ace/mode/javascript_highlight_rules");a("ace/mode/xml_highlight_rules");a("ace/mode/html_highlight_rules");a("ace/mode/css_highlight_rules");a("ace/mode/scss_highlight_rules");a("ace/mode/sass_highlight_rules");a("ace/mode/less_highlight_rules");a("ace/mode/perl_highlight_rules");a("mode/python_highlight_rules");
a("ace/mode/ruby_highlight_rules");a("ace/mode/scala_highlight_rules");a("mode/sh_highlight_rules");a("mode/stan_highlight_rules");a("mode/sql_highlight_rules");a("mode/mermaid_highlight_rules");a("ace/mode/dot_highlight_rules");var h=function(a){return"(?:[^"+g.escapeRegExp(a)+"\\\\]|\\\\.)*"},f=!0,d=7;l.setRainbowFencedDivs=function(a){f=a};l.getRainbowFencedDivs=function(){return f};l.setNumFencedDivsColors=function(a){d=a};a=function(){var a=g.arrayToMap("title author date rtl depends autosize width height transition transition-speed font-family css class navigation incremental left right id audio video type at help-doc help-topic source console console-input execute pause".split(" ")),
e={token:["text","constant.numeric.text","constant.numeric.text","constant.numeric.text"],regex:"(^|\\s+)(_{2,3})(?![\\s_])(.*?)(?=_)(\\2)\\b"},c={token:["text","constant.language.boolean.text"],regex:"(^|\\s+)(_(?=[^\\s_]).*?_)\\b"},r={token:["constant.numeric.text","constant.numeric.text","constant.numeric.text"],regex:"([*]{2,3})(?![\\s*])(.*?)(?=[*])(\\1)"},p={token:["constant.language.boolean.text"],regex:"([*](?=[^\\s*]).*?[*])"},q={token:"text",regex:"\\^\\["+h("]")+"\\]"},n={token:"text constant text url string text".split(" "),
regex:'^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:["][^"]+["])?(\\s*))$'},k={token:["text","keyword","text","constant","text"],regex:"(\\s*\\[)("+h("]")+")(\\]\\[)("+h("]")+")(\\])"},l={token:"text keyword text markup.href string text paren.keyword.operator nospell paren.keyword.operator".split(" "),regex:"(\\s*\\[)("+h("]")+')(\\]\\()((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)(\\s*"'+h('"')+'"\\s*)?(\\))(?:(\\s*{)((?:[^\\}]+))(\\s*}))?'},m={token:["text","keyword","text"],regex:"(<)((?:https?|ftp|dict):[^'\">\\s]+|(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+)(>)"};
this.$rules={basic:[{token:"constant.language.escape",regex:/\\[\\`*_{}[\]()#+\-.!]/},{token:"text",regex:/[?]`/},{token:"support.function.inline_r_chunk",regex:"`r (?:.*?[^`])`"},{token:["support.function","support.function","support.function"],regex:"(`+)(.*?[^`])(\\1)"},q,n,k,l,m,r,e,p,c],start:[{token:"empty_line",regex:"^\\s*$",next:"allowBlock"},{token:"text",regex:/[?]`/},{token:"support.function.inline_r_chunk",regex:"`r (?:.*?[^`])`"},{token:["support.function","support.function","support.function"],
regex:"(`+)([^\\r]*?[^`])(\\1)"},{token:"markup.heading.1",regex:"^\\={3,}\\s*$",next:"fieldblock"},{token:"markup.heading.1",regex:"^={3,}(?=\\s*$)"},{token:"markup.heading.2",regex:"^\\-{3,}(?=\\s*$)"},{token:"fenced_open",regex:"^[:]{3,}\\s*.*$",onMatch:function(a,c,b,e,h){if(!f)return"keyword.operator";c=(h.fences||0)%d;if(/^[:]{3,}\s*$/.test(a))return h.fences=c+1,"fenced_div_"+c;h=/^([:]{3,})(.*)$/;return[{type:"fenced_div_"+c,value:a.replace(h,"$1")},{type:"fenced_div_text_"+c,value:a.replace(h,
"$2")}]},next:"start"},{token:function(a){return"markup.heading."+a.length},regex:/^#{1,6}/,next:"header"},{token:"string.blockquote",regex:"^\\s*>\\s*(?=[-])"},{token:"string.blockquote",regex:"^\\s*>\\s*",next:"blockquote"},q,n,k,{token:"constant.hr",regex:"^\\s*[*](?:\\s*[*]){2,}\\s*$",next:"allowBlock"},{token:"constant.hr",regex:"^\\s*[-](?:\\s*[-]){2,}\\s*$",next:"allowBlock"},{token:"constant.hr",regex:"^\\s*[_](?:\\s*[_]){2,}\\s*$",next:"allowBlock"},{token:"text",regex:"\\\\\\$"},{token:"latex.markup.list.string.begin",
regex:"\\${2}",next:"mathjaxdisplay"},{token:["latex.markup.list.string.begin","latex.support.function","latex.markup.list.string.end"],regex:"(\\$)((?:(?:\\\\.)|(?:[^\\$\\\\]))*?)(\\$)"},{token:["text","keyword","text"],regex:"(<)((?:https?|ftp|dict):[^'\">\\s]+|(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+)(>)"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])"},{token:"paren.keyword.operator",regex:"[{}]"},{token:"markup.list",regex:"-?\\@[\\w\\d-]+"},{token:"text",regex:"[^\\*_%$`\\[#<>{}\\\\@\\s!]+"},
{token:"text",regex:"\\\\"},{token:"text",regex:"^\\s*(?:[*+-]|\\d+\\.)\\s+",next:"listblock"},r,e,p,c,{token:"comment",regex:"<\\!--",next:"html-comment"},{include:"basic"}],"html-comment":[{token:"comment",regex:"--\x3e",next:"start"},{defaultToken:"comment.text"}],allowBlock:[{token:"support.function",regex:"^ {4}.+",next:"allowBlock"},{token:"empty_line",regex:"^\\s*$",next:"allowBlock"},{token:"empty",regex:"",next:"start"}],header:[{regex:"$",next:"start"},{include:"basic"},{defaultToken:"heading"}],
listblock:[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"text",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock"},{token:["latex.markup.list.string.begin","latex.support.function","latex.markup.list.string.end"],regex:"(\\$)((?:(?:\\\\.)|(?:[^\\$\\\\]))*?)(\\$)"},{include:"basic",noEscape:!0},{defaultToken:"text"}],blockquote:[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"constant.language.escape",regex:/\\[\\`*_{}[\]()#+\-.!]/},{token:"text",regex:/[?]`/},{token:"support.function.inline_r_chunk",
regex:"`r (?:.*?[^`])`"},{token:["support.function","support.function","support.function"],regex:"(`+)(.*?[^`])(\\1)"},q,n,k,l,m,r,e,p,c,{defaultToken:"string.blockquote"}],fieldblock:[{token:function(c){c=c.slice(0,-1);return a[c]?"comment.doc.tag":"text"},regex:"^[\\w-]+\\:",next:"fieldblockvalue"},{token:"text",regex:"(?=.+)",next:"start"}],fieldblockvalue:[{token:"text",regex:"$",next:"fieldblock"},{token:"text",regex:"[^{}]+"}],mathjaxdisplay:[{token:"latex.markup.list.string.end",regex:"\\${2}",
next:"start"},{token:"latex.support.function",regex:"[^\\$]+"}],mathjaxnativedisplay:[{token:"latex.markup.list.string.end",regex:"\\\\\\]",next:"start"},{token:"latex.support.function",regex:"[\\s\\S]+?"}],mathjaxnativeinline:[{token:"latex.markup.list.string.end",regex:"\\\\\\)",next:"start"},{token:"latex.support.function",regex:"[\\s\\S]+?"}]};this.$rules.start.unshift({token:"support.function",regex:"^\\s*`{3,16}(?!`)",onMatch:function(a,c,b,d,e){e.chunk=e.chunk||{};if(null!=e.chunk.state)return this.next=
c,this.token;a=/^\s*((?:`|-)+)/.exec(a);e.chunk.width=a[1].length;e.chunk.state=c;this.next="github-block-"+e.chunk.width;return this.token}});e=[{token:"support.function",regex:"^\\s*`{3,16}(?!`)",onMatch:function(a,c,b,d,e){a=/^\s*((?:`|-)+)/.exec(a)[1].length;if(e.chunk.width!==a)return this.next=c,this.token;this.next=e.chunk.state||"start";delete e.chunk;return this.token}},{token:"support.function",regex:".+"}];for(c=3;16>=c;c++)this.$rules["github-block-"+c]=e;this.normalizeRules()};m.inherits(a,
k);l.MarkdownHighlightRules=a});define("mode/mermaid",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("ace/tokenizer").Tokenizer,h=a("mode/mermaid_highlight_rules").MermaidHighlightRules;a=function(){this.$highlightRules=new h;this.$tokenizer=new k(this.$highlightRules.getRules())};m.inherits(a,g);(function(){this.getNextLineIndent=function(a,d,b){return this.$getIndent(d)}}).call(a.prototype);l.Mode=a});define("mode/mermaid_highlight_rules",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){this.createKeywordMapper({keyword:"sequenceDiagram|participant|graph|subgraph|loop|alt|is|opt|else|end|style|linkStyle|classDef|class"},"identifier",!1);this.$rules={start:[{token:"comment",regex:"%%.*$"},{token:"keyword",merge:!1,regex:"^\\s*graph\\s+(?:TB|BT|RL|LR|TD)\\s*$"},{token:"keyword",merge:!1,regex:"^\\s*(?:sequenceDiagram|participant|subgraph|loop|alt(?:\\s+is)?|opt|else(?:\\s+is)?|end|style|linkStyle|classDef|class)"},
{token:"keyword.operator",merge:!1,regex:">|\\->|\\-\\->|\\-\\-\\-|\\-\\-|\\-\\.\\->|\\-\\.|\\.\\->|==>|==|\\->>|\\-\\->>|\\-x|\\-\\-x"},{token:"paren.keyword.operator",merge:!1,regex:"[[({\\|]"},{token:"paren.keyword.operator",merge:!1,regex:"[\\])}]"},{token:"markup.list",merge:!1,regex:"Note\\s+(?:left|right)\\s+of"},{token:"markup.list",merge:!1,regex:"<br/>"},{token:"text",regex:"\\s+",merge:!0}]}};m.inherits(g,a);l.MermaidHighlightRules=g});define("mode/python",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("mode/python_highlight_rules").PythonHighlightRules,h=a("ace/mode/folding/pythonic").FoldMode,f=a("ace/range").Range;a=function(){this.HighlightRules=k;this.foldingRules=new h("\\:")};m.inherits(a,g);(function(){this.lineCommentStart="#";this.getLanguageMode=function(a){return"Python"};this.getNextLineIndent=function(a,b,e,c){a=this.$getIndent(b);if(/^\s*[#]/.test(b))return a;/[{([:]\s*(?:$|[#])/.test(b)&&
(a+=e);/^\s*(?:break|continue|pass|raise|return)\b/.test(b)&&(a=a.substring(0,a.length-e.length));return a};this.$performOutdent=function(a,b,e){var c=a.doc.$lines[e];e=this.$getIndent(a.doc.$lines[b]);c=this.$getIndent(c);c.length<e.length&&(b=new f(b,0,b,e.length),a.replace(b,c));return!0};this.$autoOutdentElse=function(a,b,e){a=b.doc.$lines[e].substring(0,b.selection.cursor.column);if(!/^\s*(?:else|elif)(?:\s|[:])/.test(a))return!1;for(a=e-1;0<=a;a--)if(/^\s*(?:if|elif|for|try)(?:\s|[:])/.test(b.doc.$lines[a]))return this.$performOutdent(b,
e,a)};this.$autoOutdentExceptFinally=function(a,b,e){a=b.doc.$lines[e].substring(0,b.selection.cursor.column);if(!/^\s*(?:except|finally)(?:\s|[:])/.test(a))return!1;for(a=e-1;0<=a;a--)if(/^\s*(?:try)(?:\s|[:])/.test(b.doc.$lines[a]))return this.$performOutdent(b,e,a)};this.checkOutdent=function(a,b,e){this.$lastInput=e;return":"===e||" "===e};this.$canAutoOutdent=function(a,b,e){a=b.selection.cursor;return 0===a.column?!1:":"===this.$lastInput?!0:" "===this.$lastInput?(b=b.getTokenAt(a.row,a.column-
1)||{},/\bkeyword\b/.test(b.type)):!1};this.autoOutdent=function(a,b,e){this.$canAutoOutdent(a,b,e)&&(this.$autoOutdentElse(a,b,e)||this.$autoOutdentExceptFinally(a,b,e))};this.transformAction=function(a,b,e,c,f){return!1};this.$id="mode/python"}).call(a.prototype);l.Mode=a});define("mode/python_highlight_rules",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/mode/text_highlight_rules").TextHighlightRules,k=a("mode/rainbow_paren_highlight_rules").RainbowParenHighlightRules,h=a("mode/utils");a=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"#\\s*[|].*$",next:"start"},{token:"comment",regex:"#.*$"},{token:"constant.language",regex:"@[a-zA-Z_][a-zA-Z0-9._]*\\b"},{token:"string",regex:'(?:b|B|br|Br|bR|BR|rb|rB|Rb|RB|r|u|R|U|f|F|fr|Fr|fR|FR|rf|rF|Rf|RF)?"{3}',
next:"qqstring3"},{token:"string",regex:'(?:b|B|br|Br|bR|BR|rb|rB|Rb|RB|r|u|R|U|f|F|fr|Fr|fR|FR|rf|rF|Rf|RF)?"(?=.)',next:"qqstring"},{token:"string",regex:"(?:b|B|br|Br|bR|BR|rb|rB|Rb|RB|r|u|R|U|f|F|fr|Fr|fR|FR|rf|rF|Rf|RF)?'{3}",next:"qstring3"},{token:"string",regex:"(?:b|B|br|Br|bR|BR|rb|rB|Rb|RB|r|u|R|U|f|F|fr|Fr|fR|FR|rf|rF|Rf|RF)?'(?=.)",next:"qstring"},{token:"constant.numeric",regex:"(?:(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))|\\d+)[jJ]\\b"},
{token:"constant.numeric",regex:"(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))"},{token:"constant.numeric",regex:"(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))[lL]\\b"},{token:"constant.numeric",regex:"(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))\\b"},{token:this.createKeywordMapper({"invalid.deprecated":"debugger","support.function":"abs|all|any|ascii|basestring|bin|bool|breakpoint|bytearray|bytes|callable|chr|classmethod|cmp|compile|complex|delattr|dict|dir|divmod|eumerate|eval|execfile|exec|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|print|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip|__import__",
"constant.language":"NotImplemented|Ellipsis|__debug__",keyword:"False|None|True|and|as|assert|async|await|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield"},"identifier"),regex:"[a-zA-Z_][a-zA-Z0-9_]*\\b"},{token:"keyword.operator",regex:"//=|\\*\\*=|>>=|<<=|//|\\*\\*|==|!=|>=|<=|:=|>>|<<|\\+=|-=|\\*=|/=|&=|%=|\\|=|\\^=|\\+|-|\\*|/|%|>|<|\\^|~|\\||&|=|:|\\.|;|,",merge:!1},k.getParenRule(),{token:"text",
regex:"\\s+"}],qqstring3:[{token:"constant.language.escape",regex:"\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"},{token:"string",regex:'"{3}',next:"start"},{defaultToken:"string"}],qstring3:[{token:"constant.language.escape",regex:"\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"},{token:"string",regex:"'{3}",next:"start"},{defaultToken:"string"}],qqstring:[{token:"constant.language.escape",regex:"\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"},
{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:"\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"start"},{defaultToken:"string"}]};h.embedQuartoHighlightRules(this);this.normalizeRules()};m.inherits(a,g);l.PythonHighlightRules=a});define("mode/r",["require","exports","module"],function(a,l,m){a("ace/editor");a("ace/edit_session");a("ace/range");m=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("ace/tokenizer").Tokenizer,h=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/r_highlight_rules").RHighlightRules,d=a("mode/r_code_model").RCodeModel,b=a("mode/r_matching_brace_outdent").RMatchingBraceOutdent;a("mode/auto_brace_insert");var e=a("ace/unicode");a=function(a,e){this.$tokenizer=a?new k((new h).getRules()):
new k((new f).getRules());this.foldingRules=this.codeModel=new d(e,this.$tokenizer);this.$outdent=new b(this.codeModel)};m.inherits(a,g);(function(){this.getLanguageMode=function(a){return"R"};this.checkOutdent=function(a,b,e){return this.$outdent.checkOutdent(a,b,e)};this.autoOutdent=function(a,b,e){return this.$outdent.autoOutdent(a,b,e)};this.tokenRe=new RegExp("^["+e.wordChars+"._]+","g");this.nonTokenRe=new RegExp("^(?:[^"+e.wordChars+"._]|\\s)+","g");this.$complements={"(":")","[":"]",'"':'"',
"'":"'","{":"}","`":"`"};this.$reOpen=/^[{(\["'`]$/;this.$reClose=/^[})\]"'`]$/;this.getNextLineIndent=function(a,b,e,d){return this.codeModel.getNextLineIndent(a,b,e,d)};this.allowAutoInsert=this.smartAllowAutoInsert;this.getIndentForOpenBrace=function(a){return this.codeModel.getIndentForOpenBrace(a)};this.$getIndent=function(a){return(a=a.match(/^(\s+)/))?a[1]:""};this.$id="mode/r"}).call(a.prototype);l.Mode=a});define("mode/r_code_model",["require","exports","module"],function(a,l,m){function g(a,c){for(var b=0;b<c.length;b++)if(a===c[b])return!0;return!1}function k(a){return"if"===a||"for"===a||"while"===a||"repeat"===a||"function"===a}var h=a("ace/range").Range,f=a("ace/token_iterator").TokenIterator,d=a("mode/token_cursor").RTokenCursor,b=a("mode/utils"),e=!1,c=a("mode/r_scope_tree").ScopeManager,r=a("mode/r_scope_tree").ScopeNode;a=function(a,b,e,d,f){this.$session=a;this.$doc=a.getDocument();this.$tokenizer=
b;this.$tokens=Array(this.$doc.getLength());this.$endStates=Array(this.$doc.getLength());this.$contexts=Array(this.$doc.getLength());this.$statePattern=e;this.$codeBeginPattern=d;this.$codeEndPattern=f;this.$scopes=new c(r);var h=!0,n=function(a,c){h?h=!1:(this.$doc.off("change",p),this.$session.off("changeMode",n))}.bind(this),p=function(a){this.$onDocChange(a)}.bind(this);this.$session.on("changeMode",n);this.$doc.on("change",p)};(function(){function a(a){return"keyword"==a.type&&("function"==a.value||
"\\"==a.value)}function c(a){return/\boperator\b/.test(a.type)&&/^(=|<-|<<-)$/.test(a.value)}function n(a){return/\bidentifier\b/.test(a.type)}function r(a){for(;a.findOpeningBracket("(")&&a.moveToPreviousToken();)if(g(a.currentValue(),["if","for","while"]))return!0;return!1}function l(b){var e=b.cloneCursor();if(!(a(e.currentToken())&&e.moveToPreviousToken()&&c(e.currentToken())&&e.moveToPreviousToken()))return!1;b.$row=e.$row;b.$offset=e.$offset;return!0}function m(a){return/\binfix\b/.test(a.type)||
"|>"===a.value}function y(a){return"keyword.operator"===a||"keyword.operator.infix"===a}var E=b.contains;this.getTokenCursor=function(){return new d(this.$tokens,0,0,this)};this.$complements={"(":")",")":"(","[":"]","]":"[","{":"}","}":"{"};var t=function(a){a=a.trim();return a=a.replace(/[\n\s]+/g," ")};this.getFunctionsInScope=function(a){this.$buildScopeTreeUpToRow(a.row);return this.$scopes.getFunctionsInScope(a)};this.getAllFunctionScopes=function(a){"undefined"===typeof a&&(a=this.$doc.getLength());
this.$buildScopeTreeUpToRow(a);return this.$scopes.getAllFunctionScopes()};this.getDataFromInfixChain=function(a){var c=this.moveToDataObjectFromInfixChain(a),b=[],e=[],d="",f=!1;!1!==c&&(c.excludeArgsFromObject&&(f=c.excludeArgsFromObject),b=a.cloneCursor(),b.findStartOfEvaluationContext(),d=this.$doc.getTextRange(new h(b.currentPosition().row,b.currentPosition().column,a.currentPosition().row,a.currentPosition().column+a.currentValue().length)),b=c.additionalArgs,e=c.excludeArgs,1==c.cancel&&(f=
!0,b=[],e=[]));return{name:d,additionalArgs:b,excludeArgs:e,excludeArgsFromObject:f}};var z="mutate summarise summarize rename transmute select rename_vars inner_join left_join right_join semi_join anti_join outer_join full_join".split(" "),x=function(a){var c=/^([`'"])(.*)\1$/.exec(a);return null!=c?c[2].replace(new RegExp("\\\\"+c[1]),c[1]):a},I=function(a,c,b,e){if(!a.moveToNextToken()||"("!==a.currentValue()||!a.moveToNextToken()||")"===a.currentValue())return!1;if(a.hasType("identifier")){var d=
x(a.currentValue());c.additionalArgs.push(d)}if("rename"===e){if(!a.moveToNextToken())return!1;if("="===a.currentValue()){if(!a.moveToNextToken())return!1;d=x(a.currentValue());c.excludeArgs.push(d)}}"select"===e&&(c.excludeArgsFromObject=!0);do{if(")"===a.currentValue())break;if(a.$row>b.$row||a.$row===b.$row&&a.$offset>=b.$offset)break;if(!a.fwdToMatchingToken()&&","===a.currentValue()){if(!a.moveToNextToken())return!1;a.hasType("identifier")&&(d=x(a.currentValue()),c.additionalArgs.push(d));if(!a.moveToNextToken())return!1;
if("="===a.currentValue()){if(g(e,["rename","rename_vars"])){if(!a.moveToNextToken())return!1;a.hasType("identifier")&&(d=x(a.currentValue()),c.excludeArgs.push(d))}}else if(!a.moveToPreviousToken())return!1}}while(a.moveToNextToken());return!0};this.moveToDataObjectFromInfixChain=function(a){var c=a.cloneCursor(),b;a:{for(b=c.cloneCursor();b.findOpeningBracket("(",!1)&&b.moveToPreviousToken()&&b.moveToPreviousToken();){if("::"===b.currentValue()||":::"===b.currentValue()){if(!b.moveToPreviousToken())break;
if(!n(b.currentToken())||!b.moveToPreviousToken())break}if(m(b.currentToken())){c.$row=b.$row;c.$offset=b.$offset;b=!0;break a}}b=!1}if(!b&&(n(c.currentToken())&&!c.moveToPreviousToken()||"$"!==c.currentValue()||!c.moveToPreviousToken()||"_"!==c.currentValue()||!c.moveToPreviousToken()||"|>"===!c.currentValue()))return!1;for(b={additionalArgs:[],excludeArgs:[],cancel:!1};;){if(0===c.$row&&0===c.$offset)return a.$row=0,a.$offset=0,b;c.moveBackwardOverMatchingParens();if(!c.moveToPreviousToken())return!1;
var e=c.currentValue();"pull"===e&&(b.cancel=!0);E(z,e)&&I(c.cloneCursor(),b,a,e);if(!c.moveToPreviousToken())return a.$row=c.$row,a.$offset=c.$offset,b;if("::"===c.currentValue()||":::"===c.currentValue())if(!c.moveToPreviousToken()||!c.moveToPreviousToken())return!1;if(!m(c.currentToken()))break}if(!c.moveToNextToken())return!1;a.$row=c.$row;a.$offset=c.$offset;return b};var F=function(a){var c=a.cloneCursor();if(!c.findOpeningBracket(["(","["],!0)||!c.moveToPreviousToken())return!1;a.$row=c.$row;
a.$offset=c.$offset;return!0};this.getVariablesInScope=function(b){var e=this.getTokenCursor();if(!e.moveToPosition(b))return[];for(;F(e);){if(a(e.currentToken()))b=l(e);else{b=e;var d=b.cloneCursor();n(d.currentToken())&&d.moveToPreviousToken()&&c(d.currentToken())&&d.moveToPreviousToken()?(b.$row=d.$row,b.$offset=d.$offset,b=!0):b=!1}b&&e.findStartOfEvaluationContext()}b={};do if(!e.bwdToMatchingToken()){d=b;var f=e.cloneCursor();if("for"===f.currentValue()&&f.moveToNextToken()&&"("===f.currentValue()&&
f.moveToNextToken()){var h=f.currentValue();f.moveToNextToken()&&"in"===f.currentValue()&&(d[h]="variable")}c(e.currentToken())&&(d="variable",f=e.cloneCursor(),f.moveToNextToken()&&"function"===f.currentValue()&&(d="function"),f=e.cloneCursor(),f.moveToPreviousToken()&&n(f.currentToken())&&(f=f.currentValue(),b[f]=d))}while(e.moveToPreviousToken());e=[];for(var p in b)e.push({token:p,type:b[p]});e.sort();return e};this.$buildScopeTreeUpToRow=function(c){var e=this.$session.getMode().$id;c=Math.min(c+
30,this.$doc.getLength()-1);var d=this.$scopes.parsePos.row;if(d>=c)return d;d=new f(this.$session);d.tokenizeUpToRow(c);this.$tokenizeUpToRow(c);var p=this.$scopes.parsePos.row;d.moveToPosition({row:p,column:this.$scopes.parsePos.column},!0);var g=d.getCurrentToken();if(null==g)return p;d.getCurrentTokenPosition();p=this.$scopes.getChunkCount();do{if(d.$row>c)break;var r=g.value;var k=g.type;g=d.getCurrentTokenPosition();var q=b.getPrimaryState(this.$session,g.row);if("rdoc-start"===q)d.moveToEndOfRow();
else{var m=!0;this.$codeBeginPattern&&(m=/^r-/.test(q));if(b.startsWith(k,"markup.heading")){k="";m={row:g.row,column:0};var w={row:g.row+1,column:0};q=0;if(/^\s*#+\s*$/.test(r))q=r.split("#").length-1,r=this.$session.getLine(g.row),k=r.replace(/^\s*[#]+\s*/,"");else if(/^[-=]{3,}\s*$/.test(r)&&(q="="===r[0]?1:2,k=this.$session.getLine(g.row-1).trim(),m.row--,0===k.length))continue;k=(k=k.replace(/{.*}\s*$/,""))||"(Untitled)";this.$scopes.onMarkdownHead(k,m,w,q,!0)}else if(m&&/\bsectionhead\b/.test(k)){k=
"(Untitled)";if(q=/[^#=-\s]/.exec(r))k=r.substr(q.index),k=k.replace(/\s*[#=-]+\s*$/,"");r=/^\s*([#]+)\s*[^#]/.exec(r);if(null!=r)if(q=r[1].length,6<q)this.$scopes.onSectionStart(k,g);else m={row:g.row,column:0},w={row:g.row,column:Infinity},this.$scopes.onMarkdownHead(k,m,w,q,!1);else this.$scopes.onSectionStart(k,g)}else if(m||"mode/sweave"!==e||"keyword"!==k||0!==g.column||0!==r.indexOf("\\")||"\\chapter"!==r&&"\\section"!==r&&"\\subsection"!==r&&"\\subsubsection"!==r)if(/\bcodebegin\b/.test(k)&&
"---"===r){r=this.$session;k=0;q=Math.min(r.getLength(),100);for(m="Title";k++<q;){w=r.getLine(k);if(/^\s*[-]{3}\s*$/.test(w))break;w=/^\s*title:\s+(.*?)\s*$/.exec(w);if(null!==w){m=w[1];break}}r=b.stripEnclosingQuotes(m.trim());this.$scopes.onSectionStart(r,g,{isYaml:!0})}else if(/\bcodeend\b/.test(k)&&"---"===r)g.column=Infinity,this.$scopes.onSectionEnd(g);else if("mode/rmarkdown"===e&&/\bcodebegin\b/.test(k)&&0===r.trim().indexOf("/***"))this.$scopes.onSectionStart("(R Code Chunk)",g);else if("mode/rmarkdown"===
e&&/\bcodeend\b/.test(k)&&0===r.trim().indexOf("*/"))this.$scopes.onSectionEnd(g);else if(/\bcodebegin\b/.test(k)){p++;k={row:g.row+1,column:0};q=p;a:{m=this.$session;var u=this.$codeBeginPattern;w=d;if("undefined"===typeof u)m="";else{var A=u.exec(r);if(A&&(u=A[1],u=u.split(","),0<u.length)){A=u[0];if(!/=/.test(A)&&(A=A.replace(/(^\s+)|(\s+$)/g,""),A.length)){m=A;break a}for(var B=0;B<u.length;B++)if(A=/^\s*label\s*=\s*(.*)$/.exec(u[B])){m=b.stripEnclosingQuotes(A[1].trim());break a}}w=w.clone();
for(u=w.moveToNextToken();null!=u&&u.type.startsWith("comment");){u=m.getLine(w.$row);A=/^#\|\s*label\s*:\s*(.*)$/;if(A.test(u)){m=u.replace(A,"$1");break a}u=w.moveToStartOfNextRowWithTokens()}m=null}}q="Chunk "+q;m&&"YAML Header"!==r&&(q+=": "+m);this.$scopes.onChunkStart(m,q,g,k)}else if(/\bcodeend\b/.test(k))g.column+=r.length,this.$scopes.onChunkEnd(g);else if(m&&"{"===r)if(r=this.getTokenCursor(),r.moveToPosition(g,!0),g=r.cloneCursor(),k=g,q=k.cloneCursor(),"{"===q.currentValue()&&q.moveBackwardOverMatchingParens()&&
q.moveToPreviousToken()&&a(q.currentToken())?(k.$row=q.$row,k.$offset=q.$offset,k=!0):k=!1,k){m=g.cloneCursor();m.moveToNextToken();k=null;l(g)&&(q=g.cloneCursor(),w=g.cloneCursor(),w.findStartOfEvaluationContext()&&(k=w.currentPosition(),w=q.currentPosition(),k.row!==w.row?(k.row=w.row,k.column=0,g.$row=k.row,g.$offset=0):g.moveToPosition(k,!0),k=this.$doc.getTextRange(new h(k.row,k.column,w.row,w.column+q.currentValue().length))));q=g.currentPosition();g.isFirstSignificantTokenOnLine()&&(q.column=
0);g=m;if(a(g.currentToken())&&!g.moveToNextToken()||"("===g.currentValue()&&!g.moveToNextToken()||")"===g.currentValue())g=[];else{m=[];for(n(g.currentToken())&&m.push(g.currentValue());g.moveToNextToken();)if(!g.fwdToMatchingToken()){if(")"===g.currentValue())break;if(","===g.currentValue()){for(;","===g.currentValue()&&g.moveToNextToken(););n(g.currentToken())&&m.push(g.currentValue())}}g=m}m="("+g.join(", ")+")";m=null==k?t("<function>"+m):t(k+m);this.$scopes.onFunctionScopeStart(m,q,r.currentPosition(),
k,g)}else k=g.cloneCursor(),"{"===k.currentValue()&&k.moveToPreviousToken()&&","!=!k.currentToken().value&&k.moveToPreviousToken()&&"string"!=!k.currentToken().type&&k.moveToPreviousToken()&&"("!=!k.currentToken().value&&k.moveToPreviousToken()?(k=k.currentToken(),k=n(k)&&"test_that"==k.value):k=!1,k?(k=g.cloneCursor(),k.moveToPreviousToken(),k.moveToPreviousToken(),g=k.currentToken().value,k=k.cloneCursor(),k.moveToPreviousToken(),k.moveToPreviousToken(),this.$scopes.onTestScopeStart(g,k.currentPosition(),
r.currentPosition())):(q=r.currentPosition(),r.isFirstSignificantTokenOnLine()&&(q.column=0),this.$scopes.onScopeStart(q));else m&&"}"===r&&(g.column+=1,this.$scopes.onScopeEnd(g));else q=1,"\\chapter"===r?q=2:"\\section"===r?q=3:"\\subsection"===r?q=4:"\\subsubsection"===r&&(q=5),r=this.$doc.getLine(g.row),r=/{([^}]*)}/.exec(r),k="",null!=r&&(k=r[1]),m={row:g.row,column:0},w={row:g.row,column:Infinity},this.$scopes.onMarkdownHead(k,m,w,q,!0)}}while(g=d.moveToNextToken());c=Math.max(c,d.$row);this.$scopes.parsePos=
{row:c,column:-1};return c};this.$getFoldToken=function(a,c,b){this.$tokenizeUpToRow(b);if(this.$statePattern&&!this.$statePattern.test(this.$endStates[b]))return"";a=this.$tokens[b];for(b=0;b<a.length;b++)if(/\bsectionhead\b/.test(a[b].type))return a[b];var e=0,d=null,f=null;for(b=0;b<a.length;b++){var h=a[b];if(/\bparen\b/.test(h.type))switch(h.value){case "{":e++;1==e&&(d=h);break;case "}":e--,0==e&&(d=null),0>e&&(f=h,e=0)}}return d?d:"markbeginend"==c&&f?f:1<=a.length&&(/\bcodebegin\b/.test(a[0].type)||
/\bcodeend\b/.test(a[0].type))?a[0]:null};this.getFoldWidget=function(a,c,b){a=this.$getFoldToken(a,c,b);return null==a?"":"{"==a.value?"start":"}"==a.value?"end":/\bcodebegin\b/.test(a.type)?"start":/\bcodeend\b/.test(a.type)?"end":/\bsectionhead\b/.test(a.type)?"start":""};this.getFoldWidgetRange=function(a,c,e){var d=this.$getFoldToken(a,c,e);if(d){c={row:e,column:d.column+1};if("{"==d.value)return(a=a.$findClosingBracket(d.value,c,b.getTokenTypeRegex("paren")))?h.fromPoints(c,a):void 0;if("}"==
d.value)return(a=a.$findOpeningBracket(d.value,c,b.getTokenTypeRegex("paren")))?h.fromPoints({row:a.row,column:a.column+1},{row:c.row,column:c.column-1}):void 0;if(/\bcodebegin\b/.test(d.type)){c=new f(a,e,0);for(var g;g=c.stepForward();)if(/\bcode(begin|end)\b/.test(g.type))return g=/\bcodebegin\b/.test(g.type),c=c.getCurrentTokenRow(),a=g?{row:c-1,column:a.getLine(c-1).length}:{row:c,column:a.getLine(c).length},h.fromPoints({row:e,column:d.column+d.value.length},a)}else if(/\bcodeend\b/.test(d.type))for(c=
new f(a,e,0);d=c.stepBackward();){if(/\bcodebegin\b/.test(d.type))return c=c.getCurrentTokenRow(),h.fromPoints({row:c,column:a.getLine(c).length},{row:e,column:a.getLine(e).length})}else if(/\bsectionhead\b/.test(d.type)){d=a.getLine(e);if(/^\s*[#=-]+\s*$/.test(d))d=d.length;else{d=/[#=-]+\s*$/.exec(d);if(!d)return;d=d.index}c.column=d;e=new f(a,e+1);for(e.$tokenIndex=-1;(token=e.stepForward())&&"}"!==token.value&&!/\bsectionhead\b/.test(token.type)&&!/\bcode(?:begin|end)/.test(token.type);)"{"===
token.value&&e.fwdToMatchingToken();e=e.getCurrentTokenRow();token&&e--;a={row:e,column:a.getLine(e).length};return h.fromPoints(c,a)}}};this.getCurrentScope=function(a,c){c||(c=function(a){return!0});if(!a)return"";this.$buildScopeTreeUpToRow(a.row);var b=this.$scopes.getActiveScopes(a);if(b)for(var e=b.length-1;0<=e;e--)if(c(b[e]))return b[e];return null};this.getScopeTree=function(){this.$buildScopeTreeUpToRow(this.$doc.getLength()-1);return this.$scopes.getScopeList()};this.findFunctionDefinitionFromUsage=
function(a,c){this.$buildScopeTreeUpToRow(this.$doc.getLength()-1);return this.$scopes.findFunctionDefinitionFromUsage(a,c)};this.getIndentForOpenBrace=function(a){if(this.$tokenizeUpToRow(a.row)){var c=this.getTokenCursor();if(c.seekToNearestToken(a,a.row)&&"{"==c.currentValue()&&c.moveBackwardOverMatchingParens())return this.$getIndent(this.$getLine(c.currentPosition().row))}return this.$getIndent(this.$getLine(a.row))};this.getIndentForRow=function(a){return this.getNextLineIndent("start",this.$getLine(a),
this.$session.getTabString(),a)};this.getNextLineIndent=function(a,d,f,h){if(b.endsWith(a,"qstring"))return this.$getIndent(d);"number"!==typeof h&&(h=this.$session.getSelection().getCursor().row-1);var n=this.$session.getTabSize();a=Array(n+1).join(" ");this.$lineOverrides=null;this.$doc.getLine(h)!==d&&(this.$lineOverrides={},this.$lineOverrides[h]=d,this.$invalidateRow(h));try{var p=0>h?"":this.$getIndent(this.$getLine(h));if(!this.$tokenizeUpToRow(h))return p;var q={row:h,column:this.$getLine(h).length},
m=this.$findPreviousSignificantToken(q,0);d=this.$session.getLine(h);if(/\bfunction\s*\(\s*$/.test(d))return this.$getIndent(h)+f+f;p="";var l=!1;if(m&&y(m.token.type))p=f,l=!0;else if(m&&/\bparen\b/.test(m.token.type)&&/\)$/.test(m.token.value)){var w=this.$walkParensBalanced(m.row,m.row-10,null,function(a,c,b){return 0===a.length});if(null!=w){var u=this.$findPreviousSignificantToken(w,0);if(u&&"keyword"===u.token.type&&/^(if|while|for|function)$/.test(u.token.value))return this.$getIndent(this.$getLine(u.row))+
f}}else if(m&&"keyword"===m.token.type&&("repeat"===m.token.value||"else"===m.token.value))return this.$getIndent(this.$getLine(m.row))+f;var t=this.getTokenCursor();if(!t.moveToPosition(q))return"";do{var A=t.currentType();if("support.function.codebegin"===A||"support.function.codeend"===A)return this.$getIndent(this.$doc.getLine(t.$row))+p;var B=t.currentValue();if(t.isAtStartOfNewExpression(!1)){if("{"===B||"["===B||"("===B)p+=f;return this.$getIndent(this.$doc.getLine(t.$row))+p}if("("===B&&t.isAtStartOfNewExpression(!0))return this.$getIndent(this.$doc.getLine(t.$row))+
f;if(!t.bwdToMatchingToken()){if("{"===B)break;if(E(["[","("],B)){var x=t.currentPosition();q=null;e&&(q=this.$findNextSignificantToken({row:x.row,column:x.column+1},h));if(q){d=this.$getLine(q.row);var z=d.replace(/[^\s].*$/,""),H=q.column-z.length,I=Math.floor(H/n);x=H-n*I;H="";for(d=0;d<I;d++)H+=f;for(f=0;f<x;f++)H+=" ";f=z+H;var K=f.replace("\t",a).length;for(d=q.row+1;d<=h;d++)if(/[^\s]/.test(this.$getLine(d))){var O=this.$endStates[d-1];if("qstring"!==O&&"qqstring"!==O){var F=this.$getLine(d).replace(/[^\s].*$/,
"");var C=F.replace("\t",a).length;C<K&&(f=F,K=C)}}return r(t)?f:f+p}return this.getIndentForOpenBrace(x)+f+p}}}while(t.moveToPreviousToken());if(!t.moveToPosition(q))return"";do if(!t.bwdToMatchingToken()){if("{"===t.currentValue())return this.getIndentForOpenBrace(t.currentPosition())+f+p;if(c(t.currentToken())){for(;c(t.currentToken())&&t.moveToPreviousToken()&&t.findStartOfEvaluationContext();){var D=t.cloneCursor();if(D.moveToPreviousToken()){if("else"===D.currentValue()||"repeat"===D.currentValue())return this.$getIndent(this.$doc.getLine(D.$row))+
p+p;if(")"===D.currentValue()&&D.bwdToMatchingToken()&&D.moveToPreviousToken()&&k(D.currentValue())){d=this.$doc.getLine(D.$row);if(!l)for(;D.moveToPreviousToken()&&")"===D.currentValue()&&D.bwdToMatchingToken()&&D.moveToPreviousToken()&&k(D.currentValue());)d=this.$doc.getLine(D.$row);return this.$getIndent(d)+p+p}}c(t.peekBwd().currentToken())&&t.moveToPreviousToken()}return this.$getIndent(this.$getLine(t.$row))+p}}while(t.moveToPreviousToken());if(l){K=0;t=this.getTokenCursor();t.moveToPosition(q);
t.moveToPreviousToken();do{if(g(t.currentValue(),["if","else"])){p+=f;break}if(t.hasType("constant","identifier")){if(!t.moveToPreviousToken())break;if(g(t.currentValue(),["if","else"])){p+=f;break}if(")"===t.currentValue()){if(!t.bwdToMatchingToken())break;if(!t.moveToPreviousToken())break;if(g(t.currentValue(),["if","else"])){p+=f;break}}if(!t.hasType("operator"))break}else if(!t.findStartOfEvaluationContext())break}while(t.moveToPreviousToken()&&20>K++)}var J=this.$findNextSignificantToken({row:0,
column:0},h);return J?this.$getIndent(this.$getLine(J.row))+p:""+p}finally{this.$lineOverrides&&(this.$lineOverrides=null,this.$invalidateRow(h))}};this.getBraceIndent=function(a){var c=this.getTokenCursor(),b={row:a,column:this.$getLine(a).length};if(!c.moveToPosition(b))return"";if(")"===c.currentValue()){if(c.bwdToMatchingToken()&&c.moveToPreviousToken()&&(b=c.currentValue(),g(b,["if","while","for","function"])))return this.$getIndent(this.$getLine(c.$row))}else if(g(c.currentValue(),["else","repeat"]))return this.$getIndent(this.$getLine(c.$row));
return this.getIndentForRow(a)};this.getTokenForPos=function(a,c,b){this.$tokenizeUpToRow(a.row);if(this.$tokens.length<=a.row)return null;for(var d=this.$tokens[a.row],e=0;e<d.length;e++){var f=d[e];if(c&&a.column==f.column)return f;if(a.column<=f.column)break;if(b&&a.column==f.column+f.value.length||a.column<f.column+f.value.length)return f}return null};this.$tokenizeUpToRow=function(a){a=Math.min(a,this.$endStates.length-1);for(var c=0,b=!0;c<=a;c++)if(!b||!this.$endStates[c]){b=!1;var e=0===c?
"start":this.$endStates[c-1],d=Object.assign({},this.$contexts[c-1]),f=this.$getLine(c);f=this.$tokenizer.getLineTokens(f,e,c,d||{});this.$contexts[c]=d;!this.$statePattern||this.$statePattern.test(f.state)||this.$statePattern.test(e)?this.$tokens[c]=this.$filterWhitespaceAndComments(f.tokens):this.$tokens[c]=[];f.state===this.$endStates[c]?b=!0:this.$endStates[c]=f.state}b||c<this.$tokens.length&&this.$invalidateRow(c);return!0};this.$onDocChange=function(a){"insert"===a.action?this.$insertNewRows(a.start.row,
a.end.row-a.start.row):this.$removeRows(a.start.row,a.end.row-a.start.row);this.$invalidateRow(a.start.row);this.$scopes.invalidateFrom(a.start)};this.$invalidateRow=function(a){this.$tokens[a]=null;this.$endStates[a]=null;this.$contexts[a]=null};this.$insertNewRows=function(a,c){for(var b=[a,0],e=0;e<c;e++)b.push(null);this.$tokens.splice.apply(this.$tokens,b);this.$endStates.splice.apply(this.$endStates,b);this.$contexts.splice.apply(this.$contexts,b)};this.$removeRows=function(a,c){this.$tokens.splice(a,
c);this.$endStates.splice(a,c);this.$contexts.splice(a,c)};this.$getIndent=function(a){return(a=/^([ \t]*)/.exec(a))?a[1]:""};this.$getLine=function(a){return this.$lineOverrides&&"undefined"!=typeof this.$lineOverrides[a]?this.$lineOverrides[a]:this.$doc.getLine(a)};this.$walkParens=function(a,c,b){var e=/\bparen\b/;return a<c?function(){for(;a<=c;a++)for(var d=this.$tokens[a],f=0;f<d.length;f++)if(e.test(d[f].type)&&!b(d[f].value,{row:a,column:d[f].column}))return!1;return!0}.call(this):function(){a=
Math.max(0,a);for(c=Math.max(0,c);a>=c;a--)for(var d=this.$tokens[a],f=d.length-1;0<=f;f--)if(e.test(d[f].type)&&!b(d[f].value,{row:a,column:d[f].column}))return!1;return!0}.call(this)};this.$walkParensBalanced=function(a,c,b,d){var e=[],f=null,h=this;this.$walkParens(a,c,function(a,c){if(b&&b(e,a,c))return f=c,!1;if(/[\[({]/.test(a))if(e[e.length-1]===h.$complements[a])e.pop();else return!0;else e.push(a);return d&&d(e,a,c)?(f=c,!1):!0});return f};this.$findNextSignificantToken=function(a,c){if(0==
this.$tokens.length)return null;c=Math.min(c,this.$tokens.length-1);for(var b=a.row,e=a.column;b<=c;b++){for(var d=this.$tokens[b],f=0;f<d.length;f++)if(d[f].column+d[f].value.length>e)return{token:d[f],row:b,column:Math.max(d[f].column,e),offset:f};e=0}return null};this.findNextSignificantToken=function(a){return this.$findNextSignificantToken(a,this.$tokens.length-1)};this.$findPreviousSignificantToken=function(a,c){if(0===this.$tokens.length)return null;c=Math.max(0,c);for(var b=Math.min(a.row,
this.$tokens.length-1);b>=c;b--){var d=this.$tokens[b];if(0!==d.length){if(b!=a.row)return{row:b,column:d[d.length-1].column,token:d[d.length-1],offset:d.length-1};for(var e=d.length-1;0<=e;e--)if(d[e].column<a.column)return{row:b,column:d[e].column,token:d[e],offset:e}}}};this.$filterWhitespaceAndComments=function(a){a=a.filter(function(a){a=/\bcode(?:begin|end)\b/.test(a.type)?!1:/\bsectionhead\b/.test(a.type)?!1:/^\s*$/.test(a.value)||a.type.match(/\b(?:ace_virtual-)?comment\b/);return!a});for(var c=
a.length-1;0<=c;c--)if(1<a[c].value.length&&/\bparen\b/.test(a[c].type)){var b=a[c];a.splice(c,1);for(var d=b.value.length-1;0<=d;d--){var e={type:b.type,value:b.value.charAt(d),column:b.column+d};a.splice(c,0,e)}}return a}}).call(a.prototype);l.RCodeModel=a;l.setVerticallyAlignFunctionArgs=function(a){e=a};l.getVerticallyAlignFunctionArgs=function(){return e}});var $jscomp$templatelit$0=["(?:\\|_|[p{L}p{Nl}.][p{L}p{Nl}p{Mn}p{Mc}p{Nd}p{Pc}.]*)"];$jscomp$templatelit$0.raw=["(?:\\\\|_|[\\p{L}\\p{Nl}.][\\p{L}\\p{Nl}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}.]*)"];var $colorFunctionCalls=!1;
define("mode/r_highlight_rules",["require","exports","module"],function(a,l,m){function g(a){for(var c=Array(a.length),b=0;b<a.length;b++)c[b]={include:a[b]};return c}var k=a("mode/utils");m=a("ace/lib/oop");var h=a("ace/lib/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules,d=a("mode/rainbow_paren_highlight_rules").RainbowParenHighlightRules;k=a("mode/utils");var b=function(){this.$rules={start:[{token:"comment",regex:"@@",merge:!1},{token:"keyword",regex:"\\\\[a-zA-Z0-9]+",merge:!1},
{token:["keyword","comment"],regex:"(@(?:export|field|inheritParams|name|param|rdname|slot|template|useDynLib))(\\s+)(?=[a-zA-Z0-9._-])",merge:!1,next:"rdoc-highlight"},{token:"keyword",regex:"@(?!@)[^ ]*",merge:!1},{token:["paren.keyword.operator","comment"],regex:"(\\[)(=)",merge:!1,next:"markdown-link"},{token:"paren.keyword.operator",regex:"\\[",merge:!1,next:"markdown-link"},{token:["support.function","support.function","support.function"],regex:"(`+)(.*?[^`])(\\1)",merge:!1},{token:["comment",
"constant.language.boolean"],regex:"(\\s+|^)(__.+?__)\\b",merge:!1},{token:["comment","constant.language.boolean"],regex:"(\\s+|^)(_(?=[^_])(?:(?:\\\\.)|(?:[^_\\\\]))*?_)\\b",merge:!1},{token:["constant.numeric"],regex:"([*][*].+?[*][*])",merge:!1},{token:["constant.numeric"],regex:"([*](?=[^*])(?:(?:\\\\.)|(?:[^*\\\\]))*?[*])",merge:!1},{token:"paren.keyword.operator",regex:"(?:[[({]|[\\])}])",merge:!1},{defaultToken:"comment"}],highlight:[{token:"identifier.support.function",regex:"[^ ,]+"},{token:"comment",
regex:","},{token:"comment",regex:"\\s*",next:"start"}],"markdown-link":[{token:"paren.keyword.operator",regex:"\\]",next:"start"},{token:["identifier.support.class","comment"],regex:"([a-zA-Z0-9_.]+)(:{1,3})"},{token:"support.function",regex:"`.*?`"},{token:"support.function",regex:"[^{}()[\\]]+"},{token:"paren.keyword.operator",regex:"(?:[[({]|[\\])}])"},{defaultToken:"comment"}]};this.normalizeRules()};m.inherits(b,f);var e=function(a,b,d){return[{type:"string",value:a},{type:"string.color",value:b,
bg:d},{type:"string",value:a}]};a=function(){var a=h.arrayToMap("\\ function if else in break next repeat for while".split(" ")),f=h.arrayToMap("return switch try tryCatch stop warning message require library attach detach source setMethod setGeneric setGroupGeneric setClass setRefClass R6Class UseMethod NextMethod".split(" ")),p=h.arrayToMap("NULL NA TRUE FALSE T F Inf NaN NA_integer_ NA_real_ NA_character_ NA_complex_".split(" ")),q=new Map([["white","ffffff"],["aliceblue","f0f8ff"],["antiquewhite",
"faebd7"],["antiquewhite1","ffefdb"],["antiquewhite2","eedfcc"],["antiquewhite3","cdc0b0"],["antiquewhite4","8b8378"],["aquamarine","7fffd4"],["aquamarine1","7fffd4"],["aquamarine2","76eec6"],["aquamarine3","66cdaa"],["aquamarine4","458b74"],["azure","f0ffff"],["azure1","f0ffff"],["azure2","e0eeee"],["azure3","c1cdcd"],["azure4","838b8b"],["beige","f5f5dc"],["bisque","ffe4c4"],["bisque1","ffe4c4"],["bisque2","eed5b7"],["bisque3","cdb79e"],["bisque4","8b7d6b"],["black","000000"],["blanchedalmond",
"ffebcd"],["blue","0000ff"],["blue1","0000ff"],["blue2","0000ee"],["blue3","0000cd"],["blue4","00008b"],["blueviolet","8a2be2"],["brown","a52a2a"],["brown1","ff4040"],["brown2","ee3b3b"],["brown3","cd3333"],["brown4","8b2323"],["burlywood","deb887"],["burlywood1","ffd39b"],["burlywood2","eec591"],["burlywood3","cdaa7d"],["burlywood4","8b7355"],["cadetblue","5f9ea0"],["cadetblue1","98f5ff"],["cadetblue2","8ee5ee"],["cadetblue3","7ac5cd"],["cadetblue4","53868b"],["chartreuse","7fff00"],["chartreuse1",
"7fff00"],["chartreuse2","76ee00"],["chartreuse3","66cd00"],["chartreuse4","458b00"],["chocolate","d2691e"],["chocolate1","ff7f24"],["chocolate2","ee7621"],["chocolate3","cd661d"],["chocolate4","8b4513"],["coral","ff7f50"],["coral1","ff7256"],["coral2","ee6a50"],["coral3","cd5b45"],["coral4","8b3e2f"],["cornflowerblue","6495ed"],["cornsilk","fff8dc"],["cornsilk1","fff8dc"],["cornsilk2","eee8cd"],["cornsilk3","cdc8b1"],["cornsilk4","8b8878"],["cyan","00ffff"],["cyan1","00ffff"],["cyan2","00eeee"],
["cyan3","00cdcd"],["cyan4","008b8b"],["darkblue","00008b"],["darkcyan","008b8b"],["darkgoldenrod","b8860b"],["darkgoldenrod1","ffb90f"],["darkgoldenrod2","eead0e"],["darkgoldenrod3","cd950c"],["darkgoldenrod4","8b6508"],["darkgray","a9a9a9"],["darkgreen","006400"],["darkgrey","a9a9a9"],["darkkhaki","bdb76b"],["darkmagenta","8b008b"],["darkolivegreen","556b2f"],["darkolivegreen1","caff70"],["darkolivegreen2","bcee68"],["darkolivegreen3","a2cd5a"],["darkolivegreen4","6e8b3d"],["darkorange","ff8c00"],
["darkorange1","ff7f00"],["darkorange2","ee7600"],["darkorange3","cd6600"],["darkorange4","8b4500"],["darkorchid","9932cc"],["darkorchid1","bf3eff"],["darkorchid2","b23aee"],["darkorchid3","9a32cd"],["darkorchid4","68228b"],["darkred","8b0000"],["darksalmon","e9967a"],["darkseagreen","8fbc8f"],["darkseagreen1","c1ffc1"],["darkseagreen2","b4eeb4"],["darkseagreen3","9bcd9b"],["darkseagreen4","698b69"],["darkslateblue","483d8b"],["darkslategray","2f4f4f"],["darkslategray1","97ffff"],["darkslategray2",
"8deeee"],["darkslategray3","79cdcd"],["darkslategray4","528b8b"],["darkslategrey","2f4f4f"],["darkturquoise","00ced1"],["darkviolet","9400d3"],["deeppink","ff1493"],["deeppink1","ff1493"],["deeppink2","ee1289"],["deeppink3","cd1076"],["deeppink4","8b0a50"],["deepskyblue","00bfff"],["deepskyblue1","00bfff"],["deepskyblue2","00b2ee"],["deepskyblue3","009acd"],["deepskyblue4","00688b"],["dimgray","696969"],["dimgrey","696969"],["dodgerblue","1e90ff"],["dodgerblue1","1e90ff"],["dodgerblue2","1c86ee"],
["dodgerblue3","1874cd"],["dodgerblue4","104e8b"],["firebrick","b22222"],["firebrick1","ff3030"],["firebrick2","ee2c2c"],["firebrick3","cd2626"],["firebrick4","8b1a1a"],["floralwhite","fffaf0"],["forestgreen","228b22"],["gainsboro","dcdcdc"],["ghostwhite","f8f8ff"],["gold","ffd700"],["gold1","ffd700"],["gold2","eec900"],["gold3","cdad00"],["gold4","8b7500"],["goldenrod","daa520"],["goldenrod1","ffc125"],["goldenrod2","eeb422"],["goldenrod3","cd9b1d"],["goldenrod4","8b6914"],["gray","bebebe"],["gray0",
"000000"],["gray1","030303"],["gray2","050505"],["gray3","080808"],["gray4","0a0a0a"],["gray5","0d0d0d"],["gray6","0f0f0f"],["gray7","121212"],["gray8","141414"],["gray9","171717"],["gray10","1a1a1a"],["gray11","1c1c1c"],["gray12","1f1f1f"],["gray13","212121"],["gray14","242424"],["gray15","262626"],["gray16","292929"],["gray17","2b2b2b"],["gray18","2e2e2e"],["gray19","303030"],["gray20","333333"],["gray21","363636"],["gray22","383838"],["gray23","3b3b3b"],["gray24","3d3d3d"],["gray25","404040"],
["gray26","424242"],["gray27","454545"],["gray28","474747"],["gray29","4a4a4a"],["gray30","4d4d4d"],["gray31","4f4f4f"],["gray32","525252"],["gray33","545454"],["gray34","575757"],["gray35","595959"],["gray36","5c5c5c"],["gray37","5e5e5e"],["gray38","616161"],["gray39","636363"],["gray40","666666"],["gray41","696969"],["gray42","6b6b6b"],["gray43","6e6e6e"],["gray44","707070"],["gray45","737373"],["gray46","757575"],["gray47","787878"],["gray48","7a7a7a"],["gray49","7d7d7d"],["gray50","7f7f7f"],["gray51",
"828282"],["gray52","858585"],["gray53","878787"],["gray54","8a8a8a"],["gray55","8c8c8c"],["gray56","8f8f8f"],["gray57","919191"],["gray58","949494"],["gray59","969696"],["gray60","999999"],["gray61","9c9c9c"],["gray62","9e9e9e"],["gray63","a1a1a1"],["gray64","a3a3a3"],["gray65","a6a6a6"],["gray66","a8a8a8"],["gray67","ababab"],["gray68","adadad"],["gray69","b0b0b0"],["gray70","b3b3b3"],["gray71","b5b5b5"],["gray72","b8b8b8"],["gray73","bababa"],["gray74","bdbdbd"],["gray75","bfbfbf"],["gray76","c2c2c2"],
["gray77","c4c4c4"],["gray78","c7c7c7"],["gray79","c9c9c9"],["gray80","cccccc"],["gray81","cfcfcf"],["gray82","d1d1d1"],["gray83","d4d4d4"],["gray84","d6d6d6"],["gray85","d9d9d9"],["gray86","dbdbdb"],["gray87","dedede"],["gray88","e0e0e0"],["gray89","e3e3e3"],["gray90","e5e5e5"],["gray91","e8e8e8"],["gray92","ebebeb"],["gray93","ededed"],["gray94","f0f0f0"],["gray95","f2f2f2"],["gray96","f5f5f5"],["gray97","f7f7f7"],["gray98","fafafa"],["gray99","fcfcfc"],["gray100","ffffff"],["green","00ff00"],["green1",
"00ff00"],["green2","00ee00"],["green3","00cd00"],["green4","008b00"],["greenyellow","adff2f"],["grey","bebebe"],["grey0","000000"],["grey1","030303"],["grey2","050505"],["grey3","080808"],["grey4","0a0a0a"],["grey5","0d0d0d"],["grey6","0f0f0f"],["grey7","121212"],["grey8","141414"],["grey9","171717"],["grey10","1a1a1a"],["grey11","1c1c1c"],["grey12","1f1f1f"],["grey13","212121"],["grey14","242424"],["grey15","262626"],["grey16","292929"],["grey17","2b2b2b"],["grey18","2e2e2e"],["grey19","303030"],
["grey20","333333"],["grey21","363636"],["grey22","383838"],["grey23","3b3b3b"],["grey24","3d3d3d"],["grey25","404040"],["grey26","424242"],["grey27","454545"],["grey28","474747"],["grey29","4a4a4a"],["grey30","4d4d4d"],["grey31","4f4f4f"],["grey32","525252"],["grey33","545454"],["grey34","575757"],["grey35","595959"],["grey36","5c5c5c"],["grey37","5e5e5e"],["grey38","616161"],["grey39","636363"],["grey40","666666"],["grey41","696969"],["grey42","6b6b6b"],["grey43","6e6e6e"],["grey44","707070"],["grey45",
"737373"],["grey46","757575"],["grey47","787878"],["grey48","7a7a7a"],["grey49","7d7d7d"],["grey50","7f7f7f"],["grey51","828282"],["grey52","858585"],["grey53","878787"],["grey54","8a8a8a"],["grey55","8c8c8c"],["grey56","8f8f8f"],["grey57","919191"],["grey58","949494"],["grey59","969696"],["grey60","999999"],["grey61","9c9c9c"],["grey62","9e9e9e"],["grey63","a1a1a1"],["grey64","a3a3a3"],["grey65","a6a6a6"],["grey66","a8a8a8"],["grey67","ababab"],["grey68","adadad"],["grey69","b0b0b0"],["grey70","b3b3b3"],
["grey71","b5b5b5"],["grey72","b8b8b8"],["grey73","bababa"],["grey74","bdbdbd"],["grey75","bfbfbf"],["grey76","c2c2c2"],["grey77","c4c4c4"],["grey78","c7c7c7"],["grey79","c9c9c9"],["grey80","cccccc"],["grey81","cfcfcf"],["grey82","d1d1d1"],["grey83","d4d4d4"],["grey84","d6d6d6"],["grey85","d9d9d9"],["grey86","dbdbdb"],["grey87","dedede"],["grey88","e0e0e0"],["grey89","e3e3e3"],["grey90","e5e5e5"],["grey91","e8e8e8"],["grey92","ebebeb"],["grey93","ededed"],["grey94","f0f0f0"],["grey95","f2f2f2"],["grey96",
"f5f5f5"],["grey97","f7f7f7"],["grey98","fafafa"],["grey99","fcfcfc"],["grey100","ffffff"],["honeydew","f0fff0"],["honeydew1","f0fff0"],["honeydew2","e0eee0"],["honeydew3","c1cdc1"],["honeydew4","838b83"],["hotpink","ff69b4"],["hotpink1","ff6eb4"],["hotpink2","ee6aa7"],["hotpink3","cd6090"],["hotpink4","8b3a62"],["indianred","cd5c5c"],["indianred1","ff6a6a"],["indianred2","ee6363"],["indianred3","cd5555"],["indianred4","8b3a3a"],["ivory","fffff0"],["ivory1","fffff0"],["ivory2","eeeee0"],["ivory3",
"cdcdc1"],["ivory4","8b8b83"],["khaki","f0e68c"],["khaki1","fff68f"],["khaki2","eee685"],["khaki3","cdc673"],["khaki4","8b864e"],["lavender","e6e6fa"],["lavenderblush","fff0f5"],["lavenderblush1","fff0f5"],["lavenderblush2","eee0e5"],["lavenderblush3","cdc1c5"],["lavenderblush4","8b8386"],["lawngreen","7cfc00"],["lemonchiffon","fffacd"],["lemonchiffon1","fffacd"],["lemonchiffon2","eee9bf"],["lemonchiffon3","cdc9a5"],["lemonchiffon4","8b8970"],["lightblue","add8e6"],["lightblue1","bfefff"],["lightblue2",
"b2dfee"],["lightblue3","9ac0cd"],["lightblue4","68838b"],["lightcoral","f08080"],["lightcyan","e0ffff"],["lightcyan1","e0ffff"],["lightcyan2","d1eeee"],["lightcyan3","b4cdcd"],["lightcyan4","7a8b8b"],["lightgoldenrod","eedd82"],["lightgoldenrod1","ffec8b"],["lightgoldenrod2","eedc82"],["lightgoldenrod3","cdbe70"],["lightgoldenrod4","8b814c"],["lightgoldenrodyellow","fafad2"],["lightgray","d3d3d3"],["lightgreen","90ee90"],["lightgrey","d3d3d3"],["lightpink","ffb6c1"],["lightpink1","ffaeb9"],["lightpink2",
"eea2ad"],["lightpink3","cd8c95"],["lightpink4","8b5f65"],["lightsalmon","ffa07a"],["lightsalmon1","ffa07a"],["lightsalmon2","ee9572"],["lightsalmon3","cd8162"],["lightsalmon4","8b5742"],["lightseagreen","20b2aa"],["lightskyblue","87cefa"],["lightskyblue1","b0e2ff"],["lightskyblue2","a4d3ee"],["lightskyblue3","8db6cd"],["lightskyblue4","607b8b"],["lightslateblue","8470ff"],["lightslategray","778899"],["lightslategrey","778899"],["lightsteelblue","b0c4de"],["lightsteelblue1","cae1ff"],["lightsteelblue2",
"bcd2ee"],["lightsteelblue3","a2b5cd"],["lightsteelblue4","6e7b8b"],["lightyellow","ffffe0"],["lightyellow1","ffffe0"],["lightyellow2","eeeed1"],["lightyellow3","cdcdb4"],["lightyellow4","8b8b7a"],["limegreen","32cd32"],["linen","faf0e6"],["magenta","ff00ff"],["magenta1","ff00ff"],["magenta2","ee00ee"],["magenta3","cd00cd"],["magenta4","8b008b"],["maroon","b03060"],["maroon1","ff34b3"],["maroon2","ee30a7"],["maroon3","cd2990"],["maroon4","8b1c62"],["mediumaquamarine","66cdaa"],["mediumblue","0000cd"],
["mediumorchid","ba55d3"],["mediumorchid1","e066ff"],["mediumorchid2","d15fee"],["mediumorchid3","b452cd"],["mediumorchid4","7a378b"],["mediumpurple","9370db"],["mediumpurple1","ab82ff"],["mediumpurple2","9f79ee"],["mediumpurple3","8968cd"],["mediumpurple4","5d478b"],["mediumseagreen","3cb371"],["mediumslateblue","7b68ee"],["mediumspringgreen","00fa9a"],["mediumturquoise","48d1cc"],["mediumvioletred","c71585"],["midnightblue","191970"],["mintcream","f5fffa"],["mistyrose","ffe4e1"],["mistyrose1","ffe4e1"],
["mistyrose2","eed5d2"],["mistyrose3","cdb7b5"],["mistyrose4","8b7d7b"],["moccasin","ffe4b5"],["navajowhite","ffdead"],["navajowhite1","ffdead"],["navajowhite2","eecfa1"],["navajowhite3","cdb38b"],["navajowhite4","8b795e"],["navy","000080"],["navyblue","000080"],["oldlace","fdf5e6"],["olivedrab","6b8e23"],["olivedrab1","c0ff3e"],["olivedrab2","b3ee3a"],["olivedrab3","9acd32"],["olivedrab4","698b22"],["orange","ffa500"],["orange1","ffa500"],["orange2","ee9a00"],["orange3","cd8500"],["orange4","8b5a00"],
["orangered","ff4500"],["orangered1","ff4500"],["orangered2","ee4000"],["orangered3","cd3700"],["orangered4","8b2500"],["orchid","da70d6"],["orchid1","ff83fa"],["orchid2","ee7ae9"],["orchid3","cd69c9"],["orchid4","8b4789"],["palegoldenrod","eee8aa"],["palegreen","98fb98"],["palegreen1","9aff9a"],["palegreen2","90ee90"],["palegreen3","7ccd7c"],["palegreen4","548b54"],["paleturquoise","afeeee"],["paleturquoise1","bbffff"],["paleturquoise2","aeeeee"],["paleturquoise3","96cdcd"],["paleturquoise4","668b8b"],
["palevioletred","db7093"],["palevioletred1","ff82ab"],["palevioletred2","ee799f"],["palevioletred3","cd6889"],["palevioletred4","8b475d"],["papayawhip","ffefd5"],["peachpuff","ffdab9"],["peachpuff1","ffdab9"],["peachpuff2","eecbad"],["peachpuff3","cdaf95"],["peachpuff4","8b7765"],["peru","cd853f"],["pink","ffc0cb"],["pink1","ffb5c5"],["pink2","eea9b8"],["pink3","cd919e"],["pink4","8b636c"],["plum","dda0dd"],["plum1","ffbbff"],["plum2","eeaeee"],["plum3","cd96cd"],["plum4","8b668b"],["powderblue",
"b0e0e6"],["purple","a020f0"],["purple1","9b30ff"],["purple2","912cee"],["purple3","7d26cd"],["purple4","551a8b"],["red","ff0000"],["red1","ff0000"],["red2","ee0000"],["red3","cd0000"],["red4","8b0000"],["rosybrown","bc8f8f"],["rosybrown1","ffc1c1"],["rosybrown2","eeb4b4"],["rosybrown3","cd9b9b"],["rosybrown4","8b6969"],["royalblue","4169e1"],["royalblue1","4876ff"],["royalblue2","436eee"],["royalblue3","3a5fcd"],["royalblue4","27408b"],["saddlebrown","8b4513"],["salmon","fa8072"],["salmon1","ff8c69"],
["salmon2","ee8262"],["salmon3","cd7054"],["salmon4","8b4c39"],["sandybrown","f4a460"],["seagreen","2e8b57"],["seagreen1","54ff9f"],["seagreen2","4eee94"],["seagreen3","43cd80"],["seagreen4","2e8b57"],["seashell","fff5ee"],["seashell1","fff5ee"],["seashell2","eee5de"],["seashell3","cdc5bf"],["seashell4","8b8682"],["sienna","a0522d"],["sienna1","ff8247"],["sienna2","ee7942"],["sienna3","cd6839"],["sienna4","8b4726"],["skyblue","87ceeb"],["skyblue1","87ceff"],["skyblue2","7ec0ee"],["skyblue3","6ca6cd"],
["skyblue4","4a708b"],["slateblue","6a5acd"],["slateblue1","836fff"],["slateblue2","7a67ee"],["slateblue3","6959cd"],["slateblue4","473c8b"],["slategray","708090"],["slategray1","c6e2ff"],["slategray2","b9d3ee"],["slategray3","9fb6cd"],["slategray4","6c7b8b"],["slategrey","708090"],["snow","fffafa"],["snow1","fffafa"],["snow2","eee9e9"],["snow3","cdc9c9"],["snow4","8b8989"],["springgreen","00ff7f"],["springgreen1","00ff7f"],["springgreen2","00ee76"],["springgreen3","00cd66"],["springgreen4","008b45"],
["steelblue","4682b4"],["steelblue1","63b8ff"],["steelblue2","5cacee"],["steelblue3","4f94cd"],["steelblue4","36648b"],["tan","d2b48c"],["tan1","ffa54f"],["tan2","ee9a49"],["tan3","cd853f"],["tan4","8b5a2b"],["thistle","d8bfd8"],["thistle1","ffe1ff"],["thistle2","eed2ee"],["thistle3","cdb5cd"],["thistle4","8b7b8b"],["tomato","ff6347"],["tomato1","ff6347"],["tomato2","ee5c42"],["tomato3","cd4f39"],["tomato4","8b3626"],["turquoise","40e0d0"],["turquoise1","00f5ff"],["turquoise2","00e5ee"],["turquoise3",
"00c5cd"],["turquoise4","00868b"],["violet","ee82ee"],["violetred","d02090"],["violetred1","ff3e96"],["violetred2","ee3a8c"],["violetred3","cd3278"],["violetred4","8b2252"],["wheat","f5deb3"],["wheat1","ffe7ba"],["wheat2","eed8ae"],["wheat3","cdba96"],["wheat4","8b7e66"],["whitesmoke","f5f5f5"],["yellow","ffff00"],["yellow1","ffff00"],["yellow2","eeee00"],["yellow3","cdcd00"],["yellow4","8b8b00"],["yellowgreen","9acd32"]]),n=String.raw($jscomp$templatelit$0),m={"{":"}","[":"]","(":")"},l={"#comment":[{token:"comment.sectionhead",
regex:"#+(?!').*(?:----|====|####)\\s*$",next:"start"},{token:["comment","comment.keyword.operator"],regex:"(#+['*]\\s*)(TODO|FIXME)\\b",next:"rdoc-start"},{token:"comment",regex:"#+['*]",next:"rdoc-start"},{token:["comment","comment.keyword.operator","comment"],regex:"(#+\\s*)(TODO|FIXME)\\b(.*)$",next:"start"},{token:"comment",regex:"#.*$",next:"start"}],"#string":[{token:"string",regex:"[rR]['\"][-]*[[({]",next:"rawstring",onMatch:function(a,c,b,d){b=b||[];b[0]=c;b[1]=this.next;b[2]=m[a[a.length-
1]]+a.substring(2,a.length-1)+a[1];return this.token}},{token:"string",regex:"([\"'])(#[0-9a-fA-F]{6})([0-9a-fA-F]{2})?(\\1)",next:"start",onMatch:function(a,c,b,d){c=a.substring(0,1);a=a.substring(1,a.length-1);return e(c,a,a)}},{token:"string",regex:"([\"'])(#[0-9a-fA-F]{3})(\\1)",next:"start",onMatch:function(a,c,b,d){c=a.substring(0,1);a=a.substring(1,a.length-1);return e(c,a,a)}},{token:"string",regex:"([\"'])([a-z]+[0-9]*)(\\1)",next:"start",onMatch:function(a,c,b,d){c=a.substring(0,1);a=a.substring(1,
a.length-1);b=q.get(a);return void 0===b?this.token:e(c,a,"#"+b)}},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',next:"start"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",next:"start"},{token:"string",merge:!0,regex:'["]',next:"qqstring"},{token:"string",merge:!0,regex:"[']",next:"qstring"}],"#number":[{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+[Li]?",merge:!1,next:"start"},{token:"constant.numeric",regex:"(?:(?:\\d+(?:\\.\\d*)?)|(?:\\.\\d+))(?:[eE][+-]?\\d*)?[iL]?",
merge:!1,next:"start"}],"#quoted-identifier":[{token:"identifier",regex:"[`](?:(?:\\\\.)|(?:[^`\\\\]))*?[`]",merge:!1,next:"start"}]};l["#keyword-or-identifier"]=[{token:function(c){return p.hasOwnProperty(c)?"constant.language":a.hasOwnProperty(c)?"keyword":c.match(/^\.\.\d+$/)?"variable.language":"identifier"},regex:n,unicode:!0,merge:!1,next:"start"}];l["#package-access"]=[{token:function(a){return $colorFunctionCalls?"identifier.support.class":"identifier"},regex:n+"(?=\\s*::)",unicode:!0,merge:!1,
next:"start"}];l["#function-call"]=[{token:function(a){return $colorFunctionCalls?"identifier.support.function":"identifier"},regex:n+"(?=\\s*\\()",unicode:!0,merge:!1,next:"start"}];l["#function-call-or-keyword"]=[{token:function(c){return f.hasOwnProperty(c)||a.hasOwnProperty(c)?"keyword":$colorFunctionCalls?"identifier.support.function":"identifier"},regex:n+"(?=\\s*\\()",unicode:!0,merge:!1,next:"start"}];l["#operator"]=[{token:"keyword.operator",regex:"\\$|@",merge:!1,next:"afterDollar"},{token:"keyword.operator",
regex:":::|::|:=|\\|>|=>|%%|>=|<=|==|!=|<<-|->>|->|<-|\\|\\||&&|=|\\+|-|\\*\\*?|/|\\^|>|<|!|&|\\||~|\\$|:|@|\\?",merge:!1,next:"start"},{token:"keyword.operator.infix",regex:"%.*?%",merge:!1,next:"start"},d.getParenRule(),{token:function(a){return $colorFunctionCalls?"punctuation.keyword.operator":"punctuation"},regex:"[;]",merge:!1,next:"start"},{token:function(a){return $colorFunctionCalls?"punctuation.keyword.operator":"punctuation"},regex:"[,]",merge:!1,next:"start"}];l["#knitr-embed"]=[{token:"constant.language",
regex:"^[<][<][^>]+[>][>]$",merge:!1}];l["#text"]=[{token:"text",regex:"\\s+"}];l.start=g("#comment #string #number #package-access #quoted-identifier #function-call-or-keyword #keyword-or-identifier #knitr-embed #operator #text".split(" "));l.afterDollar=g("#comment #string #number #quoted-identifier #function-call #keyword-or-identifier #operator #text".split(" "));l.rawstring=[{token:"string",regex:"[\\]})][-]*['\"]",onMatch:function(a,c,b,d){this.next=a===b[2]?b[0]:b[1];return this.token}},{defaultToken:"string"}];
l.qqstring=[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+",merge:!0}];l.qstring=[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+",merge:!0}];this.$rules=l;n=(new b).getRules();for(var u in n){l=n[u];for(var y=0;y<l.length;y++)if(k.isArray(l[y].token))for(var E=0;E<l[y].token.length;E++)l[y].token[E]+=".virtual-comment";else l[y].token+=".virtual-comment"}this.embedRules(n,"rdoc-",[{token:"text",regex:"^",
next:"start"}]);k.embedQuartoHighlightRules(this);this.normalizeRules()};m.inherits(a,f);l.RHighlightRules=a;l.setHighlightRFunctionCalls=function(a){$colorFunctionCalls=a}});define("mode/r_matching_brace_outdent",["require","exports","module"],function(a,l,m){var g=a("ace/range").Range;a=function(a){this.codeModel=a};(function(){this.checkOutdent=function(a,h,f){return/^\s+$/.test(h)&&/^\s*[\{\}\)\]]/.test(f)||/^\s*}\s*$/.test(h)&&"\n"==f||/}\s*$/.test(h)&&/\n/.test(f)?!0:!1};this.autoOutdent=function(a,h,f){if(0!==f){a=h.getLine(f);var d=a.match(/^(\s*[\}\)\]])/);if(d){d=d[1].length;var b=h.findMatchingBracket({row:f,column:d});if(!b||b.row==f)return 0;b=this.codeModel.getIndentForOpenBrace(b);
h.replace(new g(f,0,f,d-1),b)}if(d=a.match(/^(\s*\{)/))d=d[1].length,b=this.codeModel.getBraceIndent(f-1),h.replace(new g(f,0,f,d-1),b)}}}).call(a.prototype);l.RMatchingBraceOutdent=a});define("mode/r_scope_tree",["require","exports","module"],function(a,l,m){function g(a,f){return a.row!=f.row?a.row-f.row:a.column-f.column}var k=function(a,f,d,b,e){this.label=a;if((this.start=f)&&d&&(d.row>f.row||d.row===f.row&&d.column>f.column))throw Error("Malformed preamble: should lie before start position");this.preamble=d||f;this.end=null;this.scopeType=b;this.parentScope=null;this.attributes=e||{};this.$children=[]};k.TYPE_ROOT=1;k.TYPE_BRACE=2;k.TYPE_CHUNK=3;k.TYPE_SECTION=4;(function(){this.isRoot=
function(){return this.scopeType==k.TYPE_ROOT};this.isBrace=function(){return this.scopeType==k.TYPE_BRACE};this.isChunk=function(){return this.scopeType==k.TYPE_CHUNK};this.isSection=function(){return this.scopeType==k.TYPE_SECTION};this.isFunction=function(){return this.isBrace()&&!!this.attributes.args};this.isTest=function(){return this.isBrace()&&"test"===this.attributes.type};this.equals=function(a){return this.scopeType!==a.scopeType||this.start.row!==a.start.row||this.start.column!==a.start.column?
!1:!0};this.addNode=function(a){a.end&&window.alert("[ASSERTION FAILED] New node is already closed");0!=a.$children.length&&window.alert("[ASSERTION FAILED] New node already had children");if(!this.equals(a)){var f=this.$binarySearch(a.preamble);0<=f?this.$children[f].addNode(a):(f=-(f+1),f<this.$children.length&&(a.$children=this.$children.splice(f,this.$children.length-f)),a.parentScope=this,this.$children.push(a))}};this.closeScope=function(a,f){if(0==this.$children.length)return null;var d=this.$children[this.$children.length-
1];if(d.end)return null;var b=d.closeScope(a,f);return b?b:f==d.scopeType?(d.end=a,d.$forceDescendantsClosed(a),d):null};this.$forceDescendantsClosed=function(a){if(0!=this.$children.length){var f=this.$children[this.$children.length-1];f.end||(f.$forceDescendantsClosed(a),f.end=a)}};this.findNode=function(a){var f=this.$binarySearch(a);return 0<=f&&(a=this.$children[f].findNode(a))?(this.label&&a.unshift(this),a):this.label?[this]:null};this.$getFunctionStack=function(a){var f=this.$binarySearch(a);
a=0<=f?this.$children[f].$getFunctionStack(a):[];this.isFunction()&&a.push(this);return a};this.findFunctionDefinitionFromUsage=function(a,f){for(var d=this.$getFunctionStack(a),b=0;b<d.length;b++)for(var e=d[b],c=0;c<e.$children.length;c++)if(e.$children[c].label==f)return e.$children[c];return null};this.getFunctionsInScope=function(a){a=this.$getFunctionStack(a);for(var f=[],d=0;d<a.length;d++)f.push({name:a[d].attributes.name,args:a[d].attributes.args.slice()});return f};this.invalidateFrom=function(a){var f=
this.$binarySearch(a);0<=f?0>=g(a,this.$children[f].start)?a=this.$children[f].preamble:(a=this.$children[f].invalidateFrom(a),f++):f=-(f+1);f<this.$children.length&&this.$children.splice(f,this.$children.length-f);this.end=null;return a};this.$binarySearch=function(a,f,d){"undefined"===typeof f&&(f=0);"undefined"===typeof d&&(d=this.$children.length);if(f===d)return-(f+1);var b=Math.floor((f+d)/2),e=this.$children[b].comparePosition(a);return 0===e?b:0>e?this.$binarySearch(a,f,b):this.$binarySearch(a,
b+1,d)};this.comparePosition=function(a){return 0>g(a,this.preamble)?-1:null!=this.end&&0<=g(a,this.end)?1:0};this.printDebug=function(a){"undefined"===typeof a&&(a="");for(var f=0;f<this.$children.length;f++)this.$children[f].printDebug(a+"    ")}}).call(k.prototype);a=function(a){this.$ScopeNodeFactory=a||k;this.parsePos={row:0,column:0};this.$root=new this.$ScopeNodeFactory("(Top Level)",this.parsePos,null,k.TYPE_ROOT)};(function(){function a(d){count=d.isChunk()?1:0;d=d.$children||[];for(var b=
0;b<d.length;b++)count+=a(d[b]);return count}this.getParsePosition=function(){return this.parsePos};this.setParsePosition=function(a){this.parsePos=a};this.onSectionStart=function(a,b,e){"undefined"==typeof e&&(e={});var c=this.getActiveScopes(b);if(1<c.length){c=c[c.length-2].$children;for(var d=c.length-1;0<=d;d--)if(c[d].isSection()){this.$root.closeScope(b,k.TYPE_SECTION);break}}a=new this.$ScopeNodeFactory(a,b,b,k.TYPE_SECTION,e);this.$root.addNode(a)};this.onSectionEnd=function(a){this.$root.closeScope(a,
k.TYPE_SECTION)};this.closeMarkdownHeaderScopes=function(a,b,e){for(var c=a.$children,d=c.length-1;0<=d;d--){var f=c[d];if(f.isFunction()||f.isChunk())return;if(f.isSection()&&f.attributes.depth>=e)return this.$root.closeScope(b,k.TYPE_SECTION),f.attributes.depth===e||a.isRoot()||null==a?void 0:this.closeMarkdownHeaderScopes(a.parentScope,b,e)}a.isRoot()||null==a||this.closeMarkdownHeaderScopes(a.parentScope,b,e)};this.onMarkdownHead=function(a,b,e,c,f){var d=this.getActiveScopes(b);1<d.length&&this.closeMarkdownHeaderScopes(d[d.length-
2],b,c);this.$root.addNode(new this.$ScopeNodeFactory(a,e,b,k.TYPE_SECTION,{depth:c,isMarkdown:f}))};this.onChunkStart=function(a,b,e,c){this.$root.closeScope(e,k.TYPE_CHUNK);b=new this.$ScopeNodeFactory(b,c,e,k.TYPE_CHUNK);b.chunkLabel=a;this.$root.addNode(b);this.printScopeTree()};this.onChunkEnd=function(a){a=this.$root.closeScope(a,k.TYPE_CHUNK);this.printScopeTree();return a};this.onFunctionScopeStart=function(a,b,e,c,f){this.$root.addNode(new this.$ScopeNodeFactory(a,e,b,k.TYPE_BRACE,{name:c,
args:f,type:"function"}));this.printScopeTree()};this.onTestScopeStart=function(a,b,e){var c="test_that("+a+")";a=a.replace(/^['"](.*)['"]/,"$1");this.$root.addNode(new this.$ScopeNodeFactory(c,e,b,k.TYPE_BRACE,{name:a,type:"test"}));this.printScopeTree()};this.onNamedScopeStart=function(a,b){this.$root.addNode(new this.$ScopeNodeFactory(a,b,null,k.TYPE_BRACE))};this.onScopeStart=function(a){this.$root.addNode(new this.$ScopeNodeFactory(null,a,null,k.TYPE_BRACE));this.printScopeTree()};this.onScopeEnd=
function(a){a=this.$root.closeScope(a,k.TYPE_BRACE);this.printScopeTree();return a};this.getActiveScopes=function(a){return this.$root.findNode(a)};this.getScopeList=function(){return this.$root.$children};this.findFunctionDefinitionFromUsage=function(a,b){return this.$root.findFunctionDefinitionFromUsage(a,b)};this.getFunctionsInScope=function(a,b){return this.$root.getFunctionsInScope(a,b)};this.invalidateFrom=function(a){a={row:Math.max(0,a.row-1),column:0};0<g(this.parsePos,a)&&(this.parsePos=
this.$root.invalidateFrom(a));this.printScopeTree()};this.getChunkCount=function(d){return a(this.$root)};this.getTopLevelScopeCount=function(){return this.$root.$children.length};this.printScopeTree=function(){};this.getAllFunctionScopes=function(){var a=[];f(this.$root,a);return a};var f=function(a,b){a.isFunction()&&b.push(a);for(var e=a.$children,c=0;c<e.length;c++)f(e[c],b)}}).call(a.prototype);l.ScopeManager=a;l.ScopeNode=k});var $rainbowParentheses=!1,$numParenColors=7;
define("mode/rainbow_paren_highlight_rules",["require","exports","module"],function(a,l,m){a=function(){};l.RainbowParenHighlightRules=a;l.setRainbowParentheses=function(a){$rainbowParentheses=a};l.getRainbowParentheses=function(){return $rainbowParentheses};l.setNumParenColors=function(a){$numParenColors=a};a.getParenRule=function(){return{token:"paren.keyword.operator.nomatch",regex:"[[({})\\]]",merge:!1,onMatch:function(a,k,h,f,d){if(!$rainbowParentheses)return this.token="paren.keyword.operator.nomatch";
d.rainbow=d.rainbow||0;switch(a){case "[":case "{":case "(":this.token="paren.paren_color_"+d.rainbow%$numParenColors;d.rainbow+=1;break;case "]":case "}":case ")":d.rainbow=Math.max(0,d.rainbow-1),this.token="paren.paren_color_"+d.rainbow%$numParenColors}return this.token}}}});define("mode/rdoc",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("ace/tokenizer").Tokenizer,h=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/rdoc_highlight_rules").RDocHighlightRules,d=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent;a=function(a){a?(this.$highlightRules=new h,this.$tokenizer=new k((new h).getRules())):(this.$highlightRules=new f,this.$tokenizer=new k((new f).getRules()));this.$outdent=new d};m.inherits(a,
g);(function(){this.getNextLineIndent=function(a,e,c){return this.$getIndent(e)}}).call(a.prototype);l.Mode=a});define("mode/rdoc_highlight_rules",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");a("ace/lib/lang");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){var a="\\"+"name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage".replace(/\|/g,"|\\");this.createKeywordMapper({keyword:a},
"identifer");this.$rules={start:[{token:"comment",regex:"%.*$"},{token:"text",regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage)\\b",next:"nospell"},{token:"keyword",regex:"\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])"},{token:"paren.keyword.operator",
regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],nospell:[{token:"comment",regex:"%.*$",next:"start"},{token:"nospell.text",regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage)\\b"},{token:"keyword",
regex:"\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])",next:"start"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])]"},{token:"paren.keyword.operator",regex:"}",next:"start"},{token:"nospell.text",regex:"\\s+"},{token:"nospell.text",regex:"\\w+"}]}};m.inherits(g,a);l.RDocHighlightRules=g});define("mode/rhtml",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/mode/html").Mode,k=a("ace/tokenizer").Tokenizer,h=a("mode/rhtml_highlight_rules").RHtmlHighlightRules,f=a("mode/r_code_model").RCodeModel,d=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,b=a("mode/r_matching_brace_outdent").RMatchingBraceOutdent,e=a("mode/utils");a=function(a,e){this.$session=e;this.$tokenizer=new k((new h).getRules());this.codeModel=new f(e,this.$tokenizer,/^r-/,/^\x3c!--\s*begin.rcode\s*(.*)/,
/^\s*end.rcode\s*--\x3e/);this.$outdent=new d;this.$r_outdent=new b(this.codeModel);this.foldingRules=this.codeModel};m.inherits(a,g);(function(){this.insertChunkInfo={value:"\x3c!--begin.rcode\n\nend.rcode--\x3e\n",position:{row:0,column:15},content_position:{row:1,column:0}};this.checkOutdent=function(a,b,d){return"r"===e.activeMode(a,"html")?this.$r_outdent.checkOutdent(a,b,d):this.$outdent.checkOutdent(b,d)};this.autoOutdent=function(a,b,d){return"r"===e.activeMode(a,"html")?this.$r_outdent.autoOutdent(a,
b,d):this.$outdent.autoOutdent(b,d)};this.getLanguageMode=function(a){return e.getPrimaryState(this.$session,a.row).match(/^r-/)?"R":"HTML"};this.$getNextLineIndent=this.getNextLineIndent;this.getNextLineIndent=function(a,b,d,f){return"r"===e.activeMode(a,"html")?this.codeModel.getNextLineIndent(a,b,d,f):this.$getNextLineIndent(a,b,d)};this.$id="mode/rhtml"}).call(a.prototype);l.Mode=a});define("mode/rhtml_highlight_rules",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("mode/r_highlight_rules").RHighlightRules,k=a("ace/mode/html_highlight_rules").HtmlHighlightRules;a=a("ace/mode/text_highlight_rules").TextHighlightRules;var h=function(){this.$rules=(new k).getRules();this.$rules.start.unshift({token:"support.function.codebegin",regex:"^\x3c!--\\s*begin.rcode\\s*(?:.*)",next:"r-start"});var a=(new g).getRules();this.addRules(a,"r-");this.$rules["r-start"].unshift({token:"support.function.codeend",
regex:"^\\s*end.rcode\\s*--\x3e",next:"start"})};m.inherits(h,a);l.RHtmlHighlightRules=h});define("mode/rmarkdown",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("mode/markdown").Mode,k=a("ace/tokenizer").Tokenizer,h=a("mode/rmarkdown_highlight_rules").RMarkdownHighlightRules,f=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,d=a("mode/r_matching_brace_outdent").RMatchingBraceOutdent,b=a("mode/c_cpp_matching_brace_outdent").CppMatchingBraceOutdent,e=a("mode/r_code_model").RCodeModel,c=a("mode/cpp_code_model").CppCodeModel,r=a("mode/python").Mode,p=a("rstudio/folding/rmarkdown").FoldMode,
q=a("ace/mode/folding/cstyle").FoldMode;a("mode/auto_brace_insert");var n=a("mode/utils"),w=a("ace/unicode");a=function(a,g){var l=this;this.$session=g;this.$tokenizer=new k((new h).getRules());this.$outdent=new f;this.codeModel=new e(g,this.$tokenizer,/^r-/,new RegExp(h.prototype.$reChunkStartString),new RegExp(h.prototype.$reChunkEndString));this.$r_outdent=new d(this.codeModel);this.cpp_codeModel=new c(g,this.$tokenizer,/^r-cpp-/,new RegExp(h.prototype.$reCppChunkStartString),new RegExp(h.prototype.$reChunkEndString));
this.$cpp_outdent=new b(this.cpp_codeModel);this.$python=new r;var m=new p,w=new q;this.$tokenizer.getLineTokens=function(a,c,b,e){return k.prototype.getLineTokens.call(this,a,0===b?"_start":c,b,e)};this.foldingRules={getFoldWidget:function(a,c,b){var e=l.getLanguageMode({row:b,column:0}),d=a.getLine(b);return"Markdown"===e||n.startsWith(d,"```")||0===b?m.getFoldWidget(a,c,b):"C_CPP"===e?w.getFoldWidget(a,c,b):l.codeModel.getFoldWidget(a,c,b)},getFoldWidgetRange:function(a,c,b){var e=l.getLanguageMode({row:b,
column:0}),d=a.getLine(b);return"Markdown"===e||n.startsWith(d,"```")||0===b?m.getFoldWidgetRange(a,c,b):"C_CPP"===e?w.getFoldWidgetRange(a,c,b):l.codeModel.getFoldWidgetRange(a,c,b)}}};m.inherits(a,g);(function(){function a(a){return n.activeMode(a,"markdown")}this.insertChunkInfo={value:"```{r}\n\n```\n",position:{row:0,column:5},content_position:{row:1,column:0}};this.getLanguageMode=function(c){c=n.getPrimaryState(this.$session,c.row);c=a(c);return"r"===c?"R":"r-cpp"===c?"C_CPP":"yaml"===c?"YAML":
"python"===c?"Python":"sql"==c?"SQL":"stan"===c?"Stan":"Markdown"};this.$getNextLineIndent=this.getNextLineIndent;this.getNextLineIndent=function(c,b,e,d,f){var g=a(c);return"r"===g?this.codeModel.getNextLineIndent(c,b,e,d):"r-cpp"===g?this.cpp_codeModel.getNextLineIndent(c,b,e,d,f):"yaml"===g?this.$getIndent(this.$session.getLine(d+1)):"python"===g?this.$python.getNextLineIndent(c,b,e,d):this.$getNextLineIndent(c,b,e)};this.checkOutdent=function(c,b,e){var d=a(c);return"r"===d?this.$r_outdent.checkOutdent(c,
b,e):"r-cpp"===d?this.$cpp_outdent.checkOutdent(c,b,e):"yaml"===d?!1:this.$outdent.checkOutdent(b,e)};this.autoOutdent=function(c,b,e){var d=a(c);if("r"===d)return this.$r_outdent.autoOutdent(c,b,e);if("r-cpp"===d)return this.$cpp_outdent.autoOutdent(c,b,e);if("yaml"!==d)return"python"===d?this.$python.autoOutdent(c,b,e):this.$outdent.autoOutdent(b,e)};this.getIndentForOpenBrace=function(c){var b=n.getPrimaryState(this.$session,c.row);if("r"===a(b))return this.codeModel.getIndentForOpenBrace(c);c=
this.$session.getLine(c.row1);return this.$getIndent(c)};this.transformAction=function(c,b,e,d,f){var g=a(c);return"markdown"===g?this.transformActionMarkdown(c,b,e,d,f):"r-cpp"===g?this.transformActionCpp(c,b,e,d,f):"yaml"===g?this.transformActionYaml(c,b,e,d,f):"python"===g?this.$python.transformAction(c,b,e,d,f):!1};this.transformActionMarkdown=function(a,c,b,e,d){if("insertion"===c)if("r"===d){if(a=b.getCursorPosition(),c=e.getLine(a.row),e=e.getTokenAt(a.row,a.column-1),null!==e&&-1===e.type.indexOf("support.function")&&
"`"===c[a.column-1])return{text:"r`",selection:[0,a.column+1,0,a.column+1]}}else if("`"===d&&(a=b.getCursorPosition(),c=e.getLine(a.row),e=e.getTokenAt(a.row,a.column+1),null!==e&&-1!==e.type.indexOf("support.function")&&"`"===c[a.column]))return{text:"",selection:[0,a.column+1,0,a.column+1]}};this.transformActionCpp=function(a,c,b,e,d){if("insertion"===c)if("\n"===d){if(a=b.getSelectionRange().start,(e=/^((\s*\/\/+')\s*)/.exec(e.doc.getLine(a.row)))&&b.getSelectionRange().start.column>=e[2].length)return{text:"\n"+
e[1]}}else if("R"===d&&(a=b.getSelectionRange().start,(e=/^(\s*\/\*{3,}\s*)/.exec(e.doc.getLine(a.row)))&&b.getSelectionRange().start.column>=e[1].length))return{text:"R\n\n*/\n",selection:[1,0,1,0]};return!1};this.transformActionYaml=function(a,c,b,e,d){return"insertion"===c&&"\n"===d?(a=b.getCursorPosition().row,a=e.getLine(a),e=this.$getIndent(a),/[:({[]$/.test(a)?(a=this.$session.getTabString(),{text:"\n"+e+a}):{text:"\n"+e}):!1};this.tokenRe=new RegExp("^["+w.wordChars+"._]+","g");this.nonTokenRe=
new RegExp("^(?:[^"+w.wordChars+"._]|\\s)+","g");this.allowAutoInsert=this.smartAllowAutoInsert;this.$id="mode/rmarkdown"}).call(a.prototype);l.Mode=a});define("rstudio/folding/rmarkdown",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/mode/folding/fold_mode").FoldMode,k=a("ace/range").Range,h=a("mode/utils");a=l.FoldMode=function(){};m.inherits(a,g);var f=/(?:^|[.])(?:codebegin|heading)(?:$|[.])/,d=/(?:^|[.])(?:codeend)(?:$|[.])/;(function(){this.$getBracedWidgetRange=function(a,e,c,d){var b=this.getFoldWidget(a,e,c);if(""===b)return null;if("start"===b){var f=1;var g=a.getLength();if(c>=g)return null}else if("end"===
b&&(f=-1,g=0,c<=g))return null;for(e=c+f;e!==g;){var h=a.getLine(e);if(d.test(h))break;e+=f}"start"===b?(a={row:c,column:a.getLine(c).length},c={row:e,column:0}):(a={row:e,column:a.getLine(e).length},c={row:c,column:0});return k.fromPoints(a,c)};this.getFoldWidget=function(a,e,c){a=a.getTokens(c);a=$jscomp.makeIterator(a);for(c=a.next();!c.done;c=a.next()){c=c.value.type||"";if(f.test(c))return"start";if(d.test(c))return"markbeginend"===e?"end":""}return""};this.$getFoldWidgetRange=function(a,e,c){var b=
a.getState(c),d=a.getLine(c),f=d.trim(),g=/^\s*(`{3,})/.exec(d);if(null!==g)return d=new RegExp("^\\s*(`{"+g[1].length+"})(?!`)"),this.$getBracedWidgetRange(a,e,c,d);g=0<c?a.getState(c-1):"start";if(0===c&&"---"===f)return d=/^\s*---\s*$/,this.$getBracedWidgetRange(a,e,c,d);if(h.startsWith(g,"yaml"))return d=/^\s*(?:---|\.\.\.)\s*$/,this.$getBracedWidgetRange(a,e,c,d);if("="===d[0])e=1;else if("-"===d[0])e=2;else{g=/^(#+)(?:.*)$/.exec(d);if(!g)return;e=g[1].length}if(null!==e){a:{f=a.getLength();
for(g=c+1;g<f;g++)if(a.getState(g)===b){var l=a.getLine(g);if(1===e&&/^[=]{3,}\s*/.test(l)){b=g-2;break a}if(2===e&&/^[-]{3,}\s*/.test(l)){b=g-2;break a}if((l=/^(#+)(?:.*)$/.exec(l))&&l[1].length<=e){b=g-1;break a}}b=f}return new k(c,d.length,b,a.getLine(b).length)}};this.getFoldWidgetRange=function(a,e,c){a=this.$getFoldWidgetRange(a,e,c);if(null!=a&&a.start.row!==a.end.row)return a}}).call(a.prototype)});define("mode/rmarkdown_highlight_rules",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("mode/r_highlight_rules").RHighlightRules,k=a("mode/c_cpp_highlight_rules").c_cppHighlightRules,h=a("ace/mode/perl_highlight_rules").PerlHighlightRules,f=a("mode/python_highlight_rules").PythonHighlightRules,d=a("ace/mode/ruby_highlight_rules").RubyHighlightRules,b=a("mode/markdown_highlight_rules").MarkdownHighlightRules,e=a("ace/mode/text_highlight_rules").TextHighlightRules,c=a("mode/yaml_highlight_rules").YamlHighlightRules,
r=a("mode/sh_highlight_rules").ShHighlightRules,p=a("mode/stan_highlight_rules").StanHighlightRules,q=a("mode/sql_highlight_rules").SqlHighlightRules,n=a("mode/tex_highlight_rules").LatexHighlightRules,w=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,B=a("ace/mode/css_highlight_rules").CssHighlightRules,u=a("ace/mode/scss_highlight_rules").ScssHighlightRules,y=a("ace/mode/sass_highlight_rules").SassHighlightRules,E=a("ace/mode/less_highlight_rules").LessHighlightRules;e=a("ace/mode/text_highlight_rules").TextHighlightRules;
var t=a("mode/mermaid_highlight_rules").MermaidHighlightRules,z=a("ace/mode/dot_highlight_rules").DotHighlightRules,x=a("mode/utils");a=function(){this.$rules=(new b).getRules();this.$rules._start=this.$rules.allowBlock.slice();x.embedRules(this,g,"r",this.$reChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,k,"r-cpp",this.$reCppChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,h,"perl",this.$rePerlChunkStartString,
this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,f,"python",this.$rePythonChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,d,"ruby",this.$reRubyChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,b,"markdown",this.$reMarkdownChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,r,"sh",this.$reShChunkStartString,this.$reChunkEndString,["start","listblock",
"allowBlock"]);x.embedRules(this,p,"stan",this.$reStanChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,q,"sql",this.$reSqlChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,t,"mermaid",this.$reMermaidChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,z,"dot",this.$reDotChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,w,"js",
this.$reJavaScriptChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,B,"css",this.$reCssChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,u,"scss",this.$reScssChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,y,"sass",this.$reSassChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,E,"less",this.$reLessChunkStartString,this.$reChunkEndString,
["start","listblock","allowBlock"]);x.embedRules(this,n,"tex",this.$reLatexChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,e,"text",this.$reTextChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,c,"yaml","^\\s*---\\s*$","^\\s*(?:---|\\.\\.\\.)\\s*$",["_start"]);this.$rules["yaml-start"].unshift({token:["string"],regex:/((?:January|February|March|April|May|June|July|August|September|October|November|December)\s+\d+(?:st|nd|rd|s|n|r)?(?:\s*(?:,)?(?:\s*\d+)?)?)/});
this.$rules["yaml-start"].push({defaultToken:"text.nospell"});this.normalizeRules()};m.inherits(a,e);(function(){function a(a){return"^(?:[ ]{4})?`{3,}\\s*\\{[Rr]\\b(?:.*)engine\\s*\\=\\s*['\"]"+a+"['\"](?:.*)\\}\\s*$|^(?:[ ]{4})?`{3,}\\s*\\{"+a+"\\b(?:.*)\\}\\s*$"}this.$reChunkStartString="^(?:[ ]{4})?`{3,}\\s*\\{\\w+\\b(.*)\\}\\s*$";this.$reChunkEndString="^(?:[ ]{4})?`{3,}\\s*$";this.$reCppChunkStartString=a("(?:[rR][cC]pp|[cC](?:pp)?)\\d*");this.$reMarkdownChunkStartString=a("block");this.$rePerlChunkStartString=
a("perl");this.$rePythonChunkStartString=a("python");this.$reMermaidChunkStartString=a("mermaid");this.$reDotChunkStartString=a("dot");this.$reRubyChunkStartString=a("ruby");this.$reShChunkStartString=a("(?:bash|sh)");this.$reStanChunkStartString=a("stan");this.$reSqlChunkStartString=a("sql");this.$reJavaScriptChunkStartString=a("(?:d3|js|ojs|observable)");this.$reCssChunkStartString=a("css");this.$reScssChunkStartString=a("scss");this.$reSassChunkStartString=a("sass");this.$reLessChunkStartString=
a("less");this.$reTextChunkStartString=a("(?:asis|text|verbatim)");this.$reLatexChunkStartString=a("(?:tikz|latex|tex)")}).call(a.prototype);l.RMarkdownHighlightRules=a});define("mode/sh",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("mode/sh_highlight_rules").ShHighlightRules,h=a("ace/range").Range,f=a("ace/mode/folding/cstyle").FoldMode,d=a("ace/mode/behaviour/cstyle").CstyleBehaviour;a=function(){this.HighlightRules=k;this.foldingRules=new f;this.$behaviour=new d};m.inherits(a,g);(function(){this.lineCommentStart="#";this.getNextLineIndent=function(a,c,b){var e=this.$getIndent(c),d=this.getTokenizer().getLineTokens(c,
a).tokens;if(d.length&&"comment"==d[d.length-1].type)return e;"start"==a&&c.match(/^.*[\{\(\[:]\s*$/)&&(e+=b);return e};var a={pass:1,"return":1,raise:1,"break":1,"continue":1};this.checkOutdent=function(b,c,d){if("\r\n"!==d&&"\r"!==d&&"\n"!==d)return!1;b=this.getTokenizer().getLineTokens(c.trim(),b).tokens;if(!b)return!1;do c=b.pop();while(c&&("comment"==c.type||"text"==c.type&&c.value.match(/^\s+$/)));return c?"keyword"==c.type&&a[c.value]:!1};this.autoOutdent=function(a,c,b){b+=1;a=this.$getIndent(c.getLine(b));
var e=c.getTabString();a.slice(-e.length)==e&&c.remove(new h(b,a.length-e.length,b,a.length))};this.$id="mode/sh"}).call(a.prototype);l.Mode=a});define("mode/sh_highlight_rules",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=l.reservedKeywords="!|{|}|case|do|done|elif|else|esac|fi|for|if|in|then|until|while|&|;|export|local|read|typeset|unset|elif|select|set|function|declare|readonly",k=l.languageConstructs="[|]|alias|bg|bind|break|builtin|cd|command|compgen|complete|continue|dirs|disown|echo|enable|eval|exec|exit|fc|fg|getopts|hash|help|history|jobs|kill|let|logout|popd|printf|pushd|pwd|return|set|shift|shopt|source|suspend|test|times|trap|type|ulimit|umask|unalias|wait",
h=function(){this.$rules={start:[{token:"constant",regex:/\\./},{token:["text","comment"],regex:/(^|\s)(#.*)$/},{token:"string.start",regex:'"',push:[{token:"constant.language.escape",regex:/\\(?:[$`"\\]|$)/},{include:"variables"},{token:"keyword.operator",regex:/`/},{token:"string.end",regex:'"',next:"pop"},{defaultToken:"string"}]},{token:"string",regex:"\\$'",push:[{token:"constant.language.escape",regex:/\\(?:[abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/},{token:"string",
regex:"'",next:"pop"},{defaultToken:"string"}]},{regex:"<<<",token:"keyword.operator"},{stateName:"heredoc",regex:"(<<-?)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)",onMatch:function(a,d,b){var e=d.substring(0,d.length-5);e="-"===a[2]?e+"indentedHeredoc":e+"heredoc";a=a.split(this.splitRegex);b.push(e,a[4],d);return[{type:"constant",value:a[1]},{type:"text",value:a[2]},{type:"string",value:a[3]},{type:"support.class",value:a[4]},{type:"string",value:a[5]}]},rules:{heredoc:[{onMatch:function(a,d,b){if(a===
b[1])return this.next=b[2],b.splice(-3),"support.class";this.next="";return"string"},regex:".*$"}],indentedHeredoc:[{token:"string",regex:"^\t+"},{onMatch:function(a,d,b){if(a===b[1])return this.next=b[2],b.splice(-3),"support.class";this.next="";return"string"},regex:".*$"}]}},{regex:"$",token:"empty",next:function(a,d){return/heredoc$/i.test(d[0])?d[0]:a}},{token:["keyword","text","text","text","variable"],regex:/(declare|local|readonly)(\s+)(?:(-[fixar]+)(\s+))?([a-zA-Z_][a-zA-Z0-9_]*\b)/},{token:"variable.language",
regex:"(?:\\$(?:SHLVL|\\$|\\!|\\?))"},{token:"variable",regex:"(?:[a-zA-Z_][a-zA-Z0-9_]*(?==))"},{include:"variables"},{token:"support.function",regex:"(?:[a-zA-Z_][a-zA-Z0-9_]*\\s*\\(\\))"},{token:"support.function",regex:"(?:&(?:\\d+))"},{token:"string",start:"'",end:"'"},{token:"constant.numeric",regex:"(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+)))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))"},{token:"constant.numeric",regex:"(?:(?:[1-9]\\d*)|(?:0))\\b"},{token:this.createKeywordMapper({keyword:g,
"support.function.builtin":k,"invalid.deprecated":"debugger"},"identifier"),regex:"[a-zA-Z_][a-zA-Z0-9_]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=|[%&|`]"},{token:"punctuation.operator",regex:";"},{token:"paren.lparen",regex:"[\\[\\(\\{]"},{token:"paren.rparen",regex:"[\\]]"},{token:"paren.rparen",regex:"[\\)\\}]",next:function(a,d){if(2>d.length)return a;d.shift();return d.shift()}}],variables:[{token:"variable",regex:/(\$)(\w+)/},{token:["variable","paren.lparen"],
regex:/(\$)(\()/,push:"start"},{token:["variable","paren.lparen","keyword.operator","variable","keyword.operator"],regex:/(\$)(\{)([#!]?)(\w+|[*@#?\-$!0_])(:[?+\-=]?|##?|%%?|,,?\/|\^\^?)?/,push:"start"},{token:"variable",regex:/\$[*@#?\-$!0_]/},{token:["variable","paren.lparen"],regex:/(\$)(\{)/,push:"start"}]};this.normalizeRules()};m.inherits(h,a);l.ShHighlightRules=h});define("mode/sql",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("mode/sql_highlight_rules").SqlHighlightRules;a("ace/range");a=function(){this.HighlightRules=k};m.inherits(a,g);a.prototype.lineCommentStart="--";a.prototype.$id="mode/sql";l.Mode=a});define("mode/sql_highlight_rules",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");a("ace/lib/lang");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){this.$rules={start:[{token:"comment",regex:"--.*$"},{token:"comment",start:"/\\*",end:"\\*/"},{token:"comment",regex:"^#.*$"},{token:"comment.doc.tag",regex:"\\?[a-zA-Z_][a-zA-Z0-9_$]*"},{token:"paren.keyword.operator",merge:!1,regex:"[[({]",next:"start"},{token:"paren.keyword.operator",merge:!1,regex:"[\\])}]",
next:"start"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:this.createKeywordMapper({"support.function":"avg|count|first|last|max|min|sum|ucase|lcase|mid|len|round|rank|now|format|coalesce|ifnull|isnull|nvl",keyword:"abs|absent|accessible|acos|add|all|allocate|alter|analyse|analyze|and|any|any_value|are|array|array_agg|array_max_cardinality|as|asc|asensitive|asin|asymmetric|at|atan|atomic|authorization|avg|backup|before|begin|begin_frame|begin_partition|between|bigint|binary|blob|boolean|both|break|browse|btrim|bulk|by|call|called|cardinality|cascade|cascaded|case|cast|ceil|ceiling|change|char|char_length|character|character_length|check|checkpoint|classifier|clob|close|clustered|coalesce|collate|collation|collect|column|commit|compute|concurrently|condition|connect|constraint|contains|containstable|continue|convert|copy|corr|corresponding|cos|cosh|count|covar_pop|covar_samp|create|cross|cube|cume_dist|current|current_catalog|current_date|current_default_transform_group|current_path|current_role|current_row|current_schema|current_time|current_timestamp|current_transform_group_for_type|current_user|cursor|cycle|database|databases|date|day|day_hour|day_microsecond|day_minute|day_second|dbcc|deallocate|dec|decfloat|decimal|declare|default|deferrable|define|delayed|delete|dense_rank|deny|deref|desc|describe|deterministic|disconnect|disk|distinct|distinctrow|distributed|div|do|double|drop|dual|dump|dynamic|each|element|else|elseif|empty|enclosed|end|end_frame|end_partition|end-exec|equals|errlvl|escape|escaped|every|except|exec|execute|exists|exit|exp|explain|external|extract|false|fetch|file|fillfactor|filter|first_value|float|float4|float8|floor|for|force|foreign|frame_row|free|freetext|freetexttable|freeze|from|full|fulltext|function|fusion|generated|get|global|goto|grant|greatest|group|grouping|groups|handler|having|high_priority|hold|holdlock|hour|hour_microsecond|hour_minute|hour_second|identity|identity_insert|identitycol|if|ignore|ilike|in|index|indicator|infile|initial|initially|inner|inout|insensitive|insert|int|int1|int2|int3|int4|int8|integer|intersect|intersection|interval|into|io_after_gtids|io_before_gtids|is|isnull|iterate|join|json|json_array|json_arrayagg|json_exists|json_object|json_objectagg|json_query|json_scalar|json_serialize|json_table|json_table_primitive|json_value|key|keys|kill|lag|language|large|last_value|lateral|lead|leading|least|leave|left|like|like_regex|limit|linear|lineno|lines|listagg|ln|load|local|localtime|localtimestamp|lock|log|log10|long|longblob|longtext|loop|low_priority|lower|lpad|ltrim|master_bind|master_ssl_verify_server_cert|match|match_number|match_recognize|matches|max|maxvalue|mediumblob|mediumint|mediumtext|member|merge|method|middleint|min|minute|minute_microsecond|minute_second|mod|modifies|module|month|multiset|national|natural|nchar|nclob|new|no|no_write_to_binlog|nocheck|nonclustered|none|normalize|not|notnull|nth_value|ntile|null|nullif|numeric|occurrences_regex|octet_length|of|off|offset|offsets|old|omit|on|one|only|open|opendatasource|openquery|openrowset|openxml|optimize|optimizer_costs|option|optionally|or|order|out|outer|outfile|over|overlaps|overlay|parameter|partition|pattern|per|percent|percent_rank|percentile_cont|percentile_disc|period|pivot|placing|plan|portion|position|position_regex|power|precedes|precision|prepare|primary|print|proc|procedure|ptf|public|purge|raiserror|range|rank|read|read_write|reads|readtext|real|reconfigure|recursive|ref|references|referencing|regexp|regr_avgx|regr_avgy|regr_count|regr_intercept|regr_r2|regr_slope|regr_sxx|regr_sxy|regr_syy|release|rename|repeat|replace|replication|require|resignal|restore|restrict|result|return|returning|returns|revert|revoke|right|rlike|rollback|rollup|row|row_number|rowcount|rowguidcol|rows|rpad|rule|running|save|savepoint|schema|schemas|scope|scroll|search|second|second_microsecond|securityaudit|seek|select|semantickeyphrasetable|semanticsimilaritydetailstable|semanticsimilaritytable|sensitive|separator|session_user|set|setuser|show|shutdown|signal|similar|sin|sinh|skip|smallint|some|spatial|specific|specifictype|sql|sql_big_result|sql_calc_found_rows|sql_small_result|sqlexception|sqlstate|sqlwarning|sqrt|ssl|start|starting|static|statistics|stddev_pop|stddev_samp|stored|straight_join|submultiset|subset|substring|substring_regex|succeeds|sum|symmetric|system|system_time|system_user|table|tablesample|tan|tanh|terminated|textsize|then|time|timestamp|timezone_hour|timezone_minute|tinyblob|tinyint|tinytext|to|top|trailing|tran|transaction|translate|translate_regex|translation|treat|trigger|trim|trim_array|true|truncate|try_convert|tsequal|uescape|undo|union|unique|unknown|unlock|unnest|unpivot|unsigned|until|update|updatetext|upper|usage|use|user|using|utc_date|utc_time|utc_timestamp|value|value_of|values|var_pop|var_samp|varbinary|varchar|varcharacter|variadic|varying|verbose|versioning|view|virtual|waitfor|when|whenever|where|while|width_bucket|window|with|within|within_group|without|write|writetext|xor|year|year_month|zerofill",
"constant.language":"true|false","storage.type":"int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|money|real|number|integer"},"identifier",!0),regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=|\\."},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]};this.normalizeRules()};m.inherits(g,a);l.SqlHighlightRules=g});define("mode/stan",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("ace/tokenizer").Tokenizer,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,f=a("mode/stan_highlight_rules").StanHighlightRules,d=a("ace/mode/folding/cstyle").FoldMode;a=function(){this.$highlightRules=new f;this.$tokenizer=new k(this.$highlightRules.getRules());this.$outdent=new h;this.foldingRules=new d};m.inherits(a,g);(function(){this.lineCommentStart=["//","#"];this.blockComment=
{start:"/*",end:"*/"};this.toggleCommentLines=function(a,e,c,d){var b=!0;a=/^(\s*)\/\//;for(var f=c;f<=d;f++)if(!a.test(e.getLine(f))){b=!1;break}if(b)for(b=new Range(0,0,0,0),f=c;f<=d;f++)c=e.getLine(f).match(a),b.start.row=f,b.end.row=f,b.end.column=c[0].length,e.replace(b,c[1]);else e.indentRows(c,d,"//")};this.getLanguageMode=function(a){return"Stan"};this.getNextLineIndent=function(a,e,c){var b=this.$getIndent(e),d=this.getTokenizer().getLineTokens(e,a).tokens;if(d.length&&"comment"==d[d.length-
1].type)return b;"start"==a&&e.match(/^.*(?:[\{\(\[])\s*$/)&&(b+=c);return b};this.checkOutdent=function(a,e,c){return this.$outdent.checkOutdent(e,c)};this.autoOutdent=function(a,e,c){this.$outdent.autoOutdent(e,c)};this.$id="mode/stan"}).call(a.prototype);l.Mode=a});define("mode/stan_highlight_rules",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");a("ace/lib/lang");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){this.$rules={start:[{token:"comment.line.number-sign",regex:"\\/\\/.*$"},{token:"comment.line.double-dash",regex:"#.*$"},{token:"comment.block",regex:"\\/\\*",merge:!0,next:"comment"},{token:"keyword.other.block",regex:"\\b(functions|data|transformed\\s+data|parameters|transformed\\s+parameters|model|generated\\s+quantities)\\b"},
{token:"string.quoted.double",regex:'["][ a-zA-Z0-9~@#$%^&*_\'`\\-+={}[\\]()<>|/!?.,;:]*["]'},{token:"constant.numeric",regex:"(?:(?:\\d+(?:\\.\\d*)?)|(?:\\.\\d+))(?:[eE][+\\-]?\\d*)?\\b"},{token:"keyword.operator",regex:"\\bT(?=\\s*\\[)"},{token:["keyword.other","text","punctuation"],regex:"(lower|upper)(\\s*)(=)"},{token:["keyword.other","text","keyword.operator"],regex:"(target)(\\s*)(\\+=)"},{token:"keyword.control",regex:"\\b(for|in|while|if|then|else|return)\\b"},{token:"keyword.other",regex:"\\b(print|reject)\\b"},
{token:"storage.type",regex:"\\b(int|real|vector|simplex|unit_vector|ordered|positive_ordered|row_vector|matrix|cholesky_factor_cov|cholesky_factor_corr|corr_matrix|cov_matrix|void)\\b"},{token:"invalid.deprecated",regex:"\\b(bernoulli_ccdf_log|bernoulli_cdf_log|bernoulli_log|bernoulli_logit_log|beta_binomial_ccdf_log|beta_binomial_cdf_log|beta_binomial_log|beta_ccdf_log|beta_cdf_log|beta_log|binomial_ccdf_log|binomial_cdf_log|binomial_coefficient_log|binomial_log|binomial_logit_log|categorical_log|categorical_logit_log|cauchy_ccdf_log|cauchy_cdf_log|cauchy_log|chi_square_ccdf_log|chi_square_cdf_log|chi_square_log|dirichlet_log|double_exponential_ccdf_log|double_exponential_cdf_log|double_exponential_log|exp_mod_normal_ccdf_log|exp_mod_normal_cdf_log|exp_mod_normal_log|exponential_ccdf_log|exponential_cdf_log|exponential_log|frechet_ccdf_log|frechet_cdf_log|frechet_log|gamma_ccdf_log|gamma_cdf_log|gamma_log|gaussian_dlm_obs_log|get_lp|gumbel_ccdf_log|gumbel_cdf_log|gumbel_log|hypergeometric_log|increment_log_prob|integrate_ode|inv_chi_square_ccdf_log|inv_chi_square_cdf_log|inv_chi_square_log|inv_gamma_ccdf_log|inv_gamma_cdf_log|inv_gamma_log|inv_wishart_log|lkj_corr_cholesky_log|lkj_corr_log|logistic_ccdf_log|logistic_cdf_log|logistic_log|lognormal_ccdf_log|lognormal_cdf_log|lognormal_log|multi_gp_cholesky_log|multi_gp_log|multi_normal_cholesky_log|multi_normal_log|multi_normal_prec_log|multi_student_t_log|multinomial_log|multiply_log|neg_binomial_2_ccdf_log|neg_binomial_2_cdf_log|neg_binomial_2_log|neg_binomial_2_log_log|neg_binomial_ccdf_log|neg_binomial_cdf_log|neg_binomial_log|normal_ccdf_log|normal_cdf_log|normal_log|ordered_logistic_log|pareto_ccdf_log|pareto_cdf_log|pareto_log|pareto_type_2_ccdf_log|pareto_type_2_cdf_log|pareto_type_2_log|poisson_ccdf_log|poisson_cdf_log|poisson_log|poisson_log_log|rayleigh_ccdf_log|rayleigh_cdf_log|rayleigh_log|scaled_inv_chi_square_ccdf_log|scaled_inv_chi_square_cdf_log|scaled_inv_chi_square_log|skew_normal_ccdf_log|skew_normal_cdf_log|skew_normal_log|student_t_ccdf_log|student_t_cdf_log|student_t_log|uniform_ccdf_log|uniform_cdf_log|uniform_log|von_mises_log|weibull_ccdf_log|weibull_cdf_log|weibull_log|wiener_log|wishart_log)\\b"},
{token:["keyword.operator.sampling","text","support.function"],regex:"(~)(\\s*)(bernoulli|bernoulli_logit|beta|beta_binomial|binomial|binomial_logit|categorical|categorical_logit|cauchy|chi_square|dirichlet|double_exponential|exp_mod_normal|exponential|frechet|gamma|gaussian_dlm_obs|gumbel|hypergeometric|inv_chi_square|inv_gamma|inv_wishart|lkj_corr|lkj_corr_cholesky|logistic|lognormal|multi_gp|multi_gp_cholesky|multi_normal|multi_normal_cholesky|multi_normal_prec|multi_student_t|multinomial|neg_binomial|neg_binomial_2|neg_binomial_2_log|normal|ordered_logistic|pareto|pareto_type_2|poisson|poisson_log|rayleigh|scaled_inv_chi_square|skew_normal|student_t|uniform|von_mises|weibull|wiener|wishart)\\b"},
{token:"support.function",regex:"\\b(Phi|Phi_approx|abs|acos|acosh|append_col|append_row|asin|asinh|atan|atan2|atanh|bernoulli_cdf|bernoulli_lccdf|bernoulli_lcdf|bernoulli_logit_lpmf|bernoulli_lpmf|bernoulli_rng|bessel_first_kind|bessel_second_kind|beta_binomial_cdf|beta_binomial_lccdf|beta_binomial_lcdf|beta_binomial_lpmf|beta_binomial_rng|beta_cdf|beta_lccdf|beta_lcdf|beta_lpdf|beta_rng|binary_log_loss|binomial_cdf|binomial_lccdf|binomial_lcdf|binomial_logit_lpmf|binomial_lpmf|binomial_rng|block|categorical_logit_lpmf|categorical_lpmf|categorical_rng|cauchy_cdf|cauchy_lccdf|cauchy_lcdf|cauchy_lpdf|cauchy_rng|cbrt|ceil|chi_square_cdf|chi_square_lccdf|chi_square_lcdf|chi_square_lpdf|chi_square_rng|cholesky_decompose|col|cols|columns_dot_product|columns_dot_self|cos|cosh|cov_exp_quad|crossprod|csr_extract_u|csr_extract_v|csr_extract_w|csr_matrix_times_vector|csr_to_dense_matrix|cumulative_sum|determinant|diag_matrix|diag_post_multiply|diag_pre_multiply|diagonal|digamma|dims|dirichlet_lpdf|dirichlet_rng|distance|dot_product|dot_self|double_exponential_cdf|double_exponential_lccdf|double_exponential_lcdf|double_exponential_lpdf|double_exponential_rng|e|eigenvalues_sym|eigenvectors_sym|erf|erfc|exp|exp2|exp_mod_normal_cdf|exp_mod_normal_lccdf|exp_mod_normal_lcdf|exp_mod_normal_lpdf|exp_mod_normal_rng|expm1|exponential_cdf|exponential_lccdf|exponential_lcdf|exponential_lpdf|exponential_rng|fabs|falling_factorial|fdim|floor|fma|fmax|fmin|fmod|frechet_cdf|frechet_lccdf|frechet_lcdf|frechet_lpdf|frechet_rng|gamma_cdf|gamma_lccdf|gamma_lcdf|gamma_lpdf|gamma_p|gamma_q|gamma_rng|gaussian_dlm_obs_lpdf|gumbel_cdf|gumbel_lccdf|gumbel_lcdf|gumbel_lpdf|gumbel_rng|head|hypergeometric_lpmf|hypergeometric_rng|hypot|inc_beta|int_step|integrate_ode_bdf|integrate_ode_rk45|inv|inv_chi_square_cdf|inv_chi_square_lccdf|inv_chi_square_lcdf|inv_chi_square_lpdf|inv_chi_square_rng|inv_cloglog|inv_gamma_cdf|inv_gamma_lccdf|inv_gamma_lcdf|inv_gamma_lpdf|inv_gamma_rng|inv_logit|inv_phi|inv_sqrt|inv_square|inv_wishart_lpdf|inv_wishart_rng|inverse|inverse_spd|is_inf|is_nan|lbeta|lchoose|lgamma|lkj_corr_cholesky_lpdf|lkj_corr_cholesky_rng|lkj_corr_lpdf|lkj_corr_rng|lmgamma|lmultiply|log|log10|log1m|log1m_exp|log1m_inv_logit|log1p|log1p_exp|log2|log_determinant|log_diff_exp|log_falling_factorial|log_inv_logit|log_mix|log_rising_factorial|log_softmax|log_sum_exp|logistic_cdf|logistic_lccdf|logistic_lcdf|logistic_lpdf|logistic_rng|logit|lognormal_cdf|lognormal_lccdf|lognormal_lcdf|lognormal_lpdf|lognormal_rng|machine_precision|max|mdivide_left_spd|mdivide_left_tri_low|mdivide_right_spd|mdivide_right_tri_low|mean|min|modified_bessel_first_kind|modified_bessel_second_kind|multi_gp_cholesky_lpdf|multi_gp_lpdf|multi_normal_cholesky_lpdf|multi_normal_cholesky_rng|multi_normal_lpdf|multi_normal_prec_lpdf|multi_normal_rng|multi_student_t_lpdf|multi_student_t_rng|multinomial_lpmf|multinomial_rng|multiply_lower_tri_self_transpose|neg_binomial_2_cdf|neg_binomial_2_lccdf|neg_binomial_2_lcdf|neg_binomial_2_log_lpmf|neg_binomial_2_log_rng|neg_binomial_2_lpmf|neg_binomial_2_rng|neg_binomial_cdf|neg_binomial_lccdf|neg_binomial_lcdf|neg_binomial_lpmf|neg_binomial_rng|negative_infinity|normal_cdf|normal_lccdf|normal_lcdf|normal_lpdf|normal_rng|not_a_number|num_elements|ordered_logistic_lpmf|ordered_logistic_rng|owens_t|pareto_cdf|pareto_lccdf|pareto_lcdf|pareto_lpdf|pareto_rng|pareto_type_2_cdf|pareto_type_2_lccdf|pareto_type_2_lcdf|pareto_type_2_lpdf|pareto_type_2_rng|pi|poisson_cdf|poisson_lccdf|poisson_lcdf|poisson_log_lpmf|poisson_log_rng|poisson_lpmf|poisson_rng|positive_infinity|pow|prod|qr_Q|qr_R|quad_form|quad_form_diag|quad_form_sym|rank|rayleigh_cdf|rayleigh_lccdf|rayleigh_lcdf|rayleigh_lpdf|rayleigh_rng|rep_array|rep_matrix|rep_row_vector|rep_vector|rising_factorial|round|row|rows|rows_dot_product|rows_dot_self|scaled_inv_chi_square_cdf|scaled_inv_chi_square_lccdf|scaled_inv_chi_square_lcdf|scaled_inv_chi_square_lpdf|scaled_inv_chi_square_rng|sd|segment|sin|singular_values|sinh|size|skew_normal_cdf|skew_normal_lccdf|skew_normal_lcdf|skew_normal_lpdf|skew_normal_rng|softmax|sort_asc|sort_desc|sort_indices_asc|sort_indices_desc|sqrt|sqrt2|square|squared_distance|step|student_t_cdf|student_t_lccdf|student_t_lcdf|student_t_lpdf|student_t_rng|sub_col|sub_row|sum|tail|tan|tanh|target|tcrossprod|tgamma|to_array_1d|to_array_2d|to_matrix|to_row_vector|to_vector|trace|trace_gen_quad_form|trace_quad_form|trigamma|trunc|uniform_cdf|uniform_lccdf|uniform_lcdf|uniform_lpdf|uniform_rng|variance|von_mises_lpdf|von_mises_rng|weibull_cdf|weibull_lccdf|weibull_lcdf|weibull_lpdf|weibull_rng|wiener_lpdf|wishart_lpdf|wishart_rng)\\b"},
{token:"invalid.illegal",regex:"\\b(STAN_MAJOR|STAN_MATH_MAJOR|STAN_MATH_MINOR|STAN_MATH_PATCH|STAN_MINOR|STAN_PATCH|alignas|alignof|and|and_eq|asm|auto|bitand|bitor|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|const_cast|constexpr|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|false|float|for|friend|fvar|goto|if|in|inline|int|long|lp__|mutable|namespace|new|noexcept|not|not_eq|nullptr|operator|or|or_eq|private|protected|public|register|reinterpret_cast|repeat|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|then|this|thread_local|throw|true|try|typedef|typeid|typename|union|unsigned|until|using|var|virtual|void|volatile|wchar_t|while|xor|xor_eq)\\b"},
{token:"invalid.illegal",regex:"[a-zA-Z][a-zA-Z0-9_]*(?!__)\\b__\\b"},{token:"invalid.illegal",regex:"\\b(?:_|[_0-9][A-Za-z0-9_]+|[A-Za-z][A-Za-z0-9_]*__)\\b"},{token:"function",regex:"[a-zA-Z][a-zA-Z0-9_]*(?!__)\\b(?=\\s*\\()"},{token:"identifier",regex:"[a-zA-Z][a-zA-Z0-9_]*(?!__)\\b"},{token:"invalid.deprecated",regex:"<-"},{token:"keyword.operator",regex:"~|[|]{2}|&&|==?|!=|<=?|>=?|\\+|-|\\.?\\*|\\.?/|\\\\|\\^|!|'|%|\\?|:"},{token:"punctuation.operator",regex:",|;|[|]"},{token:"paren.lparen.keyword.operator",
regex:"[\\[\\(\\{]"},{token:"paren.rparen.keyword.operator",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",merge:!0,regex:".+"}]}};m.inherits(g,a);l.StanHighlightRules=g});define("mode/sweave",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("ace/tokenizer").Tokenizer,h=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/sweave_highlight_rules").SweaveHighlightRules,d=a("mode/r_code_model").RCodeModel,b=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,e=a("mode/r_matching_brace_outdent").RMatchingBraceOutdent,c=a("ace/unicode"),r=a("mode/utils");a("mode/auto_brace_insert");a=function(a,c){this.$tokenizer=
a?new k((new h).getRules()):new k((new f).getRules());this.$session=c;this.$outdent=new b;this.codeModel=new d(c,this.$tokenizer,/^r-/,/<<(.*?)>>/,/^\s*@\s*$/);this.$r_outdent=new e(this.codeModel);this.foldingRules=this.codeModel};m.inherits(a,g);(function(){this.tokenRe=new RegExp("^["+c.wordChars+"._]+","g");this.nonTokenRe=new RegExp("^(?:[^"+c.wordChars+"._]|\\s)+","g");this.$complements={"(":")","[":"]",'"':'"',"'":"'","{":"}"};this.$reOpen=/^[(["'{]$/;this.$reClose=/^[)\]"'}]$/;this.insertChunkInfo=
{value:"<<>>=\n\n@\n",position:{row:0,column:2},content_position:{row:1,column:0}};this.getLanguageMode=function(a){return r.getPrimaryState(this.$session,a.row).match(/^r-/)?"R":"TeX"};this.$getNextLineIndent=this.getNextLineIndent;this.getNextLineIndent=function(a,c,b,e){return"r"===r.activeMode(a,"tex")?this.codeModel.getNextLineIndent(a,c,b,e):this.$getNextLineIndent(a,c,b)};this.checkOutdent=function(a,c,b){return"r"===r.activeMode(a,"tex")?this.$r_outdent.checkOutdent(a,c,b):this.$outdent.checkOutdent(c,
b)};this.autoOutdent=function(a,c,b){return"r"===r.activeMode(a,"tex")?this.$r_outdent.autoOutdent(a,c,b):this.$outdent.autoOutdent(c,b)};this.allowAutoInsert=this.smartAllowAutoInsert;this.$id="mode/sweave"}).call(a.prototype);l.Mode=a});define("mode/sweave_highlight_rules",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");a("mode/utils");var g=a("mode/tex_highlight_rules").TexHighlightRules,k=a("mode/r_highlight_rules").RHighlightRules;a=a("ace/mode/text_highlight_rules").TextHighlightRules;var h=function(){this.$rules=(new g).getRules();this.addRules((new k).getRules(),"r-");this.addRules((new k).getRules(),"r-sexpr-");this.$rules.start.unshift({token:"comment.codebegin",regex:"^\\s*<<.*>>=.*$",next:"r-start"});
this.$rules["r-start"].unshift({token:"comment.codeend",regex:"^\\s*@(?:\\s.*)?$",next:"start"});this.$rules.start.unshift({token:"comment",regex:"^\\s*@(?:\\s.*)?$"});this.$rules.start.unshift({regex:"(\\\\Sexpr)([{])",next:"r-sexpr-start",onMatch:function(a,d,b,e,c){c.sexpr=c.sexpr||{};c.sexpr.state=d;c.sexpr.count=1;return[{type:"keyword",value:"\\Sexpr"},{type:"paren.keyword.operator",value:"{"}]}});this.$rules["r-sexpr-start"].unshift({token:"paren.keyword.operator",regex:"[{]",merge:!1,onMatch:function(a,
d,b,e,c){c.sexpr.count+=1;return this.token}});this.$rules["r-sexpr-start"].unshift({token:"paren.keyword.operator",regex:"[}]",merge:!1,onMatch:function(a,d,b,e,c){--c.sexpr.count;0===c.sexpr.count?(this.next=c.sexpr.state,delete c.sexpr):this.next=d;return this.token}})};m.inherits(h,a);l.SweaveHighlightRules=h});define("mode/tex",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("ace/tokenizer").Tokenizer,h=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/tex_highlight_rules").TexHighlightRules,d=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent;a=function(a){this.$tokenizer=a?new k((new h).getRules()):new k((new f).getRules());this.$outdent=new d};m.inherits(a,g);(function(){this.getNextLineIndent=function(a,e,c){return this.$getIndent(e)};
this.allowAutoInsert=function(){return!1}}).call(a.prototype);l.Mode=a});define("mode/tex_highlight_rules",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");a("ace/lib/lang");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(a){a||(a="text");this.$rules={start:[{token:"comment",regex:"%.*$"},{token:a,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b",
push:"nospell"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:a,regex:"\\s+"}],nospell:[{token:"comment",regex:"%.*$",next:"pop"},{token:"nospell."+a,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b"},
{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])",next:"pop"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])]"},{token:"paren.keyword.operator",regex:"}",next:"pop"},{token:"nospell."+a,regex:"\\s+"},{token:"nospell."+a,regex:"\\w+"}]};this.normalizeRules()};m.inherits(g,a);l.TexHighlightRules=l.LatexHighlightRules=g});define("mode/token_cursor",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("mode/utils"),k=g.getTokenTypeRegex("paren"),h=function(a,e,c){this.$tokens=a;this.$row=e||0;this.$offset=c||0};(function(){this.cloneCursor=function(){return new h(this.$tokens,this.$row,this.$offset)};var a=g.isArray,e=g.contains,c={"(":")","{":"}","<":">","[":"]",")":"(","}":"{",">":"<","]":"["},d=["(","[","{"],f=[")","]","}"];this.moveToStartOfRow=function(a){this.$row=a;this.$offset=0};this.moveToEndOfRow=
function(a){this.$row=a;this.$offset=(a=this.$tokens[a])&&a.length?a.length-1:0};this.moveToPreviousToken=function(){if(0>=this.$row&&0>=this.$offset)return this.$offset=this.$row=0,!1;if(0<this.$offset)return this.$offset--,!0;for(var a=this.$row-1,c=0;0<=a;){var b=this.$tokens[a];if(b&&0!==b.length){c=b.length;break}a--}if(0>a)return!1;this.$row=a;this.$offset=c-1;return!0};this.moveToNextToken=function(a){"undefined"===typeof a&&(a=(this.$tokens||[]).length);if(this.$row>a)return!1;null==this.$tokens[this.$row]&&
this.$codeModel&&this.$codeModel.$tokenizeUpToRow&&this.$codeModel.$tokenizeUpToRow.call(this.$codeModel,a);var c=this.$tokens[this.$row];if(c&&this.$offset<c.length-1)return this.$offset++,!0;for(var b=this.$row+1;b<=a&&(!(c=this.$tokens[b])||0===c.length);)b++;if(b>a)return!1;this.$row=b;this.$offset=0;return!0};this.peekBwd=function(a){"undefined"===typeof a&&(a=1);for(var c=this.cloneCursor(),b=0;b<a;b++)if(!c.moveToPreviousToken())return c.$invalidate();return c};this.peekFwd=function(a){"undefined"===
typeof a&&(a=1);for(var c=this.cloneCursor(),b=0;b<a;b++)if(!c.moveToNextToken())return c.$invalidate();return c};this.$invalidate=function(){this.$column=this.$row=0;this.$tokens=[];return this};this.seekToNearestToken=function(a,c){if(a.row>c)return!1;this.$row=a.row;var b=this.$tokens[this.$row]||[];for(this.$offset=0;this.$offset<b.length;this.$offset++)if(b[this.$offset].column>=a.column)return!0;return a.row<c?this.moveToNextToken(c):!1};this.bwdToNearestToken=function(a){this.$row=a.row;this.$offset=
a.column;for(var c=this.$tokens[this.$row]||[];0<=this.$offset;this.$offset--){var b=c[this.$offset];if("undefined"!==typeof b&&b.column<=a.column)return!0}return this.moveToPreviousToken()};this.bwdToMatchingToken=function(){var a=this.currentValue();if(!e(f,a))return!1;for(var b=c[a],d=0;this.moveToPreviousToken();){var g=this.currentValue();if(g===b){if(0===d)return!0;d--}else g===a&&d++}return!1};this.fwdToMatchingToken=function(){var a=this.currentValue();if(!e(d,a))return!1;for(var b=c[a],f=
0;this.moveToNextToken();){var g=this.currentValue();if(g===b){if(0===f)return!0;f--}else g===a&&f++}return!1};this.equals=function(a){return this.$row===a.$row&&this.$offset===a.$offset};this.moveBackwardOverMatchingParens=function(){if(!this.moveToPreviousToken())return!1;if(")"!==this.currentValue())return this.moveToNextToken(),!1;for(var a=!1,c=0;this.moveToPreviousToken();){var b=this.currentValue();if("("===b){if(0===c){a=!0;break}c--}else")"===b&&c++}return a};this.findToken=function(a,c){do{var b=
this.currentToken();if(b&&a(b))return b}while(this.moveToNextToken(c));return null};this.findTokenBwd=function(a,c){do{var b=this.currentToken();if(b&&a(b))return b}while(this.moveToPreviousToken(c));return null};this.currentToken=function(){var a=this.$tokens[this.$row];if(null==a)return{};a=a[this.$offset];return null==a?{}:a};this.currentValue=function(){return this.currentToken().value};this.currentType=function(){return this.currentToken().type};this.hasType=function(){var a=this.currentType();
if(null==a)return!1;for(var c=0;c<arguments.length;c++){var b=arguments[c];if(a===b||-1!==a.indexOf(b+".")||-1!==a.indexOf("."+b))return!0}return!1};this.currentPosition=function(){var a=this.currentToken();return null==a?null:{row:this.$row,column:a.column}};this.isFirstSignificantTokenOnLine=function(){return 0===this.$offset};this.isLastSignificantTokenOnLine=function(){return this.$offset==(this.$tokens[this.$row]||[]).length-1};this.bwdUntil=function(a){for(;!a(this);)this.moveToPreviousToken()};
this.bwdWhile=function(a){for(;a(this);)this.moveToPreviousToken()};this.moveToPosition=function(a,c){var b=a.row,e=a.column,d=this.$tokens[b];null==d&&this.$codeModel&&this.$codeModel.$tokenizeUpToRow&&(this.$codeModel.$tokenizeUpToRow.call(this.$codeModel,b),d=this.$tokens[b]);if(d&&0<d.length&&d[0].column<=e){for(var f=0;f<d.length&&!(d[f].column>=e);f++);this.$row=b;this.$offset=f===d.length?f-1:c&&d[f].column===e?f:f-1;return!0}e=this.cloneCursor();e.$row=b;e.$offset=0;return e.moveToPreviousToken()?
(this.$row=e.$row,this.$offset=e.$offset,!0):!1};this.findOpeningBracket=function(c,b){a(c)||(c=[c]);var e=this.cloneCursor();do if(!e.bwdToMatchingToken()){var d=e.currentValue();if(b&&"{"===d)break;for(var f=0;f<c.length;f++)if(d===c[f])return this.$row=e.$row,this.$offset=e.$offset,!0}while(e.moveToPreviousToken());return!1};this.findOpeningBracketCountCommas=function(c,b){a(c)||(c=[c]);var e=this.cloneCursor(),d=0;do if(!e.bwdToMatchingToken()){var f=e.currentValue();","===f&&(d+=1);if(b&&"{"===
f)break;for(var g=0;g<c.length;g++)if(f===c[g])return this.$row=e.$row,this.$offset=e.$offset,d}while(e.moveToPreviousToken());return-1}}).call(h.prototype);var f=function(a,e,c,d){this.$tokens=a;this.$row=e||0;this.$offset=c||0;this.$codeModel=d};m.mixin(f.prototype,h.prototype);(function(){this.cloneCursor=function(){return new f(this.$tokens,this.$row,this.$offset,this.$codeModel)};var a=g.contains;this.bwdOverConstNoexceptDecltype=function(){var a=this.cloneCursor();if("{"!==a.currentValue()||
!a.moveToPreviousToken())return!1;var b=a.cloneCursor();")"===b.currentValue()&&b.bwdToMatchingToken()&&b.moveToPreviousToken()&&"decltype"===b.currentValue()&&b.moveToPreviousToken()&&(a.$row=b.$row,a.$offset=b.$offset);b=a.cloneCursor();")"===b.currentValue()&&b.bwdToMatchingToken()&&b.moveToPreviousToken()&&"noexcept"===b.currentValue()&&(a.$row=b.$row,a.$offset=b.$offset);if("noexcept"===a.currentValue()&&!a.moveToPreviousToken()||"const"===a.currentValue()&&!a.moveToPreviousToken()||")"===a.currentValue()&&
!a.moveToNextToken())return!1;this.$row=a.$row;this.$offset=a.$offset;return!0};this.bwdToMatchingArrow=function(){if(">"!==this.currentValue())return!1;for(var a=0,b=this.cloneCursor();b.moveToPreviousToken();)if("<"===b.currentValue()){if(0===a)return this.$row=b.$row,this.$offset=b.$offset,!0;a--}else">"===b.currentValue()&&a++;return!1};this.bwdOverClassySpecifiers=function(){var a=this.currentValue();":"!==a&&","!==a&&"{"!==a||this.moveToPreviousToken();do{this.bwdToMatchingArrow()&&this.moveToPreviousToken();
a=this.currentType();var b=this.currentValue();if("keyword"!==a&&"::"!==b&&"identifier"!==a&&"constant"!==a)break;if("class"===b||"struct"===b||"enum"===b||":"===b||","===b)return!0}while(this.moveToPreviousToken());return!1};this.bwdOverClassInheritance=function(){var a=this.cloneCursor();return e(a,this)};var e=function(a,b){a.bwdOverClassySpecifiers();var c=a.currentValue();return","===c?e(a,b):":"===c?(b.$row=a.$row,b.$offset=a.$offset,!0):!1};this.bwdOverInitializationList=function(){var a=this.cloneCursor();
return this.doBwdOverInitializationList(a,this)};this.doBwdOverInitializationList=function(b,e){b.moveBackwardOverMatchingParens();if(!b.moveBackwardOverMatchingParens()&&!b.moveToPreviousToken())return!1;for(;"keyword"===b.currentType();)if(!b.moveToPreviousToken())return!1;if(b.moveToPreviousToken()){var c=b.currentValue();if(","===c)return this.doBwdOverInitializationList(b,e);if(":"===c&&(c=b.peekBwd().currentValue(),!a(["public","private","protected"],c)))return e.$row=b.$row,e.$offset=b.$offset,
!0}return!1}}).call(f.prototype);var d=function(a,e,c,d){this.$tokens=a;this.$row=e||0;this.$offset=c||0;this.$codeModel=d};m.mixin(d.prototype,h.prototype);(function(){function a(a){return 0===a.indexOf("'")?a.lastIndexOf("'")===a.length-1:0===a.indexOf('"')?a.lastIndexOf('"')===a.length-1:!1}function e(a){return"("===a||"["===a||"{"===a}function c(a){return")"===a||"]"===a||"}"===a}this.cloneCursor=function(){return new d(this.$tokens,this.$row,this.$offset,this.$codeModel)};var f=g.contains;this.isValidAsIdentifier=
function(){var a=this.currentType();return this.hasType("identifier","constant")||"symbol"===a||"keyword"===a||"string"===a};this.isExtractionOperator=function(){var a=this.currentValue();return"$"===a||"@"===a||"::"===a||":::"===a};this.findStartOfEvaluationContext=function(){var a=this.cloneCursor();do if(!a.bwdToMatchingToken()){if(a.isValidAsIdentifier()){if(!a.moveToPreviousToken())break;if(a.isExtractionOperator())continue;if(!a.moveToNextToken())return!1;break}return!1}while(a.moveToPreviousToken());
this.$row=a.$row;this.$offset=a.$offset;return!0};this.isLookingAtBinaryOp=function(){var a=this.currentType();return"keyword.operator"===a||"keyword.operator.infix"===a};this.moveToStartOfCurrentStatement=function(){for(var a=this.cloneCursor();a.isLookingAtBinaryOp();)if(!a.moveToPreviousToken())return!1;do if(!a.bwdToMatchingToken()){if(a.isValidAsIdentifier()){if(!a.moveToPreviousToken())break;if(a.isLookingAtBinaryOp()){for(;a.isLookingAtBinaryOp();)if(!a.moveToPreviousToken())return!1;if(!a.moveToNextToken())return!1;
continue}if(!a.moveToNextToken())return!1;break}return!1}while(a.moveToPreviousToken());this.$row=a.$row;this.$offset=a.$offset;return!0};this.moveToEndOfCurrentStatement=function(){for(var a=this.cloneCursor();a.isLookingAtBinaryOp();)if(!a.moveToNextToken())return!1;do if(!a.fwdToMatchingToken()){if(a.isValidAsIdentifier()){if(!a.moveToNextToken())break;if(a.isLookingAtBinaryOp()){for(;a.isLookingAtBinaryOp();)if(!a.moveToNextToken())return!1;if(!a.moveToPreviousToken())return!1;continue}if(!a.moveToPreviousToken())return!1;
break}return!1}while(a.moveToNextToken());this.$row=a.$row;this.$offset=a.$offset;return!0};this.isSingleLineString=function(){return a(this.currentValue())};this.isLeftBracket=function(){return e(this.currentValue())};this.isRightBracket=function(){return c(this.currentValue())};this.isValidForEndOfStatement=function(){var b=this.currentType(),e=this.currentValue();return-1!==b.search(k)?c(e):a(e)||this.hasType("identifier","constant","variable")};this.isValidForStartOfStatement=function(){var b=
this.currentType();this.currentValue();if(-1!==b.search(k))return e(this.currentValue());b=this.currentValue();return a(b)||this.hasType("identifier","constant","variable")};this.isConditionalControlFlowKeyword=function(){var a=this.currentValue();return f(["if","for","while","function"],a)};this.isControlFlowKeyword=function(){var a=this.currentValue();return f("if for while else function repeat break next".split(" "),a)};this.isAtStartOfNewExpression=function(a){var b=this.cloneCursor();return b.moveToPreviousToken()?
this.isValidForStartOfStatement()&&b.isValidForEndOfStatement()&&this.$row>b.$row?b.isControlFlowKeyword()||")"===b.currentValue()&&b.bwdToMatchingToken()&&b.moveToPreviousToken()&&b.isConditionalControlFlowKeyword()?!1:!0:!1:a}}).call(d.prototype);l.TokenCursor=h;l.CppTokenCursor=f;l.RTokenCursor=d});define("mode/token_utils",["require","exports","module"],function(a,l,m){a=function(a,k,h,f,d,b){this.$doc=a;this.$tokenizer=k;this.$tokens=h;this.$endStates=Array(a.getLength());this.$statePattern=f;this.$codeBeginPattern=d;this.$codeEndPattern=b};(function(){this.getTokenForPos=function(a,k,h){this.$tokenizeUpToRow(a.row);if(this.$tokens.length<=a.row)return null;for(var f=this.$tokens[a.row],d=0;d<f.length;d++){var b=f[d];if(k&&a.column==b.column)return b;if(a.column<=b.column)break;if(h&&a.column==
b.column+b.value.length||a.column<b.column+b.value.length)return b}return null};this.$tokenizeUpToRow=function(a){a=Math.min(a,this.$doc.getLength()-1);for(var g=0,h=!0;g<=a;g++)if(!h||!this.$endStates[g]){h=!1;var f=0===g?"start":this.$endStates[g-1],d=this.$doc.getLine(g);d=this.$tokenizer.getLineTokens(d,f,g);!this.$statePattern||this.$statePattern.test(d.state)||this.$statePattern.test(f)?this.$tokens[g]=this.$filterWhitespaceAndComments(d.tokens):this.$tokens[g]=[];d.state===this.$endStates[g]?
h=!0:this.$endStates[g]=d.state}h||g<this.$tokens.length&&this.$invalidateRow(g);return!0};this.$filterWhitespaceAndComments=function(a){a=a.filter(function(a){a=/\bcode(?:begin|end)\b/.test(a.type)?!1:/\bsectionhead\b/.test(a.type)?!1:/^\s*$/.test(a.value)||a.type.match(/\b(?:ace_virtual-)?comment\b/);return!a});for(var g=a.length-1;0<=g;g--)if(1<a[g].value.length&&/\bparen\b/.test(a[g].type)){var h=a[g];a.splice(g,1);for(var f=h.value.length-1;0<=f;f--){var d={type:h.type,value:h.value.charAt(f),
column:h.column+f};a.splice(g,0,d)}}return a};this.$invalidateRow=function(a){this.$tokens[a]=null;this.$endStates[a]=null};this.$insertNewRows=function(a,k){for(var g=[a,0],f=0;f<k;f++)g.push(null);this.$tokens.splice.apply(this.$tokens,g);this.$endStates.splice.apply(this.$endStates,g)};this.$removeRows=function(a,k){this.$tokens.splice(a,k);this.$endStates.splice(a,k)};this.$walkParens=function(a,k,h){var f=/\bparen\b/;return a<k?function(){for(;a<=k;a++)for(var d=this.$tokens[a],b=0;b<d.length;b++)if(f.test(d[b].type)&&
!h(d[b].value,{row:a,column:d[b].column}))return!1;return!0}.call(this):function(){a=Math.max(0,a);for(k=Math.max(0,k);a>=k;a--)for(var d=this.$tokens[a],b=d.length-1;0<=b;b--)if(f.test(d[b].type)&&!h(d[b].value,{row:a,column:d[b].column}))return!1;return!0}.call(this)};this.$walkParensBalanced=function(a,k,h,f,d){var b=[],e=null;this.$walkParens(a,k,function(a,g){if(h&&h(b,a,g))return e=g,!1;if(/[\[({]/.test(a))if(b[b.length-1]===d[a])b.pop();else return!0;else b.push(a);return f&&f(b,a,g)?(e=g,
!1):!0});return e};this.$findNextSignificantToken=function(a,k){if(0==this.$tokens.length)return null;k=Math.min(k,this.$tokens.length-1);for(var g=a.row,f=a.column;g<=k;g++){for(var d=this.$tokens[g],b=0;b<d.length;b++)if(d[b].column+d[b].value.length>f)return{token:d[b],row:g,column:Math.max(d[b].column,f),offset:b};f=0}return null};this.findNextSignificantToken=function(a){return this.$findNextSignificantToken(a,this.$tokens.length-1)};this.$findPreviousSignificantToken=function(a,k){if(0==this.$tokens.length)return null;
k=Math.max(0,k);for(var g=Math.min(a.row,this.$tokens.length-1);g>=k;g--){var f=this.$tokens[g];if(0!=f.length){if(g!=a.row)return{row:g,column:f[f.length-1].column,token:f[f.length-1],offset:f.length-1};for(var d=f.length-1;0<=d;d--)if(f[d].column<a.column)return{row:g,column:f[d].column,token:f[d],offset:d}}}return null}}).call(a.prototype);l.TokenUtils=a});define("mode/utils",["require","exports","module"],function(a,l,m){a("ace/range");var g=a("ace/token_iterator").TokenIterator,k=a("ace/unicode"),h=a("mode/yaml_highlight_rules").YamlHighlightRules;(function(){var a=this,d=new RegExp("^["+k.wordChars+"._]+","");this.construct=function(a,b){function c(){return a.apply(this,b)}c.prototype=a.prototype;return new c};this.contains=function(a,b){for(var c=0;c<a.length;c++)if(a[c]===b)return!0;return!1};this.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)};
this.asArray=function(b){return a.isArray(b)?b:[b]};this.getPrimaryState=function(b,c){return a.primaryState(b.getState(c))};this.primaryState=function(b){if(a.isArray(b))for(var c=0;c<b.length;c++){var d=b[c];if("#tmp"!==d)return d||"start"}return b||"start"};this.activeMode=function(b,c){var d=a.primaryState(b),e=d.lastIndexOf("-");return-1===e?c:d.substring(0,e).toLowerCase()};this.endsWith=function(a,b){return-1!==a.indexOf(b,a.length-b.length)};this.escapeRegExp=function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,
"\\$&")};this.embedRules=function(b,c,d,f,g,h,k){"undefined"===typeof h&&(h=["start"]);"undefined"===typeof k&&(k="start");h=a.asArray(h);k=b.$rules;b.embedRules(c,d+"-",[{regex:g,onMatch:function(a,b,c,d,e){a=/^\s*((?:`|-|\.)+)/.exec(a)[1].length;if(e.chunk.width!==a)return this.next=b,"text";this.next=e.chunk.state||"start";delete e.chunk;return"support.function.codeend"}}]);for(b=0;b<h.length;b++)k[h[b]].unshift({regex:f,onMatch:function(a,b,c,e,f){f.chunk=f.chunk||{};if(null!=f.chunk.state)return this.next=
b,"text";a=/^\s*((?:`|-|\.)+)/.exec(a);f.chunk.width=a[1].length;f.chunk.state=b;this.next=d+"-start";return"support.function.codebegin"}})};this.isSingleLineString=function(a){if(2>a.length)return!1;var b=a[0];return"'"!==b&&'"'!==b||a[a.length-1]!==b||"\\"===a[a.length-2]&&"\\"!==a[a.length-3]?!1:!0};this.createTokenIterator=function(a){var b=a.getSelectionRange().start;a=a.getSession();return new g(a,b.row,b.column)};this.isWordCharacter=function(a){return d.test(a)};var b={"'":"'",'"':'"',"`":"`",
"{":"}","(":")","[":"]","<":">","}":"{",")":"(","]":"[",">":"<"};this.isBracket=function(a,b){return!b||"<"!==a&&">"!==a?"{"===a||"}"===a||"("===a||")"===a||"["===a||"]"===a:!0};this.isOpeningBracket=function(a,b){return"{"===a||"("===a||"["===a||!!b&&"<"===a};this.isClosingBracket=function(a,b){return"}"===a||")"===a||"]"===a||!!b&&">"===a};this.getComplement=function(a,c){"undefined"===typeof c&&(c=b);var d=c[a];return"undefined"===typeof d?a:d};this.stripEnclosingQuotes=function(a){var b=a.length;
if(2>b)return a;var d=a[0];return"'"!==d&&'"'!==d&&"`"!==d||a[b-1]!==d?a:a.substr(1,b-2)};this.startsWith=function(a,b){if("string"!==typeof a||"string"!==typeof b||a.length<b.length)return!1;for(var c=0;c<b.length;c++)if(a[c]!==b[c])return!1;return!0};this.getTokenTypeRegex=function(a){return new RegExp("(?:^|[.])"+a+"(?:$|[.])","")};this.embedQuartoHighlightRules=function(a){a.embedRules(h,"quarto-yaml-");for(var b in a.$rules)"start"!==b&&-1===b.indexOf("-start")||a.$rules[b].unshift({token:"comment.doc.tag",
regex:"^\\s*#[|]",next:"quarto-yaml-start",onMatch:function(a,b,c,d,e){e.quarto=e.quarto||{};e.quarto.state=b;return this.token}}),0===b.indexOf("quarto-yaml-")&&(a.$rules[b].unshift({token:["whitespace","comment.doc.tag"],regex:"^(\\s*)(#[|])",next:b}),a.$rules[b].unshift({token:"whitespace",regex:"^\\s*(?!#)",onMatch:function(a,b,c,d,e){this.next=e.quarto.state;return this.token}})),a.$rules["quarto-yaml-start"].unshift({token:"text",regex:"^\\s*(?!#)",onMatch:function(a,b,c,d,e){this.next=e.quarto.state;
return this.token}}),a.$rules["quarto-yaml-multiline-string"].unshift({regex:/^(#[|])(\s*)/,onMatch:function(a,b,c,d,e){a=this.splitRegex.exec(a);this.next=d===a[1]+a[2]?b:e.yaml.indent>=a[2].length?e.yaml.state:b+"-rest";return[{type:"comment.doc.tag",value:a[1]},{type:"indent",value:a[2]}]}})}}).call(l)});define("mode/xml",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("ace/tokenizer").Tokenizer,h=a("mode/xml_highlight_rules").XmlHighlightRules,f=a("mode/xml_behavior").XmlBehaviour,d=a("mode/xml_fold_mode").FoldMode;a=function(){this.$tokenizer=new k((new h).getRules());this.$behaviour=new f;this.foldingRules=new d};m.inherits(a,g);(function(){this.getNextLineIndent=function(a,d,c){return this.$getIndent(d)}}).call(a.prototype);l.Mode=a});define("mode/xml_behavior",["require","exports","module"],function(a,l,m){function g(a,b){var d=!0,c=a.type.split(".");b.split(".").forEach(function(a){if(-1==c.indexOf(a))return d=!1});return d}m=a("ace/lib/oop");var k=a("ace/mode/behaviour").Behaviour,h=a("ace/mode/behaviour/cstyle").CstyleBehaviour,f=a("ace/token_iterator").TokenIterator;a=function(){this.inherit(h,["string_dquotes"]);this.add("autoclosing","insertion",function(a,b,e,c,h){if(">"==h){a=e.getCursorPosition();e=new f(c,a.row,a.column);
c=e.getCurrentToken();b=!1;if(c&&(g(c,"meta.tag")||g(c,"text")&&c.value.match("/")))b=!0;else{do c=e.stepBackward();while(c&&(g(c,"string")||g(c,"keyword.operator")||g(c,"entity.attribute-name")||g(c,"text")))}if(c&&g(c,"meta.tag-name")&&!e.stepBackward().value.match("/"))return e=c.value,b&&(e=e.substring(0,a.column-c.start)),{text:"></"+e+">",selection:[1,1]}}});this.add("autoindent","insertion",function(a,b,e,c,f){if("\n"==f&&(b=e.getCursorPosition(),"</"==c.doc.getLine(b.row).substring(b.column,
b.column+2)))return a=this.$getIndent(c.doc.getLine(b.row))+c.getTabString(),c=this.$getIndent(c.doc.getLine(b.row)),{text:"\n"+a+"\n"+c,selection:[1,a.length,1,a.length]}})};m.inherits(a,k);l.XmlBehaviour=a});define("mode/xml_fold_mode",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/lib/lang"),k=a("ace/range").Range,h=a("ace/mode/folding/fold_mode").FoldMode,f=a("ace/token_iterator").TokenIterator;a=l.FoldMode=function(a){h.call(this);this.voidElements=a||{}};m.inherits(a,h);(function(){this.getFoldWidget=function(a,b,e){a=this._getFirstTagInLine(a,e);return a.closing?"markbeginend"==b?"end":"":!a.tagName||this.voidElements[a.tagName.toLowerCase()]||a.selfClosing||-1!==
a.value.indexOf("/"+a.tagName)?"":"start"};this._getFirstTagInLine=function(a,b){for(var d=a.getTokens(b),c="",f=0;f<d.length;f++){var h=d[f];c=0===h.type.indexOf("meta.tag")?c+h.value:c+g.stringRepeat(" ",h.value.length)}return this._parseTag(c)};this.tagRe=/^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/;this._parseTag=function(a){var b=this.tagRe.exec(a),d=this.tagRe.lastIndex||0;this.tagRe.lastIndex=0;return{value:a,match:b?b[2]:"",closing:b?!!b[3]:!1,selfClosing:b?!!b[5]||"/>"==b[2]:!1,tagName:b?
b[4]:"",column:b[1]?d+b[1].length:d}};this._readTagForward=function(a){var b=a.getCurrentToken();if(!b)return null;var d="",c;do if(0===b.type.indexOf("meta.tag")&&(c||(c={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()}),d+=b.value,-1!==d.indexOf(">")))return d=this._parseTag(d),d.start=c,d.end={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()+b.value.length},a.stepForward(),d;while(b=a.stepForward());return null};this._readTagBackward=function(a){var b=a.getCurrentToken();
if(!b)return null;var d="",c;do if(0===b.type.indexOf("meta.tag")&&(c||(c={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()+b.value.length}),d=b.value+d,-1!==d.indexOf("<")))return b=this._parseTag(d),b.end=c,b.start={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()},a.stepBackward(),b;while(b=a.stepBackward());return null};this._pop=function(a,b){for(;a.length;){var d=a[a.length-1];if(b&&d.tagName!=b.tagName)if(this.voidElements[b.tagName])break;else if(this.voidElements[d.tagName])a.pop();
else return null;else return a.pop()}};this.getFoldWidgetRange=function(a,b,e){var c=this._getFirstTagInLine(a,e);if(!c.match)return null;b=[];if(c.closing||c.selfClosing)for(a=new f(a,e,c.column+c.match.length),c={row:e,column:c.column};e=this._readTagBackward(a);){if(e.selfClosing)if(b.length)continue;else return e.start.column+=e.tagName.length+2,e.end.column-=2,k.fromPoints(e.start,e.end);if(e.closing)b.push(e);else if(this._pop(b,e),0==b.length)return e.start.column+=e.tagName.length+2,k.fromPoints(e.start,
c)}else for(a=new f(a,e,c.column),c={row:e,column:c.column+c.tagName.length+2};e=this._readTagForward(a);){if(e.selfClosing)if(b.length)continue;else return e.start.column+=e.tagName.length+2,e.end.column-=2,k.fromPoints(e.start,e.end);if(e.closing){if(this._pop(b,e),0==b.length)return k.fromPoints(c,e.start)}else b.push(e)}}}).call(a.prototype)});define("mode/xml_highlight_rules",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("mode/xml_util");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var k=function(){this.$rules={start:[{token:"text",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:"xml_pe",regex:"<\\?.*?\\?>"},{token:"comment",merge:!0,regex:"<\\!--",next:"comment"},{token:"xml_pe",regex:"<\\!.*?>"},{token:"meta.tag",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"constant.character.entity",
regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"},{token:"text",regex:"[^<]+"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",regex:"\\s+"},{token:"text",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment",regex:".*?--\x3e",next:"start"},{token:"comment",merge:!0,regex:".+"}]};g.tag(this.$rules,"tag","start")};m.inherits(k,a);l.XmlHighlightRules=k});define("mode/xml_util",["require","exports","module"],function(a,l,m){function g(a,g){return[{token:"string",merge:!0,regex:".*?"+a,next:g},{token:"string",merge:!0,regex:".+"}]}l.tag=function(a,h,f,d){a[h]=[{token:"text",regex:"\\s+"},{token:function(a){return d&&d[a]?"meta.tag.tag-name."+d[a]:"meta.tag.tag-name"},merge:!0,regex:"[-_a-zA-Z0-9:]+",next:h+"_embed_attribute_list"},{token:"empty",regex:"",next:h+"_embed_attribute_list"}];a[h+"_qstring"]=g("'",h+"_embed_attribute_list");a[h+"_qqstring"]=
g('"',h+"_embed_attribute_list");a[h+"_embed_attribute_list"]=[{token:"meta.tag",merge:!0,regex:"/?>",next:f},{token:"keyword.operator",regex:"="},{token:"entity.other.attribute-name",regex:"[-_a-zA-Z0-9:]+"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"text",regex:"\\s+"}].concat([{token:"string",regex:'".*?"'},{token:"string",merge:!0,regex:'["].*',next:h+"_qqstring"},{token:"string",regex:"'.*?'"},{token:"string",merge:!0,regex:"['].*",next:h+"_qstring"}])}});define("mode/yaml",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("mode/yaml_highlight_rules").YamlHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,f=a("ace/mode/folding/coffee").FoldMode;a=function(){this.HighlightRules=k;this.$outdent=new h;this.foldingRules=new f;this.$behaviour=this.$defaultBehaviour};m.inherits(a,g);(function(){this.lineCommentStart="#";this.getNextLineIndent=function(a,b,e){var c=this.$getIndent(b);
"start"==a&&b.match(/^.*[\{\(\[]\s*$/)&&(c+=e);return c};this.checkOutdent=function(a,b,e){return this.$outdent.checkOutdent(b,e)};this.autoOutdent=function(a,b,e){this.$outdent.autoOutdent(b,e)};this.$id="mode/yaml"}).call(a.prototype);l.Mode=a});define("mode/yaml_highlight_rules",["require","exports","module"],function(a,l,m){m=a("ace/lib/oop");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(a){return{token:["constant.numeric","text"],regex:"([-+]?(?:(?:\\d+(?:\\.\\d*)?)|(?:\\.\\d+))(?:[eE][+-]?\\d*)?)(\\s*)"+a}},k=function(){var a={},f=function(a){return{token:["constant.language.boolean","text"],regex:"\\b(true|false|TRUE|FALSE|True|False|yes|no|~)(\\s*)"+a}};a["#string"]=[{token:"string",regex:"'",push:"qstring"},
{token:"string",regex:'"',push:"qqstring"}];a.start=[{token:"comment",regex:"#.*"},{token:"whitespace",regex:"\\s+"},{token:"list.markup",regex:/\b(?:-{3}|\.{3})\s*(?=#|$)/},{token:"list.markup.keyword.operator",regex:/[-?](?=$|\s)/},{token:"constant",regex:"!![\\w//]+"},{token:"constant.language",regex:"[&\\*][a-zA-Z0-9-_]+"},{token:["meta.tag","keyword","meta.tag","keyword.operator"],regex:/\b(\s*[\w\-.]*?)(:{2,3})(\s*[\w\-.]*?)(:(?:\s+|$))/},{token:["meta.tag","keyword.operator"],regex:/\b(\s*[\w\-.]*?)(:(?:\s+|$))/},
{token:"keyword.operator",regex:"<<\\w*:\\w*"},{token:"keyword.operator",regex:"-\\s*(?=[{])"},{include:"#string"},{token:"string",regex:/[|>][-+\d\s]*$/,onMatch:function(a,b,e,c,f){a=/^(?:#[|])?(\s*)/.exec(c)[1];f.yaml=f.yaml||{};f.yaml.state=b;f.yaml.indent=a.length;this.next=b.replace(/start$/,"multiline-string");return this.token}},g("(?=(?:$|#))"),f("(?=(?:$|#))"),{token:"paren.lparen.keyword.operator",regex:"\\[",push:"list"},{token:"paren.lparen.keyword.operator",regex:"\\{",push:"dictionary"},
{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:["text","whitespace","comment"],regex:"(.+?)(?:$|(\\s+)(#.*))"}];a.list=[{token:"paren.rparen.keyword.operator",regex:"\\]",next:"pop"},{token:"whitespace",regex:"\\s+"},{token:"punctuation.keyword.operator",regex:","},{token:"paren.lparen.keyword.operator",regex:"\\[",push:"list"},{token:"paren.lparen.keyword.operator",regex:"\\{",push:"dictionary"},{include:"#string"},g("(?=(?:$|[,\\]]))"),f("(?=(?:$|[,\\]]))"),{token:"text",
regex:"[^,\\]]+"}];a.dictionary=[{token:"paren.rparen.keyword.operator",regex:"\\}",next:"pop"},{token:"whitespace",regex:"\\s+"},{token:"punctuation.keyword.operator",regex:"[:,]"},{token:"paren.lparen.keyword.operator",regex:"\\[",push:"list"},{token:"paren.lparen.keyword.operator",regex:"\\{",push:"dictionary"},{include:"#string"},g("(?=(?:$|[:,}]))"),f("(?=(?:$|[:,}]))"),{token:"text",regex:"[^}:,]+"}];a.qstring=[{token:"constant.language.escape",regex:"''"},{token:"string",regex:"'",next:"pop"},
{token:"string",regex:"[^']+"}];a.qqstring=[{token:"constant.language.escape",regex:"\\\\."},{token:"string",regex:'"',next:"pop"},{token:"string",regex:'[^\\\\"]+'}];a["multiline-string"]=[{token:"string",regex:/\s*/,onMatch:function(a,b,e,c,f){if(/^\s*(?:#[|])?\s*$/.test(c))return this.next=b,this.token;this.next=f.yaml.indent>=a.length?f.yaml.state:b+"-rest";return this.token}}];a["multiline-string-rest"]=[{token:"string",regex:".+",next:"multiline-string"}];this.$rules=a;this.normalizeRules()};
m.inherits(k,a);l.YamlHighlightRules=k});define("theme/default",["require","exports","module"],function(a,l,m){a("ace/lib/dom");l.cssClass="ace-rs"});if(!String.prototype.trimRight){var trimEndRegexp=/\s\s*$/;String.prototype.trimRight=function(){return String(this).replace(trimEndRegexp,"")}}
define("rstudio/loader",["require","exports","module"],function(a,l,m){var g=a("ace/edit_session").EditSession,k=a("ace/editor").Editor;a("ace/lib/event_emitter");a("util/expand_selection");var h=a("ace/range").Range,f=a("ace/virtual_renderer").VirtualRenderer,d=a("ace/mode/text").Mode,b=a("ace/undomanager").UndoManager,e=a("mode/utils");a("ace/lib/event");m=a("ace/lib/oop");a("mixins/token_iterator");var c=function(a,b){b.renderer=a;k.call(this,a,b);this.setBehavioursEnabled(!0)};m.inherits(c,k);
(function(){this.$highlightBrackets=function(){if(this.session.selection.isEmpty())k.prototype.$highlightBrackets.call(this);else{var a=this.session;a.$bracketHighlight&&(a.$bracketHighlight.markerIds.forEach(function(b){a.removeMarker(b)}),a.$bracketHighlight=null)}};this.insert=function(a,b){if(!this.session.selection.isEmpty()){var c=[];"quotes"===this.$surroundSelection?c=["'",'"',"`"]:"quotes_and_brackets"===this.$surroundSelection&&(c="'\"`({[".split(""));if("quotes_and_brackets"===this.$surroundSelection){var d=
this.session.$mode;if(/\/markdown$/.test(d.$id))c.push("*","_");else{var f=this.getCursorPosition();d.getLanguageMode&&"Markdown"===d.getLanguageMode(f)&&c.push("*","_")}}if(e.contains(c,a))return c=e.getComplement(a),this.session.replace(this.session.selection.getRange(),a+this.session.getTextRange()+c)}return k.prototype.insert.call(this,a,b)};this.remove=function(a){return this.session.getMode().wrapRemove?this.session.getMode().wrapRemove(this,k.prototype.remove,a):k.prototype.remove.call(this,
a)};this.undo=function(){k.prototype.undo.call(this);this._dispatchEvent("undo")};this.redo=function(){k.prototype.redo.call(this);this._dispatchEvent("redo")};this.onPaste=function(a,b){k.prototype.onPaste.call(this,a.replace(/\r\n|\n\r|\r/g,"\n"),b)}}).call(c.prototype);var r=function(a,b){g.call(this,a,b)};m.inherits(r,g);(function(){this.insert=function(a,b){return this.getMode().wrapInsert?this.getMode().wrapInsert(this,g.prototype.insert,a,b):g.prototype.insert.call(this,a,b)};this.reindent=
function(a){var b=this.getMode();if(b.getNextLineIndent){var c=a.start.row;a=a.end.row;0===c&&(this.applyIndent(0,""),c++);for(var d=c;d<=a;d++){var f=e.getPrimaryState(this,d-1);if(!e.endsWith(f,"qstring")&&"rawstring"!==f){var g=b.getNextLineIndent(f,this.getLine(d-1),this.getTabString(),d-1,!0);this.applyIndent(d,g);b.autoOutdent(f,this,d)}}b=b.codeModel;"undefined"!==typeof b&&(b=b.alignContinuationSlashes,"undefined"!==typeof b&&b(this.getDocument(),{start:c,end:a}))}};this.applyIndent=function(a,
b){var c=this.getLine(a).match(/^\s*/g)[0].length;this.replace(new h(a,0,a,c),b)};this.setDisableOverwrite=function(a){a?(this.setOverwrite(!1),this.setOverwrite=function(){},this.getOverwrite=function(){return!1}):(this.setOverwrite=g.prototype.setOverwrite,this.getOverwrite=g.prototype.getOverwrite)}}).call(r.prototype);var p=function(){b.call(this)};m.inherits(p,b);(function(){this.peek=function(){return this.$undoStack.length?this.$undoStack[this.$undoStack.length-1]:null}}).call(p.prototype);
var q=function(a,b){f.call(this,a,b)};m.inherits(q,f);(function(){this.setTheme=function(a){a&&f.prototype.setTheme.call(this,a)}}).call(q.prototype);l.RStudioEditor=c;l.loadEditor=function(b){function e(a){f.editor.commands.removeCommand(a)}var f={};b.env=f;b=new q(b,"");var g=new r("");b=new c(b,g);f.editor=b;g=b.getSession();g.setMode(new d);g.setUndoManager(new p);b=a("ace/config");b.set("basePath","ace");b.set("workerPath","js/workers");b.setDefaultValue("session","useWorker",!1);e("findnext");
e("findprevious");e("find");e("replace");e("togglecomment");e("gotoline");e("foldall");e("unfoldall");return f.editor}});define("rstudio/snippets",["require","exports","module"],function(a,l,m){l.toSnippetText=function(a){for(var g=a.length,h="",f=0;f<g;f++){var d=a[f];h+="snippet "+d.name+"\n\t"+d.content.replace(/\n/g,"\n\t")+"\n\n"}return h};l.normalizeSnippets=function(a){for(var g=a.length,h=0;h<g;h++){var f=a[h];null==f.tabTrigger&&(f.tabTrigger=f.name);f.content=f.content.replace("\n    ","\n\t")}}});define("rstudio/snippets/c_cpp",["require","exports","module"],function(a,l,m){m=a("rstudio/snippets");a=a("ace/snippets").snippetManager;var g=[{name:"once",content:"#ifndef ${1:`HeaderGuardFileName`}\n#define ${1:`HeaderGuardFileName`}\n\n${0}\n\n#endif /* ${1:`HeaderGuardFileName`} */"},{name:"ans",content:"namespace {\n${0}\n} // anonymous namespace"},{name:"ns",content:"namespace ${1:ns} {\n${0}\n} // namespace ${1:ns}"},{name:"cls",content:"class ${1:ClassName} {\npublic:\n    ${2}\nprivate:\n    ${3}\n};"},
{name:"str",content:"struct ${1} {\n    ${0}\n};"},{name:"ept",content:"// [[Rcpp::export]]\n"}];m.normalizeSnippets(g);l.snippetText=m.toSnippetText(g);a.register(g,"c_cpp")});define("rstudio/snippets/markdown",["require","exports","module"],function(a,l,m){m=a("rstudio/snippets");a=a("ace/snippets").snippetManager;var g=[{name:"[",content:"[${1:label}](${2:location})"},{name:"![",content:"![${1:label}](${2:location})"},{name:"r",content:"```{r ${1:label}, ${2:options}}\n${0}\n```"},{name:"rcpp",content:"```{r, engine='Rcpp'}\n#include <Rcpp.h>\nusing namespace Rcpp;\n\n${0}\n\n```"}];m.normalizeSnippets(g);l.snippetText=m.toSnippetText(g);a.register(g,"markdown")});define("rstudio/snippets/r",["require","exports","module"],function(a,l,m){m=a("rstudio/snippets");a=a("ace/snippets").snippetManager;var g=[{name:"lib",content:"library(${1:package})"},{name:"req",content:"require(${1:package})"},{name:"src",content:'source("${1:file.R}")'},{name:"ret",content:"return(${1:code})"},{name:"mat",content:"matrix(${1:data}, nrow = ${2:rows}, ncol = ${3:cols})"},{name:"sg",content:'setGeneric("${1:generic}", function(${2:x, ...}) {\n    standardGeneric("${1:generic}")\n})'},
{name:"sm",content:'setMethod("${1:generic}", ${2:class}, function(${2:x, ...}) {\n    ${0}\n})'},{name:"sc",content:'setClass("${1:Class}", slots = c(${2:name = "type"}))'},{name:"if",content:"if (${1:condition}) {\n    ${0}\n}"},{name:"el",content:"else {\n    ${0}\n}"},{name:"ei",content:"else if (${1:condition}) {\n    ${0}\n}"},{name:"fun",content:"${1:name} <- function(${2:variables}) {\n    ${0}\n}"},{name:"for",content:"for (${1:variable} in ${2:vector}) {\n    ${0}\n}"},{name:"while",content:"while (${1:condition}) {\n    ${0}\n}"},
{name:"switch",content:"switch (${1:object},\n    ${2:case} = ${3:action}\n)"},{name:"apply",content:"apply(${1:array}, ${2:margin}, ${3:...})"},{name:"lapply",content:"lapply(${1:list}, ${2:function})"},{name:"sapply",content:"sapply(${1:list}, ${2:function})"},{name:"mapply",content:"mapply(${1:function}, ${2:...})"},{name:"tapply",content:"tapply(${1:vector}, ${2:index}, ${3:function})"},{name:"vapply",content:"vapply(${1:list}, ${2:function}, FUN.VALUE = ${3:type}, ${4:...})"},{name:"rapply",
content:"rapply(${1:list}, ${2:function})"},{name:"ts",content:'`r paste("#", date(), "------------------------------\\n")`'},{name:"shinyapp",content:"library(shiny)\n\nui <- fluidPage(\n  ${0}\n)\n\nserver <- function(input, output, session) {\n  \n}\n\nshinyApp(ui, server)"},{name:"shinymod",content:"${1:name}UI <- function(id) {\n  ns <- NS(id)\n  tagList(\n    ${0}\n  )\n}\n\n${1:name}Server <- function(id) {\n  moduleServer(\n    id,\n    function(input, output, session) {\n      \n    }\n  )\n}"}];
m.normalizeSnippets(g);l.snippetText=m.toSnippetText(g);a.register(g,"r")});define("rstudio/snippets/stan",["require","exports","module"],function(a,l,m){m=a("rstudio/snippets");a=a("ace/snippets").snippetManager;var g=[{name:"for",content:"for (${1:var} in ${2:start}:${3:end}) {\n  ${0}\n}"},{name:"if",content:"if (${1:condition}) {\n  ${0}\n}"},{name:"el",content:"else (${1:condition}) {\n  ${0}\n}"},{name:"ei",content:"else if (${1:condition}) {\n  ${0}\n}"},{name:"<l",content:"<lower = ${1:expression}>${0}"},{name:"<u",content:"<upper = ${1:expression}>${0}"},{name:"<lu",
content:"<lower = ${1:expression}, upper = ${2:expression}>${0}"},{name:"while",content:"while (${1:condition}) {\n  ${0}\n}"},{name:"gen",content:"generated quantities {\n  ${0}\n}"},{name:"mdl",content:"model {\n  ${0}\n}"},{name:"par",content:"parameters {\n  ${0}\n}"},{name:"tpar",content:"transformed parameters {\n  ${0}\n}"},{name:"data",content:"data {\n  ${0}\n}"},{name:"tdata",content:"transformed data {\n  ${0}\n}"},{name:"ode",content:"integrate_ode(${1:function}, ${2:y0}, ${3:t0}, ${4:t}, ${5:theta}, ${6:x_r}, ${7:x_i});"},
{name:"funs",content:"functions {\n  ${0}\n}"},{name:"fun",content:"${1:return} ${2:name} (${3:args}) {\n  ${0}\n}"}];m.normalizeSnippets(g);l.snippetText=m.toSnippetText(g);a.register(g,"stan")});define("rstudio/snippets/yaml",["require","exports","module"],function(a,l,m){m=a("rstudio/snippets");a=a("ace/snippets").snippetManager;var g=[{name:"key",content:"${1:key}: ${2:value}"},{name:"list",content:"${1:key}:\n  - ${2:value1}\n  - ${3:value2}"}];m.normalizeSnippets(g);l.snippetText=m.toSnippetText(g);a.register(g,"yaml")});