• /home/barbar84/www/wp-inclu.../js/codemirr...
• File: codemirror.min.js
• Dòng [
22/
28]:
c(),a.parentNode.removeChild(b.getWrapperElement()),a.style.display="",a.form&&(Da(a.form,"submit",c),"function"==typeof a.form.submit&&(a.form.submit=e))}},a.style.display="none";var j=Pf(function(b){return a.parentNode.insertBefore(b,a.nextSibling)},b);return j}function gg(a){a.off=Da,a.on=Yg,a.wheelEventPixels=Kd,a.Doc=Eh,a.splitLines=$g,a.countColumn=l,a.findColumn=n,a.isWordChar=u,a.Pass=Mg,a.signal=Ea,a.Line=jh,a.changeEnd=Od,a.scrollbarModel=sh,a.Pos=J,a.cmpPos=K,a.modes=ch,a.mimeModes=dh,a.resolveMode=Ua,a.getMode=Va,a.modeExtensions=eh,a.extendMode=Wa,a.copyState=Xa,a.startState=Za,a.innerMode=Ya,a.commands=Mh,a.keyMap=Lh,a.keyName=jf,a.isModifierKey=gf,a.lookupKey=ff,a.normalizeKeyMap=ef,a.StringStream=fh,a.SharedTextMarker=Ch,a.TextMarker=Bh,a.LineWidget=zh,a.e_preventDefault=Ja,a.e_stopPropagation=Ka,a.e_stop=Ma,a.addClass=h,a.contains=f,a.rmClass=Gg,a.keyNames=Hh}var hg=navigator.userAgent,ig=navigator.platform,jg=/gecko\/\d/i.test(hg),kg=/MSIE \d/.test(hg),lg=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(hg),mg=/Edge\/(\d+)/.exec(hg),ng=kg||lg||mg,og=ng&&(kg?document.documentMode||6:+(mg||lg)[1]),pg=!mg&&/WebKit\//.test(hg),qg=pg&&/Qt\/\d+\.\d+/.test(hg),rg=!mg&&/Chrome\//.test(hg),sg=/Opera\//.test(hg),tg=/Apple Computer/.test(navigator.vendor),ug=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(hg),vg=/PhantomJS/.test(hg),wg=!mg&&/AppleWebKit/.test(hg)&&/Mobile\/\w+/.test(hg),xg=/Android/.test(hg),yg=wg||xg||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(hg),zg=wg||/Mac/.test(ig),Ag=/\bCrOS\b/.test(hg),Bg=/win/i.test(ig),Cg=sg&&hg.match(/Version\/(\d*\.\d*)/);Cg&&(Cg=Number(Cg[1])),Cg&&Cg>=15&&(sg=!1,pg=!0);var Dg,Eg=zg&&(qg||sg&&(null==Cg||Cg<12.11)),Fg=jg||ng&&og>=9,Gg=function(b,c){var d=b.className,e=a(c).exec(d);if(e){var f=d.slice(e.index+e[0].length);b.className=d.slice(0,e.index)+(f?e[1]+f:"")}};Dg=document.createRange?function(a,b,c,d){var e=document.createRange();return e.setEnd(d||a,c),e.setStart(a,b),e}:function(a,b,c){var d=document.body.createTextRange();try{d.moveToElementText(a.parentNode)}catch(e){return d}return d.collapse(!0),d.moveEnd("character",c),d.moveStart("character",b),d};var Hg=function(a){a.select()};wg?Hg=function(a){a.selectionStart=0,a.selectionEnd=a.value.length}:ng&&(Hg=function(a){try{a.select()}catch(b){}});var Ig=function(){this.id=null};Ig.prototype.set=function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)};var Jg,Kg,Lg=30,Mg={toString:function(){return"CodeMirror.Pass"}},Ng={scroll:!1},Og={origin:"*mouse"},Pg={origin:"+move"},Qg=[""],Rg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Sg=/[\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]/,Tg=!1,Ug=!1,Vg=null,Wg=function(){function a(a){return a<=247?c.charAt(a):1424<=a&&a<=1524?"R":1536<=a&&a<=1785?d.charAt(a-1536):1774<=a&&a<=2220?"r":8192<=a&&a<=8203?"w":8204==a?"b":"L"}function b(a,b,c){this.level=a,this.from=b,this.to=c}var c="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,g=/[LRr]/,h=/[Lb1n]/,i=/[1n]/;return function(c,d){var j="ltr"==d?"L":"R";if(0==c.length||"ltr"==d&&!e.test(c))return!1;for(var k=c.length,l=[],m=0;m<k;++m)l.push(a(c.charCodeAt(m)));for(var n=0,o=j;n<k;++n){var q=l[n];"m"==q?l[n]=o:o=q}for(var r=0,s=j;r<k;++r){var t=l[r];"1"==t&&"r"==s?l[r]="n":g.test(t)&&(s=t,"r"==t&&(l[r]="R"))}for(var u=1,v=l[0];u<k-1;++u){var w=l[u];"+"==w&&"1"==v&&"1"==l[u+1]?l[u]="1":","!=w||v!=l[u+1]||"1"!=v&&"n"!=v||(l[u]=v),v=w}for(var x=0;x<k;++x){var y=l[x];if(","==y)l[x]="N";else if("%"==y){var z=void 0;for(z=x+1;z<k&&"%"==l[z];++z);for(var A=x&&"!"==l[x-1]||z<k&&"1"==l[z]?"1":"N",B=x;B<z;++B)l[B]=A;x=z-1}}for(var C=0,D=j;C<k;++C){var E=l[C];"L"==D&&"1"==E?l[C]="L":g.test(E)&&(D=E)}for(var F=0;F<k;++F)if(f.test(l[F])){var G=void 0;for(G=F+1;G<k&&f.test(l[G]);++G);for(var H="L"==(F?l[F-1]:j),I="L"==(G<k?l[G]:j),J=H==I?H?"L":"R":j,K=F;K<G;++K)l[K]=J;F=G-1}for(var L,M=[],N=0;N<k;)if(h.test(l[N])){var O=N;for(++N;N<k&&h.test(l[N]);++N);M.push(new b(0,O,N))}else{var P=N,Q=M.length;for(++N;N<k&&"L"!=l[N];++N);for(var R=P;R<N;)if(i.test(l[R])){P<R&&M.splice(Q,0,new b(1,P,R));var S=R;for(++R;R<N&&i.test(l[R]);++R);M.splice(Q,0,new b(2,S,R)),P=R}else++R;P<N&&M.splice(Q,0,new b(1,P,N))}return 1==M[0].level&&(L=c.match(/^\s+/))&&(M[0].from=L[0].length,M.unshift(new b(0,0,L[0].length))),1==p(M).level&&(L=c.match(/\s+$/))&&(p(M).to-=L[0].length,M.push(new b(0,k-L[0].length,k))),"rtl"==d?M.reverse():M}}(),Xg=[],Yg=function(a,b,c){if(a.addEventListener)a.addEventListener(b,c,!1);else if(a.attachEvent)a.attachEvent("on"+b,c);else{var d=a._handlers||(a._handlers={});d[b]=(d[b]||Xg).concat(c)}},Zg=function(){if(ng&&og<9)return!1;var a=d("div");return"draggable"in a||"dragDrop"in a}(),$g=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;b<=d;){var e=a.indexOf("\n",b);e==-1&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");g!=-1?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},_g=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){var b;try{b=a.ownerDocument.selection.createRange()}catch(c){}return!(!b||b.parentElement()!=a)&&0!=b.compareEndPoints("StartToEnd",b)},ah=function(){var a=d("div");return"oncopy"in a||(a.setAttribute("oncopy","return;"),"function"==typeof a.oncopy)}(),bh=null,ch={},dh={},eh={},fh=function(a,b,c){this.pos=this.start=0,this.string=a,this.tabSize=b||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=c};fh.prototype.eol=function(){return this.pos>=this.string.length},fh.prototype.sol=function(){return this.pos==this.lineStart},fh.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},fh.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},fh.prototype.eat=function(a){var b,c=this.string.charAt(this.pos);if(b="string"==typeof a?c==a:c&&(a.test?a.test(c):a(c)))return++this.pos,c},fh.prototype.eatWhile=function(a){for(var b=this.pos;this.eat(a););return this.pos>b},fh.prototype.eatSpace=function(){for(var a=this,b=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++a.pos;return this.pos>b},fh.prototype.skipToEnd=function(){this.pos=this.string.length},fh.prototype.skipTo=function(a){var b=this.string.indexOf(a,this.pos);if(b>-1)return this.pos=b,!0},fh.prototype.backUp=function(a){this.pos-=a},fh.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=l(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?l(this.string,this.lineStart,this.tabSize):0)},fh.prototype.indentation=function(){return l(this.string,null,this.tabSize)-(this.lineStart?l(this.string,this.lineStart,this.tabSize):0)},fh.prototype.match=function(a,b,c){if("string"!=typeof a){var d=this.string.slice(this.pos).match(a);return d&&d.index>0?null:(d&&b!==!1&&(this.pos+=d[0].length),d)}var e=function(a){return c?a.toLowerCase():a},f=this.string.substr(this.pos,a.length);if(e(f)==e(a))return b!==!1&&(this.pos+=a.length),!0},fh.prototype.current=function(){return this.string.slice(this.start,this.pos)},fh.prototype.hideFirstChars=function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}},fh.prototype.lookAhead=function(a){var b=this.lineOracle;return b&&b.lookAhead(a)};var gh=function(a,b){this.state=a,this.lookAhead=b},hh=function(a,b,c,d){this.state=b,this.doc=a,this.line=c,this.maxLookAhead=d||0};hh.prototype.lookAhead=function(a){var b=this.doc.getLine(this.line+a);return null!=b&&a>this.maxLookAhead&&(this.maxLookAhead=a),b},hh.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},hh.fromSaved=function(a,b,c){return b instanceof gh?new hh(a,Xa(a.mode,b.state),c,b.lookAhead):new hh(a,Xa(a.mode,b),c)},hh.prototype.save=function(a){var b=a!==!1?Xa(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new gh(b,this.maxLookAhead):b};var ih=function(a,b,c){this.start=a.start,this.end=a.pos,this.string=a.current(),this.type=b||null,this.state=c},jh=function(a,b,c){this.text=a,da(this,b),this.height=c?c(this):1};jh.prototype.lineNo=function(){return F(this)},Ia(jh);var kh,lh={},mh={},nh=null,oh=null,ph={left:0,right:0,top:0,bottom:0},qh=function(a,b,c){this.cm=c;var e=this.vert=d("div",[d("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),f=this.horiz=d("div",[d("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a(e),a(f),Yg(e,"scroll",function(){e.clientHeight&&b(e.scrollTop,"vertical")}),Yg(f,"scroll",function(){f.clientWidth&&b(f.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,ng&&og<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};qh.prototype.update=function(a){var b=a.scrollWidth>a.clientWidth+1,c=a.scrollHeight>a.clientHeight+1,d=a.nativeBarWidth;if(c){this.vert.style.display="block",this.vert.style.bottom=b?d+"px":"0";var e=a.viewHeight-(b?d:0);this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+e)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(b){this.horiz.style.display="block",this.horiz.style.right=c?d+"px":"0",this.horiz.style.left=a.barLeft+"px";var f=a.viewWidth-a.barLeft-(c?d:0);this.horiz.firstChild.style.width=Math.max(0,a.scrollWidth-a.clientWidth+f)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&a.clientHeight>0&&(0==d&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:c?d:0,bottom:b?d:0}},qh.prototype.setScrollLeft=function(a){this.horiz.scrollLeft!=a&&(this.horiz.scrollLeft=a),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},qh.prototype.setScrollTop=function(a){this.vert.scrollTop!=a&&(this.vert.scrollTop=a),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},qh.prototype.zeroWidthHack=function(){var a=zg&&!ug?"12px":"18px";this.horiz.style.height=this.vert.style.width=a,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ig,this.disableVert=new Ig},qh.prototype.enableZeroWidthBar=function(a,b,c){function d(){var e=a.getBoundingClientRect(),f="vert"==c?document.elementFromPoint(e.right-1,(e.top+e.bottom)/2):document.elementFromPoint((e.right+e.left)/2,e.bottom-1);f!=a?a.style.pointerEvents="none":b.set(1e3,d)}a.style.pointerEvents="auto",b.set(1e3,d)},qh.prototype.clear=function(){var a=this.horiz.parentNode;a.removeChild(this.horiz),a.removeChild(this.vert)};var rh=function(){};rh.prototype.update=function(){return{bottom:0,right:0}},rh.prototype.setScrollLeft=function(){},rh.prototype.setScrollTop=function(){},rh.prototype.clear=function(){};var sh={"native":qh,"null":rh},th=0,uh=function(a,b,c){var d=a.display;this.viewport=b,this.visible=Mc(d,a.doc,b),this.editorIsHidden=!d.wrapper.offsetWidth,this.wrapperHeight=d.wrapper.clientHeight,this.wrapperWidth=d.wrapper.clientWidth,this.oldDisplayWidth=Sb(a),this.force=c,this.dims=uc(a),this.events=[]};uh.prototype.signal=function(a,b){Ha(a,b)&&this.events.push(arguments)},uh.prototype.finish=function(){for(var a=this,b=0;b<this.events.length;b++)Ea.apply(null,a.events[b])};var vh=0,wh=null;ng?wh=-.53:jg?wh=15:rg?wh=-.7:tg&&(wh=-1/3);var xh=function(a,b){this.ranges=a,this.primIndex=b};xh.prototype.primary=function(){return this.ranges[this.primIndex]},xh.prototype.equals=function(a){var b=this;if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return!1;for(var c=0;c<this.ranges.length;c++){var d=b.ranges[c],e=a.ranges[c];if(!L(d.anchor,e.anchor)||!L(d.head,e.head))return!1}return!0},xh.prototype.deepCopy=function(){for(var a=this,b=[],c=0;c<this.ranges.length;c++)b[c]=new yh(M(a.ranges[c].anchor),M(a.ranges[c].head));return new xh(b,this.primIndex)},xh.prototype.somethingSelected=function(){for(var a=this,b=0;b<this.ranges.length;b++)if(!a.ranges[b].empty())return!0;return!1},xh.prototype.contains=function(a,b){var c=this;b||(b=a);for(var d=0;d<this.ranges.length;d++){var e=c.ranges[d];if(K(b,e.from())>=0&&K(a,e.to())<=0)return d}return-1};var yh=function(a,b){this.anchor=a,this.head=b};yh.prototype.from=function(){return O(this.anchor,this.head)},yh.prototype.to=function(){return N(this.anchor,this.head)},yh.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Oe.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var c=this,d=a,e=a+b;d<e;++d){var f=c.lines[d];c.height-=f.height,kb(f),yb(f,"delete")}this.lines.splice(a,b)},collapse:function(a){a.push.apply(a,this.lines)},insertInner:function(a,b,c){var d=this;this.height+=c,this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(var e=0;e<b.length;++e)b[e].parent=d},iterN:function(a,b,c){for(var d=this,e=a+b;a<e;++a)if(c(d.lines[a]))return!0}},Pe.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){var c=this;this.size-=b;for(var d=0;d<this.children.length;++d){var e=c.children[d],f=e.chunkSize();if(a<f){var g=Math.min(b,f-a),h=e.height;if(e.removeInner(a,g),c.height-=h-e.height,f==g&&(c.children.splice(d--,1),e.parent=null),0==(b-=g))break;a=0}else a-=f}if(this.size-b<25&&(this.children.length>1||!(this.children[0]instanceof Oe))){var i=[];this.collapse(i),this.children=[new Oe(i)],this.children[0].parent=this}},collapse:function(a){for(var b=this,c=0;c<this.children.length;++c)b.children[c].collapse(a)},insertInner:function(a,b,c){var d=this;this.size+=b.length,this.height+=c;for(var e=0;e<this.children.length;++e){var f=d.children[e],g=f.chunkSize();if(a<=g){if(f.insertInner(a,b,c),f.lines&&f.lines.length>50){for(var h=f.lines.length%25+25,i=h;i<f.lines.length;){var j=new Oe(f.lines.slice(i,i+=25));f.height-=j.height,d.children.splice(++e,0,j),j.parent=d}f.lines=f.lines.slice(0,h),d.maybeSpill()}break}a-=g}},maybeSpill:function(){if(!(this.children.length<=10)){var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new Pe(b);if(a.parent){a.size-=c.size,a.height-=c.height;var d=m(a.parent.children,a);a.parent.children.splice(d+1,0,c)}else{var e=new Pe(a.children);e.parent=a,a.children=[e,c],a=e}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=this,e=0;e<this.children.length;++e){var f=d.children[e],g=f.chunkSize();if(a<g){var h=Math.min(b,g-a);if(f.iterN(a,h,c))return!0;if(0==(b-=h))break;a=0}else a-=g}}};var zh=function(a,b,c){var d=this;if(c)for(var e in c)c.hasOwnProperty(e)&&(d[e]=c[e]);this.doc=a,this.node=b};zh.prototype.clear=function(){var a=this,b=this.doc.cm,c=this.line.widgets,d=this.line,e=F(d);if(null!=e&&c){for(var f=0;f<c.length;++f)c[f]==a&&c.splice(f--,1);c.length||(d.widgets=null);var g=Mb(this);E(d,Math.max(0,d.height-g)),b&&(md(b,function(){Qe(b,d,-g),rd(b,e,"widget")}),yb(b,"lineWidgetCleared",b,this,e))}},zh.prototype.changed=function(){var a=this,b=this.height,c=this.doc.cm,d=this.line;this.height=null;var e=Mb(this)-b;e&&(E(d,d.height+e),c&&md(c,function(){c.curOp.forceUpdate=!0,Qe(c,d,e),yb(c,"lineWidgetChanged",c,a,F(d))}))},Ia(zh);var Ah=0,Bh=function(a,b){this.lines=[],this.type=b,this.doc=a,this.id=++Ah};Bh.prototype.clear=function(){var a=this;if(!this.explicitlyCleared){var b=this.doc.cm,c=b&&!b.curOp;if(c&&ed(b),Ha(this,"clear")){var d=this.find();d&&yb(this,"clear",d.from,d.to)}for(var e=null,f=null,g=0;g<this.lines.length;++g){var h=a.lines[g],i=W(h.markedSpans,a);b&&!a.collapsed?rd(b,F(h),"text"):b&&(null!=i.to&&(f=F(h)),null!=i.from&&(e=F(h))),h.markedSpans=X(h.markedSpans,i),null==i.from&&a.collapsed&&!qa(a.doc,h)&&b&&E(h,sc(b.display))}if(b&&this.collapsed&&!b.options.lineWrapping)for(var j=0;j<this.lines.length;++j){var k=la(a.lines[j]),l=ta(k);l>b.display.maxLineLength&&(b.display.maxLine=k,b.display.maxLineLength=l,b.display.maxLineChanged=!0)}null!=e&&b&&this.collapsed&&qd(b,e,f+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,b&&we(b.doc)),b&&yb(b,"markerCleared",b,this,e,f),c&&fd(b),this.parent&&this.parent.clear()}},Bh.prototype.find=function(a,b){var c=this;null==a&&"bookmark"==this.type&&(a=1);for(var d,e,f=0;f<this.lines.length;++f){var g=c.lines[f],h=W(g.markedSpans,c);if(null!=h.from&&(d=J(b?g:F(g),h.from),a==-1))return d;if(null!=h.to&&(e=J(b?g:F(g),h.to),1==a))return e}return d&&{from:d,to:e}},Bh.prototype.changed=function(){var a=this,b=this.find(-1,!0),c=this,d=this.doc.cm;b&&d&&md(d,function(){var e=b.line,f=F(b.line),g=Yb(d,f);if(g&&(dc(g),d.curOp.selectionChanged=d.curOp.forceUpdate=!0),d.curOp.updateMaxLine=!0,!qa(c.doc,e)&&null!=c.height){var h=c.height;c.height=null;var i=Mb(c)-h;i&&E(e,e.height+i)}yb(d,"markerChanged",d,a)})},Bh.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;b.maybeHiddenMarkers&&m(b.maybeHiddenMarkers,this)!=-1||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)},Bh.prototype.detachLine=function(a){if(this.lines.splice(m(this.lines,a),1),!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;(b.maybeHiddenMarkers||(b.maybeHiddenMarkers=[])).push(this)}},Ia(Bh);var Ch=function(a,b){var c=this;this.markers=a,this.primary=b;for(var d=0;d<a.length;++d)a[d].parent=c};Ch.prototype.clear=function(){var a=this;if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var b=0;b<this.markers.length;++b)a.markers[b].clear();yb(this,"clear")}},Ch.prototype.find=function(a,b){return this.primary.find(a,b)},Ia(Ch);var Dh=0,Eh=function(a,b,c,d,e){if(!(this instanceof Eh))return new Eh(a,b,c,d,e);null==c&&(c=0),Pe.call(this,[new Oe([new jh("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=c;var f=J(c,0);this.sel=Nd(f),this.history=new _d(null),this.id=++Dh,this.modeOption=b,this.lineSep=d,this.direction="rtl"==e?"rtl":"ltr",this.extend=!1,"string"==typeof a&&(a=this.splitLines(a)),Wd(this,{from:f,to:f,text:a}),te(this,Nd(f),Ng)};Eh.prototype=t(Pe.prototype,{constructor:Eh,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0;d<b.length;++d)c+=b[d].height;this.insertInner(a-this.first,b,c)},remove:function(a,b){this.removeInner(a-this.first,b)},getValue:function(a){var b=D(this,this.first,this.first+this.size);return a===!1?b:b.join(a||this.lineSeparator())},setValue:pd(function(a){var b=J(this.first,0),c=this.first+this.size-1;De(this,{from:b,to:J(c,B(this,c).text.length),text:this.splitLines(a),origin:"setValue",full:!0},!0),this.cm&&Vc(this.cm,0,0),te(this,Nd(b),Ng)}),replaceRange:function(a,b,c,d){b=Q(this,b),c=c?Q(this,c):b,Je(this,a,b,c,d)},getRange:function(a,b,c){var d=C(this,Q(this,a),Q(this,b));return c===!1?d:d.join(c||this.lineSeparator())},getLine:function(a){var b=this.getLineHandle(a);return b&&b.text},getLineHandle:function(a){if(H(this,a))return B(this,a)},getLineNumber:function(a){return F(a)},getLineHandleVisualStart:function(a){return"number"==typeof a&&(a=B(this,a)),la(a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return Q(this,a)},getCursor:function(a){var b,c=this.sel.primary();return b=null==a||"head"==a?c.head:"anchor"==a?c.anchor:"end"==a||"to"==a||a===!1?c.to():c.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:pd(function(a,b,c){qe(this,Q(this,"number"==typeof a?J(a,b||0):a),null,c)}),setSelection:pd(function(a,b,c){qe(this,Q(this,a),Q(this,b||a),c)}),extendSelection:pd(function(a,b,c){ne(this,Q(this,a),b&&Q(this,b),c)}),extendSelections:pd(function(a,b){oe(this,S(this,a),b)}),extendSelectionsBy:pd(function(a,b){var c=q(this.sel.ranges,a);oe(this,S(this,c),b)}),setSelections:pd(function(a,b,c){var d=this;if(a.length){for(var e=[],f=0;f<a.length;f++)e[f]=new yh(Q(d,a[f].anchor),Q(d,a[f].head));null==b&&(b=Math.min(a.length-1,this.sel.primIndex)),te(this,Md(e,b),c)}}),addSelection:pd(function(a,b,c){var d=this.sel.ranges.slice(0);d.push(new yh(Q(this,a),Q(this,b||a))),te(this,Md(d,d.length-1),c)}),getSelection:function(a){for(var b,c=this,d=this.sel.ranges,e=0;e<d.length;e++){var f=C(c,d[e].from(),d[e].to());b=b?b.concat(f):f}return a===!1?b:b.join(a||this.lineSeparator())},getSelections:function(a){for(var b=this,c=[],d=this.sel.ranges,e=0;e<d.length;e++){var f=C(b,d[e].from(),d[e].to());a!==!1&&(f=f.join(a||b.lineSeparator())),c[e]=f}return c},replaceSelection:function(a,b,c){for(var d=[],e=0;e<this.sel.ranges.length;e++)d[e]=a;this.replaceSelections(d,b,c||"+input")},replaceSelections:pd(function(a,b,c){for(var d=this,e=[],f=this.sel,g=0;g<f.ranges.length;g++){var h=f.ranges[g];e[g]={from:h.from(),to:h.to(),text:d.splitLines(a[g]),origin:c}}for(var i=b&&"end"!=b&&Sd(this,e,b),j=e.length-1;j>=0;j--)De(d,e[j]);i?se(this,i):this.cm&&Uc(this.cm)}),undo:pd(function(){Fe(this,"undo")}),redo:pd(function(){Fe(this,"redo")}),undoSelection:pd(function(){Fe(this,"undo",!0)}),redoSelection:pd(function(){Fe(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d<a.done.length;d++)a.done[d].ranges||++b;for(var e=0;e<a.undone.length;e++)a.undone[e].ranges||++c;return{undo:b,redo:c}},clearHistory:function(){this.history=new _d(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(a){return a&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(a){return this.history.generation==(a||this.cleanGeneration)},getHistory:function(){return{done:le(this.history.done),undone:le(this.history.undone)}},setHistory:function(a){var b=this.history=new _d(this.history.maxGeneration);b.done=le(a.done.slice(0),null,!0),b.undone=le(a.undone.slice(0),null,!0)},setGutterMarker:pd(function(a,b,c){return Ne(this,a,"gutter",function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&w(d)&&(a.gutterMarkers=null),!0})}),clearGutter:pd(function(a){var b=this;this.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&Ne(b,c,"gutter",function(){return c.gutterMarkers[a]=null,w(c.gutterMarkers)&&(c.gutterMarkers=null),!0})})}),lineInfo:function(a){var b;if("number"==typeof a){if(!H(this,a))return null;if(b=a,a=B(this,a),!a)return null}else if(b=F(a),null==b)return null;return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},addLineClass:pd(function(b,c,d){return Ne(this,b,"gutter"==c?"gutter":"class",function(b){var e="text"==c?"textClass":"background"==c?"bgClass":"gutter"==c?"gutterClass":"wrapClass";if(b[e]){if(a(d).test(b[e]))return!1;b[e]+=" "+d}else b[e]=d;return!0})}),removeLineClass:pd(function(b,c,d){return Ne(this,b,"gutter"==c?"gutter":"class",function(b){var e="text"==c?"textClass":"background"==c?"bgClass":"gutter"==c?"gutterClass":"wrapClass",f=b[e];if(!f)return!1;if(null==d)b[e]=null;else{var g=f.match(a(d));if(!g)return!1;var h=g.index+g[0].length;b[e]=f.slice(0,g.index)+(g.index&&h!=f.length?" ":"")+f.slice(h)||null}return!0})}),addLineWidget:pd(function(a,b,c){return Re(this,a,b,c)}),removeLineWidget:function(a){a.clear()},markText:function(a,b,c){return Se(this,Q(this,a),Q(this,b),c,c&&c.type||"range")},setBookmark:function(a,b){var c={replacedWith:b&&(null==b.nodeType?b.widget:b),insertLeft:b&&b.insertLeft,clearWhenEmpty:!1,shared:b&&b.shared,handleMouseEvents:b&&b.handleMouseEvents};return a=Q(this,a),Se(this,a,a,c,"bookmark")},findMarksAt:function(a){a=Q(this,a);var b=[],c=B(this,a.line).markedSpans;if(c)for(var d=0;d<c.length;++d){var e=c[d];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b,c){a=Q(this,a),b=Q(this,b);var d=[],e=a.line;return this.iter(a.line,b.line+1,function(f){var g=f.markedSpans;if(g)for(var h=0;h<g.length;h++){var i=g[h];null!=i.to&&e==a.line&&a.ch>=i.to||null==i.from&&e!=a.line||null!=i.from&&e==b.line&&i.from>=b.ch||c&&!c(i.marker)||d.push(i.marker.parent||i.marker)}++e}),d},getAllMarks:function(){var a=[];return this.iter(function(b){var c=b.markedSpans;if(c)for(var d=0;d<c.length;++d)null!=c[d].from&&a.push(c[d].marker)}),a},posFromIndex:function(a){var b,c=this.first,d=this.lineSeparator().length;return this.iter(function(e){var f=e.text.length+d;return f>a?(b=a,!0):(a-=f,void++c)}),Q(this,J(c,b))},indexFromPos:function(a){a=Q(this,a);var b=a.ch;if(a.line<this.first||a.ch<0)return 0;var c=this.lineSeparator().length;return this.iter(this.first,a.line,function(a){b+=a.text.length+c}),b},copy:function(a){var b=new Eh(D(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return b.scrollTop=this.scrollTop,b.scrollLeft=this.scrollLeft,b.sel=this.sel,b.extend=!1,a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory())),b},linkedDoc:function(a){a||(a={});var b=this.first,c=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from),null!=a.to&&a.to<c&&(c=a.to);var d=new Eh(D(this,b,c),a.mode||this.modeOption,b,this.lineSep,this.direction);return a.sharedHist&&(d.history=this.history),(this.linked||(this.linked=[])).push({doc:d,sharedHist:a.sharedHist}),d.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}],Ve(d,Ue(this)),d},unlinkDoc:function(a){var b=this;if(a instanceof Pf&&(a=a.doc),this.linked)for(var c=0;c<this.linked.length;++c){var d=b.linked[c];if(d.doc==a){b.linked.splice(c,1),a.unlinkDoc(b),We(Ue(b));break}}if(a.history==this.history){var e=[a.id];Xd(a,function(a){return e.push(a.id)},!0),a.history=new _d(null),a.history.done=le(this.history.done,e),a.history.undone=le(this.history.undone,e)}},iterLinkedDocs:function(a){Xd(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(a){return this.lineSep?a.split(this.lineSep):$g(a)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:pd(function(a){"rtl"!=a&&(a="ltr"),a!=this.direction&&(this.direction=a,this.iter(function(a){return a.order=null}),this.cm&&$d(this.cm))})}),Eh.prototype.eachLine=Eh.prototype.iter;for(var Fh=0,Gh=!1,Hh={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Ih=0;Ih<10;Ih++)Hh[Ih+48]=Hh[Ih+96]=String(Ih);for(var Jh=65;Jh<=90;Jh++)Hh[Jh]=String.fromCharCode(Jh);for(var Kh=1;Kh<=12;Kh++)Hh[Kh+111]=Hh[Kh+63235]="F"+Kh;var Lh={};Lh.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Lh.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Lh.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Lh.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Lh["default"]=zg?Lh.macDefault:Lh.pcDefault;var Mh={selectAll:Be,singleSelection:function(a){return a.setSelection(a.getCursor("anchor"),a.getCursor("head"),Ng)},killLine:function(a){return lf(a,function(b){if(b.empty()){var c=B(a.doc,b.head.line).text.length;