text: if(!String.prototype.trimRight){var trimEndRegexp=/\s\s*$/;String.prototype.trimRight=function(){return(""+this).replace(trimEndRegexp,"")}}
  define("rstudio/loader",function(b,j){var i=b("ace/lib/oop");b("ace/lib/event");b("ace/lib/event_emitter");var g=b("ace/editor").Editor,a=b("ace/edit_session").EditSession,d=b("ace/undomanager").UndoManager,e=b("ace/range").Range,f=function(c,h){g.call(this,c,h);this.setBehavioursEnabled(!0)};i.inherits(f,g);(function(){this.remove=function(c){return this.session.getMode().wrapRemove?this.session.getMode().wrapRemove(this,g.prototype.remove,c):g.prototype.remove.call(this,c)};this.undo=function(){g.prototype.undo.call(this);
  this._dispatchEvent("undo")};this.redo=function(){g.prototype.redo.call(this);this._dispatchEvent("redo")}}).call(f.prototype);var c=function(c,h){a.call(this,c,h)};i.inherits(c,a);(function(){this.insert=function(c,h){return this.getMode().wrapInsert?this.getMode().wrapInsert(this,a.prototype.insert,c,h):a.prototype.insert.call(this,c,h)};this.reindent=function(c){var h=this.getMode();if(h.getNextLineIndent)for(var a=c.end.row,c=c.start.row;c<=a;c++)if(0==c)this.applyIndent(c,"");else{var d=this.getState(c-
  1);if(!("qstring"==d||"qqstring"==d)){var e=this.getLine(c-1),b=this.getLine(c),b=h.checkOutdent(d," ",b),e=h.getNextLineIndent(d,e,this.getTabString(),this.getTabSize(),c-1);this.applyIndent(c,e);b&&h.autoOutdent(d,this,c)}}};this.applyIndent=function(c,h){var a=this.getLine(c).match(/^\s*/g)[0].length;this.replace(new e(c,0,c,a),h)};this.setDisableOverwrite=function(c){c?(this.setOverwrite(!1),this.setOverwrite=function(){},this.getOverwrite=function(){return!1}):(this.setOverwrite=a.prototype.setOverwrite,
  this.getOverwrite=a.prototype.getOverwrite)}}).call(c.prototype);var h=function(){d.call(this)};i.inherits(h,d);(function(){this.peek=function(){return this.$undoStack.length?this.$undoStack[this.$undoStack.length-1]:null}}).call(h.prototype);j.loadEditor=function(k){var a;function d(c){a.commands.removeCommand(c)}a=void 0;var e=b("ace/virtual_renderer").VirtualRenderer,z=b("ace/mode/text").Mode;a=new f(new e(k,{}),new c(""));k=a.getSession();k.setMode(new z);k.setUndoManager(new h);d("findnext");
  d("findprevious");d("find");d("replace");d("togglecomment");d("gotoline");d("foldall");d("unfoldall");d("touppercase");d("tolowercase");return a}});define("mode/auto_brace_insert",function(b,j){var i=b("ace/range").Range,g=b("ace/mode/text").Mode;(function(){this.$complements={"(":")","[":"]",'"':'"',"{":"}"};this.$reOpen=/^[(["{]$/;this.$reClose=/^[)\]"}]$/;this.$reStop=/^[;,\s)\]}]$/;this.wrapInsert=function(a,d,e,b){if(!this.insertMatching)return d.call(a,e,b);var c=a.selection.getCursor();if(c=a.selection.isEmpty()&&e.row==c.row&&e.column==c.column){var h=i.fromPoints(e,{row:e.row,column:e.column+1}),k=a.doc.getTextRange(h);if(this.$reClose.test(k)&&
  k==b){a.selection.moveCursorTo(h.end.row,h.end.column,!1);return}}h=null;c&&(h=this.$moveLeft(a.doc,e),h=a.doc.getTextRange(i.fromPoints(h,e)));d=d.call(a,e,b);if(c&&this.$reOpen.test(b)){if(e=i.fromPoints(d,{row:d.row,column:d.column+1}),e=a.doc.getTextRange(e),(this.$reStop.test(e)||0==e.length)&&this.allowAutoInsert(a,d,this.$complements[b]))a.doc.insert(d,this.$complements[b]),a.selection.moveCursorTo(d.row,d.column,!1)}else c&&"\n"===b&&(b=this.$moveRight(a.doc,d),"{"==h&&"}"==a.doc.getTextRange(i.fromPoints(d,
  b))&&(b=this.getIndentForOpenBrace?this.getIndentForOpenBrace(this.$moveLeft(a.doc,e)):this.$getIndent(a.doc.getLine(d.row-1)),a.doc.insert(d,"\n"+b),a.selection.moveCursorTo(d.row,d.column,!1)));return d};this.allowAutoInsert=function(){return!0};this.smartAllowAutoInsert=function(a,d,e){return"'"!==e&&'"'!==e||0==d.column?!0:(a=this.codeModel.getTokenForPos(d,!1,!0))&&"string"===a.type&&a.column===d.column-1};this.wrapRemove=function(a,d,e){var b=a.selection.getCursor(),c=a.session.getDocument();
  if(!this.insertMatching||"left"!=e||!a.selection.isEmpty()||a.$readOnly||0==b.column||c.getLine(b.row).length<=b.column)return d.call(a,e);var h=i.fromPoints(this.$moveLeft(c,b),b),b=i.fromPoints(b,this.$moveRight(c,b)),h=c.getTextRange(h),c=this.$reOpen.test(h)&&this.$complements[h]==c.getTextRange(b);d.call(a,e);c&&d.call(a,"right")};this.$moveLeft=function(a,d){if(0==d.row&&0==d.column)return d;var e=d.row,b=d.column;b?b--:(e--,b=a.getLine(e).length);return{row:e,column:b}};this.$moveRight=function(a,
  d){var b=d.row,f=d.column;a.getLine(b).length!=f?f++:(b++,f=0);return b>=a.getLength()?d:{row:b,column:f}}}).call(g.prototype);j.setInsertMatching=function(a){g.prototype.insertMatching=a}});define("mode/r_background_highlighter",function(b,j){var i=b("ace/range").Range,g=function(a){this.$session=a;this.$doc=a.getDocument();var d=this;this.$doc.on("change",function(a){d.$onDocChange.apply(d,[a])});this.$rowState=Array(this.$doc.getLength());this.$markers=[];for(a=0;a<this.$doc.getLength();a++)this.$updateRow(a);this.$syncMarkers(0)};(function(){this.$updateRow=function(a){this.$rowState[a]=this.$doc.getLine(a).match("^\\s*#+'.*$")?!0:!1};this.$syncMarkers=function(a,d){"undefined"==
  typeof d&&(d=this.$doc.getLength()-1);for(var b=a;b<=d;b++)!!this.$rowState[b]!=!!this.$markers[b]&&(this.$rowState[b]?this.$markers[b]=this.$session.addMarker(new i(b,0,b,this.$session.getLine(b).length),"ace_foreign_line","background",!1):(this.$session.removeMarker(this.$markers[b]),delete this.$markers[b]))};this.$insertNewRows=function(a,d){var b=Array(d+2);b[0]=a;b[1]=0;Array.prototype.splice.apply(this.$rowState,b)};this.$removeRows=function(a,d){this.$rowState.splice(a,d)};this.$onDocChange=
  function(a){a=a.data;if("insertLines"===a.action){var d=a.range.end.row-a.range.start.row;this.$insertNewRows(a.range.start.row,d);for(var b=0;b<d;b++)this.$updateRow(a.range.start.row+b);this.$syncMarkers(a.range.start.row)}else"insertText"===a.action?this.$doc.isNewLine(a.text)?(this.$insertNewRows(a.range.end.row,1),this.$updateRow(a.range.start.row),this.$updateRow(a.range.start.row+1),this.$syncMarkers(a.range.start.row)):(this.$updateRow(a.range.start.row),this.$syncMarkers(a.range.start.row,
  a.range.start.row)):"removeLines"===a.action?(this.$removeRows(a.range.start.row,a.range.end.row-a.range.start.row),this.$updateRow(a.range.start.row),this.$syncMarkers(a.range.start.row)):"removeText"===a.action&&(this.$doc.isNewLine(a.text)?(this.$removeRows(a.range.end.row,1),this.$updateRow(a.range.start.row),this.$syncMarkers(a.range.start.row)):(this.$updateRow(a.range.start.row),this.$syncMarkers(a.range.start.row,a.range.start.row)))}}).call(g.prototype);j.RBackgroundHighlighter=g});define("mode/r_highlight_rules",function(b,j){var i=b("ace/lib/oop"),g=b("ace/lib/lang"),a=b("ace/mode/text_highlight_rules").TextHighlightRules,d=b("mode/tex_highlight_rules").TexHighlightRules,e=function(){var a=g.arrayToMap("function,if,in,break,next,repeat,else,for,return,switch,while,try,tryCatch,stop,warning,require,library,attach,detach,source,setMethod,setGeneric,setGroupGeneric,setClass,setRefClass,new".split(",")),c=g.arrayToMap("NULL,NA,TRUE,FALSE,T,F,Inf,NaN,NA_integer_,NA_real_,NA_character_,NA_complex_".split(","));
  this.$rules={start:[{token:"comment.sectionhead",regex:"#+(?!').*(?:----|====|####)\\s*$"},{token:"comment",regex:"#+'",next:"rd-start"},{token:"comment",regex:"#.*$"},{token:"string",regex:'["]',next:"qqstring"},{token:"string",regex:"[']",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+[Li]?\\b"},{token:"constant.numeric",regex:"\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?[iL]?\\b"},{token:"constant.numeric",regex:"\\.\\d+(?:[eE][+\\-]?\\d*)?[iL]?\\b"},{token:"constant.language.boolean",
  regex:"(?:TRUE|FALSE|T|F)\\b"},{token:"identifier",regex:"`.*?`"},{token:function(h){return a[h]?"keyword":c[h]?"constant.language":"..."==h||h.match(/^\.\.\d+$/)?"variable.language":"identifier"},regex:"[a-zA-Z.][a-zA-Z0-9._]*\\b"},{token:"keyword.operator",regex:"%%|>=|<=|==|!=|\\->|<\\-|\\|\\||&&|=|\\+|\\-|\\*|/|\\^|>|<|!|&|\\||~|\\$|:|@"},{token:"keyword.operator",regex:"%.*?%"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],
  qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]};for(var h=(new d("comment")).getRules(),k=0;k<h.start.length;k++)h.start[k].token+=".virtual-comment";this.addRules(h,"rd-");this.$rules["rd-start"].unshift({token:"text",regex:"^",next:"start"});this.$rules["rd-start"].unshift({token:"keyword",regex:"@(?!@)[^ ]*"});this.$rules["rd-start"].unshift({token:"comment",
  regex:"@@"});this.$rules["rd-start"].push({token:"comment",regex:"[^%\\\\[({\\])}]+"})};i.inherits(e,a);j.RHighlightRules=e});define("mode/r_matching_brace_outdent",function(b,j){var i=b("ace/range").Range,g={};(function(){this.checkOutdent=function(a,d,b){return/^\s+$/.test(d)&&/^\s*[\{\}\)]/.test(b)||/^\s*}\s*$/.test(d)&&"\n"==b||/}\s*$/.test(d)&&/\n/.test(b)?!0:!1};this.autoOutdent=function(a,b,e){if(0==e)return 0;var a=b.getLine(e),f=a.match(/^(\s*[\}\)])/);if(f){var f=f[1].length,c=b.findMatchingBracket({row:e,column:f});if(!c||c.row==e)return 0;c=this.codeModel.getIndentForOpenBrace(c);b.replace(new i(e,0,e,f-1),c)}if(f=
  a.match(/^(\s*\{)/))f=f[1].length,c=this.codeModel.getBraceIndent(e-1),b.replace(new i(e,0,e,f-1),c)}}).call(g);j.RMatchingBraceOutdent=g});define("mode/r_code_model",function(b,j){var i=b("ace/range").Range,g=b("ace/token_iterator").TokenIterator,a=!1,d=b("mode/r_scope_tree").ScopeManager,e=function(a,c,h,k){this.$doc=a;this.$tokenizer=c;this.$tokens=Array(a.getLength());this.$endStates=Array(a.getLength());this.$statePattern=h;this.$codeBeginPattern=k;this.$scopes=new d;var b=this;this.$doc.on("change",function(c){b.$onDocChange.apply(b,[c])});this.$TokenCursor=function(c,h){this.$row=c||0;this.$offset=h||0};(function(){this.moveToStartOfRow=
  function(c){this.$row=c;this.$offset=0};this.moveToPreviousToken=function(){for(;0==this.$offset&&0<this.$row;)this.$row--,this.$offset=b.$tokens[this.$row].length;if(0==this.$offset)return!1;this.$offset--;return!0};this.moveToNextToken=function(c){if(!(this.$row>c)){for(this.$offset++;this.$offset>=b.$tokens[this.$row].length&&this.$row<c;)this.$row++,this.$offset=0;return this.$offset>=b.$tokens[this.$row].length?!1:!0}};this.seekToNearestToken=function(c,h){if(c.row>h)return!1;this.$row=c.row;
  var a=b.$tokens[this.$row]||[];for(this.$offset=0;this.$offset<a.length;this.$offset++)if(a[this.$offset].column>=c.column)return!0;return this.moveToNextToken(h)};this.moveBackwardOverMatchingParens=function(){if(!this.moveToPreviousToken()||")"!==this.currentValue())return!1;for(var c=!1,h=0;this.moveToPreviousToken();)if("("===this.currentValue()){if(0==h){c=!0;break}h--}else")"===this.currentValue()&&h++;return c};this.findToken=function(c,h){do{var a=this.currentToken();if(a&&c(a))return a}while(this.moveToNextToken(h));
  return null};this.currentToken=function(){return(b.$tokens[this.$row]||[])[this.$offset]};this.currentValue=function(){return this.currentToken().value};this.currentPosition=function(){var c=this.currentToken();return null===c?null:{row:this.$row,column:c.column}};this.cloneCursor=function(){var c=new b.$TokenCursor;c.$row=this.$row;c.$offset=this.$offset;return c};this.isFirstSignificantTokenOnLine=function(){return 0==this.$offset};this.isLastSignificantTokenOnLine=function(){return this.$offset==
  (b.$tokens[this.$row]||[]).length-1}}).call(this.$TokenCursor.prototype)};(function(){function b(c){if("{"!==c.currentValue()||!c.moveBackwardOverMatchingParens()||!c.moveToPreviousToken())return!1;var h=c.currentToken();if(!("keyword"==h.type&&"function"==h.value)||!c.moveToPreviousToken())return!1;h=c.currentToken();return!/\boperator\b/.test(h.type)||!/^(=|<-|<<-)$/.test(h.value)||!c.moveToPreviousToken()||!/\bidentifier\b/.test(c.currentToken().type)?!1:!0}this.$complements={"(":")",")":"(","[":"]",
  "]":"[","{":"}","}":"{"};this.$buildScopeTreeUpToRow=function(c){function h(c,a){var h=c.exec(a);if(!h)return null;var b=h[1].split(",");if(0==b.length)return null;if(!/=/.test(b[0]))return b[0].replace(/(^\s+)|(\s+$)/g,"");for(var d=0;d<b.length;d++)if(h=/^\s*label\s*=\s*(.*)$/.exec(b[d]))return h=h[1].replace(/(^\s+)|(\s+$)/g,""),h=(b=/^(['"])(.*)\1$/.exec(h))?b[2]:h,h;return null}maxRow=Math.min(c+30,this.$doc.getLength()-1);this.$tokenizeUpToRow(maxRow);c=new this.$TokenCursor;if(c.seekToNearestToken(this.$scopes.parsePos,
  maxRow)){do{this.$scopes.parsePos=c.currentPosition();this.$scopes.parsePos.column+=c.currentValue().length;var a=c.currentToken().type;if(/\bsectionhead\b/.test(a))a=""+/^#+'?[-=#\s]*(.*?)\s*[-=#]+\s*$/.exec(c.currentValue())[1],0==a.length&&(a="(Untitled)"),50<a.length&&(a=a.substring(0,50)+"..."),this.$scopes.onSectionHead(a,c.currentPosition());else if(/\bcodebegin\b/.test(a)){var a=c.currentPosition(),d={row:a.row+1,column:0},e=this.$scopes.getTopLevelScopeCount()+1,o=h(this.$codeBeginPattern,
  c.currentValue()),e="Chunk "+e;o&&(e+=": "+o);this.$scopes.onChunkStart(o,e,a,d)}else if(/\bcodeend\b/.test(a)){for(a=c.currentPosition();this.$scopes.onScopeEnd(a););a.column+=c.currentValue().length;this.$scopes.onChunkEnd(a)}else"{"===c.currentValue()?(a=c.cloneCursor(),b(a)?(d=a.currentPosition(),a.isFirstSignificantTokenOnLine()&&(d.column=0),this.$scopes.onFunctionScopeStart(a.currentValue(),d,c.currentPosition())):(d=c.currentPosition(),c.isFirstSignificantTokenOnLine()&&(d.column=0),this.$scopes.onScopeStart(d))):
  "}"===c.currentValue()&&(a=c.currentPosition(),c.isLastSignificantTokenOnLine()?a.column=this.$getLine(a.row).length+1:a.column++,this.$scopes.onScopeEnd(a))}while(c.moveToNextToken(maxRow))}};this.$getFoldToken=function(c,h,a){this.$tokenizeUpToRow(a);if(this.$statePattern&&!this.$statePattern.test(this.$endStates[a]))return"";c=this.$tokens[a];if(1==c.length&&/\bsectionhead\b/.test(c[0].type))return c[0];for(var a=0,b=null,d=null,e=0;e<c.length;e++){var f=c[e];if(/\bparen\b/.test(f.type))switch(f.value){case "{":a++;
  1==a&&(b=f);break;case "}":a--,0==a&&(b=null),0>a&&(d=f,a=0)}}return b?b:"markbeginend"==h&&d?d:1<=c.length&&(/\bcodebegin\b/.test(c[0].type)||/\bcodeend\b/.test(c[0].type))?c[0]:null};this.getFoldWidget=function(c,a,b){c=this.$getFoldToken(c,a,b);return null==c?"":"{"==c.value?"start":"}"==c.value?"end":/\bcodebegin\b/.test(c.type)?"start":/\bcodeend\b/.test(c.type)?"end":/\bsectionhead\b/.test(c.type)?"start":""};this.getFoldWidgetRange=function(c,a,b){var d=this.$getFoldToken(c,a,b);if(d){a={row:b,
  column:d.column+1};if("{"==d.value)return c=c.$findClosingBracket(d.value,a),!c?void 0:i.fromPoints(a,c);if("}"==d.value)return c=c.$findOpeningBracket(d.value,a),!c?void 0:i.fromPoints({row:c.row,column:c.column+1},{row:a.row,column:a.column-1});if(/\bcodebegin\b/.test(d.type))for(var a=new g(c,b,0),e;e=a.stepForward();){if(/\bcode(begin|end)\b/.test(e.type))return e=/\bcodebegin\b/.test(e.type),a=a.getCurrentTokenRow(),c=e?{row:a-1,column:c.getLine(a-1).length}:{row:a,column:c.getLine(a).length},
  i.fromPoints({row:b,column:d.column+d.value.length},c)}else if(/\bcodeend\b/.test(d.type))for(a=new g(c,b,0);d=a.stepBackward();){if(/\bcodebegin\b/.test(d.type))return a=a.getCurrentTokenRow(),i.fromPoints({row:a,column:c.getLine(a).length},{row:b,column:c.getLine(b).length})}else if(/\bsectionhead\b/.test(d.type)&&(d=/([-=#])\1+\s*$/.exec(d.value))){a.column+=d.index-1;for(d=new g(c,b,0);(e=d.stepForward())&&!/\bsectionhead\b/.test(e.type);)b=d.getCurrentTokenRow();return i.fromPoints(a,{row:b,
  column:c.getLine(b).length})}}};this.getCurrentScope=function(c,a){a||(a=function(){return!0});if(!c)return"";this.$buildScopeTreeUpToRow(c.row);var b=this.$scopes.getActiveScopes(c);if(b)for(var d=b.length-1;0<=d;d--)if(a(b[d]))return b[d];return null};this.getScopeTree=function(){this.$buildScopeTreeUpToRow(this.$doc.getLength()-1);return this.$scopes.getScopeList()};this.findFunctionDefinitionFromUsage=function(c,a){this.$buildScopeTreeUpToRow(this.$doc.getLength()-1);return this.$scopes.findFunctionDefinitionFromUsage(c,
  a)};this.getIndentForOpenBrace=function(c){if(this.$tokenizeUpToRow(c.row)){var a=new this.$TokenCursor;if(a.seekToNearestToken(c,c.row)&&"{"==a.currentValue()&&a.moveBackwardOverMatchingParens())return this.$getIndent(this.$getLine(a.currentPosition().row))}return this.$getIndent(this.$getLine(c.row))};this.getNextLineIndent=function(c,b,d,e,n){if("qstring"==d||"qqstring"==d)return"";var f=Array(n+1).join(" ");this.$lineOverrides=null;this.$doc.getLine(c)!==b&&(this.$lineOverrides={},this.$lineOverrides[c]=
  b,this.$invalidateRow(c));try{var i=0>c?"":this.$getIndent(this.$getLine(c));if(!this.$tokenizeUpToRow(c)||this.$statePattern&&!this.$statePattern.test(d))return i;var d="",g=this.$findPreviousSignificantToken({row:c,column:this.$getLine(c).length},c-10);if(g&&/\bparen\b/.test(g.token.type)&&/\)$/.test(g.token.value)){var j=this.$walkParensBalanced(g.row,g.row-10,null,function(c){return 0===c.length});if(null!=j){var s=this.$findPreviousSignificantToken(j,0);if(s&&"keyword"===s.token.type&&/^(if|while|for|function)$/.test(s.token.value))return this.$getIndent(this.$getLine(s.row))+
  e}}else{if(g&&"keyword"===g.token.type&&("repeat"===g.token.value||"else"===g.token.value))return this.$getIndent(this.$getLine(g.row))+e;g&&/\boperator\b/.test(g.token.type)&&!/\bparen\b/.test(g.token.type)&&(d=e)}var m=this.$walkParensBalanced(c,0,function(c,a){return/[\[({]/.test(a)&&0===c.length},null);if(null!=m){g=null;a&&(g=this.$findNextSignificantToken({row:m.row,column:m.column+1},c));if(g){for(var b=this.$getLine(g.row),q=b.replace(/[^\s].*$/,""),u=g.column-q.length,v=Math.floor(u/n),n=
  u-n*v,m="",b=0;b<v;b++)m+=e;for(e=0;e<n;e++)m+=" ";for(var q=q+m,w=q.replace("\t",f).length,t,b=g.row+1;b<=c;b++)if(/[^\s]/.test(this.$getLine(b))){var x=this.$endStates[b-1];"qstring"===x||"qqstring"===x||(t=this.$getLine(b).replace(/[^\s].*$/,""),thisIndentSize=t.replace("\t",f).length,thisIndentSize<w&&(q=t,w=thisIndentSize))}return q+d}return this.getIndentForOpenBrace(m)+e+d}var y=this.$findNextSignificantToken({row:0,column:0},c);return y?this.$getIndent(this.$getLine(y.row))+d:""+d}finally{this.$lineOverrides&&
  (this.$lineOverrides=null,this.$invalidateRow(c))}};this.getBraceIndent=function(c){this.$tokenizeUpToRow(c);var a=this.$findPreviousSignificantToken({row:c,column:this.$getLine(c).length},c-10);if(a&&/\bparen\b/.test(a.token.type)&&/\)$/.test(a.token.value)){if(a=this.$walkParensBalanced(a.row,a.row-10,null,function(c){return 0==c.length}),null!=a&&(a=this.$findPreviousSignificantToken(a,0))&&"keyword"===a.token.type&&/^(if|while|for|function)$/.test(a.token.value))return this.$getIndent(this.$getLine(a.row))}else if(a&&
  "keyword"===a.token.type&&("repeat"===a.token.value||"else"===a.token.value))return this.$getIndent(this.$getLine(a.row));return this.$getIndent(c)};this.getTokenForPos=function(c,a,b){this.$tokenizeUpToRow(c.row);if(this.$tokens.length<=c.row)return null;for(var d=this.$tokens[c.row],e=0;e<d.length;e++){var f=d[e];if(a&&c.column==f.column)return f;if(c.column<=f.column)break;if(b&&c.column==f.column+f.value.length||c.column<f.column+f.value.length)return f}return null};this.$tokenizeUpToRow=function(c){for(var c=
  Math.min(c,this.$endStates.length-1),a=0,b=!0;a<=c;a++)if(!b||!this.$endStates[a]){var b=!1,d=0===a?"start":this.$endStates[a-1],e=this.$tokenizer.getLineTokens(this.$getLine(a),d);this.$tokens[a]=!this.$statePattern||this.$statePattern.test(e.state)||this.$statePattern.test(d)?this.$filterWhitespaceAndComments(e.tokens):[];e.state===this.$endStates[a]?b=!0:this.$endStates[a]=e.state}b||a<this.$tokens.length&&this.$invalidateRow(a);return!0};this.$onDocChange=function(c){c=c.data;"insertLines"===
  c.action?this.$insertNewRows(c.range.start.row,c.range.end.row-c.range.start.row):"insertText"===c.action?this.$doc.isNewLine(c.text)?(this.$invalidateRow(c.range.start.row),this.$insertNewRows(c.range.end.row,1)):this.$invalidateRow(c.range.start.row):"removeLines"===c.action?(this.$removeRows(c.range.start.row,c.range.end.row-c.range.start.row),this.$invalidateRow(c.range.start.row)):"removeText"===c.action&&(this.$doc.isNewLine(c.text)&&this.$removeRows(c.range.end.row,1),this.$invalidateRow(c.range.start.row));
  this.$scopes.invalidateFrom(c.range.start)};this.$invalidateRow=function(c){this.$tokens[c]=null;this.$endStates[c]=null};this.$insertNewRows=function(c,a){for(var b=[c,0],d=0;d<a;d++)b.push(null);this.$tokens.splice.apply(this.$tokens,b);this.$endStates.splice.apply(this.$endStates,b)};this.$removeRows=function(c,a){this.$tokens.splice(c,a);this.$endStates.splice(c,a)};this.$getIndent=function(c){return(c=/^([ \t]*)/.exec(c))?c[1]:""};this.$getLine=function(c){return this.$lineOverrides&&"undefined"!=
  typeof this.$lineOverrides[c]?this.$lineOverrides[c]:this.$doc.getLine(c)};this.$walkParens=function(c,a,b){var d=/\bparen\b/;return c<a?function(){for(;c<=a;c++)for(var e=this.$tokens[c],f=0;f<e.length;f++)if(d.test(e[f].type)&&!b(e[f].value,{row:c,column:e[f].column}))return!1;return!0}.call(this):function(){c=Math.max(0,c);for(a=Math.max(0,a);c>=a;c--)for(var e=this.$tokens[c],f=e.length-1;0<=f;f--)if(d.test(e[f].type)&&!b(e[f].value,{row:c,column:e[f].column}))return!1;return!0}.call(this)};this.$walkParensBalanced=
  function(c,a,b,d){var e=[],f=null,g=this;this.$walkParens(c,a,function(c,a){if(b&&b(e,c,a))return f=a,!1;if(/[\[({]/.test(c))if(e[e.length-1]===g.$complements[c])e.pop();else return!0;else e.push(c);return d&&d(e,c,a)?(f=a,!1):!0});return f};this.$findNextSignificantToken=function(c,a){if(0==this.$tokens.length)return null;for(var a=Math.min(a,this.$tokens.length-1),b=c.row,d=c.column;b<=a;b++){for(var e=this.$tokens[b],f=0;f<e.length;f++)if(e[f].column+e[f].value.length>d)return{token:e[f],row:b,
  column:Math.max(e[f].column,d),offset:f};d=0}return null};this.findNextSignificantToken=function(c){return this.$findNextSignificantToken(c,this.$tokens.length-1)};this.$findPreviousSignificantToken=function(c,a){if(0==this.$tokens.length)return null;for(var a=Math.max(0,a),b=Math.min(c.row,this.$tokens.length-1);b>=a;b--){var d=this.$tokens[b];if(0!=d.length){if(b!=c.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<c.column)return{row:b,
  column:d[e].column,token:d[e],offset:e}}}};this.$filterWhitespaceAndComments=function(c){for(var c=c.filter(function(a){a=/\bcode(?:begin|end)\b/.test(a.type)||/\bsectionhead\b/.test(a.type)?!1:/^\s*$/.test(a.value)||a.type.match(/\b(?:ace_virtual-)?comment\b/);return!a}),a=c.length-1;0<=a;a--)if(1<c[a].value.length&&/\bparen\b/.test(c[a].type)){var b=c[a];c.splice(a,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};c.splice(a,0,e)}}return c}}).call(e.prototype);
  j.RCodeModel=e;j.setVerticallyAlignFunctionArgs=function(b){a=b}});define("mode/r_scope_tree",function(b,j){function i(a,b){return a.row!=b.row?a.row-b.row:a.column-b.column}var g=function(){this.parsePos={row:0,column:0};this.$root=new a("(Top Level)",this.parsePos,null,a.TYPE_ROOT)};(function(){this.onSectionHead=function(b,e){var f=this.getActiveScopes(e);if(2==f.length&&f[1].isSection())this.$root.closeScope(e,a.TYPE_SECTION);else if(1!=f.length)return;this.$root.addNode(new a(b,e,e,a.TYPE_SECTION))};this.onChunkStart=function(b,e,f,c){this.$root.closeScope(f,
  a.TYPE_CHUNK);e=new a(e,c,f,a.TYPE_CHUNK);e.chunkLabel=b;this.$root.addNode(e);this.printScopeTree()};this.onChunkEnd=function(b){b=this.$root.closeScope(b,a.TYPE_CHUNK);this.printScopeTree();return b};this.onFunctionScopeStart=function(b,e,f){this.$root.addNode(new a(b,f,e,a.TYPE_BRACE));this.printScopeTree()};this.onScopeStart=function(b){this.$root.addNode(new a(null,b,null,a.TYPE_BRACE));this.printScopeTree()};this.onScopeEnd=function(b){b=this.$root.closeScope(b,a.TYPE_BRACE);this.printScopeTree();
  return b};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.invalidateFrom=function(a){a={row:Math.max(0,a.row-1),column:0};0<i(this.parsePos,a)&&(this.parsePos=this.$root.invalidateFrom(a));this.printScopeTree()};this.getTopLevelScopeCount=function(){return this.$root.$children.length};this.printScopeTree=function(){this.$root.printDebug()}}).call(g.prototype);
  var a=function(a,b,f,c){this.label=a;this.start=b;this.preamble=f||b;this.end=null;this.scopeType=c;this.parentScope=null;this.$children=[]};a.TYPE_ROOT=1;a.TYPE_BRACE=2;a.TYPE_CHUNK=3;a.TYPE_SECTION=4;(function(){this.isRoot=function(){return this.scopeType==a.TYPE_ROOT};this.isBrace=function(){return this.scopeType==a.TYPE_BRACE};this.isChunk=function(){return this.scopeType==a.TYPE_CHUNK};this.isSection=function(){return this.scopeType==a.TYPE_SECTION};this.isFunction=function(){return this.isBrace()&&
  !!this.label};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");this.end=null;var b=this.$binarySearch(a.preamble);0<=b?this.$children[b].addNode(a):(b=-(b+1),b<this.$children.length&&(a.$children=this.$children.splice(b,this.$children.length-b)),a.parentScope=this,this.$children.push(a))};this.closeScope=function(a,b){if(0==this.$children.length)return null;var f=this.$children[this.$children.length-
  1];if(f.end)return null;var c=f.closeScope(a,b);if(c)return c;return b==f.scopeType?(f.end=a,f.$forceDescendantsClosed(a),f):null};this.$forceDescendantsClosed=function(a){if(0!=this.$children.length){var b=this.$children[this.$children.length-1];b.end||(b.$forceDescendantsClosed(a),b.end=a)}};this.findNode=function(a){var b=this.$binarySearch(a);return 0<=b&&(a=this.$children[b].findNode(a))?(this.label&&a.unshift(this),a):this.label?[this]:null};this.$getFunctionStack=function(a){var b=this.$binarySearch(a),
  a=0<=b?this.$children[b].$getFunctionStack(a):[];this.label&&a.push(this);return a};this.findFunctionDefinitionFromUsage=function(a,b){for(var f=this.$getFunctionStack(a),c=0;c<f.length;c++)for(var h=f[c],k=0;k<h.$children.length;k++)if(h.$children[k].label==b)return h.$children[k];return null};this.invalidateFrom=function(a){var b=this.$binarySearch(a);0<=b?0>=i(a,this.$children[b].start)?a=this.$children[b].preamble:(a=this.$children[b].invalidateFrom(a),b++):b=-(b+1);b<this.$children.length&&this.$children.splice(b,
  this.$children.length-b);this.end=null;return a};this.$binarySearch=function(a,b,f){"undefined"===typeof b&&(b=0);"undefined"===typeof f&&(f=this.$children.length);if(b===f)return-(b+1);var c=Math.floor((b+f)/2),h=this.$children[c].comparePosition(a);return 0===h?c:0>h?this.$binarySearch(a,b,c):this.$binarySearch(a,c+1,f)};this.comparePosition=function(a){return 0>i(a,this.preamble)?-1:null!=this.end&&0<=i(a,this.end)?1:0};this.printDebug=function(a){"undefined"===typeof a&&(a="");for(var b=0;b<this.$children.length;b++)this.$children[b].printDebug(a+
  "    ")}}).call(a.prototype);j.ScopeManager=g});define("mode/r",function(b,j){b("ace/editor");b("ace/edit_session");b("ace/range");var i=b("ace/lib/oop"),g=b("ace/mode/text").Mode,a=b("ace/tokenizer").Tokenizer,d=b("ace/mode/text_highlight_rules").TextHighlightRules,e=b("mode/r_highlight_rules").RHighlightRules,f=b("mode/r_code_model").RCodeModel,c=b("mode/r_matching_brace_outdent").RMatchingBraceOutdent;b("mode/auto_brace_insert");var h=b("ace/unicode"),k=function(c,b){this.$tokenizer=c?new a((new d).getRules()):new a((new e).getRules());this.foldingRules=
  this.codeModel=new f(b,this.$tokenizer,null)};i.inherits(k,g);(function(){i.implement(this,c);this.tokenRe=RegExp("^["+h.packages.L+h.packages.Mn+h.packages.Mc+h.packages.Nd+h.packages.Pc+"._]+","g");this.nonTokenRe=RegExp("^(?:[^"+h.packages.L+h.packages.Mn+h.packages.Mc+h.packages.Nd+h.packages.Pc+"._]|s])+","g");this.$complements={"(":")","[":"]",'"':'"',"'":"'","{":"}"};this.$reOpen=/^[(["'{]$/;this.$reClose=/^[)\]"'}]$/;this.getNextLineIndent=function(a,c,b,d,e){return this.codeModel.getNextLineIndent(e,
  c,a,b,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.transformAction=function(a,c,b,d,e){return"insertion"===c&&"\n"===e&&(a=b.getSelectionRange().start,(d=/^((\s*#+')\s*)/.exec(d.doc.getLine(a.row)))&&b.getSelectionRange().start.column>=d[2].length)?{text:"\n"+d[1]}:!1}}).call(k.prototype);j.Mode=k});define("mode/tex_highlight_rules",function(b,j){var i=b("ace/lib/oop");b("ace/lib/lang");var g=b("ace/mode/text_highlight_rules").TextHighlightRules,a=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",next:"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:"start"},{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:"start"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])]"},{token:"paren.keyword.operator",regex:"}",next:"start"},{token:"nospell."+a,regex:"\\s+"},{token:"nospell."+a,regex:"\\w+"}]}};i.inherits(a,g);j.TexHighlightRules=a});define("mode/tex",function(b,j){var i=b("ace/lib/oop"),g=b("ace/mode/text").Mode,a=b("ace/tokenizer").Tokenizer,d=b("ace/mode/text_highlight_rules").TextHighlightRules,e=b("mode/tex_highlight_rules").TexHighlightRules,f=b("ace/mode/matching_brace_outdent").MatchingBraceOutdent,c=function(c){this.$tokenizer=c?new a((new d).getRules()):new a((new e).getRules());this.$outdent=new f};i.inherits(c,g);(function(){this.getNextLineIndent=function(a,c){return this.$getIndent(c)};this.allowAutoInsert=function(){return!1}}).call(c.prototype);
  j.Mode=c});define("mode/sweave_background_highlighter",function(b,j){var i=b("ace/range").Range,g=function(a,b,e,f){this.$session=a;this.$doc=a.getDocument();this.$reCode=b;this.$reText=e;this.$textIsTerminator=f;var c=this;this.$doc.on("change",function(a){c.$onDocChange.apply(c,[a])});this.$rowState=Array(this.$doc.getLength());this.$markers=[];for(b=0;b<this.$doc.getLength();b++)this.$updateRow(b);var a=a.getMarkers(!1),h;for(h in a)b=a[h],b.range&&"ace_foreign_line sweave_background_highlight"===b.clazz&&
  "background"==b.type&&(this.$markers[b.range.start.row]=h);this.$syncMarkers(0)};(function(){this.$updateRow=function(a){var b=this.$doc.getLine(a),e="text",f="text";if(b.match(this.$reCode))e="begin",f="r";else if(!this.$textIsTerminator&&b.match(this.$reText))e="end",f="text";else if(0<a){var c=this.$rowState[a-1];if("begin"===c||"r"===c)b.match(this.$reText)?(e="end",f="text"):f=e="r"}this.$rowState[a]=e;for(a+=1;a<this.$rowState.length;a++){b=this.$rowState[a];if("begin"===b)break;if("end"===
  b){this.$textIsTerminator&&"text"===f&&(this.$rowState[a]="text");break}if(this.$textIsTerminator&&"r"===f&&this.$doc.getLine(a).match(this.$reText)){this.$updateRow(a);break}if(this.$rowState[a]===f)break;this.$rowState[a]=f}};this.$syncMarkers=function(a,b){for(var e="undefined"==typeof b?this.$doc.getLength():a+b,f=this.$doc.getLength()-1,c=a;c<=f;c++){var h="text"!=this.$rowState[c];if(!!h!=!!this.$markers[c])this.$markers[c]&&this.$session.removeMarker(this.$markers[c]),h?this.$markers[c]=this.$session.addMarker(new i(c,
  0,c+1,0),"ace_foreign_line sweave_background_highlight","background",!1):delete this.$markers[c];else if(c>e)break}};this.$insertNewRows=function(a,b){var e=Array(b+2);e[0]=a;e[1]=0;Array.prototype.splice.apply(this.$rowState,e)};this.$removeRows=function(a,b){this.$rowState.splice(a,b)};this.$onDocChange=function(a){a=a.data;if("insertLines"===a.action){var b=a.range.end.row-a.range.start.row;this.$insertNewRows(a.range.start.row,b);for(var e=0;e<b;e++)this.$updateRow(a.range.start.row+e);this.$syncMarkers(a.range.start.row)}else"insertText"===
  a.action?this.$doc.isNewLine(a.text)?(this.$insertNewRows(a.range.end.row,1),this.$updateRow(a.range.start.row),this.$updateRow(a.range.start.row+1),this.$syncMarkers(a.range.start.row)):(this.$updateRow(a.range.start.row),this.$syncMarkers(a.range.start.row,1)):"removeLines"===a.action?(this.$removeRows(a.range.start.row,a.range.end.row-a.range.start.row),this.$updateRow(a.range.start.row),this.$syncMarkers(a.range.start.row)):"removeText"===a.action&&(this.$doc.isNewLine(a.text)?(this.$removeRows(a.range.end.row,
  1),this.$updateRow(a.range.start.row),this.$syncMarkers(a.range.start.row)):(this.$updateRow(a.range.start.row),this.$syncMarkers(a.range.start.row,1)))}}).call(g.prototype);j.SweaveBackgroundHighlighter=g});define("mode/sweave_highlight_rules",function(b,j){var i=b("ace/lib/oop"),g=b("mode/tex_highlight_rules").TexHighlightRules,a=b("mode/r_highlight_rules").RHighlightRules,d=b("ace/mode/text_highlight_rules").TextHighlightRules,e=function(){this.$rules=(new g).getRules();this.$rules.start.unshift({token:"comment.codebegin",regex:"^\\s*\\<\\<.*\\>\\>=.*$",next:"r-start"});this.$rules.start.unshift({token:"comment",regex:"^\\s*@(?:\\s.*)?$"});this.addRules((new a).getRules(),"r-");this.$rules["r-start"].unshift({token:"comment.codeend",
  regex:"^\\s*@(?:\\s.*)?$",next:"start"});this.$rules["r-start"].unshift({token:"comment.codebegin",regex:"^\\<\\<.*\\>\\>=.*$",next:"r-start"})};i.inherits(e,d);j.SweaveHighlightRules=e});define("mode/sweave",function(b,j){var i=b("ace/lib/oop"),g=b("ace/mode/text").Mode,a=b("ace/tokenizer").Tokenizer,d=b("ace/mode/text_highlight_rules").TextHighlightRules,e=b("mode/sweave_background_highlighter").SweaveBackgroundHighlighter,f=b("mode/sweave_highlight_rules").SweaveHighlightRules,c=b("mode/r_code_model").RCodeModel,h=b("mode/r_matching_brace_outdent").RMatchingBraceOutdent,k=b("ace/unicode"),l=function(b,h,k){this.$tokenizer=b?new a((new d).getRules()):new a((new f).getRules());this.foldingRules=
  this.codeModel=new c(h,this.$tokenizer,/^r-/,/<<(.*?)>>/);this.$sweaveBackgroundHighlighter=new e(k,/^\s*\<\<.*\>\>=.*$/,/^\s*@(?:\s.*)?$/,!1);this.$session=k};i.inherits(l,g);(function(){i.implement(this,h);this.tokenRe=RegExp("^["+k.packages.L+k.packages.Mn+k.packages.Mc+k.packages.Nd+k.packages.Pc+"_]+","g");this.nonTokenRe=RegExp("^(?:[^"+k.packages.L+k.packages.Mn+k.packages.Mc+k.packages.Nd+k.packages.Pc+"_]|s])+","g");this.$complements={"(":")","[":"]",'"':'"',"'":"'","{":"}"};this.$reOpen=
  /^[(["'{]$/;this.$reClose=/^[)\]"'}]$/;this.insertChunkInfo={value:"<<>>=\n\n@\n",position:{row:0,column:2}};this.getLanguageMode=function(a){return this.$session.getState(a.row).match(/^r-/)?"R":"TeX"};this.getNextLineIndent=function(a,b,c,d,e){return this.codeModel.getNextLineIndent(e,b,a,c,d)};this.allowAutoInsert=this.smartAllowAutoInsert}).call(l.prototype);j.Mode=l});define("mode/rdoc_highlight_rules",function(b,j){var i=b("ace/lib/oop");b("ace/lib/lang");var g=b("ace/mode/text_highlight_rules").TextHighlightRules,a=function(){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+"}]}};i.inherits(a,g);j.RDocHighlightRules=a});define("mode/rdoc",function(b,j){var i=b("ace/lib/oop"),g=b("ace/mode/text").Mode,a=b("ace/tokenizer").Tokenizer,d=b("ace/mode/text_highlight_rules").TextHighlightRules,e=b("mode/rdoc_highlight_rules").RDocHighlightRules,f=b("ace/mode/matching_brace_outdent").MatchingBraceOutdent,c=function(b){this.$tokenizer=b?new a((new d).getRules()):new a((new e).getRules());this.$outdent=new f};i.inherits(c,g);(function(){this.getNextLineIndent=function(a,b){return this.$getIndent(b)}}).call(c.prototype);j.Mode=
  c});define("mode/markdown_highlight_rules",function(b,j){var i=b("ace/lib/oop"),g=b("ace/lib/lang"),a=b("ace/mode/text_highlight_rules").TextHighlightRules,d=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(","));this.$rules={start:[{token:"empty_line",regex:"^$"},{token:["support.function","support.function",
  "support.function"],regex:"(`+)([^\\r]*?[^`])(\\1)"},{token:"markup.heading.1",regex:"^\\={3,}\\s*$",next:"fieldblock"},{token:"markup.heading.1",regex:"^=+(?=\\s*$)"},{token:"markup.heading.2",regex:"^\\-+(?=\\s*$)"},{token:function(a){return"markup.heading."+a.search(/[^#]/)},regex:"^#{1,6}(?:[^ #].*| +.*(?:[^ #].*|[^ ]+.* +#+ *))$"},{token:"support.function",regex:"^```[a-zA-Z]+\\s*$",next:"githubblock"},{token:"string",regex:"^>[ ].+$",next:"blockquote"},{token:"text,constant,text,url,string,text".split(","),
  regex:'^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:["][^"]+["])?(\\s*))$'},{token:["text","keyword","text","constant","text"],regex:"(\\[)((?:[[^\\]]*\\]|[^\\[\\]])*)(\\][ ]?(?:\\n[ ]*)?\\[)(.*?)(\\])"},{token:"text,keyword,text,markup.underline,string,text".split(","),regex:'(\\[)(\\[[^\\]]*\\]|[^\\[\\]]*)(\\]\\([ \\t]*)(<?(?:(?:[^\\(]*?\\([^\\)]*?\\)\\S*?)|(?:.*?))>?)((?:[ \t]*"(?:.*?)"[ \\t]*)?)(\\))'},{token:"constant",regex:"^[ ]{0,2}(?:[ ]?\\*[ ]?){3,}\\s*$"},{token:"constant",regex:"^[ ]{0,2}(?:[ ]?\\-[ ]?){3,}\\s*$"},
  {token:"constant",regex:"^[ ]{0,2}(?:[ ]?\\_[ ]?){3,}\\s*$"},{token:"markup.list",regex:"\\\\\\[",next:"mathjaxnativedisplay"},{token:"markup.list",regex:"\\\\\\(",next:"mathjaxnativeinline"},{token:"text",regex:"\\\\\\$"},{token:"markup.list",regex:"\\${2}",next:"mathjaxdisplay"},{token:["markup.list","support.function","markup.list"],regex:"(\\$)((?!\\s)[^$]*[^$\\s])(\\$)(?![\\w\\d`])"},{token:["constant.numeric","constant.numeric","constant.numeric"],regex:"([*]{2}|[_]{2}(?=\\S))([^\\r]*?\\S[*_]*)(\\1)"},
  {token:["constant.language.boolean","constant.language.boolean","constant.language.boolean"],regex:"([*]|[_](?=\\S))([^\\r]*?\\S[*_]*)(\\1)"},{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","text","paren.keyword.operator"],regex:"(\\{)([^\\}]*)(\\})"},{token:"markup.list",regex:"\\[-?\\@[\\w\\d-]+\\]"},{token:"markup.list",
  regex:"-?\\@[\\w\\d-]+"},{token:"text",regex:"[^\\*_%$`\\[#<>\\\\]+"},{token:"text",regex:"\\\\"}],blockquote:[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"string",regex:".+"}],githubblock:[{token:"support.function",regex:"^```",next:"start"},{token:"support.function",regex:".+"}],fieldblock:[{token:function(b){b=b.slice(0,-1);return a[b]?"comment.doc.tag":"text"},regex:"^[\\w-]+\\:",next:"fieldblockvalue"},{token:"text",regex:"(?=.+)",next:"start"}],fieldblockvalue:[{token:"text",regex:"$",
  next:"fieldblock"},{token:"text",regex:".+"}],mathjaxdisplay:[{token:"markup.list",regex:"\\${2}",next:"start"},{token:"support.function",regex:"[^\\$]+"}],mathjaxnativedisplay:[{token:"markup.list",regex:"\\\\\\]",next:"start"},{token:"support.function",regex:"[\\s\\S]+?"}],mathjaxinline:[{token:"markup.list",regex:"\\$",next:"start"},{token:"support.function",regex:"[^\\$]+"}],mathjaxnativeinline:[{token:"markup.list",regex:"\\\\\\)",next:"start"},{token:"support.function",regex:"[\\s\\S]+?"}]}};
  i.inherits(d,a);j.MarkdownHighlightRules=d});define("mode/markdown_folding",function(b,j){var i=b("ace/lib/oop"),g=b("ace/mode/folding/fold_mode").FoldMode,a=b("ace/range").Range,d=j.FoldMode=function(){};i.inherits(d,g);(function(){this.foldingStartMarker=/^(?:[=-]+\s*$|#{1,6} |`{3})/;this.getFoldWidget=function(a,b,c){b=a.getLine(c);return!this.foldingStartMarker.test(b)?"":"`"==b[0]&&"start"==a.bgTokenizer.getState(c)?"end":"start"};this.getFoldWidgetRange=function(b,d,c){function h(a){return(p=b.getTokens(a)[0])&&0===p.type.lastIndexOf(r,
  0)}function k(){var a=p.value[0];return"="==a?6:"-"==a?5:7-p.value.search(/[^#]/)}var l=b.getLine(c),d=l.length,g=b.getLength(),i=c,j=c;if(l.match(this.foldingStartMarker)){if("`"==l[0]){if("start"!==b.bgTokenizer.getState(c)){for(;++c<g&&!(l=b.getLine(c),"`"==l[0]&"```"==l.substring(0,3)););return new a(i,d,c,0)}for(;0<c--&&!(l=b.getLine(c),"`"==l[0]&"```"==l.substring(0,3)););return new a(c,l.length,i,0)}var p,r="markup.heading";if(h(c)){for(j=k();++c<g&&!(h(c)&&k()>=j););j=c-(!p||-1==["=","-"].indexOf(p.value[0])?
  1:2);if(j>i)for(;j>i&&/^\s*$/.test(b.getLine(j));)j--;if(j>i)return c=b.getLine(j).length,new a(i,d,j,c)}}}}).call(d.prototype)});define("mode/markdown",function(b,j){var i=b("ace/lib/oop"),g=b("ace/mode/text").Mode,a=b("ace/tokenizer").Tokenizer,d=b("mode/markdown_highlight_rules").MarkdownHighlightRules,e=b("mode/markdown_folding").FoldMode,f=function(){this.$tokenizer=new a((new d).getRules());this.foldingRules=new e};i.inherits(f,g);(function(){this.getNextLineIndent=function(a,b){return this.$getIndent(b)}}).call(f.prototype);j.Mode=f});define("mode/rmarkdown_highlight_rules",function(b,j){var i=b("ace/lib/oop"),g=b("mode/r_highlight_rules").RHighlightRules,a=b("mode/c_cpp_highlight_rules").c_cppHighlightRules,d=b("mode/markdown_highlight_rules").MarkdownHighlightRules,e=b("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$rules=(new d).getRules();this.$rules.start.unshift({token:"support.function.codebegin",regex:"^(?:[ ]{4})?`{3,}\\s*\\{r(?:.*)\\}\\s*$",next:"r-start"});this.addRules((new g).getRules(),"r-");
  this.$rules["r-start"].unshift({token:"support.function.codeend",regex:"^(?:[ ]{4})?`{3,}\\s*$",next:"start"});this.$rules.start.unshift({token:"support.function.codebegin",regex:"^(?:[ ]{4})?`{3,}\\s*\\{r(?:.*)engine\\='Rcpp'(?:.*)\\}\\s*$",next:"r-cpp-start"});this.addRules((new a).getRules(),"r-cpp-");this.$rules["r-cpp-start"].unshift({token:"support.function.codeend",regex:"^(?:[ ]{4})?`{3,}\\s*$",next:"start"})};i.inherits(f,e);j.RMarkdownHighlightRules=f});define("mode/rmarkdown",function(b,j){var i=b("ace/lib/oop"),g=b("mode/markdown").Mode,a=b("ace/tokenizer").Tokenizer,d=b("mode/rmarkdown_highlight_rules").RMarkdownHighlightRules,e=b("ace/mode/matching_brace_outdent").MatchingBraceOutdent,f=b("mode/r_matching_brace_outdent").RMatchingBraceOutdent,c=b("mode/sweave_background_highlighter").SweaveBackgroundHighlighter,h=b("mode/r_code_model").RCodeModel,k=b("mode/markdown_folding").FoldMode,l=function(b,g,l){var j=this;this.$session=l;this.$tokenizer=
  new a((new d).getRules());this.$outdent=new e;this.$r_outdent={};i.implement(this.$r_outdent,f);this.codeModel=new h(g,this.$tokenizer,/^r-/,/^(?:[ ]{4})?`{3,}\s*\{r(.*)\}\s*$/);var r=new k;this.foldingRules={getFoldWidget:function(a,b,c){return"Markdown"==j.getLanguageMode({row:c,column:0})?r.getFoldWidget(a,b,c):j.codeModel.getFoldWidget(a,b,c)},getFoldWidgetRange:function(a,b,c){return"Markdown"==j.getLanguageMode({row:c,column:0})?r.getFoldWidgetRange(a,b,c):j.codeModel.getFoldWidgetRange(a,b,
  c)}};this.$sweaveBackgroundHighlighter=new c(l,/^(?:[ ]{4})?`{3,}\s*\{r(?:.*)\}\s*$/,/^(?:[ ]{4})?`{3,}\s*$/,!0)};i.inherits(l,g);(function(){this.insertChunkInfo={value:"```{r}\n\n```\n",position:{row:0,column:5}};this.getLanguageMode=function(a){return this.$session.getState(a.row).match(/^r-cpp-(?!r-)/)?"C_CPP":this.$session.getState(a.row).match(/^r-/)?"R":"Markdown"};this.inCppLanguageMode=function(a){return a.match(/^r-cpp-(?!r-)/)};this.inMarkdownLanguageMode=function(a){return!a.match(/^r-/)};
  this.getNextLineIndent=function(a,b,c,d,e){if(this.inCppLanguageMode(a)){var d=this.$getIndent(b),h=this.$tokenizer.getLineTokens(b,a),e=h.tokens,h=h.state;if(e.length&&"comment"==e[e.length-1].type)return d;if("r-cpp-start"==a)(a=b.match(/^.*[\{\(\[]\s*$/))&&(d+=c);else if("r-cpp-doc-start"==a){if("start"==h)return"";if(a=b.match(/^\s*(\/?)\*/))a[1]&&(d+=" "),d+="* "}return d}return this.codeModel.getNextLineIndent(e,b,a,c,d)};this.checkOutdent=function(a,b,c){return this.inCppLanguageMode(a)?this.$outdent.checkOutdent(b,
  c):this.$r_outdent.checkOutdent(b,c)};this.autoOutdent=function(a,b,c){return this.inCppLanguageMode(a)?this.$outdent.autoOutdent(b,c):this.$r_outdent.autoOutdent(a,b,c)};this.transformAction=function(a,b,c,d,e){if("insertion"===b)if("\n"===e&&this.inCppLanguageMode(a)){if(a=c.getSelectionRange().start,(d=/^((\s*\/\/+')\s*)/.exec(d.doc.getLine(a.row)))&&c.getSelectionRange().start.column>=d[2].length)return{text:"\n"+d[1]}}else if("R"===e&&this.inCppLanguageMode(a)&&(a=c.getSelectionRange().start,
  (d=/^(\s*\/\*{3,}\s*)/.exec(d.doc.getLine(a.row)))&&c.getSelectionRange().start.column>=d[1].length))return{text:"R\n\n*/\n",selection:[1,0,1,0]};return!1}}).call(l.prototype);j.Mode=l});define("mode/rhtml_highlight_rules",function(b,j){var i=b("ace/lib/oop"),g=b("mode/r_highlight_rules").RHighlightRules,a=b("ace/mode/html_highlight_rules").HtmlHighlightRules,d=b("ace/mode/text_highlight_rules").TextHighlightRules,e=function(){this.$rules=(new a).getRules();this.$rules.start.unshift({token:"support.function.codebegin",regex:"^<\!--\\s*begin.rcode\\s*(?:.*)",next:"r-start"});this.addRules((new g).getRules(),"r-");this.$rules["r-start"].unshift({token:"support.function.codeend",regex:"^\\s*end.rcode\\s*--\>",
  next:"start"})};i.inherits(e,d);j.RHtmlHighlightRules=e});define("mode/rhtml",function(b,j){var i=b("ace/lib/oop"),g=b("ace/mode/html").Mode,a=b("ace/tokenizer").Tokenizer,d=b("mode/rhtml_highlight_rules").RHtmlHighlightRules,e=b("mode/sweave_background_highlighter").SweaveBackgroundHighlighter,f=b("mode/r_code_model").RCodeModel,c=function(b,c,l){this.$session=l;this.$tokenizer=new a((new d).getRules());this.foldingRules=this.codeModel=new f(c,this.$tokenizer,/^r-/,/^<\!--\s*begin.rcode\s*(.*)/);this.$sweaveBackgroundHighlighter=new e(l,/^<\!--\s*begin.rcode\s*(?:.*)/,
  /^\s*end.rcode\s*--\>/,!0)};i.inherits(c,g);(function(){this.insertChunkInfo={value:"<\!--begin.rcode\n\nend.rcode--\>\n",position:{row:0,column:15}};this.getLanguageMode=function(a){return this.$session.getState(a.row).match(/^r-/)?"R":"HTML"};this.getNextLineIndent=function(a,b,c,d,e){return this.codeModel.getNextLineIndent(e,b,a,c,d)}}).call(c.prototype);j.Mode=c});define("mode/dcf_highlight_rules",function(b,j){var i=b("ace/lib/oop"),g=b("ace/mode/text_highlight_rules").TextHighlightRules,a=function(){this.$rules={start:[{token:["keyword","text"],regex:"^([\\w-]+)(\\:)"},{token:"text",regex:".+"}]}};i.inherits(a,g);j.DcfHighlightRules=a});define("mode/dcf",function(b,j){var i=b("ace/lib/oop"),g=b("ace/mode/text").Mode,a=b("ace/tokenizer").Tokenizer,d=b("mode/dcf_highlight_rules").DcfHighlightRules,e=function(){this.$tokenizer=new a((new d).getRules())};i.inherits(e,g);(function(){this.getNextLineIndent=function(a,b){return this.$getIndent(b)}}).call(e.prototype);j.Mode=e});define("mode/doc_comment_highlight_rules",function(b,j){var i=b("ace/lib/oop"),g=b("ace/mode/text_highlight_rules").TextHighlightRules,a=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:"."}]}};i.inherits(a,g);a.getStartRule=function(a){return{token:"comment.doc",merge:!0,regex:"\\/\\*[\\*\\!]",
  next:a}};a.getEndRule=function(a){return{token:"comment.doc",merge:!0,regex:"\\*\\/",next:a}};j.DocCommentHighlightRules=a});define("mode/c_cpp_highlight_rules",function(b,j){var i=b("ace/lib/oop"),g=b("ace/lib/lang"),a=b("mode/doc_comment_highlight_rules").DocCommentHighlightRules,d=b("ace/mode/text_highlight_rules").TextHighlightRules,e=b("mode/tex_highlight_rules").TexHighlightRules,f=b("mode/r_highlight_rules").RHighlightRules,c=function(){var b=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,long,mutable,namespace,new,noexcept,not,not_eq,nullptr,operator,or,or_eq,private,protected,public,register,reinterpret_cast,return,short,signed,sizeof,static,static_assert,static_cast,struct,switch,template,this,thread_local,throw,true,try,typedef,typeid,typename,union,unsigned,using,virtual,void,volatile,wchar_t,while,xor,xor_eq".split(",")),
  c=g.arrayToMap(["NULL"]);this.$rules={start:[{token:"comment.doc.tag",regex:"\\/\\/\\s*\\[\\[.*\\]\\].*$"},{token:"comment",regex:"\\/\\/'",next:"rd-start"},{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",merge:!0,regex:"\\/\\*",next:"comment"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",merge:!0,regex:'["].*\\\\$',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:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant",regex:"<[a-zA-Z0-9.]+>"},{token:"keyword",regex:"(?:#include|#pragma|#line|#define|#undef|#ifdef|#else|#elif|#endif|#ifndef)"},{token:function(a){return"this"==a?"variable.language":b.hasOwnProperty(a)?"keyword":c.hasOwnProperty(a)?"constant.language":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",
  regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)"},{token:"punctuation.operator",regex:"\\?|\\:|\\,|\\;|\\."},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",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:".+"}]};for(var d=(new e("comment")).getRules(),i=0;i<d.start.length;i++)d.start[i].token+=".virtual-comment";this.addRules(d,"rd-");this.$rules["rd-start"].unshift({token:"text",regex:"^",next:"start"});this.$rules["rd-start"].unshift({token:"keyword",regex:"@(?!@)[^ ]*"});this.$rules["rd-start"].unshift({token:"comment",regex:"@@"});this.$rules["rd-start"].push({token:"comment",
  regex:"[^%\\\\[({\\])}]+"});this.embedRules(a,"doc-",[a.getEndRule("start")]);this.$rules.start.unshift({token:"support.function.codebegin",regex:"^\\s*\\/\\*{3,}\\s+[Rr]\\s*$",next:"r-start"});this.addRules((new f).getRules(),"r-");this.$rules["r-start"].unshift({token:"support.function.codeend",regex:"\\*\\/",next:"start"})};i.inherits(c,d);j.c_cppHighlightRules=c});define("mode/c_cpp",function(b,j){var i=b("ace/lib/oop"),g=b("ace/mode/text").Mode,a=b("ace/tokenizer").Tokenizer,d=b("mode/c_cpp_highlight_rules").c_cppHighlightRules,e=b("ace/mode/matching_brace_outdent").MatchingBraceOutdent,f=b("ace/range").Range,c=b("ace/mode/behaviour/cstyle").CstyleBehaviour,h=null;window.NodeWebkit||(h=b("mode/c_cpp_fold_mode").FoldMode);var k=b("mode/sweave_background_highlighter").SweaveBackgroundHighlighter,l=b("mode/r_code_model").RCodeModel,n=b("mode/r_matching_brace_outdent").RMatchingBraceOutdent,
  o=function(b,f,g){this.$session=g;this.$tokenizer=new a((new d).getRules());this.$outdent=new e;this.$r_outdent={};i.implement(this.$r_outdent,n);this.$behaviour=new c;this.codeModel=new l(f,this.$tokenizer,/^r-/,/^\s*\/\*{3,}\s+[Rr]\s*$/);this.$sweaveBackgroundHighlighter=new k(g,/^\s*\/\*{3,}\s+[Rr]\s*$/,/^\*\/$/,!0);window.NodeWebkit||(this.foldingRules=new h)};i.inherits(o,g);(function(){this.insertChunkInfo={value:"/*** R\n\n*/\n",position:{row:1,column:0}};this.toggleCommentLines=function(a,
  b,c,d){for(var e=!0,a=/^(\s*)\/\//,h=c;h<=d;h++)if(!a.test(b.getLine(h))){e=!1;break}if(e){e=new f(0,0,0,0);for(h=c;h<=d;h++)c=b.getLine(h).match(a),e.start.row=h,e.end.row=h,e.end.column=c[0].length,b.replace(e,c[1])}else b.indentRows(c,d,"//")};this.getLanguageMode=function(a){return this.$session.getState(a.row).match(/^r-/)?"R":"C_CPP"};this.inRLanguageMode=function(a){return a.match(/^r-/)};this.getNextLineIndent=function(a,b,c,d,e){if(this.inRLanguageMode(a))return this.codeModel.getNextLineIndent(e,
  b,a,c,d);var d=this.$getIndent(b),h=this.$tokenizer.getLineTokens(b,a),e=h.tokens,h=h.state;if(e.length&&"comment"==e[e.length-1].type)return d;if("start"==a)(a=b.match(/^.*[\{\(\[]\s*$/))&&(d+=c);else if("doc-start"==a){if("start"==h)return"";if(a=b.match(/^\s*(\/?)\*/))a[1]&&(d+=" "),d+="* "}return d};this.checkOutdent=function(a,b,c){return this.inRLanguageMode(a)?this.$r_outdent.checkOutdent(b,c):this.$outdent.checkOutdent(b,c)};this.autoOutdent=function(a,b,c){return this.inRLanguageMode(a)?
  this.$r_outdent.autoOutdent(a,b,c):this.$outdent.autoOutdent(b,c)};this.transformAction=function(a,b,c,d,e){if("insertion"===b)if("\n"===e){a=c.getSelectionRange().start;if((b=/^(\/\*[\*\!]\s*)/.exec(d.doc.getLine(a.row)))&&c.getSelectionRange().start.column>=b[1].length)return{text:"\n * \n */\n",selection:[1,3,1,3]};if((b=/^((\s*\/\/+')\s*)/.exec(d.doc.getLine(a.row)))&&c.getSelectionRange().start.column>=b[2].length)return{text:"\n"+b[1]}}else if("R"===e&&(a=c.getSelectionRange().start,(b=/^(\s*\/\*{3,}\s+)/.exec(d.doc.getLine(a.row)))&&
  c.getSelectionRange().start.column>=b[1].length))return{text:"R\n\n*/\n",selection:[1,0,1,0]};return!1}}).call(o.prototype);j.Mode=o});define("mode/c_cpp_fold_mode",function(b,j){var i=b("ace/lib/oop");b("ace/lib/range");var g=b("ace/mode/folding/fold_mode").FoldMode,a=j.FoldMode=function(){};i.inherits(a,g);(function(){this.embeddedRComment=/^\s*\/\*{3,}\s+[Rr]\s*$/;this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/;this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;this.getFoldWidget=function(a,b,f){a=a.getLine(f);return this.foldingStartMarker.test(a)&&!this.embeddedRComment.test(a)?"start":"markbeginend"==b&&this.foldingStopMarker&&
  this.foldingStopMarker.test(a)?"end":""};this.getFoldWidgetRange=function(a,b,f){var c=a.getLine(f),h=c.match(this.foldingStartMarker);if(h)return b=h.index,h[1]?this.openingBracketBlock(a,h[1],f,b):a.getCommentFoldRange(f,b+h[0].length,1);if("markbeginend"===b&&(h=c.match(this.foldingStopMarker)))return b=h.index+h[0].length,h[1]?this.closingBracketBlock(a,h[1],f,b):a.getCommentFoldRange(f,b,-1)}}).call(a.prototype)});define("mode/python_highlight_rules",function(b,j){var i=b("ace/lib/oop"),g=b("ace/lib/lang"),a=b("ace/mode/text_highlight_rules").TextHighlightRules,d=function(){var a=g.arrayToMap("and,as,assert,break,class,continue,def,del,elif,else,except,exec,finally,for,from,global,if,import,in,is,lambda,not,or,pass,print,raise,return,try,while,with,yield".split(",")),b=g.arrayToMap("True,False,None,NotImplemented,Ellipsis,__debug__".split(",")),c=g.arrayToMap("abs,divmod,input,open,staticmethod,all,enumerate,int,ord,str,any,eval,isinstance,pow,sum,basestring,execfile,issubclass,print,super,binfile,iter,property,tuple,bool,filter,len,range,type,bytearray,float,list,raw_input,unichr,callable,format,locals,reduce,unicode,chr,frozenset,long,reload,vars,classmethod,getattr,map,repr,xrange,cmp,globals,max,reversed,zip,compile,hasattr,memoryview,round,__import__,complex,hash,min,set,apply,delattr,help,next,setattr,buffer,dict,hex,object,slice,coerce,dir,id,oct,sorted,intern".split(",")),
  d=g.arrayToMap([]);this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:'(?:r|u|ur|R|U|UR|Ur|uR)?"{3}(?:[^\\\\]|\\\\.)*?"{3}'},{token:"string",merge:!0,regex:'(?:r|u|ur|R|U|UR|Ur|uR)?"{3}.*$',next:"qqstring"},{token:"string",regex:'(?:r|u|ur|R|U|UR|Ur|uR)?"(?:[^\\\\]|\\\\.)*?"'},{token:"string",regex:"(?:r|u|ur|R|U|UR|Ur|uR)?'{3}(?:[^\\\\]|\\\\.)*?'{3}"},{token:"string",merge:!0,regex:"(?:r|u|ur|R|U|UR|Ur|uR)?'{3}.*$",next:"qstring"},{token:"string",regex:"(?:r|u|ur|R|U|UR|Ur|uR)?'(?:[^\\\\]|\\\\.)*?'"},
  {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:function(k){return a.hasOwnProperty(k)?"keyword":b.hasOwnProperty(k)?"constant.language":d.hasOwnProperty(k)?"invalid.illegal":c.hasOwnProperty(k)?"support.function":"debugger"==k?"invalid.deprecated":"identifier"},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+"}],qqstring:[{token:"string",
  regex:'(?:[^\\\\]|\\\\.)*?"{3}',next:"start"},{token:"string",merge:!0,regex:".+"}],qstring:[{token:"string",regex:"(?:[^\\\\]|\\\\.)*?'{3}",next:"start"},{token:"string",merge:!0,regex:".+"}]}};i.inherits(d,a);j.PythonHighlightRules=d});define("mode/python",function(b,j){var i=b("ace/lib/oop"),g=b("ace/mode/text").Mode,a=b("ace/tokenizer").Tokenizer,d=b("mode/python_highlight_rules").PythonHighlightRules,e=b("mode/pythonic_fold_mode").FoldMode,f=b("ace/range").Range,c=function(){this.$tokenizer=new a((new d).getRules());this.foldingRules=new e("\\:")};i.inherits(c,g);(function(){this.toggleCommentLines=function(a,b,c,d){for(var e=!0,a=/^(\s*)#/,h=c;h<=d;h++)if(!a.test(b.getLine(h))){e=!1;break}if(e){e=new f(0,0,0,0);for(h=c;h<=d;h++)c=
  b.getLine(h).match(a),e.start.row=h,e.end.row=h,e.end.column=c[0].length,b.replace(e,c[1])}else b.indentRows(c,d,"#")};this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a).tokens;if(e.length&&"comment"==e[e.length-1].type)return d;"start"==a&&b.match(/^.*[\{\(\[\:]\s*$/)&&(d+=c);return d};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.$tokenizer.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?!1:"keyword"==c.type&&a[c.value]};this.autoOutdent=function(a,b,c){var c=c+1,a=this.$getIndent(b.getLine(c)),d=b.getTabString();a.slice(-d.length)==d&&b.remove(new f(c,a.length-d.length,c,a.length))}}).call(c.prototype);j.Mode=c});define("mode/pythonic_fold_mode",function(b,j){var i=b("ace/lib/oop"),g=b("ace/mode/folding/fold_mode").FoldMode,a=j.FoldMode=function(a){this.foldingStartMarker=RegExp("([\\[{])(?:\\s*)$|("+a+")(?:\\s*)(?:#.*)?$")};i.inherits(a,g);(function(){this.getFoldWidgetRange=function(a,b,f){if(b=a.getLine(f).match(this.foldingStartMarker))return b[1]?this.openingBracketBlock(a,b[1],f,b.index):b[2]?this.indentationBlock(a,f,b.index+b[2].length):this.indentationBlock(a,f)}}).call(a.prototype)});define("mode/sql_highlight_rules",function(b,j){var i=b("ace/lib/oop"),g=b("ace/lib/lang"),a=b("ace/mode/text_highlight_rules").TextHighlightRules,d=function(){var a=g.arrayToMap("select,from,where,and,or,group,by,order,limit,offset,having,as,case,when,else,end,type,left,right,join,on,outer,desc,asc".split(",")),b=g.arrayToMap(["true","false","null"]),c=g.arrayToMap("count,min,max,avg,sum,rank,now,coalesce".split(","));this.$rules={start:[{token:"comment",regex:"--.*$"},{token:"string",regex:'".*"'},
  {token:"string",regex:"'.*'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:function(d){d=d.toLowerCase();return a.hasOwnProperty(d)?"keyword":b.hasOwnProperty(d)?"constant.language":c.hasOwnProperty(d)?"support.function":"identifier"},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+"}]}};
  i.inherits(d,a);j.SqlHighlightRules=d});define("mode/sql",function(b,j){var i=b("ace/lib/oop"),g=b("ace/mode/text").Mode,a=b("ace/tokenizer").Tokenizer,d=b("mode/sql_highlight_rules").SqlHighlightRules,e=b("ace/range").Range,f=function(){this.$tokenizer=new a((new d).getRules())};i.inherits(f,g);(function(){this.toggleCommentLines=function(a,b,d,f){for(var g=!0,a=/^(\s*)--/,i=d;i<=f;i++)if(!a.test(b.getLine(i))){g=!1;break}if(g){g=new e(0,0,0,0);for(i=d;i<=f;i++)d=b.getLine(i).match(a),g.start.row=i,g.end.row=i,g.end.column=d[0].length,
  b.replace(g,d[1])}else b.indentRows(d,f,"--")}}).call(f.prototype);j.Mode=f});define("mode/sh_highlight_rules",function(b,j){var i=b("ace/lib/oop"),g=b("ace/lib/lang"),a=b("ace/mode/text_highlight_rules").TextHighlightRules,d=function(){var a=g.arrayToMap("!,{,},case,do,done,elif,else,esac,fi,for,if,in,then,until,while,&,;,export,local,read,typeset,unset,elif,select,set".split(",")),b=g.arrayToMap("[,],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".split(","));
  this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:'"(?:[^\\\\]|\\\\.)*?"'},{token:"variable.language",regex:"(?:\\$(?:SHLVL|\\$|\\!|\\?))"},{token:"variable",regex:"(?:(?:\\$[a-zA-Z][a-zA-Z0-9_]*)|(?:[a-zA-Z][a-zA-Z0-9_]*=))"},{token:"support.function",regex:"(?:[a-zA-Z][a-zA-Z0-9_]*\\s*\\(\\))"},{token:"support.function",regex:"(?:&(?:\\d+))"},{token:"string",regex:"'(?:[^\\\\]|\\\\.)*?'"},{token:"constant.numeric",regex:"(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+)))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))"},
  {token:"constant.numeric",regex:"(?:(?:[1-9]\\d*)|(?:0))\\b"},{token:function(c){return a.hasOwnProperty(c)?"keyword":b.hasOwnProperty(c)?"constant.language":"debugger"==c?"invalid.deprecated":"identifier"},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+"}]}};i.inherits(d,a);j.ShHighlightRules=d});define("mode/sh",function(b,j){var i=b("ace/lib/oop"),g=b("ace/mode/text").Mode,a=b("ace/tokenizer").Tokenizer,d=b("mode/sh_highlight_rules").ShHighlightRules,e=b("ace/range").Range,f=function(){this.$tokenizer=new a((new d).getRules())};i.inherits(f,g);(function(){this.toggleCommentLines=function(a,b,c,d){for(var f=!0,a=/^(\s*)#/,g=c;g<=d;g++)if(!a.test(b.getLine(g))){f=!1;break}if(f){f=new e(0,0,0,0);for(g=c;g<=d;g++)c=b.getLine(g).match(a),f.start.row=g,f.end.row=g,f.end.column=c[0].length,b.replace(f,
  c[1])}else b.indentRows(c,d,"#")};this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a).tokens;if(e.length&&"comment"==e[e.length-1].type)return d;"start"==a&&b.match(/^.*[\{\(\[\:]\s*$/)&&(d+=c);return d};var a={pass:1,"return":1,raise:1,"break":1,"continue":1};this.checkOutdent=function(b,d,e){if("\r\n"!==e&&"\r"!==e&&"\n"!==e)return!1;b=this.$tokenizer.getLineTokens(d.trim(),b).tokens;if(!b)return!1;do d=b.pop();while(d&&("comment"==d.type||"text"==
  d.type&&d.value.match(/^\s+$/)));return!d?!1:"keyword"==d.type&&a[d.value]};this.autoOutdent=function(a,b,c){var c=c+1,a=this.$getIndent(b.getLine(c)),d=b.getTabString();a.slice(-d.length)==d&&b.remove(new e(c,a.length-d.length,c,a.length))}}).call(f.prototype);j.Mode=f});define("mode/yaml_highlight_rules",function(b,j){var i=b("ace/lib/oop"),g=b("ace/mode/text_highlight_rules").TextHighlightRules,a=function(){this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"comment",regex:"^---"},{token:"variable",regex:"[&\\*][a-zA-Z0-9-_]+"},{token:["identifier","text"],regex:"(\\w+\\s*:)(\\w*)"},{token:"keyword.operator",regex:"<<\\w*:\\w*"},{token:"keyword.operator",regex:"-\\s*(?=[{])"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",merge:!0,
  regex:"[\\|>]\\w*",next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false|yes|no)\\b"},{token:"invalid.illegal",regex:"\\/\\/.*$"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:"(?=(?:(?:\\\\.)|(?:[^:]))*?:)",next:"start"},{token:"string",merge:!0,regex:".+"}]}};
  i.inherits(a,g);j.YamlHighlightRules=a});define("mode/yaml",function(b,j){var i=b("ace/lib/oop"),g=b("ace/mode/text").Mode,a=b("ace/tokenizer").Tokenizer,d=b("mode/yaml_highlight_rules").YamlHighlightRules,e=b("ace/mode/matching_brace_outdent").MatchingBraceOutdent,f=function(){this.$tokenizer=new a((new d).getRules());this.$outdent=new e};i.inherits(f,g);(function(){this.getNextLineIndent=function(a,b,d){var e=this.$getIndent(b);"start"==a&&b.match(/^.*[\{\(\[]\s*$/)&&(e+=d);return e};this.checkOutdent=function(a,b,d){return this.$outdent.checkOutdent(b,
  d)};this.autoOutdent=function(a,b,d){this.$outdent.autoOutdent(b,d)}}).call(f.prototype);j.Mode=f});define("mode/xml",function(b,j){var i=b("ace/lib/oop"),g=b("ace/mode/text").Mode,a=b("ace/tokenizer").Tokenizer,d=b("mode/xml_highlight_rules").XmlHighlightRules,e=b("mode/xml_behavior").XmlBehaviour,f=b("mode/xml_fold_mode").FoldMode,c=function(){this.$tokenizer=new a((new d).getRules());this.$behaviour=new e;this.foldingRules=new f};i.inherits(c,g);(function(){this.getNextLineIndent=function(a,b){return this.$getIndent(b)}}).call(c.prototype);j.Mode=c});define("mode/xml_behavior",function(b,j){function i(a,b){var d=!0,e=a.type.split(".");b.split(".").forEach(function(a){if(-1==e.indexOf(a))return d=!1});return d}var g=b("ace/lib/oop"),a=b("ace/mode/behaviour").Behaviour,d=b("ace/mode/behaviour/cstyle").CstyleBehaviour,e=b("ace/token_iterator").TokenIterator,f=function(){this.inherit(d,["string_dquotes"]);this.add("autoclosing","insertion",function(a,b,d,f,g){if(">"==g){a=d.getCursorPosition();d=new e(f,a.row,a.column);f=d.getCurrentToken();b=!1;
  if(!f||!i(f,"meta.tag")&&(!i(f,"text")||!f.value.match("/"))){do f=d.stepBackward();while(f&&(i(f,"string")||i(f,"keyword.operator")||i(f,"entity.attribute-name")||i(f,"text")))}else b=!0;if(f&&i(f,"meta.tag-name")&&!d.stepBackward().value.match("/"))return d=f.value,b&&(d=d.substring(0,a.column-f.start)),{text:"></"+d+">",selection:[1,1]}}});this.add("autoindent","insertion",function(a,b,d,e,f){if("\n"==f&&(b=d.getCursorPosition(),"</"==e.doc.getLine(b.row).substring(b.column,b.column+2)))return a=
  this.$getIndent(e.doc.getLine(b.row))+e.getTabString(),e=this.$getIndent(e.doc.getLine(b.row)),{text:"\n"+a+"\n"+e,selection:[1,a.length,1,a.length]}})};g.inherits(f,a);j.XmlBehaviour=f});define("mode/xml_fold_mode",function(b,j){var i=b("ace/lib/oop"),g=b("ace/lib/lang"),a=b("ace/range").Range,d=b("ace/mode/folding/fold_mode").FoldMode,e=b("ace/token_iterator").TokenIterator,f=j.FoldMode=function(a){d.call(this);this.voidElements=a||{}};i.inherits(f,d);(function(){this.getFoldWidget=function(a,b,d){a=this._getFirstTagInLine(a,d);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),e="",f=0;f<d.length;f++)var i=d[f],e=0===i.type.indexOf("meta.tag")?e+i.value:e+g.stringRepeat(" ",i.value.length);return this._parseTag(e)};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="",e;do if(0===b.type.indexOf("meta.tag")&&(e||(e={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()}),d+=b.value,-1!==d.indexOf(">")))return d=this._parseTag(d),d.start=e,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="",e;do if(0===
  b.type.indexOf("meta.tag")&&(e||(e={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()+b.value.length}),d=b.value+d,-1!==d.indexOf("<")))return b=this._parseTag(d),b.end=e,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)return a.pop();if(this.voidElements[b.tagName])break;else if(this.voidElements[d.tagName])a.pop();else return null}};
  this.getFoldWidgetRange=function(b,d,f){var g=this._getFirstTagInLine(b,f);if(!g.match)return null;d=[];if(g.closing||g.selfClosing){b=new e(b,f,g.column+g.match.length);for(g={row:f,column:g.column};f=this._readTagBackward(b);){if(f.selfClosing)if(d.length)continue;else return f.start.column+=f.tagName.length+2,f.end.column-=2,a.fromPoints(f.start,f.end);if(f.closing)d.push(f);else if(this._pop(d,f),0==d.length)return f.start.column+=f.tagName.length+2,a.fromPoints(f.start,g)}}else{b=new e(b,f,g.column);
  for(g={row:f,column:g.column+g.tagName.length+2};f=this._readTagForward(b);){if(f.selfClosing)if(d.length)continue;else return f.start.column+=f.tagName.length+2,f.end.column-=2,a.fromPoints(f.start,f.end);if(f.closing){if(this._pop(d,f),0==d.length)return a.fromPoints(g,f.start)}else d.push(f)}}}}).call(f.prototype)});define("mode/xml_highlight_rules",function(b,j){var i=b("ace/lib/oop"),g=b("mode/xml_util"),a=b("ace/mode/text_highlight_rules").TextHighlightRules,d=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:".*?--\>",next:"start"},{token:"comment",merge:!0,regex:".+"}]};g.tag(this.$rules,"tag","start")};i.inherits(d,a);j.XmlHighlightRules=d});define("mode/xml_util",function(b,j){function i(b,a){return[{token:"string",merge:!0,regex:".*?"+b,next:a},{token:"string",merge:!0,regex:".+"}]}j.tag=function(b,a,d,e){b[a]=[{token:"text",regex:"\\s+"},{token:function(a){return e&&e[a]?"meta.tag.tag-name."+e[a]:"meta.tag.tag-name"},merge:!0,regex:"[-_a-zA-Z0-9:]+",next:a+"_embed_attribute_list"},{token:"empty",regex:"",next:a+"_embed_attribute_list"}];b[a+"_qstring"]=i("'",a+"_embed_attribute_list");b[a+"_qqstring"]=i('"',a+"_embed_attribute_list");
  b[a+"_embed_attribute_list"]=[{token:"meta.tag",merge:!0,regex:"/?>",next:d},{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:a+"_qqstring"},{token:"string",regex:"'.*?'"},{token:"string",merge:!0,regex:"['].*",next:a+"_qstring"}])}});define("theme/default",function(b,j){b("ace/lib/dom");j.cssClass="ace-rs"});