var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var k=0;return function(){return k<a.length?{done:!1,value:a[k++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var k="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return k?k.call(a):$jscomp.arrayIterator(a)};
define("mixins/token_iterator",["require","exports","module"],function(a,k,l){var g=a("ace/token_iterator").TokenIterator,h=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 p=1,n,q=c.clone();n=b.call(q);)if(n=a(n),n===e){if(p--,0===p)return c.moveToTokenIterator(q),!0}else n===d&&p++;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 h.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,k,l){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),h.addListener(a.renderer.scroller,"mousemove",this.onMouseMove),h.addListener(a.renderer.content,"mouseout",this.onMouseOut))}a("ace/lib/dom");l=a("ace/lib/oop");var h=a("ace/lib/event"),m=a("ace/range").Range,f=a("ace/tooltip").Tooltip;
l.inherits(g,f);(function(){this.token={};this.range=new m;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 m(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();h.removeListener(this.editor.renderer.scroller,"mousemove",this.onMouseMove);h.removeListener(this.editor.renderer.content,"mouseout",this.onMouseOut);delete this.editor.tokenTooltip}}).call(g.prototype);k.TokenTooltip=g});define("mode/auto_brace_insert",["require","exports","module"],function(a,k,l){var g=a("ace/range").Range,h=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(h.prototype);k.setInsertMatching=function(a){h.prototype.insertMatching=a}});define("mode/c_cpp",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,h=a("ace/tokenizer").Tokenizer,m=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,
n=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 h((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 n(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};l.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 p=b;p<=
e;p++)if(!a.test(c.getLine(p))){d=!1;break}if(d)for(d=new m(0,0,0,0),p=b;p<=e;p++)b=c.getLine(p).match(a),d.start.row=p,d.end.row=p,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);k.Mode=a});define("mode/c_cpp_fold_mode",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("ace/range").Range;a=a("ace/mode/folding/fold_mode").FoldMode;k=k.FoldMode=function(){};l.inherits(k,a);(function(){function a(a,e,c,d){a=a.doc.$lines;for(var b=e+d,f=a[b],p=0<d?"*/":"/*",r;null!=f;){var m=f.indexOf(p);if(-1!==m){r=0<d?new g(e,c,b,m):new g(b,f.length,e,c);break}b+=d;f=a[b]}return r}function m(a,e,c,d,n){for(var b=e+n,p=a.doc.$lines;0<=b&&b<a.getLength();){for(var f=a.getTokens(b),
r=p[b],m=0;m<f.length;m++)if(f[m].type===d)return 0<n?new g(e,c,b,0):new g(b,r.length,e,c);b+=n}}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),n;if(n=r.match(f))return this.openingBracketBlock(b,n[1],c,n.index);if(n=
"markbeginend"===e&&r.match(d))return this.closingBracketBlock(b,n[1],c,n.index+n[0].length);e=b.getTokens(c);for(n=0;n<e.length;n++){var q=e[n];if("support.function.codebegin"===q.type)return m(b,c,r.length,"support.function.codeend",1);if("support.function.codeend"===q.type)return m(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(k.prototype)});define("mode/c_cpp_highlight_rules",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("ace/lib/lang"),h=a("mode/doc_comment_highlight_rules").DocCommentHighlightRules,m=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"]),n="new delete >>= <<= ->* ... << >> && || == != <= >= :: *= += -= /= ++ -- &= ^= %= -> .* ! $ & | + - * / ^ ~ = %".split(" "),q=n.map(function(c){return a(c)}).join("|");n=["->*"].concat(n).concat("< > , () [] ->".split(" ")).map(function(c){return a(c)});n=["new\\s*\\[\\]","delete\\s*\\[\\]"].concat(n);n="operator\\s*(?:"+n.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:"\\/\\/.*$"},h.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",regex:"#\\s*include\\b",next:"include"},{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:n},{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:".+"}],include:[{token:"string",regex:/<.+>/,next:"start"},{token:"string",regex:/".+"/,next:"start"}]};q=(new f("comment")).getRules();for(n=0;n<q.start.length;n++)q.start[n].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(h,"doc-",[h.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"})};l.inherits(a,m);k.c_cppHighlightRules=a});define("mode/c_cpp_matching_brace_outdent",["require","exports","module"],function(a,k,l){var g=a("ace/range").Range,h=a("mode/token_cursor").CppTokenCursor;l=function(a){this.codeModel=a};var m=a("mode/utils"),f=!0,d=!0,b=!0,e=!0,c=!0,r=!0,n=!0,q=!0,p=!0,t=!0,B=!0,v=!0;(function(){this.setIndent=function(a,c,b,e,d){a=a.getDocument();e="string"===typeof e?e:"";var p=a.$lines[b];b=this.$getIndent(a.$lines[c]);p=this.$getIndent(p);("function"!==typeof d||d(b,p))&&a.replace(new g(c,0,c,b.length),p+e)};
this.checkOutdent=function(a,c,b){return m.endsWith(a,"start")&&(":"===b||/^\s*[#\{\}>\]\)<.:]/.test(b)||"="===b)||m.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 p=e.indexOf("=");if(-1!==d&&-1!==p&&/,\s*$/.test(e)){a=a.getDocument();b=this.$getIndent(b);if(b.length>=p)return!1;d=p-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,u){a=q.doc;var A=a.getLine(u),x=null;0<u&&(x=a.getLine(u-1));if(!t||!this.alignStartToken("<<",q,u,A,x))if(!p||!this.alignStartToken(">>",
q,u,A,x))if(!n||!this.alignStartToken(".",q,u,A,x)){if(f&&/^\s*:/.test(a.getLine(u))&&!/^\s*::/.test(a.getLine(u))&&this.codeModel.$tokenUtils.$tokenizeUpToRow(u)){var z=new h(this.codeModel.$tokens,u,0),k=-1,y=z.cloneCursor();if(")"===y.peekBwd().currentValue()||"keyword"===y.peekBwd().currentType()){do{z=y.currentType();var H=y.currentValue();if("identifier"===z||";"===H){k=y.$row;break}"keyword"!==z&&y.bwdToMatchingToken()}while(y.moveToPreviousToken())}else z.moveToPreviousToken(),z.bwdOverClassySpecifiers()&&
(k=z.$row);0<=k&&this.setIndent(q,u,k,q.getTabString(),function(a,c){return a===c})}if(r&&/^\s*>/.test(A)&&!/^\s*>>/.test(A)&&(k=this.codeModel.getRowForMatchingEOLArrows(q,a,u),0<=k)){this.setIndent(q,u,k);return}if(e&&/^\s*\}/.test(A)&&(k=q.findMatchingBracket({row:u,column:A.indexOf("}")+1}),null!==k)){if(/^\s*\{/.test(a.$lines[k.row])){this.setIndent(q,u,k.row);return}k=this.codeModel.getRowForOpenBraceIndent(q,k.row);if(0<=k){this.setIndent(q,u,k);return}}if(d&&/^\s*\)/.exec(A)&&(k=q.findMatchingBracket({row:u,
column:A.indexOf(")")+1}))){this.setIndent(q,u,k.row);return}if(c&&/^\s*\]/.exec(A)&&(k=q.findMatchingBracket({row:u,column:A.indexOf("]")+1}))){this.setIndent(q,u,k.row);return}if(B&&/^\s*public\s*:\s*$|^\s*private\s*:\s*$|^\s*protected\s*:\s*$/.test(A)&&(y=q.$findOpeningBracket("}",{row:u,column:A.length},m.getTokenTypeRegex("paren")))){k=this.codeModel.getRowForOpenBraceIndent(q,y.row);0<=k?this.setIndent(q,u,k):this.setIndent(q,u,y.row);return}if(v&&(/^\s*case.+:/.test(A)||/^\s*default\s*:/.test(A))&&
(y=q.$findOpeningBracket("}",{row:u,column:/(\S)/.exec(A).index+1},m.getTokenTypeRegex("paren")))){k=this.codeModel.getRowForOpenBraceIndent(q,y.row);0<=k?this.setIndent(q,u,k):this.setIndent(q,u,y.row);return}if(b&&/^\s*\{/.test(A)&&!/;\s*$/.test(x)){if(this.codeModel.$tokenUtils.$tokenizeUpToRow(u)&&(z=new h(this.codeModel.$tokens),z.$row=u,z.$offset=0,z.moveToPreviousToken()&&"="===z.currentValue()))return;x=this.codeModel.getRowForOpenBraceIndent(q,u);if(0<=x){this.setIndent(q,u,x);return}}/^\s*#/.test(A)&&
(q=this.$getIndent(A),a.replace(new g(u,0,u,q.length),""))}};this.$getIndent=function(a){return(a=a.match(/^(\s+)/))?a[1]:""}}).call(l.prototype);k.CppMatchingBraceOutdent=l;k.getOutdentColon=function(){return f};k.setOutdentColon=function(a){f=a};k.getOutdentRightParen=function(){return d};k.setOutdentRightParen=function(a){d=a};k.getOutdentLeftBrace=function(){return b};k.setOutdentLeftBrace=function(a){b=a};k.getOutdentRightBrace=function(){return e};k.setOutdentRightBrace=function(a){e=a};k.getOutdentRightBracket=
function(){return c};k.setOutdentRightBracket=function(a){c=a};k.getOutdentRightArrow=function(){return r};k.setOutdentRightArrow=function(a){r=a};k.getAlignDots=function(){return n};k.setAlignDots=function(a){n=a};k.getAlignEquals=function(){return q};k.setAlignEquals=function(a){q=a};k.getAlignStreamIn=function(){return p};k.setAlignStreamIn=function(a){p=a};k.getAlignStreamOut=function(){return t};k.setAlignStreamOut=function(a){t=a};k.getAlignClassAccessModifiers=function(){return B};k.setAlignClassAccessModifiers=
function(a){B=a};k.getAlignCase=function(){return v};k.setAlignCase=function(a){v=a}});define("mode/behaviour/cstyle",["require","exports","module"],function(a,k,l){l=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 h=a("mode/utils"),m=!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],p=e.doc.getTextRange(b);if(!b.isMultiLine()&&p==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,p){if("R"===p||"r"===p)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,p){if("\n"===p){var f=e.getCursorPosition();p=f.row;var n=f.column;b=d.getTabString();var q=d.doc.$lines;e=q[p];if(!this.codeModel.inMacro(q,p-1)){var r=/^(\s*\/\/'\s*)/.exec(e);if(r&&n>=r[1].length)return{text:"\n"+r[1]};if(/^\s*[/][*]+\s*$/.test(e)&&!/^\s*[*]/.test(q[p+1]||""))return d=this.$getIndent(e),b=d+" * ",{text:"\n"+b+"\n"+d+" */",selection:[1,b.length,1,b.length]};if(h.endsWith(c,"comment")||h.endsWith(c,"doc-start")){f&&f.row==p&&(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=n-1;/\s/.test(e[c]);)--c;c=e[c];n=e[n];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&&")"==n||"["==c&&"]"==n)return e=this.$getIndent(e),d=e+b,{text:"\n"+d+"\n"+e,selection:[1,d.length,1,d.length]};if("{"==c&&"}"==n){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]};p=a.getRowForOpenBraceIndent(d,p);if(null!==p&&0<=p)return e=this.$getIndent(d.getDocument().getLine(p)),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,p){if(this.insertMatching){if("{"==p&&(a=d.getSelectionRange(),""===f.doc.getTextRange(a))){a=this.codeModel.getTokenCursor();
if(!a.moveToPosition(d.getCursorPosition()))return b("{",p,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(m&&"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("{",p,d,
f)}});this.add("braces","deletion",function(a,b,e,d,p){if(this.insertMatching&&(a=d.doc.getTextRange(p),!p.isMultiLine()&&"{"==a)){a=d.doc.getLine(p.start.row);if(/^\s*do\s*\{\} while \(\);\s*$/.test(a))return p.end.column=a.length,p;d=a.substring(p.end.column,p.end.column+1);a=a.substring(p.end.column+1,p.end.column+2);if("}"==d)return p.end.column++,";"==a&&p.end.column++,p}});this.add("parens","insertion",function(a,e,d,f,p){if(this.insertMatching)return b("(",p,d,f)});this.add("parens","deletion",
function(a,b,d,f,p){if(this.insertMatching)return e("(",p,f)});this.add("brackets","insertion",function(a,e,d,f,p){if(this.insertMatching)return b("[",p,d,f)});this.add("brackets","deletion",function(a,b,d,f,p){if(this.insertMatching)return e("[",p,f)});this.add("arrows","insertion",function(a,e,d,f,p){if(this.insertMatching&&(a=f.getLine(d.getCursorPosition().row),/^\s*#\s*include/.test(a)))return b("<",p,d,f)});this.add("arrows","deletion",function(a,b,d,f,p){if(this.insertMatching)return e("<",
p,f)});this.add("string_dquotes","insertion",function(a,b,e,d,p){if(this.insertMatching&&('"'==p||"'"==p)){a=e.getSelectionRange();b=d.doc.getTextRange(a);if(""!==b)return{text:p+b+p,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,n=-1,m=0;m<d.length;m++){f=d[m];"string"==f.type?n=-1:0>n&&(n=f.value.indexOf(p));if(f.value.length+c>a.start.column)break;c+=d[m].value.length}if(!f||0>n&&"comment"!==
f.type&&("string"!==f.type||a.start.column!==f.value.length+c-1&&f.value.lastIndexOf(p)===f.value.length-1))return{text:p+p,selection:[1,1]};if(f&&"string"===f.type&&b.substring(e.column,e.column+1)==p)return{text:"",selection:[1,1]}}});this.add("string_dquotes","deletion",function(a,b,e,d,p){if(this.insertMatching&&(a=d.doc.getTextRange(p),!p.isMultiLine()&&('"'==a||"'"==a)&&(d=d.doc.getLine(p.start.row).substring(p.start.column+1,p.start.column+2),'"'===d||"'"===d)))return p.end.column++,p});this.add("punctuation.operator",
"insertion",function(a,b,e,d,p){if(this.insertMatching&&";"===p&&(a=e.selection.getCursor(),";"==d.getLine(a.row)[a.column]))return{text:"",selection:[1,1]}});this.add("macro","insertion",function(a,b,e,d,p){b=e.getPrintMarginColumn();b=Math.min(62,b);var c=d.getDocument().$lines,f=e.getCursorPosition(),m=f.row,n=c[m];e=n.substring(0,f.column);if(/^\s*#\s*define[^\\]*$/.test(n)&&"\\"==p)return a=b-e.length+1,0<=a?{text:Array(a+1).join(" ")+"\\\n"+this.$getIndent(n)+d.getTabString(),selection:!1}:
{text:"\\\n"+d.getTabString(),selection:!1};if(/^\s*#\s*define/.test(n)||this.codeModel.inMacro(c,m-1)){if("\\"==p&&/^\s*$/.test(n.substring(e.length,n.length)))return a=b-e.length+1,0<=a?{text:Array(a+1).join(" ")+"\\",selection:!1}:{text:"\\",selection:!1};if("\n"==p){if(/^\s*$/.test(n)||/^\s*#\s*define/.test(n)&&!/\\\s*$/.test(n))return{text:"\n",selection:!1};if(/\\\s*$/.test(n)&&!/\\\s*$/.test(e))return{text:"",selection:[1,f.column,1,f.column]};d=d.getMode().getNextLineIndent(a,n+"\\",d.getTabString(),
m,!1);a=b-e.length+1;p=/\\\s*$/.test(e)?"":"\\";return 0<=a?{text:Array(a+1).join(" ")+p+"\n"+d,selection:!1}:{text:p+"\n"+d,selection:!1}}}})};l.inherits(a,g);k.CStyleBehaviour=a;k.setFillinDoWhile=function(a){m=a};k.getFillinDoWhile=function(){return m}});define("mode/cpp_code_model",["require","exports","module"],function(a,k,l){a("ace/lib/oop");var g=a("ace/range").Range,h=a("mode/token_utils").TokenUtils;a("ace/token_iterator");var m=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,m,p){this.$session=a;this.$doc=a.getDocument();this.$tokenizer=b;this.$tokens=Array(this.$doc.getLength());
this.$statePattern=e;this.$codeBeginPattern=m;this.$codeEndPattern=p;this.$tokenUtils=new h(this.$doc,this.$tokenizer,this.$tokens,this.$statePattern,this.$codeBeginPattern);this.$scopes=new d(f);var c=!0,n=function(a,b){c?c=!1:(this.$doc.off("change",g),this.$session.off("changeMode",n))}.bind(this),g=function(a){this.$onDocChange(a)}.bind(this);this.$session.on("changeMode",n);this.$doc.on("change",g)};(function(){var a=e.contains;this.getTokenCursor=function(){return new m(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," ")},p=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(k.test(b[e])){var d=e;for(e+=1;k.test(b[e])&&e<=c.end;)e++;for(var p=e,f=b.slice(d,p).map(function(a){return a.lastIndexOf("\\")}),m=Math.max.apply(null,f),n=0;n<p-
d;n++){var g={row:d+n,column:f[n]},q=Array(m-f[n]+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 h=/^\s*#\s*define/,k=/\\\s*$/,v=/^\s*[+\-/&^%$!<>.?|=~]|^\s*\*[^/]|^\s*\/[^\*]/,
l=/[+\-*&^%$!<>.?|=~]\s*$|\*[^/]\s*$|\/[^\*]\s*$/,E=function(a){return v.test(a)||l.test(a)};this.inMacro=function(a,c){var b=a[c];return 0>c?!1:k.test(b)?h.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 m="";e=b.currentValue();f="";var n=this.$scopes.getActiveScopes(b.currentPosition());null!=n&&(n=n[n.length-1],n.isClass()&&n.label==="class "+e?"~"===b.peekBwd().currentValue()&&(e="~"+
e):(m=b.cloneCursor(),d(m,this),m.moveToNextToken(),m=m.currentPosition(),n=b.currentPosition(),m=this.$session.getTextRange(new g(m.row,m.column,n.row,n.column))));var r=b.peekFwd();n=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(n.row,
n.column,r.row,r.column))));m=0<m.length?p(e.trim()+f.trim()+": "+m.trim()):p(e.trim()+f.trim());this.$scopes.onFunctionScopeStart(m,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),p=0;p<this.$tokens.length;p++)if(null!=
this.$tokens[p]&&0<this.$tokens[p].length){var m=this.$tokens[p];"\\"===m[m.length-1].value&&(d[p]=this.$tokens[p].splice(m.length-1,1)[0])}var n=this.getTokenCursor();if(e){var g=b.getSelection().getCursor();if(!n.moveToPosition(g))return 0}else for(n.$row=c,p=n.$tokens[c].length-1,p=n.$tokens[c].length-1;0<=p&&(n.$offset=p,"{"!==n.currentValue());p--);if("{"===n.peekBwd().currentValue()||";"===n.currentValue())return-1;n.bwdOverInitializationList();n.bwdOverClassInheritance();if("{"===n.currentValue()&&
!n.moveToPreviousToken()||"{"===n.currentValue())return-1;for(;"keyword"===n.currentType();){var r=n.currentValue();if(a(f,r)||0===n.$row&&0===n.$offset)return n.$row;if(!n.moveToPreviousToken())return-1}if(":"===n.currentValue()){var q=n.peekBwd().currentValue();if(a(["public","private","protected"],q))return n.moveToNextToken(),n.$row}if(":"===n.currentValue())for(;n.moveToPreviousToken();){if(n.bwdToMatchingToken())if("keyword"===n.peekBwd().currentType())continue;else break;if("identifier"===
n.currentType())break}if(")"===n.currentValue()&&!n.bwdToMatchingToken()||"("===n.currentValue()&&!n.moveToPreviousToken())return-1;"="===n.currentValue()&&n.moveToPreviousToken();return n.$row}finally{for(p=0;p<d.length;p++)"undefined"!==typeof d[p]&&this.$tokens[p].push(d[p])}return-1};this.getLineSansComments=function(a,b,c){if(0>b)return"";a=a.getLine(b);var e=/(?!\\)"/g,d=a,p;for(b=[];p=e.exec(d);)b.push(p.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));k.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,p,f,n){var m=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),p,f-1,n);var t=this.$getIndent(d),v=this.$getUnindent(d,r),u=q.$lines;if(e.endsWith(c,"comment")||e.endsWith(c,"doc-start")){l&&l.row==f&&(d=d.substring(0,l.column));if(/^\s*$/.test(d))return this.$getIndent(u[f]);l=this.findStartOfCommentBlock(u,f,200);if(null!==l)return this.$getIndent(u[l])+" "}if(e.endsWith(c,"start")){if(h.test(d))return/\\\s*$/.test(d)?
t+p:t;if(/^\s*#\s*\S/.test(d))return t;if(this.inMacro(u,f-1)&&!k.test(d))return v;d=this.getLineSansComments(q,f);var l=g.getSelection().getCursor();l&&l.row==f&&!n&&(d=d.substring(0,l.column));c=this.getLineSansComments(q,f-1);if("string"!==typeof d)return"";if(0===d.length||/^\s*$/.test(d))return this.$getIndent(u[f]);if(/\*\/\s*$/.test(d)&&(v=this.findStartOfCommentBlock(u,f,200),0<=v))return this.$getIndent(u[v]);if(/^\s*<</.test(d)){for(d=f-1;/^\s*<</.test(u[d]);)d--;return this.$getIndent(u[d])}if(/^\s*\./.test(d)){for(d=
f-1;/^\s*\./.test(u[d]);)d--;return this.$getIndent(u[d])}if(/\bnamespace\b.*\{\s*$/.test(d)||/\bswitch\b.*\{\s*$/.test(d))return t;if(d.match(/\(\s*$/))return-1!==d.indexOf("=")||/^\s*(return\s+)?[a-zA-Z0-9_.->:]+\(\s*$/.test(d)?t+p:t+p+p;if(/^\s*(class|struct)\s*[\w]+\s*$/.test(d)||/^\s*(class|struct).*\{\s*$/.test(d)||/^\s*(class|struct)\s+.+:\s*$/.test(d))return t+p;if((v=d.match(/(^\s*(?:class|struct)\s+.*\w[^:]):[^:]\s*.+/))&&!/,\s*/.test(d)||(v=d.match(/^(\s*(class|struct).*:\s*).*,\s*$/))||
(v=d.match(/^(\s*:\s*)(\w+).*,\s*$/))||(v=d.match(/^(\s*)[:,]\s*[\w\s]*$/)))return m?Array(v[1].length+1).join(" "):t+p;if(/<\s*$/.test(d))return t+p;if(/^\s*".*"\s*$/.test(d)||/^\s*template\s*<.*>\s*$/.test(d)&&d.split(">").length==d.split("<").length)return t;if(/([\[\{\(<]).+,\s*$/.exec(d)){var B=["(","{","[","<"];for(v=0;v<B.length;v++){var z=B[v],x=this.$complements[z];z=this.allIndicesOf(d,z);if(z.length&&(x=this.allIndicesOf(d,x),x=z.length-x.length-1,!(0>x)))return u=z[x],m?(d=d.substr(u+
1).match(/([^\s])/),Array(u+d.index+2).join(" ")):t+p}}for(v=f-1;0<=v&&/^\s*$|^\s*#/.test(c);)c=this.getLineSansComments(q,v),v--;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(v=0;v<this.$tokens.length;v++)if(null!=this.$tokens[v]&&0<this.$tokens[v].length){var A=this.$tokens[v];"\\"===A[A.length-1].value&&
(B[v]=this.$tokens[v].splice(A.length-1,1)[0])}var w=this.getTokenCursor();n?(w.$row=f,w.$offset=this.$tokens[f].length-1):w.moveToPosition(l);for(;0>w.$offset&&0<w.$row;)w.$row--,w.$offset=w.$tokens[w.$row].length-1;for(;0<w.$row&&/^\s*#/.test(q.getLine(w.$row));)w.$row--,w.$offset=w.$tokens[w.$row].length-1;n="";var I=w.cloneCursor(),F=I.currentValue(),P=I.currentType();if("keyword"===P||a(["{",")",">",":"],F))n=p;for(;";"===w.currentValue()&&w.moveToPreviousToken(););var M=w.cloneCursor();if(m&&
w.isLastSignificantTokenOnLine()&&("keyword.operator"===w.currentType()||"punctuation.operator"===w.currentType())){var Q=w.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(","===w.currentValue()){if(m){var G=w.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=w.cloneCursor();return C.findOpeningBracket("{",!1)&&C.bwdOverClassySpecifiers()&&"enum"===C.currentValue()?this.$getIndent(u[C.$row])+p:-1!==d.indexOf("=")?this.$getIndent(d)+p:this.$getIndent(d)}if("keyword.operator"===P&&":"!==F)return this.$getIndent(u[f])+p;for(;;){if("undefined"===typeof w.currentValue())return"undefined"!==typeof M.currentValue()?
this.$getIndent(u[M.$row])+n:n;M=w.cloneCursor();if(";"===w.currentValue()&&w.moveToNextToken()){for(f=w.$row;null!=u[f]&&/^\s*#/.test(u[f]);)++f;return this.$getIndent(u[f])+n}if(a(["for","while","do","try"],w.currentValue())&&";"!==F)return this.$getIndent(u[w.$row])+n;G=w.peekBwd();if(":"===w.currentValue()){if(a(["public","private","protected"],G.currentValue()))return this.$getIndent(u[G.$row])+p;var D=u[w.$row];if(/^\s*case/.test(D))return this.$getIndent(D)+p;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(u[C.peekBwd().$row])+n}}if("]"===w.currentValue()&&"("===w.peekFwd().currentValue()&&(C=w.cloneCursor(),C.bwdToMatchingToken()))return this.$getIndent(u[C.$row])+n;if("("===w.currentValue()&&"for"===G.currentValue()&&";"===F)return w.peekFwd().cloneCursor(),m?Array(w.peekFwd().currentPosition().column+1).join(" "):
this.$getIndent(u[w.peekFwd().$row])+p;if(m&&"("===w.currentValue()&&!w.isLastSignificantTokenOnLine())return w.moveToNextToken(),Array(w.currentPosition().column+1+r).join(" ");if("if"===w.currentValue()||"else"===w.currentValue()||"template"===w.currentValue()&&"<"===w.peekFwd().currentValue())return this.$getIndent(u[w.$row])+n;if("{"===w.currentValue()){var S=this.getRowForOpenBraceIndent(g,w.$row);return 0<=S?(d=this.getLineSansComments(q,S),t=this.$getIndent(d),/\bnamespace\b/.test(d)?t:t+p):
this.$getIndent(u[w.$row])+p}if(0===w.$row&&0===w.$offset)return this.$getIndent(u[0])+n;if(">"===w.currentValue()&&(C=w.cloneCursor(),C.bwdToMatchingArrow()&&"template"===C.peekBwd().currentValue()))return">"===F&&(n=""),this.$getIndent(u[C.$row])+n;w.bwdToMatchingToken();if(!w.moveToPreviousToken())break;for(;0<w.$row&&/^\s*#/.test(u[w.$row]);)w.$row--,w.$offset=this.$tokens[w.$row].length-1}}finally{for(v=0;v<B.length;v++)"undefined"!==typeof B[v]&&this.$tokens[v].push(B[v])}}}return t};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);k.CppCodeModel=a});define("mode/cpp_scope_tree",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("mode/r_scope_tree");a=g.ScopeManager;var h=g.ScopeNode,m=function(a,d,b,e,c,m){this.label=a;this.start=d;this.preamble=b||d;this.end=null;this.scopeType=e;this.scopeCategory=c;this.attributes=m||{};this.parentScope=null;this.$children=[]};l.mixin(m.prototype,h.prototype);m.CATEGORY_CLASS=1;m.CATEGORY_NAMESPACE=2;m.CATEGORY_FUNCTION=3;m.CATEGORY_LAMBDA=4;m.CATEGORY_ANON=5;(function(){this.isClass=
function(){return this.scopeType==h.TYPE_BRACE&&this.scopeCategory==m.CATEGORY_CLASS};this.isNamespace=function(){return this.scopeType==h.TYPE_BRACE&&this.scopeCategory==m.CATEGORY_NAMESPACE};this.isFunction=function(){return this.scopeType==h.TYPE_BRACE&&this.scopeCategory==m.CATEGORY_FUNCTION};this.isLambda=function(){return this.scopeType==h.TYPE_BRACE&&this.scopeCategory==m.CATEGORY_LAMBDA}}).call(m.prototype);g=function(a){this.$ScopeNodeFactory=a;this.parsePos={row:0,column:0};this.$root=new a("(Top Level)",
this.parsePos,null,h.TYPE_ROOT)};l.mixin(g.prototype,a.prototype);(function(){this.onClassScopeStart=function(a,d,b,e){a=new this.$ScopeNodeFactory(a,b,d,h.TYPE_BRACE,m.CATEGORY_CLASS,{name:e});this.$root.addNode(a);this.printScopeTree()};this.onNamespaceScopeStart=function(a,d,b,e){a=new this.$ScopeNodeFactory(a,b,d,h.TYPE_BRACE,m.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,h.TYPE_BRACE,
m.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,h.TYPE_BRACE,m.CATEGORY_LAMBDA,{args:e});this.$root.addNode(a);this.printScopeTree()};this.onScopeStart=function(a){this.$root.addNode(new this.$ScopeNodeFactory(null,a,null,h.TYPE_BRACE));this.printScopeTree()};this.onScopeEnd=function(a){a=this.$root.closeScope(a,h.TYPE_BRACE);this.printScopeTree();return a}}).call(g.prototype);k.CppScopeManager=
g;k.CppScopeNode=m});define("mode/dcf",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,h=a("ace/tokenizer").Tokenizer,m=a("mode/dcf_highlight_rules").DcfHighlightRules;a=function(){this.$tokenizer=new h((new m).getRules())};l.inherits(a,g);(function(){this.getNextLineIndent=function(a,d,b){return this.$getIndent(d)}}).call(a.prototype);k.Mode=a});define("mode/dcf_highlight_rules",["require","exports","module"],function(a,k,l){l=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:".+"}]}};l.inherits(g,a);k.DcfHighlightRules=g});define("mode/doc_comment_highlight_rules",["require","exports","module"],function(a,k,l){l=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:"."}]}};l.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}};k.DocCommentHighlightRules=g});define("util/expand_selection",["require","exports","module"],function(a,k,l){k=a("ace/editor").Editor;var g=a("ace/range").Range;a("ace/keyboard/vim");var h=a("ace/token_iterator").TokenIterator,m=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,p=a.end.row===b.end.row&&a.end.column===b.end.column;return c?e||p: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)||m.isOpeningBracket(e.value)||
m.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.]/,n=!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 h(b);c=a.moveToPosition(d.start);0===d.start.column&&(c=a.moveToPreviousToken());b=new h(b);d=b.moveToPosition(d.end,!0);if(c&&d){var e="support.function.codebegin"===
c.type&&"support.function.codeend"===d.type;e||(e=m.isOpeningBracket(c.value)&&m.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 h(b);d=a.moveToPosition(d.start);if(null==d)return null;do{if(null==d)break;if(!a.bwdToMatchingToken()&&(m.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 h(c);if(!a.moveToPosition(e.start,!0))return null;c=new h(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)||m.isClosingBracket(f.value))if(r.test(p.value)||m.isClosingBracket(p.value)||m.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,n=f.length-2;0<=n;n--)if(f[n].equals(d)){e=
f[n+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(){n||(c.on("change",c.$onClearSelectionHistory),n=!0);for(var a=this.getSession(),b=this.getSelection(),e=b.getRange(),f=[],g=0;g<q.length;g++){var r=q[g],h=r.execute(this,a,b,e);m.isArray(h)||(h=[h]);for(var k=
0;k<h.length;k++){var l=h[k];if(l&&r.immediate&&d(l,e))return this.$acceptSelection(b,l,e);l&&d(l,e)&&f.push({name:r.name,range:l})}}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;n&&(c.off("change",c.$onClearSelectionHistory),n=!1);return this.getSelectionRange()}}).call(k.prototype)});define("mode/markdown",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,h=a("ace/mode/javascript").Mode,m=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-":h,"xml-":m,"html-":f});this.foldingRules=new b};l.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);k.Mode=a});define("mode/markdown_folding",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("ace/mode/folding/fold_mode").FoldMode,h=a("ace/range").Range;k=k.FoldMode=function(){};var m=a("mode/utils");l.inherits(k,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"===m.getPrimaryState(a,b)?d:"start":"":""};this.getFoldWidgetRange=
function(a,d,b){function e(c){return(k=a.getTokens(c)[0])&&0===k.type.lastIndexOf(l,0)}function c(){var a=k.value[0];return"="==a?6:"-"==a?5:7-k.value.search(/[^#]/)}var f=a.getLine(b);d=f.length;var n=a.getLength(),g=b,p=b;if(f.match(this.foldingStartMarker)){if("`"==f[0]){if("start"!==m.getPrimaryState(a,b)){for(;++b<n&&!(f=a.getLine(b),"`"==f[0]&"```"==f.substring(0,3)););return new h(g,d,b,0)}for(;0<b--&&!(f=a.getLine(b),"`"==f[0]&"```"==f.substring(0,3)););return new h(b,f.length,g,0)}var k,
l="markup.heading";if(e(b)){for(p=c();++b<n&&!(e(b)&&c()>=p););p=b-(k&&-1!=["=","-"].indexOf(k.value[0])?2:1);if(p>g)for(;p>g&&/^\s*$/.test(a.getLine(p));)p--;if(p>g)return b=a.getLine(p).length,new h(g,d,p,b)}}}}).call(k.prototype)});define("mode/markdown_highlight_rules",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("ace/lib/lang"),h=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 m=function(a){return"(?:[^"+g.escapeRegExp(a)+"\\\\]|\\\\.)*"},f=!0,d=7;k.setRainbowFencedDivs=function(a){f=a};k.getRainbowFencedDivs=function(){return f};k.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)"},n={token:["constant.language.boolean.text"],regex:"([*](?=[^\\s*]).*?[*])"},q={token:"text",regex:"\\^\\["+m("]")+"\\]"},p={token:"text constant text url string text".split(" "),
regex:'^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:["][^"]+["])?(\\s*))$'},h={token:["text","keyword","text","constant","text"],regex:"(\\s*\\[)("+m("]")+")(\\]\\[)("+m("]")+")(\\])"},k={token:"text keyword text markup.href string text paren.keyword.operator nospell paren.keyword.operator".split(" "),regex:"(\\s*\\[)("+m("]")+')(\\]\\()((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)(\\s*"'+m('"')+'"\\s*)?(\\))(?:(\\s*{)((?:[^\\}]+))(\\s*}))?'},l={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,p,h,k,l,r,e,n,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,n){if(!f)return"keyword.operator";c=(n.fences||0)%d;if(/^[:]{3,}\s*$/.test(a))return n.fences=c+1,"fenced_div_"+c;n=/^([:]{3,})(.*)$/;return[{type:"fenced_div_"+c,value:a.replace(n,"$1")},{type:"fenced_div_text_"+c,value:a.replace(n,
"$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,p,h,{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,n,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,p,h,k,l,r,e,n,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()};l.inherits(a,
h);k.MarkdownHighlightRules=a});define("mode/mermaid",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,h=a("ace/tokenizer").Tokenizer,m=a("mode/mermaid_highlight_rules").MermaidHighlightRules;a=function(){this.$highlightRules=new m;this.$tokenizer=new h(this.$highlightRules.getRules())};l.inherits(a,g);(function(){this.getNextLineIndent=function(a,d,b){return this.$getIndent(d)}}).call(a.prototype);k.Mode=a});define("mode/mermaid_highlight_rules",["require","exports","module"],function(a,k,l){l=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}]}};l.inherits(g,a);k.MermaidHighlightRules=g});define("mode/python",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,h=a("mode/python_highlight_rules").PythonHighlightRules,m=a("ace/mode/folding/pythonic").FoldMode,f=a("ace/range").Range;a=function(){this.HighlightRules=h;this.foldingRules=new m("\\:")};l.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);k.Mode=a});define("mode/python_highlight_rules",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("ace/mode/text_highlight_rules").TextHighlightRules,h=a("mode/rainbow_paren_highlight_rules").RainbowParenHighlightRules,m=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},h.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"}]};m.embedQuartoHighlightRules(this);this.normalizeRules()};l.inherits(a,g);k.PythonHighlightRules=a});define("mode/r",["require","exports","module"],function(a,k,l){a("ace/editor");a("ace/edit_session");a("ace/range");l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,h=a("ace/tokenizer").Tokenizer,m=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 h((new m).getRules()):
new h((new f).getRules());this.foldingRules=this.codeModel=new d(e,this.$tokenizer);this.$outdent=new b(this.codeModel)};l.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);k.Mode=a});define("mode/r_code_model",["require","exports","module"],function(a,k,l){function g(a,c){for(var b=0;b<c.length;b++)if(a===c[b])return!0;return!1}function h(a){return"if"===a||"for"===a||"while"===a||"repeat"===a||"function"===a}var m=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 n=!0,p=function(a,c){n?n=!1:(this.$doc.off("change",m),this.$session.off("changeMode",p))}.bind(this),m=function(a){this.$onDocChange(a)}.bind(this);this.$session.on("changeMode",p);this.$doc.on("change",m)};(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 p(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 k(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 l(a){return/\binfix\b/.test(a.type)||
"|>"===a.value}function z(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 u=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 m(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 A="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(!p(b.currentToken())||!b.moveToPreviousToken())break}if(l(b.currentToken())){c.$row=b.$row;c.$offset=b.$offset;b=!0;break a}}b=!1}if(!b)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(A,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(!l(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=k(e);else{b=e;
var d=b.cloneCursor();p(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 n=f.currentValue();f.moveToNextToken()&&"in"===f.currentValue()&&(d[n]="variable")}c(e.currentToken())&&(d="variable",f=e.cloneCursor(),f.moveToNextToken()&&
"function"===f.currentValue()&&(d="function"),f=e.cloneCursor(),f.moveToPreviousToken()&&p(f.currentToken())&&(f=f.currentValue(),b[f]=d))}while(e.moveToPreviousToken());e=[];for(var m in b)e.push({token:m,type:b[m]});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 n=this.$scopes.parsePos.row;
d.moveToPosition({row:n,column:this.$scopes.parsePos.column},!0);var g=d.getCurrentToken();if(null==g)return n;d.getCurrentTokenPosition();n=this.$scopes.getChunkCount();do{if(d.$row>c)break;var r=g.value;var h=g.type;g=d.getCurrentTokenPosition();var q=b.getPrimaryState(this.$session,g.row);if("rdoc-start"===q)d.moveToEndOfRow();else{var l=!0;this.$codeBeginPattern&&(l=/^r-/.test(q));if(b.startsWith(h,"markup.heading")){h="";l={row:g.row,column:0};var v={row:g.row+1,column:0};q=0;if(/^\s*#+\s*$/.test(r))q=
r.split("#").length-1,r=this.$session.getLine(g.row),h=r.replace(/^\s*[#]+\s*/,"");else if(/^[-=]{3,}\s*$/.test(r)&&(q="="===r[0]?1:2,h=this.$session.getLine(g.row-1).trim(),l.row--,0===h.length))continue;h=(h=h.replace(/{.*}\s*$/,""))||"(Untitled)";this.$scopes.onMarkdownHead(h,l,v,q,!0)}else if(l&&/\bsectionhead\b/.test(h)){h="(Untitled)";if(q=/[^#=-\s]/.exec(r))h=r.substr(q.index),h=h.replace(/\s*[#=-]+\s*$/,"");r=/^\s*([#]+)\s*[^#]/.exec(r);if(null!=r)if(q=r[1].length,6<q)this.$scopes.onSectionStart(h,
g);else l={row:g.row,column:0},v={row:g.row,column:Infinity},this.$scopes.onMarkdownHead(h,l,v,q,!1);else this.$scopes.onSectionStart(h,g)}else if(l||"mode/sweave"!==e||"keyword"!==h||0!==g.column||0!==r.indexOf("\\")||"\\chapter"!==r&&"\\section"!==r&&"\\subsection"!==r&&"\\subsubsection"!==r)if(/\bcodebegin\b/.test(h)&&"---"===r){r=this.$session;h=0;q=Math.min(r.getLength(),100);for(l="Title";h++<q;){v=r.getLine(h);if(/^\s*[-]{3}\s*$/.test(v))break;v=/^\s*title:\s+(.*?)\s*$/.exec(v);if(null!==v){l=
v[1];break}}r=b.stripEnclosingQuotes(l.trim());this.$scopes.onSectionStart(r,g,{isYaml:!0})}else if(/\bcodeend\b/.test(h)&&"---"===r)g.column=Infinity,this.$scopes.onSectionEnd(g);else if("mode/rmarkdown"===e&&/\bcodebegin\b/.test(h)&&0===r.trim().indexOf("/***"))this.$scopes.onSectionStart("(R Code Chunk)",g);else if("mode/rmarkdown"===e&&/\bcodeend\b/.test(h)&&0===r.trim().indexOf("*/"))this.$scopes.onSectionEnd(g);else if(/\bcodebegin\b/.test(h)){n++;h={row:g.row+1,column:0};q=n;a:{l=this.$session;
var y=this.$codeBeginPattern;v=d;if("undefined"===typeof y)l="";else{var t=y.exec(r);if(t&&(y=t[1],y=y.split(","),0<y.length)){t=y[0];if(!/=/.test(t)&&(t=t.replace(/(^\s+)|(\s+$)/g,""),t.length)){l=t;break a}for(var B=0;B<y.length;B++)if(t=/^\s*label\s*=\s*(.*)$/.exec(y[B])){l=b.stripEnclosingQuotes(t[1].trim());break a}}v=v.clone();for(y=v.moveToNextToken();null!=y&&y.type.startsWith("comment");){y=l.getLine(v.$row);t=/^#\|\s*label\s*:\s*(.*)$/;if(t.test(y)){l=y.replace(t,"$1");break a}y=v.moveToStartOfNextRowWithTokens()}l=
null}}q="Chunk "+q;l&&"YAML Header"!==r&&(q+=": "+l);this.$scopes.onChunkStart(l,q,g,h)}else if(/\bcodeend\b/.test(h))g.column+=r.length,this.$scopes.onChunkEnd(g);else if(l&&"{"===r)if(r=this.getTokenCursor(),r.moveToPosition(g,!0),g=r.cloneCursor(),h=g,q=h.cloneCursor(),"{"===q.currentValue()&&q.moveBackwardOverMatchingParens()&&q.moveToPreviousToken()&&a(q.currentToken())?(h.$row=q.$row,h.$offset=q.$offset,h=!0):h=!1,h){l=g.cloneCursor();l.moveToNextToken();h=null;k(g)&&(q=g.cloneCursor(),v=g.cloneCursor(),
v.findStartOfEvaluationContext()&&(h=v.currentPosition(),v=q.currentPosition(),h.row!==v.row?(h.row=v.row,h.column=0,g.$row=h.row,g.$offset=0):g.moveToPosition(h,!0),h=this.$doc.getTextRange(new m(h.row,h.column,v.row,v.column+q.currentValue().length))));q=g.currentPosition();g.isFirstSignificantTokenOnLine()&&(q.column=0);g=l;if(a(g.currentToken())&&!g.moveToNextToken()||"("===g.currentValue()&&!g.moveToNextToken()||")"===g.currentValue())g=[];else{l=[];for(p(g.currentToken())&&l.push(g.currentValue());g.moveToNextToken();)if(!g.fwdToMatchingToken()){if(")"===
g.currentValue())break;if(","===g.currentValue()){for(;","===g.currentValue()&&g.moveToNextToken(););p(g.currentToken())&&l.push(g.currentValue())}}g=l}l="("+g.join(", ")+")";l=null==h?u("<function>"+l):u(h+l);this.$scopes.onFunctionScopeStart(l,q,r.currentPosition(),h,g)}else h=g.cloneCursor(),"{"===h.currentValue()&&h.moveToPreviousToken()&&","!=!h.currentToken().value&&h.moveToPreviousToken()&&"string"!=!h.currentToken().type&&h.moveToPreviousToken()&&"("!=!h.currentToken().value&&h.moveToPreviousToken()?
(h=h.currentToken(),h=p(h)&&"test_that"==h.value):h=!1,h?(h=g.cloneCursor(),h.moveToPreviousToken(),h.moveToPreviousToken(),g=h.currentToken().value,h=h.cloneCursor(),h.moveToPreviousToken(),h.moveToPreviousToken(),this.$scopes.onTestScopeStart(g,h.currentPosition(),r.currentPosition())):(q=r.currentPosition(),r.isFirstSignificantTokenOnLine()&&(q.column=0),this.$scopes.onScopeStart(q));else l&&"}"===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),h="",null!=r&&(h=r[1]),l={row:g.row,column:0},v={row:g.row,column:Infinity},this.$scopes.onMarkdownHead(h,l,v,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 n=a[b];if(/\bparen\b/.test(n.type))switch(n.value){case "{":e++;1==e&&(d=n);break;case "}":e--,0==e&&(d=null),0>e&&(f=n,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")))?m.fromPoints(c,a):void 0;if("}"==d.value)return(a=a.$findOpeningBracket(d.value,c,b.getTokenTypeRegex("paren")))?m.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 n;n=c.stepForward();)if(/\bcode(begin|end)\b/.test(n.type))return n=
/\bcodebegin\b/.test(n.type),c=c.getCurrentTokenRow(),a=n?{row:c-1,column:a.getLine(c-1).length}:{row:c,column:a.getLine(c).length},m.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(),m.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 m.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,n){if(b.endsWith(a,"qstring"))return this.$getIndent(d);"number"!==typeof n&&(n=this.$session.getSelection().getCursor().row-1);var p=this.$session.getTabSize();a=Array(p+1).join(" ");this.$lineOverrides=
null;this.$doc.getLine(n)!==d&&(this.$lineOverrides={},this.$lineOverrides[n]=d,this.$invalidateRow(n));try{var m=0>n?"":this.$getIndent(this.$getLine(n));if(!this.$tokenizeUpToRow(n))return m;var q={row:n,column:this.$getLine(n).length},l=this.$findPreviousSignificantToken(q,0);d=this.$session.getLine(n);if(/\bfunction\s*\(\s*$/.test(d))return this.$getIndent(n)+f+f;m="";var k=!1;if(l&&z(l.token.type))m=f,k=!0;else if(l&&/\bparen\b/.test(l.token.type)&&/\)$/.test(l.token.value)){var v=this.$walkParensBalanced(l.row,
l.row-10,null,function(a,c,b){return 0===a.length});if(null!=v){var u=this.$findPreviousSignificantToken(v,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(l&&"keyword"===l.token.type&&("repeat"===l.token.value||"else"===l.token.value))return this.$getIndent(this.$getLine(l.row))+f;var t=this.getTokenCursor();if(!t.moveToPosition(q))return"";do{var y=t.currentType();if("support.function.codebegin"===y||"support.function.codeend"===
y)return this.$getIndent(this.$doc.getLine(t.$row))+m;var B=t.currentValue();if(t.isAtStartOfNewExpression(!1)){if("{"===B||"["===B||"("===B)m+=f;return this.$getIndent(this.$doc.getLine(t.$row))+m}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},n));if(q){d=this.$getLine(q.row);var A=d.replace(/[^\s].*$/,
""),H=q.column-A.length,I=Math.floor(H/p);x=H-p*I;H="";for(d=0;d<I;d++)H+=f;for(f=0;f<x;f++)H+=" ";f=A+H;var K=f.replace("\t",a).length;for(d=q.row+1;d<=n;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+m}return this.getIndentForOpenBrace(x)+f+m}}}while(t.moveToPreviousToken());if(!t.moveToPosition(q))return"";do if(!t.bwdToMatchingToken()){if("{"===
t.currentValue())return this.getIndentForOpenBrace(t.currentPosition())+f+m;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))+m+m;if(")"===D.currentValue()&&D.bwdToMatchingToken()&&D.moveToPreviousToken()&&h(D.currentValue())){d=this.$doc.getLine(D.$row);if(!k)for(;D.moveToPreviousToken()&&
")"===D.currentValue()&&D.bwdToMatchingToken()&&D.moveToPreviousToken()&&h(D.currentValue());)d=this.$doc.getLine(D.$row);return this.$getIndent(d)+m+m}}c(t.peekBwd().currentToken())&&t.moveToPreviousToken()}return this.$getIndent(this.$getLine(t.$row))+m}}while(t.moveToPreviousToken());if(k){K=0;t=this.getTokenCursor();t.moveToPosition(q);t.moveToPreviousToken();do{if(g(t.currentValue(),["if","else"])){m+=f;break}if(t.hasType("constant","identifier")){if(!t.moveToPreviousToken())break;if(g(t.currentValue(),
["if","else"])){m+=f;break}if(")"===t.currentValue()){if(!t.bwdToMatchingToken())break;if(!t.moveToPreviousToken())break;if(g(t.currentValue(),["if","else"])){m+=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},n);return J?this.$getIndent(this.$getLine(J.row))+m:""+m}finally{this.$lineOverrides&&(this.$lineOverrides=null,this.$invalidateRow(n))}};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,n=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]===n.$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);k.RCodeModel=a;k.setVerticallyAlignFunctionArgs=function(a){e=a};k.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,k,l){function g(a){for(var c=Array(a.length),b=0;b<a.length;b++)c[b]={include:a[b]};return c}var h=a("mode/utils");l=a("ace/lib/oop");var m=a("ace/lib/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules,d=a("mode/rainbow_paren_highlight_rules").RainbowParenHighlightRules;h=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()};l.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=m.arrayToMap("\\ function if else in break next repeat for while".split(" ")),f=m.arrayToMap("return switch try tryCatch stop warning require library attach detach source setMethod setGeneric setGroupGeneric setClass setRefClass R6Class UseMethod NextMethod".split(" ")),n=m.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"]]),p=String.raw($jscomp$templatelit$0),l={"{":"}","[":"]","(":")"},k={"#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]=l[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"}]};k["#keyword-or-identifier"]=[{token:function(c){return n.hasOwnProperty(c)?"constant.language":a.hasOwnProperty(c)?"keyword":c.match(/^\.\.\d+$/)?"variable.language":"identifier"},regex:p,unicode:!0,merge:!1,next:"start"}];k["#package-access"]=[{token:function(a){return $colorFunctionCalls?"identifier.support.class":"identifier"},regex:p+"(?=\\s*::)",unicode:!0,merge:!1,
next:"start"}];k["#function-call"]=[{token:function(a){return $colorFunctionCalls?"identifier.support.function":"identifier"},regex:p+"(?=\\s*\\()",unicode:!0,merge:!1,next:"start"}];k["#function-call-or-keyword"]=[{token:function(c){return f.hasOwnProperty(c)||a.hasOwnProperty(c)?"keyword":$colorFunctionCalls?"identifier.support.function":"identifier"},regex:p+"(?=\\s*\\()",unicode:!0,merge:!1,next:"start"}];k["#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"}];k["#knitr-embed"]=[{token:"constant.language",
regex:"^[<][<][^>]+[>][>]$",merge:!1}];k["#text"]=[{token:"text",regex:"\\s+"}];k.start=g("#comment #string #number #package-access #quoted-identifier #function-call-or-keyword #keyword-or-identifier #knitr-embed #operator #text".split(" "));k.afterDollar=g("#comment #string #number #quoted-identifier #function-call #keyword-or-identifier #operator #text".split(" "));k.rawstring=[{token:"string",regex:"[\\]})][-]*['\"]",onMatch:function(a,c,b,d){this.next=a===b[2]?b[0]:b[1];return this.token}},{defaultToken:"string"}];
k.qqstring=[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+",merge:!0}];k.qstring=[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+",merge:!0}];this.$rules=k;p=(new b).getRules();for(var v in p){k=p[v];for(var z=0;z<k.length;z++)if(h.isArray(k[z].token))for(var E=0;E<k[z].token.length;E++)k[z].token[E]+=".virtual-comment";else k[z].token+=".virtual-comment"}this.embedRules(p,"rdoc-",[{token:"text",regex:"^",
next:"start"}]);h.embedQuartoHighlightRules(this);this.normalizeRules()};l.inherits(a,f);k.RHighlightRules=a;k.setHighlightRFunctionCalls=function(a){$colorFunctionCalls=a}});define("mode/r_matching_brace_outdent",["require","exports","module"],function(a,k,l){var g=a("ace/range").Range;a=function(a){this.codeModel=a};(function(){this.checkOutdent=function(a,g,f){return/^\s+$/.test(g)&&/^\s*[\{\}\)\]]/.test(f)||/^\s*}\s*$/.test(g)&&"\n"==f||/}\s*$/.test(g)&&/\n/.test(f)?!0:!1};this.autoOutdent=function(a,m,f){if(0!==f){a=m.getLine(f);var d=a.match(/^(\s*[\}\)\]])/);if(d){d=d[1].length;var b=m.findMatchingBracket({row:f,column:d});if(!b||b.row==f)return 0;b=this.codeModel.getIndentForOpenBrace(b);
m.replace(new g(f,0,f,d-1),b)}if(d=a.match(/^(\s*\{)/))d=d[1].length,b=this.codeModel.getBraceIndent(f-1),m.replace(new g(f,0,f,d-1),b)}}}).call(a.prototype);k.RMatchingBraceOutdent=a});define("mode/r_scope_tree",["require","exports","module"],function(a,k,l){function g(a,f){return a.row!=f.row?a.row-f.row:a.column-f.column}var h=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=[]};h.TYPE_ROOT=1;h.TYPE_BRACE=2;h.TYPE_CHUNK=3;h.TYPE_SECTION=4;(function(){this.isRoot=
function(){return this.scopeType==h.TYPE_ROOT};this.isBrace=function(){return this.scopeType==h.TYPE_BRACE};this.isChunk=function(){return this.scopeType==h.TYPE_CHUNK};this.isSection=function(){return this.scopeType==h.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(h.prototype);a=function(a){this.$ScopeNodeFactory=a||h;this.parsePos={row:0,column:0};this.$root=new this.$ScopeNodeFactory("(Top Level)",this.parsePos,null,h.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,h.TYPE_SECTION);break}}a=new this.$ScopeNodeFactory(a,b,b,h.TYPE_SECTION,e);this.$root.addNode(a)};this.onSectionEnd=function(a){this.$root.closeScope(a,
h.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,h.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,h.TYPE_SECTION,{depth:c,isMarkdown:f}))};this.onChunkStart=function(a,b,e,c){this.$root.closeScope(e,h.TYPE_CHUNK);b=new this.$ScopeNodeFactory(b,c,e,h.TYPE_CHUNK);b.chunkLabel=a;this.$root.addNode(b);this.printScopeTree()};this.onChunkEnd=function(a){a=this.$root.closeScope(a,h.TYPE_CHUNK);this.printScopeTree();return a};this.onFunctionScopeStart=function(a,b,e,c,f){this.$root.addNode(new this.$ScopeNodeFactory(a,e,b,h.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,h.TYPE_BRACE,{name:a,type:"test"}));this.printScopeTree()};this.onNamedScopeStart=function(a,b){this.$root.addNode(new this.$ScopeNodeFactory(a,b,null,h.TYPE_BRACE))};this.onScopeStart=function(a){this.$root.addNode(new this.$ScopeNodeFactory(null,a,null,h.TYPE_BRACE));this.printScopeTree()};this.onScopeEnd=
function(a){a=this.$root.closeScope(a,h.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);k.ScopeManager=a;k.ScopeNode=h});var $rainbowParentheses=!1,$numParenColors=7;
define("mode/rainbow_paren_highlight_rules",["require","exports","module"],function(a,k,l){a=function(){};k.RainbowParenHighlightRules=a;k.setRainbowParentheses=function(a){$rainbowParentheses=a};k.getRainbowParentheses=function(){return $rainbowParentheses};k.setNumParenColors=function(a){$numParenColors=a};a.getParenRule=function(){return{token:"paren.keyword.operator.nomatch",regex:"[[({})\\]]",merge:!1,onMatch:function(a,h,m,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,k,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,h=a("ace/tokenizer").Tokenizer,m=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 m,this.$tokenizer=new h((new m).getRules())):(this.$highlightRules=new f,this.$tokenizer=new h((new f).getRules()));this.$outdent=new d};l.inherits(a,
g);(function(){this.getNextLineIndent=function(a,e,c){return this.$getIndent(e)}}).call(a.prototype);k.Mode=a});define("mode/rdoc_highlight_rules",["require","exports","module"],function(a,k,l){l=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+"}]}};l.inherits(g,a);k.RDocHighlightRules=g});define("mode/rhtml",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("ace/mode/html").Mode,h=a("ace/tokenizer").Tokenizer,m=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 h((new m).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};l.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);k.Mode=a});define("mode/rhtml_highlight_rules",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("mode/r_highlight_rules").RHighlightRules,h=a("ace/mode/html_highlight_rules").HtmlHighlightRules;a=a("ace/mode/text_highlight_rules").TextHighlightRules;var m=function(){this.$rules=(new h).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"})};l.inherits(m,a);k.RHtmlHighlightRules=m});define("mode/rmarkdown",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("mode/markdown").Mode,h=a("ace/tokenizer").Tokenizer,m=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,n=a("rstudio/folding/rmarkdown").FoldMode,
q=a("ace/mode/folding/cstyle").FoldMode;a("mode/auto_brace_insert");var p=a("mode/utils"),t=a("ace/unicode");a=function(a,g){var k=this;this.$session=g;this.$tokenizer=new h((new m).getRules());this.$outdent=new f;this.codeModel=new e(g,this.$tokenizer,/^r-/,new RegExp(m.prototype.$reChunkStartString),new RegExp(m.prototype.$reChunkEndString));this.$r_outdent=new d(this.codeModel);this.cpp_codeModel=new c(g,this.$tokenizer,/^r-cpp-/,new RegExp(m.prototype.$reCppChunkStartString),new RegExp(m.prototype.$reChunkEndString));
this.$cpp_outdent=new b(this.cpp_codeModel);this.$python=new r;var l=new n,t=new q;this.$tokenizer.getLineTokens=function(a,c,b,e){return h.prototype.getLineTokens.call(this,a,0===b?"_start":c,b,e)};this.foldingRules={getFoldWidget:function(a,c,b){var e=k.getLanguageMode({row:b,column:0}),d=a.getLine(b);return"Markdown"===e||p.startsWith(d,"```")||0===b?l.getFoldWidget(a,c,b):"C_CPP"===e?t.getFoldWidget(a,c,b):k.codeModel.getFoldWidget(a,c,b)},getFoldWidgetRange:function(a,c,b){var e=k.getLanguageMode({row:b,
column:0}),d=a.getLine(b);return"Markdown"===e||p.startsWith(d,"```")||0===b?l.getFoldWidgetRange(a,c,b):"C_CPP"===e?t.getFoldWidgetRange(a,c,b):k.codeModel.getFoldWidgetRange(a,c,b)}}};l.inherits(a,g);(function(){function a(a){return p.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=p.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 n=a(c);return"r"===n?this.codeModel.getNextLineIndent(c,b,e,d):"r-cpp"===n?this.cpp_codeModel.getNextLineIndent(c,b,e,d,f):"yaml"===n?this.$getIndent(this.$session.getLine(d+1)):"python"===n?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=p.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 n=a(c);return"markdown"===n?this.transformActionMarkdown(c,b,e,d,f):"r-cpp"===n?this.transformActionCpp(c,b,e,d,f):"yaml"===n?this.transformActionYaml(c,b,e,d,f):"python"===n?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("^["+t.wordChars+"._]+","g");this.nonTokenRe=
new RegExp("^(?:[^"+t.wordChars+"._]|\\s)+","g");this.allowAutoInsert=this.smartAllowAutoInsert;this.$id="mode/rmarkdown"}).call(a.prototype);k.Mode=a});define("rstudio/folding/rmarkdown",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("ace/mode/folding/fold_mode").FoldMode,h=a("ace/range").Range,m=a("mode/utils");a=k.FoldMode=function(){};l.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 m=a.getLine(e);if(d.test(m))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 h.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(m.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 k=a.getLine(g);if(1===e&&/^[=]{3,}\s*/.test(k)){b=g-2;break a}if(2===e&&/^[-]{3,}\s*/.test(k)){b=g-2;break a}if((k=/^(#+)(?:.*)$/.exec(k))&&k[1].length<=e){b=g-1;break a}}b=f}return new h(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,k,l){l=a("ace/lib/oop");var g=a("mode/r_highlight_rules").RHighlightRules,h=a("mode/c_cpp_highlight_rules").c_cppHighlightRules,m=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,n=a("mode/stan_highlight_rules").StanHighlightRules,q=a("mode/sql_highlight_rules").SqlHighlightRules,p=a("mode/tex_highlight_rules").LatexHighlightRules,t=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,B=a("ace/mode/css_highlight_rules").CssHighlightRules,v=a("ace/mode/scss_highlight_rules").ScssHighlightRules,z=a("ace/mode/sass_highlight_rules").SassHighlightRules,E=a("ace/mode/less_highlight_rules").LessHighlightRules;e=a("ace/mode/text_highlight_rules").TextHighlightRules;
var u=a("mode/mermaid_highlight_rules").MermaidHighlightRules,A=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,h,"r-cpp",this.$reCppChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,m,"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,n,"stan",this.$reStanChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,q,"sql",this.$reSqlChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,u,"mermaid",this.$reMermaidChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,A,"dot",this.$reDotChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,t,"js",
this.$reJavaScriptChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,B,"css",this.$reCssChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,v,"scss",this.$reScssChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,z,"sass",this.$reSassChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);x.embedRules(this,E,"less",this.$reLessChunkStartString,this.$reChunkEndString,
["start","listblock","allowBlock"]);x.embedRules(this,p,"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()};l.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);k.RMarkdownHighlightRules=a});define("mode/sh",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,h=a("mode/sh_highlight_rules").ShHighlightRules,m=a("ace/range").Range,f=a("ace/mode/folding/cstyle").FoldMode,d=a("ace/mode/behaviour/cstyle").CstyleBehaviour;a=function(){this.HighlightRules=h;this.foldingRules=new f;this.$behaviour=new d};l.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 m(b,a.length-e.length,b,a.length))};this.$id="mode/sh"}).call(a.prototype);k.Mode=a});define("mode/sh_highlight_rules",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=k.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",h=k.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",
m=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":h,"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()};l.inherits(m,a);k.ShHighlightRules=m});define("mode/sql",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,h=a("mode/sql_highlight_rules").SqlHighlightRules;a("ace/range");a=function(){this.HighlightRules=h};l.inherits(a,g);a.prototype.lineCommentStart="--";a.prototype.$id="mode/sql";k.Mode=a});define("mode/sql_highlight_rules",["require","exports","module"],function(a,k,l){l=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:"select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|when|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|foreign|not|references|default|null|inner|cross|natural|database|drop|grant|into|values|between|like|in|alter|index|view|exists|full|distinct|top|truncate|all",
"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()};l.inherits(g,a);k.SqlHighlightRules=g});define("mode/stan",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,h=a("ace/tokenizer").Tokenizer,m=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 h(this.$highlightRules.getRules());this.$outdent=new m;this.foldingRules=new d};l.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);k.Mode=a});define("mode/stan_highlight_rules",["require","exports","module"],function(a,k,l){l=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:".+"}]}};l.inherits(g,a);k.StanHighlightRules=g});define("mode/sweave",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,h=a("ace/tokenizer").Tokenizer,m=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 h((new m).getRules()):new h((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};l.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);k.Mode=a});define("mode/sweave_highlight_rules",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");a("mode/utils");var g=a("mode/tex_highlight_rules").TexHighlightRules,h=a("mode/r_highlight_rules").RHighlightRules;a=a("ace/mode/text_highlight_rules").TextHighlightRules;var m=function(){this.$rules=(new g).getRules();this.addRules((new h).getRules(),"r-");this.addRules((new h).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}})};l.inherits(m,a);k.SweaveHighlightRules=m});define("mode/tex",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,h=a("ace/tokenizer").Tokenizer,m=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 h((new m).getRules()):new h((new f).getRules());this.$outdent=new d};l.inherits(a,g);(function(){this.getNextLineIndent=function(a,e,c){return this.$getIndent(e)};
this.allowAutoInsert=function(){return!1}}).call(a.prototype);k.Mode=a});define("mode/tex_highlight_rules",["require","exports","module"],function(a,k,l){l=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()};l.inherits(g,a);k.TexHighlightRules=k.LatexHighlightRules=g});define("mode/token_cursor",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("mode/utils"),h=g.getTokenTypeRegex("paren"),m=function(a,e,c){this.$tokens=a;this.$row=e||0;this.$offset=c||0};(function(){this.cloneCursor=function(){return new m(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(m.prototype);var f=function(a,e,c,d){this.$tokens=a;this.$row=e||0;this.$offset=c||0;this.$codeModel=d};l.mixin(f.prototype,m.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};l.mixin(d.prototype,m.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(h)?c(e):a(e)||this.hasType("identifier","constant","variable")};this.isValidForStartOfStatement=function(){var b=
this.currentType();this.currentValue();if(-1!==b.search(h))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);k.TokenCursor=m;k.CppTokenCursor=f;k.RTokenCursor=d});define("mode/token_utils",["require","exports","module"],function(a,k,l){a=function(a,h,m,f,d,b){this.$doc=a;this.$tokenizer=h;this.$tokens=m;this.$endStates=Array(a.getLength());this.$statePattern=f;this.$codeBeginPattern=d;this.$codeEndPattern=b};(function(){this.getTokenForPos=function(a,h,m){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(h&&a.column==b.column)return b;if(a.column<=b.column)break;if(m&&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,m=!0;g<=a;g++)if(!m||!this.$endStates[g]){m=!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]?
m=!0:this.$endStates[g]=d.state}m||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 m=a[g];a.splice(g,1);for(var f=m.value.length-1;0<=f;f--){var d={type:m.type,value:m.value.charAt(f),
column:m.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,h){for(var g=[a,0],f=0;f<h;f++)g.push(null);this.$tokens.splice.apply(this.$tokens,g);this.$endStates.splice.apply(this.$endStates,g)};this.$removeRows=function(a,h){this.$tokens.splice(a,h);this.$endStates.splice(a,h)};this.$walkParens=function(a,h,m){var f=/\bparen\b/;return a<h?function(){for(;a<=h;a++)for(var d=this.$tokens[a],b=0;b<d.length;b++)if(f.test(d[b].type)&&
!m(d[b].value,{row:a,column:d[b].column}))return!1;return!0}.call(this):function(){a=Math.max(0,a);for(h=Math.max(0,h);a>=h;a--)for(var d=this.$tokens[a],b=d.length-1;0<=b;b--)if(f.test(d[b].type)&&!m(d[b].value,{row:a,column:d[b].column}))return!1;return!0}.call(this)};this.$walkParensBalanced=function(a,h,m,f,d){var b=[],e=null;this.$walkParens(a,h,function(a,g){if(m&&m(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,h){if(0==this.$tokens.length)return null;h=Math.min(h,this.$tokens.length-1);for(var g=a.row,f=a.column;g<=h;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,h){if(0==this.$tokens.length)return null;
h=Math.max(0,h);for(var g=Math.min(a.row,this.$tokens.length-1);g>=h;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);k.TokenUtils=a});define("mode/utils",["require","exports","module"],function(a,k,l){a("ace/range");var g=a("ace/token_iterator").TokenIterator,h=a("ace/unicode"),m=a("mode/yaml_highlight_rules").YamlHighlightRules;(function(){var a=this,d=new RegExp("^["+h.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,m){"undefined"===typeof h&&(h=["start"]);"undefined"===typeof m&&(m="start");h=a.asArray(h);m=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++)m[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(m,"quarto-yaml-");for(var b in a.$rules)"start"!==b&&-1===b.indexOf("-start")||a.$rules[b].unshift({token:"comment.doc.tag",
regex:"^\\s*#[|]",push:"quarto-yaml-start"}),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*(?!#)",next:"pop"})),a.$rules["quarto-yaml-start"].unshift({token:"text",regex:"^\\s*(?!#)",next:"pop"}),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(k)});define("mode/xml",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,h=a("ace/tokenizer").Tokenizer,m=a("mode/xml_highlight_rules").XmlHighlightRules,f=a("mode/xml_behavior").XmlBehaviour,d=a("mode/xml_fold_mode").FoldMode;a=function(){this.$tokenizer=new h((new m).getRules());this.$behaviour=new f;this.foldingRules=new d};l.inherits(a,g);(function(){this.getNextLineIndent=function(a,d,c){return this.$getIndent(d)}}).call(a.prototype);k.Mode=a});define("mode/xml_behavior",["require","exports","module"],function(a,k,l){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}l=a("ace/lib/oop");var h=a("ace/mode/behaviour").Behaviour,m=a("ace/mode/behaviour/cstyle").CstyleBehaviour,f=a("ace/token_iterator").TokenIterator;a=function(){this.inherit(m,["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]}})};l.inherits(a,h);k.XmlBehaviour=a});define("mode/xml_fold_mode",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("ace/lib/lang"),h=a("ace/range").Range,m=a("ace/mode/folding/fold_mode").FoldMode,f=a("ace/token_iterator").TokenIterator;a=k.FoldMode=function(a){m.call(this);this.voidElements=a||{}};l.inherits(a,m);(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,h.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,h.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,h.fromPoints(e.start,e.end);if(e.closing){if(this._pop(b,e),0==b.length)return h.fromPoints(c,e.start)}else b.push(e)}}}).call(a.prototype)});define("mode/xml_highlight_rules",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("mode/xml_util");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var h=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")};l.inherits(h,a);k.XmlHighlightRules=h});define("mode/xml_util",["require","exports","module"],function(a,k,l){function g(a,g){return[{token:"string",merge:!0,regex:".*?"+a,next:g},{token:"string",merge:!0,regex:".+"}]}k.tag=function(a,m,f,d){a[m]=[{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:m+"_embed_attribute_list"},{token:"empty",regex:"",next:m+"_embed_attribute_list"}];a[m+"_qstring"]=g("'",m+"_embed_attribute_list");a[m+"_qqstring"]=
g('"',m+"_embed_attribute_list");a[m+"_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:m+"_qqstring"},{token:"string",regex:"'.*?'"},{token:"string",merge:!0,regex:"['].*",next:m+"_qstring"}])}});define("mode/yaml",["require","exports","module"],function(a,k,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,h=a("mode/yaml_highlight_rules").YamlHighlightRules,m=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,f=a("ace/mode/folding/coffee").FoldMode;a=function(){this.HighlightRules=h;this.$outdent=new m;this.foldingRules=new f;this.$behaviour=this.$defaultBehaviour};l.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);k.Mode=a});define("mode/yaml_highlight_rules",["require","exports","module"],function(a,k,l){l=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}},h=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()};
l.inherits(h,a);k.YamlHighlightRules=h});define("theme/default",["require","exports","module"],function(a,k,l){a("ace/lib/dom");k.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,k,l){var g=a("ace/edit_session").EditSession,h=a("ace/editor").Editor;a("ace/lib/event_emitter");a("util/expand_selection");var m=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");l=a("ace/lib/oop");a("mixins/token_iterator");var c=function(a,b){b.renderer=a;h.call(this,a,b);this.setBehavioursEnabled(!0)};l.inherits(c,h);
(function(){this.$highlightBrackets=function(){if(this.session.selection.isEmpty())h.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 h.prototype.insert.call(this,a,b)};this.remove=function(a){return this.session.getMode().wrapRemove?this.session.getMode().wrapRemove(this,h.prototype.remove,a):h.prototype.remove.call(this,
a)};this.undo=function(){h.prototype.undo.call(this);this._dispatchEvent("undo")};this.redo=function(){h.prototype.redo.call(this);this._dispatchEvent("redo")};this.onPaste=function(a,b){h.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)};l.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 m(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 n=function(){b.call(this)};l.inherits(n,b);(function(){this.peek=function(){return this.$undoStack.length?this.$undoStack[this.$undoStack.length-1]:null}}).call(n.prototype);
var q=function(a,b){f.call(this,a,b)};l.inherits(q,f);(function(){this.setTheme=function(a){a&&f.prototype.setTheme.call(this,a)}}).call(q.prototype);k.RStudioEditor=c;k.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 n);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,k,l){k.toSnippetText=function(a){for(var g=a.length,k="",f=0;f<g;f++){var d=a[f];k+="snippet "+d.name+"\n\t"+d.content.replace(/\n/g,"\n\t")+"\n\n"}return k};k.normalizeSnippets=function(a){for(var g=a.length,k=0;k<g;k++){var f=a[k];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,k,l){l=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"}];l.normalizeSnippets(g);k.snippetText=l.toSnippetText(g);a.register(g,"c_cpp")});define("rstudio/snippets/markdown",["require","exports","module"],function(a,k,l){l=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```"}];l.normalizeSnippets(g);k.snippetText=l.toSnippetText(g);a.register(g,"markdown")});define("rstudio/snippets/r",["require","exports","module"],function(a,k,l){l=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}"}];
l.normalizeSnippets(g);k.snippetText=l.toSnippetText(g);a.register(g,"r")});define("rstudio/snippets/stan",["require","exports","module"],function(a,k,l){l=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}"}];l.normalizeSnippets(g);k.snippetText=l.toSnippetText(g);a.register(g,"stan")});define("rstudio/snippets/yaml",["require","exports","module"],function(a,k,l){l=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}"}];l.normalizeSnippets(g);k.snippetText=l.toSnippetText(g);a.register(g,"yaml")});