mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-09 10:50:24 +00:00
1 line
114 KiB
JavaScript
1 line
114 KiB
JavaScript
window.CodeMirror=function(){"use strict";function e(r,i){function fn(e){if(s.onDragEvent&&s.onDragEvent(pn,V(e)))return;K(e)}function hn(e){return e>=0&&e<_t.size}function dn(e){return q(_t,e)}function vn(e,t){Jt=!0;var n=t-e.height;for(var r=e;r;r=r.parent)r.height+=n}function mn(e,t){return e.styles||e.highlight(Mt,e.stateAfter=oi(R(e)),s.tabSize),e.getContent(s.tabSize,t,s.lineWrapping)}function gn(e){var t={line:0,ch:0};Hn(t,{line:_t.size-1,ch:dn(_t.size-1).text.length},St(e),t,t),zt=!0}function yn(e){var t=[];return _t.iter(0,_t.size,function(e){t.push(e.text)}),t.join(e||"\n")}function bn(e){A.scrollTop!=It&&(It=Ct.scrollTop=A.scrollTop,sr([]))}function wn(e){s.fixedGutter&&at.style.left!=Ct.scrollLeft+"px"&&(at.style.left=Ct.scrollLeft+"px"),Ct.scrollTop!=It&&(It=Ct.scrollTop,A.scrollTop!=It&&(A.scrollTop=It),sr([])),s.onScroll&&s.onScroll(pn)}function En(e){function u(t){g&&(Ct.draggable=!1),qt=!1,l(),c(),Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)<10&&($(t),dr(n.line,n.ch,!0),Zn())}function m(e){if(i=="single")cr(n,e);else if(i=="double"){var t=Er(e);pt(e,d)?cr(t.from,v):cr(d,t.to)}else i=="triple"&&(pt(e,d)?cr(v,mr({line:e.line,ch:0})):cr(d,mr({line:e.line+1,ch:0})))}function y(e){var t=Zr(e,!0);if(t&&!ht(t,a)){Pt||Dn(),a=t,m(t),zt=!1;var n=ir();if(t.line>=n.to||t.line<n.from)f=setTimeout(hi(function(){y(e)}),150)}}function b(e){clearTimeout(f);var t=Zr(e);t&&m(t),$(e),Zn(),zt=!0,w(),l()}lr(Y(e,"shiftKey"));for(var t=Q(e);t!=kt;t=t.parentNode)if(t.parentNode==Nt&&t!=yt)return;for(var t=Q(e);t!=kt;t=t.parentNode)if(t.parentNode==st)return s.onGutterClick&&s.onGutterClick(pn,wt(st.childNodes,t)+Gt,e),$(e);var n=Zr(e);switch(G(e)){case 3:h&&ti(e);return;case 2:n&&dr(n.line,n.ch,!0),setTimeout(Zn,20),$(e);return}if(!n){Q(e)==Ct&&$(e);return}Pt||Dn();var r=+(new Date),i="single";if(Ft&&Ft.time>r-400&&ht(Ft.pos,n))i="triple",$(e),setTimeout(Zn,20),Sr(n.line);else if(jt&&jt.time>r-400&&ht(jt.pos,n)){i="double",Ft={time:r,pos:n},$(e);var o=Er(n);cr(o.from,o.to)}else jt={time:r,pos:n};var a=n,f;if(s.dragDrop&&nt&&!s.readOnly&&!ht(Ht.from,Ht.to)&&!pt(n,Ht.from)&&!pt(Ht.to,n)&&i=="single"){g&&(Ct.draggable=!0);var l=Z(document,"mouseup",hi(u),!0),c=Z(Ct,"drop",hi(u),!0);qt=!0,Ct.dragDrop&&Ct.dragDrop();return}$(e),i=="single"&&dr(n.line,n.ch,!0);var d=Ht.from,v=Ht.to,w=Z(document,"mousemove",hi(function(e){clearTimeout(f),$(e),!p&&!G(e)?b(e):y(e)}),!0),l=Z(document,"mouseup",hi(b),!0)}function Sn(e){for(var t=Q(e);t!=kt;t=t.parentNode)if(t.parentNode==st)return $(e);$(e)}function xn(e){if(s.onDragEvent&&s.onDragEvent(pn,V(e)))return;$(e);var t=Zr(e,!0),n=e.dataTransfer.files;if(!t||s.readOnly)return;if(n&&n.length&&window.FileReader&&window.File){var r=n.length,i=Array(r),o=0,u=function(e,n){var s=new FileReader;s.onload=function(){i[n]=s.result,++o==r&&(t=mr(t),hi(function(){var e=zn(i.join(""),t,t);cr(t,e)})())},s.readAsText(e)};for(var a=0;a<r;++a)u(n[a],a)}else{if(qt&&!pt(t,Ht.from)&&!pt(Ht.to,t))return;try{var i=e.dataTransfer.getData("Text");i&&pi(function(){var e=Ht.from,n=Ht.to;cr(t,t),qt&&zn("",e,n),Wn(i),Zn()})}catch(e){}}}function Tn(e){var t=$n();e.dataTransfer.setData("Text",t),e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(vt("img"),0,0)}function Nn(e,t){if(typeof e=="string"){e=u[e];if(!e)return!1}var n=Bt;try{s.readOnly&&(Ut=!0),t&&(Bt=null),e(pn)}catch(r){if(r!=tt)throw r;return!1}finally{Bt=n,Ut=!1}return!0}function kn(e){function u(){o=!0}var t=f(s.keyMap),n=t.auto;clearTimeout(Cn),n&&!c(e)&&(Cn=setTimeout(function(){f(s.keyMap)==t&&(s.keyMap=n.call?n.call(null,pn):n)},50));var r=Tt[Y(e,"keyCode")],i=!1;if(r==null||e.altGraphKey)return!1;Y(e,"altKey")&&(r="Alt-"+r),Y(e,"ctrlKey")&&(r="Ctrl-"+r),Y(e,"metaKey")&&(r="Cmd-"+r);var o=!1;return Y(e,"shiftKey")?i=l("Shift-"+r,s.extraKeys,s.keyMap,function(e){return Nn(e,!0)},u)||l(r,s.extraKeys,s.keyMap,function(e){if(typeof e=="string"&&/^go[A-Z]/.test(e))return Nn(e)},u):i=l(r,s.extraKeys,s.keyMap,Nn,u),o&&(i=!1),i&&($(e),ni(),p&&(e.oldKeyCode=e.keyCode,e.keyCode=0)),i}function Ln(e,t){var n=l("'"+t+"'",s.extraKeys,s.keyMap,function(e){return Nn(e,!0)});return n&&($(e),ni()),n}function On(e){Pt||Dn(),p&&e.keyCode==27&&(e.returnValue=!1),sn&&Gn()&&(sn=!1);if(s.onKeyEvent&&s.onKeyEvent(pn,V(e)))return;var t=Y(e,"keyCode");lr(t==16||Y(e,"shiftKey"));var r=kn(e);b&&(An=r?t:null,!r&&t==88&&Y(e,n?"metaKey":"ctrlKey")&&Wn(""))}function Mn(e){sn&&Gn();if(s.onKeyEvent&&s.onKeyEvent(pn,V(e)))return;var t=Y(e,"keyCode"),n=Y(e,"charCode");if(b&&t==An){An=null,$(e);return}if((b&&(!e.which||e.which<10)||E)&&kn(e))return;var r=String.fromCharCode(n==null?t:n);s.electricChars&&Mt.electricChars&&s.smartIndent&&!s.readOnly&&Mt.electricChars.indexOf(r)>-1&&setTimeout(hi(function(){Tr(Ht.to.line,"smart")}),75);if(Ln(e,r))return;Kn()}function _n(e){if(s.onKeyEvent&&s.onKeyEvent(pn,V(e)))return;Y(e,"keyCode")==16&&(Bt=null)}function Dn(){if(s.readOnly=="nocursor")return;Pt||(s.onFocus&&s.onFocus(pn),Pt=!0,Ct.className.search(/\bCodeMirror-focused\b/)==-1&&(Ct.className+=" CodeMirror-focused")),Jn(),ni()}function Pn(){Pt&&(s.onBlur&&s.onBlur(pn),Pt=!1,en&&hi(function(){en&&(en(),en=null)})(),Ct.className=Ct.className.replace(" CodeMirror-focused","")),clearInterval(Ot),setTimeout(function(){Pt||(Bt=null)},150)}function Hn(e,t,n,r,i){if(Ut)return;var o=[];_t.iter(e.line,t.line+1,function(e){o.push(D(e.text,e.markedSpans))});if(un){un.addChange(e.line,n.length,o);while(un.done.length>s.undoDepth)un.done.shift()}var u=O(_(o[0]),_(lt(o)),e.ch,t.ch,n);In(e,t,u,r,i)}function Bn(e,t){if(!e.length)return;var n=e.pop(),r=[];for(var i=n.length-1;i>=0;i-=1){var s=n[i],o=[],u=s.start+s.added;_t.iter(s.start,u,function(e){o.push(D(e.text,e.markedSpans))}),r.push({start:s.start,added:s.old.length,old:o});var a={line:s.start+s.old.length-1,ch:bt(M(lt(o)),M(lt(s.old)))};In({line:s.start,ch:0},{line:u-1,ch:dn(u-1).text.length},s.old,a,a)}zt=!0,t.push(r)}function jn(){Bn(un.done,un.undone)}function Fn(){Bn(un.undone,un.done)}function In(e,t,n,r,i){function w(e){return e<=Math.min(t.line,t.line+g)?e:e+g}if(Ut)return;var o=!1,u=tn.text.length;s.lineWrapping||_t.iter(e.line,t.line+1,function(e){if(!e.hidden&&e.text.length==u)return o=!0,!0});if(e.line!=t.line||n.length>1)Jt=!0;var a=t.line-e.line,f=dn(e.line),l=dn(t.line),c=lt(n);if(e.ch==0&&t.ch==0&&M(c)==""){var h=[],p=null;for(var d=0,v=n.length-1;d<v;++d)h.push(new j(M(n[d]),_(n[d])));l.update(l.text,_(c)),a&&_t.remove(e.line,a,Kt),h.length&&_t.insert(e.line,h)}else if(f==l)if(n.length==1)f.update(f.text.slice(0,e.ch)+M(n[0])+f.text.slice(t.ch),_(n[0]));else{for(var h=[],d=1,v=n.length-1;d<v;++d)h.push(new j(M(n[d]),_(n[d])));h.push(new j(M(c)+f.text.slice(t.ch),_(c))),f.update(f.text.slice(0,e.ch)+M(n[0]),_(n[0])),_t.insert(e.line+1,h)}else if(n.length==1)f.update(f.text.slice(0,e.ch)+M(n[0])+l.text.slice(t.ch),_(n[0])),_t.remove(e.line+1,a,Kt);else{var h=[];f.update(f.text.slice(0,e.ch)+M(n[0]),_(n[0])),l.update(M(c)+l.text.slice(t.ch),_(c));for(var d=1,v=n.length-1;d<v;++d)h.push(new j(M(n[d]),_(n[d])));a>1&&_t.remove(e.line+1,a-1,Kt),_t.insert(e.line+1,h)}if(s.lineWrapping){var m=Math.max(5,Ct.clientWidth/Qr()-3);_t.iter(e.line,e.line+n.length,function(e){if(e.hidden)return;var t=Math.ceil(e.text.length/m)||1;t!=e.height&&vn(e,t)})}else _t.iter(e.line,e.line+n.length,function(e){var t=e.text;!e.hidden&&t.length>u&&(tn=e,u=t.length,rn=!0,o=!1)}),o&&(nn=!0);Dt=Math.min(Dt,e.line),ai(400);var g=n.length-a-1;Xt.push({from:e.line,to:t.line+1,diff:g});if(s.onChange){for(var d=0;d<n.length;++d)typeof n[d]!="string"&&(n[d]=n[d].text);var y={from:e,to:t,text:n};if(Vt){for(var b=Vt;b.next;b=b.next);b.next=y}else Vt=y}hr(mr(r),mr(i),w(Ht.from.line),w(Ht.to.line))}function qn(){var e=_t.height*$r()+2*Gr();return e*.99>Ct.offsetHeight?e:!1}function Rn(e){var t=qn();A.style.display=t?"block":"none",t?(L.style.height=Nt.style.minHeight=t+"px",A.style.height=Ct.clientHeight+"px",e!=null&&(A.scrollTop=Ct.scrollTop=e,g&&setTimeout(function(){if(A.scrollTop!=e)return;A.scrollTop=e+(e?-1:1),A.scrollTop=e},0))):Nt.style.minHeight="",yt.style.top=Qt*$r()+"px"}function Un(){tn=dn(0),rn=!0;var e=tn.text.length;_t.iter(1,_t.size,function(t){var n=t.text;!t.hidden&&n.length>e&&(e=n.length,tn=t)}),nn=!1}function zn(e,t,n){function r(r){if(pt(r,t))return r;if(!pt(n,r))return i;var s=r.line+e.length-(n.line-t.line)-1,o=r.ch;return r.line==n.line&&(o+=lt(e).length-(n.ch-(n.line==t.line?t.ch:0))),{line:s,ch:o}}t=mr(t),n?n=mr(n):n=t,e=St(e);var i;return Xn(e,t,n,function(e){return i=e,{from:r(Ht.from),to:r(Ht.to)}}),i}function Wn(e,t){Xn(St(e),Ht.from,Ht.to,function(e){return t=="end"?{from:e,to:e}:t=="start"?{from:Ht.from,to:Ht.from}:{from:Ht.from,to:e}})}function Xn(e,t,n,r){var i=e.length==1?e[0].length+t.ch:lt(e).length,s=r({line:t.line+e.length-1,ch:i});Hn(t,n,e,s.from,s.to)}function Vn(e,t,n){var r=e.line,i=t.line;if(r==i)return dn(r).text.slice(e.ch,t.ch);var s=[dn(r).text.slice(e.ch)];return _t.iter(r+1,i,function(e){s.push(e.text)}),s.push(dn(i).text.slice(0,t.ch)),s.join(n||"\n")}function $n(e){return Vn(Ht.from,Ht.to,e)}function Jn(){if(sn)return;Lt.set(s.pollInterval,function(){Gn(),Pt&&Jn()})}function Kn(){function t(){var n=Gn();!n&&!e?(e=!0,Lt.set(60,t)):(sn=!1,Jn())}var e=!1;sn=!0,Lt.set(20,t)}function Gn(){if(!Pt||xt(N)||s.readOnly)return!1;var e=N.value;if(e==Qn)return!1;ci||fi(),Bt=null;var t=0,n=Math.min(Qn.length,e.length);while(t<n&&Qn[t]==e[t])++t;return t<Qn.length?Ht.from={line:Ht.from.line,ch:Ht.from.ch-(Qn.length-t)}:Rt&&ht(Ht.from,Ht.to)&&(Ht.to={line:Ht.to.line,ch:Math.min(dn(Ht.to.line).text.length,Ht.to.ch+(e.length-t))}),Wn(e.slice(t),"end"),e.length>1e3?N.value=Qn="":Qn=e,ci||li(),!0}function Yn(e){ht(Ht.from,Ht.to)?e&&(Qn=N.value=""):(Qn="",N.value=$n(),Pt&&ct(N))}function Zn(){s.readOnly!="nocursor"&&N.focus()}function er(){var e=tr();nr(e.x,e.y,e.x,e.yBot);if(!Pt)return;var t=Nt.getBoundingClientRect(),n=null;e.y+t.top<0?n=!0:e.y+t.top+$r()>(window.innerHeight||document.documentElement.clientHeight)&&(n=!1);if(n!=null){var r=B.style.display=="none";r&&(B.style.display="",B.style.left=e.x+"px",B.style.top=e.y-Qt+"px"),B.scrollIntoView(n),r&&(B.style.display="none")}}function tr(){var e=Rr(Ht.inverted?Ht.from:Ht.to),t=s.lineWrapping?Math.min(e.x,rt.offsetWidth):e.x;return{x:t,y:e.y,yBot:e.yBot}}function nr(e,t,n,r){var i=rr(e,t,n,r);i.scrollLeft!=null&&(Ct.scrollLeft=i.scrollLeft),i.scrollTop!=null&&(A.scrollTop=Ct.scrollTop=i.scrollTop)}function rr(e,t,n,r){var i=Yr(),o=Gr();t+=o,r+=o,e+=i,n+=i;var u=Ct.clientHeight,a=A.scrollTop,f={},l=qn()||Infinity,c=t<o+10,h=r+o>l-10;t<a?f.scrollTop=c?0:Math.max(0,t):r>a+u&&(f.scrollTop=(h?l:r)-u);var p=Ct.clientWidth,d=Ct.scrollLeft,v=s.fixedGutter?at.clientWidth:0,m=e<v+i+10;return e<d+v||m?(m&&(e=0),f.scrollLeft=Math.max(0,e-10-v)):n>p+d-3&&(f.scrollLeft=n+10-p),f}function ir(e){var t=$r(),n=(e!=null?e:A.scrollTop)-Gr(),r=Math.max(0,Math.floor(n/t)),i=Math.ceil((n+Ct.clientHeight)/t);return{from:U(_t,r),to:U(_t,i)}}function sr(e,t,n){function d(){var e=P.firstChild,t=!1;return _t.iter(Gt,Yt,function(n){if(!e)return;if(!n.hidden){var r=Math.round(e.offsetHeight/c)||1;n.height!=r&&(vn(n,r),Jt=t=!0)}e=e.nextSibling}),t}if(!Ct.clientWidth){Gt=Yt=Qt=0;return}var r=ir(n);if(e!==!0&&e.length==0&&r.from>Gt&&r.to<Yt){Rn(n);return}var i=Math.max(r.from-100,0),o=Math.min(_t.size,r.to+100);Gt<i&&i-Gt<20&&(i=Gt),Yt>o&&Yt-o<20&&(o=Math.min(_t.size,Yt));var u=e===!0?[]:or([{from:Gt,to:Yt,domStart:0}],e),a=0;for(var f=0;f<u.length;++f){var l=u[f];l.from<i&&(l.domStart+=i-l.from,l.from=i),l.to>o&&(l.to=o),l.from>=l.to?u.splice(f--,1):a+=l.to-l.from}if(a==o-i&&i==Gt&&o==Yt){Rn(n);return}u.sort(function(e,t){return e.domStart-t.domStart});var c=$r(),h=at.style.display;P.style.display="none",ur(i,o,u),P.style.display=at.style.display="";var p=i!=Gt||o!=Yt||Zt!=Ct.clientHeight+c;p&&(Zt=Ct.clientHeight+c),(i!=Gt||o!=Yt&&s.onViewportChange)&&setTimeout(function(){s.onViewportChange&&s.onViewportChange(pn,i,o)}),Gt=i,Yt=o,Qt=z(_t,i),ai(100);if(P.childNodes.length!=Yt-Gt)throw new Error("BAD PATCH! "+JSON.stringify(u)+" size="+(Yt-Gt)+" nodes="+P.childNodes.length);return s.lineWrapping&&d(),at.style.display=h,(p||Jt)&&ar()&&s.lineWrapping&&d()&&ar(),Rn(n),fr(),!t&&s.onUpdate&&s.onUpdate(pn),!0}function or(e,t){for(var n=0,r=t.length||0;n<r;++n){var i=t[n],s=[],o=i.diff||0;for(var u=0,a=e.length;u<a;++u){var f=e[u];i.to<=f.from&&i.diff?s.push({from:f.from+o,to:f.to+o,domStart:f.domStart}):i.to<=f.from||i.from>=f.to?s.push(f):(i.from>f.from&&s.push({from:f.from,to:i.from,domStart:f.domStart}),i.to<f.to&&s.push({from:i.to+o,to:f.to+o,domStart:f.domStart+(i.to-f.from)}))}e=s}return e}function ur(e,t,n){function r(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}if(!n.length)mt(P);else{var i=0,s=P.firstChild,o;for(var u=0;u<n.length;++u){var a=n[u];while(a.domStart>i)s=r(s),i++;for(var f=0,l=a.to-a.from;f<l;++f)s=s.nextSibling,i++}while(s)s=r(s)}var c=n.shift(),s=P.firstChild,f=e;_t.iter(e,t,function(e){c&&c.to==f&&(c=n.shift());if(!c||c.from>f){if(e.hidden)var t=vt("pre");else{var t=mn(e);e.className&&(t.className=e.className);if(e.bgClassName){var r=vt("pre","\u00a0",e.bgClassName,"position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2");t=vt("div",[r,t],null,"position: relative")}}P.insertBefore(t,s)}else s=s.nextSibling;++f})}function ar(){if(!s.gutter&&!s.lineNumbers)return;var e=yt.offsetHeight,t=Ct.clientHeight;at.style.height=(e-t<2?t:e)+"px";var n=document.createDocumentFragment(),r=Gt,i;_t.iter(Gt,Math.max(Yt,Gt+1),function(e){if(e.hidden)n.appendChild(vt("pre"));else{var t=e.gutterMarker,o=s.lineNumbers?s.lineNumberFormatter(r+s.firstLineNumber):null;t&&t.text?o=t.text.replace("%N%",o!=null?o:""):o==null&&(o="\u00a0");var u=n.appendChild(vt("pre",null,t&&t.style));u.innerHTML=o;for(var a=1;a<e.height;++a)u.appendChild(vt("br")),u.appendChild(document.createTextNode("\u00a0"));t||(i=r)}++r}),at.style.display="none",gt(st,n);if(i!=null&&s.lineNumbers){var o=st.childNodes[i-Gt],u=String(_t.size).length,a=ut(o.firstChild),f="";while(a.length+f.length<u)f+="\u00a0";f&&o.insertBefore(document.createTextNode(f),o.firstChild)}at.style.display="";var l=Math.abs((parseInt(rt.style.marginLeft)||0)-at.offsetWidth)>2;return rt.style.marginLeft=at.offsetWidth+"px",Jt=!1,l}function fr(){var e=ht(Ht.from,Ht.to),t=Rr(Ht.from,!0),n=e?t:Rr(Ht.to,!0),r=Ht.inverted?t:n,i=$r(),o=ot(kt),u=ot(P);C.style.top=Math.max(0,Math.min(Ct.offsetHeight,r.y+u.top-o.top))+"px",C.style.left=Math.max(0,Math.min(Ct.offsetWidth,r.x+u.left-o.left))+"px";if(e)B.style.top=r.y+"px",B.style.left=(s.lineWrapping?Math.min(r.x,rt.offsetWidth):r.x)+"px",B.style.display="",H.style.display="none";else{var a=t.y==n.y,f=document.createDocumentFragment(),l=rt.clientWidth||rt.offsetWidth,c=rt.clientHeight||rt.offsetHeight,h=function(e,t,n,r){var i=m?"width: "+(n?l-n-e:l)+"px":"right: "+n+"px";f.appendChild(vt("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; "+i+"; height: "+r+"px"))};if(Ht.from.ch&&t.y>=0){var p=a?l-n.x:0;h(t.x,t.y,p,i)}var d=Math.max(0,t.y+(Ht.from.ch?i:0)),v=Math.min(n.y,c)-d;v>.2*i&&h(0,d,0,v),(!a||!Ht.from.ch)&&n.y<c-.5*i&&h(0,n.y,l-n.x,i),gt(H,f),B.style.display="none",H.style.display=""}}function lr(e){e?Bt=Bt||(Ht.inverted?Ht.to:Ht.from):Bt=null}function cr(e,t){var n=Bt&&mr(Bt);n&&(pt(n,e)?e=n:pt(t,n)&&(t=n)),hr(e,t),Wt=!0}function hr(e,t,n,r){on=null,n==null&&(n=Ht.from.line,r=Ht.to.line);if(ht(Ht.from,e)&&ht(Ht.to,t))return;if(pt(t,e)){var i=t;t=e,e=i}if(e.line!=n){var o=pr(e,n,Ht.from.ch);o?e=o:Fr(e.line,!1)}t.line!=r&&(t=pr(t,r,Ht.to.ch)),ht(e,t)?Ht.inverted=!1:ht(e,Ht.to)?Ht.inverted=!1:ht(t,Ht.from)&&(Ht.inverted=!0);if(s.autoClearEmptyLines&&ht(Ht.from,Ht.to)){var u=Ht.inverted?e:t;if(u.line!=Ht.from.line&&Ht.from.line<_t.size){var a=dn(Ht.from.line);/^\s+$/.test(a.text)&&setTimeout(hi(function(){if(a.parent&&/^\s+$/.test(a.text)){var e=R(a);zn("",{line:e,ch:0},{line:e,ch:a.text.length})}},10))}}Ht.from=e,Ht.to=t,$t=!0}function pr(e,t,n){function r(t){var r=e.line+t,i=t==1?_t.size:-1;while(r!=i){var o=dn(r);if(!o.hidden){var u=e.ch;if(s||u>n||u>o.text.length)u=o.text.length;return{line:r,ch:u}}r+=t}}var i=dn(e.line),s=e.ch==i.text.length&&e.ch!=n;return i.hidden?e.line>=t?r(1)||r(-1):r(-1)||r(1):e}function dr(e,t,n){var r=mr({line:e,ch:t||0});(n?cr:hr)(r,r)}function vr(e){return Math.max(0,Math.min(e,_t.size-1))}function mr(e){if(e.line<0)return{line:0,ch:0};if(e.line>=_t.size)return{line:_t.size-1,ch:dn(_t.size-1).text.length};var t=e.ch,n=dn(e.line).text.length;return t==null||t>n?{line:e.line,ch:n}:t<0?{line:e.line,ch:0}:e}function gr(e,t){function o(){for(var t=r+e,n=e<0?-1:_t.size;t!=n;t+=e){var i=dn(t);if(!i.hidden)return r=t,s=i,!0}}function u(t){if(i==(e<0?0:s.text.length)){if(!!t||!o())return!1;i=e<0?s.text.length:0}else i+=e;return!0}var n=Ht.inverted?Ht.from:Ht.to,r=n.line,i=n.ch,s=dn(r);if(t=="char")u();else if(t=="column")u(!0);else if(t=="word"){var a=!1;for(;;){if(e<0&&!u())break;if(Et(s.text.charAt(i)))a=!0;else if(a){e<0&&(e=1,u());break}if(e>0&&!u())break}}return{line:r,ch:i}}function yr(e,t){var n=e<0?Ht.from:Ht.to;if(Bt||ht(Ht.from,Ht.to))n=gr(e,t);dr(n.line,n.ch,!0)}function br(e,t){ht(Ht.from,Ht.to)?e<0?zn("",gr(e,t),Ht.to):zn("",Ht.from,gr(e,t)):zn("",Ht.from,Ht.to),Wt=!0}function wr(e,t){var n=0,r=Rr(Ht.inverted?Ht.from:Ht.to,!0);on!=null&&(r.x=on);if(t=="page")var i=Math.min(Ct.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Ur(r.x,r.y+i*e);else if(t=="line")var o=$r(),s=Ur(r.x,r.y+.5*o+e*o);t=="page"&&(A.scrollTop+=Rr(s,!0).y-r.y),dr(s.line,s.ch,!0),on=r.x}function Er(e){var t=dn(e.line).text,n=e.ch,r=e.ch;if(t){e.after===!1||r==t.length?--n:++r;var i=t.charAt(n),s=Et(i)?Et:/\s/.test(i)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!Et(e)};while(n>0&&s(t.charAt(n-1)))--n;while(r<t.length&&s(t.charAt(r)))++r}return{from:{line:e.line,ch:n},to:{line:e.line,ch:r}}}function Sr(e){cr({line:e,ch:0},mr({line:e+1,ch:0}))}function xr(e){if(ht(Ht.from,Ht.to))return Tr(Ht.from.line,e);var t=Ht.to.line-(Ht.to.ch?0:1);for(var n=Ht.from.line;n<=t;++n)Tr(n,e)}function Tr(e,t){t||(t="add");if(t=="smart")if(!Mt.indent)t="prev";else var n=oi(e);var r=dn(e),i=r.indentation(s.tabSize),o=r.text.match(/^\s*/)[0],u;t=="smart"&&(u=Mt.indent(n,r.text.slice(o.length),r.text),u==tt&&(t="prev")),t=="prev"?e?u=dn(e-1).indentation(s.tabSize):u=0:t=="add"?u=i+s.indentUnit:t=="subtract"&&(u=i-s.indentUnit),u=Math.max(0,u);var a=u-i,f="",l=0;if(s.indentWithTabs)for(var c=Math.floor(u/s.tabSize);c;--c)l+=s.tabSize,f+=" ";l<u&&(f+=ft(u-l)),f!=o&&zn(f,{line:e,ch:0},{line:e,ch:o.length})}function Nr(){Mt=e.getMode(s,s.mode),_t.iter(0,_t.size,function(e){e.stateAfter=null}),Dt=0,ai(100)}function Cr(){var e=s.gutter||s.lineNumbers;at.style.display=e?"":"none",e?Jt=!0:P.parentNode.style.marginLeft=0}function kr(e,t){if(s.lineWrapping){kt.className+=" CodeMirror-wrap";var n=Ct.clientWidth/Qr()-3;_t.iter(0,_t.size,function(e){if(e.hidden)return;var t=Math.ceil(e.text.length/n)||1;t!=1&&vn(e,t)}),rt.style.minWidth=X.style.left=""}else kt.className=kt.className.replace(" CodeMirror-wrap",""),Un(),_t.iter(0,_t.size,function(e){e.height!=1&&!e.hidden&&vn(e,1)});Xt.push({from:0,to:_t.size})}function Lr(){Ct.className=Ct.className.replace(/\s*cm-s-\S+/g,"")+s.theme.replace(/(^|\s)\s*/g," cm-s-")}function Ar(){var e=a[s.keyMap].style;kt.className=kt.className.replace(/\s*cm-keymap-\S+/g,"")+(e?" cm-keymap-"+e:"")}function Or(e,t){this.lines=[],this.type=e,t&&(this.style=t)}function Mr(e,t,n,r){e=mr(e),t=mr(t);var i=new Or("range",n);r&&r.inclusiveLeft&&(i.inclusiveLeft=!0),r&&r.inclusiveRight&&(i.inclusiveRight=!0);var s=e.line;return _t.iter(s,t.line+1,function(n){var r={from:s==e.line?e.ch:null,to:s==t.line?t.ch:null,marker:i};(n.markedSpans||(n.markedSpans=[])).push(r),i.lines.push(n),++s}),Xt.push({from:e.line,to:t.line+1}),i}function _r(e){e=mr(e);var t=new Or("bookmark"),n=dn(e.line),r={from:e.ch,to:e.ch,marker:t};return(n.markedSpans||(n.markedSpans=[])).push(r),t.lines.push(n),t}function Dr(e){e=mr(e);var t=[],n=dn(e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker)}return t}function Pr(e,t,n){return typeof e=="number"&&(e=dn(vr(e))),e.gutterMarker={text:t,style:n},Jt=!0,e}function Hr(e){typeof e=="number"&&(e=dn(vr(e))),e.gutterMarker=null,Jt=!0}function Br(e,t){var n=e,r=e;return typeof e=="number"?r=dn(vr(e)):n=R(e),n==null?null:t(r,n)?(Xt.push({from:n,to:n+1}),r):null}function jr(e,t,n){return Br(e,function(e){if(e.className!=t||e.bgClassName!=n)return e.className=t,e.bgClassName=n,!0})}function Fr(e,t){return Br(e,function(e,n){if(e.hidden!=t){e.hidden=t,s.lineWrapping||(t&&e.text.length==tn.text.length?nn=!0:!t&&e.text.length>tn.text.length&&(tn=e,nn=!1)),vn(e,t?0:1);var r=Ht.from.line,i=Ht.to.line;if(t&&(r==n||i==n)){var o=r==n?pr({line:r,ch:0},r,0):Ht.from,u=i==n?pr({line:i,ch:0},i,0):Ht.to;if(!u)return;hr(o,u)}return Jt=!0}})}function Ir(e){if(typeof e=="number"){if(!hn(e))return null;var t=e;e=dn(e);if(!e)return null}else{var t=R(e);if(t==null)return null}var n=e.gutterMarker;return{line:t,handle:e,text:e.text,markerText:n&&n.text,markerClass:n&&n.style,lineClass:e.className,bgClass:e.bgClassName}}function qr(e,t){if(t==0)return{top:0,left:0};var n=s.lineWrapping&&t<e.text.length&&it.test(e.text.slice(t-1,t+1)),r=mn(e,t);gt(J,r);var i=r.anchor,o=i.offsetTop,u=i.offsetLeft;if(p&&o==0&&u==0){var a=vt("span","x");i.parentNode.insertBefore(a,i.nextSibling),o=a.offsetTop}return{top:o,left:u}}function Rr(e,t){var n,r=$r(),i=r*(z(_t,e.line)-(t?Qt:0));if(e.ch==0)n=0;else{var o=qr(dn(e.line),e.ch);n=o.left,s.lineWrapping&&(i+=Math.max(0,o.top))}return{x:n,y:i,yBot:i+r}}function Ur(e,t){function h(e){var t=qr(u,e);if(f){var r=Math.round(t.top/n);return c=r!=l,Math.max(0,t.left+(r-l)*Ct.clientWidth)}return t.left}var n=$r(),r=Qr(),i=Qt+Math.floor(t/n);if(i<0)return{line:0,ch:0};var o=U(_t,i);if(o>=_t.size)return{line:_t.size-1,ch:dn(_t.size-1).text.length};var u=dn(o),a=u.text,f=s.lineWrapping,l=f?i-z(_t,o):0;if(e<=0&&l==0)return{line:o,ch:0};var c=!1,p=0,d=0,v=a.length,m,g=Math.min(v,Math.ceil((e+l*Ct.clientWidth*.9)/r));for(;;){var y=h(g);if(!(y<=e&&g<v)){m=y,v=g;break}g=Math.min(v,Math.ceil(g*1.2))}if(e>m)return{line:o,ch:v};g=Math.floor(v*.8),y=h(g),y<e&&(p=g,d=y);for(;;){if(v-p<=1){var b=e-d<m-e;return{line:o,ch:b?p:v,after:b}}var w=Math.ceil((p+v)/2),E=h(w);E>e?(v=w,m=E,c&&(m+=1e3)):(p=w,d=E)}}function zr(e){var t=Rr(e,!0),n=ot(rt);return{x:n.left+t.x,y:n.top+t.y,yBot:n.top+t.yBot}}function $r(){if(Vr==null){Vr=vt("pre");for(var e=0;e<49;++e)Vr.appendChild(document.createTextNode("x")),Vr.appendChild(vt("br"));Vr.appendChild(document.createTextNode("x"))}var t=P.clientHeight;return t==Xr?Wr:(Xr=t,gt(J,Vr.cloneNode(!0)),Wr=J.firstChild.offsetHeight/50||1,mt(J),Wr)}function Qr(){if(Ct.clientWidth==Kr)return Jr;Kr=Ct.clientWidth;var e=vt("span","x"),t=vt("pre",[e]);return gt(J,t),Jr=e.offsetWidth||10}function Gr(){return rt.offsetTop}function Yr(){return rt.offsetLeft}function Zr(e,t){var n=ot(Ct,!0),r,i;try{r=e.clientX,i=e.clientY}catch(e){return null}if(!t&&(r-n.left>Ct.clientWidth||i-n.top>Ct.clientHeight))return null;var s=ot(rt,!0);return Ur(r-s.left,i-s.top)}function ti(e){function i(){C.style.position="relative",N.style.cssText=r,v&&(A.scrollTop=n),Jn();if(N.selectionStart!=null){clearTimeout(ei);var e=N.value=" "+(ht(Ht.from,Ht.to)?"":N.value),t=0;Qn=" ",N.selectionStart=1,N.selectionEnd=e.length,ei=setTimeout(function i(){Qn==" "&&N.selectionStart==0?hi(u.selectAll)(pn):t++<10?ei=setTimeout(i,500):Yn()},200)}}var t=Zr(e),n=A.scrollTop;if(!t||b)return;(ht(Ht.from,Ht.to)||pt(t,Ht.from)||!pt(t,Ht.to))&&hi(dr)(t.line,t.ch);var r=N.style.cssText;C.style.position="absolute",N.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: white; "+"border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Zn(),Yn(!0),ht(Ht.from,Ht.to)&&(N.value=Qn=" ");if(h){K(e);var s=Z(window,"mouseup",function(){s(),setTimeout(i,20)},!0)}else setTimeout(i,50)}function ni(){clearInterval(Ot);var e=!0;B.style.visibility="",Ot=setInterval(function(){B.style.visibility=(e=!e)?"":"hidden"},s.cursorBlinkRate)}function ii(e){function v(e,t,n){if(!e.text)return;var r=e.styles,i=o?0:e.text.length-1,s;for(var a=o?0:r.length-2,f=o?r.length:-2;a!=f;a+=2*u){var l=r[a];if(r[a+1]!=h){i+=u*l.length;continue}for(var c=o?0:l.length-1,v=o?l.length:-1;c!=v;c+=u,i+=u)if(i>=t&&i<n&&d.test(s=l.charAt(c))){var m=ri[s];if(m.charAt(1)==">"==o)p.push(s);else{if(p.pop()!=m.charAt(0))return{pos:i,match:!1};if(!p.length)return{pos:i,match:!0}}}}}var t=Ht.inverted?Ht.from:Ht.to,n=dn(t.line),r=t.ch-1,i=r>=0&&ri[n.text.charAt(r)]||ri[n.text.charAt(++r)];if(!i)return;var s=i.charAt(0),o=i.charAt(1)==">",u=o?1:-1,a=n.styles;for(var f=r+1,l=0,c=a.length;l<c;l+=2)if((f-=a[l].length)<=0){var h=a[l+1];break}var p=[n.text.charAt(r)],d=/[(){}[\]]/;for(var l=t.line,c=o?Math.min(l+100,_t.size):Math.max(-1,l-100);l!=c;l+=u){var n=dn(l),m=l==t.line,g=v(n,m&&o?r+1:0,m&&!o?r:n.text.length);if(g)break}g||(g={pos:null,match:!1});var h=g.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",y=Mr({line:t.line,ch:r},{line:t.line,ch:r+1},h),b=g.pos!=null&&Mr({line:l,ch:g.pos},{line:l,ch:g.pos+1},h),w=hi(function(){y.clear(),b&&b.clear()});e?setTimeout(w,800):en=w}function si(e){var t,n;for(var r=e,i=e-40;r>i;--r){if(r==0)return 0;var o=dn(r-1);if(o.stateAfter)return r;var u=o.indentation(s.tabSize);if(n==null||t>u)n=r-1,t=u}return n}function oi(e){var t=si(e),n=t&&dn(t-1).stateAfter;return n?n=x(Mt,n):n=T(Mt),_t.iter(t,e,function(r){r.process(Mt,n,s.tabSize),r.stateAfter=t==e-1||t%5==0?x(Mt,n):null}),n}function ui(){if(Dt>=Yt)return;var e=+(new Date)+s.workTime,t=x(Mt,oi(Dt)),n=Dt;_t.iter(Dt,Yt,function(n){Dt>=Gt?(n.highlight(Mt,t,s.tabSize),n.stateAfter=x(Mt,t)):(n.process(Mt,t,s.tabSize),n.stateAfter=Dt%5==0?x(Mt,t):null),++Dt;if(+(new Date)>e)return ai(s.workDelay),!0}),Yt>n&&Dt>=Gt&&hi(function(){Xt.push({from:n,to:Dt})})()}function ai(e){Dt<Yt&&At.set(e,ui)}function fi(){zt=Wt=Vt=null,Xt=[],$t=!1,Kt=[]}function li(){nn&&Un();if(rn&&!s.lineWrapping){var e=X.offsetWidth,t=qr(tn,tn.text.length).left;d||(X.style.left=t+"px",rt.style.minWidth=t+e+"px"),rn=!1}var n,r;if($t){var i=tr();n=rr(i.x,i.y,i.x,i.yBot)}if(Xt.length||n&&n.scrollTop!=null)r=sr(Xt,!0,n&&n.scrollTop);r||($t&&fr(),Jt&&ar()),n&&er(),$t&&ni(),Pt&&(zt===!0||zt!==!1&&$t)&&Yn(Wt),$t&&s.matchBrackets&&setTimeout(hi(function(){en&&(en(),en=null),ht(Ht.from,Ht.to)&&ii(!1)}),20);var o=$t,u=Kt;Vt&&s.onChange&&pn&&s.onChange(pn,Vt),o&&s.onCursorActivity&&s.onCursorActivity(pn);for(var a=0;a<u.length;++a)u[a](pn);r&&s.onUpdate&&s.onUpdate(pn)}function hi(e){return function(){ci++||fi();try{var t=e.apply(this,arguments)}finally{--ci||li()}return t}}function pi(e){un.startCompound();try{return e()}finally{un.endCompound()}}var s={},y=e.defaults;for(var w in y)y.hasOwnProperty(w)&&(s[w]=(i&&i.hasOwnProperty(w)?i:y)[w]);var N=vt("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em");N.setAttribute("wrap","off"),N.setAttribute("autocorrect","off"),N.setAttribute("autocapitalize","off");var C=vt("div",[N],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),L=vt("div",null,"CodeMirror-scrollbar-inner"),A=vt("div",[L],"CodeMirror-scrollbar"),P=vt("div"),H=vt("div",null,null,"position: relative; z-index: -1"),B=vt("pre","\u00a0","CodeMirror-cursor"),X=vt("pre","\u00a0","CodeMirror-cursor","visibility: hidden"),J=vt("div",null,null,"position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden;"),rt=vt("div",[J,B,X,H,P],null,"position: relative; z-index: 0"),st=vt("div",null,"CodeMirror-gutter-text"),at=vt("div",[st],"CodeMirror-gutter"),yt=vt("div",[at,vt("div",[rt],"CodeMirror-lines")],null,"position: relative"),Nt=vt("div",[yt],null,"position: relative"),Ct=vt("div",[Nt],"CodeMirror-scroll");Ct.setAttribute("tabIndex","-1");var kt=vt("div",[C,A,Ct],"CodeMirror"+(s.lineWrapping?" CodeMirror-wrap":""));r.appendChild?r.appendChild(kt):r(kt),Lr(),Ar(),t&&(N.style.width="0px"),g||(Ct.draggable=!0),rt.style.outline="none",s.tabindex!=null&&(N.tabIndex=s.tabindex),s.autofocus&&Zn(),!s.gutter&&!s.lineNumbers&&(at.style.display="none"),E&&(C.style.height="1px",C.style.position="absolute"),S?(A.style.zIndex=-2,A.style.visibility="hidden"):d&&(A.style.minWidth="18px");var Lt=new et,At=new et,Ot,Mt,_t=new I([new F([new j("")])]),Dt=0,Pt;Nr();var Ht={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},Bt,jt,Ft,It=0,qt,Rt=!1,Ut=!1,zt,Wt,Xt,Vt,$t,Jt,Kt,Qt=0,Gt=0,Yt=0,Zt=0,en,tn=dn(0),nn=!1,rn=!0,sn=!1,on=null;hi(function(){gn(s.value||""),zt=!1})();var un=new W;Z(Ct,"mousedown",hi(En)),Z(Ct,"dblclick",hi(Sn)),Z(rt,"selectstart",$),h||Z(Ct,"contextmenu",ti),Z(Ct,"scroll",wn),Z(A,"scroll",bn),Z(A,"mousedown",function(){Pt&&setTimeout(Zn,0)});var an=Z(window,"resize",function(){kt.parentNode?sr(!0):an()},!0);Z(N,"keyup",hi(_n)),Z(N,"input",Kn),Z(N,"keydown",hi(On)),Z(N,"keypress",hi(Mn)),Z(N,"focus",Dn),Z(N,"blur",Pn),s.dragDrop&&(Z(Ct,"dragstart",Tn),Z(Ct,"dragenter",fn),Z(Ct,"dragover",fn),Z(Ct,"drop",hi(xn))),Z(Ct,"paste",function(){Zn(),Kn()}),Z(N,"paste",Kn),Z(N,"cut",hi(function(){s.readOnly||Wn("")})),E&&Z(Nt,"mouseup",function(){document.activeElement==N&&N.blur(),Zn()});var ln;try{ln=document.activeElement==N}catch(cn){}ln||s.autofocus?setTimeout(Dn,20):Pn();var pn=kt.CodeMirror={getValue:yn,setValue:hi(gn),getSelection:$n,replaceSelection:hi(Wn),focus:function(){window.focus(),Zn(),Dn(),Kn()},setOption:function(e,t){var n=s[e];s[e]=t,e=="mode"||e=="indentUnit"?Nr():e=="readOnly"&&t=="nocursor"?(Pn(),N.blur()):e=="readOnly"&&!t?Yn(!0):e=="theme"?Lr():e=="lineWrapping"&&n!=t?hi(kr)():e=="tabSize"?sr(!0):e=="keyMap"&&Ar();if(e=="lineNumbers"||e=="gutter"||e=="firstLineNumber"||e=="theme"||e=="lineNumberFormatter")Cr(),sr(!0)},getOption:function(e){return s[e]},undo:hi(jn),redo:hi(Fn),indentLine:hi(function(e,t){typeof t!="string"&&(t==null?t=s.smartIndent?"smart":"prev":t=t?"add":"subtract"),hn(e)&&Tr(e,t)}),indentSelection:hi(xr),historySize:function(){return{undo:un.done.length,redo:un.undone.length}},clearHistory:function(){un=new W},setHistory:function(e){un=new W,un.done=e.done,un.undone=e.undone},getHistory:function(){return un.time=0,{done:un.done.concat([]),undone:un.undone.concat([])}},matchBrackets:hi(function(){ii(!0)}),getTokenAt:hi(function(e){return e=mr(e),dn(e.line).getTokenAt(Mt,oi(e.line),s.tabSize,e.ch)}),getStateAfter:function(e){return e=vr(e==null?_t.size-1:e),oi(e+1)},cursorCoords:function(e,t){return e==null&&(e=Ht.inverted),this.charCoords(e?Ht.from:Ht.to,t)},charCoords:function(e,t){return e=mr(e),t=="local"?Rr(e,!1):t=="div"?Rr(e,!0):zr(e)},coordsChar:function(e){var t=ot(rt);return Ur(e.x-t.left,e.y-t.top)},markText:hi(Mr),setBookmark:_r,findMarksAt:Dr,setMarker:hi(Pr),clearMarker:hi(Hr),setLineClass:hi(jr),hideLine:hi(function(e){return Fr(e,!0)}),showLine:hi(function(e){return Fr(e,!1)}),onDeleteLine:function(e,t){if(typeof e=="number"){if(!hn(e))return null;e=dn(e)}return(e.handlers||(e.handlers=[])).push(t),e},lineInfo:Ir,getViewport:function(){return{from:Gt,to:Yt}},addWidget:function(e,t,n,r,i){e=Rr(mr(e));var s=e.yBot,o=e.x;t.style.position="absolute",Nt.appendChild(t);if(r=="over")s=e.y;else if(r=="near"){var u=Math.max(Ct.offsetHeight,_t.height*$r()),a=Math.max(Nt.clientWidth,rt.clientWidth)-Yr();e.yBot+t.offsetHeight>u&&e.y>t.offsetHeight&&(s=e.y-t.offsetHeight),o+t.offsetWidth>a&&(o=a-t.offsetWidth)}t.style.top=s+Gr()+"px",t.style.left=t.style.right="",i=="right"?(o=Nt.clientWidth-t.offsetWidth,t.style.right="0px"):(i=="left"?o=0:i=="middle"&&(o=(Nt.clientWidth-t.offsetWidth)/2),t.style.left=o+Yr()+"px"),n&&nr(o,s,o+t.offsetWidth,s+t.offsetHeight)},lineCount:function(){return _t.size},clipPos:mr,getCursor:function(e){return e==null&&(e=Ht.inverted),dt(e?Ht.from:Ht.to)},somethingSelected:function(){return!ht(Ht.from,Ht.to)},setCursor:hi(function(e,t,n){t==null&&typeof e.line=="number"?dr(e.line,e.ch,n):dr(e,t,n)}),setSelection:hi(function(e,t,n){(n?cr:hr)(mr(e),mr(t||e))}),getLine:function(e){if(hn(e))return dn(e).text},getLineHandle:function(e){if(hn(e))return dn(e)},setLine:hi(function(e,t){hn(e)&&zn(t,{line:e,ch:0},{line:e,ch:dn(e).text.length})}),removeLine:hi(function(e){hn(e)&&zn("",{line:e,ch:0},mr({line:e+1,ch:0}))}),replaceRange:hi(zn),getRange:function(e,t,n){return Vn(mr(e),mr(t),n)},triggerOnKeyDown:hi(On),execCommand:function(e){return u[e](pn)},moveH:hi(yr),deleteH:hi(br),moveV:hi(wr),toggleOverwrite:function(){Rt?(Rt=!1,B.className=B.className.replace(" CodeMirror-overwrite","")):(Rt=!0,B.className+=" CodeMirror-overwrite")},posFromIndex:function(e){var t=0,n;return _t.iter(0,_t.size,function(r){var i=r.text.length+1;if(i>e)return n=e,!0;e-=i,++t}),mr({line:t,ch:n})},indexFromPos:function(e){if(e.line<0||e.ch<0)return 0;var t=e.ch;return _t.iter(0,e.line,function(e){t+=e.text.length+1}),t},scrollTo:function(e,t){e!=null&&(Ct.scrollLeft=e),t!=null&&(A.scrollTop=Ct.scrollTop=t),sr([])},getScrollInfo:function(){return{x:Ct.scrollLeft,y:A.scrollTop,height:A.scrollHeight,width:Ct.scrollWidth}},setSize:function(e,t){function n(e){return e=String(e),/^\d+$/.test(e)?e+"px":e}e!=null&&(kt.style.width=n(e)),t!=null&&(Ct.style.height=n(t)),pn.refresh()},operation:function(e){return hi(e)()},compoundChange:function(e){return pi(e)},refresh:function(){sr(!0,null,It),A.scrollHeight>It&&(A.scrollTop=It)},getInputField:function(){return N},getWrapperElement:function(){return kt},getScrollerElement:function(){return Ct},getGutterElement:function(){return at}},Cn,An=null,Qn="";Or.prototype.clear=hi(function(){var e=Infinity,t=-Infinity;for(var n=0;n<this.lines.length;++n){var r=this.lines[n],i=k(r.markedSpans,this,!0);if(i.from!=null||i.to!=null){var s=R(r);e=Math.min(e,s),t=Math.max(t,s)}}e!=Infinity&&Xt.push({from:e,to:t+1}),this.lines.length=0}),Or.prototype.find=function(){var e,t;for(var n=0;n<this.lines.length;++n){var r=this.lines[n],i=k(r.markedSpans,this);if(i.from!=null||i.to!=null){var s=R(r);i.from!=null&&(e={line:s,ch:i.from}),i.to!=null&&(t={line:s,ch:i.to})}}return this.type=="bookmark"?e:e&&{from:e,to:t}};var Wr,Xr,Vr,Jr,Kr=0,ei,ri={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},ci=0;for(var di in o)o.propertyIsEnumerable(di)&&!pn.propertyIsEnumerable(di)&&(pn[di]=o[di]);return pn}function f(e){return typeof e=="string"?a[e]:e}function l(e,t,n,r,i){function s(t){t=f(t);var n=t[e];if(n===!1)return i&&i(),!0;if(n!=null&&r(n))return!0;if(t.nofallthrough)return i&&i(),!0;var o=t.fallthrough;if(o==null)return!1;if(Object.prototype.toString.call(o)!="[object Array]")return s(o);for(var u=0,a=o.length;u<a;++u)if(s(o[u]))return!0;return!1}return t&&s(t)?!0:s(n)}function c(e){var t=Tt[Y(e,"keyCode")];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function x(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function T(e,t,n){return e.startState?e.startState(t,n):!0}function N(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8}function C(e,t,n){this.from=e,this.to=t,this.marker=n}function k(e,t,n){if(e)for(var r=0;r<e.length;++r){var i=e[r];if(i.marker==t)return n&&e.splice(r,1),i}}function L(e,t,n){if(e)for(var r=0,i;r<e.length;++r){var s=e[r],o=s.marker,u=s.from==null||(o.inclusiveLeft?s.from<=t:s.from<t);if(u||o.type=="bookmark"&&s.from==t&&s.from!=n){var a=s.to==null||(o.inclusiveRight?s.to>=t:s.to>t);(i||(i=[])).push({from:s.from,to:a?null:s.to,marker:o})}}return i}function A(e,t){if(e)for(var n=0,r;n<e.length;++n){var i=e[n],s=i.marker,o=i.to==null||(s.inclusiveRight?i.to>=t:i.to>t);if(o||s.type=="bookmark"&&i.from==t){var u=i.from==null||(s.inclusiveLeft?i.from<=t:i.from<t);(r||(r=[])).push({from:u?null:i.from-t,to:i.to==null?null:i.to-t,marker:s})}}return r}function O(e,t,n,r,i){if(!e&&!t)return i;var s=L(e,n),o=A(t,r),u=i.length==1,a=lt(i).length+(u?n:0);if(s)for(var f=0;f<s.length;++f){var l=s[f];if(l.to==null){var c=k(o,l.marker);c?u&&(l.to=c.to==null?null:c.to+a):l.to=n}}if(o)for(var f=0;f<o.length;++f){var l=o[f];l.to!=null&&(l.to+=a);if(l.from==null){var c=k(s,l.marker);c||(l.from=a,u&&(s||(s=[])).push(l))}else l.from+=a,u&&(s||(s=[])).push(l)}var h=[D(i[0],s)];if(!u){var p=i.length-2,d;if(p>0&&s)for(var f=0;f<s.length;++f)s[f].to==null&&(d||(d=[])).push({from:null,to:null,marker:s[f].marker});for(var f=0;f<p;++f)h.push(D(i[f+1],d));h.push(D(lt(i),o))}return h}function M(e){return typeof e=="string"?e:e.text}function _(e){return typeof e=="string"?null:e.markedSpans}function D(e,t){return t?{text:e,markedSpans:t}:e}function P(e){var t=e.markedSpans;if(!t)return;for(var n=0;n<t.length;++n){var r=t[n].marker.lines,i=wt(r,e);r.splice(i,1)}e.markedSpans=null}function H(e,t){if(!t)return;for(var n=0;n<t.length;++n)var r=t[n].marker.lines.push(e);e.markedSpans=t}function j(e,t){this.text=e,this.height=1,H(this,t)}function F(e){this.lines=e,this.parent=null;for(var t=0,n=e.length,r=0;t<n;++t)e[t].parent=this,r+=e[t].height;this.height=r}function I(e){this.children=e;var t=0,n=0;for(var r=0,i=e.length;r<i;++r){var s=e[r];t+=s.chunkSize(),n+=s.height,s.parent=this}this.size=t,this.height=n,this.parent=null}function q(e,t){while(!e.lines)for(var n=0;;++n){var r=e.children[n],i=r.chunkSize();if(t<i){e=r;break}t-=i}return e.lines[t]}function R(e){if(e.parent==null)return null;var t=e.parent,n=wt(t.lines,e);for(var r=t.parent;r;t=r,r=r.parent)for(var i=0,s=r.children.length;;++i){if(r.children[i]==t)break;n+=r.children[i].chunkSize()}return n}function U(e,t){var n=0;e:do{for(var r=0,i=e.children.length;r<i;++r){var s=e.children[r],o=s.height;if(t<o){e=s;continue e}t-=o,n+=s.chunkSize()}return n}while(!e.lines);for(var r=0,i=e.lines.length;r<i;++r){var u=e.lines[r],a=u.height;if(t<a)break;t-=a}return n+r}function z(e,t){var n=0;e:do{for(var r=0,i=e.children.length;r<i;++r){var s=e.children[r],o=s.chunkSize();if(t<o){e=s;continue e}t-=o,n+=s.height}return n}while(!e.lines);for(var r=0;r<t;++r)n+=e.lines[r].height;return n}function W(){this.time=0,this.done=[],this.undone=[],this.compound=0,this.closed=!1}function X(){K(this)}function V(e){return e.stop||(e.stop=X),e}function $(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function J(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function K(e){$(e),J(e)}function Q(e){return e.target||e.srcElement}function G(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),n&&e.ctrlKey&&t==1&&(t=3),t}function Y(e,t){var n=e.override&&e.override.hasOwnProperty(t);return n?e.override[t]:e[t]}function Z(e,t,n,r){if(typeof e.addEventListener=="function"){e.addEventListener(t,n,!1);if(r)return function(){e.removeEventListener(t,n,!1)}}else{var i=function(e){n(e||window.event)};e.attachEvent("on"+t,i);if(r)return function(){e.detachEvent("on"+t,i)}}}function et(){this.id=null}function st(e,t,n){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var r=0,i=0;r<t;++r)e.charAt(r)==" "?i+=n-i%n:++i;return i}function ot(e,t){try{var n=e.getBoundingClientRect();n={top:n.top,left:n.left}}catch(r){n={top:0,left:0}}if(!t)if(window.pageYOffset==null){var i=document.documentElement||document.body.parentNode;i.scrollTop==null&&(i=document.body),n.top+=i.scrollTop,n.left+=i.scrollLeft}else n.top+=window.pageYOffset,n.left+=window.pageXOffset;return n}function ut(e){return e.textContent||e.innerText||e.nodeValue||""}function ft(e){while(at.length<=e)at.push(lt(at)+" ");return at[e]}function lt(e){return e[e.length-1]}function ct(e){t?(e.selectionStart=0,e.selectionEnd=e.value.length):e.select()}function ht(e,t){return e.line==t.line&&e.ch==t.ch}function pt(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function dt(e){return{line:e.line,ch:e.ch}}function vt(e,t,n,r){var i=document.createElement(e);n&&(i.className=n),r&&(i.style.cssText=r);if(typeof t=="string")yt(i,t);else if(t)for(var s=0;s<t.length;++s)i.appendChild(t[s]);return i}function mt(e){return e.innerHTML="",e}function gt(e,t){mt(e).appendChild(t)}function yt(e,t){v?(e.innerHTML="",e.appendChild(document.createTextNode(t))):e.textContent=t}function bt(e,t){if(!t)return 0;if(!e)return t.length;for(var n=e.length,r=t.length;n>=0&&r>=0;--n,--r)if(e.charAt(n)!=t.charAt(r))break;return r+1}function wt(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;++n)if(e[n]==t)return n;return-1}function Et(e){return/\w/.test(e)||e.toUpperCase()!=e.toLowerCase()}e.defaults={value:"",mode:null,theme:"default",indentUnit:2,indentWithTabs:!1,smartIndent:!0,tabSize:4,keyMap:"default",extraKeys:null,electricChars:!0,autoClearEmptyLines:!1,onKeyEvent:null,onDragEvent:null,lineWrapping:!1,lineNumbers:!1,gutter:!1,fixedGutter:!1,firstLineNumber:1,readOnly:!1,dragDrop:!0,onChange:null,onCursorActivity:null,onViewportChange:null,onGutterClick:null,onUpdate:null,onFocus:null,onBlur:null,onScroll:null,matchBrackets:!1,cursorBlinkRate:530,workTime:100,workDelay:200,pollInterval:100,undoDepth:40,tabindex:null,autofocus:null,lineNumberFormatter:function(e){return e}};var t=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),n=t||/Mac/.test(navigator.platform),r=/Win/.test(navigator.platform),i=e.modes={},s=e.mimeModes={};e.defineMode=function(t,n){!e.defaults.mode&&t!="null"&&(e.defaults.mode=t);if(arguments.length>2){n.dependencies=[];for(var r=2;r<arguments.length;++r)n.dependencies.push(arguments[r])}i[t]=n},e.defineMIME=function(e,t){s[e]=t},e.resolveMode=function(t){if(typeof t=="string"&&s.hasOwnProperty(t))t=s[t];else if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return typeof t=="string"?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=i[n.name];return r?r(t,n):e.getMode(t,"text/plain")},e.listModes=function(){var e=[];for(var t in i)i.propertyIsEnumerable(t)&&e.push(t);return e},e.listMIMEs=function(){var e=[];for(var t in s)s.propertyIsEnumerable(t)&&e.push({mime:t,mode:s[t]});return e};var o=e.extensions={};e.defineExtension=function(e,t){o[e]=t};var u=e.commands={selectAll:function(e){e.setSelection({line:0,ch:0},{line:e.lineCount()-1})},killLine:function(e){var t=e.getCursor(!0),n=e.getCursor(!1),r=!ht(t,n);!r&&e.getLine(t.line).length==t.ch?e.replaceRange("",t,{line:t.line+1,ch:0}):e.replaceRange("",t,r?n:{line:t.line})},deleteLine:function(e){var t=e.getCursor().line;e.replaceRange("",{line:t,ch:0},{line:t})},undo:function(e){e.undo()},redo:function(e){e.redo()},goDocStart:function(e){e.setCursor(0,0,!0)},goDocEnd:function(e){e.setSelection({line:e.lineCount()-1},null,!0)},goLineStart:function(e){e.setCursor(e.getCursor().line,0,!0)},goLineStartSmart:function(e){var t=e.getCursor(),n=e.getLine(t.line),r=Math.max(0,n.search(/\S/));e.setCursor(t.line,t.ch<=r&&t.ch?0:r,!0)},goLineEnd:function(e){e.setSelection({line:e.getCursor().line},null,!0)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goWordRight:function(e){e.moveH(1,"word")},delCharLeft:function(e){e.deleteH(-1,"char")},delCharRight:function(e){e.deleteH(1,"char")},delWordLeft:function(e){e.deleteH(-1,"word")},delWordRight:function(e){e.deleteH(1,"word")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ","end")},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.replaceSelection(" ","end")},transposeChars:function(e){var t=e.getCursor(),n=e.getLine(t.line);t.ch>0&&t.ch<n.length-1&&e.replaceRange(n.charAt(t.ch)+n.charAt(t.ch-1),{line:t.line,ch:t.ch-1},{line:t.line,ch:t.ch+1})},newlineAndIndent:function(e){e.replaceSelection("\n","end"),e.indentLine(e.getCursor().line)},toggleOverwrite:function(e){e.toggleOverwrite()}},a=e.keyMap={};a.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharRight",Backspace:"delCharLeft",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},a.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"},a.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"]},a["default"]=n?a.macDefault:a.pcDefault,a.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"},e.fromTextArea=function(t,n){function s(){t.value=a.getValue()}n||(n={}),n.value=t.value,!n.tabindex&&t.tabindex&&(n.tabindex=t.tabindex);if(n.autofocus==null){var r=document.body;try{r=document.activeElement}catch(i){}n.autofocus=r==t||t.getAttribute("autofocus")!=null&&r==document.body}if(t.form){var o=Z(t.form,"submit",s,!0);if(typeof t.form.submit=="function"){var u=t.form.submit;t.form.submit=function f(){s(),t.form.submit=u,t.form.submit(),t.form.submit=f}}}t.style.display="none";var a=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},n);return a.save=s,a.getTextArea=function(){return t},a.toTextArea=function(){s(),t.parentNode.removeChild(a.getWrapperElement()),t.style.display="",t.form&&(o(),typeof t.form.submit=="function"&&(t.form.submit=u))},a};var h=/gecko\/\d{7}/i.test(navigator.userAgent),p=/MSIE \d/.test(navigator.userAgent),d=/MSIE [1-7]\b/.test(navigator.userAgent),v=/MSIE [1-8]\b/.test(navigator.userAgent),m=p&&document.documentMode==5,g=/WebKit\//.test(navigator.userAgent),y=/Chrome\//.test(navigator.userAgent),b=/Opera\//.test(navigator.userAgent),w=/Apple Computer/.test(navigator.vendor),E=/KHTML\//.test(navigator.userAgent),S=/Mac OS X 10\D([7-9]|\d\d)\D/.test(navigator.userAgent);e.copyState=x,e.startState=T,N.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(e){var t=this.string.charAt(this.pos);if(typeof e=="string")var n=t==e;else var n=t&&(e.test?e.test(t):e(t));if(n)return++this.pos,t},eatWhile:function(e){var t=this.pos;while(this.eat(e));return this.pos>t},eatSpace:function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return st(this.string,this.start,this.tabSize)},indentation:function(){return st(this.string,null,this.tabSize)},match:function(e,t,n){if(typeof e!="string"){var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&t!==!1&&(this.pos+=i[0].length),i)}var r=function(e){return n?e.toLowerCase():e};if(r(this.string).indexOf(r(e),this.pos)==this.pos)return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)}},e.StringStream=N;var B=" ";h||p&&!d?B="\u200b":b&&(B=""),j.prototype={update:function(e,t){this.text=e,this.stateAfter=this.styles=null,P(this),H(this,t)},highlight:function(e,t,n){var r=new N(this.text,n),i=this.styles||(this.styles=[]),s=i.length=0;this.text==""&&e.blankLine&&e.blankLine(t);while(!r.eol()){var o=e.token(r,t),u=r.current();r.start=r.pos,s&&i[s-1]==o?i[s-2]+=u:u&&(i[s++]=u,i[s++]=o);if(r.pos>5e3){i[s++]=this.text.slice(r.pos),i[s++]=null;break}}},process:function(e,t,n){var r=new N(this.text,n);this.text==""&&e.blankLine&&e.blankLine(t);while(!r.eol()&&r.pos<=5e3)e.token(r,t),r.start=r.pos},getTokenAt:function(e,t,n,r){var i=this.text,s=new N(i,n);while(s.pos<r&&!s.eol()){s.start=s.pos;var o=e.token(s,t)}return{start:s.start,end:s.pos,string:s.current(),className:o||null,state:t}},indentation:function(e){return st(this.text,null,e)},getContent:function(e,t,n){function u(t,n,o){if(!n)return;r&&p&&n.charAt(0)==" "&&(n="\u00a0"+n.slice(1)),r=!1;if(!s.test(n)){i+=n.length;var u=document.createTextNode(n)}else{var u=document.createDocumentFragment(),a=0;for(;;){s.lastIndex=a;var f=s.exec(n),l=f?f.index-a:n.length-a;l&&(u.appendChild(document.createTextNode(n.slice(a,a+l))),i+=l);if(!f)break;a+=l+1;if(f[0]==" "){var c=e-i%e;u.appendChild(vt("span",ft(c),"cm-tab")),i+=c}else{var h=vt("span","\u2022","cm-invalidchar");h.title="\\u"+f[0].charCodeAt(0).toString(16),u.appendChild(h),i+=1}}}o?t.appendChild(vt("span",[u],o)):t.appendChild(u)}function m(e){return e?"cm-"+e.replace(/ +/g," cm-"):null}var r=!0,i=0,s=/[\t\u0000-\u0019\u200b\u2028\u2029\uFEFF]/g,o=vt("pre"),a=u;if(t!=null){var f=0,l=o.anchor=vt("span");a=function(e,r,i){var s=r.length;if(t>=f&&t<f+s){t>f&&(u(e,r.slice(0,t-f),i),n&&e.appendChild(vt("wbr"))),e.appendChild(l);var o=t-f;u(l,b?r.slice(o,o+1):r.slice(o),i),b&&u(e,r.slice(o+1),i),t--,f+=s}else f+=s,u(e,r,i),f==t&&f==v?(yt(l,B),e.appendChild(l)):f>t+10&&/\s/.test(r)&&(a=function(){})}}var c=this.styles,h=this.text,d=this.markedSpans,v=h.length;if(!h&&t==null)a(o," ");else if(!d||!d.length)for(var g=0,y=0;y<v;g+=2){var w=c[g],E=c[g+1],S=w.length;y+S>v&&(w=w.slice(0,v-y)),y+=S,a(o,w,m(E))}else{d.sort(function(e,t){return e.from-t.from});var x=0,g=0,T="",E,N=0,C=d[0].from||0,k=[],L=0,A=function(){var e;while(L<d.length&&((e=d[L]).from==x||e.from==null))e.marker.style!=null&&k.push(e),++L;C=L<d.length?d[L].from:Infinity;for(var t=0;t<k.length;++t){var n=k[t].to;n==null&&(n=Infinity),n==x?k.splice(t--,1):C=Math.min(n,C)}},O=0;while(x<v){C==x&&A();var M=Math.min(v,C);for(;;){if(T){var _=x+T.length,D=E;for(var P=0;P<k.length;++P)D=(D?D+" ":"")+k[P].marker.style;a(o,_>M?T.slice(0,M-x):T,D);if(_>=M){T=T.slice(M-x),x=M;break}x=_}T=c[g++],E=m(c[g++])}}}return o},cleanUp:function(){this.parent=null,P(this)}},F.prototype={chunkSize:function(){return this.lines.length},remove:function(e,t,n){for(var r=e,i=e+t;r<i;++r){var s=this.lines[r];this.height-=s.height,s.cleanUp();if(s.handlers)for(var o=0;o<s.handlers.length;++o)n.push(s.handlers[o])}this.lines.splice(e,t)},collapse:function(e){e.splice.apply(e,[e.length,0].concat(this.lines))},insertHeight:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0,i=t.length;r<i;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},I.prototype={chunkSize:function(){return this.size},remove:function(e,t,n){this.size-=t;for(var r=0;r<this.children.length;++r){var i=this.children[r],s=i.chunkSize();if(e<s){var o=Math.min(t,s-e),u=i.height;i.remove(e,o,n),this.height-=u-i.height,s==o&&(this.children.splice(r--,1),i.parent=null);if((t-=o)==0)break;e=0}else e-=s}if(this.size-t<25){var a=[];this.collapse(a),this.children=[new F(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0,n=this.children.length;t<n;++t)this.children[t].collapse(e)},insert:function(e,t){var n=0;for(var r=0,i=t.length;r<i;++r)n+=t[r].height;this.insertHeight(e,t,n)},insertHeight:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0,i=this.children.length;r<i;++r){var s=this.children[r],o=s.chunkSize();if(e<=o){s.insertHeight(e,t,n);if(s.lines&&s.lines.length>50){while(s.lines.length>50){var u=s.lines.splice(s.lines.length-25,25),a=new F(u);s.height-=a.height,this.children.splice(r+1,0,a),a.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new I(t);if(!e.parent){var r=new I(e.children);r.parent=e,e.children=[r,n],e=r}else{e.size-=n.size,e.height-=n.height;var i=wt(e.parent.children,e);e.parent.children.splice(i+1,0,n)}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iter:function(e,t,n){this.iterN(e,t-e,n)},iterN:function(e,t,n){for(var r=0,i=this.children.length;r<i;++r){var s=this.children[r],o=s.chunkSize();if(e<o){var u=Math.min(t,o-e);if(s.iterN(e,u,n))return!0;if((t-=u)==0)break;e=0}else e-=o}}},W.prototype={addChange:function(e,t,n){this.undone.length=0;var r=+(new Date),i=lt(this.done),s=i&<(i),o=r-this.time;if(this.compound&&i&&!this.closed)i.push({start:e,added:t,old:n});else if(o>400||!s||this.closed||s.start>e+n.length||s.start+s.added<e)this.done.push([{start:e,added:t,old:n}]),this.closed=!1;else{var u=Math.max(0,s.start-e),a=Math.max(0,e+n.length-(s.start+s.added));for(var f=u;f>0;--f)s.old.unshift(n[f-1]);for(var f=a;f>0;--f)s.old.push(n[n.length-f]);u&&(s.start=e),s.added+=t-(n.length-u-a)}this.time=r},startCompound:function(){this.compound++||(this.closed=!0)},endCompound:function(){--this.compound||(this.closed=!0)}},e.e_stop=K,e.e_preventDefault=$,e.e_stopPropagation=J,e.connect=Z,et.prototype={set:function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)}};var tt=e.Pass={toString:function(){return"CodeMirror.Pass"}},nt=function(){if(v)return!1;var e=vt("div");return"draggable"in e||"dragDrop"in e}(),rt=function(){var e=vt("textarea");return e.value="foo\nbar",e.value.indexOf("\r")>-1?"\r\n":"\n"}(),it=/^$/;h?it=/$'/:w?it=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:y&&(it=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/);var at=[""],St="\n\nb".split(/\n/).length!=3?function(e){var t=0,n=[],r=e.length;while(t<=r){var i=e.indexOf("\n",t);i==-1&&(i=e.length);var s=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),o=s.indexOf("\r");o!=-1?(n.push(s.slice(0,o)),t+=o+1):(n.push(s),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)};e.splitLines=St;var xt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0};e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var Tt={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",109:"-",107:"=",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 e.keyNames=Tt,function(){for(var e=0;e<10;e++)Tt[e+48]=String(e);for(var e=65;e<=90;e++)Tt[e]=String.fromCharCode(e);for(var e=1;e<=12;e++)Tt[e+111]=Tt[e+63235]="F"+e}(),e.version="2.33 +",e}(),CodeMirror.defineMode("clike",function(e,t){function c(e,t){var n=e.next();if(u[n]){var a=u[n](e,t);if(a!==!1)return a}if(n=='"'||n=="'")return t.tokenize=h(n),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(n))return l=n,null;if(/\d/.test(n))return e.eatWhile(/[\w\.]/),"number";if(n=="/"){if(e.eat("*"))return t.tokenize=p,p(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(f.test(n))return e.eatWhile(f),"operator";e.eatWhile(/[\w\$_]/);var c=e.current();return r.propertyIsEnumerable(c)?(s.propertyIsEnumerable(c)&&(l="newstatement"),"keyword"):i.propertyIsEnumerable(c)?(s.propertyIsEnumerable(c)&&(l="newstatement"),"builtin"):o.propertyIsEnumerable(c)?"atom":"variable"}function h(e){return function(t,n){var r=!1,i,s=!1;while((i=t.next())!=null){if(i==e&&!r){s=!0;break}r=!r&&i=="\\"}if(s||!r&&!a)n.tokenize=null;return"string"}}function p(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=null;break}n=r=="*"}return"comment"}function d(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function v(e,t,n){return e.context=new d(e.indented,t,n,null,e.context)}function m(e){var t=e.context.type;if(t==")"||t=="]"||t=="}")e.indented=e.context.indented;return e.context=e.context.prev}var n=e.indentUnit,r=t.keywords||{},i=t.builtin||{},s=t.blockKeywords||{},o=t.atoms||{},u=t.hooks||{},a=t.multiLineStrings,f=/[+\-*&%=<>!?|\/]/,l;return{startState:function(e){return{tokenize:null,context:new d((e||0)-n,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;e.sol()&&(n.align==null&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0);if(e.eatSpace())return null;l=null;var r=(t.tokenize||c)(e,t);if(r=="comment"||r=="meta")return r;n.align==null&&(n.align=!0);if(l!=";"&&l!=":"||n.type!="statement")if(l=="{")v(t,e.column(),"}");else if(l=="[")v(t,e.column(),"]");else if(l=="(")v(t,e.column(),")");else if(l=="}"){while(n.type=="statement")n=m(t);n.type=="}"&&(n=m(t));while(n.type=="statement")n=m(t)}else l==n.type?m(t):(n.type=="}"||n.type=="top"||n.type=="statement"&&l=="newstatement")&&v(t,e.column(),"statement");else m(t);return t.startOfLine=!1,r},indent:function(e,t){if(e.tokenize!=c&&e.tokenize!=null)return 0;var r=e.context,i=t&&t.charAt(0);r.type=="statement"&&i=="}"&&(r=r.prev);var s=i==r.type;return r.type=="statement"?r.indented+(i=="{"?0:n):r.align?r.column+(s?0:1):r.indented+(s?0:n)},electricChars:"{}"}}),function(){function e(e){var t={},n=e.split(" ");for(var r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t){return t.startOfLine?(e.skipToEnd(),"meta"):!1}function r(e,t){var n;while((n=e.next())!=null)if(n=='"'&&!e.eat('"')){t.tokenize=null;break}return"string"}function i(e,t){for(var n=0;n<e.length;++n)CodeMirror.defineMIME(e[n],t)}var t="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";i(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:e(t),blockKeywords:e("case do else for if switch while struct"),atoms:e("null"),hooks:{"#":n}}),i(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:e(t+" 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:e("catch class do else finally for if struct switch try while"),atoms:e("true false null"),hooks:{"#":n}}),CodeMirror.defineMIME("text/x-java",{name:"clike",keywords:e("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:e("catch class do else finally for if switch try while"),atoms:e("true false null"),hooks:{"@":function(e,t){return e.eatWhile(/[\w\$_]/),"meta"}}}),CodeMirror.defineMIME("text/x-csharp",{name:"clike",keywords:e("abstract as base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe 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:e("catch class do else finally for foreach if struct switch try while"),builtin:e("Boolean Byte Char DateTime DateTimeOffset Decimal Double Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),atoms:e("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=r,r(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),CodeMirror.defineMIME("text/x-scala",{name:"clike",keywords:e("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try trye type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),blockKeywords:e("catch class do else finally for forSome if match switch try while"),atoms:e("true false null"),hooks:{"@":function(e,t){return e.eatWhile(/[\w\$_]/),"meta"}}})}(),CodeMirror.defineMode("css",function(e){function a(e){var t={};for(var n=0;n<e.length;++n)t[e[n]]=!0;return t}function f(e,t){return n=t,e}function l(e,t){var r=e.next();if(r=="@")return e.eatWhile(/[\w\\\-]/),f("def",e.current());if(r=="/"&&e.eat("*"))return t.tokenize=c,c(e,t);if(r=="<"&&e.eat("!"))return t.tokenize=h,h(e,t);if(r=="=")f(null,"compare");else{if(!(r!="~"&&r!="|"||!e.eat("=")))return f(null,"compare");if(r=='"'||r=="'")return t.tokenize=p(r),t.tokenize(e,t);if(r=="#")return e.eatWhile(/[\w\\\-]/),f("atom","hash");if(r=="!")return e.match(/^\s*\w*/),f("keyword","important");if(/\d/.test(r))return e.eatWhile(/[\w.%]/),f("number","unit");if(r!=="-")return/[,+>*\/]/.test(r)?f(null,"select-op"):r=="."&&e.match(/^\w+/)?f("qualifier",n):r==":"?f("operator",r):/[;{}\[\]\(\)]/.test(r)?f(null,r):(e.eatWhile(/[\w\\\-]/),f("property","variable"));if(/\d/.test(e.peek()))return e.eatWhile(/[\w.%]/),f("number","unit");if(e.match(/^[^-]+-/))return f("meta",n)}}function c(e,t){var n=!1,r;while((r=e.next())!=null){if(n&&r=="/"){t.tokenize=l;break}n=r=="*"}return f("comment","comment")}function h(e,t){var n=0,r;while((r=e.next())!=null){if(n>=2&&r==">"){t.tokenize=l;break}n=r=="-"?n+1:0}return f("comment","comment")}function p(e){return function(t,n){var r=!1,i;while((i=t.next())!=null){if(i==e&&!r)break;r=!r&&i=="\\"}return r||(n.tokenize=l),f("string","string")}}var t=e.indentUnit,n,r=a(["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"]),i=a(["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"]),s=a(["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid-cell","grid-column","grid-column-align","grid-column-sizing","grid-column-span","grid-columns","grid-flow","grid-row","grid-row-align","grid-row-sizing","grid-row-span","grid-rows","grid-template","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-shadow","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"]),o=a(["black","silver","gray","white","maroon","red","purple","fuchsia","green","lime","olive","yellow","navy","blue","teal","aqua"]),u=a(["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break-all","break-word","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","navy","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","overlay","overline","padding","padding-box","painted","paused","persian","plus-darker","plus-lighter","pointer","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","white","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small","yellow"]);return{startState:function(e){return{tokenize:l,baseIndent:e||0,stack:[]}},token:function(e,t){if(e.eatSpace())return null;var a=t.tokenize(e,t),f=t.stack[t.stack.length-1];return a=="property"?f=="propertyValue"?u[e.current()]?a="string-2":o[e.current()]?a="keyword":a="variable-2":f=="rule"?s[e.current()]||(a+=" error"):!f||f=="@media{"?a="tag":f=="@media"?r[e.current()]?a="attribute":/^(only|not)$/i.test(e.current())?a="keyword":e.current().toLowerCase()=="and"?a="error":i[e.current()]?a="error":a="attribute error":f=="@mediaType"?r[e.current()]?a="attribute":e.current().toLowerCase()=="and"?a="operator":/^(only|not)$/i.test(e.current())?a="error":i[e.current()]?a="error":a="error":f=="@mediaType("?s[e.current()]||(r[e.current()]?a="error":e.current().toLowerCase()=="and"?a="operator":/^(only|not)$/i.test(e.current())?a="error":a+=" error"):a="error":a=="atom"?!f||f=="@media{"?a="builtin":f=="propertyValue"?/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e.current())||(a+=" error"):a="error":f=="@media"&&n=="{"&&(a="error"),n=="{"?f=="@media"||f=="@mediaType"?(t.stack.pop(),t.stack[t.stack.length-1]="@media{"):t.stack.push("rule"):n=="}"?(t.stack.pop(),f=="propertyValue"&&t.stack.pop()):n=="@media"?t.stack.push("@media"):f=="@media"&&/\b(keyword|attribute)\b/.test(a)?t.stack.push("@mediaType"):f=="@mediaType"&&e.current()==","?t.stack.pop():f=="@mediaType"&&n=="("?t.stack.push("@mediaType("):f=="@mediaType("&&n==")"?t.stack.pop():f=="rule"&&n==":"?t.stack.push("propertyValue"):f=="propertyValue"&&n==";"&&t.stack.pop(),a},indent:function(e,n){var r=e.stack.length;return/^\}/.test(n)&&(r-=e.stack[e.stack.length-1]=="propertyValue"?2:1),e.baseIndent+r*t},electricChars:"}"}}),CodeMirror.defineMIME("text/css","css"),CodeMirror.defineMode("htmlmixed",function(e,t){function s(e,t){var s=n.token(e,t.htmlState);return s=="tag"&&e.current()==">"&&t.htmlState.context&&(/^script$/i.test(t.htmlState.context.tagName)?(t.token=u,t.localState=r.startState(n.indent(t.htmlState,"")),t.mode="javascript"):/^style$/i.test(t.htmlState.context.tagName)&&(t.token=a,t.localState=i.startState(n.indent(t.htmlState,"")),t.mode="css")),s}function o(e,t,n){var r=e.current(),i=r.search(t),s;if(i>-1)e.backUp(r.length-i);else if(s=r.match(/<\/?$/))e.backUp(r[0].length),e.match(t,!1)||e.match(r[0]);return n}function u(e,t){return e.match(/^<\/\s*script\s*>/i,!1)?(t.token=s,t.localState=null,t.mode="html",s(e,t)):o(e,/<\/\s*script\s*>/,r.token(e,t.localState))}function a(e,t){return e.match(/^<\/\s*style\s*>/i,!1)?(t.token=s,t.localState=null,t.mode="html",s(e,t)):o(e,/<\/\s*style\s*>/,i.token(e,t.localState))}var n=CodeMirror.getMode(e,{name:"xml",htmlMode:!0}),r=CodeMirror.getMode(e,"javascript"),i=CodeMirror.getMode(e,"css");return{startState:function(){var e=n.startState();return{token:s,localState:null,mode:"html",htmlState:e}},copyState:function(e){if(e.localState)var t=CodeMirror.copyState(e.token==a?i:r,e.localState);return{token:e.token,localState:t,mode:e.mode,htmlState:CodeMirror.copyState(n,e.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(e,t){return e.token==s||/^\s*<\//.test(t)?n.indent(e.htmlState,t):e.token==u?r.indent(e.localState,t):i.indent(e.localState,t)},electricChars:"/{}:"}},"xml","javascript","css"),CodeMirror.defineMIME("text/html","htmlmixed"),CodeMirror.defineMode("javascript",function(e,t){function o(e,t,n){return t.tokenize=n,n(e,t)}function u(e,t){var n=!1,r;while((r=e.next())!=null){if(r==t&&!n)return!1;n=!n&&r=="\\"}return n}function l(e,t,n){return a=e,f=n,t}function c(e,t){var n=e.next();if(n=='"'||n=="'")return o(e,t,h(n));if(/[\[\]{}\(\),;\:\.]/.test(n))return l(n);if(n=="0"&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),l("number","number");if(/\d/.test(n)||n=="-"&&e.eat(/\d/))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),l("number","number");if(n=="/")return e.eat("*")?o(e,t,p):e.eat("/")?(e.skipToEnd(),l("comment","comment")):t.reAllowed?(u(e,"/"),e.eatWhile(/[gimy]/),l("regexp","string-2")):(e.eatWhile(s),l("operator",null,e.current()));if(n=="#")return e.skipToEnd(),l("error","error");if(s.test(n))return e.eatWhile(s),l("operator",null,e.current());e.eatWhile(/[\w\$_]/);var r=e.current(),a=i.propertyIsEnumerable(r)&&i[r];return a&&t.kwAllowed?l(a.type,a.style,r):l("variable","variable",r)}function h(e){return function(t,n){return u(t,e)||(n.tokenize=c),l("string","string")}}function p(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=c;break}n=r=="*"}return l("comment","comment")}function v(e,t,n,r,i,s){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=s,r!=null&&(this.align=r)}function m(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0}function g(e,t,n,i,s){var o=e.cc;y.state=e,y.stream=s,y.marked=null,y.cc=o,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);for(;;){var u=o.length?o.pop():r?A:L;if(u(n,i)){while(o.length&&o[o.length-1].lex)o.pop()();return y.marked?y.marked:n=="variable"&&m(e,i)?"variable-2":t}}}function b(){for(var e=arguments.length-1;e>=0;e--)y.cc.push(arguments[e])}function w(){return b.apply(null,arguments),!0}function E(e){var t=y.state;if(t.context){y.marked="def";for(var n=t.localVars;n;n=n.next)if(n.name==e)return;t.localVars={name:e,next:t.localVars}}}function x(){y.state.context||(y.state.localVars=S),y.state.context={prev:y.state.context,vars:y.state.localVars}}function T(){y.state.localVars=y.state.context.vars,y.state.context=y.state.context.prev}function N(e,t){var n=function(){var n=y.state;n.lexical=new v(n.indented,y.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function C(){var e=y.state;e.lexical.prev&&(e.lexical.type==")"&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function k(e){return function(n){return n==e?w():e==";"?b():w(arguments.callee)}}function L(e){return e=="var"?w(N("vardef"),j,k(";"),C):e=="keyword a"?w(N("form"),A,L,C):e=="keyword b"?w(N("form"),L,C):e=="{"?w(N("}"),B,C):e==";"?w():e=="function"?w(z):e=="for"?w(N("form"),k("("),N(")"),I,k(")"),C,L,C):e=="variable"?w(N("stat"),_):e=="switch"?w(N("form"),A,N("}","switch"),k("{"),B,C,C):e=="case"?w(A,k(":")):e=="default"?w(k(":")):e=="catch"?w(N("form"),x,k("("),W,k(")"),L,C,T):b(N("stat"),A,k(";"),C)}function A(e){return d.hasOwnProperty(e)?w(M):e=="function"?w(z):e=="keyword c"?w(O):e=="("?w(N(")"),O,k(")"),C,M):e=="operator"?w(A):e=="["?w(N("]"),H(A,"]"),C,M):e=="{"?w(N("}"),H(P,"}"),C,M):w()}function O(e){return e.match(/[;\}\)\],]/)?b():b(A)}function M(e,t){if(e=="operator"&&/\+\+|--/.test(t))return w(M);if(e=="operator"&&t=="?")return w(A,k(":"),A);if(e==";")return;if(e=="(")return w(N(")"),H(A,")"),C,M);if(e==".")return w(D,M);if(e=="[")return w(N("]"),A,k("]"),C,M)}function _(e){return e==":"?w(C,L):b(M,k(";"),C)}function D(e){if(e=="variable")return y.marked="property",w()}function P(e){e=="variable"&&(y.marked="property");if(d.hasOwnProperty(e))return w(k(":"),A)}function H(e,t){function n(r){return r==","?w(e,n):r==t?w():w(k(t))}return function(i){return i==t?w():b(e,n)}}function B(e){return e=="}"?w():b(L,B)}function j(e,t){return e=="variable"?(E(t),w(F)):w()}function F(e,t){if(t=="=")return w(A,F);if(e==",")return w(j)}function I(e){return e=="var"?w(j,R):e==";"?b(R):e=="variable"?w(q):b(R)}function q(e,t){return t=="in"?w(A):w(M,R)}function R(e,t){return e==";"?w(U):t=="in"?w(A):w(A,k(";"),U)}function U(e){e!=")"&&w(A)}function z(e,t){if(e=="variable")return E(t),w(z);if(e=="(")return w(N(")"),x,H(W,")"),C,L,T)}function W(e,t){if(e=="variable")return E(t),w()}var n=e.indentUnit,r=t.json,i=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("operator"),s={type:"atom",style:"atom"};return{"if":t,"while":t,"with":t,"else":n,"do":n,"try":n,"finally":n,"return":r,"break":r,"continue":r,"new":r,"delete":r,"throw":r,"var":e("var"),"const":e("var"),let:e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":i,"typeof":i,"instanceof":i,"true":s,"false":s,"null":s,"undefined":s,NaN:s,Infinity:s}}(),s=/[+\-*&%=<>!?|]/,a,f,d={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},y={state:null,column:null,marked:null,cc:null},S={name:"this",next:{name:"arguments"}};return C.lex=!0,{startState:function(e){return{tokenize:c,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new v((e||0)-n,0,"block",!1),localVars:t.localVars,context:t.localVars&&{vars:t.localVars},indented:0}},token:function(e,t){e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation());if(e.eatSpace())return null;var n=t.tokenize(e,t);return a=="comment"?n:(t.reAllowed=a=="operator"||a=="keyword c"||!!a.match(/^[\[{}\(,;:]$/),t.kwAllowed=a!=".",g(t,n,a,f,e))},indent:function(e,t){if(e.tokenize!=c)return 0;var r=t&&t.charAt(0),i=e.lexical;i.type=="stat"&&r=="}"&&(i=i.prev);var s=i.type,o=r==s;return s=="vardef"?i.indented+4:s=="form"&&r=="{"?i.indented:s=="stat"||s=="form"?i.indented+n:i.info=="switch"&&!o?i.indented+(/^(?:case|default)\b/.test(t)?n:2*n):i.align?i.column+(o?0:1):i.indented+(o?0:n)},electricChars:":{}"}}),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}),CodeMirror.defineMode("markdown",function(e,t){function T(e,t,n){return t.f=t.inline=n,n(e,t)}function N(e,t,n){return t.f=t.block=n,n(e,t)}function C(e){return e.linkTitle=!1,e.code=!1,e.em=!1,e.strong=!1,e.quote=!1,!n&&e.f==L&&(e.f=M,e.block=k),null}function k(e,t){var n;t.list!==!1&&t.indentationDiff>=0?(t.indentationDiff<4&&(t.indentation-=t.indentationDiff),t.list=null):t.list=!1;if(t.indentationDiff>=4)return t.indentation-=4,e.skipToEnd(),a;if(e.eatSpace())return null;if(e.peek()==="#"||s&&e.match(S))t.header=!0;else if(e.eat(">"))t.indentation++,t.quote=!0;else{if(e.peek()==="[")return T(e,t,P);if(e.match(b,!0))return c;if(n=e.match(w,!0)||e.match(E,!0))t.indentation+=4,t.list=!0}return T(e,t,t.inline)}function L(e,t){var i=r.token(e,t.htmlState);return n&&i==="tag"&&t.htmlState.type!=="openTag"&&!t.htmlState.context&&(t.f=M,t.block=k),t.md_inside&&e.current().indexOf(">")!=-1&&(t.f=M,t.block=k,t.htmlState.context=undefined),i}function A(e){var t=[];return e.strong?t.push(e.em?y:g):e.em&&t.push(m),e.code&&t.push(a),e.header&&t.push(u),e.quote&&t.push(f),e.list!==!1&&t.push(l),t.length?t.join(" "):null}function O(e,t){return e.match(x,!0)?A(t):undefined}function M(e,t){var n=t.text(e,t);if(typeof n!="undefined")return n;if(t.list)return t.list=null,l;var r=e.next();if(r==="\\")return e.next(),A(t);if(t.linkTitle){t.linkTitle=!1;var s=r;r==="("&&(s=")"),s=(s+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var o="^\\s*(?:[^"+s+"\\\\]+|\\\\\\\\|\\\\.)"+s;if(e.match(new RegExp(o),!0))return v}if(r==="`"){var u=A(t),a=e.pos;e.eatWhile("`");var f=1+e.pos-a;return t.code?f===i?(t.code=!1,u):A(t):(i=f,t.code=!0,A(t))}if(t.code)return A(t);if(r==="["&&e.match(/.*\] ?(?:\(|\[)/,!1))return T(e,t,_);if(r==="<"&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!0))return T(e,t,j(h,">"));if(r==="<"&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!0))return T(e,t,j(p,">"));if(r==="<"&&e.match(/^\w/,!1)){var c=!1;if(e.string.indexOf(">")!=-1){var d=e.string.substring(1,e.string.indexOf(">"));/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(d)&&(t.md_inside=!0)}return e.backUp(1),N(e,t,L)}if(r==="<"&&e.match(/^\/\w*?>/))return t.md_inside=!1,"tag";var u=A(t);if(r==="*"||r==="_"){if(t.strong===r&&e.eat(r))return t.strong=!1,u;if(!t.strong&&e.eat(r))return t.strong=r,A(t);if(t.em===r)return t.em=!1,u;if(!t.em)return t.em=r,A(t)}else if(r===" ")if(e.eat("*")||e.eat("_")){if(e.peek()===" ")return A(t);e.backUp(1)}return A(t)}function _(e,t){while(!e.eol()){var n=e.next();n==="\\"&&e.next();if(n==="]")return t.inline=t.f=D,d}return d}function D(e,t){if(e.eatSpace())return null;var n=e.next();return n==="("||n==="["?T(e,t,j(v,n==="("?")":"]")):"error"}function P(e,t){return e.match(/^[^\]]*\]:/,!0)?(t.f=H,d):T(e,t,M)}function H(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),e.peek()===undefined?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=M,v)}function B(e){return B[e]||(e=(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),B[e]=new RegExp("^(?:[^\\\\]+?|\\\\.)*?("+e+")")),B[e]}function j(e,t,n){return n=n||M,function(r,i){return r.match(B(t)),i.inline=i.f=n,e}}var n=CodeMirror.mimeModes.hasOwnProperty("text/html"),r=CodeMirror.getMode(e,n?"text/html":"text/plain"),i=0,s=!1,o=!1,u="header",a="comment",f="quote",l="string",c="hr",h="link",p="link",d="link",v="string",m="em",g="strong",y="emstrong",b=/^([*\-=_])(?:\s*\1){2,}\s*$/,w=/^[*\-+]\s+/,E=/^[0-9]+\.\s+/,S=/^(?:\={1,}|-{1,})$/,x=/^[^\[*_\\<>` "'(]+/;return{startState:function(){return{f:k,block:k,htmlState:CodeMirror.startState(r),indentation:0,inline:M,text:O,linkTitle:!1,em:!1,strong:!1,header:!1,list:!1,quote:!1}},copyState:function(e){return{f:e.f,block:e.block,htmlState:CodeMirror.copyState(r,e.htmlState),indentation:e.indentation,inline:e.inline,text:e.text,linkTitle:e.linkTitle,em:e.em,strong:e.strong,header:e.header,list:e.list,quote:e.quote,md_inside:e.md_inside}},token:function(e,t){if(e.sol()){if(e.match(/^\s*$/,!0))return s=!1,C(t);o&&(s=!0,o=!1),o=!0,t.header=!1,t.f=t.block;var n=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;t.indentationDiff=n-t.indentation,t.indentation=n;if(n>0)return null}return t.f(e,t)},blankLine:C,getType:A}},"xml"),CodeMirror.defineMIME("text/x-markdown","markdown"),CodeMirror.defineMode("perl",function(e,t){function s(e,t,n,r,i){return t.chain=null,t.style=null,t.tail=null,t.tokenize=function(e,t){var s=!1,o,a=0;while(o=e.next()){if(o===n[a]&&!s)return n[++a]!==undefined?(t.chain=n[a],t.style=r,t.tail=i):i&&e.eatWhile(i),t.tokenize=u,r;s=!s&&o=="\\"}return r},t.tokenize(e,t)}function o(e,t,n){return t.tokenize=function(e,t){return e.string==n&&(t.tokenize=u),e.skipToEnd(),"string"},t.tokenize(e,t)}function u(e,t){if(e.eatSpace())return null;if(t.chain)return s(e,t,t.chain,t.style,t.tail);if(e.match(/^\-?[\d\.]/,!1)&&e.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return"number";if(e.match(/^<<(?=\w)/))return e.eatWhile(/\w/),o(e,t,e.current().substr(2));if(e.sol()&&e.match(/^\=item(?!\w)/))return o(e,t,"=cut");var u=e.next();if(u=='"'||u=="'"){if(e.prefix(3)=="<<"+u){var a=e.pos;e.eatWhile(/\w/);var f=e.current().substr(1);if(f&&e.eat(u))return o(e,t,f);e.pos=a}return s(e,t,[u],"string")}if(u=="q"){var l=e.look(-2);if(!l||!/\w/.test(l)){l=e.look(0);if(l=="x"){l=e.look(1);if(l=="(")return e.eatSuffix(2),s(e,t,[")"],r,i);if(l=="[")return e.eatSuffix(2),s(e,t,["]"],r,i);if(l=="{")return e.eatSuffix(2),s(e,t,["}"],r,i);if(l=="<")return e.eatSuffix(2),s(e,t,[">"],r,i);if(/[\^'"!~\/]/.test(l))return e.eatSuffix(1),s(e,t,[e.eat(l)],r,i)}else if(l=="q"){l=e.look(1);if(l=="(")return e.eatSuffix(2),s(e,t,[")"],"string");if(l=="[")return e.eatSuffix(2),s(e,t,["]"],"string");if(l=="{")return e.eatSuffix(2),s(e,t,["}"],"string");if(l=="<")return e.eatSuffix(2),s(e,t,[">"],"string");if(/[\^'"!~\/]/.test(l))return e.eatSuffix(1),s(e,t,[e.eat(l)],"string")}else if(l=="w"){l=e.look(1);if(l=="(")return e.eatSuffix(2),s(e,t,[")"],"bracket");if(l=="[")return e.eatSuffix(2),s(e,t,["]"],"bracket");if(l=="{")return e.eatSuffix(2),s(e,t,["}"],"bracket");if(l=="<")return e.eatSuffix(2),s(e,t,[">"],"bracket");if(/[\^'"!~\/]/.test(l))return e.eatSuffix(1),s(e,t,[e.eat(l)],"bracket")}else if(l=="r"){l=e.look(1);if(l=="(")return e.eatSuffix(2),s(e,t,[")"],r,i);if(l=="[")return e.eatSuffix(2),s(e,t,["]"],r,i);if(l=="{")return e.eatSuffix(2),s(e,t,["}"],r,i);if(l=="<")return e.eatSuffix(2),s(e,t,[">"],r,i);if(/[\^'"!~\/]/.test(l))return e.eatSuffix(1),s(e,t,[e.eat(l)],r,i)}else if(/[\^'"!~\/(\[{<]/.test(l)){if(l=="(")return e.eatSuffix(1),s(e,t,[")"],"string");if(l=="[")return e.eatSuffix(1),s(e,t,["]"],"string");if(l=="{")return e.eatSuffix(1),s(e,t,["}"],"string");if(l=="<")return e.eatSuffix(1),s(e,t,[">"],"string");if(/[\^'"!~\/]/.test(l))return s(e,t,[e.eat(l)],"string")}}}if(u=="m"){var l=e.look(-2);if(!l||!/\w/.test(l)){l=e.eat(/[(\[{<\^'"!~\/]/);if(l){if(/[\^'"!~\/]/.test(l))return s(e,t,[l],r,i);if(l=="(")return s(e,t,[")"],r,i);if(l=="[")return s(e,t,["]"],r,i);if(l=="{")return s(e,t,["}"],r,i);if(l=="<")return s(e,t,[">"],r,i)}}}if(u=="s"){var l=/[\/>\]})\w]/.test(e.look(-2));if(!l){l=e.eat(/[(\[{<\^'"!~\/]/);if(l)return l=="["?s(e,t,["]","]"],r,i):l=="{"?s(e,t,["}","}"],r,i):l=="<"?s(e,t,[">",">"],r,i):l=="("?s(e,t,[")",")"],r,i):s(e,t,[l,l],r,i)}}if(u=="y"){var l=/[\/>\]})\w]/.test(e.look(-2));if(!l){l=e.eat(/[(\[{<\^'"!~\/]/);if(l)return l=="["?s(e,t,["]","]"],r,i):l=="{"?s(e,t,["}","}"],r,i):l=="<"?s(e,t,[">",">"],r,i):l=="("?s(e,t,[")",")"],r,i):s(e,t,[l,l],r,i)}}if(u=="t"){var l=/[\/>\]})\w]/.test(e.look(-2));if(!l){l=e.eat("r");if(l){l=e.eat(/[(\[{<\^'"!~\/]/);if(l)return l=="["?s(e,t,["]","]"],r,i):l=="{"?s(e,t,["}","}"],r,i):l=="<"?s(e,t,[">",">"],r,i):l=="("?s(e,t,[")",")"],r,i):s(e,t,[l,l],r,i)}}}if(u=="`")return s(e,t,[u],"variable-2");if(u=="/")return/~\s*$/.test(e.prefix())?s(e,t,[u],r,i):"operator";if(u=="$"){var a=e.pos;if(e.eatWhile(/\d/)||e.eat("{")&&e.eatWhile(/\d/)&&e.eat("}"))return"variable-2";e.pos=a}if(/[$@%]/.test(u)){var a=e.pos;if(e.eat("^")&&e.eat(/[A-Z]/)||!/[@$%&]/.test(e.look(-2))&&e.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var l=e.current();if(n[l])return"variable-2"}e.pos=a}if(/[$@%&]/.test(u))if(e.eatWhile(/[\w$\[\]]/)||e.eat("{")&&e.eatWhile(/[\w$\[\]]/)&&e.eat("}")){var l=e.current();return n[l]?"variable-2":"variable"}if(u=="#"&&e.look(-2)!="$")return e.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(u)){var a=e.pos;e.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/);if(n[e.current()])return"operator";e.pos=a}if(u=="_"&&e.pos==1){if(e.suffix(6)=="_END__")return s(e,t,["\0"],"comment");if(e.suffix(7)=="_DATA__")return s(e,t,["\0"],"variable-2");if(e.suffix(7)=="_C__")return s(e,t,["\0"],"string")}if(/\w/.test(u)){var a=e.pos;if(e.look(-2)=="{"&&(e.look(0)=="}"||e.eatWhile(/\w/)&&e.look(0)=="}"))return"string";e.pos=a}if(/[A-Z]/.test(u)){var c=e.look(-2),a=e.pos;e.eatWhile(/[A-Z_]/);if(!/[\da-z]/.test(e.look(0))){var l=n[e.current()];return l?(l[1]&&(l=l[0]),c!=":"?l==1?"keyword":l==2?"def":l==3?"atom":l==4?"operator":l==5?"variable-2":"meta":"meta"):"meta"}e.pos=a}if(/[a-zA-Z_]/.test(u)){var c=e.look(-2);e.eatWhile(/\w/);var l=n[e.current()];return l?(l[1]&&(l=l[0]),c!=":"?l==1?"keyword":l==2?"def":l==3?"atom":l==4?"operator":l==5?"variable-2":"meta":"meta"):"meta"}return null}var n={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,"if":[1,1],elsif:[1,1],"else":[1,1],"while":[1,1],unless:[1,1],"for":[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,"break":1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,"continue":[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,"default":1,defined:1,"delete":1,die:1,"do":1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,"goto":1,grep:1,hex:1,"import":1,index:1,"int":1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,"new":1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,"package":1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,"return":1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},r="string-2",i=/[goseximacplud]/;return{startState:function(){return{tokenize:u,chain:null,style:null,tail:null}},token:function(e,t){return(t.tokenize||u)(e,t)},electricChars:"{}"}}),CodeMirror.defineMIME("text/x-perl","perl"),CodeMirror.StringStream.prototype.look=function(e){return this.string.charAt(this.pos+(e||0))},CodeMirror.StringStream.prototype.prefix=function(e){if(e){var t=this.pos-e;return this.string.substr(t>=0?t:0,e)}return this.string.substr(0,this.pos-1)},CodeMirror.StringStream.prototype.suffix=function(e){var t=this.string.length,n=t-this.pos+1;return this.string.substr(this.pos,e&&e<t?e:n)},CodeMirror.StringStream.prototype.nsuffix=function(e){var t=this.pos,n=e||this.string.length-this.pos+1;return this.pos+=n,this.string.substr(t,n)},CodeMirror.StringStream.prototype.eatSuffix=function(e){var t=this.pos+e,n;t<=0?this.pos=0:t>=(n=this.string.length-1)?this.pos=n:this.pos=t},function(){function e(e){var t={},n=e.split(" ");for(var r=0;r<n.length;++r)t[n[r]]=!0;return t}function t(e){return function(t,n){return t.match(e)?n.tokenize=null:t.skipToEnd(),"string"}}var n={name:"clike",keywords:e("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:e("catch do else elseif for foreach if switch try while"),atoms:e("true false null TRUE FALSE NULL"),multiLineStrings:!0,hooks:{$:function(e,t){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,n){return e.match(/<</)?(e.eatWhile(/[\w\.]/),n.tokenize=t(e.current().slice(3)),n.tokenize(e,n)):!1},"#":function(e,t){while(!e.eol()&&!e.match("?>",!1))e.next();return"comment"},"/":function(e,t){if(e.eat("/")){while(!e.eol()&&!e.match("?>",!1))e.next();return"comment"}return!1}}};CodeMirror.defineMode("php",function(e,t){function u(e,t){var n=t.mode=="php";e.sol()&&t.pending!='"'&&(t.pending=null);if(t.curMode==r){if(e.match(/^<\?\w*/))return t.curMode=o,t.curState=t.php,t.curClose="?>",t.mode="php","meta";if(t.pending=='"'){while(!e.eol()&&e.next()!='"');var a="string"}else if(t.pending&&e.pos<t.pending.end){e.pos=t.pending.end;var a=t.pending.style}else var a=r.token(e,t.curState);t.pending=null;var f=e.current(),l=f.search(/<\?/);return l!=-1?(a=="string"&&/\"$/.test(f)&&!/\?>/.test(f)?t.pending='"':t.pending={end:e.pos,style:a},e.backUp(f.length-l)):a=="tag"&&e.current()==">"&&t.curState.context&&(/^script$/i.test(t.curState.context.tagName)?(t.curMode=i,t.curState=i.startState(r.indent(t.curState,"")),t.curClose=/^<\/\s*script\s*>/i,t.mode="javascript"):/^style$/i.test(t.curState.context.tagName)&&(t.curMode=s,t.curState=s.startState(r.indent(t.curState,"")),t.curClose=/^<\/\s*style\s*>/i,t.mode="css")),a}return(!n||t.php.tokenize==null)&&e.match(t.curClose,n)?(t.curMode=r,t.curState=t.html,t.curClose=null,t.mode="html",n?"meta":u(e,t)):t.curMode.token(e,t.curState)}var r=CodeMirror.getMode(e,{name:"xml",htmlMode:!0}),i=CodeMirror.getMode(e,"javascript"),s=CodeMirror.getMode(e,"css"),o=CodeMirror.getMode(e,n);return{startState:function(){var e=r.startState();return{html:e,php:o.startState(),curMode:t.startOpen?o:r,curState:t.startOpen?o.startState():e,curClose:t.startOpen?/^\?>/:null,mode:t.startOpen?"php":"html",pending:null}},copyState:function(e){var t=e.html,n=CodeMirror.copyState(r,t),i=e.php,s=CodeMirror.copyState(o,i),u;return e.curState==t?u=n:e.curState==i?u=s:u=CodeMirror.copyState(e.curMode,e.curState),{html:n,php:s,curMode:e.curMode,curState:u,curClose:e.curClose,mode:e.mode,pending:e.pending}},token:u,indent:function(e,t){return e.curMode!=o&&/^\s*<\//.test(t)||e.curMode==o&&/^\?>/.test(t)?r.indent(e.html,t):e.curMode.indent(e.curState,t)},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",n)}(),CodeMirror.defineMode("python",function(e,t){function r(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function b(e,t){if(e.sol()){var r=t.scopes[0].offset;if(e.eatSpace()){var c=e.indentation();return c>r?y="indent":c<r&&(y="dedent"),null}r>0&&S(e,t)}if(e.eatSpace())return null;var h=e.peek();if(h==="#")return e.skipToEnd(),"comment";if(e.match(/^[0-9\.]/,!1)){var p=!1;e.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)&&(p=!0),e.match(/^\d+\.\d*/)&&(p=!0),e.match(/^\.\d+/)&&(p=!0);if(p)return e.eat(/J/i),"number";var d=!1;e.match(/^0x[0-9a-f]+/i)&&(d=!0),e.match(/^0b[01]+/i)&&(d=!0),e.match(/^0o[0-7]+/i)&&(d=!0),e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(e.eat(/J/i),d=!0),e.match(/^0(?![\dx])/i)&&(d=!0);if(d)return e.eat(/L/i),"number"}return e.match(v)?(t.tokenize=w(e.current()),t.tokenize(e,t)):e.match(a)||e.match(u)?null:e.match(o)||e.match(i)||e.match(l)?"operator":e.match(s)?null:e.match(m)?"keyword":e.match(g)?"builtin":e.match(f)?"variable":(e.next(),n)}function w(e){while("rub".indexOf(e.charAt(0).toLowerCase())>=0)e=e.substr(1);var r=e.length==1,i="string";return function(o,u){while(!o.eol()){o.eatWhile(/[^'"\\]/);if(o.eat("\\")){o.next();if(r&&o.eol())return i}else{if(o.match(e))return u.tokenize=b,i;o.eat(/['"]/)}}if(r){if(t.singleLineStringErrors)return n;u.tokenize=b}return i}}function E(t,n,r){r=r||"py";var i=0;if(r==="py"){if(n.scopes[0].type!=="py"){n.scopes[0].offset=t.indentation();return}for(var s=0;s<n.scopes.length;++s)if(n.scopes[s].type==="py"){i=n.scopes[s].offset+e.indentUnit;break}}else i=t.column()+t.current().length;n.scopes.unshift({offset:i,type:r})}function S(e,t,n){n=n||"py";if(t.scopes.length==1)return;if(t.scopes[0].type==="py"){var r=e.indentation(),i=-1;for(var s=0;s<t.scopes.length;++s)if(r===t.scopes[s].offset){i=s;break}if(i===-1)return!0;while(t.scopes[0].offset!==r)t.scopes.shift();return!1}return n==="py"?(t.scopes[0].offset=e.indentation(),!1):t.scopes[0].type!=n?!0:(t.scopes.shift(),!1)}function x(e,t){y=null;var r=t.tokenize(e,t),i=e.current();if(i===".")return r=e.match(f,!1)?null:n,r===null&&t.lastToken==="meta"&&(r="meta"),r;if(i==="@")return e.match(f,!1)?"meta":n;(r==="variable"||r==="builtin")&&t.lastToken==="meta"&&(r="meta");if(i==="pass"||i==="return")t.dedent+=1;i==="lambda"&&(t.lambda=!0),(i===":"&&!t.lambda&&t.scopes[0].type=="py"||y==="indent")&&E(e,t);var s="[({".indexOf(i);return s!==-1&&E(e,t,"])}".slice(s,s+1)),y==="dedent"&&S(e,t)?n:(s="])}".indexOf(i),s!==-1&&S(e,t,i)?n:(t.dedent>0&&e.eol()&&t.scopes[0].type=="py"&&(t.scopes.length>1&&t.scopes.shift(),t.dedent-=1),r))}var n="error",i=new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"),s=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),o=new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),u=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),a=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),f=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),l=r(["and","or","not","is","in"]),c=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield"],h=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"],p={builtins:["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"],keywords:["exec","print"]},d={builtins:["ascii","bytes","exec","print"],keywords:["nonlocal","False","True","None"]};if(!t.version||parseInt(t.version,10)!==3){c=c.concat(p.keywords),h=h.concat(p.builtins);var v=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}else{c=c.concat(d.keywords),h=h.concat(d.builtins);var v=new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))","i")}var m=r(c),g=r(h),y=null,T={startState:function(e){return{tokenize:b,scopes:[{offset:e||0,type:"py"}],lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=x(e,t);return t.lastToken=n,e.eol()&&e.lambda&&(t.lambda=!1),n},indent:function(e,t){return e.tokenize!=b?0:e.scopes[0].offset}};return T}),CodeMirror.defineMIME("text/x-python","python"),CodeMirror.defineMode("ruby",function(e,t){function n(e){var t={};for(var n=0,r=e.length;n<r;++n)t[e[n]]=!0;return t}function a(e,t,n){return n.tokenize.push(e),e(t,n)}function f(e,t){u=null;if(e.sol()&&e.match("=begin")&&e.eol())return t.tokenize.push(p),"comment";if(e.eatSpace())return null;var n=e.next(),r;if(n=="`"||n=="'"||n=='"'||n=="/"&&!e.eol()&&e.peek()!=" ")return a(c(n,"string",n=='"'||n=="`"),e,t);if(n=="%"){var i,s=!1;e.eat("s")?i="atom":e.eat(/[WQ]/)?(i="string",s=!0):e.eat(/[wxqr]/)&&(i="string");var f=e.eat(/[^\w\s]/);return f?(o.propertyIsEnumerable(f)&&(f=o[f]),a(c(f,i,s,!0),e,t)):"operator"}if(n=="#")return e.skipToEnd(),"comment";if(n=="<"&&(r=e.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return a(h(r[1]),e,t);if(n=="0")return e.eat("x")?e.eatWhile(/[\da-fA-F]/):e.eat("b")?e.eatWhile(/[01]/):e.eatWhile(/[0-7]/),"number";if(/\d/.test(n))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if(n=="?"){while(e.match(/^\\[CM]-/));return e.eat("\\")?e.eatWhile(/\w/):e.next(),"string"}return n==":"?e.eat("'")?a(c("'","atom",!1),e,t):e.eat('"')?a(c('"',"atom",!0),e,t):(e.eatWhile(/[\w\?]/),"atom"):n=="@"?(e.eat("@"),e.eatWhile(/[\w\?]/),"variable-2"):n=="$"?(e.next(),e.eatWhile(/[\w\?]/),"variable-3"):/\w/.test(n)?(e.eatWhile(/[\w\?]/),e.eat(":")?"atom":"ident"):n!="|"||!t.varList&&t.lastTok!="{"&&t.lastTok!="do"?/[\(\)\[\]{}\\;]/.test(n)?(u=n,null):n=="-"&&e.eat(">")?"arrow":/[=+\-\/*:\.^%<>~|]/.test(n)?(e.eatWhile(/[=+\-\/*:\.^%<>~|]/),"operator"):null:(u="|",null)}function l(){var e=1;return function(t,n){if(t.peek()=="}"){e--;if(e==0)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)}else t.peek()=="{"&&e++;return f(t,n)}}function c(e,t,n,r){return function(i,s){var o=!1,u;while((u=i.next())!=null){if(u==e&&(r||!o)){s.tokenize.pop();break}if(n&&u=="#"&&!o&&i.eat("{")){s.tokenize.push(l(arguments.callee));break}o=!o&&u=="\\"}return t}}function h(e){return function(t,n){return t.match(e)?n.tokenize.pop():t.skipToEnd(),"string"}}function p(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}var r=n(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload"]),i=n(["def","class","case","for","while","do","module","then","catch","loop","proc","begin"]),s=n(["end","until"]),o={"[":"]","{":"}","(":")"},u;return{startState:function(){return{tokenize:[f],indented:0,context:{type:"top",indented:-e.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){e.sol()&&(t.indented=e.indentation());var n=t.tokenize[t.tokenize.length-1](e,t),o;if(n=="ident"){var a=e.current();n=r.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(a)?"tag":t.lastTok=="def"||t.lastTok=="class"||t.varList?"def":"variable",i.propertyIsEnumerable(a)?o="indent":s.propertyIsEnumerable(a)?o="dedent":(a=="if"||a=="unless")&&e.column()==e.indentation()&&(o="indent")}if(u||n&&n!="comment")t.lastTok=a||u||n;return u=="|"&&(t.varList=!t.varList),o=="indent"||/[\(\[\{]/.test(u)?t.context={prev:t.context,type:u||n,indented:t.indented}:(o=="dedent"||/[\)\]\}]/.test(u))&&t.context.prev&&(t.context=t.context.prev),e.eol()&&(t.continuedLine=u=="\\"||n=="operator"),n},indent:function(t,n){if(t.tokenize[t.tokenize.length-1]!=f)return 0;var r=n&&n.charAt(0),i=t.context,s=i.type==o[r]||i.type=="keyword"&&/^(?:end|until|else|elsif|when|rescue)\b/.test(n);return i.indented+(s?0:e.indentUnit)+(t.continuedLine?e.indentUnit:0)},electricChars:"}de"}}),CodeMirror.defineMIME("text/x-ruby","ruby"),CodeMirror.defineMode("shell",function(e){function n(e,n){var r=n.split(" ");for(var i=0;i<r.length;i++)t[r[i]]=e}function r(e,n){var r=e.sol(),u=e.next();if(u==="'"||u==='"'||u==="`")return n.tokens.unshift(i(u)),o(e,n);if(u==="#")return r&&e.eat("!")?(e.skipToEnd(),"meta"):(e.skipToEnd(),"comment");if(u==="$")return n.tokens.unshift(s),o(e,n);if(u==="+"||u==="=")return"operator";if(u==="-")return e.eat("-"),e.eatWhile(/\w/),"attribute";if(/\d/.test(u)){e.eatWhile(/\d/);if(!/\w/.test(e.peek()))return"number"}e.eatWhile(/\w/);var a=e.current();return e.peek()==="="&&/\w+/.test(a)?"def":t.hasOwnProperty(a)?t[a]:null}function i(e){return function(t,n){var r,i=!1,o=!1;while((r=t.next())!=null){if(r===e&&!o){i=!0;break}if(r==="$"&&!o&&e!=="'"){o=!0,t.backUp(1),n.tokens.unshift(s);break}o=!o&&r==="\\"}return(i||!o)&&n.tokens.shift(),e==="`"||e===")"?"quote":"string"}}function o(e,t){return(t.tokens[0]||r)(e,t)}var t={};n("atom","true false"),n("keyword","if then do else elif while until for in esac fi fin fil done exit set unset export function"),n("builtin","ab awk bash beep cat cc cd chown chmod chroot clear cp curl cut diff echo find gawk gcc get git grep kill killall ln ls make mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh shopt shred source sort sleep ssh start stop su sudo tee telnet top touch vi vim wall wc wget who write yes zsh");var s=function(e,t){t.tokens.length>1&&e.eat("$");var n=e.next(),r=/\w/;return n==="{"&&(r=/[^}]/),n==="("?(t.tokens[0]=i(")"),o(e,t)):(/\d/.test(n)||(e.eatWhile(r),e.eat("}")),t.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(e,t){return e.eatSpace()?null:o(e,t)}}}),CodeMirror.defineMIME("text/x-sh","shell"),CodeMirror.defineMode("xml",function(e,t){function u(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();if(r=="<"){if(e.eat("!"))return e.eat("[")?e.match("CDATA[")?n(l("atom","]]>")):null:e.match("--")?n(l("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(c(1))):null;if(e.eat("?"))return e.eatWhile(/[\w\._\-]/),t.tokenize=l("meta","?>"),"meta";o=e.eat("/")?"closeTag":"openTag",e.eatSpace(),s="";var i;while(i=e.eat(/[^\s\u00a0=<>\"\'\/?]/))s+=i;return t.tokenize=a,"tag"}if(r=="&"){var u;return e.eat("#")?e.eat("x")?u=e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):u=e.eatWhile(/[\d]/)&&e.eat(";"):u=e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),u?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var n=e.next();return n==">"||n=="/"&&e.eat(">")?(t.tokenize=u,o=n==">"?"endTag":"selfcloseTag","tag"):n=="="?(o="equals",null):/[\'\"]/.test(n)?(t.tokenize=f(n),t.tokenize(e,t)):(e.eatWhile(/[^\s\u00a0=<>\"\'\/?]/),"word")}function f(e){return function(t,n){while(!t.eol())if(t.next()==e){n.tokenize=a;break}return"string"}}function l(e,t){return function(n,r){while(!n.eol()){if(n.match(t)){r.tokenize=u;break}n.next()}return e}}function c(e){return function(t,n){var r;while((r=t.next())!=null){if(r=="<")return n.tokenize=c(e+1),n.tokenize(t,n);if(r==">"){if(e==1){n.tokenize=u;break}return n.tokenize=c(e-1),n.tokenize(t,n)}}return"meta"}}function d(){for(var e=arguments.length-1;e>=0;e--)h.cc.push(arguments[e])}function v(){return d.apply(null,arguments),!0}function m(e,t){var n=r.doNotIndent.hasOwnProperty(e)||h.context&&h.context.noIndent;h.context={prev:h.context,tagName:e,indent:h.indented,startOfLine:t,noIndent:n}}function g(){h.context&&(h.context=h.context.prev)}function y(e){if(e=="openTag")return h.tagName=s,v(S,b(h.startOfLine));if(e=="closeTag"){var t=!1;return h.context?h.context.tagName!=s&&(r.implicitlyClosed.hasOwnProperty(h.context.tagName.toLowerCase())&&g(),t=!h.context||h.context.tagName!=s):t=!0,t&&(p="error"),v(w(t))}return v()}function b(e){return function(t){return t=="selfcloseTag"||t=="endTag"&&r.autoSelfClosers.hasOwnProperty(h.tagName.toLowerCase())?(E(h.tagName.toLowerCase()),v()):t=="endTag"?(E(h.tagName.toLowerCase()),m(h.tagName,e),v()):v()}}function w(e){return function(t){return e&&(p="error"),t=="endTag"?(g(),v()):(p="error",v(arguments.callee))}}function E(e){var t;for(;;){if(!h.context)return;t=h.context.tagName.toLowerCase();if(!r.contextGrabbers.hasOwnProperty(t)||!r.contextGrabbers[t].hasOwnProperty(e))return;g()}}function S(e){return e=="word"?(p="attribute",v(x,S)):e=="endTag"||e=="selfcloseTag"?d():(p="error",v(S))}function x(e){return e=="equals"?v(T,S):(r.allowMissing||(p="error"),e=="endTag"||e=="selfcloseTag"?d():v())}function T(e){return e=="string"?v(N):e=="word"&&r.allowUnquoted?(p="string",v()):(p="error",e=="endTag"||e=="selfCloseTag"?d():v())}function N(e){return e=="string"?v(N):d()}var n=e.indentUnit,r=t.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:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1},i=t.alignCDATA,s,o,h,p;return{startState:function(){return{tokenize:u,cc:[],indented:0,startOfLine:!0,tagName:null,context:null}},token:function(e,t){e.sol()&&(t.startOfLine=!0,t.indented=e.indentation());if(e.eatSpace())return null;p=o=s=null;var n=t.tokenize(e,t);t.type=o;if((n||o)&&n!="comment"){h=t;for(;;){var r=t.cc.pop()||y;if(r(o||n))break}}return t.startOfLine=!1,p||n},indent:function(e,t,r){var s=e.context;if(e.tokenize!=a&&e.tokenize!=u||s&&s.noIndent)return r?r.match(/^(\s*)/)[0].length:0;if(i&&/<!\[CDATA\[/.test(t))return 0;s&&/^<\//.test(t)&&(s=s.prev);while(s&&!s.startOfLine)s=s.prev;return s?s.indent+n:0},electricChars:"/"}}),CodeMirror.defineMIME("text/xml","xml"),CodeMirror.defineMIME("application/xml","xml"),CodeMirror.mimeModes.hasOwnProperty("text/html")||CodeMirror.defineMIME("text/html",{name:"xml",htmlMode:!0}) |