Seditio Source
Root |
./othercms/GetSimpleCMS-3.3.16/admin/template/js/codemirror/lib/codemirror-compressed.js
var CodeMirror=function(){function a(d,e){function Wb(a){return a>=0&&a<tb.size}function Yb(a){return v(tb,a)}function Zb(a,b){Kb=!0;var c=b-a.height;for(var d=a;d;d=d.parent)d.height+=c}function $b(a){var b={line:0,ch:0};oc(b,{line:tb.size-1,ch:Yb(tb.size-1).text.length},fb(a),b,b),Eb=!0}function _b(){var a=[];return tb.iter(0,tb.size,function(b){a.push(b.text)}),a.join("\n")}function ac(a){function j(a){var b=Hd(a,!0);if(b&&!Z(b,g)){vb||mc(),g=b,Pc(d,b),Eb=!1;var c=Ic();if(b.line>=c.to||b.line<c.from)h=setTimeout(Ud(function(){j(a)}),150)}}function k(a){clearTimeout(h);var b=Hd(a);b&&Pc(d,b),C(a),Ec(),Eb=!0,l(),i()}Oc(H(a,"shiftKey"));for(var b=F(a);b!=s;b=b.parentNode)if(b.parentNode==U&&b!=V)return;for(var b=F(a);b!=s;b=b.parentNode)if(b.parentNode==ib)return f.onGutterClick&&f.onGutterClick(Xb,db(ib.childNodes,b)+Nb,a),C(a);var d=Hd(a);switch(G(a)){case 3:L&&!c&&Id(a);return;case 2:d&&Sc(d.line,d.ch,!0);return}if(!d){F(a)==T&&C(a);return}vb||mc();var e=+(new Date);if(zb&&zb.time>e-400&&Z(zb.pos,d))return C(a),setTimeout(Ec,20),_c(d.line);if(yb&&yb.time>e-400&&Z(yb.pos,d))return zb={time:e,pos:d},C(a),$c(d);yb={time:e,pos:d};var g=d,h;if(f.dragDrop&&S&&!f.readOnly&&!Z(wb.from,wb.to)&&!$(d,wb.from)&&!$(wb.to,d)){P&&(jb.draggable=!0);var i=I(document,"mouseup",Ud(function(b){P&&(jb.draggable=!1),Bb=!1,i(),Math.abs(a.clientX-b.clientX)+Math.abs(a.clientY-b.clientY)<10&&(C(b),Sc(d.line,d.ch,!0),Ec())}),!0);Bb=!0,jb.dragDrop&&jb.dragDrop();return}C(a),Sc(d.line,d.ch,!0);var l=I(document,"mousemove",Ud(function(a){clearTimeout(h),C(a),!M&&!G(a)?k(a):j(a)}),!0),i=I(document,"mouseup",Ud(k),!0)}function bc(a){for(var b=F(a);b!=s;b=b.parentNode)if(b.parentNode==ib)return C(a);var c=Hd(a);if(!c)return;zb={time:+(new Date),pos:c},C(a),$c(c)}function cc(a){a.preventDefault();var b=Hd(a,!0),c=a.dataTransfer.files;if(!b||f.readOnly)return;if(c&&c.length&&window.FileReader&&window.File){function d(a,c){var d=new FileReader;d.onload=function(){g[c]=d.result,++h==e&&(b=Uc(b),Ud(function(){var a=tc(g.join(""),b,b);Pc(b,a)})())},d.readAsText(a)}if(f.onFileDrop&&!f.onFileDrop(Xb,a.dataTransfer))return;var e=c.length,g=Array(e),h=0;for(var i=0;i<e;++i)d(c[i],i)}else try{var g=a.dataTransfer.getData("Text");g&&Vd(function(){var a=wb.from,c=wb.to;Pc(b,b),Bb&&tc("",a,c),uc(g),Ec()})}catch(a){}}function dc(a){var b=xc();a.dataTransfer.setData("Text",b);if(L||Q){var c=document.createElement("img");c.scr="data:image/gif;base64,R0lGODdhAgACAIAAAAAAAP///ywAAAAAAgACAAACAoRRADs=",a.dataTransfer.setDragImage(c,0,0)}}function ec(a,b){if(typeof a=="string"){a=h[a];if(!a)return!1}var c=xb;try{f.readOnly&&(Db=!0),b&&(xb=null),a(Xb)}catch(d){if(d!=K)throw d;return!1}finally{xb=c,Db=!1}return!0}function fc(a){var b=j(f.keyMap),c=b.auto;clearTimeout(ic),c&&!l(a)&&(ic=setTimeout(function(){j(f.keyMap)==b&&(f.keyMap=c.call?c.call(null,Xb):c)},50));var d=hb[H(a,"keyCode")],e=!1;return d==null||a.altGraphKey?!1:(H(a,"altKey")&&(d="Alt-"+d),H(a,"ctrlKey")&&(d="Ctrl-"+d),H(a,"metaKey")&&(d="Cmd-"+d),H(a,"shiftKey")?e=k("Shift-"+d,f.extraKeys,f.keyMap,function(a){return ec(a,!0)})||k(d,f.extraKeys,f.keyMap,function(a){if(typeof a=="string"&&/^go[A-Z]/.test(a))return ec(a)}):e=k(d,f.extraKeys,f.keyMap,ec),e&&(C(a),M&&(a.oldKeyCode=a.keyCode,a.keyCode=0)),e)}function gc(a,b){var c=k("'"+b+"'",f.extraKeys,f.keyMap,ec);return c&&C(a),c}function jc(a){vb||mc(),M&&a.keyCode==27&&(a.returnValue=!1),yc&&Cc()&&(yc=!1);if(f.onKeyEvent&&f.onKeyEvent(Xb,B(a)))return;var b=H(a,"keyCode");Oc(b==16||H(a,"shiftKey"));var d=fc(a);window.opera&&(hc=d?b:null,!d&&b==88&&H(a,c?"metaKey":"ctrlKey")&&uc(""))}function kc(a){yc&&Cc();if(f.onKeyEvent&&f.onKeyEvent(Xb,B(a)))return;var b=H(a,"keyCode"),c=H(a,"charCode");if(window.opera&&b==hc){hc=null,C(a);return}if((window.opera&&!a.which||R)&&fc(a))return;var d=String.fromCharCode(c==null?b:c);f.electricChars&&sb.electricChars&&f.smartIndent&&!f.readOnly&&sb.electricChars.indexOf(d)>-1&&setTimeout(Ud(function(){bd(wb.to.line,"smart")}),75);if(gc(a,d))return;Ac()}function lc(a){if(f.onKeyEvent&&f.onKeyEvent(Xb,B(a)))return;H(a,"keyCode")==16&&(xb=null)}function mc(){if(f.readOnly=="nocursor")return;vb||(f.onFocus&&f.onFocus(Xb),vb=!0,s.className.search(/\bCodeMirror-focused\b/)==-1&&(s.className+=" CodeMirror-focused"),Jb||Dc(!0)),zc(),Jd()}function nc(){vb&&(f.onBlur&&f.onBlur(Xb),vb=!1,Qb&&Ud(function(){Qb&&(Qb(),Qb=null)})(),s.className=s.className.replace(" CodeMirror-focused","")),clearInterval(rb),setTimeout(function(){vb||(xb=null)},150)}function oc(a,b,c,d,e){if(Db)return;if(Ub){var g=[];tb.iter(a.line,b.line+1,function(a){g.push(a.text)}),Ub.addChange(a.line,c.length,g);while(Ub.done.length>f.undoDepth)Ub.done.shift()}sc(a,b,c,d,e)}function pc(a,b){if(!a.length)return;var c=a.pop(),d=[];for(var e=c.length-1;e>=0;e-=1){var f=c[e],g=[],h=f.start+f.added;tb.iter(f.start,h,function(a){g.push(a.text)}),d.push({start:f.start,added:f.old.length,old:g});var i=Uc({line:f.start+f.old.length-1,ch:cb(g[g.length-1],f.old[f.old.length-1])});sc({line:f.start,ch:0},{line:h-1,ch:Yb(h-1).text.length},f.old,i,i)}Eb=!0,b.push(d)}function qc(){pc(Ub.done,Ub.undone)}function rc(){pc(Ub.undone,Ub.done)}function sc(a,b,c,d,e){function y(a){return a<=Math.min(b.line,b.line+s)?a:a+s}if(Db)return;var g=!1,h=Rb.length;f.lineWrapping||tb.iter(a.line,b.line+1,function(a){if(a.text.length==h)return g=!0,!0});if(a.line!=b.line||c.length>1)Kb=!0;var i=b.line-a.line,j=Yb(a.line),k=Yb(b.line);if(a.ch==0&&b.ch==0&&c[c.length-1]==""){var l=[],m=null;a.line?(m=Yb(a.line-1),m.fixMarkEnds(k)):k.fixMarkStarts();for(var n=0,o=c.length-1;n<o;++n)l.push(r.inheritMarks(c[n],m));i&&tb.remove(a.line,i,Lb),l.length&&tb.insert(a.line,l)}else if(j==k)if(c.length==1)j.replace(a.ch,b.ch,c[0]);else{k=j.split(b.ch,c[c.length-1]),j.replace(a.ch,null,c[0]),j.fixMarkEnds(k);var l=[];for(var n=1,o=c.length-1;n<o;++n)l.push(r.inheritMarks(c[n],j));l.push(k),tb.insert(a.line+1,l)}else if(c.length==1)j.replace(a.ch,null,c[0]),k.replace(null,b.ch,""),j.append(k),tb.remove(a.line+1,i,Lb);else{var l=[];j.replace(a.ch,null,c[0]),k.replace(null,b.ch,c[c.length-1]),j.fixMarkEnds(k);for(var n=1,o=c.length-1;n<o;++n)l.push(r.inheritMarks(c[n],j));i>1&&tb.remove(a.line+1,i-1,Lb),tb.insert(a.line+1,l)}if(f.lineWrapping){var p=Math.max(5,T.clientWidth/Ed()-3);tb.iter(a.line,a.line+c.length,function(a){if(a.hidden)return;var b=Math.ceil(a.text.length/p)||1;b!=a.height&&Zb(a,b)})}else tb.iter(a.line,n+c.length,function(a){var b=a.text;b.length>h&&(Rb=b,h=b.length,Sb=null,g=!1)}),g&&(h=0,Rb="",Sb=null,tb.iter(0,tb.size,function(a){var b=a.text;b.length>h&&(h=b.length,Rb=b)}));var q=[],s=c.length-i-1;for(var n=0,t=ub.length;n<t;++n){var u=ub[n];u<a.line?q.push(u):u>b.line&&q.push(u+s)}var v=a.line+Math.min(c.length,500);Od(a.line,v),q.push(v),ub=q,Qd(100),Gb.push({from:a.line,to:b.line+1,diff:s});var w={from:a,to:b,text:c};if(Hb){for(var x=Hb;x.next;x=x.next);x.next=w}else Hb=w;Qc(d,e,y(wb.from.line),y(wb.to.line)),T.clientHeight&&(U.style.height=tb.height*Bd()+2*Fd()+"px")}function tc(a,b,c){function d(d){if($(d,b))return d;if(!$(c,d))return e;var f=d.line+a.length-(c.line-b.line)-1,g=d.ch;return d.line==c.line&&(g+=a[a.length-1].length-(c.ch-(c.line==b.line?b.ch:0))),{line:f,ch:g}}b=Uc(b),c?c=Uc(c):c=b,a=fb(a);var e;return vc(a,b,c,function(a){return e=a,{from:d(wb.from),to:d(wb.to)}}),e}function uc(a,b){vc(fb(a),wb.from,wb.to,function(a){return b=="end"?{from:a,to:a}:b=="start"?{from:wb.from,to:wb.from}:{from:wb.from,to:a}})}function vc(a,b,c,d){var e=a.length==1?a[0].length+b.ch:a[a.length-1].length,f=d({line:b.line+a.length-1,ch:e});oc(b,c,a,f.from,f.to)}function wc(a,b){var c=a.line,d=b.line;if(c==d)return Yb(c).text.slice(a.ch,b.ch);var e=[Yb(c).text.slice(a.ch)];return tb.iter(c+1,d,function(a){e.push(a.text)}),e.push(Yb(d).text.slice(0,b.ch)),e.join("\n")}function xc(){return wc(wb.from,wb.to)}function zc(){if(yc)return;pb.set(f.pollInterval,function(){Rd(),Cc(),vb&&zc(),Sd()})}function Ac(){function b(){Rd();var c=Cc();!c&&!a?(a=!0,pb.set(60,b)):(yc=!1,zc()),Sd()}var a=!1;yc=!0,pb.set(20,b)}function Cc(){if(Jb||!vb||gb(D)||f.readOnly)return!1;var a=D.value;if(a==Bc)return!1;xb=null;var b=0,c=Math.min(Bc.length,a.length);while(b<c&&Bc[b]==a[b])++b;return b<Bc.length?wb.from={line:wb.from.line,ch:wb.from.ch-(Bc.length-b)}:Cb&&Z(wb.from,wb.to)&&(wb.to={line:wb.to.line,ch:Math.min(Yb(wb.to.line).text.length,wb.to.ch+(a.length-b))}),uc(a.slice(b),"end"),Bc=a,!0}function Dc(a){Z(wb.from,wb.to)?a&&(Bc=D.value=""):(Bc="",D.value=xc(),Y(D))}function Ec(){f.readOnly!="nocursor"&&D.focus()}function Fc(){if(!lb.getBoundingClientRect)return;var a=lb.getBoundingClientRect();if(M&&a.top==a.bottom)return;var b=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(a.top<0||a.bottom>b)&&lb.scrollIntoView()}function Gc(){var a=vd(wb.inverted?wb.from:wb.to),b=f.lineWrapping?Math.min(a.x,jb.offsetWidth):a.x;return Hc(b,a.y,b,a.yBot)}function Hc(a,b,c,d){var e=Gd(),g=Fd();b+=g,d+=g,a+=e,c+=e;var h=T.clientHeight,i=T.scrollTop,j=!1,k=!0;b<i?(T.scrollTop=Math.max(0,b),j=!0):d>i+h&&(T.scrollTop=d-h,j=!0);var l=T.clientWidth,m=T.scrollLeft,n=f.fixedGutter?ab.clientWidth:0,o=a<n+e+10;return a<m+n||o?(o&&(a=0),T.scrollLeft=Math.max(0,a-10-n),j=!0):c>l+m-3&&(T.scrollLeft=c+10-l,j=!0,c>U.clientWidth&&(k=!1)),j&&f.onScroll&&f.onScroll(Xb),k}function Ic(){var a=Bd(),b=T.scrollTop-Fd(),c=Math.max(0,Math.floor(b/a)),d=Math.ceil((b+T.clientHeight)/a);return{from:x(tb,c),to:x(tb,d)}}function Jc(a,b){function n(){Sb=T.clientWidth;var a=nb.firstChild,b=!1;return tb.iter(Nb,Ob,function(c){if(!c.hidden){var d=Math.round(a.offsetHeight/k)||1;c.height!=d&&(Zb(c,d),Kb=b=!0)}a=a.nextSibling}),b&&(U.style.height=tb.height*k+2*Fd()+"px"),b}if(!T.clientWidth){Nb=Ob=Mb=0;return}var c=Ic();if(a!==!0&&a.length==0&&c.from>Nb&&c.to<Ob)return;var d=Math.max(c.from-100,0),e=Math.min(tb.size,c.to+100);Nb<d&&d-Nb<20&&(d=Nb),Ob>e&&Ob-e<20&&(e=Math.min(tb.size,Ob));var g=a===!0?[]:Kc([{from:Nb,to:Ob,domStart:0}],a),h=0;for(var i=0;i<g.length;++i){var j=g[i];j.from<d&&(j.domStart+=d-j.from,j.from=d),j.to>e&&(j.to=e),j.from>=j.to?g.splice(i--,1):h+=j.to-j.from}if(h==e-d&&d==Nb&&e==Ob)return;g.sort(function(a,b){return a.domStart-b.domStart});var k=Bd(),l=ab.style.display;nb.style.display="none",Lc(d,e,g),nb.style.display=ab.style.display="";var m=d!=Nb||e!=Ob||Pb!=T.clientHeight+k;m&&(Pb=T.clientHeight+k),Nb=d,Ob=e,Mb=y(tb,d),V.style.top=Mb*k+"px",T.clientHeight&&(U.style.height=tb.height*k+2*Fd()+"px");if(nb.childNodes.length!=Ob-Nb)throw new Error("BAD PATCH! "+JSON.stringify(g)+" size="+(Ob-Nb)+" nodes="+nb.childNodes.length);return f.lineWrapping?n():(Sb==null&&(Sb=rd(Rb)),Sb>T.clientWidth?(jb.style.width=Sb+"px",U.style.width="",U.style.width=T.scrollWidth+"px"):jb.style.width=U.style.width=""),ab.style.display=l,(m||Kb)&&Mc()&&f.lineWrapping&&n()&&Mc(),Nc(),!b&&f.onUpdate&&f.onUpdate(Xb),!0}function Kc(a,b){for(var c=0,d=b.length||0;c<d;++c){var e=b[c],f=[],g=e.diff||0;for(var h=0,i=a.length;h<i;++h){var j=a[h];e.to<=j.from&&e.diff?f.push({from:j.from+g,to:j.to+g,domStart:j.domStart}):e.to<=j.from||e.from>=j.to?f.push(j):(e.from>j.from&&f.push({from:j.from,to:e.from,domStart:j.domStart}),e.to<j.to&&f.push({from:e.to+g,to:j.to+g,domStart:j.domStart+(e.to-j.from)}))}a=f}return a}function Lc(a,b,c){if(!c.length)nb.innerHTML="";else{function d(a){var b=a.nextSibling;return a.parentNode.removeChild(a),b}var e=0,f=nb.firstChild,g;for(var h=0;h<c.length;++h){var i=c[h];while(i.domStart>e)f=d(f),e++;for(var j=0,k=i.to-i.from;j<k;++j)f=f.nextSibling,e++}while(f)f=d(f)}var l=c.shift(),f=nb.firstChild,j=a,m=document.createElement("div");tb.iter(a,b,function(a){l&&l.to==j&&(l=c.shift());if(!l||l.from>j){if(a.hidden)var b=m.innerHTML="<pre></pre>";else{var b="<pre"+(a.className?' class="'+a.className+'"':"")+">"+a.getHTML(fd)+"</pre>";a.bgClassName&&(b='<div style="position: relative"><pre class="'+a.bgClassName+'" style="position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2">&#160;</pre>'+b+"</div>")}m.innerHTML=b,nb.insertBefore(m.firstChild,f)}else f=f.nextSibling;++j})}function Mc(){if(!f.gutter&&!f.lineNumbers)return;var a=V.offsetHeight,b=T.clientHeight;ab.style.height=(a-b<2?b:a)+"px";var c=[],d=Nb,e;tb.iter(Nb,Math.max(Ob,Nb+1),function(a){if(a.hidden)c.push("<pre></pre>");else{var b=a.gutterMarker,g=f.lineNumbers?d+f.firstLineNumber:null;b&&b.text?g=b.text.replace("%N%",g!=null?g:""):g==null&&(g="\u00a0"),c.push(b&&b.style?'<pre class="'+b.style+'">':"<pre>",g);for(var h=1;h<a.height;++h)c.push("<br/>&#160;");c.push("</pre>"),b||(e=d)}++d}),ab.style.display="none",ib.innerHTML=c.join("");if(e!=null){var g=ib.childNodes[e-Nb],h=String(tb.size).length,i=X(g),j="";while(i.length+j.length<h)j+="\u00a0";j&&g.insertBefore(document.createTextNode(j),g.firstChild)}ab.style.display="";var k=Math.abs((parseInt(jb.style.marginLeft)||0)-ab.offsetWidth)>2;return jb.style.marginLeft=ab.offsetWidth+"px",Kb=!1,k}function Nc(){var a=Z(wb.from,wb.to),b=vd(wb.from,!0),c=a?b:vd(wb.to,!0),d=wb.inverted?b:c,e=Bd(),g=W(s),h=W(nb);A.style.top=Math.max(0,Math.min(T.offsetHeight,d.y+h.top-g.top))+"px",A.style.left=Math.max(0,Math.min(T.offsetWidth,d.x+h.left-g.left))+"px";if(a)lb.style.top=d.y+"px",lb.style.left=(f.lineWrapping?Math.min(d.x,jb.offsetWidth):d.x)+"px",lb.style.display="",mb.style.display="none";else{var i=b.y==c.y,j="",k=jb.clientWidth||jb.offsetWidth,l=jb.clientHeight||jb.offsetHeight;function m(a,b,c,d){var e=O?"width: "+(c?k-c-a:k)+"px":"right: "+c+"px";j+='<div class="CodeMirror-selected" style="position: absolute; left: '+a+"px; top: "+b+"px; "+e+"; height: "+d+'px"></div>'}if(wb.from.ch&&b.y>=0){var n=i?k-c.x:0;m(b.x,b.y,n,e)}var o=Math.max(0,b.y+(wb.from.ch?e:0)),p=Math.min(c.y,l)-o;p>.2*e&&m(0,o,0,p),(!i||!wb.from.ch)&&c.y<l-.5*e&&m(0,c.y,k-c.x,e),mb.innerHTML=j,lb.style.display="none",mb.style.display=""}}function Oc(a){a?xb=xb||(wb.inverted?wb.to:wb.from):xb=null}function Pc(a,b){var c=xb&&Uc(xb);c&&($(c,a)?a=c:$(b,c)&&(b=c)),Qc(a,b),Fb=!0}function Qc(a,b,c,d){Yc=null,c==null&&(c=wb.from.line,d=wb.to.line);if(Z(wb.from,a)&&Z(wb.to,b))return;if($(b,a)){var e=b;b=a,a=e}if(a.line!=c){var g=Rc(a,c,wb.from.ch);g?a=g:pd(a.line,!1)}b.line!=d&&(b=Rc(b,d,wb.to.ch)),Z(a,b)?wb.inverted=!1:Z(a,wb.to)?wb.inverted=!1:Z(b,wb.from)&&(wb.inverted=!0);if(f.autoClearEmptyLines&&Z(wb.from,wb.to)){var h=wb.inverted?a:b;if(h.line!=wb.from.line&&wb.from.line<tb.size){var i=Yb(wb.from.line);/^\s+$/.test(i.text)&&setTimeout(Ud(function(){if(i.parent&&/^\s+$/.test(i.text)){var a=w(i);tc("",{line:a,ch:0},{line:a,ch:i.text.length})}},10))}}wb.from=a,wb.to=b,Ib=!0}function Rc(a,b,c){function d(b){var d=a.line+b,e=b==1?tb.size:-1;while(d!=e){var g=Yb(d);if(!g.hidden){var h=a.ch;if(f||h>c||h>g.text.length)h=g.text.length;return{line:d,ch:h}}d+=b}}var e=Yb(a.line),f=a.ch==e.text.length&&a.ch!=c;return e.hidden?a.line>=b?d(1)||d(-1):d(-1)||d(1):a}function Sc(a,b,c){var d=Uc({line:a,ch:b||0});(c?Pc:Qc)(d,d)}function Tc(a){return Math.max(0,Math.min(a,tb.size-1))}function Uc(a){if(a.line<0)return{line:0,ch:0};if(a.line>=tb.size)return{line:tb.size-1,ch:Yb(tb.size-1).text.length};var b=a.ch,c=Yb(a.line).text.length;return b==null||b>c?{line:a.line,ch:c}:b<0?{line:a.line,ch:0}:a}function Vc(a,b){function g(){for(var b=d+a,c=a<0?-1:tb.size;b!=c;b+=a){var e=Yb(b);if(!e.hidden)return d=b,f=e,!0}}function h(b){if(e==(a<0?0:f.text.length)){if(!!b||!g())return!1;e=a<0?f.text.length:0}else e+=a;return!0}var c=wb.inverted?wb.from:wb.to,d=c.line,e=c.ch,f=Yb(d);if(b=="char")h();else if(b=="column")h(!0);else if(b=="word"){var i=!1;for(;;){if(a<0&&!h())break;if(eb(f.text.charAt(e)))i=!0;else if(i){a<0&&(a=1,h());break}if(a>0&&!h())break}}return{line:d,ch:e}}function Wc(a,b){var c=a<0?wb.from:wb.to;if(xb||Z(wb.from,wb.to))c=Vc(a,b);Sc(c.line,c.ch,!0)}function Xc(a,b){Z(wb.from,wb.to)?a<0?tc("",Vc(a,b),wb.to):tc("",wb.from,Vc(a,b)):tc("",wb.from,wb.to),Fb=!0}function Zc(a,b){var c=0,d=vd(wb.inverted?wb.from:wb.to,!0);Yc!=null&&(d.x=Yc),b=="page"?c=Math.min(T.clientHeight,window.innerHeight||document.documentElement.clientHeight):b=="line"&&(c=Bd());var e=wd(d.x,d.y+c*a+2);b=="page"&&(T.scrollTop+=vd(e,!0).y-d.y),Sc(e.line,e.ch,!0),Yc=d.x}function $c(a){var b=Yb(a.line).text,c=a.ch,d=a.ch;while(c>0&&eb(b.charAt(c-1)))--c;while(d<b.length&&eb(b.charAt(d)))++d;Pc({line:a.line,ch:c},{line:a.line,ch:d})}function _c(a){Pc({line:a,ch:0},Uc({line:a+1,ch:0}))}function ad(a){if(Z(wb.from,wb.to))return bd(wb.from.line,a);var b=wb.to.line-(wb.to.ch?0:1);for(var c=wb.from.line;c<=b;++c)bd(c,a)}function bd(a,b){b||(b="add");if(b=="smart")if(!sb.indent)b="prev";else var c=Nd(a);var d=Yb(a),e=d.indentation(f.tabSize),g=d.text.match(/^\s*/)[0],h;b=="prev"?a?h=Yb(a-1).indentation(f.tabSize):h=0:b=="smart"?h=sb.indent(c,d.text.slice(g.length),d.text):b=="add"?h=e+f.indentUnit:b=="subtract"&&(h=e-f.indentUnit),h=Math.max(0,h);var i=h-e;if(!i){if(wb.from.line!=a&&wb.to.line!=a)return;var j=g}else{var j="",k=0;if(f.indentWithTabs)for(var l=Math.floor(h/f.tabSize);l;--l)k+=f.tabSize,j+=" ";while(k<h)++k,j+=" "}tc(j,{line:a,ch:0},{line:a,ch:g.length})}function cd(){sb=a.getMode(f,f.mode),tb.iter(0,tb.size,function(a){a.stateAfter=null}),ub=[0],Qd()}function dd(){var a=f.gutter||f.lineNumbers;ab.style.display=a?"":"none",a?Kb=!0:nb.parentNode.style.marginLeft=0}function ed(a,b){if(f.lineWrapping){s.className+=" CodeMirror-wrap";var c=T.clientWidth/Ed()-3;tb.iter(0,tb.size,function(a){if(a.hidden)return;var b=Math.ceil(a.text.length/c)||1;b!=1&&Zb(a,b)}),jb.style.width=U.style.width=""}else s.className=s.className.replace(" CodeMirror-wrap",""),Sb=null,Rb="",tb.iter(0,tb.size,function(a){a.height!=1&&!a.hidden&&Zb(a,1),a.text.length>Rb.length&&(Rb=a.text)});Gb.push({from:0,to:tb.size})}function fd(a){var b=f.tabSize-a%f.tabSize,c=Tb[b];if(c)return c;for(var d='<span class="cm-tab">',e=0;e<b;++e)d+=" ";return Tb[b]={html:d+"</span>",width:b}}function gd(){T.className=T.className.replace(/\s*cm-s-\S+/g,"")+f.theme.replace(/(^|\s)\s*/g," cm-s-")}function hd(){this.set=[]}function id(a,b,c){function e(a,b,c,e){Yb(a).addMark(new p(b,c,e,d))}a=Uc(a),b=Uc(b);var d=new hd;if(!$(a,b))return d;if(a.line==b.line)e(a.line,a.ch,b.ch,c);else{e(a.line,a.ch,null,c);for(var f=a.line+1,g=b.line;f<g;++f)e(f,null,null,c);e(b.line,null,b.ch,c)}return Gb.push({from:a.line,to:b.line+1}),d}function jd(a){a=Uc(a);var b=new q(a.ch);return Yb(a.line).addMark(b),b}function kd(a){a=Uc(a);var b=[],c=Yb(a.line).marked;if(!c)return b;for(var d=0,e=c.length;d<e;++d){var f=c[d];(f.from==null||f.from<=a.ch)&&(f.to==null||f.to>=a.ch)&&b.push(f.marker||f)}return b}function ld(a,b,c){return typeof a=="number"&&(a=Yb(Tc(a))),a.gutterMarker={text:b,style:c},Kb=!0,a}function md(a){typeof a=="number"&&(a=Yb(Tc(a))),a.gutterMarker=null,Kb=!0}function nd(a,b){var c=a,d=a;return typeof a=="number"?d=Yb(Tc(a)):c=w(a),c==null?null:b(d,c)?(Gb.push({from:c,to:c+1}),d):null}function od(a,b,c){return nd(a,function(a){if(a.className!=b||a.bgClassName!=c)return a.className=b,a.bgClassName=c,!0})}function pd(a,b){return nd(a,function(a,c){if(a.hidden!=b){a.hidden=b,Zb(a,b?0:1);var d=wb.from.line,e=wb.to.line;if(b&&(d==c||e==c)){var f=d==c?Rc({line:d,ch:0},d,0):wb.from,g=e==c?Rc({line:e,ch:0},e,0):wb.to;if(!g)return;Qc(f,g)}return Kb=!0}})}function qd(a){if(typeof a=="number"){if(!Wb(a))return null;var b=a;a=Yb(a);if(!a)return null}else{var b=w(a);if(b==null)return null}var c=a.gutterMarker;return{line:b,handle:a,text:a.text,markerText:c&&c.text,markerClass:c&&c.style,lineClass:a.className,bgClass:a.bgClassName}}function rd(a){return kb.innerHTML="<pre><span>x</span></pre>",kb.firstChild.firstChild.firstChild.nodeValue=a,kb.firstChild.firstChild.offsetWidth||10}function sd(a,b){function e(a){return kb.innerHTML="<pre><span>"+c.getHTML(fd,a)+"</span></pre>",kb.firstChild.firstChild.offsetWidth}if(b<=0)return 0;var c=Yb(a),d=c.text,f=0,g=0,h=d.length,i,j=Math.min(h,Math.ceil(b/Ed()));for(;;){var k=e(j);if(!(k<=b&&j<h)){i=k,h=j;break}j=Math.min(h,Math.ceil(j*1.2))}if(b>i)return h;j=Math.floor(h*.8),k=e(j),k<b&&(f=j,g=k);for(;;){if(h-f<=1)return i-b>b-g?f:h;var l=Math.ceil((f+h)/2),m=e(l);m>b?(h=l,i=m):(f=l,g=m)}}function ud(a,b){if(b==0)return{top:0,left:0};var c="";if(f.lineWrapping){var d=a.text.indexOf(" ",b+6);c=bb(a.text.slice(b+1,d<0?a.text.length:d+(M?5:0)))}kb.innerHTML="<pre>"+a.getHTML(fd,b)+'<span id="CodeMirror-temp-'+td+'">'+bb(a.text.charAt(b)||" ")+"</span>"+c+"</pre>";var e=document.getElementById("CodeMirror-temp-"+td),g=e.offsetTop,h=e.offsetLeft;if(M&&g==0&&h==0){var i=document.createElement("span");i.innerHTML="x",e.parentNode.insertBefore(i,e.nextSibling),g=i.offsetTop}return{top:g,left:h}}function vd(a,b){var c,d=Bd(),e=d*(y(tb,a.line)-(b?Mb:0));if(a.ch==0)c=0;else{var g=ud(Yb(a.line),a.ch);c=g.left,f.lineWrapping&&(e+=Math.max(0,g.top))}return{x:c,y:e,yBot:e+d}}function wd(a,b){function l(a){var b=ud(h,a);if(j){var d=Math.round(b.top/c);return Math.max(0,b.left+(d-k)*T.clientWidth)}return b.left}b<0&&(b=0);var c=Bd(),d=Ed(),e=Mb+Math.floor(b/c),g=x(tb,e);if(g>=tb.size)return{line:tb.size-1,ch:Yb(tb.size-1).text.length};var h=Yb(g),i=h.text,j=f.lineWrapping,k=j?e-y(tb,g):0;if(a<=0&&k==0)return{line:g,ch:0};var m=0,n=0,o=i.length,p,q=Math.min(o,Math.ceil((a+k*T.clientWidth*.9)/d));for(;;){var r=l(q);if(!(r<=a&&q<o)){p=r,o=q;break}q=Math.min(o,Math.ceil(q*1.2))}if(a>p)return{line:g,ch:o};q=Math.floor(o*.8),r=l(q),r<a&&(m=q,n=r);for(;;){if(o-m<=1)return{line:g,ch:p-a>a-n?m:o};var s=Math.ceil((m+o)/2),t=l(s);t>a?(o=s,p=t):(m=s,n=t)}}function xd(a){var b=vd(a,!0),c=W(jb);return{x:c.left+b.x,y:c.top+b.y,yBot:c.top+b.yBot}}function Bd(){if(Ad==null){Ad="<pre>";for(var a=0;a<49;++a)Ad+="x<br/>";Ad+="x</pre>"}var b=nb.clientHeight;return b==zd?yd:(zd=b,kb.innerHTML=Ad,yd=kb.firstChild.offsetHeight/50||1,kb.innerHTML="",yd)}function Ed(){return T.clientWidth==Dd?Cd:(Dd=T.clientWidth,Cd=rd("x"))}function Fd(){return jb.offsetTop}function Gd(){return jb.offsetLeft}function Hd(a,b){var c=W(T,!0),d,e;try{d=a.clientX,e=a.clientY}catch(a){return null}if(!b&&(d-c.left>T.clientWidth||e-c.top>T.clientHeight))return null;var f=W(jb,!0);return wd(d-f.left,e-f.top)}function Id(a){function f(){var a=fb(D.value).join("\n");a!=e&&Ud(uc)(a,"end"),A.style.position="relative",D.style.cssText=d,N&&(T.scrollTop=c),Jb=!1,Dc(!0),zc()}var b=Hd(a),c=T.scrollTop;if(!b||window.opera)return;(Z(wb.from,wb.to)||$(b,wb.from)||!$(b,wb.to))&&Ud(Sc)(b.line,b.ch);var d=D.style.cssText;A.style.position="absolute",D.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(a.clientY-5)+"px; left: "+(a.clientX-5)+"px; z-index: 1000; background: white; "+"border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Jb=!0;var e=D.value=xc();Ec(),Y(D);if(L){E(a);var g=I(window,"mouseup",function(){g(),setTimeout(f,20)},!0)}else setTimeout(f,50)}function Jd(){clearInterval(rb);var a=!0;lb.style.visibility="",rb=setInterval(function(){lb.style.visibility=(a=!a)?"":"hidden"},650)}function Ld(a){function p(a,b,c){if(!a.text)return;var d=a.styles,e=g?0:a.text.length-1,f;for(var i=g?0:d.length-2,j=g?d.length:-2;i!=j;i+=2*h){var k=d[i];if(d[i+1]!=null&&d[i+1]!=m){e+=h*k.length;continue}for(var l=g?0:k.length-1,p=g?k.length:-1;l!=p;l+=h,e+=h)if(e>=b&&e<c&&o.test(f=k.charAt(l))){var q=Kd[f];if(q.charAt(1)==">"==g)n.push(f);else{if(n.pop()!=q.charAt(0))return{pos:e,match:!1};if(!n.length)return{pos:e,match:!0}}}}}var b=wb.inverted?wb.from:wb.to,c=Yb(b.line),d=b.ch-1,e=d>=0&&Kd[c.text.charAt(d)]||Kd[c.text.charAt(++d)];if(!e)return;var f=e.charAt(0),g=e.charAt(1)==">",h=g?1:-1,i=c.styles;for(var j=d+1,k=0,l=i.length;k<l;k+=2)if((j-=i[k].length)<=0){var m=i[k+1];break}var n=[c.text.charAt(d)],o=/[(){}[\]]/;for(var k=b.line,l=g?Math.min(k+100,tb.size):Math.max(-1,k-100);k!=l;k+=h){var c=Yb(k),q=k==b.line,r=p(c,q&&g?d+1:0,q&&!g?d:c.text.length);if(r)break}r||(r={pos:null,match:!1});var m=r.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",s=id({line:b.line,ch:d},{line:b.line,ch:d+1},m),t=r.pos!=null&&id({line:k,ch:r.pos},{line:k,ch:r.pos+1},m),u=Ud(function(){s.clear(),t&&t.clear()});a?setTimeout(u,800):Qb=u}function Md(a){var b,c;for(var d=a,e=a-40;d>e;--d){if(d==0)return 0;var g=Yb(d-1);if(g.stateAfter)return d;var h=g.indentation(f.tabSize);if(c==null||b>h)c=d-1,b=h}return c}function Nd(a){var b=Md(a),c=b&&Yb(b-1).stateAfter;return c?c=m(sb,c):c=n(sb),tb.iter(b,a,function(a){a.highlight(sb,c,f.tabSize),a.stateAfter=m(sb,c)}),b<a&&Gb.push({from:b,to:a}),a<tb.size&&!Yb(a).stateAfter&&ub.push(a),c}function Od(a,b){var c=Nd(a);tb.iter(a,b,function(a){a.highlight(sb,c,f.tabSize),a.stateAfter=m(sb,c)})}function Pd(){var a=+(new Date)+f.workTime,b=ub.length;while(ub.length){if(!Yb(Nb).stateAfter)var c=Nb;else var c=ub.pop();if(c>=tb.size)continue;var d=Md(c),e=d&&Yb(d-1).stateAfter;e?e=m(sb,e):e=n(sb);var g=0,h=sb.compareStates,i=!1,j=d,k=!1;tb.iter(j,tb.size,function(b){var d=b.stateAfter;if(+(new Date)>a)return ub.push(j),Qd(f.workDelay),i&&Gb.push({from:c,to:j+1}),k=!0;var l=b.highlight(sb,e,f.tabSize);l&&(i=!0),b.stateAfter=m(sb,e);var n=null;if(h){var o=d&&h(d,e);o!=K&&(n=!!o)}n==null&&(l!==!1||!d?g=0:++g>3&&(!sb.indent||sb.indent(d,"")==sb.indent(e,""))&&(n=!0));if(n)return!0;++j});if(k)return;i&&Gb.push({from:c,to:j+1})}b&&f.onHighlightComplete&&f.onHighlightComplete(Xb)}function Qd(a){if(!ub.length)return;qb.set(a,Ud(Pd))}function Rd(){Eb=Fb=Hb=null,Gb=[],Ib=!1,Lb=[]}function Sd(){var a=!1,b;Ib&&(a=!Gc()),Gb.length?b=Jc(Gb,!0):(Ib&&Nc(),Kb&&Mc()),a&&Gc(),Ib&&(Fc(),Jd()),vb&&!Jb&&(Eb===!0||Eb!==!1&&Ib)&&Dc(Fb),Ib&&f.matchBrackets&&setTimeout(Ud(function(){Qb&&(Qb(),Qb=null),Z(wb.from,wb.to)&&Ld(!1)}),20);var c=Hb,d=Lb;Ib&&f.onCursorActivity&&f.onCursorActivity(Xb),c&&f.onChange&&Xb&&f.onChange(Xb,c);for(var e=0;e<d.length;++e)d[e](Xb);b&&f.onUpdate&&f.onUpdate(Xb)}function Ud(a){return function(){Td++||Rd();try{var b=a.apply(this,arguments)}finally{--Td||Sd()}return b}}function Vd(a){Ub.startCompound();try{return a()}finally{Ub.endCompound()}}var f={},i=a.defaults;for(var o in i)i.hasOwnProperty(o)&&(f[o]=(e&&e.hasOwnProperty(o)?e:i)[o]);var s=document.createElement("div");s.className="CodeMirror"+(f.lineWrapping?" CodeMirror-wrap":""),s.innerHTML='<div style="overflow: hidden; position: relative; width: 3px; height: 0px;"><textarea style="position: absolute; padding: 0; width: 1px; height: 1em" wrap="off" autocorrect="off" autocapitalize="off"></textarea></div><div class="CodeMirror-scroll" tabindex="-1"><div style="position: relative"><div style="position: relative"><div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div><div class="CodeMirror-lines"><div style="position: relative; z-index: 0"><div style="position: absolute; width: 100%; height: 0; overflow: hidden; visibility: hidden;"></div><pre class="CodeMirror-cursor">&#160;</pre><div style="position: relative; z-index: -1"></div><div></div></div></div></div></div></div>',d.appendChild?d.appendChild(s):d(s);var A=s.firstChild,D=A.firstChild,T=s.lastChild,U=T.firstChild,V=U.firstChild,ab=V.firstChild,ib=ab.firstChild,jb=ab.nextSibling.firstChild,kb=jb.firstChild,lb=kb.nextSibling,mb=lb.nextSibling,nb=mb.nextSibling;gd(),b&&(D.style.width="0px"),P||(jb.draggable=!0),jb.style.outline="none",f.tabindex!=null&&(D.tabIndex=f.tabindex),f.autofocus&&Ec(),!f.gutter&&!f.lineNumbers&&(ab.style.display="none"),R&&(A.style.height="1px",A.style.position="absolute");try{rd("x")}catch(ob){throw ob.message.match(/runtime/i)&&(ob=new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)")),ob}var pb=new J,qb=new J,rb,sb,tb=new u([new t([new r("")])]),ub,vb;cd();var wb={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},xb,yb,zb,Ab=0,Bb,Cb=!1,Db=!1,Eb,Fb,Gb,Hb,Ib,Jb,Kb,Lb,Mb=0,Nb=0,Ob=0,Pb=0,Qb,Rb="",Sb,Tb={};Ud(function(){$b(f.value||""),Eb=!1})();var Ub=new z;I(T,"mousedown",Ud(ac)),I(T,"dblclick",Ud(bc)),I(jb,"selectstart",C),L||I(T,"contextmenu",Id),I(T,"scroll",function(){Ab=T.scrollTop,Jc([]),f.fixedGutter&&(ab.style.left=T.scrollLeft+"px"),f.onScroll&&f.onScroll(Xb)}),I(window,"resize",function(){Jc(!0)}),I(D,"keyup",Ud(lc)),I(D,"input",Ac),I(D,"keydown",Ud(jc)),I(D,"keypress",Ud(kc)),I(D,"focus",mc),I(D,"blur",nc),f.dragDrop&&(I(jb,"dragstart",dc),I(T,"dragenter",E),I(T,"dragover",E),I(T,"drop",Ud(cc))),I(T,"paste",function(){Ec(),Ac()}),I(D,"paste",Ac),I(D,"cut",Ud(function(){f.readOnly||uc("")})),R&&I(U,"mouseup",function(){document.activeElement==D&&D.blur(),Ec()});var Vb;try{Vb=document.activeElement==D}catch(ob){}Vb||f.autofocus?setTimeout(mc,20):nc();var Xb=s.CodeMirror={getValue:_b,setValue:Ud($b),getSelection:xc,replaceSelection:Ud(uc),focus:function(){window.focus(),Ec(),mc(),Ac()},setOption:function(a,b){var c=f[a];f[a]=b,a=="mode"||a=="indentUnit"?cd():a=="readOnly"&&b=="nocursor"?(nc(),D.blur()):a=="readOnly"&&!b?Dc(!0):a=="theme"?gd():a=="lineWrapping"&&c!=b?Ud(ed)():a=="tabSize"&&Jc(!0);if(a=="lineNumbers"||a=="gutter"||a=="firstLineNumber"||a=="theme")dd(),Jc(!0)},getOption:function(a){return f[a]},undo:Ud(qc),redo:Ud(rc),indentLine:Ud(function(a,b){typeof b!="string"&&(b==null?b=f.smartIndent?"smart":"prev":b=b?"add":"subtract"),Wb(a)&&bd(a,b)}),indentSelection:Ud(ad),historySize:function(){return{undo:Ub.done.length,redo:Ub.undone.length}},clearHistory:function(){Ub=new z},matchBrackets:Ud(function(){Ld(!0)}),getTokenAt:Ud(function(a){return a=Uc(a),Yb(a.line).getTokenAt(sb,Nd(a.line),a.ch)}),getStateAfter:function(a){return a=Tc(a==null?tb.size-1:a),Nd(a+1)},cursorCoords:function(a,b){return a==null&&(a=wb.inverted),this.charCoords(a?wb.from:wb.to,b)},charCoords:function(a,b){return a=Uc(a),b=="local"?vd(a,!1):b=="div"?vd(a,!0):xd(a)},coordsChar:function(a){var b=W(jb);return wd(a.x-b.left,a.y-b.top)},markText:Ud(id),setBookmark:jd,findMarksAt:kd,setMarker:Ud(ld),clearMarker:Ud(md),setLineClass:Ud(od),hideLine:Ud(function(a){return pd(a,!0)}),showLine:Ud(function(a){return pd(a,!1)}),onDeleteLine:function(a,b){if(typeof a=="number"){if(!Wb(a))return null;a=Yb(a)}return(a.handlers||(a.handlers=[])).push(b),a},lineInfo:qd,addWidget:function(a,b,c,d,e){a=vd(Uc(a));var f=a.yBot,g=a.x;b.style.position="absolute",U.appendChild(b);if(d=="over")f=a.y;else if(d=="near"){var h=Math.max(T.offsetHeight,tb.height*Bd()),i=Math.max(U.clientWidth,jb.clientWidth)-Gd();a.yBot+b.offsetHeight>h&&a.y>b.offsetHeight&&(f=a.y-b.offsetHeight),g+b.offsetWidth>i&&(g=i-b.offsetWidth)}b.style.top=f+Fd()+"px",b.style.left=b.style.right="",e=="right"?(g=U.clientWidth-b.offsetWidth,b.style.right="0px"):(e=="left"?g=0:e=="middle"&&(g=(U.clientWidth-b.offsetWidth)/2),b.style.left=g+Gd()+"px"),c&&Hc(g,f,g+b.offsetWidth,f+b.offsetHeight)},lineCount:function(){return tb.size},clipPos:Uc,getCursor:function(a){return a==null&&(a=wb.inverted),_(a?wb.from:wb.to)},somethingSelected:function(){return!Z(wb.from,wb.to)},setCursor:Ud(function(a,b,c){b==null&&typeof a.line=="number"?Sc(a.line,a.ch,c):Sc(a,b,c)}),setSelection:Ud(function(a,b,c){(c?Pc:Qc)(Uc(a),Uc(b||a))}),getLine:function(a){if(Wb(a))return Yb(a).text},getLineHandle:function(a){if(Wb(a))return Yb(a)},setLine:Ud(function(a,b){Wb(a)&&tc(b,{line:a,ch:0},{line:a,ch:Yb(a).text.length})}),removeLine:Ud(function(a){Wb(a)&&tc("",{line:a,ch:0},Uc({line:a+1,ch:0}))}),replaceRange:Ud(tc),getRange:function(a,b){return wc(Uc(a),Uc(b))},triggerOnKeyDown:Ud(jc),execCommand:function(a){return h[a](Xb)},moveH:Ud(Wc),deleteH:Ud(Xc),moveV:Ud(Zc),toggleOverwrite:function(){Cb?(Cb=!1,lb.className=lb.className.replace(" CodeMirror-overwrite","")):(Cb=!0,lb.className+=" CodeMirror-overwrite")},posFromIndex:function(a){var b=0,c;return tb.iter(0,tb.size,function(d){var e=d.text.length+1;if(e>a)return c=a,!0;a-=e,++b}),Uc({line:b,ch:c})},indexFromPos:function(a){if(a.line<0||a.ch<0)return 0;var b=a.ch;return tb.iter(0,a.line,function(a){b+=a.text.length+1}),b},scrollTo:function(a,b){a!=null&&(T.scrollLeft=a),b!=null&&(T.scrollTop=b),Jc([])},operation:function(a){return Ud(a)()},compoundChange:function(a){return Vd(a)},refresh:function(){Jc(!0),T.scrollHeight>Ab&&(T.scrollTop=Ab)},getInputField:function(){return D},getWrapperElement:function(){return s},getScrollerElement:function(){return T},getGutterElement:function(){return ab}},hc=null,ic,yc=!1,Bc="",Yc=null;hd.prototype.clear=Ud(function(){var a=Infinity,b=-Infinity;for(var c=0,d=this.set.length;c<d;++c){var e=this.set[c],f=e.marked;if(!f||!e.parent)continue;var g=w(e);a=Math.min(a,g),b=Math.max(b,g);for(var h=0;h<f.length;++h)f[h].marker==this&&f.splice(h--,1)}a!=Infinity&&Gb.push({from:a,to:b+1})}),hd.prototype.find=function(){var a,b;for(var c=0,d=this.set.length;c<d;++c){var e=this.set[c],f=e.marked;for(var g=0;g<f.length;++g){var h=f[g];if(h.marker==this)if(h.from!=null||h.to!=null){var i=w(e);i!=null&&(h.from!=null&&(a={line:i,ch:h.from}),h.to!=null&&(b={line:i,ch:h.to}))}}}return{from:a,to:b}};var td=Math.floor(Math.random()*16777215).toString(16),yd,zd,Ad,Cd,Dd=0,Kd={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},Td=0;for(var Wd in g)g.propertyIsEnumerable(Wd)&&!Xb.propertyIsEnumerable(Wd)&&(Xb[Wd]=g[Wd]);return Xb}function j(a){return typeof a=="string"?i[a]:a}function k(a,b,c,d){function e(b){b=j(b);var c=b[a];if(c!=null&&d(c))return!0;if(b.catchall)return d(b.catchall);var f=b.fallthrough;if(f==null)return!1;if(Object.prototype.toString.call(f)!="[object Array]")return e(f);for(var g=0,h=f.length;g<h;++g)if(e(f[g]))return!0;return!1}return b&&e(b)?!0:e(c)}function l(a){var b=hb[H(a,"keyCode")];return b=="Ctrl"||b=="Alt"||b=="Shift"||b=="Mod"}function m(a,b){if(b===!0)return b;if(a.copyState)return a.copyState(b);var c={};for(var d in b){var e=b[d];e instanceof Array&&(e=e.concat([])),c[d]=e}return c}function n(a,b,c){return a.startState?a.startState(b,c):!0}function o(a,b){this.pos=this.start=0,this.string=a,this.tabSize=b||8}function p(a,b,c,d){this.from=a,this.to=b,this.style=c,this.marker=d}function q(a){this.from=a,this.to=a,this.line=null}function r(a,b){this.styles=b||[a,null],this.text=a,this.height=1,this.marked=this.gutterMarker=this.className=this.bgClassName=this.handlers=null,this.stateAfter=this.parent=this.hidden=null}function s(a,b,c,d){for(var e=0,f=0,g=0;f<b;e+=2){var h=c[e],i=f+h.length;g==0?(i>a&&d.push(h.slice(a-f,Math.min(h.length,b-f)),c[e+1]),i>=a&&(g=1)):g==1&&(i>b?d.push(h.slice(0,b-f),c[e+1]):d.push(h,c[e+1])),f=i}}function t(a){this.lines=a,this.parent=null;for(var b=0,c=a.length,d=0;b<c;++b)a[b].parent=this,d+=a[b].height;this.height=d}function u(a){this.children=a;var b=0,c=0;for(var d=0,e=a.length;d<e;++d){var f=a[d];b+=f.chunkSize(),c+=f.height,f.parent=this}this.size=b,this.height=c,this.parent=null}function v(a,b){while(!a.lines)for(var c=0;;++c){var d=a.children[c],e=d.chunkSize();if(b<e){a=d;break}b-=e}return a.lines[b]}function w(a){if(a.parent==null)return null;var b=a.parent,c=db(b.lines,a);for(var d=b.parent;d;b=d,d=d.parent)for(var e=0,f=d.children.length;;++e){if(d.children[e]==b)break;c+=d.children[e].chunkSize()}return c}function x(a,b){var c=0;a:do{for(var d=0,e=a.children.length;d<e;++d){var f=a.children[d],g=f.height;if(b<g){a=f;continue a}b-=g,c+=f.chunkSize()}return c}while(!a.lines);for(var d=0,e=a.lines.length;d<e;++d){var h=a.lines[d],i=h.height;if(b<i)break;b-=i}return c+d}function y(a,b){var c=0;a:do{for(var d=0,e=a.children.length;d<e;++d){var f=a.children[d],g=f.chunkSize();if(b<g){a=f;continue a}b-=g,c+=f.height}return c}while(!a.lines);for(var d=0;d<b;++d)c+=a.lines[d].height;return c}function z(){this.time=0,this.done=[],this.undone=[],this.compound=0,this.closed=!1}function A(){E(this)}function B(a){return a.stop||(a.stop=A),a}function C(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function D(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function E(a){C(a),D(a)}function F(a){return a.target||a.srcElement}function G(a){if(a.which)return a.which;if(a.button&1)return 1;if(a.button&2)return 3;if(a.button&4)return 2}function H(a,b){var c=a.override&&a.override.hasOwnProperty(b);return c?a.override[b]:a[b]}function I(a,b,c,d){if(typeof a.addEventListener=="function"){a.addEventListener(b,c,!1);if(d)return function(){a.removeEventListener(b,c,!1)}}else{var e=function(a){c(a||window.event)};a.attachEvent("on"+b,e);if(d)return function(){a.detachEvent("on"+b,e)}}}function J(){this.id=null}function U(a,b,c){b==null&&(b=a.search(/[^\s\u00a0]/),b==-1&&(b=a.length));for(var d=0,e=0;d<b;++d)a.charAt(d)==" "?e+=c-e%c:++e;return e}function V(a){return a.currentStyle?a.currentStyle:window.getComputedStyle(a,null)}function W(a,b){var c=a.ownerDocument.body,d=0,e=0,f=!1;for(var g=a;g;g=g.offsetParent){var h=g.offsetLeft,i=g.offsetTop;g==c?(d+=Math.abs(h),e+=Math.abs(i)):(d+=h,e+=i),b&&V(g).position=="fixed"&&(f=!0)}var j=b&&!f?null:c;for(var g=a.parentNode;g!=j;g=g.parentNode)g.scrollLeft!=null&&(d-=g.scrollLeft,e-=g.scrollTop);return{left:d,top:e}}function X(a){return a.textContent||a.innerText||a.nodeValue||""}function Y(a){b?(a.selectionStart=0,a.selectionEnd=a.value.length):a.select()}function Z(a,b){return a.line==b.line&&a.ch==b.ch}function $(a,b){return a.line<b.line||a.line==b.line&&a.ch<b.ch}function _(a){return{line:a.line,ch:a.ch}}function bb(a){return ab.textContent=a,ab.innerHTML}function cb(a,b){if(!b)return 0;if(!a)return b.length;for(var c=a.length,d=b.length;c>=0&&d>=0;--c,--d)if(a.charAt(c)!=b.charAt(d))break;return d+1}function db(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;c<d;++c)if(a[c]==b)return c;return-1}function eb(a){return/\w/.test(a)||a.toUpperCase()!=a.toLowerCase()}a.defaults={value:"",mode:null,theme:"default",indentUnit:2,indentWithTabs:!1,smartIndent:!0,tabSize:4,keyMap:"default",extraKeys:null,electricChars:!0,autoClearEmptyLines:!1,onKeyEvent:null,lineWrapping:!1,lineNumbers:!1,gutter:!1,fixedGutter:!1,firstLineNumber:1,readOnly:!1,dragDrop:!0,onFileDrop:null,onChange:null,onCursorActivity:null,onGutterClick:null,onHighlightComplete:null,onUpdate:null,onFocus:null,onBlur:null,onScroll:null,matchBrackets:!1,workTime:100,workDelay:200,pollInterval:100,undoDepth:40,tabindex:null,autofocus:null};var b=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),c=b||/Mac/.test(navigator.platform),d=/Win/.test(navigator.platform),e=a.modes={},f=a.mimeModes={};a.defineMode=function(b,c){!a.defaults.mode&&b!="null"&&(a.defaults.mode=b);if(arguments.length>2){c.dependencies=[];for(var d=2;d<arguments.length;++d)c.dependencies.push(arguments[d])}e[b]=c},a.defineMIME=function(a,b){f[a]=b},a.resolveMode=function(b){if(typeof b=="string"&&f.hasOwnProperty(b))b=f[b];else if(typeof b=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(b))return a.resolveMode("application/xml");return typeof b=="string"?{name:b}:b||{name:"null"}},a.getMode=function(b,c){var c=a.resolveMode(c),d=e[c.name];return d?d(b,c):a.getMode(b,"text/plain")},a.listModes=function(){var a=[];for(var b in e)e.propertyIsEnumerable(b)&&a.push(b);return a},a.listMIMEs=function(){var a=[];for(var b in f)f.propertyIsEnumerable(b)&&a.push({mime:b,mode:f[b]});return a};var g=a.extensions={};a.defineExtension=function(a,b){g[a]=b};var h=a.commands={selectAll:function(a){a.setSelection({line:0,ch:0},{line:a.lineCount()-1})},killLine:function(a){var b=a.getCursor(!0),c=a.getCursor(!1),d=!Z(b,c);!d&&a.getLine(b.line).length==b.ch?a.replaceRange("",b,{line:b.line+1,ch:0}):a.replaceRange("",b,d?c:{line:b.line})},deleteLine:function(a){var b=a.getCursor().line;a.replaceRange("",{line:b,ch:0},{line:b})},undo:function(a){a.undo()},redo:function(a){a.redo()},goDocStart:function(a){a.setCursor(0,0,!0)},goDocEnd:function(a){a.setSelection({line:a.lineCount()-1},null,!0)},goLineStart:function(a){a.setCursor(a.getCursor().line,0,!0)},goLineStartSmart:function(a){var b=a.getCursor(),c=a.getLine(b.line),d=Math.max(0,c.search(/\S/));a.setCursor(b.line,b.ch<=d&&b.ch?0:d,!0)},goLineEnd:function(a){a.setSelection({line:a.getCursor().line},null,!0)},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1,"char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},goWordRight:function(a){a.moveH(1,"word")},delCharLeft:function(a){a.deleteH(-1,"char")},delCharRight:function(a){a.deleteH(1,"char")},delWordLeft:function(a){a.deleteH(-1,"word")},delWordRight:function(a){a.deleteH(1,"word")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection(" ","end")},transposeChars:function(a){var b=a.getCursor(),c=a.getLine(b.line);b.ch>0&&b.ch<c.length-1&&a.replaceRange(c.charAt(b.ch)+c.charAt(b.ch-1),{line:b.line,ch:b.ch-1},{line:b.line,ch:b.ch+1})},newlineAndIndent:function(a){a.replaceSelection("\n","end"),a.indentLine(a.getCursor().line)},toggleOverwrite:function(a){a.toggleOverwrite()}},i=a.keyMap={};i.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharRight",Backspace:"delCharLeft",Tab:"insertTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},i.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goWordLeft","Ctrl-Right":"goWordRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordLeft","Ctrl-Delete":"delWordRight","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",fallthrough:"basic"},i.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goWordLeft","Alt-Right":"goWordRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordLeft","Ctrl-Alt-Backspace":"delWordRight","Alt-Delete":"delWordRight","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",fallthrough:["basic","emacsy"]},i["default"]=c?i.macDefault:i.pcDefault,i.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":"goPageUp","Shift-Ctrl-V":"goPageDown","Ctrl-D":"delCharRight","Ctrl-H":"delCharLeft","Alt-D":"delWordRight","Alt-Backspace":"delWordLeft","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},a.fromTextArea=function(b,c){function d(){b.value=h.getValue()}c||(c={}),c.value=b.value,!c.tabindex&&b.tabindex&&(c.tabindex=b.tabindex),c.autofocus==null&&b.getAttribute("autofocus")!=null&&(c.autofocus=!0);if(b.form){var e=I(b.form,"submit",d,!0);if(typeof b.form.submit=="function"){var f=b.form.submit;function g(){d(),b.form.submit=f,b.form.submit(),b.form.submit=g}b.form.submit=g}}b.style.display="none";var h=a(function(a){b.parentNode.insertBefore(a,b.nextSibling)},c);return h.save=d,h.getTextArea=function(){return b},h.toTextArea=function(){d(),b.parentNode.removeChild(h.getWrapperElement()),b.style.display="",b.form&&(e(),typeof b.form.submit=="function"&&(b.form.submit=f))},h},a.copyState=m,a.startState=n,o.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(a){var b=this.string.charAt(this.pos);if(typeof a=="string")var c=b==a;else var c=b&&(a.test?a.test(b):a(b));if(c)return++this.pos,b},eatWhile:function(a){var b=this.pos;while(this.eat(a));return this.pos>b},eatSpace:function(){var a=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);if(b>-1)return this.pos=b,!0},backUp:function(a){this.pos-=a},column:function(){return U(this.string,this.start,this.tabSize)},indentation:function(){return U(this.string,null,this.tabSize)},match:function(a,b,c){if(typeof a!="string"){var e=this.string.slice(this.pos).match(a);return e&&b!==!1&&(this.pos+=e[0].length),e}function d(a){return c?a.toLowerCase():a}if(d(this.string).indexOf(d(a),this.pos)==this.pos)return b!==!1&&(this.pos+=a.length),!0},current:function(){return this.string.slice(this.start,this.pos)}},a.StringStream=o,p.prototype={attach:function(a){this.marker.set.push(a)},detach:function(a){var b=db(this.marker.set,a);b>-1&&this.marker.set.splice(b,1)},split:function(a,b){if(this.to<=a&&this.to!=null)return null;var c=this.from<a||this.from==null?null:this.from-a+b,d=this.to==null?null:this.to-a+b;return new p(c,d,this.style,this.marker)},dup:function(){return new p(null,null,this.style,this.marker)},clipTo:function(a,b,c,d,e){a&&d>this.from&&(d<this.to||this.to==null)?this.from=null:this.from!=null&&this.from>=b&&(this.from=Math.max(d,this.from)+e),c&&(b<this.to||this.to==null)&&(b>this.from||this.from==null)?this.to=null:this.to!=null&&this.to>b&&(this.to=d<this.to?this.to+e:b)},isDead:function(){return this.from!=null&&this.to!=null&&this.from>=this.to},sameSet:function(a){return this.marker==a.marker}},q.prototype={attach:function(a){this.line=a},detach:function(a){this.line==a&&(this.line=null)},split:function(a,b){if(a<this.from)return this.from=this.to=this.from-a+b,this},isDead:function(){return this.from>this.to},clipTo:function(a,b,c,d,e){(a||b<this.from)&&(c||d>this.to)?(this.from=0,this.to=-1):this.from>b&&(this.from=this.to=Math.max(d,this.from)+e)},sameSet:function(a){return!1},find:function(){return!this.line||!this.line.parent?null:{line:w(this.line),ch:this.from}},clear:function(){if(this.line){var a=db(this.line.marked,this);a!=-1&&this.line.marked.splice(a,1),this.line=null}}},r.inheritMarks=function(a,b){var c=new r(a),d=b&&b.marked;if(d)for(var e=0;e<d.length;++e)if(d[e].to==null&&d[e].style){var f=c.marked||(c.marked=[]),g=d[e],h=g.dup();f.push(h),h.attach(c)}return c},r.prototype={replace:function(a,b,c){var d=[],e=this.marked,f=b==null?this.text.length:b;s(0,a,this.styles,d),c&&d.push(c,null),s(f,this.text.length,this.styles,d),this.styles=d,this.text=this.text.slice(0,a)+c+this.text.slice(f),this.stateAfter=null;if(e){var g=c.length-(f-a);for(var h=0;h<e.length;++h){var i=e[h];i.clipTo(a==null,a||0,b==null,f,g),i.isDead()&&(i.detach(this),e.splice(h--,1))}}},split:function(a,b){var c=[b,null],d=this.marked;s(a,this.text.length,this.styles,c);var e=new r(b+this.text.slice(a),c);if(d)for(var f=0;f<d.length;++f){var g=d[f],h=g.split(a,b.length);h&&(e.marked||(e.marked=[]),e.marked.push(h),h.attach(e),h==g&&d.splice(f--,1))}return e},append:function(a){var b=this.text.length,c=a.marked,d=this.marked;this.text+=a.text,s(0,a.text.length,a.styles,this.styles);if(d)for(var e=0;e<d.length;++e)d[e].to==null&&(d[e].to=b);if(c&&c.length){d||(this.marked=d=[]);a:for(var e=0;e<c.length;++e){var f=c[e];if(!f.from)for(var g=0;g<d.length;++g){var h=d[g];if(h.to==b&&h.sameSet(f)){h.to=f.to==null?null:f.to+b,h.isDead()&&(h.detach(this),c.splice(e--,1));continue a}}d.push(f),f.attach(this),f.from+=b,f.to!=null&&(f.to+=b)}}},fixMarkEnds:function(a){var b=this.marked,c=a.marked;if(!b)return;for(var d=0;d<b.length;++d){var e=b[d],f=e.to==null;if(f&&c)for(var g=0;g<c.length;++g)if(c[g].sameSet(e)){f=!1;break}f&&(e.to=this.text.length)}},fixMarkStarts:function(){var a=this.marked;if(!a)return;for(var b=0;b<a.length;++b)a[b].from==null&&(a[b].from=0)},addMark:function(a){a.attach(this),this.marked==null&&(this.marked=[]),this.marked.push(a),this.marked.sort(function(a,b){return(a.from||0)-(b.from||0)})},highlight:function(a,b,c){var d=new o(this.text,c),e=this.styles,f=0,g=!1,h=e[0],i;this.text==""&&a.blankLine&&a.blankLine(b);while(!d.eol()){var j=a.token(d,b),k=this.text.slice(d.start,d.pos);d.start=d.pos,f&&e[f-1]==j?e[f-2]+=k:k&&(!g&&(e[f+1]!=j||f&&e[f-2]!=i)&&(g=!0),e[f++]=k,e[f++]=j,i=h,h=e[f]);if(d.pos>5e3){e[f++]=this.text.slice(d.pos),e[f++]=null;break}}return e.length!=f&&(e.length=f,g=!0),f&&e[f-2]!=i&&(g=!0),g||(e.length<5&&this.text.length<10?null:!1)},getTokenAt:function(a,b,c){var d=this.text,e=new o(d);while(e.pos<c&&!e.eol()){e.start=e.pos;var f=a.token(e,b)}return{start:e.start,end:e.pos,string:e.current(),className:f||null,state:b}},indentation:function(a){return U(this.text,null,a)},getHTML:function(a,b){function f(b,f){if(!b)return;d&&M&&b.charAt(0)==" "&&(b="\u00a0"+b.slice(1)),d=!1;if(b.indexOf(" ")==-1){e+=b.length;var g=bb(b)}else{var g="";for(var h=0;;){var i=b.indexOf(" ",h);if(i==-1){g+=bb(b.slice(h)),e+=b.length-h;break}e+=i-h;var j=a(e);g+=bb(b.slice(h,i))+j.html,e+=j.width,h=i+1}}f?c.push('<span class="',f,'">',g,"</span>"):c.push(g)}function k(a){return a?"cm-"+a.replace(/ +/g," cm-"):null}var c=[],d=!0,e=0,g=this.styles,h=this.text,i=this.marked,j=h.length;b!=null&&(j=Math.min(b,j));if(!h&&b==null)f(" ");else if(!i||!i.length)for(var l=0,m=0;m<j;l+=2){var n=g[l],o=g[l+1],p=n.length;m+p>j&&(n=n.slice(0,j-m)),m+=p,f(n,k(o))}else{var q=0,l=0,r="",o,s=0,t=i[0].from||0,u=[],v=0;function w(){var a;while(v<i.length&&((a=i[v]).from==q||a.from==null))a.style!=null&&u.push(a),++v;t=v<i.length?i[v].from:Infinity;for(var b=0;b<u.length;++b){var c=u[b].to||Infinity;c==q?u.splice(b--,1):t=Math.min(c,t)}}var x=0;while(q<j){t==q&&w();var y=Math.min(j,t);for(;;){if(r){var z=q+r.length,A=o;for(var B=0;B<u.length;++B)A=(A?A+" ":"")+u[B].style;f(z>y?r.slice(0,y-q):r,A);if(z>=y){r=r.slice(y-q),q=y;break}q=z}r=g[l++],o=k(g[l++])}}}return c.join("")},cleanUp:function(){this.parent=null;if(this.marked)for(var a=0,b=this.marked.length;a<b;++a)this.marked[a].detach(this)}},t.prototype={chunkSize:function(){return this.lines.length},remove:function(a,b,c){for(var d=a,e=a+b;d<e;++d){var f=this.lines[d];this.height-=f.height,f.cleanUp();if(f.handlers)for(var g=0;g<f.handlers.length;++g)c.push(f.handlers[g])}this.lines.splice(a,b)},collapse:function(a){a.splice.apply(a,[a.length,0].concat(this.lines))},insertHeight:function(a,b,c){this.height+=c,M?this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a)):this.lines.splice.apply(this.lines,[a,0].concat(b));for(var d=0,e=b.length;d<e;++d)b[d].parent=this},iterN:function(a,b,c){for(var d=a+b;a<d;++a)if(c(this.lines[a]))return!0}},u.prototype={chunkSize:function(){return this.size},remove:function(a,b,c){this.size-=b;for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(a<f){var g=Math.min(b,f-a),h=e.height;e.remove(a,g,c),this.height-=h-e.height,f==g&&(this.children.splice(d--,1),e.parent=null);if((b-=g)==0)break;a=0}else a-=f}if(this.size-b<25){var i=[];this.collapse(i),this.children=[new t(i)],this.children[0].parent=this}},collapse:function(a){for(var b=0,c=this.children.length;b<c;++b)this.children[b].collapse(a)},insert:function(a,b){var c=0;for(var d=0,e=b.length;d<e;++d)c+=b[d].height;this.insertHeight(a,b,c)},insertHeight:function(a,b,c){this.size+=b.length,this.height+=c;for(var d=0,e=this.children.length;d<e;++d){var f=this.children[d],g=f.chunkSize();if(a<=g){f.insertHeight(a,b,c);if(f.lines&&f.lines.length>50){while(f.lines.length>50){var h=f.lines.splice(f.lines.length-25,25),i=new t(h);f.height-=i.height,this.children.splice(d+1,0,i),i.parent=this}this.maybeSpill()}break}a-=g}},maybeSpill:function(){if(this.children.length<=10)return;var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new u(b);if(!a.parent){var d=new u(a.children);d.parent=a,a.children=[d,c],a=d}else{a.size-=c.size,a.height-=c.height;var e=db(a.parent.children,a);a.parent.children.splice(e+1,0,c)}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()},iter:function(a,b,c){this.iterN(a,b-a,c)},iterN:function(a,b,c){for(var d=0,e=this.children.length;d<e;++d){var f=this.children[d],g=f.chunkSize();if(a<g){var h=Math.min(b,g-a);if(f.iterN(a,h,c))return!0;if((b-=h)==0)break;a=0}else a-=g}}},z.prototype={addChange:function(a,b,c){this.undone.length=0;var d=+(new Date),e=this.done[this.done.length-1],f=e&&e[e.length-1],g=d-this.time;if(this.compound&&e&&!this.closed)e.push({start:a,added:b,old:c});else if(g>400||!f||this.closed||f.start>a+c.length||f.start+f.added<a)this.done.push([{start:a,added:b,old:c}]),this.closed=!1;else{var h=Math.max(0,f.start-a),i=Math.max(0,a+c.length-(f.start+f.added));for(var j=h;j>0;--j)f.old.unshift(c[j-1]);for(var j=i;j>0;--j)f.old.push(c[c.length-j]);h&&(f.start=a),f.added+=b-(c.length-h-i)}this.time=d},startCompound:function(){this.compound++||(this.closed=!0)},endCompound:function(){--this.compound||(this.closed=!0)}},a.e_stop=E,a.e_preventDefault=C,a.e_stopPropagation=D,a.connect=I,J.prototype={set:function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)}};var K=a.Pass={toString:function(){return"CodeMirror.Pass"}},L=/gecko\/\d{7}/i.test(navigator.userAgent),M=/MSIE \d/.test(navigator.userAgent),N=/MSIE [1-8]\b/.test(navigator.userAgent),O=M&&document.documentMode==5,P=/WebKit\//.test(navigator.userAgent),Q=/Chrome\//.test(navigator.userAgent),R=/KHTML\//.test(navigator.userAgent),S=function(){if(N)return!1;var a=document.createElement("div");return"draggable"in a||"dragDrop"in a}(),T="\n";(function(){var a=document.createElement("textarea");a.value="foo\nbar",a.value.indexOf("\r")>-1&&(T="\r\n")})(),document.documentElement.getBoundingClientRect!=null&&(W=function(a,b){try{var c=a.getBoundingClientRect();c={top:c.top,left:c.left}}catch(d){c={top:0,left:0}}if(!b)if(window.pageYOffset==null){var e=document.documentElement||document.body.parentNode;e.scrollTop==null&&(e=document.body),c.top+=e.scrollTop,c.left+=e.scrollLeft}else c.top+=window.pageYOffset,c.left+=window.pageXOffset;return c});var ab=document.createElement("pre");bb("a")=="\na"?bb=function(a){return ab.textContent=a,ab.innerHTML.slice(1)}:bb(" ")!=" "&&(bb=function(a){return ab.innerHTML="",ab.appendChild(document.createTextNode(a)),ab.innerHTML}),a.htmlEscape=bb;var fb="\n\nb".split(/\n/).length!=3?function(a){var b=0,c,d=[];while((c=a.indexOf("\n",b))>-1)d.push(a.slice(b,a.charAt(c-1)=="\r"?c-1:c)),b=c+1;return d.push(a.slice(b)),d}:function(a){return a.split(/\r?\n/)};a.splitLines=fb;var gb=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return!b||b.parentElement()!=a?!1:b.compareEndPoints("StartToEnd",b)!=0};a.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}}),a.defineMIME("text/plain","null");var hb={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:";",91:"Mod",92:"Mod",93:"Mod",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};return a.keyNames=hb,function(){for(var a=0;a<10;a++)hb[a+48]=String(a);for(var a=65;a<=90;a++)hb[a]=String.fromCharCode(a);for(var a=1;a<=12;a++)hb[a+111]=hb[a+63235]="F"+a}(),a}();CodeMirror.defineMode("clike",function(a,b){function k(a,b){var c=a.next();if(g[c]){var h=g[c](a,b);if(h!==!1)return h}if(c=='"'||c=="'")return b.tokenize=l(c),b.tokenize(a,b);if(/[\[\]{}\(\),;\:\.]/.test(c))return j=c,null;if(/\d/.test(c))return a.eatWhile(/[\w\.]/),"number";if(c=="/"){if(a.eat("*"))return b.tokenize=m,m(a,b);if(a.eat("/"))return a.skipToEnd(),"comment"}if(i.test(c))return a.eatWhile(i),"operator";a.eatWhile(/[\w\$_]/);var k=a.current();return d.propertyIsEnumerable(k)?(e.propertyIsEnumerable(k)&&(j="newstatement"),"keyword"):f.propertyIsEnumerable(k)?"atom":"word"}function l(a){return function(b,c){var d=!1,e,f=!1;while((e=b.next())!=null){if(e==a&&!d){f=!0;break}d=!d&&e=="\\"}if(f||!d&&!h)c.tokenize=null;return"string"}}function m(a,b){var c=!1,d;while(d=a.next()){if(d=="/"&&c){b.tokenize=null;break}c=d=="*"}return"comment"}function n(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function o(a,b,c){return a.context=new n(a.indented,b,c,null,a.context)}function p(a){var b=a.context.type;if(b==")"||b=="]"||b=="}")a.indented=a.context.indented;return a.context=a.context.prev}var c=a.indentUnit,d=b.keywords||{},e=b.blockKeywords||{},f=b.atoms||{},g=b.hooks||{},h=b.multiLineStrings,i=/[+\-*&%=<>!?|\/]/,j;return{startState:function(a){return{tokenize:null,context:new n((a||0)-c,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,b){var c=b.context;a.sol()&&(c.align==null&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0);if(a.eatSpace())return null;j=null;var d=(b.tokenize||k)(a,b);if(d=="comment"||d=="meta")return d;c.align==null&&(c.align=!0);if(j!=";"&&j!=":"||c.type!="statement")if(j=="{")o(b,a.column(),"}");else if(j=="[")o(b,a.column(),"]");else if(j=="(")o(b,a.column(),")");else if(j=="}"){while(c.type=="statement")c=p(b);c.type=="}"&&(c=p(b));while(c.type=="statement")c=p(b)}else j==c.type?p(b):(c.type=="}"||c.type=="top"||c.type=="statement"&&j=="newstatement")&&o(b,a.column(),"statement");else p(b);return b.startOfLine=!1,d},indent:function(a,b){if(a.tokenize!=k&&a.tokenize!=null)return 0;var d=a.context,e=b&&b.charAt(0);d.type=="statement"&&e=="}"&&(d=d.prev);var f=e==d.type;return d.type=="statement"?d.indented+(e=="{"?0:c):d.align?d.column+(f?0:1):d.indented+(f?0:c)},electricChars:"{}"}}),function(){function a(a){var b={},c=a.split(" ");for(var d=0;d<c.length;++d)b[c[d]]=!0;return b}function c(a,b){return b.startOfLine?(a.skipToEnd(),"meta"):!1}function d(a,b){var c;while((c=a.next())!=null)if(c=='"'&&!a.eat('"')){b.tokenize=null;break}return"string"}var b="auto if break int case long char register continue return default short do sizeof double static else struct entry switch extern typedef float union for unsigned goto while enum void const signed volatile";CodeMirror.defineMIME("text/x-csrc",{name:"clike",keywords:a(b),blockKeywords:a("case do else for if switch while struct"),atoms:a("null"),hooks:{"#":c}}),CodeMirror.defineMIME("text/x-c++src",{name:"clike",keywords:a(b+" asm dynamic_cast namespace reinterpret_cast try bool explicit new "+"static_cast typeid catch operator template typename class friend private "+"this using const_cast inline public throw virtual delete mutable protected "+"wchar_t"),blockKeywords:a("catch class do else finally for if struct switch try while"),atoms:a("true false null"),hooks:{"#":c}}),CodeMirror.defineMIME("text/x-java",{name:"clike",keywords:a("abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while"),blockKeywords:a("catch class do else finally for if switch try while"),atoms:a("true false null"),hooks:{"@":function(a,b){return a.eatWhile(/[\w\$_]/),"meta"}}}),CodeMirror.defineMIME("text/x-csharp",{name:"clike",keywords:a("abstract as base bool break byte case catch char checked class const continue decimal default delegate do double else enum event explicit extern finally fixed float for foreach goto if implicit in int interface internal is lock long namespace new object operator out override params private protected public readonly ref return sbyte sealed short sizeof stackalloc static string struct switch this throw try typeof uint ulong unchecked unsafe ushort using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),blockKeywords:a("catch class do else finally for foreach if struct switch try while"),atoms:a("true false null"),hooks:{"@":function(a,b){return a.eat('"')?(b.tokenize=d,d(a,b)):(a.eatWhile(/[\w\$_]/),"meta")}}})}(),CodeMirror.defineMode("css",function(a){function d(a,b){return c=b,a}function e(a,b){var c=a.next();if(c=="@")return a.eatWhile(/[\w\\\-]/),d("meta",a.current());if(c=="/"&&a.eat("*"))return b.tokenize=f,f(a,b);if(c=="<"&&a.eat("!"))return b.tokenize=g,g(a,b);if(c!="=")return c!="~"&&c!="|"||!a.eat("=")?c=='"'||c=="'"?(b.tokenize=h(c),b.tokenize(a,b)):c=="#"?(a.eatWhile(/[\w\\\-]/),d("atom","hash")):c=="!"?(a.match(/^\s*\w*/),d("keyword","important")):/\d/.test(c)?(a.eatWhile(/[\w.%]/),d("number","unit")):/[,.+>*\/]/.test(c)?d(null,"select-op"):/[;{}:\[\]]/.test(c)?d(null,c):(a.eatWhile(/[\w\\\-]/),d("variable","variable")):d(null,"compare");d(null,"compare")}function f(a,b){var c=!1,f;while((f=a.next())!=null){if(c&&f=="/"){b.tokenize=e;break}c=f=="*"}return d("comment","comment")}function g(a,b){var c=0,f;while((f=a.next())!=null){if(c>=2&&f==">"){b.tokenize=e;break}c=f=="-"?c+1:0}return d("comment","comment")}function h(a){return function(b,c){var f=!1,g;while((g=b.next())!=null){if(g==a&&!f)break;f=!f&&g=="\\"}return f||(c.tokenize=e),d("string","string")}}var b=a.indentUnit,c;return{startState:function(a){return{tokenize:e,baseIndent:a||0,stack:[]}},token:function(a,b){if(a.eatSpace())return null;var d=b.tokenize(a,b),e=b.stack[b.stack.length-1];if(c=="hash"&&e!="rule")d="string-2";else if(d=="variable")if(e=="rule")d="number";else if(!e||e=="@media{")d="tag";return e=="rule"&&/^[\{\};]$/.test(c)&&b.stack.pop(),c=="{"?e=="@media"?b.stack[b.stack.length-1]="@media{":b.stack.push("{"):c=="}"?b.stack.pop():c=="@media"?b.stack.push("@media"):e=="{"&&c!="comment"&&b.stack.push("rule"),d},indent:function(a,c){var d=a.stack.length;return/^\}/.test(c)&&(d-=a.stack[a.stack.length-1]=="rule"?2:1),a.baseIndent+d*b},electricChars:"}"}}),CodeMirror.defineMIME("text/css","css"),CodeMirror.defineMode("htmlembedded",function(a,b){function g(a,b){return a.match(c,!1)?(b.token=h,e.token(a,b.scriptState)):f.token(a,b.htmlState)}function h(a,b){return a.match(d,!1)?(b.token=g,f.token(a,b.htmlState)):e.token(a,b.scriptState)}var c=b.scriptStartRegex||/^<%/i,d=b.scriptEndRegex||/^%>/i,e,f;return{startState:function(){return e=e||CodeMirror.getMode(a,b.scriptingModeSpec),f=f||CodeMirror.getMode(a,"htmlmixed"),{token:b.startOpen?h:g,htmlState:f.startState(),scriptState:e.startState()}},token:function(a,b){return b.token(a,b)},indent:function(a,b){return a.token==g?f.indent(a.htmlState,b):e.indent(a.scriptState,b)},copyState:function(a){return{token:a.token,htmlState:CodeMirror.copyState(f,a.htmlState),scriptState:CodeMirror.copyState(e,a.scriptState)}},electricChars:"/{}:"}},"htmlmixed"),CodeMirror.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),CodeMirror.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),CodeMirror.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),CodeMirror.defineMode("htmlmixed",function(a,b){function f(a,b){var f=c.token(a,b.htmlState);return f=="tag"&&a.current()==">"&&b.htmlState.context&&(/^script$/i.test(b.htmlState.context.tagName)?(b.token=h,b.localState=d.startState(c.indent(b.htmlState,"")),b.mode="javascript"):/^style$/i.test(b.htmlState.context.tagName)&&(b.token=i,b.localState=e.startState(c.indent(b.htmlState,"")),b.mode="css")),f}function g(a,b,c){var d=a.current(),e=d.search(b);return e>-1&&a.backUp(d.length-e),c}function h(a,b){return a.match(/^<\/\s*script\s*>/i,!1)?(b.token=f,b.localState=null,b.mode="html",f(a,b)):g(a,/<\/\s*script\s*>/,d.token(a,b.localState))}function i(a,b){return a.match(/^<\/\s*style\s*>/i,!1)?(b.token=f,b.localState=null,b.mode="html",f(a,b)):g(a,/<\/\s*style\s*>/,e.token(a,b.localState))}var c=CodeMirror.getMode(a,{name:"xml",htmlMode:!0}),d=CodeMirror.getMode(a,"javascript"),e=CodeMirror.getMode(a,"css");return{startState:function(){var a=c.startState();return{token:f,localState:null,mode:"html",htmlState:a}},copyState:function(a){if(a.localState)var b=CodeMirror.copyState(a.token==i?e:d,a.localState);return{token:a.token,localState:b,mode:a.mode,htmlState:CodeMirror.copyState(c,a.htmlState)}},token:function(a,b){return b.token(a,b)},indent:function(a,b){return a.token==f||/^\s*<\//.test(b)?c.indent(a.htmlState,b):a.token==h?d.indent(a.localState,b):e.indent(a.localState,b)},compareStates:function(a,b){return a.mode!=b.mode?!1:a.localState?CodeMirror.Pass:c.compareStates(a.htmlState,b.htmlState)},electricChars:"/{}:"}},"xml","javascript","css"),CodeMirror.defineMIME("text/html","htmlmixed"),CodeMirror.defineMode("javascript",function(a,b){function g(a,b,c){return b.tokenize=c,c(a,b)}function h(a,b){var c=!1,d;while((d=a.next())!=null){if(d==b&&!c)return!1;c=!c&&d=="\\"}return c}function k(a,b,c){return i=a,j=c,b}function l(a,b){var c=a.next();if(c=='"'||c=="'")return g(a,b,m(c));if(/[\[\]{}\(\),;\:\.]/.test(c))return k(c);if(c=="0"&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),k("number","number");if(/\d/.test(c))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),k("number","number");if(c=="/")return a.eat("*")?g(a,b,n):a.eat("/")?(a.skipToEnd(),k("comment","comment")):b.reAllowed?(h(a,"/"),a.eatWhile(/[gimy]/),k("regexp","string-2")):(a.eatWhile(f),k("operator",null,a.current()));if(c=="#")return a.skipToEnd(),k("error","error");if(f.test(c))return a.eatWhile(f),k("operator",null,a.current());a.eatWhile(/[\w\$_]/);var d=a.current(),i=e.propertyIsEnumerable(d)&&e[d];return i&&b.kwAllowed?k(i.type,i.style,d):k("variable","variable",d)}function m(a){return function(b,c){return h(b,a)||(c.tokenize=l),k("string","string")}}function n(a,b){var c=!1,d;while(d=a.next()){if(d=="/"&&c){b.tokenize=l;break}c=d=="*"}return k("comment","comment")}function p(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.prev=e,this.info=f,d!=null&&(this.align=d)}function q(a,b){for(var c=a.localVars;c;c=c.next)if(c.name==b)return!0}function r(a,b,c,e,f){var g=a.cc;s.state=a,s.stream=f,s.marked=null,s.cc=g,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);for(;;){var h=g.length?g.pop():d?D:C;if(h(c,e)){while(g.length&&g[g.length-1].lex)g.pop()();return s.marked?s.marked:c=="variable"&&q(a,e)?"variable-2":b}}}function t(){for(var a=arguments.length-1;a>=0;a--)s.cc.push(arguments[a])}function u(){return t.apply(null,arguments),!0}function v(a){var b=s.state;if(b.context){s.marked="def";for(var c=b.localVars;c;c=c.next)if(c.name==a)return;b.localVars={name:a,next:b.localVars}}}function x(){s.state.context||(s.state.localVars=w),s.state.context={prev:s.state.context,vars:s.state.localVars}}function y(){s.state.localVars=s.state.context.vars,s.state.context=s.state.context.prev}function z(a,b){var c=function(){var c=s.state;c.lexical=new p(c.indented,s.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function A(){var a=s.state;a.lexical.prev&&(a.lexical.type==")"&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function B(a){return function(c){return c==a?u():a==";"?t():u(arguments.callee)}}function C(a){return a=="var"?u(z("vardef"),L,B(";"),A):a=="keyword a"?u(z("form"),D,C,A):a=="keyword b"?u(z("form"),C,A):a=="{"?u(z("}"),K,A):a==";"?u():a=="function"?u(R):a=="for"?u(z("form"),B("("),z(")"),N,B(")"),A,C,A):a=="variable"?u(z("stat"),G):a=="switch"?u(z("form"),D,z("}","switch"),B("{"),K,A,A):a=="case"?u(D,B(":")):a=="default"?u(B(":")):a=="catch"?u(z("form"),x,B("("),S,B(")"),C,A,y):t(z("stat"),D,B(";"),A)}function D(a){return o.hasOwnProperty(a)?u(F):a=="function"?u(R):a=="keyword c"?u(E):a=="("?u(z(")"),E,B(")"),A,F):a=="operator"?u(D):a=="["?u(z("]"),J(D,"]"),A,F):a=="{"?u(z("}"),J(I,"}"),A,F):u()}function E(a){return a.match(/[;\}\)\],]/)?t():t(D)}function F(a,b){if(a=="operator"&&/\+\+|--/.test(b))return u(F);if(a=="operator")return u(D);if(a==";")return;if(a=="(")return u(z(")"),J(D,")"),A,F);if(a==".")return u(H,F);if(a=="[")return u(z("]"),D,B("]"),A,F)}function G(a){return a==":"?u(A,C):t(F,B(";"),A)}function H(a){if(a=="variable")return s.marked="property",u()}function I(a){a=="variable"&&(s.marked="property");if(o.hasOwnProperty(a))return u(B(":"),D)}function J(a,b){function c(d){return d==","?u(a,c):d==b?u():u(B(b))}return function(e){return e==b?u():t(a,c)}}function K(a){return a=="}"?u():t(C,K)}function L(a,b){return a=="variable"?(v(b),u(M)):u()}function M(a,b){if(b=="=")return u(D,M);if(a==",")return u(L)}function N(a){return a=="var"?u(L,P):a==";"?t(P):a=="variable"?u(O):t(P)}function O(a,b){return b=="in"?u(D):u(F,P)}function P(a,b){return a==";"?u(Q):b=="in"?u(D):u(D,B(";"),Q)}function Q(a){a!=")"&&u(D)}function R(a,b){if(a=="variable")return v(b),u(R);if(a=="(")return u(z(")"),x,J(S,")"),A,C,y)}function S(a,b){if(a=="variable")return v(b),u()}var c=a.indentUnit,d=b.json,e=function(){function a(a){return{type:a,style:"keyword"}}var b=a("keyword a"),c=a("keyword b"),d=a("keyword c"),e=a("operator"),f={type:"atom",style:"atom"};return{"if":b,"while":b,"with":b,"else":c,"do":c,"try":c,"finally":c,"return":d,"break":d,"continue":d,"new":d,"delete":d,"throw":d,"var":a("var"),"const":a("var"),let:a("var"),"function":a("function"),"catch":a("catch"),"for":a("for"),"switch":a("switch"),"case":a("case"),"default":a("default"),"in":e,"typeof":e,"instanceof":e,"true":f,"false":f,"null":f,"undefined":f,NaN:f,Infinity:f}}(),f=/[+\-*&%=<>!?|]/,i,j,o={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},s={state:null,column:null,marked:null,cc:null},w={name:"this",next:{name:"arguments"}};return A.lex=!0,{startState:function(a){return{tokenize:l,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new p((a||0)-c,0,"block",!1),localVars:b.localVars,context:b.localVars&&{vars:b.localVars},indented:0}},token:function(a,b){a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation());if(a.eatSpace())return null;var c=b.tokenize(a,b);return i=="comment"?c:(b.reAllowed=i=="operator"||i=="keyword c"||!!i.match(/^[\[{}\(,;:]$/),b.kwAllowed=i!=".",r(b,c,i,j,a))},indent:function(a,b){if(a.tokenize!=l)return 0;var d=b&&b.charAt(0),e=a.lexical,f=e.type,g=d==f;return f=="vardef"?e.indented+4:f=="form"&&d=="{"?e.indented:f=="stat"||f=="form"?e.indented+c:e.info=="switch"&&!g?e.indented+(/^(?:case|default)\b/.test(b)?c:2*c):e.align?e.column+(g?0:1):e.indented+(g?0:c)},electricChars:":{}"}}),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}),CodeMirror.defineMode("markdown",function(a,b){function s(a,b,c){return b.f=b.inline=c,c(a,b)}function t(a,b,c){return b.f=b.block=c,c(a,b)}function u(a){return a.em=!1,a.strong=!1,null}function v(a,b){var c;if(b.indentationDiff>=4)return b.indentation-=b.indentationDiff,a.skipToEnd(),e;if(a.eatSpace())return null;if(a.peek()==="#"||a.match(q))b.header=!0;else if(a.eat(">"))b.indentation++,b.quote=!0;else{if(a.peek()==="[")return s(a,b,C);if(a.match(n,!0))return h;if(c=a.match(o,!0)||a.match(p,!0))return b.indentation+=c[0].length,g}return s(a,b,b.inline)}function w(a,b){var d=c.token(a,b.htmlState);return d==="tag"&&b.htmlState.type!=="openTag"&&!b.htmlState.context&&(b.f=z,b.block=v),d}function x(a){var b=[];return a.strong?b.push(a.em?m:l):a.em&&b.push(k),a.header&&b.push(d),a.quote&&b.push(f),b.length?b.join(" "):null}function y(a,b){return a.match(r,!0)?x(b):undefined}function z(a,b){var c=b.text(a,b);if(typeof c!="undefined")return c;var d=a.next();if(d==="\\")return a.next(),x(b);if(d==="`")return s(a,b,F(e,"`"));if(d==="[")return s(a,b,A);if(d==="<"&&a.match(/^\w/,!1))return a.backUp(1),t(a,b,w);var f=x(b);return d==="*"||d==="_"?a.eat(d)?(b.strong=!b.strong)?x(b):f:(b.em=!b.em)?x(b):f:x(b)}function A(a,b){while(!a.eol()){var c=a.next();c==="\\"&&a.next();if(c==="]")return b.inline=b.f=B,i}return i}function B(a,b){a.eatSpace();var c=a.next();return c==="("||c==="["?s(a,b,F(j,c==="("?")":"]")):"error"}function C(a,b){return a.match(/^[^\]]*\]:/,!0)?(b.f=D,i):s(a,b,z)}function D(a,b){return a.eatSpace(),a.match(/^[^\s]+/,!0),b.f=b.inline=z,j}function E(a){return E[a]||(E[a]=new RegExp("^(?:[^\\\\\\"+a+"]|\\\\.)*(?:\\"+a+"|$)")),E[a]}function F(a,b,c){return c=c||z,function(d,e){return d.match(E(b)),e.inline=e.f=c,a}}var c=CodeMirror.getMode(a,{name:"xml",htmlMode:!0}),d="header",e="comment",f="quote",g="string",h="hr",i="link",j="string",k="em",l="strong",m="emstrong",n=/^([*\-=_])(?:\s*\1){2,}\s*$/,o=/^[*\-+]\s+/,p=/^[0-9]+\.\s+/,q=/^(?:\={3,}|-{3,})$/,r=/^[^\[*_\\<>`]+/;return{startState:function(){return{f:v,block:v,htmlState:c.startState(),indentation:0,inline:z,text:y,em:!1,strong:!1,header:!1,quote:!1}},copyState:function(a){return{f:a.f,block:a.block,htmlState:CodeMirror.copyState(c,a.htmlState),indentation:a.indentation,inline:a.inline,text:a.text,em:a.em,strong:a.strong,header:a.header,quote:a.quote}},token:function(a,b){if(a.sol()){if(a.match(/^\s*$/,!0))return u(b);b.header=!1,b.quote=!1,b.f=b.block;var c=a.match(/^\s*/,!0)[0].replace(/\t/g,"    ").length;b.indentationDiff=c-b.indentation,b.indentation=c;if(c>0)return null}return b.f(a,b)},blankLine:u,getType:x}},"xml"),CodeMirror.defineMIME("text/x-markdown","markdown"),function(){function a(a){var b={},c=a.split(" ");for(var d=0;d<c.length;++d)b[c[d]]=!0;return b}function b(a){return function(b,c){return b.match(a)?c.tokenize=null:b.skipToEnd(),"string"}}var c={name:"clike",keywords:a("abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent"),blockKeywords:a("catch do else elseif for foreach if switch try while"),atoms:a("true false null TRUE FALSE NULL"),multiLineStrings:!0,hooks:{$:function(a,b){return a.eatWhile(/[\w\$_]/),"variable-2"},"<":function(a,c){return a.match(/<</)?(a.eatWhile(/[\w\.]/),c.tokenize=b(a.current().slice(3)),c.tokenize(a,c)):!1},"#":function(a,b){while(!a.eol()&&!a.match("?>",!1))a.next();return"comment"},"/":function(a,b){if(a.eat("/")){while(!a.eol()&&!a.match("?>",!1))a.next();return"comment"}return!1}}};CodeMirror.defineMode("php",function(a,b){function h(a,b){var c=b.mode=="php";a.sol()&&b.pending!='"'&&(b.pending=null);if(b.curMode==d){if(a.match(/^<\?\w*/))return b.curMode=g,b.curState=b.php,b.curClose="?>",b.mode="php","meta";if(b.pending=='"'){while(!a.eol()&&a.next()!='"');var i="string"}else if(b.pending&&a.pos<b.pending.end){a.pos=b.pending.end;var i=b.pending.style}else var i=d.token(a,b.curState);b.pending=null;var j=a.current(),k=j.search(/<\?/);return k!=-1?(i=="string"&&/\"$/.test(j)&&!/\?>/.test(j)?b.pending='"':b.pending={end:a.pos,style:i},a.backUp(j.length-k)):i=="tag"&&a.current()==">"&&b.curState.context&&(/^script$/i.test(b.curState.context.tagName)?(b.curMode=e,b.curState=e.startState(d.indent(b.curState,"")),b.curClose=/^<\/\s*script\s*>/i,b.mode="javascript"):/^style$/i.test(b.curState.context.tagName)&&(b.curMode=f,b.curState=f.startState(d.indent(b.curState,"")),b.curClose=/^<\/\s*style\s*>/i,b.mode="css")),i}return(!c||b.php.tokenize==null)&&a.match(b.curClose,c)?(b.curMode=d,b.curState=b.html,b.curClose=null,b.mode="html",c?"meta":h(a,b)):b.curMode.token(a,b.curState)}var d=CodeMirror.getMode(a,{name:"xml",htmlMode:!0}),e=CodeMirror.getMode(a,"javascript"),f=CodeMirror.getMode(a,"css"),g=CodeMirror.getMode(a,c);return{startState:function(){var a=d.startState();return{html:a,php:g.startState(),curMode:b.startOpen?g:d,curState:b.startOpen?g.startState():a,curClose:b.startOpen?/^\?>/:null,mode:b.startOpen?"php":"html",pending:null}},copyState:function(a){var b=a.html,c=CodeMirror.copyState(d,b),e=a.php,f=CodeMirror.copyState(g,e),h;return a.curState==b?h=c:a.curState==e?h=f:h=CodeMirror.copyState(a.curMode,a.curState),{html:c,php:f,curMode:a.curMode,curState:h,curClose:a.curClose,mode:a.mode,pending:a.pending}},token:h,indent:function(a,b){return a.curMode!=g&&/^\s*<\//.test(b)||a.curMode==g&&/^\?>/.test(b)?d.indent(a.html,b):a.curMode.indent(a.curState,b)},electricChars:"/{}:"}},"xml","clike","javascript","css"),CodeMirror.defineMIME("application/x-httpd-php","php"),CodeMirror.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),CodeMirror.defineMIME("text/x-php",c)}(),CodeMirror.defineMode("xml",function(a,b){function h(a,b){function c(c){return b.tokenize=c,c(a,b)}var d=a.next();if(d=="<"){if(a.eat("!"))return a.eat("[")?a.match("CDATA[")?c(k("atom","]]>")):null:a.match("--")?c(k("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),c(l(1))):null;if(a.eat("?"))return a.eatWhile(/[\w\._\-]/),b.tokenize=k("meta","?>"),"meta";g=a.eat("/")?"closeTag":"openTag",a.eatSpace(),f="";var e;while(e=a.eat(/[^\s\u00a0=<>\"\'\/?]/))f+=e;return b.tokenize=i,"tag"}if(d=="&"){var h;return a.eat("#")?a.eat("x")?h=a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):h=a.eatWhile(/[\d]/)&&a.eat(";"):h=a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),h?"atom":"error"}return a.eatWhile(/[^&<]/),null}function i(a,b){var c=a.next();return c==">"||c=="/"&&a.eat(">")?(b.tokenize=h,g=c==">"?"endTag":"selfcloseTag","tag"):c=="="?(g="equals",null):/[\'\"]/.test(c)?(b.tokenize=j(c),b.tokenize(a,b)):(a.eatWhile(/[^\s\u00a0=<>\"\'\/?]/),"word")}function j(a){return function(b,c){while(!b.eol())if(b.next()==a){c.tokenize=i;break}return"string"}}function k(a,b){return function(c,d){while(!c.eol()){if(c.match(b)){d.tokenize=h;break}c.next()}return a}}function l(a){return function(b,c){var d;while((d=b.next())!=null){if(d=="<")return c.tokenize=l(a+1),c.tokenize(b,c);if(d==">"){if(a==1){c.tokenize=h;break}return c.tokenize=l(a-1),c.tokenize(b,c)}}return"meta"}}function o(){for(var a=arguments.length-1;a>=0;a--)m.cc.push(arguments[a])}function p(){return o.apply(null,arguments),!0}function q(a,b){var c=d.doNotIndent.hasOwnProperty(a)||m.context&&m.context.noIndent;m.context={prev:m.context,tagName:a,indent:m.indented,startOfLine:b,noIndent:c}}function r(){m.context&&(m.context=m.context.prev)}function s(a){if(a=="openTag")return m.tagName=f,p(w,t(m.startOfLine));if(a=="closeTag"){var b=!1;return m.context?m.context.tagName!=f&&(d.implicitlyClosed.hasOwnProperty(m.context.tagName.toLowerCase())&&r(),b=!m.context||m.context.tagName!=f):b=!0,b&&(n="error"),p(u(b))}return p()}function t(a){return function(b){return b=="selfcloseTag"||b=="endTag"&&d.autoSelfClosers.hasOwnProperty(m.tagName.toLowerCase())?(v(m.tagName.toLowerCase()),p()):b=="endTag"?(v(m.tagName.toLowerCase()),q(m.tagName,a),p()):p()}}function u(a){return function(b){return a&&(n="error"),b=="endTag"?(r(),p()):(n="error",p(arguments.callee))}}function v(a){var b;for(;;){if(!m.context)return;b=m.context.tagName.toLowerCase();if(!d.contextGrabbers.hasOwnProperty(b)||!d.contextGrabbers[b].hasOwnProperty(a))return;r()}}function w(a){return a=="word"?(n="attribute",p(x,w)):a=="endTag"||a=="selfcloseTag"?o():(n="error",p(w))}function x(a){return a=="equals"?p(y,w):(d.allowMissing||(n="error"),a=="endTag"||a=="selfcloseTag"?o():p())}function y(a){return a=="string"?p(z):a=="word"&&d.allowUnquoted?(n="string",p()):(n="error",a=="endTag"||a=="selfCloseTag"?o():p())}function z(a){return a=="string"?p(z):o()}var c=a.indentUnit,d=b.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!1}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1},e=b.alignCDATA,f,g,m,n;return{startState:function(){return{tokenize:h,cc:[],indented:0,startOfLine:!0,tagName:null,context:null}},token:function(a,b){a.sol()&&(b.startOfLine=!0,b.indented=a.indentation());if(a.eatSpace())return null;n=g=f=null;var c=b.tokenize(a,b);b.type=g;if((c||g)&&c!="comment"){m=b;for(;;){var d=b.cc.pop()||s;if(d(g||c))break}}return b.startOfLine=!1,n||c},indent:function(a,b,d){var f=a.context;if(a.tokenize!=i&&a.tokenize!=h||f&&f.noIndent)return d?d.match(/^(\s*)/)[0].length:0;if(e&&/<!\[CDATA\[/.test(b))return 0;f&&/^<\//.test(b)&&(f=f.prev);while(f&&!f.startOfLine)f=f.prev;return f?f.indent+c:0},compareStates:function(a,b){if(a.indented!=b.indented||a.tokenize!=b.tokenize)return!1;for(var c=a.context,d=b.context;;c=c.prev,d=d.prev){if(!c||!d)return c==d;if(c.tagName!=d.tagName)return!1}},electricChars:"/"}}),CodeMirror.defineMIME("application/xml","xml"),CodeMirror.mimeModes.hasOwnProperty("text/html")||CodeMirror.defineMIME("text/html",{name:"xml",htmlMode:!0}),CodeMirror.overlayParser=function(a,b,c){return{startState:function(){return{base:CodeMirror.startState(a),overlay:CodeMirror.startState(b),basePos:0,baseCur:null,overlayPos:0,overlayCur:null}},copyState:function(c){return{base:CodeMirror.copyState(a,c.base),overlay:CodeMirror.copyState(b,c.overlay),basePos:c.basePos,baseCur:null,overlayPos:c.overlayPos,overlayCur:null}},token:function(d,e){return d.start==e.basePos&&(e.baseCur=a.token(d,e.base),e.basePos=d.pos),d.start==e.overlayPos&&(d.pos=d.start,e.overlayCur=b.token(d,e.overlay),e.overlayPos=d.pos),d.pos=Math.min(e.basePos,e.overlayPos),d.eol()&&(e.basePos=e.overlayPos=0),e.overlayCur==null?e.baseCur:e.baseCur!=null&&c?e.baseCur+" "+e.overlayCur:e.overlayCur},indent:a.indent&&function(b,c){return a.indent(b.base,c)},electricChars:a.electricChars}},function(){CodeMirror.simpleHint=function(a,b){function e(b){a.replaceRange(b,c.from,c.to)}function m(){if(l)return;l=!0,f.parentNode.removeChild(f)}function n(){e(d[g.selectedIndex]),m(),setTimeout(function(){a.focus()},50)}if(a.somethingSelected())return;var c=b(a);if(!c||!c.list.length)return;var d=c.list;if(d.length==1)return e(d[0]),!0;var f=document.createElement("div");f.className="CodeMirror-completions";var g=f.appendChild(document.createElement("select"));window.opera||(g.multiple=!0);for(var h=0;h<d.length;++h){var i=g.appendChild(document.createElement("option"));i.appendChild(document.createTextNode(d[h]))}g.firstChild.selected=!0,g.size=Math.min(10,d.length);var j=a.cursorCoords();f.style.left=j.x+"px",f.style.top=j.yBot+"px",document.body.appendChild(f);var k=window.innerWidth||Math.max(document.body.offsetWidth,document.documentElement.offsetWidth);k-j.x<g.clientWidth&&(f.style.left=j.x-g.clientWidth+"px"),d.length<=10&&(f.style.width=g.clientWidth-1+"px");var l=!1;return CodeMirror.connect(g,"blur",m),CodeMirror.connect(g,"keydown",function(c){var d=c.keyCode;d==13?(CodeMirror.e_stop(c),n()):d==27?(CodeMirror.e_stop(c),m(),a.focus()):d!=38&&d!=40&&(m(),a.focus(),a.triggerOnKeyDown(c),setTimeout(function(){CodeMirror.simpleHint(a,b)},50))}),CodeMirror.connect(g,"dblclick",n),g.focus(),window.opera&&setTimeout(function(){l||g.focus()},100),!0}}(),function(){function a(a,b){for(var c=0,d=a.length;c<d;++c)b(a[c])}function b(a,b){if(!Array.prototype.indexOf){var c=a.length;while(c--)if(a[c]===b)return!0;return!1}return a.indexOf(b)!=-1}function c(a,b,c){var d=a.getCursor(),e=c(a,d),f=e;/^[\w$_]*$/.test(e.string)||(e=f={start:d.ch,end:d.ch,string:"",state:e.state,className:e.string=="."?"property":null});while(f.className=="property"){f=c(a,{line:d.line,ch:f.start});if(f.string!=".")return;f=c(a,{line:d.line,ch:f.start});if(f.string==")"){var g=1;do{f=c(a,{line:d.line,ch:f.start});switch(f.string){case")":g++;break;case"(":g--;break;default:}}while(g>0);f=c(a,{line:d.line,ch:f.start});if(f.className!="variable")return;f.className="function"}if(!h)var h=[];h.push(f)}return{list:j(e,h,b),from:{line:d.line,ch:e.start},to:{line:d.line,ch:e.end}}}function d(a,b){var c=a.getTokenAt(b);return b.ch==c.start+1&&c.string.charAt(0)=="."?(c.end=c.start,c.string=".",c.className="property"):/^\.[\w$_]*$/.test(c.string)&&(c.className="property",c.start++,c.string=c.string.replace(/\./,"")),c}function j(c,d,h){function k(a){a.indexOf(j)==0&&!b(i,a)&&i.push(a)}function l(b){typeof b=="string"?a(e,k):b instanceof Array?a(f,k):b instanceof Function&&a(g,k);for(var c in b)k(c)}var i=[],j=c.string;if(d){var m=d.pop(),n;m.className=="variable"?n=window[m.string]:m.className=="string"?n="":m.className=="atom"?n=1:m.className=="function"&&(window.jQuery==null||m.string!="$"&&m.string!="jQuery"||typeof window.jQuery!="function"?window._!=null&&m.string=="_"&&typeof window._=="function"&&(n=window._()):n=window.jQuery());while(n!=null&&d.length)n=n[d.pop().string];n!=null&&l(n)}else{for(var o=c.state.localVars;o;o=o.next)k(o.name);l(window),a(h,k)}return i}CodeMirror.javascriptHint=function(a){return c(a,h,function(a,b){return a.getTokenAt(b)})},CodeMirror.coffeescriptHint=function(a){return c(a,i,d)};var e="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),f="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),g="prototype apply call bind".split(" "),h="break case catch continue debugger default delete do else false finally for function if in instanceof new null return switch throw true try typeof var void while with".split(" "),i="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ")}(),CodeMirror.tagRangeFinder=function(a,b){var c="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",d=c+"-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",e=new RegExp("^["+c+"]["+d+"]*"),f=a.getLine(b),g=!1,h=null,i=0;while(!g){i=f.indexOf("<",i);if(-1==i)return;if(i+1<f.length&&f[i+1]=="/"){i++;continue}if(!f.substr(i+1).match(e)){i++;continue}var j=f.indexOf(">",i+1);if(-1==j){var k=b+1,l=!1,m=a.lineCount();while(k<m&&!l){var n=a.getLine(k),o=n.indexOf(">");if(-1!=o){l=!0;var p=n.lastIndexOf("/",o);if(-1!=p&&p<o){var q=f.substr(p,o-p+1);if(!q.match(/\/\s*\>/))return k+1}}k++}g=!0}else{var r=f.lastIndexOf("/",j);if(-1==r)g=!0;else{var q=f.substr(r,j-r+1);q.match(/\/\s*\>/)||(g=!0)}}if(g){var s=f.substr(i+1);h=s.match(e),h?(h=h[0],-1!=f.indexOf("</"+h+">",i)&&(g=!1)):g=!1}g||i++}if(g){var t="(\\<\\/"+h+"\\>)|(\\<"+h+"\\>)|(\\<"+h+"\\s)|(\\<"+h+"$)",u=new RegExp(t,"g"),v="</"+h+">",w=1,k=b+1,m=a.lineCount();while(k<m){f=a.getLine(k);var x=f.match(u);if(x)for(var y=0;y<x.length;y++){x[y]==v?w--:w++;if(!w)return k+1}k++}return}},CodeMirror.braceRangeFinder=function(a,b){var c=a.getLine(b),d=c.lastIndexOf("{");if(d<0||c.lastIndexOf("}")>d)return;var e=a.getTokenAt({line:b,ch:d}).className,f=1,g=a.lineCount(),h;a:for(var i=b+1;i<g;++i){var j=a.getLine(i),k=0;for(;;){var l=j.indexOf("{",k),m=j.indexOf("}",k);l<0&&(l=j.length),m<0&&(m=j.length),k=Math.min(l,m);if(k==j.length)break;if(a.getTokenAt({line:i,ch:k+1}).className==e)if(k==l)++f;else if(!--f){h=i;break a}++k}}if(h==null||h==b+1)return;return h},CodeMirror.indentRangeFinder=function(a,b){var c=a.getOption("tabSize"),d=a.getLineHandle(b).indentation(c),e;for(var f=b+1,g=a.lineCount();f<g;++f){var h=a.getLineHandle(f);if(!/^\s*$/.test(h.text)){if(h.indentation(c)<=d)break;e=f}}return e?e+1:null},CodeMirror.newFoldFunction=function(a,b){function d(a,b){for(var d=0;d<c.length;++d){var e=a.lineInfo(c[d].start);if(!e)c.splice(d--,1);else if(e.line==b)return{pos:d,region:c[d]}}}function e(a,b){a.clearMarker(b.start);for(var c=0;c<b.hidden.length;++c)a.showLine(b.hidden[c])}var c=[];return b==null&&(b='<div style="position: absolute; left: 2px; color:#600">&#x25bc;</div>%N%'),function(f,g){f.operation(function(){var h=d(f,g);if(h)c.splice(h.pos,1),e(f,h.region);else{var i=a(f,g);if(i==null)return;var j=[];for(var k=g+1;k<i;++k){var l=f.hideLine(k);l&&j.push(l)}var m=f.setMarker(g,b),n={start:m,hidden:j};f.onDeleteLine(m,function(){e(f,n)}),c.push(n)}})}},function(){function a(a,b){var c=a.getWrapperElement(),d=c.insertBefore(document.createElement("div"),c.firstChild);return d.className="CodeMirror-dialog",d.innerHTML="<div>"+b+"</div>",d}CodeMirror.defineExtension("openDialog",function(b,c){function g(){if(e)return;e=!0,d.parentNode.removeChild(d)}var d=a(this,b),e=!1,f=this,h=d.getElementsByTagName("input")[0];return h&&(CodeMirror.connect(h,"keydown",function(a){if(a.keyCode==13||a.keyCode==27)CodeMirror.e_stop(a),g(),f.focus(),a.keyCode==13&&c(h.value)}),h.focus(),CodeMirror.connect(h,"blur",g)),g}),CodeMirror.defineExtension("openConfirm",function(b,c){function i(){if(f)return;f=!0,d.parentNode.removeChild(d),g.focus()}var d=a(this,b),e=d.getElementsByTagName("button"),f=!1,g=this,h=1;e[0].focus();for(var j=0;j<e.length;++j){var k=e[j];(function(a){CodeMirror.connect(k,"click",function(b){CodeMirror.e_preventDefault(b),i(),a&&a(g)})})(c[j]),CodeMirror.connect(k,"blur",function(){--h,setTimeout(function(){h<=0&&i()},200)}),CodeMirror.connect(k,"focus",function(){++h})}})}(),function(){function a(){this.posFrom=this.posTo=this.query=null,this.marked=[]}function b(b){return b._searchState||(b._searchState=new a)}function c(a,b,c,d){a.openDialog?a.openDialog(b,d):d(prompt(c,""))}function d(a,b,c,d){a.openConfirm?a.openConfirm(b,d):confirm(c)&&d[0]()}function e(a){var b=a.match(/^\/(.*)\/$/);return b?new RegExp(b[1]):a}function g(a,d){var g=b(a);if(g.query)return h(a,d);c(a,f,"Search for:",function(b){a.operation(function(){if(!b||g.query)return;g.query=e(b);if(a.lineCount()<2e3)for(var c=a.getSearchCursor(b);c.findNext();)g.marked.push(a.markText(c.from(),c.to(),"CodeMirror-searching"));g.posFrom=g.posTo=a.getCursor(),h(a,d)})})}function h(a,c){a.operation(function(){var d=b(a),e=a.getSearchCursor(d.query,c?d.posFrom:d.posTo);if(!e.find(c)){e=a.getSearchCursor(d.query,c?{line:a.lineCount()-1}:{line:0,ch:0});if(!e.find(c))return}a.setSelection(e.from(),e.to()),d.posFrom=e.from(),d.posTo=e.to()})}function i(a){a.operation(function(){var c=b(a);if(!c.query)return;c.query=null;for(var d=0;d<c.marked.length;++d)c.marked[d].clear();c.marked.length=0})}function m(a,b){c(a,j,"Replace:",function(f){if(!f)return;f=e(f),c(a,k,"Replace with:",function(c){if(b)a.compoundChange(function(){a.operation(function(){for(var b=a.getSearchCursor(f);b.findNext();)if(typeof f!="string"){var d=a.getRange(b.from(),b.to()).match(f);b.replace(c.replace(/\$(\d)/,function(a,b){return d[b]}))}else b.replace(c)})});else{i(a);var e=a.getSearchCursor(f,a.getCursor());function g(){var b=e.from(),c;if(!(c=e.findNext())){e=a.getSearchCursor(f);if(!(c=e.findNext())||e.from().line==b.line&&e.from().ch==b.ch)return}a.setSelection(e.from(),e.to()),d(a,l,"Replace?",[function(){h(c)},g])}function h(a){e.replace(typeof f=="string"?c:c.replace(/\$(\d)/,function(b,c){return a[c]})),g()}g()}})})}var f='Search: <input type="text" style="width: 10em"> <span style="color: #888">(Use /re/ syntax for regexp search)</span>',j='Replace: <input type="text" style="width: 10em"> <span style="color: #888">(Use /re/ syntax for regexp search)</span>',k='With: <input type="text" style="width: 10em">',l="Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";CodeMirror.commands.find=function(a){i(a),g(a)},CodeMirror.commands.findNext=g,CodeMirror.commands.findPrev=function(a){g(a,!0)},CodeMirror.commands.clearSearch=i,CodeMirror.commands.replace=m,CodeMirror.commands.replaceAll=function(a){m(a,!0)}}(),function(){function a(a,b,c,d){this.atOccurrence=!1,this.cm=a,d==null&&(d=typeof b=="string"&&b==b.toLowerCase()),c=c?a.clipPos(c):{line:0,ch:0},this.pos={from:c,to:c};if(typeof b!="string")this.matches=function(c,d){if(c){var e=a.getLine(d.line).slice(0,d.ch),f=e.match(b),g=0;while(f){var h=e.indexOf(f[0]);g+=h,e=e.slice(h+1);var i=e.match(b);if(!i)break;f=i,g++}}else var e=a.getLine(d.line).slice(d.ch),f=e.match(b),g=f&&d.ch+e.indexOf(f[0]);if(f)return{from:{line:d.line,ch:g},to:{line:d.line,ch:g+f[0].length},match:f}};else{d&&(b=b.toLowerCase());var e=d?function(a){return a.toLowerCase()}:function(a){return a},f=b.split("\n");f.length==1?this.matches=function(c,d){var f=e(a.getLine(d.line)),g=b.length,h;if(c?d.ch>=g&&(h=f.lastIndexOf(b,d.ch-g))!=-1:(h=f.indexOf(b,d.ch))!=-1)return{from:{line:d.line,ch:h},to:{line:d.line,ch:h+g}}}:this.matches=function(b,c){var d=c.line,g=b?f.length-1:0,h=f[g],i=e(a.getLine(d)),j=b?i.indexOf(h)+h.length:i.lastIndexOf(h);if(b?j>=c.ch||j!=h.length:j<=c.ch||j!=i.length-h.length)return;for(;;){if(b?!d:d==a.lineCount()-1)return;i=e(a.getLine(d+=b?-1:1)),h=f[b?--g:++g];if(g>0&&g<f.length-1){if(i!=h)return;continue}var k=b?i.lastIndexOf(h):i.indexOf(h)+h.length;if(b?k!=i.length-h.length:k!=h.length)return;var l={line:c.line,ch:j},m={line:d,ch:k};return{from:b?m:l,to:b?l:m}}}}}a.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(a){function d(a){var c={line:a,ch:0};return b.pos={from:c,to:c},b.atOccurrence=!1,!1}var b=this,c=this.cm.clipPos(a?this.pos.from:this.pos.to);for(;;){if(this.pos=this.matches(a,c))return this.atOccurrence=!0,this.pos.match||!0;if(a){if(!c.line)return d(0);c={line:c.line-1,ch:this.cm.getLine(c.line-1).length}}else{var e=this.cm.lineCount();if(c.line==e-1)return d(e);c={line:c.line+1,ch:0}}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(a){var b=this;this.atOccurrence&&(b.pos.to=this.cm.replaceRange(a,b.pos.from,b.pos.to))}},CodeMirror.defineExtension("getSearchCursor",function(b,c,d){return new a(this,b,c,d)})}(),CodeMirror.modeExtensions||(CodeMirror.modeExtensions={}),CodeMirror.defineExtension("getModeExt",function(){var a=CodeMirror.resolveMode(this.getOption("mode")).name,b=CodeMirror.modeExtensions[a];if(!b)throw new Error("No extensions found for mode "+a);return b}),CodeMirror.defineExtension("getModeExtAtPos",function(a){var b=this.getTokenAt(a);return b&&b.state&&b.state.mode?CodeMirror.modeExtensions[b.state.mode=="html"?"htmlmixed":b.state.mode]:this.getModeExt()}),CodeMirror.defineExtension("commentRange",function(a,b,c){var d=this.getModeExtAtPos(this.getCursor());if(a){var e=this.getRange(b,c);this.replaceRange(d.commentStart+this.getRange(b,c)+d.commentEnd,b,c),b.line==c.line&&b.ch==c.ch&&this.setCursor(b.line,b.ch+d.commentStart.length)}else{var f=this.getRange(b,c),g=f.indexOf(d.commentStart),h=f.lastIndexOf(d.commentEnd);g>-1&&h>-1&&h>g&&(f=f.substr(0,g)+f.substring(g+d.commentStart.length,h)+f.substr(h+d.commentEnd.length)),this.replaceRange(f,b,c)}}),CodeMirror.defineExtension("autoIndentRange",function(a,b){var c=this;this.operation(function(){for(var d=a.line;d<=b.line;d++)c.indentLine(d,"smart")})}),CodeMirror.defineExtension("autoFormatRange",function(a,b){var c=this.indexFromPos(a),d=this.indexFromPos(b),e=this.getModeExt().autoFormatLineBreaks(this.getValue(),c,d),f=this;this.operation(function(){f.replaceRange(e,a,b);var d=f.posFromIndex(c).line,g=f.posFromIndex(c+e.length).line;for(var h=d;h<=g;h++)f.indentLine(h,"smart")})}),CodeMirror.modeExtensions.css={commentStart:"/*",commentEnd:"*/",wordWrapChars:[";","\\{","\\}"],autoFormatLineBreaks:function(a){return a.replace(new RegExp("(;|\\{|\\})([^\r\n])","g"),"$1\n$2")}},CodeMirror.modeExtensions.javascript={commentStart:"/*",commentEnd:"*/",wordWrapChars:[";","\\{","\\}"],getNonBreakableBlocks:function(a){var b=[new RegExp("for\\s*?\\(([\\s\\S]*?)\\)"),new RegExp("'([\\s\\S]*?)('|$)"),new RegExp('"([\\s\\S]*?)("|$)'),new RegExp("//.*([\r\n]|$)")],c=new Array;for(var d=0;d<b.length;d++){var e=0;while(e<a.length){var f=a.substr(e).match(b[d]);if(f==null)break;c.push({start:e+f.index,end:e+f.index+f[0].length}),e+=f.index+Math.max(1,f[0].length)}}return c.sort(function(a,b){return a.start-b.start}),c},autoFormatLineBreaks:function(a){var b=0,c=new RegExp("(;|\\{|\\})([^\r\n])","g"),d=this.getNonBreakableBlocks(a);if(d!=null){var e="";for(var f=0;f<d.length;f++)d[f].start>b&&(e+=a.substring(b,d[f].start).replace(c,"$1\n$2"),b=d[f].start),d[f].start<=b&&d[f].end>=b&&(e+=a.substring(b,d[f].end),b=d[f].end);return b<a.length-1&&(e+=a.substr(b).replace(c,"$1\n$2")),e}return a.replace(c,"$1\n$2")}},CodeMirror.modeExtensions.xml={commentStart:"<!--",commentEnd:"-->",wordWrapChars:[">"],autoFormatLineBreaks:function(a){var b=a.split("\n"),c=new RegExp("(^\\s*?<|^[^<]*?)(.+)(>\\s*?$|[^>]*?$)"),d=new RegExp("<","g"),e=new RegExp("(>)([^\r\n])","g");for(var f=0;f<b.length;f++){var g=b[f].match(c);if(g!=null&&g.length>3){b[f]=g[1]+g[2].replace(d,"\n$&").replace(e,"$1\n$2")+g[3];continue}}return b.join("\n")}},CodeMirror.modeExtensions.htmlmixed={commentStart:"<!--",commentEnd:"-->",wordWrapChars:[">",";","\\{","\\}"],getModeInfos:function(a,b){var c=new Array;c[0]={pos:0,modeExt:CodeMirror.modeExtensions.xml,modeName:"xml"};var d=new Array;d[0]={regex:new RegExp("<style[^>]*>([\\s\\S]*?)(</style[^>]*>|$)","i"),modeExt:CodeMirror.modeExtensions.css,modeName:"css"},d[1]={regex:new RegExp("<script[^>]*>([\\s\\S]*?)(</script[^>]*>|$)","i"),modeExt:CodeMirror.modeExtensions.javascript,modeName:"javascript"};var e=typeof b!="undefined"?b:a.length-1;for(var f=0;f<d.length;f++){var g=0;while(g<=e){var h=a.substr(g).match(d[f].regex);if(h==null)break;if(h.length>1&&h[1].length>0){var i=g+h.index+h[0].indexOf(h[1]);c.push({pos:i,modeExt:d[f].modeExt,modeName:d[f].modeName}),c.push({pos:i+h[1].length,modeExt:c[0].modeExt,modeName:c[0].modeName}),g+=h.index+h[0].length;continue}g+=h.index+Math.max(h[0].length,1)}}return c.sort(function(b,c){return b.pos-c.pos}),c},autoFormatLineBreaks:function(a,b,c){var d=this.getModeInfos(a),e=new RegExp("^\\s*?\n"),f=new RegExp("\n\\s*?$"),g="";if(d.length>1)for(var h=1;h<=d.length;h++){var i=d[h-1].pos,j=h<d.length?d[h].pos:c;if(i>=c)break;if(i<b){if(j<=b)continue;i=b}j>c&&(j=c);var k=a.substring(i,j);d[h-1].modeName!="xml"&&(!e.test(k)&&i>0&&(k="\n"+k),!f.test(k)&&j<a.length-1&&(k+="\n")),g+=d[h-1].modeExt.autoFormatLineBreaks(k)}else g=d[0].modeExt.autoFormatLineBreaks(a.substring(b,c));return g}},function(){function b(){this.marked=[]}function c(a){return a._matchHighlightState||(a._matchHighlightState=new b)}function d(a){var b=c(a);for(var d=0;d<b.marked.length;++d)b.marked[d].clear();b.marked=[]}function e(b,e,f){d(b),f=typeof f!="undefined"?f:a;if(b.somethingSelected()&&b.getSelection().length>=f){var g=c(b),h=b.getSelection();b.operation(function(){if(b.lineCount()<2e3)for(var a=b.getSearchCursor(h);a.findNext();)(a.from().line!==b.getCursor(!0).line||a.from().ch!==b.getCursor(!0).ch)&&g.marked.push(b.markText(a.from(),a.to(),e))})}}var a=2;CodeMirror.defineExtension("matchHighlight",function(a,b){e(this,a,b)})}(),function(){function a(a,c,d,e){b(a,c,e)?(a.replaceSelection("\n\n</"+e+">","end"),a.indentLine(d.line+1),a.indentLine(d.line+2),a.setCursor({line:d.line+1,ch:a.getLine(d.line+1).length})):(a.replaceSelection("</"+e+">"),a.setCursor(d))}function b(a,b,d){if(typeof b=="undefined"||b==null||b==1)b=a.getOption("closeTagIndent");return b||(b=[]),c(b,d.toLowerCase())!=-1}function c(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;c<d;++c)if(a[c]==b)return c;return-1}function d(a,b,c){a.replaceSelection("/"+c+">"),a.setCursor({line:b.line,ch:b.ch+c.length+2})}CodeMirror.defaults.closeTagEnabled=!0,CodeMirror.defaults.closeTagIndent=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"],CodeMirror.defineExtension("closeTag",function(b,c,e){if(!b.getOption("closeTagEnabled"))throw CodeMirror.Pass;var f=b.getOption("mode");if(f=="text/html"){var g=b.getCursor(),h=b.getTokenAt(g),i=h.state;if(i.mode&&i.mode!="html")throw CodeMirror.Pass;if(c==">"){var j=i.htmlState?i.htmlState.type:i.type;if(h.className=="tag"&&j=="closeTag")throw CodeMirror.Pass;b.replaceSelection(">"),g={line:g.line,ch:g.ch+1},b.setCursor(g),h=b.getTokenAt(b.getCursor()),i=h.state,j=i.htmlState?i.htmlState.type:i.type;if(h.className=="tag"&&j!="selfcloseTag"){var k=i.htmlState?i.htmlState.context.tagName:i.tagName;k.length>0&&a(b,e,g,k);return}b.setSelection({line:g.line,ch:g.ch-1},g),b.replaceSelection("")}else if(c=="/"&&h.className=="tag"&&h.string=="<"){var k=i.htmlState?i.htmlState.context?i.htmlState.context.tagName:"":i.context.tagName;if(k.length>0){d(b,g,k);return}}}else if(f=="xmlpure"){var g=b.getCursor(),h=b.getTokenAt(g),k=h.state.context.tagName;if(c==">"){if(h.string==k){b.replaceSelection(">"),g={line:g.line,ch:g.ch+1},b.setCursor(g),a(b,e,g,k);return}}else if(c=="/"&&h.string=="<"){d(b,g,k);return}}throw CodeMirror.Pass})}(),function(){function b(a,b){var c=b;return function(){--c==0&&a()}}function c(a,c){var d=CodeMirror.modes[a].dependencies;if(!d)return c();var e=[];for(var f=0;f<d.length;++f)CodeMirror.modes.hasOwnProperty(d[f])||e.push(d[f]);if(!e.length)return c();var g=b(c,e.length);for(var f=0;f<e.length;++f)CodeMirror.requireMode(e[f],g)}CodeMirror.modeURL||(CodeMirror.modeURL="../mode/%N/%N.js");var a={};CodeMirror.requireMode=function(b,d){if(CodeMirror.modes.hasOwnProperty(b))return c(b,d());if(a.hasOwnProperty(b))return a[b].push(d);var e=document.createElement("script");e.src=CodeMirror.modeURL.replace(/%N/g,b);var f=document.getElementsByTagName("script")[0];f.parentNode.insertBefore(e,f);var g=a[b]=[d],h=0,i=setInterval(function(){if(++h>100)return clearInterval(i);CodeMirror.modes.hasOwnProperty(b)&&(clearInterval(i),a[b]=null,c(b,function(){for(var a=0;a<g.length;++a)g[a]()}))},200)},CodeMirror.autoLoadMode=function(a,b){CodeMirror.modes.hasOwnProperty(b)||CodeMirror.requireMode(b,function(){a.setOption("mode",a.getOption("mode"))})}}()