You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
224 KiB
25 lines
224 KiB
import{dB as hu,dp as du}from"./index-f4658ae7.js";var hl={exports:{}};(function(Qr,Wn){(function(H,ze){Qr.exports=ze()})(du,function(){var H=navigator.userAgent,ze=navigator.platform,ve=/gecko\/\d/i.test(H),Je=/MSIE \d/.test(H),pt=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(H),Ie=/Edge\/(\d+)/.exec(H),z=Je||pt||Ie,te=z&&(Je?document.documentMode||6:+(Ie||pt)[1]),U=!Ie&&/WebKit\//.test(H),re=U&&/Qt\/\d+\.\d+/.test(H),R=!Ie&&/Chrome\/(\d+)/.exec(H),le=R&&+R[1],ne=/Opera\//.test(H),Ne=/Apple Computer/.test(navigator.vendor),Ae=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(H),Be=/PhantomJS/.test(H),$=Ne&&(/Mobile\/\w+/.test(H)||navigator.maxTouchPoints>2),Z=/Android/.test(H),ie=$||Z||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(H),pe=$||/Mac/.test(ze),Ge=/\bCrOS\b/.test(H),lt=/win/i.test(ze),Re=ne&&H.match(/Version\/(\d*\.\d*)/);Re&&(Re=Number(Re[1])),Re&&Re>=15&&(ne=!1,U=!0);var Ke=pe&&(re||ne&&(Re==null||Re<12.11)),Y=ve||z&&te>=9;function _(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ke=function(e,t){var n=e.className,r=_(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function k(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function P(e,t){return k(e).appendChild(t)}function c(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function D(e,t,n,r){var i=c(e,t,n,r);return i.setAttribute("role","presentation"),i}var L;document.createRange?L=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:L=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function K(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function ue(e){var t;try{t=e.activeElement}catch(n){t=e.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function De(e,t){var n=e.className;_(t).test(n)||(e.className+=(n?" ":"")+t)}function Mt(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!_(n[r]).test(t)&&(t+=" "+n[r]);return t}var Gt=function(e){e.select()};$?Gt=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:z&&(Gt=function(e){try{e.select()}catch(t){}});function Oe(e){return e.display.wrapper.ownerDocument}function kt(e){return Oe(e).defaultView}function We(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function G(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function F(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=r||0,a=i||0;;){var l=e.indexOf(" ",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}}var Q=function(){this.id=null,this.f=null,this.time=0,this.handler=We(this.onTimeout,this)};Q.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Q.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function ee(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var oe=50,j={toString:function(){return"CodeMirror.Pass"}},xe={scroll:!1},Pt={origin:"*mouse"},zt={origin:"+move"};function bt(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);o==-1&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var ce=[""];function He(e){for(;ce.length<=e;)ce.push(J(ce)+" ");return ce[e]}function J(e){return e[e.length-1]}function vt(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function pr(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function ye(){}function y(e,t){var n;return Object.create?n=Object.create(e):(ye.prototype=e,n=new ye),t&&G(t,n),n}var T=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function w(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||T.test(e))}function ae(e,t){return t?t.source.indexOf("\\w")>-1&&w(e)?!0:t.test(e):w(e)}function rt(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Mr=/[\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 Jr(e){return e.charCodeAt(0)>=768&&Mr.test(e)}function Ht(e,t,n){for(;(n<0?t>0:t<e.length)&&Jr(e.charAt(t));)t+=n;return t}function Ce(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function vr(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),a.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var Et=null;function St(e,t,n){var r;Et=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:Et=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:Et=i)}return r!=null?r:Et}var vi=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,l=/[1n]/;function s(u,h,d){this.level=u,this.from=h,this.to=d}return function(u,h){var d=h=="ltr"?"L":"R";if(u.length==0||h=="ltr"&&!r.test(u))return!1;for(var m=u.length,g=[],x=0;x<m;++x)g.push(n(u.charCodeAt(x)));for(var S=0,C=d;S<m;++S){var M=g[S];M=="m"?g[S]=C:C=M}for(var O=0,N=d;O<m;++O){var W=g[O];W=="1"&&N=="r"?g[O]="n":o.test(W)&&(N=W,W=="r"&&(g[O]="R"))}for(var B=1,I=g[0];B<m-1;++B){var V=g[B];V=="+"&&I=="1"&&g[B+1]=="1"?g[B]="1":V==","&&I==g[B+1]&&(I=="1"||I=="n")&&(g[B]=I),I=V}for(var me=0;me<m;++me){var je=g[me];if(je==",")g[me]="N";else if(je=="%"){var Se=void 0;for(Se=me+1;Se<m&&g[Se]=="%";++Se);for(var yt=me&&g[me-1]=="!"||Se<m&&g[Se]=="1"?"1":"N",ct=me;ct<Se;++ct)g[ct]=yt;me=Se-1}}for(var Ee=0,ht=d;Ee<m;++Ee){var Qe=g[Ee];ht=="L"&&Qe=="1"?g[Ee]="L":o.test(Qe)&&(ht=Qe)}for(var Ue=0;Ue<m;++Ue)if(i.test(g[Ue])){var Fe=void 0;for(Fe=Ue+1;Fe<m&&i.test(g[Fe]);++Fe);for(var Me=(Ue?g[Ue-1]:d)=="L",dt=(Fe<m?g[Fe]:d)=="L",jr=Me==dt?Me?"L":"R":d,dr=Ue;dr<Fe;++dr)g[dr]=jr;Ue=Fe-1}for(var tt=[],Ut,Ze=0;Ze<m;)if(a.test(g[Ze])){var uo=Ze;for(++Ze;Ze<m&&a.test(g[Ze]);++Ze);tt.push(new s(0,uo,Ze))}else{var er=Ze,Lr=tt.length,Tr=h=="rtl"?1:0;for(++Ze;Ze<m&&g[Ze]!="L";++Ze);for(var at=er;at<Ze;)if(l.test(g[at])){er<at&&(tt.splice(Lr,0,new s(1,er,at)),Lr+=Tr);var Zr=at;for(++at;at<Ze&&l.test(g[at]);++at);tt.splice(Lr,0,new s(2,Zr,at)),Lr+=Tr,er=at}else++at;er<Ze&&tt.splice(Lr,0,new s(1,er,Ze))}return h=="ltr"&&(tt[0].level==1&&(Ut=u.match(/^\s+/))&&(tt[0].from=Ut[0].length,tt.unshift(new s(0,0,Ut[0].length))),J(tt).level==1&&(Ut=u.match(/\s+$/))&&(J(tt).to-=Ut[0].length,tt.push(new s(0,m-Ut[0].length,m)))),h=="rtl"?tt.reverse():tt}}();function Ct(e,t){var n=e.order;return n==null&&(n=e.order=vi(e.text,t)),n}var Pn=[],A=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Pn).concat(n)}};function Vr(e,t){return e._handlers&&e._handlers[t]||Pn}function Ve(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=ee(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function be(e,t){var n=Vr(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Le(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),be(e,n||t.type,e,t),$r(t)||t.codemirrorIgnore}function zn(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)ee(n,t[r])==-1&&n.push(t[r])}function nt(e,t){return Vr(e,t).length>0}function it(e){e.prototype.on=function(t,n){A(this,t,n)},e.prototype.off=function(t,n){Ve(this,t,n)}}function $e(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function gr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function $r(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function qt(e){$e(e),gr(e)}function st(e){return e.target||e.srcElement}function en(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),pe&&e.ctrlKey&&t==1&&(t=3),t}var gi=function(){if(z&&te<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),Lt;function mi(e){if(Lt==null){var t=c("span","\u200B");P(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Lt=t.offsetWidth<=1&&t.offsetHeight>2&&!(z&&te<8))}var n=Lt?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var Nr;function Hn(e){if(Nr!=null)return Nr;var t=P(e,document.createTextNode("A\u062EA")),n=L(t,0,1).getBoundingClientRect(),r=L(t,1,2).getBoundingClientRect();return k(e),!n||n.left==n.right?!1:Nr=r.right-n.right<3}var tn=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
|
|
`,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),a=o.indexOf("\r");a!=-1?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},tr=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ft=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),It=null;function En(e){if(It!=null)return It;var t=P(e,c("span","x")),n=t.getBoundingClientRect(),r=L(t,0,1).getBoundingClientRect();return It=Math.abs(n.left-r.left)>1}var Nt={},rr={};function Fn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Nt[e]=t}function Ar(e,t){rr[e]=t}function gt(e){if(typeof e=="string"&&rr.hasOwnProperty(e))e=rr[e];else if(e&&typeof e.name=="string"&&rr.hasOwnProperty(e.name)){var t=rr[e.name];typeof t=="string"&&(t={name:t}),e=y(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return gt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return gt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Xt(e,t){t=gt(t);var n=Nt[t.name];if(!n)return Xt(e,"text/plain");var r=n(e,t);if(nr.hasOwnProperty(t.name)){var i=nr[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var nr={};function In(e,t){var n=nr.hasOwnProperty(e)?nr[e]:nr[e]={};G(t,n)}function Yt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function ir(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function rn(e,t,n){return e.startState?e.startState(t,n):!0}var Te=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Te.prototype.eol=function(){return this.pos>=this.string.length},Te.prototype.sol=function(){return this.pos==this.lineStart},Te.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Te.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Te.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},Te.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Te.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Te.prototype.skipToEnd=function(){this.pos=this.string.length},Te.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Te.prototype.backUp=function(e){this.pos-=e},Te.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=F(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Te.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Te.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(a){return n?a.toLowerCase():a},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var o=this.string.slice(this.pos).match(e);return o&&o.index>0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},Te.prototype.current=function(){return this.string.slice(this.start,this.pos)},Te.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Te.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Te.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function E(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 n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function jt(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(o){var a=o.text;i==n.line&&(a=a.slice(0,n.ch)),i==t.line&&(a=a.slice(t.ch)),r.push(a),++i}),r}function Dr(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function Tt(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function he(e){if(e.parent==null)return null;for(var t=e.parent,n=ee(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function Bt(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var l=e.lines[a],s=l.height;if(t<s)break;t-=s}return n+a}function f(e,t){return t>=e.first&&t<e.first+e.size}function p(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function v(e,t,n){if(n===void 0&&(n=null),!(this instanceof v))return new v(e,t,n);this.line=e,this.ch=t,this.sticky=n}function b(e,t){return e.line-t.line||e.ch-t.ch}function q(e,t){return e.sticky==t.sticky&&b(e,t)==0}function se(e){return v(e.line,e.ch)}function fe(e,t){return b(e,t)<0?t:e}function _e(e,t){return b(e,t)<0?e:t}function xt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function X(e,t){if(t.line<e.first)return v(e.first,0);var n=e.first+e.size-1;return t.line>n?v(n,E(e,n).text.length):dl(t,E(e,t.line).text.length)}function dl(e,t){var n=e.ch;return n==null||n>t?v(e.line,t):n<0?v(e.line,0):e}function co(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=X(e,t[r]);return n}var Bn=function(e,t){this.state=e,this.lookAhead=t},Rt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Rt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Rt.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}},Rt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Rt.fromSaved=function(e,t,n){return t instanceof Bn?new Rt(e,Yt(e.mode,t.state),n,t.lookAhead):new Rt(e,Yt(e.mode,t),n)},Rt.prototype.save=function(e){var t=e!==!1?Yt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Bn(t,this.maxLookAhead):t};function ho(e,t,n,r){var i=[e.state.modeGen],o={};bo(e,t.text,e.doc.mode,n,function(u,h){return i.push(u,h)},o,r);for(var a=n.state,l=function(u){n.baseTokens=i;var h=e.state.overlays[u],d=1,m=0;n.state=!0,bo(e,t.text,h.mode,n,function(g,x){for(var S=d;m<g;){var C=i[d];C>g&&i.splice(d,1,g,i[d+1],C),d+=2,m=Math.min(g,C)}if(x)if(h.opaque)i.splice(S,d-S,g,"overlay "+x),d=S+2;else for(;S<d;S+=2){var M=i[S+1];i[S+1]=(M?M+" ":"")+"overlay "+x}},o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)l(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function po(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=nn(e,he(t)),i=t.text.length>e.options.maxHighlightLength&&Yt(e.doc.mode,r.state),o=ho(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function nn(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Rt(r,!0,t);var o=pl(e,t,n),a=o>r.first&&E(r,o-1).stateAfter,l=a?Rt.fromSaved(r,a,o):new Rt(r,rn(r.mode),o);return r.iter(o,t,function(s){yi(e,s.text,l);var u=l.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&u<i.viewTo?l.save():null,l.nextLine()}),n&&(r.modeFrontier=l.line),l}function yi(e,t,n,r){var i=e.doc.mode,o=new Te(t,e.options.tabSize,n);for(o.start=o.pos=r||0,t==""&&vo(i,n.state);!o.eol();)bi(i,o,n.state),o.start=o.pos}function vo(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=ir(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function bi(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=ir(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var go=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function mo(e,t,n,r){var i=e.doc,o=i.mode,a;t=X(i,t);var l=E(i,t.line),s=nn(e,t.line,n),u=new Te(l.text,e.options.tabSize,s),h;for(r&&(h=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,a=bi(o,u,s.state),r&&h.push(new go(u,a,Yt(i.mode,s.state)));return r?h:new go(u,a,s.state)}function yo(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function bo(e,t,n,r,i,o,a){var l=n.flattenSpans;l==null&&(l=e.options.flattenSpans);var s=0,u=null,h=new Te(t,e.options.tabSize,r),d,m=e.options.addModeClass&&[null];for(t==""&&yo(vo(n,r.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(l=!1,a&&yi(e,t,r,h.pos),h.pos=t.length,d=null):d=yo(bi(n,h,r.state,m),o),m){var g=m[0].name;g&&(d="m-"+(d?g+" "+d:g))}if(!l||u!=d){for(;s<h.start;)s=Math.min(h.start,s+5e3),i(s,u);u=d}h.start=h.pos}for(;s<h.pos;){var x=Math.min(h.pos,s+5e3);i(x,u),s=x}}function pl(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=E(o,l-1),u=s.stateAfter;if(u&&(!n||l+(u instanceof Bn?u.lookAhead:0)<=o.modeFrontier))return l;var h=F(s.text,null,e.options.tabSize);(i==null||r>h)&&(i=l-1,r=h)}return i}function vl(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=E(e,r).stateAfter;if(i&&(!(i instanceof Bn)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var xo=!1,Zt=!1;function gl(){xo=!0}function ml(){Zt=!0}function Rn(e,t,n){this.marker=e,this.from=t,this.to=n}function on(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function yl(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function bl(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function xl(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=o.from==null||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&a.type=="bookmark"&&(!n||!o.marker.insertLeft)){var s=o.to==null||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Rn(a,o.from,s?null:o.to))}}return r}function wl(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=o.to==null||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&a.type=="bookmark"&&(!n||o.marker.insertLeft)){var s=o.from==null||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Rn(a,s?null:o.from-t,o.to==null?null:o.to-t))}}return r}function xi(e,t){if(t.full)return null;var n=f(e,t.from.line)&&E(e,t.from.line).markedSpans,r=f(e,t.to.line)&&E(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=b(t.from,t.to)==0,l=xl(n,i,a),s=wl(r,o,a),u=t.text.length==1,h=J(t.text).length+(u?i:0);if(l)for(var d=0;d<l.length;++d){var m=l[d];if(m.to==null){var g=on(s,m.marker);g?u&&(m.to=g.to==null?null:g.to+h):m.to=i}}if(s)for(var x=0;x<s.length;++x){var S=s[x];if(S.to!=null&&(S.to+=h),S.from==null){var C=on(l,S.marker);C||(S.from=h,u&&(l||(l=[])).push(S))}else S.from+=h,u&&(l||(l=[])).push(S)}l&&(l=wo(l)),s&&s!=l&&(s=wo(s));var M=[l];if(!u){var O=t.text.length-2,N;if(O>0&&l)for(var W=0;W<l.length;++W)l[W].to==null&&(N||(N=[])).push(new Rn(l[W].marker,null,null));for(var B=0;B<O;++B)M.push(N);M.push(s)}return M}function wo(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function kl(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(g){if(g.markedSpans)for(var x=0;x<g.markedSpans.length;++x){var S=g.markedSpans[x].marker;S.readOnly&&(!r||ee(r,S)==-1)&&(r||(r=[])).push(S)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],l=a.find(0),s=0;s<i.length;++s){var u=i[s];if(!(b(u.to,l.from)<0||b(u.from,l.to)>0)){var h=[s,1],d=b(u.from,l.from),m=b(u.to,l.to);(d<0||!a.inclusiveLeft&&!d)&&h.push({from:u.from,to:l.from}),(m>0||!a.inclusiveRight&&!m)&&h.push({from:l.to,to:u.to}),i.splice.apply(i,h),s+=h.length-3}}return i}function ko(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function So(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Kn(e){return e.inclusiveLeft?-1:0}function _n(e){return e.inclusiveRight?1:0}function wi(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),o=b(r.from,i.from)||Kn(e)-Kn(t);if(o)return-o;var a=b(r.to,i.to)||_n(e)-_n(t);return a||t.id-e.id}function Co(e,t){var n=Zt&&e.markedSpans,r;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||wi(r,i.marker)<0)&&(r=i.marker);return r}function Lo(e){return Co(e,!0)}function Un(e){return Co(e,!1)}function Sl(e,t){var n=Zt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!r||wi(r,o.marker)<0)&&(r=o.marker)}return r}function To(e,t,n,r,i){var o=E(e,t),a=Zt&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var u=s.marker.find(0),h=b(u.from,n)||Kn(s.marker)-Kn(i),d=b(u.to,r)||_n(s.marker)-_n(i);if(!(h>=0&&d<=0||h<=0&&d>=0)&&(h<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?b(u.to,n)>=0:b(u.to,n)>0)||h>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?b(u.from,r)<=0:b(u.from,r)<0)))return!0}}}function At(e){for(var t;t=Lo(e);)e=t.find(-1,!0).line;return e}function Cl(e){for(var t;t=Un(e);)e=t.find(1,!0).line;return e}function Ll(e){for(var t,n;t=Un(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function ki(e,t){var n=E(e,t),r=At(n);return n==r?t:he(r)}function Mo(e,t){if(t>e.lastLine())return t;var n=E(e,t),r;if(!or(e,n))return t;for(;r=Un(n);)n=r.find(1,!0).line;return he(n)+1}function or(e,t){var n=Zt&&t.markedSpans;if(n){for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&Si(e,t,r))return!0}}}function Si(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return Si(e,r.line,on(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Si(e,t,i))return!0}function Qt(e){e=At(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==n)break;t+=l.height}return t}function Gn(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=Lo(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=Un(r);){var o=n.find(0,!0);t-=r.text.length-o.from.ch,r=o.to.line,t+=r.text.length-o.to.ch}return t}function Ci(e){var t=e.display,n=e.doc;t.maxLine=E(n,n.first),t.maxLineLength=Gn(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=Gn(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Or=function(e,t,n){this.text=e,So(this,t),this.height=n?n(this):1};Or.prototype.lineNo=function(){return he(this)},it(Or);function Tl(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),ko(e),So(e,n);var i=r?r(e):1;i!=e.height&&Tt(e,i)}function Ml(e){e.parent=null,ko(e)}var Nl={},Al={};function No(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Al:Nl;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Ao(e,t){var n=D("span",null,null,U?"padding-right: .1px":null),r={pre:D("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=Ol,Hn(e.display.measure)&&(a=Ct(o,e.doc.direction))&&(r.addToken=Pl(r.addToken,a)),r.map=[];var l=t!=e.display.externalMeasured&&he(o);zl(o,r,po(e,o,l)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=Mt(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=Mt(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(mi(e.display.measure))),i==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(U){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return be(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Mt(r.pre.className,r.textClass||"")),r}function Dl(e){var t=c("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ol(e,t,n,r,i,o,a){if(t){var l=e.splitSpaces?Wl(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,h;if(!s.test(t))e.col+=t.length,h=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,h),z&&te<9&&(u=!0),e.pos+=t.length;else{h=document.createDocumentFragment();for(var d=0;;){s.lastIndex=d;var m=s.exec(t),g=m?m.index-d:t.length-d;if(g){var x=document.createTextNode(l.slice(d,d+g));z&&te<9?h.appendChild(c("span",[x])):h.appendChild(x),e.map.push(e.pos,e.pos+g,x),e.col+=g,e.pos+=g}if(!m)break;d+=g+1;var S=void 0;if(m[0]==" "){var C=e.cm.options.tabSize,M=C-e.col%C;S=h.appendChild(c("span",He(M),"cm-tab")),S.setAttribute("role","presentation"),S.setAttribute("cm-text"," "),e.col+=M}else m[0]=="\r"||m[0]==`
|
|
`?(S=h.appendChild(c("span",m[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),S.setAttribute("cm-text",m[0]),e.col+=1):(S=e.cm.options.specialCharPlaceholder(m[0]),S.setAttribute("cm-text",m[0]),z&&te<9?h.appendChild(c("span",[S])):h.appendChild(S),e.col+=1);e.map.push(e.pos,e.pos+1,S),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||u||o||a){var O=n||"";r&&(O+=r),i&&(O+=i);var N=c("span",[h],O,o);if(a)for(var W in a)a.hasOwnProperty(W)&&W!="style"&&W!="class"&&N.setAttribute(W,a[W]);return e.content.appendChild(N)}e.content.appendChild(h)}}function Wl(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);o==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(o="\xA0"),r+=o,n=o==" "}return r}function Pl(e,t){return function(n,r,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,h=u+r.length;;){for(var d=void 0,m=0;m<t.length&&(d=t[m],!(d.to>u&&d.from<=u));m++);if(d.to>=h)return e(n,r,i,o,a,l,s);e(n,r.slice(0,d.to-u),i,o,null,l,s),o=null,r=r.slice(d.to-u),u=d.to}}}function Do(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function zl(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var a=1;a<n.length;a+=2)t.addToken(t,i.slice(o,o=n[a]),No(n[a+1],t.cm.options));return}for(var l=i.length,s=0,u=1,h="",d,m,g=0,x,S,C,M,O;;){if(g==s){x=S=C=m="",O=null,M=null,g=1/0;for(var N=[],W=void 0,B=0;B<r.length;++B){var I=r[B],V=I.marker;if(V.type=="bookmark"&&I.from==s&&V.widgetNode)N.push(V);else if(I.from<=s&&(I.to==null||I.to>s||V.collapsed&&I.to==s&&I.from==s)){if(I.to!=null&&I.to!=s&&g>I.to&&(g=I.to,S=""),V.className&&(x+=" "+V.className),V.css&&(m=(m?m+";":"")+V.css),V.startStyle&&I.from==s&&(C+=" "+V.startStyle),V.endStyle&&I.to==g&&(W||(W=[])).push(V.endStyle,I.to),V.title&&((O||(O={})).title=V.title),V.attributes)for(var me in V.attributes)(O||(O={}))[me]=V.attributes[me];V.collapsed&&(!M||wi(M.marker,V)<0)&&(M=I)}else I.from>s&&g>I.from&&(g=I.from)}if(W)for(var je=0;je<W.length;je+=2)W[je+1]==g&&(S+=" "+W[je]);if(!M||M.from==s)for(var Se=0;Se<N.length;++Se)Do(t,0,N[Se]);if(M&&(M.from||0)==s){if(Do(t,(M.to==null?l+1:M.to)-s,M.marker,M.from==null),M.to==null)return;M.to==s&&(M=!1)}}if(s>=l)break;for(var yt=Math.min(l,g);;){if(h){var ct=s+h.length;if(!M){var Ee=ct>yt?h.slice(0,yt-s):h;t.addToken(t,Ee,d?d+x:x,C,s+Ee.length==g?S:"",m,O)}if(ct>=yt){h=h.slice(yt-s),s=yt;break}s=ct,C=""}h=i.slice(o,o=n[u++]),d=No(n[u++],t.cm.options)}}}function Oo(e,t,n){this.line=t,this.rest=Ll(t),this.size=this.rest?he(J(this.rest))-n+1:1,this.node=this.text=null,this.hidden=or(e,t)}function qn(e,t,n){for(var r=[],i,o=t;o<n;o=i){var a=new Oo(e.doc,E(e.doc,o),o);i=o+a.size,r.push(a)}return r}var Wr=null;function Hl(e){Wr?Wr.ops.push(e):e.ownsGroup=Wr={ops:[e],delayedCallbacks:[]}}function El(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function Fl(e,t){var n=e.ownsGroup;if(n)try{El(n)}finally{Wr=null,t(n)}}var an=null;function qe(e,t){var n=Vr(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;Wr?i=Wr.delayedCallbacks:an?i=an:(i=an=[],setTimeout(Il,0));for(var o=function(l){i.push(function(){return n[l].apply(null,r)})},a=0;a<n.length;++a)o(a)}}function Il(){var e=an;an=null;for(var t=0;t<e.length;++t)e[t]()}function Wo(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];o=="text"?Rl(e,t):o=="gutter"?zo(e,t,n,r):o=="class"?Li(e,t):o=="widget"&&Kl(e,t,r)}t.changes=null}function ln(e){return e.node==e.text&&(e.node=c("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),z&&te<8&&(e.node.style.zIndex=2)),e.node}function Bl(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=ln(t);t.background=r.insertBefore(c("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Po(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Ao(e,t)}function Rl(e,t){var n=t.text.className,r=Po(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Li(e,t)):n&&(t.text.className=n)}function Li(e,t){Bl(e,t),t.line.wrapClass?ln(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function zo(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=ln(t);t.gutterBackground=c("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=ln(t),l=t.gutter=c("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(l.setAttribute("aria-hidden","true"),e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])&&(t.lineNumber=l.appendChild(c("div",p(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,h=o.hasOwnProperty(u)&&o[u];h&&l.appendChild(c("div",[h],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function Kl(e,t,n){t.alignable&&(t.alignable=null);for(var r=_("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);Ho(e,t,n)}function _l(e,t,n,r){var i=Po(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Li(e,t),zo(e,t,n,r),Ho(e,t,r),t.node}function Ho(e,t,n){if(Eo(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Eo(e,t.rest[r],t,n,!1)}function Eo(e,t,n,r,i){if(t.widgets)for(var o=ln(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],u=c("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Ul(s,u,n,r),e.display.input.setUneditable(u),i&&s.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),qe(s,"redraw")}}function Ul(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function sn(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!K(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),P(t.display.measure,c("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Jt(e,t){for(var n=st(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Xn(e){return e.lineSpace.offsetTop}function Ti(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Fo(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=P(e.measure,c("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Kt(e){return oe-e.display.nativeBarWidth}function mr(e){return e.display.scroller.clientWidth-Kt(e)-e.display.barWidth}function Mi(e){return e.display.scroller.clientHeight-Kt(e)-e.display.barHeight}function Gl(e,t,n){var r=e.options.lineWrapping,i=r&&mr(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],u=a[l+1];Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Io(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(he(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function ql(e,t){t=At(t);var n=he(t),r=e.display.externalMeasured=new Oo(e.doc,t,n);r.lineN=n;var i=r.built=Ao(e,r);return r.text=i.pre,P(e.display.lineMeasure,i.pre),r}function Bo(e,t,n,r){return _t(e,Pr(e,t),n,r)}function Ni(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[xr(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Pr(e,t){var n=he(t),r=Ni(e,n);r&&!r.text?r=null:r&&r.changes&&(Wo(e,r,n,Pi(e)),e.curOp.forceUpdate=!0),r||(r=ql(e,t));var i=Io(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function _t(e,t,n,r,i){t.before&&(n=-1);var o=n+(r||""),a;return t.cache.hasOwnProperty(o)?a=t.cache[o]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Gl(e,t.view,t.rect),t.hasHeights=!0),a=Yl(e,t,n,r),a.bogus||(t.cache[o]=a)),{left:a.left,right:a.right,top:i?a.rtop:a.top,bottom:i?a.rbottom:a.bottom}}var Ro={left:0,right:0,top:0,bottom:0};function Ko(e,t,n){for(var r,i,o,a,l,s,u=0;u<e.length;u+=3)if(l=e[u],s=e[u+1],t<l?(i=0,o=1,a="left"):t<s?(i=t-l,o=i+1):(u==e.length-3||t==s&&e[u+3]>t)&&(o=s-l,i=o-1,t>=s&&(a="right")),i!=null){if(r=e[u+2],l==s&&n==(r.insertLeft?"left":"right")&&(a=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],a="left";if(n=="right"&&i==s-l)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function Xl(e,t){var n=Ro;if(t=="left")for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function Yl(e,t,n,r){var i=Ko(t.map,n,r),o=i.node,a=i.start,l=i.end,s=i.collapse,u;if(o.nodeType==3){for(var h=0;h<4;h++){for(;a&&Jr(t.line.text.charAt(i.coverStart+a));)--a;for(;i.coverStart+l<i.coverEnd&&Jr(t.line.text.charAt(i.coverStart+l));)++l;if(z&&te<9&&a==0&&l==i.coverEnd-i.coverStart?u=o.parentNode.getBoundingClientRect():u=Xl(L(o,a,l).getClientRects(),r),u.left||u.right||a==0)break;l=a,a=a-1,s="right"}z&&te<11&&(u=jl(e.display.measure,u))}else{a>0&&(s=r="right");var d;e.options.lineWrapping&&(d=o.getClientRects()).length>1?u=d[r=="right"?d.length-1:0]:u=o.getBoundingClientRect()}if(z&&te<9&&!a&&(!u||!u.left&&!u.right)){var m=o.parentNode.getClientRects()[0];m?u={left:m.left,right:m.left+Hr(e.display),top:m.top,bottom:m.bottom}:u=Ro}for(var g=u.top-t.rect.top,x=u.bottom-t.rect.top,S=(g+x)/2,C=t.view.measure.heights,M=0;M<C.length-1&&!(S<C[M]);M++);var O=M?C[M-1]:0,N=C[M],W={left:(s=="right"?u.right:u.left)-t.rect.left,right:(s=="left"?u.left:u.right)-t.rect.left,top:O,bottom:N};return!u.left&&!u.right&&(W.bogus=!0),e.options.singleCursorHeightPerLine||(W.rtop=g,W.rbottom=x),W}function jl(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!En(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function _o(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Uo(e){e.display.externalMeasure=null,k(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)_o(e.display.view[t])}function un(e){Uo(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Go(e){return R&&Z?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function qo(e){return R&&Z?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function Ai(e){var t=At(e),n=t.widgets,r=0;if(n)for(var i=0;i<n.length;++i)n[i].above&&(r+=sn(n[i]));return r}function Yn(e,t,n,r,i){if(!i){var o=Ai(t);n.top+=o,n.bottom+=o}if(r=="line")return n;r||(r="local");var a=Qt(t);if(r=="local"?a+=Xn(e.display):a-=e.display.viewOffset,r=="page"||r=="window"){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+(r=="window"?0:qo(Oe(e)));var s=l.left+(r=="window"?0:Go(Oe(e)));n.left+=s,n.right+=s}return n.top+=a,n.bottom+=a,n}function Xo(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=Go(Oe(e)),i-=qo(Oe(e));else if(n=="local"||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function jn(e,t,n,r,i){return r||(r=E(e.doc,t.line)),Yn(e,r,Bo(e,r,t.ch,i),n)}function Dt(e,t,n,r,i,o){r=r||E(e.doc,t.line),i||(i=Pr(e,r));function a(x,S){var C=_t(e,i,x,S?"right":"left",o);return S?C.left=C.right:C.right=C.left,Yn(e,r,C,n)}var l=Ct(r,e.doc.direction),s=t.ch,u=t.sticky;if(s>=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!l)return a(u=="before"?s-1:s,u=="before");function h(x,S,C){var M=l[S],O=M.level==1;return a(C?x-1:x,O!=C)}var d=St(l,s,u),m=Et,g=h(s,d,u=="before");return m!=null&&(g.other=h(s,m,u!="before")),g}function Yo(e,t){var n=0;t=X(e.doc,t),e.options.lineWrapping||(n=Hr(e.display)*t.ch);var r=E(e.doc,t.line),i=Qt(r)+Xn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Di(e,t,n,r,i){var o=v(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Oi(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Di(r.first,0,null,-1,-1);var i=Bt(r,n),o=r.first+r.size-1;if(i>o)return Di(r.first+r.size-1,E(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=E(r,i);;){var l=Zl(e,a,i,t,n),s=Sl(a,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var u=s.find(1);if(u.line==i)return u;a=E(r,i=u.line)}}function jo(e,t,n,r){r-=Ai(t);var i=t.text.length,o=Ce(function(a){return _t(e,n,a-1).bottom<=r},i,0);return i=Ce(function(a){return _t(e,n,a).top>r},o,i),{begin:o,end:i}}function Zo(e,t,n,r){n||(n=Pr(e,t));var i=Yn(e,t,_t(e,n,r),"line").top;return jo(e,t,n,i)}function Wi(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Zl(e,t,n,r,i){i-=Qt(t);var o=Pr(e,t),a=Ai(t),l=0,s=t.text.length,u=!0,h=Ct(t,e.doc.direction);if(h){var d=(e.options.lineWrapping?Jl:Ql)(e,t,n,o,h,r,i);u=d.level!=1,l=u?d.from:d.to-1,s=u?d.to:d.from-1}var m=null,g=null,x=Ce(function(B){var I=_t(e,o,B);return I.top+=a,I.bottom+=a,Wi(I,r,i,!1)?(I.top<=i&&I.left<=r&&(m=B,g=I),!0):!1},l,s),S,C,M=!1;if(g){var O=r-g.left<g.right-r,N=O==u;x=m+(N?0:1),C=N?"after":"before",S=O?g.left:g.right}else{!u&&(x==s||x==l)&&x++,C=x==0?"after":x==t.text.length?"before":_t(e,o,x-(u?1:0)).bottom+a<=i==u?"after":"before";var W=Dt(e,v(n,x,C),"line",t,o);S=W.left,M=i<W.top?-1:i>=W.bottom?1:0}return x=Ht(t.text,x,1),Di(n,x,C,M,r-S)}function Ql(e,t,n,r,i,o,a){var l=Ce(function(d){var m=i[d],g=m.level!=1;return Wi(Dt(e,v(n,g?m.to:m.from,g?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),s=i[l];if(l>0){var u=s.level!=1,h=Dt(e,v(n,u?s.from:s.to,u?"after":"before"),"line",t,r);Wi(h,o,a,!0)&&h.top>a&&(s=i[l-1])}return s}function Jl(e,t,n,r,i,o,a){var l=jo(e,t,r,a),s=l.begin,u=l.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var h=null,d=null,m=0;m<i.length;m++){var g=i[m];if(!(g.from>=u||g.to<=s)){var x=g.level!=1,S=_t(e,r,x?Math.min(u,g.to)-1:Math.max(s,g.from)).right,C=S<o?o-S+1e9:S-o;(!h||d>C)&&(h=g,d=C)}}return h||(h=i[i.length-1]),h.from<s&&(h={from:s,to:h.to,level:h.level}),h.to>u&&(h={from:h.from,to:u,level:h.level}),h}var yr;function zr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(yr==null){yr=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)yr.appendChild(document.createTextNode("x")),yr.appendChild(c("br"));yr.appendChild(document.createTextNode("x"))}P(e.measure,yr);var n=yr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),k(e.measure),n||1}function Hr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),n=c("pre",[t],"CodeMirror-line-like");P(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Pi(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var l=e.display.gutterSpecs[a].className;n[l]=o.offsetLeft+o.clientLeft+i,r[l]=o.clientWidth}return{fixedPos:zi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function zi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Qo(e){var t=zr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Hr(e.display)-3);return function(i){if(or(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function Hi(e){var t=e.doc,n=Qo(e);t.iter(function(r){var i=n(r);i!=r.height&&Tt(r,i)})}function br(e,t,n,r){var i=e.display;if(!n&&st(t).getAttribute("cm-not-content")=="true")return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(d){return null}var s=Oi(e,o,a),u;if(r&&s.xRel>0&&(u=E(e.doc,s.line).text).length==s.ch){var h=F(u,u.length,e.options.tabSize)-u.length;s=v(s.line,Math.max(0,Math.round((o-Fo(e.display).left)/Hr(e.display))-h))}return s}function xr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function ut(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Zt&&ki(e.doc,t)<i.viewTo&&lr(e);else if(n<=i.viewFrom)Zt&&Mo(e.doc,n+r)>i.viewFrom?lr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)lr(e);else if(t<=i.viewFrom){var o=Zn(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):lr(e)}else if(n>=i.viewTo){var a=Zn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):lr(e)}else{var l=Zn(e,t,t,-1),s=Zn(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(qn(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):lr(e)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(i.externalMeasured=null))}function ar(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[xr(e,t)];if(o.node!=null){var a=o.changes||(o.changes=[]);ee(a,n)==-1&&a.push(n)}}}function lr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Zn(e,t,n,r){var i=xr(e,t),o,a=e.display.view;if(!Zt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var l=e.display.viewFrom,s=0;s<i;s++)l+=a[s].size;if(l!=t){if(r>0){if(i==a.length-1)return null;o=l+a[i].size-t,i++}else o=l-t;t+=o,n+=o}for(;ki(e.doc,n)!=n;){if(i==(r<0?0:a.length-1))return null;n+=r*a[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function Vl(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=qn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=qn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(xr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(qn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,xr(e,n)))),r.viewTo=n}function Jo(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function fn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Vo(e,t){t===void 0&&(t=!0);var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=e.options.$customCursor;a&&(t=!0);for(var l=0;l<n.sel.ranges.length;l++)if(!(!t&&l==n.sel.primIndex)){var s=n.sel.ranges[l];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var u=s.empty();if(a){var h=a(e,s);h&&Ei(e,h,i)}else(u||e.options.showCursorWhenSelecting)&&Ei(e,s.head,i);u||$l(e,s,o)}}return r}function Ei(e,t,n){var r=Dt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(c("div","\xA0","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var o=jn(e,t,"div",null,null),a=o.right-o.left;i.style.width=(a>0?a:e.defaultCharWidth())+"px"}if(r.other){var l=n.appendChild(c("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));l.style.display="",l.style.left=r.other.left+"px",l.style.top=r.other.top+"px",l.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Qn(e,t){return e.top-t.top||e.left-t.left}function $l(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=Fo(e.display),l=a.left,s=Math.max(r.sizerWidth,mr(e)-r.sizer.offsetLeft)-a.right,u=i.direction=="ltr";function h(N,W,B,I){W<0&&(W=0),W=Math.round(W),I=Math.round(I),o.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+N+`px;
|
|
top: `+W+"px; width: "+(B==null?s-N:B)+`px;
|
|
height: `+(I-W)+"px"))}function d(N,W,B){var I=E(i,N),V=I.text.length,me,je;function Se(Ee,ht){return jn(e,v(N,Ee),"div",I,ht)}function yt(Ee,ht,Qe){var Ue=Zo(e,I,null,Ee),Fe=ht=="ltr"==(Qe=="after")?"left":"right",Me=Qe=="after"?Ue.begin:Ue.end-(/\s/.test(I.text.charAt(Ue.end-1))?2:1);return Se(Me,Fe)[Fe]}var ct=Ct(I,i.direction);return vr(ct,W||0,B==null?V:B,function(Ee,ht,Qe,Ue){var Fe=Qe=="ltr",Me=Se(Ee,Fe?"left":"right"),dt=Se(ht-1,Fe?"right":"left"),jr=W==null&&Ee==0,dr=B==null&&ht==V,tt=Ue==0,Ut=!ct||Ue==ct.length-1;if(dt.top-Me.top<=3){var Ze=(u?jr:dr)&&tt,uo=(u?dr:jr)&&Ut,er=Ze?l:(Fe?Me:dt).left,Lr=uo?s:(Fe?dt:Me).right;h(er,Me.top,Lr-er,Me.bottom)}else{var Tr,at,Zr,fo;Fe?(Tr=u&&jr&&tt?l:Me.left,at=u?s:yt(Ee,Qe,"before"),Zr=u?l:yt(ht,Qe,"after"),fo=u&&dr&&Ut?s:dt.right):(Tr=u?yt(Ee,Qe,"before"):l,at=!u&&jr&&tt?s:Me.right,Zr=!u&&dr&&Ut?l:dt.left,fo=u?yt(ht,Qe,"after"):s),h(Tr,Me.top,at-Tr,Me.bottom),Me.bottom<dt.top&&h(l,Me.bottom,null,dt.top),h(Zr,dt.top,fo-Zr,dt.bottom)}(!me||Qn(Me,me)<0)&&(me=Me),Qn(dt,me)<0&&(me=dt),(!je||Qn(Me,je)<0)&&(je=Me),Qn(dt,je)<0&&(je=dt)}),{start:me,end:je}}var m=t.from(),g=t.to();if(m.line==g.line)d(m.line,m.ch,g.ch);else{var x=E(i,m.line),S=E(i,g.line),C=At(x)==At(S),M=d(m.line,m.ch,C?x.text.length+1:null).end,O=d(g.line,C?0:null,g.ch).start;C&&(M.top<O.top-2?(h(M.right,M.top,null,M.bottom),h(l,O.top,O.left,O.bottom)):h(M.right,M.top,O.left-M.right,M.bottom)),M.bottom<O.top&&h(l,M.bottom,null,O.top)}n.appendChild(o)}function Fi(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Er(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function $o(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Bi(e))}function Ii(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Er(e))},100)}function Bi(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,De(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),U&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Fi(e))}function Er(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 Jn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,a=0;a<t.view.length;a++){var l=t.view[a],s=e.options.lineWrapping,u=void 0,h=0;if(!l.hidden){if(i+=l.line.height,z&&te<8){var d=l.node.offsetTop+l.node.offsetHeight;u=d-n,n=d}else{var m=l.node.getBoundingClientRect();u=m.bottom-m.top,!s&&l.text.firstChild&&(h=l.text.firstChild.getBoundingClientRect().right-m.left-1)}var g=l.line.height-u;if((g>.005||g<-.005)&&(i<r&&(o-=g),Tt(l.line,u),ea(l.line),l.rest))for(var x=0;x<l.rest.length;x++)ea(l.rest[x]);if(h>e.display.sizerWidth){var S=Math.ceil(h/Hr(e.display));S>e.display.maxLineLength&&(e.display.maxLineLength=S,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function ea(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Vn(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Xn(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,o=Bt(t,r),a=Bt(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;l<o?(o=l,a=Bt(t,Qt(E(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=Bt(t,Qt(E(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function es(e,t){if(!Le(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,o=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),i!=null&&!Be){var a=c("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-n.viewOffset-Xn(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Kt(e)+n.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}}function ts(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?v(t.line,t.ch+1,"before"):t,t=t.ch?v(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,l=Dt(e,t),s=!n||n==t?l:Dt(e,n);i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-r,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+r};var u=Ri(e,i),h=e.doc.scrollTop,d=e.doc.scrollLeft;if(u.scrollTop!=null&&(hn(e,u.scrollTop),Math.abs(e.doc.scrollTop-h)>1&&(a=!0)),u.scrollLeft!=null&&(wr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function rs(e,t){var n=Ri(e,t);n.scrollTop!=null&&hn(e,n.scrollTop),n.scrollLeft!=null&&wr(e,n.scrollLeft)}function Ri(e,t){var n=e.display,r=zr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Mi(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Ti(n),s=t.top<r,u=t.bottom>l-r;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var h=Math.min(t.top,(u?l:t.bottom)-o);h!=i&&(a.scrollTop=h)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,m=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-d,g=mr(e)-n.gutters.offsetWidth,x=t.right-t.left>g;return x&&(t.right=t.left+g),t.left<10?a.scrollLeft=0:t.left<m?a.scrollLeft=Math.max(0,t.left+d-(x?0:10)):t.right>g+m-3&&(a.scrollLeft=t.right+(x?0:10)-g),a}function Ki(e,t){t!=null&&($n(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Fr(e){$n(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function cn(e,t,n){(t!=null||n!=null)&&$n(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function ns(e,t){$n(e),e.curOp.scrollToPos=t}function $n(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Yo(e,t.from),r=Yo(e,t.to);ta(e,n,r,t.margin)}}function ta(e,t,n,r){var i=Ri(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});cn(e,i.scrollLeft,i.scrollTop)}function hn(e,t){Math.abs(e.doc.scrollTop-t)<2||(ve||Ui(e,{top:t}),ra(e,t,!0),ve&&Ui(e),vn(e,100))}function ra(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function wr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,la(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function dn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Ti(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?n:0,docHeight:r,scrollHeight:r+Kt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var kr=function(e,t,n){this.cm=n;var r=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),A(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),A(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,z&&te<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};kr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"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=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"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:n?r:0,bottom:t?r:0}},kr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},kr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},kr.prototype.zeroWidthHack=function(){var e=pe&&!Ae?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Q,this.disableVert=new Q},kr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="";function r(){var i=e.getBoundingClientRect(),o=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},kr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var pn=function(){};pn.prototype.update=function(){return{bottom:0,right:0}},pn.prototype.setScrollLeft=function(){},pn.prototype.setScrollTop=function(){},pn.prototype.clear=function(){};function Ir(e,t){t||(t=dn(e));var n=e.display.barWidth,r=e.display.barHeight;na(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Jn(e),na(e,dn(e)),n=e.display.barWidth,r=e.display.barHeight}function na(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var ia={native:kr,null:pn};function oa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ke(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ia[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),A(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?wr(e,t):hn(e,t)},e),e.display.scrollbars.addClass&&De(e.display.wrapper,e.display.scrollbars.addClass)}var is=0;function Sr(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:++is,markArrays:null},Hl(e.curOp)}function Cr(e){var t=e.curOp;t&&Fl(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;os(n)})}function os(e){for(var t=e.ops,n=0;n<t.length;n++)as(t[n]);for(var r=0;r<t.length;r++)ls(t[r]);for(var i=0;i<t.length;i++)ss(t[i]);for(var o=0;o<t.length;o++)us(t[o]);for(var a=0;a<t.length;a++)fs(t[a])}function as(e){var t=e.cm,n=t.display;hs(t),e.updateMaxLine&&Ci(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ei(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ls(e){e.updatedDisplay=e.mustUpdate&&_i(e.cm,e.update)}function ss(e){var t=e.cm,n=t.display;e.updatedDisplay&&Jn(t),e.barMeasure=dn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Bo(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Kt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-mr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function us(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&wr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==ue(Oe(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ir(t,e.barMeasure),e.updatedDisplay&&qi(t,e.barMeasure),e.selectionChanged&&Fi(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&$o(e.cm)}function fs(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&aa(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&ra(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&wr(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=ts(t,X(r,e.scrollToPos.from),X(r,e.scrollToPos.to),e.scrollToPos.margin);es(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||be(o[l],"hide");if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&be(a[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&be(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function mt(e,t){if(e.curOp)return t();Sr(e);try{return t()}finally{Cr(e)}}function Xe(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Sr(e);try{return t.apply(e,arguments)}finally{Cr(e)}}}function ot(e){return function(){if(this.curOp)return e.apply(this,arguments);Sr(this);try{return e.apply(this,arguments)}finally{Cr(this)}}}function Ye(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Sr(t);try{return e.apply(this,arguments)}finally{Cr(t)}}}function vn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,We(cs,e))}function cs(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=nn(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength?Yt(t.mode,r.state):null,s=ho(e,o,r,!0);l&&(r.state=l),o.styles=s.styles;var u=o.styleClasses,h=s.classes;h?o.styleClasses=h:u&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||u!=h&&(!u||!h||u.bgClass!=h.bgClass||u.textClass!=h.textClass),m=0;!d&&m<a.length;++m)d=a[m]!=o.styles[m];d&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&yi(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return vn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&mt(e,function(){for(var o=0;o<i.length;o++)ar(e,i[o],"text")})}}var ei=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Vn(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=mr(e),this.force=n,this.dims=Pi(e),this.events=[]};ei.prototype.signal=function(e,t){nt(e,t)&&this.events.push(arguments)},ei.prototype.finish=function(){for(var e=0;e<this.events.length;e++)be.apply(null,this.events[e])};function hs(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Kt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Kt(e)+"px",t.scrollbarsClipped=!0)}function ds(e){if(e.hasFocus())return null;var t=ue(Oe(e));if(!t||!K(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=kt(e).getSelection();r.anchorNode&&r.extend&&K(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function ps(e){if(!(!e||!e.activeElt||e.activeElt==ue(e.activeElt.ownerDocument))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&K(document.body,e.anchorNode)&&K(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}function _i(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return lr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&Jo(e)==0)return!1;sa(e)&&(lr(e),t.dims=Pi(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Zt&&(o=ki(e.doc,o),a=Mo(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Vl(e,o,a),n.viewOffset=Qt(E(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=Jo(e);if(!l&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=ds(e);return s>4&&(n.lineDiv.style.display="none"),vs(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ps(u),k(n.cursorDiv),k(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,vn(e,400)),n.updateLineNumbers=null,!0}function aa(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==mr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Ti(e.display)-Mi(e),n.top)}),t.visible=Vn(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Vn(e.display,e.doc,n));if(!_i(e,t))break;Jn(e);var i=dn(e);fn(e),Ir(e,i),qi(e,i),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 Ui(e,t){var n=new ei(e,t);if(_i(e,n)){Jn(e),aa(e,n);var r=dn(e);fn(e),Ir(e,r),qi(e,r),n.finish()}}function vs(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function l(x){var S=x.nextSibling;return U&&pe&&e.display.currentWheelTarget==x?x.style.display="none":x.parentNode.removeChild(x),S}for(var s=r.view,u=r.viewFrom,h=0;h<s.length;h++){var d=s[h];if(!d.hidden)if(!d.node||d.node.parentNode!=o){var m=_l(e,d,u,n);o.insertBefore(m,a)}else{for(;a!=d.node;)a=l(a);var g=i&&t!=null&&t<=u&&d.lineNumber;d.changes&&(ee(d.changes,"gutter")>-1&&(g=!1),Wo(e,d,u,n)),g&&(k(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(p(e.options,u)))),a=d.node.nextSibling}u+=d.size}for(;a;)a=l(a)}function Gi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",qe(e,"gutterChanged",e)}function qi(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+Kt(e)+"px"}function la(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=zi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var l=n[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function sa(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=p(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(c("div",[c("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Gi(e.display),!0}return!1}function Xi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],a=null;if(typeof o!="string"&&(a=o.style,o=o.className),o=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:o,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function ua(e){var t=e.gutters,n=e.gutterSpecs;k(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,l=t.appendChild(c("div",null,"CodeMirror-gutter "+o));a&&(l.style.cssText=a),o=="CodeMirror-linenumbers"&&(e.lineGutter=l,l.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Gi(e)}function gn(e){ua(e.display),ut(e),la(e)}function gs(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=c("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=c("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=D("div",null,"CodeMirror-code"),i.selectionDiv=c("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=c("div",null,"CodeMirror-cursors"),i.measure=c("div",null,"CodeMirror-measure"),i.lineMeasure=c("div",null,"CodeMirror-measure"),i.lineSpace=D("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=D("div",[i.lineSpace],"CodeMirror-lines");i.mover=c("div",[o],null,"position: relative"),i.sizer=c("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=c("div",null,null,"position: absolute; height: "+oe+"px; width: 1px;"),i.gutters=c("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=c("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=c("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),R&&le>=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),z&&te<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!U&&!(ve&&ie)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Xi(r.gutters,r.lineNumbers),ua(i),n.init(i)}var ti=0,Vt=null;z?Vt=-.53:ve?Vt=15:R?Vt=-.7:Ne&&(Vt=-1/3);function fa(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function ms(e){var t=fa(e);return t.x*=Vt,t.y*=Vt,t}function ca(e,t){R&&le==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var n=fa(t),r=n.x,i=n.y,o=Vt;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,o=1);var a=e.display,l=a.scroller,s=l.scrollWidth>l.clientWidth,u=l.scrollHeight>l.clientHeight;if(r&&s||i&&u){if(i&&pe&&U){e:for(var h=t.target,d=a.view;h!=l;h=h.parentNode)for(var m=0;m<d.length;m++)if(d[m].node==h){e.display.currentWheelTarget=h;break e}}if(r&&!ve&&!ne&&o!=null){i&&u&&hn(e,Math.max(0,l.scrollTop+i*o)),wr(e,Math.max(0,l.scrollLeft+r*o)),(!i||i&&u)&&$e(t),a.wheelStartX=null;return}if(i&&o!=null){var g=i*o,x=e.doc.scrollTop,S=x+a.wrapper.clientHeight;g<0?x=Math.max(0,x+g-50):S=Math.min(e.doc.height,S+g+50),Ui(e,{top:x,bottom:S})}ti<20&&t.deltaMode!==0&&(a.wheelStartX==null?(a.wheelStartX=l.scrollLeft,a.wheelStartY=l.scrollTop,a.wheelDX=r,a.wheelDY=i,setTimeout(function(){if(a.wheelStartX!=null){var C=l.scrollLeft-a.wheelStartX,M=l.scrollTop-a.wheelStartY,O=M&&a.wheelDY&&M/a.wheelDY||C&&a.wheelDX&&C/a.wheelDX;a.wheelStartX=a.wheelStartY=null,O&&(Vt=(Vt*ti+O)/(ti+1),++ti)}},200)):(a.wheelDX+=r,a.wheelDY+=i))}}var wt=function(e,t){this.ranges=e,this.primIndex=t};wt.prototype.primary=function(){return this.ranges[this.primIndex]},wt.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!q(n.anchor,r.anchor)||!q(n.head,r.head))return!1}return!0},wt.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new de(se(this.ranges[t].anchor),se(this.ranges[t].head));return new wt(e,this.primIndex)},wt.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},wt.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(b(t,r.from())>=0&&b(e,r.to())<=0)return n}return-1};var de=function(e,t){this.anchor=e,this.head=t};de.prototype.from=function(){return _e(this.anchor,this.head)},de.prototype.to=function(){return fe(this.anchor,this.head)},de.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ot(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(m,g){return b(m.from(),g.from())}),n=ee(t,i);for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=b(l.to(),a.from());if(r&&!a.empty()?s>0:s>=0){var u=_e(l.from(),a.from()),h=fe(l.to(),a.to()),d=l.empty()?a.from()==a.head:l.from()==l.head;o<=n&&--n,t.splice(--o,2,new de(d?h:u,d?u:h))}}return new wt(t,n)}function sr(e,t){return new wt([new de(e,t||e)],0)}function ur(e){return e.text?v(e.from.line+e.text.length-1,J(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ha(e,t){if(b(e,t.from)<0)return e;if(b(e,t.to)<=0)return ur(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=ur(t).ch-t.to.ch),v(n,r)}function Yi(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new de(ha(i.anchor,t),ha(i.head,t)))}return Ot(e.cm,n,e.sel.primIndex)}function da(e,t,n){return e.line==t.line?v(n.line,e.ch-t.ch+n.ch):v(n.line+(e.line-t.line),e.ch)}function ys(e,t,n){for(var r=[],i=v(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=da(l.from,i,o),u=da(ur(l),i,o);if(i=l.to,o=u,n=="around"){var h=e.sel.ranges[a],d=b(h.head,h.anchor)<0;r[a]=new de(d?u:s,d?s:u)}else r[a]=new de(s,s)}return new wt(r,e.sel.primIndex)}function ji(e){e.doc.mode=Xt(e.options,e.doc.modeOption),mn(e)}function mn(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,vn(e,100),e.state.modeGen++,e.curOp&&ut(e)}function pa(e,t){return t.from.ch==0&&t.to.ch==0&&J(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Zi(e,t,n,r){function i(O){return n?n[O]:null}function o(O,N,W){Tl(O,N,W,r),qe(O,"change",O,t)}function a(O,N){for(var W=[],B=O;B<N;++B)W.push(new Or(u[B],i(B),r));return W}var l=t.from,s=t.to,u=t.text,h=E(e,l.line),d=E(e,s.line),m=J(u),g=i(u.length-1),x=s.line-l.line;if(t.full)e.insert(0,a(0,u.length)),e.remove(u.length,e.size-u.length);else if(pa(e,t)){var S=a(0,u.length-1);o(d,d.text,g),x&&e.remove(l.line,x),S.length&&e.insert(l.line,S)}else if(h==d)if(u.length==1)o(h,h.text.slice(0,l.ch)+m+h.text.slice(s.ch),g);else{var C=a(1,u.length-1);C.push(new Or(m+h.text.slice(s.ch),g,r)),o(h,h.text.slice(0,l.ch)+u[0],i(0)),e.insert(l.line+1,C)}else if(u.length==1)o(h,h.text.slice(0,l.ch)+u[0]+d.text.slice(s.ch),i(0)),e.remove(l.line+1,x);else{o(h,h.text.slice(0,l.ch)+u[0],i(0)),o(d,m+d.text.slice(s.ch),g);var M=a(1,u.length-1);x>1&&e.remove(l.line+1,x-1),e.insert(l.line+1,M)}qe(e,"change",e,t)}function fr(e,t,n){function r(i,o,a){if(i.linked)for(var l=0;l<i.linked.length;++l){var s=i.linked[l];if(s.doc!=o){var u=a&&s.sharedHist;n&&!u||(t(s.doc,u),r(s.doc,i,u))}}}r(e,null,!0)}function va(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Hi(e),ji(e),ga(e),e.options.direction=t.direction,e.options.lineWrapping||Ci(e),e.options.mode=t.modeOption,ut(e)}function ga(e){(e.doc.direction=="rtl"?De:ke)(e.display.lineDiv,"CodeMirror-rtl")}function bs(e){mt(e,function(){ga(e),ut(e)})}function ri(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Qi(e,t){var n={from:se(t.from),to:ur(t),text:jt(e,t.from,t.to)};return ba(e,n,t.from.line,t.to.line+1),fr(e,function(r){return ba(r,n,t.from.line,t.to.line+1)},!0),n}function ma(e){for(;e.length;){var t=J(e);if(t.ranges)e.pop();else break}}function xs(e,t){if(t)return ma(e.done),J(e.done);if(e.done.length&&!J(e.done).ranges)return J(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),J(e.done)}function ya(e,t,n,r){var i=e.history;i.undone.length=0;var o=+new Date,a,l;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(a=xs(i,i.lastOp==r)))l=J(a.changes),b(t.from,t.to)==0&&b(t.from,l.to)==0?l.to=ur(t):a.changes.push(Qi(e,t));else{var s=J(i.done);for((!s||!s.ranges)&&ni(e.sel,i.done),a={changes:[Qi(e,t)],generation:i.generation},i.done.push(a);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=o,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||be(e,"historyAdded")}function ws(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function ks(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ws(e,o,J(i.done),t))?i.done[i.done.length-1]=t:ni(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&ma(i.undone)}function ni(e,t){var n=J(t);n&&n.ranges&&n.equals(e)||t.push(e)}function ba(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(a){a.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=a.markedSpans),++o})}function Ss(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Cs(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Ss(n[i]));return r}function xa(e,t){var n=Cs(e,t),r=xi(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],u=0;u<o.length;++u)if(o[u].marker==s.marker)continue e;o.push(s)}else a&&(n[i]=a)}return n}function Br(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges){r.push(n?wt.prototype.deepCopy.call(o):o);continue}var a=o.changes,l=[];r.push({changes:l});for(var s=0;s<a.length;++s){var u=a[s],h=void 0;if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var d in u)(h=d.match(/^spans_(\d+)$/))&&ee(t,Number(h[1]))>-1&&(J(l)[d]=u[d],delete u[d])}}return r}function Ji(e,t,n,r){if(r){var i=e.anchor;if(n){var o=b(t,i)<0;o!=b(n,i)<0?(i=t,t=n):o!=b(t,n)<0&&(t=n)}return new de(i,t)}else return new de(n||t,t)}function ii(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),et(e,new wt([Ji(e.sel.primary(),t,n,i)],0),r)}function wa(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Ji(e.sel.ranges[o],t[o],null,i);var a=Ot(e.cm,r,e.sel.primIndex);et(e,a,n)}function Vi(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,et(e,Ot(e.cm,i,e.sel.primIndex),r)}function ka(e,t,n,r){et(e,sr(t,n),r)}function Ls(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var o=0;o<i.length;o++)this.ranges[o]=new de(X(e,i[o].anchor),X(e,i[o].head))},origin:n&&n.origin};return be(e,"beforeSelectionChange",e,r),e.cm&&be(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Ot(e.cm,r.ranges,r.ranges.length-1):t}function Sa(e,t,n){var r=e.history.done,i=J(r);i&&i.ranges?(r[r.length-1]=t,oi(e,t,n)):et(e,t,n)}function et(e,t,n){oi(e,t,n),ks(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function oi(e,t,n){(nt(e,"beforeSelectionChange")||e.cm&&nt(e.cm,"beforeSelectionChange"))&&(t=Ls(e,t,n));var r=n&&n.bias||(b(t.primary().head,e.sel.primary().head)<0?-1:1);Ca(e,Ta(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&Fr(e.cm)}function Ca(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,zn(e.cm)),qe(e,"cursorActivity",e))}function La(e){Ca(e,Ta(e,e.sel,null,!1))}function Ta(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=ai(e,a.anchor,l&&l.anchor,n,r),u=a.head==a.anchor?s:ai(e,a.head,l&&l.head,n,r);(i||s!=a.anchor||u!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new de(s,u))}return i?Ot(e.cm,i,t.primIndex):t}function Rr(e,t,n,r,i){var o=E(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,h="selectRight"in s?!s.selectRight:s.inclusiveRight;if((l.from==null||(u?l.from<=t.ch:l.from<t.ch))&&(l.to==null||(h?l.to>=t.ch:l.to>t.ch))){if(i&&(be(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--a;continue}else break;if(!s.atomic)continue;if(n){var d=s.find(r<0?1:-1),m=void 0;if((r<0?h:u)&&(d=Ma(e,d,-r,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(m=b(d,n))&&(r<0?m<0:m>0))return Rr(e,d,t,r,i)}var g=s.find(r<0?-1:1);return(r<0?u:h)&&(g=Ma(e,g,r,g.line==t.line?o:null)),g?Rr(e,g,t,r,i):null}}return t}function ai(e,t,n,r,i){var o=r||1,a=Rr(e,t,n,o,i)||!i&&Rr(e,t,n,o,!0)||Rr(e,t,n,-o,i)||!i&&Rr(e,t,n,-o,!0);return a||(e.cantEdit=!0,v(e.first,0))}function Ma(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?X(e,v(t.line-1)):null:n>0&&t.ch==(r||E(e,t.line)).text.length?t.line<e.first+e.size-1?v(t.line+1,0):null:new v(t.line,t.ch+n)}function Na(e){e.setSelection(v(e.firstLine(),0),v(e.lastLine()),xe)}function Aa(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(i,o,a,l){i&&(r.from=X(e,i)),o&&(r.to=X(e,o)),a&&(r.text=a),l!==void 0&&(r.origin=l)}),be(e,"beforeChange",e,r),e.cm&&be(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Kr(e,t,n){if(e.cm){if(!e.cm.curOp)return Xe(e.cm,Kr)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((nt(e,"beforeChange")||e.cm&&nt(e.cm,"beforeChange"))&&(t=Aa(e,t,!0),!t))){var r=xo&&!n&&kl(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Da(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Da(e,t)}}function Da(e,t){if(!(t.text.length==1&&t.text[0]==""&&b(t.from,t.to)==0)){var n=Yi(e,t);ya(e,t,n,e.cm?e.cm.curOp.id:NaN),yn(e,t,n,xi(e,t));var r=[];fr(e,function(i,o){!o&&ee(r,i.history)==-1&&(za(i.history,t),r.push(i.history)),yn(i,t,null,xi(i,t))})}}function li(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,o,a=e.sel,l=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,u=0;u<l.length&&(o=l[u],!(n?o.ranges&&!o.equals(e.sel):!o.ranges));u++);if(u!=l.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(o=l.pop(),o.ranges){if(ni(o,s),n&&!o.equals(e.sel)){et(e,o,{clearRedo:!1});return}a=o}else if(r){l.push(o);return}else break;var h=[];ni(a,s),s.push({changes:h,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var d=nt(e,"beforeChange")||e.cm&&nt(e.cm,"beforeChange"),m=function(S){var C=o.changes[S];if(C.origin=t,d&&!Aa(e,C,!1))return l.length=0,{};h.push(Qi(e,C));var M=S?Yi(e,C):J(l);yn(e,C,M,xa(e,C)),!S&&e.cm&&e.cm.scrollIntoView({from:C.from,to:ur(C)});var O=[];fr(e,function(N,W){!W&&ee(O,N.history)==-1&&(za(N.history,C),O.push(N.history)),yn(N,C,null,xa(N,C))})},g=o.changes.length-1;g>=0;--g){var x=m(g);if(x)return x.v}}}}function Oa(e,t){if(t!=0&&(e.first+=t,e.sel=new wt(vt(e.sel.ranges,function(i){return new de(v(i.anchor.line+t,i.anchor.ch),v(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){ut(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)ar(e.cm,r,"gutter")}}function yn(e,t,n,r){if(e.cm&&!e.cm.curOp)return Xe(e.cm,yn)(e,t,n,r);if(t.to.line<e.first){Oa(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Oa(e,i),t={from:v(e.first,0),to:v(t.to.line+i,t.to.ch),text:[J(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:v(o,E(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=jt(e,t.from,t.to),n||(n=Yi(e,t)),e.cm?Ts(e.cm,t,r):Zi(e,t,r),oi(e,n,xe),e.cantEdit&&ai(e,v(e.firstLine(),0))&&(e.cantEdit=!1)}}function Ts(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=he(At(E(r,o.line))),r.iter(s,a.line+1,function(g){if(g==i.maxLine)return l=!0,!0})),r.sel.contains(t.from,t.to)>-1&&zn(e),Zi(r,t,n,Qo(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(g){var x=Gn(g);x>i.maxLineLength&&(i.maxLine=g,i.maxLineLength=x,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),vl(r,o.line),vn(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?ut(e):o.line==a.line&&t.text.length==1&&!pa(e.doc,t)?ar(e,o.line,"text"):ut(e,o.line,a.line+1,u);var h=nt(e,"changes"),d=nt(e,"change");if(d||h){var m={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&qe(e,"change",e,m),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(m)}e.display.selForContextMenu=null}function _r(e,t,n,r,i){var o;r||(r=n),b(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),Kr(e,{from:n,to:r,text:t,origin:i})}function Wa(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Pa(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var l=0;l<o.ranges.length;l++)Wa(o.ranges[l].anchor,t,n,r),Wa(o.ranges[l].head,t,n,r);continue}for(var s=0;s<o.changes.length;++s){var u=o.changes[s];if(n<u.from.line)u.from=v(u.from.line+r,u.from.ch),u.to=v(u.to.line+r,u.to.ch);else if(t<=u.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}function za(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Pa(e.done,n,r,i),Pa(e.undone,n,r,i)}function bn(e,t,n,r){var i=t,o=t;return typeof t=="number"?o=E(e,xt(e,t)):i=he(t),i==null?null:(r(o,i)&&e.cm&&ar(e.cm,i,n),o)}function xn(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}xn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,Ml(i),qe(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function wn(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}wn.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),(t-=o)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof xn))){var l=[];this.collapse(l),this.children=[new xn(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,l=a;l<i.lines.length;){var s=new xn(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new wn(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=ee(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new wn(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if((t-=a)==0)break;e=0}else e-=o}}};var kn=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};kn.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=he(n);if(!(r==null||!t)){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=sn(this);Tt(n,Math.max(0,n.height-o)),e&&(mt(e,function(){Ha(e,n,-o),ar(e,r,"widget")}),qe(e,"lineWidgetCleared",e,this,r))}},kn.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=sn(this)-t;i&&(or(this.doc,r)||Tt(r,r.height+i),n&&mt(n,function(){n.curOp.forceUpdate=!0,Ha(n,r,i),qe(n,"lineWidgetChanged",n,e,he(r))}))},it(kn);function Ha(e,t,n){Qt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ki(e,n)}function Ms(e,t,n,r){var i=new kn(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),bn(e,t,"widget",function(a){var l=a.widgets||(a.widgets=[]);if(i.insertAt==null?l.push(i):l.splice(Math.min(l.length,Math.max(0,i.insertAt)),0,i),i.line=a,o&&!or(e,a)){var s=Qt(a)<e.scrollTop;Tt(a,a.height+sn(i)),s&&Ki(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&qe(o,"lineWidgetAdded",o,i,typeof t=="number"?t:he(t)),i}var Ea=0,cr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Ea};cr.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Sr(e),nt(this,"clear")){var n=this.find();n&&qe(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=on(a.markedSpans,this);e&&!this.collapsed?ar(e,he(a),"text"):e&&(l.to!=null&&(i=he(a)),l.from!=null&&(r=he(a))),a.markedSpans=yl(a.markedSpans,l),l.from==null&&this.collapsed&&!or(this.doc,a)&&e&&Tt(a,zr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=At(this.lines[s]),h=Gn(u);h>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=h,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&ut(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&La(e.doc)),e&&qe(e,"markerCleared",e,this,r,i),t&&Cr(e),this.parent&&this.parent.clear()}},cr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],a=on(o.markedSpans,this);if(a.from!=null&&(n=v(t?o:he(o),a.from),e==-1))return n;if(a.to!=null&&(r=v(t?o:he(o),a.to),e==1))return r}return n&&{from:n,to:r}},cr.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||mt(r,function(){var i=t.line,o=he(t.line),a=Ni(r,o);if(a&&(_o(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!or(n.doc,i)&&n.height!=null){var l=n.height;n.height=null;var s=sn(n)-l;s&&Tt(i,i.height+s)}qe(r,"markerChanged",r,e)})},cr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ee(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},cr.prototype.detachLine=function(e){if(this.lines.splice(ee(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},it(cr);function Ur(e,t,n,r,i){if(r&&r.shared)return Ns(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Xe(e.cm,Ur)(e,t,n,r,i);var o=new cr(e,i),a=b(t,n);if(r&&G(r,o,!1),a>0||a==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=D("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(To(e,t.line,t,n,o)||t.line!=n.line&&To(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");ml()}o.addToHistory&&ya(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l=t.line,s=e.cm,u;if(e.iter(l,n.line+1,function(d){s&&o.collapsed&&!s.options.lineWrapping&&At(d)==s.display.maxLine&&(u=!0),o.collapsed&&l!=t.line&&Tt(d,0),bl(d,new Rn(o,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l}),o.collapsed&&e.iter(t.line,n.line+1,function(d){or(e,d)&&Tt(d,0)}),o.clearOnEnter&&A(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(gl(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Ea,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)ut(s,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var h=t.line;h<=n.line;h++)ar(s,h,"text");o.atomic&&La(s.doc),qe(s,"markerAdded",s,o)}return o}var Sn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Sn.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();qe(this,"clear")}},Sn.prototype.find=function(e,t){return this.primary.find(e,t)},it(Sn);function Ns(e,t,n,r,i){r=G(r),r.shared=!1;var o=[Ur(e,t,n,r,i)],a=o[0],l=r.widgetNode;return fr(e,function(s){l&&(r.widgetNode=l.cloneNode(!0)),o.push(Ur(s,X(s,t),X(s,n),r,i));for(var u=0;u<s.linked.length;++u)if(s.linked[u].isParent)return;a=J(o)}),new Sn(o,a)}function Fa(e){return e.findMarks(v(e.first,0),e.clipPos(v(e.lastLine())),function(t){return t.parent})}function As(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(b(o,a)){var l=Ur(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}function Ds(e){for(var t=function(r){var i=e[r],o=[i.primary.doc];fr(i.primary.doc,function(s){return o.push(s)});for(var a=0;a<i.markers.length;a++){var l=i.markers[a];ee(o,l.doc)==-1&&(l.parent=null,i.markers.splice(a--,1))}},n=0;n<e.length;n++)t(n)}var Os=0,ft=function(e,t,n,r,i){if(!(this instanceof ft))return new ft(e,t,n,r,i);n==null&&(n=0),wn.call(this,[new xn([new Or("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=v(n,0);this.sel=sr(o),this.history=new ri(null),this.id=++Os,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Zi(this,{from:o,to:o,text:e}),et(this,sr(o),xe)};ft.prototype=y(wn.prototype,{constructor:ft,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Dr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Ye(function(e){var t=v(this.first,0),n=this.first+this.size-1;Kr(this,{from:t,to:v(n,E(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&cn(this.cm,0,0),et(this,sr(t),xe)}),replaceRange:function(e,t,n,r){t=X(this,t),n=n?X(this,n):t,_r(this,e,t,n,r)},getRange:function(e,t,n){var r=jt(this,X(this,e),X(this,t));return n===!1?r:n===""?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(f(this,e))return E(this,e)},getLineNumber:function(e){return he(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=E(this,e)),At(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return X(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ye(function(e,t,n){ka(this,X(this,typeof e=="number"?v(e,t||0):e),null,n)}),setSelection:Ye(function(e,t,n){ka(this,X(this,e),X(this,t||e),n)}),extendSelection:Ye(function(e,t,n){ii(this,X(this,e),t&&X(this,t),n)}),extendSelections:Ye(function(e,t){wa(this,co(this,e),t)}),extendSelectionsBy:Ye(function(e,t){var n=vt(this.sel.ranges,e);wa(this,co(this,n),t)}),setSelections:Ye(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new de(X(this,e[i].anchor),X(this,e[i].head||e[i].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),et(this,Ot(this.cm,r,t),n)}}),addSelection:Ye(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new de(X(this,e),X(this,t||e))),et(this,Ot(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=jt(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=jt(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:Ye(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var l=t&&t!="end"&&ys(this,r,t),s=r.length-1;s>=0;s--)Kr(this,r[s]);l?Sa(this,l):this.cm&&Fr(this.cm)}),undo:Ye(function(){li(this,"undo")}),redo:Ye(function(){li(this,"redo")}),undoSelection:Ye(function(){li(this,"undo",!0)}),redoSelection:Ye(function(){li(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new ri(this.history),fr(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Br(this.history.done),undone:Br(this.history.undone)}},setHistory:function(e){var t=this.history=new ri(this.history);t.done=Br(e.done.slice(0),null,!0),t.undone=Br(e.undone.slice(0),null,!0)},setGutterMarker:Ye(function(e,t,n){return bn(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&rt(i)&&(r.gutterMarkers=null),!0})}),clearGutter:Ye(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&bn(t,n,"gutter",function(){return n.gutterMarkers[e]=null,rt(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!f(this,e)||(t=e,e=E(this,e),!e))return null}else if(t=he(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Ye(function(e,t,n){return bn(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i])r[i]=n;else{if(_(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:Ye(function(e,t,n){return bn(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",o=r[i];if(o)if(n==null)r[i]=null;else{var a=o.match(_(n));if(!a)return!1;var l=a.index+a[0].length;r[i]=o.slice(0,a.index)+(!a.index||l==o.length?"":" ")+o.slice(l)||null}else return!1;return!0})}),addLineWidget:Ye(function(e,t,n){return Ms(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Ur(this,X(this,e),X(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=X(this,e),Ur(this,e,e,n,"bookmark")},findMarksAt:function(e){e=X(this,e);var t=[],n=E(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=X(this,e),t=X(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];!(s.to!=null&&i==e.line&&e.ch>=s.to||s.from==null&&i!=e.line||s.from!=null&&i==t.line&&s.from>=t.ch)&&(!n||n(s.marker))&&r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n}),X(this,v(n,t))},indexFromPos:function(e){e=X(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new ft(Dr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new ft(Dr(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],As(r,Fa(this)),r},unlinkDoc:function(e){if(e instanceof we&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Ds(Fa(this));break}}if(e.history==this.history){var r=[e.id];fr(e,function(i){return r.push(i.id)},!0),e.history=new ri(null),e.history.done=Br(this.history.done,r),e.history.undone=Br(this.history.undone,r)}},iterLinkedDocs:function(e){fr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):tn(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:Ye(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&bs(this.cm))})}),ft.prototype.eachLine=ft.prototype.iter;var Ia=0;function Ws(e){var t=this;if(Ba(t),!(Le(t,e)||Jt(t.display,e))){$e(e),z&&(Ia=+new Date);var n=br(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,l=function(){++a==i&&Xe(t,function(){n=X(t.doc,n);var g={from:n,to:n,text:t.doc.splitLines(o.filter(function(x){return x!=null}).join(t.doc.lineSeparator())),origin:"paste"};Kr(t.doc,g),Sa(t.doc,sr(X(t.doc,n),X(t.doc,ur(g))))})()},s=function(g,x){if(t.options.allowDropFileTypes&&ee(t.options.allowDropFileTypes,g.type)==-1){l();return}var S=new FileReader;S.onerror=function(){return l()},S.onload=function(){var C=S.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(C)){l();return}o[x]=C,l()},S.readAsText(g)},u=0;u<r.length;u++)s(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var h=e.dataTransfer.getData("Text");if(h){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),oi(t.doc,sr(n,n)),d)for(var m=0;m<d.length;++m)_r(t.doc,"",d[m].anchor,d[m].head,"drag");t.replaceSelection(h,"around","paste"),t.display.input.focus()}}catch(g){}}}}function Ps(e,t){if(z&&(!e.state.draggingText||+new Date-Ia<100)){qt(t);return}if(!(Le(e,t)||Jt(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!Ne)){var n=c("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",ne&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),ne&&n.parentNode.removeChild(n)}}function zs(e,t){var n=br(e,t);if(n){var r=document.createDocumentFragment();Ei(e,n,r),e.display.dragCursor||(e.display.dragCursor=c("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),P(e.display.dragCursor,r)}}function Ba(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ra(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var o=0;o<n.length;o++)e(n[o])})}}var Ka=!1;function Hs(){Ka||(Es(),Ka=!0)}function Es(){var e;A(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ra(Fs)},100))}),A(window,"blur",function(){return Ra(Er)})}function Fs(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var hr={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Cn=0;Cn<10;Cn++)hr[Cn+48]=hr[Cn+96]=String(Cn);for(var si=65;si<=90;si++)hr[si]=String.fromCharCode(si);for(var Ln=1;Ln<=12;Ln++)hr[Ln+111]=hr[Ln+63235]="F"+Ln;var $t={};$t.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},$t.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},$t.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},$t.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},$t.default=pe?$t.macDefault:$t.pcDefault;function Is(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,o,a=0;a<t.length-1;a++){var l=t[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))i=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Bs(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var i=vt(n.split(" "),Is),o=0;o<i.length;o++){var a=void 0,l=void 0;o==i.length-1?(l=i.join(" "),a=r):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(!s)t[l]=a;else if(s!=a)throw new Error("Inconsistent bindings for "+l)}delete e[n]}for(var u in t)e[u]=t[u];return e}function Gr(e,t,n,r){t=ui(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Gr(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=Gr(e,t.fallthrough[o],n,r);if(a)return a}}}function _a(e){var t=typeof e=="string"?e:hr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Ua(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(Ke?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(Ke?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Ga(e,t){if(ne&&e.keyCode==34&&e.char)return!1;var n=hr[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),Ua(n,e,t))}function ui(e){return typeof e=="string"?$t[e]:e}function qr(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&b(o.from,J(r).to)<=0;){var a=r.pop();if(b(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}mt(e,function(){for(var l=r.length-1;l>=0;l--)_r(e.doc,"",r[l].from,r[l].to,"+delete");Fr(e)})}function $i(e,t,n){var r=Ht(e.text,t+n,n);return r<0||r>e.text.length?null:r}function eo(e,t,n){var r=$i(e,t.ch,n);return r==null?null:new v(t.line,r,n<0?"after":"before")}function to(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=Ct(n,t.doc.direction);if(o){var a=i<0?J(o):o[0],l=i<0==(a.level==1),s=l?"after":"before",u;if(a.level>0||t.doc.direction=="rtl"){var h=Pr(t,n);u=i<0?n.text.length-1:0;var d=_t(t,h,u).top;u=Ce(function(m){return _t(t,h,m).top==d},i<0==(a.level==1)?a.from:a.to-1,u),s=="before"&&(u=$i(n,u,1))}else u=i<0?a.to:a.from;return new v(r,u,s)}}return new v(r,i<0?n.text.length:0,i<0?"before":"after")}function Rs(e,t,n,r){var i=Ct(t,e.doc.direction);if(!i)return eo(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=St(i,n.ch,n.sticky),a=i[o];if(e.doc.direction=="ltr"&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return eo(t,n,r);var l=function(M,O){return $i(t,M instanceof v?M.ch:M,O)},s,u=function(M){return e.options.lineWrapping?(s=s||Pr(e,t),Zo(e,t,s,M)):{begin:0,end:t.text.length}},h=u(n.sticky=="before"?l(n,-1):n.ch);if(e.doc.direction=="rtl"||a.level==1){var d=a.level==1==r<0,m=l(n,d?1:-1);if(m!=null&&(d?m<=a.to&&m<=h.end:m>=a.from&&m>=h.begin)){var g=d?"before":"after";return new v(n.line,m,g)}}var x=function(M,O,N){for(var W=function(me,je){return je?new v(n.line,l(me,1),"before"):new v(n.line,me,"after")};M>=0&&M<i.length;M+=O){var B=i[M],I=O>0==(B.level!=1),V=I?N.begin:l(N.end,-1);if(B.from<=V&&V<B.to||(V=I?B.from:l(B.to,-1),N.begin<=V&&V<N.end))return W(V,I)}},S=x(o+r,r,h);if(S)return S;var C=r>0?h.end:l(h.begin,-1);return C!=null&&!(r>0&&C==t.text.length)&&(S=x(r>0?0:i.length-1,r,u(C)),S)?S:null}var Tn={selectAll:Na,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),xe)},killLine:function(e){return qr(e,function(t){if(t.empty()){var n=E(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:v(t.head.line+1,0)}:{from:t.head,to:v(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return qr(e,function(t){return{from:v(t.from().line,0),to:X(e.doc,v(t.to().line+1,0))}})},delLineLeft:function(e){return qr(e,function(t){return{from:v(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return qr(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return qr(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(v(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(v(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return qa(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Xa(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Ks(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},zt)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},zt)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?Xa(e,t.head):r},zt)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=F(e.getLine(o.line),o.ch,r);t.push(He(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return mt(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=E(e.doc,i.line).text;if(o){if(i.ch==o.length&&(i=new v(i.line,i.ch-1)),i.ch>0)i=new v(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),v(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=E(e.doc,i.line-1).text;a&&(i=new v(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),v(i.line-1,a.length-1),i,"+transpose"))}}n.push(new de(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return mt(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Fr(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function qa(e,t){var n=E(e.doc,t),r=At(n);return r!=n&&(t=he(r)),to(!0,e,r,t,1)}function Ks(e,t){var n=E(e.doc,t),r=Cl(n);return r!=n&&(t=he(r)),to(!0,e,n,t,-1)}function Xa(e,t){var n=qa(e,t.line),r=E(e.doc,n.line),i=Ct(r,e.doc.direction);if(!i||i[0].level==0){var o=Math.max(n.ch,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return v(n.line,a?0:o,n.sticky)}return n}function fi(e,t,n){if(typeof t=="string"&&(t=Tn[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=j}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function _s(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Gr(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Gr(t,e.options.extraKeys,n,e)||Gr(t,e.options.keyMap,n,e)}var Us=new Q;function Mn(e,t,n,r){var i=e.state.keySeq;if(i){if(_a(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Us.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),Ya(e,i+" "+t,n,r))return!0}return Ya(e,t,n,r)}function Ya(e,t,n,r){var i=_s(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&qe(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&($e(n),Fi(e)),!!i}function ja(e,t){var n=Ga(t,!0);return n?t.shiftKey&&!e.state.keySeq?Mn(e,"Shift-"+n,t,function(r){return fi(e,r,!0)})||Mn(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return fi(e,r)}):Mn(e,n,t,function(r){return fi(e,r)}):!1}function Gs(e,t,n){return Mn(e,"'"+n+"'",t,function(r){return fi(e,r,!0)})}var ro=null;function Za(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=ue(Oe(t)),!Le(t,e))){z&&te<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=ja(t,e);ne&&(ro=r?n:null,!r&&n==88&&!Ft&&(pe?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),ve&&!pe&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&qs(t)}}function qs(e){var t=e.display.lineDiv;De(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(ke(t,"CodeMirror-crosshair"),Ve(document,"keyup",n),Ve(document,"mouseover",n))}A(document,"keyup",n),A(document,"mouseover",n)}function Qa(e){e.keyCode==16&&(this.doc.sel.shift=!1),Le(this,e)}function Ja(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(Jt(t.display,e)||Le(t,e)||e.ctrlKey&&!e.altKey||pe&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(ne&&n==ro){ro=null,$e(e);return}if(!(ne&&(!e.which||e.which<10)&&ja(t,e))){var i=String.fromCharCode(r==null?n:r);i!="\b"&&(Gs(t,e,i)||t.display.input.onKeyPress(e))}}}var Xs=400,no=function(e,t,n){this.time=e,this.pos=t,this.button=n};no.prototype.compare=function(e,t,n){return this.time+Xs>e&&b(t,this.pos)==0&&n==this.button};var Nn,An;function Ys(e,t){var n=+new Date;return An&&An.compare(n,e,t)?(Nn=An=null,"triple"):Nn&&Nn.compare(n,e,t)?(An=new no(n,e,t),Nn=null,"double"):(Nn=new no(n,e,t),An=null,"single")}function Va(e){var t=this,n=t.display;if(!(Le(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,Jt(n,e)){U||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!io(t,e)){var r=br(t,e),i=en(e),o=r?Ys(r,i):"single";kt(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&js(t,i,r,o,e))&&(i==1?r?Qs(t,r,o,e):st(e)==n.scroller&&$e(e):i==2?(r&&ii(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(Y?t.display.input.onContextMenu(e):Ii(t)))}}}function js(e,t,n,r,i){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,Mn(e,Ua(o,i),i,function(a){if(typeof a=="string"&&(a=Tn[a]),!a)return!1;var l=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),l=a(e,n)!=j}finally{e.state.suppressEdits=!1}return l})}function Zs(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var o=Ge?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=pe?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(pe?n.altKey:n.ctrlKey)),i}function Qs(e,t,n,r){z?setTimeout(We($o,e),0):e.curOp.focus=ue(Oe(e));var i=Zs(e,n,r),o=e.doc.sel,a;e.options.dragDrop&&gi&&!e.isReadOnly()&&n=="single"&&(a=o.contains(t))>-1&&(b((a=o.ranges[a]).from(),t)<0||t.xRel>0)&&(b(a.to(),t)>0||t.xRel<0)?Js(e,r,t,i):Vs(e,r,t,i)}function Js(e,t,n,r){var i=e.display,o=!1,a=Xe(e,function(u){U&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Ii(e)),Ve(i.wrapper.ownerDocument,"mouseup",a),Ve(i.wrapper.ownerDocument,"mousemove",l),Ve(i.scroller,"dragstart",s),Ve(i.scroller,"drop",a),o||($e(u),r.addNew||ii(e.doc,n,null,null,r.extend),U&&!Ne||z&&te==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),l=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return o=!0};U&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!r.moveOnDrag,A(i.wrapper.ownerDocument,"mouseup",a),A(i.wrapper.ownerDocument,"mousemove",l),A(i.scroller,"dragstart",s),A(i.scroller,"drop",a),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function $a(e,t,n){if(n=="char")return new de(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new de(v(t.line,0),X(e.doc,v(t.line+1,0)));var r=n(e,t);return new de(r.from,r.to)}function Vs(e,t,n,r){z&&Ii(e);var i=e.display,o=e.doc;$e(t);var a,l,s=o.sel,u=s.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),l>-1?a=u[l]:a=new de(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),r.unit=="rectangle")r.addNew||(a=new de(n,n)),n=br(e,t,!0,!0),l=-1;else{var h=$a(e,n,r.unit);r.extend?a=Ji(a,h.anchor,h.head,r.extend):a=h}r.addNew?l==-1?(l=u.length,et(o,Ot(e,u.concat([a]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&r.unit=="char"&&!r.extend?(et(o,Ot(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):Vi(o,l,a,Pt):(l=0,et(o,new wt([a],0),Pt),s=o.sel);var d=n;function m(N){if(b(d,N)!=0)if(d=N,r.unit=="rectangle"){for(var W=[],B=e.options.tabSize,I=F(E(o,n.line).text,n.ch,B),V=F(E(o,N.line).text,N.ch,B),me=Math.min(I,V),je=Math.max(I,V),Se=Math.min(n.line,N.line),yt=Math.min(e.lastLine(),Math.max(n.line,N.line));Se<=yt;Se++){var ct=E(o,Se).text,Ee=bt(ct,me,B);me==je?W.push(new de(v(Se,Ee),v(Se,Ee))):ct.length>Ee&&W.push(new de(v(Se,Ee),v(Se,bt(ct,je,B))))}W.length||W.push(new de(n,n)),et(o,Ot(e,s.ranges.slice(0,l).concat(W),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(N)}else{var ht=a,Qe=$a(e,N,r.unit),Ue=ht.anchor,Fe;b(Qe.anchor,Ue)>0?(Fe=Qe.head,Ue=_e(ht.from(),Qe.anchor)):(Fe=Qe.anchor,Ue=fe(ht.to(),Qe.head));var Me=s.ranges.slice(0);Me[l]=$s(e,new de(X(o,Ue),Fe)),et(o,Ot(e,Me,l),Pt)}}var g=i.wrapper.getBoundingClientRect(),x=0;function S(N){var W=++x,B=br(e,N,!0,r.unit=="rectangle");if(B)if(b(B,d)!=0){e.curOp.focus=ue(Oe(e)),m(B);var I=Vn(i,o);(B.line>=I.to||B.line<I.from)&&setTimeout(Xe(e,function(){x==W&&S(N)}),150)}else{var V=N.clientY<g.top?-20:N.clientY>g.bottom?20:0;V&&setTimeout(Xe(e,function(){x==W&&(i.scroller.scrollTop+=V,S(N))}),50)}}function C(N){e.state.selectingText=!1,x=1/0,N&&($e(N),i.input.focus()),Ve(i.wrapper.ownerDocument,"mousemove",M),Ve(i.wrapper.ownerDocument,"mouseup",O),o.history.lastSelOrigin=null}var M=Xe(e,function(N){N.buttons===0||!en(N)?C(N):S(N)}),O=Xe(e,C);e.state.selectingText=O,A(i.wrapper.ownerDocument,"mousemove",M),A(i.wrapper.ownerDocument,"mouseup",O)}function $s(e,t){var n=t.anchor,r=t.head,i=E(e.doc,n.line);if(b(n,r)==0&&n.sticky==r.sticky)return t;var o=Ct(i);if(!o)return t;var a=St(o,n.ch,n.sticky),l=o[a];if(l.from!=n.ch&&l.to!=n.ch)return t;var s=a+(l.from==n.ch==(l.level!=1)?0:1);if(s==0||s==o.length)return t;var u;if(r.line!=n.line)u=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var h=St(o,r.ch,r.sticky),d=h-a||(r.ch-n.ch)*(l.level==1?-1:1);h==s-1||h==s?u=d<0:u=d>0}var m=o[s+(u?-1:0)],g=u==(m.level==1),x=g?m.from:m.to,S=g?"after":"before";return n.ch==x&&n.sticky==S?t:new de(new v(n.line,x,S),r)}function el(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(m){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&$e(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!nt(e,n))return $r(t);o-=l.top-a.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var u=a.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=i){var h=Bt(e.doc,o),d=e.display.gutterSpecs[s];return be(e,n,e,h,d.className,t),$r(t)}}}function io(e,t){return el(e,t,"gutterClick",!0)}function tl(e,t){Jt(e.display,t)||eu(e,t)||Le(e,t,"contextmenu")||Y||e.display.input.onContextMenu(t)}function eu(e,t){return nt(e,"gutterContextMenu")?el(e,t,"gutterContextMenu",!1):!1}function rl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),un(e)}var Xr={toString:function(){return"CodeMirror.Init"}},nl={},ci={};function tu(e){var t=e.optionHandlers;function n(r,i,o,a){e.defaults[r]=i,o&&(t[r]=a?function(l,s,u){u!=Xr&&o(l,s,u)}:o)}e.defineOption=n,e.Init=Xr,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,ji(r)},!0),n("indentUnit",2,ji,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){mn(r),un(r),ut(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var o=[],a=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var h=s.text.indexOf(i,u);if(h==-1)break;u=h+i.length,o.push(v(a,h))}a++});for(var l=o.length-1;l>=0;l--)_r(r.doc,i,o[l],v(o[l].line,o[l].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,i,o){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),o!=Xr&&r.refresh()}),n("specialCharPlaceholder",Dl,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",ie?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!lt),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){rl(r),gn(r)},!0),n("keyMap","default",function(r,i,o){var a=ui(i),l=o!=Xr&&ui(o);l&&l.detach&&l.detach(r,a),a.attach&&a.attach(r,l||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,nu,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Xi(i,r.options.lineNumbers),gn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?zi(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Ir(r)},!0),n("scrollbarStyle","native",function(r){oa(r),Ir(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=Xi(r.options.gutters,i),gn(r)},!0),n("firstLineNumber",1,gn,!0),n("lineNumberFormatter",function(r){return r},gn,!0),n("showCursorWhenSelecting",!1,fn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Er(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,ru),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,fn,!0),n("singleCursorHeightPerLine",!0,fn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,mn,!0),n("addModeClass",!1,mn,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,mn,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function ru(e,t,n){var r=n&&n!=Xr;if(!t!=!r){var i=e.display.dragFunctions,o=t?A:Ve;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function nu(e){e.options.lineWrapping?(De(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ke(e.display.wrapper,"CodeMirror-wrap"),Ci(e)),Hi(e),ut(e),un(e),setTimeout(function(){return Ir(e)},100)}function we(e,t){var n=this;if(!(this instanceof we))return new we(e,t);this.options=t=t?G(t):{},G(nl,t,!1);var r=t.value;typeof r=="string"?r=new ft(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new we.inputStyles[t.inputStyle](this),o=this.display=new gs(e,r,i,t);o.wrapper.CodeMirror=this,rl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),oa(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 Q,keySeq:null,specialChars:null},t.autofocus&&!ie&&o.input.focus(),z&&te<11&&setTimeout(function(){return n.display.input.reset(!0)},20),iu(this),Hs(),Sr(this),this.curOp.forceUpdate=!0,va(this,r),t.autofocus&&!ie||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Bi(n)},20):Er(this);for(var a in ci)ci.hasOwnProperty(a)&&ci[a](this,t[a],Xr);sa(this),t.finishInit&&t.finishInit(this);for(var l=0;l<oo.length;++l)oo[l](this);Cr(this),U&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"&&(o.lineDiv.style.textRendering="auto")}we.defaults=nl,we.optionHandlers=ci;function iu(e){var t=e.display;A(t.scroller,"mousedown",Xe(e,Va)),z&&te<11?A(t.scroller,"dblclick",Xe(e,function(s){if(!Le(e,s)){var u=br(e,s);if(!(!u||io(e,s)||Jt(e.display,s))){$e(s);var h=e.findWordAt(u);ii(e.doc,h.anchor,h.head)}}})):A(t.scroller,"dblclick",function(s){return Le(e,s)||$e(s)}),A(t.scroller,"contextmenu",function(s){return tl(e,s)}),A(t.input.getField(),"contextmenu",function(s){t.scroller.contains(s.target)||tl(e,s)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function o(s){if(s.touches.length!=1)return!1;var u=s.touches[0];return u.radiusX<=1&&u.radiusY<=1}function a(s,u){if(u.left==null)return!0;var h=u.left-s.left,d=u.top-s.top;return h*h+d*d>20*20}A(t.scroller,"touchstart",function(s){if(!Le(e,s)&&!o(s)&&!io(e,s)){t.input.ensurePolled(),clearTimeout(n);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),A(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),A(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!Jt(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var h=e.coordsChar(t.activeTouch,"page"),d;!u.prev||a(u,u.prev)?d=new de(h,h):!u.prev.prev||a(u,u.prev.prev)?d=e.findWordAt(h):d=new de(v(h.line,0),X(e.doc,v(h.line+1,0))),e.setSelection(d.anchor,d.head),e.focus(),$e(s)}i()}),A(t.scroller,"touchcancel",i),A(t.scroller,"scroll",function(){t.scroller.clientHeight&&(hn(e,t.scroller.scrollTop),wr(e,t.scroller.scrollLeft,!0),be(e,"scroll",e))}),A(t.scroller,"mousewheel",function(s){return ca(e,s)}),A(t.scroller,"DOMMouseScroll",function(s){return ca(e,s)}),A(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){Le(e,s)||qt(s)},over:function(s){Le(e,s)||(zs(e,s),qt(s))},start:function(s){return Ps(e,s)},drop:Xe(e,Ws),leave:function(s){Le(e,s)||Ba(e)}};var l=t.input.getField();A(l,"keyup",function(s){return Qa.call(e,s)}),A(l,"keydown",Xe(e,Za)),A(l,"keypress",Xe(e,Ja)),A(l,"focus",function(s){return Bi(e,s)}),A(l,"blur",function(s){return Er(e,s)})}var oo=[];we.defineInitHook=function(e){return oo.push(e)};function Dn(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=nn(e,t).state:n="prev");var a=e.options.tabSize,l=E(i,t),s=F(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var u=l.text.match(/^\s*/)[0],h;if(!r&&!/\S/.test(l.text))h=0,n="not";else if(n=="smart"&&(h=i.mode.indent(o,l.text.slice(u.length),l.text),h==j||h>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?h=F(E(i,t-1).text,null,a):h=0:n=="add"?h=s+e.options.indentUnit:n=="subtract"?h=s-e.options.indentUnit:typeof n=="number"&&(h=s+n),h=Math.max(0,h);var d="",m=0;if(e.options.indentWithTabs)for(var g=Math.floor(h/a);g;--g)m+=a,d+=" ";if(m<h&&(d+=He(h-m)),d!=u)return _r(i,d,v(t,0),v(t,u.length),"+input"),l.stateAfter=null,!0;for(var x=0;x<i.sel.ranges.length;x++){var S=i.sel.ranges[x];if(S.head.line==t&&S.head.ch<u.length){var C=v(t,u.length);Vi(i,x,new de(C,C));break}}}var Wt=null;function hi(e){Wt=e}function ao(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=+new Date-200,l=i=="paste"||e.state.pasteIncoming>a,s=tn(t),u=null;if(l&&r.ranges.length>1)if(Wt&&Wt.text.join(`
|
|
`)==t){if(r.ranges.length%Wt.text.length==0){u=[];for(var h=0;h<Wt.text.length;h++)u.push(o.splitLines(Wt.text[h]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=vt(s,function(M){return[M]}));for(var d=e.curOp.updateInput,m=r.ranges.length-1;m>=0;m--){var g=r.ranges[m],x=g.from(),S=g.to();g.empty()&&(n&&n>0?x=v(x.line,x.ch-n):e.state.overwrite&&!l?S=v(S.line,Math.min(E(o,S.line).text.length,S.ch+J(s).length)):l&&Wt&&Wt.lineWise&&Wt.text.join(`
|
|
`)==s.join(`
|
|
`)&&(x=S=v(x.line,0)));var C={from:x,to:S,text:u?u[m%u.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};Kr(e.doc,C),qe(e,"inputRead",e,C)}t&&!l&&ol(e,t),Fr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function il(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&mt(t,function(){return ao(t,n,0,null,"paste")}),!0}function ol(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Dn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(E(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Dn(e,i.head.line,"smart"));a&&qe(e,"electricInput",e,i.head.line)}}}function al(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:v(i,0),head:v(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function lo(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function ll(){var e=c("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=c("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return U?e.style.width="1000px":e.setAttribute("wrap","off"),$&&(e.style.border="1px solid black"),t}function ou(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){kt(this).focus(),this.display.input.focus()},setOption:function(r,i){var o=this.options,a=o[r];o[r]==i&&r!="mode"||(o[r]=i,t.hasOwnProperty(r)&&Xe(this,t[r])(this,i,a),be(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](ui(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,o=0;o<i.length;++o)if(i[o]==r||i[o].name==r)return i.splice(o,1),!0},addOverlay:ot(function(r,i){var o=r.token?r:e.getMode(this.options,r);if(o.startState)throw new Error("Overlays may not be stateful.");pr(this.state.overlays,{mode:o,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(a){return a.priority}),this.state.modeGen++,ut(this)}),removeOverlay:ot(function(r){for(var i=this.state.overlays,o=0;o<i.length;++o){var a=i[o].modeSpec;if(a==r||typeof r=="string"&&a.name==r){i.splice(o,1),this.state.modeGen++,ut(this);return}}}),indentLine:ot(function(r,i,o){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),f(this.doc,r)&&Dn(this,r,i,o)}),indentSelection:ot(function(r){for(var i=this.doc.sel.ranges,o=-1,a=0;a<i.length;a++){var l=i[a];if(l.empty())l.head.line>o&&(Dn(this,l.head.line,r,!0),o=l.head.line,a==this.doc.sel.primIndex&&Fr(this));else{var s=l.from(),u=l.to(),h=Math.max(o,s.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var d=h;d<o;++d)Dn(this,d,r);var m=this.doc.sel.ranges;s.ch==0&&i.length==m.length&&m[a].from().ch>0&&Vi(this.doc,a,new de(s,m[a].to()),xe)}}}),getTokenAt:function(r,i){return mo(this,r,i)},getLineTokens:function(r,i){return mo(this,v(r),i,!0)},getTokenTypeAt:function(r){r=X(this.doc,r);var i=po(this,E(this.doc,r.line)),o=0,a=(i.length-1)/2,l=r.ch,s;if(l==0)s=i[2];else for(;;){var u=o+a>>1;if((u?i[u*2-1]:0)>=l)a=u;else if(i[u*2+1]<l)o=u+1;else{s=i[u*2+2];break}}var h=s?s.indexOf("overlay "):-1;return h<0?s:h==0?null:s.slice(0,h-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var o=[];if(!n.hasOwnProperty(i))return o;var a=n[i],l=this.getModeAt(r);if(typeof l[i]=="string")a[l[i]]&&o.push(a[l[i]]);else if(l[i])for(var s=0;s<l[i].length;s++){var u=a[l[i][s]];u&&o.push(u)}else l.helperType&&a[l.helperType]?o.push(a[l.helperType]):a[l.name]&&o.push(a[l.name]);for(var h=0;h<a._global.length;h++){var d=a._global[h];d.pred(l,this)&&ee(o,d.val)==-1&&o.push(d.val)}return o},getStateAfter:function(r,i){var o=this.doc;return r=xt(o,r==null?o.first+o.size-1:r),nn(this,r+1,i).state},cursorCoords:function(r,i){var o,a=this.doc.sel.primary();return r==null?o=a.head:typeof r=="object"?o=X(this.doc,r):o=r?a.from():a.to(),Dt(this,o,i||"page")},charCoords:function(r,i){return jn(this,X(this.doc,r),i||"page")},coordsChar:function(r,i){return r=Xo(this,r,i||"page"),Oi(this,r.left,r.top)},lineAtHeight:function(r,i){return r=Xo(this,{top:r,left:0},i||"page").top,Bt(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,o){var a=!1,l;if(typeof r=="number"){var s=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>s&&(r=s,a=!0),l=E(this.doc,r)}else l=r;return Yn(this,l,{top:0,left:0},i||"page",o||a).top+(a?this.doc.height-Qt(l):0)},defaultTextHeight:function(){return zr(this.display)},defaultCharWidth:function(){return Hr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,o,a,l){var s=this.display;r=Dt(this,X(this.doc,r));var u=r.bottom,h=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),a=="over")u=r.top;else if(a=="above"||a=="near"){var d=Math.max(s.wrapper.clientHeight,this.doc.height),m=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(a=="above"||r.bottom+i.offsetHeight>d)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=d&&(u=r.bottom),h+i.offsetWidth>m&&(h=m-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",l=="right"?(h=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(l=="left"?h=0:l=="middle"&&(h=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=h+"px"),o&&rs(this,{left:h,top:u,right:h+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:ot(Za),triggerOnKeyPress:ot(Ja),triggerOnKeyUp:Qa,triggerOnMouseDown:ot(Va),execCommand:function(r){if(Tn.hasOwnProperty(r))return Tn[r].call(null,this)},triggerElectric:ot(function(r){ol(this,r)}),findPosH:function(r,i,o,a){var l=1;i<0&&(l=-1,i=-i);for(var s=X(this.doc,r),u=0;u<i&&(s=so(this.doc,s,l,o,a),!s.hitSide);++u);return s},moveH:ot(function(r,i){var o=this;this.extendSelectionsBy(function(a){return o.display.shift||o.doc.extend||a.empty()?so(o.doc,a.head,r,i,o.options.rtlMoveVisually):r<0?a.from():a.to()},zt)}),deleteH:ot(function(r,i){var o=this.doc.sel,a=this.doc;o.somethingSelected()?a.replaceSelection("",null,"+delete"):qr(this,function(l){var s=so(a,l.head,r,i,!1);return r<0?{from:s,to:l.head}:{from:l.head,to:s}})}),findPosV:function(r,i,o,a){var l=1,s=a;i<0&&(l=-1,i=-i);for(var u=X(this.doc,r),h=0;h<i;++h){var d=Dt(this,u,"div");if(s==null?s=d.left:d.left=s,u=sl(this,d,l,o),u.hitSide)break}return u},moveV:ot(function(r,i){var o=this,a=this.doc,l=[],s=!this.display.shift&&!a.extend&&a.sel.somethingSelected();if(a.extendSelectionsBy(function(h){if(s)return r<0?h.from():h.to();var d=Dt(o,h.head,"div");h.goalColumn!=null&&(d.left=h.goalColumn),l.push(d.left);var m=sl(o,d,r,i);return i=="page"&&h==a.sel.primary()&&Ki(o,jn(o,m,"div").top-d.top),m},zt),l.length)for(var u=0;u<a.sel.ranges.length;u++)a.sel.ranges[u].goalColumn=l[u]}),findWordAt:function(r){var i=this.doc,o=E(i,r.line).text,a=r.ch,l=r.ch;if(o){var s=this.getHelper(r,"wordChars");(r.sticky=="before"||l==o.length)&&a?--a:++l;for(var u=o.charAt(a),h=ae(u,s)?function(d){return ae(d,s)}:/\s/.test(u)?function(d){return/\s/.test(d)}:function(d){return!/\s/.test(d)&&!ae(d)};a>0&&h(o.charAt(a-1));)--a;for(;l<o.length&&h(o.charAt(l));)++l}return new de(v(r.line,a),v(r.line,l))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?De(this.display.cursorDiv,"CodeMirror-overwrite"):ke(this.display.cursorDiv,"CodeMirror-overwrite"),be(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==ue(Oe(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ot(function(r,i){cn(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Kt(this)-this.display.barHeight,width:r.scrollWidth-Kt(this)-this.display.barWidth,clientHeight:Mi(this),clientWidth:mr(this)}},scrollIntoView:ot(function(r,i){r==null?(r={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof r=="number"?r={from:v(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=i||0,r.from.line!=null?ns(this,r):ta(this,r.from,r.to,r.margin)}),setSize:ot(function(r,i){var o=this,a=function(s){return typeof s=="number"||/^\d+$/.test(String(s))?s+"px":s};r!=null&&(this.display.wrapper.style.width=a(r)),i!=null&&(this.display.wrapper.style.height=a(i)),this.options.lineWrapping&&Uo(this);var l=this.display.viewFrom;this.doc.iter(l,this.display.viewTo,function(s){if(s.widgets){for(var u=0;u<s.widgets.length;u++)if(s.widgets[u].noHScroll){ar(o,l,"widget");break}}++l}),this.curOp.forceUpdate=!0,be(this,"refresh",this)}),operation:function(r){return mt(this,r)},startOperation:function(){return Sr(this)},endOperation:function(){return Cr(this)},refresh:ot(function(){var r=this.display.cachedTextHeight;ut(this),this.curOp.forceUpdate=!0,un(this),cn(this,this.doc.scrollLeft,this.doc.scrollTop),Gi(this.display),(r==null||Math.abs(r-zr(this.display))>.5||this.options.lineWrapping)&&Hi(this),be(this,"refresh",this)}),swapDoc:ot(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),va(this,r),un(this),this.display.input.reset(),cn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,qe(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[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}},it(e),e.registerHelper=function(r,i,o){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=o},e.registerGlobalHelper=function(r,i,o,a){e.registerHelper(r,i,a),n[r]._global.push({pred:o,val:a})}}function so(e,t,n,r,i){var o=t,a=n,l=E(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var O=t.line+s;return O<e.first||O>=e.first+e.size?!1:(t=new v(O,t.ch,t.sticky),l=E(e,O))}function h(O){var N;if(r=="codepoint"){var W=l.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(W))N=null;else{var B=n>0?W>=55296&&W<56320:W>=56320&&W<57343;N=new v(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(B?2:1))),-n)}}else i?N=Rs(e.cm,l,t,n):N=eo(l,t,n);if(N==null)if(!O&&u())t=to(i,e.cm,l,t.line,s);else return!1;else t=N;return!0}if(r=="char"||r=="codepoint")h();else if(r=="column")h(!0);else if(r=="word"||r=="group")for(var d=null,m=r=="group",g=e.cm&&e.cm.getHelper(t,"wordChars"),x=!0;!(n<0&&!h(!x));x=!1){var S=l.text.charAt(t.ch)||`
|
|
`,C=ae(S,g)?"w":m&&S==`
|
|
`?"n":!m||/\s/.test(S)?null:"p";if(m&&!x&&!C&&(C="s"),d&&d!=C){n<0&&(n=1,h(),t.sticky="after");break}if(C&&(d=C),n>0&&!h(!x))break}var M=ai(e,t,o,a,!0);return q(o,M)&&(M.hitSide=!0),M}function sl(e,t,n,r){var i=e.doc,o=t.left,a;if(r=="page"){var l=Math.min(e.display.wrapper.clientHeight,kt(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(l-.5*zr(e.display),3);a=(n>0?t.bottom:t.top)+n*s}else r=="line"&&(a=n>0?t.bottom+3:t.top-3);for(var u;u=Oi(e,o,a),!!u.outside;){if(n<0?a<=0:a>=i.height){u.hitSide=!0;break}a+=n*5}return u}var ge=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Q,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ge.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,lo(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(l){for(var s=l.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}A(i,"paste",function(l){!o(l)||Le(r,l)||il(l,r)||te<=11&&setTimeout(Xe(r,function(){return t.updateFromDOM()}),20)}),A(i,"compositionstart",function(l){t.composing={data:l.data,done:!1}}),A(i,"compositionupdate",function(l){t.composing||(t.composing={data:l.data,done:!1})}),A(i,"compositionend",function(l){t.composing&&(l.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),A(i,"touchstart",function(){return n.forceCompositionEnd()}),A(i,"input",function(){t.composing||t.readFromDOMSoon()});function a(l){if(!(!o(l)||Le(r,l))){if(r.somethingSelected())hi({lineWise:!1,text:r.getSelections()}),l.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=al(r);hi({lineWise:!0,text:s.text}),l.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,xe),r.replaceSelection("",null,"cut")})}else return;if(l.clipboardData){l.clipboardData.clearData();var u=Wt.text.join(`
|
|
`);if(l.clipboardData.setData("Text",u),l.clipboardData.getData("Text")==u){l.preventDefault();return}}var h=ll(),d=h.firstChild;lo(d),r.display.lineSpace.insertBefore(h,r.display.lineSpace.firstChild),d.value=Wt.text.join(`
|
|
`);var m=ue(i.ownerDocument);Gt(d),setTimeout(function(){r.display.lineSpace.removeChild(h),m.focus(),m==i&&n.showPrimarySelection()},50)}}A(i,"copy",a),A(i,"cut",a)},ge.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},ge.prototype.prepareSelection=function(){var e=Vo(this.cm,!1);return e.focus=ue(this.div.ownerDocument)==this.div,e},ge.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},ge.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ge.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var o=di(t,e.anchorNode,e.anchorOffset),a=di(t,e.focusNode,e.focusOffset);if(!(o&&!o.bad&&a&&!a.bad&&b(_e(o,a),r)==0&&b(fe(o,a),i)==0)){var l=t.display.view,s=r.line>=t.display.viewFrom&&ul(t,r)||{node:l[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&ul(t,i);if(!u){var h=l[l.length-1].measure,d=h.maps?h.maps[h.maps.length-1]:h.map;u={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(!s||!u){e.removeAllRanges();return}var m=e.rangeCount&&e.getRangeAt(0),g;try{g=L(s.node,s.offset,u.offset,u.node)}catch(x){}g&&(!ve&&t.state.focused?(e.collapse(s.node,s.offset),g.collapsed||(e.removeAllRanges(),e.addRange(g))):(e.removeAllRanges(),e.addRange(g)),m&&e.anchorNode==null?e.addRange(m):ve&&this.startGracePeriod()),this.rememberSelection()}},ge.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},ge.prototype.showMultipleSelections=function(e){P(this.cm.display.cursorDiv,e.cursors),P(this.cm.display.selectionDiv,e.selection)},ge.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},ge.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return K(this.div,t)},ge.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||ue(this.div.ownerDocument)!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},ge.prototype.blur=function(){this.div.blur()},ge.prototype.getField=function(){return this.div},ge.prototype.supportsTouch=function(){return!0},ge.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):mt(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},ge.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},ge.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(Z&&R&&this.cm.display.gutterSpecs.length&&au(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=di(t,e.anchorNode,e.anchorOffset),r=di(t,e.focusNode,e.focusOffset);n&&r&&mt(t,function(){et(t.doc,sr(n,r),xe),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},ge.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=v(r.line-1,E(e.doc,r.line-1).length)),i.ch==E(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=v(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,a,l;r.line==t.viewFrom||(o=xr(e,r.line))==0?(a=he(t.view[0].line),l=t.view[0].node):(a=he(t.view[o].line),l=t.view[o-1].node.nextSibling);var s=xr(e,i.line),u,h;if(s==t.view.length-1?(u=t.viewTo-1,h=t.lineDiv.lastChild):(u=he(t.view[s+1].line)-1,h=t.view[s+1].node.previousSibling),!l)return!1;for(var d=e.doc.splitLines(lu(e,l,h,a,u)),m=jt(e.doc,v(a,0),v(u,E(e.doc,u).text.length));d.length>1&&m.length>1;)if(J(d)==J(m))d.pop(),m.pop(),u--;else if(d[0]==m[0])d.shift(),m.shift(),a++;else break;for(var g=0,x=0,S=d[0],C=m[0],M=Math.min(S.length,C.length);g<M&&S.charCodeAt(g)==C.charCodeAt(g);)++g;for(var O=J(d),N=J(m),W=Math.min(O.length-(d.length==1?g:0),N.length-(m.length==1?g:0));x<W&&O.charCodeAt(O.length-x-1)==N.charCodeAt(N.length-x-1);)++x;if(d.length==1&&m.length==1&&a==r.line)for(;g&&g>r.ch&&O.charCodeAt(O.length-x-1)==N.charCodeAt(N.length-x-1);)g--,x++;d[d.length-1]=O.slice(0,O.length-x).replace(/^\u200b+/,""),d[0]=d[0].slice(g).replace(/\u200b+$/,"");var B=v(a,g),I=v(u,m.length?J(m).length-x:0);if(d.length>1||d[0]||b(B,I))return _r(e.doc,d,B,I,"+input"),!0},ge.prototype.ensurePolled=function(){this.forceCompositionEnd()},ge.prototype.reset=function(){this.forceCompositionEnd()},ge.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ge.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))},ge.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&mt(this.cm,function(){return ut(e.cm)})},ge.prototype.setUneditable=function(e){e.contentEditable="false"},ge.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Xe(this.cm,ao)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},ge.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},ge.prototype.onContextMenu=function(){},ge.prototype.resetPosition=function(){},ge.prototype.needsContentAttribute=!0;function ul(e,t){var n=Ni(e,t.line);if(!n||n.hidden)return null;var r=E(e.doc,t.line),i=Io(n,r,t.line),o=Ct(r,e.doc.direction),a="left";if(o){var l=St(o,t.ch);a=l%2?"right":"left"}var s=Ko(i.map,t.ch,a);return s.offset=s.collapse=="right"?s.end:s.start,s}function au(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Yr(e,t){return t&&(e.bad=!0),e}function lu(e,t,n,r,i){var o="",a=!1,l=e.doc.lineSeparator(),s=!1;function u(g){return function(x){return x.id==g}}function h(){a&&(o+=l,s&&(o+=l),a=s=!1)}function d(g){g&&(h(),o+=g)}function m(g){if(g.nodeType==1){var x=g.getAttribute("cm-text");if(x){d(x);return}var S=g.getAttribute("cm-marker"),C;if(S){var M=e.findMarks(v(r,0),v(i+1,0),u(+S));M.length&&(C=M[0].find(0))&&d(jt(e.doc,C.from,C.to).join(l));return}if(g.getAttribute("contenteditable")=="false")return;var O=/^(pre|div|p|li|table|br)$/i.test(g.nodeName);if(!/^br$/i.test(g.nodeName)&&g.textContent.length==0)return;O&&h();for(var N=0;N<g.childNodes.length;N++)m(g.childNodes[N]);/^(pre|p)$/i.test(g.nodeName)&&(s=!0),O&&(a=!0)}else g.nodeType==3&&d(g.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;m(t),t!=n;)t=t.nextSibling,s=!1;return o}function di(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return Yr(e.clipPos(v(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return su(o,t,n)}}function su(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!K(r,t))return Yr(v(he(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?J(e.rest):e.line;return Yr(v(he(o),o.text.length),i)}var a=t.nodeType==3?t:null,l=t;for(!a&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(a=t.firstChild,n&&(n=a.nodeValue.length));l.parentNode!=r;)l=l.parentNode;var s=e.measure,u=s.maps;function h(C,M,O){for(var N=-1;N<(u?u.length:0);N++)for(var W=N<0?s.map:u[N],B=0;B<W.length;B+=3){var I=W[B+2];if(I==C||I==M){var V=he(N<0?e.line:e.rest[N]),me=W[B]+O;return(O<0||I!=C)&&(me=W[B+(O?1:0)]),v(V,me)}}}var d=h(a,l,n);if(d)return Yr(d,i);for(var m=l.nextSibling,g=a?a.nodeValue.length-n:0;m;m=m.nextSibling){if(d=h(m,m.firstChild,0),d)return Yr(v(d.line,d.ch-g),i);g+=m.textContent.length}for(var x=l.previousSibling,S=n;x;x=x.previousSibling){if(d=h(x,x.firstChild,-1),d)return Yr(v(d.line,d.ch+S),i);S+=x.textContent.length}}var Pe=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Q,this.hasSelection=!1,this.composing=null,this.resetting=!1};Pe.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),$&&(i.style.width="0px"),A(i,"input",function(){z&&te>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),A(i,"paste",function(a){Le(r,a)||il(a,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function o(a){if(!Le(r,a)){if(r.somethingSelected())hi({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var l=al(r);hi({lineWise:!0,text:l.text}),a.type=="cut"?r.setSelections(l.ranges,null,xe):(n.prevInput="",i.value=l.text.join(`
|
|
`),Gt(i))}else return;a.type=="cut"&&(r.state.cutIncoming=+new Date)}}A(i,"cut",o),A(i,"copy",o),A(e.scroller,"paste",function(a){if(!(Jt(e,a)||Le(r,a))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var l=new Event("paste");l.clipboardData=a.clipboardData,i.dispatchEvent(l)}}),A(e.lineSpace,"selectstart",function(a){Jt(e,a)||$e(a)}),A(i,"compositionstart",function(){var a=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:a,range:r.markText(a,r.getCursor("to"),{className:"CodeMirror-composing"})}}),A(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Pe.prototype.createField=function(e){this.wrapper=ll(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;lo(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},Pe.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Pe.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Vo(e);if(e.options.moveInputWithCursor){var i=Dt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},Pe.prototype.showSelection=function(e){var t=this.cm,n=t.display;P(n.cursorDiv,e.cursors),P(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Pe.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&Gt(this.textarea),z&&te>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",z&&te>=9&&(this.hasSelection=null));this.resetting=!1}},Pe.prototype.getField=function(){return this.textarea},Pe.prototype.supportsTouch=function(){return!1},Pe.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!ie||ue(this.textarea.ownerDocument)!=this.textarea))try{this.textarea.focus()}catch(e){}},Pe.prototype.blur=function(){this.textarea.blur()},Pe.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Pe.prototype.receivedFocus=function(){this.slowPoll()},Pe.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Pe.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},Pe.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||tr(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(z&&te>=9&&this.hasSelection===i||pe&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(o==8203&&!r&&(r="\u200B"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var a=0,l=Math.min(r.length,i.length);a<l&&r.charCodeAt(a)==i.charCodeAt(a);)++a;return mt(t,function(){ao(t,i.slice(a),r.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
|
|
`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Pe.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Pe.prototype.onKeyPress=function(){z&&te>=9&&(this.hasSelection=null),this.fastPoll()},Pe.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=br(n,e),a=r.scroller.scrollTop;if(!o||ne)return;var l=n.options.resetSelectionOnContextMenu;l&&n.doc.sel.contains(o)==-1&&Xe(n,et)(n.doc,sr(o),xe);var s=i.style.cssText,u=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+`px;
|
|
z-index: 1000; background: `+(z?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var d;U&&(d=i.ownerDocument.defaultView.scrollY),r.input.focus(),U&&i.ownerDocument.defaultView.scrollTo(null,d),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=g,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function m(){if(i.selectionStart!=null){var S=n.somethingSelected(),C="\u200B"+(S?i.value:"");i.value="\u21DA",i.value=C,t.prevInput=S?"":"\u200B",i.selectionStart=1,i.selectionEnd=C.length,r.selForContextMenu=n.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=s,z&&te<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=a),i.selectionStart!=null)){(!z||z&&te<9)&&m();var S=0,C=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?Xe(n,Na)(n):S++<10?r.detectingSelectAll=setTimeout(C,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(C,200)}}if(z&&te>=9&&m(),Y){qt(e);var x=function(){Ve(window,"mouseup",x),setTimeout(g,20)};A(window,"mouseup",x)}else setTimeout(g,50)},Pe.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Pe.prototype.setUneditable=function(){},Pe.prototype.needsContentAttribute=!1;function uu(e,t){if(t=t?G(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 n=ue(e.ownerDocument);t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=l.getValue()}var i;if(e.form&&(A(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(s){}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(Ve(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var l=we(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return l}function fu(e){e.off=Ve,e.on=A,e.wheelEventPixels=ms,e.Doc=ft,e.splitLines=tn,e.countColumn=F,e.findColumn=bt,e.isWordChar=w,e.Pass=j,e.signal=be,e.Line=Or,e.changeEnd=ur,e.scrollbarModel=ia,e.Pos=v,e.cmpPos=b,e.modes=Nt,e.mimeModes=rr,e.resolveMode=gt,e.getMode=Xt,e.modeExtensions=nr,e.extendMode=In,e.copyState=Yt,e.startState=rn,e.innerMode=ir,e.commands=Tn,e.keyMap=$t,e.keyName=Ga,e.isModifierKey=_a,e.lookupKey=Gr,e.normalizeKeyMap=Bs,e.StringStream=Te,e.SharedTextMarker=Sn,e.TextMarker=cr,e.LineWidget=kn,e.e_preventDefault=$e,e.e_stopPropagation=gr,e.e_stop=qt,e.addClass=De,e.contains=K,e.rmClass=ke,e.keyNames=hr}tu(we),ou(we);var cu="iter insert remove copy getEditor constructor".split(" ");for(var pi in ft.prototype)ft.prototype.hasOwnProperty(pi)&&ee(cu,pi)<0&&(we.prototype[pi]=function(e){return function(){return e.apply(this.doc,arguments)}}(ft.prototype[pi]));return it(ft),we.inputStyles={textarea:Pe,contenteditable:ge},we.defineMode=function(e){!we.defaults.mode&&e!="null"&&(we.defaults.mode=e),Fn.apply(this,arguments)},we.defineMIME=Ar,we.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),we.defineMIME("text/plain","null"),we.defineExtension=function(e,t){we.prototype[e]=t},we.defineDocExtension=function(e,t){ft.prototype[e]=t},we.fromTextArea=uu,fu(we),we.version="5.65.15",we})})(hl);var On=hl.exports;const xu=hu(On);var pu={exports:{}};(function(Qr,Wn){(function(H){H(On)})(function(H){H.defineMode("javascript",function(ze,ve){var Je=ze.indentUnit,pt=ve.statementIndent,Ie=ve.jsonld,z=ve.json||Ie,te=ve.trackScope!==!1,U=ve.typescript,re=ve.wordCharacters||/[\w$\xa1-\uffff]/,R=function(){function f(_e){return{type:_e,style:"keyword"}}var p=f("keyword a"),v=f("keyword b"),b=f("keyword c"),q=f("keyword d"),se=f("operator"),fe={type:"atom",style:"atom"};return{if:f("if"),while:p,with:p,else:v,do:v,try:v,finally:v,return:q,break:q,continue:q,new:f("new"),delete:b,void:b,throw:b,debugger:f("debugger"),var:f("var"),const:f("var"),let:f("var"),function:f("function"),catch:f("catch"),for:f("for"),switch:f("switch"),case:f("case"),default:f("default"),in:se,typeof:se,instanceof:se,true:fe,false:fe,null:fe,undefined:fe,NaN:fe,Infinity:fe,this:f("this"),class:f("class"),super:f("atom"),yield:b,export:f("export"),import:f("import"),extends:b,await:b}}(),le=/[+\-*&%=<>!?|~^@]/,ne=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function Ne(f){for(var p=!1,v,b=!1;(v=f.next())!=null;){if(!p){if(v=="/"&&!b)return;v=="["?b=!0:b&&v=="]"&&(b=!1)}p=!p&&v=="\\"}}var Ae,Be;function $(f,p,v){return Ae=f,Be=v,p}function Z(f,p){var v=f.next();if(v=='"'||v=="'")return p.tokenize=ie(v),p.tokenize(f,p);if(v=="."&&f.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return $("number","number");if(v=="."&&f.match(".."))return $("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(v))return $(v);if(v=="="&&f.eat(">"))return $("=>","operator");if(v=="0"&&f.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return $("number","number");if(/\d/.test(v))return f.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),$("number","number");if(v=="/")return f.eat("*")?(p.tokenize=pe,pe(f,p)):f.eat("/")?(f.skipToEnd(),$("comment","comment")):Bt(f,p,1)?(Ne(f),f.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),$("regexp","string-2")):(f.eat("="),$("operator","operator",f.current()));if(v=="`")return p.tokenize=Ge,Ge(f,p);if(v=="#"&&f.peek()=="!")return f.skipToEnd(),$("meta","meta");if(v=="#"&&f.eatWhile(re))return $("variable","property");if(v=="<"&&f.match("!--")||v=="-"&&f.match("->")&&!/\S/.test(f.string.slice(0,f.start)))return f.skipToEnd(),$("comment","comment");if(le.test(v))return(v!=">"||!p.lexical||p.lexical.type!=">")&&(f.eat("=")?(v=="!"||v=="=")&&f.eat("="):/[<>*+\-|&?]/.test(v)&&(f.eat(v),v==">"&&f.eat(v))),v=="?"&&f.eat(".")?$("."):$("operator","operator",f.current());if(re.test(v)){f.eatWhile(re);var b=f.current();if(p.lastType!="."){if(R.propertyIsEnumerable(b)){var q=R[b];return $(q.type,q.style,b)}if(b=="async"&&f.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return $("async","keyword",b)}return $("variable","variable",b)}}function ie(f){return function(p,v){var b=!1,q;if(Ie&&p.peek()=="@"&&p.match(ne))return v.tokenize=Z,$("jsonld-keyword","meta");for(;(q=p.next())!=null&&!(q==f&&!b);)b=!b&&q=="\\";return b||(v.tokenize=Z),$("string","string")}}function pe(f,p){for(var v=!1,b;b=f.next();){if(b=="/"&&v){p.tokenize=Z;break}v=b=="*"}return $("comment","comment")}function Ge(f,p){for(var v=!1,b;(b=f.next())!=null;){if(!v&&(b=="`"||b=="$"&&f.eat("{"))){p.tokenize=Z;break}v=!v&&b=="\\"}return $("quasi","string-2",f.current())}var lt="([{}])";function Re(f,p){p.fatArrowAt&&(p.fatArrowAt=null);var v=f.string.indexOf("=>",f.start);if(!(v<0)){if(U){var b=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(f.string.slice(f.start,v));b&&(v=b.index)}for(var q=0,se=!1,fe=v-1;fe>=0;--fe){var _e=f.string.charAt(fe),xt=lt.indexOf(_e);if(xt>=0&&xt<3){if(!q){++fe;break}if(--q==0){_e=="("&&(se=!0);break}}else if(xt>=3&&xt<6)++q;else if(re.test(_e))se=!0;else if(/["'\/`]/.test(_e))for(;;--fe){if(fe==0)return;var X=f.string.charAt(fe-1);if(X==_e&&f.string.charAt(fe-2)!="\\"){fe--;break}}else if(se&&!q){++fe;break}}se&&!q&&(p.fatArrowAt=fe)}}var Ke={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function Y(f,p,v,b,q,se){this.indented=f,this.column=p,this.type=v,this.prev=q,this.info=se,b!=null&&(this.align=b)}function _(f,p){if(!te)return!1;for(var v=f.localVars;v;v=v.next)if(v.name==p)return!0;for(var b=f.context;b;b=b.prev)for(var v=b.vars;v;v=v.next)if(v.name==p)return!0}function ke(f,p,v,b,q){var se=f.cc;for(k.state=f,k.stream=q,k.marked=null,k.cc=se,k.style=p,f.lexical.hasOwnProperty("align")||(f.lexical.align=!0);;){var fe=se.length?se.pop():z?j:ee;if(fe(v,b)){for(;se.length&&se[se.length-1].lex;)se.pop()();return k.marked?k.marked:v=="variable"&&_(f,b)?"variable-2":p}}}var k={state:null,column:null,marked:null,cc:null};function P(){for(var f=arguments.length-1;f>=0;f--)k.cc.push(arguments[f])}function c(){return P.apply(null,arguments),!0}function D(f,p){for(var v=p;v;v=v.next)if(v.name==f)return!0;return!1}function L(f){var p=k.state;if(k.marked="def",!!te){if(p.context){if(p.lexical.info=="var"&&p.context&&p.context.block){var v=K(f,p.context);if(v!=null){p.context=v;return}}else if(!D(f,p.localVars)){p.localVars=new Mt(f,p.localVars);return}}ve.globalVars&&!D(f,p.globalVars)&&(p.globalVars=new Mt(f,p.globalVars))}}function K(f,p){if(p)if(p.block){var v=K(f,p.prev);return v?v==p.prev?p:new De(v,p.vars,!0):null}else return D(f,p.vars)?p:new De(p.prev,new Mt(f,p.vars),!1);else return null}function ue(f){return f=="public"||f=="private"||f=="protected"||f=="abstract"||f=="readonly"}function De(f,p,v){this.prev=f,this.vars=p,this.block=v}function Mt(f,p){this.name=f,this.next=p}var Gt=new Mt("this",new Mt("arguments",null));function Oe(){k.state.context=new De(k.state.context,k.state.localVars,!1),k.state.localVars=Gt}function kt(){k.state.context=new De(k.state.context,k.state.localVars,!0),k.state.localVars=null}Oe.lex=kt.lex=!0;function We(){k.state.localVars=k.state.context.vars,k.state.context=k.state.context.prev}We.lex=!0;function G(f,p){var v=function(){var b=k.state,q=b.indented;if(b.lexical.type=="stat")q=b.lexical.indented;else for(var se=b.lexical;se&&se.type==")"&&se.align;se=se.prev)q=se.indented;b.lexical=new Y(q,k.stream.column(),f,null,b.lexical,p)};return v.lex=!0,v}function F(){var f=k.state;f.lexical.prev&&(f.lexical.type==")"&&(f.indented=f.lexical.indented),f.lexical=f.lexical.prev)}F.lex=!0;function Q(f){function p(v){return v==f?c():f==";"||v=="}"||v==")"||v=="]"?P():c(p)}return p}function ee(f,p){return f=="var"?c(G("vardef",p),qt,Q(";"),F):f=="keyword a"?c(G("form"),Pt,ee,F):f=="keyword b"?c(G("form"),ee,F):f=="keyword d"?k.stream.match(/^\s*$/,!1)?c():c(G("stat"),bt,Q(";"),F):f=="debugger"?c(Q(";")):f=="{"?c(G("}"),kt,Et,F,We):f==";"?c():f=="if"?(k.state.lexical.info=="else"&&k.state.cc[k.state.cc.length-1]==F&&k.state.cc.pop()(),c(G("form"),Pt,ee,F,Nr)):f=="function"?c(Ft):f=="for"?c(G("form"),kt,Hn,ee,We,F):f=="class"||U&&p=="interface"?(k.marked="keyword",c(G("form",f=="class"?f:p),Fn,F)):f=="variable"?U&&p=="declare"?(k.marked="keyword",c(ee)):U&&(p=="module"||p=="enum"||p=="type")&&k.stream.match(/^\s*\w/,!1)?(k.marked="keyword",p=="enum"?c(Dr):p=="type"?c(En,Q("operator"),A,Q(";")):c(G("form"),st,Q("{"),G("}"),Et,F,F)):U&&p=="namespace"?(k.marked="keyword",c(G("form"),j,ee,F)):U&&p=="abstract"?(k.marked="keyword",c(ee)):c(G("stat"),ae):f=="switch"?c(G("form"),Pt,Q("{"),G("}","switch"),kt,Et,F,F,We):f=="case"?c(j,Q(":")):f=="default"?c(Q(":")):f=="catch"?c(G("form"),Oe,oe,ee,F,We):f=="export"?c(G("stat"),nr,F):f=="import"?c(G("stat"),Yt,F):f=="async"?c(ee):p=="@"?c(j,ee):P(G("stat"),j,Q(";"),F)}function oe(f){if(f=="(")return c(Nt,Q(")"))}function j(f,p){return zt(f,p,!1)}function xe(f,p){return zt(f,p,!0)}function Pt(f){return f!="("?P():c(G(")"),bt,Q(")"),F)}function zt(f,p,v){if(k.state.fatArrowAt==k.stream.start){var b=v?ye:pr;if(f=="(")return c(Oe,G(")"),Ce(Nt,")"),F,Q("=>"),b,We);if(f=="variable")return P(Oe,st,Q("=>"),b,We)}var q=v?He:ce;return Ke.hasOwnProperty(f)?c(q):f=="function"?c(Ft,q):f=="class"||U&&p=="interface"?(k.marked="keyword",c(G("form"),rr,F)):f=="keyword c"||f=="async"?c(v?xe:j):f=="("?c(G(")"),bt,Q(")"),F,q):f=="operator"||f=="spread"?c(v?xe:j):f=="["?c(G("]"),jt,F,q):f=="{"?vr(Mr,"}",null,q):f=="quasi"?P(J,q):f=="new"?c(y(v)):c()}function bt(f){return f.match(/[;\}\)\],]/)?P():P(j)}function ce(f,p){return f==","?c(bt):He(f,p,!1)}function He(f,p,v){var b=v==!1?ce:He,q=v==!1?j:xe;if(f=="=>")return c(Oe,v?ye:pr,We);if(f=="operator")return/\+\+|--/.test(p)||U&&p=="!"?c(b):U&&p=="<"&&k.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?c(G(">"),Ce(A,">"),F,b):p=="?"?c(j,Q(":"),q):c(q);if(f=="quasi")return P(J,b);if(f!=";"){if(f=="(")return vr(xe,")","call",b);if(f==".")return c(rt,b);if(f=="[")return c(G("]"),bt,Q("]"),F,b);if(U&&p=="as")return k.marked="keyword",c(A,b);if(f=="regexp")return k.state.lastType=k.marked="operator",k.stream.backUp(k.stream.pos-k.stream.start-1),c(q)}}function J(f,p){return f!="quasi"?P():p.slice(p.length-2)!="${"?c(J):c(bt,vt)}function vt(f){if(f=="}")return k.marked="string-2",k.state.tokenize=Ge,c(J)}function pr(f){return Re(k.stream,k.state),P(f=="{"?ee:j)}function ye(f){return Re(k.stream,k.state),P(f=="{"?ee:xe)}function y(f){return function(p){return p=="."?c(f?w:T):p=="variable"&&U?c($e,f?He:ce):P(f?xe:j)}}function T(f,p){if(p=="target")return k.marked="keyword",c(ce)}function w(f,p){if(p=="target")return k.marked="keyword",c(He)}function ae(f){return f==":"?c(F,ee):P(ce,Q(";"),F)}function rt(f){if(f=="variable")return k.marked="property",c()}function Mr(f,p){if(f=="async")return k.marked="property",c(Mr);if(f=="variable"||k.style=="keyword"){if(k.marked="property",p=="get"||p=="set")return c(Jr);var v;return U&&k.state.fatArrowAt==k.stream.start&&(v=k.stream.match(/^\s*:\s*/,!1))&&(k.state.fatArrowAt=k.stream.pos+v[0].length),c(Ht)}else{if(f=="number"||f=="string")return k.marked=Ie?"property":k.style+" property",c(Ht);if(f=="jsonld-keyword")return c(Ht);if(U&&ue(p))return k.marked="keyword",c(Mr);if(f=="[")return c(j,St,Q("]"),Ht);if(f=="spread")return c(xe,Ht);if(p=="*")return k.marked="keyword",c(Mr);if(f==":")return P(Ht)}}function Jr(f){return f!="variable"?P(Ht):(k.marked="property",c(Ft))}function Ht(f){if(f==":")return c(xe);if(f=="(")return P(Ft)}function Ce(f,p,v){function b(q,se){if(v?v.indexOf(q)>-1:q==","){var fe=k.state.lexical;return fe.info=="call"&&(fe.pos=(fe.pos||0)+1),c(function(_e,xt){return _e==p||xt==p?P():P(f)},b)}return q==p||se==p?c():v&&v.indexOf(";")>-1?P(f):c(Q(p))}return function(q,se){return q==p||se==p?c():P(f,b)}}function vr(f,p,v){for(var b=3;b<arguments.length;b++)k.cc.push(arguments[b]);return c(G(p,v),Ce(f,p),F)}function Et(f){return f=="}"?c():P(ee,Et)}function St(f,p){if(U){if(f==":")return c(A);if(p=="?")return c(St)}}function vi(f,p){if(U&&(f==":"||p=="in"))return c(A)}function Ct(f){if(U&&f==":")return k.stream.match(/^\s*\w+\s+is\b/,!1)?c(j,Pn,A):c(A)}function Pn(f,p){if(p=="is")return k.marked="keyword",c()}function A(f,p){if(p=="keyof"||p=="typeof"||p=="infer"||p=="readonly")return k.marked="keyword",c(p=="typeof"?xe:A);if(f=="variable"||p=="void")return k.marked="type",c(it);if(p=="|"||p=="&")return c(A);if(f=="string"||f=="number"||f=="atom")return c(it);if(f=="[")return c(G("]"),Ce(A,"]",","),F,it);if(f=="{")return c(G("}"),Ve,F,it);if(f=="(")return c(Ce(nt,")"),Vr,it);if(f=="<")return c(Ce(A,">"),A);if(f=="quasi")return P(Le,it)}function Vr(f){if(f=="=>")return c(A)}function Ve(f){return f.match(/[\}\)\]]/)?c():f==","||f==";"?c(Ve):P(be,Ve)}function be(f,p){if(f=="variable"||k.style=="keyword")return k.marked="property",c(be);if(p=="?"||f=="number"||f=="string")return c(be);if(f==":")return c(A);if(f=="[")return c(Q("variable"),vi,Q("]"),be);if(f=="(")return P(It,be);if(!f.match(/[;\}\)\],]/))return c()}function Le(f,p){return f!="quasi"?P():p.slice(p.length-2)!="${"?c(Le):c(A,zn)}function zn(f){if(f=="}")return k.marked="string-2",k.state.tokenize=Ge,c(Le)}function nt(f,p){return f=="variable"&&k.stream.match(/^\s*[?:]/,!1)||p=="?"?c(nt):f==":"?c(A):f=="spread"?c(nt):P(A)}function it(f,p){if(p=="<")return c(G(">"),Ce(A,">"),F,it);if(p=="|"||f=="."||p=="&")return c(A);if(f=="[")return c(A,Q("]"),it);if(p=="extends"||p=="implements")return k.marked="keyword",c(A);if(p=="?")return c(A,Q(":"),A)}function $e(f,p){if(p=="<")return c(G(">"),Ce(A,">"),F,it)}function gr(){return P(A,$r)}function $r(f,p){if(p=="=")return c(A)}function qt(f,p){return p=="enum"?(k.marked="keyword",c(Dr)):P(st,St,Lt,mi)}function st(f,p){if(U&&ue(p))return k.marked="keyword",c(st);if(f=="variable")return L(p),c();if(f=="spread")return c(st);if(f=="[")return vr(gi,"]");if(f=="{")return vr(en,"}")}function en(f,p){return f=="variable"&&!k.stream.match(/^\s*:/,!1)?(L(p),c(Lt)):(f=="variable"&&(k.marked="property"),f=="spread"?c(st):f=="}"?P():f=="["?c(j,Q("]"),Q(":"),en):c(Q(":"),st,Lt))}function gi(){return P(st,Lt)}function Lt(f,p){if(p=="=")return c(xe)}function mi(f){if(f==",")return c(qt)}function Nr(f,p){if(f=="keyword b"&&p=="else")return c(G("form","else"),ee,F)}function Hn(f,p){if(p=="await")return c(Hn);if(f=="(")return c(G(")"),tn,F)}function tn(f){return f=="var"?c(qt,tr):f=="variable"?c(tr):P(tr)}function tr(f,p){return f==")"?c():f==";"?c(tr):p=="in"||p=="of"?(k.marked="keyword",c(j,tr)):P(j,tr)}function Ft(f,p){if(p=="*")return k.marked="keyword",c(Ft);if(f=="variable")return L(p),c(Ft);if(f=="(")return c(Oe,G(")"),Ce(Nt,")"),F,Ct,ee,We);if(U&&p=="<")return c(G(">"),Ce(gr,">"),F,Ft)}function It(f,p){if(p=="*")return k.marked="keyword",c(It);if(f=="variable")return L(p),c(It);if(f=="(")return c(Oe,G(")"),Ce(Nt,")"),F,Ct,We);if(U&&p=="<")return c(G(">"),Ce(gr,">"),F,It)}function En(f,p){if(f=="keyword"||f=="variable")return k.marked="type",c(En);if(p=="<")return c(G(">"),Ce(gr,">"),F)}function Nt(f,p){return p=="@"&&c(j,Nt),f=="spread"?c(Nt):U&&ue(p)?(k.marked="keyword",c(Nt)):U&&f=="this"?c(St,Lt):P(st,St,Lt)}function rr(f,p){return f=="variable"?Fn(f,p):Ar(f,p)}function Fn(f,p){if(f=="variable")return L(p),c(Ar)}function Ar(f,p){if(p=="<")return c(G(">"),Ce(gr,">"),F,Ar);if(p=="extends"||p=="implements"||U&&f==",")return p=="implements"&&(k.marked="keyword"),c(U?A:j,Ar);if(f=="{")return c(G("}"),gt,F)}function gt(f,p){if(f=="async"||f=="variable"&&(p=="static"||p=="get"||p=="set"||U&&ue(p))&&k.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return k.marked="keyword",c(gt);if(f=="variable"||k.style=="keyword")return k.marked="property",c(Xt,gt);if(f=="number"||f=="string")return c(Xt,gt);if(f=="[")return c(j,St,Q("]"),Xt,gt);if(p=="*")return k.marked="keyword",c(gt);if(U&&f=="(")return P(It,gt);if(f==";"||f==",")return c(gt);if(f=="}")return c();if(p=="@")return c(j,gt)}function Xt(f,p){if(p=="!"||p=="?")return c(Xt);if(f==":")return c(A,Lt);if(p=="=")return c(xe);var v=k.state.lexical.prev,b=v&&v.info=="interface";return P(b?It:Ft)}function nr(f,p){return p=="*"?(k.marked="keyword",c(E,Q(";"))):p=="default"?(k.marked="keyword",c(j,Q(";"))):f=="{"?c(Ce(In,"}"),E,Q(";")):P(ee)}function In(f,p){if(p=="as")return k.marked="keyword",c(Q("variable"));if(f=="variable")return P(xe,In)}function Yt(f){return f=="string"?c():f=="("?P(j):f=="."?P(ce):P(ir,rn,E)}function ir(f,p){return f=="{"?vr(ir,"}"):(f=="variable"&&L(p),p=="*"&&(k.marked="keyword"),c(Te))}function rn(f){if(f==",")return c(ir,rn)}function Te(f,p){if(p=="as")return k.marked="keyword",c(ir)}function E(f,p){if(p=="from")return k.marked="keyword",c(j)}function jt(f){return f=="]"?c():P(Ce(xe,"]"))}function Dr(){return P(G("form"),st,Q("{"),G("}"),Ce(Tt,"}"),F,F)}function Tt(){return P(st,Lt)}function he(f,p){return f.lastType=="operator"||f.lastType==","||le.test(p.charAt(0))||/[,.]/.test(p.charAt(0))}function Bt(f,p,v){return p.tokenize==Z&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(p.lastType)||p.lastType=="quasi"&&/\{\s*$/.test(f.string.slice(0,f.pos-(v||0)))}return{startState:function(f){var p={tokenize:Z,lastType:"sof",cc:[],lexical:new Y((f||0)-Je,0,"block",!1),localVars:ve.localVars,context:ve.localVars&&new De(null,null,!1),indented:f||0};return ve.globalVars&&typeof ve.globalVars=="object"&&(p.globalVars=ve.globalVars),p},token:function(f,p){if(f.sol()&&(p.lexical.hasOwnProperty("align")||(p.lexical.align=!1),p.indented=f.indentation(),Re(f,p)),p.tokenize!=pe&&f.eatSpace())return null;var v=p.tokenize(f,p);return Ae=="comment"?v:(p.lastType=Ae=="operator"&&(Be=="++"||Be=="--")?"incdec":Ae,ke(p,v,Ae,Be,f))},indent:function(f,p){if(f.tokenize==pe||f.tokenize==Ge)return H.Pass;if(f.tokenize!=Z)return 0;var v=p&&p.charAt(0),b=f.lexical,q;if(!/^\s*else\b/.test(p))for(var se=f.cc.length-1;se>=0;--se){var fe=f.cc[se];if(fe==F)b=b.prev;else if(fe!=Nr&&fe!=We)break}for(;(b.type=="stat"||b.type=="form")&&(v=="}"||(q=f.cc[f.cc.length-1])&&(q==ce||q==He)&&!/^[,\.=+\-*:?[\(]/.test(p));)b=b.prev;pt&&b.type==")"&&b.prev.type=="stat"&&(b=b.prev);var _e=b.type,xt=v==_e;return _e=="vardef"?b.indented+(f.lastType=="operator"||f.lastType==","?b.info.length+1:0):_e=="form"&&v=="{"?b.indented:_e=="form"?b.indented+Je:_e=="stat"?b.indented+(he(f,p)?pt||Je:0):b.info=="switch"&&!xt&&ve.doubleIndentSwitch!=!1?b.indented+(/^(?:case|default)\b/.test(p)?Je:2*Je):b.align?b.column+(xt?0:1):b.indented+(xt?0:Je)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:z?null:"/*",blockCommentEnd:z?null:"*/",blockCommentContinue:z?null:" * ",lineComment:z?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:z?"json":"javascript",jsonldMode:Ie,jsonMode:z,expressionAllowed:Bt,skipExpression:function(f){ke(f,"atom","atom","true",new H.StringStream("",2,null))}}}),H.registerHelper("wordChars","javascript",/[\w$]/),H.defineMIME("text/javascript","javascript"),H.defineMIME("text/ecmascript","javascript"),H.defineMIME("application/javascript","javascript"),H.defineMIME("application/x-javascript","javascript"),H.defineMIME("application/ecmascript","javascript"),H.defineMIME("application/json",{name:"javascript",json:!0}),H.defineMIME("application/x-json",{name:"javascript",json:!0}),H.defineMIME("application/manifest+json",{name:"javascript",json:!0}),H.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),H.defineMIME("text/typescript",{name:"javascript",typescript:!0}),H.defineMIME("application/typescript",{name:"javascript",typescript:!0})})})();var vu=pu.exports,gu={exports:{}};(function(Qr,Wn){(function(H){H(On)})(function(H){H.defineMode("css",function(Y,_){var ke=_.inline;_.propertyKeywords||(_=H.resolveMode("text/css"));var k=Y.indentUnit,P=_.tokenHooks,c=_.documentTypes||{},D=_.mediaTypes||{},L=_.mediaFeatures||{},K=_.mediaValueKeywords||{},ue=_.propertyKeywords||{},De=_.nonStandardPropertyKeywords||{},Mt=_.fontProperties||{},Gt=_.counterDescriptors||{},Oe=_.colorKeywords||{},kt=_.valueKeywords||{},We=_.allowNested,G=_.lineComment,F=_.supportsAtComponent===!0,Q=Y.highlightNonStandardPropertyKeywords!==!1,ee,oe;function j(y,T){return ee=T,y}function xe(y,T){var w=y.next();if(P[w]){var ae=P[w](y,T);if(ae!==!1)return ae}if(w=="@")return y.eatWhile(/[\w\\\-]/),j("def",y.current());if(w=="="||(w=="~"||w=="|")&&y.eat("="))return j(null,"compare");if(w=='"'||w=="'")return T.tokenize=Pt(w),T.tokenize(y,T);if(w=="#")return y.eatWhile(/[\w\\\-]/),j("atom","hash");if(w=="!")return y.match(/^\s*\w*/),j("keyword","important");if(/\d/.test(w)||w=="."&&y.eat(/\d/))return y.eatWhile(/[\w.%]/),j("number","unit");if(w==="-"){if(/[\d.]/.test(y.peek()))return y.eatWhile(/[\w.%]/),j("number","unit");if(y.match(/^-[\w\\\-]*/))return y.eatWhile(/[\w\\\-]/),y.match(/^\s*:/,!1)?j("variable-2","variable-definition"):j("variable-2","variable");if(y.match(/^\w+-/))return j("meta","meta")}else return/[,+>*\/]/.test(w)?j(null,"select-op"):w=="."&&y.match(/^-?[_a-z][_a-z0-9-]*/i)?j("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(w)?j(null,w):y.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(y.current())&&(T.tokenize=zt),j("variable callee","variable")):/[\w\\\-]/.test(w)?(y.eatWhile(/[\w\\\-]/),j("property","word")):j(null,null)}function Pt(y){return function(T,w){for(var ae=!1,rt;(rt=T.next())!=null;){if(rt==y&&!ae){y==")"&&T.backUp(1);break}ae=!ae&&rt=="\\"}return(rt==y||!ae&&y!=")")&&(w.tokenize=null),j("string","string")}}function zt(y,T){return y.next(),y.match(/^\s*[\"\')]/,!1)?T.tokenize=null:T.tokenize=Pt(")"),j(null,"(")}function bt(y,T,w){this.type=y,this.indent=T,this.prev=w}function ce(y,T,w,ae){return y.context=new bt(w,T.indentation()+(ae===!1?0:k),y.context),w}function He(y){return y.context.prev&&(y.context=y.context.prev),y.context.type}function J(y,T,w){return ye[w.context.type](y,T,w)}function vt(y,T,w,ae){for(var rt=ae||1;rt>0;rt--)w.context=w.context.prev;return J(y,T,w)}function pr(y){var T=y.current().toLowerCase();kt.hasOwnProperty(T)?oe="atom":Oe.hasOwnProperty(T)?oe="keyword":oe="variable"}var ye={};return ye.top=function(y,T,w){if(y=="{")return ce(w,T,"block");if(y=="}"&&w.context.prev)return He(w);if(F&&/@component/i.test(y))return ce(w,T,"atComponentBlock");if(/^@(-moz-)?document$/i.test(y))return ce(w,T,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(y))return ce(w,T,"atBlock");if(/^@(font-face|counter-style)/i.test(y))return w.stateArg=y,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(y))return"keyframes";if(y&&y.charAt(0)=="@")return ce(w,T,"at");if(y=="hash")oe="builtin";else if(y=="word")oe="tag";else{if(y=="variable-definition")return"maybeprop";if(y=="interpolation")return ce(w,T,"interpolation");if(y==":")return"pseudo";if(We&&y=="(")return ce(w,T,"parens")}return w.context.type},ye.block=function(y,T,w){if(y=="word"){var ae=T.current().toLowerCase();return ue.hasOwnProperty(ae)?(oe="property","maybeprop"):De.hasOwnProperty(ae)?(oe=Q?"string-2":"property","maybeprop"):We?(oe=T.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(oe+=" error","maybeprop")}else return y=="meta"?"block":!We&&(y=="hash"||y=="qualifier")?(oe="error","block"):ye.top(y,T,w)},ye.maybeprop=function(y,T,w){return y==":"?ce(w,T,"prop"):J(y,T,w)},ye.prop=function(y,T,w){if(y==";")return He(w);if(y=="{"&&We)return ce(w,T,"propBlock");if(y=="}"||y=="{")return vt(y,T,w);if(y=="(")return ce(w,T,"parens");if(y=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(T.current()))oe+=" error";else if(y=="word")pr(T);else if(y=="interpolation")return ce(w,T,"interpolation");return"prop"},ye.propBlock=function(y,T,w){return y=="}"?He(w):y=="word"?(oe="property","maybeprop"):w.context.type},ye.parens=function(y,T,w){return y=="{"||y=="}"?vt(y,T,w):y==")"?He(w):y=="("?ce(w,T,"parens"):y=="interpolation"?ce(w,T,"interpolation"):(y=="word"&&pr(T),"parens")},ye.pseudo=function(y,T,w){return y=="meta"?"pseudo":y=="word"?(oe="variable-3",w.context.type):J(y,T,w)},ye.documentTypes=function(y,T,w){return y=="word"&&c.hasOwnProperty(T.current())?(oe="tag",w.context.type):ye.atBlock(y,T,w)},ye.atBlock=function(y,T,w){if(y=="(")return ce(w,T,"atBlock_parens");if(y=="}"||y==";")return vt(y,T,w);if(y=="{")return He(w)&&ce(w,T,We?"block":"top");if(y=="interpolation")return ce(w,T,"interpolation");if(y=="word"){var ae=T.current().toLowerCase();ae=="only"||ae=="not"||ae=="and"||ae=="or"?oe="keyword":D.hasOwnProperty(ae)?oe="attribute":L.hasOwnProperty(ae)?oe="property":K.hasOwnProperty(ae)?oe="keyword":ue.hasOwnProperty(ae)?oe="property":De.hasOwnProperty(ae)?oe=Q?"string-2":"property":kt.hasOwnProperty(ae)?oe="atom":Oe.hasOwnProperty(ae)?oe="keyword":oe="error"}return w.context.type},ye.atComponentBlock=function(y,T,w){return y=="}"?vt(y,T,w):y=="{"?He(w)&&ce(w,T,We?"block":"top",!1):(y=="word"&&(oe="error"),w.context.type)},ye.atBlock_parens=function(y,T,w){return y==")"?He(w):y=="{"||y=="}"?vt(y,T,w,2):ye.atBlock(y,T,w)},ye.restricted_atBlock_before=function(y,T,w){return y=="{"?ce(w,T,"restricted_atBlock"):y=="word"&&w.stateArg=="@counter-style"?(oe="variable","restricted_atBlock_before"):J(y,T,w)},ye.restricted_atBlock=function(y,T,w){return y=="}"?(w.stateArg=null,He(w)):y=="word"?(w.stateArg=="@font-face"&&!Mt.hasOwnProperty(T.current().toLowerCase())||w.stateArg=="@counter-style"&&!Gt.hasOwnProperty(T.current().toLowerCase())?oe="error":oe="property","maybeprop"):"restricted_atBlock"},ye.keyframes=function(y,T,w){return y=="word"?(oe="variable","keyframes"):y=="{"?ce(w,T,"top"):J(y,T,w)},ye.at=function(y,T,w){return y==";"?He(w):y=="{"||y=="}"?vt(y,T,w):(y=="word"?oe="tag":y=="hash"&&(oe="builtin"),"at")},ye.interpolation=function(y,T,w){return y=="}"?He(w):y=="{"||y==";"?vt(y,T,w):(y=="word"?oe="variable":y!="variable"&&y!="("&&y!=")"&&(oe="error"),"interpolation")},{startState:function(y){return{tokenize:null,state:ke?"block":"top",stateArg:null,context:new bt(ke?"block":"top",y||0,null)}},token:function(y,T){if(!T.tokenize&&y.eatSpace())return null;var w=(T.tokenize||xe)(y,T);return w&&typeof w=="object"&&(ee=w[1],w=w[0]),oe=w,ee!="comment"&&(T.state=ye[T.state](ee,y,T)),oe},indent:function(y,T){var w=y.context,ae=T&&T.charAt(0),rt=w.indent;return w.type=="prop"&&(ae=="}"||ae==")")&&(w=w.prev),w.prev&&(ae=="}"&&(w.type=="block"||w.type=="top"||w.type=="interpolation"||w.type=="restricted_atBlock")?(w=w.prev,rt=w.indent):(ae==")"&&(w.type=="parens"||w.type=="atBlock_parens")||ae=="{"&&(w.type=="at"||w.type=="atBlock"))&&(rt=Math.max(0,w.indent-k))),rt},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:G,fold:"brace"}});function ze(Y){for(var _={},ke=0;ke<Y.length;++ke)_[Y[ke].toLowerCase()]=!0;return _}var ve=["domain","regexp","url","url-prefix"],Je=ze(ve),pt=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],Ie=ze(pt),z=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],te=ze(z),U=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],re=ze(U),R=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],le=ze(R),ne=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],Ne=ze(ne),Ae=["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],Be=ze(Ae),$=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],Z=ze($),ie=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],pe=ze(ie),Ge=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],lt=ze(Ge),Re=ve.concat(pt).concat(z).concat(U).concat(R).concat(ne).concat(ie).concat(Ge);H.registerHelper("hintWords","css",Re);function Ke(Y,_){for(var ke=!1,k;(k=Y.next())!=null;){if(ke&&k=="/"){_.tokenize=null;break}ke=k=="*"}return["comment","comment"]}H.defineMIME("text/css",{documentTypes:Je,mediaTypes:Ie,mediaFeatures:te,mediaValueKeywords:re,propertyKeywords:le,nonStandardPropertyKeywords:Ne,fontProperties:Be,counterDescriptors:Z,colorKeywords:pe,valueKeywords:lt,tokenHooks:{"/":function(Y,_){return Y.eat("*")?(_.tokenize=Ke,Ke(Y,_)):!1}},name:"css"}),H.defineMIME("text/x-scss",{mediaTypes:Ie,mediaFeatures:te,mediaValueKeywords:re,propertyKeywords:le,nonStandardPropertyKeywords:Ne,colorKeywords:pe,valueKeywords:lt,fontProperties:Be,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(Y,_){return Y.eat("/")?(Y.skipToEnd(),["comment","comment"]):Y.eat("*")?(_.tokenize=Ke,Ke(Y,_)):["operator","operator"]},":":function(Y){return Y.match(/^\s*\{/,!1)?[null,null]:!1},$:function(Y){return Y.match(/^[\w-]+/),Y.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(Y){return Y.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),H.defineMIME("text/x-less",{mediaTypes:Ie,mediaFeatures:te,mediaValueKeywords:re,propertyKeywords:le,nonStandardPropertyKeywords:Ne,colorKeywords:pe,valueKeywords:lt,fontProperties:Be,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(Y,_){return Y.eat("/")?(Y.skipToEnd(),["comment","comment"]):Y.eat("*")?(_.tokenize=Ke,Ke(Y,_)):["operator","operator"]},"@":function(Y){return Y.eat("{")?[null,"interpolation"]:Y.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)?!1:(Y.eatWhile(/[\w\\\-]/),Y.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),H.defineMIME("text/x-gss",{documentTypes:Je,mediaTypes:Ie,mediaFeatures:te,propertyKeywords:le,nonStandardPropertyKeywords:Ne,fontProperties:Be,counterDescriptors:Z,colorKeywords:pe,valueKeywords:lt,supportsAtComponent:!0,tokenHooks:{"/":function(Y,_){return Y.eat("*")?(_.tokenize=Ke,Ke(Y,_)):!1}},name:"css",helperType:"gss"})})})();var mu=gu.exports,fl={exports:{}},cl;function yu(){return cl||(cl=1,function(Qr,Wn){(function(H){H(On)})(function(H){var ze={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},ve={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};H.defineMode("xml",function(Je,pt){var Ie=Je.indentUnit,z={},te=pt.htmlMode?ze:ve;for(var U in te)z[U]=te[U];for(var U in pt)z[U]=pt[U];var re,R;function le(c,D){function L(De){return D.tokenize=De,De(c,D)}var K=c.next();if(K=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?L(Ae("atom","]]>")):null:c.match("--")?L(Ae("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),L(Be(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),D.tokenize=Ae("meta","?>"),"meta"):(re=c.eat("/")?"closeTag":"openTag",D.tokenize=ne,"tag bracket");if(K=="&"){var ue;return c.eat("#")?c.eat("x")?ue=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):ue=c.eatWhile(/[\d]/)&&c.eat(";"):ue=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),ue?"atom":"error"}else return c.eatWhile(/[^&<]/),null}le.isInText=!0;function ne(c,D){var L=c.next();if(L==">"||L=="/"&&c.eat(">"))return D.tokenize=le,re=L==">"?"endTag":"selfcloseTag","tag bracket";if(L=="=")return re="equals",null;if(L=="<"){D.tokenize=le,D.state=Ge,D.tagName=D.tagStart=null;var K=D.tokenize(c,D);return K?K+" tag error":"tag error"}else return/[\'\"]/.test(L)?(D.tokenize=Ne(L),D.stringStartCol=c.column(),D.tokenize(c,D)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Ne(c){var D=function(L,K){for(;!L.eol();)if(L.next()==c){K.tokenize=ne;break}return"string"};return D.isInAttribute=!0,D}function Ae(c,D){return function(L,K){for(;!L.eol();){if(L.match(D)){K.tokenize=le;break}L.next()}return c}}function Be(c){return function(D,L){for(var K;(K=D.next())!=null;){if(K=="<")return L.tokenize=Be(c+1),L.tokenize(D,L);if(K==">")if(c==1){L.tokenize=le;break}else return L.tokenize=Be(c-1),L.tokenize(D,L)}return"meta"}}function $(c){return c&&c.toLowerCase()}function Z(c,D,L){this.prev=c.context,this.tagName=D||"",this.indent=c.indented,this.startOfLine=L,(z.doNotIndent.hasOwnProperty(D)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function ie(c){c.context&&(c.context=c.context.prev)}function pe(c,D){for(var L;;){if(!c.context||(L=c.context.tagName,!z.contextGrabbers.hasOwnProperty($(L))||!z.contextGrabbers[$(L)].hasOwnProperty($(D))))return;ie(c)}}function Ge(c,D,L){return c=="openTag"?(L.tagStart=D.column(),lt):c=="closeTag"?Re:Ge}function lt(c,D,L){return c=="word"?(L.tagName=D.current(),R="tag",_):z.allowMissingTagName&&c=="endTag"?(R="tag bracket",_(c,D,L)):(R="error",lt)}function Re(c,D,L){if(c=="word"){var K=D.current();return L.context&&L.context.tagName!=K&&z.implicitlyClosed.hasOwnProperty($(L.context.tagName))&&ie(L),L.context&&L.context.tagName==K||z.matchClosing===!1?(R="tag",Ke):(R="tag error",Y)}else return z.allowMissingTagName&&c=="endTag"?(R="tag bracket",Ke(c,D,L)):(R="error",Y)}function Ke(c,D,L){return c!="endTag"?(R="error",Ke):(ie(L),Ge)}function Y(c,D,L){return R="error",Ke(c,D,L)}function _(c,D,L){if(c=="word")return R="attribute",ke;if(c=="endTag"||c=="selfcloseTag"){var K=L.tagName,ue=L.tagStart;return L.tagName=L.tagStart=null,c=="selfcloseTag"||z.autoSelfClosers.hasOwnProperty($(K))?pe(L,K):(pe(L,K),L.context=new Z(L,K,ue==L.indented)),Ge}return R="error",_}function ke(c,D,L){return c=="equals"?k:(z.allowMissing||(R="error"),_(c,D,L))}function k(c,D,L){return c=="string"?P:c=="word"&&z.allowUnquoted?(R="string",_):(R="error",_(c,D,L))}function P(c,D,L){return c=="string"?P:_(c,D,L)}return{startState:function(c){var D={tokenize:le,state:Ge,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(D.baseIndent=c),D},token:function(c,D){if(!D.tagName&&c.sol()&&(D.indented=c.indentation()),c.eatSpace())return null;re=null;var L=D.tokenize(c,D);return(L||re)&&L!="comment"&&(R=null,D.state=D.state(re||L,c,D),R&&(L=R=="error"?L+" error":R)),L},indent:function(c,D,L){var K=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+Ie;if(K&&K.noIndent)return H.Pass;if(c.tokenize!=ne&&c.tokenize!=le)return L?L.match(/^(\s*)/)[0].length:0;if(c.tagName)return z.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+Ie*(z.multilineTagIndentFactor||1);if(z.alignCDATA&&/<!\[CDATA\[/.test(D))return 0;var ue=D&&/^<(\/)?([\w_:\.-]*)/.exec(D);if(ue&&ue[1])for(;K;)if(K.tagName==ue[2]){K=K.prev;break}else if(z.implicitlyClosed.hasOwnProperty($(K.tagName)))K=K.prev;else break;else if(ue)for(;K;){var De=z.contextGrabbers[$(K.tagName)];if(De&&De.hasOwnProperty($(ue[2])))K=K.prev;else break}for(;K&&K.prev&&!K.startOfLine;)K=K.prev;return K?K.indent+Ie:c.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:z.htmlMode?"html":"xml",helperType:z.htmlMode?"html":"xml",skipAttribute:function(c){c.state==k&&(c.state=_)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var D=[],L=c.context;L;L=L.prev)D.push(L.tagName);return D.reverse()}}}),H.defineMIME("text/xml","xml"),H.defineMIME("application/xml","xml"),H.mimeModes.hasOwnProperty("text/html")||H.defineMIME("text/html",{name:"xml",htmlMode:!0})})}()),fl.exports}(function(Qr,Wn){(function(H){H(On,yu(),vu,mu)})(function(H){var ze={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 ve(re,R,le){var ne=re.current(),Ne=ne.search(R);return Ne>-1?re.backUp(ne.length-Ne):ne.match(/<\/?$/)&&(re.backUp(ne.length),re.match(R,!1)||re.match(ne)),le}var Je={};function pt(re){var R=Je[re];return R||(Je[re]=new RegExp("\\s+"+re+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function Ie(re,R){var le=re.match(pt(R));return le?/^\s*(.*?)\s*$/.exec(le[2])[1]:""}function z(re,R){return new RegExp((R?"^":"")+"</\\s*"+re+"\\s*>","i")}function te(re,R){for(var le in re)for(var ne=R[le]||(R[le]=[]),Ne=re[le],Ae=Ne.length-1;Ae>=0;Ae--)ne.unshift(Ne[Ae])}function U(re,R){for(var le=0;le<re.length;le++){var ne=re[le];if(!ne[0]||ne[1].test(Ie(R,ne[0])))return ne[2]}}H.defineMode("htmlmixed",function(re,R){var le=H.getMode(re,{name:"xml",htmlMode:!0,multilineTagIndentFactor:R.multilineTagIndentFactor,multilineTagIndentPastTag:R.multilineTagIndentPastTag,allowMissingTagName:R.allowMissingTagName}),ne={},Ne=R&&R.tags,Ae=R&&R.scriptTypes;if(te(ze,ne),Ne&&te(Ne,ne),Ae)for(var Be=Ae.length-1;Be>=0;Be--)ne.script.unshift(["type",Ae[Be].matches,Ae[Be].mode]);function $(Z,ie){var pe=le.token(Z,ie.htmlState),Ge=/\btag\b/.test(pe),lt;if(Ge&&!/[<>\s\/]/.test(Z.current())&&(lt=ie.htmlState.tagName&&ie.htmlState.tagName.toLowerCase())&&ne.hasOwnProperty(lt))ie.inTag=lt+" ";else if(ie.inTag&&Ge&&/>$/.test(Z.current())){var Re=/^([\S]+) (.*)/.exec(ie.inTag);ie.inTag=null;var Ke=Z.current()==">"&&U(ne[Re[1]],Re[2]),Y=H.getMode(re,Ke),_=z(Re[1],!0),ke=z(Re[1],!1);ie.token=function(k,P){return k.match(_,!1)?(P.token=$,P.localState=P.localMode=null,null):ve(k,ke,P.localMode.token(k,P.localState))},ie.localMode=Y,ie.localState=H.startState(Y,le.indent(ie.htmlState,"",""))}else ie.inTag&&(ie.inTag+=Z.current(),Z.eol()&&(ie.inTag+=" "));return pe}return{startState:function(){var Z=H.startState(le);return{token:$,inTag:null,localMode:null,localState:null,htmlState:Z}},copyState:function(Z){var ie;return Z.localState&&(ie=H.copyState(Z.localMode,Z.localState)),{token:Z.token,inTag:Z.inTag,localMode:Z.localMode,localState:ie,htmlState:H.copyState(le,Z.htmlState)}},token:function(Z,ie){return ie.token(Z,ie)},indent:function(Z,ie,pe){return!Z.localMode||/^\s*<\//.test(ie)?le.indent(Z.htmlState,ie,pe):Z.localMode.indent?Z.localMode.indent(Z.localState,ie,pe):H.Pass},innerMode:function(Z){return{state:Z.localState||Z.htmlState,mode:Z.localMode||le}}}},"xml","javascript","css"),H.defineMIME("text/html","htmlmixed")})})();export{xu as C};
|