mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-03 23:34:01 +01:00
1 line
109 KiB
JavaScript
1 line
109 KiB
JavaScript
window.CodeMirror=function(){"use strict";function e(r,i){function cn(e){if(s.onDragEvent&&s.onDragEvent(vn,K(e)))return;Y(e)}function dn(e){return e>=0&&e<Dt.size}function mn(e){return z(Dt,e)}function gn(e,t){Qt=!0;var n=t-e.height;for(var r=e;r;r=r.parent)r.height+=n}function yn(e,t){return e.styles||e.highlight(_t,e.stateAfter=ai(W(e)),s.tabSize),e.getContent(s.tabSize,t,s.lineWrapping)}function bn(e){var t={line:0,ch:0};jn(t,{line:Dt.size-1,ch:mn(Dt.size-1).text.length},Nt(e),t,t),Xt=!0}function wn(e){var t=[];return Dt.iter(0,Dt.size,function(e){t.push(e.text)}),t.join(e||"\n")}function En(e){M.scrollTop!=qt&&(qt=Et.scrollTop=M.scrollTop,ur([]))}function Sn(e){s.fixedGutter&&ut.style.left!=Et.scrollLeft+"px"&&(ut.style.left=Et.scrollLeft+"px"),Et.scrollTop!=qt&&(qt=Et.scrollTop,M.scrollTop!=qt&&(M.scrollTop=qt),ur([])),s.onScroll&&s.onScroll(vn)}function xn(e){function u(t){b&&(Et.draggable=!1),Rt=!1,l(),c(),Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)<10&&(Q(t),mr(n.line,n.ch,!0),tr())}function m(e){if(i=="single")pr(n,e);else if(i=="double"){var t=xr(e);mt(e,h)?pr(t.from,p):pr(h,t.to)}else i=="triple"&&(mt(e,h)?pr(p,yr({line:e.line,ch:0})):pr(h,yr({line:e.line+1,ch:0})))}function g(e){var t=ti(e,!0);if(t&&!vt(t,a)){Ht||Hn(),a=t,m(t),Xt=!1;var n=or();if(t.line>=n.to||t.line<n.from)f=setTimeout(di(function(){g(e)}),150)}}function y(e){clearTimeout(f);var t=ti(e);t&&m(t),Q(e),tr(),Xt=!0,w(),l()}hr(tt(e,"shiftKey"));for(var t=Z(e);t!=Lt;t=t.parentNode)if(t.parentNode==ct&&t!=at)return;for(var t=Z(e);t!=Lt;t=t.parentNode)if(t.parentNode==ot)return s.onGutterClick&&s.onGutterClick(vn,xt(ot.childNodes,t)+Zt,e),Q(e);var n=ti(e);switch(et(e)){case 3:d&&ri(e);return;case 2:n&&mr(n.line,n.ch,!0),setTimeout(tr,20),Q(e);return}if(!n){Z(e)==Et&&Q(e);return}Ht||Hn();var r=+(new Date),i="single";if(It&&It.time>r-400&&vt(It.pos,n))i="triple",Q(e),setTimeout(tr,20),Tr(n.line);else if(Ft&&Ft.time>r-400&&vt(Ft.pos,n)){i="double",It={time:r,pos:n},Q(e);var o=xr(n);pr(o.from,o.to)}else Ft={time:r,pos:n};var a=n,f;if(s.dragDrop&&st&&!s.readOnly&&!vt(Bt.from,Bt.to)&&!mt(n,Bt.from)&&!mt(Bt.to,n)&&i=="single"){b&&(Et.draggable=!0);var l=nt(document,"mouseup",di(u),!0),c=nt(Et,"drop",di(u),!0);Rt=!0,Et.dragDrop&&Et.dragDrop();return}Q(e),i=="single"&&mr(n.line,n.ch,!0);var h=Bt.from,p=Bt.to,w=nt(document,"mousemove",di(function(e){clearTimeout(f),Q(e),!v&&!et(e)?y(e):g(e)}),!0),l=nt(document,"mouseup",di(y),!0)}function Tn(e){for(var t=Z(e);t!=Lt;t=t.parentNode)if(t.parentNode==ot)return Q(e);Q(e)}function Nn(e){if(s.onDragEvent&&s.onDragEvent(vn,K(e)))return;Q(e);var t=ti(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=yr(t),di(function(){var e=Xn(i.join(""),t,t);pr(t,e)})())},s.readAsText(e)};for(var a=0;a<r;++a)u(n[a],a)}else{if(Rt&&!mt(t,Bt.from)&&!mt(Bt.to,t))return;try{var i=e.dataTransfer.getData("Text");i&&vi(function(){var e=Bt.from,n=Bt.to;pr(t,t),Rt&&Xn("",e,n),Vn(i),tr()})}catch(e){}}}function Cn(e){var t=Kn();e.dataTransfer.setData("Text",t),e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(yt("img"),0,0)}function kn(e,t){if(typeof e=="string"){e=f[e];if(!e)return!1}var n=jt;try{s.readOnly&&(zt=!0),t&&(jt=null),e(vn)}catch(r){if(r!=it)throw r;return!1}finally{jt=n,zt=!1}return!0}function An(e){function f(){a=!0}var t=c(s.keyMap),r=t.auto;clearTimeout(Ln),r&&!p(e)&&(Ln=setTimeout(function(){c(s.keyMap)==t&&(s.keyMap=r.call?r.call(null,vn):r)},50));var i=kt[tt(e,"keyCode")],o=!1,u=E&&n;if(i==null||e.altGraphKey)return!1;tt(e,"altKey")&&(i="Alt-"+i),tt(e,u?"metaKey":"ctrlKey")&&(i="Ctrl-"+i),tt(e,u?"ctrlKey":"metaKey")&&(i="Cmd-"+i);var a=!1;return tt(e,"shiftKey")?o=h("Shift-"+i,s.extraKeys,s.keyMap,function(e){return kn(e,!0)},f)||h(i,s.extraKeys,s.keyMap,function(e){if(typeof e=="string"&&/^go[A-Z]/.test(e))return kn(e)},f):o=h(i,s.extraKeys,s.keyMap,kn,f),a&&(o=!1),o&&(Q(e),ii(),v&&(e.oldKeyCode=e.keyCode,e.keyCode=0)),o}function On(e,t){var n=h("'"+t+"'",s.extraKeys,s.keyMap,function(e){return kn(e,!0)});return n&&(Q(e),ii()),n}function _n(e){Ht||Hn(),v&&e.keyCode==27&&(e.returnValue=!1),un&&Zn()&&(un=!1);if(s.onKeyEvent&&s.onKeyEvent(vn,K(e)))return;var t=tt(e,"keyCode");hr(t==16||tt(e,"shiftKey"));var r=An(e);E&&(Mn=r?t:null,!r&&t==88&&tt(e,n?"metaKey":"ctrlKey")&&Vn(""))}function Dn(e){un&&Zn();if(s.onKeyEvent&&s.onKeyEvent(vn,K(e)))return;var t=tt(e,"keyCode"),n=tt(e,"charCode");if(E&&t==Mn){Mn=null,Q(e);return}if((E&&(!e.which||e.which<10)||x)&&An(e))return;var r=String.fromCharCode(n==null?t:n);s.electricChars&&_t.electricChars&&s.smartIndent&&!s.readOnly&&_t.electricChars.indexOf(r)>-1&&setTimeout(di(function(){Cr(Bt.to.line,"smart")}),75);if(On(e,r))return;Gn()}function Pn(e){if(s.onKeyEvent&&s.onKeyEvent(vn,K(e)))return;tt(e,"keyCode")==16&&(jt=null)}function Hn(){if(s.readOnly=="nocursor")return;Ht||(s.onFocus&&s.onFocus(vn),Ht=!0,Et.className.search(/\bCodeMirror-focused\b/)==-1&&(Et.className+=" CodeMirror-focused")),Qn(),ii()}function Bn(){Ht&&(s.onBlur&&s.onBlur(vn),Ht=!1,nn&&di(function(){nn&&(nn(),nn=null)})(),Et.className=Et.className.replace(" CodeMirror-focused","")),clearInterval(Mt),setTimeout(function(){Ht||(jt=null)},150)}function jn(e,t,n,r,i){if(zt)return;var o=[];Dt.iter(e.line,t.line+1,function(e){o.push(B(e.text,e.markedSpans))});if(fn){fn.addChange(e.line,n.length,o);while(fn.done.length>s.undoDepth)fn.done.shift()}var u=D(H(o[0]),H(pt(o)),e.ch,t.ch,n);Rn(e,t,u,r,i)}function Fn(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;Dt.iter(s.start,u,function(e){o.push(B(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:St(P(pt(o)),P(pt(s.old)))};Rn({line:s.start,ch:0},{line:u-1,ch:mn(u-1).text.length},s.old,a,a)}Xt=!0,t.push(r)}function In(){Fn(fn.done,fn.undone)}function qn(){Fn(fn.undone,fn.done)}function Rn(e,t,n,r,i){function w(e){return e<=Math.min(t.line,t.line+g)?e:e+g}if(zt)return;var o=!1,u=rn.text.length;s.lineWrapping||Dt.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)Qt=!0;var a=t.line-e.line,f=mn(e.line),l=mn(t.line),c=pt(n);if(e.ch==0&&t.ch==0&&P(c)==""){var h=[],p=null;for(var d=0,v=n.length-1;d<v;++d)h.push(new q(P(n[d]),H(n[d])));l.update(l.text,H(c)),a&&Dt.remove(e.line,a,Gt),h.length&&Dt.insert(e.line,h)}else if(f==l)if(n.length==1)f.update(f.text.slice(0,e.ch)+P(n[0])+f.text.slice(t.ch),H(n[0]));else{for(var h=[],d=1,v=n.length-1;d<v;++d)h.push(new q(P(n[d]),H(n[d])));h.push(new q(P(c)+f.text.slice(t.ch),H(c))),f.update(f.text.slice(0,e.ch)+P(n[0]),H(n[0])),Dt.insert(e.line+1,h)}else if(n.length==1)f.update(f.text.slice(0,e.ch)+P(n[0])+l.text.slice(t.ch),H(n[0])),Dt.remove(e.line+1,a,Gt);else{var h=[];f.update(f.text.slice(0,e.ch)+P(n[0]),H(n[0])),l.update(P(c)+l.text.slice(t.ch),H(c));for(var d=1,v=n.length-1;d<v;++d)h.push(new q(P(n[d]),H(n[d])));a>1&&Dt.remove(e.line+1,a-1,Gt),Dt.insert(e.line+1,h)}if(s.lineWrapping){var m=Math.max(5,Et.clientWidth/Yr()-3);Dt.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&&gn(e,t)})}else Dt.iter(e.line,e.line+n.length,function(e){var t=e.text;!e.hidden&&t.length>u&&(rn=e,u=t.length,on=!0,o=!1)}),o&&(sn=!0);Pt=Math.min(Pt,e.line),li(400);var g=n.length-a-1;$t.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(Jt){for(var b=Jt;b.next;b=b.next);b.next=y}else Jt=y}dr(yr(r),yr(i),w(Bt.from.line),w(Bt.to.line))}function Un(){var e=Dt.height*Kr()+2*Zr();return e*.99>Et.offsetHeight?e:!1}function zn(e){var t=Un();M.style.display=t?"block":"none",t?(L.style.height=ct.style.minHeight=t+"px",M.style.height=Et.clientHeight+"px",e!=null&&(M.scrollTop=Et.scrollTop=e,b&&setTimeout(function(){if(M.scrollTop!=e)return;M.scrollTop=e+(e?-1:1),M.scrollTop=e},0))):ct.style.minHeight="",at.style.top=Yt*Kr()+"px"}function Wn(){rn=mn(0),on=!0;var e=rn.text.length;Dt.iter(1,Dt.size,function(t){var n=t.text;!t.hidden&&n.length>e&&(e=n.length,rn=t)}),sn=!1}function Xn(e,t,n){function r(r){if(mt(r,t))return r;if(!mt(n,r))return i;var s=r.line+e.length-(n.line-t.line)-1,o=r.ch;return r.line==n.line&&(o+=pt(e).length-(n.ch-(n.line==t.line?t.ch:0))),{line:s,ch:o}}t=yr(t),n?n=yr(n):n=t,e=Nt(e);var i;return $n(e,t,n,function(e){return i=e,{from:r(Bt.from),to:r(Bt.to)}}),i}function Vn(e,t){$n(Nt(e),Bt.from,Bt.to,function(e){return t=="end"?{from:e,to:e}:t=="start"?{from:Bt.from,to:Bt.from}:{from:Bt.from,to:e}})}function $n(e,t,n,r){var i=e.length==1?e[0].length+t.ch:pt(e).length,s=r({line:t.line+e.length-1,ch:i});jn(t,n,e,s.from,s.to)}function Jn(e,t,n){var r=e.line,i=t.line;if(r==i)return mn(r).text.slice(e.ch,t.ch);var s=[mn(r).text.slice(e.ch)];return Dt.iter(r+1,i,function(e){s.push(e.text)}),s.push(mn(i).text.slice(0,t.ch)),s.join(n||"\n")}function Kn(e){return Jn(Bt.from,Bt.to,e)}function Qn(){if(un)return;At.set(s.pollInterval,function(){Zn(),Ht&&Qn()})}function Gn(){function t(){var n=Zn();!n&&!e?(e=!0,At.set(60,t)):(un=!1,Qn())}var e=!1;un=!0,At.set(20,t)}function Zn(){if(!Ht||Ct(S)||s.readOnly)return!1;var e=S.value;if(e==Yn)return!1;pi||ci(),jt=null;var t=0,n=Math.min(Yn.length,e.length);while(t<n&&Yn[t]==e[t])++t;return t<Yn.length?Bt.from={line:Bt.from.line,ch:Bt.from.ch-(Yn.length-t)}:Ut&&vt(Bt.from,Bt.to)&&!Wt&&(Bt.to={line:Bt.to.line,ch:Math.min(mn(Bt.to.line).text.length,Bt.to.ch+(e.length-t))}),Vn(e.slice(t),"end"),e.length>1e3?S.value=Yn="":Yn=e,pi||hi(),Wt=!1,!0}function er(e){vt(Bt.from,Bt.to)?e&&(Yn=S.value=""):(Yn="",S.value=Kn(),Ht&&dt(S))}function tr(){s.readOnly!="nocursor"&&S.focus()}function nr(){var e=rr();ir(e.x,e.y,e.x,e.yBot);if(!Ht)return;var t=ct.getBoundingClientRect(),n=null;e.y+t.top<0?n=!0:e.y+t.top+Kr()>(window.innerHeight||document.documentElement.clientHeight)&&(n=!1);if(n!=null){var r=F.style.display=="none";r&&(F.style.display="",F.style.left=e.x+"px",F.style.top=e.y-Yt+"px"),F.scrollIntoView(n),r&&(F.style.display="none")}}function rr(){var e=zr(Bt.inverted?Bt.from:Bt.to),t=s.lineWrapping?Math.min(e.x,G.offsetWidth):e.x;return{x:t,y:e.y,yBot:e.yBot}}function ir(e,t,n,r){var i=sr(e,t,n,r);i.scrollLeft!=null&&(Et.scrollLeft=i.scrollLeft),i.scrollTop!=null&&(M.scrollTop=Et.scrollTop=i.scrollTop)}function sr(e,t,n,r){var i=ei(),o=Zr();t+=o,r+=o,e+=i,n+=i;var u=Et.clientHeight,a=M.scrollTop,f={},l=Un()||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=Et.clientWidth,d=Et.scrollLeft,v=s.fixedGutter?ut.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 or(e){var t=Kr(),n=(e!=null?e:M.scrollTop)-Zr(),r=Math.max(0,Math.floor(n/t)),i=Math.ceil((n+Et.clientHeight)/t);return{from:X(Dt,r),to:X(Dt,i)}}function ur(e,t,n){function d(){var e=_.firstChild,t=!1;return Dt.iter(Zt,en,function(n){if(!e)return;if(!n.hidden){var r=Math.round(e.offsetHeight/c)||1;n.height!=r&&(gn(n,r),Qt=t=!0)}e=e.nextSibling}),t}if(!Et.clientWidth){Zt=en=Yt=0;return}var r=or(n);if(e!==!0&&e.length==0&&r.from>Zt&&r.to<en){zn(n);return}var i=Math.max(r.from-100,0),o=Math.min(Dt.size,r.to+100);Zt<i&&i-Zt<20&&(i=Zt),en>o&&en-o<20&&(o=Math.min(Dt.size,en));var u=e===!0?[]:ar([{from:Zt,to:en,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==Zt&&o==en){zn(n);return}u.sort(function(e,t){return e.domStart-t.domStart});var c=Kr(),h=ut.style.display;_.style.display="none",fr(i,o,u),_.style.display=ut.style.display="";var p=i!=Zt||o!=en||tn!=Et.clientHeight+c;p&&(tn=Et.clientHeight+c),(i!=Zt||o!=en&&s.onViewportChange)&&setTimeout(function(){s.onViewportChange&&s.onViewportChange(vn,i,o)}),Zt=i,en=o,Yt=V(Dt,i),li(100);if(_.childNodes.length!=en-Zt)throw new Error("BAD PATCH! "+JSON.stringify(u)+" size="+(en-Zt)+" nodes="+_.childNodes.length);return s.lineWrapping&&d(),ut.style.display=h,(p||Qt)&&lr()&&s.lineWrapping&&d()&&lr(),zn(n),cr(),!t&&s.onUpdate&&s.onUpdate(vn),!0}function ar(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 fr(e,t,n){function r(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}if(!n.length)bt(_);else{var i=0,s=_.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=_.firstChild,f=e;Dt.iter(e,t,function(e){c&&c.to==f&&(c=n.shift());if(!c||c.from>f){if(e.hidden)var t=yt("pre");else{var t=yn(e);e.className&&(t.className=e.className);if(e.bgClassName){var r=yt("pre","\u00a0",e.bgClassName,"position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2");t=yt("div",[r,t],null,"position: relative")}}_.insertBefore(t,s)}else s=s.nextSibling;++f})}function lr(){if(!s.gutter&&!s.lineNumbers)return;var e=at.offsetHeight,t=Et.clientHeight;ut.style.height=(e-t<2?t:e)+"px";var n=document.createDocumentFragment(),r=Zt,i;Dt.iter(Zt,Math.max(en,Zt+1),function(e){if(e.hidden)n.appendChild(yt("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(yt("pre",null,t&&t.style));u.innerHTML=o;for(var a=1;a<e.height;++a)u.appendChild(yt("br")),u.appendChild(document.createTextNode("\u00a0"));t||(i=r)}++r}),ut.style.display="none",wt(ot,n);if(i!=null&&s.lineNumbers){var o=ot.childNodes[i-Zt],u=String(Dt.size).length,a=lt(o.firstChild),f="";while(a.length+f.length<u)f+="\u00a0";f&&o.insertBefore(document.createTextNode(f),o.firstChild)}ut.style.display="";var l=Math.abs((parseInt(G.style.marginLeft)||0)-ut.offsetWidth)>2;return G.style.marginLeft=ut.offsetWidth+"px",Qt=!1,l}function cr(){var e=vt(Bt.from,Bt.to),t=zr(Bt.from,!0),n=e?t:zr(Bt.to,!0),r=Bt.inverted?t:n,i=Kr(),o=ft(Lt),u=ft(_);k.style.top=Math.max(0,Math.min(Et.offsetHeight,r.y+u.top-o.top))+"px",k.style.left=Math.max(0,Math.min(Et.offsetWidth,r.x+u.left-o.left))+"px";if(e)F.style.top=r.y+"px",F.style.left=(s.lineWrapping?Math.min(r.x,G.offsetWidth):r.x)+"px",F.style.display="",j.style.display="none";else{var a=t.y==n.y,f=document.createDocumentFragment(),l=G.clientWidth||G.offsetWidth,c=G.clientHeight||G.offsetHeight,h=function(e,t,n,r){var i=y?"width: "+(n?l-n-e:l)+"px":"right: "+n+"px";f.appendChild(yt("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; "+i+"; height: "+r+"px"))};if(Bt.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+(Bt.from.ch?i:0)),v=Math.min(n.y,c)-d;v>.2*i&&h(0,d,0,v),(!a||!Bt.from.ch)&&n.y<c-.5*i&&h(0,n.y,l-n.x,i),wt(j,f),F.style.display="none",j.style.display=""}}function hr(e){e?jt=jt||(Bt.inverted?Bt.to:Bt.from):jt=null}function pr(e,t){var n=jt&&yr(jt);n&&(mt(n,e)?e=n:mt(t,n)&&(t=n)),dr(e,t),Vt=!0}function dr(e,t,n,r){an=null,n==null&&(n=Bt.from.line,r=Bt.to.line);if(vt(Bt.from,e)&&vt(Bt.to,t))return;if(mt(t,e)){var i=t;t=e,e=i}if(e.line!=n){var o=vr(e,n,Bt.from.ch);o?e=o:qr(e.line,!1)}t.line!=r&&(t=vr(t,r,Bt.to.ch)),vt(e,t)?Bt.inverted=!1:vt(e,Bt.to)?Bt.inverted=!1:vt(t,Bt.from)&&(Bt.inverted=!0);if(s.autoClearEmptyLines&&vt(Bt.from,Bt.to)){var u=Bt.inverted?e:t;if(u.line!=Bt.from.line&&Bt.from.line<Dt.size){var a=mn(Bt.from.line);/^\s+$/.test(a.text)&&setTimeout(di(function(){if(a.parent&&/^\s+$/.test(a.text)){var e=W(a);Xn("",{line:e,ch:0},{line:e,ch:a.text.length})}},10))}}Bt.from=e,Bt.to=t,Kt=!0}function vr(e,t,n){function r(t){var r=e.line+t,i=t==1?Dt.size:-1;while(r!=i){var o=mn(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=mn(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 mr(e,t,n){var r=yr({line:e,ch:t||0});(n?pr:dr)(r,r)}function gr(e){return Math.max(0,Math.min(e,Dt.size-1))}function yr(e){if(e.line<0)return{line:0,ch:0};if(e.line>=Dt.size)return{line:Dt.size-1,ch:mn(Dt.size-1).text.length};var t=e.ch,n=mn(e.line).text.length;return t==null||t>n?{line:e.line,ch:n}:t<0?{line:e.line,ch:0}:e}function br(e,t){function o(){for(var t=r+e,n=e<0?-1:Dt.size;t!=n;t+=e){var i=mn(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=Bt.inverted?Bt.from:Bt.to,r=n.line,i=n.ch,s=mn(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(Tt(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 wr(e,t){var n=e<0?Bt.from:Bt.to;if(jt||vt(Bt.from,Bt.to))n=br(e,t);mr(n.line,n.ch,!0)}function Er(e,t){vt(Bt.from,Bt.to)?e<0?Xn("",br(e,t),Bt.to):Xn("",Bt.from,br(e,t)):Xn("",Bt.from,Bt.to),Vt=!0}function Sr(e,t){var n=0,r=zr(Bt.inverted?Bt.from:Bt.to,!0);an!=null&&(r.x=an);if(t=="page")var i=Math.min(Et.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Wr(r.x,r.y+i*e);else if(t=="line")var o=Kr(),s=Wr(r.x,r.y+.5*o+e*o);t=="page"&&(M.scrollTop+=zr(s,!0).y-r.y),mr(s.line,s.ch,!0),an=r.x}function xr(e){var t=mn(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=Tt(i)?Tt:/\s/.test(i)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&Tt(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 Tr(e){pr({line:e,ch:0},yr({line:e+1,ch:0}))}function Nr(e){if(vt(Bt.from,Bt.to))return Cr(Bt.from.line,e);var t=Bt.to.line-(Bt.to.ch?0:1);for(var n=Bt.from.line;n<=t;++n)Cr(n,e)}function Cr(e,t){t||(t="add");if(t=="smart")if(!_t.indent)t="prev";else var n=ai(e);var r=mn(e),i=r.indentation(s.tabSize),o=r.text.match(/^\s*/)[0],u;t=="smart"&&(u=_t.indent(n,r.text.slice(o.length),r.text),u==it&&(t="prev")),t=="prev"?e?u=mn(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+=ht(u-l)),f!=o&&Xn(f,{line:e,ch:0},{line:e,ch:o.length}),r.stateAfter=null}function kr(){_t=e.getMode(s,s.mode),Dt.iter(0,Dt.size,function(e){e.stateAfter=null}),Pt=0,li(100)}function Lr(){var e=s.gutter||s.lineNumbers;ut.style.display=e?"":"none",e?Qt=!0:_.parentNode.style.marginLeft=0}function Ar(e,t){if(s.lineWrapping){Lt.className+=" CodeMirror-wrap";var n=Et.clientWidth/Yr()-3;Dt.iter(0,Dt.size,function(e){if(e.hidden)return;var t=Math.ceil(e.text.length/n)||1;t!=1&&gn(e,t)}),G.style.minWidth=I.style.left=""}else Lt.className=Lt.className.replace(" CodeMirror-wrap",""),Wn(),Dt.iter(0,Dt.size,function(e){e.height!=1&&!e.hidden&&gn(e,1)});$t.push({from:0,to:Dt.size})}function Or(){Et.className=Et.className.replace(/\s*cm-s-\S+/g,"")+s.theme.replace(/(^|\s)\s*/g," cm-s-")}function Mr(){var e=l[s.keyMap].style;Lt.className=Lt.className.replace(/\s*cm-keymap-\S+/g,"")+(e?" cm-keymap-"+e:"")}function _r(e,t){this.lines=[],this.type=e,t&&(this.style=t)}function Dr(e,t,n,r){e=yr(e),t=yr(t);var i=new _r("range",n);if(r)for(var s in r)r.hasOwnProperty(s)&&(i[s]=r[s]);var o=e.line;return Dt.iter(o,t.line+1,function(n){var r={from:o==e.line?e.ch:null,to:o==t.line?t.ch:null,marker:i};n.markedSpans=(n.markedSpans||[]).concat([r]),i.lines.push(n),++o}),$t.push({from:e.line,to:t.line+1}),i}function Pr(e){e=yr(e);var t=new _r("bookmark"),n=mn(e.line);fn.addChange(e.line,1,[B(n.text,n.markedSpans)],!0);var r={from:e.ch,to:e.ch,marker:t};return n.markedSpans=(n.markedSpans||[]).concat([r]),t.lines.push(n),t}function Hr(e){e=yr(e);var t=[],n=mn(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 Br(e,t,n){return typeof e=="number"&&(e=mn(gr(e))),e.gutterMarker={text:t,style:n},Qt=!0,e}function jr(e){typeof e=="number"&&(e=mn(gr(e))),e.gutterMarker=null,Qt=!0}function Fr(e,t){var n=e,r=e;return typeof e=="number"?r=mn(gr(e)):n=W(e),n==null?null:t(r,n)?($t.push({from:n,to:n+1}),r):null}function Ir(e,t,n){return Fr(e,function(e){if(e.className!=t||e.bgClassName!=n)return e.className=t,e.bgClassName=n,!0})}function qr(e,t){return Fr(e,function(e,n){if(e.hidden!=t){e.hidden=t,s.lineWrapping||(t&&e.text.length==rn.text.length?sn=!0:!t&&e.text.length>rn.text.length&&(rn=e,sn=!1)),gn(e,t?0:1);var r=Bt.from.line,i=Bt.to.line;if(t&&(r==n||i==n)){var o=r==n?vr({line:r,ch:0},r,0):Bt.from,u=i==n?vr({line:i,ch:0},i,0):Bt.to;if(!u)return;dr(o,u)}return Qt=!0}})}function Rr(e){if(typeof e=="number"){if(!dn(e))return null;var t=e;e=mn(e);if(!e)return null}else{var t=W(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 Ur(e,t){if(t==0)return{top:0,left:0};var n=yn(e,t);wt(J,n);var r=n.anchor,i=r.offsetTop,s=r.offsetLeft;if(v&&i==0&&s==0){var o=yt("span","x");r.parentNode.insertBefore(o,r.nextSibling),i=o.offsetTop}return{top:i,left:s}}function zr(e,t){var n,r=Kr(),i=r*(V(Dt,e.line)-(t?Yt:0));if(e.ch==0)n=0;else{var o=Ur(mn(e.line),e.ch);n=o.left,s.lineWrapping&&(i+=Math.max(0,o.top))}return{x:n,y:i,yBot:i+r}}function Wr(e,t){function h(e){var t=Ur(u,e);if(f){var r=Math.round(t.top/n);return c=r!=l,Math.max(0,t.left+(r-l)*Et.clientWidth)}return t.left}var n=Kr(),r=Yr(),i=Yt+Math.floor(t/n);if(i<0)return{line:0,ch:0};var o=X(Dt,i);if(o>=Dt.size)return{line:Dt.size-1,ch:mn(Dt.size-1).text.length};var u=mn(o),a=u.text,f=s.lineWrapping,l=f?i-V(Dt,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*Et.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 Xr(e){var t=zr(e,!0),n=ft(G);return{x:n.left+t.x,y:n.top+t.y,yBot:n.top+t.yBot}}function Kr(){if(Jr==null){Jr=yt("pre");for(var e=0;e<49;++e)Jr.appendChild(document.createTextNode("x")),Jr.appendChild(yt("br"));Jr.appendChild(document.createTextNode("x"))}var t=_.clientHeight;return t==$r?Vr:($r=t,wt(J,Jr.cloneNode(!0)),Vr=J.firstChild.offsetHeight/50||1,bt(J),Vr)}function Yr(){if(Et.clientWidth==Gr)return Qr;Gr=Et.clientWidth;var e=yt("span","x"),t=yt("pre",[e]);return wt(J,t),Qr=e.offsetWidth||10}function Zr(){return G.offsetTop}function ei(){return G.offsetLeft}function ti(e,t){var n=ft(Et,!0),r,i;try{r=e.clientX,i=e.clientY}catch(e){return null}if(!t&&(r-n.left>Et.clientWidth||i-n.top>Et.clientHeight))return null;var s=ft(G,!0);return Wr(r-s.left,i-s.top)}function ri(e){function i(){k.style.position="relative",S.style.cssText=r,g&&(M.scrollTop=n),Qn();if(S.selectionStart!=null){clearTimeout(ni);var e=S.value=" "+(vt(Bt.from,Bt.to)?"":S.value),t=0;Yn=" ",S.selectionStart=1,S.selectionEnd=e.length,ni=setTimeout(function i(){Yn==" "&&S.selectionStart==0?di(f.selectAll)(vn):t++<10?ni=setTimeout(i,500):er()},200)}}var t=ti(e),n=M.scrollTop;if(!t||E)return;(vt(Bt.from,Bt.to)||mt(t,Bt.from)||!mt(t,Bt.to))&&di(mr)(t.line,t.ch);var r=S.style.cssText;k.style.position="absolute",S.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);",tr(),er(!0),vt(Bt.from,Bt.to)&&(S.value=Yn=" ");if(d){Y(e);var s=nt(window,"mouseup",function(){s(),setTimeout(i,20)},!0)}else setTimeout(i,50)}function ii(){clearInterval(Mt);var e=!0;F.style.visibility="",Mt=setInterval(function(){F.style.visibility=(e=!e)?"":"hidden"},s.cursorBlinkRate)}function oi(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=si[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=Bt.inverted?Bt.from:Bt.to,n=mn(t.line),r=t.ch-1,i=r>=0&&si[n.text.charAt(r)]||si[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,Dt.size):Math.max(-1,l-100);l!=c;l+=u){var n=mn(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=Dr({line:t.line,ch:r},{line:t.line,ch:r+1},h),b=g.pos!=null&&Dr({line:l,ch:g.pos},{line:l,ch:g.pos+1},h),w=di(function(){y.clear(),b&&b.clear()});e?setTimeout(w,800):nn=w}function ui(e){var t,n;for(var r=e,i=e-40;r>i;--r){if(r==0)return 0;var o=mn(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 ai(e){var t=ui(e),n=t&&mn(t-1).stateAfter;return n?n=N(_t,n):n=C(_t),Dt.iter(t,e,function(r){r.process(_t,n,s.tabSize),r.stateAfter=t==e-1||t%5==0?N(_t,n):null}),n}function fi(){if(Pt>=en)return;var e=+(new Date)+s.workTime,t=N(_t,ai(Pt)),n=Pt;Dt.iter(Pt,en,function(n){Pt>=Zt?(n.highlight(_t,t,s.tabSize),n.stateAfter=N(_t,t)):(n.process(_t,t,s.tabSize),n.stateAfter=Pt%5==0?N(_t,t):null),++Pt;if(+(new Date)>e)return li(s.workDelay),!0}),en>n&&Pt>=Zt&&di(function(){$t.push({from:n,to:Pt})})()}function li(e){Pt<en&&Ot.set(e,fi)}function ci(){Xt=Vt=Jt=null,$t=[],Kt=!1,Gt=[]}function hi(){sn&&Wn();if(on&&!s.lineWrapping){var e=I.offsetWidth,t=Ur(rn,rn.text.length).left;m||(I.style.left=t+"px",G.style.minWidth=t+e+"px"),on=!1}var n,r;if(Kt){var i=rr();n=sr(i.x,i.y,i.x,i.yBot)}if($t.length||n&&n.scrollTop!=null)r=ur($t,!0,n&&n.scrollTop);r||(Kt&&cr(),Qt&&lr()),n&&nr(),Kt&&ii(),Ht&&(Xt===!0||Xt!==!1&&Kt)&&er(Vt),Kt&&s.matchBrackets&&setTimeout(di(function(){nn&&(nn(),nn=null),vt(Bt.from,Bt.to)&&oi(!1)}),20);var o=Kt,u=Gt;Jt&&s.onChange&&vn&&s.onChange(vn,Jt),o&&s.onCursorActivity&&s.onCursorActivity(vn);for(var a=0;a<u.length;++a)u[a](vn);r&&s.onUpdate&&s.onUpdate(vn)}function di(e){return function(){pi++||ci();try{var t=e.apply(this,arguments)}finally{--pi||hi()}return t}}function vi(e){fn.startCompound();try{return e()}finally{fn.endCompound()}}var s={},a=e.defaults;for(var w in a)a.hasOwnProperty(w)&&(s[w]=(i&&i.hasOwnProperty(w)?i:a)[w]);var S=yt("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em");S.setAttribute("wrap","off"),S.setAttribute("autocorrect","off"),S.setAttribute("autocapitalize","off");var k=yt("div",[S],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),L=yt("div",null,"CodeMirror-scrollbar-inner"),M=yt("div",[L],"CodeMirror-scrollbar"),_=yt("div"),j=yt("div",null,null,"position: relative; z-index: -1"),F=yt("pre","\u00a0","CodeMirror-cursor"),I=yt("pre","\u00a0","CodeMirror-cursor","visibility: hidden"),J=yt("div",null,null,"position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden;"),G=yt("div",[J,F,I,j,_],null,"position: relative; z-index: 0"),ot=yt("div",null,"CodeMirror-gutter-text"),ut=yt("div",[ot],"CodeMirror-gutter"),at=yt("div",[ut,yt("div",[G],"CodeMirror-lines")],null,"position: relative"),ct=yt("div",[at],null,"position: relative"),Et=yt("div",[ct],"CodeMirror-scroll");Et.setAttribute("tabIndex","-1");var Lt=yt("div",[k,M,Et],"CodeMirror"+(s.lineWrapping?" CodeMirror-wrap":""));r.appendChild?r.appendChild(Lt):r(Lt),Or(),Mr(),t&&(S.style.width="0px"),b||(Et.draggable=!0),G.style.outline="none",s.tabindex!=null&&(S.tabIndex=s.tabindex),s.autofocus&&tr(),!s.gutter&&!s.lineNumbers&&(ut.style.display="none"),x&&(k.style.height="1px",k.style.position="absolute"),T?(M.style.zIndex=-2,M.style.visibility="hidden"):m&&(M.style.minWidth="18px");var At=new rt,Ot=new rt,Mt,_t,Dt=new U([new R([new q("")])]),Pt=0,Ht;kr();var Bt={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},jt,Ft,It,qt=0,Rt,Ut=!1,zt=!1,Wt=!1,Xt,Vt,$t,Jt,Kt,Qt,Gt,Yt=0,Zt=0,en=0,tn=0,nn,rn=mn(0),sn=!1,on=!0,un=!1,an=null;di(function(){bn(s.value||""),Xt=!1})();var fn=new $;nt(Et,"mousedown",di(xn)),nt(Et,"dblclick",di(Tn)),nt(G,"selectstart",Q),d||nt(Et,"contextmenu",ri),nt(Et,"scroll",Sn),nt(M,"scroll",En),nt(M,"mousedown",function(){Ht&&setTimeout(tr,0)});var ln=nt(window,"resize",function(){Lt.parentNode?ur(!0):ln()},!0);nt(S,"keyup",di(Pn)),nt(S,"input",Gn),nt(S,"keydown",di(_n)),nt(S,"keypress",di(Dn)),nt(S,"focus",Hn),nt(S,"blur",Bn),s.dragDrop&&(nt(Et,"dragstart",Cn),nt(Et,"dragenter",cn),nt(Et,"dragover",cn),nt(Et,"drop",di(Nn))),nt(Et,"paste",function(){tr(),Gn()}),nt(S,"paste",function(){Wt=!0,Gn()}),nt(S,"cut",di(function(){s.readOnly||Vn("")})),x&&nt(ct,"mouseup",function(){document.activeElement==S&&S.blur(),tr()});var hn;try{hn=document.activeElement==S}catch(pn){}hn||s.autofocus?setTimeout(Hn,20):Bn();var vn=Lt.CodeMirror={getValue:wn,setValue:di(bn),getSelection:Kn,replaceSelection:di(Vn),focus:function(){window.focus(),tr(),Hn(),Gn()},setOption:function(e,t){var n=s[e];s[e]=t,e=="mode"||e=="indentUnit"?kr():e=="readOnly"&&t=="nocursor"?(Bn(),S.blur()):e=="readOnly"&&!t?er(!0):e=="theme"?Or():e=="lineWrapping"&&n!=t?di(Ar)():e=="tabSize"?ur(!0):e=="keyMap"?Mr():e=="tabindex"&&(S.tabIndex=t);if(e=="lineNumbers"||e=="gutter"||e=="firstLineNumber"||e=="theme"||e=="lineNumberFormatter")Lr(),ur(!0)},getOption:function(e){return s[e]},getMode:function(){return _t},undo:di(In),redo:di(qn),indentLine:di(function(e,t){typeof t!="string"&&(t==null?t=s.smartIndent?"smart":"prev":t=t?"add":"subtract"),dn(e)&&Cr(e,t)}),indentSelection:di(Nr),historySize:function(){return{undo:fn.done.length,redo:fn.undone.length}},clearHistory:function(){fn=new $},setHistory:function(e){fn=new $,fn.done=e.done,fn.undone=e.undone},getHistory:function(){function e(e){for(var t=0,n=[],r;t<e.length;++t){n.push(r=[]);for(var i=0,s=e[t];i<s.length;++i){var o=[],u=s[i];r.push({start:u.start,added:u.added,old:o});for(var a=0;a<u.old.length;++a)o.push(P(u.old[a]))}}return n}return{done:e(fn.done),undone:e(fn.undone)}},matchBrackets:di(function(){oi(!0)}),getTokenAt:di(function(e){return e=yr(e),mn(e.line).getTokenAt(_t,ai(e.line),s.tabSize,e.ch)}),getStateAfter:function(e){return e=gr(e==null?Dt.size-1:e),ai(e+1)},cursorCoords:function(e,t){return e==null&&(e=Bt.inverted),this.charCoords(e?Bt.from:Bt.to,t)},charCoords:function(e,t){return e=yr(e),t=="local"?zr(e,!1):t=="div"?zr(e,!0):Xr(e)},coordsChar:function(e){var t=ft(G);return Wr(e.x-t.left,e.y-t.top)},markText:di(Dr),setBookmark:Pr,findMarksAt:Hr,setMarker:di(Br),clearMarker:di(jr),setLineClass:di(Ir),hideLine:di(function(e){return qr(e,!0)}),showLine:di(function(e){return qr(e,!1)}),onDeleteLine:function(e,t){if(typeof e=="number"){if(!dn(e))return null;e=mn(e)}return(e.handlers||(e.handlers=[])).push(t),e},lineInfo:Rr,getViewport:function(){return{from:Zt,to:en}},addWidget:function(e,t,n,r,i){e=zr(yr(e));var s=e.yBot,o=e.x;t.style.position="absolute",ct.appendChild(t);if(r=="over")s=e.y;else if(r=="near"){var u=Math.max(Et.offsetHeight,Dt.height*Kr()),a=Math.max(ct.clientWidth,G.clientWidth)-ei();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+Zr()+"px",t.style.left=t.style.right="",i=="right"?(o=ct.clientWidth-t.offsetWidth,t.style.right="0px"):(i=="left"?o=0:i=="middle"&&(o=(ct.clientWidth-t.offsetWidth)/2),t.style.left=o+ei()+"px"),n&&ir(o,s,o+t.offsetWidth,s+t.offsetHeight)},lineCount:function(){return Dt.size},clipPos:yr,getCursor:function(e){return e==null&&(e=Bt.inverted),gt(e?Bt.from:Bt.to)},somethingSelected:function(){return!vt(Bt.from,Bt.to)},setCursor:di(function(e,t,n){t==null&&typeof e.line=="number"?mr(e.line,e.ch,n):mr(e,t,n)}),setSelection:di(function(e,t,n){(n?pr:dr)(yr(e),yr(t||e))}),getLine:function(e){if(dn(e))return mn(e).text},getLineHandle:function(e){if(dn(e))return mn(e)},setLine:di(function(e,t){dn(e)&&Xn(t,{line:e,ch:0},{line:e,ch:mn(e).text.length})}),removeLine:di(function(e){dn(e)&&Xn("",{line:e,ch:0},yr({line:e+1,ch:0}))}),replaceRange:di(Xn),getRange:function(e,t,n){return Jn(yr(e),yr(t),n)},triggerOnKeyDown:di(_n),execCommand:function(e){return f[e](vn)},moveH:di(wr),deleteH:di(Er),moveV:di(Sr),toggleOverwrite:function(){Ut?(Ut=!1,F.className=F.className.replace(" CodeMirror-overwrite","")):(Ut=!0,F.className+=" CodeMirror-overwrite")},posFromIndex:function(e){var t=0,n;return Dt.iter(0,Dt.size,function(r){var i=r.text.length+1;if(i>e)return n=e,!0;e-=i,++t}),yr({line:t,ch:n})},indexFromPos:function(e){if(e.line<0||e.ch<0)return 0;var t=e.ch;return Dt.iter(0,e.line,function(e){t+=e.text.length+1}),t},scrollTo:function(e,t){e!=null&&(Et.scrollLeft=e),t!=null&&(M.scrollTop=Et.scrollTop=t),ur([])},getScrollInfo:function(){return{x:Et.scrollLeft,y:M.scrollTop,height:M.scrollHeight,width:Et.scrollWidth}},setSize:function(e,t){function n(e){return e=String(e),/^\d+$/.test(e)?e+"px":e}e!=null&&(Lt.style.width=n(e)),t!=null&&(Et.style.height=n(t)),vn.refresh()},operation:function(e){return di(e)()},compoundChange:function(e){return vi(e)},refresh:function(){ur(!0,null,qt),M.scrollHeight>qt&&(M.scrollTop=qt)},getInputField:function(){return S},getWrapperElement:function(){return Lt},getScrollerElement:function(){return Et},getGutterElement:function(){return ut}},Ln,Mn=null,Yn="";_r.prototype.clear=di(function(){var e,t;for(var n=0;n<this.lines.length;++n){var r=this.lines[n],i=A(r.markedSpans,this);i.from!=null&&(e=W(r)),i.to!=null&&(t=W(r)),r.markedSpans=O(r.markedSpans,i)}e!=null&&$t.push({from:e,to:t+1}),this.lines.length=0,this.explicitlyCleared=!0}),_r.prototype.find=function(){var e,t;for(var n=0;n<this.lines.length;++n){var r=this.lines[n],i=A(r.markedSpans,this);if(i.from!=null||i.to!=null){var s=W(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 Vr,$r,Jr,Qr,Gr=0,ni,si={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},pi=0;for(var mi in o)o.propertyIsEnumerable(mi)&&!vn.propertyIsEnumerable(mi)&&(vn[mi]=o[mi]);for(var gi=0;gi<u.length;++gi)u[gi](vn);return vn}function c(e){return typeof e=="string"?l[e]:e}function h(e,t,n,r,i){function s(t){t=c(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 p(e){var t=kt[tt(e,"keyCode")];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function N(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 C(e,t,n){return e.startState?e.startState(t,n):!0}function k(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8}function L(e,t,n){this.from=e,this.to=t,this.marker=n}function A(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function O(e,t){var n;for(var r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function M(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 _(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 D(e,t,n,r,i){if(!e&&!t)return i;var s=M(e,n),o=_(t,r),u=i.length==1,a=pt(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=A(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=A(s,l.marker);c||(l.from=a,u&&(s||(s=[])).push(l))}else l.from+=a,u&&(s||(s=[])).push(l)}var h=[B(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(B(i[f+1],d));h.push(B(pt(i),o))}return h}function P(e){return typeof e=="string"?e:e.text}function H(e){if(typeof e=="string")return null;var t=e.markedSpans,n=null;for(var r=0;r<t.length;++r)t[r].marker.explicitlyCleared?n||(n=t.slice(0,r)):n&&n.push(t[r]);return n?n.length?n:null:t}function B(e,t){return t?{text:e,markedSpans:t}:e}function j(e){var t=e.markedSpans;if(!t)return;for(var n=0;n<t.length;++n){var r=t[n].marker.lines,i=xt(r,e);r.splice(i,1)}e.markedSpans=null}function F(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 q(e,t){this.text=e,this.height=1,F(this,t)}function R(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 U(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 z(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 W(e){if(e.parent==null)return null;var t=e.parent,n=xt(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 X(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 V(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 $(){this.time=0,this.done=[],this.undone=[],this.compound=0,this.closed=!1}function J(){Y(this)}function K(e){return e.stop||(e.stop=J),e}function Q(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function G(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Y(e){Q(e),G(e)}function Z(e){return e.target||e.srcElement}function et(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 tt(e,t){var n=e.override&&e.override.hasOwnProperty(t);return n?e.override[t]:e[t]}function nt(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 rt(){this.id=null}function at(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 ft(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 lt(e){return e.textContent||e.innerText||e.nodeValue||""}function ht(e){while(ct.length<=e)ct.push(pt(ct)+" ");return ct[e]}function pt(e){return e[e.length-1]}function dt(e){t?(e.selectionStart=0,e.selectionEnd=e.value.length):e.select()}function vt(e,t){return e.line==t.line&&e.ch==t.ch}function mt(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function gt(e){return{line:e.line,ch:e.ch}}function yt(e,t,n,r){var i=document.createElement(e);n&&(i.className=n),r&&(i.style.cssText=r);if(typeof t=="string")Et(i,t);else if(t)for(var s=0;s<t.length;++s)i.appendChild(t[s]);return i}function bt(e){return e.innerHTML="",e}function wt(e,t){bt(e).appendChild(t)}function Et(e,t){g?(e.innerHTML="",e.appendChild(document.createTextNode(t))):e.textContent=t}function St(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 xt(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 Tt(e){return/\w/.test(e)||e.toUpperCase()!=e.toLowerCase()||/[\u4E00-\u9FA5]/.test(e)}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];if(!r)return e.getMode(t,"text/plain");var s=r(t,n);if(a.hasOwnProperty(n.name)){var o=a[n.name];for(var u in o)o.hasOwnProperty(u)&&(s[u]=o[u])}return s.name=n.name,s},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.defineInitHook=function(e){u.push(e)};var a=e.modeExtensions={};e.extendMode=function(e,t){var n=a.hasOwnProperty(e)?a[e]:a[e]={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r])};var f=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=!vt(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()}},l=e.keyMap={};l.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"},l.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"},l.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"]},l["default"]=n?l.macDefault:l.pcDefault,l.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.isModifierKey=p,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=nt(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 d=/gecko\/\d{7}/i.test(navigator.userAgent),v=/MSIE \d/.test(navigator.userAgent),m=/MSIE [1-7]\b/.test(navigator.userAgent),g=/MSIE [1-8]\b/.test(navigator.userAgent),y=v&&document.documentMode==5,b=/WebKit\//.test(navigator.userAgent),w=/Chrome\//.test(navigator.userAgent),E=/Opera\//.test(navigator.userAgent),S=/Apple Computer/.test(navigator.vendor),x=/KHTML\//.test(navigator.userAgent),T=/Mac OS X 10\D([7-9]|\d\d)\D/.test(navigator.userAgent);e.copyState=N,e.startState=C,e.innerMode=function(e,t){while(e.innerMode){var n=e.innerMode(t);t=n.state,e=n.mode}return n||{mode:e,state:t}},k.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 at(this.string,this.start,this.tabSize)},indentation:function(){return at(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=k;var I=" ";d||v&&!m?I="\u200b":E&&(I=""),q.prototype={update:function(e,t){this.text=e,this.stateAfter=this.styles=null,j(this),F(this,t)},highlight:function(e,t,n){var r=new k(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 k(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 k(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 at(this.text,null,e)},getContent:function(e,t,n){function u(t,n,o){if(!n)return;r&&v&&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(yt("span",ht(c),"cm-tab")),i+=c}else{var h=yt("span","\u2022","cm-invalidchar");h.title="\\u"+f[0].charCodeAt(0).toString(16),u.appendChild(h),i+=1}}}o?t.appendChild(yt("span",[u],o)):t.appendChild(u)}function g(e){return e?"cm-"+e.replace(/ +/g," cm-"):null}var r=!0,i=0,s=/[\t\u0000-\u0019\u200b\u2028\u2029\uFEFF]/g,o=yt("pre"),a=u;if(t!=null){var f=0,l=o.anchor=yt("span");a=function(e,r,i){var s=r.length;if(t>=f&&t<f+s){var o=t-f;if(o){u(e,r.slice(0,o),i);if(n){var c=r.slice(o-1,o+1);ut.test(c)?e.appendChild(yt("wbr")):!m&&/\w\w/.test(c)&&e.appendChild(document.createTextNode("\u200d"))}}e.appendChild(l),u(l,E?r.slice(o,o+1):r.slice(o),i),E&&u(e,r.slice(o+1),i),t--,f+=s}else f+=s,u(e,r,i),f==t&&f==d?(Et(l,I),e.appendChild(l)):f>t+10&&/\s/.test(r)&&(a=function(){})}}var c=this.styles,h=this.text,p=this.markedSpans,d=h.length;if(!h&&t==null)a(o," ");else if(!p||!p.length)for(var y=0,b=0;b<d;y+=2){var w=c[y],S=c[y+1],x=w.length;b+x>d&&(w=w.slice(0,d-b)),b+=x,a(o,w,g(S))}else{p.sort(function(e,t){return e.from-t.from});var T=0,y=0,N="",S,C=0,k=p[0].from||0,L=[],A=0,O=function(){var e;while(A<p.length&&((e=p[A]).from==T||e.from==null))e.marker.type=="range"&&L.push(e),++A;k=A<p.length?p[A].from:Infinity;for(var t=0;t<L.length;++t){var n=L[t].to;n==null&&(n=Infinity),n==T?L.splice(t--,1):k=Math.min(n,k)}},M=0;while(T<d){k==T&&O();var _=Math.min(d,k);for(;;){if(N){var D=T+N.length,P=S;for(var H=0;H<L.length;++H){var B=L[H];P=(P?P+" ":"")+B.marker.style,B.marker.endStyle&&B.to===Math.min(D,_)&&(P+=" "+B.marker.endStyle),B.marker.startStyle&&B.from===T&&(P+=" "+B.marker.startStyle)}a(o,D>_?N.slice(0,_-T):N,P);if(D>=_){N=N.slice(_-T),T=_;break}T=D}N=c[y++],S=g(c[y++])}}}return o},cleanUp:function(){this.parent=null,j(this)}},R.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}},U.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 R(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 R(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 U(t);if(!e.parent){var r=new U(e.children);r.parent=e,e.children=[r,n],e=r}else{e.size-=n.size,e.height-=n.height;var i=xt(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}}},$.prototype={addChange:function(e,t,n){this.undone.length=0;var r=+(new Date),i=pt(this.done),s=i&&pt(i),o=r-this.time;if(i&&!this.closed&&this.compound)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=Y,e.e_preventDefault=Q,e.e_stopPropagation=G,e.connect=nt,rt.prototype={set:function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)}};var it=e.Pass={toString:function(){return"CodeMirror.Pass"}},st=function(){if(g)return!1;var e=yt("div");return"draggable"in e||"dragDrop"in e}(),ot=function(){var e=yt("textarea");return e.value="foo\nbar",e.value.indexOf("\r")>-1?"\r\n":"\n"}(),ut=/^$/;d?ut=/$'/:S?ut=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:w&&(ut=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/);var ct=[""],Nt="\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=Nt;var Ct=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 kt={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=kt,function(){for(var e=0;e<10;e++)kt[e+48]=String(e);for(var e=65;e<=90;e++)kt[e]=String.fromCharCode(e);for(var e=1;e<=12;e++)kt[e+111]=kt[e+63235]="F"+e}(),e.version="2.35",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==p)return CodeMirror.Pass;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("coffeescript",function(e){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function y(e,n){if(e.sol()){var c=n.scopes[0].offset;if(e.eatSpace()){var h=e.indentation();return h>c?"indent":h<c?"dedent":null}c>0&&S(e,n)}if(e.eatSpace())return null;var m=e.peek();if(e.match("####"))return e.skipToEnd(),"comment";if(e.match("###"))return n.tokenize=w,n.tokenize(e,n);if(m==="#")return e.skipToEnd(),"comment";if(e.match(/^-?[0-9\.]/,!1)){var y=!1;e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(y=!0),e.match(/^-?\d+\.\d*/)&&(y=!0),e.match(/^-?\.\d+/)&&(y=!0);if(y)return e.peek()=="."&&e.backUp(1),"number";var E=!1;e.match(/^-?0x[0-9a-f]+/i)&&(E=!0),e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(E=!0),e.match(/^-?0(?![\dx])/i)&&(E=!0);if(E)return"number"}if(e.match(d))return n.tokenize=b(e.current(),"string"),n.tokenize(e,n);if(e.match(v)){if(e.current()!="/"||e.match(/^.*\//,!1))return n.tokenize=b(e.current(),"string-2"),n.tokenize(e,n);e.backUp(1)}return e.match(u)||e.match(o)?"punctuation":e.match(s)||e.match(r)||e.match(l)?"operator":e.match(i)?"punctuation":e.match(g)?"atom":e.match(p)?"keyword":e.match(a)?"variable":e.match(f)?"property":(e.next(),t)}function b(n,r){var i=n.length==1;return function(o,u){while(!o.eol()){o.eatWhile(/[^'"\/\\]/);if(o.eat("\\")){o.next();if(i&&o.eol())return r}else{if(o.match(n))return u.tokenize=y,r;o.eat(/['"\/]/)}}return i&&(e.mode.singleLineStringErrors?r=t:u.tokenize=y),r}}function w(e,t){while(!e.eol()){e.eatWhile(/[^#]/);if(e.match("###")){t.tokenize=y;break}e.eatWhile("#")}return"comment"}function E(t,n,r){r=r||"coffee";var i=0;if(r==="coffee"){for(var s=0;s<n.scopes.length;s++)if(n.scopes[s].type==="coffee"){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){if(t.scopes.length==1)return;if(t.scopes[0].type==="coffee"){var n=e.indentation(),r=-1;for(var i=0;i<t.scopes.length;++i)if(n===t.scopes[i].offset){r=i;break}if(r===-1)return!0;while(t.scopes[0].offset!==n)t.scopes.shift();return!1}return t.scopes.shift(),!1}function x(e,n){var r=n.tokenize(e,n),i=e.current();if(i===".")return r=n.tokenize(e,n),i=e.current(),r==="variable"?"variable":t;i==="return"&&(n.dedent+=1),((i==="->"||i==="=>")&&!n.lambda&&n.scopes[0].type=="coffee"&&e.peek()===""||r==="indent")&&E(e,n);var s="[({".indexOf(i);return s!==-1&&E(e,n,"])}".slice(s,s+1)),c.exec(i)&&E(e,n),i=="then"&&S(e,n),r==="dedent"&&S(e,n)?t:(s="])}".indexOf(i),s!==-1&&S(e,n)?t:(n.dedent>0&&e.eol()&&n.scopes[0].type=="coffee"&&(n.scopes.length>1&&n.scopes.shift(),n.dedent-=1),r))}var t="error",r=new RegExp("^[\\+\\-\\*/%&|\\^~<>!?]"),i=new RegExp("^[\\(\\)\\[\\]\\{\\},:`=;\\.]"),s=new RegExp("^((->)|(=>)|(\\+\\+)|(\\+\\=)|(\\-\\-)|(\\-\\=)|(\\*\\*)|(\\*\\=)|(\\/\\/)|(\\/\\=)|(==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//))"),o=new RegExp("^((\\.\\.)|(\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),u=new RegExp("^((\\.\\.\\.)|(//=)|(>>=)|(<<=)|(\\*\\*=))"),a=new RegExp("^[_A-Za-z$][_A-Za-z$0-9]*"),f=new RegExp("^(@|this.)[_A-Za-z$][_A-Za-z$0-9]*"),l=n(["and","or","not","is","isnt","in","instanceof","typeof"]),c=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],h=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","throw","when","until"],p=n(c.concat(h));c=n(c);var d=new RegExp("^('{3}|\"{3}|['\"])"),v=new RegExp("^(/{3}|/)"),m=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],g=n(m),T={startState:function(e){return{tokenize:y,scopes:[{offset:e||0,type:"coffee"}],lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=x(e,t);return t.lastToken={style:n,content:e.current()},e.eol()&&e.lambda&&(t.lambda=!1),n},indent:function(e,t){return e.tokenize!=y?0:e.scopes[0].offset}};return T}),CodeMirror.defineMIME("text/x-coffeescript","coffeescript"),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(/^-?[_a-z][_a-z0-9-]*/i)?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("javascript",function(e,t){function u(e,t,n){return t.tokenize=n,n(e,t)}function a(e,t){var n=!1,r;while((r=e.next())!=null){if(r==t&&!n)return!1;n=!n&&r=="\\"}return n}function c(e,t,n){return f=e,l=n,t}function h(e,t){var n=e.next();if(n=='"'||n=="'")return u(e,t,p(n));if(/[\[\]{}\(\),;\:\.]/.test(n))return c(n);if(n=="0"&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),c("number","number");if(/\d/.test(n)||n=="-"&&e.eat(/\d/))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),c("number","number");if(n=="/")return e.eat("*")?u(e,t,d):e.eat("/")?(e.skipToEnd(),c("comment","comment")):t.lastType=="operator"||t.lastType=="keyword c"||/^[\[{}\(,;:]$/.test(t.lastType)?(a(e,"/"),e.eatWhile(/[gimy]/),c("regexp","string-2")):(e.eatWhile(o),c("operator",null,e.current()));if(n=="#")return e.skipToEnd(),c("error","error");if(o.test(n))return e.eatWhile(o),c("operator",null,e.current());e.eatWhile(/[\w\$_]/);var r=e.current(),i=s.propertyIsEnumerable(r)&&s[r];return i&&t.lastType!="."?c(i.type,i.style,r):c("variable","variable",r)}function p(e){return function(t,n){return a(t,e)||(n.tokenize=h),c("string","string")}}function d(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=h;break}n=r=="*"}return c("comment","comment")}function m(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 g(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0}function y(e,t,n,i,s){var o=e.cc;b.state=e,b.stream=s,b.marked=null,b.cc=o,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);for(;;){var u=o.length?o.pop():r?O:A;if(u(n,i)){while(o.length&&o[o.length-1].lex)o.pop()();return b.marked?b.marked:n=="variable"&&g(e,i)?"variable-2":t}}}function w(){for(var e=arguments.length-1;e>=0;e--)b.cc.push(arguments[e])}function E(){return w.apply(null,arguments),!0}function S(e){var t=b.state;if(t.context){b.marked="def";for(var n=t.localVars;n;n=n.next)if(n.name==e)return;t.localVars={name:e,next:t.localVars}}}function T(){b.state.context={prev:b.state.context,vars:b.state.localVars},b.state.localVars=x}function N(){b.state.localVars=b.state.context.vars,b.state.context=b.state.context.prev}function C(e,t){var n=function(){var n=b.state;n.lexical=new m(n.indented,b.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function k(){var e=b.state;e.lexical.prev&&(e.lexical.type==")"&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function L(e){return function(n){return n==e?E():e==";"?w():E(arguments.callee)}}function A(e){return e=="var"?E(C("vardef"),q,L(";"),k):e=="keyword a"?E(C("form"),O,A,k):e=="keyword b"?E(C("form"),A,k):e=="{"?E(C("}"),j,k):e==";"?E():e=="function"?E(V):e=="for"?E(C("form"),L("("),C(")"),U,L(")"),k,A,k):e=="variable"?E(C("stat"),D):e=="switch"?E(C("form"),O,C("}","switch"),L("{"),j,k,k):e=="case"?E(O,L(":")):e=="default"?E(L(":")):e=="catch"?E(C("form"),T,L("("),$,L(")"),A,k,N):w(C("stat"),O,L(";"),k)}function O(e){return v.hasOwnProperty(e)?E(_):e=="function"?E(V):e=="keyword c"?E(M):e=="("?E(C(")"),M,L(")"),k,_):e=="operator"?E(O):e=="["?E(C("]"),B(O,"]"),k,_):e=="{"?E(C("}"),B(H,"}"),k,_):E()}function M(e){return e.match(/[;\}\)\],]/)?w():w(O)}function _(e,t){if(e=="operator"&&/\+\+|--/.test(t))return E(_);if(e=="operator"&&t=="?")return E(O,L(":"),O);if(e==";")return;if(e=="(")return E(C(")"),B(O,")"),k,_);if(e==".")return E(P,_);if(e=="[")return E(C("]"),O,L("]"),k,_)}function D(e){return e==":"?E(k,A):w(_,L(";"),k)}function P(e){if(e=="variable")return b.marked="property",E()}function H(e){e=="variable"&&(b.marked="property");if(v.hasOwnProperty(e))return E(L(":"),O)}function B(e,t){function n(r){return r==","?E(e,n):r==t?E():E(L(t))}return function(i){return i==t?E():w(e,n)}}function j(e){return e=="}"?E():w(A,j)}function F(e){return e==":"?E(I):w()}function I(e){return e=="variable"?(b.marked="variable-3",E()):w()}function q(e,t){return e=="variable"?(S(t),i?E(F,R):E(R)):w()}function R(e,t){if(t=="=")return E(O,R);if(e==",")return E(q)}function U(e){return e=="var"?E(q,L(";"),W):e==";"?E(W):e=="variable"?E(z):E(W)}function z(e,t){return t=="in"?E(O):E(_,W)}function W(e,t){return e==";"?E(X):t=="in"?E(O):E(O,L(";"),X)}function X(e){e!=")"&&E(O)}function V(e,t){if(e=="variable")return S(t),E(V);if(e=="(")return E(C(")"),T,B($,")"),k,A,N)}function $(e,t){if(e=="variable")return S(t),i?E(F):E()}var n=e.indentUnit,r=t.json,i=t.typescript,s=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),s=e("operator"),o={type:"atom",style:"atom"},u={"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":s,"typeof":s,"instanceof":s,"true":o,"false":o,"null":o,"undefined":o,NaN:o,Infinity:o};if(i){var a={type:"variable",style:"variable-3"},f={"interface":e("interface"),"class":e("class"),"extends":e("extends"),constructor:e("constructor"),"public":e("public"),"private":e("private"),"protected":e("protected"),"static":e("static"),"super":e("super"),string:a,number:a,bool:a,any:a};for(var l in f)u[l]=f[l]}return u}(),o=/[+\-*&%=<>!?|]/,f,l,v={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},b={state:null,column:null,marked:null,cc:null},x={name:"this",next:{name:"arguments"}};return k.lex=!0,{startState:function(e){return{tokenize:h,lastType:null,cc:[],lexical:new m((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 f=="comment"?n:(t.lastType=f,y(t,n,f,l,e))},indent:function(e,t){if(e.tokenize==d)return CodeMirror.Pass;if(e.tokenize!=h)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+(e.lastType=="operator"||e.lastType==","?4:0):s=="form"&&r=="{"?i.indented:s=="form"?i.indented+n:s=="stat"?i.indented+(e.lastType=="operator"||e.lastType==","?n:0):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.defineMIME("text/typescript",{name:"javascript",typescript:!0}),CodeMirror.defineMIME("application/typescript",{name:"javascript",typescript:!0}),CodeMirror.defineMode("less",function(e){function r(e,t){return n=t,e}function s(e){for(var t=0;t<i.length;t++)if(e===i[t])return!0}function u(e,t){var i=e.next();if(i=="@")return e.eatWhile(/[\w\-]/),r("meta",e.current());if(i=="/"&&e.eat("*"))return t.tokenize=f,f(e,t);if(i=="<"&&e.eat("!"))return t.tokenize=l,l(e,t);if(i=="=")r(null,"compare");else{if(i=="|"&&e.eat("="))return r(null,"compare");if(i=='"'||i=="'")return t.tokenize=c(i),t.tokenize(e,t);if(i=="/"){if(e.eat("/"))return t.tokenize=a,a(e,t);if(n=="string"||n=="(")return r("string","string");if(t.stack[t.stack.length-1]!=undefined)return r(null,i);e.eatWhile(/[\a-zA-Z0-9\-_.\s]/);if(/\/|\)|#/.test(e.peek()||e.eatSpace()&&e.peek()==")")||e.eol())return r("string","string")}else{if(i=="!")return e.match(/^\s*\w*/),r("keyword","important");if(/\d/.test(i))return e.eatWhile(/[\w.%]/),r("number","unit");if(/[,+<>*\/]/.test(i))return e.peek()=="="||n=="a"?r("string","string"):r(null,"select-op");if(!/[;{}:\[\]()~\|]/.test(i)){if(i==".")return n=="("||n=="string"?r("string","string"):(e.eatWhile(/[\a-zA-Z0-9\-_]/),e.peek()==" "&&e.eatSpace(),e.peek()==")"?r("number","unit"):r("tag","tag"));if(i=="#")return e.eatWhile(/[A-Za-z0-9]/),e.current().length==4||e.current().length==7?e.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,false)!=null?e.current().substring(1)!=e.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,false)?r("atom","tag"):(e.eatSpace(),/[\/<>.(){!$%^&*_\-\\?=+\|#'~`]/.test(e.peek())?r("atom","tag"):e.peek()=="}"?r("number","unit"):/[a-zA-Z\\]/.test(e.peek())?r("atom","tag"):e.eol()?r("atom","tag"):r("number","unit")):(e.eatWhile(/[\w\\\-]/),r("atom","tag")):(e.eatWhile(/[\w\\\-]/),r("atom","tag"));if(i=="&")return e.eatWhile(/[\w\-]/),r(null,i);e.eatWhile(/[\w\\\-_%.{]/);if(n=="string")return r("string","string");if(e.current().match(/(^http$|^https$)/)!=null)return e.eatWhile(/[\w\\\-_%.{:\/]/),r("string","string");if(e.peek()=="<"||e.peek()==">")return r("tag","tag");if(/\(/.test(e.peek()))return r(null,i);if(e.peek()=="/"&&t.stack[t.stack.length-1]!=undefined)return r("string","string");if(e.current().match(/\-\d|\-.\d/))return r("number","unit");if(s(e.current().toLowerCase()))return r("tag","tag");if(/\/|[\s\)]/.test(e.peek()||e.eol()||e.eatSpace()&&e.peek()=="/")&&e.current().indexOf(".")!==-1)return e.current().substring(e.current().length-1,e.current().length)=="{"?(e.backUp(1),r("tag","tag")):(e.eatSpace(),/[{<>.a-zA-Z\/]/.test(e.peek())||e.eol()?r("tag","tag"):r("string","string"));if(e.eol()||e.peek()=="["||e.peek()=="#"||n=="tag")return e.current().substring(e.current().length-1,e.current().length)=="{"&&e.backUp(1),r("tag","tag");if(n=="compare"||n=="a"||n=="(")return r("string","string");if(n=="|"||e.current()=="-"||n=="[")return r(null,i);if(e.peek()==":"){e.next();var u=e.peek()==":"?!0:!1;if(!u){var h=e.pos,p=e.current().length;e.eatWhile(/[a-z\\\-]/);var d=e.pos;if(e.current().substring(p-1).match(o)!=null)return e.backUp(d-(h-1)),r("tag","tag");e.backUp(d-(h-1))}else e.backUp(1);return u?r("tag","tag"):r("variable","variable")}return r("variable","variable")}if(i==":")return e.eatWhile(/[a-z\\\-]/),o.test(e.current())?r("tag","tag"):e.peek()==":"?(e.next(),e.eatWhile(/[a-z\\\-]/),e.current().match(/\:\:\-(o|ms|moz|webkit)\-/)?r("string","string"):o.test(e.current().substring(1))?r("tag","tag"):r(null,i)):r(null,i);if(i!="~")return r(null,i);if(n=="r")return r("string","string")}}}function a(e,t){return e.skipToEnd(),t.tokenize=u,r("comment","comment")}function f(e,t){var n=!1,i;while((i=e.next())!=null){if(n&&i=="/"){t.tokenize=u;break}n=i=="*"}return r("comment","comment")}function l(e,t){var n=0,i;while((i=e.next())!=null){if(n>=2&&i==">"){t.tokenize=u;break}n=i=="-"?n+1:0}return r("comment","comment")}function c(e){return function(t,n){var i=!1,s;while((s=t.next())!=null){if(s==e&&!i)break;i=!i&&s=="\\"}return i||(n.tokenize=u),r("string","string")}}var t=e.indentUnit,n,i="a abbr acronym address applet area article aside audio b base basefont bdi bdo big blockquote body br button canvas caption cite code col colgroup command datalist dd del details dfn dir div dl dt em embed fieldset figcaption figure font footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins keygen kbd label legend li link map mark menu meta meter nav noframes noscript object ol optgroup option output p param pre progress q rp rt ruby s samp script section select small source span strike strong style sub summary sup table tbody td textarea tfoot th thead time title tr track tt u ul var video wbr".split(" "),o=/(^\:root$|^\:nth\-child$|^\:nth\-last\-child$|^\:nth\-of\-type$|^\:nth\-last\-of\-type$|^\:first\-child$|^\:last\-child$|^\:first\-of\-type$|^\:last\-of\-type$|^\:only\-child$|^\:only\-of\-type$|^\:empty$|^\:link|^\:visited$|^\:active$|^\:hover$|^\:focus$|^\:target$|^\:lang$|^\:enabled^\:disabled$|^\:checked$|^\:first\-line$|^\:first\-letter$|^\:before$|^\:after$|^\:not$|^\:required$|^\:invalid$)/;return{startState:function(e){return{tokenize:u,baseIndent:e||0,stack:[]}},token:function(e,t){if(e.eatSpace())return null;var r=t.tokenize(e,t),i=t.stack[t.stack.length-1];if(n=="hash"&&i=="rule")r="atom";else if(r=="variable")if(i=="rule")r=null;else if(!i||i=="@media{")r=e.current()=="when"?"variable":/[\s,|\s\)|\s]/.test(e.peek())?"tag":n;return i=="rule"&&/^[\{\};]$/.test(n)&&t.stack.pop(),n=="{"?i=="@media"?t.stack[t.stack.length-1]="@media{":t.stack.push("{"):n=="}"?t.stack.pop():n=="@media"?t.stack.push("@media"):i=="{"&&n!="comment"&&t.stack.push("rule"),r},indent:function(e,n){var r=e.stack.length;return/^\}/.test(n)&&(r-=e.stack[e.stack.length-1]=="rule"?2:1),e.baseIndent+r*t},electricChars:"}"}}),CodeMirror.defineMIME("text/x-less","less"),CodeMirror.mimeModes.hasOwnProperty("text/css")||CodeMirror.defineMIME("text/css","less"),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.curMode==o;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="?>","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):/^style$/i.test(t.curState.context.tagName)&&(t.curMode=s,t.curState=s.startState(r.indent(t.curState,"")),t.curClose=/^<\/\s*style\s*>/i)),a}return(!n||t.php.tokenize==null)&&e.match(t.curClose,n)?(t.curMode=r,t.curState=t.html,t.curClose=null,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:"/{}:",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},"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("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("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}),CodeMirror.tagRangeFinder=function(e,t,n){var r="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i=r+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",s=new RegExp("^["+r+"]["+i+"]*"),o=e.getLine(t),u=!1,a=null,f=0;while(!u){f=o.indexOf("<",f);if(-1==f)return;if(f+1<o.length&&o[f+1]=="/"){f++;continue}if(!o.substr(f+1).match(s)){f++;continue}var l=o.indexOf(">",f+1);if(-1==l){var c=t+1,h=!1,p=e.lineCount();while(c<p&&!h){var d=e.getLine(c),v=d.indexOf(">");if(-1!=v){h=!0;var m=d.lastIndexOf("/",v);if(-1!=m&&m<v){var g=o.substr(m,v-m+1);if(!g.match(/\/\s*\>/))return n===!0&&c++,c}}c++}u=!0}else{var y=o.lastIndexOf("/",l);if(-1==y)u=!0;else{var g=o.substr(y,l-y+1);g.match(/\/\s*\>/)||(u=!0)}}if(u){var b=o.substr(f+1);a=b.match(s),a?(a=a[0],-1!=o.indexOf("</"+a+">",f)&&(u=!1)):u=!1}u||f++}if(u){var w="(\\<\\/"+a+"\\>)|(\\<"+a+"\\>)|(\\<"+a+"\\s)|(\\<"+a+"$)",E=new RegExp(w,"g"),S="</"+a+">",x=1,c=t+1,p=e.lineCount();while(c<p){o=e.getLine(c);var T=o.match(E);if(T)for(var N=0;N<T.length;N++){T[N]==S?x--:x++;if(!x)return n===!0&&c++,c}c++}return}},CodeMirror.braceRangeFinder=function(e,t,n){var r=e.getLine(t),i=r.length,s,o;for(;;){var u=r.lastIndexOf("{",i);if(u<0)break;o=e.getTokenAt({line:t,ch:u}).className;if(!/^(comment|string)/.test(o)){s=u;break}i=u-1}if(s==null||r.lastIndexOf("}")>s)return;var a=1,f=e.lineCount(),l;e:for(var c=t+1;c<f;++c){var h=e.getLine(c),p=0;for(;;){var d=h.indexOf("{",p),v=h.indexOf("}",p);d<0&&(d=h.length),v<0&&(v=h.length),p=Math.min(d,v);if(p==h.length)break;if(e.getTokenAt({line:c,ch:p+1}).className==o)if(p==d)++a;else if(!--a){l=c;break e}++p}}if(l==null||l==t+1)return;return n===!0&&l++,l},CodeMirror.indentRangeFinder=function(e,t){var n=e.getOption("tabSize"),r=e.getLineHandle(t).indentation(n),i;for(var s=t+1,o=e.lineCount();s<o;++s){var u=e.getLineHandle(s);if(!/^\s*$/.test(u.text)){if(u.indentation(n)<=r)break;i=s}}return i?i+1:null},CodeMirror.newFoldFunction=function(e,t,n){function i(e,t){for(var n=0;n<r.length;++n){var i=e.lineInfo(r[n].start);if(!i)r.splice(n--,1);else if(i.line==t)return{pos:n,region:r[n]}}}function s(e,t){e.clearMarker(t.start);for(var n=0;n<t.hidden.length;++n)e.showLine(t.hidden[n])}var r=[];return t==null&&(t='<div style="position: absolute; left: 2px; color:#600">▼</div>%N%'),function(o,u){o.operation(function(){var a=i(o,u);if(a)r.splice(a.pos,1),s(o,a.region);else{var f=e(o,u,n);if(f==null)return;var l=[];for(var c=u+1;c<f;++c){var h=o.hideLine(c);h&&l.push(h)}var p=o.setMarker(u,t),d={start:p,hidden:l};o.onDeleteLine(p,function(){s(o,d)}),r.push(d)}})}},function(){function e(e,t,n,r){this.atOccurrence=!1,this.cm=e,r==null&&typeof t=="string"&&(r=!1),n=n?e.clipPos(n):{line:0,ch:0},this.pos={from:n,to:n};if(typeof t!="string")t.global||(t=new RegExp(t.source,t.ignoreCase?"ig":"g")),this.matches=function(n,r){if(n){t.lastIndex=0;var i=e.getLine(r.line).slice(0,r.ch),s=t.exec(i),o=0;while(s){o+=s.index+1,i=i.slice(o),t.lastIndex=0;var u=t.exec(i);if(!u)break;s=u}o--}else{t.lastIndex=r.ch;var i=e.getLine(r.line),s=t.exec(i),o=s&&s.index}if(s)return{from:{line:r.line,ch:o},to:{line:r.line,ch:o+s[0].length},match:s}};else{r&&(t=t.toLowerCase());var i=r?function(e){return e.toLowerCase()}:function(e){return e},s=t.split("\n");s.length==1?this.matches=function(n,r){var s=i(e.getLine(r.line)),o=t.length,u;if(n?r.ch>=o&&(u=s.lastIndexOf(t,r.ch-o))!=-1:(u=s.indexOf(t,r.ch))!=-1)return{from:{line:r.line,ch:u},to:{line:r.line,ch:u+o}}}:this.matches=function(t,n){var r=n.line,o=t?s.length-1:0,u=s[o],a=i(e.getLine(r)),f=t?a.indexOf(u)+u.length:a.lastIndexOf(u);if(t?f>=n.ch||f!=u.length:f<=n.ch||f!=a.length-u.length)return;for(;;){if(t?!r:r==e.lineCount()-1)return;a=i(e.getLine(r+=t?-1:1)),u=s[t?--o:++o];if(o>0&&o<s.length-1){if(a!=u)return;continue}var l=t?a.lastIndexOf(u):a.indexOf(u)+u.length;if(t?l!=a.length-u.length:l!=u.length)return;var c={line:n.line,ch:f},h={line:r,ch:l};return{from:t?h:c,to:t?c:h}}}}}e.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function r(e){var n={line:e,ch:0};return t.pos={from:n,to:n},t.atOccurrence=!1,!1}var t=this,n=this.cm.clipPos(e?this.pos.from:this.pos.to);for(;;){if(this.pos=this.matches(e,n))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!n.line)return r(0);n={line:n.line-1,ch:this.cm.getLine(n.line-1).length}}else{var i=this.cm.lineCount();if(n.line==i-1)return r(i);n={line:n.line+1,ch:0}}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(e){var t=this;this.atOccurrence&&(t.pos.to=this.cm.replaceRange(e,t.pos.from,t.pos.to))}},CodeMirror.defineExtension("getSearchCursor",function(t,n,r){return new e(this,t,n,r)})}(),function(){function t(){this.marked=[]}function n(e){return e._matchHighlightState||(e._matchHighlightState=new t)}function r(e){var t=n(e);for(var r=0;r<t.marked.length;++r)t.marked[r].clear();t.marked=[]}function i(t,i,s){r(t),s=typeof s!="undefined"?s:e;if(t.somethingSelected()&&t.getSelection().replace(/^\s+|\s+$/g,"").length>=s){var o=n(t),u=t.getSelection();t.operation(function(){if(t.lineCount()<2e3)for(var e=t.getSearchCursor(u);e.findNext();)(e.from().line!==t.getCursor(!0).line||e.from().ch!==t.getCursor(!0).ch)&&o.marked.push(t.markText(e.from(),e.to(),i))})}}var e=2;CodeMirror.defineExtension("matchHighlight",function(e,t){i(this,e,t)})}() |