import{_ as id}from"./app-843bbcab.js";import{ae as sd,af as od,ag as G1,b as Oc,ah as K1,z as So,c as Gr,m as $r,r as zn,o as Dc,w as Ya,E as ad,X as qt,Y as pn,a9 as Rc,ab as ld,Z as Ft,a0 as Wr,ac as gl,a6 as Hi,a4 as Is,F as ko,I as X1,a2 as Ja,ai as ud,aj as cd,ak as fd,al as hd,am as pd,an as dd,ao as md,h as As,ap as V1,aq as Mc,a7 as Y1,u as Mt,a3 as Mo,a8 as qi,T as gd,a5 as Fc,aa as vd,ar as J1,as as kd,at as yd}from"./framework-caa722f8.js";const bd=["onMousedown"],wd=Gr({__name:"SplitPane",props:{layout:null},setup(n){const o=n,l=As(()=>o.layout==="vertical"),c=zn(),p=$r("store"),g=zn(p.initialShowOutput),_=Oc({dragging:!1,split:50}),S=As(()=>{const{split:T}=_;return T<20?20:T>80?80:T});let w=0,C=0;function y(T){_.dragging=!0,w=l.value?T.pageY:T.pageX,C=S.value}function E(T){if(_.dragging){const F=l.value?T.pageY:T.pageX,R=l.value?c.value.offsetHeight:c.value.offsetWidth,W=F-w;_.split=C+~~(W/R*100)}}function L(){_.dragging=!1}return(T,F)=>(qt(),pn("div",{ref_key:"container",ref:c,class:qi(["split-pane",{dragging:_.dragging,"show-output":g.value,vertical:Mt(l)}]),onMousemove:E,onMouseup:L,onMouseleave:L},[Ft("div",{class:"left",style:Y1({[Mt(l)?"height":"width"]:Mt(S)+"%"})},[V1(T.$slots,"left",{},void 0,!0),Ft("div",{class:"dragger",onMousedown:Mc(y,["prevent"])},null,40,bd)],4),Ft("div",{class:"right",style:Y1({[Mt(l)?"height":"width"]:100-Mt(S)+"%"})},[V1(T.$slots,"right",{},void 0,!0)],4),Ft("button",{class:"toggler",onClick:F[0]||(F[0]=R=>g.value=!g.value)},Mo(g.value?"< Code":"Output >"),1)],34))}}),pi=(n,o)=>{const l=n.__vccOpts||n;for(const[c,p]of o)l[c]=p;return l},xd=pi(wd,[["__scopeId","data-v-3102671e"]]),Bc=n=>(kd("data-v-cbb0a4e5"),n=n(),yd(),n),_d=["onClick"],Sd={class:"label"},Td=["onClick"],Cd=Bc(()=>Ft("svg",{class:"icon",width:"12",height:"12",viewBox:"0 0 24 24"},[Ft("line",{stroke:"#999",x1:"18",y1:"6",x2:"6",y2:"18"}),Ft("line",{stroke:"#999",x1:"6",y1:"6",x2:"18",y2:"18"})],-1)),Id=[Cd],Ad={key:0,class:"file pending"},Ld=["onKeyup"],Ed={key:1,class:"import-map-wrapper"},Nd=Bc(()=>Ft("span",{class:"label"},"Import Map",-1)),Pd=[Nd],Od=Gr({__name:"FileSelector",setup(n){const o=$r("store"),l=zn(!1),c=zn("Comp.vue"),p="import-map.json",g=$r("import-map"),_=As(()=>Object.entries(o.state.files).filter(([T,F])=>T!==p&&!F.hidden).map(([T])=>T));function S(){let T=0,F="Comp.vue";for(;;){let R=!1;for(const W in o.state.files)if(W===F){R=!0,F=`Comp${++T}.vue`;break}if(!R)break}c.value=F,l.value=!0}function w(){l.value=!1}function C({el:T}){T.focus()}function y(){if(!l.value)return;const T=c.value;if(!/\.(vue|js|ts|css)$/.test(T)){o.state.errors=["Playground only supports *.vue, *.js, *.ts, *.css files."];return}if(T in o.state.files){o.state.errors=[`File "${T}" already exists.`];return}o.state.errors=[],w(),o.addFile(T)}const E=zn(null);function L(T){T.preventDefault();const F=E.value,W=30*((Math.abs(T.deltaX)>=Math.abs(T.deltaY)?T.deltaX:T.deltaY)>0?1:-1);F.scrollTo({left:F.scrollLeft+W})}return(T,F)=>(qt(),pn("div",{class:qi(["file-selector",{"has-import-map":Mt(g)}]),onWheel:L,ref_key:"fileSel",ref:E},[(qt(!0),pn(Is,null,Fc(Mt(_),(R,W)=>(qt(),pn("div",{class:qi(["file",{active:Mt(o).state.activeFile.filename===R}]),onClick:D=>Mt(o).setActive(R)},[Ft("span",Sd,Mo(R===p?"Import Map":R),1),W>0?(qt(),pn("span",{key:0,class:"remove",onClick:Mc(D=>Mt(o).deleteFile(R),["stop"])},Id,8,Td)):Hi("",!0)],10,_d))),256)),l.value?(qt(),pn("div",Ad,[Rc(Ft("input",{"onUpdate:modelValue":F[0]||(F[0]=R=>c.value=R),spellcheck:"false",onBlur:y,onKeyup:[J1(y,["enter"]),J1(w,["esc"])],onVnodeMounted:C},null,40,Ld),[[vd,c.value]])])):Hi("",!0),Ft("button",{class:"add",onClick:S},"+"),Mt(g)?(qt(),pn("div",Ed,[Ft("div",{class:qi(["file import-map",{active:Mt(o).state.activeFile.filename===p}]),onClick:F[1]||(F[1]=R=>Mt(o).setActive(p))},Pd,2)])):Hi("",!0)],34))}}),Dd=pi(Od,[["__scopeId","data-v-cbb0a4e5"]]);var zt=Uint8Array,yn=Uint16Array,Fo=Uint32Array,Bo=new zt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),jo=new zt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Za=new zt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),jc=function(n,o){for(var l=new yn(31),c=0;c<31;++c)l[c]=o+=1<>>1|(vt&21845)<<1;Br=(Br&52428)>>>2|(Br&13107)<<2,Br=(Br&61680)>>>4|(Br&3855)<<4,el[vt]=((Br&65280)>>>8|(Br&255)<<8)>>>1}var rr=function(n,o,l){for(var c=n.length,p=0,g=new yn(o);p>>w]=C}else for(S=new yn(c),p=0;p>>15-n[p]);return S},Ur=new zt(288);for(var vt=0;vt<144;++vt)Ur[vt]=8;for(var vt=144;vt<256;++vt)Ur[vt]=9;for(var vt=256;vt<280;++vt)Ur[vt]=7;for(var vt=280;vt<288;++vt)Ur[vt]=8;var Ls=new zt(32);for(var vt=0;vt<32;++vt)Ls[vt]=5;var Md=rr(Ur,9,0),Fd=rr(Ur,9,1),Bd=rr(Ls,5,0),jd=rr(Ls,5,1),Ha=function(n){for(var o=n[0],l=1;lo&&(o=n[l]);return o},Wn=function(n,o,l){var c=o/8|0;return(n[c]|n[c+1]<<8)>>(o&7)&l},qa=function(n,o){var l=o/8|0;return(n[l]|n[l+1]<<8|n[l+2]<<16)>>(o&7)},vl=function(n){return(n+7)/8|0},Wo=function(n,o,l){(o==null||o<0)&&(o=0),(l==null||l>n.length)&&(l=n.length);var c=new(n.BYTES_PER_ELEMENT==2?yn:n.BYTES_PER_ELEMENT==4?Fo:zt)(l-o);return c.set(n.subarray(o,l)),c},Wd=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Hn=function(n,o,l){var c=new Error(o||Wd[n]);if(c.code=n,Error.captureStackTrace&&Error.captureStackTrace(c,Hn),!l)throw c;return c},Hd=function(n,o,l){var c=n.length;if(!c||l&&l.f&&!l.l)return o||new zt(0);var p=!o||l,g=!l||l.i;l||(l={}),o||(o=new zt(c*3));var _=function(z){var V=o.length;if(z>V){var ee=new zt(Math.max(V*2,z));ee.set(o),o=ee}},S=l.f||0,w=l.p||0,C=l.b||0,y=l.l,E=l.d,L=l.m,T=l.n,F=c*8;do{if(!y){S=Wn(n,w,1);var R=Wn(n,w+1,3);if(w+=3,R)if(R==1)y=Fd,E=jd,L=9,T=5;else if(R==2){var M=Wn(n,w,31)+257,B=Wn(n,w+10,15)+4,U=M+Wn(n,w+5,31)+1;w+=14;for(var ae=new zt(U),ue=new zt(19),te=0;te>>4;if(W<16)ae[te++]=W;else{var G=0,K=0;for(W==16?(K=3+Wn(n,w,3),w+=2,G=ae[te-1]):W==17?(K=3+Wn(n,w,7),w+=3):W==18&&(K=11+Wn(n,w,127),w+=7);K--;)ae[te++]=G}}var b=ae.subarray(0,M),oe=ae.subarray(M);L=Ha(b),T=Ha(oe),y=rr(b,L,1),E=rr(oe,T,1)}else Hn(1);else{var W=vl(w)+4,D=n[W-4]|n[W-3]<<8,I=W+D;if(I>c){g&&Hn(0);break}p&&_(C+D),o.set(n.subarray(W,I),C),l.b=C+=D,l.p=w=I*8,l.f=S;continue}if(w>F){g&&Hn(0);break}}p&&_(C+131072);for(var Z=(1<>>4;if(w+=G&15,w>F){g&&Hn(0);break}if(G||Hn(2),Ae<256)o[C++]=Ae;else if(Ae==256){Pe=w,y=null;break}else{var Fe=Ae-254;if(Ae>264){var te=Ae-257,Ze=Bo[te];Fe=Wn(n,w,(1<>>4;He||Hn(3),w+=He&15;var oe=Rd[qe];if(qe>3){var Ze=jo[qe];oe+=qa(n,w)&(1<F){g&&Hn(0);break}p&&_(C+131072);for(var X=C+Fe;C>>8},ws=function(n,o,l){l<<=o&7;var c=o/8|0;n[c]|=l,n[c+1]|=l>>>8,n[c+2]|=l>>>16},za=function(n,o){for(var l=[],c=0;cL&&(L=g[c].s);var T=new yn(L+1),F=tl(l[y-1],T,0);if(F>o){var c=0,R=0,W=F-o,D=1<o)R+=D-(1<>>=W;R>0;){var M=g[c].s;T[M]=0&&R;--c){var B=g[c].s;T[B]==o&&(--T[B],++R)}F=o}return[new zt(T),F]},tl=function(n,o,l){return n.s==-1?Math.max(tl(n.l,o,l+1),tl(n.r,o,l+1)):o[n.s]=l},Q1=function(n){for(var o=n.length;o&&!n[--o];);for(var l=new yn(++o),c=0,p=n[0],g=1,_=function(w){l[c++]=w},S=1;S<=o;++S)if(n[S]==p&&S!=o)++g;else{if(!p&&g>2){for(;g>138;g-=138)_(32754);g>2&&(_(g>10?g-11<<5|28690:g-3<<5|12305),g=0)}else if(g>3){for(_(p),--g;g>6;g-=6)_(8304);g>2&&(_(g-3<<5|8208),g=0)}for(;g--;)_(p);g=1,p=n[S]}return[l.subarray(0,c),o]},xs=function(n,o){for(var l=0,c=0;c>>8,n[p+2]=n[p]^255,n[p+3]=n[p+1]^255;for(var g=0;g4&&!ge[Za[Te-1]];--Te);var G=C+5<<3,K=xs(p,Ur)+xs(g,Ls)+_,b=xs(p,L)+xs(g,R)+_+14+3*Te+xs(ue,ge)+(2*ue[16]+3*ue[17]+7*ue[18]);if(G<=K&&G<=b)return nl(o,y,n.subarray(w,w+C));var oe,Z,le,Pe;if(wr(o,y,1+(b15&&(wr(o,y,He[te]>>>5&127),y+=He[te]>>>12)}}else oe=Md,Z=Ur,le=Bd,Pe=Ls;for(var te=0;te255){var qe=c[te]>>>18&31;ws(o,y,oe[qe+257]),y+=Z[qe+257],qe>7&&(wr(o,y,c[te]>>>23&31),y+=Bo[qe]);var X=c[te]&31;ws(o,y,le[X]),y+=Pe[X],X>3&&(ws(o,y,c[te]>>>5&8191),y+=jo[X])}else ws(o,y,oe[c[te]]),y+=Z[c[te]];return ws(o,y,oe[256]),y+Z[256]},qd=new Fo([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),kl=new zt(0),zd=function(n,o,l,c,p,g){var _=n.length,S=new zt(c+_+5*(1+Math.ceil(_/7e3))+p),w=S.subarray(c,S.length-p),C=0;if(!o||_<8)for(var y=0;y<=_;y+=65535){var E=y+65535;E>=_&&(w[C>>3]=g),C=nl(w,C+1,n.subarray(y,E))}else{for(var L=qd[o-1],T=L>>>13,F=L&8191,R=(1<7e3||ge>24576)&&oe>423){C=ec(n,w,0,U,ae,ue,ye,ge,Te,y-Te,C),ge=te=ye=0,Te=y;for(var Z=0;Z<286;++Z)ae[Z]=0;for(var Z=0;Z<30;++Z)ue[Z]=0}var le=2,Pe=0,Ae=F,Fe=K-b&32767;if(oe>2&&G==B(y-Fe))for(var Ze=Math.min(T,oe)-1,He=Math.min(32767,y),qe=Math.min(258,oe);Fe<=He&&--Ae&&K!=b;){if(n[y+le]==n[y+le-Fe]){for(var X=0;Xle){if(le=X,Pe=Fe,X>Ze)break;for(var z=Math.min(Fe,X-2),V=0,Z=0;ZV&&(V=ve,b=ee)}}}K=b,b=W[K],Fe+=K-b+32768&32767}if(Pe){U[ge++]=268435456|Qa[le]<<18|Z1[Pe];var de=Qa[le]&31,Me=Z1[Pe]&31;ye+=Bo[de]+jo[Me],++ae[257+de],++ue[Me],ke=y+le,++te}else U[ge++]=n[y],++ae[n[y]]}}C=ec(n,w,g,U,ae,ue,ye,ge,Te,y-Te,C),!g&&C&7&&(C=nl(w,C+1,kl))}return Wo(S,0,c+vl(C)+p)},$d=function(){var n=1,o=0;return{p:function(l){for(var c=n,p=o,g=l.length|0,_=0;_!=g;){for(var S=Math.min(_+2655,g);_>16),p=(p&65535)+15*(p>>16)}n=c,o=p},d:function(){return n%=65521,o%=65521,(n&255)<<24|n>>>8<<16|(o&255)<<8|o>>>8}}},Ud=function(n,o,l,c,p){return zd(n,o.level==null?6:o.level,o.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):12+o.mem,l,c,!p)},Gd=function(n,o,l){for(;l;++o)n[o]=l,l>>>=8},Kd=function(n,o){var l=o.level,c=l==0?0:l<6?1:l==9?3:2;n[0]=120,n[1]=c<<6|(c?32-2*c:1)},Xd=function(n){((n[0]&15)!=8||n[0]>>>4>7||(n[0]<<8|n[1])%31)&&Hn(6,"invalid zlib data"),n[1]&32&&Hn(6,"invalid zlib data: preset dictionaries not supported")};function Vd(n,o){o||(o={});var l=$d();l.p(n);var c=Ud(n,o,2,4);return Kd(c,o),Gd(c,c.length-4,l.d()),c}function Yd(n,o){return Hd((Xd(n),n.subarray(2,-4)),o)}var tc=typeof TextEncoder<"u"&&new TextEncoder,rl=typeof TextDecoder<"u"&&new TextDecoder,Jd=0;try{rl.decode(kl,{stream:!0}),Jd=1}catch{}var Zd=function(n){for(var o="",l=0;;){var c=n[l++],p=(c>127)+(c>223)+(c>239);if(l+p>n.length)return[o,Wo(n,l-1)];p?p==3?(c=((c&15)<<18|(n[l++]&63)<<12|(n[l++]&63)<<6|n[l++]&63)-65536,o+=String.fromCharCode(55296|c>>10,56320|c&1023)):p&1?o+=String.fromCharCode((c&31)<<6|n[l++]&63):o+=String.fromCharCode((c&15)<<12|(n[l++]&63)<<6|n[l++]&63):o+=String.fromCharCode(c)}};function zc(n,o){if(o){for(var l=new zt(n.length),c=0;c>1)),_=0,S=function(y){g[_++]=y},c=0;cg.length){var w=new zt(_+8+(p-c<<1));w.set(g),g=w}var C=n.charCodeAt(c);C<128||o?S(C):C<2048?(S(192|C>>6),S(128|C&63)):C>55295&&C<57344?(C=65536+(C&1023<<10)|n.charCodeAt(++c)&1023,S(240|C>>18),S(128|C>>12&63),S(128|C>>6&63),S(128|C&63)):(S(224|C>>12),S(128|C>>6&63),S(128|C&63))}return Wo(g,0,_)}function $c(n,o){if(o){for(var l="",c=0;c{l&&clearTimeout(l),l=setTimeout(()=>{n(...c)},o)}}function Qd(n){const o=zc(n),l=Vd(o,{level:9}),c=$c(l,!0);return btoa(c)}function em(n){const o=atob(n);if(o.startsWith("xÚ")){const l=zc(o,!0),c=Yd(l);return $c(c)}return decodeURIComponent(escape(o))}var ui=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var To={},nm={get exports(){return To},set exports(n){To=n}},nc;function wn(){return nc||(nc=1,function(n,o){(function(l,c){n.exports=c()})(ui,function(){var l=navigator.userAgent,c=navigator.platform,p=/gecko\/\d/i.test(l),g=/MSIE \d/.test(l),_=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(l),S=/Edge\/(\d+)/.exec(l),w=g||_||S,C=w&&(g?document.documentMode||6:+(S||_)[1]),y=!S&&/WebKit\//.test(l),E=y&&/Qt\/\d+\.\d+/.test(l),L=!S&&/Chrome\//.test(l),T=/Opera\//.test(l),F=/Apple Computer/.test(navigator.vendor),R=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(l),W=/PhantomJS/.test(l),D=F&&(/Mobile\/\w+/.test(l)||navigator.maxTouchPoints>2),I=/Android/.test(l),M=D||I||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(l),B=D||/Mac/.test(c),U=/\bCrOS\b/.test(l),ae=/win/i.test(c),ue=T&&l.match(/Version\/(\d*\.\d*)/);ue&&(ue=Number(ue[1])),ue&&ue>=15&&(T=!1,y=!0);var te=B&&(E||T&&(ue==null||ue<12.11)),ye=p||w&&C>=9;function ge(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ke=function(e,t){var i=e.className,r=ge(t).exec(i);if(r){var a=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(a?r[1]+a:"")}};function Te(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function G(e,t){return Te(e).appendChild(t)}function K(e,t,i,r){var a=document.createElement(e);if(i&&(a.className=i),r&&(a.style.cssText=r),typeof t=="string")a.appendChild(document.createTextNode(t));else if(t)for(var u=0;u=t)return f+(t-u);f+=d-u,f+=i-f%i,u=d+1}}var X=function(){this.id=null,this.f=null,this.time=0,this.handler=Ze(this.onTimeout,this)};X.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},X.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i=t)return r+Math.min(f,t-a);if(a+=u-r,a+=i-a%i,r=u+1,a>=t)return r}}var et=[""];function Je(e){for(;et.length<=e;)et.push(Le(et)+" ");return et[e]}function Le(e){return e[e.length-1]}function ze(e,t){for(var i=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||rn.test(e))}function $(e,t){return t?t.source.indexOf("\\w")>-1&&nt(e)?!0:t.test(e):nt(e)}function pe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Q=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Ve(e){return e.charCodeAt(0)>=768&&Q.test(e)}function It(e,t,i){for(;(i<0?t>0:ti?-1:1;;){if(t==i)return t;var a=(t+i)/2,u=r<0?Math.ceil(a):Math.floor(a);if(u==t)return e(u)?t:i;e(u)?i=u:t=u+r}}function Xr(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var a=!1,u=0;ut||t==i&&f.to==t)&&(r(Math.max(f.from,t),Math.min(f.to,i),f.level==1?"rtl":"ltr",u),a=!0)}a||r(t,i,"ltr")}var Gt=null;function ft(e,t,i){var r;Gt=null;for(var a=0;at)return a;u.to==t&&(u.from!=u.to&&i=="before"?r=a:Gt=a),u.from==t&&(u.from!=u.to&&i!="before"?r=a:Gt=a)}return r??Gt}var Dn=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(v){return v<=247?e.charAt(v):1424<=v&&v<=1524?"R":1536<=v&&v<=1785?t.charAt(v-1536):1774<=v&&v<=2220?"r":8192<=v&&v<=8203?"w":v==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,a=/[stwN]/,u=/[LRr]/,f=/[Lb1n]/,d=/[1n]/;function m(v,A,N){this.level=v,this.from=A,this.to=N}return function(v,A){var N=A=="ltr"?"L":"R";if(v.length==0||A=="ltr"&&!r.test(v))return!1;for(var q=v.length,j=[],Y=0;Y-1&&(r[t]=a.slice(0,u).concat(a.slice(u+1)))}}}function Be(e,t){var i=Kn(e,t);if(i.length)for(var r=Array.prototype.slice.call(arguments,2),a=0;a0}function mn(e){e.prototype.on=function(t,i){Ne(this,t,i)},e.prototype.off=function(t,i){Lt(this,t,i)}}function St(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Vn(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Kt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Rn(e){St(e),Vn(e)}function Ln(e){return e.target||e.srcElement}function Sr(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),B&&e.ctrlKey&&t==1&&(t=3),t}var lr=function(){if(w&&C<9)return!1;var e=K("div");return"draggable"in e||"dragDrop"in e}(),Et;function Tr(e){if(Et==null){var t=K("span","​");G(e,K("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Et=t.offsetWidth<=1&&t.offsetHeight>2&&!(w&&C<8))}var i=Et?K("span","​"):K("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var ur;function gn(e){if(ur!=null)return ur;var t=G(e,document.createTextNode("AخA")),i=oe(t,0,1).getBoundingClientRect(),r=oe(t,1,2).getBoundingClientRect();return Te(e),!i||i.left==i.right?!1:ur=r.right-i.right<3}var cr=` b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var a=e.indexOf(` `,t);a==-1&&(a=e.length);var u=e.slice(t,e.charAt(a-1)=="\r"?a-1:a),f=u.indexOf("\r");f!=-1?(i.push(u.slice(0,f)),t+=f+1):(i.push(u),t=a+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Cr=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ir=function(){var e=K("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),fr=null;function En(e){if(fr!=null)return fr;var t=G(e,K("span","x")),i=t.getBoundingClientRect(),r=oe(t,0,1).getBoundingClientRect();return fr=Math.abs(i.left-r.left)>1}var Qt={},Xt={};function Ar(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Qt[e]=t}function _n(e,t){Xt[e]=t}function Yn(e){if(typeof e=="string"&&Xt.hasOwnProperty(e))e=Xt[e];else if(e&&typeof e.name=="string"&&Xt.hasOwnProperty(e.name)){var t=Xt[e.name];typeof t=="string"&&(t={name:t}),e=ut(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Yn("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Yn("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Jn(e,t){t=Yn(t);var i=Qt[t.name];if(!i)return Jn(e,"text/plain");var r=i(e,t);if(sn.hasOwnProperty(t.name)){var a=sn[t.name];for(var u in a)a.hasOwnProperty(u)&&(r.hasOwnProperty(u)&&(r["_"+u]=r[u]),r[u]=a[u])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var f in t.modeProps)r[f]=t.modeProps[f];return r}var sn={};function on(e,t){var i=sn.hasOwnProperty(e)?sn[e]:sn[e]={};He(t,i)}function Vt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var a=t[r];a instanceof Array&&(a=a.concat([])),i[r]=a}return i}function hr(e,t){for(var i;e.innerMode&&(i=e.innerMode(t),!(!i||i.mode==e));)t=i.state,e=i.mode;return i||{mode:e,state:t}}function pr(e,t,i){return e.startState?e.startState(t,i):!0}var mt=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};mt.prototype.eol=function(){return this.pos>=this.string.length},mt.prototype.sol=function(){return this.pos==this.lineStart},mt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},mt.prototype.next=function(){if(this.post},mt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},mt.prototype.skipToEnd=function(){this.pos=this.string.length},mt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},mt.prototype.backUp=function(e){this.pos-=e},mt.prototype.column=function(){return this.lastColumnPos0?null:(u&&t!==!1&&(this.pos+=u[0].length),u)}},mt.prototype.current=function(){return this.string.slice(this.start,this.pos)},mt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},mt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},mt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Ie(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var a=i.children[r],u=a.chunkSize();if(t=e.first&&ti?ce(i,Ie(e,i).text.length):Yt(t,Ie(e,t.line).text.length)}function Yt(e,t){var i=e.ch;return i==null||i>t?ce(e.line,t):i<0?ce(e.line,0):e}function Sn(e,t){for(var i=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},Zn.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Zn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Zn.fromSaved=function(e,t,i){return t instanceof gi?new Zn(e,Vt(e.mode,t.state),i,t.lookAhead):new Zn(e,Vt(e.mode,t),i)},Zn.prototype.save=function(e){var t=e!==!1?Vt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new gi(t,this.maxLookAhead):t};function Xl(e,t,i,r){var a=[e.state.modeGen],u={};eu(e,t.text,e.doc.mode,i,function(v,A){return a.push(v,A)},u,r);for(var f=i.state,d=function(v){i.baseTokens=a;var A=e.state.overlays[v],N=1,q=0;i.state=!0,eu(e,t.text,A.mode,i,function(j,Y){for(var se=N;qj&&a.splice(N,1,j,a[N+1],me),N+=2,q=Math.min(j,me)}if(Y)if(A.opaque)a.splice(se,N-se,j,"overlay "+Y),N=se+2;else for(;see.options.maxHighlightLength&&Vt(e.doc.mode,r.state),u=Xl(e,t,r);a&&(r.state=a),t.stateAfter=r.save(!a),t.styles=u.styles,u.classes?t.styleClasses=u.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Xi(e,t,i){var r=e.doc,a=e.display;if(!r.mode.startState)return new Zn(r,!0,t);var u=oh(e,t,i),f=u>r.first&&Ie(r,u-1).stateAfter,d=f?Zn.fromSaved(r,f,u):new Zn(r,pr(r.mode),u);return r.iter(u,t,function(m){Vo(e,m.text,d);var v=d.line;m.stateAfter=v==t-1||v%5==0||v>=a.viewFrom&&vt.start)return u}throw new Error("Mode "+e.name+" failed to advance stream.")}var Jl=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Zl(e,t,i,r){var a=e.doc,u=a.mode,f;t=Se(a,t);var d=Ie(a,t.line),m=Xi(e,t.line,i),v=new mt(d.text,e.options.tabSize,m),A;for(r&&(A=[]);(r||v.pose.options.maxHighlightLength?(d=!1,f&&Vo(e,t,r,A.pos),A.pos=t.length,N=null):N=Ql(Yo(i,A,r.state,q),u),q){var j=q[0].name;j&&(N="m-"+(N?j+" "+N:j))}if(!d||v!=N){for(;mf;--d){if(d<=u.first)return u.first;var m=Ie(u,d-1),v=m.stateAfter;if(v&&(!i||d+(v instanceof gi?v.lookAhead:0)<=u.modeFrontier))return d;var A=qe(m.text,null,e.options.tabSize);(a==null||r>A)&&(a=d-1,r=A)}return a}function ah(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontieri;r--){var a=Ie(e,r).stateAfter;if(a&&(!(a instanceof gi)||r+a.lookAhead=t:u.to>t);(r||(r=[])).push(new qs(f,u.from,m?null:u.to))}}return r}function ph(e,t,i){var r;if(e)for(var a=0;a=t:u.to>t);if(d||u.from==t&&f.type=="bookmark"&&(!i||u.marker.insertLeft)){var m=u.from==null||(f.inclusiveLeft?u.from<=t:u.from0&&d)for(var Ce=0;Ce0)){var A=[m,1],N=k(v.from,d.from),q=k(v.to,d.to);(N<0||!f.inclusiveLeft&&!N)&&A.push({from:v.from,to:d.from}),(q>0||!f.inclusiveRight&&!q)&&A.push({from:d.to,to:v.to}),a.splice.apply(a,A),m+=A.length-3}}return a}function ru(e){var t=e.markedSpans;if(t){for(var i=0;it)&&(!r||Zo(r,u.marker)<0)&&(r=u.marker)}return r}function au(e,t,i,r,a){var u=Ie(e,t),f=mr&&u.markedSpans;if(f)for(var d=0;d=0&&N<=0||A<=0&&N>=0)&&(A<=0&&(m.marker.inclusiveRight&&a.inclusiveLeft?k(v.to,i)>=0:k(v.to,i)>0)||A>=0&&(m.marker.inclusiveRight&&a.inclusiveLeft?k(v.from,r)<=0:k(v.from,r)<0)))return!0}}}function Mn(e){for(var t;t=ou(e);)e=t.find(-1,!0).line;return e}function gh(e){for(var t;t=Us(e);)e=t.find(1,!0).line;return e}function vh(e){for(var t,i;t=Us(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function Qo(e,t){var i=Ie(e,t),r=Mn(i);return i==r?t:rt(r)}function lu(e,t){if(t>e.lastLine())return t;var i=Ie(e,t),r;if(!Lr(e,i))return t;for(;r=Us(i);)i=r.find(1,!0).line;return rt(i)+1}function Lr(e,t){var i=mr&&t.markedSpans;if(i){for(var r=void 0,a=0;at.maxLineLength&&(t.maxLineLength=a,t.maxLine=r)})}var vi=function(e,t,i){this.text=e,iu(this,t),this.height=i?i(this):1};vi.prototype.lineNo=function(){return rt(this)},mn(vi);function kh(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),ru(e),iu(e,i);var a=r?r(e):1;a!=e.height&&en(e,a)}function yh(e){e.parent=null,ru(e)}var bh={},wh={};function uu(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?wh:bh;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function cu(e,t){var i=b("span",null,null,y?"padding-right: .1px":null),r={pre:b("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var a=0;a<=(t.rest?t.rest.length:0);a++){var u=a?t.rest[a-1]:t.line,f=void 0;r.pos=0,r.addToken=_h,gn(e.display.measure)&&(f=Wt(u,e.doc.direction))&&(r.addToken=Th(r.addToken,f)),r.map=[];var d=t!=e.display.externalMeasured&&rt(u);Ch(u,r,Vl(e,u,d)),u.styleClasses&&(u.styleClasses.bgClass&&(r.bgClass=Ae(u.styleClasses.bgClass,r.bgClass||"")),u.styleClasses.textClass&&(r.textClass=Ae(u.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Tr(e.display.measure))),a==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(y){var m=r.content.lastChild;(/\bcm-tab\b/.test(m.className)||m.querySelector&&m.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Be(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Ae(r.pre.className,r.textClass||"")),r}function xh(e){var t=K("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function _h(e,t,i,r,a,u,f){if(t){var d=e.splitSpaces?Sh(t,e.trailingSpace):t,m=e.cm.state.specialChars,v=!1,A;if(!m.test(t))e.col+=t.length,A=document.createTextNode(d),e.map.push(e.pos,e.pos+t.length,A),w&&C<9&&(v=!0),e.pos+=t.length;else{A=document.createDocumentFragment();for(var N=0;;){m.lastIndex=N;var q=m.exec(t),j=q?q.index-N:t.length-N;if(j){var Y=document.createTextNode(d.slice(N,N+j));w&&C<9?A.appendChild(K("span",[Y])):A.appendChild(Y),e.map.push(e.pos,e.pos+j,Y),e.col+=j,e.pos+=j}if(!q)break;N+=j+1;var se=void 0;if(q[0]==" "){var me=e.cm.options.tabSize,be=me-e.col%me;se=A.appendChild(K("span",Je(be),"cm-tab")),se.setAttribute("role","presentation"),se.setAttribute("cm-text"," "),e.col+=be}else q[0]=="\r"||q[0]==` `?(se=A.appendChild(K("span",q[0]=="\r"?"␍":"␤","cm-invalidchar")),se.setAttribute("cm-text",q[0]),e.col+=1):(se=e.cm.options.specialCharPlaceholder(q[0]),se.setAttribute("cm-text",q[0]),w&&C<9?A.appendChild(K("span",[se])):A.appendChild(se),e.col+=1);e.map.push(e.pos,e.pos+1,se),e.pos++}}if(e.trailingSpace=d.charCodeAt(t.length-1)==32,i||r||a||v||u||f){var _e=i||"";r&&(_e+=r),a&&(_e+=a);var we=K("span",[A],_e,u);if(f)for(var Ce in f)f.hasOwnProperty(Ce)&&Ce!="style"&&Ce!="class"&&we.setAttribute(Ce,f[Ce]);return e.content.appendChild(we)}e.content.appendChild(A)}}function Sh(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",a=0;av&&N.from<=v));q++);if(N.to>=A)return e(i,r,a,u,f,d,m);e(i,r.slice(0,N.to-v),a,u,null,d,m),u=null,r=r.slice(N.to-v),v=N.to}}}function fu(e,t,i,r){var a=!r&&i.widgetNode;a&&e.map.push(e.pos,e.pos+t,a),!r&&e.cm.display.input.needsContentAttribute&&(a||(a=e.content.appendChild(document.createElement("span"))),a.setAttribute("cm-marker",i.id)),a&&(e.cm.display.input.setUneditable(a),e.content.appendChild(a)),e.pos+=t,e.trailingSpace=!1}function Ch(e,t,i){var r=e.markedSpans,a=e.text,u=0;if(!r){for(var f=1;fm||Ye.collapsed&&Ee.to==m&&Ee.from==m)){if(Ee.to!=null&&Ee.to!=m&&j>Ee.to&&(j=Ee.to,se=""),Ye.className&&(Y+=" "+Ye.className),Ye.css&&(q=(q?q+";":"")+Ye.css),Ye.startStyle&&Ee.from==m&&(me+=" "+Ye.startStyle),Ye.endStyle&&Ee.to==j&&(Ce||(Ce=[])).push(Ye.endStyle,Ee.to),Ye.title&&((_e||(_e={})).title=Ye.title),Ye.attributes)for(var ct in Ye.attributes)(_e||(_e={}))[ct]=Ye.attributes[ct];Ye.collapsed&&(!be||Zo(be.marker,Ye)<0)&&(be=Ee)}else Ee.from>m&&j>Ee.from&&(j=Ee.from)}if(Ce)for(var Dt=0;Dt=d)break;for(var kn=Math.min(d,j);;){if(A){var un=m+A.length;if(!be){var Tt=un>kn?A.slice(0,kn-m):A;t.addToken(t,Tt,N?N+Y:Y,me,m+Tt.length==j?se:"",q,_e)}if(un>=kn){A=A.slice(kn-m),m=kn;break}m=un,me=""}A=a.slice(u,u=i[v++]),N=uu(i[v++],t.cm.options)}}}function hu(e,t,i){this.line=t,this.rest=vh(t),this.size=this.rest?rt(Le(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Lr(e,t)}function Ks(e,t,i){for(var r=[],a,u=t;u2&&u.push((m.bottom+v.top)/2-i.top)}}u.push(i.bottom-i.top)}}function yu(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;ri)return{map:e.measure.maps[a],cache:e.measure.caches[a],before:!0}}}function Fh(e,t){t=Mn(t);var i=rt(t),r=e.display.externalMeasured=new hu(e.doc,t,i);r.lineN=i;var a=r.built=cu(e,r);return r.text=a.pre,G(e.display.lineMeasure,a.pre),r}function bu(e,t,i,r){return er(e,yi(e,t),i,r)}function sa(e,t){if(t>=e.display.viewFrom&&t=i.lineN&&tt)&&(u=m-d,a=u-1,t>=m&&(f="right")),a!=null){if(r=e[v+2],d==m&&i==(r.insertLeft?"left":"right")&&(f=i),i=="left"&&a==0)for(;v&&e[v-2]==e[v-3]&&e[v-1].insertLeft;)r=e[(v-=3)+2],f="left";if(i=="right"&&a==m-d)for(;v=0&&(i=e[a]).left==i.right;a--);return i}function jh(e,t,i,r){var a=xu(t.map,i,r),u=a.node,f=a.start,d=a.end,m=a.collapse,v;if(u.nodeType==3){for(var A=0;A<4;A++){for(;f&&Ve(t.line.text.charAt(a.coverStart+f));)--f;for(;a.coverStart+d0&&(m=r="right");var N;e.options.lineWrapping&&(N=u.getClientRects()).length>1?v=N[r=="right"?N.length-1:0]:v=u.getBoundingClientRect()}if(w&&C<9&&!f&&(!v||!v.left&&!v.right)){var q=u.parentNode.getClientRects()[0];q?v={left:q.left,right:q.left+wi(e.display),top:q.top,bottom:q.bottom}:v=wu}for(var j=v.top-t.rect.top,Y=v.bottom-t.rect.top,se=(j+Y)/2,me=t.view.measure.heights,be=0;be=r.text.length?(m=r.text.length,v="before"):m<=0&&(m=0,v="after"),!d)return f(v=="before"?m-1:m,v=="before");function A(Y,se,me){var be=d[se],_e=be.level==1;return f(me?Y-1:Y,_e!=me)}var N=ft(d,m,v),q=Gt,j=A(m,N,v=="before");return q!=null&&(j.other=A(m,q,v!="before")),j}function Au(e,t){var i=0;t=Se(e.doc,t),e.options.lineWrapping||(i=wi(e.display)*t.ch);var r=Ie(e.doc,t.line),a=gr(r)+Xs(e.display);return{left:i,right:i,top:a,bottom:a+r.height}}function aa(e,t,i,r,a){var u=ce(e,t,i);return u.xRel=a,r&&(u.outside=r),u}function la(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return aa(r.first,0,null,-1,-1);var a=Pn(r,i),u=r.first+r.size-1;if(a>u)return aa(r.first+r.size-1,Ie(r,u).text.length,null,1,1);t<0&&(t=0);for(var f=Ie(r,a);;){var d=Hh(e,f,a,t,i),m=mh(f,d.ch+(d.xRel>0||d.outside>0?1:0));if(!m)return d;var v=m.find(1);if(v.line==a)return v;f=Ie(r,a=v.line)}}function Lu(e,t,i,r){r-=oa(t);var a=t.text.length,u=dn(function(f){return er(e,i,f-1).bottom<=r},a,0);return a=dn(function(f){return er(e,i,f).top>r},u,a),{begin:u,end:a}}function Eu(e,t,i,r){i||(i=yi(e,t));var a=Vs(e,t,er(e,i,r),"line").top;return Lu(e,t,i,a)}function ua(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function Hh(e,t,i,r,a){a-=gr(t);var u=yi(e,t),f=oa(t),d=0,m=t.text.length,v=!0,A=Wt(t,e.doc.direction);if(A){var N=(e.options.lineWrapping?zh:qh)(e,t,i,u,A,r,a);v=N.level!=1,d=v?N.from:N.to-1,m=v?N.to:N.from-1}var q=null,j=null,Y=dn(function(Oe){var Ee=er(e,u,Oe);return Ee.top+=f,Ee.bottom+=f,ua(Ee,r,a,!1)?(Ee.top<=a&&Ee.left<=r&&(q=Oe,j=Ee),!0):!1},d,m),se,me,be=!1;if(j){var _e=r-j.left=Ce.bottom?1:0}return Y=It(t.text,Y,1),aa(i,Y,me,be,r-se)}function qh(e,t,i,r,a,u,f){var d=dn(function(N){var q=a[N],j=q.level!=1;return ua(Fn(e,ce(i,j?q.to:q.from,j?"before":"after"),"line",t,r),u,f,!0)},0,a.length-1),m=a[d];if(d>0){var v=m.level!=1,A=Fn(e,ce(i,v?m.from:m.to,v?"after":"before"),"line",t,r);ua(A,u,f,!0)&&A.top>f&&(m=a[d-1])}return m}function zh(e,t,i,r,a,u,f){var d=Lu(e,t,r,f),m=d.begin,v=d.end;/\s/.test(t.text.charAt(v-1))&&v--;for(var A=null,N=null,q=0;q=v||j.to<=m)){var Y=j.level!=1,se=er(e,r,Y?Math.min(v,j.to)-1:Math.max(m,j.from)).right,me=seme)&&(A=j,N=me)}}return A||(A=a[a.length-1]),A.fromv&&(A={from:A.from,to:v,level:A.level}),A}var Zr;function bi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Zr==null){Zr=K("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Zr.appendChild(document.createTextNode("x")),Zr.appendChild(K("br"));Zr.appendChild(document.createTextNode("x"))}G(e.measure,Zr);var i=Zr.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),Te(e.measure),i||1}function wi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=K("span","xxxxxxxxxx"),i=K("pre",[t],"CodeMirror-line-like");G(e.measure,i);var r=t.getBoundingClientRect(),a=(r.right-r.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function ca(e){for(var t=e.display,i={},r={},a=t.gutters.clientLeft,u=t.gutters.firstChild,f=0;u;u=u.nextSibling,++f){var d=e.display.gutterSpecs[f].className;i[d]=u.offsetLeft+u.clientLeft+a,r[d]=u.clientWidth}return{fixedPos:fa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function fa(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Nu(e){var t=bi(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/wi(e.display)-3);return function(a){if(Lr(e.doc,a))return 0;var u=0;if(a.widgets)for(var f=0;f0&&(v=Ie(e.doc,m.line).text).length==m.ch){var A=qe(v,v.length,e.options.tabSize)-v.length;m=ce(m.line,Math.max(0,Math.round((u-ku(e.display).left)/wi(e.display))-A))}return m}function ei(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var i=e.display.view,r=0;rt)&&(a.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=a.viewTo)mr&&Qo(e.doc,t)a.viewFrom?Nr(e):(a.viewFrom+=r,a.viewTo+=r);else if(t<=a.viewFrom&&i>=a.viewTo)Nr(e);else if(t<=a.viewFrom){var u=Js(e,i,i+r,1);u?(a.view=a.view.slice(u.index),a.viewFrom=u.lineN,a.viewTo+=r):Nr(e)}else if(i>=a.viewTo){var f=Js(e,t,t,-1);f?(a.view=a.view.slice(0,f.index),a.viewTo=f.lineN):Nr(e)}else{var d=Js(e,t,t,-1),m=Js(e,i,i+r,1);d&&m?(a.view=a.view.slice(0,d.index).concat(Ks(e,d.lineN,m.lineN)).concat(a.view.slice(m.index)),a.viewTo+=r):Nr(e)}var v=a.externalMeasured;v&&(i=a.lineN&&t=r.viewTo)){var u=r.view[ei(e,t)];if(u.node!=null){var f=u.changes||(u.changes=[]);z(f,i)==-1&&f.push(i)}}}function Nr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Js(e,t,i,r){var a=ei(e,t),u,f=e.display.view;if(!mr||i==e.doc.first+e.doc.size)return{index:a,lineN:i};for(var d=e.display.viewFrom,m=0;m0){if(a==f.length-1)return null;u=d+f[a].size-t,a++}else u=d-t;t+=u,i+=u}for(;Qo(e.doc,i)!=i;){if(a==(r<0?0:f.length-1))return null;i+=r*f[a-(r<0?1:0)].size,a+=r}return{index:a,lineN:i}}function $h(e,t,i){var r=e.display,a=r.view;a.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=Ks(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=Ks(e,t,r.viewFrom).concat(r.view):r.viewFromi&&(r.view=r.view.slice(0,ei(e,i)))),r.viewTo=i}function Pu(e){for(var t=e.display.view,i=0,r=0;r=e.display.viewTo||m.to().line0?f:e.defaultCharWidth())+"px"}if(r.other){var d=i.appendChild(K("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));d.style.display="",d.style.left=r.other.left+"px",d.style.top=r.other.top+"px",d.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Zs(e,t){return e.top-t.top||e.left-t.left}function Uh(e,t,i){var r=e.display,a=e.doc,u=document.createDocumentFragment(),f=ku(e.display),d=f.left,m=Math.max(r.sizerWidth,Jr(e)-r.sizer.offsetLeft)-f.right,v=a.direction=="ltr";function A(we,Ce,Oe,Ee){Ce<0&&(Ce=0),Ce=Math.round(Ce),Ee=Math.round(Ee),u.appendChild(K("div",null,"CodeMirror-selected","position: absolute; left: "+we+`px; top: `+Ce+"px; width: "+(Oe??m-we)+`px; height: `+(Ee-Ce)+"px"))}function N(we,Ce,Oe){var Ee=Ie(a,we),Ye=Ee.text.length,ct,Dt;function kt(Tt,cn){return Ys(e,ce(we,Tt),"div",Ee,cn)}function kn(Tt,cn,Ht){var At=Eu(e,Ee,null,Tt),Ct=cn=="ltr"==(Ht=="after")?"left":"right",bt=Ht=="after"?At.begin:At.end-(/\s/.test(Ee.text.charAt(At.end-1))?2:1);return kt(bt,Ct)[Ct]}var un=Wt(Ee,a.direction);return Xr(un,Ce||0,Oe??Ye,function(Tt,cn,Ht,At){var Ct=Ht=="ltr",bt=kt(Tt,Ct?"left":"right"),fn=kt(cn-1,Ct?"right":"left"),Di=Ce==null&&Tt==0,Fr=Oe==null&&cn==Ye,Zt=At==0,tr=!un||At==un.length-1;if(fn.top-bt.top<=3){var Rt=(v?Di:Fr)&&Zt,ja=(v?Fr:Di)&&tr,br=Rt?d:(Ct?bt:fn).left,si=ja?m:(Ct?fn:bt).right;A(br,bt.top,si-br,bt.bottom)}else{var oi,nn,Ri,Wa;Ct?(oi=v&&Di&&Zt?d:bt.left,nn=v?m:kn(Tt,Ht,"before"),Ri=v?d:kn(cn,Ht,"after"),Wa=v&&Fr&&tr?m:fn.right):(oi=v?kn(Tt,Ht,"before"):d,nn=!v&&Di&&Zt?m:bt.right,Ri=!v&&Fr&&tr?d:fn.left,Wa=v?kn(cn,Ht,"after"):m),A(oi,bt.top,nn-oi,bt.bottom),bt.bottom0?t.blinker=setInterval(function(){e.hasFocus()||xi(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Du(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||ga(e))}function ma(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&xi(e))},100)}function ga(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Be(e,"focus",e,t),e.state.focused=!0,Pe(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),y&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),da(e))}function xi(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Be(e,"blur",e,t),e.state.focused=!1,ke(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Qs(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),a=t.lineDiv.getBoundingClientRect().top,u=0,f=0;f.005||j<-.005)&&(ae.display.sizerWidth){var se=Math.ceil(A/wi(e.display));se>e.display.maxLineLength&&(e.display.maxLineLength=se,e.display.maxLine=d.line,e.display.maxLineChanged=!0)}}}Math.abs(u)>2&&(t.scroller.scrollTop+=u)}function Ru(e){if(e.widgets)for(var t=0;t=f&&(u=Pn(t,gr(Ie(t,m))-e.wrapper.clientHeight),f=m)}return{from:u,to:Math.max(f,u+1)}}function Gh(e,t){if(!dt(e,"scrollCursorIntoView")){var i=e.display,r=i.sizer.getBoundingClientRect(),a=null;if(t.top+r.top<0?a=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(a=!1),a!=null&&!W){var u=K("div","​",null,`position: absolute; top: `+(t.top-i.viewOffset-Xs(e.display))+`px; height: `+(t.bottom-t.top+Qn(e)+i.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(u),u.scrollIntoView(a),e.display.lineSpace.removeChild(u)}}}function Kh(e,t,i,r){r==null&&(r=0);var a;!e.options.lineWrapping&&t==i&&(i=t.sticky=="before"?ce(t.line,t.ch+1,"before"):t,t=t.ch?ce(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var u=0;u<5;u++){var f=!1,d=Fn(e,t),m=!i||i==t?d:Fn(e,i);a={left:Math.min(d.left,m.left),top:Math.min(d.top,m.top)-r,right:Math.max(d.left,m.left),bottom:Math.max(d.bottom,m.bottom)+r};var v=va(e,a),A=e.doc.scrollTop,N=e.doc.scrollLeft;if(v.scrollTop!=null&&(ns(e,v.scrollTop),Math.abs(e.doc.scrollTop-A)>1&&(f=!0)),v.scrollLeft!=null&&(ti(e,v.scrollLeft),Math.abs(e.doc.scrollLeft-N)>1&&(f=!0)),!f)break}return a}function Xh(e,t){var i=va(e,t);i.scrollTop!=null&&ns(e,i.scrollTop),i.scrollLeft!=null&&ti(e,i.scrollLeft)}function va(e,t){var i=e.display,r=bi(e.display);t.top<0&&(t.top=0);var a=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,u=ia(e),f={};t.bottom-t.top>u&&(t.bottom=t.top+u);var d=e.doc.height+ra(i),m=t.topd-r;if(t.topa+u){var A=Math.min(t.top,(v?d:t.bottom)-u);A!=a&&(f.scrollTop=A)}var N=e.options.fixedGutter?0:i.gutters.offsetWidth,q=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-N,j=Jr(e)-i.gutters.offsetWidth,Y=t.right-t.left>j;return Y&&(t.right=t.left+j),t.left<10?f.scrollLeft=0:t.leftj+q-3&&(f.scrollLeft=t.right+(Y?0:10)-j),f}function ka(e,t){t!=null&&(to(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function _i(e){to(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ts(e,t,i){(t!=null||i!=null)&&to(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Vh(e,t){to(e),e.curOp.scrollToPos=t}function to(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=Au(e,t.from),r=Au(e,t.to);Mu(e,i,r,t.margin)}}function Mu(e,t,i,r){var a=va(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});ts(e,a.scrollLeft,a.scrollTop)}function ns(e,t){Math.abs(e.doc.scrollTop-t)<2||(p||ba(e,{top:t}),Fu(e,t,!0),p&&ba(e),ss(e,100))}function Fu(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!i)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function ti(e,t,i,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,qu(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function rs(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+ra(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+Qn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var ni=function(e,t,i){this.cm=i;var r=this.vert=K("div",[K("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),a=this.horiz=K("div",[K("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=a.tabIndex=-1,e(r),e(a),Ne(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ne(a,"scroll",function(){a.clientWidth&&t(a.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,w&&C<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ni.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var a=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+a)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var u=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+u)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},ni.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ni.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ni.prototype.zeroWidthHack=function(){var e=B&&!R?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new X,this.disableVert=new X},ni.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function r(){var a=e.getBoundingClientRect(),u=i=="vert"?document.elementFromPoint(a.right-1,(a.top+a.bottom)/2):document.elementFromPoint((a.right+a.left)/2,a.bottom-1);u!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},ni.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var is=function(){};is.prototype.update=function(){return{bottom:0,right:0}},is.prototype.setScrollLeft=function(){},is.prototype.setScrollTop=function(){},is.prototype.clear=function(){};function Si(e,t){t||(t=rs(e));var i=e.display.barWidth,r=e.display.barHeight;Bu(e,t);for(var a=0;a<4&&i!=e.display.barWidth||r!=e.display.barHeight;a++)i!=e.display.barWidth&&e.options.lineWrapping&&Qs(e),Bu(e,rs(e)),i=e.display.barWidth,r=e.display.barHeight}function Bu(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var ju={native:ni,null:is};function Wu(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ke(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ju[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ne(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?ti(e,t):ns(e,t)},e),e.display.scrollbars.addClass&&Pe(e.display.wrapper,e.display.scrollbars.addClass)}var Yh=0;function ri(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Yh,markArrays:null},Ih(e.curOp)}function ii(e){var t=e.curOp;t&&Lh(t,function(i){for(var r=0;r=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new no(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Qh(e){e.updatedDisplay=e.mustUpdate&&ya(e.cm,e.update)}function ep(e){var t=e.cm,i=t.display;e.updatedDisplay&&Qs(t),e.barMeasure=rs(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=bu(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Qn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Jr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function tp(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var i=+new Date+e.options.workTime,r=Xi(e,t.highlightFrontier),a=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(u){if(r.line>=e.display.viewFrom){var f=u.styles,d=u.text.length>e.options.maxHighlightLength?Vt(t.mode,r.state):null,m=Xl(e,u,r,!0);d&&(r.state=d),u.styles=m.styles;var v=u.styleClasses,A=m.classes;A?u.styleClasses=A:v&&(u.styleClasses=null);for(var N=!f||f.length!=u.styles.length||v!=A&&(!v||!A||v.bgClass!=A.bgClass||v.textClass!=A.textClass),q=0;!N&&qi)return ss(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),a.length&&vn(e,function(){for(var u=0;u=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&Pu(e)==0)return!1;zu(e)&&(Nr(e),t.dims=ca(e));var a=r.first+r.size,u=Math.max(t.visible.from-e.options.viewportMargin,r.first),f=Math.min(a,t.visible.to+e.options.viewportMargin);i.viewFromf&&i.viewTo-f<20&&(f=Math.min(a,i.viewTo)),mr&&(u=Qo(e.doc,u),f=lu(e.doc,f));var d=u!=i.viewFrom||f!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;$h(e,u,f),i.viewOffset=gr(Ie(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var m=Pu(e);if(!d&&m==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var v=sp(e);return m>4&&(i.lineDiv.style.display="none"),ap(e,i.updateLineNumbers,t.dims),m>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,op(v),Te(i.cursorDiv),Te(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,d&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,ss(e,400)),i.updateLineNumbers=null,!0}function Hu(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Jr(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+ra(e.display)-ia(e),i.top)}),t.visible=eo(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=eo(e.display,e.doc,i));if(!ya(e,t))break;Qs(e);var a=rs(e);es(e),Si(e,a),xa(e,a),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ba(e,t){var i=new no(e,t);if(ya(e,i)){Qs(e),Hu(e,i);var r=rs(e);es(e),Si(e,r),xa(e,r),i.finish()}}function ap(e,t,i){var r=e.display,a=e.options.lineNumbers,u=r.lineDiv,f=u.firstChild;function d(Y){var se=Y.nextSibling;return y&&B&&e.display.currentWheelTarget==Y?Y.style.display="none":Y.parentNode.removeChild(Y),se}for(var m=r.view,v=r.viewFrom,A=0;A-1&&(j=!1),pu(e,N,v,i)),j&&(Te(N.lineNumber),N.lineNumber.appendChild(document.createTextNode(Yr(e.options,v)))),f=N.node.nextSibling}v+=N.size}for(;f;)f=d(f)}function wa(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Nt(e,"gutterChanged",e)}function xa(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Qn(e)+"px"}function qu(e){var t=e.display,i=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=fa(t)-t.scroller.scrollLeft+e.doc.scrollLeft,a=t.gutters.offsetWidth,u=r+"px",f=0;fd.clientWidth,v=d.scrollHeight>d.clientHeight;if(r&&m||a&&v){if(a&&B&&y){e:for(var A=t.target,N=f.view;A!=d;A=A.parentNode)for(var q=0;q=0&&k(e,r.to())<=0)return i}return-1};var st=function(e,t){this.anchor=e,this.head=t};st.prototype.from=function(){return je(this.anchor,this.head)},st.prototype.to=function(){return he(this.anchor,this.head)},st.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Bn(e,t,i){var r=e&&e.options.selectionsMayTouch,a=t[i];t.sort(function(q,j){return k(q.from(),j.from())}),i=z(t,a);for(var u=1;u0:m>=0){var v=je(d.from(),f.from()),A=he(d.to(),f.to()),N=d.empty()?f.from()==f.head:d.from()==d.head;u<=i&&--i,t.splice(--u,2,new st(N?A:v,N?v:A))}}return new Tn(t,i)}function Pr(e,t){return new Tn([new st(e,t||e)],0)}function Or(e){return e.text?ce(e.from.line+e.text.length-1,Le(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ku(e,t){if(k(e,t.from)<0)return e;if(k(e,t.to)<=0)return Or(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Or(t).ch-t.to.ch),ce(i,r)}function Sa(e,t){for(var i=[],r=0;r1&&e.remove(d.line+1,Y-1),e.insert(d.line+1,be)}Nt(e,"change",e,t)}function Dr(e,t,i){function r(a,u,f){if(a.linked)for(var d=0;d1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Le(e.done)}function Qu(e,t,i,r){var a=e.history;a.undone.length=0;var u=+new Date,f,d;if((a.lastOp==r||a.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&a.lastModTime>u-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(f=hp(a,a.lastOp==r)))d=Le(f.changes),k(t.from,t.to)==0&&k(t.from,d.to)==0?d.to=Or(t):f.changes.push(Ia(e,t));else{var m=Le(a.done);for((!m||!m.ranges)&&so(e.sel,a.done),f={changes:[Ia(e,t)],generation:a.generation},a.done.push(f);a.done.length>a.undoDepth;)a.done.shift(),a.done[0].ranges||a.done.shift()}a.done.push(i),a.generation=++a.maxGeneration,a.lastModTime=a.lastSelTime=u,a.lastOp=a.lastSelOp=r,a.lastOrigin=a.lastSelOrigin=t.origin,d||Be(e,"historyAdded")}function pp(e,t,i,r){var a=t.charAt(0);return a=="*"||a=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function dp(e,t,i,r){var a=e.history,u=r&&r.origin;i==a.lastSelOp||u&&a.lastSelOrigin==u&&(a.lastModTime==a.lastSelTime&&a.lastOrigin==u||pp(e,u,Le(a.done),t))?a.done[a.done.length-1]=t:so(t,a.done),a.lastSelTime=+new Date,a.lastSelOrigin=u,a.lastSelOp=i,r&&r.clearRedo!==!1&&Zu(a.undone)}function so(e,t){var i=Le(t);i&&i.ranges&&i.equals(e)||t.push(e)}function e1(e,t,i,r){var a=t["spans_"+e.id],u=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(f){f.markedSpans&&((a||(a=t["spans_"+e.id]={}))[u]=f.markedSpans),++u})}function mp(e){if(!e)return null;for(var t,i=0;i-1&&(Le(d)[N]=v[N],delete v[N])}}return r}function Aa(e,t,i,r){if(r){var a=e.anchor;if(i){var u=k(t,a)<0;u!=k(i,a)<0?(a=t,t=i):u!=k(t,i)<0&&(t=i)}return new st(a,t)}else return new st(i||t,t)}function oo(e,t,i,r,a){a==null&&(a=e.cm&&(e.cm.display.shift||e.extend)),Jt(e,new Tn([Aa(e.sel.primary(),t,i,a)],0),r)}function n1(e,t,i){for(var r=[],a=e.cm&&(e.cm.display.shift||e.extend),u=0;u=t.ch:d.to>t.ch))){if(a&&(Be(m,"beforeCursorEnter"),m.explicitlyCleared))if(u.markedSpans){--f;continue}else break;if(!m.atomic)continue;if(i){var N=m.find(r<0?1:-1),q=void 0;if((r<0?A:v)&&(N=l1(e,N,-r,N&&N.line==t.line?u:null)),N&&N.line==t.line&&(q=k(N,i))&&(r<0?q<0:q>0))return Ci(e,N,t,r,a)}var j=m.find(r<0?-1:1);return(r<0?v:A)&&(j=l1(e,j,r,j.line==t.line?u:null)),j?Ci(e,j,t,r,a):null}}return t}function lo(e,t,i,r,a){var u=r||1,f=Ci(e,t,i,u,a)||!a&&Ci(e,t,i,u,!0)||Ci(e,t,i,-u,a)||!a&&Ci(e,t,i,-u,!0);return f||(e.cantEdit=!0,ce(e.first,0))}function l1(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?Se(e,ce(t.line-1)):null:i>0&&t.ch==(r||Ie(e,t.line)).text.length?t.line=0;--a)f1(e,{from:r[a].from,to:r[a].to,text:a?[""]:t.text,origin:t.origin});else f1(e,t)}}function f1(e,t){if(!(t.text.length==1&&t.text[0]==""&&k(t.from,t.to)==0)){var i=Sa(e,t);Qu(e,t,i,e.cm?e.cm.curOp.id:NaN),ls(e,t,i,Jo(e,t));var r=[];Dr(e,function(a,u){!u&&z(r,a.history)==-1&&(m1(a.history,t),r.push(a.history)),ls(a,t,null,Jo(a,t))})}}function uo(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!i)){for(var a=e.history,u,f=e.sel,d=t=="undo"?a.done:a.undone,m=t=="undo"?a.undone:a.done,v=0;v=0;--j){var Y=q(j);if(Y)return Y.v}}}}function h1(e,t){if(t!=0&&(e.first+=t,e.sel=new Tn(ze(e.sel.ranges,function(a){return new st(ce(a.anchor.line+t,a.anchor.ch),ce(a.head.line+t,a.head.ch))}),e.sel.primIndex),e.cm)){an(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;re.lastLine())){if(t.from.lineu&&(t={from:t.from,to:ce(u,Ie(e,u).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Nn(e,t.from,t.to),i||(i=Sa(e,t)),e.cm?kp(e.cm,t,r):Ca(e,t,r),ao(e,i,fe),e.cantEdit&&lo(e,ce(e.firstLine(),0))&&(e.cantEdit=!1)}}function kp(e,t,i){var r=e.doc,a=e.display,u=t.from,f=t.to,d=!1,m=u.line;e.options.lineWrapping||(m=rt(Mn(Ie(r,u.line))),r.iter(m,f.line+1,function(j){if(j==a.maxLine)return d=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Xn(e),Ca(r,t,i,Nu(e)),e.options.lineWrapping||(r.iter(m,u.line+t.text.length,function(j){var Y=Gs(j);Y>a.maxLineLength&&(a.maxLine=j,a.maxLineLength=Y,a.maxLineChanged=!0,d=!1)}),d&&(e.curOp.updateMaxLine=!0)),ah(r,u.line),ss(e,400);var v=t.text.length-(f.line-u.line)-1;t.full?an(e):u.line==f.line&&t.text.length==1&&!Vu(e.doc,t)?Er(e,u.line,"text"):an(e,u.line,f.line+1,v);var A=xt(e,"changes"),N=xt(e,"change");if(N||A){var q={from:u,to:f,text:t.text,removed:t.removed,origin:t.origin};N&&Nt(e,"change",e,q),A&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(q)}e.display.selForContextMenu=null}function Ai(e,t,i,r,a){var u;r||(r=i),k(r,i)<0&&(u=[r,i],i=u[0],r=u[1]),typeof t=="string"&&(t=e.splitLines(t)),Ii(e,{from:i,to:r,text:t,origin:a})}function p1(e,t,i,r){i1||!(this.children[0]instanceof cs))){var d=[];this.collapse(d),this.children=[new cs(d)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var f=a.lines.length%25+25,d=f;d10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=v,e.display.maxLineLength=A,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&an(e,r,a+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&o1(e.doc)),e&&Nt(e,"markerCleared",e,this,r,a),t&&ii(e),this.parent&&this.parent.clear()}},Rr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,a=0;a0||f==0&&u.clearWhenEmpty!==!1)return u;if(u.replacedWith&&(u.collapsed=!0,u.widgetNode=b("span",[u.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||u.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(u.widgetNode.insertLeft=!0)),u.collapsed){if(au(e,t.line,t,i,u)||t.line!=i.line&&au(e,i.line,t,i,u))throw new Error("Inserting collapsed marker partially overlapping an existing one");uh()}u.addToHistory&&Qu(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var d=t.line,m=e.cm,v;if(e.iter(d,i.line+1,function(N){m&&u.collapsed&&!m.options.lineWrapping&&Mn(N)==m.display.maxLine&&(v=!0),u.collapsed&&d!=t.line&&en(N,0),fh(N,new qs(u,d==t.line?t.ch:null,d==i.line?i.ch:null),e.cm&&e.cm.curOp),++d}),u.collapsed&&e.iter(t.line,i.line+1,function(N){Lr(e,N)&&en(N,0)}),u.clearOnEnter&&Ne(u,"beforeCursorEnter",function(){return u.clear()}),u.readOnly&&(lh(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),u.collapsed&&(u.id=++v1,u.atomic=!0),m){if(v&&(m.curOp.updateMaxLine=!0),u.collapsed)an(m,t.line,i.line+1);else if(u.className||u.startStyle||u.endStyle||u.css||u.attributes||u.title)for(var A=t.line;A<=i.line;A++)Er(m,A,"text");u.atomic&&o1(m.doc),Nt(m,"markerAdded",m,u)}return u}var ps=function(e,t){this.markers=e,this.primary=t;for(var i=0;i=0;m--)Ii(this,r[m]);d?i1(this,d):this.cm&&_i(this.cm)}),undo:Ot(function(){uo(this,"undo")}),redo:Ot(function(){uo(this,"redo")}),undoSelection:Ot(function(){uo(this,"undo",!0)}),redoSelection:Ot(function(){uo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r=e.ch)&&t.push(a.marker.parent||a.marker)}return t},findMarks:function(e,t,i){e=Se(this,e),t=Se(this,t);var r=[],a=e.line;return this.iter(e.line,t.line+1,function(u){var f=u.markedSpans;if(f)for(var d=0;d=m.to||m.from==null&&a!=e.line||m.from!=null&&a==t.line&&m.from>=t.ch)&&(!i||i(m.marker))&&r.push(m.marker.parent||m.marker)}++a}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;re)return t=e,!0;e-=u,++i}),Se(this,ce(i,t))},indexFromPos:function(e){e=Se(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var A=e.dataTransfer.getData("Text");if(A){var N;if(t.state.draggingText&&!t.state.draggingText.copy&&(N=t.listSelections()),ao(t.doc,Pr(i,i)),N)for(var q=0;q=0;d--)Ai(e.doc,"",r[d].from,r[d].to,"+delete");_i(e)})}function Ea(e,t,i){var r=It(e.text,t+i,i);return r<0||r>e.text.length?null:r}function Na(e,t,i){var r=Ea(e,t.ch,i);return r==null?null:new ce(t.line,r,i<0?"after":"before")}function Pa(e,t,i,r,a){if(e){t.doc.direction=="rtl"&&(a=-a);var u=Wt(i,t.doc.direction);if(u){var f=a<0?Le(u):u[0],d=a<0==(f.level==1),m=d?"after":"before",v;if(f.level>0||t.doc.direction=="rtl"){var A=yi(t,i);v=a<0?i.text.length-1:0;var N=er(t,A,v).top;v=dn(function(q){return er(t,A,q).top==N},a<0==(f.level==1)?f.from:f.to-1,v),m=="before"&&(v=Ea(i,v,1))}else v=a<0?f.to:f.from;return new ce(r,v,m)}}return new ce(r,a<0?i.text.length:0,a<0?"before":"after")}function Pp(e,t,i,r){var a=Wt(t,e.doc.direction);if(!a)return Na(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var u=ft(a,i.ch,i.sticky),f=a[u];if(e.doc.direction=="ltr"&&f.level%2==0&&(r>0?f.to>i.ch:f.from=f.from&&q>=A.begin)){var j=N?"before":"after";return new ce(i.line,q,j)}}var Y=function(be,_e,we){for(var Ce=function(ct,Dt){return Dt?new ce(i.line,d(ct,1),"before"):new ce(i.line,ct,"after")};be>=0&&be0==(Oe.level!=1),Ye=Ee?we.begin:d(we.end,-1);if(Oe.from<=Ye&&Ye0?A.end:d(A.begin,-1);return me!=null&&!(r>0&&me==t.text.length)&&(se=Y(r>0?0:a.length-1,r,v(me)),se)?se:null}var gs={selectAll:u1,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),fe)},killLine:function(e){return Ni(e,function(t){if(t.empty()){var i=Ie(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line0)a=new ce(a.line,a.ch+1),e.replaceRange(u.charAt(a.ch-1)+u.charAt(a.ch-2),ce(a.line,a.ch-2),a,"+transpose");else if(a.line>e.doc.first){var f=Ie(e.doc,a.line-1).text;f&&(a=new ce(a.line,1),e.replaceRange(u.charAt(0)+e.doc.lineSeparator()+f.charAt(f.length-1),ce(a.line-1,f.length-1),a,"+transpose"))}}i.push(new st(a,a))}e.setSelections(i)})},newlineAndIndent:function(e){return vn(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;re&&k(t,this.pos)==0&&i==this.button};var ks,ys;function jp(e,t){var i=+new Date;return ys&&ys.compare(i,e,t)?(ks=ys=null,"triple"):ks&&ks.compare(i,e,t)?(ys=new Da(i,e,t),ks=null,"double"):(ks=new Da(i,e,t),ys=null,"single")}function O1(e){var t=this,i=t.display;if(!(dt(t,e)||i.activeTouch&&i.input.supportsTouch())){if(i.input.ensurePolled(),i.shift=e.shiftKey,vr(i,e)){y||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(!Ra(t,e)){var r=Qr(t,e),a=Sr(e),u=r?jp(r,a):"single";window.focus(),a==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Wp(t,a,r,u,e))&&(a==1?r?qp(t,r,u,e):Ln(e)==i.scroller&&St(e):a==2?(r&&oo(t.doc,r),setTimeout(function(){return i.input.focus()},20)):a==3&&(ye?t.display.input.onContextMenu(e):ma(t)))}}}function Wp(e,t,i,r,a){var u="Click";return r=="double"?u="Double"+u:r=="triple"&&(u="Triple"+u),u=(t==1?"Left":t==2?"Middle":"Right")+u,vs(e,S1(u,a),a,function(f){if(typeof f=="string"&&(f=gs[f]),!f)return!1;var d=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),d=f(e,i)!=ee}finally{e.state.suppressEdits=!1}return d})}function Hp(e,t,i){var r=e.getOption("configureMouse"),a=r?r(e,t,i):{};if(a.unit==null){var u=U?i.shiftKey&&i.metaKey:i.altKey;a.unit=u?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(a.extend==null||e.doc.extend)&&(a.extend=e.doc.extend||i.shiftKey),a.addNew==null&&(a.addNew=B?i.metaKey:i.ctrlKey),a.moveOnDrag==null&&(a.moveOnDrag=!(B?i.altKey:i.ctrlKey)),a}function qp(e,t,i,r){w?setTimeout(Ze(Du,e),0):e.curOp.focus=le();var a=Hp(e,i,r),u=e.doc.sel,f;e.options.dragDrop&&lr&&!e.isReadOnly()&&i=="single"&&(f=u.contains(t))>-1&&(k((f=u.ranges[f]).from(),t)<0||t.xRel>0)&&(k(f.to(),t)>0||t.xRel<0)?zp(e,r,t,a):$p(e,r,t,a)}function zp(e,t,i,r){var a=e.display,u=!1,f=Pt(e,function(v){y&&(a.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:ma(e)),Lt(a.wrapper.ownerDocument,"mouseup",f),Lt(a.wrapper.ownerDocument,"mousemove",d),Lt(a.scroller,"dragstart",m),Lt(a.scroller,"drop",f),u||(St(v),r.addNew||oo(e.doc,i,null,null,r.extend),y&&!F||w&&C==9?setTimeout(function(){a.wrapper.ownerDocument.body.focus({preventScroll:!0}),a.input.focus()},20):a.input.focus())}),d=function(v){u=u||Math.abs(t.clientX-v.clientX)+Math.abs(t.clientY-v.clientY)>=10},m=function(){return u=!0};y&&(a.scroller.draggable=!0),e.state.draggingText=f,f.copy=!r.moveOnDrag,Ne(a.wrapper.ownerDocument,"mouseup",f),Ne(a.wrapper.ownerDocument,"mousemove",d),Ne(a.scroller,"dragstart",m),Ne(a.scroller,"drop",f),e.state.delayingBlurEvent=!0,setTimeout(function(){return a.input.focus()},20),a.scroller.dragDrop&&a.scroller.dragDrop()}function D1(e,t,i){if(i=="char")return new st(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new st(ce(t.line,0),Se(e.doc,ce(t.line+1,0)));var r=i(e,t);return new st(r.from,r.to)}function $p(e,t,i,r){w&&ma(e);var a=e.display,u=e.doc;St(t);var f,d,m=u.sel,v=m.ranges;if(r.addNew&&!r.extend?(d=u.sel.contains(i),d>-1?f=v[d]:f=new st(i,i)):(f=u.sel.primary(),d=u.sel.primIndex),r.unit=="rectangle")r.addNew||(f=new st(i,i)),i=Qr(e,t,!0,!0),d=-1;else{var A=D1(e,i,r.unit);r.extend?f=Aa(f,A.anchor,A.head,r.extend):f=A}r.addNew?d==-1?(d=v.length,Jt(u,Bn(e,v.concat([f]),d),{scroll:!1,origin:"*mouse"})):v.length>1&&v[d].empty()&&r.unit=="char"&&!r.extend?(Jt(u,Bn(e,v.slice(0,d).concat(v.slice(d+1)),0),{scroll:!1,origin:"*mouse"}),m=u.sel):La(u,d,f,ve):(d=0,Jt(u,new Tn([f],0),ve),m=u.sel);var N=i;function q(we){if(k(N,we)!=0)if(N=we,r.unit=="rectangle"){for(var Ce=[],Oe=e.options.tabSize,Ee=qe(Ie(u,i.line).text,i.ch,Oe),Ye=qe(Ie(u,we.line).text,we.ch,Oe),ct=Math.min(Ee,Ye),Dt=Math.max(Ee,Ye),kt=Math.min(i.line,we.line),kn=Math.min(e.lastLine(),Math.max(i.line,we.line));kt<=kn;kt++){var un=Ie(u,kt).text,Tt=Me(un,ct,Oe);ct==Dt?Ce.push(new st(ce(kt,Tt),ce(kt,Tt))):un.length>Tt&&Ce.push(new st(ce(kt,Tt),ce(kt,Me(un,Dt,Oe))))}Ce.length||Ce.push(new st(i,i)),Jt(u,Bn(e,m.ranges.slice(0,d).concat(Ce),d),{origin:"*mouse",scroll:!1}),e.scrollIntoView(we)}else{var cn=f,Ht=D1(e,we,r.unit),At=cn.anchor,Ct;k(Ht.anchor,At)>0?(Ct=Ht.head,At=je(cn.from(),Ht.anchor)):(Ct=Ht.anchor,At=he(cn.to(),Ht.head));var bt=m.ranges.slice(0);bt[d]=Up(e,new st(Se(u,At),Ct)),Jt(u,Bn(e,bt,d),ve)}}var j=a.wrapper.getBoundingClientRect(),Y=0;function se(we){var Ce=++Y,Oe=Qr(e,we,!0,r.unit=="rectangle");if(Oe)if(k(Oe,N)!=0){e.curOp.focus=le(),q(Oe);var Ee=eo(a,u);(Oe.line>=Ee.to||Oe.linej.bottom?20:0;Ye&&setTimeout(Pt(e,function(){Y==Ce&&(a.scroller.scrollTop+=Ye,se(we))}),50)}}function me(we){e.state.selectingText=!1,Y=1/0,we&&(St(we),a.input.focus()),Lt(a.wrapper.ownerDocument,"mousemove",be),Lt(a.wrapper.ownerDocument,"mouseup",_e),u.history.lastSelOrigin=null}var be=Pt(e,function(we){we.buttons===0||!Sr(we)?me(we):se(we)}),_e=Pt(e,me);e.state.selectingText=_e,Ne(a.wrapper.ownerDocument,"mousemove",be),Ne(a.wrapper.ownerDocument,"mouseup",_e)}function Up(e,t){var i=t.anchor,r=t.head,a=Ie(e.doc,i.line);if(k(i,r)==0&&i.sticky==r.sticky)return t;var u=Wt(a);if(!u)return t;var f=ft(u,i.ch,i.sticky),d=u[f];if(d.from!=i.ch&&d.to!=i.ch)return t;var m=f+(d.from==i.ch==(d.level!=1)?0:1);if(m==0||m==u.length)return t;var v;if(r.line!=i.line)v=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var A=ft(u,r.ch,r.sticky),N=A-f||(r.ch-i.ch)*(d.level==1?-1:1);A==m-1||A==m?v=N<0:v=N>0}var q=u[m+(v?-1:0)],j=v==(q.level==1),Y=j?q.from:q.to,se=j?"after":"before";return i.ch==Y&&i.sticky==se?t:new st(new ce(i.line,Y,se),r)}function R1(e,t,i,r){var a,u;if(t.touches)a=t.touches[0].clientX,u=t.touches[0].clientY;else try{a=t.clientX,u=t.clientY}catch{return!1}if(a>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&St(t);var f=e.display,d=f.lineDiv.getBoundingClientRect();if(u>d.bottom||!xt(e,i))return Kt(t);u-=d.top-f.viewOffset;for(var m=0;m=a){var A=Pn(e.doc,u),N=e.display.gutterSpecs[m];return Be(e,i,e,A,N.className,t),Kt(t)}}}function Ra(e,t){return R1(e,t,"gutterClick",!0)}function M1(e,t){vr(e.display,t)||Gp(e,t)||dt(e,t,"contextmenu")||ye||e.display.input.onContextMenu(t)}function Gp(e,t){return xt(e,"gutterContextMenu")?R1(e,t,"gutterContextMenu",!1):!1}function F1(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Qi(e)}var Pi={toString:function(){return"CodeMirror.Init"}},B1={},po={};function Kp(e){var t=e.optionHandlers;function i(r,a,u,f){e.defaults[r]=a,u&&(t[r]=f?function(d,m,v){v!=Pi&&u(d,m,v)}:u)}e.defineOption=i,e.Init=Pi,i("value","",function(r,a){return r.setValue(a)},!0),i("mode",null,function(r,a){r.doc.modeOption=a,Ta(r)},!0),i("indentUnit",2,Ta,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){as(r),Qi(r),an(r)},!0),i("lineSeparator",null,function(r,a){if(r.doc.lineSep=a,!!a){var u=[],f=r.doc.first;r.doc.iter(function(m){for(var v=0;;){var A=m.text.indexOf(a,v);if(A==-1)break;v=A+a.length,u.push(ce(f,A))}f++});for(var d=u.length-1;d>=0;d--)Ai(r.doc,a,u[d],ce(u[d].line,u[d].ch+a.length))}}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,a,u){r.state.specialChars=new RegExp(a.source+(a.test(" ")?"":"| "),"g"),u!=Pi&&r.refresh()}),i("specialCharPlaceholder",xh,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",M?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,a){return r.getInputField().spellcheck=a},!0),i("autocorrect",!1,function(r,a){return r.getInputField().autocorrect=a},!0),i("autocapitalize",!1,function(r,a){return r.getInputField().autocapitalize=a},!0),i("rtlMoveVisually",!ae),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){F1(r),os(r)},!0),i("keyMap","default",function(r,a,u){var f=fo(a),d=u!=Pi&&fo(u);d&&d.detach&&d.detach(r,f),f.attach&&f.attach(r,d||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Vp,!0),i("gutters",[],function(r,a){r.display.gutterSpecs=_a(a,r.options.lineNumbers),os(r)},!0),i("fixedGutter",!0,function(r,a){r.display.gutters.style.left=a?fa(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return Si(r)},!0),i("scrollbarStyle","native",function(r){Wu(r),Si(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,a){r.display.gutterSpecs=_a(r.options.gutters,a),os(r)},!0),i("firstLineNumber",1,os,!0),i("lineNumberFormatter",function(r){return r},os,!0),i("showCursorWhenSelecting",!1,es,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,a){a=="nocursor"&&(xi(r),r.display.input.blur()),r.display.input.readOnlyChanged(a)}),i("screenReaderLabel",null,function(r,a){a=a===""?null:a,r.display.input.screenReaderLabelChanged(a)}),i("disableInput",!1,function(r,a){a||r.display.input.reset()},!0),i("dragDrop",!0,Xp),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,es,!0),i("singleCursorHeightPerLine",!0,es,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,as,!0),i("addModeClass",!1,as,!0),i("pollInterval",100),i("undoDepth",200,function(r,a){return r.doc.history.undoDepth=a}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,as,!0),i("moveInputWithCursor",!0,function(r,a){a||r.display.input.resetPosition()}),i("tabindex",null,function(r,a){return r.display.input.getField().tabIndex=a||""}),i("autofocus",null),i("direction","ltr",function(r,a){return r.doc.setDirection(a)},!0),i("phrases",null)}function Xp(e,t,i){var r=i&&i!=Pi;if(!t!=!r){var a=e.display.dragFunctions,u=t?Ne:Lt;u(e.display.scroller,"dragstart",a.start),u(e.display.scroller,"dragenter",a.enter),u(e.display.scroller,"dragover",a.over),u(e.display.scroller,"dragleave",a.leave),u(e.display.scroller,"drop",a.drop)}}function Vp(e){e.options.lineWrapping?(Pe(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ke(e.display.wrapper,"CodeMirror-wrap"),ta(e)),ha(e),an(e),Qi(e),setTimeout(function(){return Si(e)},100)}function gt(e,t){var i=this;if(!(this instanceof gt))return new gt(e,t);this.options=t=t?He(t):{},He(B1,t,!1);var r=t.value;typeof r=="string"?r=new ln(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var a=new gt.inputStyles[t.inputStyle](this),u=this.display=new lp(e,r,a,t);u.wrapper.CodeMirror=this,F1(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Wu(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new X,keySeq:null,specialChars:null},t.autofocus&&!M&&u.input.focus(),w&&C<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Yp(this),Ip(),ri(this),this.curOp.forceUpdate=!0,Yu(this,r),t.autofocus&&!M||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&ga(i)},20):xi(this);for(var f in po)po.hasOwnProperty(f)&&po[f](this,t[f],Pi);zu(this),t.finishInit&&t.finishInit(this);for(var d=0;d20*20}Ne(t.scroller,"touchstart",function(m){if(!dt(e,m)&&!u(m)&&!Ra(e,m)){t.input.ensurePolled(),clearTimeout(i);var v=+new Date;t.activeTouch={start:v,moved:!1,prev:v-r.end<=300?r:null},m.touches.length==1&&(t.activeTouch.left=m.touches[0].pageX,t.activeTouch.top=m.touches[0].pageY)}}),Ne(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ne(t.scroller,"touchend",function(m){var v=t.activeTouch;if(v&&!vr(t,m)&&v.left!=null&&!v.moved&&new Date-v.start<300){var A=e.coordsChar(t.activeTouch,"page"),N;!v.prev||f(v,v.prev)?N=new st(A,A):!v.prev.prev||f(v,v.prev.prev)?N=e.findWordAt(A):N=new st(ce(A.line,0),Se(e.doc,ce(A.line+1,0))),e.setSelection(N.anchor,N.head),e.focus(),St(m)}a()}),Ne(t.scroller,"touchcancel",a),Ne(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ns(e,t.scroller.scrollTop),ti(e,t.scroller.scrollLeft,!0),Be(e,"scroll",e))}),Ne(t.scroller,"mousewheel",function(m){return Gu(e,m)}),Ne(t.scroller,"DOMMouseScroll",function(m){return Gu(e,m)}),Ne(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(m){dt(e,m)||Rn(m)},over:function(m){dt(e,m)||(Cp(e,m),Rn(m))},start:function(m){return Tp(e,m)},drop:Pt(e,Sp),leave:function(m){dt(e,m)||b1(e)}};var d=t.input.getField();Ne(d,"keyup",function(m){return N1.call(e,m)}),Ne(d,"keydown",Pt(e,E1)),Ne(d,"keypress",Pt(e,P1)),Ne(d,"focus",function(m){return ga(e,m)}),Ne(d,"blur",function(m){return xi(e,m)})}var Ma=[];gt.defineInitHook=function(e){return Ma.push(e)};function bs(e,t,i,r){var a=e.doc,u;i==null&&(i="add"),i=="smart"&&(a.mode.indent?u=Xi(e,t).state:i="prev");var f=e.options.tabSize,d=Ie(a,t),m=qe(d.text,null,f);d.stateAfter&&(d.stateAfter=null);var v=d.text.match(/^\s*/)[0],A;if(!r&&!/\S/.test(d.text))A=0,i="not";else if(i=="smart"&&(A=a.mode.indent(u,d.text.slice(v.length),d.text),A==ee||A>150)){if(!r)return;i="prev"}i=="prev"?t>a.first?A=qe(Ie(a,t-1).text,null,f):A=0:i=="add"?A=m+e.options.indentUnit:i=="subtract"?A=m-e.options.indentUnit:typeof i=="number"&&(A=m+i),A=Math.max(0,A);var N="",q=0;if(e.options.indentWithTabs)for(var j=Math.floor(A/f);j;--j)q+=f,N+=" ";if(qf,m=cr(t),v=null;if(d&&r.ranges.length>1)if(jn&&jn.text.join(` `)==t){if(r.ranges.length%jn.text.length==0){v=[];for(var A=0;A=0;q--){var j=r.ranges[q],Y=j.from(),se=j.to();j.empty()&&(i&&i>0?Y=ce(Y.line,Y.ch-i):e.state.overwrite&&!d?se=ce(se.line,Math.min(Ie(u,se.line).text.length,se.ch+Le(m).length)):d&&jn&&jn.lineWise&&jn.text.join(` `)==m.join(` `)&&(Y=se=ce(Y.line,0)));var me={from:Y,to:se,text:v?v[q%v.length]:m,origin:a||(d?"paste":e.state.cutIncoming>f?"cut":"+input")};Ii(e.doc,me),Nt(e,"inputRead",e,me)}t&&!d&&W1(e,t),_i(e),e.curOp.updateInput<2&&(e.curOp.updateInput=N),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function j1(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&vn(t,function(){return Fa(t,i,0,null,"paste")}),!0}function W1(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var a=i.ranges[r];if(!(a.head.ch>100||r&&i.ranges[r-1].head.line==a.head.line)){var u=e.getModeAt(a.head),f=!1;if(u.electricChars){for(var d=0;d-1){f=bs(e,a.head.line,"smart");break}}else u.electricInput&&u.electricInput.test(Ie(e.doc,a.head.line).text.slice(0,a.head.ch))&&(f=bs(e,a.head.line,"smart"));f&&Nt(e,"electricInput",e,a.head.line)}}}function H1(e){for(var t=[],i=[],r=0;ru&&(bs(this,d.head.line,r,!0),u=d.head.line,f==this.doc.sel.primIndex&&_i(this));else{var m=d.from(),v=d.to(),A=Math.max(u,m.line);u=Math.min(this.lastLine(),v.line-(v.ch?0:1))+1;for(var N=A;N0&&La(this.doc,f,new st(m,q[f].to()),fe)}}}),getTokenAt:function(r,a){return Zl(this,r,a)},getLineTokens:function(r,a){return Zl(this,ce(r),a,!0)},getTokenTypeAt:function(r){r=Se(this.doc,r);var a=Vl(this,Ie(this.doc,r.line)),u=0,f=(a.length-1)/2,d=r.ch,m;if(d==0)m=a[2];else for(;;){var v=u+f>>1;if((v?a[v*2-1]:0)>=d)f=v;else if(a[v*2+1]m&&(r=m,f=!0),d=Ie(this.doc,r)}else d=r;return Vs(this,d,{top:0,left:0},a||"page",u||f).top+(f?this.doc.height-gr(d):0)},defaultTextHeight:function(){return bi(this.display)},defaultCharWidth:function(){return wi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,a,u,f,d){var m=this.display;r=Fn(this,Se(this.doc,r));var v=r.bottom,A=r.left;if(a.style.position="absolute",a.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(a),m.sizer.appendChild(a),f=="over")v=r.top;else if(f=="above"||f=="near"){var N=Math.max(m.wrapper.clientHeight,this.doc.height),q=Math.max(m.sizer.clientWidth,m.lineSpace.clientWidth);(f=="above"||r.bottom+a.offsetHeight>N)&&r.top>a.offsetHeight?v=r.top-a.offsetHeight:r.bottom+a.offsetHeight<=N&&(v=r.bottom),A+a.offsetWidth>q&&(A=q-a.offsetWidth)}a.style.top=v+"px",a.style.left=a.style.right="",d=="right"?(A=m.sizer.clientWidth-a.offsetWidth,a.style.right="0px"):(d=="left"?A=0:d=="middle"&&(A=(m.sizer.clientWidth-a.offsetWidth)/2),a.style.left=A+"px"),u&&Xh(this,{left:A,top:v,right:A+a.offsetWidth,bottom:v+a.offsetHeight})},triggerOnKeyDown:tn(E1),triggerOnKeyPress:tn(P1),triggerOnKeyUp:N1,triggerOnMouseDown:tn(O1),execCommand:function(r){if(gs.hasOwnProperty(r))return gs[r].call(null,this)},triggerElectric:tn(function(r){W1(this,r)}),findPosH:function(r,a,u,f){var d=1;a<0&&(d=-1,a=-a);for(var m=Se(this.doc,r),v=0;v0&&A(u.charAt(f-1));)--f;for(;d.5||this.options.lineWrapping)&&ha(this),Be(this,"refresh",this)}),swapDoc:tn(function(r){var a=this.doc;return a.cm=null,this.state.selectingText&&this.state.selectingText(),Yu(this,r),Qi(this),this.display.input.reset(),ts(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Nt(this,"swapDoc",this,a),a}),phrase:function(r){var a=this.options.phrases;return a&&Object.prototype.hasOwnProperty.call(a,r)?a[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},mn(e),e.registerHelper=function(r,a,u){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][a]=u},e.registerGlobalHelper=function(r,a,u,f){e.registerHelper(r,a,f),i[r]._global.push({pred:u,val:f})}}function Ba(e,t,i,r,a){var u=t,f=i,d=Ie(e,t.line),m=a&&e.direction=="rtl"?-i:i;function v(){var _e=t.line+m;return _e=e.first+e.size?!1:(t=new ce(_e,t.ch,t.sticky),d=Ie(e,_e))}function A(_e){var we;if(r=="codepoint"){var Ce=d.text.charCodeAt(t.ch+(i>0?0:-1));if(isNaN(Ce))we=null;else{var Oe=i>0?Ce>=55296&&Ce<56320:Ce>=56320&&Ce<57343;we=new ce(t.line,Math.max(0,Math.min(d.text.length,t.ch+i*(Oe?2:1))),-i)}}else a?we=Pp(e.cm,d,t,i):we=Na(d,t,i);if(we==null)if(!_e&&v())t=Pa(a,e.cm,d,t.line,m);else return!1;else t=we;return!0}if(r=="char"||r=="codepoint")A();else if(r=="column")A(!0);else if(r=="word"||r=="group")for(var N=null,q=r=="group",j=e.cm&&e.cm.getHelper(t,"wordChars"),Y=!0;!(i<0&&!A(!Y));Y=!1){var se=d.text.charAt(t.ch)||` `,me=$(se,j)?"w":q&&se==` `?"n":!q||/\s/.test(se)?null:"p";if(q&&!Y&&!me&&(me="s"),N&&N!=me){i<0&&(i=1,A(),t.sticky="after");break}if(me&&(N=me),i>0&&!A(!Y))break}var be=lo(e,t,u,f,!0);return P(u,be)&&(be.hitSide=!0),be}function $1(e,t,i,r){var a=e.doc,u=t.left,f;if(r=="page"){var d=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),m=Math.max(d-.5*bi(e.display),3);f=(i>0?t.bottom:t.top)+i*m}else r=="line"&&(f=i>0?t.bottom+3:t.top-3);for(var v;v=la(e,u,f),!!v.outside;){if(i<0?f<=0:f>=a.height){v.hitSide=!0;break}f+=i*5}return v}var lt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new X,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};lt.prototype.init=function(e){var t=this,i=this,r=i.cm,a=i.div=e.lineDiv;a.contentEditable=!0,q1(a,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function u(d){for(var m=d.target;m;m=m.parentNode){if(m==a)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(m.className))break}return!1}Ne(a,"paste",function(d){!u(d)||dt(r,d)||j1(d,r)||C<=11&&setTimeout(Pt(r,function(){return t.updateFromDOM()}),20)}),Ne(a,"compositionstart",function(d){t.composing={data:d.data,done:!1}}),Ne(a,"compositionupdate",function(d){t.composing||(t.composing={data:d.data,done:!1})}),Ne(a,"compositionend",function(d){t.composing&&(d.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ne(a,"touchstart",function(){return i.forceCompositionEnd()}),Ne(a,"input",function(){t.composing||t.readFromDOMSoon()});function f(d){if(!(!u(d)||dt(r,d))){if(r.somethingSelected())mo({lineWise:!1,text:r.getSelections()}),d.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var m=H1(r);mo({lineWise:!0,text:m.text}),d.type=="cut"&&r.operation(function(){r.setSelections(m.ranges,0,fe),r.replaceSelection("",null,"cut")})}else return;if(d.clipboardData){d.clipboardData.clearData();var v=jn.text.join(` `);if(d.clipboardData.setData("Text",v),d.clipboardData.getData("Text")==v){d.preventDefault();return}}var A=z1(),N=A.firstChild;r.display.lineSpace.insertBefore(A,r.display.lineSpace.firstChild),N.value=jn.text.join(` `);var q=le();Fe(N),setTimeout(function(){r.display.lineSpace.removeChild(A),q.focus(),q==a&&i.showPrimarySelection()},50)}}Ne(a,"copy",f),Ne(a,"cut",f)},lt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},lt.prototype.prepareSelection=function(){var e=Ou(this.cm,!1);return e.focus=le()==this.div,e},lt.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},lt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},lt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),a=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||a.line=t.display.viewFrom&&U1(t,r)||{node:d[0].measure.map[2],offset:0},v=a.linee.firstLine()&&(r=ce(r.line-1,Ie(e.doc,r.line-1).length)),a.ch==Ie(e.doc,a.line).text.length&&a.linet.viewTo-1)return!1;var u,f,d;r.line==t.viewFrom||(u=ei(e,r.line))==0?(f=rt(t.view[0].line),d=t.view[0].node):(f=rt(t.view[u].line),d=t.view[u-1].node.nextSibling);var m=ei(e,a.line),v,A;if(m==t.view.length-1?(v=t.viewTo-1,A=t.lineDiv.lastChild):(v=rt(t.view[m+1].line)-1,A=t.view[m+1].node.previousSibling),!d)return!1;for(var N=e.doc.splitLines(Qp(e,d,A,f,v)),q=Nn(e.doc,ce(f,0),ce(v,Ie(e.doc,v).text.length));N.length>1&&q.length>1;)if(Le(N)==Le(q))N.pop(),q.pop(),v--;else if(N[0]==q[0])N.shift(),q.shift(),f++;else break;for(var j=0,Y=0,se=N[0],me=q[0],be=Math.min(se.length,me.length);jr.ch&&_e.charCodeAt(_e.length-Y-1)==we.charCodeAt(we.length-Y-1);)j--,Y++;N[N.length-1]=_e.slice(0,_e.length-Y).replace(/^\u200b+/,""),N[0]=N[0].slice(j).replace(/\u200b+$/,"");var Oe=ce(f,j),Ee=ce(v,q.length?Le(q).length-Y:0);if(N.length>1||N[0]||k(Oe,Ee))return Ai(e.doc,N,Oe,Ee,"+input"),!0},lt.prototype.ensurePolled=function(){this.forceCompositionEnd()},lt.prototype.reset=function(){this.forceCompositionEnd()},lt.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},lt.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},lt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&vn(this.cm,function(){return an(e.cm)})},lt.prototype.setUneditable=function(e){e.contentEditable="false"},lt.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Pt(this.cm,Fa)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},lt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},lt.prototype.onContextMenu=function(){},lt.prototype.resetPosition=function(){},lt.prototype.needsContentAttribute=!0;function U1(e,t){var i=sa(e,t.line);if(!i||i.hidden)return null;var r=Ie(e.doc,t.line),a=yu(i,r,t.line),u=Wt(r,e.doc.direction),f="left";if(u){var d=ft(u,t.ch);f=d%2?"right":"left"}var m=xu(a.map,t.ch,f);return m.offset=m.collapse=="right"?m.end:m.start,m}function Zp(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Oi(e,t){return t&&(e.bad=!0),e}function Qp(e,t,i,r,a){var u="",f=!1,d=e.doc.lineSeparator(),m=!1;function v(j){return function(Y){return Y.id==j}}function A(){f&&(u+=d,m&&(u+=d),f=m=!1)}function N(j){j&&(A(),u+=j)}function q(j){if(j.nodeType==1){var Y=j.getAttribute("cm-text");if(Y){N(Y);return}var se=j.getAttribute("cm-marker"),me;if(se){var be=e.findMarks(ce(r,0),ce(a+1,0),v(+se));be.length&&(me=be[0].find(0))&&N(Nn(e.doc,me.from,me.to).join(d));return}if(j.getAttribute("contenteditable")=="false")return;var _e=/^(pre|div|p|li|table|br)$/i.test(j.nodeName);if(!/^br$/i.test(j.nodeName)&&j.textContent.length==0)return;_e&&A();for(var we=0;we=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Ne(a,"paste",function(f){dt(r,f)||j1(f,r)||(r.state.pasteIncoming=+new Date,i.fastPoll())});function u(f){if(!dt(r,f)){if(r.somethingSelected())mo({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var d=H1(r);mo({lineWise:!0,text:d.text}),f.type=="cut"?r.setSelections(d.ranges,null,fe):(i.prevInput="",a.value=d.text.join(` `),Fe(a))}else return;f.type=="cut"&&(r.state.cutIncoming=+new Date)}}Ne(a,"cut",u),Ne(a,"copy",u),Ne(e.scroller,"paste",function(f){if(!(vr(e,f)||dt(r,f))){if(!a.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var d=new Event("paste");d.clipboardData=f.clipboardData,a.dispatchEvent(d)}}),Ne(e.lineSpace,"selectstart",function(f){vr(e,f)||St(f)}),Ne(a,"compositionstart",function(){var f=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:f,range:r.markText(f,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ne(a,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},_t.prototype.createField=function(e){this.wrapper=z1(),this.textarea=this.wrapper.firstChild},_t.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},_t.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=Ou(e);if(e.options.moveInputWithCursor){var a=Fn(e,i.sel.primary().head,"div"),u=t.wrapper.getBoundingClientRect(),f=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,a.top+f.top-u.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,a.left+f.left-u.left))}return r},_t.prototype.showSelection=function(e){var t=this.cm,i=t.display;G(i.cursorDiv,e.cursors),G(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},_t.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing)){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&Fe(this.textarea),w&&C>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",w&&C>=9&&(this.hasSelection=null))}},_t.prototype.getField=function(){return this.textarea},_t.prototype.supportsTouch=function(){return!1},_t.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!M||le()!=this.textarea))try{this.textarea.focus()}catch{}},_t.prototype.blur=function(){this.textarea.blur()},_t.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},_t.prototype.receivedFocus=function(){this.slowPoll()},_t.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},_t.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},_t.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Cr(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var a=i.value;if(a==r&&!t.somethingSelected())return!1;if(w&&C>=9&&this.hasSelection===a||B&&/[\uf700-\uf7ff]/.test(a))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var u=a.charCodeAt(0);if(u==8203&&!r&&(r="​"),u==8666)return this.reset(),this.cm.execCommand("undo")}for(var f=0,d=Math.min(r.length,a.length);f1e3||a.indexOf(` `)>-1?i.value=e.prevInput="":e.prevInput=a,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},_t.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},_t.prototype.onKeyPress=function(){w&&C>=9&&(this.hasSelection=null),this.fastPoll()},_t.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,a=t.textarea;t.contextMenuPending&&t.contextMenuPending();var u=Qr(i,e),f=r.scroller.scrollTop;if(!u||T)return;var d=i.options.resetSelectionOnContextMenu;d&&i.doc.sel.contains(u)==-1&&Pt(i,Jt)(i.doc,Pr(u),fe);var m=a.style.cssText,v=t.wrapper.style.cssText,A=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",a.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-A.top-5)+"px; left: "+(e.clientX-A.left-5)+`px; z-index: 1000; background: `+(w?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var N;y&&(N=window.scrollY),r.input.focus(),y&&window.scrollTo(null,N),r.input.reset(),i.somethingSelected()||(a.value=t.prevInput=" "),t.contextMenuPending=j,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function q(){if(a.selectionStart!=null){var se=i.somethingSelected(),me="​"+(se?a.value:"");a.value="⇚",a.value=me,t.prevInput=se?"":"​",a.selectionStart=1,a.selectionEnd=me.length,r.selForContextMenu=i.doc.sel}}function j(){if(t.contextMenuPending==j&&(t.contextMenuPending=!1,t.wrapper.style.cssText=v,a.style.cssText=m,w&&C<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=f),a.selectionStart!=null)){(!w||w&&C<9)&&q();var se=0,me=function(){r.selForContextMenu==i.doc.sel&&a.selectionStart==0&&a.selectionEnd>0&&t.prevInput=="​"?Pt(i,u1)(i):se++<10?r.detectingSelectAll=setTimeout(me,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(me,200)}}if(w&&C>=9&&q(),ye){Rn(e);var Y=function(){Lt(window,"mouseup",Y),setTimeout(j,20)};Ne(window,"mouseup",Y)}else setTimeout(j,50)},_t.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},_t.prototype.setUneditable=function(){},_t.prototype.needsContentAttribute=!1;function td(e,t){if(t=t?He(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=le();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=d.getValue()}var a;if(e.form&&(Ne(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var u=e.form;a=u.submit;try{var f=u.submit=function(){r(),u.submit=a,u.submit(),u.submit=f}}catch{}}t.finishInit=function(m){m.save=r,m.getTextArea=function(){return e},m.toTextArea=function(){m.toTextArea=isNaN,r(),e.parentNode.removeChild(m.getWrapperElement()),e.style.display="",e.form&&(Lt(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=a))}},e.style.display="none";var d=gt(function(m){return e.parentNode.insertBefore(m,e.nextSibling)},t);return d}function nd(e){e.off=Lt,e.on=Ne,e.wheelEventPixels=up,e.Doc=ln,e.splitLines=cr,e.countColumn=qe,e.findColumn=Me,e.isWordChar=nt,e.Pass=ee,e.signal=Be,e.Line=vi,e.changeEnd=Or,e.scrollbarModel=ju,e.Pos=ce,e.cmpPos=k,e.modes=Qt,e.mimeModes=Xt,e.resolveMode=Yn,e.getMode=Jn,e.modeExtensions=sn,e.extendMode=on,e.copyState=Vt,e.startState=pr,e.innerMode=hr,e.commands=gs,e.keyMap=yr,e.keyName=T1,e.isModifierKey=_1,e.lookupKey=Ei,e.normalizeKeyMap=Np,e.StringStream=mt,e.SharedTextMarker=ps,e.TextMarker=Rr,e.LineWidget=hs,e.e_preventDefault=St,e.e_stopPropagation=Vn,e.e_stop=Rn,e.addClass=Pe,e.contains=Z,e.rmClass=ke,e.keyNames=Mr}Kp(gt),Jp(gt);var rd="iter insert remove copy getEditor constructor".split(" ");for(var vo in ln.prototype)ln.prototype.hasOwnProperty(vo)&&z(rd,vo)<0&&(gt.prototype[vo]=function(e){return function(){return e.apply(this.doc,arguments)}}(ln.prototype[vo]));return mn(ln),gt.inputStyles={textarea:_t,contenteditable:lt},gt.defineMode=function(e){!gt.defaults.mode&&e!="null"&&(gt.defaults.mode=e),Ar.apply(this,arguments)},gt.defineMIME=_n,gt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),gt.defineMIME("text/plain","null"),gt.defineExtension=function(e,t){gt.prototype[e]=t},gt.defineDocExtension=function(e,t){ln.prototype[e]=t},gt.fromTextArea=td,nd(gt),gt.version="5.65.3",gt})}(nm)),To}var rm=wn();const im=tm(rm);var sm={};(function(n,o){(function(l){l(wn())})(function(l){l.defineMode("javascript",function(c,p){var g=c.indentUnit,_=p.statementIndent,S=p.jsonld,w=p.json||S,C=p.trackScope!==!1,y=p.typescript,E=p.wordCharacters||/[\w$\xa1-\uffff]/,L=function(){function k(Yt){return{type:Yt,style:"keyword"}}var P=k("keyword a"),ne=k("keyword b"),he=k("keyword c"),je=k("keyword d"),Qe=k("operator"),Se={type:"atom",style:"atom"};return{if:k("if"),while:P,with:P,else:ne,do:ne,try:ne,finally:ne,return:je,break:je,continue:je,new:k("new"),delete:he,void:he,throw:he,debugger:k("debugger"),var:k("var"),const:k("var"),let:k("var"),function:k("function"),catch:k("catch"),for:k("for"),switch:k("switch"),case:k("case"),default:k("default"),in:Qe,typeof:Qe,instanceof:Qe,true:Se,false:Se,null:Se,undefined:Se,NaN:Se,Infinity:Se,this:k("this"),class:k("class"),super:k("atom"),yield:he,export:k("export"),import:k("import"),extends:he,await:he}}(),T=/[+\-*&%=<>!?|~^@]/,F=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function R(k){for(var P=!1,ne,he=!1;(ne=k.next())!=null;){if(!P){if(ne=="/"&&!he)return;ne=="["?he=!0:he&&ne=="]"&&(he=!1)}P=!P&&ne=="\\"}}var W,D;function I(k,P,ne){return W=k,D=ne,P}function M(k,P){var ne=k.next();if(ne=='"'||ne=="'")return P.tokenize=B(ne),P.tokenize(k,P);if(ne=="."&&k.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return I("number","number");if(ne=="."&&k.match(".."))return I("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(ne))return I(ne);if(ne=="="&&k.eat(">"))return I("=>","operator");if(ne=="0"&&k.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return I("number","number");if(/\d/.test(ne))return k.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),I("number","number");if(ne=="/")return k.eat("*")?(P.tokenize=U,U(k,P)):k.eat("/")?(k.skipToEnd(),I("comment","comment")):ce(k,P,1)?(R(k),k.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),I("regexp","string-2")):(k.eat("="),I("operator","operator",k.current()));if(ne=="`")return P.tokenize=ae,ae(k,P);if(ne=="#"&&k.peek()=="!")return k.skipToEnd(),I("meta","meta");if(ne=="#"&&k.eatWhile(E))return I("variable","property");if(ne=="<"&&k.match("!--")||ne=="-"&&k.match("->")&&!/\S/.test(k.string.slice(0,k.start)))return k.skipToEnd(),I("comment","comment");if(T.test(ne))return(ne!=">"||!P.lexical||P.lexical.type!=">")&&(k.eat("=")?(ne=="!"||ne=="=")&&k.eat("="):/[<>*+\-|&?]/.test(ne)&&(k.eat(ne),ne==">"&&k.eat(ne))),ne=="?"&&k.eat(".")?I("."):I("operator","operator",k.current());if(E.test(ne)){k.eatWhile(E);var he=k.current();if(P.lastType!="."){if(L.propertyIsEnumerable(he)){var je=L[he];return I(je.type,je.style,he)}if(he=="async"&&k.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return I("async","keyword",he)}return I("variable","variable",he)}}function B(k){return function(P,ne){var he=!1,je;if(S&&P.peek()=="@"&&P.match(F))return ne.tokenize=M,I("jsonld-keyword","meta");for(;(je=P.next())!=null&&!(je==k&&!he);)he=!he&&je=="\\";return he||(ne.tokenize=M),I("string","string")}}function U(k,P){for(var ne=!1,he;he=k.next();){if(he=="/"&&ne){P.tokenize=M;break}ne=he=="*"}return I("comment","comment")}function ae(k,P){for(var ne=!1,he;(he=k.next())!=null;){if(!ne&&(he=="`"||he=="$"&&k.eat("{"))){P.tokenize=M;break}ne=!ne&&he=="\\"}return I("quasi","string-2",k.current())}var ue="([{}])";function te(k,P){P.fatArrowAt&&(P.fatArrowAt=null);var ne=k.string.indexOf("=>",k.start);if(!(ne<0)){if(y){var he=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(k.string.slice(k.start,ne));he&&(ne=he.index)}for(var je=0,Qe=!1,Se=ne-1;Se>=0;--Se){var Yt=k.string.charAt(Se),Sn=ue.indexOf(Yt);if(Sn>=0&&Sn<3){if(!je){++Se;break}if(--je==0){Yt=="("&&(Qe=!0);break}}else if(Sn>=3&&Sn<6)++je;else if(E.test(Yt))Qe=!0;else if(/["'\/`]/.test(Yt))for(;;--Se){if(Se==0)return;var gi=k.string.charAt(Se-1);if(gi==Yt&&k.string.charAt(Se-2)!="\\"){Se--;break}}else if(Qe&&!je){++Se;break}}Qe&&!je&&(P.fatArrowAt=Se)}}var ye={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function ge(k,P,ne,he,je,Qe){this.indented=k,this.column=P,this.type=ne,this.prev=je,this.info=Qe,he!=null&&(this.align=he)}function ke(k,P){if(!C)return!1;for(var ne=k.localVars;ne;ne=ne.next)if(ne.name==P)return!0;for(var he=k.context;he;he=he.prev)for(var ne=he.vars;ne;ne=ne.next)if(ne.name==P)return!0}function Te(k,P,ne,he,je){var Qe=k.cc;for(G.state=k,G.stream=je,G.marked=null,G.cc=Qe,G.style=P,k.lexical.hasOwnProperty("align")||(k.lexical.align=!0);;){var Se=Qe.length?Qe.pop():w?de:fe;if(Se(ne,he)){for(;Qe.length&&Qe[Qe.length-1].lex;)Qe.pop()();return G.marked?G.marked:ne=="variable"&&ke(k,he)?"variable-2":P}}}var G={state:null,column:null,marked:null,cc:null};function K(){for(var k=arguments.length-1;k>=0;k--)G.cc.push(arguments[k])}function b(){return K.apply(null,arguments),!0}function oe(k,P){for(var ne=P;ne;ne=ne.next)if(ne.name==k)return!0;return!1}function Z(k){var P=G.state;if(G.marked="def",!!C){if(P.context){if(P.lexical.info=="var"&&P.context&&P.context.block){var ne=le(k,P.context);if(ne!=null){P.context=ne;return}}else if(!oe(k,P.localVars)){P.localVars=new Fe(k,P.localVars);return}}p.globalVars&&!oe(k,P.globalVars)&&(P.globalVars=new Fe(k,P.globalVars))}}function le(k,P){if(P)if(P.block){var ne=le(k,P.prev);return ne?ne==P.prev?P:new Ae(ne,P.vars,!0):null}else return oe(k,P.vars)?P:new Ae(P.prev,new Fe(k,P.vars),!1);else return null}function Pe(k){return k=="public"||k=="private"||k=="protected"||k=="abstract"||k=="readonly"}function Ae(k,P,ne){this.prev=k,this.vars=P,this.block=ne}function Fe(k,P){this.name=k,this.next=P}var Ze=new Fe("this",new Fe("arguments",null));function He(){G.state.context=new Ae(G.state.context,G.state.localVars,!1),G.state.localVars=Ze}function qe(){G.state.context=new Ae(G.state.context,G.state.localVars,!0),G.state.localVars=null}He.lex=qe.lex=!0;function X(){G.state.localVars=G.state.context.vars,G.state.context=G.state.context.prev}X.lex=!0;function z(k,P){var ne=function(){var he=G.state,je=he.indented;if(he.lexical.type=="stat")je=he.lexical.indented;else for(var Qe=he.lexical;Qe&&Qe.type==")"&&Qe.align;Qe=Qe.prev)je=Qe.indented;he.lexical=new ge(je,G.stream.column(),k,null,he.lexical,P)};return ne.lex=!0,ne}function V(){var k=G.state;k.lexical.prev&&(k.lexical.type==")"&&(k.indented=k.lexical.indented),k.lexical=k.lexical.prev)}V.lex=!0;function ee(k){function P(ne){return ne==k?b():k==";"||ne=="}"||ne==")"||ne=="]"?K():b(P)}return P}function fe(k,P){return k=="var"?b(z("vardef",P),lr,ee(";"),V):k=="keyword a"?b(z("form"),et,fe,V):k=="keyword b"?b(z("form"),fe,V):k=="keyword d"?G.stream.match(/^\s*$/,!1)?b():b(z("stat"),Le,ee(";"),V):k=="debugger"?b(ee(";")):k=="{"?b(z("}"),qe,Wt,V,X):k==";"?b():k=="if"?(G.state.lexical.info=="else"&&G.state.cc[G.state.cc.length-1]==V&&G.state.cc.pop()(),b(z("form"),et,fe,V,Cr)):k=="function"?b(Qt):k=="for"?b(z("form"),qe,Ir,fe,X,V):k=="class"||y&&P=="interface"?(G.marked="keyword",b(z("form",k=="class"?k:P),Jn,V)):k=="variable"?y&&P=="declare"?(G.marked="keyword",b(fe)):y&&(P=="module"||P=="enum"||P=="type")&&G.stream.match(/^\s*\w/,!1)?(G.marked="keyword",P=="enum"?b(Pn):P=="type"?b(Ar,ee("operator"),Be,ee(";")):b(z("form"),Et,ee("{"),z("}"),Wt,V,V)):y&&P=="namespace"?(G.marked="keyword",b(z("form"),de,fe,V)):y&&P=="abstract"?(G.marked="keyword",b(fe)):b(z("stat"),Ve):k=="switch"?b(z("form"),et,ee("{"),z("}","switch"),qe,Wt,V,V,X):k=="case"?b(de,ee(":")):k=="default"?b(ee(":")):k=="catch"?b(z("form"),He,ve,fe,V,X):k=="export"?b(z("stat"),hr,V):k=="import"?b(z("stat"),mt,V):k=="async"?b(fe):P=="@"?b(de,fe):K(z("stat"),de,ee(";"),V)}function ve(k){if(k=="(")return b(_n,ee(")"))}function de(k,P){return Je(k,P,!1)}function Me(k,P){return Je(k,P,!0)}function et(k){return k!="("?K():b(z(")"),Le,ee(")"),V)}function Je(k,P,ne){if(G.state.fatArrowAt==G.stream.start){var he=ne?nt:rn;if(k=="(")return b(He,z(")"),ft(_n,")"),V,ee("=>"),he,X);if(k=="variable")return K(He,Et,ee("=>"),he,X)}var je=ne?Xe:ze;return ye.hasOwnProperty(k)?b(je):k=="function"?b(Qt,je):k=="class"||y&&P=="interface"?(G.marked="keyword",b(z("form"),Yn,V)):k=="keyword c"||k=="async"?b(ne?Me:de):k=="("?b(z(")"),Le,ee(")"),V,je):k=="operator"||k=="spread"?b(ne?Me:de):k=="["?b(z("]"),rt,V,je):k=="{"?Dn(dn,"}",null,je):k=="quasi"?K(at,je):k=="new"?b($(ne)):b()}function Le(k){return k.match(/[;\}\)\],]/)?K():K(de)}function ze(k,P){return k==","?b(Le):Xe(k,P,!1)}function Xe(k,P,ne){var he=ne==!1?ze:Xe,je=ne==!1?de:Me;if(k=="=>")return b(He,ne?nt:rn,X);if(k=="operator")return/\+\+|--/.test(P)||y&&P=="!"?b(he):y&&P=="<"&&G.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?b(z(">"),ft(Be,">"),V,he):P=="?"?b(de,ee(":"),je):b(je);if(k=="quasi")return K(at,he);if(k!=";"){if(k=="(")return Dn(Me,")","call",he);if(k==".")return b(It,he);if(k=="[")return b(z("]"),Le,ee("]"),V,he);if(y&&P=="as")return G.marked="keyword",b(Be,he);if(k=="regexp")return G.state.lastType=G.marked="operator",G.stream.backUp(G.stream.pos-G.stream.start-1),b(je)}}function at(k,P){return k!="quasi"?K():P.slice(P.length-2)!="${"?b(at):b(Le,ut)}function ut(k){if(k=="}")return G.marked="string-2",G.state.tokenize=ae,b(at)}function rn(k){return te(G.stream,G.state),K(k=="{"?fe:de)}function nt(k){return te(G.stream,G.state),K(k=="{"?fe:Me)}function $(k){return function(P){return P=="."?b(k?Q:pe):P=="variable"&&y?b(Rn,k?Xe:ze):K(k?Me:de)}}function pe(k,P){if(P=="target")return G.marked="keyword",b(ze)}function Q(k,P){if(P=="target")return G.marked="keyword",b(Xe)}function Ve(k){return k==":"?b(V,fe):K(ze,ee(";"),V)}function It(k){if(k=="variable")return G.marked="property",b()}function dn(k,P){if(k=="async")return G.marked="property",b(dn);if(k=="variable"||G.style=="keyword"){if(G.marked="property",P=="get"||P=="set")return b(Xr);var ne;return y&&G.state.fatArrowAt==G.stream.start&&(ne=G.stream.match(/^\s*:\s*/,!1))&&(G.state.fatArrowAt=G.stream.pos+ne[0].length),b(Gt)}else{if(k=="number"||k=="string")return G.marked=S?"property":G.style+" property",b(Gt);if(k=="jsonld-keyword")return b(Gt);if(y&&Pe(P))return G.marked="keyword",b(dn);if(k=="[")return b(de,xn,ee("]"),Gt);if(k=="spread")return b(Me,Gt);if(P=="*")return G.marked="keyword",b(dn);if(k==":")return K(Gt)}}function Xr(k){return k!="variable"?K(Gt):(G.marked="property",b(Qt))}function Gt(k){if(k==":")return b(Me);if(k=="(")return K(Qt)}function ft(k,P,ne){function he(je,Qe){if(ne?ne.indexOf(je)>-1:je==","){var Se=G.state.lexical;return Se.info=="call"&&(Se.pos=(Se.pos||0)+1),b(function(Yt,Sn){return Yt==P||Sn==P?K():K(k)},he)}return je==P||Qe==P?b():ne&&ne.indexOf(";")>-1?K(k):b(ee(P))}return function(je,Qe){return je==P||Qe==P?b():K(k,he)}}function Dn(k,P,ne){for(var he=3;he"),Be);if(k=="quasi")return K(mn,Kt)}function dt(k){if(k=="=>")return b(Be)}function Xn(k){return k.match(/[\}\)\]]/)?b():k==","||k==";"?b(Xn):K(xt,Xn)}function xt(k,P){if(k=="variable"||G.style=="keyword")return G.marked="property",b(xt);if(P=="?"||k=="number"||k=="string")return b(xt);if(k==":")return b(Be);if(k=="[")return b(ee("variable"),Ne,ee("]"),xt);if(k=="(")return K(Xt,xt);if(!k.match(/[;\}\)\],]/))return b()}function mn(k,P){return k!="quasi"?K():P.slice(P.length-2)!="${"?b(mn):b(Be,St)}function St(k){if(k=="}")return G.marked="string-2",G.state.tokenize=ae,b(mn)}function Vn(k,P){return k=="variable"&&G.stream.match(/^\s*[?:]/,!1)||P=="?"?b(Vn):k==":"?b(Be):k=="spread"?b(Vn):K(Be)}function Kt(k,P){if(P=="<")return b(z(">"),ft(Be,">"),V,Kt);if(P=="|"||k=="."||P=="&")return b(Be);if(k=="[")return b(Be,ee("]"),Kt);if(P=="extends"||P=="implements")return G.marked="keyword",b(Be);if(P=="?")return b(Be,ee(":"),Be)}function Rn(k,P){if(P=="<")return b(z(">"),ft(Be,">"),V,Kt)}function Ln(){return K(Be,Sr)}function Sr(k,P){if(P=="=")return b(Be)}function lr(k,P){return P=="enum"?(G.marked="keyword",b(Pn)):K(Et,xn,gn,cr)}function Et(k,P){if(y&&Pe(P))return G.marked="keyword",b(Et);if(k=="variable")return Z(P),b();if(k=="spread")return b(Et);if(k=="[")return Dn(ur,"]");if(k=="{")return Dn(Tr,"}")}function Tr(k,P){return k=="variable"&&!G.stream.match(/^\s*:/,!1)?(Z(P),b(gn)):(k=="variable"&&(G.marked="property"),k=="spread"?b(Et):k=="}"?K():k=="["?b(de,ee("]"),ee(":"),Tr):b(ee(":"),Et,gn))}function ur(){return K(Et,gn)}function gn(k,P){if(P=="=")return b(Me)}function cr(k){if(k==",")return b(lr)}function Cr(k,P){if(k=="keyword b"&&P=="else")return b(z("form","else"),fe,V)}function Ir(k,P){if(P=="await")return b(Ir);if(k=="(")return b(z(")"),fr,V)}function fr(k){return k=="var"?b(lr,En):k=="variable"?b(En):K(En)}function En(k,P){return k==")"?b():k==";"?b(En):P=="in"||P=="of"?(G.marked="keyword",b(de,En)):K(de,En)}function Qt(k,P){if(P=="*")return G.marked="keyword",b(Qt);if(k=="variable")return Z(P),b(Qt);if(k=="(")return b(He,z(")"),ft(_n,")"),V,Kn,fe,X);if(y&&P=="<")return b(z(">"),ft(Ln,">"),V,Qt)}function Xt(k,P){if(P=="*")return G.marked="keyword",b(Xt);if(k=="variable")return Z(P),b(Xt);if(k=="(")return b(He,z(")"),ft(_n,")"),V,Kn,X);if(y&&P=="<")return b(z(">"),ft(Ln,">"),V,Xt)}function Ar(k,P){if(k=="keyword"||k=="variable")return G.marked="type",b(Ar);if(P=="<")return b(z(">"),ft(Ln,">"),V)}function _n(k,P){return P=="@"&&b(de,_n),k=="spread"?b(_n):y&&Pe(P)?(G.marked="keyword",b(_n)):y&&k=="this"?b(xn,gn):K(Et,xn,gn)}function Yn(k,P){return k=="variable"?Jn(k,P):sn(k,P)}function Jn(k,P){if(k=="variable")return Z(P),b(sn)}function sn(k,P){if(P=="<")return b(z(">"),ft(Ln,">"),V,sn);if(P=="extends"||P=="implements"||y&&k==",")return P=="implements"&&(G.marked="keyword"),b(y?Be:de,sn);if(k=="{")return b(z("}"),on,V)}function on(k,P){if(k=="async"||k=="variable"&&(P=="static"||P=="get"||P=="set"||y&&Pe(P))&&G.stream.match(/^\s+[\w$\xa1-\uffff]/,!1))return G.marked="keyword",b(on);if(k=="variable"||G.style=="keyword")return G.marked="property",b(Vt,on);if(k=="number"||k=="string")return b(Vt,on);if(k=="[")return b(de,xn,ee("]"),Vt,on);if(P=="*")return G.marked="keyword",b(on);if(y&&k=="(")return K(Xt,on);if(k==";"||k==",")return b(on);if(k=="}")return b();if(P=="@")return b(de,on)}function Vt(k,P){if(P=="!"||P=="?")return b(Vt);if(k==":")return b(Be,gn);if(P=="=")return b(Me);var ne=G.state.lexical.prev,he=ne&&ne.info=="interface";return K(he?Xt:Qt)}function hr(k,P){return P=="*"?(G.marked="keyword",b(en,ee(";"))):P=="default"?(G.marked="keyword",b(de,ee(";"))):k=="{"?b(ft(pr,"}"),en,ee(";")):K(fe)}function pr(k,P){if(P=="as")return G.marked="keyword",b(ee("variable"));if(k=="variable")return K(Me,pr)}function mt(k){return k=="string"?b():k=="("?K(de):k=="."?K(ze):K(Ie,Nn,en)}function Ie(k,P){return k=="{"?Dn(Ie,"}"):(k=="variable"&&Z(P),P=="*"&&(G.marked="keyword"),b(Vr))}function Nn(k){if(k==",")return b(Ie,Nn)}function Vr(k,P){if(P=="as")return G.marked="keyword",b(Ie)}function en(k,P){if(P=="from")return G.marked="keyword",b(de)}function rt(k){return k=="]"?b():K(ft(Me,"]"))}function Pn(){return K(z("form"),Et,ee("{"),z("}"),ft(dr,"}"),V,V)}function dr(){return K(Et,gn)}function Yr(k,P){return k.lastType=="operator"||k.lastType==","||T.test(P.charAt(0))||/[,.]/.test(P.charAt(0))}function ce(k,P,ne){return P.tokenize==M&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(P.lastType)||P.lastType=="quasi"&&/\{\s*$/.test(k.string.slice(0,k.pos-(ne||0)))}return{startState:function(k){var P={tokenize:M,lastType:"sof",cc:[],lexical:new ge((k||0)-g,0,"block",!1),localVars:p.localVars,context:p.localVars&&new Ae(null,null,!1),indented:k||0};return p.globalVars&&typeof p.globalVars=="object"&&(P.globalVars=p.globalVars),P},token:function(k,P){if(k.sol()&&(P.lexical.hasOwnProperty("align")||(P.lexical.align=!1),P.indented=k.indentation(),te(k,P)),P.tokenize!=U&&k.eatSpace())return null;var ne=P.tokenize(k,P);return W=="comment"?ne:(P.lastType=W=="operator"&&(D=="++"||D=="--")?"incdec":W,Te(P,ne,W,D,k))},indent:function(k,P){if(k.tokenize==U||k.tokenize==ae)return l.Pass;if(k.tokenize!=M)return 0;var ne=P&&P.charAt(0),he=k.lexical,je;if(!/^\s*else\b/.test(P))for(var Qe=k.cc.length-1;Qe>=0;--Qe){var Se=k.cc[Qe];if(Se==V)he=he.prev;else if(Se!=Cr&&Se!=X)break}for(;(he.type=="stat"||he.type=="form")&&(ne=="}"||(je=k.cc[k.cc.length-1])&&(je==ze||je==Xe)&&!/^[,\.=+\-*:?[\(]/.test(P));)he=he.prev;_&&he.type==")"&&he.prev.type=="stat"&&(he=he.prev);var Yt=he.type,Sn=ne==Yt;return Yt=="vardef"?he.indented+(k.lastType=="operator"||k.lastType==","?he.info.length+1:0):Yt=="form"&&ne=="{"?he.indented:Yt=="form"?he.indented+g:Yt=="stat"?he.indented+(Yr(k,P)?_||g:0):he.info=="switch"&&!Sn&&p.doubleIndentSwitch!=!1?he.indented+(/^(?:case|default)\b/.test(P)?g:2*g):he.align?he.column+(Sn?0:1):he.indented+(Sn?0:g)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:w?null:"/*",blockCommentEnd:w?null:"*/",blockCommentContinue:w?null:" * ",lineComment:w?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:w?"json":"javascript",jsonldMode:S,jsonMode:w,expressionAllowed:ce,skipExpression:function(k){Te(k,"atom","atom","true",new l.StringStream("",2,null))}}}),l.registerHelper("wordChars","javascript",/[\w$]/),l.defineMIME("text/javascript","javascript"),l.defineMIME("text/ecmascript","javascript"),l.defineMIME("application/javascript","javascript"),l.defineMIME("application/x-javascript","javascript"),l.defineMIME("application/ecmascript","javascript"),l.defineMIME("application/json",{name:"javascript",json:!0}),l.defineMIME("application/x-json",{name:"javascript",json:!0}),l.defineMIME("application/manifest+json",{name:"javascript",json:!0}),l.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),l.defineMIME("text/typescript",{name:"javascript",typescript:!0}),l.defineMIME("application/typescript",{name:"javascript",typescript:!0})})})();var rc={},ic;function Gc(){return ic||(ic=1,function(n,o){(function(l){l(wn())})(function(l){l.defineMode("css",function(ge,ke){var Te=ke.inline;ke.propertyKeywords||(ke=l.resolveMode("text/css"));var G=ge.indentUnit,K=ke.tokenHooks,b=ke.documentTypes||{},oe=ke.mediaTypes||{},Z=ke.mediaFeatures||{},le=ke.mediaValueKeywords||{},Pe=ke.propertyKeywords||{},Ae=ke.nonStandardPropertyKeywords||{},Fe=ke.fontProperties||{},Ze=ke.counterDescriptors||{},He=ke.colorKeywords||{},qe=ke.valueKeywords||{},X=ke.allowNested,z=ke.lineComment,V=ke.supportsAtComponent===!0,ee=ge.highlightNonStandardPropertyKeywords!==!1,fe,ve;function de($,pe){return fe=pe,$}function Me($,pe){var Q=$.next();if(K[Q]){var Ve=K[Q]($,pe);if(Ve!==!1)return Ve}if(Q=="@")return $.eatWhile(/[\w\\\-]/),de("def",$.current());if(Q=="="||(Q=="~"||Q=="|")&&$.eat("="))return de(null,"compare");if(Q=='"'||Q=="'")return pe.tokenize=et(Q),pe.tokenize($,pe);if(Q=="#")return $.eatWhile(/[\w\\\-]/),de("atom","hash");if(Q=="!")return $.match(/^\s*\w*/),de("keyword","important");if(/\d/.test(Q)||Q=="."&&$.eat(/\d/))return $.eatWhile(/[\w.%]/),de("number","unit");if(Q==="-"){if(/[\d.]/.test($.peek()))return $.eatWhile(/[\w.%]/),de("number","unit");if($.match(/^-[\w\\\-]*/))return $.eatWhile(/[\w\\\-]/),$.match(/^\s*:/,!1)?de("variable-2","variable-definition"):de("variable-2","variable");if($.match(/^\w+-/))return de("meta","meta")}else return/[,+>*\/]/.test(Q)?de(null,"select-op"):Q=="."&&$.match(/^-?[_a-z][_a-z0-9-]*/i)?de("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(Q)?de(null,Q):$.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test($.current())&&(pe.tokenize=Je),de("variable callee","variable")):/[\w\\\-]/.test(Q)?($.eatWhile(/[\w\\\-]/),de("property","word")):de(null,null)}function et($){return function(pe,Q){for(var Ve=!1,It;(It=pe.next())!=null;){if(It==$&&!Ve){$==")"&&pe.backUp(1);break}Ve=!Ve&&It=="\\"}return(It==$||!Ve&&$!=")")&&(Q.tokenize=null),de("string","string")}}function Je($,pe){return $.next(),$.match(/^\s*[\"\')]/,!1)?pe.tokenize=null:pe.tokenize=et(")"),de(null,"(")}function Le($,pe,Q){this.type=$,this.indent=pe,this.prev=Q}function ze($,pe,Q,Ve){return $.context=new Le(Q,pe.indentation()+(Ve===!1?0:G),$.context),Q}function Xe($){return $.context.prev&&($.context=$.context.prev),$.context.type}function at($,pe,Q){return nt[Q.context.type]($,pe,Q)}function ut($,pe,Q,Ve){for(var It=Ve||1;It>0;It--)Q.context=Q.context.prev;return at($,pe,Q)}function rn($){var pe=$.current().toLowerCase();qe.hasOwnProperty(pe)?ve="atom":He.hasOwnProperty(pe)?ve="keyword":ve="variable"}var nt={};return nt.top=function($,pe,Q){if($=="{")return ze(Q,pe,"block");if($=="}"&&Q.context.prev)return Xe(Q);if(V&&/@component/i.test($))return ze(Q,pe,"atComponentBlock");if(/^@(-moz-)?document$/i.test($))return ze(Q,pe,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test($))return ze(Q,pe,"atBlock");if(/^@(font-face|counter-style)/i.test($))return Q.stateArg=$,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test($))return"keyframes";if($&&$.charAt(0)=="@")return ze(Q,pe,"at");if($=="hash")ve="builtin";else if($=="word")ve="tag";else{if($=="variable-definition")return"maybeprop";if($=="interpolation")return ze(Q,pe,"interpolation");if($==":")return"pseudo";if(X&&$=="(")return ze(Q,pe,"parens")}return Q.context.type},nt.block=function($,pe,Q){if($=="word"){var Ve=pe.current().toLowerCase();return Pe.hasOwnProperty(Ve)?(ve="property","maybeprop"):Ae.hasOwnProperty(Ve)?(ve=ee?"string-2":"property","maybeprop"):X?(ve=pe.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(ve+=" error","maybeprop")}else return $=="meta"?"block":!X&&($=="hash"||$=="qualifier")?(ve="error","block"):nt.top($,pe,Q)},nt.maybeprop=function($,pe,Q){return $==":"?ze(Q,pe,"prop"):at($,pe,Q)},nt.prop=function($,pe,Q){if($==";")return Xe(Q);if($=="{"&&X)return ze(Q,pe,"propBlock");if($=="}"||$=="{")return ut($,pe,Q);if($=="(")return ze(Q,pe,"parens");if($=="hash"&&!/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(pe.current()))ve+=" error";else if($=="word")rn(pe);else if($=="interpolation")return ze(Q,pe,"interpolation");return"prop"},nt.propBlock=function($,pe,Q){return $=="}"?Xe(Q):$=="word"?(ve="property","maybeprop"):Q.context.type},nt.parens=function($,pe,Q){return $=="{"||$=="}"?ut($,pe,Q):$==")"?Xe(Q):$=="("?ze(Q,pe,"parens"):$=="interpolation"?ze(Q,pe,"interpolation"):($=="word"&&rn(pe),"parens")},nt.pseudo=function($,pe,Q){return $=="meta"?"pseudo":$=="word"?(ve="variable-3",Q.context.type):at($,pe,Q)},nt.documentTypes=function($,pe,Q){return $=="word"&&b.hasOwnProperty(pe.current())?(ve="tag",Q.context.type):nt.atBlock($,pe,Q)},nt.atBlock=function($,pe,Q){if($=="(")return ze(Q,pe,"atBlock_parens");if($=="}"||$==";")return ut($,pe,Q);if($=="{")return Xe(Q)&&ze(Q,pe,X?"block":"top");if($=="interpolation")return ze(Q,pe,"interpolation");if($=="word"){var Ve=pe.current().toLowerCase();Ve=="only"||Ve=="not"||Ve=="and"||Ve=="or"?ve="keyword":oe.hasOwnProperty(Ve)?ve="attribute":Z.hasOwnProperty(Ve)?ve="property":le.hasOwnProperty(Ve)?ve="keyword":Pe.hasOwnProperty(Ve)?ve="property":Ae.hasOwnProperty(Ve)?ve=ee?"string-2":"property":qe.hasOwnProperty(Ve)?ve="atom":He.hasOwnProperty(Ve)?ve="keyword":ve="error"}return Q.context.type},nt.atComponentBlock=function($,pe,Q){return $=="}"?ut($,pe,Q):$=="{"?Xe(Q)&&ze(Q,pe,X?"block":"top",!1):($=="word"&&(ve="error"),Q.context.type)},nt.atBlock_parens=function($,pe,Q){return $==")"?Xe(Q):$=="{"||$=="}"?ut($,pe,Q,2):nt.atBlock($,pe,Q)},nt.restricted_atBlock_before=function($,pe,Q){return $=="{"?ze(Q,pe,"restricted_atBlock"):$=="word"&&Q.stateArg=="@counter-style"?(ve="variable","restricted_atBlock_before"):at($,pe,Q)},nt.restricted_atBlock=function($,pe,Q){return $=="}"?(Q.stateArg=null,Xe(Q)):$=="word"?(Q.stateArg=="@font-face"&&!Fe.hasOwnProperty(pe.current().toLowerCase())||Q.stateArg=="@counter-style"&&!Ze.hasOwnProperty(pe.current().toLowerCase())?ve="error":ve="property","maybeprop"):"restricted_atBlock"},nt.keyframes=function($,pe,Q){return $=="word"?(ve="variable","keyframes"):$=="{"?ze(Q,pe,"top"):at($,pe,Q)},nt.at=function($,pe,Q){return $==";"?Xe(Q):$=="{"||$=="}"?ut($,pe,Q):($=="word"?ve="tag":$=="hash"&&(ve="builtin"),"at")},nt.interpolation=function($,pe,Q){return $=="}"?Xe(Q):$=="{"||$==";"?ut($,pe,Q):($=="word"?ve="variable":$!="variable"&&$!="("&&$!=")"&&(ve="error"),"interpolation")},{startState:function($){return{tokenize:null,state:Te?"block":"top",stateArg:null,context:new Le(Te?"block":"top",$||0,null)}},token:function($,pe){if(!pe.tokenize&&$.eatSpace())return null;var Q=(pe.tokenize||Me)($,pe);return Q&&typeof Q=="object"&&(fe=Q[1],Q=Q[0]),ve=Q,fe!="comment"&&(pe.state=nt[pe.state](fe,$,pe)),ve},indent:function($,pe){var Q=$.context,Ve=pe&&pe.charAt(0),It=Q.indent;return Q.type=="prop"&&(Ve=="}"||Ve==")")&&(Q=Q.prev),Q.prev&&(Ve=="}"&&(Q.type=="block"||Q.type=="top"||Q.type=="interpolation"||Q.type=="restricted_atBlock")?(Q=Q.prev,It=Q.indent):(Ve==")"&&(Q.type=="parens"||Q.type=="atBlock_parens")||Ve=="{"&&(Q.type=="at"||Q.type=="atBlock"))&&(It=Math.max(0,Q.indent-G))),It},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:z,fold:"brace"}});function c(ge){for(var ke={},Te=0;Te")):null:b.match("--")?Z(W("comment","-->")):b.match("DOCTYPE",!0,!0)?(b.eatWhile(/[\w\._\-]/),Z(D(1))):null:b.eat("?")?(b.eatWhile(/[\w\._\-]/),oe.tokenize=W("meta","?>"),"meta"):(E=b.eat("/")?"closeTag":"openTag",oe.tokenize=F,"tag bracket");if(le=="&"){var Pe;return b.eat("#")?b.eat("x")?Pe=b.eatWhile(/[a-fA-F\d]/)&&b.eat(";"):Pe=b.eatWhile(/[\d]/)&&b.eat(";"):Pe=b.eatWhile(/[\w\.\-:]/)&&b.eat(";"),Pe?"atom":"error"}else return b.eatWhile(/[^&<]/),null}T.isInText=!0;function F(b,oe){var Z=b.next();if(Z==">"||Z=="/"&&b.eat(">"))return oe.tokenize=T,E=Z==">"?"endTag":"selfcloseTag","tag bracket";if(Z=="=")return E="equals",null;if(Z=="<"){oe.tokenize=T,oe.state=ae,oe.tagName=oe.tagStart=null;var le=oe.tokenize(b,oe);return le?le+" tag error":"tag error"}else return/[\'\"]/.test(Z)?(oe.tokenize=R(Z),oe.stringStartCol=b.column(),oe.tokenize(b,oe)):(b.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function R(b){var oe=function(Z,le){for(;!Z.eol();)if(Z.next()==b){le.tokenize=F;break}return"string"};return oe.isInAttribute=!0,oe}function W(b,oe){return function(Z,le){for(;!Z.eol();){if(Z.match(oe)){le.tokenize=T;break}Z.next()}return b}}function D(b){return function(oe,Z){for(var le;(le=oe.next())!=null;){if(le=="<")return Z.tokenize=D(b+1),Z.tokenize(oe,Z);if(le==">")if(b==1){Z.tokenize=T;break}else return Z.tokenize=D(b-1),Z.tokenize(oe,Z)}return"meta"}}function I(b){return b&&b.toLowerCase()}function M(b,oe,Z){this.prev=b.context,this.tagName=oe||"",this.indent=b.indented,this.startOfLine=Z,(w.doNotIndent.hasOwnProperty(oe)||b.context&&b.context.noIndent)&&(this.noIndent=!0)}function B(b){b.context&&(b.context=b.context.prev)}function U(b,oe){for(var Z;;){if(!b.context||(Z=b.context.tagName,!w.contextGrabbers.hasOwnProperty(I(Z))||!w.contextGrabbers[I(Z)].hasOwnProperty(I(oe))))return;B(b)}}function ae(b,oe,Z){return b=="openTag"?(Z.tagStart=oe.column(),ue):b=="closeTag"?te:ae}function ue(b,oe,Z){return b=="word"?(Z.tagName=oe.current(),L="tag",ke):w.allowMissingTagName&&b=="endTag"?(L="tag bracket",ke(b,oe,Z)):(L="error",ue)}function te(b,oe,Z){if(b=="word"){var le=oe.current();return Z.context&&Z.context.tagName!=le&&w.implicitlyClosed.hasOwnProperty(I(Z.context.tagName))&&B(Z),Z.context&&Z.context.tagName==le||w.matchClosing===!1?(L="tag",ye):(L="tag error",ge)}else return w.allowMissingTagName&&b=="endTag"?(L="tag bracket",ye(b,oe,Z)):(L="error",ge)}function ye(b,oe,Z){return b!="endTag"?(L="error",ye):(B(Z),ae)}function ge(b,oe,Z){return L="error",ye(b,oe,Z)}function ke(b,oe,Z){if(b=="word")return L="attribute",Te;if(b=="endTag"||b=="selfcloseTag"){var le=Z.tagName,Pe=Z.tagStart;return Z.tagName=Z.tagStart=null,b=="selfcloseTag"||w.autoSelfClosers.hasOwnProperty(I(le))?U(Z,le):(U(Z,le),Z.context=new M(Z,le,Pe==Z.indented)),ae}return L="error",ke}function Te(b,oe,Z){return b=="equals"?G:(w.allowMissing||(L="error"),ke(b,oe,Z))}function G(b,oe,Z){return b=="string"?K:b=="word"&&w.allowUnquoted?(L="string",ke):(L="error",ke(b,oe,Z))}function K(b,oe,Z){return b=="string"?K:ke(b,oe,Z)}return{startState:function(b){var oe={tokenize:T,state:ae,indented:b||0,tagName:null,tagStart:null,context:null};return b!=null&&(oe.baseIndent=b),oe},token:function(b,oe){if(!oe.tagName&&b.sol()&&(oe.indented=b.indentation()),b.eatSpace())return null;E=null;var Z=oe.tokenize(b,oe);return(Z||E)&&Z!="comment"&&(L=null,oe.state=oe.state(E||Z,b,oe),L&&(Z=L=="error"?Z+" error":L)),Z},indent:function(b,oe,Z){var le=b.context;if(b.tokenize.isInAttribute)return b.tagStart==b.indented?b.stringStartCol+1:b.indented+S;if(le&&le.noIndent)return l.Pass;if(b.tokenize!=F&&b.tokenize!=T)return Z?Z.match(/^(\s*)/)[0].length:0;if(b.tagName)return w.multilineTagIndentPastTag!==!1?b.tagStart+b.tagName.length+2:b.tagStart+S*(w.multilineTagIndentFactor||1);if(w.alignCDATA&&/$/,blockCommentStart:"",configuration:w.htmlMode?"html":"xml",helperType:w.htmlMode?"html":"xml",skipAttribute:function(b){b.state==G&&(b.state=ke)},xmlCurrentTag:function(b){return b.tagName?{name:b.tagName,close:b.type=="closeTag"}:null},xmlCurrentContext:function(b){for(var oe=[],Z=b.context;Z;Z=Z.prev)oe.push(Z.tagName);return oe.reverse()}}}),l.defineMIME("text/xml","xml"),l.defineMIME("application/xml","xml"),l.mimeModes.hasOwnProperty("text/html")||l.defineMIME("text/html",{name:"xml",htmlMode:!0})})}()),sc}(function(n,o){(function(l){l(wn(),om(),sm,Gc())})(function(l){var c={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function p(E,L,T){var F=E.current(),R=F.search(L);return R>-1?E.backUp(F.length-R):F.match(/<\/?$/)&&(E.backUp(F.length),E.match(L,!1)||E.match(F)),T}var g={};function _(E){var L=g[E];return L||(g[E]=new RegExp("\\s+"+E+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function S(E,L){var T=E.match(_(L));return T?/^\s*(.*?)\s*$/.exec(T[2])[1]:""}function w(E,L){return new RegExp((L?"^":"")+"","i")}function C(E,L){for(var T in E)for(var F=L[T]||(L[T]=[]),R=E[T],W=R.length-1;W>=0;W--)F.unshift(R[W])}function y(E,L){for(var T=0;T=0;D--)F.script.unshift(["type",W[D].matches,W[D].mode]);function I(M,B){var U=T.token(M,B.htmlState),ae=/\btag\b/.test(U),ue;if(ae&&!/[<>\s\/]/.test(M.current())&&(ue=B.htmlState.tagName&&B.htmlState.tagName.toLowerCase())&&F.hasOwnProperty(ue))B.inTag=ue+" ";else if(B.inTag&&ae&&/>$/.test(M.current())){var te=/^([\S]+) (.*)/.exec(B.inTag);B.inTag=null;var ye=M.current()==">"&&y(F[te[1]],te[2]),ge=l.getMode(E,ye),ke=w(te[1],!0),Te=w(te[1],!1);B.token=function(G,K){return G.match(ke,!1)?(K.token=I,K.localState=K.localMode=null,null):p(G,Te,K.localMode.token(G,K.localState))},B.localMode=ge,B.localState=l.startState(ge,T.indent(B.htmlState,"",""))}else B.inTag&&(B.inTag+=M.current(),M.eol()&&(B.inTag+=" "));return U}return{startState:function(){var M=l.startState(T);return{token:I,inTag:null,localMode:null,localState:null,htmlState:M}},copyState:function(M){var B;return M.localState&&(B=l.copyState(M.localMode,M.localState)),{token:M.token,inTag:M.inTag,localMode:M.localMode,localState:B,htmlState:l.copyState(T,M.htmlState)}},token:function(M,B){return B.token(M,B)},indent:function(M,B,U){return!M.localMode||/^\s*<\//.test(B)?T.indent(M.htmlState,B,U):M.localMode.indent?M.localMode.indent(M.localState,B,U):l.Pass},innerMode:function(M){return{state:M.localState||M.htmlState,mode:M.localMode||T}}}},"xml","javascript","css"),l.defineMIME("text/html","htmlmixed")})})();(function(n,o){(function(l){l(wn())})(function(l){var c={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},p=l.Pos;l.defineOption("autoCloseBrackets",!1,function(D,I,M){M&&M!=l.Init&&(D.removeKeyMap(_),D.state.closeBrackets=null),I&&(S(g(I,"pairs")),D.state.closeBrackets=I,D.addKeyMap(_))});function g(D,I){return I=="pairs"&&typeof D=="string"?D:typeof D=="object"&&D[I]!=null?D[I]:c[I]}var _={Backspace:y,Enter:E};function S(D){for(var I=0;I=0;U--){var ue=B[U].head;D.replaceRange("",p(ue.line,ue.ch-1),p(ue.line,ue.ch+1),"+delete")}}function E(D){var I=C(D),M=I&&g(I,"explode");if(!M||D.getOption("disableInput"))return l.Pass;for(var B=D.listSelections(),U=0;U0?{line:ue.head.line,ch:ue.head.ch+I}:{line:ue.head.line-1};M.push({anchor:te,head:te})}D.setSelections(M,U)}function T(D){var I=l.cmpPos(D.anchor,D.head)>0;return{anchor:new p(D.anchor.line,D.anchor.ch+(I?-1:1)),head:new p(D.head.line,D.head.ch+(I?1:-1))}}function F(D,I){var M=C(D);if(!M||D.getOption("disableInput"))return l.Pass;var B=g(M,"pairs"),U=B.indexOf(I);if(U==-1)return l.Pass;for(var ae=g(M,"closeBefore"),ue=g(M,"triples"),te=B.charAt(U+1)==I,ye=D.listSelections(),ge=U%2==0,ke,Te=0;Te=0&&D.getRange(K,p(K.line,K.ch+3))==I+I+I?b="skipThree":b="skip";else if(te&&K.ch>1&&ue.indexOf(I)>=0&&D.getRange(p(K.line,K.ch-2),K)==I+I){if(K.ch>2&&/\bstring/.test(D.getTokenTypeAt(p(K.line,K.ch-2))))return l.Pass;b="addFour"}else if(te){var Z=K.ch==0?" ":D.getRange(p(K.line,K.ch-1),K);if(!l.isWordChar(oe)&&Z!=I&&!l.isWordChar(Z))b="both";else return l.Pass}else if(ge&&(oe.length===0||/\s/.test(oe)||ae.indexOf(oe)>-1))b="both";else return l.Pass;if(!ke)ke=b;else if(ke!=b)return l.Pass}var le=U%2?B.charAt(U-1):I,Pe=U%2?I:B.charAt(U+1);D.operation(function(){if(ke=="skip")L(D,1);else if(ke=="skipThree")L(D,3);else if(ke=="surround"){for(var Ae=D.getSelections(),Fe=0;Fe=I.max))return I.ch=0,I.text=I.cm.getLine(++I.line),!0}function E(I){if(!(I.line<=I.min))return I.text=I.cm.getLine(--I.line),I.ch=I.text.length,!0}function L(I){for(;;){var M=I.text.indexOf(">",I.ch);if(M==-1){if(y(I))continue;return}if(!C(I,M+1)){I.ch=M+1;continue}var B=I.text.lastIndexOf("/",M),U=B>-1&&!/\S/.test(I.text.slice(B+1,M));return I.ch=M+1,U?"selfClose":"regular"}}function T(I){for(;;){var M=I.ch?I.text.lastIndexOf("<",I.ch-1):-1;if(M==-1){if(E(I))continue;return}if(!C(I,M+1)){I.ch=M;continue}S.lastIndex=M,I.ch=M;var B=S.exec(I.text);if(B&&B.index==M)return B}}function F(I){for(;;){S.lastIndex=I.ch;var M=S.exec(I.text);if(!M){if(y(I))continue;return}if(!C(I,M.index+1)){I.ch=M.index+1;continue}return I.ch=M.index+M[0].length,M}}function R(I){for(;;){var M=I.ch?I.text.lastIndexOf(">",I.ch-1):-1;if(M==-1){if(E(I))continue;return}if(!C(I,M+1)){I.ch=M;continue}var B=I.text.lastIndexOf("/",M),U=B>-1&&!/\S/.test(I.text.slice(B+1,M));return I.ch=M+1,U?"selfClose":"regular"}}function W(I,M){for(var B=[];;){var U=F(I),ae,ue=I.line,te=I.ch-(U?U[0].length:0);if(!U||!(ae=L(I)))return;if(ae!="selfClose")if(U[1]){for(var ye=B.length-1;ye>=0;--ye)if(B[ye]==U[2]){B.length=ye;break}if(ye<0&&(!M||M==U[2]))return{tag:U[2],from:c(ue,te),to:c(I.line,I.ch)}}else B.push(U[2])}}function D(I,M){for(var B=[];;){var U=R(I);if(!U)return;if(U=="selfClose"){T(I);continue}var ae=I.line,ue=I.ch,te=T(I);if(!te)return;if(te[1])B.push(te[2]);else{for(var ye=B.length-1;ye>=0;--ye)if(B[ye]==te[2]){B.length=ye;break}if(ye<0&&(!M||M==te[2]))return{tag:te[2],from:c(I.line,I.ch),to:c(ae,ue)}}}}l.registerHelper("fold","xml",function(I,M){for(var B=new w(I,M.line,0);;){var U=F(B);if(!U||B.line!=M.line)return;var ae=L(B);if(!ae)return;if(!U[1]&&ae!="selfClose"){var ue=c(B.line,B.ch),te=W(B,U[2]);return te&&p(te.from,ue)>0?{from:ue,to:te.from}:null}}}),l.findMatchingTag=function(I,M,B){var U=new w(I,M.line,M.ch,B);if(!(U.text.indexOf(">")==-1&&U.text.indexOf("<")==-1)){var ae=L(U),ue=ae&&c(U.line,U.ch),te=ae&&T(U);if(!(!ae||!te||p(U,M)>0)){var ye={from:c(U.line,U.ch),to:ue,tag:te[2]};return ae=="selfClose"?{open:ye,close:null,at:"open"}:te[1]?{open:D(U,te[2]),close:ye,at:"close"}:(U=new w(I,ue.line,ue.ch,B),{open:ye,close:W(U,te[2]),at:"open"})}}},l.findEnclosingTag=function(I,M,B,U){for(var ae=new w(I,M.line,M.ch,B);;){var ue=D(ae,U);if(!ue)break;var te=new w(I,M.line,M.ch,B),ye=W(te,ue.tag);if(ye)return{open:ue,close:ye}}},l.scanForClosingTag=function(I,M,B,U){var ae=new w(I,M.line,M.ch,U?{from:0,to:U}:null);return W(ae,B)}})}()),ac}(function(n,o){(function(l){l(wn(),am())})(function(l){l.defineOption("autoCloseTags",!1,function(y,E,L){if(L!=l.Init&&L&&y.removeKeyMap("autoCloseTags"),!!E){var T={name:"autoCloseTags"};(typeof E!="object"||E.whenClosing!==!1)&&(T["'/'"]=function(F){return S(F)}),(typeof E!="object"||E.whenOpening!==!1)&&(T["'>'"]=function(F){return g(F)}),y.addKeyMap(T)}});var c=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],p=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function g(y){if(y.getOption("disableInput"))return l.Pass;for(var E=y.listSelections(),L=[],T=y.getOption("autoCloseTags"),F=0;FR.ch&&(B=B.slice(0,B.length-W.end+R.ch));var te=B.toLowerCase();if(!B||W.type=="string"&&(W.end!=R.ch||!/[\"\']/.test(W.string.charAt(W.string.length-1))||W.string.length==1)||W.type=="tag"&&M.close||W.string.indexOf("/")==R.ch-W.start-1||ae&&w(ae,te)>-1||C(y,D.mode.xmlCurrentContext&&D.mode.xmlCurrentContext(I)||[],B,R,!0))return l.Pass;var ye=typeof T=="object"&&T.emptyTags;if(ye&&w(ye,B)>-1){L[F]={text:"/>",newPos:l.Pos(R.line,R.ch+2)};continue}var ge=ue&&w(ue,te)>-1;L[F]={indent:ge,text:">"+(ge?` `:"")+"",newPos:ge?l.Pos(R.line+1,0):l.Pos(R.line,R.ch+1)}}for(var ke=typeof T=="object"&&T.dontIndentOnAutoClose,F=E.length-1;F>=0;F--){var Te=L[F];y.replaceRange(Te.text,E[F].head,E[F].anchor,"+insert");var G=y.listSelections().slice(0);G[F]={head:Te.newPos,anchor:Te.newPos},y.setSelections(G),!ke&&Te.indent&&(y.indentLine(Te.newPos.line,null,!0),y.indentLine(Te.newPos.line+1,null,!0))}}function _(y,E){for(var L=y.listSelections(),T=[],F=E?"/":""&&(ae+=">"),T[D]=ae}if(y.replaceSelections(T),L=y.listSelections(),!W)for(var D=0;D=0&&E[I]==L;I--)++D;T=W.to;for(var I=1;I=0;R--){var W=T[R].from(),D=T[R].to();W.line>=L||(D.line>=L&&(D=g(L,0)),L=W.line,F==null?E.uncomment(W,D,y)?F="un":(E.lineComment(W,D,y),F="line"):F=="un"?E.uncomment(W,D,y):E.lineComment(W,D,y))}});function w(y,E,L){return/\bstring\b/.test(y.getTokenTypeAt(g(E.line,0)))&&!/^[\'\"\`]/.test(L)}function C(y,E){var L=y.getMode();return L.useInnerComments===!1||!L.innerMode?L:y.getModeAt(E)}l.defineExtension("lineComment",function(y,E,L){L||(L=c);var T=this,F=C(T,y),R=T.getLine(y.line);if(!(R==null||w(T,y,R))){var W=L.lineComment||F.lineComment;if(!W){(L.blockCommentStart||F.blockCommentStart)&&(L.fullLines=!0,T.blockComment(y,E,L));return}var D=Math.min(E.ch!=0||E.line==y.line?E.line+1:E.line,T.lastLine()+1),I=L.padding==null?" ":L.padding,M=L.commentBlankLines||y.line==E.line;T.operation(function(){if(L.indent){for(var B=null,U=y.line;Uue.length)&&(B=ue)}for(var U=y.line;UD||T.operation(function(){if(L.fullLines!=!1){var M=p.test(T.getLine(D));T.replaceRange(I+W,g(D)),T.replaceRange(R+I,g(y.line,0));var B=L.blockCommentLead||F.blockCommentLead;if(B!=null)for(var U=y.line+1;U<=D;++U)(U!=D||M)&&T.replaceRange(B+I,g(U,0))}else{var ae=_(T.getCursor("to"),E)==0,ue=!T.somethingSelected();T.replaceRange(W,E),ae&&T.setSelection(ue?E:T.getCursor("from"),E),T.replaceRange(R,y)}})}}),l.defineExtension("uncomment",function(y,E,L){L||(L=c);var T=this,F=C(T,y),R=Math.min(E.ch!=0||E.line==y.line?E.line:E.line-1,T.lastLine()),W=Math.min(y.line,R),D=L.lineComment||F.lineComment,I=[],M=L.padding==null?" ":L.padding,B;e:{if(!D)break e;for(var U=W;U<=R;++U){var ae=T.getLine(U),ue=ae.indexOf(D);if(ue>-1&&!/comment/.test(T.getTokenTypeAt(g(U,ue+1)))&&(ue=-1),ue==-1&&p.test(ae)||ue>-1&&p.test(ae.slice(0,ue)))break e;I.push(ae)}if(T.operation(function(){for(var Ae=W;Ae<=R;++Ae){var Fe=I[Ae-W],Ze=Fe.indexOf(D),He=Ze+D.length;Ze<0||(Fe.slice(He,He+M.length)==M&&(He+=M.length),B=!0,T.replaceRange("",g(Ae,Ze),g(Ae,He)))}}),B)return!0}var te=L.blockCommentStart||F.blockCommentStart,ye=L.blockCommentEnd||F.blockCommentEnd;if(!te||!ye)return!1;var ge=L.blockCommentLead||F.blockCommentLead,ke=T.getLine(W),Te=ke.indexOf(te);if(Te==-1)return!1;var G=R==W?ke:T.getLine(R),K=G.indexOf(ye,R==W?Te+te.length:0),b=g(W,Te+1),oe=g(R,K+1);if(K==-1||!/comment/.test(T.getTokenTypeAt(b))||!/comment/.test(T.getTokenTypeAt(oe))||T.getRange(b,oe,` `).indexOf(ye)>-1)return!1;var Z=ke.lastIndexOf(te,y.ch),le=Z==-1?-1:ke.slice(0,y.ch).indexOf(ye,Z+te.length);if(Z!=-1&&le!=-1&&le+ye.length!=y.ch)return!1;le=G.indexOf(ye,E.ch);var Pe=G.slice(E.ch).lastIndexOf(te,le-E.ch);return Z=le==-1||Pe==-1?-1:E.ch+Pe,le!=-1&&Z!=-1&&Z!=E.ch?!1:(T.operation(function(){T.replaceRange("",g(R,K-(M&&G.slice(K-M.length,K)==M?M.length:0)),g(R,K+ye.length));var Ae=Te+te.length;if(M&&ke.slice(Ae,Ae+M.length)==M&&(Ae+=M.length),T.replaceRange("",g(W,Te),g(W,Ae)),ge)for(var Fe=W+1;Fe<=R;++Fe){var Ze=T.getLine(Fe),He=Ze.indexOf(ge);if(!(He==-1||p.test(Ze.slice(0,He)))){var qe=He+ge.length;M&&Ze.slice(qe,qe+M.length)==M&&(qe+=M.length),T.replaceRange("",g(Fe,He),g(Fe,qe))}}}),!0)})})})();var lm={};(function(n,o){(function(l){l(wn())})(function(l){function c(S,w,C,y){if(C&&C.call){var E=C;C=null}else var E=_(S,C,"rangeFinder");typeof w=="number"&&(w=l.Pos(w,0));var L=_(S,C,"minFoldSize");function T(D){var I=E(S,w);if(!I||I.to.line-I.from.lineS.firstLine();)w=l.Pos(w.line-1,0),F=T(!1);if(!(!F||F.cleared||y==="unfold")){var R=p(S,C,F);l.on(R,"mousedown",function(D){W.clear(),l.e_preventDefault(D)});var W=S.markText(F.from,F.to,{replacedWith:R,clearOnEnter:_(S,C,"clearOnEnter"),__isFold:!0});W.on("clear",function(D,I){l.signal(S,"unfold",S,D,I)}),l.signal(S,"fold",S,F.from,F.to)}}function p(S,w,C){var y=_(S,w,"widget");if(typeof y=="function"&&(y=y(C.from,C.to)),typeof y=="string"){var E=document.createTextNode(y);y=document.createElement("span"),y.appendChild(E),y.className="CodeMirror-foldmarker"}else y&&(y=y.cloneNode(!0));return y}l.newFoldFunction=function(S,w){return function(C,y){c(C,y,{rangeFinder:S,widget:w})}},l.defineExtension("foldCode",function(S,w,C){c(this,S,w,C)}),l.defineExtension("isFolded",function(S){for(var w=this.findMarksAt(S),C=0;C=B){if(ue&&ge&&ue.test(ge.className))return;ye=S(I.indicatorOpen)}}!ye&&!ge||R.setGutterMarker(te,I.gutter,ye)})}function C(R){return new RegExp("(^|\\s)"+R+"(?:$|\\s)\\s*")}function y(R){var W=R.getViewport(),D=R.state.foldGutter;D&&(R.operation(function(){w(R,W.from,W.to)}),D.from=W.from,D.to=W.to)}function E(R,W,D){var I=R.state.foldGutter;if(I){var M=I.options;if(D==M.gutter){var B=_(R,W);B?B.clear():R.foldCode(c(W,0),M)}}}function L(R){var W=R.state.foldGutter;if(W){var D=W.options;W.from=W.to=0,clearTimeout(W.changeUpdate),W.changeUpdate=setTimeout(function(){y(R)},D.foldOnChangeTimeSpan||600)}}function T(R){var W=R.state.foldGutter;if(W){var D=W.options;clearTimeout(W.changeUpdate),W.changeUpdate=setTimeout(function(){var I=R.getViewport();W.from==W.to||I.from-W.to>20||W.from-I.to>20?y(R):R.operation(function(){I.fromW.to&&(w(R,W.to,I.to),W.to=I.to)})},D.updateViewportTimeSpan||400)}}function F(R,W){var D=R.state.foldGutter;if(D){var I=W.line;I>=D.from&&Ip.lastLine())return null;var T=p.getTokenAt(l.Pos(L,1));if(/\S/.test(T.string)||(T=p.getTokenAt(l.Pos(L,T.end+1))),T.type!="keyword"||T.string!="import")return null;for(var F=L,R=Math.min(p.lastLine(),L+10);F<=R;++F){var W=p.getLine(F),D=W.indexOf(";");if(D!=-1)return{startCh:T.end,end:l.Pos(F,D)}}}var S=g.line,w=_(S),C;if(!w||_(S-1)||(C=_(S-2))&&C.end.line==S-1)return null;for(var y=w.end;;){var E=_(y.line+1);if(E==null)break;y=E.end}return{from:p.clipPos(l.Pos(S,w.startCh+1)),to:y}}),l.registerHelper("fold","include",function(p,g){function _(E){if(Ep.lastLine())return null;var L=p.getTokenAt(l.Pos(E,1));if(/\S/.test(L.string)||(L=p.getTokenAt(l.Pos(E,L.end+1))),L.type=="meta"&&L.string.slice(0,8)=="#include")return L.start+8}var S=g.line,w=_(S);if(w==null||_(S-1)!=null)return null;for(var C=S;;){var y=_(C+1);if(y==null)break;++C}return{from:l.Pos(S,w+1),to:p.clipPos(l.Pos(C))}})})})();(function(n,o){(function(l){l(wn())})(function(l){function c(p,g){var _=p.getLine(g),S=_.search(/\S/);return S==-1||/\bcomment\b/.test(p.getTokenTypeAt(l.Pos(g,S+1)))?-1:l.countColumn(_,null,p.getOption("tabSize"))}l.registerHelper("fold","indent",function(p,g){var _=c(p,g.line);if(!(_<0)){for(var S=null,w=g.line+1,C=p.lastLine();w<=C;++w){var y=c(p,w);if(y!=-1)if(y>_)S=w;else break}if(S)return{from:l.Pos(g.line,p.getLine(g.line).length),to:l.Pos(S,p.getLine(S).length)}}})})})();(function(n,o){(function(l){l(wn())})(function(l){l.registerGlobalHelper("fold","comment",function(c){return c.blockCommentStart&&c.blockCommentEnd},function(c,p){var g=c.getModeAt(p),_=g.blockCommentStart,S=g.blockCommentEnd;if(!_||!S)return;for(var w=p.line,C=c.getLine(w),y,E=p.ch,L=0;;){var T=E<=0?-1:C.lastIndexOf(_,E-1);if(T==-1){if(L==1)return;L=1,E=C.length;continue}if(L==1&&T{const g={autoCloseBrackets:!0,autoCloseTags:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]},_=im(c.value,{value:"",mode:l.mode,readOnly:l.readonly,tabSize:2,lineWrapping:!0,lineNumbers:!0,...g});_.on("change",()=>{o("change",_.getValue())}),So(()=>{const S=_.getValue();l.value!==S&&_.setValue(l.value)}),So(()=>{_.setOption("mode",l.mode)}),setTimeout(()=>{_.refresh()},50),p&&window.addEventListener("resize",Uc(()=>{_.refresh()}))}),(g,_)=>(qt(),pn("div",{class:"editor",ref_key:"el",ref:c},null,512))}}),um=Gr({__name:"Message",props:["err","warn"],setup(n){const o=n,l=zn(!1);Ya(()=>[o.err,o.warn],()=>{l.value=!1});function c(p){if(typeof p=="string")return p;{let g=p.message;const _=p.loc;return _&&_.start&&(g=`(${_.start.line}:${_.start.column}) `+g),g}}return(p,g)=>(qt(),gl(gd,{name:"fade"},{default:Ja(()=>[!l.value&&(n.err||n.warn)?(qt(),pn("div",{key:0,class:qi(["msg",n.err?"err":"warn"])},[Ft("pre",null,Mo(c(n.err||n.warn)),1),Ft("button",{class:"dismiss",onClick:g[0]||(g[0]=_=>l.value=!0)},"✕")],2)):Hi("",!0)]),_:1}))}}),il=pi(um,[["__scopeId","data-v-92411507"]]),cm={class:"editor-container"},fm=Gr({__name:"Editor",setup(n){const o=$r("store"),l=Uc(p=>{o.state.activeFile.code=p},250),c=As(()=>{const{filename:p}=o.state.activeFile;return p.endsWith(".vue")||p.endsWith(".html")?"htmlmixed":p.endsWith(".css")?"css":"javascript"});return(p,g)=>(qt(),pn(Is,null,[Wr(Dd),Ft("div",cm,[Wr(Kc,{onChange:Mt(l),value:Mt(o).state.activeFile.code,mode:Mt(c)},null,8,["onChange","value","mode"]),Wr(il,{err:Mt(o).state.errors[0]},null,8,["err"])])],64))}}),hm=pi(fm,[["__scopeId","data-v-0384e940"]]),pm=`