__NEXT_REGISTER_CHUNK("comps_CodeMirror_51c113b8f0eb112cf9be60e9d3293726",function(){webpackJsonp([1],{282:function(e,t,r){(function(t,r){e.exports=r()})(this,function(){"use strict";var e=navigator.userAgent;var t=navigator.platform;var r=/gecko\/\d/i.test(e);var n=/MSIE \d/.test(e);var i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e);var o=/Edge\/(\d+)/.exec(e);var a=n||i||o;var l=a&&(n?document.documentMode||6:+(o||i)[1]);var s=!o&&/WebKit\//.test(e);var u=s&&/Qt\/\d+\.\d+/.test(e);var c=!o&&/Chrome\//.test(e);var f=/Opera\//.test(e);var h=/Apple Computer/.test(navigator.vendor);var d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e);var p=/PhantomJS/.test(e);var m=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e);var v=/Android/.test(e);var g=m||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e);var x=m||/Mac/.test(t);var y=/\bCrOS\b/.test(e);var b=/win/i.test(t);var w=f&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1]));if(w&&w>=15){f=false;s=true}var k=x&&(u||f&&(null==w||w<12.11));var C=r||a&&l>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var L=function(e,t){var r=e.className;var n=S(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function M(e,t){return T(e).appendChild(t)}function N(e,t,r,n){var i=document.createElement(e);r&&(i.className=r);n&&(i.style.cssText=n);if("string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=l-o;a+=r-a%r;o=l+1}}var R=function(){this.id=null};R.prototype.set=function(e,t){clearTimeout(this.id);this.id=setTimeout(t,e)};function B(e,t){for(var r=0;r=t)return n+Math.min(a,t-i);i+=o-n;i+=r-i%r;n=o+1;if(i>=t)return n}}var _=[""];function X(e){while(_.length<=e)_.push($(_)+" ");return _[e]}function $(e){return e[e.length-1]}function Y(e,t){var r=[];for(var n=0;n"€"&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function re(e,t){if(!t)return te(e);if(t.source.indexOf("\\w")>-1&&te(e))return true;return t.test(e)}function ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return false;return true}var ie=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function oe(e){return e.charCodeAt(0)>=768&&ie.test(e)}function ae(e,t,r){while((r<0?t>0:tr?-1:1;for(;;){if(t==r)return t;var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+n}}function se(e,t,n){var i=this;this.input=n;i.scrollbarFiller=N("div",null,"CodeMirror-scrollbar-filler");i.scrollbarFiller.setAttribute("cm-not-content","true");i.gutterFiller=N("div",null,"CodeMirror-gutter-filler");i.gutterFiller.setAttribute("cm-not-content","true");i.lineDiv=O("div",null,"CodeMirror-code");i.selectionDiv=N("div",null,null,"position: relative; z-index: 1");i.cursorDiv=N("div",null,"CodeMirror-cursors");i.measure=N("div",null,"CodeMirror-measure");i.lineMeasure=N("div",null,"CodeMirror-measure");i.lineSpace=O("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=O("div",[i.lineSpace],"CodeMirror-lines");i.mover=N("div",[o],null,"position: relative");i.sizer=N("div",[i.mover],"CodeMirror-sizer");i.sizerWidth=null;i.heightForcer=N("div",null,null,"position: absolute; height: "+j+"px; width: 1px;");i.gutters=N("div",null,"CodeMirror-gutters");i.lineGutter=null;i.scroller=N("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll");i.scroller.setAttribute("tabIndex","-1");i.wrapper=N("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror");if(a&&l<8){i.gutters.style.zIndex=-1;i.scroller.style.paddingRight=0}s||r&&g||(i.scroller.draggable=true);e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper));i.viewFrom=i.viewTo=t.first;i.reportedViewFrom=i.reportedViewTo=t.first;i.view=[];i.renderedView=null;i.externalMeasured=null;i.viewOffset=0;i.lastWrapHeight=i.lastWrapWidth=0;i.updateLineNumbers=null;i.nativeBarWidth=i.barHeight=i.barWidth=0;i.scrollbarsClipped=false;i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null;i.alignWidgets=false;i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null;i.maxLine=null;i.maxLineLength=0;i.maxLineChanged=false;i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null;i.shift=false;i.selForContextMenu=null;i.activeTouch=null;n.init(i)}function ue(e,t){t-=e.first;if(t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");var r=e;while(!r.lines)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t=e.first&&tr)return ge(r,ue(e,r).text.length);return Le(t,ue(e,t.line).text.length)}function Le(e,t){var r=e.ch;return null==r||r>t?ge(e.line,t):r<0?ge(e.line,0):e}function Te(e,t){var r=[];for(var n=0;n=t:o.to>t);(n||(n=[])).push(new De(a,o.from,s?null:o.to))}}return n}function Pe(e,t,r){var n;if(e)for(var i=0;i=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&l)for(var b=0;b0)continue;var c=[s,1],f=xe(u.from,l.from),h=xe(u.to,l.to);(f<0||!a.inclusiveLeft&&!f)&&c.push({from:u.from,to:l.from});(h>0||!a.inclusiveRight&&!h)&&c.push({from:l.to,to:u.to});i.splice.apply(i,c);s+=c.length-3}}return i}function Be(e){var t=e.markedSpans;if(!t)return;for(var r=0;r=0&&f<=0||c<=0&&f>=0)continue;if(c<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?xe(u.to,r)>=0:xe(u.to,r)>0)||c>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?xe(u.from,n)<=0:xe(u.from,n)<0))return true}}function $e(e){var t;while(t=Ve(e))e=t.find(-1,true).line;return e}function Ye(e){var t;while(t=_e(e))e=t.find(1,true).line;return e}function Je(e){var t,r;while(t=_e(e)){e=t.find(1,true).line;(r||(r=[])).push(e)}return r}function Ze(e,t){var r=ue(e,t),n=$e(r);if(r==n)return t;return de(n)}function Qe(e,t){if(t>e.lastLine())return t;var r=ue(e,t),n;if(!et(e,r))return t;while(n=_e(r))r=n.find(1,true).line;return de(r)+1}function et(e,t){var r=Ne&&t.markedSpans;if(r)for(var n=void 0,i=0;it.maxLineLength){t.maxLineLength=r;t.maxLine=e}})}function ot(e,t,r,n){if(!e)return n(t,r,"ltr",0);var i=false;for(var o=0;ot||t==r&&a.to==t){n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr",o);i=true}}i||n(t,r,"ltr")}var at=null;function lt(e,t,r){var n;at=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:at=i);o.from==t&&(o.from!=o.to&&"before"!=r?n=i:at=i)}return null!=n?n:at}var st=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";var t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(r){return r<=247?e.charAt(r):1424<=r&&r<=1524?"R":1536<=r&&r<=1785?t.charAt(r-1536):1774<=r&&r<=2220?"r":8192<=r&&r<=8203?"w":8204==r?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;var i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,l=/[1n]/;function s(e,t,r){this.level=e;this.from=t;this.to=r}return function(e,t){var u="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!n.test(e))return false;var c=e.length,f=[];for(var h=0;h-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function pt(e,t){var r=ht(e,t);if(!r.length)return;var n=Array.prototype.slice.call(arguments,2);for(var i=0;i0}function xt(e){e.prototype.on=function(e,t){ft(this,e,t)};e.prototype.off=function(e,t){dt(this,e,t)}}function yt(e){e.preventDefault?e.preventDefault():e.returnValue=false}function bt(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=true}function wt(e){return null!=e.defaultPrevented?e.defaultPrevented:false==e.returnValue}function kt(e){yt(e);bt(e)}function Ct(e){return e.target||e.srcElement}function St(e){var t=e.which;null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2));x&&e.ctrlKey&&1==t&&(t=3);return t}var Lt=function(){if(a&&l<9)return false;var e=N("div");return"draggable"in e||"dragDrop"in e}();var Tt;function Mt(e){if(null==Tt){var t=N("span","​");M(e,N("span",[t,document.createTextNode("x")]));0!=e.firstChild.offsetHeight&&(Tt=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&l<8))}var r=Tt?N("span","​"):N("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");r.setAttribute("cm-text","");return r}var Nt;function Ot(e){if(null!=Nt)return Nt;var t=M(e,document.createTextNode("AخA"));var r=A(t,0,1).getBoundingClientRect();var n=A(t,1,2).getBoundingClientRect();T(e);if(!r||r.left==r.right)return false;return Nt=n.right-r.right<3}var At=3!="\n\nb".split(/\n/).length?function(e){var t=0,r=[],n=e.length;while(t<=n){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i);var a=o.indexOf("\r");if(-1!=a){r.push(o.slice(0,a));t+=a+1}else{r.push(o);t=i+1}}return r}:function(e){return e.split(/\r\n?|\n/)};var Dt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return false}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}if(!t||t.parentElement()!=e)return false;return 0!=t.compareEndPoints("StartToEnd",t)};var Wt=function(){var e=N("div");if("oncopy"in e)return true;e.setAttribute("oncopy","return;");return"function"==typeof e.oncopy}();var Ht=null;function Et(e){if(null!=Ht)return Ht;var t=M(e,N("span","x"));var r=t.getBoundingClientRect();var n=A(t,0,1).getBoundingClientRect();return Ht=Math.abs(r.left-n.left)>1}var Ft={};var Pt={};function It(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2));Ft[e]=t}function zt(e,t){Pt[e]=t}function Rt(e){if("string"==typeof e&&Pt.hasOwnProperty(e))e=Pt[e];else if(e&&"string"==typeof e.name&&Pt.hasOwnProperty(e.name)){var t=Pt[e.name];"string"==typeof t&&(t={name:t});e=Q(t,e);e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Rt("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Rt("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Bt(e,t){t=Rt(t);var r=Ft[t.name];if(!r)return Bt(e,"text/plain");var n=r(e,t);if(jt.hasOwnProperty(t.name)){var i=jt[t.name];for(var o in i){if(!i.hasOwnProperty(o))continue;n.hasOwnProperty(o)&&(n["_"+o]=n[o]);n[o]=i[o]}}n.name=t.name;t.helperType&&(n.helperType=t.helperType);if(t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}var jt={};function qt(e,t){var r=jt.hasOwnProperty(e)?jt[e]:jt[e]={};I(t,r)}function Gt(e,t){if(true===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([]));r[n]=i}return r}function Ut(e,t){var r;while(e.innerMode){r=e.innerMode(t);if(!r||r.mode==e)break;t=r.state;e=r.mode}return r||{mode:e,state:t}}function Kt(e,t,r){return!e.startState||e.startState(t,r)}var Vt=function(e,t,r){this.pos=this.start=0;this.string=e;this.tabSize=t||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0;this.lineOracle=r};Vt.prototype.eol=function(){return this.pos>=this.string.length};Vt.prototype.sol=function(){return this.pos==this.lineStart};Vt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0};Vt.prototype.next=function(){if(this.post};Vt.prototype.eatSpace=function(){var e=this;var t=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++e.pos;return this.pos>t};Vt.prototype.skipToEnd=function(){this.pos=this.string.length};Vt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1){this.pos=t;return true}};Vt.prototype.backUp=function(e){this.pos-=e};Vt.prototype.column=function(){if(this.lastColumnPos0)return null;n&&false!==t&&(this.pos+=n[0].length);return n}var i=function(e){return r?e.toLowerCase():e};var o=this.string.substr(this.pos,e.length);if(i(o)==i(e)){false!==t&&(this.pos+=e.length);return true}};Vt.prototype.current=function(){return this.string.slice(this.start,this.pos)};Vt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}};Vt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)};Vt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var _t=function(e,t){this.state=e;this.lookAhead=t};var Xt=function(e,t,r,n){this.state=t;this.doc=e;this.line=r;this.maxLookAhead=n||0;this.baseTokens=null;this.baseTokenPos=1};Xt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e);return t};Xt.prototype.baseToken=function(e){var t=this;if(!this.baseTokens)return null;while(this.baseTokens[this.baseTokenPos]<=e)t.baseTokenPos+=2;var r=this.baseTokens[this.baseTokenPos+1];return{type:r&&r.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}};Xt.prototype.nextLine=function(){this.line++;this.maxLookAhead>0&&this.maxLookAhead--};Xt.fromSaved=function(e,t,r){return t instanceof _t?new Xt(e,Gt(e.mode,t.state),r,t.lookAhead):new Xt(e,Gt(e.mode,t),r)};Xt.prototype.save=function(e){var t=false!==e?Gt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new _t(t,this.maxLookAhead):t};function $t(e,t,r,n){var i=[e.state.modeGen],o={};ir(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);var a=r.state;var l=function(n){r.baseTokens=i;var l=e.state.overlays[n],s=1,u=0;r.state=true;ir(e,t.text,l.mode,r,function(e,t){var r=s;while(ue&&i.splice(s,1,e,i[s+1],n);s+=2;u=Math.min(e,n)}if(!t)return;if(l.opaque){i.splice(r,s-r,e,"overlay "+t);s=r+2}else for(;re.options.maxHighlightLength&&Gt(e.doc.mode,n.state);var o=$t(e,t,n);i&&(n.state=i);t.stateAfter=n.save(!i);t.styles=o.styles;o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null);r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Jt(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new Xt(n,true,t);var o=or(e,t,r);var a=o>n.first&&ue(n,o-1).stateAfter;var l=a?Xt.fromSaved(n,a,o):new Xt(n,Kt(n.mode),o);n.iter(o,t,function(r){Zt(e,r.text,l);var n=l.line;r.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&nt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var tr=function(e,t,r){this.start=e.start;this.end=e.pos;this.string=e.current();this.type=t||null;this.state=r};function rr(e,t,r,n){var i=e.doc,o=i.mode,a;t=Se(i,t);var l=ue(i,t.line),s=Jt(e,t.line,r);var u=new Vt(l.text,e.options.tabSize,s),c;n&&(c=[]);while((n||u.pose.options.maxHighlightLength){l=false;a&&Zt(e,t,n,c.pos);c.pos=t.length;f=null}else f=nr(er(r,c,n.state,h),o);if(h){var d=h[0].name;d&&(f="m-"+(f?d+" "+f:d))}if(!l||u!=f){while(sa;--l){if(l<=o.first)return o.first;var s=ue(o,l-1),u=s.stateAfter;if(u&&(!r||l+(u instanceof _t?u.lookAhead:0)<=o.modeFrontier))return l;var c=z(s.text,null,e.options.tabSize);if(null==i||n>c){i=l-1;n=c}}return i}function ar(e,t){e.modeFrontier=Math.min(e.modeFrontier,t);if(e.highlightFrontierr;n--){var i=ue(e,n).stateAfter;if(i&&(!(i instanceof _t)||n+i.lookAhead1&&!/ /.test(e))return e;var r=t,n="";for(var i=0;iu&&f.from<=u)break}if(f.to>=c)return e(r,n,i,o,a,l,s);e(r,n.slice(0,f.to-u),i,o,null,l,s);o=null;n=n.slice(f.to-u);u=f.to}}}function xr(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i);if(!n&&e.cm.display.input.needsContentAttribute){i||(i=e.content.appendChild(document.createElement("span")));i.setAttribute("cm-marker",r.id)}if(i){e.cm.display.input.setUneditable(i);e.content.appendChild(i)}e.pos+=t;e.trailingSpace=false}function yr(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(!n){for(var a=1;as||C.collapsed&&k.to==s&&k.from==s)){if(null!=k.to&&k.to!=s&&d>k.to){d=k.to;m=""}C.className&&(p+=" "+C.className);C.css&&(h=(h?h+";":"")+C.css);C.startStyle&&k.from==s&&(v+=" "+C.startStyle);C.endStyle&&k.to==d&&(b||(b=[])).push(C.endStyle,k.to);C.title&&!g&&(g=C.title);C.collapsed&&(!x||Ue(x.marker,C)<0)&&(x=k)}else k.from>s&&d>k.from&&(d=k.from)}if(b)for(var S=0;S=l)break;var T=Math.min(l,d);while(true){if(c){var M=s+c.length;if(!x){var N=M>T?c.slice(0,T-s):c;t.addToken(t,N,f?f+p:p,v,s+N.length==d?m:"",g,h)}if(M>=T){c=c.slice(T-s);s=T;break}s=M;v=""}c=i.slice(o,o=r[u++]);f=hr(r[u++],t.cm.options)}}}function br(e,t,r){this.line=t;this.rest=Je(t);this.size=this.rest?de($(this.rest))-r+1:1;this.node=this.text=null;this.hidden=et(e,t)}function wr(e,t,r){var n=[],i;for(var o=t;o2&&o.push((s.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function Yr(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;nr)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:true}}function Jr(e,t){t=$e(t);var r=de(t);var n=e.display.externalMeasured=new br(e.doc,t,r);n.lineN=r;var i=n.built=dr(e,n);n.text=i.pre;M(e.display.lineMeasure,i.pre);return n}function Zr(e,t,r,n){return tn(e,en(e,t),r,n)}function Qr(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt){o=s-l;i=o-1;t>=s&&(a="right")}if(null!=i){n=e[u+2];l==s&&r==(n.insertLeft?"left":"right")&&(a=r);if("left"==r&&0==i)while(u&&e[u-2]==e[u-3]&&e[u-1].insertLeft){n=e[2+(u-=3)];a="left"}if("right"==r&&i==s-l)while(u=0;i--)if((r=e[i]).left!=r.right)break;return r}function an(e,t,r,n){var i=nn(t.map,r,n);var o=i.node,s=i.start,u=i.end,c=i.collapse;var f;if(3==o.nodeType){for(var h=0;h<4;h++){while(s&&oe(t.line.text.charAt(i.coverStart+s)))--s;while(i.coverStart+u0&&(c=n="right");var d;f=e.options.lineWrapping&&(d=o.getClientRects()).length>1?d["right"==n?d.length-1:0]:o.getBoundingClientRect()}if(a&&l<9&&!s&&(!f||!f.left&&!f.right)){var p=o.parentNode.getClientRects()[0];f=p?{left:p.left,right:p.left+On(e.display),top:p.top,bottom:p.bottom}:rn}var m=f.top-t.rect.top,v=f.bottom-t.rect.top;var g=(m+v)/2;var x=t.view.measure.heights;var y=0;for(;y=n.text.length){s=n.text.length;u="before"}else if(s<=0){s=0;u="after"}if(!l)return a("before"==u?s-1:s,"before"==u);function c(e,t,r){var n=l[t],i=1==n.level;return a(r?e-1:e,i!=r)}var f=lt(l,s,u);var h=at;var d=c(s,f,"before"==u);null!=h&&(d.other=c(s,h,"before"!=u));return d}function xn(e,t){var r=0;t=Se(e.doc,t);e.options.lineWrapping||(r=On(e.display)*t.ch);var n=ue(e.doc,t.line);var i=rt(n)+Gr(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function yn(e,t,r,n,i){var o=ge(e,t,r);o.xRel=i;n&&(o.outside=true);return o}function bn(e,t,r){var n=e.doc;r+=e.display.viewOffset;if(r<0)return yn(n.first,0,null,true,-1);var i=pe(n,r),o=n.first+n.size-1;if(i>o)return yn(n.first+n.size-1,ue(n,o).text.length,null,true,1);t<0&&(t=0);var a=ue(n,i);for(;;){var l=Sn(e,a,i,t,r);var s=_e(a);var u=s&&s.find(0,true);if(!s||!(l.ch>u.from.ch||l.ch==u.from.ch&&l.xRel>0))return l;i=de(a=u.to.line)}}function wn(e,t,r,n){n-=dn(t);var i=t.text.length;var o=le(function(t){return tn(e,r,t-1).bottom<=n},i,0);i=le(function(t){return tn(e,r,t).top>n},o,i);return{begin:o,end:i}}function kn(e,t,r,n){r||(r=en(e,t));var i=pn(e,t,tn(e,r,n),"line").top;return wn(e,t,r,i)}function Cn(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function Sn(e,t,r,n,i){i-=rt(t);var o=en(e,t);var a=dn(t);var l=0,s=t.text.length,u=true;var c=ut(t,e.doc.direction);if(c){var f=(e.options.lineWrapping?Tn:Ln)(e,t,r,o,c,n,i);u=1!=f.level;l=u?f.from:f.to-1;s=u?f.to:f.from-1}var h=null,d=null;var p=le(function(t){var r=tn(e,o,t);r.top+=a;r.bottom+=a;if(!Cn(r,n,i,false))return false;if(r.top<=i&&r.left<=n){h=t;d=r}return true},l,s);var m,v,g=false;if(d){var x=n-d.left=b.bottom}p=ae(t.text,p,1);return yn(r,p,v,g,n-m)}function Ln(e,t,r,n,i,o,a){var l=le(function(l){var s=i[l],u=1!=s.level;return Cn(gn(e,ge(r,u?s.to:s.from,u?"before":"after"),"line",t,n),o,a,true)},0,i.length-1);var s=i[l];if(l>0){var u=1!=s.level;var c=gn(e,ge(r,u?s.from:s.to,u?"after":"before"),"line",t,n);Cn(c,o,a,true)&&c.top>a&&(s=i[l-1])}return s}function Tn(e,t,r,n,i,o,a){var l=wn(e,t,n,a);var s=l.begin;var u=l.end;/\s/.test(t.text.charAt(u-1))&&u--;var c=null,f=null;for(var h=0;h=u||d.to<=s)continue;var p=1!=d.level;var m=tn(e,n,p?Math.min(u,d.to)-1:Math.max(s,d.from)).right;var v=mv){c=d;f=v}}c||(c=i[i.length-1]);c.fromu&&(c={from:c.from,to:u,level:c.level});return c}var Mn;function Nn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Mn){Mn=N("pre");for(var t=0;t<49;++t){Mn.appendChild(document.createTextNode("x"));Mn.appendChild(N("br"))}Mn.appendChild(document.createTextNode("x"))}M(e.measure,Mn);var r=Mn.offsetHeight/50;r>3&&(e.cachedTextHeight=r);T(e.measure);return r||1}function On(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=N("span","xxxxxxxxxx");var r=N("pre",[t]);M(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;i>2&&(e.cachedCharWidth=i);return i||10}function An(e){var t=e.display,r={},n={};var i=t.gutters.clientLeft;for(var o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){r[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i;n[e.options.gutters[a]]=o.clientWidth}return{fixedPos:Dn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Dn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Wn(e){var t=Nn(e.display),r=e.options.lineWrapping;var n=r&&Math.max(5,e.display.scroller.clientWidth/On(e.display)-3);return function(i){if(et(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a=e.display.viewTo)return null;t-=e.display.viewFrom;if(t<0)return null;var r=e.display.view;for(var n=0;n=e.display.viewTo||l.to().line0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function qn(e){if(!e.state.focused){e.display.input.focus();Un(e)}}function Gn(e){e.state.delayingBlurEvent=true;setTimeout(function(){if(e.state.delayingBlurEvent){e.state.delayingBlurEvent=false;Kn(e)}},100)}function Un(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=false);if("nocursor"==e.options.readOnly)return;if(!e.state.focused){pt(e,"focus",e,t);e.state.focused=true;H(e.display.wrapper,"CodeMirror-focused");if(!e.curOp&&e.display.selForContextMenu!=e.doc.sel){e.display.input.reset();s&&setTimeout(function(){return e.display.input.reset(true)},20)}e.display.input.receivedFocus()}jn(e)}function Kn(e,t){if(e.state.delayingBlurEvent)return;if(e.state.focused){pt(e,"blur",e,t);e.state.focused=false;L(e.display.wrapper,"CodeMirror-focused")}clearInterval(e.display.blinker);setTimeout(function(){e.state.focused||(e.display.shift=false)},150)}function Vn(e){var t=e.display;var r=t.lineDiv.offsetTop;for(var n=0;n.005||c<-.005){he(i.line,o);_n(i.line);if(i.rest)for(var f=0;f=a){o=pe(t,rt(ue(t,s))-e.wrapper.clientHeight);a=s}}return{from:o,to:Math.max(a,o+1)}}function $n(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;var n=Dn(t)-t.scroller.scrollLeft+e.doc.scrollLeft;var i=t.gutters.offsetWidth,o=n+"px";for(var a=0;a(window.innerHeight||document.documentElement.clientHeight)&&(i=false);if(null!=i&&!p){var o=N("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Gr(e.display))+"px;\n height: "+(t.bottom-t.top+Vr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o);o.scrollIntoView(i);e.display.lineSpace.removeChild(o)}}function Zn(e,t,r,n){null==n&&(n=0);var i;if(!e.options.lineWrapping&&t==r){t=t.ch?ge(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t;r="before"==t.sticky?ge(t.line,t.ch+1,"before"):t}for(var o=0;o<5;o++){var a=false;var l=gn(e,t);var s=r&&r!=t?gn(e,r):l;i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-n,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+n};var u=ei(e,i);var c=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=u.scrollTop){li(e,u.scrollTop);Math.abs(e.doc.scrollTop-c)>1&&(a=true)}if(null!=u.scrollLeft){ui(e,u.scrollLeft);Math.abs(e.doc.scrollLeft-f)>1&&(a=true)}if(!a)break}return i}function Qn(e,t){var r=ei(e,t);null!=r.scrollTop&&li(e,r.scrollTop);null!=r.scrollLeft&&ui(e,r.scrollLeft)}function ei(e,t){var r=e.display,n=Nn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop;var o=Xr(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Ur(r);var s=t.topl-n;if(t.topi+o){var c=Math.min(t.top,(u?l:t.bottom)-o);c!=i&&(a.scrollTop=c)}var f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft;var h=_r(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0);var d=t.right-t.left>h;d&&(t.right=t.left+h);t.left<10?a.scrollLeft=0:t.lefth+f-3&&(a.scrollLeft=t.right+(d?0:10)-h);return a}function ti(e,t){if(null==t)return;oi(e);e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t}function ri(e){oi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ni(e,t,r){null==t&&null==r||oi(e);null!=t&&(e.curOp.scrollLeft=t);null!=r&&(e.curOp.scrollTop=r)}function ii(e,t){oi(e);e.curOp.scrollToPos=t}function oi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=xn(e,t.from),n=xn(e,t.to);ai(e,r,n,t.margin)}}function ai(e,t,r,n){var i=ei(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});ni(e,i.scrollLeft,i.scrollTop)}function li(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;r||Ui(e,{top:t});si(e,t,true);r&&Ui(e);Pi(e,100)}function si(e,t,r){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t);if(e.display.scroller.scrollTop==t&&!r)return;e.doc.scrollTop=t;e.display.scrollbars.setScrollTop(t);e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function ui(e,t,r,n){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth);if((r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t;$n(e);e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t);e.display.scrollbars.setScrollLeft(t)}function ci(e){var t=e.display,r=t.gutters.offsetWidth;var n=Math.round(e.doc.height+Ur(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Vr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var fi=function(e,t,r){this.cm=r;var n=this.vert=N("div",[N("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");var i=this.horiz=N("div",[N("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(n);e(i);ft(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")});ft(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")});this.checkedZeroWidth=false;a&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};fi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1;var r=e.scrollHeight>e.clientHeight+1;var n=e.nativeBarWidth;if(r){this.vert.style.display="block";this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else{this.vert.style.display="";this.vert.firstChild.style.height="0"}if(t){this.horiz.style.display="block";this.horiz.style.right=r?n+"px":"0";this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"}if(!this.checkedZeroWidth&&e.clientHeight>0){0==n&&this.zeroWidthHack();this.checkedZeroWidth=true}return{right:r?n:0,bottom:t?n:0}};fi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e);this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")};fi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e);this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")};fi.prototype.zeroWidthHack=function(){var e=x&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e;this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none";this.disableHoriz=new R;this.disableVert=new R};fi.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto";function n(){var i=e.getBoundingClientRect();var o="vert"==r?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)};fi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz);e.removeChild(this.vert)};var hi=function(){};hi.prototype.update=function(){return{bottom:0,right:0}};hi.prototype.setScrollLeft=function(){};hi.prototype.setScrollTop=function(){};hi.prototype.clear=function(){};function di(e,t){t||(t=ci(e));var r=e.display.barWidth,n=e.display.barHeight;pi(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++){r!=e.display.barWidth&&e.options.lineWrapping&&Vn(e);pi(e,ci(e));r=e.display.barWidth;n=e.display.barHeight}}function pi(e,t){var r=e.display;var n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px";r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px";r.heightForcer.style.borderBottom=n.bottom+"px solid transparent";if(n.right&&n.bottom){r.scrollbarFiller.style.display="block";r.scrollbarFiller.style.height=n.bottom+"px";r.scrollbarFiller.style.width=n.right+"px"}else r.scrollbarFiller.style.display="";if(n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter){r.gutterFiller.style.display="block";r.gutterFiller.style.height=n.bottom+"px";r.gutterFiller.style.width=t.gutterWidth+"px"}else r.gutterFiller.style.display=""}var mi={native:fi,null:hi};function vi(e){if(e.display.scrollbars){e.display.scrollbars.clear();e.display.scrollbars.addClass&&L(e.display.wrapper,e.display.scrollbars.addClass)}e.display.scrollbars=new mi[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller);ft(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)});t.setAttribute("cm-not-content","true")},function(t,r){"horizontal"==r?ui(e,t):li(e,t)},e);e.display.scrollbars.addClass&&H(e.display.wrapper,e.display.scrollbars.addClass)}var gi=0;function xi(e){e.curOp={cm:e,viewChanged:false,startHeight:e.doc.height,forceUpdate:false,updateInput:null,typing:false,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:false,updateMaxLine:false,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:false,id:++gi};Cr(e.curOp)}function yi(e){var t=e.curOp;Lr(t,function(e){for(var t=0;t=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping;e.update=e.mustUpdate&&new zi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ki(e){e.updatedDisplay=e.mustUpdate&&qi(e.cm,e.update)}function Ci(e){var t=e.cm,r=t.display;e.updatedDisplay&&Vn(t);e.barMeasure=ci(t);if(r.maxLineChanged&&!t.options.lineWrapping){e.adjustWidthTo=Zr(t,r.maxLine,r.maxLine.text.length).left+3;t.display.sizerWidth=e.adjustWidthTo;e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Vr(t)+t.display.barWidth);e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-_r(t))}(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Si(e){var t=e.cm;if(null!=e.adjustWidthTo){t.display.sizer.style.minWidth=e.adjustWidthTo+"px";e.maxScrollLeftt)&&(i.updateLineNumbers=t);e.curOp.viewChanged=true;if(t>=i.viewTo)Ne&&Ze(e.doc,t)i.viewFrom)Wi(e);else{i.viewFrom+=n;i.viewTo+=n}else if(t<=i.viewFrom&&r>=i.viewTo)Wi(e);else if(t<=i.viewFrom){var o=Hi(e,r,r+n,1);if(o){i.view=i.view.slice(o.index);i.viewFrom=o.lineN;i.viewTo+=n}else Wi(e)}else if(r>=i.viewTo){var a=Hi(e,t,t,-1);if(a){i.view=i.view.slice(0,a.index);i.viewTo=a.lineN}else Wi(e)}else{var l=Hi(e,t,t,-1);var s=Hi(e,r,r+n,1);if(l&&s){i.view=i.view.slice(0,l.index).concat(wr(e,l.lineN,s.lineN)).concat(i.view.slice(s.index));i.viewTo+=n}else Wi(e)}var u=i.externalMeasured;u&&(r=i.lineN&&t=n.viewTo)return;var o=n.view[Fn(e,t)];if(null==o.node)return;var a=o.changes||(o.changes=[]);-1==B(a,r)&&a.push(r)}function Wi(e){e.display.viewFrom=e.display.viewTo=e.doc.first;e.display.view=[];e.display.viewOffset=0}function Hi(e,t,r,n){var i=Fn(e,t),o,a=e.display.view;if(!Ne||r==e.doc.first+e.doc.size)return{index:i,lineN:r};var l=e.display.viewFrom;for(var s=0;s0){if(i==a.length-1)return null;o=l+a[i].size-t;i++}else o=l-t;t+=o;r+=o}while(Ze(e.doc,r)!=r){if(i==(n<0?0:a.length-1))return null;r+=n*a[i-(n<0?1:0)].size;i+=n}return{index:i,lineN:r}}function Ei(e,t,r){var n=e.display,i=n.view;if(0==i.length||t>=n.viewTo||r<=n.viewFrom){n.view=wr(e,t,r);n.viewFrom=t}else{n.viewFrom>t?n.view=wr(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,Fn(e,r)))}n.viewTo=r}function Fi(e){var t=e.display.view,r=0;for(var n=0;n=e.display.viewTo)return;var r=+new Date+e.options.workTime;var n=Jt(e,t.highlightFrontier);var i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(n.line>=e.display.viewFrom){var a=o.styles;var l=o.text.length>e.options.maxHighlightLength?Gt(t.mode,n.state):null;var s=$t(e,o,n,true);l&&(n.state=l);o.styles=s.styles;var u=o.styleClasses,c=s.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);var f=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass);for(var h=0;!f&&hr){Pi(e,e.options.workDelay);return true}});t.highlightFrontier=n.line;t.modeFrontier=Math.max(t.modeFrontier,n.line);i.length&&Ti(e,function(){for(var t=0;t=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==Fi(e))return false;if(Yn(e)){Wi(e);t.dims=An(e)}var i=n.first+n.size;var o=Math.max(t.visible.from-e.options.viewportMargin,n.first);var a=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFroma&&r.viewTo-a<20&&(a=Math.min(i,r.viewTo));if(Ne){o=Ze(e.doc,o);a=Qe(e.doc,a)}var l=o!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Ei(e,o,a);r.viewOffset=rt(ue(e.doc,r.viewFrom));e.display.mover.style.top=r.viewOffset+"px";var s=Fi(e);if(!l&&0==s&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return false;var u=Bi(e);s>4&&(r.lineDiv.style.display="none");Ki(e,r.updateLineNumbers,t.dims);s>4&&(r.lineDiv.style.display="");r.renderedView=r.view;ji(u);T(r.cursorDiv);T(r.selectionDiv);r.gutters.style.height=r.sizer.style.minHeight=0;if(l){r.lastWrapHeight=t.wrapperHeight;r.lastWrapWidth=t.wrapperWidth;Pi(e,400)}r.updateLineNumbers=null;return true}function Gi(e,t){var r=t.viewport;for(var n=true;;n=false){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==_r(e)){r&&null!=r.top&&(r={top:Math.min(e.doc.height+Ur(e.display)-Xr(e),r.top)});t.visible=Xn(e.display,e.doc,r);if(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}if(!qi(e,t))break;Vn(e);var i=ci(e);Pn(e);di(e,i);_i(e,i);t.force=false}t.signal(e,"update",e);if(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo){t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo);e.display.reportedViewFrom=e.display.viewFrom;e.display.reportedViewTo=e.display.viewTo}}function Ui(e,t){var r=new zi(e,t);if(qi(e,r)){Vn(e);Gi(e,r);var n=ci(e);Pn(e);di(e,n);_i(e,n);r.finish()}}function Ki(e,t,r){var n=e.display,i=e.options.lineNumbers;var o=n.lineDiv,a=o.firstChild;function l(t){var r=t.nextSibling;s&&x&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t);return r}var u=n.view,c=n.viewFrom;for(var f=0;f-1&&(d=false);Or(e,h,c,r)}if(d){T(h.lineNumber);h.lineNumber.appendChild(document.createTextNode(ve(e.options,c)))}a=h.node.nextSibling}else{var p=Ir(e,h,c,r);o.insertBefore(p,a)}c+=h.size}while(a)a=l(a)}function Vi(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function _i(e,t){e.display.sizer.style.minHeight=t.docHeight+"px";e.display.heightForcer.style.top=t.docHeight+"px";e.display.gutters.style.height=t.docHeight+e.display.barHeight+Vr(e)+"px"}function Xi(e){var t=e.display.gutters,r=e.options.gutters;T(t);var n=0;for(;n-1&&!e.lineNumbers){e.gutters=e.gutters.slice(0);e.gutters.splice(t,1)}}var Yi=0;var Ji=null;a?Ji=-.53:r?Ji=15:c?Ji=-.7:h&&(Ji=-1/3);function Zi(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail);null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta);return{x:t,y:r}}function Qi(e){var t=Zi(e);t.x*=Ji;t.y*=Ji;return t}function eo(e,t){var n=Zi(t),i=n.x,o=n.y;var a=e.display,l=a.scroller;var u=l.scrollWidth>l.clientWidth;var c=l.scrollHeight>l.clientHeight;if(!(i&&u||o&&c))return;if(o&&x&&s)e:for(var h=t.target,d=a.view;h!=l;h=h.parentNode)for(var p=0;p=0&&xe(e,i.to())<=0)return n}return-1};var ro=function(e,t){this.anchor=e;this.head=t};ro.prototype.from=function(){return ke(this.anchor,this.head)};ro.prototype.to=function(){return we(this.anchor,this.head)};ro.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function no(e,t){var r=e[t];e.sort(function(e,t){return xe(e.from(),t.from())});t=B(e,r);for(var n=1;n=0){var a=ke(o.from(),i.from()),l=we(o.to(),i.to());var s=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t;e.splice(--n,2,new ro(s?l:a,s?a:l))}}return new to(e,t)}function io(e,t){return new to([new ro(e,t||e)],0)}function oo(e){if(!e.text)return e.to;return ge(e.from.line+e.text.length-1,$(e.text).length+(1==e.text.length?e.from.ch:0))}function ao(e,t){if(xe(e,t.from)<0)return e;if(xe(e,t.to)<=0)return oo(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;e.line==t.to.line&&(n+=oo(t).ch-t.to.ch);return ge(r,n)}function lo(e,t){var r=[];for(var n=0;n1&&e.remove(l.line+1,p-1);e.insert(l.line+1,g)}Mr(e,"change",e,t)}function mo(e,t,r){function n(e,i,o){if(e.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges){e.done.pop();return $(e.done)}}function Co(e,t,r,n){var i=e.history;i.undone.length=0;var o=+new Date,a;var l;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(a=ko(i,i.lastOp==n))){l=$(a.changes);0==xe(t.from,t.to)&&0==xe(t.from,l.to)?l.to=oo(t):a.changes.push(bo(e,t))}else{var s=$(i.done);s&&s.ranges||To(e.sel,i.done);a={changes:[bo(e,t)],generation:i.generation};i.done.push(a);while(i.done.length>i.undoDepth){i.done.shift();i.done[0].ranges||i.done.shift()}}i.done.push(r);i.generation=++i.maxGeneration;i.lastModTime=i.lastSelTime=o;i.lastOp=i.lastSelOp=n;i.lastOrigin=i.lastSelOrigin=t.origin;l||pt(e,"historyAdded")}function So(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Lo(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||So(e,o,$(i.done),t))?i.done[i.done.length-1]=t:To(t,i.done);i.lastSelTime=+new Date;i.lastSelOrigin=o;i.lastSelOp=r;n&&false!==n.clearRedo&&wo(i.undone)}function To(e,t){var r=$(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Mo(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans);++o})}function No(e){if(!e)return null;var t;for(var r=0;r-1){$(l)[f]=u[f];delete u[f]}}}return n}function Wo(e,t,r,n){if(n){var i=e.anchor;if(r){var o=xe(t,i)<0;if(o!=xe(r,i)<0){i=t;t=r}else o!=xe(t,r)<0&&(t=r)}return new ro(i,t)}return new ro(r||t,t)}function Ho(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend));Ro(e,new to([Wo(e.sel.primary(),t,r,i)],0),n)}function Eo(e,t,r){var n=[];var i=e.cm&&(e.cm.display.shift||e.extend);for(var o=0;o=t.ch:l.to>t.ch))){if(i){pt(s,"beforeCursorEnter");if(s.explicitlyCleared){if(o.markedSpans){--a;continue}break}}if(!s.atomic)continue;if(r){var u=s.find(n<0?1:-1),c=void 0;(n<0?s.inclusiveRight:s.inclusiveLeft)&&(u=Vo(e,u,-n,u&&u.line==t.line?o:null));if(u&&u.line==t.line&&(c=xe(u,r))&&(n<0?c<0:c>0))return Uo(e,u,t,n,i)}var f=s.find(n<0?-1:1);(n<0?s.inclusiveLeft:s.inclusiveRight)&&(f=Vo(e,f,n,f.line==t.line?o:null));return f?Uo(e,f,t,n,i):null}}return t}function Ko(e,t,r,n,i){var o=n||1;var a=Uo(e,t,r,o,i)||!i&&Uo(e,t,r,o,true)||Uo(e,t,r,-o,i)||!i&&Uo(e,t,r,-o,true);if(!a){e.cantEdit=true;return ge(e.first,0)}return a}function Vo(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?Se(e,ge(t.line-1)):null:r>0&&t.ch==(n||ue(e,t.line)).text.length?t.line=0;--i)Yo(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else Yo(e,t)}function Yo(e,t){if(1==t.text.length&&""==t.text[0]&&0==xe(t.from,t.to))return;var r=lo(e,t);Co(e,t,r,e.cm?e.cm.curOp.id:NaN);Qo(e,t,r,Ie(e,t));var n=[];mo(e,function(e,r){if(!r&&-1==B(n,e.history)){ia(e.history,t);n.push(e.history)}Qo(e,t,null,Ie(e,t))})}function Jo(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!r)return;var i=e.history,o,a=e.sel;var l="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done;var u=0;for(;u=0;--d){var p=h(d);if(p)return p.v}}function Zo(e,t){if(0==t)return;e.first+=t;e.sel=new to(Y(e.sel.ranges,function(e){return new ro(ge(e.anchor.line+t,e.anchor.ch),ge(e.head.line+t,e.head.ch))}),e.sel.primIndex);if(e.cm){Ai(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())return;if(t.from.lineo&&(t={from:t.from,to:ge(o,ue(e,o).text.length),text:[t.text[0]],origin:t.origin});t.removed=ce(e,t.from,t.to);r||(r=lo(e,t));e.cm?ea(e.cm,t,n):po(e,t,n);Bo(e,r,G)}function ea(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to;var l=false,s=o.line;if(!e.options.lineWrapping){s=de($e(ue(n,o.line)));n.iter(s,a.line+1,function(e){if(e==i.maxLine){l=true;return true}})}n.sel.contains(t.from,t.to)>-1&&vt(e);po(n,t,r,Wn(e));if(!e.options.lineWrapping){n.iter(s,o.line+t.text.length,function(e){var t=nt(e);if(t>i.maxLineLength){i.maxLine=e;i.maxLineLength=t;i.maxLineChanged=true;l=false}});l&&(e.curOp.updateMaxLine=true)}ar(n,o.line);Pi(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?Ai(e):o.line!=a.line||1!=t.text.length||ho(e.doc,t)?Ai(e,o.line,a.line+1,u):Di(e,o.line,"text");var c=gt(e,"changes"),f=gt(e,"change");if(f||c){var h={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};f&&Mr(e,"change",e,h);c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function ta(e,t,r,n,i){n||(n=r);if(xe(n,r)<0){var o;o=[n,r],r=o[0],n=o[1]}"string"==typeof t&&(t=e.splitLines(t));$o(e,{from:r,to:n,text:t,origin:i})}function ra(e,t,r,n){if(r1||!(this.children[0]instanceof aa))){var s=[];this.collapse(s);this.children=[new aa(s)];this.children[0].parent=this}},collapse:function(e){var t=this;for(var r=0;r50){var l=o.lines.length%25+25;for(var s=l;s10);e.parent.maybeSpill()},iterN:function(e,t,r){var n=this;for(var i=0;it.display.maxLineLength){t.display.maxLine=c;t.display.maxLineLength=f;t.display.maxLineChanged=true}}null!=i&&t&&this.collapsed&&Ai(t,i,o+1);this.lines.length=0;this.explicitlyCleared=true;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=false;t&&qo(t.doc)}t&&Mr(t,"markerCleared",t,this,i,o);r&&yi(t);this.parent&&this.parent.clear()};ha.prototype.find=function(e,t){var r=this;null==e&&"bookmark"==this.type&&(e=1);var n,i;for(var o=0;o0||0==a&&false!==o.clearWhenEmpty)return o;if(o.replacedWith){o.collapsed=true;o.widgetNode=O("span",[o.replacedWith],"CodeMirror-widget");n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true");n.insertLeft&&(o.widgetNode.insertLeft=true)}if(o.collapsed){if(Xe(e,t.line,t,r,o)||t.line!=r.line&&Xe(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ae()}o.addToHistory&&Co(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var l=t.line,s=e.cm,u;e.iter(l,r.line+1,function(e){s&&o.collapsed&&!s.options.lineWrapping&&$e(e)==s.display.maxLine&&(u=true);o.collapsed&&l!=t.line&&he(e,0);Ee(e,new De(o,l==t.line?t.ch:null,l==r.line?r.ch:null));++l});o.collapsed&&e.iter(t.line,r.line+1,function(t){et(e,t)&&he(t,0)});o.clearOnEnter&&ft(o,"beforeCursorEnter",function(){return o.clear()});if(o.readOnly){Oe();(e.history.done.length||e.history.undone.length)&&e.clearHistory()}if(o.collapsed){o.id=++fa;o.atomic=true}if(s){u&&(s.curOp.updateMaxLine=true);if(o.collapsed)Ai(s,t.line,r.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var c=t.line;c<=r.line;c++)Di(s,c,"text");o.atomic&&qo(s.doc);Mr(s,"markerAdded",s,o)}return o}var pa=function(e,t){var r=this;this.markers=e;this.primary=t;for(var n=0;n=0;u--)$o(n,i[u]);s?zo(this,s):this.cm&&ri(this.cm)}),undo:Oi(function(){Jo(this,"undo")}),redo:Oi(function(){Jo(this,"redo")}),undoSelection:Oi(function(){Jo(this,"undo",true)}),redoSelection:Oi(function(){Jo(this,"redo",true)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){var e=this.history,t=0,r=0;for(var n=0;n=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=Se(this,e);t=Se(this,t);var n=[],i=e.line;this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||r&&!r(s.marker)||n.push(s.marker.parent||s.marker)}++i});return n},getAllMarks:function(){var e=[];this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne){t=e;return true}e-=o;++r});return Se(this,ge(r,t))},indexFromPos:function(e){e=Se(this,e);var t=e.ch;if(e.linet&&(t=e.from);null!=e.to&&e.to-1){t.state.draggingText(e);setTimeout(function(){return t.display.input.focus()},20);return}try{var c=e.dataTransfer.getData("Text");if(c){var f;t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections());Bo(t.doc,io(r,r));if(f)for(var h=0;h=0;t--)ta(e.doc,"",n[t].from,n[t].to,"+delete");ri(e)})}function Ua(e,t,r){var n=ae(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Ka(e,t,r){var n=Ua(e,t.ch,r);return null==n?null:new ge(t.line,n,r<0?"after":"before")}function Va(e,t,r,n,i){if(e){var o=ut(r,t.doc.direction);if(o){var a=i<0?$(o):o[0];var l=i<0==(1==a.level);var s=l?"after":"before";var u;if(a.level>0||"rtl"==t.doc.direction){var c=en(t,r);u=i<0?r.text.length-1:0;var f=tn(t,c,u).top;u=le(function(e){return tn(t,c,e).top==f},i<0==(1==a.level)?a.from:a.to-1,u);"before"==s&&(u=Ua(r,u,1))}else u=i<0?a.to:a.from;return new ge(n,u,s)}}return new ge(n,i<0?r.text.length:0,i<0?"before":"after")}function _a(e,t,r,n){var i=ut(t,e.doc.direction);if(!i)return Ka(t,r,n);if(r.ch>=t.text.length){r.ch=t.text.length;r.sticky="before"}else if(r.ch<=0){r.ch=0;r.sticky="after"}var o=lt(i,r.ch,r.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(n>0?a.to>r.ch:a.from=a.from&&h>=c.begin)){var d=f?"before":"after";return new ge(r.line,h,d)}}var p=function(e,t,n){var o=function(e,t){return t?new ge(r.line,l(e,1),"before"):new ge(r.line,e,"after")};for(;e>=0&&e0==(1!=a.level);var u=s?n.begin:l(n.end,-1);if(a.from<=u&&u0?c.end:l(c.begin,-1);if(null!=v&&!(n>0&&v==t.text.length)){m=p(n>0?0:i.length-1,n,u(v));if(m)return m}return null}var Xa={selectAll:_o,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),G)},killLine:function(e){return Ga(e,function(t){if(t.empty()){var r=ue(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0){i=new ge(i.line,i.ch+1);e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ge(i.line,i.ch-2),i,"+transpose")}else if(i.line>e.doc.first){var a=ue(e.doc,i.line-1).text;if(a){i=new ge(i.line,1);e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),ge(i.line-1,a.length-1),i,"+transpose")}}}r.push(new ro(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return Ti(e,function(){var t=e.listSelections();for(var r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;ne&&0==xe(t,this.pos)&&r==this.button};var hl;var dl;function pl(e,t){var r=+new Date;if(dl&&dl.compare(r,e,t)){hl=dl=null;return"triple"}if(hl&&hl.compare(r,e,t)){dl=new fl(r,e,t);hl=null;return"double"}hl=new fl(r,e,t);dl=null;return"single"}function ml(e){var t=this,r=t.display;if(mt(t,e)||r.activeTouch&&r.input.supportsTouch())return;r.input.ensurePolled();r.shift=e.shiftKey;if(qr(r,e)){if(!s){r.scroller.draggable=false;setTimeout(function(){return r.scroller.draggable=true},100)}return}if(Sl(t,e))return;var n=En(t,e),i=St(e),o=n?pl(n,i):"single";window.focus();1==i&&t.state.selectingText&&t.state.selectingText(e);if(n&&vl(t,i,n,o,e))return;if(1==i)n?xl(t,n,o,e):Ct(e)==r.scroller&&yt(e);else if(2==i){n&&Ho(t.doc,n);setTimeout(function(){return r.input.focus()},20)}else 3==i&&(C?Ll(t,e):Gn(t))}function vl(e,t,r,n,i){var o="Click";"double"==n?o="Double"+o:"triple"==n&&(o="Triple"+o);o=(1==t?"Left":2==t?"Middle":"Right")+o;return tl(e,Ba(o,i),i,function(t){"string"==typeof t&&(t=Xa[t]);if(!t)return false;var n=false;try{e.isReadOnly()&&(e.state.suppressEdits=true);n=t(e,r)!=q}finally{e.state.suppressEdits=false}return n})}function gl(e,t,r){var n=e.getOption("configureMouse");var i=n?n(e,t,r):{};if(null==i.unit){var o=y?r.shiftKey&&r.metaKey:r.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey);null==i.addNew&&(i.addNew=x?r.metaKey:r.ctrlKey);null==i.moveOnDrag&&(i.moveOnDrag=!(x?r.altKey:r.ctrlKey));return i}function xl(e,t,r,n){a?setTimeout(P(qn,e),0):e.curOp.focus=W();var i=gl(e,r,n);var o=e.doc.sel,l;e.options.dragDrop&&Lt&&!e.isReadOnly()&&"single"==r&&(l=o.contains(t))>-1&&(xe((l=o.ranges[l]).from(),t)<0||t.xRel>0)&&(xe(l.to(),t)>0||t.xRel<0)?yl(e,n,t,i):wl(e,n,t,i)}function yl(e,t,r,n){var i=e.display,o=false;var u=Mi(e,function(t){s&&(i.scroller.draggable=false);e.state.draggingText=false;dt(i.wrapper.ownerDocument,"mouseup",u);dt(i.wrapper.ownerDocument,"mousemove",c);dt(i.scroller,"dragstart",f);dt(i.scroller,"drop",u);if(!o){yt(t);n.addNew||Ho(e.doc,r,null,null,n.extend);s||a&&9==l?setTimeout(function(){i.wrapper.ownerDocument.body.focus();i.input.focus()},20):i.input.focus()}});var c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10};var f=function(){return o=true};s&&(i.scroller.draggable=true);e.state.draggingText=u;u.copy=!n.moveOnDrag;i.scroller.dragDrop&&i.scroller.dragDrop();ft(i.wrapper.ownerDocument,"mouseup",u);ft(i.wrapper.ownerDocument,"mousemove",c);ft(i.scroller,"dragstart",f);ft(i.scroller,"drop",u);Gn(e);setTimeout(function(){return i.input.focus()},20)}function bl(e,t,r){if("char"==r)return new ro(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new ro(ge(t.line,0),Se(e.doc,ge(t.line+1,0)));var n=r(e,t);return new ro(n.from,n.to)}function wl(e,t,r,n){var i=e.display,o=e.doc;yt(t);var a,l,s=o.sel,u=s.ranges;if(n.addNew&&!n.extend){l=o.sel.contains(r);a=l>-1?u[l]:new ro(r,r)}else{a=o.sel.primary();l=o.sel.primIndex}if("rectangle"==n.unit){n.addNew||(a=new ro(r,r));r=En(e,t,true,true);l=-1}else{var c=bl(e,r,n.unit);a=n.extend?Wo(a,c.anchor,c.head,n.extend):c}if(n.addNew)if(-1==l){l=u.length;Ro(o,no(u.concat([a]),l),{scroll:false,origin:"*mouse"})}else if(u.length>1&&u[l].empty()&&"char"==n.unit&&!n.extend){Ro(o,no(u.slice(0,l).concat(u.slice(l+1)),0),{scroll:false,origin:"*mouse"});s=o.sel}else Fo(o,l,a,U);else{l=0;Ro(o,new to([a],0),U);s=o.sel}var f=r;function h(t){if(0==xe(f,t))return;f=t;if("rectangle"==n.unit){var i=[],u=e.options.tabSize;var c=z(ue(o,r.line).text,r.ch,u);var h=z(ue(o,t.line).text,t.ch,u);var d=Math.min(c,h),p=Math.max(c,h);for(var m=Math.min(r.line,t.line),v=Math.min(e.lastLine(),Math.max(r.line,t.line));m<=v;m++){var g=ue(o,m).text,x=V(g,d,u);d==p?i.push(new ro(ge(m,x),ge(m,x))):g.length>x&&i.push(new ro(ge(m,x),ge(m,V(g,p,u))))}i.length||i.push(new ro(r,r));Ro(o,no(s.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:false});e.scrollIntoView(t)}else{var y=a;var b=bl(e,t,n.unit);var w=y.anchor,k;if(xe(b.anchor,w)>0){k=b.head;w=ke(y.from(),b.anchor)}else{k=b.anchor;w=we(y.to(),b.head)}var C=s.ranges.slice(0);C[l]=kl(e,new ro(Se(o,w),k));Ro(o,no(C,l),U)}}var d=i.wrapper.getBoundingClientRect();var p=0;function m(t){var r=++p;var a=En(e,t,true,"rectangle"==n.unit);if(!a)return;if(0!=xe(a,f)){e.curOp.focus=W();h(a);var l=Xn(i,o);(a.line>=l.to||a.lined.bottom?20:0;s&&setTimeout(Mi(e,function(){if(p!=r)return;i.scroller.scrollTop+=s;m(t)}),50)}}function v(t){e.state.selectingText=false;p=Infinity;yt(t);i.input.focus();dt(i.wrapper.ownerDocument,"mousemove",g);dt(i.wrapper.ownerDocument,"mouseup",x);o.history.lastSelOrigin=null}var g=Mi(e,function(e){St(e)?m(e):v(e)});var x=Mi(e,v);e.state.selectingText=x;ft(i.wrapper.ownerDocument,"mousemove",g);ft(i.wrapper.ownerDocument,"mouseup",x)}function kl(e,t){var r=t.anchor;var n=t.head;var i=ue(e.doc,r.line);if(0==xe(r,n)&&r.sticky==n.sticky)return t;var o=ut(i);if(!o)return t;var a=lt(o,r.ch,r.sticky),l=o[a];if(l.from!=r.ch&&l.to!=r.ch)return t;var s=a+(l.from==r.ch==(1!=l.level)?0:1);if(0==s||s==o.length)return t;var u;if(n.line!=r.line)u=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=lt(o,n.ch,n.sticky);var f=c-a||(n.ch-r.ch)*(1==l.level?-1:1);u=c==s-1||c==s?f<0:f>0}var h=o[s+(u?-1:0)];var d=u==(1==h.level);var p=d?h.from:h.to,m=d?"after":"before";return r.ch==p&&r.sticky==m?t:new ro(new ge(r.line,p,m),n)}function Cl(e,t,r,n){var i,o;if(t.touches){i=t.touches[0].clientX;o=t.touches[0].clientY}else try{i=t.clientX;o=t.clientY}catch(t){return false}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return false;n&&yt(t);var a=e.display;var l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!gt(e,r))return wt(t);o-=l.top-a.viewOffset;for(var s=0;s=i){var c=pe(e.doc,o);var f=e.options.gutters[s];pt(e,r,e,c,f,t);return wt(t)}}}function Sl(e,t){return Cl(e,t,"gutterClick",true)}function Ll(e,t){if(qr(e.display,t)||Tl(e,t))return;if(mt(e,t,"contextmenu"))return;e.display.input.onContextMenu(t)}function Tl(e,t){if(!gt(e,"gutterContextMenu"))return false;return Cl(e,t,"gutterContextMenu",false)}function Ml(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-");cn(e)}var Nl={toString:function(){return"CodeMirror.Init"}};var Ol={};var Al={};function Dl(e){var t=e.optionHandlers;function r(r,n,i,o){e.defaults[r]=n;i&&(t[r]=o?function(e,t,r){r!=Nl&&i(e,t,r)}:i)}e.defineOption=r;e.Init=Nl;r("value","",function(e,t){return e.setValue(t)},true);r("mode",null,function(e,t){e.doc.modeOption=t;co(e)},true);r("indentUnit",2,co,true);r("indentWithTabs",false);r("smartIndent",true);r("tabSize",4,function(e){fo(e);cn(e);Ai(e)},true);r("lineSeparator",null,function(e,t){e.doc.lineSep=t;if(!t)return;var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length;r.push(ge(n,o))}n++});for(var i=r.length-1;i>=0;i--)ta(e.doc,t,r[i],ge(r[i].line,r[i].ch+t.length))});r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g");r!=Nl&&e.refresh()});r("specialCharPlaceholder",pr,function(e){return e.refresh()},true);r("electricChars",true);r("inputStyle",g?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},true);r("spellcheck",false,function(e,t){return e.getInputField().spellcheck=t},true);r("rtlMoveVisually",!b);r("wholeLineUpdateBefore",true);r("theme","default",function(e){Ml(e);Wl(e)},true);r("keyMap","default",function(e,t,r){var n=qa(t);var i=r!=Nl&&qa(r);i&&i.detach&&i.detach(e,n);n.attach&&n.attach(e,i||null)});r("extraKeys",null);r("configureMouse",null);r("lineWrapping",false,El,true);r("gutters",[],function(e){$i(e.options);Wl(e)},true);r("fixedGutter",true,function(e,t){e.display.gutters.style.left=t?Dn(e.display)+"px":"0";e.refresh()},true);r("coverGutterNextToScrollbar",false,function(e){return di(e)},true);r("scrollbarStyle","native",function(e){vi(e);di(e);e.display.scrollbars.setScrollTop(e.doc.scrollTop);e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},true);r("lineNumbers",false,function(e){$i(e.options);Wl(e)},true);r("firstLineNumber",1,Wl,true);r("lineNumberFormatter",function(e){return e},Wl,true);r("showCursorWhenSelecting",false,Pn,true);r("resetSelectionOnContextMenu",true);r("lineWiseCopyCut",true);r("pasteLinesPerSelection",true);r("readOnly",false,function(e,t){if("nocursor"==t){Kn(e);e.display.input.blur()}e.display.input.readOnlyChanged(t)});r("disableInput",false,function(e,t){t||e.display.input.reset()},true);r("dragDrop",true,Hl);r("allowDropFileTypes",null);r("cursorBlinkRate",530);r("cursorScrollMargin",0);r("cursorHeight",1,Pn,true);r("singleCursorHeightPerLine",true,Pn,true);r("workTime",100);r("workDelay",100);r("flattenSpans",true,fo,true);r("addModeClass",false,fo,true);r("pollInterval",100);r("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t});r("historyEventDelay",1250);r("viewportMargin",10,function(e){return e.refresh()},true);r("maxHighlightLength",1e4,fo,true);r("moveInputWithCursor",true,function(e,t){t||e.display.input.resetPosition()});r("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""});r("autofocus",null);r("direction","ltr",function(e,t){return e.doc.setDirection(t)},true)}function Wl(e){Xi(e);Ai(e);$n(e)}function Hl(e,t,r){var n=r&&r!=Nl;if(!t!=!n){var i=e.display.dragFunctions;var o=t?ft:dt;o(e.display.scroller,"dragstart",i.start);o(e.display.scroller,"dragenter",i.enter);o(e.display.scroller,"dragover",i.over);o(e.display.scroller,"dragleave",i.leave);o(e.display.scroller,"drop",i.drop)}}function El(e){if(e.options.lineWrapping){H(e.display.wrapper,"CodeMirror-wrap");e.display.sizer.style.minWidth="";e.display.sizerWidth=null}else{L(e.display.wrapper,"CodeMirror-wrap");it(e)}Hn(e);Ai(e);cn(e);setTimeout(function(){return di(e)},100)}function Fl(e,t){var r=this;if(!(this instanceof Fl))return new Fl(e,t);this.options=t=t?I(t):{};I(Ol,t,false);$i(t);var n=t.value;"string"==typeof n&&(n=new ba(n,t.mode,null,t.lineSeparator,t.direction));this.doc=n;var i=new Fl.inputStyles[t.inputStyle](this);var o=this.display=new se(e,n,i);o.wrapper.CodeMirror=this;Xi(this);Ml(this);t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");vi(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:false,delayingBlurEvent:false,focused:false,suppressEdits:false,pasteIncoming:false,cutIncoming:false,selectingText:false,draggingText:false,highlight:new R,keySeq:null,specialChars:null};t.autofocus&&!g&&o.input.focus();a&&l<11&&setTimeout(function(){return r.display.input.reset(true)},20);Pl(this);Na();xi(this);this.curOp.forceUpdate=true;vo(this,n);t.autofocus&&!g||this.hasFocus()?setTimeout(P(Un,this),20):Kn(this);for(var u in Al)Al.hasOwnProperty(u)&&Al[u](r,t[u],Nl);Yn(this);t.finishInit&&t.finishInit(this);for(var c=0;c400}ft(t.scroller,"touchstart",function(i){if(!mt(e,i)&&!o(i)&&!Sl(e,i)){t.input.ensurePolled();clearTimeout(r);var a=+new Date;t.activeTouch={start:a,moved:false,prev:a-n.end<=300?n:null};if(1==i.touches.length){t.activeTouch.left=i.touches[0].pageX;t.activeTouch.top=i.touches[0].pageY}}});ft(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=true)});ft(t.scroller,"touchend",function(r){var n=t.activeTouch;if(n&&!qr(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var o=e.coordsChar(t.activeTouch,"page"),a;a=!n.prev||s(n,n.prev)?new ro(o,o):!n.prev.prev||s(n,n.prev.prev)?e.findWordAt(o):new ro(ge(o.line,0),Se(e.doc,ge(o.line+1,0)));e.setSelection(a.anchor,a.head);e.focus();yt(r)}i()});ft(t.scroller,"touchcancel",i);ft(t.scroller,"scroll",function(){if(t.scroller.clientHeight){li(e,t.scroller.scrollTop);ui(e,t.scroller.scrollLeft,true);pt(e,"scroll",e)}});ft(t.scroller,"mousewheel",function(t){return eo(e,t)});ft(t.scroller,"DOMMouseScroll",function(t){return eo(e,t)});ft(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0});t.dragFunctions={enter:function(t){mt(e,t)||kt(t)},over:function(t){if(!mt(e,t)){Sa(e,t);kt(t)}},start:function(t){return Ca(e,t)},drop:Mi(e,ka),leave:function(t){mt(e,t)||La(e)}};var u=t.input.getField();ft(u,"keyup",function(t){return sl.call(e,t)});ft(u,"keydown",Mi(e,al));ft(u,"keypress",Mi(e,ul));ft(u,"focus",function(t){return Un(e,t)});ft(u,"blur",function(t){return Kn(e,t)})}var Il=[];Fl.defineInitHook=function(e){return Il.push(e)};function zl(e,t,r,n){var i=e.doc,o;null==r&&(r="add");"smart"==r&&(i.mode.indent?o=Jt(e,t).state:r="prev");var a=e.options.tabSize;var l=ue(i,t),s=z(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var u=l.text.match(/^\s*/)[0],c;if(n||/\S/.test(l.text)){if("smart"==r){c=i.mode.indent(o,l.text.slice(u.length),l.text);if(c==q||c>150){if(!n)return;r="prev"}}}else{c=0;r="not"}"prev"==r?c=t>i.first?z(ue(i,t-1).text,null,a):0:"add"==r?c=s+e.options.indentUnit:"subtract"==r?c=s-e.options.indentUnit:"number"==typeof r&&(c=s+r);c=Math.max(0,c);var f="",h=0;if(e.options.indentWithTabs)for(var d=Math.floor(c/a);d;--d){h+=a;f+="\t"}h1)if(Rl&&Rl.text.join("\n")==t){if(n.ranges.length%Rl.text.length==0){s=[];for(var u=0;u=0;f--){var h=n.ranges[f];var d=h.from(),p=h.to();h.empty()&&(r&&r>0?d=ge(d.line,d.ch-r):e.state.overwrite&&!a?p=ge(p.line,Math.min(ue(o,p.line).text.length,p.ch+$(l).length)):Rl&&Rl.lineWise&&Rl.text.join("\n")==t&&(d=p=ge(d.line,0)));c=e.curOp.updateInput;var m={from:d,to:p,text:s?s[f%s.length]:l,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};$o(e.doc,m);Mr(e,"inputRead",e,m)}t&&!a&&Gl(e,t);ri(e);e.curOp.updateInput=c;e.curOp.typing=true;e.state.pasteIncoming=e.state.cutIncoming=false}function ql(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r){e.preventDefault();t.isReadOnly()||t.options.disableInput||Ti(t,function(){return jl(t,r,0,null,"paste")});return true}}function Gl(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;var r=e.doc.sel;for(var n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)continue;var o=e.getModeAt(i.head);var a=false;if(o.electricChars){for(var l=0;l-1){a=zl(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(ue(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=zl(e,i.head.line,"smart"));a&&Mr(e,"electricInput",e,i.head.line)}}function Ul(e){var t=[],r=[];for(var n=0;nn){zl(t,o.head.line,e,true);n=o.head.line;i==t.doc.sel.primIndex&&ri(t)}}else{var a=o.from(),l=o.to();var s=Math.max(n,a.line);n=Math.min(t.lastLine(),l.line-(l.ch?0:1))+1;for(var u=s;u0&&Fo(t.doc,i,new ro(a,c[i].to()),G)}}}),getTokenAt:function(e,t){return rr(this,e,t)},getLineTokens:function(e,t){return rr(this,ge(e),t,true)},getTokenTypeAt:function(e){e=Se(this.doc,e);var t=Yt(this,ue(this.doc,e.line));var r=0,n=(t.length-1)/2,i=e.ch;var o;if(0==i)o=t[2];else for(;;){var a=r+n>>1;if((a?t[2*a-1]:0)>=i)n=a;else{if(!(t[2*a+1]o){e=o;n=true}i=ue(this.doc,e)}else i=e;return pn(this,i,{top:0,left:0},t||"page",r||n).top+(n?this.doc.height-rt(i):0)},defaultTextHeight:function(){return Nn(this.display)},defaultCharWidth:function(){return On(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=gn(this,Se(this.doc,e));var a=e.bottom,l=e.left;t.style.position="absolute";t.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(t);o.sizer.appendChild(t);if("over"==n)a=e.top;else if("above"==n||"near"==n){var s=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom);l+t.offsetWidth>u&&(l=u-t.offsetWidth)}t.style.top=a+"px";t.style.left=t.style.right="";if("right"==i){l=o.sizer.clientWidth-t.offsetWidth;t.style.right="0px"}else{"left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2);t.style.left=l+"px"}r&&Qn(this,{left:l,top:a,right:l+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:Ni(al),triggerOnKeyPress:Ni(ul),triggerOnKeyUp:sl,triggerOnMouseDown:Ni(ml),execCommand:function(e){if(Xa.hasOwnProperty(e))return Xa[e].call(null,this)},triggerElectric:Ni(function(e){Gl(this,e)}),findPosH:function(e,t,r,n){var i=this;var o=1;if(t<0){o=-1;t=-t}var a=Se(this.doc,e);for(var l=0;l0&&l(r.charAt(n-1)))--n;while(i.5)&&Hn(this);pt(this,"refresh",this)}),swapDoc:Ni(function(e){var t=this.doc;t.cm=null;vo(this,e);cn(this);this.display.input.reset();ni(this,e.scrollLeft,e.scrollTop);this.curOp.forceScroll=true;Mr(this,"swapDoc",this,t);return t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};xt(e);e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]});r[t][n]=i};e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o);r[t]._global.push({pred:i,val:o})}};function Xl(e,t,r,n,i){var o=t;var a=r;var l=ue(e,t.line);function s(){var n=t.line+r;if(n=e.first+e.size)return false;t=new ge(n,t.ch,t.sticky);return l=ue(e,n)}function u(n){var o;o=i?_a(e.cm,l,t,r):Ka(l,t,r);if(null==o){if(n||!s())return false;t=Va(i,e.cm,l,t.line,r)}else t=o;return true}if("char"==n)u();else if("column"==n)u(true);else if("word"==n||"group"==n){var c=null,f="group"==n;var h=e.cm&&e.cm.getHelper(t,"wordChars");for(var d=true;;d=false){if(r<0&&!u(!d))break;var p=l.text.charAt(t.ch)||"\n";var m=re(p,h)?"w":f&&"\n"==p?"n":!f||/\s/.test(p)?null:"p";!f||d||m||(m="s");if(c&&c!=m){if(r<0){r=1;u();t.sticky="after"}break}m&&(c=m);if(r>0&&!u(!d))break}}var v=Ko(e,t,o,a,true);ye(o,v)&&(v.hitSide=true);return v}function $l(e,t,r,n){var i=e.doc,o=t.left,a;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);var s=Math.max(l-.5*Nn(e.display),3);a=(r>0?t.bottom:t.top)+r*s}else"line"==n&&(a=r>0?t.bottom+3:t.top-3);var u;for(;;){u=bn(e,o,a);if(!u.outside)break;if(r<0?a<=0:a>=i.height){u.hitSide=true;break}a+=5*r}return u}var Yl=function(e){this.cm=e;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new R;this.composing=null;this.gracePeriod=false;this.readDOMTimeout=null};Yl.prototype.init=function(e){var t=this;var r=this,n=r.cm;var i=r.div=e.lineDiv;Kl(i,n.options.spellcheck);ft(i,"paste",function(e){if(mt(n,e)||ql(e,n))return;l<=11&&setTimeout(Mi(n,function(){return t.updateFromDOM()}),20)});ft(i,"compositionstart",function(e){t.composing={data:e.data,done:false}});ft(i,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:false})});ft(i,"compositionend",function(e){if(t.composing){e.data!=t.composing.data&&t.readFromDOMSoon();t.composing.done=true}});ft(i,"touchstart",function(){return r.forceCompositionEnd()});ft(i,"input",function(){t.composing||t.readFromDOMSoon()});function o(e){if(mt(n,e))return;if(n.somethingSelected()){Bl({lineWise:false,text:n.getSelections()});"cut"==e.type&&n.replaceSelection("",null,"cut")}else{if(!n.options.lineWiseCopyCut)return;var t=Ul(n);Bl({lineWise:true,text:t.text});"cut"==e.type&&n.operation(function(){n.setSelections(t.ranges,0,G);n.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var o=Rl.text.join("\n");e.clipboardData.setData("Text",o);if(e.clipboardData.getData("Text")==o){e.preventDefault();return}}var a=Vl(),l=a.firstChild;n.display.lineSpace.insertBefore(a,n.display.lineSpace.firstChild);l.value=Rl.text.join("\n");var s=document.activeElement;F(l);setTimeout(function(){n.display.lineSpace.removeChild(a);s.focus();s==i&&r.showPrimarySelection()},50)}ft(i,"copy",o);ft(i,"cut",o)};Yl.prototype.prepareSelection=function(){var e=In(this.cm,false);e.focus=this.cm.state.focused;return e};Yl.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection();this.showMultipleSelections(e)};Yl.prototype.showPrimarySelection=function(){var e=window.getSelection(),t=this.cm,n=t.doc.sel.primary();var i=n.from(),o=n.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line=t.display.viewFrom&&Jl(t,i)||{node:s[0].measure.map[2],offset:0};var c=o.linee.firstLine()&&(n=ge(n.line-1,ue(e.doc,n.line-1).length));i.ch==ue(e.doc,i.line).text.length&&i.linet.viewTo-1)return false;var o,a,l;if(n.line==t.viewFrom||0==(o=Fn(e,n.line))){a=de(t.view[0].line);l=t.view[0].node}else{a=de(t.view[o].line);l=t.view[o-1].node.nextSibling}var s=Fn(e,i.line);var u,c;if(s==t.view.length-1){u=t.viewTo-1;c=t.lineDiv.lastChild}else{u=de(t.view[s+1].line)-1;c=t.view[s+1].node.previousSibling}if(!l)return false;var f=e.doc.splitLines(es(e,l,c,a,u));var h=ce(e.doc,ge(a,0),ge(u,ue(e.doc,u).text.length));while(f.length>1&&h.length>1)if($(f)==$(h)){f.pop();h.pop();u--}else{if(f[0]!=h[0])break;f.shift();h.shift();a++}var d=0,p=0;var m=f[0],v=h[0],g=Math.min(m.length,v.length);while(dn.ch&&x.charCodeAt(x.length-p-1)==y.charCodeAt(y.length-p-1)){d--;p++}f[f.length-1]=x.slice(0,x.length-p).replace(/^\u200b+/,"");f[0]=f[0].slice(d).replace(/\u200b+$/,"");var w=ge(a,d);var k=ge(u,h.length?$(h).length-p:0);if(f.length>1||f[0]||xe(w,k)){ta(e.doc,f,w,k,"+input");return true}};Yl.prototype.ensurePolled=function(){this.forceCompositionEnd()};Yl.prototype.reset=function(){this.forceCompositionEnd()};Yl.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout);this.composing=null;this.updateFromDOM();this.div.blur();this.div.focus()};Yl.prototype.readFromDOMSoon=function(){var e=this;if(null!=this.readDOMTimeout)return;this.readDOMTimeout=setTimeout(function(){e.readDOMTimeout=null;if(e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80)};Yl.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Ti(this.cm,function(){return Ai(e.cm)})};Yl.prototype.setUneditable=function(e){e.contentEditable="false"};Yl.prototype.onKeyPress=function(e){if(0==e.charCode||this.composing)return;e.preventDefault();this.cm.isReadOnly()||Mi(this.cm,jl)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)};Yl.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)};Yl.prototype.onContextMenu=function(){};Yl.prototype.resetPosition=function(){};Yl.prototype.needsContentAttribute=true;function Jl(e,t){var r=Qr(e,t.line);if(!r||r.hidden)return null;var n=ue(e.doc,t.line);var i=Yr(r,n,t.line);var o=ut(n,e.doc.direction),a="left";if(o){var l=lt(o,t.ch);a=l%2?"right":"left"}var s=nn(i.map,t.ch,a);s.offset="right"==s.collapse?s.end:s.start;return s}function Zl(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return true;return false}function Ql(e,t){t&&(e.bad=true);return e}function es(e,t,r,n,i){var o="",a=false,l=e.doc.lineSeparator();function s(e){return function(t){return t.id==e}}function u(){if(a){o+=l;a=false}}function c(e){if(e){u();o+=e}}function f(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r){c(r||t.textContent.replace(/\u200b/g,""));return}var o=t.getAttribute("cm-marker"),h;if(o){var d=e.findMarks(ge(n,0),ge(i+1,0),s(+o));d.length&&(h=d[0].find(0))&&c(ce(e.doc,h.from,h.to).join(l));return}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p)$/i.test(t.nodeName);p&&u();for(var m=0;m=9&&t.hasSelection&&(t.hasSelection=null);r.poll()});ft(i,"paste",function(e){if(mt(n,e)||ql(e,n))return;n.state.pasteIncoming=true;r.fastPoll()});function o(e){if(mt(n,e))return;if(n.somethingSelected())Bl({lineWise:false,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=Ul(n);Bl({lineWise:true,text:t.text});if("cut"==e.type)n.setSelections(t.ranges,null,G);else{r.prevInput="";i.value=t.text.join("\n");F(i)}}"cut"==e.type&&(n.state.cutIncoming=true)}ft(i,"cut",o);ft(i,"copy",o);ft(e.scroller,"paste",function(t){if(qr(e,t)||mt(n,t))return;n.state.pasteIncoming=true;r.focus()});ft(e.lineSpace,"selectstart",function(t){qr(e,t)||yt(t)});ft(i,"compositionstart",function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear();r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}});ft(i,"compositionend",function(){if(r.composing){r.poll();r.composing.range.clear();r.composing=null}})};ns.prototype.createField=function(e){this.wrapper=Vl();this.textarea=this.wrapper.firstChild};ns.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc;var n=In(e);if(e.options.moveInputWithCursor){var i=gn(e,r.sel.primary().head,"div");var o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top));n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n};ns.prototype.showSelection=function(e){var t=this.cm,r=t.display;M(r.cursorDiv,e.cursors);M(r.selectionDiv,e.selection);if(null!=e.teTop){this.wrapper.style.top=e.teTop+"px";this.wrapper.style.left=e.teLeft+"px"}};ns.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r;t.state.focused&&F(this.textarea);a&&l>=9&&(this.hasSelection=r)}else if(!e){this.prevInput=this.textarea.value="";a&&l>=9&&(this.hasSelection=null)}};ns.prototype.getField=function(){return this.textarea};ns.prototype.supportsTouch=function(){return false};ns.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!g||W()!=this.textarea))try{this.textarea.focus()}catch(e){}};ns.prototype.blur=function(){this.textarea.blur()};ns.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0};ns.prototype.receivedFocus=function(){this.slowPoll()};ns.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll();e.cm.state.focused&&e.slowPoll()})};ns.prototype.fastPoll=function(){var e=false,t=this;t.pollingFast=true;function r(){var n=t.poll();if(n||e){t.pollingFast=false;t.slowPoll()}else{e=true;t.polling.set(60,r)}}t.polling.set(20,r)};ns.prototype.poll=function(){var e=this;var t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Dt(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return false;var i=r.value;if(i==n&&!t.somethingSelected())return false;if(a&&l>=9&&this.hasSelection===i||x&&/[\uf700-\uf7ff]/.test(i)){t.display.input.reset();return false}if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);8203!=o||n||(n="​");if(8666==o){this.reset();return this.cm.execCommand("undo")}}var s=0,u=Math.min(n.length,i.length);while(s1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i;if(e.composing){e.composing.range.clear();e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"})}});return true};ns.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=false)};ns.prototype.onKeyPress=function(){a&&l>=9&&(this.hasSelection=null);this.fastPoll()};ns.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;var o=En(r,e),u=n.scroller.scrollTop;if(!o||f)return;var c=r.options.resetSelectionOnContextMenu;c&&-1==r.doc.sel.contains(o)&&Mi(r,Ro)(r.doc,io(o),G);var h=i.style.cssText,d=t.wrapper.style.cssText;t.wrapper.style.cssText="position: absolute";var p=t.wrapper.getBoundingClientRect();i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var m;s&&(m=window.scrollY);n.input.focus();s&&window.scrollTo(null,m);n.input.reset();r.somethingSelected()||(i.value=t.prevInput=" ");t.contextMenuPending=true;n.selForContextMenu=r.doc.sel;clearTimeout(n.detectingSelectAll);function v(){if(null!=i.selectionStart){var e=r.somethingSelected();var o="​"+(e?i.value:"");i.value="⇚";i.value=o;t.prevInput=e?"":"​";i.selectionStart=1;i.selectionEnd=o.length;n.selForContextMenu=r.doc.sel}}function g(){t.contextMenuPending=false;t.wrapper.style.cssText=d;i.style.cssText=h;a&&l<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=u);if(null!=i.selectionStart){(!a||a&&l<9)&&v();var e=0,o=function(){if(n.selForContextMenu==r.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput)Mi(r,_o)(r);else if(e++<10)n.detectingSelectAll=setTimeout(o,500);else{n.selForContextMenu=null;n.input.reset()}};n.detectingSelectAll=setTimeout(o,200)}}a&&l>=9&&v();if(C){kt(e);var x=function(){dt(window,"mouseup",x);setTimeout(g,20)};ft(window,"mouseup",x)}else setTimeout(g,50)};ns.prototype.readOnlyChanged=function(e){e||this.reset();this.textarea.disabled="nocursor"==e};ns.prototype.setUneditable=function(){};ns.prototype.needsContentAttribute=false;function is(e,t){t=t?I(t):{};t.value=e.value;!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex);!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder);if(null==t.autofocus){var r=W();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=l.getValue()}var i;if(e.form){ft(e.form,"submit",n);if(!t.leaveSubmitMethodAlone){var o=e.form;i=o.submit;try{var a=o.submit=function(){n();o.submit=i;o.submit();o.submit=a}}catch(e){}}}t.finishInit=function(t){t.save=n;t.getTextArea=function(){return e};t.toTextArea=function(){t.toTextArea=isNaN;n();e.parentNode.removeChild(t.getWrapperElement());e.style.display="";if(e.form){dt(e.form,"submit",n);"function"==typeof e.form.submit&&(e.form.submit=i)}}};e.style.display="none";var l=Fl(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return l}function os(e){e.off=dt;e.on=ft;e.wheelEventPixels=Qi;e.Doc=ba;e.splitLines=At;e.countColumn=z;e.findColumn=V;e.isWordChar=te;e.Pass=q;e.signal=pt;e.Line=lr;e.changeEnd=oo;e.scrollbarModel=mi;e.Pos=ge;e.cmpPos=xe;e.modes=Ft;e.mimeModes=Pt;e.resolveMode=Rt;e.getMode=Bt;e.modeExtensions=jt;e.extendMode=qt;e.copyState=Gt;e.startState=Kt;e.innerMode=Ut;e.commands=Xa;e.keyMap=Fa;e.keyName=ja;e.isModifierKey=Ra;e.lookupKey=za;e.normalizeKeyMap=Ia;e.StringStream=Vt;e.SharedTextMarker=pa;e.TextMarker=ha;e.LineWidget=sa;e.e_preventDefault=yt;e.e_stopPropagation=bt;e.e_stop=kt;e.addClass=H;e.contains=D;e.rmClass=L;e.keyNames=Da}Dl(Fl);_l(Fl);var as="iter insert remove copy getEditor constructor".split(" ");for(var ls in ba.prototype)ba.prototype.hasOwnProperty(ls)&&B(as,ls)<0&&(Fl.prototype[ls]=function(e){return function(){return e.apply(this.doc,arguments)}}(ba.prototype[ls]));xt(ba);Fl.inputStyles={textarea:ns,contenteditable:Yl};Fl.defineMode=function(e){Fl.defaults.mode||"null"==e||(Fl.defaults.mode=e);It.apply(this,arguments)};Fl.defineMIME=zt;Fl.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}});Fl.defineMIME("text/plain","null");Fl.defineExtension=function(e,t){Fl.prototype[e]=t};Fl.defineDocExtension=function(e,t){ba.prototype[e]=t};Fl.fromTextArea=is;os(Fl);Fl.version="5.37.0";return Fl})},370:function(e,t,r){(function(e){true;e(r(282),r(371),r(372))})(function(e){"use strict";e.defineMode("markdown",function(t,r){var n=e.getMode(t,"text/html");var i="null"==n.name;function o(r){if(e.findModeByName){var n=e.findModeByName(r);n&&(r=n.mime||n.mimes[0])}var i=e.getMode(t,r);return"null"==i.name?null:i}void 0===r.highlightFormatting&&(r.highlightFormatting=false);void 0===r.maxBlockquoteDepth&&(r.maxBlockquoteDepth=0);void 0===r.taskLists&&(r.taskLists=false);void 0===r.strikethrough&&(r.strikethrough=false);void 0===r.emoji&&(r.emoji=false);void 0===r.fencedCodeBlockHighlighting&&(r.fencedCodeBlockHighlighting=true);void 0===r.xml&&(r.xml=true);void 0===r.tokenTypeOverrides&&(r.tokenTypeOverrides={});var a={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var l in a)a.hasOwnProperty(l)&&r.tokenTypeOverrides[l]&&(a[l]=r.tokenTypeOverrides[l]);var s=/^([*\-_])(?:\s*\1){2,}\s*$/,u=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,c=/^\[(x| )\](?=\s)/i,f=r.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,h=/^ *(?:\={1,}|-{1,})\s*$/,d=/^[^#!\[\]*_\\<>` "'(~:]+/,p=/^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/,m=/^\s*\[[^\]]+?\]:.*$/,v=/[!\"#$%&\'()*+,\-\.\/:;<=>?@\[\\\]^_`{|}~—]/,g=" ";function x(e,t,r){t.f=t.inline=r;return r(e,t)}function y(e,t,r){t.f=t.block=r;return r(e,t)}function b(e){return!e||!/\S/.test(e.string)}function w(e){e.linkTitle=false;e.linkHref=false;e.linkText=false;e.em=false;e.strong=false;e.strikethrough=false;e.quote=0;e.indentedCode=false;if(e.f==C){e.f=M;e.block=k}e.trailingSpace=0;e.trailingSpaceNewLine=false;e.prevLine=e.thisLine;e.thisLine={stream:null};return null}function k(t,n){var i=t.column()===n.indentation;var l=b(n.prevLine.stream);var d=n.indentedCode;var v=n.prevLine.hr;var g=false!==n.list;var y=(n.listStack[n.listStack.length-1]||0)+3;n.indentedCode=false;var w=n.indentation;if(null===n.indentationDiff){n.indentationDiff=n.indentation;if(g){n.em=false;n.strong=false;n.code=false;n.strikethrough=false;n.list=null;while(w=4&&(d||n.prevLine.fencedCodeEnd||n.prevLine.header||l)){t.skipToEnd();n.indentedCode=true;return a.code}if(t.eatSpace())return null;if(i&&n.indentation<=y&&(T=t.match(f))&&T[1].length<=6){n.quote=0;n.header=T[1].length;n.thisLine.header=true;r.highlightFormatting&&(n.formatting="header");n.f=n.inline;return L(n)}if(n.indentation<=y&&t.eat(">")){n.quote=i?1:n.quote+1;r.highlightFormatting&&(n.formatting="quote");t.eatSpace();return L(n)}if(!C&&!n.setext&&i&&n.indentation<=y&&(T=t.match(u))){var M=T[1]?"ol":"ul";n.indentation=w+t.current().length;n.list=true;n.quote=0;n.listStack.push(n.indentation);r.taskLists&&t.match(c,false)&&(n.taskList=true);n.f=n.inline;r.highlightFormatting&&(n.formatting=["list","list-"+M]);return L(n)}if(i&&n.indentation<=y&&(T=t.match(p,true))){n.quote=0;n.fencedEndRE=new RegExp(T[1]+"+ *$");n.localMode=r.fencedCodeBlockHighlighting&&o(T[2]);n.localMode&&(n.localState=e.startState(n.localMode));n.f=n.block=S;r.highlightFormatting&&(n.formatting="code-block");n.code=-1;return L(n)}if(n.setext||!(k&&g||n.quote||false!==n.list||n.code||C||m.test(t.string))&&(T=t.lookAhead(1))&&(T=T.match(h))){if(n.setext){n.header=n.setext;n.setext=0;t.skipToEnd();r.highlightFormatting&&(n.formatting="header")}else{n.header="="==T[0].charAt(0)?1:2;n.setext=n.header}n.thisLine.header=true;n.f=n.inline;return L(n)}if(C){t.skipToEnd();n.hr=true;n.thisLine.hr=true;return a.hr}if("["===t.peek())return x(t,n,W);return x(t,n,n.inline)}function C(t,r){var o=n.token(t,r.htmlState);if(!i){var a=e.innerMode(n,r.htmlState);if("xml"==a.mode.name&&null===a.state.tagStart&&!a.state.context&&a.state.tokenize.isInText||r.md_inside&&t.current().indexOf(">")>-1){r.f=M;r.block=k;r.htmlState=null}}return o}function S(e,t){var n=t.listStack[t.listStack.length-1]||0;var i=t.indentation=e.quote?t.push(a.formatting+"-"+e.formatting[n]+"-"+e.quote):t.push("error"))}}if(e.taskOpen){t.push("meta");return t.length?t.join(" "):null}if(e.taskClosed){t.push("property");return t.length?t.join(" "):null}if(e.linkHref)t.push(a.linkHref,"url");else{e.strong&&t.push(a.strong);e.em&&t.push(a.em);e.strikethrough&&t.push(a.strikethrough);e.emoji&&t.push(a.emoji);e.linkText&&t.push(a.linkText);e.code&&t.push(a.code);e.image&&t.push(a.image);e.imageAltText&&t.push(a.imageAltText,"link");e.imageMarker&&t.push(a.imageMarker)}e.header&&t.push(a.header,a.header+"-"+e.header);if(e.quote){t.push(a.quote);!r.maxBlockquoteDepth||r.maxBlockquoteDepth>=e.quote?t.push(a.quote+"-"+e.quote):t.push(a.quote+"-"+r.maxBlockquoteDepth)}if(false!==e.list){var i=(e.listStack.length-1)%3;i?1===i?t.push(a.list2):t.push(a.list3):t.push(a.list1)}e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b"));return t.length?t.join(" "):null}function T(e,t){if(e.match(d,true))return L(t);return}function M(t,i){var o=i.text(t,i);if("undefined"!==typeof o)return o;if(i.list){i.list=null;return L(i)}if(i.taskList){var l=" "===t.match(c,true)[1];l?i.taskOpen=true:i.taskClosed=true;r.highlightFormatting&&(i.formatting="task");i.taskList=false;return L(i)}i.taskOpen=false;i.taskClosed=false;if(i.header&&t.match(/^#+$/,true)){r.highlightFormatting&&(i.formatting="header");return L(i)}var s=t.next();if(i.linkTitle){i.linkTitle=false;var u=s;"("===s&&(u=")");u=(u+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var f="^\\s*(?:[^"+u+"\\\\]+|\\\\\\\\|\\\\.)"+u;if(t.match(new RegExp(f),true))return a.linkHref}if("`"===s){var h=i.formatting;r.highlightFormatting&&(i.formatting="code");t.eatWhile("`");var d=t.current().length;if(0!=i.code||i.quote&&1!=d){if(d==i.code){var p=L(i);i.code=0;return p}i.formatting=h;return L(i)}i.code=d;return L(i)}if(i.code)return L(i);if("\\"===s){t.next();if(r.highlightFormatting){var m=L(i);var g=a.formatting+"-escape";return m?m+" "+g:g}}if("!"===s&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,false)){i.imageMarker=true;i.image=true;r.highlightFormatting&&(i.formatting="image");return L(i)}if("["===s&&i.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,false)){i.imageMarker=false;i.imageAltText=true;r.highlightFormatting&&(i.formatting="image");return L(i)}if("]"===s&&i.imageAltText){r.highlightFormatting&&(i.formatting="image");var m=L(i);i.imageAltText=false;i.image=false;i.inline=i.f=O;return m}if("["===s&&!i.image){i.linkText=true;r.highlightFormatting&&(i.formatting="link");return L(i)}if("]"===s&&i.linkText){r.highlightFormatting&&(i.formatting="link");var m=L(i);i.linkText=false;i.inline=i.f=t.match(/\(.*?\)| ?\[.*?\]/,false)?O:M;return m}if("<"===s&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,false)){i.f=i.inline=N;r.highlightFormatting&&(i.formatting="link");var m=L(i);m?m+=" ":m="";return m+a.linkInline}if("<"===s&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,false)){i.f=i.inline=N;r.highlightFormatting&&(i.formatting="link");var m=L(i);m?m+=" ":m="";return m+a.linkEmail}if(r.xml&&"<"===s&&t.match(/^(!--|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*>)/i,false)){var x=t.string.indexOf(">",t.pos);if(-1!=x){var b=t.string.substring(t.start,x);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(i.md_inside=true)}t.backUp(1);i.htmlState=e.startState(n);return y(t,i,C)}if(r.xml&&"<"===s&&t.match(/^\/\w*?>/)){i.md_inside=false;return"tag"}if("*"===s||"_"===s){var w=1,k=1==t.pos?" ":t.string.charAt(t.pos-2);while(w<3&&t.eat(s))w++;var S=t.peek()||" ";var T=!/\s/.test(S)&&(!v.test(S)||/\s/.test(k)||v.test(k));var A=!/\s/.test(k)&&(!v.test(k)||/\s/.test(S)||v.test(S));var D=null,W=null;w%2&&(i.em||!T||"*"!==s&&A&&!v.test(k)?i.em!=s||!A||"*"!==s&&T&&!v.test(S)||(D=false):D=true);w>1&&(i.strong||!T||"*"!==s&&A&&!v.test(k)?i.strong!=s||!A||"*"!==s&&T&&!v.test(S)||(W=false):W=true);if(null!=W||null!=D){r.highlightFormatting&&(i.formatting=null==D?"strong":null==W?"em":"strong em");true===D&&(i.em=s);true===W&&(i.strong=s);var p=L(i);false===D&&(i.em=false);false===W&&(i.strong=false);return p}}else if(" "===s&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return L(i);t.backUp(1)}if(r.strikethrough)if("~"===s&&t.eatWhile(s)){if(i.strikethrough){r.highlightFormatting&&(i.formatting="strikethrough");var p=L(i);i.strikethrough=false;return p}if(t.match(/^[^\s]/,false)){i.strikethrough=true;r.highlightFormatting&&(i.formatting="strikethrough");return L(i)}}else if(" "===s&&t.match(/^~~/,true)){if(" "===t.peek())return L(i);t.backUp(2)}if(r.emoji&&":"===s&&t.match(/^[a-z_\d+-]+:/)){i.emoji=true;r.highlightFormatting&&(i.formatting="emoji");var H=L(i);i.emoji=false;return H}" "===s&&(t.match(/ +$/,false)?i.trailingSpace++:i.trailingSpace&&(i.trailingSpaceNewLine=true));return L(i)}function N(e,t){var n=e.next();if(">"===n){t.f=t.inline=M;r.highlightFormatting&&(t.formatting="link");var i=L(t);i?i+=" ":i="";return i+a.linkInline}e.match(/^[^>]+/,true);return a.linkInline}function O(e,t){if(e.eatSpace())return null;var n=e.next();if("("===n||"["===n){t.f=t.inline=D("("===n?")":"]");r.highlightFormatting&&(t.formatting="link-string");t.linkHref=true;return L(t)}return"error"}var A={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function D(e){return function(t,n){var i=t.next();if(i===e){n.f=n.inline=M;r.highlightFormatting&&(n.formatting="link-string");var o=L(n);n.linkHref=false;return o}t.match(A[e]);n.linkHref=true;return L(n)}}function W(e,t){if(e.match(/^([^\]\\]|\\.)*\]:/,false)){t.f=H;e.next();r.highlightFormatting&&(t.formatting="link");t.linkText=true;return L(t)}return x(e,t,M)}function H(e,t){if(e.match(/^\]:/,true)){t.f=t.inline=E;r.highlightFormatting&&(t.formatting="link");var n=L(t);t.linkText=false;return n}e.match(/^([^\]\\]|\\.)+/,true);return a.linkText}function E(e,t){if(e.eatSpace())return null;e.match(/^[^\s]+/,true);void 0===e.peek()?t.linkTitle=true:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,true);t.f=t.inline=M;return a.linkHref+" url"}var F={startState:function(){return{f:k,prevLine:{stream:null},thisLine:{stream:null},block:k,htmlState:null,indentation:0,inline:M,text:T,formatting:false,linkText:false,linkHref:false,linkTitle:false,code:0,em:false,strong:false,header:0,setext:0,hr:false,taskList:false,list:false,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:false,strikethrough:false,emoji:false,fencedEndRE:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(n,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:false,linkText:t.linkText,linkTitle:t.linkTitle,linkHref:t.linkHref,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,emoji:t.emoji,header:t.header,setext:t.setext,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedEndRE:t.fencedEndRE}},token:function(e,t){t.formatting=false;if(e!=t.thisLine.stream){t.header=0;t.hr=false;if(e.match(/^\s*$/,true)){w(t);return null}t.prevLine=t.thisLine;t.thisLine={stream:e};t.taskList=false;t.trailingSpace=0;t.trailingSpaceNewLine=false;if(!t.localState){t.f=t.block;if(t.f!=C){var r=e.match(/^\s*/,true)[0].replace(/\t/g,g).length;t.indentation=r;t.indentationDiff=null;if(r>0)return null}}}return t.f(e,t)},innerMode:function(e){if(e.block==C)return{state:e.htmlState,mode:n};if(e.localState)return{state:e.localState,mode:e.localMode};return{state:e,mode:F}},indent:function(t,r,i){if(t.block==C&&n.indent)return n.indent(t.htmlState,r,i);if(t.localState&&t.localMode.indent)return t.localMode.indent(t.localState,r,i);return e.Pass},blankLine:w,getType:L,closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return F},"xml");e.defineMIME("text/markdown","markdown");e.defineMIME("text/x-markdown","markdown")})},371:function(e,t,r){(function(e){true;e(r(282))})(function(e){"use strict";var t={autoSelfClosers:{area:true,base:true,br:true,col:true,command:true,embed:true,frame:true,hr:true,img:true,input:true,keygen:true,link:true,meta:true,param:true,source:true,track:true,wbr:true,menuitem:true},implicitlyClosed:{dd:true,li:true,optgroup:true,option:true,p:true,rp:true,rt:true,tbody:true,td:true,tfoot:true,th:true,tr:true},contextGrabbers:{dd:{dd:true,dt:true},dt:{dd:true,dt:true},li:{li:true},option:{option:true,optgroup:true},optgroup:{optgroup:true},p:{address:true,article:true,aside:true,blockquote:true,dir:true,div:true,dl:true,fieldset:true,footer:true,form:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true,header:true,hgroup:true,hr:true,menu:true,nav:true,ol:true,p:true,pre:true,section:true,table:true,ul:true},rp:{rp:true,rt:true},rt:{rp:true,rt:true},tbody:{tbody:true,tfoot:true},td:{td:true,th:true},tfoot:{tbody:true},th:{td:true,th:true},thead:{tbody:true,tfoot:true},tr:{tr:true}},doNotIndent:{pre:true},allowUnquoted:true,allowMissing:true,caseFold:true};var r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:false,allowMissing:false,allowMissingTagName:false,caseFold:false};e.defineMode("xml",function(n,i){var o=n.indentUnit;var a={};var l=i.htmlMode?t:r;for(var s in l)a[s]=l[s];for(var s in i)a[s]=i[s];var u,c;function f(e,t){function r(r){t.tokenize=r;return r(e,t)}var n=e.next();if("<"==n){if(e.eat("!")){if(e.eat("["))return e.match("CDATA[")?r(p("atom","]]>")):null;if(e.match("--"))return r(p("comment","--\x3e"));if(e.match("DOCTYPE",true,true)){e.eatWhile(/[\w\._\-]/);return r(m(1))}return null}if(e.eat("?")){e.eatWhile(/[\w\._\-]/);t.tokenize=p("meta","?>");return"meta"}u=e.eat("/")?"closeTag":"openTag";t.tokenize=h;return"tag bracket"}if("&"==n){var i;i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";");return i?"atom":"error"}e.eatWhile(/[^&<]/);return null}f.isInText=true;function h(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">")){t.tokenize=f;u=">"==r?"endTag":"selfcloseTag";return"tag bracket"}if("="==r){u="equals";return null}if("<"==r){t.tokenize=f;t.state=y;t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+" tag error":"tag error"}if(/[\'\"]/.test(r)){t.tokenize=d(r);t.stringStartCol=e.column();return t.tokenize(e,t)}e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);return"word"}function d(e){var t=function(t,r){while(!t.eol())if(t.next()==e){r.tokenize=h;break}return"string"};t.isInAttribute=true;return t}function p(e,t){return function(r,n){while(!r.eol()){if(r.match(t)){n.tokenize=f;break}r.next()}return e}}function m(e){return function(t,r){var n;while(null!=(n=t.next())){if("<"==n){r.tokenize=m(e+1);return r.tokenize(t,r)}if(">"==n){if(1==e){r.tokenize=f;break}r.tokenize=m(e-1);return r.tokenize(t,r)}}return"meta"}}function v(e,t,r){this.prev=e.context;this.tagName=t;this.indent=e.indented;this.startOfLine=r;(a.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=true)}function g(e){e.context&&(e.context=e.context.prev)}function x(e,t){var r;while(true){if(!e.context)return;r=e.context.tagName;if(!a.contextGrabbers.hasOwnProperty(r)||!a.contextGrabbers[r].hasOwnProperty(t))return;g(e)}}function y(e,t,r){if("openTag"==e){r.tagStart=t.column();return b}return"closeTag"==e?w:y}function b(e,t,r){if("word"==e){r.tagName=t.current();c="tag";return S}if(a.allowMissingTagName&&"endTag"==e){c="tag bracket";return S(e,t,r)}c="error";return b}function w(e,t,r){if("word"==e){var n=t.current();r.context&&r.context.tagName!=n&&a.implicitlyClosed.hasOwnProperty(r.context.tagName)&&g(r);if(r.context&&r.context.tagName==n||false===a.matchClosing){c="tag";return k}c="tag error";return C}if(a.allowMissingTagName&&"endTag"==e){c="tag bracket";return k(e,t,r)}c="error";return C}function k(e,t,r){if("endTag"!=e){c="error";return k}g(r);return y}function C(e,t,r){c="error";return k(e,t,r)}function S(e,t,r){if("word"==e){c="attribute";return L}if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;r.tagName=r.tagStart=null;if("selfcloseTag"==e||a.autoSelfClosers.hasOwnProperty(n))x(r,n);else{x(r,n);r.context=new v(r,n,i==r.indented)}return y}c="error";return S}function L(e,t,r){if("equals"==e)return T;a.allowMissing||(c="error");return S(e,t,r)}function T(e,t,r){if("string"==e)return M;if("word"==e&&a.allowUnquoted){c="string";return S}c="error";return S(e,t,r)}function M(e,t,r){if("string"==e)return M;return S(e,t,r)}return{startState:function(e){var t={tokenize:f,state:y,indented:e||0,tagName:null,tagStart:null,context:null};null!=e&&(t.baseIndent=e);return t},token:function(e,t){!t.tagName&&e.sol()&&(t.indented=e.indentation());if(e.eatSpace())return null;u=null;var r=t.tokenize(e,t);if((r||u)&&"comment"!=r){c=null;t.state=t.state(u||r,e,t);c&&(r="error"==c?r+" error":c)}return r},indent:function(t,r,n){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+o;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=h&&t.tokenize!=f)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return false!==a.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+o*(a.multilineTagIndentFactor||1);if(a.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:a.htmlMode?"html":"xml",helperType:a.htmlMode?"html":"xml",skipAttribute:function(e){e.state==T&&(e.state=S)}}});e.defineMIME("text/xml","xml");e.defineMIME("application/xml","xml");e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:true})})},372:function(e,t,r){(function(e){true;e(r(282))})(function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"],alias:["objective-c","objc"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]}];for(var t=0;t-1&&t.substring(i+1,t.length);if(o)return e.findModeByExtension(o)};e.findModeByName=function(t){t=t.toLowerCase();for(var r=0;r