@data-fair/app-calendar 1.2.11 → 1.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,49 +0,0 @@
1
- import{bV as vf,bW as Kl,b7 as mf}from"./index-DRlPnsoW.js";import{m as yf}from"./EventEdit-CjDoNXEo.js";var Xl={exports:{}};(function(f,x){(function(c,m){f.exports=m()})(vf,function(){var c=navigator.userAgent,m=navigator.platform,p=/gecko\/\d/i.test(c),S=/MSIE \d/.test(c),d=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(c),v=/Edge\/(\d+)/.exec(c),g=S||d||v,k=g&&(S?document.documentMode||6:+(v||d)[1]),E=!v&&/WebKit\//.test(c),N=E&&/Qt\/\d+\.\d+/.test(c),M=!v&&/Chrome\/(\d+)/.exec(c),O=M&&+M[1],I=/Opera\//.test(c),Z=/Apple Computer/.test(navigator.vendor),_=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(c),j=/PhantomJS/.test(c),D=Z&&(/Mobile\/\w+/.test(c)||navigator.maxTouchPoints>2),A=/Android/.test(c),H=D||A||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(c),z=D||/Mac/.test(m),G=/\bCrOS\b/.test(c),B=/win/i.test(m),Q=I&&c.match(/Version\/(\d*\.\d*)/);Q&&(Q=Number(Q[1])),Q&&Q>=15&&(I=!1,E=!0);var re=z&&(N||I&&(Q==null||Q<12.11)),we=p||g&&k>=9;function K(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var fe=function(e,t){var i=e.className,r=K(t).exec(i);if(r){var n=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(n?r[1]+n:"")}};function ce(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function le(e,t){return ce(e).appendChild(t)}function L(e,t,i,r){var n=document.createElement(e);if(i&&(n.className=i),r&&(n.style.cssText=r),typeof t=="string")n.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)n.appendChild(t[a]);return n}function q(e,t,i,r){var n=L(e,t,i,r);return n.setAttribute("role","presentation"),n}var R;document.createRange?R=function(e,t,i,r){var n=document.createRange();return n.setEnd(r||e,i),n.setStart(e,t),n}:R=function(e,t,i){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",i),r.moveStart("character",t),r};function ee(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 ge(e){var t=e.ownerDocument||e,i;try{i=e.activeElement}catch{i=t.body||null}for(;i&&i.shadowRoot&&i.shadowRoot.activeElement;)i=i.shadowRoot.activeElement;return i}function qe(e,t){var i=e.className;K(t).test(i)||(e.className+=(i?" ":"")+t)}function Nt(e,t){for(var i=e.split(" "),r=0;r<i.length;r++)i[r]&&!K(i[r]).test(t)&&(t+=" "+i[r]);return t}var w=function(e){e.select()};D?w=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:g&&(w=function(e){try{e.select()}catch{}});function h(e){return e.display.wrapper.ownerDocument}function te(e){return ve(e.display.wrapper)}function ve(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function he(e){return h(e).defaultView}function Je(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function ot(e,t,i){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(i!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function Oe(e,t,i,r,n){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var a=r||0,o=n||0;;){var l=e.indexOf(" ",a);if(l<0||l>=t)return o+(t-a);o+=l-a,o+=i-o%i,a=l+1}}var Xe=function(){this.id=null,this.f=null,this.time=0,this.handler=Je(this.onTimeout,this)};Xe.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Xe.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function ke(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var Me=50,Ie={toString:function(){return"CodeMirror.Pass"}},Qe={scroll:!1},Nr={origin:"*mouse"},mt={origin:"+move"};function yt(e,t,i){for(var r=0,n=0;;){var a=e.indexOf(" ",r);a==-1&&(a=e.length);var o=a-r;if(a==e.length||n+o>=t)return r+Math.min(o,t-n);if(n+=a-r,n+=i-n%i,r=a+1,n>=t)return r}}var ct=[""];function Ht(e){for(;ct.length<=e;)ct.push(pe(ct)+" ");return ct[e]}function pe(e){return e[e.length-1]}function ht(e,t){for(var i=[],r=0;r<e.length;r++)i[r]=t(e[r],r);return i}function Ot(e,t,i){for(var r=0,n=i(t);r<e.length&&i(e[r])<=n;)r++;e.splice(r,0,t)}function di(){}function Ha(e,t){var i;return Object.create?i=Object.create(e):(di.prototype=e,i=new di),t&&ot(t,i),i}var is=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function vn(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||is.test(e))}function pi(e,t){return t?t.source.indexOf("\\w")>-1&&vn(e)?!0:t.test(e):vn(e)}function Oa(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ns=/[\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 mn(e){return e.charCodeAt(0)>=768&&ns.test(e)}function Ia(e,t,i){for(;(i<0?t>0:t<e.length)&&mn(e.charAt(t));)t+=i;return t}function Hr(e,t,i){for(var r=t>i?-1:1;;){if(t==i)return t;var n=(t+i)/2,a=r<0?Math.ceil(n):Math.floor(n);if(a==t)return e(a)?t:i;e(a)?i=a:t=a+r}}function as(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var n=!1,a=0;a<e.length;++a){var o=e[a];(o.from<i&&o.to>t||t==i&&o.to==t)&&(r(Math.max(o.from,t),Math.min(o.to,i),o.level==1?"rtl":"ltr",a),n=!0)}n||r(t,i,"ltr")}var Or=null;function Ir(e,t,i){var r;Or=null;for(var n=0;n<e.length;++n){var a=e[n];if(a.from<t&&a.to>t)return n;a.to==t&&(a.from!=a.to&&i=="before"?r=n:Or=n),a.from==t&&(a.from!=a.to&&i!="before"?r=n:Or=n)}return r??Or}var os=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(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]/,n=/[stwN]/,a=/[LRr]/,o=/[Lb1n]/,l=/[1n]/;function s(u,y,b){this.level=u,this.from=y,this.to=b}return function(u,y){var b=y=="ltr"?"L":"R";if(u.length==0||y=="ltr"&&!r.test(u))return!1;for(var T=u.length,C=[],F=0;F<T;++F)C.push(i(u.charCodeAt(F)));for(var P=0,U=b;P<T;++P){var X=C[P];X=="m"?C[P]=U:U=X}for(var J=0,Y=b;J<T;++J){var $=C[J];$=="1"&&Y=="r"?C[J]="n":a.test($)&&(Y=$,$=="r"&&(C[J]="R"))}for(var ae=1,ne=C[0];ae<T-1;++ae){var de=C[ae];de=="+"&&ne=="1"&&C[ae+1]=="1"?C[ae]="1":de==","&&ne==C[ae+1]&&(ne=="1"||ne=="n")&&(C[ae]=ne),ne=de}for(var be=0;be<T;++be){var _e=C[be];if(_e==",")C[be]="N";else if(_e=="%"){var Te=void 0;for(Te=be+1;Te<T&&C[Te]=="%";++Te);for(var at=be&&C[be-1]=="!"||Te<T&&C[Te]=="1"?"1":"N",tt=be;tt<Te;++tt)C[tt]=at;be=Te-1}}for(var Ne=0,rt=b;Ne<T;++Ne){var Ge=C[Ne];rt=="L"&&Ge=="1"?C[Ne]="L":a.test(Ge)&&(rt=Ge)}for(var Pe=0;Pe<T;++Pe)if(n.test(C[Pe])){var He=void 0;for(He=Pe+1;He<T&&n.test(C[He]);++He);for(var De=(Pe?C[Pe-1]:b)=="L",it=(He<T?C[He]:b)=="L",Dr=De==it?De?"L":"R":b,qt=Pe;qt<He;++qt)C[qt]=Dr;Pe=He-1}for(var Ke=[],kt,Ue=0;Ue<T;)if(o.test(C[Ue])){var ka=Ue;for(++Ue;Ue<T&&o.test(C[Ue]);++Ue);Ke.push(new s(0,ka,Ue))}else{var Et=Ue,ir=Ke.length,nr=y=="rtl"?1:0;for(++Ue;Ue<T&&C[Ue]!="L";++Ue);for(var Ze=Et;Ze<Ue;)if(l.test(C[Ze])){Et<Ze&&(Ke.splice(ir,0,new s(1,Et,Ze)),ir+=nr);var Fr=Ze;for(++Ze;Ze<Ue&&l.test(C[Ze]);++Ze);Ke.splice(ir,0,new s(2,Fr,Ze)),ir+=nr,Et=Ze}else++Ze;Et<Ue&&Ke.splice(ir,0,new s(1,Et,Ue))}return y=="ltr"&&(Ke[0].level==1&&(kt=u.match(/^\s+/))&&(Ke[0].from=kt[0].length,Ke.unshift(new s(0,0,kt[0].length))),pe(Ke).level==1&&(kt=u.match(/\s+$/))&&(pe(Ke).to-=kt[0].length,Ke.push(new s(0,T-kt[0].length,T)))),y=="rtl"?Ke.reverse():Ke}}();function Ct(e,t){var i=e.order;return i==null&&(i=e.order=os(e.text,t)),i}var Pa=[],oe=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Pa).concat(i)}};function yn(e,t){return e._handlers&&e._handlers[t]||Pa}function lt(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var r=e._handlers,n=r&&r[t];if(n){var a=ke(n,i);a>-1&&(r[t]=n.slice(0,a).concat(n.slice(a+1)))}}}function Ee(e,t){var i=yn(e,t);if(i.length)for(var r=Array.prototype.slice.call(arguments,2),n=0;n<i.length;++n)i[n].apply(null,r)}function Be(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ee(e,i||t.type,e,t),xn(t)||t.codemirrorIgnore}function Ba(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)ke(i,t[r])==-1&&i.push(t[r])}function ft(e,t){return yn(e,t).length>0}function sr(e){e.prototype.on=function(t,i){oe(this,t,i)},e.prototype.off=function(t,i){lt(this,t,i)}}function Ve(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ra(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function xn(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Pr(e){Ve(e),Ra(e)}function bn(e){return e.target||e.srcElement}function Wa(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),z&&e.ctrlKey&&t==1&&(t=3),t}var ls=function(){if(g&&k<9)return!1;var e=L("div");return"draggable"in e||"dragDrop"in e}(),Sn;function ss(e){if(Sn==null){var t=L("span","​");le(e,L("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Sn=t.offsetWidth<=1&&t.offsetHeight>2&&!(g&&k<8))}var i=Sn?L("span","​"):L("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var wn;function us(e){if(wn!=null)return wn;var t=le(e,document.createTextNode("AخA")),i=R(t,0,1).getBoundingClientRect(),r=R(t,1,2).getBoundingClientRect();return ce(e),!i||i.left==i.right?!1:wn=r.right-i.right<3}var kn=`
2
-
3
- b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var n=e.indexOf(`
4
- `,t);n==-1&&(n=e.length);var a=e.slice(t,e.charAt(n-1)=="\r"?n-1:n),o=a.indexOf("\r");o!=-1?(i.push(a.slice(0,o)),t+=o+1):(i.push(a),t=n+1)}return i}:function(e){return e.split(/\r\n?|\n/)},fs=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},cs=function(){var e=L("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Cn=null;function hs(e){if(Cn!=null)return Cn;var t=le(e,L("span","x")),i=t.getBoundingClientRect(),r=R(t,0,1).getBoundingClientRect();return Cn=Math.abs(i.left-r.left)>1}var Ln={},ur={};function ds(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ln[e]=t}function ps(e,t){ur[e]=t}function gi(e){if(typeof e=="string"&&ur.hasOwnProperty(e))e=ur[e];else if(e&&typeof e.name=="string"&&ur.hasOwnProperty(e.name)){var t=ur[e.name];typeof t=="string"&&(t={name:t}),e=Ha(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return gi("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return gi("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Tn(e,t){t=gi(t);var i=Ln[t.name];if(!i)return Tn(e,"text/plain");var r=i(e,t);if(fr.hasOwnProperty(t.name)){var n=fr[t.name];for(var a in n)n.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r["_"+a]=r[a]),r[a]=n[a])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)r[o]=t.modeProps[o];return r}var fr={};function gs(e,t){var i=fr.hasOwnProperty(e)?fr[e]:fr[e]={};ot(t,i)}function Kt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var n=t[r];n instanceof Array&&(n=n.concat([])),i[r]=n}return i}function Mn(e,t){for(var i;e.innerMode&&(i=e.innerMode(t),!(!i||i.mode==e));)t=i.state,e=i.mode;return i||{mode:e,state:t}}function za(e,t,i){return e.startState?e.startState(t,i):!0}var Ae=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};Ae.prototype.eol=function(){return this.pos>=this.string.length},Ae.prototype.sol=function(){return this.pos==this.lineStart},Ae.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ae.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ae.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},Ae.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ae.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ae.prototype.skipToEnd=function(){this.pos=this.string.length},Ae.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ae.prototype.backUp=function(e){this.pos-=e},Ae.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Oe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Oe(this.string,this.lineStart,this.tabSize):0)},Ae.prototype.indentation=function(){return Oe(this.string,null,this.tabSize)-(this.lineStart?Oe(this.string,this.lineStart,this.tabSize):0)},Ae.prototype.match=function(e,t,i){if(typeof e=="string"){var r=function(o){return i?o.toLowerCase():o},n=this.string.substr(this.pos,e.length);if(r(n)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var a=this.string.slice(this.pos).match(e);return a&&a.index>0?null:(a&&t!==!1&&(this.pos+=a[0].length),a)}},Ae.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ae.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ae.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ae.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ie(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var n=i.children[r],a=n.chunkSize();if(t<a){i=n;break}t-=a}return i.lines[t]}function Xt(e,t,i){var r=[],n=t.line;return e.iter(t.line,i.line+1,function(a){var o=a.text;n==i.line&&(o=o.slice(0,i.ch)),n==t.line&&(o=o.slice(t.ch)),r.push(o),++n}),r}function Dn(e,t,i){var r=[];return e.iter(t,i,function(n){r.push(n.text)}),r}function xt(e,t){var i=t-e.height;if(i)for(var r=e;r;r=r.parent)r.height+=i}function ye(e){if(e.parent==null)return null;for(var t=e.parent,i=ke(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var n=0;r.children[n]!=t;++n)i+=r.children[n].chunkSize();return i+t.first}function Yt(e,t){var i=e.first;e:do{for(var r=0;r<e.children.length;++r){var n=e.children[r],a=n.height;if(t<a){e=n;continue e}t-=a,i+=n.chunkSize()}return i}while(!e.lines);for(var o=0;o<e.lines.length;++o){var l=e.lines[o],s=l.height;if(t<s)break;t-=s}return i+o}function Br(e,t){return t>=e.first&&t<e.first+e.size}function Fn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function W(e,t,i){if(i===void 0&&(i=null),!(this instanceof W))return new W(e,t,i);this.line=e,this.ch=t,this.sticky=i}function se(e,t){return e.line-t.line||e.ch-t.ch}function En(e,t){return e.sticky==t.sticky&&se(e,t)==0}function An(e){return W(e.line,e.ch)}function vi(e,t){return se(e,t)<0?t:e}function mi(e,t){return se(e,t)<0?e:t}function _a(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ue(e,t){if(t.line<e.first)return W(e.first,0);var i=e.first+e.size-1;return t.line>i?W(i,ie(e,i).text.length):vs(t,ie(e,t.line).text.length)}function vs(e,t){var i=e.ch;return i==null||i>t?W(e.line,t):i<0?W(e.line,0):e}function Ua(e,t){for(var i=[],r=0;r<t.length;r++)i[r]=ue(e,t[r]);return i}var yi=function(e,t){this.state=e,this.lookAhead=t},bt=function(e,t,i,r){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};bt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},bt.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}},bt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},bt.fromSaved=function(e,t,i){return t instanceof yi?new bt(e,Kt(e.mode,t.state),i,t.lookAhead):new bt(e,Kt(e.mode,t),i)},bt.prototype.save=function(e){var t=e!==!1?Kt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new yi(t,this.maxLookAhead):t};function qa(e,t,i,r){var n=[e.state.modeGen],a={};Za(e,t.text,e.doc.mode,i,function(u,y){return n.push(u,y)},a,r);for(var o=i.state,l=function(u){i.baseTokens=n;var y=e.state.overlays[u],b=1,T=0;i.state=!0,Za(e,t.text,y.mode,i,function(C,F){for(var P=b;T<C;){var U=n[b];U>C&&n.splice(b,1,C,n[b+1],U),b+=2,T=Math.min(C,U)}if(F)if(y.opaque)n.splice(P,b-P,C,"overlay "+F),b=P+2;else for(;P<b;P+=2){var X=n[P+1];n[P+1]=(X?X+" ":"")+"overlay "+F}},a),i.state=o,i.baseTokens=null,i.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)l(s);return{styles:n,classes:a.bgClass||a.textClass?a:null}}function Ga(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Rr(e,ye(t)),n=t.text.length>e.options.maxHighlightLength&&Kt(e.doc.mode,r.state),a=qa(e,t,r);n&&(r.state=n),t.stateAfter=r.save(!n),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Rr(e,t,i){var r=e.doc,n=e.display;if(!r.mode.startState)return new bt(r,!0,t);var a=ms(e,t,i),o=a>r.first&&ie(r,a-1).stateAfter,l=o?bt.fromSaved(r,o,a):new bt(r,za(r.mode),a);return r.iter(a,t,function(s){Nn(e,s.text,l);var u=l.line;s.stateAfter=u==t-1||u%5==0||u>=n.viewFrom&&u<n.viewTo?l.save():null,l.nextLine()}),i&&(r.modeFrontier=l.line),l}function Nn(e,t,i,r){var n=e.doc.mode,a=new Ae(t,e.options.tabSize,i);for(a.start=a.pos=r||0,t==""&&ja(n,i.state);!a.eol();)Hn(n,a,i.state),a.start=a.pos}function ja(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var i=Mn(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}}function Hn(e,t,i,r){for(var n=0;n<10;n++){r&&(r[0]=Mn(e,i).mode);var a=e.token(t,i);if(t.pos>t.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}var Ka=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Xa(e,t,i,r){var n=e.doc,a=n.mode,o;t=ue(n,t);var l=ie(n,t.line),s=Rr(e,t.line,i),u=new Ae(l.text,e.options.tabSize,s),y;for(r&&(y=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,o=Hn(a,u,s.state),r&&y.push(new Ka(u,o,Kt(n.mode,s.state)));return r?y:new Ka(u,o,s.state)}function Ya(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var r=i[1]?"bgClass":"textClass";t[r]==null?t[r]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+i[2])}return e}function Za(e,t,i,r,n,a,o){var l=i.flattenSpans;l==null&&(l=e.options.flattenSpans);var s=0,u=null,y=new Ae(t,e.options.tabSize,r),b,T=e.options.addModeClass&&[null];for(t==""&&Ya(ja(i,r.state),a);!y.eol();){if(y.pos>e.options.maxHighlightLength?(l=!1,o&&Nn(e,t,r,y.pos),y.pos=t.length,b=null):b=Ya(Hn(i,y,r.state,T),a),T){var C=T[0].name;C&&(b="m-"+(b?C+" "+b:C))}if(!l||u!=b){for(;s<y.start;)s=Math.min(y.start,s+5e3),n(s,u);u=b}y.start=y.pos}for(;s<y.pos;){var F=Math.min(y.pos,s+5e3);n(F,u),s=F}}function ms(e,t,i){for(var r,n,a=e.doc,o=i?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>o;--l){if(l<=a.first)return a.first;var s=ie(a,l-1),u=s.stateAfter;if(u&&(!i||l+(u instanceof yi?u.lookAhead:0)<=a.modeFrontier))return l;var y=Oe(s.text,null,e.options.tabSize);(n==null||r>y)&&(n=l-1,r=y)}return n}function ys(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var i=e.first,r=t-1;r>i;r--){var n=ie(e,r).stateAfter;if(n&&(!(n instanceof yi)||r+n.lookAhead<t)){i=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}}var Ja=!1,Lt=!1;function xs(){Ja=!0}function bs(){Lt=!0}function xi(e,t,i){this.marker=e,this.from=t,this.to=i}function Wr(e,t){if(e)for(var i=0;i<e.length;++i){var r=e[i];if(r.marker==t)return r}}function Ss(e,t){for(var i,r=0;r<e.length;++r)e[r]!=t&&(i||(i=[])).push(e[r]);return i}function ws(e,t,i){var r=i&&window.WeakSet&&(i.markedSpans||(i.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 ks(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var a=e[n],o=a.marker,l=a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t);if(l||a.from==t&&o.type=="bookmark"&&(!i||!a.marker.insertLeft)){var s=a.to==null||(o.inclusiveRight?a.to>=t:a.to>t);(r||(r=[])).push(new xi(o,a.from,s?null:a.to))}}return r}function Cs(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var a=e[n],o=a.marker,l=a.to==null||(o.inclusiveRight?a.to>=t:a.to>t);if(l||a.from==t&&o.type=="bookmark"&&(!i||a.marker.insertLeft)){var s=a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t);(r||(r=[])).push(new xi(o,s?null:a.from-t,a.to==null?null:a.to-t))}}return r}function On(e,t){if(t.full)return null;var i=Br(e,t.from.line)&&ie(e,t.from.line).markedSpans,r=Br(e,t.to.line)&&ie(e,t.to.line).markedSpans;if(!i&&!r)return null;var n=t.from.ch,a=t.to.ch,o=se(t.from,t.to)==0,l=ks(i,n,o),s=Cs(r,a,o),u=t.text.length==1,y=pe(t.text).length+(u?n:0);if(l)for(var b=0;b<l.length;++b){var T=l[b];if(T.to==null){var C=Wr(s,T.marker);C?u&&(T.to=C.to==null?null:C.to+y):T.to=n}}if(s)for(var F=0;F<s.length;++F){var P=s[F];if(P.to!=null&&(P.to+=y),P.from==null){var U=Wr(l,P.marker);U||(P.from=y,u&&(l||(l=[])).push(P))}else P.from+=y,u&&(l||(l=[])).push(P)}l&&(l=Qa(l)),s&&s!=l&&(s=Qa(s));var X=[l];if(!u){var J=t.text.length-2,Y;if(J>0&&l)for(var $=0;$<l.length;++$)l[$].to==null&&(Y||(Y=[])).push(new xi(l[$].marker,null,null));for(var ae=0;ae<J;++ae)X.push(Y);X.push(s)}return X}function Qa(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Ls(e,t,i){var r=null;if(e.iter(t.line,i.line+1,function(C){if(C.markedSpans)for(var F=0;F<C.markedSpans.length;++F){var P=C.markedSpans[F].marker;P.readOnly&&(!r||ke(r,P)==-1)&&(r||(r=[])).push(P)}}),!r)return null;for(var n=[{from:t,to:i}],a=0;a<r.length;++a)for(var o=r[a],l=o.find(0),s=0;s<n.length;++s){var u=n[s];if(!(se(u.to,l.from)<0||se(u.from,l.to)>0)){var y=[s,1],b=se(u.from,l.from),T=se(u.to,l.to);(b<0||!o.inclusiveLeft&&!b)&&y.push({from:u.from,to:l.from}),(T>0||!o.inclusiveRight&&!T)&&y.push({from:l.to,to:u.to}),n.splice.apply(n,y),s+=y.length-3}}return n}function Va(e){var t=e.markedSpans;if(t){for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}}function $a(e,t){if(t){for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}}function bi(e){return e.inclusiveLeft?-1:0}function Si(e){return e.inclusiveRight?1:0}function In(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var r=e.find(),n=t.find(),a=se(r.from,n.from)||bi(e)-bi(t);if(a)return-a;var o=se(r.to,n.to)||Si(e)-Si(t);return o||t.id-e.id}function eo(e,t){var i=Lt&&e.markedSpans,r;if(i)for(var n=void 0,a=0;a<i.length;++a)n=i[a],n.marker.collapsed&&(t?n.from:n.to)==null&&(!r||In(r,n.marker)<0)&&(r=n.marker);return r}function to(e){return eo(e,!0)}function wi(e){return eo(e,!1)}function Ts(e,t){var i=Lt&&e.markedSpans,r;if(i)for(var n=0;n<i.length;++n){var a=i[n];a.marker.collapsed&&(a.from==null||a.from<t)&&(a.to==null||a.to>t)&&(!r||In(r,a.marker)<0)&&(r=a.marker)}return r}function ro(e,t,i,r,n){var a=ie(e,t),o=Lt&&a.markedSpans;if(o)for(var l=0;l<o.length;++l){var s=o[l];if(s.marker.collapsed){var u=s.marker.find(0),y=se(u.from,i)||bi(s.marker)-bi(n),b=se(u.to,r)||Si(s.marker)-Si(n);if(!(y>=0&&b<=0||y<=0&&b>=0)&&(y<=0&&(s.marker.inclusiveRight&&n.inclusiveLeft?se(u.to,i)>=0:se(u.to,i)>0)||y>=0&&(s.marker.inclusiveRight&&n.inclusiveLeft?se(u.from,r)<=0:se(u.from,r)<0)))return!0}}}function dt(e){for(var t;t=to(e);)e=t.find(-1,!0).line;return e}function Ms(e){for(var t;t=wi(e);)e=t.find(1,!0).line;return e}function Ds(e){for(var t,i;t=wi(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function Pn(e,t){var i=ie(e,t),r=dt(i);return i==r?t:ye(r)}function io(e,t){if(t>e.lastLine())return t;var i=ie(e,t),r;if(!It(e,i))return t;for(;r=wi(i);)i=r.find(1,!0).line;return ye(i)+1}function It(e,t){var i=Lt&&t.markedSpans;if(i){for(var r=void 0,n=0;n<i.length;++n)if(r=i[n],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&Bn(e,t,r))return!0}}}function Bn(e,t,i){if(i.to==null){var r=i.marker.find(1,!0);return Bn(e,r.line,Wr(r.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var n=void 0,a=0;a<t.markedSpans.length;++a)if(n=t.markedSpans[a],n.marker.collapsed&&!n.marker.widgetNode&&n.from==i.to&&(n.to==null||n.to!=i.from)&&(n.marker.inclusiveLeft||i.marker.inclusiveRight)&&Bn(e,t,n))return!0}function Tt(e){e=dt(e);for(var t=0,i=e.parent,r=0;r<i.lines.length;++r){var n=i.lines[r];if(n==e)break;t+=n.height}for(var a=i.parent;a;i=a,a=i.parent)for(var o=0;o<a.children.length;++o){var l=a.children[o];if(l==i)break;t+=l.height}return t}function ki(e){if(e.height==0)return 0;for(var t=e.text.length,i,r=e;i=to(r);){var n=i.find(0,!0);r=n.from.line,t+=n.from.ch-n.to.ch}for(r=e;i=wi(r);){var a=i.find(0,!0);t-=r.text.length-a.from.ch,r=a.to.line,t+=r.text.length-a.to.ch}return t}function Rn(e){var t=e.display,i=e.doc;t.maxLine=ie(i,i.first),t.maxLineLength=ki(t.maxLine),t.maxLineChanged=!0,i.iter(function(r){var n=ki(r);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=r)})}var cr=function(e,t,i){this.text=e,$a(this,t),this.height=i?i(this):1};cr.prototype.lineNo=function(){return ye(this)},sr(cr);function Fs(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Va(e),$a(e,i);var n=r?r(e):1;n!=e.height&&xt(e,n)}function Es(e){e.parent=null,Va(e)}var As={},Ns={};function no(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Ns:As;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function ao(e,t){var i=q("span",null,null,E?"padding-right: .1px":null),r={pre:q("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var a=n?t.rest[n-1]:t.line,o=void 0;r.pos=0,r.addToken=Os,us(e.display.measure)&&(o=Ct(a,e.doc.direction))&&(r.addToken=Ps(r.addToken,o)),r.map=[];var l=t!=e.display.externalMeasured&&ye(a);Bs(a,r,Ga(e,a,l)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=Nt(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=Nt(a.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(ss(e.display.measure))),n==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(E){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 Ee(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Nt(r.pre.className,r.textClass||"")),r}function Hs(e){var t=L("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Os(e,t,i,r,n,a,o){if(t){var l=e.splitSpaces?Is(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,y;if(!s.test(t))e.col+=t.length,y=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,y),g&&k<9&&(u=!0),e.pos+=t.length;else{y=document.createDocumentFragment();for(var b=0;;){s.lastIndex=b;var T=s.exec(t),C=T?T.index-b:t.length-b;if(C){var F=document.createTextNode(l.slice(b,b+C));g&&k<9?y.appendChild(L("span",[F])):y.appendChild(F),e.map.push(e.pos,e.pos+C,F),e.col+=C,e.pos+=C}if(!T)break;b+=C+1;var P=void 0;if(T[0]==" "){var U=e.cm.options.tabSize,X=U-e.col%U;P=y.appendChild(L("span",Ht(X),"cm-tab")),P.setAttribute("role","presentation"),P.setAttribute("cm-text"," "),e.col+=X}else T[0]=="\r"||T[0]==`
5
- `?(P=y.appendChild(L("span",T[0]=="\r"?"␍":"␤","cm-invalidchar")),P.setAttribute("cm-text",T[0]),e.col+=1):(P=e.cm.options.specialCharPlaceholder(T[0]),P.setAttribute("cm-text",T[0]),g&&k<9?y.appendChild(L("span",[P])):y.appendChild(P),e.col+=1);e.map.push(e.pos,e.pos+1,P),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,i||r||n||u||a||o){var J=i||"";r&&(J+=r),n&&(J+=n);var Y=L("span",[y],J,a);if(o)for(var $ in o)o.hasOwnProperty($)&&$!="style"&&$!="class"&&Y.setAttribute($,o[$]);return e.content.appendChild(Y)}e.content.appendChild(y)}}function Is(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",n=0;n<e.length;n++){var a=e.charAt(n);a==" "&&i&&(n==e.length-1||e.charCodeAt(n+1)==32)&&(a=" "),r+=a,i=a==" "}return r}function Ps(e,t){return function(i,r,n,a,o,l,s){n=n?n+" cm-force-border":"cm-force-border";for(var u=i.pos,y=u+r.length;;){for(var b=void 0,T=0;T<t.length&&(b=t[T],!(b.to>u&&b.from<=u));T++);if(b.to>=y)return e(i,r,n,a,o,l,s);e(i,r.slice(0,b.to-u),n,a,null,l,s),a=null,r=r.slice(b.to-u),u=b.to}}}function oo(e,t,i,r){var n=!r&&i.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!r&&e.cm.display.input.needsContentAttribute&&(n||(n=e.content.appendChild(document.createElement("span"))),n.setAttribute("cm-marker",i.id)),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function Bs(e,t,i){var r=e.markedSpans,n=e.text,a=0;if(!r){for(var o=1;o<i.length;o+=2)t.addToken(t,n.slice(a,a=i[o]),no(i[o+1],t.cm.options));return}for(var l=n.length,s=0,u=1,y="",b,T,C=0,F,P,U,X,J;;){if(C==s){F=P=U=T="",J=null,X=null,C=1/0;for(var Y=[],$=void 0,ae=0;ae<r.length;++ae){var ne=r[ae],de=ne.marker;if(de.type=="bookmark"&&ne.from==s&&de.widgetNode)Y.push(de);else if(ne.from<=s&&(ne.to==null||ne.to>s||de.collapsed&&ne.to==s&&ne.from==s)){if(ne.to!=null&&ne.to!=s&&C>ne.to&&(C=ne.to,P=""),de.className&&(F+=" "+de.className),de.css&&(T=(T?T+";":"")+de.css),de.startStyle&&ne.from==s&&(U+=" "+de.startStyle),de.endStyle&&ne.to==C&&($||($=[])).push(de.endStyle,ne.to),de.title&&((J||(J={})).title=de.title),de.attributes)for(var be in de.attributes)(J||(J={}))[be]=de.attributes[be];de.collapsed&&(!X||In(X.marker,de)<0)&&(X=ne)}else ne.from>s&&C>ne.from&&(C=ne.from)}if($)for(var _e=0;_e<$.length;_e+=2)$[_e+1]==C&&(P+=" "+$[_e]);if(!X||X.from==s)for(var Te=0;Te<Y.length;++Te)oo(t,0,Y[Te]);if(X&&(X.from||0)==s){if(oo(t,(X.to==null?l+1:X.to)-s,X.marker,X.from==null),X.to==null)return;X.to==s&&(X=!1)}}if(s>=l)break;for(var at=Math.min(l,C);;){if(y){var tt=s+y.length;if(!X){var Ne=tt>at?y.slice(0,at-s):y;t.addToken(t,Ne,b?b+F:F,U,s+Ne.length==C?P:"",T,J)}if(tt>=at){y=y.slice(at-s),s=at;break}s=tt,U=""}y=n.slice(a,a=i[u++]),b=no(i[u++],t.cm.options)}}}function lo(e,t,i){this.line=t,this.rest=Ds(t),this.size=this.rest?ye(pe(this.rest))-i+1:1,this.node=this.text=null,this.hidden=It(e,t)}function Ci(e,t,i){for(var r=[],n,a=t;a<i;a=n){var o=new lo(e.doc,ie(e.doc,a),a);n=a+o.size,r.push(o)}return r}var hr=null;function Rs(e){hr?hr.ops.push(e):e.ownsGroup=hr={ops:[e],delayedCallbacks:[]}}function Ws(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var r=0;r<e.ops.length;r++){var n=e.ops[r];if(n.cursorActivityHandlers)for(;n.cursorActivityCalled<n.cursorActivityHandlers.length;)n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}}while(i<t.length)}function zs(e,t){var i=e.ownsGroup;if(i)try{Ws(i)}finally{hr=null,t(i)}}var zr=null;function Re(e,t){var i=yn(e,t);if(i.length){var r=Array.prototype.slice.call(arguments,2),n;hr?n=hr.delayedCallbacks:zr?n=zr:(n=zr=[],setTimeout(_s,0));for(var a=function(l){n.push(function(){return i[l].apply(null,r)})},o=0;o<i.length;++o)a(o)}}function _s(){var e=zr;zr=null;for(var t=0;t<e.length;++t)e[t]()}function so(e,t,i,r){for(var n=0;n<t.changes.length;n++){var a=t.changes[n];a=="text"?qs(e,t):a=="gutter"?fo(e,t,i,r):a=="class"?Wn(e,t):a=="widget"&&Gs(e,t,r)}t.changes=null}function _r(e){return e.node==e.text&&(e.node=L("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),g&&k<8&&(e.node.style.zIndex=2)),e.node}function Us(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var r=_r(t);t.background=r.insertBefore(L("div",null,i),r.firstChild),e.display.input.setUneditable(t.background)}}function uo(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):ao(e,t)}function qs(e,t){var i=t.text.className,r=uo(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,Wn(e,t)):i&&(t.text.className=i)}function Wn(e,t){Us(e,t),t.line.wrapClass?_r(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function fo(e,t,i,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 n=_r(t);t.gutterBackground=L("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),n.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var o=_r(t),l=t.gutter=L("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),o.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!a||!a["CodeMirror-linenumbers"])&&(t.lineNumber=l.appendChild(L("div",Fn(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,y=a.hasOwnProperty(u)&&a[u];y&&l.appendChild(L("div",[y],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function Gs(e,t,i){t.alignable&&(t.alignable=null);for(var r=K("CodeMirror-linewidget"),n=t.node.firstChild,a=void 0;n;n=a)a=n.nextSibling,r.test(n.className)&&t.node.removeChild(n);co(e,t,i)}function js(e,t,i,r){var n=uo(e,t);return t.text=t.node=n.pre,n.bgClass&&(t.bgClass=n.bgClass),n.textClass&&(t.textClass=n.textClass),Wn(e,t),fo(e,t,i,r),co(e,t,r),t.node}function co(e,t,i){if(ho(e,t.line,t,i,!0),t.rest)for(var r=0;r<t.rest.length;r++)ho(e,t.rest[r],t,i,!1)}function ho(e,t,i,r,n){if(t.widgets)for(var a=_r(i),o=0,l=t.widgets;o<l.length;++o){var s=l[o],u=L("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Ks(s,u,i,r),e.display.input.setUneditable(u),n&&s.above?a.insertBefore(u,i.gutter||i.text):a.appendChild(u),Re(s,"redraw")}}function Ks(e,t,i,r){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var n=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(n-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=n+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Ur(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!ee(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),le(t.display.measure,L("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function Mt(e,t){for(var i=bn(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Li(e){return e.lineSpace.offsetTop}function zn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function po(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=le(e.measure,L("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function St(e){return Me-e.display.nativeBarWidth}function Zt(e){return e.display.scroller.clientWidth-St(e)-e.display.barWidth}function _n(e){return e.display.scroller.clientHeight-St(e)-e.display.barHeight}function Xs(e,t,i){var r=e.options.lineWrapping,n=r&&Zt(e);if(!t.measure.heights||r&&t.measure.width!=n){var a=t.measure.heights=[];if(r){t.measure.width=n;for(var o=t.text.firstChild.getClientRects(),l=0;l<o.length-1;l++){var s=o[l],u=o[l+1];Math.abs(s.bottom-u.bottom)>2&&a.push((s.bottom+u.top)/2-i.top)}}a.push(i.bottom-i.top)}}function go(e,t,i){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 n=0;n<e.rest.length;n++)if(ye(e.rest[n])>i)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}}function Ys(e,t){t=dt(t);var i=ye(t),r=e.display.externalMeasured=new lo(e.doc,t,i);r.lineN=i;var n=r.built=ao(e,r);return r.text=n.pre,le(e.display.lineMeasure,n.pre),r}function vo(e,t,i,r){return wt(e,dr(e,t),i,r)}function Un(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Vt(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function dr(e,t){var i=ye(t),r=Un(e,i);r&&!r.text?r=null:r&&r.changes&&(so(e,r,i,Xn(e)),e.curOp.forceUpdate=!0),r||(r=Ys(e,t));var n=go(r,t,i);return{line:t,view:r,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:!1}}function wt(e,t,i,r,n){t.before&&(i=-1);var a=i+(r||""),o;return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Xs(e,t.view,t.rect),t.hasHeights=!0),o=Js(e,t,i,r),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:n?o.rtop:o.top,bottom:n?o.rbottom:o.bottom}}var mo={left:0,right:0,top:0,bottom:0};function yo(e,t,i){for(var r,n,a,o,l,s,u=0;u<e.length;u+=3)if(l=e[u],s=e[u+1],t<l?(n=0,a=1,o="left"):t<s?(n=t-l,a=n+1):(u==e.length-3||t==s&&e[u+3]>t)&&(a=s-l,n=a-1,t>=s&&(o="right")),n!=null){if(r=e[u+2],l==s&&i==(r.insertLeft?"left":"right")&&(o=i),i=="left"&&n==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],o="left";if(i=="right"&&n==s-l)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],o="right";break}return{node:r,start:n,end:a,collapse:o,coverStart:l,coverEnd:s}}function Zs(e,t){var i=mo;if(t=="left")for(var r=0;r<e.length&&(i=e[r]).left==i.right;r++);else for(var n=e.length-1;n>=0&&(i=e[n]).left==i.right;n--);return i}function Js(e,t,i,r){var n=yo(t.map,i,r),a=n.node,o=n.start,l=n.end,s=n.collapse,u;if(a.nodeType==3){for(var y=0;y<4;y++){for(;o&&mn(t.line.text.charAt(n.coverStart+o));)--o;for(;n.coverStart+l<n.coverEnd&&mn(t.line.text.charAt(n.coverStart+l));)++l;if(g&&k<9&&o==0&&l==n.coverEnd-n.coverStart?u=a.parentNode.getBoundingClientRect():u=Zs(R(a,o,l).getClientRects(),r),u.left||u.right||o==0)break;l=o,o=o-1,s="right"}g&&k<11&&(u=Qs(e.display.measure,u))}else{o>0&&(s=r="right");var b;e.options.lineWrapping&&(b=a.getClientRects()).length>1?u=b[r=="right"?b.length-1:0]:u=a.getBoundingClientRect()}if(g&&k<9&&!o&&(!u||!u.left&&!u.right)){var T=a.parentNode.getClientRects()[0];T?u={left:T.left,right:T.left+gr(e.display),top:T.top,bottom:T.bottom}:u=mo}for(var C=u.top-t.rect.top,F=u.bottom-t.rect.top,P=(C+F)/2,U=t.view.measure.heights,X=0;X<U.length-1&&!(P<U[X]);X++);var J=X?U[X-1]:0,Y=U[X],$={left:(s=="right"?u.right:u.left)-t.rect.left,right:(s=="left"?u.left:u.right)-t.rect.left,top:J,bottom:Y};return!u.left&&!u.right&&($.bogus=!0),e.options.singleCursorHeightPerLine||($.rtop=C,$.rbottom=F),$}function Qs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!hs(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*r,bottom:t.bottom*r}}function xo(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 bo(e){e.display.externalMeasure=null,ce(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)xo(e.display.view[t])}function qr(e){bo(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function So(e){return M&&A?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function wo(e){return M&&A?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function qn(e){var t=dt(e),i=t.widgets,r=0;if(i)for(var n=0;n<i.length;++n)i[n].above&&(r+=Ur(i[n]));return r}function Ti(e,t,i,r,n){if(!n){var a=qn(t);i.top+=a,i.bottom+=a}if(r=="line")return i;r||(r="local");var o=Tt(t);if(r=="local"?o+=Li(e.display):o-=e.display.viewOffset,r=="page"||r=="window"){var l=e.display.lineSpace.getBoundingClientRect();o+=l.top+(r=="window"?0:wo(h(e)));var s=l.left+(r=="window"?0:So(h(e)));i.left+=s,i.right+=s}return i.top+=o,i.bottom+=o,i}function ko(e,t,i){if(i=="div")return t;var r=t.left,n=t.top;if(i=="page")r-=So(h(e)),n-=wo(h(e));else if(i=="local"||!i){var a=e.display.sizer.getBoundingClientRect();r+=a.left,n+=a.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:r-o.left,top:n-o.top}}function Mi(e,t,i,r,n){return r||(r=ie(e.doc,t.line)),Ti(e,r,vo(e,r,t.ch,n),i)}function pt(e,t,i,r,n,a){r=r||ie(e.doc,t.line),n||(n=dr(e,r));function o(F,P){var U=wt(e,n,F,P?"right":"left",a);return P?U.left=U.right:U.right=U.left,Ti(e,r,U,i)}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 o(u=="before"?s-1:s,u=="before");function y(F,P,U){var X=l[P],J=X.level==1;return o(U?F-1:F,J!=U)}var b=Ir(l,s,u),T=Or,C=y(s,b,u=="before");return T!=null&&(C.other=y(s,T,u!="before")),C}function Co(e,t){var i=0;t=ue(e.doc,t),e.options.lineWrapping||(i=gr(e.display)*t.ch);var r=ie(e.doc,t.line),n=Tt(r)+Li(e.display);return{left:i,right:i,top:n,bottom:n+r.height}}function Gn(e,t,i,r,n){var a=W(e,t,i);return a.xRel=n,r&&(a.outside=r),a}function jn(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return Gn(r.first,0,null,-1,-1);var n=Yt(r,i),a=r.first+r.size-1;if(n>a)return Gn(r.first+r.size-1,ie(r,a).text.length,null,1,1);t<0&&(t=0);for(var o=ie(r,n);;){var l=Vs(e,o,n,t,i),s=Ts(o,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var u=s.find(1);if(u.line==n)return u;o=ie(r,n=u.line)}}function Lo(e,t,i,r){r-=qn(t);var n=t.text.length,a=Hr(function(o){return wt(e,i,o-1).bottom<=r},n,0);return n=Hr(function(o){return wt(e,i,o).top>r},a,n),{begin:a,end:n}}function To(e,t,i,r){i||(i=dr(e,t));var n=Ti(e,t,wt(e,i,r),"line").top;return Lo(e,t,i,n)}function Kn(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function Vs(e,t,i,r,n){n-=Tt(t);var a=dr(e,t),o=qn(t),l=0,s=t.text.length,u=!0,y=Ct(t,e.doc.direction);if(y){var b=(e.options.lineWrapping?eu:$s)(e,t,i,a,y,r,n);u=b.level!=1,l=u?b.from:b.to-1,s=u?b.to:b.from-1}var T=null,C=null,F=Hr(function(ae){var ne=wt(e,a,ae);return ne.top+=o,ne.bottom+=o,Kn(ne,r,n,!1)?(ne.top<=n&&ne.left<=r&&(T=ae,C=ne),!0):!1},l,s),P,U,X=!1;if(C){var J=r-C.left<C.right-r,Y=J==u;F=T+(Y?0:1),U=Y?"after":"before",P=J?C.left:C.right}else{!u&&(F==s||F==l)&&F++,U=F==0?"after":F==t.text.length?"before":wt(e,a,F-(u?1:0)).bottom+o<=n==u?"after":"before";var $=pt(e,W(i,F,U),"line",t,a);P=$.left,X=n<$.top?-1:n>=$.bottom?1:0}return F=Ia(t.text,F,1),Gn(i,F,U,X,r-P)}function $s(e,t,i,r,n,a,o){var l=Hr(function(b){var T=n[b],C=T.level!=1;return Kn(pt(e,W(i,C?T.to:T.from,C?"before":"after"),"line",t,r),a,o,!0)},0,n.length-1),s=n[l];if(l>0){var u=s.level!=1,y=pt(e,W(i,u?s.from:s.to,u?"after":"before"),"line",t,r);Kn(y,a,o,!0)&&y.top>o&&(s=n[l-1])}return s}function eu(e,t,i,r,n,a,o){var l=Lo(e,t,r,o),s=l.begin,u=l.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var y=null,b=null,T=0;T<n.length;T++){var C=n[T];if(!(C.from>=u||C.to<=s)){var F=C.level!=1,P=wt(e,r,F?Math.min(u,C.to)-1:Math.max(s,C.from)).right,U=P<a?a-P+1e9:P-a;(!y||b>U)&&(y=C,b=U)}}return y||(y=n[n.length-1]),y.from<s&&(y={from:s,to:y.to,level:y.level}),y.to>u&&(y={from:y.from,to:u,level:y.level}),y}var Jt;function pr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Jt==null){Jt=L("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Jt.appendChild(document.createTextNode("x")),Jt.appendChild(L("br"));Jt.appendChild(document.createTextNode("x"))}le(e.measure,Jt);var i=Jt.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),ce(e.measure),i||1}function gr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=L("span","xxxxxxxxxx"),i=L("pre",[t],"CodeMirror-line-like");le(e.measure,i);var r=t.getBoundingClientRect(),n=(r.right-r.left)/10;return n>2&&(e.cachedCharWidth=n),n||10}function Xn(e){for(var t=e.display,i={},r={},n=t.gutters.clientLeft,a=t.gutters.firstChild,o=0;a;a=a.nextSibling,++o){var l=e.display.gutterSpecs[o].className;i[l]=a.offsetLeft+a.clientLeft+n,r[l]=a.clientWidth}return{fixedPos:Yn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Yn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Mo(e){var t=pr(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/gr(e.display)-3);return function(n){if(It(e.doc,n))return 0;var a=0;if(n.widgets)for(var o=0;o<n.widgets.length;o++)n.widgets[o].height&&(a+=n.widgets[o].height);return i?a+(Math.ceil(n.text.length/r)||1)*t:a+t}}function Zn(e){var t=e.doc,i=Mo(e);t.iter(function(r){var n=i(r);n!=r.height&&xt(r,n)})}function Qt(e,t,i,r){var n=e.display;if(!i&&bn(t).getAttribute("cm-not-content")=="true")return null;var a,o,l=n.lineSpace.getBoundingClientRect();try{a=t.clientX-l.left,o=t.clientY-l.top}catch{return null}var s=jn(e,a,o),u;if(r&&s.xRel>0&&(u=ie(e.doc,s.line).text).length==s.ch){var y=Oe(u,u.length,e.options.tabSize)-u.length;s=W(s.line,Math.max(0,Math.round((a-po(e.display).left)/gr(e.display))-y))}return s}function Vt(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var i=e.display.view,r=0;r<i.length;r++)if(t-=i[r].size,t<0)return r}function $e(e,t,i,r){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),r||(r=0);var n=e.display;if(r&&i<n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>t)&&(n.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=n.viewTo)Lt&&Pn(e.doc,t)<n.viewTo&&Bt(e);else if(i<=n.viewFrom)Lt&&io(e.doc,i+r)>n.viewFrom?Bt(e):(n.viewFrom+=r,n.viewTo+=r);else if(t<=n.viewFrom&&i>=n.viewTo)Bt(e);else if(t<=n.viewFrom){var a=Di(e,i,i+r,1);a?(n.view=n.view.slice(a.index),n.viewFrom=a.lineN,n.viewTo+=r):Bt(e)}else if(i>=n.viewTo){var o=Di(e,t,t,-1);o?(n.view=n.view.slice(0,o.index),n.viewTo=o.lineN):Bt(e)}else{var l=Di(e,t,t,-1),s=Di(e,i,i+r,1);l&&s?(n.view=n.view.slice(0,l.index).concat(Ci(e,l.lineN,s.lineN)).concat(n.view.slice(s.index)),n.viewTo+=r):Bt(e)}var u=n.externalMeasured;u&&(i<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(n.externalMeasured=null))}function Pt(e,t,i){e.curOp.viewChanged=!0;var r=e.display,n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var a=r.view[Vt(e,t)];if(a.node!=null){var o=a.changes||(a.changes=[]);ke(o,i)==-1&&o.push(i)}}}function Bt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Di(e,t,i,r){var n=Vt(e,t),a,o=e.display.view;if(!Lt||i==e.doc.first+e.doc.size)return{index:n,lineN:i};for(var l=e.display.viewFrom,s=0;s<n;s++)l+=o[s].size;if(l!=t){if(r>0){if(n==o.length-1)return null;a=l+o[n].size-t,n++}else a=l-t;t+=a,i+=a}for(;Pn(e.doc,i)!=i;){if(n==(r<0?0:o.length-1))return null;i+=r*o[n-(r<0?1:0)].size,n+=r}return{index:n,lineN:i}}function tu(e,t,i){var r=e.display,n=r.view;n.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=Ci(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=Ci(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Vt(e,t))),r.viewFrom=t,r.viewTo<i?r.view=r.view.concat(Ci(e,r.viewTo,i)):r.viewTo>i&&(r.view=r.view.slice(0,Vt(e,i)))),r.viewTo=i}function Do(e){for(var t=e.display.view,i=0,r=0;r<t.length;r++){var n=t[r];!n.hidden&&(!n.node||n.changes)&&++i}return i}function Gr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Fo(e,t){t===void 0&&(t=!0);var i=e.doc,r={},n=r.cursors=document.createDocumentFragment(),a=r.selection=document.createDocumentFragment(),o=e.options.$customCursor;o&&(t=!0);for(var l=0;l<i.sel.ranges.length;l++)if(!(!t&&l==i.sel.primIndex)){var s=i.sel.ranges[l];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var u=s.empty();if(o){var y=o(e,s);y&&Jn(e,y,n)}else(u||e.options.showCursorWhenSelecting)&&Jn(e,s.head,n);u||ru(e,s,a)}}return r}function Jn(e,t,i){var r=pt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),n=i.appendChild(L("div"," ","CodeMirror-cursor"));if(n.style.left=r.left+"px",n.style.top=r.top+"px",n.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var a=Mi(e,t,"div",null,null),o=a.right-a.left;n.style.width=(o>0?o:e.defaultCharWidth())+"px"}if(r.other){var l=i.appendChild(L("div"," ","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 Fi(e,t){return e.top-t.top||e.left-t.left}function ru(e,t,i){var r=e.display,n=e.doc,a=document.createDocumentFragment(),o=po(e.display),l=o.left,s=Math.max(r.sizerWidth,Zt(e)-r.sizer.offsetLeft)-o.right,u=n.direction=="ltr";function y(Y,$,ae,ne){$<0&&($=0),$=Math.round($),ne=Math.round(ne),a.appendChild(L("div",null,"CodeMirror-selected","position: absolute; left: "+Y+`px;
6
- top: `+$+"px; width: "+(ae??s-Y)+`px;
7
- height: `+(ne-$)+"px"))}function b(Y,$,ae){var ne=ie(n,Y),de=ne.text.length,be,_e;function Te(Ne,rt){return Mi(e,W(Y,Ne),"div",ne,rt)}function at(Ne,rt,Ge){var Pe=To(e,ne,null,Ne),He=rt=="ltr"==(Ge=="after")?"left":"right",De=Ge=="after"?Pe.begin:Pe.end-(/\s/.test(ne.text.charAt(Pe.end-1))?2:1);return Te(De,He)[He]}var tt=Ct(ne,n.direction);return as(tt,$||0,ae??de,function(Ne,rt,Ge,Pe){var He=Ge=="ltr",De=Te(Ne,He?"left":"right"),it=Te(rt-1,He?"right":"left"),Dr=$==null&&Ne==0,qt=ae==null&&rt==de,Ke=Pe==0,kt=!tt||Pe==tt.length-1;if(it.top-De.top<=3){var Ue=(u?Dr:qt)&&Ke,ka=(u?qt:Dr)&&kt,Et=Ue?l:(He?De:it).left,ir=ka?s:(He?it:De).right;y(Et,De.top,ir-Et,De.bottom)}else{var nr,Ze,Fr,Ca;He?(nr=u&&Dr&&Ke?l:De.left,Ze=u?s:at(Ne,Ge,"before"),Fr=u?l:at(rt,Ge,"after"),Ca=u&&qt&&kt?s:it.right):(nr=u?at(Ne,Ge,"before"):l,Ze=!u&&Dr&&Ke?s:De.right,Fr=!u&&qt&&kt?l:it.left,Ca=u?at(rt,Ge,"after"):s),y(nr,De.top,Ze-nr,De.bottom),De.bottom<it.top&&y(l,De.bottom,null,it.top),y(Fr,it.top,Ca-Fr,it.bottom)}(!be||Fi(De,be)<0)&&(be=De),Fi(it,be)<0&&(be=it),(!_e||Fi(De,_e)<0)&&(_e=De),Fi(it,_e)<0&&(_e=it)}),{start:be,end:_e}}var T=t.from(),C=t.to();if(T.line==C.line)b(T.line,T.ch,C.ch);else{var F=ie(n,T.line),P=ie(n,C.line),U=dt(F)==dt(P),X=b(T.line,T.ch,U?F.text.length+1:null).end,J=b(C.line,U?0:null,C.ch).start;U&&(X.top<J.top-2?(y(X.right,X.top,null,X.bottom),y(l,J.top,J.left,J.bottom)):y(X.right,X.top,J.left-X.right,X.bottom)),X.bottom<J.top&&y(l,X.bottom,null,J.top)}i.appendChild(a)}function Qn(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||vr(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Eo(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||$n(e))}function Vn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&vr(e))},100)}function $n(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Ee(e,"focus",e,t),e.state.focused=!0,qe(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),E&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Qn(e))}function vr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ee(e,"blur",e,t),e.state.focused=!1,fe(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Ei(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),n=t.lineDiv.getBoundingClientRect().top,a=0,o=0;o<t.view.length;o++){var l=t.view[o],s=e.options.lineWrapping,u=void 0,y=0;if(!l.hidden){if(n+=l.line.height,g&&k<8){var b=l.node.offsetTop+l.node.offsetHeight;u=b-i,i=b}else{var T=l.node.getBoundingClientRect();u=T.bottom-T.top,!s&&l.text.firstChild&&(y=l.text.firstChild.getBoundingClientRect().right-T.left-1)}var C=l.line.height-u;if((C>.005||C<-.005)&&(n<r&&(a-=C),xt(l.line,u),Ao(l.line),l.rest))for(var F=0;F<l.rest.length;F++)Ao(l.rest[F]);if(y>e.display.sizerWidth){var P=Math.ceil(y/gr(e.display));P>e.display.maxLineLength&&(e.display.maxLineLength=P,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(a)>2&&(t.scroller.scrollTop+=a)}function Ao(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],r=i.node.parentNode;r&&(i.height=r.offsetHeight)}}function Ai(e,t,i){var r=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;r=Math.floor(r-Li(e));var n=i&&i.bottom!=null?i.bottom:r+e.wrapper.clientHeight,a=Yt(t,r),o=Yt(t,n);if(i&&i.ensure){var l=i.ensure.from.line,s=i.ensure.to.line;l<a?(a=l,o=Yt(t,Tt(ie(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=o&&(a=Yt(t,Tt(ie(t,s))-e.wrapper.clientHeight),o=s)}return{from:a,to:Math.max(o,a+1)}}function iu(e,t){if(!Be(e,"scrollCursorIntoView")){var i=e.display,r=i.sizer.getBoundingClientRect(),n=null,a=i.wrapper.ownerDocument;if(t.top+r.top<0?n=!0:t.bottom+r.top>(a.defaultView.innerHeight||a.documentElement.clientHeight)&&(n=!1),n!=null&&!j){var o=L("div","​",null,`position: absolute;
8
- top: `+(t.top-i.viewOffset-Li(e.display))+`px;
9
- height: `+(t.bottom-t.top+St(e)+i.barHeight)+`px;
10
- left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(n),e.display.lineSpace.removeChild(o)}}}function nu(e,t,i,r){r==null&&(r=0);var n;!e.options.lineWrapping&&t==i&&(i=t.sticky=="before"?W(t.line,t.ch+1,"before"):t,t=t.ch?W(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var a=0;a<5;a++){var o=!1,l=pt(e,t),s=!i||i==t?l:pt(e,i);n={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=ea(e,n),y=e.doc.scrollTop,b=e.doc.scrollLeft;if(u.scrollTop!=null&&(Kr(e,u.scrollTop),Math.abs(e.doc.scrollTop-y)>1&&(o=!0)),u.scrollLeft!=null&&($t(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-b)>1&&(o=!0)),!o)break}return n}function au(e,t){var i=ea(e,t);i.scrollTop!=null&&Kr(e,i.scrollTop),i.scrollLeft!=null&&$t(e,i.scrollLeft)}function ea(e,t){var i=e.display,r=pr(e.display);t.top<0&&(t.top=0);var n=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,a=_n(e),o={};t.bottom-t.top>a&&(t.bottom=t.top+a);var l=e.doc.height+zn(i),s=t.top<r,u=t.bottom>l-r;if(t.top<n)o.scrollTop=s?0:t.top;else if(t.bottom>n+a){var y=Math.min(t.top,(u?l:t.bottom)-a);y!=n&&(o.scrollTop=y)}var b=e.options.fixedGutter?0:i.gutters.offsetWidth,T=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-b,C=Zt(e)-i.gutters.offsetWidth,F=t.right-t.left>C;return F&&(t.right=t.left+C),t.left<10?o.scrollLeft=0:t.left<T?o.scrollLeft=Math.max(0,t.left+b-(F?0:10)):t.right>C+T-3&&(o.scrollLeft=t.right+(F?0:10)-C),o}function ta(e,t){t!=null&&(Ni(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function mr(e){Ni(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function jr(e,t,i){(t!=null||i!=null)&&Ni(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function ou(e,t){Ni(e),e.curOp.scrollToPos=t}function Ni(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=Co(e,t.from),r=Co(e,t.to);No(e,i,r,t.margin)}}function No(e,t,i,r){var n=ea(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});jr(e,n.scrollLeft,n.scrollTop)}function Kr(e,t){Math.abs(e.doc.scrollTop-t)<2||(p||ia(e,{top:t}),Ho(e,t,!0),p&&ia(e),Zr(e,100))}function Ho(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!i)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function $t(e,t,i,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,Ro(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Xr(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+zn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+St(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var er=function(e,t,i){this.cm=i;var r=this.vert=L("div",[L("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=L("div",[L("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=n.tabIndex=-1,e(r),e(n),oe(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),oe(n,"scroll",function(){n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,g&&k<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};er.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var n=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+n)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var a=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},er.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},er.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},er.prototype.zeroWidthHack=function(){var e=z&&!_?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Xe,this.disableVert=new Xe},er.prototype.enableZeroWidthBar=function(e,t,i){e.style.visibility="";function r(){var n=e.getBoundingClientRect(),a=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);a!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},er.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Yr=function(){};Yr.prototype.update=function(){return{bottom:0,right:0}},Yr.prototype.setScrollLeft=function(){},Yr.prototype.setScrollTop=function(){},Yr.prototype.clear=function(){};function yr(e,t){t||(t=Xr(e));var i=e.display.barWidth,r=e.display.barHeight;Oo(e,t);for(var n=0;n<4&&i!=e.display.barWidth||r!=e.display.barHeight;n++)i!=e.display.barWidth&&e.options.lineWrapping&&Ei(e),Oo(e,Xr(e)),i=e.display.barWidth,r=e.display.barHeight}function Oo(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var Io={native:er,null:Yr};function Po(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&fe(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Io[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),oe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?$t(e,t):Kr(e,t)},e),e.display.scrollbars.addClass&&qe(e.display.wrapper,e.display.scrollbars.addClass)}var lu=0;function tr(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:++lu,markArrays:null},Rs(e.curOp)}function rr(e){var t=e.curOp;t&&zs(t,function(i){for(var r=0;r<i.ops.length;r++)i.ops[r].cm.curOp=null;su(i)})}function su(e){for(var t=e.ops,i=0;i<t.length;i++)uu(t[i]);for(var r=0;r<t.length;r++)fu(t[r]);for(var n=0;n<t.length;n++)cu(t[n]);for(var a=0;a<t.length;a++)hu(t[a]);for(var o=0;o<t.length;o++)du(t[o])}function uu(e){var t=e.cm,i=t.display;gu(t),e.updateMaxLine&&Rn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Hi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function fu(e){e.updatedDisplay=e.mustUpdate&&ra(e.cm,e.update)}function cu(e){var t=e.cm,i=t.display;e.updatedDisplay&&Ei(t),e.barMeasure=Xr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=vo(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+St(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Zt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function hu(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&$t(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==ge(te(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&yr(t,e.barMeasure),e.updatedDisplay&&aa(t,e.barMeasure),e.selectionChanged&&Qn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&Eo(e.cm)}function du(e){var t=e.cm,i=t.display,r=t.doc;if(e.updatedDisplay&&Bo(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&Ho(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&$t(t,e.scrollLeft,!0,!0),e.scrollToPos){var n=nu(t,ue(r,e.scrollToPos.from),ue(r,e.scrollToPos.to),e.scrollToPos.margin);iu(t,n)}var a=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(a)for(var l=0;l<a.length;++l)a[l].lines.length||Ee(a[l],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&Ee(o[s],"unhide");i.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ee(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function nt(e,t){if(e.curOp)return t();tr(e);try{return t()}finally{rr(e)}}function We(e,t){return function(){if(e.curOp)return t.apply(e,arguments);tr(e);try{return t.apply(e,arguments)}finally{rr(e)}}}function Ye(e){return function(){if(this.curOp)return e.apply(this,arguments);tr(this);try{return e.apply(this,arguments)}finally{rr(this)}}}function ze(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);tr(t);try{return e.apply(this,arguments)}finally{rr(t)}}}function Zr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,Je(pu,e))}function pu(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var i=+new Date+e.options.workTime,r=Rr(e,t.highlightFrontier),n=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(a){if(r.line>=e.display.viewFrom){var o=a.styles,l=a.text.length>e.options.maxHighlightLength?Kt(t.mode,r.state):null,s=qa(e,a,r,!0);l&&(r.state=l),a.styles=s.styles;var u=a.styleClasses,y=s.classes;y?a.styleClasses=y:u&&(a.styleClasses=null);for(var b=!o||o.length!=a.styles.length||u!=y&&(!u||!y||u.bgClass!=y.bgClass||u.textClass!=y.textClass),T=0;!b&&T<o.length;++T)b=o[T]!=a.styles[T];b&&n.push(r.line),a.stateAfter=r.save(),r.nextLine()}else a.text.length<=e.options.maxHighlightLength&&Nn(e,a.text,r),a.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>i)return Zr(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),n.length&&nt(e,function(){for(var a=0;a<n.length;a++)Pt(e,n[a],"text")})}}var Hi=function(e,t,i){var r=e.display;this.viewport=t,this.visible=Ai(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Zt(e),this.force=i,this.dims=Xn(e),this.events=[]};Hi.prototype.signal=function(e,t){ft(e,t)&&this.events.push(arguments)},Hi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ee.apply(null,this.events[e])};function gu(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=St(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=St(e)+"px",t.scrollbarsClipped=!0)}function vu(e){if(e.hasFocus())return null;var t=ge(te(e));if(!t||!ee(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var r=he(e).getSelection();r.anchorNode&&r.extend&&ee(e.display.lineDiv,r.anchorNode)&&(i.anchorNode=r.anchorNode,i.anchorOffset=r.anchorOffset,i.focusNode=r.focusNode,i.focusOffset=r.focusOffset)}return i}function mu(e){if(!(!e||!e.activeElt||e.activeElt==ge(ve(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&ee(document.body,e.anchorNode)&&ee(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,i=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),i.removeAllRanges(),i.addRange(r),i.extend(e.focusNode,e.focusOffset)}}function ra(e,t){var i=e.display,r=e.doc;if(t.editorIsHidden)return Bt(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&Do(e)==0)return!1;Wo(e)&&(Bt(e),t.dims=Xn(e));var n=r.first+r.size,a=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(n,t.visible.to+e.options.viewportMargin);i.viewFrom<a&&a-i.viewFrom<20&&(a=Math.max(r.first,i.viewFrom)),i.viewTo>o&&i.viewTo-o<20&&(o=Math.min(n,i.viewTo)),Lt&&(a=Pn(e.doc,a),o=io(e.doc,o));var l=a!=i.viewFrom||o!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;tu(e,a,o),i.viewOffset=Tt(ie(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var s=Do(e);if(!l&&s==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var u=vu(e);return s>4&&(i.lineDiv.style.display="none"),yu(e,i.updateLineNumbers,t.dims),s>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,mu(u),ce(i.cursorDiv),ce(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,l&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Zr(e,400)),i.updateLineNumbers=null,!0}function Bo(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Zt(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+zn(e.display)-_n(e),i.top)}),t.visible=Ai(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Ai(e.display,e.doc,i));if(!ra(e,t))break;Ei(e);var n=Xr(e);Gr(e),yr(e,n),aa(e,n),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 ia(e,t){var i=new Hi(e,t);if(ra(e,i)){Ei(e),Bo(e,i);var r=Xr(e);Gr(e),yr(e,r),aa(e,r),i.finish()}}function yu(e,t,i){var r=e.display,n=e.options.lineNumbers,a=r.lineDiv,o=a.firstChild;function l(F){var P=F.nextSibling;return E&&z&&e.display.currentWheelTarget==F?F.style.display="none":F.parentNode.removeChild(F),P}for(var s=r.view,u=r.viewFrom,y=0;y<s.length;y++){var b=s[y];if(!b.hidden)if(!b.node||b.node.parentNode!=a){var T=js(e,b,u,i);a.insertBefore(T,o)}else{for(;o!=b.node;)o=l(o);var C=n&&t!=null&&t<=u&&b.lineNumber;b.changes&&(ke(b.changes,"gutter")>-1&&(C=!1),so(e,b,u,i)),C&&(ce(b.lineNumber),b.lineNumber.appendChild(document.createTextNode(Fn(e.options,u)))),o=b.node.nextSibling}u+=b.size}for(;o;)o=l(o)}function na(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Re(e,"gutterChanged",e)}function aa(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+St(e)+"px"}function Ro(e){var t=e.display,i=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Yn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,a=r+"px",o=0;o<i.length;o++)if(!i[o].hidden){e.options.fixedGutter&&(i[o].gutter&&(i[o].gutter.style.left=a),i[o].gutterBackground&&(i[o].gutterBackground.style.left=a));var l=i[o].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=r+n+"px")}}function Wo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=Fn(e.options,t.first+t.size-1),r=e.display;if(i.length!=r.lineNumChars){var n=r.measure.appendChild(L("div",[L("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=n.firstChild.offsetWidth,o=n.offsetWidth-a;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(a,r.lineGutter.offsetWidth-o)+1,r.lineNumWidth=r.lineNumInnerWidth+o,r.lineNumChars=r.lineNumInnerWidth?i.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",na(e.display),!0}return!1}function oa(e,t){for(var i=[],r=!1,n=0;n<e.length;n++){var a=e[n],o=null;if(typeof a!="string"&&(o=a.style,a=a.className),a=="CodeMirror-linenumbers")if(t)r=!0;else continue;i.push({className:a,style:o})}return t&&!r&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function zo(e){var t=e.gutters,i=e.gutterSpecs;ce(t),e.lineGutter=null;for(var r=0;r<i.length;++r){var n=i[r],a=n.className,o=n.style,l=t.appendChild(L("div",null,"CodeMirror-gutter "+a));o&&(l.style.cssText=o),a=="CodeMirror-linenumbers"&&(e.lineGutter=l,l.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",na(e)}function Jr(e){zo(e.display),$e(e),Ro(e)}function xu(e,t,i,r){var n=this;this.input=i,n.scrollbarFiller=L("div",null,"CodeMirror-scrollbar-filler"),n.scrollbarFiller.setAttribute("cm-not-content","true"),n.gutterFiller=L("div",null,"CodeMirror-gutter-filler"),n.gutterFiller.setAttribute("cm-not-content","true"),n.lineDiv=q("div",null,"CodeMirror-code"),n.selectionDiv=L("div",null,null,"position: relative; z-index: 1"),n.cursorDiv=L("div",null,"CodeMirror-cursors"),n.measure=L("div",null,"CodeMirror-measure"),n.lineMeasure=L("div",null,"CodeMirror-measure"),n.lineSpace=q("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none");var a=q("div",[n.lineSpace],"CodeMirror-lines");n.mover=L("div",[a],null,"position: relative"),n.sizer=L("div",[n.mover],"CodeMirror-sizer"),n.sizerWidth=null,n.heightForcer=L("div",null,null,"position: absolute; height: "+Me+"px; width: 1px;"),n.gutters=L("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=L("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=L("div",[n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),M&&O>=105&&(n.wrapper.style.clipPath="inset(0px)"),n.wrapper.setAttribute("translate","no"),g&&k<8&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),!E&&!(p&&H)&&(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,n.gutterSpecs=oa(r.gutters,r.lineNumbers),zo(n),i.init(n)}var Oi=0,Dt=null;g?Dt=-.53:p?Dt=15:M?Dt=-.7:Z&&(Dt=-1/3);function _o(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function bu(e){var t=_o(e);return t.x*=Dt,t.y*=Dt,t}function Uo(e,t){M&&O==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 i=_o(t),r=i.x,n=i.y,a=Dt;t.deltaMode===0&&(r=t.deltaX,n=t.deltaY,a=1);var o=e.display,l=o.scroller,s=l.scrollWidth>l.clientWidth,u=l.scrollHeight>l.clientHeight;if(r&&s||n&&u){if(n&&z&&E){e:for(var y=t.target,b=o.view;y!=l;y=y.parentNode)for(var T=0;T<b.length;T++)if(b[T].node==y){e.display.currentWheelTarget=y;break e}}if(r&&!p&&!I&&a!=null){n&&u&&Kr(e,Math.max(0,l.scrollTop+n*a)),$t(e,Math.max(0,l.scrollLeft+r*a)),(!n||n&&u)&&Ve(t),o.wheelStartX=null;return}if(n&&a!=null){var C=n*a,F=e.doc.scrollTop,P=F+o.wrapper.clientHeight;C<0?F=Math.max(0,F+C-50):P=Math.min(e.doc.height,P+C+50),ia(e,{top:F,bottom:P})}Oi<20&&t.deltaMode!==0&&(o.wheelStartX==null?(o.wheelStartX=l.scrollLeft,o.wheelStartY=l.scrollTop,o.wheelDX=r,o.wheelDY=n,setTimeout(function(){if(o.wheelStartX!=null){var U=l.scrollLeft-o.wheelStartX,X=l.scrollTop-o.wheelStartY,J=X&&o.wheelDY&&X/o.wheelDY||U&&o.wheelDX&&U/o.wheelDX;o.wheelStartX=o.wheelStartY=null,J&&(Dt=(Dt*Oi+J)/(Oi+1),++Oi)}},200)):(o.wheelDX+=r,o.wheelDY+=n))}}var st=function(e,t){this.ranges=e,this.primIndex=t};st.prototype.primary=function(){return this.ranges[this.primIndex]},st.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 i=this.ranges[t],r=e.ranges[t];if(!En(i.anchor,r.anchor)||!En(i.head,r.head))return!1}return!0},st.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new me(An(this.ranges[t].anchor),An(this.ranges[t].head));return new st(e,this.primIndex)},st.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},st.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var r=this.ranges[i];if(se(t,r.from())>=0&&se(e,r.to())<=0)return i}return-1};var me=function(e,t){this.anchor=e,this.head=t};me.prototype.from=function(){return mi(this.anchor,this.head)},me.prototype.to=function(){return vi(this.anchor,this.head)},me.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function gt(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort(function(T,C){return se(T.from(),C.from())}),i=ke(t,n);for(var a=1;a<t.length;a++){var o=t[a],l=t[a-1],s=se(l.to(),o.from());if(r&&!o.empty()?s>0:s>=0){var u=mi(l.from(),o.from()),y=vi(l.to(),o.to()),b=l.empty()?o.from()==o.head:l.from()==l.head;a<=i&&--i,t.splice(--a,2,new me(b?y:u,b?u:y))}}return new st(t,i)}function Rt(e,t){return new st([new me(e,t||e)],0)}function Wt(e){return e.text?W(e.from.line+e.text.length-1,pe(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function qo(e,t){if(se(e,t.from)<0)return e;if(se(e,t.to)<=0)return Wt(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Wt(t).ch-t.to.ch),W(i,r)}function la(e,t){for(var i=[],r=0;r<e.sel.ranges.length;r++){var n=e.sel.ranges[r];i.push(new me(qo(n.anchor,t),qo(n.head,t)))}return gt(e.cm,i,e.sel.primIndex)}function Go(e,t,i){return e.line==t.line?W(i.line,e.ch-t.ch+i.ch):W(i.line+(e.line-t.line),e.ch)}function Su(e,t,i){for(var r=[],n=W(e.first,0),a=n,o=0;o<t.length;o++){var l=t[o],s=Go(l.from,n,a),u=Go(Wt(l),n,a);if(n=l.to,a=u,i=="around"){var y=e.sel.ranges[o],b=se(y.head,y.anchor)<0;r[o]=new me(b?u:s,b?s:u)}else r[o]=new me(s,s)}return new st(r,e.sel.primIndex)}function sa(e){e.doc.mode=Tn(e.options,e.doc.modeOption),Qr(e)}function Qr(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,Zr(e,100),e.state.modeGen++,e.curOp&&$e(e)}function jo(e,t){return t.from.ch==0&&t.to.ch==0&&pe(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ua(e,t,i,r){function n(J){return i?i[J]:null}function a(J,Y,$){Fs(J,Y,$,r),Re(J,"change",J,t)}function o(J,Y){for(var $=[],ae=J;ae<Y;++ae)$.push(new cr(u[ae],n(ae),r));return $}var l=t.from,s=t.to,u=t.text,y=ie(e,l.line),b=ie(e,s.line),T=pe(u),C=n(u.length-1),F=s.line-l.line;if(t.full)e.insert(0,o(0,u.length)),e.remove(u.length,e.size-u.length);else if(jo(e,t)){var P=o(0,u.length-1);a(b,b.text,C),F&&e.remove(l.line,F),P.length&&e.insert(l.line,P)}else if(y==b)if(u.length==1)a(y,y.text.slice(0,l.ch)+T+y.text.slice(s.ch),C);else{var U=o(1,u.length-1);U.push(new cr(T+y.text.slice(s.ch),C,r)),a(y,y.text.slice(0,l.ch)+u[0],n(0)),e.insert(l.line+1,U)}else if(u.length==1)a(y,y.text.slice(0,l.ch)+u[0]+b.text.slice(s.ch),n(0)),e.remove(l.line+1,F);else{a(y,y.text.slice(0,l.ch)+u[0],n(0)),a(b,T+b.text.slice(s.ch),C);var X=o(1,u.length-1);F>1&&e.remove(l.line+1,F-1),e.insert(l.line+1,X)}Re(e,"change",e,t)}function zt(e,t,i){function r(n,a,o){if(n.linked)for(var l=0;l<n.linked.length;++l){var s=n.linked[l];if(s.doc!=a){var u=o&&s.sharedHist;i&&!u||(t(s.doc,u),r(s.doc,n,u))}}}r(e,null,!0)}function Ko(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Zn(e),sa(e),Xo(e),e.options.direction=t.direction,e.options.lineWrapping||Rn(e),e.options.mode=t.modeOption,$e(e)}function Xo(e){(e.doc.direction=="rtl"?qe:fe)(e.display.lineDiv,"CodeMirror-rtl")}function wu(e){nt(e,function(){Xo(e),$e(e)})}function Ii(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 fa(e,t){var i={from:An(t.from),to:Wt(t),text:Xt(e,t.from,t.to)};return Jo(e,i,t.from.line,t.to.line+1),zt(e,function(r){return Jo(r,i,t.from.line,t.to.line+1)},!0),i}function Yo(e){for(;e.length;){var t=pe(e);if(t.ranges)e.pop();else break}}function ku(e,t){if(t)return Yo(e.done),pe(e.done);if(e.done.length&&!pe(e.done).ranges)return pe(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),pe(e.done)}function Zo(e,t,i,r){var n=e.history;n.undone.length=0;var a=+new Date,o,l;if((n.lastOp==r||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(o=ku(n,n.lastOp==r)))l=pe(o.changes),se(t.from,t.to)==0&&se(t.from,l.to)==0?l.to=Wt(t):o.changes.push(fa(e,t));else{var s=pe(n.done);for((!s||!s.ranges)&&Pi(e.sel,n.done),o={changes:[fa(e,t)],generation:n.generation},n.done.push(o);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(i),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=a,n.lastOp=n.lastSelOp=r,n.lastOrigin=n.lastSelOrigin=t.origin,l||Ee(e,"historyAdded")}function Cu(e,t,i,r){var n=t.charAt(0);return n=="*"||n=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Lu(e,t,i,r){var n=e.history,a=r&&r.origin;i==n.lastSelOp||a&&n.lastSelOrigin==a&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==a||Cu(e,a,pe(n.done),t))?n.done[n.done.length-1]=t:Pi(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=a,n.lastSelOp=i,r&&r.clearRedo!==!1&&Yo(n.undone)}function Pi(e,t){var i=pe(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Jo(e,t,i,r){var n=t["spans_"+e.id],a=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(o){o.markedSpans&&((n||(n=t["spans_"+e.id]={}))[a]=o.markedSpans),++a})}function Tu(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function Mu(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var r=[],n=0;n<t.text.length;++n)r.push(Tu(i[n]));return r}function Qo(e,t){var i=Mu(e,t),r=On(e,t);if(!i)return r;if(!r)return i;for(var n=0;n<i.length;++n){var a=i[n],o=r[n];if(a&&o)e:for(var l=0;l<o.length;++l){for(var s=o[l],u=0;u<a.length;++u)if(a[u].marker==s.marker)continue e;a.push(s)}else o&&(i[n]=o)}return i}function xr(e,t,i){for(var r=[],n=0;n<e.length;++n){var a=e[n];if(a.ranges){r.push(i?st.prototype.deepCopy.call(a):a);continue}var o=a.changes,l=[];r.push({changes:l});for(var s=0;s<o.length;++s){var u=o[s],y=void 0;if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var b in u)(y=b.match(/^spans_(\d+)$/))&&ke(t,Number(y[1]))>-1&&(pe(l)[b]=u[b],delete u[b])}}return r}function ca(e,t,i,r){if(r){var n=e.anchor;if(i){var a=se(t,n)<0;a!=se(i,n)<0?(n=t,t=i):a!=se(t,i)<0&&(t=i)}return new me(n,t)}else return new me(i||t,t)}function Bi(e,t,i,r,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),je(e,new st([ca(e.sel.primary(),t,i,n)],0),r)}function Vo(e,t,i){for(var r=[],n=e.cm&&(e.cm.display.shift||e.extend),a=0;a<e.sel.ranges.length;a++)r[a]=ca(e.sel.ranges[a],t[a],null,n);var o=gt(e.cm,r,e.sel.primIndex);je(e,o,i)}function ha(e,t,i,r){var n=e.sel.ranges.slice(0);n[t]=i,je(e,gt(e.cm,n,e.sel.primIndex),r)}function $o(e,t,i,r){je(e,Rt(t,i),r)}function Du(e,t,i){var r={ranges:t.ranges,update:function(n){this.ranges=[];for(var a=0;a<n.length;a++)this.ranges[a]=new me(ue(e,n[a].anchor),ue(e,n[a].head))},origin:i&&i.origin};return Ee(e,"beforeSelectionChange",e,r),e.cm&&Ee(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?gt(e.cm,r.ranges,r.ranges.length-1):t}function el(e,t,i){var r=e.history.done,n=pe(r);n&&n.ranges?(r[r.length-1]=t,Ri(e,t,i)):je(e,t,i)}function je(e,t,i){Ri(e,t,i),Lu(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Ri(e,t,i){(ft(e,"beforeSelectionChange")||e.cm&&ft(e.cm,"beforeSelectionChange"))&&(t=Du(e,t,i));var r=i&&i.bias||(se(t.primary().head,e.sel.primary().head)<0?-1:1);tl(e,il(e,t,r,!0)),!(i&&i.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&mr(e.cm)}function tl(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ba(e.cm)),Re(e,"cursorActivity",e))}function rl(e){tl(e,il(e,e.sel,null,!1))}function il(e,t,i,r){for(var n,a=0;a<t.ranges.length;a++){var o=t.ranges[a],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[a],s=Wi(e,o.anchor,l&&l.anchor,i,r),u=o.head==o.anchor?s:Wi(e,o.head,l&&l.head,i,r);(n||s!=o.anchor||u!=o.head)&&(n||(n=t.ranges.slice(0,a)),n[a]=new me(s,u))}return n?gt(e.cm,n,t.primIndex):t}function br(e,t,i,r,n){var a=ie(e,t.line);if(a.markedSpans)for(var o=0;o<a.markedSpans.length;++o){var l=a.markedSpans[o],s=l.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,y="selectRight"in s?!s.selectRight:s.inclusiveRight;if((l.from==null||(u?l.from<=t.ch:l.from<t.ch))&&(l.to==null||(y?l.to>=t.ch:l.to>t.ch))){if(n&&(Ee(s,"beforeCursorEnter"),s.explicitlyCleared))if(a.markedSpans){--o;continue}else break;if(!s.atomic)continue;if(i){var b=s.find(r<0?1:-1),T=void 0;if((r<0?y:u)&&(b=nl(e,b,-r,b&&b.line==t.line?a:null)),b&&b.line==t.line&&(T=se(b,i))&&(r<0?T<0:T>0))return br(e,b,t,r,n)}var C=s.find(r<0?-1:1);return(r<0?u:y)&&(C=nl(e,C,r,C.line==t.line?a:null)),C?br(e,C,t,r,n):null}}return t}function Wi(e,t,i,r,n){var a=r||1,o=br(e,t,i,a,n)||!n&&br(e,t,i,a,!0)||br(e,t,i,-a,n)||!n&&br(e,t,i,-a,!0);return o||(e.cantEdit=!0,W(e.first,0))}function nl(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?ue(e,W(t.line-1)):null:i>0&&t.ch==(r||ie(e,t.line)).text.length?t.line<e.first+e.size-1?W(t.line+1,0):null:new W(t.line,t.ch+i)}function al(e){e.setSelection(W(e.firstLine(),0),W(e.lastLine()),Qe)}function ol(e,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return i&&(r.update=function(n,a,o,l){n&&(r.from=ue(e,n)),a&&(r.to=ue(e,a)),o&&(r.text=o),l!==void 0&&(r.origin=l)}),Ee(e,"beforeChange",e,r),e.cm&&Ee(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 Sr(e,t,i){if(e.cm){if(!e.cm.curOp)return We(e.cm,Sr)(e,t,i);if(e.cm.state.suppressEdits)return}if(!((ft(e,"beforeChange")||e.cm&&ft(e.cm,"beforeChange"))&&(t=ol(e,t,!0),!t))){var r=Ja&&!i&&Ls(e,t.from,t.to);if(r)for(var n=r.length-1;n>=0;--n)ll(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else ll(e,t)}}function ll(e,t){if(!(t.text.length==1&&t.text[0]==""&&se(t.from,t.to)==0)){var i=la(e,t);Zo(e,t,i,e.cm?e.cm.curOp.id:NaN),Vr(e,t,i,On(e,t));var r=[];zt(e,function(n,a){!a&&ke(r,n.history)==-1&&(cl(n.history,t),r.push(n.history)),Vr(n,t,null,On(n,t))})}}function zi(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!i)){for(var n=e.history,a,o=e.sel,l=t=="undo"?n.done:n.undone,s=t=="undo"?n.undone:n.done,u=0;u<l.length&&(a=l[u],!(i?a.ranges&&!a.equals(e.sel):!a.ranges));u++);if(u!=l.length){for(n.lastOrigin=n.lastSelOrigin=null;;)if(a=l.pop(),a.ranges){if(Pi(a,s),i&&!a.equals(e.sel)){je(e,a,{clearRedo:!1});return}o=a}else if(r){l.push(a);return}else break;var y=[];Pi(o,s),s.push({changes:y,generation:n.generation}),n.generation=a.generation||++n.maxGeneration;for(var b=ft(e,"beforeChange")||e.cm&&ft(e.cm,"beforeChange"),T=function(P){var U=a.changes[P];if(U.origin=t,b&&!ol(e,U,!1))return l.length=0,{};y.push(fa(e,U));var X=P?la(e,U):pe(l);Vr(e,U,X,Qo(e,U)),!P&&e.cm&&e.cm.scrollIntoView({from:U.from,to:Wt(U)});var J=[];zt(e,function(Y,$){!$&&ke(J,Y.history)==-1&&(cl(Y.history,U),J.push(Y.history)),Vr(Y,U,null,Qo(Y,U))})},C=a.changes.length-1;C>=0;--C){var F=T(C);if(F)return F.v}}}}function sl(e,t){if(t!=0&&(e.first+=t,e.sel=new st(ht(e.sel.ranges,function(n){return new me(W(n.anchor.line+t,n.anchor.ch),W(n.head.line+t,n.head.ch))}),e.sel.primIndex),e.cm)){$e(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;r<i.viewTo;r++)Pt(e.cm,r,"gutter")}}function Vr(e,t,i,r){if(e.cm&&!e.cm.curOp)return We(e.cm,Vr)(e,t,i,r);if(t.to.line<e.first){sl(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 n=t.text.length-1-(e.first-t.from.line);sl(e,n),t={from:W(e.first,0),to:W(t.to.line+n,t.to.ch),text:[pe(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:W(a,ie(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Xt(e,t.from,t.to),i||(i=la(e,t)),e.cm?Fu(e.cm,t,r):ua(e,t,r),Ri(e,i,Qe),e.cantEdit&&Wi(e,W(e.firstLine(),0))&&(e.cantEdit=!1)}}function Fu(e,t,i){var r=e.doc,n=e.display,a=t.from,o=t.to,l=!1,s=a.line;e.options.lineWrapping||(s=ye(dt(ie(r,a.line))),r.iter(s,o.line+1,function(C){if(C==n.maxLine)return l=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Ba(e),ua(r,t,i,Mo(e)),e.options.lineWrapping||(r.iter(s,a.line+t.text.length,function(C){var F=ki(C);F>n.maxLineLength&&(n.maxLine=C,n.maxLineLength=F,n.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),ys(r,a.line),Zr(e,400);var u=t.text.length-(o.line-a.line)-1;t.full?$e(e):a.line==o.line&&t.text.length==1&&!jo(e.doc,t)?Pt(e,a.line,"text"):$e(e,a.line,o.line+1,u);var y=ft(e,"changes"),b=ft(e,"change");if(b||y){var T={from:a,to:o,text:t.text,removed:t.removed,origin:t.origin};b&&Re(e,"change",e,T),y&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(T)}e.display.selForContextMenu=null}function wr(e,t,i,r,n){var a;r||(r=i),se(r,i)<0&&(a=[r,i],i=a[0],r=a[1]),typeof t=="string"&&(t=e.splitLines(t)),Sr(e,{from:i,to:r,text:t,origin:n})}function ul(e,t,i,r){i<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function fl(e,t,i,r){for(var n=0;n<e.length;++n){var a=e[n],o=!0;if(a.ranges){a.copied||(a=e[n]=a.deepCopy(),a.copied=!0);for(var l=0;l<a.ranges.length;l++)ul(a.ranges[l].anchor,t,i,r),ul(a.ranges[l].head,t,i,r);continue}for(var s=0;s<a.changes.length;++s){var u=a.changes[s];if(i<u.from.line)u.from=W(u.from.line+r,u.from.ch),u.to=W(u.to.line+r,u.to.ch);else if(t<=u.to.line){o=!1;break}}o||(e.splice(0,n+1),n=0)}}function cl(e,t){var i=t.from.line,r=t.to.line,n=t.text.length-(r-i)-1;fl(e.done,i,r,n),fl(e.undone,i,r,n)}function $r(e,t,i,r){var n=t,a=t;return typeof t=="number"?a=ie(e,_a(e,t)):n=ye(t),n==null?null:(r(a,n)&&e.cm&&Pt(e.cm,n,i),a)}function ei(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}ei.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,r=e+t;i<r;++i){var n=this.lines[i];this.height-=n.height,Es(n),Re(n,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,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,i){for(var r=e+t;e<r;++e)if(i(this.lines[e]))return!0}};function ti(e){this.children=e;for(var t=0,i=0,r=0;r<e.length;++r){var n=e[r];t+=n.chunkSize(),i+=n.height,n.parent=this}this.size=t,this.height=i,this.parent=null}ti.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var r=this.children[i],n=r.chunkSize();if(e<n){var a=Math.min(t,n-e),o=r.height;if(r.removeInner(e,a),this.height-=o-r.height,n==a&&(this.children.splice(i--,1),r.parent=null),(t-=a)==0)break;e=0}else e-=n}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ei))){var l=[];this.collapse(l),this.children=[new ei(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,i){this.size+=t.length,this.height+=i;for(var r=0;r<this.children.length;++r){var n=this.children[r],a=n.chunkSize();if(e<=a){if(n.insertInner(e,t,i),n.lines&&n.lines.length>50){for(var o=n.lines.length%25+25,l=o;l<n.lines.length;){var s=new ei(n.lines.slice(l,l+=25));n.height-=s.height,this.children.splice(++r,0,s),s.parent=this}n.lines=n.lines.slice(0,o),this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new ti(t);if(e.parent){e.size-=i.size,e.height-=i.height;var n=ke(e.parent.children,e);e.parent.children.splice(n+1,0,i)}else{var r=new ti(e.children);r.parent=e,e.children=[r,i],e=r}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var r=0;r<this.children.length;++r){var n=this.children[r],a=n.chunkSize();if(e<a){var o=Math.min(t,a-e);if(n.iterN(e,o,i))return!0;if((t-=o)==0)break;e=0}else e-=a}}};var ri=function(e,t,i){if(i)for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.doc=e,this.node=t};ri.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,r=ye(i);if(!(r==null||!t)){for(var n=0;n<t.length;++n)t[n]==this&&t.splice(n--,1);t.length||(i.widgets=null);var a=Ur(this);xt(i,Math.max(0,i.height-a)),e&&(nt(e,function(){hl(e,i,-a),Pt(e,r,"widget")}),Re(e,"lineWidgetCleared",e,this,r))}},ri.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,r=this.line;this.height=null;var n=Ur(this)-t;n&&(It(this.doc,r)||xt(r,r.height+n),i&&nt(i,function(){i.curOp.forceUpdate=!0,hl(i,r,n),Re(i,"lineWidgetChanged",i,e,ye(r))}))},sr(ri);function hl(e,t,i){Tt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ta(e,i)}function Eu(e,t,i,r){var n=new ri(e,i,r),a=e.cm;return a&&n.noHScroll&&(a.display.alignWidgets=!0),$r(e,t,"widget",function(o){var l=o.widgets||(o.widgets=[]);if(n.insertAt==null?l.push(n):l.splice(Math.min(l.length,Math.max(0,n.insertAt)),0,n),n.line=o,a&&!It(e,o)){var s=Tt(o)<e.scrollTop;xt(o,o.height+Ur(n)),s&&ta(a,n.height),a.curOp.forceUpdate=!0}return!0}),a&&Re(a,"lineWidgetAdded",a,n,typeof t=="number"?t:ye(t)),n}var dl=0,_t=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++dl};_t.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&tr(e),ft(this,"clear")){var i=this.find();i&&Re(this,"clear",i.from,i.to)}for(var r=null,n=null,a=0;a<this.lines.length;++a){var o=this.lines[a],l=Wr(o.markedSpans,this);e&&!this.collapsed?Pt(e,ye(o),"text"):e&&(l.to!=null&&(n=ye(o)),l.from!=null&&(r=ye(o))),o.markedSpans=Ss(o.markedSpans,l),l.from==null&&this.collapsed&&!It(this.doc,o)&&e&&xt(o,pr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=dt(this.lines[s]),y=ki(u);y>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=y,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&$e(e,r,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&rl(e.doc)),e&&Re(e,"markerCleared",e,this,r,n),t&&rr(e),this.parent&&this.parent.clear()}},_t.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,n=0;n<this.lines.length;++n){var a=this.lines[n],o=Wr(a.markedSpans,this);if(o.from!=null&&(i=W(t?a:ye(a),o.from),e==-1))return i;if(o.to!=null&&(r=W(t?a:ye(a),o.to),e==1))return r}return i&&{from:i,to:r}},_t.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,r=this.doc.cm;!t||!r||nt(r,function(){var n=t.line,a=ye(t.line),o=Un(r,a);if(o&&(xo(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!It(i.doc,n)&&i.height!=null){var l=i.height;i.height=null;var s=Ur(i)-l;s&&xt(n,n.height+s)}Re(r,"markerChanged",r,e)})},_t.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ke(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},_t.prototype.detachLine=function(e){if(this.lines.splice(ke(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},sr(_t);function kr(e,t,i,r,n){if(r&&r.shared)return Au(e,t,i,r,n);if(e.cm&&!e.cm.curOp)return We(e.cm,kr)(e,t,i,r,n);var a=new _t(e,n),o=se(t,i);if(r&&ot(r,a,!1),o>0||o==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=q("span",[a.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(ro(e,t.line,t,i,a)||t.line!=i.line&&ro(e,i.line,t,i,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");bs()}a.addToHistory&&Zo(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var l=t.line,s=e.cm,u;if(e.iter(l,i.line+1,function(b){s&&a.collapsed&&!s.options.lineWrapping&&dt(b)==s.display.maxLine&&(u=!0),a.collapsed&&l!=t.line&&xt(b,0),ws(b,new xi(a,l==t.line?t.ch:null,l==i.line?i.ch:null),e.cm&&e.cm.curOp),++l}),a.collapsed&&e.iter(t.line,i.line+1,function(b){It(e,b)&&xt(b,0)}),a.clearOnEnter&&oe(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(xs(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++dl,a.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),a.collapsed)$e(s,t.line,i.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var y=t.line;y<=i.line;y++)Pt(s,y,"text");a.atomic&&rl(s.doc),Re(s,"markerAdded",s,a)}return a}var ii=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};ii.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Re(this,"clear")}},ii.prototype.find=function(e,t){return this.primary.find(e,t)},sr(ii);function Au(e,t,i,r,n){r=ot(r),r.shared=!1;var a=[kr(e,t,i,r,n)],o=a[0],l=r.widgetNode;return zt(e,function(s){l&&(r.widgetNode=l.cloneNode(!0)),a.push(kr(s,ue(s,t),ue(s,i),r,n));for(var u=0;u<s.linked.length;++u)if(s.linked[u].isParent)return;o=pe(a)}),new ii(a,o)}function pl(e){return e.findMarks(W(e.first,0),e.clipPos(W(e.lastLine())),function(t){return t.parent})}function Nu(e,t){for(var i=0;i<t.length;i++){var r=t[i],n=r.find(),a=e.clipPos(n.from),o=e.clipPos(n.to);if(se(a,o)){var l=kr(e,a,o,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}function Hu(e){for(var t=function(r){var n=e[r],a=[n.primary.doc];zt(n.primary.doc,function(s){return a.push(s)});for(var o=0;o<n.markers.length;o++){var l=n.markers[o];ke(a,l.doc)==-1&&(l.parent=null,n.markers.splice(o--,1))}},i=0;i<e.length;i++)t(i)}var Ou=0,et=function(e,t,i,r,n){if(!(this instanceof et))return new et(e,t,i,r,n);i==null&&(i=0),ti.call(this,[new ei([new cr("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var a=W(i,0);this.sel=Rt(a),this.history=new Ii(null),this.id=++Ou,this.modeOption=t,this.lineSep=r,this.direction=n=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ua(this,{from:a,to:a,text:e}),je(this,Rt(a),Qe)};et.prototype=Ha(ti.prototype,{constructor:et,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,r=0;r<t.length;++r)i+=t[r].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Dn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:ze(function(e){var t=W(this.first,0),i=this.first+this.size-1;Sr(this,{from:t,to:W(i,ie(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&jr(this.cm,0,0),je(this,Rt(t),Qe)}),replaceRange:function(e,t,i,r){t=ue(this,t),i=i?ue(this,i):t,wr(this,e,t,i,r)},getRange:function(e,t,i){var r=Xt(this,ue(this,e),ue(this,t));return i===!1?r:i===""?r.join(""):r.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Br(this,e))return ie(this,e)},getLineNumber:function(e){return ye(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ie(this,e)),dt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ue(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ze(function(e,t,i){$o(this,ue(this,typeof e=="number"?W(e,t||0):e),null,i)}),setSelection:ze(function(e,t,i){$o(this,ue(this,e),ue(this,t||e),i)}),extendSelection:ze(function(e,t,i){Bi(this,ue(this,e),t&&ue(this,t),i)}),extendSelections:ze(function(e,t){Vo(this,Ua(this,e),t)}),extendSelectionsBy:ze(function(e,t){var i=ht(this.sel.ranges,e);Vo(this,Ua(this,i),t)}),setSelections:ze(function(e,t,i){if(e.length){for(var r=[],n=0;n<e.length;n++)r[n]=new me(ue(this,e[n].anchor),ue(this,e[n].head||e[n].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),je(this,gt(this.cm,r,t),i)}}),addSelection:ze(function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new me(ue(this,e),ue(this,t||e))),je(this,gt(this.cm,r,r.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,r=0;r<t.length;r++){var n=Xt(this,t[r].from(),t[r].to());i=i?i.concat(n):n}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,r=0;r<i.length;r++){var n=Xt(this,i[r].from(),i[r].to());e!==!1&&(n=n.join(e||this.lineSeparator())),t[r]=n}return t},replaceSelection:function(e,t,i){for(var r=[],n=0;n<this.sel.ranges.length;n++)r[n]=e;this.replaceSelections(r,t,i||"+input")},replaceSelections:ze(function(e,t,i){for(var r=[],n=this.sel,a=0;a<n.ranges.length;a++){var o=n.ranges[a];r[a]={from:o.from(),to:o.to(),text:this.splitLines(e[a]),origin:i}}for(var l=t&&t!="end"&&Su(this,r,t),s=r.length-1;s>=0;s--)Sr(this,r[s]);l?el(this,l):this.cm&&mr(this.cm)}),undo:ze(function(){zi(this,"undo")}),redo:ze(function(){zi(this,"redo")}),undoSelection:ze(function(){zi(this,"undo",!0)}),redoSelection:ze(function(){zi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var n=0;n<e.undone.length;n++)e.undone[n].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Ii(this.history),zt(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:xr(this.history.done),undone:xr(this.history.undone)}},setHistory:function(e){var t=this.history=new Ii(this.history);t.done=xr(e.done.slice(0),null,!0),t.undone=xr(e.undone.slice(0),null,!0)},setGutterMarker:ze(function(e,t,i){return $r(this,e,"gutter",function(r){var n=r.gutterMarkers||(r.gutterMarkers={});return n[t]=i,!i&&Oa(n)&&(r.gutterMarkers=null),!0})}),clearGutter:ze(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&$r(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Oa(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Br(this,e)||(t=e,e=ie(this,e),!e))return null}else if(t=ye(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:ze(function(e,t,i){return $r(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[n])r[n]=i;else{if(K(i).test(r[n]))return!1;r[n]+=" "+i}return!0})}),removeLineClass:ze(function(e,t,i){return $r(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",a=r[n];if(a)if(i==null)r[n]=null;else{var o=a.match(K(i));if(!o)return!1;var l=o.index+o[0].length;r[n]=a.slice(0,o.index)+(!o.index||l==a.length?"":" ")+a.slice(l)||null}else return!1;return!0})}),addLineWidget:ze(function(e,t,i){return Eu(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return kr(this,ue(this,e),ue(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ue(this,e),kr(this,e,e,i,"bookmark")},findMarksAt:function(e){e=ue(this,e);var t=[],i=ie(this,e.line).markedSpans;if(i)for(var r=0;r<i.length;++r){var n=i[r];(n.from==null||n.from<=e.ch)&&(n.to==null||n.to>=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,i){e=ue(this,e),t=ue(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,function(a){var o=a.markedSpans;if(o)for(var l=0;l<o.length;l++){var s=o[l];!(s.to!=null&&n==e.line&&e.ch>=s.to||s.from==null&&n!=e.line||s.from!=null&&n==t.line&&s.from>=t.ch)&&(!i||i(s.marker))&&r.push(s.marker.parent||s.marker)}++n}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;r<i.length;++r)i[r].from!=null&&e.push(i[r].marker)}),e},posFromIndex:function(e){var t,i=this.first,r=this.lineSeparator().length;return this.iter(function(n){var a=n.text.length+r;if(a>e)return t=e,!0;e-=a,++i}),ue(this,W(i,t))},indexFromPos:function(e){e=ue(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+i}),t},copy:function(e){var t=new et(Dn(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,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var r=new et(Dn(this,t,i),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}],Nu(r,pl(this)),r},unlinkDoc:function(e){if(e instanceof Ce&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Hu(pl(this));break}}if(e.history==this.history){var r=[e.id];zt(e,function(n){return r.push(n.id)},!0),e.history=new Ii(null),e.history.done=xr(this.history.done,r),e.history.undone=xr(this.history.undone,r)}},iterLinkedDocs:function(e){zt(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):kn(e)},lineSeparator:function(){return this.lineSep||`
11
- `},setDirection:ze(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&wu(this.cm))})}),et.prototype.eachLine=et.prototype.iter;var gl=0;function Iu(e){var t=this;if(vl(t),!(Be(t,e)||Mt(t.display,e))){Ve(e),g&&(gl=+new Date);var i=Qt(t,e,!0),r=e.dataTransfer.files;if(!(!i||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var n=r.length,a=Array(n),o=0,l=function(){++o==n&&We(t,function(){i=ue(t.doc,i);var C={from:i,to:i,text:t.doc.splitLines(a.filter(function(F){return F!=null}).join(t.doc.lineSeparator())),origin:"paste"};Sr(t.doc,C),el(t.doc,Rt(ue(t.doc,i),ue(t.doc,Wt(C))))})()},s=function(C,F){if(t.options.allowDropFileTypes&&ke(t.options.allowDropFileTypes,C.type)==-1){l();return}var P=new FileReader;P.onerror=function(){return l()},P.onload=function(){var U=P.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(U)){l();return}a[F]=U,l()},P.readAsText(C)},u=0;u<r.length;u++)s(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var y=e.dataTransfer.getData("Text");if(y){var b;if(t.state.draggingText&&!t.state.draggingText.copy&&(b=t.listSelections()),Ri(t.doc,Rt(i,i)),b)for(var T=0;T<b.length;++T)wr(t.doc,"",b[T].anchor,b[T].head,"drag");t.replaceSelection(y,"around","paste"),t.display.input.focus()}}catch{}}}}function Pu(e,t){if(g&&(!e.state.draggingText||+new Date-gl<100)){Pr(t);return}if(!(Be(e,t)||Mt(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!Z)){var i=L("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",I&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),I&&i.parentNode.removeChild(i)}}function Bu(e,t){var i=Qt(e,t);if(i){var r=document.createDocumentFragment();Jn(e,i,r),e.display.dragCursor||(e.display.dragCursor=L("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),le(e.display.dragCursor,r)}}function vl(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ml(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),i=[],r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&i.push(n)}i.length&&i[0].operation(function(){for(var a=0;a<i.length;a++)e(i[a])})}}var yl=!1;function Ru(){yl||(Wu(),yl=!0)}function Wu(){var e;oe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ml(zu)},100))}),oe(window,"blur",function(){return ml(vr)})}function zu(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ut={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"},ni=0;ni<10;ni++)Ut[ni+48]=Ut[ni+96]=String(ni);for(var _i=65;_i<=90;_i++)Ut[_i]=String.fromCharCode(_i);for(var ai=1;ai<=12;ai++)Ut[ai+111]=Ut[ai+63235]="F"+ai;var Ft={};Ft.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"},Ft.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"},Ft.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"},Ft.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"]},Ft.default=z?Ft.macDefault:Ft.pcDefault;function _u(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,r,n,a,o=0;o<t.length-1;o++){var l=t[o];if(/^(cmd|meta|m)$/i.test(l))a=!0;else if(/^a(lt)?$/i.test(l))i=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))n=!0;else throw new Error("Unrecognized modifier name: "+l)}return i&&(e="Alt-"+e),r&&(e="Ctrl-"+e),a&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function Uu(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(r=="..."){delete e[i];continue}for(var n=ht(i.split(" "),_u),a=0;a<n.length;a++){var o=void 0,l=void 0;a==n.length-1?(l=n.join(" "),o=r):(l=n.slice(0,a+1).join(" "),o="...");var s=t[l];if(!s)t[l]=o;else if(s!=o)throw new Error("Inconsistent bindings for "+l)}delete e[i]}for(var u in t)e[u]=t[u];return e}function Cr(e,t,i,r){t=Ui(t);var n=t.call?t.call(e,r):t[e];if(n===!1)return"nothing";if(n==="...")return"multi";if(n!=null&&i(n))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Cr(e,t.fallthrough,i,r);for(var a=0;a<t.fallthrough.length;a++){var o=Cr(e,t.fallthrough[a],i,r);if(o)return o}}}function xl(e){var t=typeof e=="string"?e:Ut[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function bl(e,t,i){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(re?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(re?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Sl(e,t){if(I&&e.keyCode==34&&e.char)return!1;var i=Ut[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),bl(i,e,t))}function Ui(e){return typeof e=="string"?Ft[e]:e}function Lr(e,t){for(var i=e.doc.sel.ranges,r=[],n=0;n<i.length;n++){for(var a=t(i[n]);r.length&&se(a.from,pe(r).to)<=0;){var o=r.pop();if(se(o.from,a.from)<0){a.from=o.from;break}}r.push(a)}nt(e,function(){for(var l=r.length-1;l>=0;l--)wr(e.doc,"",r[l].from,r[l].to,"+delete");mr(e)})}function da(e,t,i){var r=Ia(e.text,t+i,i);return r<0||r>e.text.length?null:r}function pa(e,t,i){var r=da(e,t.ch,i);return r==null?null:new W(t.line,r,i<0?"after":"before")}function ga(e,t,i,r,n){if(e){t.doc.direction=="rtl"&&(n=-n);var a=Ct(i,t.doc.direction);if(a){var o=n<0?pe(a):a[0],l=n<0==(o.level==1),s=l?"after":"before",u;if(o.level>0||t.doc.direction=="rtl"){var y=dr(t,i);u=n<0?i.text.length-1:0;var b=wt(t,y,u).top;u=Hr(function(T){return wt(t,y,T).top==b},n<0==(o.level==1)?o.from:o.to-1,u),s=="before"&&(u=da(i,u,1))}else u=n<0?o.to:o.from;return new W(r,u,s)}}return new W(r,n<0?i.text.length:0,n<0?"before":"after")}function qu(e,t,i,r){var n=Ct(t,e.doc.direction);if(!n)return pa(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var a=Ir(n,i.ch,i.sticky),o=n[a];if(e.doc.direction=="ltr"&&o.level%2==0&&(r>0?o.to>i.ch:o.from<i.ch))return pa(t,i,r);var l=function(X,J){return da(t,X instanceof W?X.ch:X,J)},s,u=function(X){return e.options.lineWrapping?(s=s||dr(e,t),To(e,t,s,X)):{begin:0,end:t.text.length}},y=u(i.sticky=="before"?l(i,-1):i.ch);if(e.doc.direction=="rtl"||o.level==1){var b=o.level==1==r<0,T=l(i,b?1:-1);if(T!=null&&(b?T<=o.to&&T<=y.end:T>=o.from&&T>=y.begin)){var C=b?"before":"after";return new W(i.line,T,C)}}var F=function(X,J,Y){for(var $=function(be,_e){return _e?new W(i.line,l(be,1),"before"):new W(i.line,be,"after")};X>=0&&X<n.length;X+=J){var ae=n[X],ne=J>0==(ae.level!=1),de=ne?Y.begin:l(Y.end,-1);if(ae.from<=de&&de<ae.to||(de=ne?ae.from:l(ae.to,-1),Y.begin<=de&&de<Y.end))return $(de,ne)}},P=F(a+r,r,y);if(P)return P;var U=r>0?y.end:l(y.begin,-1);return U!=null&&!(r>0&&U==t.text.length)&&(P=F(r>0?0:n.length-1,r,u(U)),P)?P:null}var oi={selectAll:al,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Qe)},killLine:function(e){return Lr(e,function(t){if(t.empty()){var i=ie(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:W(t.head.line+1,0)}:{from:t.head,to:W(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Lr(e,function(t){return{from:W(t.from().line,0),to:ue(e.doc,W(t.to().line+1,0))}})},delLineLeft:function(e){return Lr(e,function(t){return{from:W(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Lr(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Lr(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"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(W(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(W(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return wl(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return kl(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Gu(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},mt)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},mt)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return r.ch<e.getLine(r.line).search(/\S/)?kl(e,t.head):r},mt)},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=[],i=e.listSelections(),r=e.options.tabSize,n=0;n<i.length;n++){var a=i[n].from(),o=Oe(e.getLine(a.line),a.ch,r);t.push(Ht(r-o%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return nt(e,function(){for(var t=e.listSelections(),i=[],r=0;r<t.length;r++)if(t[r].empty()){var n=t[r].head,a=ie(e.doc,n.line).text;if(a){if(n.ch==a.length&&(n=new W(n.line,n.ch-1)),n.ch>0)n=new W(n.line,n.ch+1),e.replaceRange(a.charAt(n.ch-1)+a.charAt(n.ch-2),W(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var o=ie(e.doc,n.line-1).text;o&&(n=new W(n.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),W(n.line-1,o.length-1),n,"+transpose"))}}i.push(new me(n,n))}e.setSelections(i)})},newlineAndIndent:function(e){return nt(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);mr(e)})},openLine:function(e){return e.replaceSelection(`
12
- `,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function wl(e,t){var i=ie(e.doc,t),r=dt(i);return r!=i&&(t=ye(r)),ga(!0,e,r,t,1)}function Gu(e,t){var i=ie(e.doc,t),r=Ms(i);return r!=i&&(t=ye(r)),ga(!0,e,i,t,-1)}function kl(e,t){var i=wl(e,t.line),r=ie(e.doc,i.line),n=Ct(r,e.doc.direction);if(!n||n[0].level==0){var a=Math.max(i.ch,r.text.search(/\S/)),o=t.line==i.line&&t.ch<=a&&t.ch;return W(i.line,o?0:a,i.sticky)}return i}function qi(e,t,i){if(typeof t=="string"&&(t=oi[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),n=t(e)!=Ie}finally{e.display.shift=r,e.state.suppressEdits=!1}return n}function ju(e,t,i){for(var r=0;r<e.state.keyMaps.length;r++){var n=Cr(t,e.state.keyMaps[r],i,e);if(n)return n}return e.options.extraKeys&&Cr(t,e.options.extraKeys,i,e)||Cr(t,e.options.keyMap,i,e)}var Ku=new Xe;function li(e,t,i,r){var n=e.state.keySeq;if(n){if(xl(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ku.set(50,function(){e.state.keySeq==n&&(e.state.keySeq=null,e.display.input.reset())}),Cl(e,n+" "+t,i,r))return!0}return Cl(e,t,i,r)}function Cl(e,t,i,r){var n=ju(e,t,r);return n=="multi"&&(e.state.keySeq=t),n=="handled"&&Re(e,"keyHandled",e,t,i),(n=="handled"||n=="multi")&&(Ve(i),Qn(e)),!!n}function Ll(e,t){var i=Sl(t,!0);return i?t.shiftKey&&!e.state.keySeq?li(e,"Shift-"+i,t,function(r){return qi(e,r,!0)})||li(e,i,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return qi(e,r)}):li(e,i,t,function(r){return qi(e,r)}):!1}function Xu(e,t,i){return li(e,"'"+i+"'",t,function(r){return qi(e,r,!0)})}var va=null;function Tl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=ge(te(t)),!Be(t,e))){g&&k<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var r=Ll(t,e);I&&(va=r?i:null,!r&&i==88&&!cs&&(z?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),p&&!z&&!r&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Yu(t)}}function Yu(e){var t=e.display.lineDiv;qe(t,"CodeMirror-crosshair");function i(r){(r.keyCode==18||!r.altKey)&&(fe(t,"CodeMirror-crosshair"),lt(document,"keyup",i),lt(document,"mouseover",i))}oe(document,"keyup",i),oe(document,"mouseover",i)}function Ml(e){e.keyCode==16&&(this.doc.sel.shift=!1),Be(this,e)}function Dl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(Mt(t.display,e)||Be(t,e)||e.ctrlKey&&!e.altKey||z&&e.metaKey)){var i=e.keyCode,r=e.charCode;if(I&&i==va){va=null,Ve(e);return}if(!(I&&(!e.which||e.which<10)&&Ll(t,e))){var n=String.fromCharCode(r??i);n!="\b"&&(Xu(t,e,n)||t.display.input.onKeyPress(e))}}}var Zu=400,ma=function(e,t,i){this.time=e,this.pos=t,this.button=i};ma.prototype.compare=function(e,t,i){return this.time+Zu>e&&se(t,this.pos)==0&&i==this.button};var si,ui;function Ju(e,t){var i=+new Date;return ui&&ui.compare(i,e,t)?(si=ui=null,"triple"):si&&si.compare(i,e,t)?(ui=new ma(i,e,t),si=null,"double"):(si=new ma(i,e,t),ui=null,"single")}function Fl(e){var t=this,i=t.display;if(!(Be(t,e)||i.activeTouch&&i.input.supportsTouch())){if(i.input.ensurePolled(),i.shift=e.shiftKey,Mt(i,e)){E||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(!ya(t,e)){var r=Qt(t,e),n=Wa(e),a=r?Ju(r,n):"single";he(t).focus(),n==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Qu(t,n,r,a,e))&&(n==1?r?$u(t,r,a,e):bn(e)==i.scroller&&Ve(e):n==2?(r&&Bi(t.doc,r),setTimeout(function(){return i.input.focus()},20)):n==3&&(we?t.display.input.onContextMenu(e):Vn(t)))}}}function Qu(e,t,i,r,n){var a="Click";return r=="double"?a="Double"+a:r=="triple"&&(a="Triple"+a),a=(t==1?"Left":t==2?"Middle":"Right")+a,li(e,bl(a,n),n,function(o){if(typeof o=="string"&&(o=oi[o]),!o)return!1;var l=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),l=o(e,i)!=Ie}finally{e.state.suppressEdits=!1}return l})}function Vu(e,t,i){var r=e.getOption("configureMouse"),n=r?r(e,t,i):{};if(n.unit==null){var a=G?i.shiftKey&&i.metaKey:i.altKey;n.unit=a?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(n.extend==null||e.doc.extend)&&(n.extend=e.doc.extend||i.shiftKey),n.addNew==null&&(n.addNew=z?i.metaKey:i.ctrlKey),n.moveOnDrag==null&&(n.moveOnDrag=!(z?i.altKey:i.ctrlKey)),n}function $u(e,t,i,r){g?setTimeout(Je(Eo,e),0):e.curOp.focus=ge(te(e));var n=Vu(e,i,r),a=e.doc.sel,o;e.options.dragDrop&&ls&&!e.isReadOnly()&&i=="single"&&(o=a.contains(t))>-1&&(se((o=a.ranges[o]).from(),t)<0||t.xRel>0)&&(se(o.to(),t)>0||t.xRel<0)?ef(e,r,t,n):tf(e,r,t,n)}function ef(e,t,i,r){var n=e.display,a=!1,o=We(e,function(u){E&&(n.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Vn(e)),lt(n.wrapper.ownerDocument,"mouseup",o),lt(n.wrapper.ownerDocument,"mousemove",l),lt(n.scroller,"dragstart",s),lt(n.scroller,"drop",o),a||(Ve(u),r.addNew||Bi(e.doc,i,null,null,r.extend),E&&!Z||g&&k==9?setTimeout(function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()},20):n.input.focus())}),l=function(u){a=a||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return a=!0};E&&(n.scroller.draggable=!0),e.state.draggingText=o,o.copy=!r.moveOnDrag,oe(n.wrapper.ownerDocument,"mouseup",o),oe(n.wrapper.ownerDocument,"mousemove",l),oe(n.scroller,"dragstart",s),oe(n.scroller,"drop",o),e.state.delayingBlurEvent=!0,setTimeout(function(){return n.input.focus()},20),n.scroller.dragDrop&&n.scroller.dragDrop()}function El(e,t,i){if(i=="char")return new me(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new me(W(t.line,0),ue(e.doc,W(t.line+1,0)));var r=i(e,t);return new me(r.from,r.to)}function tf(e,t,i,r){g&&Vn(e);var n=e.display,a=e.doc;Ve(t);var o,l,s=a.sel,u=s.ranges;if(r.addNew&&!r.extend?(l=a.sel.contains(i),l>-1?o=u[l]:o=new me(i,i)):(o=a.sel.primary(),l=a.sel.primIndex),r.unit=="rectangle")r.addNew||(o=new me(i,i)),i=Qt(e,t,!0,!0),l=-1;else{var y=El(e,i,r.unit);r.extend?o=ca(o,y.anchor,y.head,r.extend):o=y}r.addNew?l==-1?(l=u.length,je(a,gt(e,u.concat([o]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&r.unit=="char"&&!r.extend?(je(a,gt(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=a.sel):ha(a,l,o,Nr):(l=0,je(a,new st([o],0),Nr),s=a.sel);var b=i;function T(Y){if(se(b,Y)!=0)if(b=Y,r.unit=="rectangle"){for(var $=[],ae=e.options.tabSize,ne=Oe(ie(a,i.line).text,i.ch,ae),de=Oe(ie(a,Y.line).text,Y.ch,ae),be=Math.min(ne,de),_e=Math.max(ne,de),Te=Math.min(i.line,Y.line),at=Math.min(e.lastLine(),Math.max(i.line,Y.line));Te<=at;Te++){var tt=ie(a,Te).text,Ne=yt(tt,be,ae);be==_e?$.push(new me(W(Te,Ne),W(Te,Ne))):tt.length>Ne&&$.push(new me(W(Te,Ne),W(Te,yt(tt,_e,ae))))}$.length||$.push(new me(i,i)),je(a,gt(e,s.ranges.slice(0,l).concat($),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Y)}else{var rt=o,Ge=El(e,Y,r.unit),Pe=rt.anchor,He;se(Ge.anchor,Pe)>0?(He=Ge.head,Pe=mi(rt.from(),Ge.anchor)):(He=Ge.anchor,Pe=vi(rt.to(),Ge.head));var De=s.ranges.slice(0);De[l]=rf(e,new me(ue(a,Pe),He)),je(a,gt(e,De,l),Nr)}}var C=n.wrapper.getBoundingClientRect(),F=0;function P(Y){var $=++F,ae=Qt(e,Y,!0,r.unit=="rectangle");if(ae)if(se(ae,b)!=0){e.curOp.focus=ge(te(e)),T(ae);var ne=Ai(n,a);(ae.line>=ne.to||ae.line<ne.from)&&setTimeout(We(e,function(){F==$&&P(Y)}),150)}else{var de=Y.clientY<C.top?-20:Y.clientY>C.bottom?20:0;de&&setTimeout(We(e,function(){F==$&&(n.scroller.scrollTop+=de,P(Y))}),50)}}function U(Y){e.state.selectingText=!1,F=1/0,Y&&(Ve(Y),n.input.focus()),lt(n.wrapper.ownerDocument,"mousemove",X),lt(n.wrapper.ownerDocument,"mouseup",J),a.history.lastSelOrigin=null}var X=We(e,function(Y){Y.buttons===0||!Wa(Y)?U(Y):P(Y)}),J=We(e,U);e.state.selectingText=J,oe(n.wrapper.ownerDocument,"mousemove",X),oe(n.wrapper.ownerDocument,"mouseup",J)}function rf(e,t){var i=t.anchor,r=t.head,n=ie(e.doc,i.line);if(se(i,r)==0&&i.sticky==r.sticky)return t;var a=Ct(n);if(!a)return t;var o=Ir(a,i.ch,i.sticky),l=a[o];if(l.from!=i.ch&&l.to!=i.ch)return t;var s=o+(l.from==i.ch==(l.level!=1)?0:1);if(s==0||s==a.length)return t;var u;if(r.line!=i.line)u=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var y=Ir(a,r.ch,r.sticky),b=y-o||(r.ch-i.ch)*(l.level==1?-1:1);y==s-1||y==s?u=b<0:u=b>0}var T=a[s+(u?-1:0)],C=u==(T.level==1),F=C?T.from:T.to,P=C?"after":"before";return i.ch==F&&i.sticky==P?t:new me(new W(i.line,F,P),r)}function Al(e,t,i,r){var n,a;if(t.touches)n=t.touches[0].clientX,a=t.touches[0].clientY;else try{n=t.clientX,a=t.clientY}catch{return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ve(t);var o=e.display,l=o.lineDiv.getBoundingClientRect();if(a>l.bottom||!ft(e,i))return xn(t);a-=l.top-o.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var u=o.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=n){var y=Yt(e.doc,a),b=e.display.gutterSpecs[s];return Ee(e,i,e,y,b.className,t),xn(t)}}}function ya(e,t){return Al(e,t,"gutterClick",!0)}function Nl(e,t){Mt(e.display,t)||nf(e,t)||Be(e,t,"contextmenu")||we||e.display.input.onContextMenu(t)}function nf(e,t){return ft(e,"gutterContextMenu")?Al(e,t,"gutterContextMenu",!1):!1}function Hl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),qr(e)}var Tr={toString:function(){return"CodeMirror.Init"}},Ol={},Gi={};function af(e){var t=e.optionHandlers;function i(r,n,a,o){e.defaults[r]=n,a&&(t[r]=o?function(l,s,u){u!=Tr&&a(l,s,u)}:a)}e.defineOption=i,e.Init=Tr,i("value","",function(r,n){return r.setValue(n)},!0),i("mode",null,function(r,n){r.doc.modeOption=n,sa(r)},!0),i("indentUnit",2,sa,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){Qr(r),qr(r),$e(r)},!0),i("lineSeparator",null,function(r,n){if(r.doc.lineSep=n,!!n){var a=[],o=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var y=s.text.indexOf(n,u);if(y==-1)break;u=y+n.length,a.push(W(o,y))}o++});for(var l=a.length-1;l>=0;l--)wr(r.doc,n,a[l],W(a[l].line,a[l].ch+n.length))}}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,n,a){r.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),a!=Tr&&r.refresh()}),i("specialCharPlaceholder",Hs,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",H?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,n){return r.getInputField().spellcheck=n},!0),i("autocorrect",!1,function(r,n){return r.getInputField().autocorrect=n},!0),i("autocapitalize",!1,function(r,n){return r.getInputField().autocapitalize=n},!0),i("rtlMoveVisually",!B),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){Hl(r),Jr(r)},!0),i("keyMap","default",function(r,n,a){var o=Ui(n),l=a!=Tr&&Ui(a);l&&l.detach&&l.detach(r,o),o.attach&&o.attach(r,l||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,lf,!0),i("gutters",[],function(r,n){r.display.gutterSpecs=oa(n,r.options.lineNumbers),Jr(r)},!0),i("fixedGutter",!0,function(r,n){r.display.gutters.style.left=n?Yn(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return yr(r)},!0),i("scrollbarStyle","native",function(r){Po(r),yr(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,n){r.display.gutterSpecs=oa(r.options.gutters,n),Jr(r)},!0),i("firstLineNumber",1,Jr,!0),i("lineNumberFormatter",function(r){return r},Jr,!0),i("showCursorWhenSelecting",!1,Gr,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,n){n=="nocursor"&&(vr(r),r.display.input.blur()),r.display.input.readOnlyChanged(n)}),i("screenReaderLabel",null,function(r,n){n=n===""?null:n,r.display.input.screenReaderLabelChanged(n)}),i("disableInput",!1,function(r,n){n||r.display.input.reset()},!0),i("dragDrop",!0,of),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,Gr,!0),i("singleCursorHeightPerLine",!0,Gr,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,Qr,!0),i("addModeClass",!1,Qr,!0),i("pollInterval",100),i("undoDepth",200,function(r,n){return r.doc.history.undoDepth=n}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,Qr,!0),i("moveInputWithCursor",!0,function(r,n){n||r.display.input.resetPosition()}),i("tabindex",null,function(r,n){return r.display.input.getField().tabIndex=n||""}),i("autofocus",null),i("direction","ltr",function(r,n){return r.doc.setDirection(n)},!0),i("phrases",null)}function of(e,t,i){var r=i&&i!=Tr;if(!t!=!r){var n=e.display.dragFunctions,a=t?oe:lt;a(e.display.scroller,"dragstart",n.start),a(e.display.scroller,"dragenter",n.enter),a(e.display.scroller,"dragover",n.over),a(e.display.scroller,"dragleave",n.leave),a(e.display.scroller,"drop",n.drop)}}function lf(e){e.options.lineWrapping?(qe(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(fe(e.display.wrapper,"CodeMirror-wrap"),Rn(e)),Zn(e),$e(e),qr(e),setTimeout(function(){return yr(e)},100)}function Ce(e,t){var i=this;if(!(this instanceof Ce))return new Ce(e,t);this.options=t=t?ot(t):{},ot(Ol,t,!1);var r=t.value;typeof r=="string"?r=new et(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var n=new Ce.inputStyles[t.inputStyle](this),a=this.display=new xu(e,r,n,t);a.wrapper.CodeMirror=this,Hl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Po(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 Xe,keySeq:null,specialChars:null},t.autofocus&&!H&&a.input.focus(),g&&k<11&&setTimeout(function(){return i.display.input.reset(!0)},20),sf(this),Ru(),tr(this),this.curOp.forceUpdate=!0,Ko(this,r),t.autofocus&&!H||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&$n(i)},20):vr(this);for(var o in Gi)Gi.hasOwnProperty(o)&&Gi[o](this,t[o],Tr);Wo(this),t.finishInit&&t.finishInit(this);for(var l=0;l<xa.length;++l)xa[l](this);rr(this),E&&t.lineWrapping&&getComputedStyle(a.lineDiv).textRendering=="optimizelegibility"&&(a.lineDiv.style.textRendering="auto")}Ce.defaults=Ol,Ce.optionHandlers=Gi;function sf(e){var t=e.display;oe(t.scroller,"mousedown",We(e,Fl)),g&&k<11?oe(t.scroller,"dblclick",We(e,function(s){if(!Be(e,s)){var u=Qt(e,s);if(!(!u||ya(e,s)||Mt(e.display,s))){Ve(s);var y=e.findWordAt(u);Bi(e.doc,y.anchor,y.head)}}})):oe(t.scroller,"dblclick",function(s){return Be(e,s)||Ve(s)}),oe(t.scroller,"contextmenu",function(s){return Nl(e,s)}),oe(t.input.getField(),"contextmenu",function(s){t.scroller.contains(s.target)||Nl(e,s)});var i,r={end:0};function n(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function a(s){if(s.touches.length!=1)return!1;var u=s.touches[0];return u.radiusX<=1&&u.radiusY<=1}function o(s,u){if(u.left==null)return!0;var y=u.left-s.left,b=u.top-s.top;return y*y+b*b>20*20}oe(t.scroller,"touchstart",function(s){if(!Be(e,s)&&!a(s)&&!ya(e,s)){t.input.ensurePolled(),clearTimeout(i);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)}}),oe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),oe(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!Mt(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var y=e.coordsChar(t.activeTouch,"page"),b;!u.prev||o(u,u.prev)?b=new me(y,y):!u.prev.prev||o(u,u.prev.prev)?b=e.findWordAt(y):b=new me(W(y.line,0),ue(e.doc,W(y.line+1,0))),e.setSelection(b.anchor,b.head),e.focus(),Ve(s)}n()}),oe(t.scroller,"touchcancel",n),oe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Kr(e,t.scroller.scrollTop),$t(e,t.scroller.scrollLeft,!0),Ee(e,"scroll",e))}),oe(t.scroller,"mousewheel",function(s){return Uo(e,s)}),oe(t.scroller,"DOMMouseScroll",function(s){return Uo(e,s)}),oe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){Be(e,s)||Pr(s)},over:function(s){Be(e,s)||(Bu(e,s),Pr(s))},start:function(s){return Pu(e,s)},drop:We(e,Iu),leave:function(s){Be(e,s)||vl(e)}};var l=t.input.getField();oe(l,"keyup",function(s){return Ml.call(e,s)}),oe(l,"keydown",We(e,Tl)),oe(l,"keypress",We(e,Dl)),oe(l,"focus",function(s){return $n(e,s)}),oe(l,"blur",function(s){return vr(e,s)})}var xa=[];Ce.defineInitHook=function(e){return xa.push(e)};function fi(e,t,i,r){var n=e.doc,a;i==null&&(i="add"),i=="smart"&&(n.mode.indent?a=Rr(e,t).state:i="prev");var o=e.options.tabSize,l=ie(n,t),s=Oe(l.text,null,o);l.stateAfter&&(l.stateAfter=null);var u=l.text.match(/^\s*/)[0],y;if(!r&&!/\S/.test(l.text))y=0,i="not";else if(i=="smart"&&(y=n.mode.indent(a,l.text.slice(u.length),l.text),y==Ie||y>150)){if(!r)return;i="prev"}i=="prev"?t>n.first?y=Oe(ie(n,t-1).text,null,o):y=0:i=="add"?y=s+e.options.indentUnit:i=="subtract"?y=s-e.options.indentUnit:typeof i=="number"&&(y=s+i),y=Math.max(0,y);var b="",T=0;if(e.options.indentWithTabs)for(var C=Math.floor(y/o);C;--C)T+=o,b+=" ";if(T<y&&(b+=Ht(y-T)),b!=u)return wr(n,b,W(t,0),W(t,u.length),"+input"),l.stateAfter=null,!0;for(var F=0;F<n.sel.ranges.length;F++){var P=n.sel.ranges[F];if(P.head.line==t&&P.head.ch<u.length){var U=W(t,u.length);ha(n,F,new me(U,U));break}}}var vt=null;function ji(e){vt=e}function ba(e,t,i,r,n){var a=e.doc;e.display.shift=!1,r||(r=a.sel);var o=+new Date-200,l=n=="paste"||e.state.pasteIncoming>o,s=kn(t),u=null;if(l&&r.ranges.length>1)if(vt&&vt.text.join(`
13
- `)==t){if(r.ranges.length%vt.text.length==0){u=[];for(var y=0;y<vt.text.length;y++)u.push(a.splitLines(vt.text[y]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=ht(s,function(X){return[X]}));for(var b=e.curOp.updateInput,T=r.ranges.length-1;T>=0;T--){var C=r.ranges[T],F=C.from(),P=C.to();C.empty()&&(i&&i>0?F=W(F.line,F.ch-i):e.state.overwrite&&!l?P=W(P.line,Math.min(ie(a,P.line).text.length,P.ch+pe(s).length)):l&&vt&&vt.lineWise&&vt.text.join(`
14
- `)==s.join(`
15
- `)&&(F=P=W(F.line,0)));var U={from:F,to:P,text:u?u[T%u.length]:s,origin:n||(l?"paste":e.state.cutIncoming>o?"cut":"+input")};Sr(e.doc,U),Re(e,"inputRead",e,U)}t&&!l&&Pl(e,t),mr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=b),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Il(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&nt(t,function(){return ba(t,i,0,null,"paste")}),!0}function Pl(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var n=i.ranges[r];if(!(n.head.ch>100||r&&i.ranges[r-1].head.line==n.head.line)){var a=e.getModeAt(n.head),o=!1;if(a.electricChars){for(var l=0;l<a.electricChars.length;l++)if(t.indexOf(a.electricChars.charAt(l))>-1){o=fi(e,n.head.line,"smart");break}}else a.electricInput&&a.electricInput.test(ie(e.doc,n.head.line).text.slice(0,n.head.ch))&&(o=fi(e,n.head.line,"smart"));o&&Re(e,"electricInput",e,n.head.line)}}}function Bl(e){for(var t=[],i=[],r=0;r<e.doc.sel.ranges.length;r++){var n=e.doc.sel.ranges[r].head.line,a={anchor:W(n,0),head:W(n+1,0)};i.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:i}}function Sa(e,t,i,r){e.setAttribute("autocorrect",i?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function Rl(){var e=L("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=L("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return E?e.style.width="1000px":e.setAttribute("wrap","off"),D&&(e.style.border="1px solid black"),t}function uf(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){he(this).focus(),this.display.input.focus()},setOption:function(r,n){var a=this.options,o=a[r];a[r]==n&&r!="mode"||(a[r]=n,t.hasOwnProperty(r)&&We(this,t[r])(this,n,o),Ee(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,n){this.state.keyMaps[n?"push":"unshift"](Ui(r))},removeKeyMap:function(r){for(var n=this.state.keyMaps,a=0;a<n.length;++a)if(n[a]==r||n[a].name==r)return n.splice(a,1),!0},addOverlay:Ye(function(r,n){var a=r.token?r:e.getMode(this.options,r);if(a.startState)throw new Error("Overlays may not be stateful.");Ot(this.state.overlays,{mode:a,modeSpec:r,opaque:n&&n.opaque,priority:n&&n.priority||0},function(o){return o.priority}),this.state.modeGen++,$e(this)}),removeOverlay:Ye(function(r){for(var n=this.state.overlays,a=0;a<n.length;++a){var o=n[a].modeSpec;if(o==r||typeof r=="string"&&o.name==r){n.splice(a,1),this.state.modeGen++,$e(this);return}}}),indentLine:Ye(function(r,n,a){typeof n!="string"&&typeof n!="number"&&(n==null?n=this.options.smartIndent?"smart":"prev":n=n?"add":"subtract"),Br(this.doc,r)&&fi(this,r,n,a)}),indentSelection:Ye(function(r){for(var n=this.doc.sel.ranges,a=-1,o=0;o<n.length;o++){var l=n[o];if(l.empty())l.head.line>a&&(fi(this,l.head.line,r,!0),a=l.head.line,o==this.doc.sel.primIndex&&mr(this));else{var s=l.from(),u=l.to(),y=Math.max(a,s.line);a=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var b=y;b<a;++b)fi(this,b,r);var T=this.doc.sel.ranges;s.ch==0&&n.length==T.length&&T[o].from().ch>0&&ha(this.doc,o,new me(s,T[o].to()),Qe)}}}),getTokenAt:function(r,n){return Xa(this,r,n)},getLineTokens:function(r,n){return Xa(this,W(r),n,!0)},getTokenTypeAt:function(r){r=ue(this.doc,r);var n=Ga(this,ie(this.doc,r.line)),a=0,o=(n.length-1)/2,l=r.ch,s;if(l==0)s=n[2];else for(;;){var u=a+o>>1;if((u?n[u*2-1]:0)>=l)o=u;else if(n[u*2+1]<l)a=u+1;else{s=n[u*2+2];break}}var y=s?s.indexOf("overlay "):-1;return y<0?s:y==0?null:s.slice(0,y-1)},getModeAt:function(r){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(r).state).mode:n},getHelper:function(r,n){return this.getHelpers(r,n)[0]},getHelpers:function(r,n){var a=[];if(!i.hasOwnProperty(n))return a;var o=i[n],l=this.getModeAt(r);if(typeof l[n]=="string")o[l[n]]&&a.push(o[l[n]]);else if(l[n])for(var s=0;s<l[n].length;s++){var u=o[l[n][s]];u&&a.push(u)}else l.helperType&&o[l.helperType]?a.push(o[l.helperType]):o[l.name]&&a.push(o[l.name]);for(var y=0;y<o._global.length;y++){var b=o._global[y];b.pred(l,this)&&ke(a,b.val)==-1&&a.push(b.val)}return a},getStateAfter:function(r,n){var a=this.doc;return r=_a(a,r??a.first+a.size-1),Rr(this,r+1,n).state},cursorCoords:function(r,n){var a,o=this.doc.sel.primary();return r==null?a=o.head:typeof r=="object"?a=ue(this.doc,r):a=r?o.from():o.to(),pt(this,a,n||"page")},charCoords:function(r,n){return Mi(this,ue(this.doc,r),n||"page")},coordsChar:function(r,n){return r=ko(this,r,n||"page"),jn(this,r.left,r.top)},lineAtHeight:function(r,n){return r=ko(this,{top:r,left:0},n||"page").top,Yt(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,n,a){var o=!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,o=!0),l=ie(this.doc,r)}else l=r;return Ti(this,l,{top:0,left:0},n||"page",a||o).top+(o?this.doc.height-Tt(l):0)},defaultTextHeight:function(){return pr(this.display)},defaultCharWidth:function(){return gr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,n,a,o,l){var s=this.display;r=pt(this,ue(this.doc,r));var u=r.bottom,y=r.left;if(n.style.position="absolute",n.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(n),s.sizer.appendChild(n),o=="over")u=r.top;else if(o=="above"||o=="near"){var b=Math.max(s.wrapper.clientHeight,this.doc.height),T=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(o=="above"||r.bottom+n.offsetHeight>b)&&r.top>n.offsetHeight?u=r.top-n.offsetHeight:r.bottom+n.offsetHeight<=b&&(u=r.bottom),y+n.offsetWidth>T&&(y=T-n.offsetWidth)}n.style.top=u+"px",n.style.left=n.style.right="",l=="right"?(y=s.sizer.clientWidth-n.offsetWidth,n.style.right="0px"):(l=="left"?y=0:l=="middle"&&(y=(s.sizer.clientWidth-n.offsetWidth)/2),n.style.left=y+"px"),a&&au(this,{left:y,top:u,right:y+n.offsetWidth,bottom:u+n.offsetHeight})},triggerOnKeyDown:Ye(Tl),triggerOnKeyPress:Ye(Dl),triggerOnKeyUp:Ml,triggerOnMouseDown:Ye(Fl),execCommand:function(r){if(oi.hasOwnProperty(r))return oi[r].call(null,this)},triggerElectric:Ye(function(r){Pl(this,r)}),findPosH:function(r,n,a,o){var l=1;n<0&&(l=-1,n=-n);for(var s=ue(this.doc,r),u=0;u<n&&(s=wa(this.doc,s,l,a,o),!s.hitSide);++u);return s},moveH:Ye(function(r,n){var a=this;this.extendSelectionsBy(function(o){return a.display.shift||a.doc.extend||o.empty()?wa(a.doc,o.head,r,n,a.options.rtlMoveVisually):r<0?o.from():o.to()},mt)}),deleteH:Ye(function(r,n){var a=this.doc.sel,o=this.doc;a.somethingSelected()?o.replaceSelection("",null,"+delete"):Lr(this,function(l){var s=wa(o,l.head,r,n,!1);return r<0?{from:s,to:l.head}:{from:l.head,to:s}})}),findPosV:function(r,n,a,o){var l=1,s=o;n<0&&(l=-1,n=-n);for(var u=ue(this.doc,r),y=0;y<n;++y){var b=pt(this,u,"div");if(s==null?s=b.left:b.left=s,u=Wl(this,b,l,a),u.hitSide)break}return u},moveV:Ye(function(r,n){var a=this,o=this.doc,l=[],s=!this.display.shift&&!o.extend&&o.sel.somethingSelected();if(o.extendSelectionsBy(function(y){if(s)return r<0?y.from():y.to();var b=pt(a,y.head,"div");y.goalColumn!=null&&(b.left=y.goalColumn),l.push(b.left);var T=Wl(a,b,r,n);return n=="page"&&y==o.sel.primary()&&ta(a,Mi(a,T,"div").top-b.top),T},mt),l.length)for(var u=0;u<o.sel.ranges.length;u++)o.sel.ranges[u].goalColumn=l[u]}),findWordAt:function(r){var n=this.doc,a=ie(n,r.line).text,o=r.ch,l=r.ch;if(a){var s=this.getHelper(r,"wordChars");(r.sticky=="before"||l==a.length)&&o?--o:++l;for(var u=a.charAt(o),y=pi(u,s)?function(b){return pi(b,s)}:/\s/.test(u)?function(b){return/\s/.test(b)}:function(b){return!/\s/.test(b)&&!pi(b)};o>0&&y(a.charAt(o-1));)--o;for(;l<a.length&&y(a.charAt(l));)++l}return new me(W(r.line,o),W(r.line,l))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?qe(this.display.cursorDiv,"CodeMirror-overwrite"):fe(this.display.cursorDiv,"CodeMirror-overwrite"),Ee(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==ge(te(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ye(function(r,n){jr(this,r,n)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-St(this)-this.display.barHeight,width:r.scrollWidth-St(this)-this.display.barWidth,clientHeight:_n(this),clientWidth:Zt(this)}},scrollIntoView:Ye(function(r,n){r==null?(r={from:this.doc.sel.primary().head,to:null},n==null&&(n=this.options.cursorScrollMargin)):typeof r=="number"?r={from:W(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=n||0,r.from.line!=null?ou(this,r):No(this,r.from,r.to,r.margin)}),setSize:Ye(function(r,n){var a=this,o=function(s){return typeof s=="number"||/^\d+$/.test(String(s))?s+"px":s};r!=null&&(this.display.wrapper.style.width=o(r)),n!=null&&(this.display.wrapper.style.height=o(n)),this.options.lineWrapping&&bo(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){Pt(a,l,"widget");break}}++l}),this.curOp.forceUpdate=!0,Ee(this,"refresh",this)}),operation:function(r){return nt(this,r)},startOperation:function(){return tr(this)},endOperation:function(){return rr(this)},refresh:Ye(function(){var r=this.display.cachedTextHeight;$e(this),this.curOp.forceUpdate=!0,qr(this),jr(this,this.doc.scrollLeft,this.doc.scrollTop),na(this.display),(r==null||Math.abs(r-pr(this.display))>.5||this.options.lineWrapping)&&Zn(this),Ee(this,"refresh",this)}),swapDoc:Ye(function(r){var n=this.doc;return n.cm=null,this.state.selectingText&&this.state.selectingText(),Ko(this,r),qr(this),this.display.input.reset(),jr(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Re(this,"swapDoc",this,n),n}),phrase:function(r){var n=this.options.phrases;return n&&Object.prototype.hasOwnProperty.call(n,r)?n[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}},sr(e),e.registerHelper=function(r,n,a){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][n]=a},e.registerGlobalHelper=function(r,n,a,o){e.registerHelper(r,n,o),i[r]._global.push({pred:a,val:o})}}function wa(e,t,i,r,n){var a=t,o=i,l=ie(e,t.line),s=n&&e.direction=="rtl"?-i:i;function u(){var J=t.line+s;return J<e.first||J>=e.first+e.size?!1:(t=new W(J,t.ch,t.sticky),l=ie(e,J))}function y(J){var Y;if(r=="codepoint"){var $=l.text.charCodeAt(t.ch+(i>0?0:-1));if(isNaN($))Y=null;else{var ae=i>0?$>=55296&&$<56320:$>=56320&&$<57343;Y=new W(t.line,Math.max(0,Math.min(l.text.length,t.ch+i*(ae?2:1))),-i)}}else n?Y=qu(e.cm,l,t,i):Y=pa(l,t,i);if(Y==null)if(!J&&u())t=ga(n,e.cm,l,t.line,s);else return!1;else t=Y;return!0}if(r=="char"||r=="codepoint")y();else if(r=="column")y(!0);else if(r=="word"||r=="group")for(var b=null,T=r=="group",C=e.cm&&e.cm.getHelper(t,"wordChars"),F=!0;!(i<0&&!y(!F));F=!1){var P=l.text.charAt(t.ch)||`
16
- `,U=pi(P,C)?"w":T&&P==`
17
- `?"n":!T||/\s/.test(P)?null:"p";if(T&&!F&&!U&&(U="s"),b&&b!=U){i<0&&(i=1,y(),t.sticky="after");break}if(U&&(b=U),i>0&&!y(!F))break}var X=Wi(e,t,a,o,!0);return En(a,X)&&(X.hitSide=!0),X}function Wl(e,t,i,r){var n=e.doc,a=t.left,o;if(r=="page"){var l=Math.min(e.display.wrapper.clientHeight,he(e).innerHeight||n(e).documentElement.clientHeight),s=Math.max(l-.5*pr(e.display),3);o=(i>0?t.bottom:t.top)+i*s}else r=="line"&&(o=i>0?t.bottom+3:t.top-3);for(var u;u=jn(e,a,o),!!u.outside;){if(i<0?o<=0:o>=n.height){u.hitSide=!0;break}o+=i*5}return u}var xe=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Xe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};xe.prototype.init=function(e){var t=this,i=this,r=i.cm,n=i.div=e.lineDiv;n.contentEditable=!0,Sa(n,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function a(l){for(var s=l.target;s;s=s.parentNode){if(s==n)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}oe(n,"paste",function(l){!a(l)||Be(r,l)||Il(l,r)||k<=11&&setTimeout(We(r,function(){return t.updateFromDOM()}),20)}),oe(n,"compositionstart",function(l){t.composing={data:l.data,done:!1}}),oe(n,"compositionupdate",function(l){t.composing||(t.composing={data:l.data,done:!1})}),oe(n,"compositionend",function(l){t.composing&&(l.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),oe(n,"touchstart",function(){return i.forceCompositionEnd()}),oe(n,"input",function(){t.composing||t.readFromDOMSoon()});function o(l){if(!(!a(l)||Be(r,l))){if(r.somethingSelected())ji({lineWise:!1,text:r.getSelections()}),l.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=Bl(r);ji({lineWise:!0,text:s.text}),l.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,Qe),r.replaceSelection("",null,"cut")})}else return;if(l.clipboardData){l.clipboardData.clearData();var u=vt.text.join(`
18
- `);if(l.clipboardData.setData("Text",u),l.clipboardData.getData("Text")==u){l.preventDefault();return}}var y=Rl(),b=y.firstChild;Sa(b),r.display.lineSpace.insertBefore(y,r.display.lineSpace.firstChild),b.value=vt.text.join(`
19
- `);var T=ge(ve(n));w(b),setTimeout(function(){r.display.lineSpace.removeChild(y),T.focus(),T==n&&i.showPrimarySelection()},50)}}oe(n,"copy",o),oe(n,"cut",o)},xe.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},xe.prototype.prepareSelection=function(){var e=Fo(this.cm,!1);return e.focus=ge(ve(this.div))==this.div,e},xe.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},xe.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},xe.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),n=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||n.line<t.display.viewFrom){e.removeAllRanges();return}var a=Ki(t,e.anchorNode,e.anchorOffset),o=Ki(t,e.focusNode,e.focusOffset);if(!(a&&!a.bad&&o&&!o.bad&&se(mi(a,o),r)==0&&se(vi(a,o),n)==0)){var l=t.display.view,s=r.line>=t.display.viewFrom&&zl(t,r)||{node:l[0].measure.map[2],offset:0},u=n.line<t.display.viewTo&&zl(t,n);if(!u){var y=l[l.length-1].measure,b=y.maps?y.maps[y.maps.length-1]:y.map;u={node:b[b.length-1],offset:b[b.length-2]-b[b.length-3]}}if(!s||!u){e.removeAllRanges();return}var T=e.rangeCount&&e.getRangeAt(0),C;try{C=R(s.node,s.offset,u.offset,u.node)}catch{}C&&(!p&&t.state.focused?(e.collapse(s.node,s.offset),C.collapsed||(e.removeAllRanges(),e.addRange(C))):(e.removeAllRanges(),e.addRange(C)),T&&e.anchorNode==null?e.addRange(T):p&&this.startGracePeriod()),this.rememberSelection()}},xe.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)},xe.prototype.showMultipleSelections=function(e){le(this.cm.display.cursorDiv,e.cursors),le(this.cm.display.selectionDiv,e.selection)},xe.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},xe.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return ee(this.div,t)},xe.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||ge(ve(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},xe.prototype.blur=function(){this.div.blur()},xe.prototype.getField=function(){return this.div},xe.prototype.supportsTouch=function(){return!0},xe.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):nt(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function i(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,i))}this.polling.set(this.cm.options.pollInterval,i)},xe.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},xe.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(A&&M&&this.cm.display.gutterSpecs.length&&ff(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var i=Ki(t,e.anchorNode,e.anchorOffset),r=Ki(t,e.focusNode,e.focusOffset);i&&r&&nt(t,function(){je(t.doc,Rt(i,r),Qe),(i.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},xe.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),r=i.from(),n=i.to();if(r.ch==0&&r.line>e.firstLine()&&(r=W(r.line-1,ie(e.doc,r.line-1).length)),n.ch==ie(e.doc,n.line).text.length&&n.line<e.lastLine()&&(n=W(n.line+1,0)),r.line<t.viewFrom||n.line>t.viewTo-1)return!1;var a,o,l;r.line==t.viewFrom||(a=Vt(e,r.line))==0?(o=ye(t.view[0].line),l=t.view[0].node):(o=ye(t.view[a].line),l=t.view[a-1].node.nextSibling);var s=Vt(e,n.line),u,y;if(s==t.view.length-1?(u=t.viewTo-1,y=t.lineDiv.lastChild):(u=ye(t.view[s+1].line)-1,y=t.view[s+1].node.previousSibling),!l)return!1;for(var b=e.doc.splitLines(cf(e,l,y,o,u)),T=Xt(e.doc,W(o,0),W(u,ie(e.doc,u).text.length));b.length>1&&T.length>1;)if(pe(b)==pe(T))b.pop(),T.pop(),u--;else if(b[0]==T[0])b.shift(),T.shift(),o++;else break;for(var C=0,F=0,P=b[0],U=T[0],X=Math.min(P.length,U.length);C<X&&P.charCodeAt(C)==U.charCodeAt(C);)++C;for(var J=pe(b),Y=pe(T),$=Math.min(J.length-(b.length==1?C:0),Y.length-(T.length==1?C:0));F<$&&J.charCodeAt(J.length-F-1)==Y.charCodeAt(Y.length-F-1);)++F;if(b.length==1&&T.length==1&&o==r.line)for(;C&&C>r.ch&&J.charCodeAt(J.length-F-1)==Y.charCodeAt(Y.length-F-1);)C--,F++;b[b.length-1]=J.slice(0,J.length-F).replace(/^\u200b+/,""),b[0]=b[0].slice(C).replace(/\u200b+$/,"");var ae=W(o,C),ne=W(u,T.length?pe(T).length-F:0);if(b.length>1||b[0]||se(ae,ne))return wr(e.doc,b,ae,ne,"+input"),!0},xe.prototype.ensurePolled=function(){this.forceCompositionEnd()},xe.prototype.reset=function(){this.forceCompositionEnd()},xe.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},xe.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))},xe.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&nt(this.cm,function(){return $e(e.cm)})},xe.prototype.setUneditable=function(e){e.contentEditable="false"},xe.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||We(this.cm,ba)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},xe.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},xe.prototype.onContextMenu=function(){},xe.prototype.resetPosition=function(){},xe.prototype.needsContentAttribute=!0;function zl(e,t){var i=Un(e,t.line);if(!i||i.hidden)return null;var r=ie(e.doc,t.line),n=go(i,r,t.line),a=Ct(r,e.doc.direction),o="left";if(a){var l=Ir(a,t.ch);o=l%2?"right":"left"}var s=yo(n.map,t.ch,o);return s.offset=s.collapse=="right"?s.end:s.start,s}function ff(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Mr(e,t){return t&&(e.bad=!0),e}function cf(e,t,i,r,n){var a="",o=!1,l=e.doc.lineSeparator(),s=!1;function u(C){return function(F){return F.id==C}}function y(){o&&(a+=l,s&&(a+=l),o=s=!1)}function b(C){C&&(y(),a+=C)}function T(C){if(C.nodeType==1){var F=C.getAttribute("cm-text");if(F){b(F);return}var P=C.getAttribute("cm-marker"),U;if(P){var X=e.findMarks(W(r,0),W(n+1,0),u(+P));X.length&&(U=X[0].find(0))&&b(Xt(e.doc,U.from,U.to).join(l));return}if(C.getAttribute("contenteditable")=="false")return;var J=/^(pre|div|p|li|table|br)$/i.test(C.nodeName);if(!/^br$/i.test(C.nodeName)&&C.textContent.length==0)return;J&&y();for(var Y=0;Y<C.childNodes.length;Y++)T(C.childNodes[Y]);/^(pre|p)$/i.test(C.nodeName)&&(s=!0),J&&(o=!0)}else C.nodeType==3&&b(C.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;T(t),t!=i;)t=t.nextSibling,s=!1;return a}function Ki(e,t,i){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[i],!r)return Mr(e.clipPos(W(e.display.viewTo-1)),!0);t=null,i=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 n=0;n<e.display.view.length;n++){var a=e.display.view[n];if(a.node==r)return hf(a,t,i)}}function hf(e,t,i){var r=e.text.firstChild,n=!1;if(!t||!ee(r,t))return Mr(W(ye(e.line),0),!0);if(t==r&&(n=!0,t=r.childNodes[i],i=0,!t)){var a=e.rest?pe(e.rest):e.line;return Mr(W(ye(a),a.text.length),n)}var o=t.nodeType==3?t:null,l=t;for(!o&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(o=t.firstChild,i&&(i=o.nodeValue.length));l.parentNode!=r;)l=l.parentNode;var s=e.measure,u=s.maps;function y(U,X,J){for(var Y=-1;Y<(u?u.length:0);Y++)for(var $=Y<0?s.map:u[Y],ae=0;ae<$.length;ae+=3){var ne=$[ae+2];if(ne==U||ne==X){var de=ye(Y<0?e.line:e.rest[Y]),be=$[ae]+J;return(J<0||ne!=U)&&(be=$[ae+(J?1:0)]),W(de,be)}}}var b=y(o,l,i);if(b)return Mr(b,n);for(var T=l.nextSibling,C=o?o.nodeValue.length-i:0;T;T=T.nextSibling){if(b=y(T,T.firstChild,0),b)return Mr(W(b.line,b.ch-C),n);C+=T.textContent.length}for(var F=l.previousSibling,P=i;F;F=F.previousSibling){if(b=y(F,F.firstChild,-1),b)return Mr(W(b.line,b.ch+P),n);P+=F.textContent.length}}var Fe=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Xe,this.hasSelection=!1,this.composing=null,this.resetting=!1};Fe.prototype.init=function(e){var t=this,i=this,r=this.cm;this.createField(e);var n=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),D&&(n.style.width="0px"),oe(n,"input",function(){g&&k>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),oe(n,"paste",function(o){Be(r,o)||Il(o,r)||(r.state.pasteIncoming=+new Date,i.fastPoll())});function a(o){if(!Be(r,o)){if(r.somethingSelected())ji({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var l=Bl(r);ji({lineWise:!0,text:l.text}),o.type=="cut"?r.setSelections(l.ranges,null,Qe):(i.prevInput="",n.value=l.text.join(`
20
- `),w(n))}else return;o.type=="cut"&&(r.state.cutIncoming=+new Date)}}oe(n,"cut",a),oe(n,"copy",a),oe(e.scroller,"paste",function(o){if(!(Mt(e,o)||Be(r,o))){if(!n.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var l=new Event("paste");l.clipboardData=o.clipboardData,n.dispatchEvent(l)}}),oe(e.lineSpace,"selectstart",function(o){Mt(e,o)||Ve(o)}),oe(n,"compositionstart",function(){var o=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:o,range:r.markText(o,r.getCursor("to"),{className:"CodeMirror-composing"})}}),oe(n,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},Fe.prototype.createField=function(e){this.wrapper=Rl(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Sa(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},Fe.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Fe.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=Fo(e);if(e.options.moveInputWithCursor){var n=pt(e,i.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+o.top-a.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+o.left-a.left))}return r},Fe.prototype.showSelection=function(e){var t=this.cm,i=t.display;le(i.cursorDiv,e.cursors),le(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Fe.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&w(this.textarea),g&&k>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",g&&k>=9&&(this.hasSelection=null));this.resetting=!1}},Fe.prototype.getField=function(){return this.textarea},Fe.prototype.supportsTouch=function(){return!1},Fe.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!H||ge(ve(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},Fe.prototype.blur=function(){this.textarea.blur()},Fe.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Fe.prototype.receivedFocus=function(){this.slowPoll()},Fe.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Fe.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},Fe.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||fs(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var n=i.value;if(n==r&&!t.somethingSelected())return!1;if(g&&k>=9&&this.hasSelection===n||z&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=n.charCodeAt(0);if(a==8203&&!r&&(r="​"),a==8666)return this.reset(),this.cm.execCommand("undo")}for(var o=0,l=Math.min(r.length,n.length);o<l&&r.charCodeAt(o)==n.charCodeAt(o);)++o;return nt(t,function(){ba(t,n.slice(o),r.length-o,null,e.composing?"*compose":null),n.length>1e3||n.indexOf(`
21
- `)>-1?i.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Fe.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Fe.prototype.onKeyPress=function(){g&&k>=9&&(this.hasSelection=null),this.fastPoll()},Fe.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=Qt(i,e),o=r.scroller.scrollTop;if(!a||I)return;var l=i.options.resetSelectionOnContextMenu;l&&i.doc.sel.contains(a)==-1&&We(i,je)(i.doc,Rt(a),Qe);var s=n.style.cssText,u=t.wrapper.style.cssText,y=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",n.style.cssText=`position: absolute; width: 30px; height: 30px;
22
- top: `+(e.clientY-y.top-5)+"px; left: "+(e.clientX-y.left-5)+`px;
23
- z-index: 1000; background: `+(g?"rgba(255, 255, 255, .05)":"transparent")+`;
24
- outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var b;E&&(b=n.ownerDocument.defaultView.scrollY),r.input.focus(),E&&n.ownerDocument.defaultView.scrollTo(null,b),r.input.reset(),i.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=C,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function T(){if(n.selectionStart!=null){var P=i.somethingSelected(),U="​"+(P?n.value:"");n.value="⇚",n.value=U,t.prevInput=P?"":"​",n.selectionStart=1,n.selectionEnd=U.length,r.selForContextMenu=i.doc.sel}}function C(){if(t.contextMenuPending==C&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,n.style.cssText=s,g&&k<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=o),n.selectionStart!=null)){(!g||g&&k<9)&&T();var P=0,U=function(){r.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="​"?We(i,al)(i):P++<10?r.detectingSelectAll=setTimeout(U,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(U,200)}}if(g&&k>=9&&T(),we){Pr(e);var F=function(){lt(window,"mouseup",F),setTimeout(C,20)};oe(window,"mouseup",F)}else setTimeout(C,50)},Fe.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Fe.prototype.setUneditable=function(){},Fe.prototype.needsContentAttribute=!1;function df(e,t){if(t=t?ot(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=ge(ve(e));t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=l.getValue()}var n;if(e.form&&(oe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var a=e.form;n=a.submit;try{var o=a.submit=function(){r(),a.submit=n,a.submit(),a.submit=o}}catch{}}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&&(lt(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=n))}},e.style.display="none";var l=Ce(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return l}function pf(e){e.off=lt,e.on=oe,e.wheelEventPixels=bu,e.Doc=et,e.splitLines=kn,e.countColumn=Oe,e.findColumn=yt,e.isWordChar=vn,e.Pass=Ie,e.signal=Ee,e.Line=cr,e.changeEnd=Wt,e.scrollbarModel=Io,e.Pos=W,e.cmpPos=se,e.modes=Ln,e.mimeModes=ur,e.resolveMode=gi,e.getMode=Tn,e.modeExtensions=fr,e.extendMode=gs,e.copyState=Kt,e.startState=za,e.innerMode=Mn,e.commands=oi,e.keyMap=Ft,e.keyName=Sl,e.isModifierKey=xl,e.lookupKey=Cr,e.normalizeKeyMap=Uu,e.StringStream=Ae,e.SharedTextMarker=ii,e.TextMarker=_t,e.LineWidget=ri,e.e_preventDefault=Ve,e.e_stopPropagation=Ra,e.e_stop=Pr,e.addClass=qe,e.contains=ee,e.rmClass=fe,e.keyNames=Ut}af(Ce),uf(Ce);var gf="iter insert remove copy getEditor constructor".split(" ");for(var Xi in et.prototype)et.prototype.hasOwnProperty(Xi)&&ke(gf,Xi)<0&&(Ce.prototype[Xi]=function(e){return function(){return e.apply(this.doc,arguments)}}(et.prototype[Xi]));return sr(et),Ce.inputStyles={textarea:Fe,contenteditable:xe},Ce.defineMode=function(e){!Ce.defaults.mode&&e!="null"&&(Ce.defaults.mode=e),ds.apply(this,arguments)},Ce.defineMIME=ps,Ce.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ce.defineMIME("text/plain","null"),Ce.defineExtension=function(e,t){Ce.prototype[e]=t},Ce.defineDocExtension=function(e,t){et.prototype[e]=t},Ce.fromTextArea=df,pf(Ce),Ce.version="5.65.17",Ce})})(Xl);var ut=Xl.exports;(function(f,x){(function(c){c(ut)})(function(c){var m=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,p=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,S=/[*+-]\s/;c.commands.newlineAndIndentContinueMarkdownList=function(v){if(v.getOption("disableInput"))return c.Pass;for(var g=v.listSelections(),k=[],E=0;E<g.length;E++){var N=g[E].head,M=v.getStateAfter(N.line),O=c.innerMode(v.getMode(),M);if(O.mode.name!=="markdown"&&O.mode.helperType!=="markdown"){v.execCommand("newlineAndIndent");return}else M=O.state;var I=M.list!==!1,Z=M.quote!==0,_=v.getLine(N.line),j=m.exec(_),D=/^\s*$/.test(_.slice(0,N.ch));if(!g[E].empty()||!I&&!Z||!j||D){v.execCommand("newlineAndIndent");return}if(p.test(_)){var A=Z&&/>\s*$/.test(_),H=!/>\s*$/.test(_);(A||H)&&v.replaceRange("",{line:N.line,ch:0},{line:N.line,ch:N.ch+1}),k[E]=`
25
- `}else{var z=j[1],G=j[5],B=!(S.test(j[2])||j[2].indexOf(">")>=0),Q=B?parseInt(j[3],10)+1+j[4]:j[2].replace("x"," ");k[E]=`
26
- `+z+Q+G,B&&d(v,N)}}v.replaceSelections(k)};function d(v,g){var k=g.line,E=0,N=0,M=m.exec(v.getLine(k)),O=M[1];do{E+=1;var I=k+E,Z=v.getLine(I),_=m.exec(Z);if(_){var j=_[1],D=parseInt(M[3],10)+E-N,A=parseInt(_[3],10),H=A;if(O===j&&!isNaN(A))D===A&&(H=A+1),D>A&&(H=D+1),v.replaceRange(Z.replace(m,j+H+_[4]+_[5]),{line:I,ch:0},{line:I,ch:Z.length});else{if(O.length>j.length||O.length<j.length&&E===1)return;N+=1}}}while(_)}})})();var Yl=ut;Yl.commands.tabAndIndentMarkdownList=function(f){var x=f.listSelections(),c=x[0].head,m=f.getStateAfter(c.line),p=m.list!==!1;if(p){f.execCommand("indentMore");return}if(f.options.indentWithTabs)f.execCommand("insertTab");else{var S=Array(f.options.tabSize+1).join(" ");f.replaceSelection(S)}};Yl.commands.shiftTabAndUnindentMarkdownList=function(f){var x=f.listSelections(),c=x[0].head,m=f.getStateAfter(c.line),p=m.list!==!1;if(p){f.execCommand("indentLess");return}if(f.options.indentWithTabs)f.execCommand("insertTab");else{var S=Array(f.options.tabSize+1).join(" ");f.replaceSelection(S)}};(function(f,x){(function(c){c(ut)})(function(c){c.defineOption("fullScreen",!1,function(S,d,v){v==c.Init&&(v=!1),!v!=!d&&(d?m(S):p(S))});function m(S){var d=S.getWrapperElement();S.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:d.style.width,height:d.style.height},d.style.width="",d.style.height="auto",d.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",S.refresh()}function p(S){var d=S.getWrapperElement();d.className=d.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var v=S.state.fullScreenRestore;d.style.width=v.width,d.style.height=v.height,window.scrollTo(v.scrollLeft,v.scrollTop),S.refresh()}})})();var xf={exports:{}},bf={exports:{}};(function(f,x){(function(c){c(ut)})(function(c){var m={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},p={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};c.defineMode("xml",function(S,d){var v=S.indentUnit,g={},k=d.htmlMode?m:p;for(var E in k)g[E]=k[E];for(var E in d)g[E]=d[E];var N,M;function O(L,q){function R(qe){return q.tokenize=qe,qe(L,q)}var ee=L.next();if(ee=="<")return L.eat("!")?L.eat("[")?L.match("CDATA[")?R(_("atom","]]>")):null:L.match("--")?R(_("comment","-->")):L.match("DOCTYPE",!0,!0)?(L.eatWhile(/[\w\._\-]/),R(j(1))):null:L.eat("?")?(L.eatWhile(/[\w\._\-]/),q.tokenize=_("meta","?>"),"meta"):(N=L.eat("/")?"closeTag":"openTag",q.tokenize=I,"tag bracket");if(ee=="&"){var ge;return L.eat("#")?L.eat("x")?ge=L.eatWhile(/[a-fA-F\d]/)&&L.eat(";"):ge=L.eatWhile(/[\d]/)&&L.eat(";"):ge=L.eatWhile(/[\w\.\-:]/)&&L.eat(";"),ge?"atom":"error"}else return L.eatWhile(/[^&<]/),null}O.isInText=!0;function I(L,q){var R=L.next();if(R==">"||R=="/"&&L.eat(">"))return q.tokenize=O,N=R==">"?"endTag":"selfcloseTag","tag bracket";if(R=="=")return N="equals",null;if(R=="<"){q.tokenize=O,q.state=G,q.tagName=q.tagStart=null;var ee=q.tokenize(L,q);return ee?ee+" tag error":"tag error"}else return/[\'\"]/.test(R)?(q.tokenize=Z(R),q.stringStartCol=L.column(),q.tokenize(L,q)):(L.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Z(L){var q=function(R,ee){for(;!R.eol();)if(R.next()==L){ee.tokenize=I;break}return"string"};return q.isInAttribute=!0,q}function _(L,q){return function(R,ee){for(;!R.eol();){if(R.match(q)){ee.tokenize=O;break}R.next()}return L}}function j(L){return function(q,R){for(var ee;(ee=q.next())!=null;){if(ee=="<")return R.tokenize=j(L+1),R.tokenize(q,R);if(ee==">")if(L==1){R.tokenize=O;break}else return R.tokenize=j(L-1),R.tokenize(q,R)}return"meta"}}function D(L){return L&&L.toLowerCase()}function A(L,q,R){this.prev=L.context,this.tagName=q||"",this.indent=L.indented,this.startOfLine=R,(g.doNotIndent.hasOwnProperty(q)||L.context&&L.context.noIndent)&&(this.noIndent=!0)}function H(L){L.context&&(L.context=L.context.prev)}function z(L,q){for(var R;;){if(!L.context||(R=L.context.tagName,!g.contextGrabbers.hasOwnProperty(D(R))||!g.contextGrabbers[D(R)].hasOwnProperty(D(q))))return;H(L)}}function G(L,q,R){return L=="openTag"?(R.tagStart=q.column(),B):L=="closeTag"?Q:G}function B(L,q,R){return L=="word"?(R.tagName=q.current(),M="tag",K):g.allowMissingTagName&&L=="endTag"?(M="tag bracket",K(L,q,R)):(M="error",B)}function Q(L,q,R){if(L=="word"){var ee=q.current();return R.context&&R.context.tagName!=ee&&g.implicitlyClosed.hasOwnProperty(D(R.context.tagName))&&H(R),R.context&&R.context.tagName==ee||g.matchClosing===!1?(M="tag",re):(M="tag error",we)}else return g.allowMissingTagName&&L=="endTag"?(M="tag bracket",re(L,q,R)):(M="error",we)}function re(L,q,R){return L!="endTag"?(M="error",re):(H(R),G)}function we(L,q,R){return M="error",re(L,q,R)}function K(L,q,R){if(L=="word")return M="attribute",fe;if(L=="endTag"||L=="selfcloseTag"){var ee=R.tagName,ge=R.tagStart;return R.tagName=R.tagStart=null,L=="selfcloseTag"||g.autoSelfClosers.hasOwnProperty(D(ee))?z(R,ee):(z(R,ee),R.context=new A(R,ee,ge==R.indented)),G}return M="error",K}function fe(L,q,R){return L=="equals"?ce:(g.allowMissing||(M="error"),K(L,q,R))}function ce(L,q,R){return L=="string"?le:L=="word"&&g.allowUnquoted?(M="string",K):(M="error",K(L,q,R))}function le(L,q,R){return L=="string"?le:K(L,q,R)}return{startState:function(L){var q={tokenize:O,state:G,indented:L||0,tagName:null,tagStart:null,context:null};return L!=null&&(q.baseIndent=L),q},token:function(L,q){if(!q.tagName&&L.sol()&&(q.indented=L.indentation()),L.eatSpace())return null;N=null;var R=q.tokenize(L,q);return(R||N)&&R!="comment"&&(M=null,q.state=q.state(N||R,L,q),M&&(R=M=="error"?R+" error":M)),R},indent:function(L,q,R){var ee=L.context;if(L.tokenize.isInAttribute)return L.tagStart==L.indented?L.stringStartCol+1:L.indented+v;if(ee&&ee.noIndent)return c.Pass;if(L.tokenize!=I&&L.tokenize!=O)return R?R.match(/^(\s*)/)[0].length:0;if(L.tagName)return g.multilineTagIndentPastTag!==!1?L.tagStart+L.tagName.length+2:L.tagStart+v*(g.multilineTagIndentFactor||1);if(g.alignCDATA&&/<!\[CDATA\[/.test(q))return 0;var ge=q&&/^<(\/)?([\w_:\.-]*)/.exec(q);if(ge&&ge[1])for(;ee;)if(ee.tagName==ge[2]){ee=ee.prev;break}else if(g.implicitlyClosed.hasOwnProperty(D(ee.tagName)))ee=ee.prev;else break;else if(ge)for(;ee;){var qe=g.contextGrabbers[D(ee.tagName)];if(qe&&qe.hasOwnProperty(D(ge[2])))ee=ee.prev;else break}for(;ee&&ee.prev&&!ee.startOfLine;)ee=ee.prev;return ee?ee.indent+v:L.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:g.htmlMode?"html":"xml",helperType:g.htmlMode?"html":"xml",skipAttribute:function(L){L.state==ce&&(L.state=K)},xmlCurrentTag:function(L){return L.tagName?{name:L.tagName,close:L.type=="closeTag"}:null},xmlCurrentContext:function(L){for(var q=[],R=L.context;R;R=R.prev)q.push(R.tagName);return q.reverse()}}}),c.defineMIME("text/xml","xml"),c.defineMIME("application/xml","xml"),c.mimeModes.hasOwnProperty("text/html")||c.defineMIME("text/html",{name:"xml",htmlMode:!0})})})();var Sf=bf.exports,_l={exports:{}},Ul;function wf(){return Ul||(Ul=1,function(f,x){(function(c){c(ut)})(function(c){c.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var m=0;m<c.modeInfo.length;m++){var p=c.modeInfo[m];p.mimes&&(p.mime=p.mimes[0])}c.findModeByMIME=function(S){S=S.toLowerCase();for(var d=0;d<c.modeInfo.length;d++){var v=c.modeInfo[d];if(v.mime==S)return v;if(v.mimes){for(var g=0;g<v.mimes.length;g++)if(v.mimes[g]==S)return v}}if(/\+xml$/.test(S))return c.findModeByMIME("application/xml");if(/\+json$/.test(S))return c.findModeByMIME("application/json")},c.findModeByExtension=function(S){S=S.toLowerCase();for(var d=0;d<c.modeInfo.length;d++){var v=c.modeInfo[d];if(v.ext){for(var g=0;g<v.ext.length;g++)if(v.ext[g]==S)return v}}},c.findModeByFileName=function(S){for(var d=0;d<c.modeInfo.length;d++){var v=c.modeInfo[d];if(v.file&&v.file.test(S))return v}var g=S.lastIndexOf("."),k=g>-1&&S.substring(g+1,S.length);if(k)return c.findModeByExtension(k)},c.findModeByName=function(S){S=S.toLowerCase();for(var d=0;d<c.modeInfo.length;d++){var v=c.modeInfo[d];if(v.name.toLowerCase()==S)return v;if(v.alias){for(var g=0;g<v.alias.length;g++)if(v.alias[g].toLowerCase()==S)return v}}}})}()),_l.exports}(function(f,x){(function(c){c(ut,Sf,wf())})(function(c){c.defineMode("markdown",function(m,p){var S=c.getMode(m,"text/html"),d=S.name=="null";function v(w){if(c.findModeByName){var h=c.findModeByName(w);h&&(w=h.mime||h.mimes[0])}var te=c.getMode(m,w);return te.name=="null"?null:te}p.highlightFormatting===void 0&&(p.highlightFormatting=!1),p.maxBlockquoteDepth===void 0&&(p.maxBlockquoteDepth=0),p.taskLists===void 0&&(p.taskLists=!1),p.strikethrough===void 0&&(p.strikethrough=!1),p.emoji===void 0&&(p.emoji=!1),p.fencedCodeBlockHighlighting===void 0&&(p.fencedCodeBlockHighlighting=!0),p.fencedCodeBlockDefaultMode===void 0&&(p.fencedCodeBlockDefaultMode="text/plain"),p.xml===void 0&&(p.xml=!0),p.tokenTypeOverrides===void 0&&(p.tokenTypeOverrides={});var g={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var k in g)g.hasOwnProperty(k)&&p.tokenTypeOverrides[k]&&(g[k]=p.tokenTypeOverrides[k]);var E=/^([*\-_])(?:\s*\1){2,}\s*$/,N=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,M=/^\[(x| )\](?=\s)/i,O=p.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,I=/^ {0,3}(?:\={1,}|-{2,})\s*$/,Z=/^[^#!\[\]*_\\<>` "'(~:]+/,_=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,j=/^\s*\[[^\]]+?\]:.*$/,D=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,A=" ";function H(w,h,te){return h.f=h.inline=te,te(w,h)}function z(w,h,te){return h.f=h.block=te,te(w,h)}function G(w){return!w||!/\S/.test(w.string)}function B(w){if(w.linkTitle=!1,w.linkHref=!1,w.linkText=!1,w.em=!1,w.strong=!1,w.strikethrough=!1,w.quote=0,w.indentedCode=!1,w.f==re){var h=d;if(!h){var te=c.innerMode(S,w.htmlState);h=te.mode.name=="xml"&&te.state.tagStart===null&&!te.state.context&&te.state.tokenize.isInText}h&&(w.f=ce,w.block=Q,w.htmlState=null)}return w.trailingSpace=0,w.trailingSpaceNewLine=!1,w.prevLine=w.thisLine,w.thisLine={stream:null},null}function Q(w,h){var te=w.column()===h.indentation,ve=G(h.prevLine.stream),he=h.indentedCode,Je=h.prevLine.hr,ot=h.list!==!1,Oe=(h.listStack[h.listStack.length-1]||0)+3;h.indentedCode=!1;var Xe=h.indentation;if(h.indentationDiff===null&&(h.indentationDiff=h.indentation,ot)){for(h.list=null;Xe<h.listStack[h.listStack.length-1];)h.listStack.pop(),h.listStack.length?h.indentation=h.listStack[h.listStack.length-1]:h.list=!1;h.list!==!1&&(h.indentationDiff=Xe-h.listStack[h.listStack.length-1])}var ke=!ve&&!Je&&!h.prevLine.header&&(!ot||!he)&&!h.prevLine.fencedCodeEnd,Me=(h.list===!1||Je||ve)&&h.indentation<=Oe&&w.match(E),Ie=null;if(h.indentationDiff>=4&&(he||h.prevLine.fencedCodeEnd||h.prevLine.header||ve))return w.skipToEnd(),h.indentedCode=!0,g.code;if(w.eatSpace())return null;if(te&&h.indentation<=Oe&&(Ie=w.match(O))&&Ie[1].length<=6)return h.quote=0,h.header=Ie[1].length,h.thisLine.header=!0,p.highlightFormatting&&(h.formatting="header"),h.f=h.inline,K(h);if(h.indentation<=Oe&&w.eat(">"))return h.quote=te?1:h.quote+1,p.highlightFormatting&&(h.formatting="quote"),w.eatSpace(),K(h);if(!Me&&!h.setext&&te&&h.indentation<=Oe&&(Ie=w.match(N))){var Qe=Ie[1]?"ol":"ul";return h.indentation=Xe+w.current().length,h.list=!0,h.quote=0,h.listStack.push(h.indentation),h.em=!1,h.strong=!1,h.code=!1,h.strikethrough=!1,p.taskLists&&w.match(M,!1)&&(h.taskList=!0),h.f=h.inline,p.highlightFormatting&&(h.formatting=["list","list-"+Qe]),K(h)}else{if(te&&h.indentation<=Oe&&(Ie=w.match(_,!0)))return h.quote=0,h.fencedEndRE=new RegExp(Ie[1]+"+ *$"),h.localMode=p.fencedCodeBlockHighlighting&&v(Ie[2]||p.fencedCodeBlockDefaultMode),h.localMode&&(h.localState=c.startState(h.localMode)),h.f=h.block=we,p.highlightFormatting&&(h.formatting="code-block"),h.code=-1,K(h);if(h.setext||(!ke||!ot)&&!h.quote&&h.list===!1&&!h.code&&!Me&&!j.test(w.string)&&(Ie=w.lookAhead(1))&&(Ie=Ie.match(I)))return h.setext?(h.header=h.setext,h.setext=0,w.skipToEnd(),p.highlightFormatting&&(h.formatting="header")):(h.header=Ie[0].charAt(0)=="="?1:2,h.setext=h.header),h.thisLine.header=!0,h.f=h.inline,K(h);if(Me)return w.skipToEnd(),h.hr=!0,h.thisLine.hr=!0,g.hr;if(w.peek()==="[")return H(w,h,ee)}return H(w,h,h.inline)}function re(w,h){var te=S.token(w,h.htmlState);if(!d){var ve=c.innerMode(S,h.htmlState);(ve.mode.name=="xml"&&ve.state.tagStart===null&&!ve.state.context&&ve.state.tokenize.isInText||h.md_inside&&w.current().indexOf(">")>-1)&&(h.f=ce,h.block=Q,h.htmlState=null)}return te}function we(w,h){var te=h.listStack[h.listStack.length-1]||0,ve=h.indentation<te,he=te+3;if(h.fencedEndRE&&h.indentation<=he&&(ve||w.match(h.fencedEndRE))){p.highlightFormatting&&(h.formatting="code-block");var Je;return ve||(Je=K(h)),h.localMode=h.localState=null,h.block=Q,h.f=ce,h.fencedEndRE=null,h.code=0,h.thisLine.fencedCodeEnd=!0,ve?z(w,h,h.block):Je}else return h.localMode?h.localMode.token(w,h.localState):(w.skipToEnd(),g.code)}function K(w){var h=[];if(w.formatting){h.push(g.formatting),typeof w.formatting=="string"&&(w.formatting=[w.formatting]);for(var te=0;te<w.formatting.length;te++)h.push(g.formatting+"-"+w.formatting[te]),w.formatting[te]==="header"&&h.push(g.formatting+"-"+w.formatting[te]+"-"+w.header),w.formatting[te]==="quote"&&(!p.maxBlockquoteDepth||p.maxBlockquoteDepth>=w.quote?h.push(g.formatting+"-"+w.formatting[te]+"-"+w.quote):h.push("error"))}if(w.taskOpen)return h.push("meta"),h.length?h.join(" "):null;if(w.taskClosed)return h.push("property"),h.length?h.join(" "):null;if(w.linkHref?h.push(g.linkHref,"url"):(w.strong&&h.push(g.strong),w.em&&h.push(g.em),w.strikethrough&&h.push(g.strikethrough),w.emoji&&h.push(g.emoji),w.linkText&&h.push(g.linkText),w.code&&h.push(g.code),w.image&&h.push(g.image),w.imageAltText&&h.push(g.imageAltText,"link"),w.imageMarker&&h.push(g.imageMarker)),w.header&&h.push(g.header,g.header+"-"+w.header),w.quote&&(h.push(g.quote),!p.maxBlockquoteDepth||p.maxBlockquoteDepth>=w.quote?h.push(g.quote+"-"+w.quote):h.push(g.quote+"-"+p.maxBlockquoteDepth)),w.list!==!1){var ve=(w.listStack.length-1)%3;ve?ve===1?h.push(g.list2):h.push(g.list3):h.push(g.list1)}return w.trailingSpaceNewLine?h.push("trailing-space-new-line"):w.trailingSpace&&h.push("trailing-space-"+(w.trailingSpace%2?"a":"b")),h.length?h.join(" "):null}function fe(w,h){if(w.match(Z,!0))return K(h)}function ce(w,h){var te=h.text(w,h);if(typeof te<"u")return te;if(h.list)return h.list=null,K(h);if(h.taskList){var ve=w.match(M,!0)[1]===" ";return ve?h.taskOpen=!0:h.taskClosed=!0,p.highlightFormatting&&(h.formatting="task"),h.taskList=!1,K(h)}if(h.taskOpen=!1,h.taskClosed=!1,h.header&&w.match(/^#+$/,!0))return p.highlightFormatting&&(h.formatting="header"),K(h);var he=w.next();if(h.linkTitle){h.linkTitle=!1;var Je=he;he==="("&&(Je=")"),Je=(Je+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ot="^\\s*(?:[^"+Je+"\\\\]+|\\\\\\\\|\\\\.)"+Je;if(w.match(new RegExp(ot),!0))return g.linkHref}if(he==="`"){var Oe=h.formatting;p.highlightFormatting&&(h.formatting="code"),w.eatWhile("`");var Xe=w.current().length;if(h.code==0&&(!h.quote||Xe==1))return h.code=Xe,K(h);if(Xe==h.code){var ke=K(h);return h.code=0,ke}else return h.formatting=Oe,K(h)}else if(h.code)return K(h);if(he==="\\"&&(w.next(),p.highlightFormatting)){var Me=K(h),Ie=g.formatting+"-escape";return Me?Me+" "+Ie:Ie}if(he==="!"&&w.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return h.imageMarker=!0,h.image=!0,p.highlightFormatting&&(h.formatting="image"),K(h);if(he==="["&&h.imageMarker&&w.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return h.imageMarker=!1,h.imageAltText=!0,p.highlightFormatting&&(h.formatting="image"),K(h);if(he==="]"&&h.imageAltText){p.highlightFormatting&&(h.formatting="image");var Me=K(h);return h.imageAltText=!1,h.image=!1,h.inline=h.f=L,Me}if(he==="["&&!h.image)return h.linkText&&w.match(/^.*?\]/)||(h.linkText=!0,p.highlightFormatting&&(h.formatting="link")),K(h);if(he==="]"&&h.linkText){p.highlightFormatting&&(h.formatting="link");var Me=K(h);return h.linkText=!1,h.inline=h.f=w.match(/\(.*?\)| ?\[.*?\]/,!1)?L:ce,Me}if(he==="<"&&w.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){h.f=h.inline=le,p.highlightFormatting&&(h.formatting="link");var Me=K(h);return Me?Me+=" ":Me="",Me+g.linkInline}if(he==="<"&&w.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){h.f=h.inline=le,p.highlightFormatting&&(h.formatting="link");var Me=K(h);return Me?Me+=" ":Me="",Me+g.linkEmail}if(p.xml&&he==="<"&&w.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Qe=w.string.indexOf(">",w.pos);if(Qe!=-1){var Nr=w.string.substring(w.start,Qe);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Nr)&&(h.md_inside=!0)}return w.backUp(1),h.htmlState=c.startState(S),z(w,h,re)}if(p.xml&&he==="<"&&w.match(/^\/\w*?>/))return h.md_inside=!1,"tag";if(he==="*"||he==="_"){for(var mt=1,yt=w.pos==1?" ":w.string.charAt(w.pos-2);mt<3&&w.eat(he);)mt++;var ct=w.peek()||" ",Ht=!/\s/.test(ct)&&(!D.test(ct)||/\s/.test(yt)||D.test(yt)),pe=!/\s/.test(yt)&&(!D.test(yt)||/\s/.test(ct)||D.test(ct)),ht=null,Ot=null;if(mt%2&&(!h.em&&Ht&&(he==="*"||!pe||D.test(yt))?ht=!0:h.em==he&&pe&&(he==="*"||!Ht||D.test(ct))&&(ht=!1)),mt>1&&(!h.strong&&Ht&&(he==="*"||!pe||D.test(yt))?Ot=!0:h.strong==he&&pe&&(he==="*"||!Ht||D.test(ct))&&(Ot=!1)),Ot!=null||ht!=null){p.highlightFormatting&&(h.formatting=ht==null?"strong":Ot==null?"em":"strong em"),ht===!0&&(h.em=he),Ot===!0&&(h.strong=he);var ke=K(h);return ht===!1&&(h.em=!1),Ot===!1&&(h.strong=!1),ke}}else if(he===" "&&(w.eat("*")||w.eat("_"))){if(w.peek()===" ")return K(h);w.backUp(1)}if(p.strikethrough){if(he==="~"&&w.eatWhile(he)){if(h.strikethrough){p.highlightFormatting&&(h.formatting="strikethrough");var ke=K(h);return h.strikethrough=!1,ke}else if(w.match(/^[^\s]/,!1))return h.strikethrough=!0,p.highlightFormatting&&(h.formatting="strikethrough"),K(h)}else if(he===" "&&w.match("~~",!0)){if(w.peek()===" ")return K(h);w.backUp(2)}}if(p.emoji&&he===":"&&w.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){h.emoji=!0,p.highlightFormatting&&(h.formatting="emoji");var di=K(h);return h.emoji=!1,di}return he===" "&&(w.match(/^ +$/,!1)?h.trailingSpace++:h.trailingSpace&&(h.trailingSpaceNewLine=!0)),K(h)}function le(w,h){var te=w.next();if(te===">"){h.f=h.inline=ce,p.highlightFormatting&&(h.formatting="link");var ve=K(h);return ve?ve+=" ":ve="",ve+g.linkInline}return w.match(/^[^>]+/,!0),g.linkInline}function L(w,h){if(w.eatSpace())return null;var te=w.next();return te==="("||te==="["?(h.f=h.inline=R(te==="("?")":"]"),p.highlightFormatting&&(h.formatting="link-string"),h.linkHref=!0,K(h)):"error"}var q={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function R(w){return function(h,te){var ve=h.next();if(ve===w){te.f=te.inline=ce,p.highlightFormatting&&(te.formatting="link-string");var he=K(te);return te.linkHref=!1,he}return h.match(q[w]),te.linkHref=!0,K(te)}}function ee(w,h){return w.match(/^([^\]\\]|\\.)*\]:/,!1)?(h.f=ge,w.next(),p.highlightFormatting&&(h.formatting="link"),h.linkText=!0,K(h)):H(w,h,ce)}function ge(w,h){if(w.match("]:",!0)){h.f=h.inline=qe,p.highlightFormatting&&(h.formatting="link");var te=K(h);return h.linkText=!1,te}return w.match(/^([^\]\\]|\\.)+/,!0),g.linkText}function qe(w,h){return w.eatSpace()?null:(w.match(/^[^\s]+/,!0),w.peek()===void 0?h.linkTitle=!0:w.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),h.f=h.inline=ce,g.linkHref+" url")}var Nt={startState:function(){return{f:Q,prevLine:{stream:null},thisLine:{stream:null},block:Q,htmlState:null,indentation:0,inline:ce,text:fe,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(w){return{f:w.f,prevLine:w.prevLine,thisLine:w.thisLine,block:w.block,htmlState:w.htmlState&&c.copyState(S,w.htmlState),indentation:w.indentation,localMode:w.localMode,localState:w.localMode?c.copyState(w.localMode,w.localState):null,inline:w.inline,text:w.text,formatting:!1,linkText:w.linkText,linkTitle:w.linkTitle,linkHref:w.linkHref,code:w.code,em:w.em,strong:w.strong,strikethrough:w.strikethrough,emoji:w.emoji,header:w.header,setext:w.setext,hr:w.hr,taskList:w.taskList,list:w.list,listStack:w.listStack.slice(0),quote:w.quote,indentedCode:w.indentedCode,trailingSpace:w.trailingSpace,trailingSpaceNewLine:w.trailingSpaceNewLine,md_inside:w.md_inside,fencedEndRE:w.fencedEndRE}},token:function(w,h){if(h.formatting=!1,w!=h.thisLine.stream){if(h.header=0,h.hr=!1,w.match(/^\s*$/,!0))return B(h),null;if(h.prevLine=h.thisLine,h.thisLine={stream:w},h.taskList=!1,h.trailingSpace=0,h.trailingSpaceNewLine=!1,!h.localState&&(h.f=h.block,h.f!=re)){var te=w.match(/^\s*/,!0)[0].replace(/\t/g,A).length;if(h.indentation=te,h.indentationDiff=null,te>0)return null}}return h.f(w,h)},innerMode:function(w){return w.block==re?{state:w.htmlState,mode:S}:w.localState?{state:w.localState,mode:w.localMode}:{state:w,mode:Nt}},indent:function(w,h,te){return w.block==re&&S.indent?S.indent(w.htmlState,h,te):w.localState&&w.localMode.indent?w.localMode.indent(w.localState,h,te):c.Pass},blankLine:B,getType:K,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Nt},"xml"),c.defineMIME("text/markdown","markdown"),c.defineMIME("text/x-markdown","markdown")})})();var kf=xf.exports,Cf={exports:{}};(function(f,x){(function(c){c(ut)})(function(c){c.overlayMode=function(m,p,S){return{startState:function(){return{base:c.startState(m),overlay:c.startState(p),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(d){return{base:c.copyState(m,d.base),overlay:c.copyState(p,d.overlay),basePos:d.basePos,baseCur:null,overlayPos:d.overlayPos,overlayCur:null}},token:function(d,v){return(d!=v.streamSeen||Math.min(v.basePos,v.overlayPos)<d.start)&&(v.streamSeen=d,v.basePos=v.overlayPos=d.start),d.start==v.basePos&&(v.baseCur=m.token(d,v.base),v.basePos=d.pos),d.start==v.overlayPos&&(d.pos=d.start,v.overlayCur=p.token(d,v.overlay),v.overlayPos=d.pos),d.pos=Math.min(v.basePos,v.overlayPos),v.overlayCur==null?v.baseCur:v.baseCur!=null&&v.overlay.combineTokens||S&&v.overlay.combineTokens==null?v.baseCur+" "+v.overlayCur:v.overlayCur},indent:m.indent&&function(d,v,g){return m.indent(d.base,v,g)},electricChars:m.electricChars,innerMode:function(d){return{state:d.base,mode:m}},blankLine:function(d){var v,g;return m.blankLine&&(v=m.blankLine(d.base)),p.blankLine&&(g=p.blankLine(d.overlay)),g==null?v:S&&v!=null?v+" "+g:g}}}})})();var Lf=Cf.exports;(function(f,x){(function(c){c(ut)})(function(c){c.defineOption("placeholder","",function(k,E,N){var M=N&&N!=c.Init;if(E&&!M)k.on("blur",d),k.on("change",v),k.on("swapDoc",v),c.on(k.getInputField(),"compositionupdate",k.state.placeholderCompose=function(){S(k)}),v(k);else if(!E&&M){k.off("blur",d),k.off("change",v),k.off("swapDoc",v),c.off(k.getInputField(),"compositionupdate",k.state.placeholderCompose),m(k);var O=k.getWrapperElement();O.className=O.className.replace(" CodeMirror-empty","")}E&&!k.hasFocus()&&d(k)});function m(k){k.state.placeholder&&(k.state.placeholder.parentNode.removeChild(k.state.placeholder),k.state.placeholder=null)}function p(k){m(k);var E=k.state.placeholder=document.createElement("pre");E.style.cssText="height: 0; overflow: visible",E.style.direction=k.getOption("direction"),E.className="CodeMirror-placeholder CodeMirror-line-like";var N=k.getOption("placeholder");typeof N=="string"&&(N=document.createTextNode(N)),E.appendChild(N),k.display.lineSpace.insertBefore(E,k.display.lineSpace.firstChild)}function S(k){setTimeout(function(){var E=!1;if(k.lineCount()==1){var N=k.getInputField();E=N.nodeName=="TEXTAREA"?!k.getLine(0).length:!/[^\u200b]/.test(N.querySelector(".CodeMirror-line").textContent)}E?p(k):m(k)},20)}function d(k){g(k)&&p(k)}function v(k){var E=k.getWrapperElement(),N=g(k);E.className=E.className.replace(" CodeMirror-empty","")+(N?" CodeMirror-empty":""),N?p(k):m(k)}function g(k){return k.lineCount()===1&&k.getLine(0)===""}})})();(function(f,x){(function(c){c(ut)})(function(c){c.defineOption("autoRefresh",!1,function(S,d){S.state.autoRefresh&&(p(S,S.state.autoRefresh),S.state.autoRefresh=null),d&&S.display.wrapper.offsetHeight==0&&m(S,S.state.autoRefresh={delay:d.delay||250})});function m(S,d){function v(){S.display.wrapper.offsetHeight?(p(S,d),S.display.lastWrapHeight!=S.display.wrapper.clientHeight&&S.refresh()):d.timeout=setTimeout(v,d.delay)}d.timeout=setTimeout(v,d.delay),d.hurry=function(){clearTimeout(d.timeout),d.timeout=setTimeout(v,50)},c.on(window,"mouseup",d.hurry),c.on(window,"keyup",d.hurry)}function p(S,d){clearTimeout(d.timeout),c.off(window,"mouseup",d.hurry),c.off(window,"keyup",d.hurry)}})})();(function(f,x){(function(c){c(ut)})(function(c){c.defineOption("styleSelectedText",!1,function(M,O,I){var Z=I&&I!=c.Init;O&&!Z?(M.state.markedSelection=[],M.state.markedSelectionStyle=typeof O=="string"?O:"CodeMirror-selectedtext",E(M),M.on("cursorActivity",m),M.on("change",p)):!O&&Z&&(M.off("cursorActivity",m),M.off("change",p),k(M),M.state.markedSelection=M.state.markedSelectionStyle=null)});function m(M){M.state.markedSelection&&M.operation(function(){N(M)})}function p(M){M.state.markedSelection&&M.state.markedSelection.length&&M.operation(function(){k(M)})}var S=8,d=c.Pos,v=c.cmpPos;function g(M,O,I,Z){if(v(O,I)!=0)for(var _=M.state.markedSelection,j=M.state.markedSelectionStyle,D=O.line;;){var A=D==O.line?O:d(D,0),H=D+S,z=H>=I.line,G=z?I:d(H,0),B=M.markText(A,G,{className:j});if(Z==null?_.push(B):_.splice(Z++,0,B),z)break;D=H}}function k(M){for(var O=M.state.markedSelection,I=0;I<O.length;++I)O[I].clear();O.length=0}function E(M){k(M);for(var O=M.listSelections(),I=0;I<O.length;I++)g(M,O[I].from(),O[I].to())}function N(M){if(!M.somethingSelected())return k(M);if(M.listSelections().length>1)return E(M);var O=M.getCursor("start"),I=M.getCursor("end"),Z=M.state.markedSelection;if(!Z.length)return g(M,O,I);var _=Z[0].find(),j=Z[Z.length-1].find();if(!_||!j||I.line-O.line<=S||v(O,j.to)>=0||v(I,_.from)<=0)return E(M);for(;v(O,_.from)>0;)Z.shift().clear(),_=Z[0].find();for(v(O,_.from)<0&&(_.to.line-O.line<S?(Z.shift().clear(),g(M,O,_.to,0)):g(M,O,_.from,0));v(I,j.to)<0;)Z.pop().clear(),j=Z[Z.length-1].find();v(I,j.to)>0&&(I.line-j.from.line<S?(Z.pop().clear(),g(M,j.from,I)):g(M,j.to,I))}})})();(function(f,x){(function(c){c(ut)})(function(c){var m=c.Pos;function p(D){var A=D.flags;return A??(D.ignoreCase?"i":"")+(D.global?"g":"")+(D.multiline?"m":"")}function S(D,A){for(var H=p(D),z=H,G=0;G<A.length;G++)z.indexOf(A.charAt(G))==-1&&(z+=A.charAt(G));return H==z?D:new RegExp(D.source,z)}function d(D){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(D.source)}function v(D,A,H){A=S(A,"g");for(var z=H.line,G=H.ch,B=D.lastLine();z<=B;z++,G=0){A.lastIndex=G;var Q=D.getLine(z),re=A.exec(Q);if(re)return{from:m(z,re.index),to:m(z,re.index+re[0].length),match:re}}}function g(D,A,H){if(!d(A))return v(D,A,H);A=S(A,"gm");for(var z,G=1,B=H.line,Q=D.lastLine();B<=Q;){for(var re=0;re<G&&!(B>Q);re++){var we=D.getLine(B++);z=z==null?we:z+`
27
- `+we}G=G*2,A.lastIndex=H.ch;var K=A.exec(z);if(K){var fe=z.slice(0,K.index).split(`
28
- `),ce=K[0].split(`
29
- `),le=H.line+fe.length-1,L=fe[fe.length-1].length;return{from:m(le,L),to:m(le+ce.length-1,ce.length==1?L+ce[0].length:ce[ce.length-1].length),match:K}}}}function k(D,A,H){for(var z,G=0;G<=D.length;){A.lastIndex=G;var B=A.exec(D);if(!B)break;var Q=B.index+B[0].length;if(Q>D.length-H)break;(!z||Q>z.index+z[0].length)&&(z=B),G=B.index+1}return z}function E(D,A,H){A=S(A,"g");for(var z=H.line,G=H.ch,B=D.firstLine();z>=B;z--,G=-1){var Q=D.getLine(z),re=k(Q,A,G<0?0:Q.length-G);if(re)return{from:m(z,re.index),to:m(z,re.index+re[0].length),match:re}}}function N(D,A,H){if(!d(A))return E(D,A,H);A=S(A,"gm");for(var z,G=1,B=D.getLine(H.line).length-H.ch,Q=H.line,re=D.firstLine();Q>=re;){for(var we=0;we<G&&Q>=re;we++){var K=D.getLine(Q--);z=z==null?K:K+`
30
- `+z}G*=2;var fe=k(z,A,B);if(fe){var ce=z.slice(0,fe.index).split(`
31
- `),le=fe[0].split(`
32
- `),L=Q+ce.length,q=ce[ce.length-1].length;return{from:m(L,q),to:m(L+le.length-1,le.length==1?q+le[0].length:le[le.length-1].length),match:fe}}}}var M,O;String.prototype.normalize?(M=function(D){return D.normalize("NFD").toLowerCase()},O=function(D){return D.normalize("NFD")}):(M=function(D){return D.toLowerCase()},O=function(D){return D});function I(D,A,H,z){if(D.length==A.length)return H;for(var G=0,B=H+Math.max(0,D.length-A.length);;){if(G==B)return G;var Q=G+B>>1,re=z(D.slice(0,Q)).length;if(re==H)return Q;re>H?B=Q:G=Q+1}}function Z(D,A,H,z){if(!A.length)return null;var G=z?M:O,B=G(A).split(/\r|\n\r?/);e:for(var Q=H.line,re=H.ch,we=D.lastLine()+1-B.length;Q<=we;Q++,re=0){var K=D.getLine(Q).slice(re),fe=G(K);if(B.length==1){var ce=fe.indexOf(B[0]);if(ce==-1)continue e;var H=I(K,fe,ce,G)+re;return{from:m(Q,I(K,fe,ce,G)+re),to:m(Q,I(K,fe,ce+B[0].length,G)+re)}}else{var le=fe.length-B[0].length;if(fe.slice(le)!=B[0])continue e;for(var L=1;L<B.length-1;L++)if(G(D.getLine(Q+L))!=B[L])continue e;var q=D.getLine(Q+B.length-1),R=G(q),ee=B[B.length-1];if(R.slice(0,ee.length)!=ee)continue e;return{from:m(Q,I(K,fe,le,G)+re),to:m(Q+B.length-1,I(q,R,ee.length,G))}}}}function _(D,A,H,z){if(!A.length)return null;var G=z?M:O,B=G(A).split(/\r|\n\r?/);e:for(var Q=H.line,re=H.ch,we=D.firstLine()-1+B.length;Q>=we;Q--,re=-1){var K=D.getLine(Q);re>-1&&(K=K.slice(0,re));var fe=G(K);if(B.length==1){var ce=fe.lastIndexOf(B[0]);if(ce==-1)continue e;return{from:m(Q,I(K,fe,ce,G)),to:m(Q,I(K,fe,ce+B[0].length,G))}}else{var le=B[B.length-1];if(fe.slice(0,le.length)!=le)continue e;for(var L=1,H=Q-B.length+1;L<B.length-1;L++)if(G(D.getLine(H+L))!=B[L])continue e;var q=D.getLine(Q+1-B.length),R=G(q);if(R.slice(R.length-B[0].length)!=B[0])continue e;return{from:m(Q+1-B.length,I(q,R,q.length-B[0].length,G)),to:m(Q,I(K,fe,le.length,G))}}}}function j(D,A,H,z){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=D,H=H?D.clipPos(H):m(0,0),this.pos={from:H,to:H};var G;typeof z=="object"?G=z.caseFold:(G=z,z=null),typeof A=="string"?(G==null&&(G=!1),this.matches=function(B,Q){return(B?_:Z)(D,A,Q,G)}):(A=S(A,"gm"),!z||z.multiline!==!1?this.matches=function(B,Q){return(B?N:g)(D,A,Q)}:this.matches=function(B,Q){return(B?E:v)(D,A,Q)})}j.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(D){var A=this.doc.clipPos(D?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(A=m(A.line,A.ch),D?(A.ch--,A.ch<0&&(A.line--,A.ch=(this.doc.getLine(A.line)||"").length)):(A.ch++,A.ch>(this.doc.getLine(A.line)||"").length&&(A.ch=0,A.line++)),c.cmpPos(A,this.doc.clipPos(A))!=0))return this.atOccurrence=!1;var H=this.matches(D,A);if(this.afterEmptyMatch=H&&c.cmpPos(H.from,H.to)==0,H)return this.pos=H,this.atOccurrence=!0,this.pos.match||!0;var z=m(D?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:z,to:z},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(D,A){if(this.atOccurrence){var H=c.splitLines(D);this.doc.replaceRange(H,this.pos.from,this.pos.to,A),this.pos.to=m(this.pos.from.line+H.length-1,H[H.length-1].length+(H.length==1?this.pos.from.ch:0))}}},c.defineExtension("getSearchCursor",function(D,A,H){return new j(this.doc,D,A,H)}),c.defineDocExtension("getSearchCursor",function(D,A,H){return new j(this,D,A,H)}),c.defineExtension("selectMatches",function(D,A){for(var H=[],z=this.getSearchCursor(D,this.getCursor("from"),A);z.findNext()&&!(c.cmpPos(z.to(),this.getCursor("to"))>0);)H.push({anchor:z.from(),head:z.to()});H.length&&this.setSelections(H,0)})})})();(function(f,x){(function(c){c(ut,kf,Lf)})(function(c){var m=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;c.defineMode("gfm",function(p,S){var d=0;function v(N){return N.code=!1,null}var g={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(N){return{code:N.code,codeBlock:N.codeBlock,ateSpace:N.ateSpace}},token:function(N,M){if(M.combineTokens=null,M.codeBlock)return N.match(/^```+/)?(M.codeBlock=!1,null):(N.skipToEnd(),null);if(N.sol()&&(M.code=!1),N.sol()&&N.match(/^```+/))return N.skipToEnd(),M.codeBlock=!0,null;if(N.peek()==="`"){N.next();var O=N.pos;N.eatWhile("`");var I=1+N.pos-O;return M.code?I===d&&(M.code=!1):(d=I,M.code=!0),null}else if(M.code)return N.next(),null;if(N.eatSpace())return M.ateSpace=!0,null;if((N.sol()||M.ateSpace)&&(M.ateSpace=!1,S.gitHubSpice!==!1)){if(N.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/))return M.combineTokens=!0,"link";if(N.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return M.combineTokens=!0,"link"}return N.match(m)&&N.string.slice(N.start-2,N.start)!="]("&&(N.start==0||/\W/.test(N.string.charAt(N.start-1)))?(M.combineTokens=!0,"link"):(N.next(),null)},blankLine:v},k={taskLists:!0,strikethrough:!0,emoji:!0};for(var E in S)k[E]=S[E];return k.name="markdown",c.overlayMode(c.getMode(p,k),g)},"markdown"),c.defineMIME("text/x-gfm","gfm")})})();function Tf(f){throw new Error('Could not dynamically require "'+f+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Zl={exports:{}};const Mf={},Df=Object.freeze(Object.defineProperty({__proto__:null,default:Mf},Symbol.toStringTag,{value:"Module"})),Ff=Kl(Df);(function(f){var x;(function(){x=function(c,m,p,S){S=S||{},this.dictionary=null,this.rules={},this.dictionaryTable={},this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=S.flags||{},this.memoized={},this.loaded=!1;var d=this,v,g,k,E,N;c&&(d.dictionary=c,m&&p?Z():typeof window<"u"&&"chrome"in window&&"extension"in window.chrome&&"getURL"in window.chrome.extension?(S.dictionaryPath?v=S.dictionaryPath:v="typo/dictionaries",m||M(chrome.extension.getURL(v+"/"+c+"/"+c+".aff"),O),p||M(chrome.extension.getURL(v+"/"+c+"/"+c+".dic"),I)):(S.dictionaryPath?v=S.dictionaryPath:typeof __dirname<"u"?v=__dirname+"/dictionaries":v="./dictionaries",m||M(v+"/"+c+"/"+c+".aff",O),p||M(v+"/"+c+"/"+c+".dic",I)));function M(_,j){var D=d._readFile(_,null,S.asyncLoad);S.asyncLoad?D.then(function(A){j(A)}):j(D)}function O(_){m=_,p&&Z()}function I(_){p=_,m&&Z()}function Z(){for(d.rules=d._parseAFF(m),d.compoundRuleCodes={},g=0,E=d.compoundRules.length;g<E;g++){var _=d.compoundRules[g];for(k=0,N=_.length;k<N;k++)d.compoundRuleCodes[_[k]]=[]}"ONLYINCOMPOUND"in d.flags&&(d.compoundRuleCodes[d.flags.ONLYINCOMPOUND]=[]),d.dictionaryTable=d._parseDIC(p);for(g in d.compoundRuleCodes)d.compoundRuleCodes[g].length===0&&delete d.compoundRuleCodes[g];for(g=0,E=d.compoundRules.length;g<E;g++){var j=d.compoundRules[g],D="";for(k=0,N=j.length;k<N;k++){var A=j[k];A in d.compoundRuleCodes?D+="("+d.compoundRuleCodes[A].join("|")+")":D+=A}d.compoundRules[g]=new RegExp(D,"i")}d.loaded=!0,S.asyncLoad&&S.loadedCallback&&S.loadedCallback(d)}return this},x.prototype={load:function(c){for(var m in c)c.hasOwnProperty(m)&&(this[m]=c[m]);return this},_readFile:function(c,m,p){if(m=m||"utf8",typeof XMLHttpRequest<"u"){var S,d=new XMLHttpRequest;return d.open("GET",c,p),p&&(S=new Promise(function(g,k){d.onload=function(){d.status===200?g(d.responseText):k(d.statusText)},d.onerror=function(){k(d.statusText)}})),d.overrideMimeType&&d.overrideMimeType("text/plain; charset="+m),d.send(null),p?S:d.responseText}else if(typeof Tf<"u"){var v=Ff;try{if(v.existsSync(c))return v.readFileSync(c,m);console.log("Path "+c+" does not exist.")}catch(g){return console.log(g),""}}},_parseAFF:function(c){var m={},p,S,d,v,g,k,E,N,M=c.split(/\r?\n/);for(g=0,E=M.length;g<E;g++)if(p=this._removeAffixComments(M[g]),p=p.trim(),!!p){var O=p.split(/\s+/),I=O[0];if(I=="PFX"||I=="SFX"){var Z=O[1],_=O[2];d=parseInt(O[3],10);var j=[];for(k=g+1,N=g+1+d;k<N;k++){S=M[k],v=S.split(/\s+/);var D=v[2],A=v[3].split("/"),H=A[0];H==="0"&&(H="");var z=this.parseRuleCodes(A[1]),G=v[4],B={};B.add=H,z.length>0&&(B.continuationClasses=z),G!=="."&&(I==="SFX"?B.match=new RegExp(G+"$"):B.match=new RegExp("^"+G)),D!="0"&&(I==="SFX"?B.remove=new RegExp(D+"$"):B.remove=D),j.push(B)}m[Z]={type:I,combineable:_=="Y",entries:j},g+=d}else if(I==="COMPOUNDRULE"){for(d=parseInt(O[1],10),k=g+1,N=g+1+d;k<N;k++)p=M[k],v=p.split(/\s+/),this.compoundRules.push(v[1]);g+=d}else I==="REP"?(v=p.split(/\s+/),v.length===3&&this.replacementTable.push([v[1],v[2]])):this.flags[I]=O[1]}return m},_removeAffixComments:function(c){return c.match(/^\s*#/,"")?"":c},_parseDIC:function(c){c=this._removeDicComments(c);var m=c.split(/\r?\n/),p={};function S(K,fe){p.hasOwnProperty(K)||(p[K]=null),fe.length>0&&(p[K]===null&&(p[K]=[]),p[K].push(fe))}for(var d=1,v=m.length;d<v;d++){var g=m[d];if(g){var k=g.split("/",2),E=k[0];if(k.length>1){var N=this.parseRuleCodes(k[1]);(!("NEEDAFFIX"in this.flags)||N.indexOf(this.flags.NEEDAFFIX)==-1)&&S(E,N);for(var M=0,O=N.length;M<O;M++){var I=N[M],Z=this.rules[I];if(Z)for(var _=this._applyRule(E,Z),j=0,D=_.length;j<D;j++){var A=_[j];if(S(A,[]),Z.combineable)for(var H=M+1;H<O;H++){var z=N[H],G=this.rules[z];if(G&&G.combineable&&Z.type!=G.type)for(var B=this._applyRule(A,G),Q=0,re=B.length;Q<re;Q++){var we=B[Q];S(we,[])}}}I in this.compoundRuleCodes&&this.compoundRuleCodes[I].push(E)}}else S(E.trim(),[])}}return p},_removeDicComments:function(c){return c=c.replace(/^\t.*$/mg,""),c},parseRuleCodes:function(c){if(c)if("FLAG"in this.flags)if(this.flags.FLAG==="long"){for(var m=[],p=0,S=c.length;p<S;p+=2)m.push(c.substr(p,2));return m}else return this.flags.FLAG==="num"?c.split(","):this.flags.FLAG==="UTF-8"?Array.from(c):c.split("");else return c.split("");else return[]},_applyRule:function(c,m){for(var p=m.entries,S=[],d=0,v=p.length;d<v;d++){var g=p[d];if(!g.match||c.match(g.match)){var k=c;if(g.remove&&(k=k.replace(g.remove,"")),m.type==="SFX"?k=k+g.add:k=g.add+k,S.push(k),"continuationClasses"in g)for(var E=0,N=g.continuationClasses.length;E<N;E++){var M=this.rules[g.continuationClasses[E]];M&&(S=S.concat(this._applyRule(k,M)))}}}return S},check:function(c){if(!this.loaded)throw"Dictionary not loaded.";if(!c)return!1;var m=c.replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(this.checkExact(m))return!0;if(m.toUpperCase()===m){var p=m[0]+m.substring(1).toLowerCase();if(this.hasFlag(p,"KEEPCASE"))return!1;if(this.checkExact(p)||this.checkExact(m.toLowerCase()))return!0}var S=m[0].toLowerCase()+m.substring(1);if(S!==m){if(this.hasFlag(S,"KEEPCASE"))return!1;if(this.checkExact(S))return!0}return!1},checkExact:function(c){if(!this.loaded)throw"Dictionary not loaded.";var m=this.dictionaryTable[c],p,S;if(typeof m>"u"){if("COMPOUNDMIN"in this.flags&&c.length>=this.flags.COMPOUNDMIN){for(p=0,S=this.compoundRules.length;p<S;p++)if(c.match(this.compoundRules[p]))return!0}}else{if(m===null)return!0;if(typeof m=="object"){for(p=0,S=m.length;p<S;p++)if(!this.hasFlag(c,"ONLYINCOMPOUND",m[p]))return!0}}return!1},hasFlag:function(c,m,p){if(!this.loaded)throw"Dictionary not loaded.";return!!(m in this.flags&&(typeof p>"u"&&(p=Array.prototype.concat.apply([],this.dictionaryTable[c])),p&&p.indexOf(this.flags[m])!==-1))},alphabet:"",suggest:function(c,m){if(!this.loaded)throw"Dictionary not loaded.";if(m=m||5,this.memoized.hasOwnProperty(c)){var p=this.memoized[c].limit;if(m<=p||this.memoized[c].suggestions.length<p)return this.memoized[c].suggestions.slice(0,m)}if(this.check(c))return[];for(var S=0,d=this.replacementTable.length;S<d;S++){var v=this.replacementTable[S];if(c.indexOf(v[0])!==-1){var g=c.replace(v[0],v[1]);if(this.check(g))return[g]}}if(!this.alphabet){this.alphabet="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ","TRY"in this.flags&&(this.alphabet+=this.flags.TRY),"WORDCHARS"in this.flags&&(this.alphabet+=this.flags.WORDCHARS);var k=this.alphabet.split("");k.sort();for(var E={},S=0;S<k.length;S++)E[k[S]]=!0;this.alphabet="";for(var S in E)this.alphabet+=S}var N=this;function M(I,Z){var _={},j,D,A,H,z=N.alphabet.length;if(typeof I=="string"){var G=I;I={},I[G]=!0}for(var G in I)for(j=0,A=G.length+1;j<A;j++){var B=[G.substring(0,j),G.substring(j)];if(B[1]&&(H=B[0]+B[1].substring(1),(!Z||N.check(H))&&(H in _?_[H]+=1:_[H]=1)),B[1].length>1&&B[1][1]!==B[1][0]&&(H=B[0]+B[1][1]+B[1][0]+B[1].substring(2),(!Z||N.check(H))&&(H in _?_[H]+=1:_[H]=1)),B[1]){var Q=B[1].substring(0,1).toUpperCase()===B[1].substring(0,1)?"uppercase":"lowercase";for(D=0;D<z;D++){var re=N.alphabet[D];Q==="uppercase"&&(re=re.toUpperCase()),re!=B[1].substring(0,1)&&(H=B[0]+re+B[1].substring(1),(!Z||N.check(H))&&(H in _?_[H]+=1:_[H]=1))}}if(B[1])for(D=0;D<z;D++){var Q=B[0].substring(-1).toUpperCase()===B[0].substring(-1)&&B[1].substring(0,1).toUpperCase()===B[1].substring(0,1)?"uppercase":"lowercase",re=N.alphabet[D];Q==="uppercase"&&(re=re.toUpperCase()),H=B[0]+re+B[1],(!Z||N.check(H))&&(H in _?_[H]+=1:_[H]=1)}}return _}function O(I){var Z=M(I),_=M(Z,!0),j=_;for(var D in Z)N.check(D)&&(D in j?j[D]+=Z[D]:j[D]=Z[D]);var A,H=[];for(A in j)j.hasOwnProperty(A)&&H.push([A,j[A]]);function z(re,we){var K=re[1],fe=we[1];return K<fe?-1:K>fe?1:we[0].localeCompare(re[0])}H.sort(z).reverse();var G=[],B="lowercase";I.toUpperCase()===I?B="uppercase":I.substr(0,1).toUpperCase()+I.substr(1).toLowerCase()===I&&(B="capitalized");var Q=m;for(A=0;A<Math.min(Q,H.length);A++)B==="uppercase"?H[A][0]=H[A][0].toUpperCase():B==="capitalized"&&(H[A][0]=H[A][0].substr(0,1).toUpperCase()+H[A][0].substr(1)),!N.hasFlag(H[A][0],"NOSUGGEST")&&G.indexOf(H[A][0])==-1?G.push(H[A][0]):Q++;return G}return this.memoized[c]={suggestions:O(c),limit:m},this.memoized[c].suggestions}}})(),f.exports=x})(Zl);var Ef=Zl.exports,ql=Ef;function Le(f){if(f=f||{},typeof f.codeMirrorInstance!="function"||typeof f.codeMirrorInstance.defineMode!="function"){console.log("CodeMirror Spell Checker: You must provide an instance of CodeMirror via the option `codeMirrorInstance`");return}String.prototype.includes||(String.prototype.includes=function(){return String.prototype.indexOf.apply(this,arguments)!==-1}),f.codeMirrorInstance.defineMode("spell-checker",function(x){if(!Le.aff_loading){Le.aff_loading=!0;var c=new XMLHttpRequest;c.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),c.onload=function(){c.readyState===4&&c.status===200&&(Le.aff_data=c.responseText,Le.num_loaded++,Le.num_loaded==2&&(Le.typo=new ql("en_US",Le.aff_data,Le.dic_data,{platform:"any"})))},c.send(null)}if(!Le.dic_loading){Le.dic_loading=!0;var m=new XMLHttpRequest;m.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),m.onload=function(){m.readyState===4&&m.status===200&&(Le.dic_data=m.responseText,Le.num_loaded++,Le.num_loaded==2&&(Le.typo=new ql("en_US",Le.aff_data,Le.dic_data,{platform:"any"})))},m.send(null)}var p='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',S={token:function(v){var g=v.peek(),k="";if(p.includes(g))return v.next(),null;for(;(g=v.peek())!=null&&!p.includes(g);)k+=g,v.next();return Le.typo&&!Le.typo.check(k)?"spell-error":null}},d=f.codeMirrorInstance.getMode(x,x.backdrop||"text/plain");return f.codeMirrorInstance.overlayMode(d,S,!0)})}Le.num_loaded=0;Le.aff_loading=!1;Le.dic_loading=!1;Le.aff_data="";Le.dic_data="";Le.typo;var Af=Le;const Nf=Kl(yf);var Er=ut,Hf=Af,La=Nf.marked,Jl=/Mac/.test(navigator.platform),Of=new RegExp(/(<a.*?https?:\/\/.*?[^a]>)+?/g),ci={toggleBold:Ji,toggleItalic:Qi,drawLink:un,toggleHeadingSmaller:hi,toggleHeadingBigger:tn,drawImage:fn,toggleBlockquote:en,toggleOrderedList:ln,toggleUnorderedList:on,toggleCodeBlock:$i,togglePreview:gn,toggleStrikethrough:Vi,toggleHeading1:rn,toggleHeading2:nn,toggleHeading3:an,toggleHeading4:Ma,toggleHeading5:Da,toggleHeading6:Fa,cleanBlock:sn,drawTable:cn,drawHorizontalRule:hn,undo:dn,redo:pn,toggleSideBySide:Ar,toggleFullScreen:or},If={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",toggleHeading1:"Ctrl+Alt+1",toggleHeading2:"Ctrl+Alt+2",toggleHeading3:"Ctrl+Alt+3",toggleHeading4:"Ctrl+Alt+4",toggleHeading5:"Ctrl+Alt+5",toggleHeading6:"Ctrl+Alt+6",cleanBlock:"Cmd-E",drawImage:"Cmd-Alt-I",toggleBlockquote:"Cmd-'",toggleOrderedList:"Cmd-Alt-L",toggleUnorderedList:"Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},Pf=function(f){for(var x in ci)if(ci[x]===f)return x;return null},Ta=function(){var f=!1;return function(x){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(x)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(x.substr(0,4)))&&(f=!0)}(navigator.userAgent||navigator.vendor||window.opera),f};function Bf(f){for(var x;(x=Of.exec(f))!==null;){var c=x[0];if(c.indexOf("target=")===-1){var m=c.replace(/>$/,' target="_blank">');f=f.replace(c,m)}}return f}function Rf(f){for(var x=new DOMParser,c=x.parseFromString(f,"text/html"),m=c.getElementsByTagName("li"),p=0;p<m.length;p++)for(var S=m[p],d=0;d<S.children.length;d++){var v=S.children[d];v instanceof HTMLInputElement&&v.type==="checkbox"&&(S.style.marginLeft="-1.5em",S.style.listStyleType="none")}return c.documentElement.innerHTML}function Ql(f){return Jl?f=f.replace("Ctrl","Cmd"):f=f.replace("Cmd","Ctrl"),f}function Wf(f,x,c,m){var p=Yi(f,!1,x,c,"button",m);p.classList.add("easymde-dropdown"),p.onclick=function(){p.focus()};var S=document.createElement("div");S.className="easymde-dropdown-content";for(var d=0;d<f.children.length;d++){var v=f.children[d],g;typeof v=="string"&&v in ar?g=Yi(ar[v],!0,x,c,"button",m):g=Yi(v,!0,x,c,"button",m),g.addEventListener("click",function(k){k.stopPropagation()},!1),S.appendChild(g)}return p.appendChild(S),p}function Yi(f,x,c,m,p,S){f=f||{};var d=document.createElement(p);if(f.attributes)for(var v in f.attributes)Object.prototype.hasOwnProperty.call(f.attributes,v)&&d.setAttribute(v,f.attributes[v]);var g=S.options.toolbarButtonClassPrefix?S.options.toolbarButtonClassPrefix+"-":"";d.className=g+f.name,d.setAttribute("type",p),c=c??!0,f.text&&(d.innerText=f.text),f.name&&f.name in m&&(ci[f.name]=f.action),f.title&&c&&(d.title=_f(f.title,f.action,m),Jl&&(d.title=d.title.replace("Ctrl","⌘"),d.title=d.title.replace("Alt","⌥"))),f.title&&d.setAttribute("aria-label",f.title),f.noDisable&&d.classList.add("no-disable"),f.noMobile&&d.classList.add("no-mobile");var k=[];typeof f.className<"u"&&(k=f.className.split(" "));for(var E=[],N=0;N<k.length;N++){var M=k[N];M.match(/^fa([srlb]|(-[\w-]*)|$)/)?E.push(M):d.classList.add(M)}if(d.tabIndex=-1,E.length>0){for(var O=document.createElement("i"),I=0;I<E.length;I++){var Z=E[I];O.classList.add(Z)}d.appendChild(O)}return typeof f.icon<"u"&&(d.innerHTML=f.icon),f.action&&x&&(typeof f.action=="function"?d.onclick=function(_){_.preventDefault(),f.action(S)}:typeof f.action=="string"&&(d.onclick=function(_){_.preventDefault(),window.open(f.action,"_blank")})),d}function zf(){var f=document.createElement("i");return f.className="separator",f.innerHTML="|",f}function _f(f,x,c){var m,p=f;return x&&(m=Pf(x),c[m]&&(p+=" ("+Ql(c[m])+")")),p}function Gt(f,x){x=x||f.getCursor("start");var c=f.getTokenAt(x);if(!c.type)return{};for(var m=c.type.split(" "),p={},S,d,v=0;v<m.length;v++)S=m[v],S==="strong"?p.bold=!0:S==="variable-2"?(d=f.getLine(x.line),/^\s*\d+\.\s/.test(d)?p["ordered-list"]=!0:p["unordered-list"]=!0):S==="atom"?p.quote=!0:S==="em"?p.italic=!0:S==="quote"?p.quote=!0:S==="strikethrough"?p.strikethrough=!0:S==="comment"?p.code=!0:S==="link"&&!p.image?p.link=!0:S==="image"?p.image=!0:S.match(/^header(-[1-6])?$/)&&(p[S.replace("header","heading")]=!0);return p}var Gl="";function or(f){var x=f.codemirror;x.setOption("fullScreen",!x.getOption("fullScreen")),x.getOption("fullScreen")?(Gl=document.body.style.overflow,document.body.style.overflow="hidden"):document.body.style.overflow=Gl;var c=x.getWrapperElement(),m=c.nextSibling;if(m.classList.contains("editor-preview-active-side"))if(f.options.sideBySideFullscreen===!1){var p=c.parentNode;x.getOption("fullScreen")?p.classList.remove("sided--no-fullscreen"):p.classList.add("sided--no-fullscreen")}else Ar(f);if(f.options.onToggleFullScreen&&f.options.onToggleFullScreen(x.getOption("fullScreen")||!1),typeof f.options.maxHeight<"u"&&(x.getOption("fullScreen")?(x.getScrollerElement().style.removeProperty("height"),m.style.removeProperty("height")):(x.getScrollerElement().style.height=f.options.maxHeight,f.setPreviewMaxHeight())),f.toolbar_div.classList.toggle("fullscreen"),f.toolbarElements&&f.toolbarElements.fullscreen){var S=f.toolbarElements.fullscreen;S.classList.toggle("active")}}function Ji(f){Na(f,"bold",f.options.blockStyles.bold)}function Qi(f){Na(f,"italic",f.options.blockStyles.italic)}function Vi(f){Na(f,"strikethrough","~~")}function $i(f){var x=f.options.blockStyles.code;function c(le){if(typeof le!="object")throw"fencing_line() takes a 'line' object (not a line number, or line text). Got: "+typeof le+": "+le;return le.styles&&le.styles[2]&&le.styles[2].indexOf("formatting-code-block")!==-1}function m(le){return le.state.base.base||le.state.base}function p(le,L,q,R,ee){q=q||le.getLineHandle(L),R=R||le.getTokenAt({line:L,ch:1}),ee=ee||!!q.text&&le.getTokenAt({line:L,ch:q.text.length-1});var ge=R.type?R.type.split(" "):[];return ee&&m(ee).indentedCode?"indented":ge.indexOf("comment")===-1?!1:m(R).fencedChars||m(ee).fencedChars||c(q)?"fenced":"single"}function S(le,L,q,R){var ee=L.line+1,ge=q.line+1,qe=L.line!==q.line,Nt=R+`
33
- `,w=`
34
- `+R;qe&&ge++,qe&&q.ch===0&&(w=R+`
35
- `,ge--),lr(le,!1,[Nt,w]),le.setSelection({line:ee,ch:0},{line:ge,ch:0})}var d=f.codemirror,v=d.getCursor("start"),g=d.getCursor("end"),k=d.getTokenAt({line:v.line,ch:v.ch||1}),E=d.getLineHandle(v.line),N=p(d,v.line,E,k),M,O,I;if(N==="single"){var Z=E.text.slice(0,v.ch).replace("`",""),_=E.text.slice(v.ch).replace("`","");d.replaceRange(Z+_,{line:v.line,ch:0},{line:v.line,ch:99999999999999}),v.ch--,v!==g&&g.ch--,d.setSelection(v,g),d.focus()}else if(N==="fenced")if(v.line!==g.line||v.ch!==g.ch){for(M=v.line;M>=0&&(E=d.getLineHandle(M),!c(E));M--);var j=d.getTokenAt({line:M,ch:1}),D=m(j).fencedChars,A,H,z,G;c(d.getLineHandle(v.line))?(A="",H=v.line):c(d.getLineHandle(v.line-1))?(A="",H=v.line-1):(A=D+`
36
- `,H=v.line),c(d.getLineHandle(g.line))?(z="",G=g.line,g.ch===0&&(G+=1)):g.ch!==0&&c(d.getLineHandle(g.line+1))?(z="",G=g.line+1):(z=D+`
37
- `,G=g.line+1),g.ch===0&&(G-=1),d.operation(function(){d.replaceRange(z,{line:G,ch:0},{line:G+(z?0:1),ch:0}),d.replaceRange(A,{line:H,ch:0},{line:H+(A?0:1),ch:0})}),d.setSelection({line:H+(A?1:0),ch:0},{line:G+(A?1:-1),ch:0}),d.focus()}else{var B=v.line;if(c(d.getLineHandle(v.line))&&(p(d,v.line+1)==="fenced"?(M=v.line,B=v.line+1):(O=v.line,B=v.line-1)),M===void 0)for(M=B;M>=0&&(E=d.getLineHandle(M),!c(E));M--);if(O===void 0)for(I=d.lineCount(),O=B;O<I&&(E=d.getLineHandle(O),!c(E));O++);d.operation(function(){d.replaceRange("",{line:M,ch:0},{line:M+1,ch:0}),d.replaceRange("",{line:O-1,ch:0},{line:O,ch:0})}),d.focus()}else if(N==="indented"){if(v.line!==g.line||v.ch!==g.ch)M=v.line,O=g.line,g.ch===0&&O--;else{for(M=v.line;M>=0;M--)if(E=d.getLineHandle(M),!E.text.match(/^\s*$/)&&p(d,M,E)!=="indented"){M+=1;break}for(I=d.lineCount(),O=v.line;O<I;O++)if(E=d.getLineHandle(O),!E.text.match(/^\s*$/)&&p(d,O,E)!=="indented"){O-=1;break}}var Q=d.getLineHandle(O+1),re=Q&&d.getTokenAt({line:O+1,ch:Q.text.length-1}),we=re&&m(re).indentedCode;we&&d.replaceRange(`
38
- `,{line:O+1,ch:0});for(var K=M;K<=O;K++)d.indentLine(K,"subtract");d.focus()}else{var fe=v.line===g.line&&v.ch===g.ch&&v.ch===0,ce=v.line!==g.line;fe||ce?S(d,v,g,x):lr(d,!1,["`","`"])}}function en(f){Aa(f.codemirror,"quote")}function hi(f){jt(f.codemirror,"smaller")}function tn(f){jt(f.codemirror,"bigger")}function rn(f){jt(f.codemirror,void 0,1)}function nn(f){jt(f.codemirror,void 0,2)}function an(f){jt(f.codemirror,void 0,3)}function Ma(f){jt(f.codemirror,void 0,4)}function Da(f){jt(f.codemirror,void 0,5)}function Fa(f){jt(f.codemirror,void 0,6)}function on(f){var x=f.codemirror,c="*";["-","+","*"].includes(f.options.unorderedListStyle)&&(c=f.options.unorderedListStyle),Aa(x,"unordered-list",c)}function ln(f){Aa(f.codemirror,"ordered-list")}function sn(f){Uf(f.codemirror)}function un(f){var x=f.options,c="https://";if(x.promptURLs){var m=prompt(x.promptTexts.link,c);if(!m)return!1;c=Vl(m)}es(f,"link",x.insertTexts.link,c)}function fn(f){var x=f.options,c="https://";if(x.promptURLs){var m=prompt(x.promptTexts.image,c);if(!m)return!1;c=Vl(m)}es(f,"image",x.insertTexts.image,c)}function Vl(f){return encodeURI(f).replace(/([\\()])/g,"\\$1")}function Ea(f){f.openBrowseFileWindow()}function $l(f,x){var c=f.codemirror,m=Gt(c),p=f.options,S=x.substr(x.lastIndexOf("/")+1),d=S.substring(S.lastIndexOf(".")+1).replace(/\?.*$/,"").toLowerCase();if(["png","jpg","jpeg","gif","svg","apng","avif","webp"].includes(d))lr(c,m.image,p.insertTexts.uploadedImage,x);else{var v=p.insertTexts.link;v[0]="["+S,lr(c,m.link,v,x)}f.updateStatusBar("upload-image",f.options.imageTexts.sbOnUploaded.replace("#image_name#",S)),setTimeout(function(){f.updateStatusBar("upload-image",f.options.imageTexts.sbInit)},1e3)}function cn(f){var x=f.codemirror,c=Gt(x),m=f.options;lr(x,c.table,m.insertTexts.table)}function hn(f){var x=f.codemirror,c=Gt(x),m=f.options;lr(x,c.image,m.insertTexts.horizontalRule)}function dn(f){var x=f.codemirror;x.undo(),x.focus()}function pn(f){var x=f.codemirror;x.redo(),x.focus()}function Ar(f){var x=f.codemirror,c=x.getWrapperElement(),m=c.nextSibling,p=f.toolbarElements&&f.toolbarElements["side-by-side"],S=!1,d=c.parentNode;m.classList.contains("editor-preview-active-side")?(f.options.sideBySideFullscreen===!1&&d.classList.remove("sided--no-fullscreen"),m.classList.remove("editor-preview-active-side"),p&&p.classList.remove("active"),c.classList.remove("CodeMirror-sided")):(setTimeout(function(){x.getOption("fullScreen")||(f.options.sideBySideFullscreen===!1?d.classList.add("sided--no-fullscreen"):or(f)),m.classList.add("editor-preview-active-side")},1),p&&p.classList.add("active"),c.classList.add("CodeMirror-sided"),S=!0);var v=c.lastChild;if(v.classList.contains("editor-preview-active")){v.classList.remove("editor-preview-active");var g=f.toolbarElements.preview,k=f.toolbar_div;g.classList.remove("active"),k.classList.remove("disabled-for-preview")}var E=function(){var M=f.options.previewRender(f.value(),m);M!=null&&(m.innerHTML=M)};if(x.sideBySideRenderingFunction||(x.sideBySideRenderingFunction=E),S){var N=f.options.previewRender(f.value(),m);N!=null&&(m.innerHTML=N),x.on("update",x.sideBySideRenderingFunction)}else x.off("update",x.sideBySideRenderingFunction);x.refresh()}function gn(f){var x=f.codemirror,c=x.getWrapperElement(),m=f.toolbar_div,p=f.options.toolbar?f.toolbarElements.preview:!1,S=c.lastChild,d=x.getWrapperElement().nextSibling;if(d.classList.contains("editor-preview-active-side")&&Ar(f),!S||!S.classList.contains("editor-preview-full")){if(S=document.createElement("div"),S.className="editor-preview-full",f.options.previewClass)if(Array.isArray(f.options.previewClass))for(var v=0;v<f.options.previewClass.length;v++)S.classList.add(f.options.previewClass[v]);else typeof f.options.previewClass=="string"&&S.classList.add(f.options.previewClass);c.appendChild(S)}S.classList.contains("editor-preview-active")?(S.classList.remove("editor-preview-active"),p&&(p.classList.remove("active"),m.classList.remove("disabled-for-preview"))):(setTimeout(function(){S.classList.add("editor-preview-active")},1),p&&(p.classList.add("active"),m.classList.add("disabled-for-preview")));var g=f.options.previewRender(f.value(),S);g!==null&&(S.innerHTML=g)}function lr(f,x,c,m){if(!f.getWrapperElement().lastChild.classList.contains("editor-preview-active")){var p,S=c[0],d=c[1],v={},g={};Object.assign(v,f.getCursor("start")),Object.assign(g,f.getCursor("end")),m&&(S=S.replace("#url#",m),d=d.replace("#url#",m)),x?(p=f.getLine(v.line),S=p.slice(0,v.ch),d=p.slice(v.ch),f.replaceRange(S+d,{line:v.line,ch:0})):(p=f.getSelection(),f.replaceSelection(S+p+d),v.ch+=S.length,v!==g&&(g.ch+=S.length)),f.setSelection(v,g),f.focus()}}function jt(f,x,c){if(!f.getWrapperElement().lastChild.classList.contains("editor-preview-active")){for(var m=f.getCursor("start"),p=f.getCursor("end"),S=m.line;S<=p.line;S++)(function(d){var v=f.getLine(d),g=v.search(/[^#]/);x!==void 0?g<=0?x=="bigger"?v="###### "+v:v="# "+v:g==6&&x=="smaller"?v=v.substr(7):g==1&&x=="bigger"?v=v.substr(2):x=="bigger"?v=v.substr(1):v="#"+v:g<=0?v="#".repeat(c)+" "+v:g==c?v=v.substr(g+1):v="#".repeat(c)+" "+v.substr(g+1),f.replaceRange(v,{line:d,ch:0},{line:d,ch:99999999999999})})(S);f.focus()}}function Aa(f,x,c){if(!f.getWrapperElement().lastChild.classList.contains("editor-preview-active")){for(var m=/^(\s*)(\*|-|\+|\d*\.)(\s+)/,p=/^\s*/,S=Gt(f),d=f.getCursor("start"),v=f.getCursor("end"),g={quote:/^(\s*)>\s+/,"unordered-list":m,"ordered-list":m},k=function(I,Z){var _={quote:">","unordered-list":c,"ordered-list":"%%i."};return _[I].replace("%%i",Z)},E=function(I,Z){var _={quote:">","unordered-list":"\\"+c,"ordered-list":"\\d+."},j=new RegExp(_[I]);return Z&&j.test(Z)},N=function(I,Z,_){var j=m.exec(Z),D=k(I,M);return j!==null?(E(I,j[2])&&(D=""),Z=j[1]+D+j[3]+Z.replace(p,"").replace(g[I],"$1")):_==!1&&(Z=D+" "+Z),Z},M=1,O=d.line;O<=v.line;O++)(function(I){var Z=f.getLine(I);S[x]?Z=Z.replace(g[x],"$1"):(x=="unordered-list"&&(Z=N("ordered-list",Z,!0)),Z=N(x,Z,!1),M+=1),f.replaceRange(Z,{line:I,ch:0},{line:I,ch:99999999999999})})(O);f.focus()}}function es(f,x,c,m){if(!(!f.codemirror||f.isPreviewActive())){var p=f.codemirror,S=Gt(p),d=S[x];if(!d){lr(p,d,c,m);return}var v=p.getCursor("start"),g=p.getCursor("end"),k=p.getLine(v.line),E=k.slice(0,v.ch),N=k.slice(v.ch);x=="link"?E=E.replace(/(.*)[^!]\[/,"$1"):x=="image"&&(E=E.replace(/(.*)!\[$/,"$1")),N=N.replace(/]\(.*?\)/,""),p.replaceRange(E+N,{line:v.line,ch:0},{line:v.line,ch:99999999999999}),v.ch-=c[0].length,v!==g&&(g.ch-=c[0].length),p.setSelection(v,g),p.focus()}}function Na(f,x,c,m){if(!(!f.codemirror||f.isPreviewActive())){m=typeof m>"u"?c:m;var p=f.codemirror,S=Gt(p),d,v=c,g=m,k=p.getCursor("start"),E=p.getCursor("end");S[x]?(d=p.getLine(k.line),v=d.slice(0,k.ch),g=d.slice(k.ch),x=="bold"?(v=v.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),g=g.replace(/(\*\*|__)/,"")):x=="italic"?(v=v.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),g=g.replace(/(\*|_)/,"")):x=="strikethrough"&&(v=v.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),g=g.replace(/(\*\*|~~)/,"")),p.replaceRange(v+g,{line:k.line,ch:0},{line:k.line,ch:99999999999999}),x=="bold"||x=="strikethrough"?(k.ch-=2,k!==E&&(E.ch-=2)):x=="italic"&&(k.ch-=1,k!==E&&(E.ch-=1))):(d=p.getSelection(),x=="bold"?(d=d.split("**").join(""),d=d.split("__").join("")):x=="italic"?(d=d.split("*").join(""),d=d.split("_").join("")):x=="strikethrough"&&(d=d.split("~~").join("")),p.replaceSelection(v+d+g),k.ch+=c.length,E.ch=k.ch+d.length),p.setSelection(k,E),p.focus()}}function Uf(f){if(!f.getWrapperElement().lastChild.classList.contains("editor-preview-active"))for(var x=f.getCursor("start"),c=f.getCursor("end"),m,p=x.line;p<=c.line;p++)m=f.getLine(p),m=m.replace(/^[ ]*([# ]+|\*|-|[> ]+|[0-9]+(.|\)))[ ]*/,""),f.replaceRange(m,{line:p,ch:0},{line:p,ch:99999999999999})}function Zi(f,x){if(Math.abs(f)<1024)return""+f+x[0];var c=0;do f/=1024,++c;while(Math.abs(f)>=1024&&c<x.length);return""+f.toFixed(1)+x[c]}function ts(f,x){for(var c in x)Object.prototype.hasOwnProperty.call(x,c)&&(x[c]instanceof Array?f[c]=x[c].concat(f[c]instanceof Array?f[c]:[]):x[c]!==null&&typeof x[c]=="object"&&x[c].constructor===Object?f[c]=ts(f[c]||{},x[c]):f[c]=x[c]);return f}function At(f){for(var x=1;x<arguments.length;x++)f=ts(f,arguments[x]);return f}function jl(f){var x=/[a-zA-Z0-9_\u00A0-\u02AF\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g,c=f.match(x),m=0;if(c===null)return m;for(var p=0;p<c.length;p++)c[p].charCodeAt(0)>=19968?m+=c[p].length:m+=1;return m}var Se={bold:"fa fa-bold",italic:"fa fa-italic",strikethrough:"fa fa-strikethrough",heading:"fa fa-header fa-heading","heading-smaller":"fa fa-header fa-heading header-smaller","heading-bigger":"fa fa-header fa-heading header-bigger","heading-1":"fa fa-header fa-heading header-1","heading-2":"fa fa-header fa-heading header-2","heading-3":"fa fa-header fa-heading header-3",code:"fa fa-code",quote:"fa fa-quote-left","ordered-list":"fa fa-list-ol","unordered-list":"fa fa-list-ul","clean-block":"fa fa-eraser",link:"fa fa-link",image:"fa fa-image","upload-image":"fa fa-image",table:"fa fa-table","horizontal-rule":"fa fa-minus",preview:"fa fa-eye","side-by-side":"fa fa-columns",fullscreen:"fa fa-arrows-alt",guide:"fa fa-question-circle",undo:"fa fa-undo",redo:"fa fa-repeat fa-redo"},ar={bold:{name:"bold",action:Ji,className:Se.bold,title:"Bold",default:!0},italic:{name:"italic",action:Qi,className:Se.italic,title:"Italic",default:!0},strikethrough:{name:"strikethrough",action:Vi,className:Se.strikethrough,title:"Strikethrough"},heading:{name:"heading",action:hi,className:Se.heading,title:"Heading",default:!0},"heading-smaller":{name:"heading-smaller",action:hi,className:Se["heading-smaller"],title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:tn,className:Se["heading-bigger"],title:"Bigger Heading"},"heading-1":{name:"heading-1",action:rn,className:Se["heading-1"],title:"Big Heading"},"heading-2":{name:"heading-2",action:nn,className:Se["heading-2"],title:"Medium Heading"},"heading-3":{name:"heading-3",action:an,className:Se["heading-3"],title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:$i,className:Se.code,title:"Code"},quote:{name:"quote",action:en,className:Se.quote,title:"Quote",default:!0},"unordered-list":{name:"unordered-list",action:on,className:Se["unordered-list"],title:"Generic List",default:!0},"ordered-list":{name:"ordered-list",action:ln,className:Se["ordered-list"],title:"Numbered List",default:!0},"clean-block":{name:"clean-block",action:sn,className:Se["clean-block"],title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:un,className:Se.link,title:"Create Link",default:!0},image:{name:"image",action:fn,className:Se.image,title:"Insert Image",default:!0},"upload-image":{name:"upload-image",action:Ea,className:Se["upload-image"],title:"Import an image"},table:{name:"table",action:cn,className:Se.table,title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:hn,className:Se["horizontal-rule"],title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:gn,className:Se.preview,noDisable:!0,title:"Toggle Preview",default:!0},"side-by-side":{name:"side-by-side",action:Ar,className:Se["side-by-side"],noDisable:!0,noMobile:!0,title:"Toggle Side by Side",default:!0},fullscreen:{name:"fullscreen",action:or,className:Se.fullscreen,noDisable:!0,noMobile:!0,title:"Toggle Fullscreen",default:!0},"separator-4":{name:"separator-4"},guide:{name:"guide",action:"https://www.markdownguide.org/basic-syntax/",className:Se.guide,noDisable:!0,title:"Markdown Guide",default:!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:dn,className:Se.undo,noDisable:!0,title:"Undo"},redo:{name:"redo",action:pn,className:Se.redo,noDisable:!0,title:"Redo"}},qf={link:["[","](#url#)"],image:["![","](#url#)"],uploadedImage:["![](#url#)",""],table:["",`
39
-
40
- | Column 1 | Column 2 | Column 3 |
41
- | -------- | -------- | -------- |
42
- | Text | Text | Text |
43
-
44
- `],horizontalRule:["",`
45
-
46
- -----
47
-
48
- `]},Gf={link:"URL for the link:",image:"URL of the image:"},jf={locale:"en-US",format:{hour:"2-digit",minute:"2-digit"}},Kf={bold:"**",code:"```",italic:"*"},Xf={sbInit:"Attach files by drag and dropping or pasting from clipboard.",sbOnDragEnter:"Drop image to upload it.",sbOnDrop:"Uploading image #images_names#...",sbProgress:"Uploading #file_name#: #progress#%",sbOnUploaded:"Uploaded #image_name#",sizeUnits:" B, KB, MB"},Yf={noFileGiven:"You must select a file.",typeNotAllowed:"This image type is not allowed.",fileTooLarge:`Image #image_name# is too big (#image_size#).
49
- Maximum file size is #image_max_size#.`,importError:"Something went wrong when uploading the image #image_name#."};function V(f){f=f||{},f.parent=this;var x=!0;if(f.autoDownloadFontAwesome===!1&&(x=!1),f.autoDownloadFontAwesome!==!0)for(var c=document.styleSheets,m=0;m<c.length;m++)c[m].href&&c[m].href.indexOf("//maxcdn.bootstrapcdn.com/font-awesome/")>-1&&(x=!1);if(x){var p=document.createElement("link");p.rel="stylesheet",p.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(p)}if(f.element)this.element=f.element;else if(f.element===null){console.log("EasyMDE: Error. No element was found.");return}if(f.toolbar===void 0){f.toolbar=[];for(var S in ar)Object.prototype.hasOwnProperty.call(ar,S)&&(S.indexOf("separator-")!=-1&&f.toolbar.push("|"),(ar[S].default===!0||f.showIcons&&f.showIcons.constructor===Array&&f.showIcons.indexOf(S)!=-1)&&f.toolbar.push(S))}if(Object.prototype.hasOwnProperty.call(f,"previewClass")||(f.previewClass="editor-preview"),Object.prototype.hasOwnProperty.call(f,"status")||(f.status=["autosave","lines","words","cursor"],f.uploadImage&&f.status.unshift("upload-image")),f.previewRender||(f.previewRender=function(v){return this.parent.markdown(v)}),f.parsingConfig=At({highlightFormatting:!0},f.parsingConfig||{}),f.insertTexts=At({},qf,f.insertTexts||{}),f.promptTexts=At({},Gf,f.promptTexts||{}),f.blockStyles=At({},Kf,f.blockStyles||{}),f.autosave!=null&&(f.autosave.timeFormat=At({},jf,f.autosave.timeFormat||{})),f.iconClassMap=At({},Se,f.iconClassMap||{}),f.shortcuts=At({},If,f.shortcuts||{}),f.maxHeight=f.maxHeight||void 0,f.direction=f.direction||"ltr",typeof f.maxHeight<"u"?f.minHeight=f.maxHeight:f.minHeight=f.minHeight||"300px",f.errorCallback=f.errorCallback||function(v){alert(v)},f.uploadImage=f.uploadImage||!1,f.imageMaxSize=f.imageMaxSize||2097152,f.imageAccept=f.imageAccept||"image/png, image/jpeg, image/gif, image/avif",f.imageTexts=At({},Xf,f.imageTexts||{}),f.errorMessages=At({},Yf,f.errorMessages||{}),f.imagePathAbsolute=f.imagePathAbsolute||!1,f.imageCSRFName=f.imageCSRFName||"csrfmiddlewaretoken",f.imageCSRFHeader=f.imageCSRFHeader||!1,f.autosave!=null&&f.autosave.unique_id!=null&&f.autosave.unique_id!=""&&(f.autosave.uniqueId=f.autosave.unique_id),f.overlayMode&&f.overlayMode.combine===void 0&&(f.overlayMode.combine=!0),this.options=f,this.render(),f.initialValue&&(!this.options.autosave||this.options.autosave.foundSavedValue!==!0)&&this.value(f.initialValue),f.uploadImage){var d=this;this.codemirror.on("dragenter",function(v,g){d.updateStatusBar("upload-image",d.options.imageTexts.sbOnDragEnter),g.stopPropagation(),g.preventDefault()}),this.codemirror.on("dragend",function(v,g){d.updateStatusBar("upload-image",d.options.imageTexts.sbInit),g.stopPropagation(),g.preventDefault()}),this.codemirror.on("dragleave",function(v,g){d.updateStatusBar("upload-image",d.options.imageTexts.sbInit),g.stopPropagation(),g.preventDefault()}),this.codemirror.on("dragover",function(v,g){d.updateStatusBar("upload-image",d.options.imageTexts.sbOnDragEnter),g.stopPropagation(),g.preventDefault()}),this.codemirror.on("drop",function(v,g){g.stopPropagation(),g.preventDefault(),f.imageUploadFunction?d.uploadImagesUsingCustomFunction(f.imageUploadFunction,g.dataTransfer.files):d.uploadImages(g.dataTransfer.files)}),this.codemirror.on("paste",function(v,g){f.imageUploadFunction?d.uploadImagesUsingCustomFunction(f.imageUploadFunction,g.clipboardData.files):d.uploadImages(g.clipboardData.files)})}}V.prototype.uploadImages=function(f,x,c){if(f.length!==0){for(var m=[],p=0;p<f.length;p++)m.push(f[p].name),this.uploadImage(f[p],x,c);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",m.join(", ")))}};V.prototype.uploadImagesUsingCustomFunction=function(f,x){if(x.length!==0){for(var c=[],m=0;m<x.length;m++)c.push(x[m].name),this.uploadImageUsingCustomFunction(f,x[m]);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",c.join(", ")))}};V.prototype.updateStatusBar=function(f,x){if(this.gui.statusbar){var c=this.gui.statusbar.getElementsByClassName(f);c.length===1?this.gui.statusbar.getElementsByClassName(f)[0].textContent=x:c.length===0?console.log("EasyMDE: status bar item "+f+" was not found."):console.log("EasyMDE: Several status bar items named "+f+" was found.")}};V.prototype.markdown=function(f){if(La){var x;if(this.options&&this.options.renderingConfig&&this.options.renderingConfig.markedOptions?x=this.options.renderingConfig.markedOptions:x={},this.options&&this.options.renderingConfig&&this.options.renderingConfig.singleLineBreaks===!1?x.breaks=!1:x.breaks=!0,this.options&&this.options.renderingConfig&&this.options.renderingConfig.codeSyntaxHighlighting===!0){var c=this.options.renderingConfig.hljs||window.hljs;c&&(x.highlight=function(p,S){return S&&c.getLanguage(S)?c.highlight(S,p).value:c.highlightAuto(p).value})}La.setOptions(x);var m=La.parse(f);return this.options.renderingConfig&&typeof this.options.renderingConfig.sanitizerFunction=="function"&&(m=this.options.renderingConfig.sanitizerFunction.call(this,m)),m=Bf(m),m=Rf(m),m}};V.prototype.render=function(f){if(f||(f=this.element||document.getElementsByTagName("textarea")[0]),this._rendered&&this._rendered===f)return;this.element=f;var x=this.options,c=this,m={};for(var p in x.shortcuts)x.shortcuts[p]!==null&&ci[p]!==null&&function(_){m[Ql(x.shortcuts[_])]=function(){var j=ci[_];typeof j=="function"?j(c):typeof j=="string"&&window.open(j,"_blank")}}(p);m.Enter="newlineAndIndentContinueMarkdownList",m.Tab="tabAndIndentMarkdownList",m["Shift-Tab"]="shiftTabAndUnindentMarkdownList",m.Esc=function(_){_.getOption("fullScreen")&&or(c)},this.documentOnKeyDown=function(_){_=_||window.event,_.keyCode==27&&c.codemirror.getOption("fullScreen")&&or(c)},document.addEventListener("keydown",this.documentOnKeyDown,!1);var S,d;x.overlayMode?(Er.defineMode("overlay-mode",function(_){return Er.overlayMode(Er.getMode(_,x.spellChecker!==!1?"spell-checker":"gfm"),x.overlayMode.mode,x.overlayMode.combine)}),S="overlay-mode",d=x.parsingConfig,d.gitHubSpice=!1):(S=x.parsingConfig,S.name="gfm",S.gitHubSpice=!1),x.spellChecker!==!1&&(S="spell-checker",d=x.parsingConfig,d.name="gfm",d.gitHubSpice=!1,typeof x.spellChecker=="function"?x.spellChecker({codeMirrorInstance:Er}):Hf({codeMirrorInstance:Er}));function v(_,j,D){return{addNew:!1}}if(this.codemirror=Er.fromTextArea(f,{mode:S,backdrop:d,theme:x.theme!=null?x.theme:"easymde",tabSize:x.tabSize!=null?x.tabSize:2,indentUnit:x.tabSize!=null?x.tabSize:2,indentWithTabs:x.indentWithTabs!==!1,lineNumbers:x.lineNumbers===!0,autofocus:x.autofocus===!0,extraKeys:m,direction:x.direction,lineWrapping:x.lineWrapping!==!1,allowDropFileTypes:["text/plain"],placeholder:x.placeholder||f.getAttribute("placeholder")||"",styleSelectedText:x.styleSelectedText!=null?x.styleSelectedText:!Ta(),scrollbarStyle:x.scrollbarStyle!=null?x.scrollbarStyle:"native",configureMouse:v,inputStyle:x.inputStyle!=null?x.inputStyle:Ta()?"contenteditable":"textarea",spellcheck:x.nativeSpellcheck!=null?x.nativeSpellcheck:!0,autoRefresh:x.autoRefresh!=null?x.autoRefresh:!1}),this.codemirror.getScrollerElement().style.minHeight=x.minHeight,typeof x.maxHeight<"u"&&(this.codemirror.getScrollerElement().style.height=x.maxHeight),x.forceSync===!0){var g=this.codemirror;g.on("change",function(){g.save()})}this.gui={};var k=document.createElement("div");k.classList.add("EasyMDEContainer"),k.setAttribute("role","application");var E=this.codemirror.getWrapperElement();E.parentNode.insertBefore(k,E),k.appendChild(E),x.toolbar!==!1&&(this.gui.toolbar=this.createToolbar()),x.status!==!1&&(this.gui.statusbar=this.createStatusbar()),x.autosave!=null&&x.autosave.enabled===!0&&(this.autosave(),this.codemirror.on("change",function(){clearTimeout(c._autosave_timeout),c._autosave_timeout=setTimeout(function(){c.autosave()},c.options.autosave.submit_delay||c.options.autosave.delay||1e3)}));function N(_,j){var D,A=window.getComputedStyle(document.querySelector(".CodeMirror-sizer")).width.replace("px","");return _<A?D=j+"px":D=j/_*100+"%",D}var M=this;function O(_,j){_.setAttribute("data-img-src",j.url),_.setAttribute("style","--bg-image:url("+j.url+");--width:"+j.naturalWidth+"px;--height:"+N(j.naturalWidth,j.naturalHeight)),M.codemirror.setSize()}function I(){x.previewImagesInEditor&&k.querySelectorAll(".cm-image-marker").forEach(function(_){var j=_.parentElement;if(j.innerText.match(/^!\[.*?\]\(.*\)/g)&&!j.hasAttribute("data-img-src")){var D=j.innerText.match("\\((.*)\\)");if(window.EMDEimagesCache||(window.EMDEimagesCache={}),D&&D.length>=2){var A=D[1];if(x.imagesPreviewHandler){var H=x.imagesPreviewHandler(D[1]);typeof H=="string"&&(A=H)}if(window.EMDEimagesCache[A])O(j,window.EMDEimagesCache[A]);else{var z=document.createElement("img");z.onload=function(){window.EMDEimagesCache[A]={naturalWidth:z.naturalWidth,naturalHeight:z.naturalHeight,url:A},O(j,window.EMDEimagesCache[A])},z.src=A}}}})}this.codemirror.on("update",function(){I()}),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element,(x.autofocus===!0||f.autofocus)&&this.codemirror.focus();var Z=this.codemirror;setTimeout((function(){Z.refresh()}).bind(Z),0)};V.prototype.cleanup=function(){document.removeEventListener("keydown",this.documentOnKeyDown)};function rs(){if(typeof localStorage=="object")try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch{return!1}else return!1;return!0}V.prototype.autosave=function(){if(rs()){var f=this;if(this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to use the autosave feature");return}this.options.autosave.binded!==!0&&(f.element.form!=null&&f.element.form!=null&&f.element.form.addEventListener("submit",function(){clearTimeout(f.autosaveTimeoutId),f.autosaveTimeoutId=void 0,localStorage.removeItem("smde_"+f.options.autosave.uniqueId)}),this.options.autosave.binded=!0),this.options.autosave.loaded!==!0&&(typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)=="string"&&localStorage.getItem("smde_"+this.options.autosave.uniqueId)!=""&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0);var x=f.value();x!==""?localStorage.setItem("smde_"+this.options.autosave.uniqueId,x):localStorage.removeItem("smde_"+this.options.autosave.uniqueId);var c=document.getElementById("autosaved");if(c!=null&&c!=null&&c!=""){var m=new Date,p=new Intl.DateTimeFormat([this.options.autosave.timeFormat.locale,"en-US"],this.options.autosave.timeFormat.format).format(m),S=this.options.autosave.text==null?"Autosaved: ":this.options.autosave.text;c.innerHTML=S+p}}else console.log("EasyMDE: localStorage not available, cannot autosave")};V.prototype.clearAutosavedValue=function(){if(rs()){if(this.options.autosave==null||this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to clear the autosave value");return}localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("EasyMDE: localStorage not available, cannot autosave")};V.prototype.openBrowseFileWindow=function(f,x){var c=this,m=this.gui.toolbar.getElementsByClassName("imageInput")[0];m.click();function p(S){c.options.imageUploadFunction?c.uploadImagesUsingCustomFunction(c.options.imageUploadFunction,S.target.files):c.uploadImages(S.target.files,f,x),m.removeEventListener("change",p)}m.addEventListener("change",p)};V.prototype.uploadImage=function(f,x,c){var m=this;x=x||function(k){$l(m,k)};function p(g){m.updateStatusBar("upload-image",g),setTimeout(function(){m.updateStatusBar("upload-image",m.options.imageTexts.sbInit)},1e4),c&&typeof c=="function"&&c(g),m.options.errorCallback(g)}function S(g){var k=m.options.imageTexts.sizeUnits.split(",");return g.replace("#image_name#",f.name).replace("#image_size#",Zi(f.size,k)).replace("#image_max_size#",Zi(m.options.imageMaxSize,k))}if(f.size>this.options.imageMaxSize){p(S(this.options.errorMessages.fileTooLarge));return}var d=new FormData;d.append("image",f),m.options.imageCSRFToken&&!m.options.imageCSRFHeader&&d.append(m.options.imageCSRFName,m.options.imageCSRFToken);var v=new XMLHttpRequest;v.upload.onprogress=function(g){if(g.lengthComputable){var k=""+Math.round(g.loaded*100/g.total);m.updateStatusBar("upload-image",m.options.imageTexts.sbProgress.replace("#file_name#",f.name).replace("#progress#",k))}},v.open("POST",this.options.imageUploadEndpoint),m.options.imageCSRFToken&&m.options.imageCSRFHeader&&v.setRequestHeader(m.options.imageCSRFName,m.options.imageCSRFToken),v.onload=function(){try{var g=JSON.parse(this.responseText)}catch{console.error("EasyMDE: The server did not return a valid json."),p(S(m.options.errorMessages.importError));return}this.status===200&&g&&!g.error&&g.data&&g.data.filePath?x((m.options.imagePathAbsolute?"":window.location.origin+"/")+g.data.filePath):g.error&&g.error in m.options.errorMessages?p(S(m.options.errorMessages[g.error])):g.error?p(S(g.error)):(console.error("EasyMDE: Received an unexpected response after uploading the image."+this.status+" ("+this.statusText+")"),p(S(m.options.errorMessages.importError)))},v.onerror=function(g){console.error("EasyMDE: An unexpected error occurred when trying to upload the image."+g.target.status+" ("+g.target.statusText+")"),p(m.options.errorMessages.importError)},v.send(d)};V.prototype.uploadImageUsingCustomFunction=function(f,x){var c=this;function m(d){$l(c,d)}function p(d){var v=S(d);c.updateStatusBar("upload-image",v),setTimeout(function(){c.updateStatusBar("upload-image",c.options.imageTexts.sbInit)},1e4),c.options.errorCallback(v)}function S(d){var v=c.options.imageTexts.sizeUnits.split(",");return d.replace("#image_name#",x.name).replace("#image_size#",Zi(x.size,v)).replace("#image_max_size#",Zi(c.options.imageMaxSize,v))}f.apply(this,[x,m,p])};V.prototype.setPreviewMaxHeight=function(){var f=this.codemirror,x=f.getWrapperElement(),c=x.nextSibling,m=parseInt(window.getComputedStyle(x).paddingTop),p=parseInt(window.getComputedStyle(x).borderTopWidth),S=parseInt(this.options.maxHeight),d=S+m*2+p*2,v=d.toString()+"px";c.style.height=v};V.prototype.createSideBySide=function(){var f=this.codemirror,x=f.getWrapperElement(),c=x.nextSibling;if(!c||!c.classList.contains("editor-preview-side")){if(c=document.createElement("div"),c.className="editor-preview-side",this.options.previewClass)if(Array.isArray(this.options.previewClass))for(var m=0;m<this.options.previewClass.length;m++)c.classList.add(this.options.previewClass[m]);else typeof this.options.previewClass=="string"&&c.classList.add(this.options.previewClass);x.parentNode.insertBefore(c,x.nextSibling)}if(typeof this.options.maxHeight<"u"&&this.setPreviewMaxHeight(),this.options.syncSideBySidePreviewScroll===!1)return c;var p=!1,S=!1;return f.on("scroll",function(d){if(p){p=!1;return}S=!0;var v=d.getScrollInfo().height-d.getScrollInfo().clientHeight,g=parseFloat(d.getScrollInfo().top)/v,k=(c.scrollHeight-c.clientHeight)*g;c.scrollTop=k}),c.onscroll=function(){if(S){S=!1;return}p=!0;var d=c.scrollHeight-c.clientHeight,v=parseFloat(c.scrollTop)/d,g=(f.getScrollInfo().height-f.getScrollInfo().clientHeight)*v;f.scrollTo(0,g)},c};V.prototype.createToolbar=function(f){if(f=f||this.options.toolbar,!(!f||f.length===0)){var x;for(x=0;x<f.length;x++)ar[f[x]]!=null&&(f[x]=ar[f[x]]);var c=document.createElement("div");c.className="editor-toolbar",c.setAttribute("role","toolbar");var m=this,p={};for(m.toolbar=f,x=0;x<f.length;x++)if(!(f[x].name=="guide"&&m.options.toolbarGuideIcon===!1)&&!(m.options.hideIcons&&m.options.hideIcons.indexOf(f[x].name)!=-1)&&!((f[x].name=="fullscreen"||f[x].name=="side-by-side")&&Ta())){if(f[x]==="|"){for(var S=!1,d=x+1;d<f.length;d++)f[d]!=="|"&&(!m.options.hideIcons||m.options.hideIcons.indexOf(f[d].name)==-1)&&(S=!0);if(!S)continue}(function(k){var E;if(k==="|"?E=zf():k.children?E=Wf(k,m.options.toolbarTips,m.options.shortcuts,m):E=Yi(k,!0,m.options.toolbarTips,m.options.shortcuts,"button",m),p[k.name||k]=E,c.appendChild(E),k.name==="upload-image"){var N=document.createElement("input");N.className="imageInput",N.type="file",N.multiple=!0,N.name="image",N.accept=m.options.imageAccept,N.style.display="none",N.style.opacity=0,c.appendChild(N)}})(f[x])}m.toolbar_div=c,m.toolbarElements=p;var v=this.codemirror;v.on("cursorActivity",function(){var k=Gt(v);for(var E in p)(function(N){var M=p[N];k[N]?M.classList.add("active"):N!="fullscreen"&&N!="side-by-side"&&M.classList.remove("active")})(E)});var g=v.getWrapperElement();return g.parentNode.insertBefore(c,g),c}};V.prototype.createStatusbar=function(f){f=f||this.options.status;var x=this.options,c=this.codemirror;if(!(!f||f.length===0)){var m=[],p,S,d,v;for(p=0;p<f.length;p++)if(S=void 0,d=void 0,v=void 0,typeof f[p]=="object")m.push({className:f[p].className,defaultValue:f[p].defaultValue,onUpdate:f[p].onUpdate,onActivity:f[p].onActivity});else{var g=f[p];g==="words"?(v=function(O){O.innerHTML=jl(c.getValue())},S=function(O){O.innerHTML=jl(c.getValue())}):g==="lines"?(v=function(O){O.innerHTML=c.lineCount()},S=function(O){O.innerHTML=c.lineCount()}):g==="cursor"?(v=function(O){O.innerHTML="1:1"},d=function(O){var I=c.getCursor(),Z=I.line+1,_=I.ch+1;O.innerHTML=Z+":"+_}):g==="autosave"?v=function(O){x.autosave!=null&&x.autosave.enabled===!0&&O.setAttribute("id","autosaved")}:g==="upload-image"&&(v=function(O){O.innerHTML=x.imageTexts.sbInit}),m.push({className:g,defaultValue:v,onUpdate:S,onActivity:d})}var k=document.createElement("div");for(k.className="editor-statusbar",p=0;p<m.length;p++){var E=m[p],N=document.createElement("span");N.className=E.className,typeof E.defaultValue=="function"&&E.defaultValue(N),typeof E.onUpdate=="function"&&this.codemirror.on("update",function(O,I){return function(){I.onUpdate(O)}}(N,E)),typeof E.onActivity=="function"&&this.codemirror.on("cursorActivity",function(O,I){return function(){I.onActivity(O)}}(N,E)),k.appendChild(N)}var M=this.codemirror.getWrapperElement();return M.parentNode.insertBefore(k,M.nextSibling),k}};V.prototype.value=function(f){var x=this.codemirror;if(f===void 0)return x.getValue();if(x.getDoc().setValue(f),this.isPreviewActive()){var c=x.getWrapperElement(),m=c.lastChild,p=this.options.previewRender(f,m);p!==null&&(m.innerHTML=p)}return this};V.toggleBold=Ji;V.toggleItalic=Qi;V.toggleStrikethrough=Vi;V.toggleBlockquote=en;V.toggleHeadingSmaller=hi;V.toggleHeadingBigger=tn;V.toggleHeading1=rn;V.toggleHeading2=nn;V.toggleHeading3=an;V.toggleHeading4=Ma;V.toggleHeading5=Da;V.toggleHeading6=Fa;V.toggleCodeBlock=$i;V.toggleUnorderedList=on;V.toggleOrderedList=ln;V.cleanBlock=sn;V.drawLink=un;V.drawImage=fn;V.drawUploadedImage=Ea;V.drawTable=cn;V.drawHorizontalRule=hn;V.undo=dn;V.redo=pn;V.togglePreview=gn;V.toggleSideBySide=Ar;V.toggleFullScreen=or;V.prototype.toggleBold=function(){Ji(this)};V.prototype.toggleItalic=function(){Qi(this)};V.prototype.toggleStrikethrough=function(){Vi(this)};V.prototype.toggleBlockquote=function(){en(this)};V.prototype.toggleHeadingSmaller=function(){hi(this)};V.prototype.toggleHeadingBigger=function(){tn(this)};V.prototype.toggleHeading1=function(){rn(this)};V.prototype.toggleHeading2=function(){nn(this)};V.prototype.toggleHeading3=function(){an(this)};V.prototype.toggleHeading4=function(){Ma(this)};V.prototype.toggleHeading5=function(){Da(this)};V.prototype.toggleHeading6=function(){Fa(this)};V.prototype.toggleCodeBlock=function(){$i(this)};V.prototype.toggleUnorderedList=function(){on(this)};V.prototype.toggleOrderedList=function(){ln(this)};V.prototype.cleanBlock=function(){sn(this)};V.prototype.drawLink=function(){un(this)};V.prototype.drawImage=function(){fn(this)};V.prototype.drawUploadedImage=function(){Ea(this)};V.prototype.drawTable=function(){cn(this)};V.prototype.drawHorizontalRule=function(){hn(this)};V.prototype.undo=function(){dn(this)};V.prototype.redo=function(){pn(this)};V.prototype.togglePreview=function(){gn(this)};V.prototype.toggleSideBySide=function(){Ar(this)};V.prototype.toggleFullScreen=function(){or(this)};V.prototype.isPreviewActive=function(){var f=this.codemirror,x=f.getWrapperElement(),c=x.lastChild;return c.classList.contains("editor-preview-active")};V.prototype.isSideBySideActive=function(){var f=this.codemirror,x=f.getWrapperElement(),c=x.nextSibling;return c.classList.contains("editor-preview-active-side")};V.prototype.isFullscreenActive=function(){var f=this.codemirror;return f.getOption("fullScreen")};V.prototype.getState=function(){var f=this.codemirror;return Gt(f)};V.prototype.toTextArea=function(){var f=this.codemirror,x=f.getWrapperElement(),c=x.parentNode;c&&(this.gui.toolbar&&c.removeChild(this.gui.toolbar),this.gui.statusbar&&c.removeChild(this.gui.statusbar),this.gui.sideBySide&&c.removeChild(this.gui.sideBySide)),c.parentNode.insertBefore(x,c),c.remove(),f.toTextArea(),this.autosaveTimeoutId&&(clearTimeout(this.autosaveTimeoutId),this.autosaveTimeoutId=void 0,this.clearAutosavedValue())};var Zf=V;const Jf=mf(Zf),$f=Object.freeze(Object.defineProperty({__proto__:null,default:Jf},Symbol.toStringTag,{value:"Module"}));export{$f as e};