@data-fair/app-calendar 1.2.13 → 1.3.0

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.
@@ -0,0 +1,95 @@
1
+ import{i as e,t}from"./rolldown-runtime-C0FnF6B9.js";var n=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n||=self,n.CodeMirror=r())})(e,(function(){var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),a=/Edge\/(\d+)/.exec(e),o=r||i||a,s=o&&(r?document.documentMode||6:+(a||i)[1]),c=!a&&/WebKit\//.test(e),l=c&&/Qt\/\d+\.\d+/.test(e),u=!a&&/Chrome\/(\d+)/.exec(e),d=u&&+u[1],f=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),m=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),g=p&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),_=/Android/.test(e),v=g||_||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),S=f&&e.match(/Version\/(\d*\.\d*)/);S&&=Number(S[1]),S&&S>=15&&(f=!1,c=!0);var C=y&&(l||f&&(S==null||S<12.11)),w=n||o&&s>=9;function T(e){return RegExp(`(^|\\s)`+e+`(?:$|\\s)\\s*`)}var E=function(e,t){var n=e.className,r=T(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:``)}};function D(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function O(e,t){return D(e).appendChild(t)}function k(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t==`string`)i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)i.appendChild(t[a]);return i}function A(e,t,n,r){var i=k(e,t,n,r);return i.setAttribute(`role`,`presentation`),i}var j=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd(`character`,n),r.moveStart(`character`,t),r};function M(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 ee(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch{n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function te(e,t){var n=e.className;T(t).test(n)||(e.className+=(n?` `:``)+t)}function N(e,t){for(var n=e.split(` `),r=0;r<n.length;r++)n[r]&&!T(n[r]).test(t)&&(t+=` `+n[r]);return t}var ne=function(e){e.select()};g?ne=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:o&&(ne=function(e){try{e.select()}catch{}});function P(e){return e.display.wrapper.ownerDocument}function re(e){return F(e.display.wrapper)}function F(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function I(e){return P(e).defaultView}function ie(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function L(e,t,n){for(var r in t||={},e)Object.prototype.hasOwnProperty.call(e,r)&&(n!==!1||!Object.prototype.hasOwnProperty.call(t,r))&&(t[r]=e[r]);return t}function R(e,t,n,r,i){t??(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var a=r||0,o=i||0;;){var s=e.indexOf(` `,a);if(s<0||s>=t)return o+(t-a);o+=s-a,o+=n-o%n,a=s+1}}var ae=function(){this.id=null,this.f=null,this.time=0,this.handler=ie(this.onTimeout,this)};ae.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ae.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function z(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var oe=50,se={toString:function(){return`CodeMirror.Pass`}},ce={scroll:!1},le={origin:`*mouse`},ue={origin:`+move`};function B(e,t,n){for(var r=0,i=0;;){var a=e.indexOf(` `,r);a==-1&&(a=e.length);var o=a-r;if(a==e.length||i+o>=t)return r+Math.min(o,t-i);if(i+=a-r,i+=n-i%n,r=a+1,i>=t)return r}}var de=[``];function fe(e){for(;de.length<=e;)de.push(V(de)+` `);return de[e]}function V(e){return e[e.length-1]}function pe(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function me(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function he(){}function ge(e,t){var n;return Object.create?n=Object.create(e):(he.prototype=e,n=new he),t&&L(t,n),n}var _e=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ve(e){return/\w/.test(e)||e>`€`&&(e.toUpperCase()!=e.toLowerCase()||_e.test(e))}function ye(e,t){return t?t.source.indexOf(`\\w`)>-1&&ve(e)?!0:t.test(e):ve(e)}function be(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var xe=/[\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 Se(e){return e.charCodeAt(0)>=768&&xe.test(e)}function Ce(e,t,n){for(;(n<0?t>0:t<e.length)&&Se(e.charAt(t));)t+=n;return t}function we(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,a=r<0?Math.ceil(i):Math.floor(i);if(a==t)return e(a)?t:n;e(a)?n=a:t=a+r}}function Te(e,t,n,r){if(!e)return r(t,n,`ltr`,0);for(var i=!1,a=0;a<e.length;++a){var o=e[a];(o.from<n&&o.to>t||t==n&&o.to==t)&&(r(Math.max(o.from,t),Math.min(o.to,n),o.level==1?`rtl`:`ltr`,a),i=!0)}i||r(t,n,`ltr`)}var Ee=null;function De(e,t,n){var r;Ee=null;for(var i=0;i<e.length;++i){var a=e[i];if(a.from<t&&a.to>t)return i;a.to==t&&(a.from!=a.to&&n==`before`?r=i:Ee=i),a.from==t&&(a.from!=a.to&&n!=`before`?r=i:Ee=i)}return r??Ee}var Oe=(function(){function e(e){return e<=247?`bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN`.charAt(e):1424<=e&&e<=1524?`R`:1536<=e&&e<=1785?`nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111`.charAt(e-1536):1774<=e&&e<=2220?`r`:8192<=e&&e<=8203?`w`:e==8204?`b`:`L`}var t=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,r=/[LRr]/,i=/[Lb1n]/,a=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(s,c){var l=c==`ltr`?`L`:`R`;if(s.length==0||c==`ltr`&&!t.test(s))return!1;for(var u=s.length,d=[],f=0;f<u;++f)d.push(e(s.charCodeAt(f)));for(var p=0,m=l;p<u;++p){var h=d[p];h==`m`?d[p]=m:m=h}for(var g=0,_=l;g<u;++g){var v=d[g];v==`1`&&_==`r`?d[g]=`n`:r.test(v)&&(_=v,v==`r`&&(d[g]=`R`))}for(var y=1,b=d[0];y<u-1;++y){var x=d[y];x==`+`&&b==`1`&&d[y+1]==`1`?d[y]=`1`:x==`,`&&b==d[y+1]&&(b==`1`||b==`n`)&&(d[y]=b),b=x}for(var S=0;S<u;++S){var C=d[S];if(C==`,`)d[S]=`N`;else if(C==`%`){var w=void 0;for(w=S+1;w<u&&d[w]==`%`;++w);for(var T=S&&d[S-1]==`!`||w<u&&d[w]==`1`?`1`:`N`,E=S;E<w;++E)d[E]=T;S=w-1}}for(var D=0,O=l;D<u;++D){var k=d[D];O==`L`&&k==`1`?d[D]=`L`:r.test(k)&&(O=k)}for(var A=0;A<u;++A)if(n.test(d[A])){var j=void 0;for(j=A+1;j<u&&n.test(d[j]);++j);for(var M=(A?d[A-1]:l)==`L`,ee=M==((j<u?d[j]:l)==`L`)?M?`L`:`R`:l,te=A;te<j;++te)d[te]=ee;A=j-1}for(var N=[],ne,P=0;P<u;)if(i.test(d[P])){var re=P;for(++P;P<u&&i.test(d[P]);++P);N.push(new o(0,re,P))}else{var F=P,I=N.length,ie=+(c==`rtl`);for(++P;P<u&&d[P]!=`L`;++P);for(var L=F;L<P;)if(a.test(d[L])){F<L&&(N.splice(I,0,new o(1,F,L)),I+=ie);var R=L;for(++L;L<P&&a.test(d[L]);++L);N.splice(I,0,new o(2,R,L)),I+=ie,F=L}else++L;F<P&&N.splice(I,0,new o(1,F,P))}return c==`ltr`&&(N[0].level==1&&(ne=s.match(/^\s+/))&&(N[0].from=ne[0].length,N.unshift(new o(0,0,ne[0].length))),V(N).level==1&&(ne=s.match(/\s+$/))&&(V(N).to-=ne[0].length,N.push(new o(0,u-ne[0].length,u)))),c==`rtl`?N.reverse():N}})();function ke(e,t){var n=e.order;return n??=e.order=Oe(e.text,t),n}var Ae=[],H=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent(`on`+t,n);else{var r=e._handlers||={};r[t]=(r[t]||Ae).concat(n)}};function je(e,t){return e._handlers&&e._handlers[t]||Ae}function Me(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent(`on`+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var a=z(i,n);a>-1&&(r[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function U(e,t){var n=je(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Ne(e,t,n){return typeof t==`string`&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),U(e,n||t.type,e,t),Re(t)||t.codemirrorIgnore}function Pe(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)z(n,t[r])==-1&&n.push(t[r])}function Fe(e,t){return je(e,t).length>0}function Ie(e){e.prototype.on=function(e,t){H(this,e,t)},e.prototype.off=function(e,t){Me(this,e,t)}}function W(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Le(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Re(e){return e.defaultPrevented==null?e.returnValue==0:e.defaultPrevented}function ze(e){W(e),Le(e)}function Be(e){return e.target||e.srcElement}function Ve(e){var t=e.which;return t??(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),y&&e.ctrlKey&&t==1&&(t=3),t}var He=function(){if(o&&s<9)return!1;var e=k(`div`);return`draggable`in e||`dragDrop`in e}(),Ue;function We(e){if(Ue==null){var t=k(`span`,`​`);O(e,k(`span`,[t,document.createTextNode(`x`)])),e.firstChild.offsetHeight!=0&&(Ue=t.offsetWidth<=1&&t.offsetHeight>2&&!(o&&s<8))}var n=Ue?k(`span`,`​`):k(`span`,`\xA0`,null,`display: inline-block; width: 1px; margin-right: -1px`);return n.setAttribute(`cm-text`,``),n}var Ge;function Ke(e){if(Ge!=null)return Ge;var t=O(e,document.createTextNode(`AخA`)),n=j(t,0,1).getBoundingClientRect(),r=j(t,1,2).getBoundingClientRect();return D(e),!n||n.left==n.right?!1:Ge=r.right-n.right<3}var qe=`
2
+
3
+ b`.split(/\n/).length==3?function(e){return e.split(/\r\n?|\n/)}:function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
4
+ `,t);i==-1&&(i=e.length);var a=e.slice(t,e.charAt(i-1)==`\r`?i-1:i),o=a.indexOf(`\r`);o==-1?(n.push(a),t=i+1):(n.push(a.slice(0,o)),t+=o+1)}return n},Je=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},Ye=(function(){var e=k(`div`);return`oncopy`in e||(e.setAttribute(`oncopy`,`return;`),typeof e.oncopy==`function`)})(),Xe=null;function Ze(e){if(Xe!=null)return Xe;var t=O(e,k(`span`,`x`)),n=t.getBoundingClientRect(),r=j(t,0,1).getBoundingClientRect();return Xe=Math.abs(n.left-r.left)>1}var Qe={},$e={};function et(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Qe[e]=t}function tt(e,t){$e[e]=t}function nt(e){if(typeof e==`string`&&$e.hasOwnProperty(e))e=$e[e];else if(e&&typeof e.name==`string`&&$e.hasOwnProperty(e.name)){var t=$e[e.name];typeof t==`string`&&(t={name:t}),e=ge(t,e),e.name=t.name}else if(typeof e==`string`&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return nt(`application/xml`);else if(typeof e==`string`&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return nt(`application/json`);return typeof e==`string`?{name:e}:e||{name:`null`}}function rt(e,t){t=nt(t);var n=Qe[t.name];if(!n)return rt(e,`text/plain`);var r=n(e,t);if(it.hasOwnProperty(t.name)){var i=it[t.name];for(var a in i)i.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r[`_`+a]=r[a]),r[a]=i[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 it={};function at(e,t){L(t,it.hasOwnProperty(e)?it[e]:it[e]={})}function ot(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function st(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function ct(e,t,n){return!e.startState||e.startState(t,n)}var lt=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};lt.prototype.eol=function(){return this.pos>=this.string.length},lt.prototype.sol=function(){return this.pos==this.lineStart},lt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},lt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},lt.prototype.eat=function(e){var t=this.string.charAt(this.pos);if(typeof e==`string`?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},lt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},lt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},lt.prototype.skipToEnd=function(){this.pos=this.string.length},lt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},lt.prototype.backUp=function(e){this.pos-=e},lt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=R(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?R(this.string,this.lineStart,this.tabSize):0)},lt.prototype.indentation=function(){return R(this.string,null,this.tabSize)-(this.lineStart?R(this.string,this.lineStart,this.tabSize):0)},lt.prototype.match=function(e,t,n){if(typeof e==`string`){var r=function(e){return n?e.toLowerCase():e};if(r(this.string.substr(this.pos,e.length))==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&t!==!1&&(this.pos+=i[0].length),i)}},lt.prototype.current=function(){return this.string.slice(this.start,this.pos)},lt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},lt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},lt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function G(e,t){if(t-=e.first,t<0||t>=e.size)throw Error(`There is no line `+(t+e.first)+` in the document.`);for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],a=i.chunkSize();if(t<a){n=i;break}t-=a}return n.lines[t]}function ut(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var a=e.text;i==n.line&&(a=a.slice(0,n.ch)),i==t.line&&(a=a.slice(t.ch)),r.push(a),++i}),r}function dt(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function ft(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function K(e){if(e.parent==null)return null;for(var t=e.parent,n=z(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function pt(e,t){var n=e.first;outer:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],a=i.height;if(t<a){e=i;continue outer}t-=a,n+=i.chunkSize()}return n}while(!e.lines);for(var o=0;o<e.lines.length;++o){var s=e.lines[o].height;if(t<s)break;t-=s}return n+o}function mt(e,t){return t>=e.first&&t<e.first+e.size}function ht(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function q(e,t,n){if(n===void 0&&(n=null),!(this instanceof q))return new q(e,t,n);this.line=e,this.ch=t,this.sticky=n}function J(e,t){return e.line-t.line||e.ch-t.ch}function gt(e,t){return e.sticky==t.sticky&&J(e,t)==0}function _t(e){return q(e.line,e.ch)}function vt(e,t){return J(e,t)<0?t:e}function yt(e,t){return J(e,t)<0?e:t}function bt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Y(e,t){if(t.line<e.first)return q(e.first,0);var n=e.first+e.size-1;return t.line>n?q(n,G(e,n).text.length):xt(t,G(e,t.line).text.length)}function xt(e,t){var n=e.ch;return n==null||n>t?q(e.line,t):n<0?q(e.line,0):e}function St(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=Y(e,t[r]);return n}var Ct=function(e,t){this.state=e,this.lookAhead=t},wt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};wt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},wt.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}},wt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},wt.fromSaved=function(e,t,n){return t instanceof Ct?new wt(e,ot(e.mode,t.state),n,t.lookAhead):new wt(e,ot(e.mode,t),n)},wt.prototype.save=function(e){var t=e===!1?this.state:ot(this.doc.mode,this.state);return this.maxLookAhead>0?new Ct(t,this.maxLookAhead):t};function Tt(e,t,n,r){var i=[e.state.modeGen],a={};Pt(e,t.text,e.doc.mode,n,function(e,t){return i.push(e,t)},a,r);for(var o=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],c=1,l=0;n.state=!0,Pt(e,t.text,s.mode,n,function(e,t){for(var n=c;l<e;){var r=i[c];r>e&&i.splice(c,1,e,i[c+1],r),c+=2,l=Math.min(e,r)}if(t){if(s.opaque)i.splice(n,c-n,e,`overlay `+t),c=n+2;else for(;n<c;n+=2){var a=i[n+1];i[n+1]=(a?a+` `:``)+`overlay `+t}}},a),n.state=o,n.baseTokens=null,n.baseTokenPos=1},c=0;c<e.state.overlays.length;++c)s(c);return{styles:i,classes:a.bgClass||a.textClass?a:null}}function Et(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Dt(e,K(t)),i=t.text.length>e.options.maxHighlightLength&&ot(e.doc.mode,r.state),a=Tt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&=null,n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Dt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new wt(r,!0,t);var a=Ft(e,t,n),o=a>r.first&&G(r,a-1).stateAfter,s=o?wt.fromSaved(r,o,a):new wt(r,ct(r.mode),a);return r.iter(a,t,function(n){Ot(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()}),n&&(r.modeFrontier=s.line),s}function Ot(e,t,n,r){var i=e.doc.mode,a=new lt(t,e.options.tabSize,n);for(a.start=a.pos=r||0,t==``&&kt(i,n.state);!a.eol();)At(i,a,n.state),a.start=a.pos}function kt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=st(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function At(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=st(e,n).mode);var a=e.token(t,n);if(t.pos>t.start)return a}throw Error(`Mode `+e.name+` failed to advance stream.`)}var jt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Mt(e,t,n,r){var i=e.doc,a=i.mode,o;t=Y(i,t);var s=G(i,t.line),c=Dt(e,t.line,n),l=new lt(s.text,e.options.tabSize,c),u;for(r&&(u=[]);(r||l.pos<t.ch)&&!l.eol();)l.start=l.pos,o=At(a,l,c.state),r&&u.push(new jt(l,o,ot(i.mode,c.state)));return r?u:new jt(l,o,c.state)}function Nt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?`bgClass`:`textClass`;t[r]==null?t[r]=n[2]:RegExp(`(?:^|\\s)`+n[2]+`(?:$|\\s)`).test(t[r])||(t[r]+=` `+n[2])}return e}function Pt(e,t,n,r,i,a,o){var s=n.flattenSpans;s??=e.options.flattenSpans;var c=0,l=null,u=new lt(t,e.options.tabSize,r),d,f=e.options.addModeClass&&[null];for(t==``&&Nt(kt(n,r.state),a);!u.eol();){if(u.pos>e.options.maxHighlightLength?(s=!1,o&&Ot(e,t,r,u.pos),u.pos=t.length,d=null):d=Nt(At(n,u,r.state,f),a),f){var p=f[0].name;p&&(d=`m-`+(d?p+` `+d:p))}if(!s||l!=d){for(;c<u.start;)c=Math.min(u.start,c+5e3),i(c,l);l=d}u.start=u.pos}for(;c<u.pos;){var m=Math.min(u.pos,c+5e3);i(m,l),c=m}}function Ft(e,t,n){for(var r,i,a=e.doc,o=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>o;--s){if(s<=a.first)return a.first;var c=G(a,s-1),l=c.stateAfter;if(l&&(!n||s+(l instanceof Ct?l.lookAhead:0)<=a.modeFrontier))return s;var u=R(c.text,null,e.options.tabSize);(i==null||r>u)&&(i=s-1,r=u)}return i}function It(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=G(e,r).stateAfter;if(i&&(!(i instanceof Ct)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var Lt=!1,Rt=!1;function zt(){Lt=!0}function Bt(){Rt=!0}function Vt(e,t,n){this.marker=e,this.from=t,this.to=n}function Ht(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Ut(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||=[]).push(e[r]);return n}function Wt(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||=new WeakSet);r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function Gt(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker;if(a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t)||a.from==t&&o.type==`bookmark`&&(!n||!a.marker.insertLeft)){var s=a.to==null||(o.inclusiveRight?a.to>=t:a.to>t);(r||=[]).push(new Vt(o,a.from,s?null:a.to))}}return r}function Kt(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker;if(a.to==null||(o.inclusiveRight?a.to>=t:a.to>t)||a.from==t&&o.type==`bookmark`&&(!n||a.marker.insertLeft)){var s=a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t);(r||=[]).push(new Vt(o,s?null:a.from-t,a.to==null?null:a.to-t))}}return r}function qt(e,t){if(t.full)return null;var n=mt(e,t.from.line)&&G(e,t.from.line).markedSpans,r=mt(e,t.to.line)&&G(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,a=t.to.ch,o=J(t.from,t.to)==0,s=Gt(n,i,o),c=Kt(r,a,o),l=t.text.length==1,u=V(t.text).length+(l?i:0);if(s)for(var d=0;d<s.length;++d){var f=s[d];if(f.to==null){var p=Ht(c,f.marker);p?l&&(f.to=p.to==null?null:p.to+u):f.to=i}}if(c)for(var m=0;m<c.length;++m){var h=c[m];h.to!=null&&(h.to+=u),h.from==null?Ht(s,h.marker)||(h.from=u,l&&(s||=[]).push(h)):(h.from+=u,l&&(s||=[]).push(h))}s&&=Jt(s),c&&c!=s&&(c=Jt(c));var g=[s];if(!l){var _=t.text.length-2,v;if(_>0&&s)for(var y=0;y<s.length;++y)s[y].to??(v||=[]).push(new Vt(s[y].marker,null,null));for(var b=0;b<_;++b)g.push(v);g.push(c)}return g}function Jt(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Yt(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;n.readOnly&&(!r||z(r,n)==-1)&&(r||=[]).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],a=0;a<r.length;++a)for(var o=r[a],s=o.find(0),c=0;c<i.length;++c){var l=i[c];if(!(J(l.to,s.from)<0||J(l.from,s.to)>0)){var u=[c,1],d=J(l.from,s.from),f=J(l.to,s.to);(d<0||!o.inclusiveLeft&&!d)&&u.push({from:l.from,to:s.from}),(f>0||!o.inclusiveRight&&!f)&&u.push({from:s.to,to:l.to}),i.splice.apply(i,u),c+=u.length-3}}return i}function Xt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Zt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Qt(e){return e.inclusiveLeft?-1:0}function $t(e){return+!!e.inclusiveRight}function en(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),a=J(r.from,i.from)||Qt(e)-Qt(t);return a?-a:J(r.to,i.to)||$t(e)-$t(t)||t.id-e.id}function tn(e,t){var n=Rt&&e.markedSpans,r;if(n)for(var i=void 0,a=0;a<n.length;++a)i=n[a],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||en(r,i.marker)<0)&&(r=i.marker);return r}function nn(e){return tn(e,!0)}function rn(e){return tn(e,!1)}function an(e,t){var n=Rt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var a=n[i];a.marker.collapsed&&(a.from==null||a.from<t)&&(a.to==null||a.to>t)&&(!r||en(r,a.marker)<0)&&(r=a.marker)}return r}function on(e,t,n,r,i){var a=G(e,t),o=Rt&&a.markedSpans;if(o)for(var s=0;s<o.length;++s){var c=o[s];if(c.marker.collapsed){var l=c.marker.find(0),u=J(l.from,n)||Qt(c.marker)-Qt(i),d=J(l.to,r)||$t(c.marker)-$t(i);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(c.marker.inclusiveRight&&i.inclusiveLeft?J(l.to,n)>=0:J(l.to,n)>0)||u>=0&&(c.marker.inclusiveRight&&i.inclusiveLeft?J(l.from,r)<=0:J(l.from,r)<0)))return!0}}}function sn(e){for(var t;t=nn(e);)e=t.find(-1,!0).line;return e}function cn(e){for(var t;t=rn(e);)e=t.find(1,!0).line;return e}function ln(e){for(var t,n;t=rn(e);)e=t.find(1,!0).line,(n||=[]).push(e);return n}function un(e,t){var n=G(e,t),r=sn(n);return n==r?t:K(r)}function dn(e,t){if(t>e.lastLine())return t;var n=G(e,t),r;if(!fn(e,n))return t;for(;r=rn(n);)n=r.find(1,!0).line;return K(n)+1}function fn(e,t){var n=Rt&&t.markedSpans;if(n){for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed&&(r.from==null||!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&pn(e,t,r)))return!0}}function pn(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return pn(e,r.line,Ht(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,a=0;a<t.markedSpans.length;++a)if(i=t.markedSpans[a],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&pn(e,t,i))return!0}function mn(e){e=sn(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var a=n.parent;a;n=a,a=n.parent)for(var o=0;o<a.children.length;++o){var s=a.children[o];if(s==n)break;t+=s.height}return t}function hn(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=nn(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=rn(r);){var a=n.find(0,!0);t-=r.text.length-a.from.ch,r=a.to.line,t+=r.text.length-a.to.ch}return t}function gn(e){var t=e.display,n=e.doc;t.maxLine=G(n,n.first),t.maxLineLength=hn(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=hn(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}var _n=function(e,t,n){this.text=e,Zt(this,t),this.height=n?n(this):1};_n.prototype.lineNo=function(){return K(this)},Ie(_n);function vn(e,t,n,r){e.text=t,e.stateAfter&&=null,e.styles&&=null,e.order!=null&&(e.order=null),Xt(e),Zt(e,n);var i=r?r(e):1;i!=e.height&&ft(e,i)}function yn(e){e.parent=null,Xt(e)}var bn={},xn={};function Sn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?xn:bn;return n[e]||(n[e]=e.replace(/\S+/g,`cm-$&`))}function Cn(e,t){var n=A(`span`,null,null,c?`padding-right: .1px`:null),r={pre:A(`pre`,[n],`CodeMirror-line`),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption(`lineWrapping`)};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var a=i?t.rest[i-1]:t.line,o=void 0;r.pos=0,r.addToken=Tn,Ke(e.display.measure)&&(o=ke(a,e.doc.direction))&&(r.addToken=Dn(r.addToken,o)),r.map=[],kn(a,r,Et(e,a,t!=e.display.externalMeasured&&K(a))),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=N(a.styleClasses.bgClass,r.bgClass||``)),a.styleClasses.textClass&&(r.textClass=N(a.styleClasses.textClass,r.textClass||``))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(We(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(c){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 U(e,`renderLine`,e,t.line,r.pre),r.pre.className&&(r.textClass=N(r.pre.className,r.textClass||``)),r}function wn(e){var t=k(`span`,`•`,`cm-invalidchar`);return t.title=`\\u`+e.charCodeAt(0).toString(16),t.setAttribute(`aria-label`,t.title),t}function Tn(e,t,n,r,i,a,c){if(t){var l=e.splitSpaces?En(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1,f;if(!u.test(t))e.col+=t.length,f=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,f),o&&s<9&&(d=!0),e.pos+=t.length;else{f=document.createDocumentFragment();for(var p=0;;){u.lastIndex=p;var m=u.exec(t),h=m?m.index-p:t.length-p;if(h){var g=document.createTextNode(l.slice(p,p+h));o&&s<9?f.appendChild(k(`span`,[g])):f.appendChild(g),e.map.push(e.pos,e.pos+h,g),e.col+=h,e.pos+=h}if(!m)break;p+=h+1;var _=void 0;if(m[0]==` `){var v=e.cm.options.tabSize,y=v-e.col%v;_=f.appendChild(k(`span`,fe(y),`cm-tab`)),_.setAttribute(`role`,`presentation`),_.setAttribute(`cm-text`,` `),e.col+=y}else m[0]==`\r`||m[0]==`
5
+ `?(_=f.appendChild(k(`span`,m[0]==`\r`?`␍`:`␤`,`cm-invalidchar`)),_.setAttribute(`cm-text`,m[0]),e.col+=1):(_=e.cm.options.specialCharPlaceholder(m[0]),_.setAttribute(`cm-text`,m[0]),o&&s<9?f.appendChild(k(`span`,[_])):f.appendChild(_),e.col+=1);e.map.push(e.pos,e.pos+1,_),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||d||a||c){var b=n||``;r&&(b+=r),i&&(b+=i);var x=k(`span`,[f],b,a);if(c)for(var S in c)c.hasOwnProperty(S)&&S!=`style`&&S!=`class`&&x.setAttribute(S,c[S]);return e.content.appendChild(x)}e.content.appendChild(f)}}function En(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r=``,i=0;i<e.length;i++){var a=e.charAt(i);a==` `&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(a=`\xA0`),r+=a,n=a==` `}return r}function Dn(e,t){return function(n,r,i,a,o,s,c){i=i?i+` cm-force-border`:`cm-force-border`;for(var l=n.pos,u=l+r.length;;){for(var d=void 0,f=0;f<t.length&&(d=t[f],!(d.to>l&&d.from<=l));f++);if(d.to>=u)return e(n,r,i,a,o,s,c);e(n,r.slice(0,d.to-l),i,a,null,s,c),a=null,r=r.slice(d.to-l),l=d.to}}}function On(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||=e.content.appendChild(document.createElement(`span`)),i.setAttribute(`cm-marker`,n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function kn(e,t,n){var r=e.markedSpans,i=e.text,a=0;if(!r){for(var o=1;o<n.length;o+=2)t.addToken(t,i.slice(a,a=n[o]),Sn(n[o+1],t.cm.options));return}for(var s=i.length,c=0,l=1,u=``,d,f,p=0,m,h,g,_,v;;){if(p==c){m=h=g=f=``,v=null,_=null,p=1/0;for(var y=[],b=void 0,x=0;x<r.length;++x){var S=r[x],C=S.marker;if(C.type==`bookmark`&&S.from==c&&C.widgetNode)y.push(C);else if(S.from<=c&&(S.to==null||S.to>c||C.collapsed&&S.to==c&&S.from==c)){if(S.to!=null&&S.to!=c&&p>S.to&&(p=S.to,h=``),C.className&&(m+=` `+C.className),C.css&&(f=(f?f+`;`:``)+C.css),C.startStyle&&S.from==c&&(g+=` `+C.startStyle),C.endStyle&&S.to==p&&(b||=[]).push(C.endStyle,S.to),C.title&&((v||={}).title=C.title),C.attributes)for(var w in C.attributes)(v||={})[w]=C.attributes[w];C.collapsed&&(!_||en(_.marker,C)<0)&&(_=S)}else S.from>c&&p>S.from&&(p=S.from)}if(b)for(var T=0;T<b.length;T+=2)b[T+1]==p&&(h+=` `+b[T]);if(!_||_.from==c)for(var E=0;E<y.length;++E)On(t,0,y[E]);if(_&&(_.from||0)==c){if(On(t,(_.to==null?s+1:_.to)-c,_.marker,_.from==null),_.to==null)return;_.to==c&&(_=!1)}}if(c>=s)break;for(var D=Math.min(s,p);;){if(u){var O=c+u.length;if(!_){var k=O>D?u.slice(0,D-c):u;t.addToken(t,k,d?d+m:m,g,c+k.length==p?h:``,f,v)}if(O>=D){u=u.slice(D-c),c=D;break}c=O,g=``}u=i.slice(a,a=n[l++]),d=Sn(n[l++],t.cm.options)}}}function An(e,t,n){this.line=t,this.rest=ln(t),this.size=this.rest?K(V(this.rest))-n+1:1,this.node=this.text=null,this.hidden=fn(e,t)}function jn(e,t,n){for(var r=[],i,a=t;a<n;a=i){var o=new An(e.doc,G(e.doc,a),a);i=a+o.size,r.push(o)}return r}var Mn=null;function Nn(e){Mn?Mn.ops.push(e):e.ownsGroup=Mn={ops:[e],delayedCallbacks:[]}}function Pn(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function Fn(e,t){var n=e.ownsGroup;if(n)try{Pn(n)}finally{Mn=null,t(n)}}var In=null;function Ln(e,t){var n=je(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;Mn?i=Mn.delayedCallbacks:In?i=In:(i=In=[],setTimeout(Rn,0));for(var a=function(e){i.push(function(){return n[e].apply(null,r)})},o=0;o<n.length;++o)a(o)}}function Rn(){var e=In;In=null;for(var t=0;t<e.length;++t)e[t]()}function zn(e,t,n,r){for(var i=0;i<t.changes.length;i++){var a=t.changes[i];a==`text`?Un(e,t):a==`gutter`?Gn(e,t,n,r):a==`class`?Wn(e,t):a==`widget`&&Kn(e,t,r)}t.changes=null}function Bn(e){return e.node==e.text&&(e.node=k(`div`,null,null,`position: relative`),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),o&&s<8&&(e.node.style.zIndex=2)),e.node}function Vn(e,t){var n=t.bgClass?t.bgClass+` `+(t.line.bgClass||``):t.line.bgClass;if(n&&(n+=` CodeMirror-linebackground`),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=Bn(t);t.background=r.insertBefore(k(`div`,null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Hn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Cn(e,t)}function Un(e,t){var n=t.text.className,r=Hn(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)):n&&(t.text.className=n)}function Wn(e,t){Vn(e,t),t.line.wrapClass?Bn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className=``);var n=t.textClass?t.textClass+` `+(t.line.textClass||``):t.line.textClass;t.text.className=n||``}function Gn(e,t,n,r){if(t.gutter&&=(t.node.removeChild(t.gutter),null),t.gutterBackground&&=(t.node.removeChild(t.gutterBackground),null),t.line.gutterClass){var i=Bn(t);t.gutterBackground=k(`div`,null,`CodeMirror-gutter-background `+t.line.gutterClass,`left: `+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+`px; width: `+r.gutterTotalWidth+`px`),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var o=Bn(t),s=t.gutter=k(`div`,null,`CodeMirror-gutter-wrapper`,`left: `+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+`px`);if(s.setAttribute(`aria-hidden`,`true`),e.display.input.setUneditable(s),o.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=` `+t.line.gutterClass),e.options.lineNumbers&&(!a||!a[`CodeMirror-linenumbers`])&&(t.lineNumber=s.appendChild(k(`div`,ht(e.options,n),`CodeMirror-linenumber CodeMirror-gutter-elt`,`left: `+r.gutterLeft[`CodeMirror-linenumbers`]+`px; width: `+e.display.lineNumInnerWidth+`px`))),a)for(var c=0;c<e.display.gutterSpecs.length;++c){var l=e.display.gutterSpecs[c].className,u=a.hasOwnProperty(l)&&a[l];u&&s.appendChild(k(`div`,[u],`CodeMirror-gutter-elt`,`left: `+r.gutterLeft[l]+`px; width: `+r.gutterWidth[l]+`px`))}}}function Kn(e,t,n){t.alignable&&=null;for(var r=T(`CodeMirror-linewidget`),i=t.node.firstChild,a=void 0;i;i=a)a=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);Jn(e,t,n)}function qn(e,t,n,r){var i=Hn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Wn(e,t),Gn(e,t,n,r),Jn(e,t,r),t.node}function Jn(e,t,n){if(Yn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Yn(e,t.rest[r],t,n,!1)}function Yn(e,t,n,r,i){if(t.widgets)for(var a=Bn(n),o=0,s=t.widgets;o<s.length;++o){var c=s[o],l=k(`div`,[c.node],`CodeMirror-linewidget`+(c.className?` `+c.className:``));c.handleMouseEvents||l.setAttribute(`cm-ignore-events`,`true`),Xn(c,l,n,r),e.display.input.setUneditable(l),i&&c.above?a.insertBefore(l,n.gutter||n.text):a.appendChild(l),Ln(c,`redraw`)}}function Xn(e,t,n,r){if(e.noHScroll){(n.alignable||=[]).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+`px`,e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+`px`),t.style.width=i+`px`}e.coverGutter&&(t.style.zIndex=5,t.style.position=`relative`,e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+`px`))}function Zn(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!M(document.body,e.node)){var n=`position: relative;`;e.coverGutter&&(n+=`margin-left: -`+t.display.gutters.offsetWidth+`px;`),e.noHScroll&&(n+=`width: `+t.display.wrapper.clientWidth+`px;`),O(t.display.measure,k(`div`,[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Qn(e,t){for(var n=Be(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute(`cm-ignore-events`)==`true`||n.parentNode==e.sizer&&n!=e.mover)return!0}function $n(e){return e.lineSpace.offsetTop}function er(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function tr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=O(e.measure,k(`pre`,`x`,`CodeMirror-line-like`)),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function nr(e){return oe-e.display.nativeBarWidth}function rr(e){return e.display.scroller.clientWidth-nr(e)-e.display.barWidth}function ir(e){return e.display.scroller.clientHeight-nr(e)-e.display.barHeight}function ar(e,t,n){var r=e.options.lineWrapping,i=r&&rr(e);if(!t.measure.heights||r&&t.measure.width!=i){var a=t.measure.heights=[];if(r){t.measure.width=i;for(var o=t.text.firstChild.getClientRects(),s=0;s<o.length-1;s++){var c=o[s],l=o[s+1];Math.abs(c.bottom-l.bottom)>2&&a.push((c.bottom+l.top)/2-n.top)}}a.push(n.bottom-n.top)}}function or(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(K(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function sr(e,t){t=sn(t);var n=K(t),r=e.display.externalMeasured=new An(e.doc,t,n);r.lineN=n;var i=r.built=Cn(e,r);return r.text=i.pre,O(e.display.lineMeasure,i.pre),r}function cr(e,t,n,r){return dr(e,ur(e,t),n,r)}function lr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Wr(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function ur(e,t){var n=K(t),r=lr(e,n);r&&!r.text?r=null:r&&r.changes&&(zn(e,r,n,zr(e)),e.curOp.forceUpdate=!0),r||=sr(e,t);var i=or(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function dr(e,t,n,r,i){t.before&&(n=-1);var a=n+(r||``),o;return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||=t.view.text.getBoundingClientRect(),t.hasHeights||=(ar(e,t.view,t.rect),!0),o=hr(e,t,n,r),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var fr={left:0,right:0,top:0,bottom:0};function pr(e,t,n){for(var r,i,a,o,s,c,l=0;l<e.length;l+=3)if(s=e[l],c=e[l+1],t<s?(i=0,a=1,o=`left`):t<c?(i=t-s,a=i+1):(l==e.length-3||t==c&&e[l+3]>t)&&(a=c-s,i=a-1,t>=c&&(o=`right`)),i!=null){if(r=e[l+2],s==c&&n==(r.insertLeft?`left`:`right`)&&(o=n),n==`left`&&i==0)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)r=e[(l-=3)+2],o=`left`;if(n==`right`&&i==c-s)for(;l<e.length-3&&e[l+3]==e[l+4]&&!e[l+5].insertLeft;)r=e[(l+=3)+2],o=`right`;break}return{node:r,start:i,end:a,collapse:o,coverStart:s,coverEnd:c}}function mr(e,t){var n=fr;if(t==`left`)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function hr(e,t,n,r){var i=pr(t.map,n,r),a=i.node,c=i.start,l=i.end,u=i.collapse,d;if(a.nodeType==3){for(var f=0;f<4;f++){for(;c&&Se(t.line.text.charAt(i.coverStart+c));)--c;for(;i.coverStart+l<i.coverEnd&&Se(t.line.text.charAt(i.coverStart+l));)++l;if(d=o&&s<9&&c==0&&l==i.coverEnd-i.coverStart?a.parentNode.getBoundingClientRect():mr(j(a,c,l).getClientRects(),r),d.left||d.right||c==0)break;l=c,--c,u=`right`}o&&s<11&&(d=gr(e.display.measure,d))}else{c>0&&(u=r=`right`);var p;d=e.options.lineWrapping&&(p=a.getClientRects()).length>1?p[r==`right`?p.length-1:0]:a.getBoundingClientRect()}if(o&&s<9&&!c&&(!d||!d.left&&!d.right)){var m=a.parentNode.getClientRects()[0];d=m?{left:m.left,right:m.left+Rr(e.display),top:m.top,bottom:m.bottom}:fr}for(var h=d.top-t.rect.top,g=d.bottom-t.rect.top,_=(h+g)/2,v=t.view.measure.heights,y=0;y<v.length-1&&!(_<v[y]);y++);var b=y?v[y-1]:0,x=v[y],S={left:(u==`right`?d.right:d.left)-t.rect.left,right:(u==`left`?d.left:d.right)-t.rect.left,top:b,bottom:x};return!d.left&&!d.right&&(S.bogus=!0),e.options.singleCursorHeightPerLine||(S.rtop=h,S.rbottom=g),S}function gr(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ze(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function _r(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 vr(e){e.display.externalMeasure=null,D(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)_r(e.display.view[t])}function yr(e){vr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function br(e){return u&&_?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function xr(e){return u&&_?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function Sr(e){var t=sn(e).widgets,n=0;if(t)for(var r=0;r<t.length;++r)t[r].above&&(n+=Zn(t[r]));return n}function Cr(e,t,n,r,i){if(!i){var a=Sr(t);n.top+=a,n.bottom+=a}if(r==`line`)return n;r||=`local`;var o=mn(t);if(r==`local`?o+=$n(e.display):o-=e.display.viewOffset,r==`page`||r==`window`){var s=e.display.lineSpace.getBoundingClientRect();o+=s.top+(r==`window`?0:xr(P(e)));var c=s.left+(r==`window`?0:br(P(e)));n.left+=c,n.right+=c}return n.top+=o,n.bottom+=o,n}function wr(e,t,n){if(n==`div`)return t;var r=t.left,i=t.top;if(n==`page`)r-=br(P(e)),i-=xr(P(e));else if(n==`local`||!n){var a=e.display.sizer.getBoundingClientRect();r+=a.left,i+=a.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:r-o.left,top:i-o.top}}function Tr(e,t,n,r,i){return r||=G(e.doc,t.line),Cr(e,r,cr(e,r,t.ch,i),n)}function Er(e,t,n,r,i,a){r||=G(e.doc,t.line),i||=ur(e,r);function o(t,o){var s=dr(e,i,t,o?`right`:`left`,a);return o?s.left=s.right:s.right=s.left,Cr(e,r,s,n)}var s=ke(r,e.doc.direction),c=t.ch,l=t.sticky;if(c>=r.text.length?(c=r.text.length,l=`before`):c<=0&&(c=0,l=`after`),!s)return o(l==`before`?c-1:c,l==`before`);function u(e,t,n){var r=s[t].level==1;return o(n?e-1:e,r!=n)}var d=De(s,c,l),f=Ee,p=u(c,d,l==`before`);return f!=null&&(p.other=u(c,f,l!=`before`)),p}function Dr(e,t){var n=0;t=Y(e.doc,t),e.options.lineWrapping||(n=Rr(e.display)*t.ch);var r=G(e.doc,t.line),i=mn(r)+$n(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Or(e,t,n,r,i){var a=q(e,t,n);return a.xRel=i,r&&(a.outside=r),a}function kr(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Or(r.first,0,null,-1,-1);var i=pt(r,n),a=r.first+r.size-1;if(i>a)return Or(r.first+r.size-1,G(r,a).text.length,null,1,1);t<0&&(t=0);for(var o=G(r,i);;){var s=Nr(e,o,i,t,n),c=an(o,s.ch+ +(s.xRel>0||s.outside>0));if(!c)return s;var l=c.find(1);if(l.line==i)return l;o=G(r,i=l.line)}}function Ar(e,t,n,r){r-=Sr(t);var i=t.text.length,a=we(function(t){return dr(e,n,t-1).bottom<=r},i,0);return i=we(function(t){return dr(e,n,t).top>r},a,i),{begin:a,end:i}}function jr(e,t,n,r){n||=ur(e,t);var i=Cr(e,t,dr(e,n,r),`line`).top;return Ar(e,t,n,i)}function Mr(e,t,n,r){return e.bottom<=n?!1:e.top>n||(r?e.left:e.right)>t}function Nr(e,t,n,r,i){i-=mn(t);var a=ur(e,t),o=Sr(t),s=0,c=t.text.length,l=!0,u=ke(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?Fr:Pr)(e,t,n,a,u,r,i);l=d.level!=1,s=l?d.from:d.to-1,c=l?d.to:d.from-1}var f=null,p=null,m=we(function(t){var n=dr(e,a,t);return n.top+=o,n.bottom+=o,Mr(n,r,i,!1)?(n.top<=i&&n.left<=r&&(f=t,p=n),!0):!1},s,c),h,g,_=!1;if(p){var v=r-p.left<p.right-r,y=v==l;m=f+ +!y,g=y?`after`:`before`,h=v?p.left:p.right}else{!l&&(m==c||m==s)&&m++,g=m==0?`after`:m==t.text.length?`before`:dr(e,a,m-+!!l).bottom+o<=i==l?`after`:`before`;var b=Er(e,q(n,m,g),`line`,t,a);h=b.left,_=i<b.top?-1:+(i>=b.bottom)}return m=Ce(t.text,m,1),Or(n,m,g,_,r-h)}function Pr(e,t,n,r,i,a,o){var s=we(function(s){var c=i[s],l=c.level!=1;return Mr(Er(e,q(n,l?c.to:c.from,l?`before`:`after`),`line`,t,r),a,o,!0)},0,i.length-1),c=i[s];if(s>0){var l=c.level!=1,u=Er(e,q(n,l?c.from:c.to,l?`after`:`before`),`line`,t,r);Mr(u,a,o,!0)&&u.top>o&&(c=i[s-1])}return c}function Fr(e,t,n,r,i,a,o){var s=Ar(e,t,r,o),c=s.begin,l=s.end;/\s/.test(t.text.charAt(l-1))&&l--;for(var u=null,d=null,f=0;f<i.length;f++){var p=i[f];if(!(p.from>=l||p.to<=c)){var m=dr(e,r,p.level==1?Math.max(c,p.from):Math.min(l,p.to)-1).right,h=m<a?a-m+1e9:m-a;(!u||d>h)&&(u=p,d=h)}}return u||=i[i.length-1],u.from<c&&(u={from:c,to:u.to,level:u.level}),u.to>l&&(u={from:u.from,to:l,level:u.level}),u}var Ir;function Lr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Ir==null){Ir=k(`pre`,null,`CodeMirror-line-like`);for(var t=0;t<49;++t)Ir.appendChild(document.createTextNode(`x`)),Ir.appendChild(k(`br`));Ir.appendChild(document.createTextNode(`x`))}O(e.measure,Ir);var n=Ir.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),D(e.measure),n||1}function Rr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=k(`span`,`xxxxxxxxxx`),n=k(`pre`,[t],`CodeMirror-line-like`);O(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function zr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,a=t.gutters.firstChild,o=0;a;a=a.nextSibling,++o){var s=e.display.gutterSpecs[o].className;n[s]=a.offsetLeft+a.clientLeft+i,r[s]=a.clientWidth}return{fixedPos:Br(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Br(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Vr(e){var t=Lr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Rr(e.display)-3);return function(i){if(fn(e.doc,i))return 0;var a=0;if(i.widgets)for(var o=0;o<i.widgets.length;o++)i.widgets[o].height&&(a+=i.widgets[o].height);return n?a+(Math.ceil(i.text.length/r)||1)*t:a+t}}function Hr(e){var t=e.doc,n=Vr(e);t.iter(function(e){var t=n(e);t!=e.height&&ft(e,t)})}function Ur(e,t,n,r){var i=e.display;if(!n&&Be(t).getAttribute(`cm-not-content`)==`true`)return null;var a,o,s=i.lineSpace.getBoundingClientRect();try{a=t.clientX-s.left,o=t.clientY-s.top}catch{return null}var c=kr(e,a,o),l;if(r&&c.xRel>0&&(l=G(e.doc,c.line).text).length==c.ch){var u=R(l,l.length,e.options.tabSize)-l.length;c=q(c.line,Math.max(0,Math.round((a-tr(e.display).left)/Rr(e.display))-u))}return c}function Wr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function Gr(e,t,n,r){t??=e.doc.first,n??=e.doc.first+e.doc.size,r||=0;var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Rt&&un(e.doc,t)<i.viewTo&&qr(e);else if(n<=i.viewFrom)Rt&&dn(e.doc,n+r)>i.viewFrom?qr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)qr(e);else if(t<=i.viewFrom){var a=Jr(e,n,n+r,1);a?(i.view=i.view.slice(a.index),i.viewFrom=a.lineN,i.viewTo+=r):qr(e)}else if(n>=i.viewTo){var o=Jr(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):qr(e)}else{var s=Jr(e,t,t,-1),c=Jr(e,n,n+r,1);s&&c?(i.view=i.view.slice(0,s.index).concat(jn(e,s.lineN,c.lineN)).concat(i.view.slice(c.index)),i.viewTo+=r):qr(e)}var l=i.externalMeasured;l&&(n<l.lineN?l.lineN+=r:t<l.lineN+l.size&&(i.externalMeasured=null))}function Kr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var a=r.view[Wr(e,t)];if(a.node!=null){var o=a.changes||=[];z(o,n)==-1&&o.push(n)}}}function qr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Jr(e,t,n,r){var i=Wr(e,t),a,o=e.display.view;if(!Rt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var s=e.display.viewFrom,c=0;c<i;c++)s+=o[c].size;if(s!=t){if(r>0){if(i==o.length-1)return null;a=s+o[i].size-t,i++}else a=s-t;t+=a,n+=a}for(;un(e.doc,n)!=n;){if(i==(r<0?0:o.length-1))return null;n+=r*o[i-+(r<0)].size,i+=r}return{index:i,lineN:n}}function Yr(e,t,n){var r=e.display;r.view.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=jn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=jn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Wr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(jn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Wr(e,n)))),r.viewTo=n}function Xr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function Zr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Qr(e,t){t===void 0&&(t=!0);var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),a=r.selection=document.createDocumentFragment(),o=e.options.$customCursor;o&&(t=!0);for(var s=0;s<n.sel.ranges.length;s++)if(!(!t&&s==n.sel.primIndex)){var c=n.sel.ranges[s];if(!(c.from().line>=e.display.viewTo||c.to().line<e.display.viewFrom)){var l=c.empty();if(o){var u=o(e,c);u&&$r(e,u,i)}else(l||e.options.showCursorWhenSelecting)&&$r(e,c.head,i);l||ti(e,c,a)}}return r}function $r(e,t,n){var r=Er(e,t,`div`,null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(k(`div`,`\xA0`,`CodeMirror-cursor`));if(i.style.left=r.left+`px`,i.style.top=r.top+`px`,i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+`px`,/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var a=Tr(e,t,`div`,null,null),o=a.right-a.left;i.style.width=(o>0?o:e.defaultCharWidth())+`px`}if(r.other){var s=n.appendChild(k(`div`,`\xA0`,`CodeMirror-cursor CodeMirror-secondarycursor`));s.style.display=``,s.style.left=r.other.left+`px`,s.style.top=r.other.top+`px`,s.style.height=(r.other.bottom-r.other.top)*.85+`px`}}function ei(e,t){return e.top-t.top||e.left-t.left}function ti(e,t,n){var r=e.display,i=e.doc,a=document.createDocumentFragment(),o=tr(e.display),s=o.left,c=Math.max(r.sizerWidth,rr(e)-r.sizer.offsetLeft)-o.right,l=i.direction==`ltr`;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),a.appendChild(k(`div`,null,`CodeMirror-selected`,`position: absolute; left: `+e+`px;
6
+ top: `+t+`px; width: `+(n??c-e)+`px;
7
+ height: `+(r-t)+`px`))}function d(t,n,r){var a=G(i,t),o=a.text.length,d,f;function p(n,r){return Tr(e,q(t,n),`div`,a,r)}function m(t,n,r){var i=jr(e,a,null,t),o=n==`ltr`==(r==`after`)?`left`:`right`;return p(r==`after`?i.begin:i.end-(/\s/.test(a.text.charAt(i.end-1))?2:1),o)[o]}var h=ke(a,i.direction);return Te(h,n||0,r??o,function(e,t,i,a){var g=i==`ltr`,_=p(e,g?`left`:`right`),v=p(t-1,g?`right`:`left`),y=n==null&&e==0,b=r==null&&t==o,x=a==0,S=!h||a==h.length-1;if(v.top-_.top<=3){var C=(l?y:b)&&x,w=(l?b:y)&&S,T=C?s:(g?_:v).left,E=w?c:(g?v:_).right;u(T,_.top,E-T,_.bottom)}else{var D,O,k,A;g?(D=l&&y&&x?s:_.left,O=l?c:m(e,i,`before`),k=l?s:m(t,i,`after`),A=l&&b&&S?c:v.right):(D=l?m(e,i,`before`):s,O=!l&&y&&x?c:_.right,k=!l&&b&&S?s:v.left,A=l?m(t,i,`after`):c),u(D,_.top,O-D,_.bottom),_.bottom<v.top&&u(s,_.bottom,null,v.top),u(k,v.top,A-k,v.bottom)}(!d||ei(_,d)<0)&&(d=_),ei(v,d)<0&&(d=v),(!f||ei(_,f)<0)&&(f=_),ei(v,f)<0&&(f=v)}),{start:d,end:f}}var f=t.from(),p=t.to();if(f.line==p.line)d(f.line,f.ch,p.ch);else{var m=G(i,f.line),h=G(i,p.line),g=sn(m)==sn(h),_=d(f.line,f.ch,g?m.text.length+1:null).end,v=d(p.line,g?0:null,p.ch).start;g&&(_.top<v.top-2?(u(_.right,_.top,null,_.bottom),u(s,v.top,v.left,v.bottom)):u(_.right,_.top,v.left-_.right,_.bottom)),_.bottom<v.top&&u(s,_.bottom,null,v.top)}n.appendChild(a)}function ni(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility=``,e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||oi(e),t.cursorDiv.style.visibility=(n=!n)?``:`hidden`},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility=`hidden`)}}function ri(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||ai(e))}function ii(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&oi(e))},100)}function ai(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!=`nocursor`&&(e.state.focused||(U(e,`focus`,e,t),e.state.focused=!0,te(e.display.wrapper,`CodeMirror-focused`),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),c&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ni(e))}function oi(e,t){e.state.delayingBlurEvent||(e.state.focused&&(U(e,`blur`,e,t),e.state.focused=!1,E(e.display.wrapper,`CodeMirror-focused`)),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function si(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,a=0,c=0;c<t.view.length;c++){var l=t.view[c],u=e.options.lineWrapping,d=void 0,f=0;if(!l.hidden){if(i+=l.line.height,o&&s<8){var p=l.node.offsetTop+l.node.offsetHeight;d=p-n,n=p}else{var m=l.node.getBoundingClientRect();d=m.bottom-m.top,!u&&l.text.firstChild&&(f=l.text.firstChild.getBoundingClientRect().right-m.left-1)}var h=l.line.height-d;if((h>.005||h<-.005)&&(i<r&&(a-=h),ft(l.line,d),ci(l.line),l.rest))for(var g=0;g<l.rest.length;g++)ci(l.rest[g]);if(f>e.display.sizerWidth){var _=Math.ceil(f/Rr(e.display));_>e.display.maxLineLength&&(e.display.maxLineLength=_,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(a)>2&&(t.scroller.scrollTop+=a)}function ci(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function li(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-$n(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,a=pt(t,r),o=pt(t,i);if(n&&n.ensure){var s=n.ensure.from.line,c=n.ensure.to.line;s<a?(a=s,o=pt(t,mn(G(t,s))+e.wrapper.clientHeight)):Math.min(c,t.lastLine())>=o&&(a=pt(t,mn(G(t,c))-e.wrapper.clientHeight),o=c)}return{from:a,to:Math.max(o,a+1)}}function ui(e,t){if(!Ne(e,`scrollCursorIntoView`)){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,a=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(a.defaultView.innerHeight||a.documentElement.clientHeight)&&(i=!1),i!=null&&!h){var o=k(`div`,`​`,null,`position: absolute;
8
+ top: `+(t.top-n.viewOffset-$n(e.display))+`px;
9
+ height: `+(t.bottom-t.top+nr(e)+n.barHeight)+`px;
10
+ left: `+t.left+`px; width: `+Math.max(2,t.right-t.left)+`px;`);e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function di(e,t,n,r){r??=0;var i;!e.options.lineWrapping&&t==n&&(n=t.sticky==`before`?q(t.line,t.ch+1,`before`):t,t=t.ch?q(t.line,t.sticky==`before`?t.ch-1:t.ch,`after`):t);for(var a=0;a<5;a++){var o=!1,s=Er(e,t),c=!n||n==t?s:Er(e,n);i={left:Math.min(s.left,c.left),top:Math.min(s.top,c.top)-r,right:Math.max(s.left,c.left),bottom:Math.max(s.bottom,c.bottom)+r};var l=pi(e,i),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(l.scrollTop!=null&&(bi(e,l.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),l.scrollLeft!=null&&(Si(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(o=!0)),!o)break}return i}function fi(e,t){var n=pi(e,t);n.scrollTop!=null&&bi(e,n.scrollTop),n.scrollLeft!=null&&Si(e,n.scrollLeft)}function pi(e,t){var n=e.display,r=Lr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,a=ir(e),o={};t.bottom-t.top>a&&(t.bottom=t.top+a);var s=e.doc.height+er(n),c=t.top<r,l=t.bottom>s-r;if(t.top<i)o.scrollTop=c?0:t.top;else if(t.bottom>i+a){var u=Math.min(t.top,(l?s:t.bottom)-a);u!=i&&(o.scrollTop=u)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,f=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-d,p=rr(e)-n.gutters.offsetWidth,m=t.right-t.left>p;return m&&(t.right=t.left+p),t.left<10?o.scrollLeft=0:t.left<f?o.scrollLeft=Math.max(0,t.left+d-(m?0:10)):t.right>p+f-3&&(o.scrollLeft=t.right+(m?0:10)-p),o}function mi(e,t){t!=null&&(vi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function hi(e){vi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function gi(e,t,n){(t!=null||n!=null)&&vi(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function _i(e,t){vi(e),e.curOp.scrollToPos=t}function vi(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,yi(e,Dr(e,t.from),Dr(e,t.to),t.margin))}function yi(e,t,n,r){var i=pi(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});gi(e,i.scrollLeft,i.scrollTop)}function bi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Zi(e,{top:t}),xi(e,t,!0),n&&Zi(e),Ui(e,100))}function xi(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Si(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,ta(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Ci(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+er(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+nr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var wi=function(e,t,n){this.cm=n;var r=this.vert=k(`div`,[k(`div`,null,null,`min-width: 1px`)],`CodeMirror-vscrollbar`),i=this.horiz=k(`div`,[k(`div`,null,null,`height: 100%; min-height: 1px`)],`CodeMirror-hscrollbar`);r.tabIndex=i.tabIndex=-1,e(r),e(i),H(r,`scroll`,function(){r.clientHeight&&t(r.scrollTop,`vertical`)}),H(i,`scroll`,function(){i.clientWidth&&t(i.scrollLeft,`horizontal`)}),this.checkedZeroWidth=!1,o&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth=`18px`)};wi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display=`block`,this.vert.style.bottom=t?r+`px`:`0`;var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+`px`}else this.vert.scrollTop=0,this.vert.style.display=``,this.vert.firstChild.style.height=`0`;if(t){this.horiz.style.display=`block`,this.horiz.style.right=n?r+`px`:`0`,this.horiz.style.left=e.barLeft+`px`;var a=e.viewWidth-e.barLeft-(n?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:n?r:0,bottom:t?r:0}},wi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,`horiz`)},wi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,`vert`)},wi.prototype.zeroWidthHack=function(){var e=y&&!m?`12px`:`18px`;this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility=`hidden`,this.disableHoriz=new ae,this.disableVert=new ae},wi.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility=``;function r(){var i=e.getBoundingClientRect();(n==`vert`?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))==e?t.set(1e3,r):e.style.visibility=`hidden`}t.set(1e3,r)},wi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ti=function(){};Ti.prototype.update=function(){return{bottom:0,right:0}},Ti.prototype.setScrollLeft=function(){},Ti.prototype.setScrollTop=function(){},Ti.prototype.clear=function(){};function Ei(e,t){t||=Ci(e);var n=e.display.barWidth,r=e.display.barHeight;Di(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&si(e),Di(e,Ci(e)),n=e.display.barWidth,r=e.display.barHeight}function Di(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+`px`,n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+`px`,n.heightForcer.style.borderBottom=r.bottom+`px solid transparent`,r.right&&r.bottom?(n.scrollbarFiller.style.display=`block`,n.scrollbarFiller.style.height=r.bottom+`px`,n.scrollbarFiller.style.width=r.right+`px`):n.scrollbarFiller.style.display=``,r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display=`block`,n.gutterFiller.style.height=r.bottom+`px`,n.gutterFiller.style.width=t.gutterWidth+`px`):n.gutterFiller.style.display=``}var Oi={native:wi,null:Ti};function ki(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Oi[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),H(t,`mousedown`,function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute(`cm-not-content`,`true`)},function(t,n){n==`horizontal`?Si(e,t):bi(e,t)},e),e.display.scrollbars.addClass&&te(e.display.wrapper,e.display.scrollbars.addClass)}var Ai=0;function ji(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:++Ai,markArrays:null},Nn(e.curOp)}function Mi(e){var t=e.curOp;t&&Fn(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;Ni(e)})}function Ni(e){for(var t=e.ops,n=0;n<t.length;n++)Pi(t[n]);for(var r=0;r<t.length;r++)Fi(t[r]);for(var i=0;i<t.length;i++)Ii(t[i]);for(var a=0;a<t.length;a++)Li(t[a]);for(var o=0;o<t.length;o++)Ri(t[o])}function Pi(e){var t=e.cm,n=t.display;Ki(t),e.updateMaxLine&&gn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Gi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Fi(e){e.updatedDisplay=e.mustUpdate&&Yi(e.cm,e.update)}function Ii(e){var t=e.cm,n=t.display;e.updatedDisplay&&si(t),e.barMeasure=Ci(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=cr(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+nr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-rr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Li(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+`px`,e.maxScrollLeft<t.doc.scrollLeft&&Si(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==ee(re(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ei(t,e.barMeasure),e.updatedDisplay&&ea(t,e.barMeasure),e.selectionChanged&&ni(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&ri(e.cm)}function Ri(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&Xi(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&xi(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Si(t,e.scrollLeft,!0,!0),e.scrollToPos&&ui(t,di(t,Y(r,e.scrollToPos.from),Y(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(i)for(var o=0;o<i.length;++o)i[o].lines.length||U(i[o],`hide`);if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&U(a[s],`unhide`);n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&U(t,`changes`,t,e.changeObjs),e.update&&e.update.finish()}function zi(e,t){if(e.curOp)return t();ji(e);try{return t()}finally{Mi(e)}}function Bi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ji(e);try{return t.apply(e,arguments)}finally{Mi(e)}}}function Vi(e){return function(){if(this.curOp)return e.apply(this,arguments);ji(this);try{return e.apply(this,arguments)}finally{Mi(this)}}}function Hi(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ji(t);try{return e.apply(this,arguments)}finally{Mi(t)}}}function Ui(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,ie(Wi,e))}function Wi(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=Dt(e,t.highlightFrontier),i=[];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,s=a.text.length>e.options.maxHighlightLength?ot(t.mode,r.state):null,c=Tt(e,a,r,!0);s&&(r.state=s),a.styles=c.styles;var l=a.styleClasses,u=c.classes;u?a.styleClasses=u:l&&(a.styleClasses=null);for(var d=!o||o.length!=a.styles.length||l!=u&&(!l||!u||l.bgClass!=u.bgClass||l.textClass!=u.textClass),f=0;!d&&f<o.length;++f)d=o[f]!=a.styles[f];d&&i.push(r.line),a.stateAfter=r.save(),r.nextLine()}else a.text.length<=e.options.maxHighlightLength&&Ot(e,a.text,r),a.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return Ui(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&zi(e,function(){for(var t=0;t<i.length;t++)Kr(e,i[t],`text`)})}}var Gi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=li(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=rr(e),this.force=n,this.dims=zr(e),this.events=[]};Gi.prototype.signal=function(e,t){Fe(e,t)&&this.events.push(arguments)},Gi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)U.apply(null,this.events[e])};function Ki(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=nr(e)+`px`,t.sizer.style.marginBottom=-t.nativeBarWidth+`px`,t.sizer.style.borderRightWidth=nr(e)+`px`,t.scrollbarsClipped=!0)}function qi(e){if(e.hasFocus())return null;var t=ee(re(e));if(!t||!M(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=I(e).getSelection();r.anchorNode&&r.extend&&M(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function Ji(e){if(!(!e||!e.activeElt||e.activeElt==ee(F(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&M(document.body,e.anchorNode)&&M(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}function Yi(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return qr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&Xr(e)==0)return!1;na(e)&&(qr(e),t.dims=zr(e));var i=r.first+r.size,a=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<a&&a-n.viewFrom<20&&(a=Math.max(r.first,n.viewFrom)),n.viewTo>o&&n.viewTo-o<20&&(o=Math.min(i,n.viewTo)),Rt&&(a=un(e.doc,a),o=dn(e.doc,o));var s=a!=n.viewFrom||o!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Yr(e,a,o),n.viewOffset=mn(G(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+`px`;var c=Xr(e);if(!s&&c==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var l=qi(e);return c>4&&(n.lineDiv.style.display=`none`),Qi(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=``),n.renderedView=n.view,Ji(l),D(n.cursorDiv),D(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Ui(e,400)),n.updateLineNumbers=null,!0}function Xi(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==rr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+er(e.display)-ir(e),n.top)}),t.visible=li(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=li(e.display,e.doc,n));if(!Yi(e,t))break;si(e);var i=Ci(e);Zr(e),Ei(e,i),ea(e,i),t.force=!1}t.signal(e,`update`,e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,`viewportChange`,e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Zi(e,t){var n=new Gi(e,t);if(Yi(e,n)){si(e),Xi(e,n);var r=Ci(e);Zr(e),Ei(e,r),ea(e,r),n.finish()}}function Qi(e,t,n){var r=e.display,i=e.options.lineNumbers,a=r.lineDiv,o=a.firstChild;function s(t){var n=t.nextSibling;return c&&y&&e.display.currentWheelTarget==t?t.style.display=`none`:t.parentNode.removeChild(t),n}for(var l=r.view,u=r.viewFrom,d=0;d<l.length;d++){var f=l[d];if(!f.hidden){if(!f.node||f.node.parentNode!=a){var p=qn(e,f,u,n);a.insertBefore(p,o)}else{for(;o!=f.node;)o=s(o);var m=i&&t!=null&&t<=u&&f.lineNumber;f.changes&&(z(f.changes,`gutter`)>-1&&(m=!1),zn(e,f,u,n)),m&&(D(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(ht(e.options,u)))),o=f.node.nextSibling}}u+=f.size}for(;o;)o=s(o)}function $i(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+`px`,Ln(e,`gutterChanged`,e)}function ea(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+nr(e)+`px`}function ta(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Br(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,a=r+`px`,o=0;o<n.length;o++)if(!n[o].hidden){e.options.fixedGutter&&(n[o].gutter&&(n[o].gutter.style.left=a),n[o].gutterBackground&&(n[o].gutterBackground.style.left=a));var s=n[o].alignable;if(s)for(var c=0;c<s.length;c++)s[c].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=r+i+`px`)}}function na(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=ht(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(k(`div`,[k(`div`,n)],`CodeMirror-linenumber CodeMirror-gutter-elt`)),a=i.firstChild.offsetWidth,o=i.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?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+`px`,$i(e.display),!0}return!1}function ra(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var a=e[i],o=null;if(typeof a!=`string`&&(o=a.style,a=a.className),a==`CodeMirror-linenumbers`){if(t)r=!0;else continue}n.push({className:a,style:o})}return t&&!r&&n.push({className:`CodeMirror-linenumbers`,style:null}),n}function ia(e){var t=e.gutters,n=e.gutterSpecs;D(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],a=i.className,o=i.style,s=t.appendChild(k(`div`,null,`CodeMirror-gutter `+a));o&&(s.style.cssText=o),a==`CodeMirror-linenumbers`&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+`px`)}t.style.display=n.length?``:`none`,$i(e)}function aa(e){ia(e.display),Gr(e),ta(e)}function oa(e,t,r,i){var a=this;this.input=r,a.scrollbarFiller=k(`div`,null,`CodeMirror-scrollbar-filler`),a.scrollbarFiller.setAttribute(`cm-not-content`,`true`),a.gutterFiller=k(`div`,null,`CodeMirror-gutter-filler`),a.gutterFiller.setAttribute(`cm-not-content`,`true`),a.lineDiv=A(`div`,null,`CodeMirror-code`),a.selectionDiv=k(`div`,null,null,`position: relative; z-index: 1`),a.cursorDiv=k(`div`,null,`CodeMirror-cursors`),a.measure=k(`div`,null,`CodeMirror-measure`),a.lineMeasure=k(`div`,null,`CodeMirror-measure`),a.lineSpace=A(`div`,[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,`position: relative; outline: none`),a.mover=k(`div`,[A(`div`,[a.lineSpace],`CodeMirror-lines`)],null,`position: relative`),a.sizer=k(`div`,[a.mover],`CodeMirror-sizer`),a.sizerWidth=null,a.heightForcer=k(`div`,null,null,`position: absolute; height: `+oe+`px; width: 1px;`),a.gutters=k(`div`,null,`CodeMirror-gutters`),a.lineGutter=null,a.scroller=k(`div`,[a.sizer,a.heightForcer,a.gutters],`CodeMirror-scroll`),a.scroller.setAttribute(`tabIndex`,`-1`),a.wrapper=k(`div`,[a.scrollbarFiller,a.gutterFiller,a.scroller],`CodeMirror`),u&&d===105&&(a.wrapper.style.clipPath=`inset(0px)`),a.wrapper.setAttribute(`translate`,`no`),o&&s<8&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),!c&&!(n&&v)&&(a.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(a.wrapper):e(a.wrapper)),a.viewFrom=a.viewTo=t.first,a.reportedViewFrom=a.reportedViewTo=t.first,a.view=[],a.renderedView=null,a.externalMeasured=null,a.viewOffset=0,a.lastWrapHeight=a.lastWrapWidth=0,a.updateLineNumbers=null,a.nativeBarWidth=a.barHeight=a.barWidth=0,a.scrollbarsClipped=!1,a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null,a.alignWidgets=!1,a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.maxLine=null,a.maxLineLength=0,a.maxLineChanged=!1,a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null,a.shift=!1,a.selForContextMenu=null,a.activeTouch=null,a.gutterSpecs=ra(i.gutters,i.lineNumbers),ia(a),r.init(a)}var sa=0,ca=null;o?ca=-.53:n?ca=15:u?ca=-.7:p&&(ca=-1/3);function la(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n??=e.wheelDelta,{x:t,y:n}}function ua(e){var t=la(e);return t.x*=ca,t.y*=ca,t}function da(e,t){u&&d==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 r=la(t),i=r.x,a=r.y,o=ca;t.deltaMode===0&&(i=t.deltaX,a=t.deltaY,o=1);var s=e.display,l=s.scroller,p=l.scrollWidth>l.clientWidth,m=l.scrollHeight>l.clientHeight;if(i&&p||a&&m){if(a&&y&&c){outer:for(var h=t.target,g=s.view;h!=l;h=h.parentNode)for(var _=0;_<g.length;_++)if(g[_].node==h){e.display.currentWheelTarget=h;break outer}}if(i&&!n&&!f&&o!=null){a&&m&&bi(e,Math.max(0,l.scrollTop+a*o)),Si(e,Math.max(0,l.scrollLeft+i*o)),(!a||a&&m)&&W(t),s.wheelStartX=null;return}if(a&&o!=null){var v=a*o,b=e.doc.scrollTop,x=b+s.wrapper.clientHeight;v<0?b=Math.max(0,b+v-50):x=Math.min(e.doc.height,x+v+50),Zi(e,{top:b,bottom:x})}sa<20&&t.deltaMode!==0&&(s.wheelStartX==null?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=i,s.wheelDY=a,setTimeout(function(){if(s.wheelStartX!=null){var e=l.scrollLeft-s.wheelStartX,t=l.scrollTop-s.wheelStartY,n=t&&s.wheelDY&&t/s.wheelDY||e&&s.wheelDX&&e/s.wheelDX;s.wheelStartX=s.wheelStartY=null,n&&(ca=(ca*sa+n)/(sa+1),++sa)}},200)):(s.wheelDX+=i,s.wheelDY+=a))}}var fa=function(e,t){this.ranges=e,this.primIndex=t};fa.prototype.primary=function(){return this.ranges[this.primIndex]},fa.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!gt(n.anchor,r.anchor)||!gt(n.head,r.head))return!1}return!0},fa.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new X(_t(this.ranges[t].anchor),_t(this.ranges[t].head));return new fa(e,this.primIndex)},fa.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},fa.prototype.contains=function(e,t){t||=e;for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(J(t,r.from())>=0&&J(e,r.to())<=0)return n}return-1};var X=function(e,t){this.anchor=e,this.head=t};X.prototype.from=function(){return yt(this.anchor,this.head)},X.prototype.to=function(){return vt(this.anchor,this.head)},X.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function pa(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(e,t){return J(e.from(),t.from())}),n=z(t,i);for(var a=1;a<t.length;a++){var o=t[a],s=t[a-1],c=J(s.to(),o.from());if(r&&!o.empty()?c>0:c>=0){var l=yt(s.from(),o.from()),u=vt(s.to(),o.to()),d=s.empty()?o.from()==o.head:s.from()==s.head;a<=n&&--n,t.splice(--a,2,new X(d?u:l,d?l:u))}}return new fa(t,n)}function ma(e,t){return new fa([new X(e,t||e)],0)}function ha(e){return e.text?q(e.from.line+e.text.length-1,V(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ga(e,t){if(J(e,t.from)<0)return e;if(J(e,t.to)<=0)return ha(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=ha(t).ch-t.to.ch),q(n,r)}function _a(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new X(ga(i.anchor,t),ga(i.head,t)))}return pa(e.cm,n,e.sel.primIndex)}function va(e,t,n){return e.line==t.line?q(n.line,e.ch-t.ch+n.ch):q(n.line+(e.line-t.line),e.ch)}function ya(e,t,n){for(var r=[],i=q(e.first,0),a=i,o=0;o<t.length;o++){var s=t[o],c=va(s.from,i,a),l=va(ha(s),i,a);if(i=s.to,a=l,n==`around`){var u=e.sel.ranges[o],d=J(u.head,u.anchor)<0;r[o]=new X(d?l:c,d?c:l)}else r[o]=new X(c,c)}return new fa(r,e.sel.primIndex)}function ba(e){e.doc.mode=rt(e.options,e.doc.modeOption),xa(e)}function xa(e){e.doc.iter(function(e){e.stateAfter&&=null,e.styles&&=null}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Ui(e,100),e.state.modeGen++,e.curOp&&Gr(e)}function Sa(e,t){return t.from.ch==0&&t.to.ch==0&&V(t.text)==``&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ca(e,t,n,r){function i(e){return n?n[e]:null}function a(e,n,i){vn(e,n,i,r),Ln(e,`change`,e,t)}function o(e,t){for(var n=[],a=e;a<t;++a)n.push(new _n(l[a],i(a),r));return n}var s=t.from,c=t.to,l=t.text,u=G(e,s.line),d=G(e,c.line),f=V(l),p=i(l.length-1),m=c.line-s.line;if(t.full)e.insert(0,o(0,l.length)),e.remove(l.length,e.size-l.length);else if(Sa(e,t)){var h=o(0,l.length-1);a(d,d.text,p),m&&e.remove(s.line,m),h.length&&e.insert(s.line,h)}else if(u==d){if(l.length==1)a(u,u.text.slice(0,s.ch)+f+u.text.slice(c.ch),p);else{var g=o(1,l.length-1);g.push(new _n(f+u.text.slice(c.ch),p,r)),a(u,u.text.slice(0,s.ch)+l[0],i(0)),e.insert(s.line+1,g)}}else if(l.length==1)a(u,u.text.slice(0,s.ch)+l[0]+d.text.slice(c.ch),i(0)),e.remove(s.line+1,m);else{a(u,u.text.slice(0,s.ch)+l[0],i(0)),a(d,f+d.text.slice(c.ch),p);var _=o(1,l.length-1);m>1&&e.remove(s.line+1,m-1),e.insert(s.line+1,_)}Ln(e,`change`,e,t)}function wa(e,t,n){function r(e,i,a){if(e.linked)for(var o=0;o<e.linked.length;++o){var s=e.linked[o];if(s.doc!=i){var c=a&&s.sharedHist;n&&!c||(t(s.doc,c),r(s.doc,e,c))}}}r(e,null,!0)}function Ta(e,t){if(t.cm)throw Error(`This document is already in use.`);e.doc=t,t.cm=e,Hr(e),ba(e),Ea(e),e.options.direction=t.direction,e.options.lineWrapping||gn(e),e.options.mode=t.modeOption,Gr(e)}function Ea(e){(e.doc.direction==`rtl`?te:E)(e.display.lineDiv,`CodeMirror-rtl`)}function Da(e){zi(e,function(){Ea(e),Gr(e)})}function Oa(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 ka(e,t){var n={from:_t(t.from),to:ha(t),text:ut(e,t.from,t.to)};return Ia(e,n,t.from.line,t.to.line+1),wa(e,function(e){return Ia(e,n,t.from.line,t.to.line+1)},!0),n}function Aa(e){for(;e.length&&V(e).ranges;)e.pop()}function ja(e,t){if(t)return Aa(e.done),V(e.done);if(e.done.length&&!V(e.done).ranges)return V(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),V(e.done)}function Ma(e,t,n,r){var i=e.history;i.undone.length=0;var a=+new Date,o,s;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)==`+`&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)==`*`))&&(o=ja(i,i.lastOp==r)))s=V(o.changes),J(t.from,t.to)==0&&J(t.from,s.to)==0?s.to=ha(t):o.changes.push(ka(e,t));else{var c=V(i.done);for((!c||!c.ranges)&&Fa(e.sel,i.done),o={changes:[ka(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,s||U(e,`historyAdded`)}function Na(e,t,n,r){var i=t.charAt(0);return i==`*`||i==`+`&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Pa(e,t,n,r){var i=e.history,a=r&&r.origin;n==i.lastSelOp||a&&i.lastSelOrigin==a&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==a||Na(e,a,V(i.done),t))?i.done[i.done.length-1]=t:Fa(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=n,r&&r.clearRedo!==!1&&Aa(i.undone)}function Fa(e,t){var n=V(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Ia(e,t,n,r){var i=t[`spans_`+e.id],a=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||=t[`spans_`+e.id]={})[a]=n.markedSpans),++a})}function La(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||=e.slice(0,n):t&&t.push(e[n]);return t?t.length?t:null:e}function Ra(e,t){var n=t[`spans_`+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(La(n[i]));return r}function za(e,t){var n=Ra(e,t),r=qt(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var a=n[i],o=r[i];if(a&&o)spans:for(var s=0;s<o.length;++s){for(var c=o[s],l=0;l<a.length;++l)if(a[l].marker==c.marker)continue spans;a.push(c)}else o&&(n[i]=o)}return n}function Ba(e,t,n){for(var r=[],i=0;i<e.length;++i){var a=e[i];if(a.ranges){r.push(n?fa.prototype.deepCopy.call(a):a);continue}var o=a.changes,s=[];r.push({changes:s});for(var c=0;c<o.length;++c){var l=o[c],u=void 0;if(s.push({from:l.from,to:l.to,text:l.text}),t)for(var d in l)(u=d.match(/^spans_(\d+)$/))&&z(t,Number(u[1]))>-1&&(V(s)[d]=l[d],delete l[d])}}return r}function Va(e,t,n,r){if(r){var i=e.anchor;if(n){var a=J(t,i)<0;a==J(n,i)<0?a!=J(t,n)<0&&(t=n):(i=t,t=n)}return new X(i,t)}return new X(n||t,t)}function Ha(e,t,n,r,i){i??=e.cm&&(e.cm.display.shift||e.extend),Ja(e,new fa([Va(e.sel.primary(),t,n,i)],0),r)}function Ua(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),a=0;a<e.sel.ranges.length;a++)r[a]=Va(e.sel.ranges[a],t[a],null,i);Ja(e,pa(e.cm,r,e.sel.primIndex),n)}function Wa(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Ja(e,pa(e.cm,i,e.sel.primIndex),r)}function Ga(e,t,n,r){Ja(e,ma(t,n),r)}function Ka(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new X(Y(e,t[n].anchor),Y(e,t[n].head))},origin:n&&n.origin};return U(e,`beforeSelectionChange`,e,r),e.cm&&U(e.cm,`beforeSelectionChange`,e.cm,r),r.ranges==t.ranges?t:pa(e.cm,r.ranges,r.ranges.length-1)}function qa(e,t,n){var r=e.history.done,i=V(r);i&&i.ranges?(r[r.length-1]=t,Ya(e,t,n)):Ja(e,t,n)}function Ja(e,t,n){Ya(e,t,n),Pa(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Ya(e,t,n){(Fe(e,`beforeSelectionChange`)||e.cm&&Fe(e.cm,`beforeSelectionChange`))&&(t=Ka(e,t,n));var r=n&&n.bias||(J(t.primary().head,e.sel.primary().head)<0?-1:1);Xa(e,Qa(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&e.cm.getOption(`readOnly`)!=`nocursor`&&hi(e.cm)}function Xa(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Pe(e.cm)),Ln(e,`cursorActivity`,e))}function Za(e){Xa(e,Qa(e,e.sel,null,!1))}function Qa(e,t,n,r){for(var i,a=0;a<t.ranges.length;a++){var o=t.ranges[a],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[a],c=eo(e,o.anchor,s&&s.anchor,n,r),l=o.head==o.anchor?c:eo(e,o.head,s&&s.head,n,r);(i||c!=o.anchor||l!=o.head)&&(i||=t.ranges.slice(0,a),i[a]=new X(c,l))}return i?pa(e.cm,i,t.primIndex):t}function $a(e,t,n,r,i){var a=G(e,t.line);if(a.markedSpans)for(var o=0;o<a.markedSpans.length;++o){var s=a.markedSpans[o],c=s.marker,l=`selectLeft`in c?!c.selectLeft:c.inclusiveLeft,u=`selectRight`in c?!c.selectRight:c.inclusiveRight;if((s.from==null||(l?s.from<=t.ch:s.from<t.ch))&&(s.to==null||(u?s.to>=t.ch:s.to>t.ch))){if(i&&(U(c,`beforeCursorEnter`),c.explicitlyCleared)){if(a.markedSpans){--o;continue}break}if(!c.atomic)continue;if(n){var d=c.find(r<0?1:-1),f=void 0;if((r<0?u:l)&&(d=to(e,d,-r,d&&d.line==t.line?a:null)),d&&d.line==t.line&&(f=J(d,n))&&(r<0?f<0:f>0))return $a(e,d,t,r,i)}var p=c.find(r<0?-1:1);return(r<0?l:u)&&(p=to(e,p,r,p.line==t.line?a:null)),p?$a(e,p,t,r,i):null}}return t}function eo(e,t,n,r,i){var a=r||1;return $a(e,t,n,a,i)||!i&&$a(e,t,n,a,!0)||$a(e,t,n,-a,i)||!i&&$a(e,t,n,-a,!0)||(e.cantEdit=!0,q(e.first,0))}function to(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?Y(e,q(t.line-1)):null:n>0&&t.ch==(r||G(e,t.line)).text.length?t.line<e.first+e.size-1?q(t.line+1,0):null:new q(t.line,t.ch+n)}function no(e){e.setSelection(q(e.firstLine(),0),q(e.lastLine()),ce)}function ro(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,a){t&&(r.from=Y(e,t)),n&&(r.to=Y(e,n)),i&&(r.text=i),a!==void 0&&(r.origin=a)}),U(e,`beforeChange`,e,r),e.cm&&U(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 io(e,t,n){if(e.cm){if(!e.cm.curOp)return Bi(e.cm,io)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((Fe(e,`beforeChange`)||e.cm&&Fe(e.cm,`beforeChange`))&&(t=ro(e,t,!0),!t))){var r=Lt&&!n&&Yt(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)ao(e,{from:r[i].from,to:r[i].to,text:i?[``]:t.text,origin:t.origin});else ao(e,t)}}function ao(e,t){if(t.text.length!=1||t.text[0]!=``||J(t.from,t.to)!=0){var n=_a(e,t);Ma(e,t,n,e.cm?e.cm.curOp.id:NaN),co(e,t,n,qt(e,t));var r=[];wa(e,function(e,n){!n&&z(r,e.history)==-1&&(mo(e.history,t),r.push(e.history)),co(e,t,null,qt(e,t))})}}function oo(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,a,o=e.sel,s=t==`undo`?i.done:i.undone,c=t==`undo`?i.undone:i.done,l=0;l<s.length&&(a=s[l],!(n?a.ranges&&!a.equals(e.sel):!a.ranges));l++);if(l!=s.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(a=s.pop(),a.ranges){if(Fa(a,c),n&&!a.equals(e.sel)){Ja(e,a,{clearRedo:!1});return}o=a}else if(r){s.push(a);return}else break;var u=[];Fa(o,c),c.push({changes:u,generation:i.generation}),i.generation=a.generation||++i.maxGeneration;for(var d=Fe(e,`beforeChange`)||e.cm&&Fe(e.cm,`beforeChange`),f=function(n){var r=a.changes[n];if(r.origin=t,d&&!ro(e,r,!1))return s.length=0,{};u.push(ka(e,r)),co(e,r,n?_a(e,r):V(s),za(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:ha(r)});var i=[];wa(e,function(e,t){!t&&z(i,e.history)==-1&&(mo(e.history,r),i.push(e.history)),co(e,r,null,za(e,r))})},p=a.changes.length-1;p>=0;--p){var m=f(p);if(m)return m.v}}}}function so(e,t){if(t!=0&&(e.first+=t,e.sel=new fa(pe(e.sel.ranges,function(e){return new X(q(e.anchor.line+t,e.anchor.ch),q(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Gr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Kr(e.cm,r,`gutter`)}}function co(e,t,n,r){if(e.cm&&!e.cm.curOp)return Bi(e.cm,co)(e,t,n,r);if(t.to.line<e.first){so(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);so(e,i),t={from:q(e.first,0),to:q(t.to.line+i,t.to.ch),text:[V(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:q(a,G(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ut(e,t.from,t.to),n||=_a(e,t),e.cm?lo(e.cm,t,r):Ca(e,t,r),Ya(e,n,ce),e.cantEdit&&eo(e,q(e.firstLine(),0))&&(e.cantEdit=!1)}}function lo(e,t,n){var r=e.doc,i=e.display,a=t.from,o=t.to,s=!1,c=a.line;e.options.lineWrapping||(c=K(sn(G(r,a.line))),r.iter(c,o.line+1,function(e){if(e==i.maxLine)return s=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Pe(e),Ca(r,t,n,Vr(e)),e.options.lineWrapping||(r.iter(c,a.line+t.text.length,function(e){var t=hn(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),It(r,a.line),Ui(e,400);var l=t.text.length-(o.line-a.line)-1;t.full?Gr(e):a.line==o.line&&t.text.length==1&&!Sa(e.doc,t)?Kr(e,a.line,`text`):Gr(e,a.line,o.line+1,l);var u=Fe(e,`changes`),d=Fe(e,`change`);if(d||u){var f={from:a,to:o,text:t.text,removed:t.removed,origin:t.origin};d&&Ln(e,`change`,e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function uo(e,t,n,r,i){var a;r||=n,J(r,n)<0&&(a=[r,n],n=a[0],r=a[1]),typeof t==`string`&&(t=e.splitLines(t)),io(e,{from:n,to:r,text:t,origin:i})}function fo(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function po(e,t,n,r){for(var i=0;i<e.length;++i){var a=e[i],o=!0;if(a.ranges){a.copied||(a=e[i]=a.deepCopy(),a.copied=!0);for(var s=0;s<a.ranges.length;s++)fo(a.ranges[s].anchor,t,n,r),fo(a.ranges[s].head,t,n,r);continue}for(var c=0;c<a.changes.length;++c){var l=a.changes[c];if(n<l.from.line)l.from=q(l.from.line+r,l.from.ch),l.to=q(l.to.line+r,l.to.ch);else if(t<=l.to.line){o=!1;break}}o||(e.splice(0,i+1),i=0)}}function mo(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;po(e.done,n,r,i),po(e.undone,n,r,i)}function ho(e,t,n,r){var i=t,a=t;return typeof t==`number`?a=G(e,bt(e,t)):i=K(t),i==null?null:(r(a,i)&&e.cm&&Kr(e.cm,i,n),a)}function go(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}go.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,yn(i),Ln(i,`delete`)}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function _o(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}_o.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var a=Math.min(t,i-e),o=r.height;if(r.removeInner(e,a),this.height-=o-r.height,i==a&&(this.children.splice(n--,1),r.parent=null),(t-=a)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof go))){var s=[];this.collapse(s),this.children=[new go(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<=a){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var o=i.lines.length%25+25,s=o;s<i.lines.length;){var c=new go(i.lines.slice(s,s+=25));i.height-=c.height,this.children.splice(++r,0,c),c.parent=this}i.lines=i.lines.slice(0,o),this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new _o(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=z(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new _o(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<a){var o=Math.min(t,a-e);if(i.iterN(e,o,n))return!0;if((t-=o)==0)break;e=0}else e-=a}}};var vo=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};vo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=K(n);if(!(r==null||!t)){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var a=Zn(this);ft(n,Math.max(0,n.height-a)),e&&(zi(e,function(){yo(e,n,-a),Kr(e,r,`widget`)}),Ln(e,`lineWidgetCleared`,e,this,r))}},vo.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Zn(this)-t;i&&(fn(this.doc,r)||ft(r,r.height+i),n&&zi(n,function(){n.curOp.forceUpdate=!0,yo(n,r,i),Ln(n,`lineWidgetChanged`,n,e,K(r))}))},Ie(vo);function yo(e,t,n){mn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&mi(e,n)}function bo(e,t,n,r){var i=new vo(e,n,r),a=e.cm;return a&&i.noHScroll&&(a.display.alignWidgets=!0),ho(e,t,`widget`,function(t){var n=t.widgets||=[];if(i.insertAt==null?n.push(i):n.splice(Math.min(n.length,Math.max(0,i.insertAt)),0,i),i.line=t,a&&!fn(e,t)){var r=mn(t)<e.scrollTop;ft(t,t.height+Zn(i)),r&&mi(a,i.height),a.curOp.forceUpdate=!0}return!0}),a&&Ln(a,`lineWidgetAdded`,a,i,typeof t==`number`?t:K(t)),i}var xo=0,So=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++xo};So.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&ji(e),Fe(this,`clear`)){var n=this.find();n&&Ln(this,`clear`,n.from,n.to)}for(var r=null,i=null,a=0;a<this.lines.length;++a){var o=this.lines[a],s=Ht(o.markedSpans,this);e&&!this.collapsed?Kr(e,K(o),`text`):e&&(s.to!=null&&(i=K(o)),s.from!=null&&(r=K(o))),o.markedSpans=Ut(o.markedSpans,s),s.from==null&&this.collapsed&&!fn(this.doc,o)&&e&&ft(o,Lr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var l=sn(this.lines[c]),u=hn(l);u>e.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Gr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Za(e.doc)),e&&Ln(e,`markerCleared`,e,this,r,i),t&&Mi(e),this.parent&&this.parent.clear()}},So.prototype.find=function(e,t){e==null&&this.type==`bookmark`&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var a=this.lines[i],o=Ht(a.markedSpans,this);if(o.from!=null&&(n=q(t?a:K(a),o.from),e==-1))return n;if(o.to!=null&&(r=q(t?a:K(a),o.to),e==1))return r}return n&&{from:n,to:r}},So.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||zi(r,function(){var i=t.line,a=lr(r,K(t.line));if(a&&(_r(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!fn(n.doc,i)&&n.height!=null){var o=n.height;n.height=null;var s=Zn(n)-o;s&&ft(i,i.height+s)}Ln(r,`markerChanged`,r,e)})},So.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||z(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||=[]).push(this)}this.lines.push(e)},So.prototype.detachLine=function(e){if(this.lines.splice(z(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||=[]).push(this)}},Ie(So);function Co(e,t,n,r,i){if(r&&r.shared)return To(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Bi(e.cm,Co)(e,t,n,r,i);var a=new So(e,i),o=J(t,n);if(r&&L(r,a,!1),o>0||o==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=A(`span`,[a.replacedWith],`CodeMirror-widget`),r.handleMouseEvents||a.widgetNode.setAttribute(`cm-ignore-events`,`true`),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(on(e,t.line,t,n,a)||t.line!=n.line&&on(e,n.line,t,n,a))throw Error(`Inserting collapsed marker partially overlapping an existing one`);Bt()}a.addToHistory&&Ma(e,{from:t,to:n,origin:`markText`},e.sel,NaN);var s=t.line,c=e.cm,l;if(e.iter(s,n.line+1,function(r){c&&a.collapsed&&!c.options.lineWrapping&&sn(r)==c.display.maxLine&&(l=!0),a.collapsed&&s!=t.line&&ft(r,0),Wt(r,new Vt(a,s==t.line?t.ch:null,s==n.line?n.ch:null),e.cm&&e.cm.curOp),++s}),a.collapsed&&e.iter(t.line,n.line+1,function(t){fn(e,t)&&ft(t,0)}),a.clearOnEnter&&H(a,`beforeCursorEnter`,function(){return a.clear()}),a.readOnly&&(zt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++xo,a.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),a.collapsed)Gr(c,t.line,n.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var u=t.line;u<=n.line;u++)Kr(c,u,`text`);a.atomic&&Za(c.doc),Ln(c,`markerAdded`,c,a)}return a}var wo=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};wo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ln(this,`clear`)}},wo.prototype.find=function(e,t){return this.primary.find(e,t)},Ie(wo);function To(e,t,n,r,i){r=L(r),r.shared=!1;var a=[Co(e,t,n,r,i)],o=a[0],s=r.widgetNode;return wa(e,function(e){s&&(r.widgetNode=s.cloneNode(!0)),a.push(Co(e,Y(e,t),Y(e,n),r,i));for(var c=0;c<e.linked.length;++c)if(e.linked[c].isParent)return;o=V(a)}),new wo(a,o)}function Eo(e){return e.findMarks(q(e.first,0),e.clipPos(q(e.lastLine())),function(e){return e.parent})}function Do(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),a=e.clipPos(i.from),o=e.clipPos(i.to);if(J(a,o)){var s=Co(e,a,o,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}function Oo(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];wa(n.primary.doc,function(e){return r.push(e)});for(var i=0;i<n.markers.length;i++){var a=n.markers[i];z(r,a.doc)==-1&&(a.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}var ko=0,Ao=function(e,t,n,r,i){if(!(this instanceof Ao))return new Ao(e,t,n,r,i);n??=0,_o.call(this,[new go([new _n(``,null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var a=q(n,0);this.sel=ma(a),this.history=new Oa(null),this.id=++ko,this.modeOption=t,this.lineSep=r,this.direction=i==`rtl`?`rtl`:`ltr`,this.extend=!1,typeof e==`string`&&(e=this.splitLines(e)),Ca(this,{from:a,to:a,text:e}),Ja(this,ma(a),ce)};Ao.prototype=ge(_o.prototype,{constructor:Ao,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=dt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Hi(function(e){var t=q(this.first,0),n=this.first+this.size-1;io(this,{from:t,to:q(n,G(this,n).text.length),text:this.splitLines(e),origin:`setValue`,full:!0},!0),this.cm&&gi(this.cm,0,0),Ja(this,ma(t),ce)}),replaceRange:function(e,t,n,r){t=Y(this,t),n=n?Y(this,n):t,uo(this,e,t,n,r)},getRange:function(e,t,n){var r=ut(this,Y(this,e),Y(this,t));return n===!1?r:n===``?r.join(``):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(mt(this,e))return G(this,e)},getLineNumber:function(e){return K(e)},getLineHandleVisualStart:function(e){return typeof e==`number`&&(e=G(this,e)),sn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Y(this,e)},getCursor:function(e){var t=this.sel.primary();return e==null||e==`head`?t.head:e==`anchor`?t.anchor:e==`end`||e==`to`||e===!1?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Hi(function(e,t,n){Ga(this,Y(this,typeof e==`number`?q(e,t||0):e),null,n)}),setSelection:Hi(function(e,t,n){Ga(this,Y(this,e),Y(this,t||e),n)}),extendSelection:Hi(function(e,t,n){Ha(this,Y(this,e),t&&Y(this,t),n)}),extendSelections:Hi(function(e,t){Ua(this,St(this,e),t)}),extendSelectionsBy:Hi(function(e,t){var n=pe(this.sel.ranges,e);Ua(this,St(this,n),t)}),setSelections:Hi(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new X(Y(this,e[i].anchor),Y(this,e[i].head||e[i].anchor));t??=Math.min(e.length-1,this.sel.primIndex),Ja(this,pa(this.cm,r,t),n)}}),addSelection:Hi(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new X(Y(this,e),Y(this,t||e))),Ja(this,pa(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=ut(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=ut(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||`+input`)},replaceSelections:Hi(function(e,t,n){for(var r=[],i=this.sel,a=0;a<i.ranges.length;a++){var o=i.ranges[a];r[a]={from:o.from(),to:o.to(),text:this.splitLines(e[a]),origin:n}}for(var s=t&&t!=`end`&&ya(this,r,t),c=r.length-1;c>=0;c--)io(this,r[c]);s?qa(this,s):this.cm&&hi(this.cm)}),undo:Hi(function(){oo(this,`undo`)}),redo:Hi(function(){oo(this,`redo`)}),undoSelection:Hi(function(){oo(this,`undo`,!0)}),redoSelection:Hi(function(){oo(this,`redo`,!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Oa(this.history),wa(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:Ba(this.history.done),undone:Ba(this.history.undone)}},setHistory:function(e){var t=this.history=new Oa(this.history);t.done=Ba(e.done.slice(0),null,!0),t.undone=Ba(e.undone.slice(0),null,!0)},setGutterMarker:Hi(function(e,t,n){return ho(this,e,`gutter`,function(e){var r=e.gutterMarkers||={};return r[t]=n,!n&&be(r)&&(e.gutterMarkers=null),!0})}),clearGutter:Hi(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&ho(t,n,`gutter`,function(){return n.gutterMarkers[e]=null,be(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e==`number`){if(!mt(this,e)||(t=e,e=G(this,e),!e))return null}else if(t=K(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:Hi(function(e,t,n){return ho(this,e,t==`gutter`?`gutter`:`class`,function(e){var r=t==`text`?`textClass`:t==`background`?`bgClass`:t==`gutter`?`gutterClass`:`wrapClass`;if(!e[r])e[r]=n;else if(T(n).test(e[r]))return!1;else e[r]+=` `+n;return!0})}),removeLineClass:Hi(function(e,t,n){return ho(this,e,t==`gutter`?`gutter`:`class`,function(e){var r=t==`text`?`textClass`:t==`background`?`bgClass`:t==`gutter`?`gutterClass`:`wrapClass`,i=e[r];if(!i)return!1;if(n==null)e[r]=null;else{var a=i.match(T(n));if(!a)return!1;var o=a.index+a[0].length;e[r]=i.slice(0,a.index)+(!a.index||o==i.length?``:` `)+i.slice(o)||null}return!0})}),addLineWidget:Hi(function(e,t,n){return bo(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Co(this,Y(this,e),Y(this,t),n,n&&n.type||`range`)},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=Y(this,e),Co(this,e,e,n,`bookmark`)},findMarksAt:function(e){e=Y(this,e);var t=[],n=G(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=Y(this,e),t=Y(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(a){var o=a.markedSpans;if(o)for(var s=0;s<o.length;s++){var c=o[s];!(c.to!=null&&i==e.line&&e.ch>=c.to||c.from==null&&i!=e.line||c.from!=null&&i==t.line&&c.from>=t.ch)&&(!n||n(c.marker))&&r.push(c.marker.parent||c.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var a=i.text.length+r;if(a>e)return t=e,!0;e-=a,++n}),Y(this,q(n,t))},indexFromPos:function(e){e=Y(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new Ao(dt(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||={};var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new Ao(dt(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||=[]).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Do(r,Eo(this)),r},unlinkDoc:function(e){if(e instanceof Z&&(e=e.doc),this.linked){for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Oo(Eo(this));break}}if(e.history==this.history){var n=[e.id];wa(e,function(e){return n.push(e.id)},!0),e.history=new Oa(null),e.history.done=Ba(this.history.done,n),e.history.undone=Ba(this.history.undone,n)}},iterLinkedDocs:function(e){wa(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):qe(e)},lineSeparator:function(){return this.lineSep||`
11
+ `},setDirection:Hi(function(e){e!=`rtl`&&(e=`ltr`),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&Da(this.cm))})}),Ao.prototype.eachLine=Ao.prototype.iter;var jo=0;function Mo(e){var t=this;if(Fo(t),!(Ne(t,e)||Qn(t.display,e))){W(e),o&&(jo=+new Date);var n=Ur(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly())){if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,a=Array(i),s=0,c=function(){++s==i&&Bi(t,function(){n=Y(t.doc,n);var e={from:n,to:n,text:t.doc.splitLines(a.filter(function(e){return e!=null}).join(t.doc.lineSeparator())),origin:`paste`};io(t.doc,e),qa(t.doc,ma(Y(t.doc,n),Y(t.doc,ha(e))))})()},l=function(e,n){if(t.options.allowDropFileTypes&&z(t.options.allowDropFileTypes,e.type)==-1){c();return}var r=new FileReader;r.onerror=function(){return c()},r.onload=function(){var e=r.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)){c();return}a[n]=e,c()},r.readAsText(e)},u=0;u<r.length;u++)l(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var d=e.dataTransfer.getData(`Text`);if(d){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),Ya(t.doc,ma(n,n)),f)for(var p=0;p<f.length;++p)uo(t.doc,``,f[p].anchor,f[p].head,`drag`);t.replaceSelection(d,`around`,`paste`),t.display.input.focus()}}catch{}}}}}function No(e,t){if(o&&(!e.state.draggingText||+new Date-jo<100)){ze(t);return}if(!(Ne(e,t)||Qn(e.display,t))&&(t.dataTransfer.setData(`Text`,e.getSelection()),t.dataTransfer.effectAllowed=`copyMove`,t.dataTransfer.setDragImage&&!p)){var n=k(`img`,null,null,`position: fixed; left: 0; top: 0;`);n.src=`data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==`,f&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),f&&n.parentNode.removeChild(n)}}function Po(e,t){var n=Ur(e,t);if(n){var r=document.createDocumentFragment();$r(e,n,r),e.display.dragCursor||(e.display.dragCursor=k(`div`,null,`CodeMirror-cursors CodeMirror-dragcursors`),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),O(e.display.dragCursor,r)}}function Fo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Io(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName(`CodeMirror`),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var t=0;t<n.length;t++)e(n[t])})}}var Lo=!1;function Ro(){Lo||=(zo(),!0)}function zo(){var e;H(window,`resize`,function(){e??=setTimeout(function(){e=null,Io(Bo)},100)}),H(window,`blur`,function(){return Io(oi)})}function Bo(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Vo={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`},Ho=0;Ho<10;Ho++)Vo[Ho+48]=Vo[Ho+96]=String(Ho);for(var Uo=65;Uo<=90;Uo++)Vo[Uo]=String.fromCharCode(Uo);for(var Wo=1;Wo<=12;Wo++)Vo[Wo+111]=Vo[Wo+63235]=`F`+Wo;var Go={};Go.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`},Go.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`},Go.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`},Go.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`]},Go.default=y?Go.macDefault:Go.pcDefault;function Ko(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,a,o=0;o<t.length-1;o++){var s=t[o];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))i=!0;else throw Error(`Unrecognized modifier name: `+s)}return n&&(e=`Alt-`+e),r&&(e=`Ctrl-`+e),a&&(e=`Cmd-`+e),i&&(e=`Shift-`+e),e}function qo(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r==`...`){delete e[n];continue}for(var i=pe(n.split(` `),Ko),a=0;a<i.length;a++){var o=void 0,s=void 0;a==i.length-1?(s=i.join(` `),o=r):(s=i.slice(0,a+1).join(` `),o=`...`);var c=t[s];if(!c)t[s]=o;else if(c!=o)throw Error(`Inconsistent bindings for `+s)}delete e[n]}for(var l in t)e[l]=t[l];return e}function Jo(e,t,n,r){t=Qo(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return`nothing`;if(i===`...`)return`multi`;if(i!=null&&n(i))return`handled`;if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!=`[object Array]`)return Jo(e,t.fallthrough,n,r);for(var a=0;a<t.fallthrough.length;a++){var o=Jo(e,t.fallthrough[a],n,r);if(o)return o}}}function Yo(e){var t=typeof e==`string`?e:Vo[e.keyCode];return t==`Ctrl`||t==`Alt`||t==`Shift`||t==`Mod`}function Xo(e,t,n){var r=e;return t.altKey&&r!=`Alt`&&(e=`Alt-`+e),(C?t.metaKey:t.ctrlKey)&&r!=`Ctrl`&&(e=`Ctrl-`+e),(C?t.ctrlKey:t.metaKey)&&r!=`Mod`&&(e=`Cmd-`+e),!n&&t.shiftKey&&r!=`Shift`&&(e=`Shift-`+e),e}function Zo(e,t){if(f&&e.keyCode==34&&e.char)return!1;var n=Vo[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),Xo(n,e,t))}function Qo(e){return typeof e==`string`?Go[e]:e}function $o(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var a=t(n[i]);r.length&&J(a.from,V(r).to)<=0;){var o=r.pop();if(J(o.from,a.from)<0){a.from=o.from;break}}r.push(a)}zi(e,function(){for(var t=r.length-1;t>=0;t--)uo(e.doc,``,r[t].from,r[t].to,`+delete`);hi(e)})}function es(e,t,n){var r=Ce(e.text,t+n,n);return r<0||r>e.text.length?null:r}function ts(e,t,n){var r=es(e,t.ch,n);return r==null?null:new q(t.line,r,n<0?`after`:`before`)}function ns(e,t,n,r,i){if(e){t.doc.direction==`rtl`&&(i=-i);var a=ke(n,t.doc.direction);if(a){var o=i<0?V(a):a[0],s=i<0==(o.level==1)?`after`:`before`,c;if(o.level>0||t.doc.direction==`rtl`){var l=ur(t,n);c=i<0?n.text.length-1:0;var u=dr(t,l,c).top;c=we(function(e){return dr(t,l,e).top==u},i<0==(o.level==1)?o.from:o.to-1,c),s==`before`&&(c=es(n,c,1))}else c=i<0?o.to:o.from;return new q(r,c,s)}}return new q(r,i<0?n.text.length:0,i<0?`before`:`after`)}function rs(e,t,n,r){var i=ke(t,e.doc.direction);if(!i)return ts(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky=`before`):n.ch<=0&&(n.ch=0,n.sticky=`after`);var a=De(i,n.ch,n.sticky),o=i[a];if(e.doc.direction==`ltr`&&o.level%2==0&&(r>0?o.to>n.ch:o.from<n.ch))return ts(t,n,r);var s=function(e,n){return es(t,e instanceof q?e.ch:e,n)},c,l=function(n){return e.options.lineWrapping?(c||=ur(e,t),jr(e,t,c,n)):{begin:0,end:t.text.length}},u=l(n.sticky==`before`?s(n,-1):n.ch);if(e.doc.direction==`rtl`||o.level==1){var d=o.level==1==r<0,f=s(n,d?1:-1);if(f!=null&&(d?f<=o.to&&f<=u.end:f>=o.from&&f>=u.begin)){var p=d?`before`:`after`;return new q(n.line,f,p)}}var m=function(e,t,r){for(var a=function(e,t){return t?new q(n.line,s(e,1),`before`):new q(n.line,e,`after`)};e>=0&&e<i.length;e+=t){var o=i[e],c=t>0==(o.level!=1),l=c?r.begin:s(r.end,-1);if(o.from<=l&&l<o.to||(l=c?o.from:s(o.to,-1),r.begin<=l&&l<r.end))return a(l,c)}},h=m(a+r,r,u);if(h)return h;var g=r>0?u.end:s(u.begin,-1);return g!=null&&!(r>0&&g==t.text.length)&&(h=m(r>0?0:i.length-1,r,l(g)),h)?h:null}var is={selectAll:no,singleSelection:function(e){return e.setSelection(e.getCursor(`anchor`),e.getCursor(`head`),ce)},killLine:function(e){return $o(e,function(t){if(t.empty()){var n=G(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:q(t.head.line+1,0)}:{from:t.head,to:q(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return $o(e,function(t){return{from:q(t.from().line,0),to:Y(e.doc,q(t.to().line+1,0))}})},delLineLeft:function(e){return $o(e,function(e){return{from:q(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return $o(e,function(t){var n=e.charCoords(t.head,`div`).top+5;return{from:e.coordsChar({left:0,top:n},`div`),to:t.from()}})},delWrappedLineRight:function(e){return $o(e,function(t){var n=e.charCoords(t.head,`div`).top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},`div`);return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(q(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(q(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return as(e,t.head.line)},{origin:`+move`,bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ss(e,t.head)},{origin:`+move`,bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return os(e,t.head.line)},{origin:`+move`,bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,`div`).top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},`div`)},ue)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,`div`).top+5;return e.coordsChar({left:0,top:n},`div`)},ue)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,`div`).top+5,r=e.coordsChar({left:0,top:n},`div`);return r.ch<e.getLine(r.line).search(/\S/)?ss(e,t.head):r},ue)},goLineUp:function(e){return e.moveV(-1,`line`)},goLineDown:function(e){return e.moveV(1,`line`)},goPageUp:function(e){return e.moveV(-1,`page`)},goPageDown:function(e){return e.moveV(1,`page`)},goCharLeft:function(e){return e.moveH(-1,`char`)},goCharRight:function(e){return e.moveH(1,`char`)},goColumnLeft:function(e){return e.moveH(-1,`column`)},goColumnRight:function(e){return e.moveH(1,`column`)},goWordLeft:function(e){return e.moveH(-1,`word`)},goGroupRight:function(e){return e.moveH(1,`group`)},goGroupLeft:function(e){return e.moveH(-1,`group`)},goWordRight:function(e){return e.moveH(1,`word`)},delCharBefore:function(e){return e.deleteH(-1,`codepoint`)},delCharAfter:function(e){return e.deleteH(1,`char`)},delWordBefore:function(e){return e.deleteH(-1,`word`)},delWordAfter:function(e){return e.deleteH(1,`word`)},delGroupBefore:function(e){return e.deleteH(-1,`group`)},delGroupAfter:function(e){return e.deleteH(1,`group`)},indentAuto:function(e){return e.indentSelection(`smart`)},indentMore:function(e){return e.indentSelection(`add`)},indentLess:function(e){return e.indentSelection(`subtract`)},insertTab:function(e){return e.replaceSelection(` `)},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var a=n[i].from(),o=R(e.getLine(a.line),a.ch,r);t.push(fe(r-o%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection(`add`):e.execCommand(`insertTab`)},transposeChars:function(e){return zi(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,a=G(e.doc,i.line).text;if(a){if(i.ch==a.length&&(i=new q(i.line,i.ch-1)),i.ch>0)i=new q(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),q(i.line,i.ch-2),i,`+transpose`);else if(i.line>e.doc.first){var o=G(e.doc,i.line-1).text;o&&(i=new q(i.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),q(i.line-1,o.length-1),i,`+transpose`))}}n.push(new X(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return zi(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,`+input`);t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);hi(e)})},openLine:function(e){return e.replaceSelection(`
12
+ `,`start`)},toggleOverwrite:function(e){return e.toggleOverwrite()}};function as(e,t){var n=G(e.doc,t),r=sn(n);return r!=n&&(t=K(r)),ns(!0,e,r,t,1)}function os(e,t){var n=G(e.doc,t),r=cn(n);return r!=n&&(t=K(r)),ns(!0,e,n,t,-1)}function ss(e,t){var n=as(e,t.line),r=G(e.doc,n.line),i=ke(r,e.doc.direction);if(!i||i[0].level==0){var a=Math.max(n.ch,r.text.search(/\S/)),o=t.line==n.line&&t.ch<=a&&t.ch;return q(n.line,o?0:a,n.sticky)}return n}function cs(e,t,n){if(typeof t==`string`&&(t=is[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=se}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function ls(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Jo(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Jo(t,e.options.extraKeys,n,e)||Jo(t,e.options.keyMap,n,e)}var us=new ae;function ds(e,t,n,r){var i=e.state.keySeq;if(i){if(Yo(t))return`handled`;if(/\'$/.test(t)?e.state.keySeq=null:us.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),fs(e,i+` `+t,n,r))return!0}return fs(e,t,n,r)}function fs(e,t,n,r){var i=ls(e,t,r);return i==`multi`&&(e.state.keySeq=t),i==`handled`&&Ln(e,`keyHandled`,e,t,n),(i==`handled`||i==`multi`)&&(W(n),ni(e)),!!i}function ps(e,t){var n=Zo(t,!0);return n?t.shiftKey&&!e.state.keySeq?ds(e,`Shift-`+n,t,function(t){return cs(e,t,!0)})||ds(e,n,t,function(t){if(typeof t==`string`?/^go[A-Z]/.test(t):t.motion)return cs(e,t)}):ds(e,n,t,function(t){return cs(e,t)}):!1}function ms(e,t,n){return ds(e,`'`+n+`'`,t,function(t){return cs(e,t,!0)})}var hs=null;function gs(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=ee(re(t)),!Ne(t,e))){o&&s<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var i=ps(t,e);f&&(hs=i?r:null,!i&&r==88&&!Ye&&(y?e.metaKey:e.ctrlKey)&&t.replaceSelection(``,null,`cut`)),n&&!y&&!i&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand(`cut`),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&_s(t)}}function _s(e){var t=e.display.lineDiv;te(t,`CodeMirror-crosshair`);function n(e){(e.keyCode==18||!e.altKey)&&(E(t,`CodeMirror-crosshair`),Me(document,`keyup`,n),Me(document,`mouseover`,n))}H(document,`keyup`,n),H(document,`mouseover`,n)}function vs(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ne(this,e)}function ys(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(Qn(t.display,e)||Ne(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(f&&n==hs){hs=null,W(e);return}if(!(f&&(!e.which||e.which<10)&&ps(t,e))){var i=String.fromCharCode(r??n);i!=`\b`&&(ms(t,e,i)||t.display.input.onKeyPress(e))}}}var bs=400,xs=function(e,t,n){this.time=e,this.pos=t,this.button=n};xs.prototype.compare=function(e,t,n){return this.time+bs>e&&J(t,this.pos)==0&&n==this.button};var Ss,Cs;function ws(e,t){var n=+new Date;return Cs&&Cs.compare(n,e,t)?(Ss=Cs=null,`triple`):Ss&&Ss.compare(n,e,t)?(Cs=new xs(n,e,t),Ss=null,`double`):(Ss=new xs(n,e,t),Cs=null,`single`)}function Ts(e){var t=this,n=t.display;if(!(Ne(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,Qn(n,e)){c||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!Ps(t,e)){var r=Ur(t,e),i=Ve(e),a=r?ws(r,i):`single`;I(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Es(t,i,r,a,e))&&(i==1?r?Os(t,r,a,e):Be(e)==n.scroller&&W(e):i==2?(r&&Ha(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(w?t.display.input.onContextMenu(e):ii(t)))}}}function Es(e,t,n,r,i){var a=`Click`;return r==`double`?a=`Double`+a:r==`triple`&&(a=`Triple`+a),a=(t==1?`Left`:t==2?`Middle`:`Right`)+a,ds(e,Xo(a,i),i,function(t){if(typeof t==`string`&&(t=is[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=se}finally{e.state.suppressEdits=!1}return r})}function Ds(e,t,n){var r=e.getOption(`configureMouse`),i=r?r(e,t,n):{};return i.unit??=(b?n.shiftKey&&n.metaKey:n.altKey)?`rectangle`:t==`single`?`char`:t==`double`?`word`:`line`,(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew??=y?n.metaKey:n.ctrlKey,i.moveOnDrag??=!(y?n.altKey:n.ctrlKey),i}function Os(e,t,n,r){o?setTimeout(ie(ri,e),0):e.curOp.focus=ee(re(e));var i=Ds(e,n,r),a=e.doc.sel,s;e.options.dragDrop&&He&&!e.isReadOnly()&&n==`single`&&(s=a.contains(t))>-1&&(J((s=a.ranges[s]).from(),t)<0||t.xRel>0)&&(J(s.to(),t)>0||t.xRel<0)?ks(e,r,t,i):js(e,r,t,i)}function ks(e,t,n,r){var i=e.display,a=!1,l=Bi(e,function(t){c&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:ii(e)),Me(i.wrapper.ownerDocument,`mouseup`,l),Me(i.wrapper.ownerDocument,`mousemove`,u),Me(i.scroller,`dragstart`,d),Me(i.scroller,`drop`,l),a||(W(t),r.addNew||Ha(e.doc,n,null,null,r.extend),c&&!p||o&&s==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),u=function(e){a||=Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return a=!0};c&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,H(i.wrapper.ownerDocument,`mouseup`,l),H(i.wrapper.ownerDocument,`mousemove`,u),H(i.scroller,`dragstart`,d),H(i.scroller,`drop`,l),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function As(e,t,n){if(n==`char`)return new X(t,t);if(n==`word`)return e.findWordAt(t);if(n==`line`)return new X(q(t.line,0),Y(e.doc,q(t.line+1,0)));var r=n(e,t);return new X(r.from,r.to)}function js(e,t,n,r){o&&ii(e);var i=e.display,a=e.doc;W(t);var s,c,l=a.sel,u=l.ranges;if(r.addNew&&!r.extend?(c=a.sel.contains(n),s=c>-1?u[c]:new X(n,n)):(s=a.sel.primary(),c=a.sel.primIndex),r.unit==`rectangle`)r.addNew||(s=new X(n,n)),n=Ur(e,t,!0,!0),c=-1;else{var d=As(e,n,r.unit);s=r.extend?Va(s,d.anchor,d.head,r.extend):d}r.addNew?c==-1?(c=u.length,Ja(a,pa(e,u.concat([s]),c),{scroll:!1,origin:`*mouse`})):u.length>1&&u[c].empty()&&r.unit==`char`&&!r.extend?(Ja(a,pa(e,u.slice(0,c).concat(u.slice(c+1)),0),{scroll:!1,origin:`*mouse`}),l=a.sel):Wa(a,c,s,le):(c=0,Ja(a,new fa([s],0),le),l=a.sel);var f=n;function p(t){if(J(f,t)!=0){if(f=t,r.unit==`rectangle`){for(var i=[],o=e.options.tabSize,u=R(G(a,n.line).text,n.ch,o),d=R(G(a,t.line).text,t.ch,o),p=Math.min(u,d),m=Math.max(u,d),h=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));h<=g;h++){var _=G(a,h).text,v=B(_,p,o);p==m?i.push(new X(q(h,v),q(h,v))):_.length>v&&i.push(new X(q(h,v),q(h,B(_,m,o))))}i.length||i.push(new X(n,n)),Ja(a,pa(e,l.ranges.slice(0,c).concat(i),c),{origin:`*mouse`,scroll:!1}),e.scrollIntoView(t)}else{var y=s,b=As(e,t,r.unit),x=y.anchor,S;J(b.anchor,x)>0?(S=b.head,x=yt(y.from(),b.anchor)):(S=b.anchor,x=vt(y.to(),b.head));var C=l.ranges.slice(0);C[c]=Ms(e,new X(Y(a,x),S)),Ja(a,pa(e,C,c),le)}}}var m=i.wrapper.getBoundingClientRect(),h=0;function g(t){var n=++h,o=Ur(e,t,!0,r.unit==`rectangle`);if(o){if(J(o,f)!=0){e.curOp.focus=ee(re(e)),p(o);var s=li(i,a);(o.line>=s.to||o.line<s.from)&&setTimeout(Bi(e,function(){h==n&&g(t)}),150)}else{var c=t.clientY<m.top?-20:t.clientY>m.bottom?20:0;c&&setTimeout(Bi(e,function(){h==n&&(i.scroller.scrollTop+=c,g(t))}),50)}}}function _(t){e.state.selectingText=!1,h=1/0,t&&(W(t),i.input.focus()),Me(i.wrapper.ownerDocument,`mousemove`,v),Me(i.wrapper.ownerDocument,`mouseup`,y),a.history.lastSelOrigin=null}var v=Bi(e,function(e){e.buttons===0||!Ve(e)?_(e):g(e)}),y=Bi(e,_);e.state.selectingText=y,H(i.wrapper.ownerDocument,`mousemove`,v),H(i.wrapper.ownerDocument,`mouseup`,y)}function Ms(e,t){var n=t.anchor,r=t.head,i=G(e.doc,n.line);if(J(n,r)==0&&n.sticky==r.sticky)return t;var a=ke(i);if(!a)return t;var o=De(a,n.ch,n.sticky),s=a[o];if(s.from!=n.ch&&s.to!=n.ch)return t;var c=o+(s.from==n.ch==(s.level!=1)?0:1);if(c==0||c==a.length)return t;var l;if(r.line!=n.line)l=(r.line-n.line)*(e.doc.direction==`ltr`?1:-1)>0;else{var u=De(a,r.ch,r.sticky),d=u-o||(r.ch-n.ch)*(s.level==1?-1:1);l=u==c-1||u==c?d<0:d>0}var f=a[c+(l?-1:0)],p=l==(f.level==1),m=p?f.from:f.to,h=p?`after`:`before`;return n.ch==m&&n.sticky==h?t:new X(new q(n.line,m,h),r)}function Ns(e,t,n,r){var i,a;if(t.touches)i=t.touches[0].clientX,a=t.touches[0].clientY;else try{i=t.clientX,a=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&W(t);var o=e.display,s=o.lineDiv.getBoundingClientRect();if(a>s.bottom||!Fe(e,n))return Re(t);a-=s.top-o.viewOffset;for(var c=0;c<e.display.gutterSpecs.length;++c){var l=o.gutters.childNodes[c];if(l&&l.getBoundingClientRect().right>=i){var u=pt(e.doc,a),d=e.display.gutterSpecs[c];return U(e,n,e,u,d.className,t),Re(t)}}}function Ps(e,t){return Ns(e,t,`gutterClick`,!0)}function Fs(e,t){Qn(e.display,t)||Is(e,t)||Ne(e,t,`contextmenu`)||w||e.display.input.onContextMenu(t)}function Is(e,t){return Fe(e,`gutterContextMenu`)?Ns(e,t,`gutterContextMenu`,!1):!1}function Ls(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,``)+e.options.theme.replace(/(^|\s)\s*/g,` cm-s-`),yr(e)}var Rs={toString:function(){return`CodeMirror.Init`}},zs={},Bs={};function Vs(e){var t=e.optionHandlers;function n(n,r,i,a){e.defaults[n]=r,i&&(t[n]=a?function(e,t,n){n!=Rs&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Rs,n(`value`,``,function(e,t){return e.setValue(t)},!0),n(`mode`,null,function(e,t){e.doc.modeOption=t,ba(e)},!0),n(`indentUnit`,2,ba,!0),n(`indentWithTabs`,!1),n(`smartIndent`,!0),n(`tabSize`,4,function(e){xa(e),yr(e),Gr(e)},!0),n(`lineSeparator`,null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var a=e.text.indexOf(t,i);if(a==-1)break;i=a+t.length,n.push(q(r,a))}r++});for(var i=n.length-1;i>=0;i--)uo(e.doc,t,n[i],q(n[i].line,n[i].ch+t.length))}}),n(`specialChars`,/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(e,t,n){e.state.specialChars=RegExp(t.source+(t.test(` `)?``:`| `),`g`),n!=Rs&&e.refresh()}),n(`specialCharPlaceholder`,wn,function(e){return e.refresh()},!0),n(`electricChars`,!0),n(`inputStyle`,v?`contenteditable`:`textarea`,function(){throw Error(`inputStyle can not (yet) be changed in a running editor`)},!0),n(`spellcheck`,!1,function(e,t){return e.getInputField().spellcheck=t},!0),n(`autocorrect`,!1,function(e,t){return e.getInputField().autocorrect=t},!0),n(`autocapitalize`,!1,function(e,t){return e.getInputField().autocapitalize=t},!0),n(`rtlMoveVisually`,!x),n(`wholeLineUpdateBefore`,!0),n(`theme`,`default`,function(e){Ls(e),aa(e)},!0),n(`keyMap`,`default`,function(e,t,n){var r=Qo(t),i=n!=Rs&&Qo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),n(`extraKeys`,null),n(`configureMouse`,null),n(`lineWrapping`,!1,Us,!0),n(`gutters`,[],function(e,t){e.display.gutterSpecs=ra(t,e.options.lineNumbers),aa(e)},!0),n(`fixedGutter`,!0,function(e,t){e.display.gutters.style.left=t?Br(e.display)+`px`:`0`,e.refresh()},!0),n(`coverGutterNextToScrollbar`,!1,function(e){return Ei(e)},!0),n(`scrollbarStyle`,`native`,function(e){ki(e),Ei(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),n(`lineNumbers`,!1,function(e,t){e.display.gutterSpecs=ra(e.options.gutters,t),aa(e)},!0),n(`firstLineNumber`,1,aa,!0),n(`lineNumberFormatter`,function(e){return e},aa,!0),n(`showCursorWhenSelecting`,!1,Zr,!0),n(`resetSelectionOnContextMenu`,!0),n(`lineWiseCopyCut`,!0),n(`pasteLinesPerSelection`,!0),n(`selectionsMayTouch`,!1),n(`readOnly`,!1,function(e,t){t==`nocursor`&&(oi(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),n(`screenReaderLabel`,null,function(e,t){t=t===``?null:t,e.display.input.screenReaderLabelChanged(t)}),n(`disableInput`,!1,function(e,t){t||e.display.input.reset()},!0),n(`dragDrop`,!0,Hs),n(`allowDropFileTypes`,null),n(`cursorBlinkRate`,530),n(`cursorScrollMargin`,0),n(`cursorHeight`,1,Zr,!0),n(`singleCursorHeightPerLine`,!0,Zr,!0),n(`workTime`,100),n(`workDelay`,100),n(`flattenSpans`,!0,xa,!0),n(`addModeClass`,!1,xa,!0),n(`pollInterval`,100),n(`undoDepth`,200,function(e,t){return e.doc.history.undoDepth=t}),n(`historyEventDelay`,1250),n(`viewportMargin`,10,function(e){return e.refresh()},!0),n(`maxHighlightLength`,1e4,xa,!0),n(`moveInputWithCursor`,!0,function(e,t){t||e.display.input.resetPosition()}),n(`tabindex`,null,function(e,t){return e.display.input.getField().tabIndex=t||``}),n(`autofocus`,null),n(`direction`,`ltr`,function(e,t){return e.doc.setDirection(t)},!0),n(`phrases`,null)}function Hs(e,t,n){if(!t!=!(n&&n!=Rs)){var r=e.display.dragFunctions,i=t?H:Me;i(e.display.scroller,`dragstart`,r.start),i(e.display.scroller,`dragenter`,r.enter),i(e.display.scroller,`dragover`,r.over),i(e.display.scroller,`dragleave`,r.leave),i(e.display.scroller,`drop`,r.drop)}}function Us(e){e.options.lineWrapping?(te(e.display.wrapper,`CodeMirror-wrap`),e.display.sizer.style.minWidth=``,e.display.sizerWidth=null):(E(e.display.wrapper,`CodeMirror-wrap`),gn(e)),Hr(e),Gr(e),yr(e),setTimeout(function(){return Ei(e)},100)}function Z(e,t){var n=this;if(!(this instanceof Z))return new Z(e,t);this.options=t=t?L(t):{},L(zs,t,!1);var r=t.value;typeof r==`string`?r=new Ao(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Z.inputStyles[t.inputStyle](this),a=this.display=new oa(e,r,i,t);for(var l in a.wrapper.CodeMirror=this,Ls(this),t.lineWrapping&&(this.display.wrapper.className+=` CodeMirror-wrap`),ki(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 ae,keySeq:null,specialChars:null},t.autofocus&&!v&&a.input.focus(),o&&s<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Ws(this),Ro(),ji(this),this.curOp.forceUpdate=!0,Ta(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&ai(n)},20):oi(this),Bs)Bs.hasOwnProperty(l)&&Bs[l](this,t[l],Rs);na(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Gs.length;++u)Gs[u](this);Mi(this),c&&t.lineWrapping&&getComputedStyle(a.lineDiv).textRendering==`optimizelegibility`&&(a.lineDiv.style.textRendering=`auto`)}Z.defaults=zs,Z.optionHandlers=Bs;function Ws(e){var t=e.display;H(t.scroller,`mousedown`,Bi(e,Ts)),o&&s<11?H(t.scroller,`dblclick`,Bi(e,function(t){if(!Ne(e,t)){var n=Ur(e,t);if(!(!n||Ps(e,t)||Qn(e.display,t))){W(t);var r=e.findWordAt(n);Ha(e.doc,r.anchor,r.head)}}})):H(t.scroller,`dblclick`,function(t){return Ne(e,t)||W(t)}),H(t.scroller,`contextmenu`,function(t){return Fs(e,t)}),H(t.input.getField(),`contextmenu`,function(n){t.scroller.contains(n.target)||Fs(e,n)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function a(e){if(e.touches.length!=1)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function c(e,t){if(t.left==null)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}H(t.scroller,`touchstart`,function(i){if(!Ne(e,i)&&!a(i)&&!Ps(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},i.touches.length==1&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),H(t.scroller,`touchmove`,function(){t.activeTouch&&(t.activeTouch.moved=!0)}),H(t.scroller,`touchend`,function(n){var r=t.activeTouch;if(r&&!Qn(t,n)&&r.left!=null&&!r.moved&&new Date-r.start<300){var a=e.coordsChar(t.activeTouch,`page`),o=!r.prev||c(r,r.prev)?new X(a,a):!r.prev.prev||c(r,r.prev.prev)?e.findWordAt(a):new X(q(a.line,0),Y(e.doc,q(a.line+1,0)));e.setSelection(o.anchor,o.head),e.focus(),W(n)}i()}),H(t.scroller,`touchcancel`,i),H(t.scroller,`scroll`,function(){t.scroller.clientHeight&&(bi(e,t.scroller.scrollTop),Si(e,t.scroller.scrollLeft,!0),U(e,`scroll`,e))}),H(t.scroller,`mousewheel`,function(t){return da(e,t)}),H(t.scroller,`DOMMouseScroll`,function(t){return da(e,t)}),H(t.wrapper,`scroll`,function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){Ne(e,t)||ze(t)},over:function(t){Ne(e,t)||(Po(e,t),ze(t))},start:function(t){return No(e,t)},drop:Bi(e,Mo),leave:function(t){Ne(e,t)||Fo(e)}};var l=t.input.getField();H(l,`keyup`,function(t){return vs.call(e,t)}),H(l,`keydown`,Bi(e,gs)),H(l,`keypress`,Bi(e,ys)),H(l,`focus`,function(t){return ai(e,t)}),H(l,`blur`,function(t){return oi(e,t)})}var Gs=[];Z.defineInitHook=function(e){return Gs.push(e)};function Ks(e,t,n,r){var i=e.doc,a;n??=`add`,n==`smart`&&(i.mode.indent?a=Dt(e,t).state:n=`prev`);var o=e.options.tabSize,s=G(i,t),c=R(s.text,null,o);s.stateAfter&&=null;var l=s.text.match(/^\s*/)[0],u;if(!r&&!/\S/.test(s.text))u=0,n=`not`;else if(n==`smart`&&(u=i.mode.indent(a,s.text.slice(l.length),s.text),u==se||u>150)){if(!r)return;n=`prev`}n==`prev`?u=t>i.first?R(G(i,t-1).text,null,o):0:n==`add`?u=c+e.options.indentUnit:n==`subtract`?u=c-e.options.indentUnit:typeof n==`number`&&(u=c+n),u=Math.max(0,u);var d=``,f=0;if(e.options.indentWithTabs)for(var p=Math.floor(u/o);p;--p)f+=o,d+=` `;if(f<u&&(d+=fe(u-f)),d!=l)return uo(i,d,q(t,0),q(t,l.length),`+input`),s.stateAfter=null,!0;for(var m=0;m<i.sel.ranges.length;m++){var h=i.sel.ranges[m];if(h.head.line==t&&h.head.ch<l.length){var g=q(t,l.length);Wa(i,m,new X(g,g));break}}}var qs=null;function Js(e){qs=e}function Ys(e,t,n,r,i){var a=e.doc;e.display.shift=!1,r||=a.sel;var o=new Date-200,s=i==`paste`||e.state.pasteIncoming>o,c=qe(t),l=null;if(s&&r.ranges.length>1){if(qs&&qs.text.join(`
13
+ `)==t){if(r.ranges.length%qs.text.length==0){l=[];for(var u=0;u<qs.text.length;u++)l.push(a.splitLines(qs.text[u]))}}else c.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(l=pe(c,function(e){return[e]}))}for(var d=e.curOp.updateInput,f=r.ranges.length-1;f>=0;f--){var p=r.ranges[f],m=p.from(),h=p.to();p.empty()&&(n&&n>0?m=q(m.line,m.ch-n):e.state.overwrite&&!s?h=q(h.line,Math.min(G(a,h.line).text.length,h.ch+V(c).length)):s&&qs&&qs.lineWise&&qs.text.join(`
14
+ `)==c.join(`
15
+ `)&&(m=h=q(m.line,0)));var g={from:m,to:h,text:l?l[f%l.length]:c,origin:i||(s?`paste`:e.state.cutIncoming>o?`cut`:`+input`)};io(e.doc,g),Ln(e,`inputRead`,e,g)}t&&!s&&Zs(e,t),hi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Xs(e,t){var n=e.clipboardData&&e.clipboardData.getData(`Text`);if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&zi(t,function(){return Ys(t,n,0,null,`paste`)}),!0}function Zs(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var a=e.getModeAt(i.head),o=!1;if(a.electricChars){for(var s=0;s<a.electricChars.length;s++)if(t.indexOf(a.electricChars.charAt(s))>-1){o=Ks(e,i.head.line,`smart`);break}}else a.electricInput&&a.electricInput.test(G(e.doc,i.head.line).text.slice(0,i.head.ch))&&(o=Ks(e,i.head.line,`smart`));o&&Ln(e,`electricInput`,e,i.head.line)}}}function Qs(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,a={anchor:q(i,0),head:q(i+1,0)};n.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:n}}function $s(e,t,n,r){e.setAttribute(`autocorrect`,n?`on`:`off`),e.setAttribute(`autocapitalize`,r?`on`:`off`),e.setAttribute(`spellcheck`,!!t)}function ec(){var e=k(`textarea`,null,null,`position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none`),t=k(`div`,[e],null,`overflow: hidden; position: relative; width: 3px; height: 0px;`);return c?e.style.width=`1000px`:e.setAttribute(`wrap`,`off`),g&&(e.style.border=`1px solid black`),t}function tc(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){I(this).focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];(r[e]!=n||e==`mode`)&&(r[e]=n,t.hasOwnProperty(e)&&Bi(this,t[e])(this,n,i),U(this,`optionChange`,this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?`push`:`unshift`](Qo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Vi(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw Error(`Overlays may not be stateful.`);me(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},function(e){return e.priority}),this.state.modeGen++,Gr(this)}),removeOverlay:Vi(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||typeof e==`string`&&r.name==e){t.splice(n,1),this.state.modeGen++,Gr(this);return}}}),indentLine:Vi(function(e,t,n){typeof t!=`string`&&typeof t!=`number`&&(t=t==null?this.options.smartIndent?`smart`:`prev`:t?`add`:`subtract`),mt(this.doc,e)&&Ks(this,e,t,n)}),indentSelection:Vi(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Ks(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&hi(this));else{var a=i.from(),o=i.to(),s=Math.max(n,a.line);n=Math.min(this.lastLine(),o.line-+!o.ch)+1;for(var c=s;c<n;++c)Ks(this,c,e);var l=this.doc.sel.ranges;a.ch==0&&t.length==l.length&&l[r].from().ch>0&&Wa(this.doc,r,new X(a,l[r].to()),ce)}}}),getTokenAt:function(e,t){return Mt(this,e,t)},getLineTokens:function(e,t){return Mt(this,q(e),t,!0)},getTokenTypeAt:function(e){e=Y(this.doc,e);var t=Et(this,G(this.doc,e.line)),n=0,r=(t.length-1)/2,i=e.ch,a;if(i==0)a=t[2];else for(;;){var o=n+r>>1;if((o?t[o*2-1]:0)>=i)r=o;else if(t[o*2+1]<i)n=o+1;else{a=t[o*2+2];break}}var s=a?a.indexOf(`overlay `):-1;return s<0?a:s==0?null:a.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],a=this.getModeAt(e);if(typeof a[t]==`string`)i[a[t]]&&r.push(i[a[t]]);else if(a[t])for(var o=0;o<a[t].length;o++){var s=i[a[t][o]];s&&r.push(s)}else a.helperType&&i[a.helperType]?r.push(i[a.helperType]):i[a.name]&&r.push(i[a.name]);for(var c=0;c<i._global.length;c++){var l=i._global[c];l.pred(a,this)&&z(r,l.val)==-1&&r.push(l.val)}return r},getStateAfter:function(e,t){var n=this.doc;return e=bt(n,e??n.first+n.size-1),Dt(this,e+1,t).state},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return n=e==null?r.head:typeof e==`object`?Y(this.doc,e):e?r.from():r.to(),Er(this,n,t||`page`)},charCoords:function(e,t){return Tr(this,Y(this.doc,e),t||`page`)},coordsChar:function(e,t){return e=wr(this,e,t||`page`),kr(this,e.left,e.top)},lineAtHeight:function(e,t){return e=wr(this,{top:e,left:0},t||`page`).top,pt(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r=!1,i;if(typeof e==`number`){var a=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>a&&(e=a,r=!0),i=G(this.doc,e)}else i=e;return Cr(this,i,{top:0,left:0},t||`page`,n||r).top+(r?this.doc.height-mn(i):0)},defaultTextHeight:function(){return Lr(this.display)},defaultCharWidth:function(){return Rr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var a=this.display;e=Er(this,Y(this.doc,e));var o=e.bottom,s=e.left;if(t.style.position=`absolute`,t.setAttribute(`cm-ignore-events`,`true`),this.display.input.setUneditable(t),a.sizer.appendChild(t),r==`over`)o=e.top;else if(r==`above`||r==`near`){var c=Math.max(a.wrapper.clientHeight,this.doc.height),l=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);(r==`above`||e.bottom+t.offsetHeight>c)&&e.top>t.offsetHeight?o=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=c&&(o=e.bottom),s+t.offsetWidth>l&&(s=l-t.offsetWidth)}t.style.top=o+`px`,t.style.left=t.style.right=``,i==`right`?(s=a.sizer.clientWidth-t.offsetWidth,t.style.right=`0px`):(i==`left`?s=0:i==`middle`&&(s=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+`px`),n&&fi(this,{left:s,top:o,right:s+t.offsetWidth,bottom:o+t.offsetHeight})},triggerOnKeyDown:Vi(gs),triggerOnKeyPress:Vi(ys),triggerOnKeyUp:vs,triggerOnMouseDown:Vi(Ts),execCommand:function(e){if(is.hasOwnProperty(e))return is[e].call(null,this)},triggerElectric:Vi(function(e){Zs(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var a=Y(this.doc,e),o=0;o<t&&(a=nc(this.doc,a,i,n,r),!a.hitSide);++o);return a},moveH:Vi(function(e,t){var n=this;this.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?nc(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()},ue)}),deleteH:Vi(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection(``,null,`+delete`):$o(this,function(n){var i=nc(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,a=r;t<0&&(i=-1,t=-t);for(var o=Y(this.doc,e),s=0;s<t;++s){var c=Er(this,o,`div`);if(a==null?a=c.left:c.left=a,o=rc(this,c,i,n),o.hitSide)break}return o},moveV:Vi(function(e,t){var n=this,r=this.doc,i=[],a=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(o){if(a)return e<0?o.from():o.to();var s=Er(n,o.head,`div`);o.goalColumn!=null&&(s.left=o.goalColumn),i.push(s.left);var c=rc(n,s,e,t);return t==`page`&&o==r.sel.primary()&&mi(n,Tr(n,c,`div`).top-s.top),c},ue),i.length)for(var o=0;o<r.sel.ranges.length;o++)r.sel.ranges[o].goalColumn=i[o]}),findWordAt:function(e){var t=this.doc,n=G(t,e.line).text,r=e.ch,i=e.ch;if(n){var a=this.getHelper(e,`wordChars`);(e.sticky==`before`||i==n.length)&&r?--r:++i;for(var o=n.charAt(r),s=ye(o,a)?function(e){return ye(e,a)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ye(e)};r>0&&s(n.charAt(r-1));)--r;for(;i<n.length&&s(n.charAt(i));)++i}return new X(q(e.line,r),q(e.line,i))},toggleOverwrite:function(e){(e==null||e!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?te(this.display.cursorDiv,`CodeMirror-overwrite`):E(this.display.cursorDiv,`CodeMirror-overwrite`),U(this,`overwriteToggle`,this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==ee(re(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Vi(function(e,t){gi(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-nr(this)-this.display.barHeight,width:e.scrollWidth-nr(this)-this.display.barWidth,clientHeight:ir(this),clientWidth:rr(this)}},scrollIntoView:Vi(function(e,t){e==null?(e={from:this.doc.sel.primary().head,to:null},t??=this.options.cursorScrollMargin):typeof e==`number`?e={from:q(e,0),to:null}:e.from??(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,e.from.line==null?yi(this,e.from,e.to,e.margin):_i(this,e)}),setSize:Vi(function(e,t){var n=this,r=function(e){return typeof e==`number`||/^\d+$/.test(String(e))?e+`px`:e};e!=null&&(this.display.wrapper.style.width=r(e)),t!=null&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&vr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets){for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Kr(n,i,`widget`);break}}++i}),this.curOp.forceUpdate=!0,U(this,`refresh`,this)}),operation:function(e){return zi(this,e)},startOperation:function(){return ji(this)},endOperation:function(){return Mi(this)},refresh:Vi(function(){var e=this.display.cachedTextHeight;Gr(this),this.curOp.forceUpdate=!0,yr(this),gi(this,this.doc.scrollLeft,this.doc.scrollTop),$i(this.display),(e==null||Math.abs(e-Lr(this.display))>.5||this.options.lineWrapping)&&Hr(this),U(this,`refresh`,this)}),swapDoc:Vi(function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Ta(this,e),yr(this),this.display.input.reset(),gi(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Ln(this,`swapDoc`,this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},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}},Ie(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,a){e.registerHelper(t,r,a),n[t]._global.push({pred:i,val:a})}}function nc(e,t,n,r,i){var a=t,o=n,s=G(e,t.line),c=i&&e.direction==`rtl`?-n:n;function l(){var n=t.line+c;return n<e.first||n>=e.first+e.size?!1:(t=new q(n,t.ch,t.sticky),s=G(e,n))}function u(a){var o;if(r==`codepoint`){var u=s.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(u))o=null;else{var d=n>0?u>=55296&&u<56320:u>=56320&&u<57343;o=new q(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(d?2:1))),-n)}}else o=i?rs(e.cm,s,t,n):ts(s,t,n);if(o==null){if(!a&&l())t=ns(i,e.cm,s,t.line,c);else return!1}else t=o;return!0}if(r==`char`||r==`codepoint`)u();else if(r==`column`)u(!0);else if(r==`word`||r==`group`)for(var d=null,f=r==`group`,p=e.cm&&e.cm.getHelper(t,`wordChars`),m=!0;!(n<0&&!u(!m));m=!1){var h=s.text.charAt(t.ch)||`
16
+ `,g=ye(h,p)?`w`:f&&h==`
17
+ `?`n`:!f||/\s/.test(h)?null:`p`;if(f&&!m&&!g&&(g=`s`),d&&d!=g){n<0&&(n=1,u(),t.sticky=`after`);break}if(g&&(d=g),n>0&&!u(!m))break}var _=eo(e,t,a,o,!0);return gt(a,_)&&(_.hitSide=!0),_}function rc(e,t,n,r){var i=e.doc,a=t.left,o;if(r==`page`){var s=Math.min(e.display.wrapper.clientHeight,I(e).innerHeight||i(e).documentElement.clientHeight),c=Math.max(s-.5*Lr(e.display),3);o=(n>0?t.bottom:t.top)+n*c}else r==`line`&&(o=n>0?t.bottom+3:t.top-3);for(var l;l=kr(e,a,o),l.outside;){if(n<0?o<=0:o>=i.height){l.hitSide=!0;break}o+=n*5}return l}var Q=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ae,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Q.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,$s(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function a(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}H(i,`paste`,function(e){!a(e)||Ne(r,e)||Xs(e,r)||s<=11&&setTimeout(Bi(r,function(){return t.updateFromDOM()}),20)}),H(i,`compositionstart`,function(e){t.composing={data:e.data,done:!1}}),H(i,`compositionupdate`,function(e){t.composing||={data:e.data,done:!1}}),H(i,`compositionend`,function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),H(i,`touchstart`,function(){return n.forceCompositionEnd()}),H(i,`input`,function(){t.composing||t.readFromDOMSoon()});function o(e){if(!(!a(e)||Ne(r,e))){if(r.somethingSelected())Js({lineWise:!1,text:r.getSelections()}),e.type==`cut`&&r.replaceSelection(``,null,`cut`);else if(r.options.lineWiseCopyCut){var t=Qs(r);Js({lineWise:!0,text:t.text}),e.type==`cut`&&r.operation(function(){r.setSelections(t.ranges,0,ce),r.replaceSelection(``,null,`cut`)})}else return;if(e.clipboardData){e.clipboardData.clearData();var o=qs.text.join(`
18
+ `);if(e.clipboardData.setData(`Text`,o),e.clipboardData.getData(`Text`)==o){e.preventDefault();return}}var s=ec(),c=s.firstChild;$s(c),r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),c.value=qs.text.join(`
19
+ `);var l=ee(F(i));ne(c),setTimeout(function(){r.display.lineSpace.removeChild(s),l.focus(),l==i&&n.showPrimarySelection()},50)}}H(i,`copy`,o),H(i,`cut`,o)},Q.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute(`aria-label`,e):this.div.removeAttribute(`aria-label`)},Q.prototype.prepareSelection=function(){var e=Qr(this.cm,!1);return e.focus=ee(F(this.div))==this.div,e},Q.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Q.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Q.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),a=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||a.line<t.display.viewFrom){e.removeAllRanges();return}var o=cc(t,e.anchorNode,e.anchorOffset),s=cc(t,e.focusNode,e.focusOffset);if(!(o&&!o.bad&&s&&!s.bad&&J(yt(o,s),i)==0&&J(vt(o,s),a)==0)){var c=t.display.view,l=i.line>=t.display.viewFrom&&ic(t,i)||{node:c[0].measure.map[2],offset:0},u=a.line<t.display.viewTo&&ic(t,a);if(!u){var d=c[c.length-1].measure,f=d.maps?d.maps[d.maps.length-1]:d.map;u={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(!l||!u){e.removeAllRanges();return}var p=e.rangeCount&&e.getRangeAt(0),m;try{m=j(l.node,l.offset,u.offset,u.node)}catch{}m&&(!n&&t.state.focused?(e.collapse(l.node,l.offset),m.collapsed||(e.removeAllRanges(),e.addRange(m))):(e.removeAllRanges(),e.addRange(m)),p&&e.anchorNode==null?e.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}},Q.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)},Q.prototype.showMultipleSelections=function(e){O(this.cm.display.cursorDiv,e.cursors),O(this.cm.display.selectionDiv,e.selection)},Q.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Q.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return M(this.div,t)},Q.prototype.focus=function(){this.cm.options.readOnly!=`nocursor`&&((!this.selectionInEditor()||ee(F(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Q.prototype.blur=function(){this.div.blur()},Q.prototype.getField=function(){return this.div},Q.prototype.supportsTouch=function(){return!0},Q.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):zi(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},Q.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Q.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(_&&u&&this.cm.display.gutterSpecs.length&&ac(e.anchorNode)){this.cm.triggerOnKeyDown({type:`keydown`,keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=cc(t,e.anchorNode,e.anchorOffset),r=cc(t,e.focusNode,e.focusOffset);n&&r&&zi(t,function(){Ja(t.doc,ma(n,r),ce),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},Q.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=q(r.line-1,G(e.doc,r.line-1).length)),i.ch==G(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=q(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var a,o,s;r.line==t.viewFrom||(a=Wr(e,r.line))==0?(o=K(t.view[0].line),s=t.view[0].node):(o=K(t.view[a].line),s=t.view[a-1].node.nextSibling);var c=Wr(e,i.line),l,u;if(c==t.view.length-1?(l=t.viewTo-1,u=t.lineDiv.lastChild):(l=K(t.view[c+1].line)-1,u=t.view[c+1].node.previousSibling),!s)return!1;for(var d=e.doc.splitLines(sc(e,s,u,o,l)),f=ut(e.doc,q(o,0),q(l,G(e.doc,l).text.length));d.length>1&&f.length>1;)if(V(d)==V(f))d.pop(),f.pop(),l--;else if(d[0]==f[0])d.shift(),f.shift(),o++;else break;for(var p=0,m=0,h=d[0],g=f[0],_=Math.min(h.length,g.length);p<_&&h.charCodeAt(p)==g.charCodeAt(p);)++p;for(var v=V(d),y=V(f),b=Math.min(v.length-(d.length==1?p:0),y.length-(f.length==1?p:0));m<b&&v.charCodeAt(v.length-m-1)==y.charCodeAt(y.length-m-1);)++m;if(d.length==1&&f.length==1&&o==r.line)for(;p&&p>r.ch&&v.charCodeAt(v.length-m-1)==y.charCodeAt(y.length-m-1);)p--,m++;d[d.length-1]=v.slice(0,v.length-m).replace(/^\u200b+/,``),d[0]=d[0].slice(p).replace(/\u200b+$/,``);var x=q(o,p),S=q(l,f.length?V(f).length-m:0);if(d.length>1||d[0]||J(x,S))return uo(e.doc,d,x,S,`+input`),!0},Q.prototype.ensurePolled=function(){this.forceCompositionEnd()},Q.prototype.reset=function(){this.forceCompositionEnd()},Q.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Q.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout??=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(e.composing.done)e.composing=null;else return}e.updateFromDOM()},80)},Q.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&zi(this.cm,function(){return Gr(e.cm)})},Q.prototype.setUneditable=function(e){e.contentEditable=`false`},Q.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Bi(this.cm,Ys)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},Q.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!=`nocursor`)},Q.prototype.onContextMenu=function(){},Q.prototype.resetPosition=function(){},Q.prototype.needsContentAttribute=!0;function ic(e,t){var n=lr(e,t.line);if(!n||n.hidden)return null;var r=G(e.doc,t.line),i=or(n,r,t.line),a=ke(r,e.doc.direction),o=`left`;a&&(o=De(a,t.ch)%2?`right`:`left`);var s=pr(i.map,t.ch,o);return s.offset=s.collapse==`right`?s.end:s.start,s}function ac(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function oc(e,t){return t&&(e.bad=!0),e}function sc(e,t,n,r,i){var a=``,o=!1,s=e.doc.lineSeparator(),c=!1;function l(e){return function(t){return t.id==e}}function u(){o&&=(a+=s,c&&(a+=s),c=!1)}function d(e){e&&(u(),a+=e)}function f(t){if(t.nodeType==1){var n=t.getAttribute(`cm-text`);if(n){d(n);return}var a=t.getAttribute(`cm-marker`),p;if(a){var m=e.findMarks(q(r,0),q(i+1,0),l(+a));m.length&&(p=m[0].find(0))&&d(ut(e.doc,p.from,p.to).join(s));return}if(t.getAttribute(`contenteditable`)==`false`)return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&t.textContent.length==0)return;h&&u();for(var g=0;g<t.childNodes.length;g++)f(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(c=!0),h&&(o=!0)}else t.nodeType==3&&d(t.nodeValue.replace(/\u200b/g,``).replace(/\u00a0/g,` `))}for(;f(t),t!=n;)t=t.nextSibling,c=!1;return a}function cc(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return oc(e.clipPos(q(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var a=e.display.view[i];if(a.node==r)return lc(a,t,n)}}function lc(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!M(r,t))return oc(q(K(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var a=e.rest?V(e.rest):e.line;return oc(q(K(a),a.text.length),i)}var o=t.nodeType==3?t:null,s=t;for(!o&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(o=t.firstChild,n&&=o.nodeValue.length);s.parentNode!=r;)s=s.parentNode;var c=e.measure,l=c.maps;function u(t,n,r){for(var i=-1;i<(l?l.length:0);i++)for(var a=i<0?c.map:l[i],o=0;o<a.length;o+=3){var s=a[o+2];if(s==t||s==n){var u=K(i<0?e.line:e.rest[i]),d=a[o]+r;return(r<0||s!=t)&&(d=a[o+ +!!r]),q(u,d)}}}var d=u(o,s,n);if(d)return oc(d,i);for(var f=s.nextSibling,p=o?o.nodeValue.length-n:0;f;f=f.nextSibling){if(d=u(f,f.firstChild,0),d)return oc(q(d.line,d.ch-p),i);p+=f.textContent.length}for(var m=s.previousSibling,h=n;m;m=m.previousSibling){if(d=u(m,m.firstChild,-1),d)return oc(q(d.line,d.ch+h),i);h+=m.textContent.length}}var $=function(e){this.cm=e,this.prevInput=``,this.pollingFast=!1,this.polling=new ae,this.hasSelection=!1,this.composing=null,this.resetting=!1};$.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width=`0px`),H(i,`input`,function(){o&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),H(i,`paste`,function(e){Ne(r,e)||Xs(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function a(e){if(!Ne(r,e)){if(r.somethingSelected())Js({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var t=Qs(r);Js({lineWise:!0,text:t.text}),e.type==`cut`?r.setSelections(t.ranges,null,ce):(n.prevInput=``,i.value=t.text.join(`
20
+ `),ne(i))}else return;e.type==`cut`&&(r.state.cutIncoming=+new Date)}}H(i,`cut`,a),H(i,`copy`,a),H(e.scroller,`paste`,function(t){if(!(Qn(e,t)||Ne(r,t))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var a=new Event(`paste`);a.clipboardData=t.clipboardData,i.dispatchEvent(a)}}),H(e.lineSpace,`selectstart`,function(t){Qn(e,t)||W(t)}),H(i,`compositionstart`,function(){var e=r.getCursor(`from`);n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor(`to`),{className:`CodeMirror-composing`})}}),H(i,`compositionend`,function(){n.composing&&=(n.poll(),n.composing.range.clear(),null)})},$.prototype.createField=function(e){this.wrapper=ec(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;$s(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},$.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute(`aria-label`,e):this.textarea.removeAttribute(`aria-label`)},$.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Qr(e);if(e.options.moveInputWithCursor){var i=Er(e,n.sel.primary().head,`div`),a=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+o.top-a.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+o.left-a.left))}return r},$.prototype.showSelection=function(e){var t=this.cm.display;O(t.cursorDiv,e.cursors),O(t.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+`px`,this.wrapper.style.left=e.teLeft+`px`)},$.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput=``;var n=t.getSelection();this.textarea.value=n,t.state.focused&&ne(this.textarea),o&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value=``,o&&s>=9&&(this.hasSelection=null));this.resetting=!1}},$.prototype.getField=function(){return this.textarea},$.prototype.supportsTouch=function(){return!1},$.prototype.focus=function(){if(this.cm.options.readOnly!=`nocursor`&&(!v||ee(F(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},$.prototype.blur=function(){this.textarea.blur()},$.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},$.prototype.receivedFocus=function(){this.slowPoll()},$.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},$.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){!t.poll()&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},$.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Je(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(o&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=i.charCodeAt(0);if(a==8203&&!r&&(r=`​`),a==8666)return this.reset(),this.cm.execCommand(`undo`)}for(var c=0,l=Math.min(r.length,i.length);c<l&&r.charCodeAt(c)==i.charCodeAt(c);)++c;return zi(t,function(){Ys(t,i.slice(c),r.length-c,null,e.composing?`*compose`:null),i.length>1e3||i.indexOf(`
21
+ `)>-1?n.value=e.prevInput=``:e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor(`to`),{className:`CodeMirror-composing`}))}),!0},$.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},$.prototype.onKeyPress=function(){o&&s>=9&&(this.hasSelection=null),this.fastPoll()},$.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=Ur(n,e),l=r.scroller.scrollTop;if(!a||f)return;n.options.resetSelectionOnContextMenu&&n.doc.sel.contains(a)==-1&&Bi(n,Ja)(n.doc,ma(a),ce);var u=i.style.cssText,d=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText=`position: static`,i.style.cssText=`position: absolute; width: 30px; height: 30px;
22
+ top: `+(e.clientY-p.top-5)+`px; left: `+(e.clientX-p.left-5)+`px;
23
+ z-index: 1000; background: `+(o?`rgba(255, 255, 255, .05)`:`transparent`)+`;
24
+ outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var m;c&&(m=i.ownerDocument.defaultView.scrollY),r.input.focus(),c&&i.ownerDocument.defaultView.scrollTo(null,m),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=` `),t.contextMenuPending=g,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function h(){if(i.selectionStart!=null){var e=n.somethingSelected(),a=`​`+(e?i.value:``);i.value=`⇚`,i.value=a,t.prevInput=e?``:`​`,i.selectionStart=1,i.selectionEnd=a.length,r.selForContextMenu=n.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=u,o&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!o||o&&s<9)&&h();var e=0,a=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput==`​`?Bi(n,no)(n):e++<10?r.detectingSelectAll=setTimeout(a,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(a,200)}}if(o&&s>=9&&h(),w){ze(e);var _=function(){Me(window,`mouseup`,_),setTimeout(g,20)};H(window,`mouseup`,_)}else setTimeout(g,50)},$.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e==`nocursor`,this.textarea.readOnly=!!e},$.prototype.setUneditable=function(){},$.prototype.needsContentAttribute=!1;function uc(e,t){if(t=t?L(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=ee(F(e));t.autofocus=n==e||e.getAttribute(`autofocus`)!=null&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(H(e.form,`submit`,r),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var o=a.submit=function(){r(),a.submit=i,a.submit(),a.submit=o}}catch{}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display=``,e.form&&(Me(e.form,`submit`,r),!t.leaveSubmitMethodAlone&&typeof e.form.submit==`function`&&(e.form.submit=i))}},e.style.display=`none`;var s=Z(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s}function dc(e){e.off=Me,e.on=H,e.wheelEventPixels=ua,e.Doc=Ao,e.splitLines=qe,e.countColumn=R,e.findColumn=B,e.isWordChar=ve,e.Pass=se,e.signal=U,e.Line=_n,e.changeEnd=ha,e.scrollbarModel=Oi,e.Pos=q,e.cmpPos=J,e.modes=Qe,e.mimeModes=$e,e.resolveMode=nt,e.getMode=rt,e.modeExtensions=it,e.extendMode=at,e.copyState=ot,e.startState=ct,e.innerMode=st,e.commands=is,e.keyMap=Go,e.keyName=Zo,e.isModifierKey=Yo,e.lookupKey=Jo,e.normalizeKeyMap=qo,e.StringStream=lt,e.SharedTextMarker=wo,e.TextMarker=So,e.LineWidget=vo,e.e_preventDefault=W,e.e_stopPropagation=Le,e.e_stop=ze,e.addClass=te,e.contains=M,e.rmClass=E,e.keyNames=Vo}Vs(Z),tc(Z);var fc=`iter insert remove copy getEditor constructor`.split(` `);for(var pc in Ao.prototype)Ao.prototype.hasOwnProperty(pc)&&z(fc,pc)<0&&(Z.prototype[pc]=(function(e){return function(){return e.apply(this.doc,arguments)}})(Ao.prototype[pc]));return Ie(Ao),Z.inputStyles={textarea:$,contenteditable:Q},Z.defineMode=function(e){!Z.defaults.mode&&e!=`null`&&(Z.defaults.mode=e),et.apply(this,arguments)},Z.defineMIME=tt,Z.defineMode(`null`,function(){return{token:function(e){return e.skipToEnd()}}}),Z.defineMIME(`text/plain`,`null`),Z.defineExtension=function(e,t){Z.prototype[e]=t},Z.defineDocExtension=function(e,t){Ao.prototype[e]=t},Z.fromTextArea=uc,dc(Z),Z.version=`5.65.21`,Z}))})),r=t(((e,t)=>{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],r):r(CodeMirror)})(function(e){var t=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,n=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,r=/[*+-]\s/;e.commands.newlineAndIndentContinueMarkdownList=function(a){if(a.getOption(`disableInput`))return e.Pass;for(var o=a.listSelections(),s=[],c=0;c<o.length;c++){var l=o[c].head,u=a.getStateAfter(l.line),d=e.innerMode(a.getMode(),u);if(d.mode.name!==`markdown`&&d.mode.helperType!==`markdown`){a.execCommand(`newlineAndIndent`);return}u=d.state;var f=u.list!==!1,p=u.quote!==0,m=a.getLine(l.line),h=t.exec(m),g=/^\s*$/.test(m.slice(0,l.ch));if(!o[c].empty()||!f&&!p||!h||g){a.execCommand(`newlineAndIndent`);return}if(n.test(m)){var _=p&&/>\s*$/.test(m),v=!/>\s*$/.test(m);(_||v)&&a.replaceRange(``,{line:l.line,ch:0},{line:l.line,ch:l.ch+1}),s[c]=`
25
+ `}else{var y=h[1],b=h[5],x=!(r.test(h[2])||h[2].indexOf(`>`)>=0),S=x?parseInt(h[3],10)+1+h[4]:h[2].replace(`x`,` `);s[c]=`
26
+ `+y+S+b,x&&i(a,l)}}a.replaceSelections(s)};function i(e,n){var r=n.line,i=0,a=0,o=t.exec(e.getLine(r)),s=o[1];do{i+=1;var c=r+i,l=e.getLine(c),u=t.exec(l);if(u){var d=u[1],f=parseInt(o[3],10)+i-a,p=parseInt(u[3],10),m=p;if(s===d&&!isNaN(p))f===p&&(m=p+1),f>p&&(m=f+1),e.replaceRange(l.replace(t,d+m+u[4]+u[5]),{line:c,ch:0},{line:c,ch:l.length});else{if(s.length>d.length||s.length<d.length&&i===1)return;a+=1}}}while(u)}})})),i=t((()=>{var e=n();e.commands.tabAndIndentMarkdownList=function(e){var t=e.listSelections()[0].head;if(e.getStateAfter(t.line).list!==!1){e.execCommand(`indentMore`);return}if(e.options.indentWithTabs)e.execCommand(`insertTab`);else{var n=Array(e.options.tabSize+1).join(` `);e.replaceSelection(n)}},e.commands.shiftTabAndUnindentMarkdownList=function(e){var t=e.listSelections()[0].head;if(e.getStateAfter(t.line).list!==!1){e.execCommand(`indentLess`);return}if(e.options.indentWithTabs)e.execCommand(`insertTab`);else{var n=Array(e.options.tabSize+1).join(` `);e.replaceSelection(n)}}})),a=t(((e,t)=>{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],r):r(CodeMirror)})(function(e){e.defineOption(`fullScreen`,!1,function(r,i,a){a==e.Init&&(a=!1),!a!=!i&&(i?t(r):n(r))});function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width=``,t.style.height=`auto`,t.className+=` CodeMirror-fullscreen`,document.documentElement.style.overflow=`hidden`,e.refresh()}function n(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,``),document.documentElement.style.overflow=``;var n=e.state.fullScreenRestore;t.style.width=n.width,t.style.height=n.height,window.scrollTo(n.scrollLeft,n.scrollTop),e.refresh()}})})),o=t(((e,t)=>{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],r):r(CodeMirror)})(function(e){var t={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},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode(`xml`,function(r,i){var a=r.indentUnit,o={},s=i.htmlMode?t:n;for(var c in s)o[c]=s[c];for(var c in i)o[c]=i[c];var l,u;function d(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();return r==`<`?e.eat(`!`)?e.eat(`[`)?e.match(`CDATA[`)?n(m(`atom`,`]]>`)):null:e.match(`--`)?n(m(`comment`,`-->`)):e.match(`DOCTYPE`,!0,!0)?(e.eatWhile(/[\w\._\-]/),n(h(1))):null:e.eat(`?`)?(e.eatWhile(/[\w\._\-]/),t.tokenize=m(`meta`,`?>`),`meta`):(l=e.eat(`/`)?`closeTag`:`openTag`,t.tokenize=f,`tag bracket`):r==`&`?(e.eat(`#`)?e.eat(`x`)?e.eatWhile(/[a-fA-F\d]/)&&e.eat(`;`):e.eatWhile(/[\d]/)&&e.eat(`;`):e.eatWhile(/[\w\.\-:]/)&&e.eat(`;`))?`atom`:`error`:(e.eatWhile(/[^&<]/),null)}d.isInText=!0;function f(e,t){var n=e.next();if(n==`>`||n==`/`&&e.eat(`>`))return t.tokenize=d,l=n==`>`?`endTag`:`selfcloseTag`,`tag bracket`;if(n==`=`)return l=`equals`,null;if(n==`<`){t.tokenize=d,t.state=b,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+` tag error`:`tag error`}return/[\'\"]/.test(n)?(t.tokenize=p(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),`word`)}function p(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=f;break}return`string`};return t.isInAttribute=!0,t}function m(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function h(e){return function(t,n){for(var r;(r=t.next())!=null;)if(r==`<`)return n.tokenize=h(e+1),n.tokenize(t,n);else if(r==`>`){if(e==1){n.tokenize=d;break}return n.tokenize=h(e-1),n.tokenize(t,n)}return`meta`}}function g(e){return e&&e.toLowerCase()}function _(e,t,n){this.prev=e.context,this.tagName=t||``,this.indent=e.indented,this.startOfLine=n,(o.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function v(e){e.context&&=e.context.prev}function y(e,t){for(var n;;){if(!e.context||(n=e.context.tagName,!o.contextGrabbers.hasOwnProperty(g(n))||!o.contextGrabbers[g(n)].hasOwnProperty(g(t))))return;v(e)}}function b(e,t,n){return e==`openTag`?(n.tagStart=t.column(),x):e==`closeTag`?S:b}function x(e,t,n){return e==`word`?(n.tagName=t.current(),u=`tag`,T):o.allowMissingTagName&&e==`endTag`?(u=`tag bracket`,T(e,t,n)):(u=`error`,x)}function S(e,t,n){if(e==`word`){var r=t.current();return n.context&&n.context.tagName!=r&&o.implicitlyClosed.hasOwnProperty(g(n.context.tagName))&&v(n),n.context&&n.context.tagName==r||o.matchClosing===!1?(u=`tag`,C):(u=`tag error`,w)}return o.allowMissingTagName&&e==`endTag`?(u=`tag bracket`,C(e,t,n)):(u=`error`,w)}function C(e,t,n){return e==`endTag`?(v(n),b):(u=`error`,C)}function w(e,t,n){return u=`error`,C(e,t,n)}function T(e,t,n){if(e==`word`)return u=`attribute`,E;if(e==`endTag`||e==`selfcloseTag`){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,e==`selfcloseTag`||o.autoSelfClosers.hasOwnProperty(g(r))?y(n,r):(y(n,r),n.context=new _(n,r,i==n.indented)),b}return u=`error`,T}function E(e,t,n){return e==`equals`?D:(o.allowMissing||(u=`error`),T(e,t,n))}function D(e,t,n){return e==`string`?O:e==`word`&&o.allowUnquoted?(u=`string`,T):(u=`error`,T(e,t,n))}function O(e,t,n){return e==`string`?O:T(e,t,n)}return{startState:function(e){var t={tokenize:d,state:b,indented:e||0,tagName:null,tagStart:null,context:null};return e!=null&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;l=null;var n=t.tokenize(e,t);return(n||l)&&n!=`comment`&&(u=null,t.state=t.state(l||n,e,t),u&&(n=u==`error`?n+` error`:u)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+a;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=f&&t.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return o.multilineTagIndentPastTag===!1?t.tagStart+a*(o.multilineTagIndentFactor||1):t.tagStart+t.tagName.length+2;if(o.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var s=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(s&&s[1])for(;i;)if(i.tagName==s[2]){i=i.prev;break}else if(o.implicitlyClosed.hasOwnProperty(g(i.tagName)))i=i.prev;else break;else if(s)for(;i;){var c=o.contextGrabbers[g(i.tagName)];if(c&&c.hasOwnProperty(g(s[2])))i=i.prev;else break}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+a:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:`<!--`,blockCommentEnd:`-->`,configuration:o.htmlMode?`html`:`xml`,helperType:o.htmlMode?`html`:`xml`,skipAttribute:function(e){e.state==D&&(e.state=T)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:e.type==`closeTag`}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)t.push(n.tagName);return t.reverse()}}}),e.defineMIME(`text/xml`,`xml`),e.defineMIME(`application/xml`,`xml`),e.mimeModes.hasOwnProperty(`text/html`)||e.defineMIME(`text/html`,{name:`xml`,htmlMode:!0})})})),s=t(((e,t)=>{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../lib/codemirror`],r):r(CodeMirror)})(function(e){e.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 t=0;t<e.modeInfo.length;t++){var n=e.modeInfo[t];n.mimes&&(n.mime=n.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.mime==t)return r;if(r.mimes){for(var i=0;i<r.mimes.length;i++)if(r.mimes[i]==t)return r}}if(/\+xml$/.test(t))return e.findModeByMIME(`application/xml`);if(/\+json$/.test(t))return e.findModeByMIME(`application/json`)},e.findModeByExtension=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.ext){for(var i=0;i<r.ext.length;i++)if(r.ext[i]==t)return r}}},e.findModeByFileName=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.file&&r.file.test(t))return r}var i=t.lastIndexOf(`.`),a=i>-1&&t.substring(i+1,t.length);if(a)return e.findModeByExtension(a)},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.name.toLowerCase()==t)return r;if(r.alias){for(var i=0;i<r.alias.length;i++)if(r.alias[i].toLowerCase()==t)return r}}}})})),c=t(((e,t)=>{(function(r){typeof e==`object`&&typeof t==`object`?r(n(),o(),s()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`,`../xml/xml`,`../meta`],r):r(CodeMirror)})(function(e){e.defineMode(`markdown`,function(t,n){var r=e.getMode(t,`text/html`),i=r.name==`null`;function a(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return i.name==`null`?null:i}n.highlightFormatting===void 0&&(n.highlightFormatting=!1),n.maxBlockquoteDepth===void 0&&(n.maxBlockquoteDepth=0),n.taskLists===void 0&&(n.taskLists=!1),n.strikethrough===void 0&&(n.strikethrough=!1),n.emoji===void 0&&(n.emoji=!1),n.fencedCodeBlockHighlighting===void 0&&(n.fencedCodeBlockHighlighting=!0),n.fencedCodeBlockDefaultMode===void 0&&(n.fencedCodeBlockDefaultMode=`text/plain`),n.xml===void 0&&(n.xml=!0),n.tokenTypeOverrides===void 0&&(n.tokenTypeOverrides={});var o={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 s in o)o.hasOwnProperty(s)&&n.tokenTypeOverrides[s]&&(o[s]=n.tokenTypeOverrides[s]);var c=/^([*\-_])(?:\s*\1){2,}\s*$/,l=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,u=/^\[(x| )\](?=\s)/i,d=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,f=/^ {0,3}(?:\={1,}|-{2,})\s*$/,p=/^[^#!\[\]*_\\<>` "'(~:]+/,m=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,h=/^\s*\[[^\]]+?\]:.*$/,g=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,_=` `;function v(e,t,n){return t.f=t.inline=n,n(e,t)}function y(e,t,n){return t.f=t.block=n,n(e,t)}function b(e){return!e||!/\S/.test(e.string)}function x(t){if(t.linkTitle=!1,t.linkHref=!1,t.linkText=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,t.indentedCode=!1,t.f==C){var n=i;if(!n){var a=e.innerMode(r,t.htmlState);n=a.mode.name==`xml`&&a.state.tagStart===null&&!a.state.context&&a.state.tokenize.isInText}n&&(t.f=D,t.block=S,t.htmlState=null)}return t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine={stream:null},null}function S(t,r){var i=t.column()===r.indentation,s=b(r.prevLine.stream),p=r.indentedCode,g=r.prevLine.hr,_=r.list!==!1,y=(r.listStack[r.listStack.length-1]||0)+3;r.indentedCode=!1;var x=r.indentation;if(r.indentationDiff===null&&(r.indentationDiff=r.indentation,_)){for(r.list=null;x<r.listStack[r.listStack.length-1];)r.listStack.pop(),r.listStack.length?r.indentation=r.listStack[r.listStack.length-1]:r.list=!1;r.list!==!1&&(r.indentationDiff=x-r.listStack[r.listStack.length-1])}var S=!s&&!g&&!r.prevLine.header&&(!_||!p)&&!r.prevLine.fencedCodeEnd,C=(r.list===!1||g||s)&&r.indentation<=y&&t.match(c),E=null;if(r.indentationDiff>=4&&(p||r.prevLine.fencedCodeEnd||r.prevLine.header||s))return t.skipToEnd(),r.indentedCode=!0,o.code;if(t.eatSpace())return null;if(i&&r.indentation<=y&&(E=t.match(d))&&E[1].length<=6)return r.quote=0,r.header=E[1].length,r.thisLine.header=!0,n.highlightFormatting&&(r.formatting=`header`),r.f=r.inline,T(r);if(r.indentation<=y&&t.eat(`>`))return r.quote=i?1:r.quote+1,n.highlightFormatting&&(r.formatting=`quote`),t.eatSpace(),T(r);if(!C&&!r.setext&&i&&r.indentation<=y&&(E=t.match(l))){var D=E[1]?`ol`:`ul`;return r.indentation=x+t.current().length,r.list=!0,r.quote=0,r.listStack.push(r.indentation),r.em=!1,r.strong=!1,r.code=!1,r.strikethrough=!1,n.taskLists&&t.match(u,!1)&&(r.taskList=!0),r.f=r.inline,n.highlightFormatting&&(r.formatting=[`list`,`list-`+D]),T(r)}return i&&r.indentation<=y&&(E=t.match(m,!0))?(r.quote=0,r.fencedEndRE=RegExp(E[1]+`+ *$`),r.localMode=n.fencedCodeBlockHighlighting&&a(E[2]||n.fencedCodeBlockDefaultMode),r.localMode&&(r.localState=e.startState(r.localMode)),r.f=r.block=w,n.highlightFormatting&&(r.formatting=`code-block`),r.code=-1,T(r)):r.setext||(!S||!_)&&!r.quote&&r.list===!1&&!r.code&&!C&&!h.test(t.string)&&(E=t.lookAhead(1))&&(E=E.match(f))?(r.setext?(r.header=r.setext,r.setext=0,t.skipToEnd(),n.highlightFormatting&&(r.formatting=`header`)):(r.header=E[0].charAt(0)==`=`?1:2,r.setext=r.header),r.thisLine.header=!0,r.f=r.inline,T(r)):C?(t.skipToEnd(),r.hr=!0,r.thisLine.hr=!0,o.hr):t.peek()===`[`?v(t,r,M):v(t,r,r.inline)}function C(t,n){var a=r.token(t,n.htmlState);if(!i){var o=e.innerMode(r,n.htmlState);(o.mode.name==`xml`&&o.state.tagStart===null&&!o.state.context&&o.state.tokenize.isInText||n.md_inside&&t.current().indexOf(`>`)>-1)&&(n.f=D,n.block=S,n.htmlState=null)}return a}function w(e,t){var r=t.listStack[t.listStack.length-1]||0,i=t.indentation<r,a=r+3;if(t.fencedEndRE&&t.indentation<=a&&(i||e.match(t.fencedEndRE))){n.highlightFormatting&&(t.formatting=`code-block`);var s;return i||(s=T(t)),t.localMode=t.localState=null,t.block=S,t.f=D,t.fencedEndRE=null,t.code=0,t.thisLine.fencedCodeEnd=!0,i?y(e,t,t.block):s}return t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),o.code)}function T(e){var t=[];if(e.formatting){t.push(o.formatting),typeof e.formatting==`string`&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)t.push(o.formatting+`-`+e.formatting[r]),e.formatting[r]===`header`&&t.push(o.formatting+`-`+e.formatting[r]+`-`+e.header),e.formatting[r]===`quote`&&(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(o.formatting+`-`+e.formatting[r]+`-`+e.quote):t.push(`error`))}if(e.taskOpen)return t.push(`meta`),t.length?t.join(` `):null;if(e.taskClosed)return t.push(`property`),t.length?t.join(` `):null;if(e.linkHref?t.push(o.linkHref,`url`):(e.strong&&t.push(o.strong),e.em&&t.push(o.em),e.strikethrough&&t.push(o.strikethrough),e.emoji&&t.push(o.emoji),e.linkText&&t.push(o.linkText),e.code&&t.push(o.code),e.image&&t.push(o.image),e.imageAltText&&t.push(o.imageAltText,`link`),e.imageMarker&&t.push(o.imageMarker)),e.header&&t.push(o.header,o.header+`-`+e.header),e.quote&&(t.push(o.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(o.quote+`-`+e.quote):t.push(o.quote+`-`+n.maxBlockquoteDepth)),e.list!==!1){var i=(e.listStack.length-1)%3;i?i===1?t.push(o.list2):t.push(o.list3):t.push(o.list1)}return e.trailingSpaceNewLine?t.push(`trailing-space-new-line`):e.trailingSpace&&t.push(`trailing-space-`+(e.trailingSpace%2?`a`:`b`)),t.length?t.join(` `):null}function E(e,t){if(e.match(p,!0))return T(t)}function D(t,i){var a=i.text(t,i);if(a!==void 0)return a;if(i.list)return i.list=null,T(i);if(i.taskList)return t.match(u,!0)[1]===` `?i.taskOpen=!0:i.taskClosed=!0,n.highlightFormatting&&(i.formatting=`task`),i.taskList=!1,T(i);if(i.taskOpen=!1,i.taskClosed=!1,i.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(i.formatting=`header`),T(i);var s=t.next();if(i.linkTitle){i.linkTitle=!1;var c=s;s===`(`&&(c=`)`),c=(c+``).replace(/([.?*+^\[\]\\(){}|-])/g,`\\$1`);var l=`^\\s*(?:[^`+c+`\\\\]+|\\\\\\\\|\\\\.)`+c;if(t.match(new RegExp(l),!0))return o.linkHref}if(s==="`"){var d=i.formatting;n.highlightFormatting&&(i.formatting=`code`),t.eatWhile("`");var f=t.current().length;if(i.code==0&&(!i.quote||f==1))return i.code=f,T(i);if(f==i.code){var p=T(i);return i.code=0,p}return i.formatting=d,T(i)}if(i.code)return T(i);if(s===`\\`&&(t.next(),n.highlightFormatting)){var m=T(i),h=o.formatting+`-escape`;return m?m+` `+h:h}if(s===`!`&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return i.imageMarker=!0,i.image=!0,n.highlightFormatting&&(i.formatting=`image`),T(i);if(s===`[`&&i.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return i.imageMarker=!1,i.imageAltText=!0,n.highlightFormatting&&(i.formatting=`image`),T(i);if(s===`]`&&i.imageAltText){n.highlightFormatting&&(i.formatting=`image`);var m=T(i);return i.imageAltText=!1,i.image=!1,i.inline=i.f=k,m}if(s===`[`&&!i.image)return i.linkText&&t.match(/^.*?\]/)?T(i):(i.linkText=!0,n.highlightFormatting&&(i.formatting=`link`),T(i));if(s===`]`&&i.linkText){n.highlightFormatting&&(i.formatting=`link`);var m=T(i);return i.linkText=!1,i.inline=i.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?k:D,m}if(s===`<`&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){i.f=i.inline=O,n.highlightFormatting&&(i.formatting=`link`);var m=T(i);return m?m+=` `:m=``,m+o.linkInline}if(s===`<`&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){i.f=i.inline=O,n.highlightFormatting&&(i.formatting=`link`);var m=T(i);return m?m+=` `:m=``,m+o.linkEmail}if(n.xml&&s===`<`&&t.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var _=t.string.indexOf(`>`,t.pos);if(_!=-1){var v=t.string.substring(t.start,_);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(v)&&(i.md_inside=!0)}return t.backUp(1),i.htmlState=e.startState(r),y(t,i,C)}if(n.xml&&s===`<`&&t.match(/^\/\w*?>/))return i.md_inside=!1,`tag`;if(s===`*`||s===`_`){for(var b=1,x=t.pos==1?` `:t.string.charAt(t.pos-2);b<3&&t.eat(s);)b++;var S=t.peek()||` `,w=!/\s/.test(S)&&(!g.test(S)||/\s/.test(x)||g.test(x)),E=!/\s/.test(x)&&(!g.test(x)||/\s/.test(S)||g.test(S)),A=null,j=null;if(b%2&&(!i.em&&w&&(s===`*`||!E||g.test(x))?A=!0:i.em==s&&E&&(s===`*`||!w||g.test(S))&&(A=!1)),b>1&&(!i.strong&&w&&(s===`*`||!E||g.test(x))?j=!0:i.strong==s&&E&&(s===`*`||!w||g.test(S))&&(j=!1)),j!=null||A!=null){n.highlightFormatting&&(i.formatting=A==null?`strong`:j==null?`em`:`strong em`),A===!0&&(i.em=s),j===!0&&(i.strong=s);var p=T(i);return A===!1&&(i.em=!1),j===!1&&(i.strong=!1),p}}else if(s===` `&&(t.eat(`*`)||t.eat(`_`))){if(t.peek()===` `)return T(i);t.backUp(1)}if(n.strikethrough){if(s===`~`&&t.eatWhile(s)){if(i.strikethrough){n.highlightFormatting&&(i.formatting=`strikethrough`);var p=T(i);return i.strikethrough=!1,p}if(t.match(/^[^\s]/,!1))return i.strikethrough=!0,n.highlightFormatting&&(i.formatting=`strikethrough`),T(i)}else if(s===` `&&t.match(`~~`,!0)){if(t.peek()===` `)return T(i);t.backUp(2)}}if(n.emoji&&s===`:`&&t.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){i.emoji=!0,n.highlightFormatting&&(i.formatting=`emoji`);var M=T(i);return i.emoji=!1,M}return s===` `&&(t.match(/^ +$/,!1)?i.trailingSpace++:i.trailingSpace&&(i.trailingSpaceNewLine=!0)),T(i)}function O(e,t){if(e.next()===`>`){t.f=t.inline=D,n.highlightFormatting&&(t.formatting=`link`);var r=T(t);return r?r+=` `:r=``,r+o.linkInline}return e.match(/^[^>]+/,!0),o.linkInline}function k(e,t){if(e.eatSpace())return null;var r=e.next();return r===`(`||r===`[`?(t.f=t.inline=j(r===`(`?`)`:`]`),n.highlightFormatting&&(t.formatting=`link-string`),t.linkHref=!0,T(t)):`error`}var A={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function j(e){return function(t,r){if(t.next()===e){r.f=r.inline=D,n.highlightFormatting&&(r.formatting=`link-string`);var i=T(r);return r.linkHref=!1,i}return t.match(A[e]),r.linkHref=!0,T(r)}}function M(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=ee,e.next(),n.highlightFormatting&&(t.formatting=`link`),t.linkText=!0,T(t)):v(e,t,D)}function ee(e,t){if(e.match(`]:`,!0)){t.f=t.inline=te,n.highlightFormatting&&(t.formatting=`link`);var r=T(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),o.linkText}function te(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),e.peek()===void 0?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),t.f=t.inline=D,o.linkHref+` url`)}var N={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:D,text:E,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(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(r,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkText:t.linkText,linkTitle:t.linkTitle,linkHref:t.linkHref,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,emoji:t.emoji,header:t.header,setext:t.setext,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedEndRE:t.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return x(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=C)){var n=e.match(/^\s*/,!0)[0].replace(/\t/g,_).length;if(t.indentation=n,t.indentationDiff=null,n>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==C?{state:e.htmlState,mode:r}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:N}},indent:function(t,n,i){return t.block==C&&r.indent?r.indent(t.htmlState,n,i):t.localState&&t.localMode.indent?t.localMode.indent(t.localState,n,i):e.Pass},blankLine:x,getType:T,blockCommentStart:`<!--`,blockCommentEnd:`-->`,closeBrackets:`()[]{}''""\`\``,fold:`markdown`};return N},`xml`),e.defineMIME(`text/markdown`,`markdown`),e.defineMIME(`text/x-markdown`,`markdown`)})})),l=t(((e,t)=>{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],r):r(CodeMirror)})(function(e){e.overlayMode=function(t,n,r){return{startState:function(){return{base:e.startState(t),overlay:e.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(r){return{base:e.copyState(t,r.base),overlay:e.copyState(n,r.overlay),basePos:r.basePos,baseCur:null,overlayPos:r.overlayPos,overlayCur:null}},token:function(e,i){return(e!=i.streamSeen||Math.min(i.basePos,i.overlayPos)<e.start)&&(i.streamSeen=e,i.basePos=i.overlayPos=e.start),e.start==i.basePos&&(i.baseCur=t.token(e,i.base),i.basePos=e.pos),e.start==i.overlayPos&&(e.pos=e.start,i.overlayCur=n.token(e,i.overlay),i.overlayPos=e.pos),e.pos=Math.min(i.basePos,i.overlayPos),i.overlayCur==null?i.baseCur:i.baseCur!=null&&i.overlay.combineTokens||r&&i.overlay.combineTokens==null?i.baseCur+` `+i.overlayCur:i.overlayCur},indent:t.indent&&function(e,n,r){return t.indent(e.base,n,r)},electricChars:t.electricChars,innerMode:function(e){return{state:e.base,mode:t}},blankLine:function(e){var i,a;return t.blankLine&&(i=t.blankLine(e.base)),n.blankLine&&(a=n.blankLine(e.overlay)),a==null?i:r&&i!=null?i+` `+a:a}}}})})),u=t(((e,t)=>{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],r):r(CodeMirror)})(function(e){e.defineOption(`placeholder`,``,function(n,o,s){var c=s&&s!=e.Init;if(o&&!c)n.on(`blur`,i),n.on(`change`,a),n.on(`swapDoc`,a),e.on(n.getInputField(),`compositionupdate`,n.state.placeholderCompose=function(){r(n)}),a(n);else if(!o&&c){n.off(`blur`,i),n.off(`change`,a),n.off(`swapDoc`,a),e.off(n.getInputField(),`compositionupdate`,n.state.placeholderCompose),t(n);var l=n.getWrapperElement();l.className=l.className.replace(` CodeMirror-empty`,``)}o&&!n.hasFocus()&&i(n)});function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement(`pre`);n.style.cssText=`height: 0; overflow: visible`,n.style.direction=e.getOption(`direction`),n.className=`CodeMirror-placeholder CodeMirror-line-like`;var r=e.getOption(`placeholder`);typeof r==`string`&&(r=document.createTextNode(r)),n.appendChild(r),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function r(e){setTimeout(function(){var r=!1;if(e.lineCount()==1){var i=e.getInputField();r=i.nodeName==`TEXTAREA`?!e.getLine(0).length:!/[^\u200b]/.test(i.querySelector(`.CodeMirror-line`).textContent)}r?n(e):t(e)},20)}function i(e){o(e)&&n(e)}function a(e){var r=e.getWrapperElement(),i=o(e);r.className=r.className.replace(` CodeMirror-empty`,``)+(i?` CodeMirror-empty`:``),i?n(e):t(e)}function o(e){return e.lineCount()===1&&e.getLine(0)===``}})})),d=t(((e,t)=>{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],r):r(CodeMirror)})(function(e){e.defineOption(`autoRefresh`,!1,function(e,r){e.state.autoRefresh&&(n(e,e.state.autoRefresh),e.state.autoRefresh=null),r&&e.display.wrapper.offsetHeight==0&&t(e,e.state.autoRefresh={delay:r.delay||250})});function t(t,r){function i(){t.display.wrapper.offsetHeight?(n(t,r),t.display.lastWrapHeight!=t.display.wrapper.clientHeight&&t.refresh()):r.timeout=setTimeout(i,r.delay)}r.timeout=setTimeout(i,r.delay),r.hurry=function(){clearTimeout(r.timeout),r.timeout=setTimeout(i,50)},e.on(window,`mouseup`,r.hurry),e.on(window,`keyup`,r.hurry)}function n(t,n){clearTimeout(n.timeout),e.off(window,`mouseup`,n.hurry),e.off(window,`keyup`,n.hurry)}})})),f=t(((e,t)=>{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],r):r(CodeMirror)})(function(e){e.defineOption(`styleSelectedText`,!1,function(r,i,a){var o=a&&a!=e.Init;i&&!o?(r.state.markedSelection=[],r.state.markedSelectionStyle=typeof i==`string`?i:`CodeMirror-selectedtext`,c(r),r.on(`cursorActivity`,t),r.on(`change`,n)):!i&&o&&(r.off(`cursorActivity`,t),r.off(`change`,n),s(r),r.state.markedSelection=r.state.markedSelectionStyle=null)});function t(e){e.state.markedSelection&&e.operation(function(){l(e)})}function n(e){e.state.markedSelection&&e.state.markedSelection.length&&e.operation(function(){s(e)})}var r=8,i=e.Pos,a=e.cmpPos;function o(e,t,n,o){if(a(t,n)!=0)for(var s=e.state.markedSelection,c=e.state.markedSelectionStyle,l=t.line;;){var u=l==t.line?t:i(l,0),d=l+r,f=d>=n.line,p=f?n:i(d,0),m=e.markText(u,p,{className:c});if(o==null?s.push(m):s.splice(o++,0,m),f)break;l=d}}function s(e){for(var t=e.state.markedSelection,n=0;n<t.length;++n)t[n].clear();t.length=0}function c(e){s(e);for(var t=e.listSelections(),n=0;n<t.length;n++)o(e,t[n].from(),t[n].to())}function l(e){if(!e.somethingSelected())return s(e);if(e.listSelections().length>1)return c(e);var t=e.getCursor(`start`),n=e.getCursor(`end`),i=e.state.markedSelection;if(!i.length)return o(e,t,n);var l=i[0].find(),u=i[i.length-1].find();if(!l||!u||n.line-t.line<=r||a(t,u.to)>=0||a(n,l.from)<=0)return c(e);for(;a(t,l.from)>0;)i.shift().clear(),l=i[0].find();for(a(t,l.from)<0&&(l.to.line-t.line<r?(i.shift().clear(),o(e,t,l.to,0)):o(e,t,l.from,0));a(n,u.to)<0;)i.pop().clear(),u=i[i.length-1].find();a(n,u.to)>0&&(n.line-u.from.line<r?(i.pop().clear(),o(e,u.from,n)):o(e,u.to,n))}})})),p=t(((e,t)=>{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],r):r(CodeMirror)})(function(e){var t=e.Pos;function n(e){return e.flags??(e.ignoreCase?`i`:``)+(e.global?`g`:``)+(e.multiline?`m`:``)}function r(e,t){for(var r=n(e),i=r,a=0;a<t.length;a++)i.indexOf(t.charAt(a))==-1&&(i+=t.charAt(a));return r==i?e:new RegExp(e.source,i)}function i(e){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(e.source)}function a(e,n,i){n=r(n,`g`);for(var a=i.line,o=i.ch,s=e.lastLine();a<=s;a++,o=0){n.lastIndex=o;var c=e.getLine(a),l=n.exec(c);if(l)return{from:t(a,l.index),to:t(a,l.index+l[0].length),match:l}}}function o(e,n,o){if(!i(n))return a(e,n,o);n=r(n,`gm`);for(var s,c=1,l=o.line,u=e.lastLine();l<=u;){for(var d=0;d<c&&!(l>u);d++){var f=e.getLine(l++);s=s==null?f:s+`
27
+ `+f}c*=2,n.lastIndex=o.ch;var p=n.exec(s);if(p){var m=s.slice(0,p.index).split(`
28
+ `),h=p[0].split(`
29
+ `),g=o.line+m.length-1,_=m[m.length-1].length;return{from:t(g,_),to:t(g+h.length-1,h.length==1?_+h[0].length:h[h.length-1].length),match:p}}}}function s(e,t,n){for(var r,i=0;i<=e.length;){t.lastIndex=i;var a=t.exec(e);if(!a)break;var o=a.index+a[0].length;if(o>e.length-n)break;(!r||o>r.index+r[0].length)&&(r=a),i=a.index+1}return r}function c(e,n,i){n=r(n,`g`);for(var a=i.line,o=i.ch,c=e.firstLine();a>=c;a--,o=-1){var l=e.getLine(a),u=s(l,n,o<0?0:l.length-o);if(u)return{from:t(a,u.index),to:t(a,u.index+u[0].length),match:u}}}function l(e,n,a){if(!i(n))return c(e,n,a);n=r(n,`gm`);for(var o,l=1,u=e.getLine(a.line).length-a.ch,d=a.line,f=e.firstLine();d>=f;){for(var p=0;p<l&&d>=f;p++){var m=e.getLine(d--);o=o==null?m:m+`
30
+ `+o}l*=2;var h=s(o,n,u);if(h){var g=o.slice(0,h.index).split(`
31
+ `),_=h[0].split(`
32
+ `),v=d+g.length,y=g[g.length-1].length;return{from:t(v,y),to:t(v+_.length-1,_.length==1?y+_[0].length:_[_.length-1].length),match:h}}}}var u,d;String.prototype.normalize?(u=function(e){return e.normalize(`NFD`).toLowerCase()},d=function(e){return e.normalize(`NFD`)}):(u=function(e){return e.toLowerCase()},d=function(e){return e});function f(e,t,n,r){if(e.length==t.length)return n;for(var i=0,a=n+Math.max(0,e.length-t.length);;){if(i==a)return i;var o=i+a>>1,s=r(e.slice(0,o)).length;if(s==n)return o;s>n?a=o:i=o+1}}function p(e,n,r,i){if(!n.length)return null;var a=i?u:d,o=a(n).split(/\r|\n\r?/);search:for(var s=r.line,c=r.ch,l=e.lastLine()+1-o.length;s<=l;s++,c=0){var p=e.getLine(s).slice(c),m=a(p);if(o.length==1){var h=m.indexOf(o[0]);if(h==-1)continue search;var r=f(p,m,h,a)+c;return{from:t(s,f(p,m,h,a)+c),to:t(s,f(p,m,h+o[0].length,a)+c)}}var g=m.length-o[0].length;if(m.slice(g)!=o[0])continue search;for(var _=1;_<o.length-1;_++)if(a(e.getLine(s+_))!=o[_])continue search;var v=e.getLine(s+o.length-1),y=a(v),b=o[o.length-1];if(y.slice(0,b.length)!=b)continue search;return{from:t(s,f(p,m,g,a)+c),to:t(s+o.length-1,f(v,y,b.length,a))}}}function m(e,n,r,i){if(!n.length)return null;var a=i?u:d,o=a(n).split(/\r|\n\r?/);search:for(var s=r.line,c=r.ch,l=e.firstLine()-1+o.length;s>=l;s--,c=-1){var p=e.getLine(s);c>-1&&(p=p.slice(0,c));var m=a(p);if(o.length==1){var h=m.lastIndexOf(o[0]);if(h==-1)continue search;return{from:t(s,f(p,m,h,a)),to:t(s,f(p,m,h+o[0].length,a))}}var g=o[o.length-1];if(m.slice(0,g.length)!=g)continue search;for(var _=1,r=s-o.length+1;_<o.length-1;_++)if(a(e.getLine(r+_))!=o[_])continue search;var v=e.getLine(s+1-o.length),y=a(v);if(y.slice(y.length-o[0].length)!=o[0])continue search;return{from:t(s+1-o.length,f(v,y,v.length-o[0].length,a)),to:t(s,f(p,m,g.length,a))}}}function h(e,n,i,s){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=e,i=i?e.clipPos(i):t(0,0),this.pos={from:i,to:i};var u;typeof s==`object`?u=s.caseFold:(u=s,s=null),typeof n==`string`?(u??=!1,this.matches=function(t,r){return(t?m:p)(e,n,r,u)}):(n=r(n,`gm`),this.matches=!s||s.multiline!==!1?function(t,r){return(t?l:o)(e,n,r)}:function(t,r){return(t?c:a)(e,n,r)})}h.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(n){var r=this.doc.clipPos(n?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(r=t(r.line,r.ch),n?(r.ch--,r.ch<0&&(r.line--,r.ch=(this.doc.getLine(r.line)||``).length)):(r.ch++,r.ch>(this.doc.getLine(r.line)||``).length&&(r.ch=0,r.line++)),e.cmpPos(r,this.doc.clipPos(r))!=0))return this.atOccurrence=!1;var i=this.matches(n,r);if(this.afterEmptyMatch=i&&e.cmpPos(i.from,i.to)==0,i)return this.pos=i,this.atOccurrence=!0,this.pos.match||!0;var a=t(n?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:a,to:a},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(n,r){if(this.atOccurrence){var i=e.splitLines(n);this.doc.replaceRange(i,this.pos.from,this.pos.to,r),this.pos.to=t(this.pos.from.line+i.length-1,i[i.length-1].length+(i.length==1?this.pos.from.ch:0))}}},e.defineExtension(`getSearchCursor`,function(e,t,n){return new h(this.doc,e,t,n)}),e.defineDocExtension(`getSearchCursor`,function(e,t,n){return new h(this,e,t,n)}),e.defineExtension(`selectMatches`,function(t,n){for(var r=[],i=this.getSearchCursor(t,this.getCursor(`from`),n);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor(`to`))>0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)})})})),m=t(((e,t)=>{(function(r){typeof e==`object`&&typeof t==`object`?r(n(),c(),l()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`,`../markdown/markdown`,`../../addon/mode/overlay`],r):r(CodeMirror)})(function(e){var t=/^((?:(?: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;e.defineMode(`gfm`,function(n,r){var i=0;function a(e){return e.code=!1,null}var o={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,n){if(n.combineTokens=null,n.codeBlock)return e.match(/^```+/)?(n.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(n.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),n.codeBlock=!0,null;if(e.peek()==="`"){e.next();var a=e.pos;e.eatWhile("`");var o=1+e.pos-a;return n.code?o===i&&(n.code=!1):(i=o,n.code=!0),null}return n.code?(e.next(),null):e.eatSpace()?(n.ateSpace=!0,null):(e.sol()||n.ateSpace)&&(n.ateSpace=!1,r.gitHubSpice!==!1)&&(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/)||e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))||e.match(t)&&e.string.slice(e.start-2,e.start)!=`](`&&(e.start==0||/\W/.test(e.string.charAt(e.start-1)))?(n.combineTokens=!0,`link`):(e.next(),null)},blankLine:a},s={taskLists:!0,strikethrough:!0,emoji:!0};for(var c in r)s[c]=r[c];return s.name=`markdown`,e.overlayMode(e.getMode(n,s),o)},`markdown`),e.defineMIME(`text/x-gfm`,`gfm`)})})),h=t(((e,t)=>{t.exports={}})),g=t(((t,n)=>{var r;(function(){r=function(e,t,n,r){r||={},this.dictionary=null,this.rules={},this.dictionaryTable=new Map,this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=r.flags||{},this.memoized={},this.loaded=!1;var i=this,a,o,s,c,l;e&&(i.dictionary=e,t&&n?p():(typeof window<`u`?(a=r.dictionaryPath?r.dictionaryPath:`typo/dictionaries`,window.chrome&&window.chrome.runtime&&window.chrome.runtime.getURL?a=window.chrome.runtime.getURL(a):window.browser&&window.browser.runtime&&window.browser.runtime.getURL&&(a=window.browser.runtime.getURL(a))):a=typeof __dirname<`u`?__dirname+`/dictionaries`:`./dictionaries`,t||u(a+`/`+e+`/`+e+`.aff`,d),n||u(a+`/`+e+`/`+e+`.dic`,f)));function u(e,t){var n=i._readFile(e,null,r?.asyncLoad);r?.asyncLoad?n.then(function(e){t(e)}):t(n)}function d(e){t=e,n&&p()}function f(e){n=e,t&&p()}function p(){for(i.rules=i._parseAFF(t),i.compoundRuleCodes={},o=0,c=i.compoundRules.length;o<c;o++){var e=i.compoundRules[o];for(s=0,l=e.length;s<l;s++)i.compoundRuleCodes[e[s]]=[]}for(o in`ONLYINCOMPOUND`in i.flags&&(i.compoundRuleCodes[i.flags.ONLYINCOMPOUND]=[]),i.dictionaryTable=i._parseDIC(n),i.compoundRuleCodes)i.compoundRuleCodes[o].length===0&&delete i.compoundRuleCodes[o];for(o=0,c=i.compoundRules.length;o<c;o++){var a=i.compoundRules[o],u=``;for(s=0,l=a.length;s<l;s++){var d=a[s];d in i.compoundRuleCodes?u+=`(`+i.compoundRuleCodes[d].join(`|`)+`)`:u+=d}i.compoundRules[o]=RegExp(`^`+u+`$`,`i`)}i.loaded=!0,r?.asyncLoad&&r?.loadedCallback&&r.loadedCallback(i)}return this},r.prototype={load:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);return this},_readFile:function(t,n,r){var i;if(n||=`utf8`,typeof XMLHttpRequest<`u`){var a=new XMLHttpRequest;if(a.open(`GET`,t,!!r),(i=a.overrideMimeType)==null||i.call(a,`text/plain; charset=`+n),r){var o=new Promise(function(e,t){a.onload=function(){a.status===200?e(a.responseText):t(a.statusText)},a.onerror=function(){t(a.statusText)}});return a.send(null),o}return a.send(null),a.responseText}if(e!==void 0){var s=h();try{if(s.existsSync(t))return s.readFileSync(t,n);console.log(`Path `+t+` does not exist.`)}catch(e){console.log(e)}return``}return``},_parseAFF:function(e){var t={},n,r,i,a,o,s,c,l,u=e.split(/\r?\n/);for(o=0,c=u.length;o<c;o++)if(n=this._removeAffixComments(u[o]),n=n.trim(),n){var d=n.split(/\s+/),f=d[0];if(f===`PFX`||f===`SFX`){var p=d[1],m=d[2];i=parseInt(d[3],10);var h=[];for(s=o+1,l=o+1+i;s<l;s++){r=u[s],a=r.split(/\s+/);var g=a[2],_=a[3].split(`/`),v=_[0];v===`0`&&(v=``);var y=this.parseRuleCodes(_[1]),b=a[4],x={add:v};y.length>0&&(x.continuationClasses=y),b!==`.`&&(x.match=RegExp(f===`SFX`?b+`$`:`^`+b)),g!=`0`&&(x.remove=f===`SFX`?RegExp(g+`$`):g),h.push(x)}t[p]={type:f,combineable:m===`Y`,entries:h},o+=i}else if(f===`COMPOUNDRULE`){for(i=parseInt(d[1],10),s=o+1,l=o+1+i;s<l;s++)n=u[s],a=n.split(/\s+/),this.compoundRules.push(a[1]);o+=i}else f===`REP`?(a=n.split(/\s+/),a.length===3&&this.replacementTable.push([a[1],a[2]])):this.flags[f]=d[1]}return t},_removeAffixComments:function(e){return e.match(/^\s*#/)?``:e},_parseDIC:function(e){e=this._removeDicComments(e);var t=e.split(/\r?\n/),n=new Map;function r(e,t){n.has(e)||n.set(e,null),t.length>0&&(n.get(e)===null&&n.set(e,[]),n.get(e).push(t))}for(var i=1,a=t.length;i<a;i++){var o=t[i];if(o){var s=o.replace(/\s.*$/,``).split(`/`,2),c=s[0];if(s.length>1){var l=this.parseRuleCodes(s[1]);(!(`NEEDAFFIX`in this.flags)||l.indexOf(this.flags.NEEDAFFIX)===-1)&&r(c,l);for(var u=0,d=l.length;u<d;u++){var f=l[u],p=this.rules[f];if(p)for(var m=this._applyRule(c,p),h=0,g=m.length;h<g;h++){var _=m[h];if(r(_,[]),p.combineable)for(var v=u+1;v<d;v++){var y=l[v],b=this.rules[y];if(b&&b.combineable&&p.type!=b.type)for(var x=this._applyRule(_,b),S=0,C=x.length;S<C;S++){var w=x[S];r(w,[])}}}f in this.compoundRuleCodes&&this.compoundRuleCodes[f].push(c)}}else r(c.trim(),[])}}return n},_removeDicComments:function(e){return e=e.replace(/^\t.*$/gm,``),e},parseRuleCodes:function(e){if(!e)return[];if(!(`FLAG`in this.flags))return e.split(``);if(this.flags.FLAG===`long`){for(var t=[],n=0,r=e.length;n<r;n+=2)t.push(e.substr(n,2));return t}return this.flags.FLAG===`num`?e.split(`,`):this.flags.FLAG===`UTF-8`?Array.from(e):e.split(``)},_applyRule:function(e,t){for(var n=t.entries,r=[],i=0,a=n.length;i<a;i++){var o=n[i];if(!o.match||e.match(o.match)){var s=e;if(o.remove&&(s=s.replace(o.remove,``)),t.type===`SFX`?s+=o.add:s=o.add+s,r.push(s),`continuationClasses`in o)for(var c=0,l=o.continuationClasses.length;c<l;c++){var u=this.rules[o.continuationClasses[c]];u&&(r=r.concat(this._applyRule(s,u)))}}}return r},check:function(e){if(!this.loaded)throw`Dictionary not loaded.`;if(!e)return!1;var t=e.replace(/^\s\s*/,``).replace(/\s\s*$/,``);if(this.checkExact(t))return!0;if(t.toUpperCase()===t){var n=t[0]+t.substring(1).toLowerCase();if(this.hasFlag(n,`KEEPCASE`))return!1;if(this.checkExact(n)||this.checkExact(t.toLowerCase()))return!0}var r=t[0].toLowerCase()+t.substring(1);if(r!==t){if(this.hasFlag(r,`KEEPCASE`))return!1;if(this.checkExact(r))return!0}return!1},checkExact:function(e){if(!this.loaded)throw`Dictionary not loaded.`;var t=this.dictionaryTable.get(e),n,r;if(t===void 0){if(`COMPOUNDMIN`in this.flags&&e.length>=this.flags.COMPOUNDMIN){for(n=0,r=this.compoundRules.length;n<r;n++)if(e.match(this.compoundRules[n]))return!0}}else if(t===null)return!0;else if(typeof t==`object`){for(n=0,r=t.length;n<r;n++)if(!this.hasFlag(e,`ONLYINCOMPOUND`,t[n]))return!0}return!1},hasFlag:function(e,t,n){if(!this.loaded)throw`Dictionary not loaded.`;return!!(t in this.flags&&(n===void 0&&(n=Array.prototype.concat.apply([],this.dictionaryTable.get(e))),n&&n.indexOf(this.flags[t])!==-1))},alphabet:``,suggest:function(e,t){if(!this.loaded)throw`Dictionary not loaded.`;if(t||=5,this.memoized.hasOwnProperty(e)){var n=this.memoized[e].limit;if(t<=n||this.memoized[e].suggestions.length<n)return this.memoized[e].suggestions.slice(0,t)}if(this.check(e))return[];for(var r=0,i=this.replacementTable.length;r<i;r++){var a=this.replacementTable[r];if(e.indexOf(a[0])!==-1){var o=e.replace(a[0],a[1]);if(this.check(o))return[o]}}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 s=this.alphabet.split(``);s.sort();for(var c={},r=0;r<s.length;r++)c[s[r]]=!0;for(var r in this.alphabet=``,c)this.alphabet+=r}var l=this;function u(e,t){var n={},r,i,a,o,s=l.alphabet.length;for(var c in e)for(r=0,a=c.length+1;r<a;r++){var u=[c.substring(0,r),c.substring(r)];if(u[1]&&(o=u[0]+u[1].substring(1),(!t||l.check(o))&&(o in n?n[o]+=1:n[o]=1)),u[1].length>1&&u[1][1]!==u[1][0]&&(o=u[0]+u[1][1]+u[1][0]+u[1].substring(2),(!t||l.check(o))&&(o in n?n[o]+=1:n[o]=1)),u[1]){var d=u[1].substring(0,1).toUpperCase()===u[1].substring(0,1)?`uppercase`:`lowercase`;for(i=0;i<s;i++){var f=l.alphabet[i];d===`uppercase`&&(f=f.toUpperCase()),f!=u[1].substring(0,1)&&(o=u[0]+f+u[1].substring(1),(!t||l.check(o))&&(o in n?n[o]+=1:n[o]=1))}}if(u[1])for(i=0;i<s;i++){var d=u[0].substring(-1).toUpperCase()===u[0].substring(-1)&&u[1].substring(0,1).toUpperCase()===u[1].substring(0,1)?`uppercase`:`lowercase`,f=l.alphabet[i];d===`uppercase`&&(f=f.toUpperCase()),o=u[0]+f+u[1],(!t||l.check(o))&&(o in n?n[o]+=1:n[o]=1)}}return n}function d(e){var n,r=u((n={},n[e]=!0,n)),i=u(r,!0);for(var a in r)l.check(a)&&(a in i?i[a]+=r[a]:i[a]=r[a]);var o,s=[];for(o in i)i.hasOwnProperty(o)&&(l.hasFlag(o,`PRIORITYSUGGEST`)&&(i[o]+=1e3),s.push([o,i[o]]));function c(e,t){var n=e[1],r=t[1];return n<r?-1:n>r?1:t[0].localeCompare(e[0])}s.sort(c).reverse();var d=[],f=`lowercase`;e.toUpperCase()===e?f=`uppercase`:e.substr(0,1).toUpperCase()+e.substr(1).toLowerCase()===e&&(f=`capitalized`);var p=t;for(o=0;o<Math.min(p,s.length);o++)f===`uppercase`?s[o][0]=s[o][0].toUpperCase():f===`capitalized`&&(s[o][0]=s[o][0].substr(0,1).toUpperCase()+s[o][0].substr(1)),!l.hasFlag(s[o][0],`NOSUGGEST`)&&d.indexOf(s[o][0])===-1?d.push(s[o][0]):p++;return d}return this.memoized[e]={suggestions:d(e),limit:t},this.memoized[e].suggestions}}})(),n!==void 0&&(n.exports=r)})),_=t(((e,t)=>{var n=g();function r(e){if(e||={},typeof e.codeMirrorInstance!=`function`||typeof e.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}),e.codeMirrorInstance.defineMode(`spell-checker`,function(t){if(!r.aff_loading){r.aff_loading=!0;var i=new XMLHttpRequest;i.open(`GET`,`https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff`,!0),i.onload=function(){i.readyState===4&&i.status===200&&(r.aff_data=i.responseText,r.num_loaded++,r.num_loaded==2&&(r.typo=new n(`en_US`,r.aff_data,r.dic_data,{platform:`any`})))},i.send(null)}if(!r.dic_loading){r.dic_loading=!0;var a=new XMLHttpRequest;a.open(`GET`,`https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic`,!0),a.onload=function(){a.readyState===4&&a.status===200&&(r.dic_data=a.responseText,r.num_loaded++,r.num_loaded==2&&(r.typo=new n(`en_US`,r.aff_data,r.dic_data,{platform:`any`})))},a.send(null)}var o='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',s={token:function(e){var t=e.peek(),n=``;if(o.includes(t))return e.next(),null;for(;(t=e.peek())!=null&&!o.includes(t);)n+=t,e.next();return r.typo&&!r.typo.check(n)?`spell-error`:null}},c=e.codeMirrorInstance.getMode(t,t.backdrop||`text/plain`);return e.codeMirrorInstance.overlayMode(c,s,!0)})}r.num_loaded=0,r.aff_loading=!1,r.dic_loading=!1,r.aff_data=``,r.dic_data=``,r.typo,t.exports=r})),v=t((e=>{function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}function i(e,t){if(e){if(typeof e==`string`)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}}function a(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=i(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
33
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function c(e){var t=s(e,`string`);return typeof t==`symbol`?t:String(t)}function l(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:``,highlight:null,hooks:null,langPrefix:`language-`,mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults=l();function u(t){e.defaults=t}var d=/[&<>"']/,f=new RegExp(d.source,`g`),p=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,m=new RegExp(p.source,`g`),h={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},g=function(e){return h[e]};function _(e,t){if(t){if(d.test(e))return e.replace(f,g)}else if(p.test(e))return e.replace(m,g);return e}var v=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function y(e){return e.replace(v,function(e,t){return t=t.toLowerCase(),t===`colon`?`:`:t.charAt(0)===`#`?t.charAt(1)===`x`?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):``})}var b=/(^|[^\[])\^/g;function x(e,t){e=typeof e==`string`?e:e.source,t||=``;var n={replace:function(t,r){return r=r.source||r,r=r.replace(b,`$1`),e=e.replace(t,r),n},getRegex:function(){return new RegExp(e,t)}};return n}var S=/[^\w:]/g,C=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function w(e,t,n){if(e){var r;try{r=decodeURIComponent(y(n)).replace(S,``).toLowerCase()}catch{return null}if(r.indexOf(`javascript:`)===0||r.indexOf(`vbscript:`)===0||r.indexOf(`data:`)===0)return null}t&&!C.test(n)&&(n=k(t,n));try{n=encodeURI(n).replace(/%25/g,`%`)}catch{return null}return n}var T={},E=/^[^:]+:\/*[^/]*$/,D=/^([^:]+:)[\s\S]*$/,O=/^([^:]+:\/*[^/]*)[\s\S]*$/;function k(e,t){T[` `+e]||(E.test(e)?T[` `+e]=e+`/`:T[` `+e]=M(e,`/`,!0)),e=T[` `+e];var n=e.indexOf(`:`)===-1;return t.substring(0,2)===`//`?n?t:e.replace(D,`$1`)+t:t.charAt(0)===`/`?n?t:e.replace(O,`$1`)+t:e+t}var A={exec:function(){}};function j(e,t){var n=e.replace(/\|/g,function(e,t,n){for(var r=!1,i=t;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(/ \|/),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,`|`);return n}function M(e,t,n){var r=e.length;if(r===0)return``;for(var i=0;i<r;){var a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function ee(e,t){if(e.indexOf(t[1])===-1)return-1;for(var n=e.length,r=0,i=0;i<n;i++)if(e[i]===`\\`)i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return-1}function te(e){e&&e.sanitize&&!e.silent&&console.warn(`marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options`)}function N(e,t){if(t<1)return``;for(var n=``;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function ne(e,t,n,r){var i=t.href,a=t.title?_(t.title):null,o=e[1].replace(/\\([\[\]])/g,`$1`);if(e[0].charAt(0)!==`!`){r.state.inLink=!0;var s={type:`link`,raw:n,href:i,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,s}return{type:`image`,raw:n,href:i,title:a,text:_(o)}}function P(e,t){var n=e.match(/^(\s+)(?:```)/);if(n===null)return t;var r=n[1];return t.split(`
34
+ `).map(function(e){var t=e.match(/^\s+/);return t===null?e:t[0].length>=r.length?e.slice(r.length):e}).join(`
35
+ `)}var re=function(){function t(t){this.options=t||e.defaults}var n=t.prototype;return n.space=function(e){var t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}},n.code=function(e){var t=this.rules.block.code.exec(e);if(t){var n=t[0].replace(/^ {1,4}/gm,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?n:M(n,`
36
+ `)}}},n.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],r=P(n,t[3]||``);return{type:`code`,raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,`$1`):t[2],text:r}}},n.heading=function(e){var t=this.rules.block.heading.exec(e);if(t){var n=t[2].trim();if(/#$/.test(n)){var r=M(n,`#`);(this.options.pedantic||!r||/ $/.test(r))&&(n=r.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}},n.hr=function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:t[0]}},n.blockquote=function(e){var t=this.rules.block.blockquote.exec(e);if(t){var n=t[0].replace(/^ *>[ \t]?/gm,``),r=this.lexer.state.top;this.lexer.state.top=!0;var i=this.lexer.blockTokens(n);return this.lexer.state.top=r,{type:`blockquote`,raw:t[0],tokens:i,text:n}}},n.list=function(e){var t=this.rules.block.list.exec(e);if(t){var n,r,i,a,o,s,c,l,u,d,f,p,m=t[1].trim(),h=m.length>1,g={type:`list`,raw:``,ordered:h,start:h?+m.slice(0,-1):``,loose:!1,items:[]};m=h?`\\d{1,9}\\`+m.slice(-1):`\\`+m,this.options.pedantic&&(m=h?m:`[*+-]`);for(var _=RegExp(`^( {0,3}`+m+`)((?:[ ][^\\n]*)?(?:\\n|$))`);e&&(p=!1,!(!(t=_.exec(e))||this.rules.block.hr.test(e)));){if(n=t[0],e=e.substring(n.length),l=t[2].split(`
37
+ `,1)[0].replace(/^\t+/,function(e){return` `.repeat(3*e.length)}),u=e.split(`
38
+ `,1)[0],this.options.pedantic?(a=2,f=l.trimLeft()):(a=t[2].search(/[^ ]/),a=a>4?1:a,f=l.slice(a),a+=t[1].length),s=!1,!l&&/^ *$/.test(u)&&(n+=u+`
39
+ `,e=e.substring(u.length+1),p=!0),!p)for(var v=RegExp(`^ {0,`+Math.min(3,a-1)+`}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),y=RegExp(`^ {0,`+Math.min(3,a-1)+`}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),b=RegExp(`^ {0,`+Math.min(3,a-1)+"}(?:```|~~~)"),x=RegExp(`^ {0,`+Math.min(3,a-1)+`}#`);e&&(d=e.split(`
40
+ `,1)[0],u=d,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g,` `)),!(b.test(u)||x.test(u)||v.test(u)||y.test(e)));){if(u.search(/[^ ]/)>=a||!u.trim())f+=`
41
+ `+u.slice(a);else{if(s||l.search(/[^ ]/)>=4||b.test(l)||x.test(l)||y.test(l))break;f+=`
42
+ `+u}!s&&!u.trim()&&(s=!0),n+=d+`
43
+ `,e=e.substring(d.length+1),l=u.slice(a)}g.loose||(c?g.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(f),r&&(i=r[0]!==`[ ] `,f=f.replace(/^\[[ xX]\] +/,``))),g.items.push({type:`list_item`,raw:n,task:!!r,checked:i,loose:!1,text:f}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=f.trimRight(),g.raw=g.raw.trimRight();var S=g.items.length;for(o=0;o<S;o++)if(this.lexer.state.top=!1,g.items[o].tokens=this.lexer.blockTokens(g.items[o].text,[]),!g.loose){var C=g.items[o].tokens.filter(function(e){return e.type===`space`});g.loose=C.length>0&&C.some(function(e){return/\n.*\n/.test(e.raw)})}if(g.loose)for(o=0;o<S;o++)g.items[o].loose=!0;return g}},n.html=function(e){var t=this.rules.block.html.exec(e);if(t){var n={type:`html`,raw:t[0],pre:!this.options.sanitizer&&(t[1]===`pre`||t[1]===`script`||t[1]===`style`),text:t[0]};if(this.options.sanitize){var r=this.options.sanitizer?this.options.sanitizer(t[0]):_(t[0]);n.type=`paragraph`,n.text=r,n.tokens=this.lexer.inline(r)}return n}},n.def=function(e){var t=this.rules.block.def.exec(e);if(t){var n=t[1].toLowerCase().replace(/\s+/g,` `),r=t[2]?t[2].replace(/^<(.*)>$/,`$1`).replace(this.rules.inline._escapes,`$1`):``,i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,`$1`):t[3];return{type:`def`,tag:n,raw:t[0],href:r,title:i}}},n.table=function(e){var t=this.rules.block.table.exec(e);if(t){var n={type:`table`,header:j(t[1]).map(function(e){return{text:e}}),align:t[2].replace(/^ *|\| *$/g,``).split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,``).split(`
44
+ `):[]};if(n.header.length===n.align.length){n.raw=t[0];var r=n.align.length,i,a,o,s;for(i=0;i<r;i++)/^ *-+: *$/.test(n.align[i])?n.align[i]=`right`:/^ *:-+: *$/.test(n.align[i])?n.align[i]=`center`:/^ *:-+ *$/.test(n.align[i])?n.align[i]=`left`:n.align[i]=null;for(r=n.rows.length,i=0;i<r;i++)n.rows[i]=j(n.rows[i],n.header.length).map(function(e){return{text:e}});for(r=n.header.length,a=0;a<r;a++)n.header[a].tokens=this.lexer.inline(n.header[a].text);for(r=n.rows.length,a=0;a<r;a++)for(s=n.rows[a],o=0;o<s.length;o++)s[o].tokens=this.lexer.inline(s[o].text);return n}}},n.lheading=function(e){var t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}},n.paragraph=function(e){var t=this.rules.block.paragraph.exec(e);if(t){var n=t[1].charAt(t[1].length-1)===`
45
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:n,tokens:this.lexer.inline(n)}}},n.text=function(e){var t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}},n.escape=function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:_(t[1])}},n.tag=function(e){var t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?`text`:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):_(t[0]):t[0]}},n.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var n=t[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;var r=M(n.slice(0,-1),`\\`);if((n.length-r.length)%2==0)return}else{var i=ee(t[2],`()`);if(i>-1){var a=(t[0].indexOf(`!`)===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,a).trim(),t[3]=``}}var o=t[2],s=``;if(this.options.pedantic){var c=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);c&&(o=c[1],s=c[3])}else s=t[3]?t[3].slice(1,-1):``;return o=o.trim(),/^</.test(o)&&(o=this.options.pedantic&&!/>$/.test(n)?o.slice(1):o.slice(1,-1)),ne(t,{href:o&&o.replace(this.rules.inline._escapes,`$1`),title:s&&s.replace(this.rules.inline._escapes,`$1`)},t[0],this.lexer)}},n.reflink=function(e,t){var n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){var r=(n[2]||n[1]).replace(/\s+/g,` `);if(r=t[r.toLowerCase()],!r){var i=n[0].charAt(0);return{type:`text`,raw:i,text:i}}return ne(n,r,n[0],this.lexer)}},n.emStrong=function(e,t,n){n===void 0&&(n=``);var r=this.rules.inline.emStrong.lDelim.exec(e);if(r&&!(r[3]&&n.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var i=r[1]||r[2]||``;if(!i||i&&(n===``||this.rules.inline.punctuation.exec(n))){var a=r[0].length-1,o,s,c=a,l=0,u=r[0][0]===`*`?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+a);(r=u.exec(t))!=null;)if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],o){if(s=o.length,r[3]||r[4]){c+=s;continue}if((r[5]||r[6])&&a%3&&!((a+s)%3)){l+=s;continue}if(c-=s,!(c>0)){s=Math.min(s,s+c+l);var d=e.slice(0,a+r.index+(r[0].length-o.length)+s);if(Math.min(a,s)%2){var f=d.slice(1,-1);return{type:`em`,raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}var p=d.slice(2,-2);return{type:`strong`,raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}}}}},n.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[2].replace(/\n/g,` `),r=/[^ ]/.test(n),i=/^ /.test(n)&&/ $/.test(n);return r&&i&&(n=n.substring(1,n.length-1)),n=_(n,!0),{type:`codespan`,raw:t[0],text:n}}},n.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}},n.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}},n.autolink=function(e,t){var n=this.rules.inline.autolink.exec(e);if(n){var r,i;return n[2]===`@`?(r=_(this.options.mangle?t(n[1]):n[1]),i=`mailto:`+r):(r=_(n[1]),i=r),{type:`link`,raw:n[0],text:r,href:i,tokens:[{type:`text`,raw:r,text:r}]}}},n.url=function(e,t){var n;if(n=this.rules.inline.url.exec(e)){var r,i;if(n[2]===`@`)r=_(this.options.mangle?t(n[0]):n[0]),i=`mailto:`+r;else{var a;do a=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(a!==n[0]);r=_(n[0]),i=n[1]===`www.`?`http://`+n[0]:n[0]}return{type:`link`,raw:n[0],text:r,href:i,tokens:[{type:`text`,raw:r,text:r}]}}},n.inlineText=function(e,t){var n=this.rules.inline.text.exec(e);if(n){var r=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):_(n[0]):n[0]:_(this.options.smartypants?t(n[0]):n[0]);return{type:`text`,raw:n[0],text:r}}},t}(),F={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))`,def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:A,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};F._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,F._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,F.def=x(F.def).replace(`label`,F._label).replace(`title`,F._title).getRegex(),F.bullet=/(?:[*+-]|\d{1,9}[.)])/,F.listItemStart=x(/^( *)(bull) */).replace(`bull`,F.bullet).getRegex(),F.list=x(F.list).replace(/bull/g,F.bullet).replace(`hr`,`\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))`).replace(`def`,`\\n+(?=`+F.def.source+`)`).getRegex(),F._tag=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,F._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,F.html=x(F.html,`i`).replace(`comment`,F._comment).replace(`tag`,F._tag).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),F.paragraph=x(F._paragraph).replace(`hr`,F.hr).replace(`heading`,` {0,3}#{1,6} `).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,F._tag).getRegex(),F.blockquote=x(F.blockquote).replace(`paragraph`,F.paragraph).getRegex(),F.normal=r({},F),F.gfm=r({},F.normal,{table:`^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`}),F.gfm.table=x(F.gfm.table).replace(`hr`,F.hr).replace(`heading`,` {0,3}#{1,6} `).replace(`blockquote`,` {0,3}>`).replace(`code`,` {4}[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,F._tag).getRegex(),F.gfm.paragraph=x(F._paragraph).replace(`hr`,F.hr).replace(`heading`,` {0,3}#{1,6} `).replace(`|lheading`,``).replace(`table`,F.gfm.table).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,F._tag).getRegex(),F.pedantic=r({},F.normal,{html:x(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,F._comment).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:A,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:x(F.normal._paragraph).replace(`hr`,F.hr).replace(`heading`,` *#{1,6} *[^
46
+ ]`).replace(`lheading`,F.lheading).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).getRegex()});var I={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:A,tag:`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`,link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:`reflink|nolink(?!\\()`,emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:A,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};I._punctuation=`!"#$%&'()+\\-.,/:;<=>?@\\[\\]\`^{|}~`,I.punctuation=x(I.punctuation).replace(/punctuation/g,I._punctuation).getRegex(),I.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,I.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,I._comment=x(F._comment).replace(`(?:-->|$)`,`-->`).getRegex(),I.emStrong.lDelim=x(I.emStrong.lDelim).replace(/punct/g,I._punctuation).getRegex(),I.emStrong.rDelimAst=x(I.emStrong.rDelimAst,`g`).replace(/punct/g,I._punctuation).getRegex(),I.emStrong.rDelimUnd=x(I.emStrong.rDelimUnd,`g`).replace(/punct/g,I._punctuation).getRegex(),I._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,I._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,I._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,I.autolink=x(I.autolink).replace(`scheme`,I._scheme).replace(`email`,I._email).getRegex(),I._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,I.tag=x(I.tag).replace(`comment`,I._comment).replace(`attribute`,I._attribute).getRegex(),I._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,I._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,I._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,I.link=x(I.link).replace(`label`,I._label).replace(`href`,I._href).replace(`title`,I._title).getRegex(),I.reflink=x(I.reflink).replace(`label`,I._label).replace(`ref`,F._label).getRegex(),I.nolink=x(I.nolink).replace(`ref`,F._label).getRegex(),I.reflinkSearch=x(I.reflinkSearch,`g`).replace(`reflink`,I.reflink).replace(`nolink`,I.nolink).getRegex(),I.normal=r({},I),I.pedantic=r({},I.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:x(/^!?\[(label)\]\((.*?)\)/).replace(`label`,I._label).getRegex(),reflink:x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,I._label).getRegex()}),I.gfm=r({},I.normal,{escape:x(I.escape).replace(`])`,`~|])`).getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),I.gfm.url=x(I.gfm.url,`i`).replace(`email`,I.gfm._extended_email).getRegex(),I.breaks=r({},I.gfm,{br:x(I.br).replace(`{2,}`,`*`).getRegex(),text:x(I.gfm.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()});function ie(e){return e.replace(/---/g,`—`).replace(/--/g,`–`).replace(/(^|[-\u2014/(\[{"\s])'/g,`$1‘`).replace(/'/g,`’`).replace(/(^|[-\u2014/(\[{\u2018\s])"/g,`$1“`).replace(/"/g,`”`).replace(/\.{3}/g,`…`)}function L(e){var t=``,n,r,i=e.length;for(n=0;n<i;n++)r=e.charCodeAt(n),Math.random()>.5&&(r=`x`+r.toString(16)),t+=`&#`+r+`;`;return t}var R=function(){function t(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||e.defaults,this.options.tokenizer=this.options.tokenizer||new re,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var n={block:F.normal,inline:I.normal};this.options.pedantic?(n.block=F.pedantic,n.inline=I.pedantic):this.options.gfm&&(n.block=F.gfm,n.inline=this.options.breaks?I.breaks:I.gfm),this.tokenizer.rules=n}t.lex=function(e,n){return new t(n).lex(e)},t.lexInline=function(e,n){return new t(n).inlineTokens(e)};var r=t.prototype;return r.lex=function(e){e=e.replace(/\r\n|\r/g,`
47
+ `),this.blockTokens(e,this.tokens);for(var t;t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens},r.blockTokens=function(e,t){var n=this;t===void 0&&(t=[]),e=this.options.pedantic?e.replace(/\t/g,` `).replace(/^ +$/gm,``):e.replace(/^( *)(\t+)/gm,function(e,t,n){return t+` `.repeat(n.length)});for(var r,i,a,o;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(i){return(r=i.call({lexer:n},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1}))){if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length),r.raw.length===1&&t.length>0?t[t.length-1].raw+=`
48
+ `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&(i.type===`paragraph`||i.type===`text`)?(i.raw+=`
49
+ `+r.raw,i.text+=`
50
+ `+r.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&(i.type===`paragraph`||i.type===`text`)?(i.raw+=`
51
+ `+r.raw,i.text+=`
52
+ `+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(a=e,this.options.extensions&&this.options.extensions.startBlock&&(function(){var t=1/0,r=e.slice(1),i=void 0;n.options.extensions.startBlock.forEach(function(e){i=e.call({lexer:this},r),typeof i==`number`&&i>=0&&(t=Math.min(t,i))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))})(),this.state.top&&(r=this.tokenizer.paragraph(a))){i=t[t.length-1],o&&i.type===`paragraph`?(i.raw+=`
53
+ `+r.raw,i.text+=`
54
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r),o=a.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&i.type===`text`?(i.raw+=`
55
+ `+r.raw,i.text+=`
56
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r);continue}if(e){var s=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(s);break}throw Error(s)}}return this.state.top=!0,t},r.inline=function(e,t){return t===void 0&&(t=[]),this.inlineQueue.push({src:e,tokens:t}),t},r.inlineTokens=function(e,t){var n=this;t===void 0&&(t=[]);var r,i,a,o=e,s,c,l;if(this.tokens.links){var u=Object.keys(this.tokens.links);if(u.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)u.includes(s[0].slice(s[0].lastIndexOf(`[`)+1,-1))&&(o=o.slice(0,s.index)+`[`+N(`a`,s[0].length-2)+`]`+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,s.index)+`[`+N(`a`,s[0].length-2)+`]`+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.escapedEmSt.exec(o))!=null;)o=o.slice(0,s.index+s[0].length-2)+`++`+o.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(c||(l=``),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(i){return(r=i.call({lexer:n},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1}))){if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&r.type===`text`&&i.type===`text`?(i.raw+=r.raw,i.text+=r.text):t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length),i=t[t.length-1],i&&r.type===`text`&&i.type===`text`?(i.raw+=r.raw,i.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,o,l)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e,L)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e,L))){e=e.substring(r.raw.length),t.push(r);continue}if(a=e,this.options.extensions&&this.options.extensions.startInline&&(function(){var t=1/0,r=e.slice(1),i=void 0;n.options.extensions.startInline.forEach(function(e){i=e.call({lexer:this},r),typeof i==`number`&&i>=0&&(t=Math.min(t,i))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))})(),r=this.tokenizer.inlineText(a,ie)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(l=r.raw.slice(-1)),c=!0,i=t[t.length-1],i&&i.type===`text`?(i.raw+=r.raw,i.text+=r.text):t.push(r);continue}if(e){var d=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(d);break}throw Error(d)}}return t},n(t,null,[{key:`rules`,get:function(){return{block:F,inline:I}}}]),t}(),ae=function(){function t(t){this.options=t||e.defaults}var n=t.prototype;return n.code=function(e,t,n){var r=(t||``).match(/\S*/)[0];if(this.options.highlight){var i=this.options.highlight(e,r);i!=null&&i!==e&&(n=!0,e=i)}return e=e.replace(/\n$/,``)+`
57
+ `,r?`<pre><code class="`+this.options.langPrefix+_(r)+`">`+(n?e:_(e,!0))+`</code></pre>
58
+ `:`<pre><code>`+(n?e:_(e,!0))+`</code></pre>
59
+ `},n.blockquote=function(e){return`<blockquote>
60
+ `+e+`</blockquote>
61
+ `},n.html=function(e){return e},n.heading=function(e,t,n,r){if(this.options.headerIds){var i=this.options.headerPrefix+r.slug(n);return`<h`+t+` id="`+i+`">`+e+`</h`+t+`>
62
+ `}return`<h`+t+`>`+e+`</h`+t+`>
63
+ `},n.hr=function(){return this.options.xhtml?`<hr/>
64
+ `:`<hr>
65
+ `},n.list=function(e,t,n){var r=t?`ol`:`ul`,i=t&&n!==1?` start="`+n+`"`:``;return`<`+r+i+`>
66
+ `+e+`</`+r+`>
67
+ `},n.listitem=function(e){return`<li>`+e+`</li>
68
+ `},n.checkbox=function(e){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"`+(this.options.xhtml?` /`:``)+`> `},n.paragraph=function(e){return`<p>`+e+`</p>
69
+ `},n.table=function(e,t){return t&&=`<tbody>`+t+`</tbody>`,`<table>
70
+ <thead>
71
+ `+e+`</thead>
72
+ `+t+`</table>
73
+ `},n.tablerow=function(e){return`<tr>
74
+ `+e+`</tr>
75
+ `},n.tablecell=function(e,t){var n=t.header?`th`:`td`;return(t.align?`<`+n+` align="`+t.align+`">`:`<`+n+`>`)+e+(`</`+n+`>
76
+ `)},n.strong=function(e){return`<strong>`+e+`</strong>`},n.em=function(e){return`<em>`+e+`</em>`},n.codespan=function(e){return`<code>`+e+`</code>`},n.br=function(){return this.options.xhtml?`<br/>`:`<br>`},n.del=function(e){return`<del>`+e+`</del>`},n.link=function(e,t,n){if(e=w(this.options.sanitize,this.options.baseUrl,e),e===null)return n;var r=`<a href="`+e+`"`;return t&&(r+=` title="`+t+`"`),r+=`>`+n+`</a>`,r},n.image=function(e,t,n){if(e=w(this.options.sanitize,this.options.baseUrl,e),e===null)return n;var r=`<img src="`+e+`" alt="`+n+`"`;return t&&(r+=` title="`+t+`"`),r+=this.options.xhtml?`/>`:`>`,r},n.text=function(e){return e},t}(),z=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,n){return``+n},t.image=function(e,t,n){return``+n},t.br=function(){return``},e}(),oe=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,``).replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,``).replace(/\s/g,`-`)},t.getNextSafeSlug=function(e,t){var n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do r++,n=e+`-`+r;while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n},t.slug=function(e,t){t===void 0&&(t={});var n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)},e}(),se=function(){function t(t){this.options=t||e.defaults,this.options.renderer=this.options.renderer||new ae,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new z,this.slugger=new oe}t.parse=function(e,n){return new t(n).parse(e)},t.parseInline=function(e,n){return new t(n).parseInline(e)};var n=t.prototype;return n.parse=function(e,t){t===void 0&&(t=!0);var n=``,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,b,x,S,C=e.length;for(r=0;r<C;r++){if(f=e[r],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[f.type]&&(S=this.options.extensions.renderers[f.type].call({parser:this},f),S!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`paragraph`,`text`].includes(f.type))){n+=S||``;continue}switch(f.type){case`space`:continue;case`hr`:n+=this.renderer.hr();continue;case`heading`:n+=this.renderer.heading(this.parseInline(f.tokens),f.depth,y(this.parseInline(f.tokens,this.textRenderer)),this.slugger);continue;case`code`:n+=this.renderer.code(f.text,f.lang,f.escaped);continue;case`table`:for(u=``,l=``,o=f.header.length,i=0;i<o;i++)l+=this.renderer.tablecell(this.parseInline(f.header[i].tokens),{header:!0,align:f.align[i]});for(u+=this.renderer.tablerow(l),d=``,o=f.rows.length,i=0;i<o;i++){for(c=f.rows[i],l=``,s=c.length,a=0;a<s;a++)l+=this.renderer.tablecell(this.parseInline(c[a].tokens),{header:!1,align:f.align[a]});d+=this.renderer.tablerow(l)}n+=this.renderer.table(u,d);continue;case`blockquote`:d=this.parse(f.tokens),n+=this.renderer.blockquote(d);continue;case`list`:for(p=f.ordered,m=f.start,h=f.loose,o=f.items.length,d=``,i=0;i<o;i++)_=f.items[i],v=_.checked,b=_.task,g=``,_.task&&(x=this.renderer.checkbox(v),h?_.tokens.length>0&&_.tokens[0].type===`paragraph`?(_.tokens[0].text=x+` `+_.tokens[0].text,_.tokens[0].tokens&&_.tokens[0].tokens.length>0&&_.tokens[0].tokens[0].type===`text`&&(_.tokens[0].tokens[0].text=x+` `+_.tokens[0].tokens[0].text)):_.tokens.unshift({type:`text`,text:x}):g+=x),g+=this.parse(_.tokens,h),d+=this.renderer.listitem(g,b,v);n+=this.renderer.list(d,p,m);continue;case`html`:n+=this.renderer.html(f.text);continue;case`paragraph`:n+=this.renderer.paragraph(this.parseInline(f.tokens));continue;case`text`:for(d=f.tokens?this.parseInline(f.tokens):f.text;r+1<C&&e[r+1].type===`text`;)f=e[++r],d+=`
77
+ `+(f.tokens?this.parseInline(f.tokens):f.text);n+=t?this.renderer.paragraph(d):d;continue;default:var w=`Token with "`+f.type+`" type was not found.`;if(this.options.silent){console.error(w);return}throw Error(w)}}return n},n.parseInline=function(e,t){t||=this.renderer;var n=``,r,i,a,o=e.length;for(r=0;r<o;r++){if(i=e[r],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]&&(a=this.options.extensions.renderers[i.type].call({parser:this},i),a!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type))){n+=a||``;continue}switch(i.type){case`escape`:n+=t.text(i.text);break;case`html`:n+=t.html(i.text);break;case`link`:n+=t.link(i.href,i.title,this.parseInline(i.tokens,t));break;case`image`:n+=t.image(i.href,i.title,i.text);break;case`strong`:n+=t.strong(this.parseInline(i.tokens,t));break;case`em`:n+=t.em(this.parseInline(i.tokens,t));break;case`codespan`:n+=t.codespan(i.text);break;case`br`:n+=t.br();break;case`del`:n+=t.del(this.parseInline(i.tokens,t));break;case`text`:n+=t.text(i.text);break;default:var s=`Token with "`+i.type+`" type was not found.`;if(this.options.silent){console.error(s);return}throw Error(s)}}return n},t}(),ce=function(){function t(t){this.options=t||e.defaults}var n=t.prototype;return n.preprocess=function(e){return e},n.postprocess=function(e){return e},t}();ce.passThroughHooks=new Set([`preprocess`,`postprocess`]);function le(e,t,n){return function(r){if(r.message+=`
78
+ Please report this to https://github.com/markedjs/marked.`,e){var i=`<p>An error occurred:</p><pre>`+_(r.message+``,!0)+`</pre>`;if(t)return Promise.resolve(i);if(n){n(null,i);return}return i}if(t)return Promise.reject(r);if(n){n(r);return}throw r}}function ue(e,t){return function(n,i,a){typeof i==`function`&&(a=i,i=null);var o=r({},i);i=r({},B.defaults,o);var s=le(i.silent,i.async,a);if(n==null)return s(Error(`marked(): input parameter is undefined or null`));if(typeof n!=`string`)return s(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(n)+`, string expected`));if(te(i),i.hooks&&(i.hooks.options=i),a){var c=i.highlight,l;try{i.hooks&&(n=i.hooks.preprocess(n)),l=e(n,i)}catch(e){return s(e)}var u=function(e){var n;if(!e)try{i.walkTokens&&B.walkTokens(l,i.walkTokens),n=t(l,i),i.hooks&&(n=i.hooks.postprocess(n))}catch(t){e=t}return i.highlight=c,e?s(e):a(null,n)};if(!c||c.length<3||(delete i.highlight,!l.length))return u();var d=0;B.walkTokens(l,function(e){e.type===`code`&&(d++,setTimeout(function(){c(e.text,e.lang,function(t,n){if(t)return u(t);n!=null&&n!==e.text&&(e.text=n,e.escaped=!0),d--,d===0&&u()})},0))}),d===0&&u();return}if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(function(t){return e(t,i)}).then(function(e){return i.walkTokens?Promise.all(B.walkTokens(e,i.walkTokens)).then(function(){return e}):e}).then(function(e){return t(e,i)}).then(function(e){return i.hooks?i.hooks.postprocess(e):e}).catch(s);try{i.hooks&&(n=i.hooks.preprocess(n));var f=e(n,i);i.walkTokens&&B.walkTokens(f,i.walkTokens);var p=t(f,i);return i.hooks&&(p=i.hooks.postprocess(p)),p}catch(e){return s(e)}}}function B(e,t,n){return ue(R.lex,se.parse)(e,t,n)}B.options=B.setOptions=function(e){return B.defaults=r({},B.defaults,e),u(B.defaults),B},B.getDefaults=l,B.defaults=e.defaults,B.use=function(){var e=B.defaults.extensions||{renderers:{},childTokens:{}};[...arguments].forEach(function(t){var n=r({},t);if(n.async=B.defaults.async||n.async||!1,t.extensions&&(t.extensions.forEach(function(t){if(!t.name)throw Error(`extension name required`);if(t.renderer){var n=e.renderers[t.name];n?e.renderers[t.name]=function(){var e=[...arguments],r=t.renderer.apply(this,e);return r===!1&&(r=n.apply(this,e)),r}:e.renderers[t.name]=t.renderer}if(t.tokenizer){if(!t.level||t.level!==`block`&&t.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);e[t.level]?e[t.level].unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&(t.level===`block`?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:t.level===`inline`&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),n.extensions=e),t.renderer&&(function(){var e=B.defaults.renderer||new ae,r=function(n){var r=e[n];e[n]=function(){var i=[...arguments],a=t.renderer[n].apply(e,i);return a===!1&&(a=r.apply(e,i)),a}};for(var i in t.renderer)r(i);n.renderer=e})(),t.tokenizer&&(function(){var e=B.defaults.tokenizer||new re,r=function(n){var r=e[n];e[n]=function(){var i=[...arguments],a=t.tokenizer[n].apply(e,i);return a===!1&&(a=r.apply(e,i)),a}};for(var i in t.tokenizer)r(i);n.tokenizer=e})(),t.hooks&&(function(){var e=B.defaults.hooks||new ce,r=function(n){var r=e[n];e[n]=ce.passThroughHooks.has(n)?function(i){if(B.defaults.async)return Promise.resolve(t.hooks[n].call(e,i)).then(function(t){return r.call(e,t)});var a=t.hooks[n].call(e,i);return r.call(e,a)}:function(){var i=[...arguments],a=t.hooks[n].apply(e,i);return a===!1&&(a=r.apply(e,i)),a}};for(var i in t.hooks)r(i);n.hooks=e})(),t.walkTokens){var i=B.defaults.walkTokens;n.walkTokens=function(e){var n=[];return n.push(t.walkTokens.call(this,e)),i&&(n=n.concat(i.call(this,e))),n}}B.setOptions(n)})},B.walkTokens=function(e,t){for(var n=[],r=function(){var e=a.value;switch(n=n.concat(t.call(B,e)),e.type){case`table`:for(var r=o(e.header),i;!(i=r()).done;){var s=i.value;n=n.concat(B.walkTokens(s.tokens,t))}for(var c=o(e.rows),l;!(l=c()).done;)for(var u=l.value,d=o(u),f;!(f=d()).done;){var p=f.value;n=n.concat(B.walkTokens(p.tokens,t))}break;case`list`:n=n.concat(B.walkTokens(e.items,t));break;default:B.defaults.extensions&&B.defaults.extensions.childTokens&&B.defaults.extensions.childTokens[e.type]?B.defaults.extensions.childTokens[e.type].forEach(function(r){n=n.concat(B.walkTokens(e[r],t))}):e.tokens&&(n=n.concat(B.walkTokens(e.tokens,t)))}},i=o(e),a;!(a=i()).done;)r();return n},B.parseInline=ue(R.lexInline,se.parseInline),B.Parser=se,B.parser=se.parse,B.Renderer=ae,B.TextRenderer=z,B.Lexer=R,B.lexer=R.lex,B.Tokenizer=re,B.Slugger=oe,B.Hooks=ce,B.parse=B;var de=B.options,fe=B.setOptions,V=B.use,pe=B.walkTokens,me=B.parseInline,he=B,ge=se.parse,_e=R.lex;e.Hooks=ce,e.Lexer=R,e.Parser=se,e.Renderer=ae,e.Slugger=oe,e.TextRenderer=z,e.Tokenizer=re,e.getDefaults=l,e.lexer=_e,e.marked=B,e.options=de,e.parse=he,e.parseInline=me,e.parser=ge,e.setOptions=fe,e.use=V,e.walkTokens=pe})),y=t(((e,t)=>{var s=n();r(),i(),a(),c(),l(),u(),d(),f(),p(),m(),o();var h=_(),g=v().marked,y=/Mac/.test(navigator.platform),b=new RegExp(/(<a.*?https?:\/\/.*?[^a]>)+?/g),x={toggleBold:N,toggleItalic:ne,drawLink:de,toggleHeadingSmaller:I,toggleHeadingBigger:ie,drawImage:fe,toggleBlockquote:F,toggleOrderedList:le,toggleUnorderedList:ce,toggleCheckList:ue,toggleCodeBlock:re,togglePreview:be,toggleStrikethrough:P,toggleHeading1:L,toggleHeading2:R,toggleHeading3:ae,toggleHeading4:z,toggleHeading5:oe,toggleHeading6:se,cleanBlock:B,drawTable:he,drawHorizontalRule:ge,undo:_e,redo:ve,toggleSideBySide:ye,toggleFullScreen:te},S={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`,toggleCheckList:`Shift-Cmd-L`,toggleCodeBlock:`Cmd-Alt-C`,togglePreview:`Cmd-P`,toggleSideBySide:`F9`,toggleFullScreen:`F11`},C=function(e){for(var t in x)if(x[t]===e)return t;return null},w=function(){var e=!1;return(function(t){(/(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(t)||/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(t.substr(0,4)))&&(e=!0)})(navigator.userAgent||navigator.vendor||window.opera),e};function T(e){for(var t;(t=b.exec(e))!==null;){var n=t[0];if(n.indexOf(`target=`)===-1){var r=n.replace(/>$/,` target="_blank">`);e=e.replace(n,r)}}return e}function E(e){for(var t=new DOMParser().parseFromString(e,`text/html`),n=t.getElementsByTagName(`li`),r=0;r<n.length;r++)for(var i=n[r],a=0;a<i.children.length;a++){var o=i.children[a];o instanceof HTMLInputElement&&o.type===`checkbox`&&(i.style.marginLeft=`-1.5em`,i.style.listStyleType=`none`)}return t.documentElement.innerHTML}function D(e){return e=y?e.replace(`Ctrl`,`Cmd`):e.replace(`Cmd`,`Ctrl`),e}function O(e,t,n,r){var i=k(e,!1,t,n,`button`,r);i.classList.add(`easymde-dropdown`),i.onclick=function(){i.focus()};var a=document.createElement(`div`);a.className=`easymde-dropdown-content`;for(var o=0;o<e.children.length;o++){var s=e.children[o],c=typeof s==`string`&&s in je?k(je[s],!0,t,n,`button`,r):k(s,!0,t,n,`button`,r);c.addEventListener(`click`,function(e){e.stopPropagation()},!1),a.appendChild(c)}return i.appendChild(a),i}function k(e,t,n,r,i,a){e||={};var o=document.createElement(i);if(e.attributes)for(var s in e.attributes)Object.prototype.hasOwnProperty.call(e.attributes,s)&&o.setAttribute(s,e.attributes[s]);o.className=(a.options.toolbarButtonClassPrefix?a.options.toolbarButtonClassPrefix+`-`:``)+e.name,o.setAttribute(`type`,i),n??=!0,e.text&&(o.innerText=e.text),e.name&&e.name in r&&(x[e.name]=e.action),e.title&&n&&(o.title=j(e.title,e.action,r),y&&(o.title=o.title.replace(`Ctrl`,`⌘`),o.title=o.title.replace(`Alt`,`⌥`))),e.title&&o.setAttribute(`aria-label`,e.title),e.noDisable&&o.classList.add(`no-disable`),e.noMobile&&o.classList.add(`no-mobile`);var c=[];e.className!==void 0&&(c=e.className.split(` `));for(var l=[],u=0;u<c.length;u++){var d=c[u];d.match(/^fa([srlb]|(-[\w-]*)|$)/)?l.push(d):o.classList.add(d)}if(o.tabIndex=-1,l.length>0){for(var f=document.createElement(`i`),p=0;p<l.length;p++){var m=l[p];f.classList.add(m)}o.appendChild(f)}return e.icon!==void 0&&(o.innerHTML=e.icon),e.action&&t&&(typeof e.action==`function`?o.onclick=function(t){t.preventDefault(),e.action(a)}:typeof e.action==`string`&&(o.onclick=function(t){t.preventDefault(),window.open(e.action,`_blank`)})),o}function A(){var e=document.createElement(`i`);return e.className=`separator`,e.innerHTML=`|`,e}function j(e,t,n){var r,i=e;return t&&(r=C(t),n[r]&&(i+=` (`+D(n[r])+`)`)),i}function M(e,t){t||=e.getCursor(`start`);var n=e.getTokenAt(t);if(!n.type)return{};for(var r=n.type.split(` `),i={},a,o,s=0;s<r.length;s++)a=r[s],a===`strong`?i.bold=!0:a===`variable-2`?(o=e.getLine(t.line),/^\s*\d+\.\s/.test(o)?i[`ordered-list`]=!0:/^\s*- \[[ xX]]\s/.test(o)?i[`check-list`]=!0:i[`unordered-list`]=!0):a===`atom`?i.quote=!0:a===`em`?i.italic=!0:a===`quote`?i.quote=!0:a===`strikethrough`?i.strikethrough=!0:a===`comment`?i.code=!0:a===`link`&&!i.image?i.link=!0:a===`image`?i.image=!0:a.match(/^header(-[1-6])?$/)&&(i[a.replace(`header`,`heading`)]=!0);return i}var ee=``;function te(e){var t=e.codemirror;t.setOption(`fullScreen`,!t.getOption(`fullScreen`)),t.getOption(`fullScreen`)?(ee=document.body.style.overflow,document.body.style.overflow=`hidden`):document.body.style.overflow=ee;var n=t.getWrapperElement(),r=n.nextSibling;if(r.classList.contains(`editor-preview-active-side`)){if(e.options.sideBySideFullscreen===!1){var i=n.parentNode;t.getOption(`fullScreen`)?i.classList.remove(`sided--no-fullscreen`):i.classList.add(`sided--no-fullscreen`)}else ye(e)}e.options.onToggleFullScreen&&e.options.onToggleFullScreen(t.getOption(`fullScreen`)||!1),e.options.maxHeight!==void 0&&(t.getOption(`fullScreen`)?(t.getScrollerElement().style.removeProperty(`height`),r.style.removeProperty(`height`)):(t.getScrollerElement().style.height=e.options.maxHeight,e.setPreviewMaxHeight())),e.toolbar_div.classList.toggle(`fullscreen`),e.toolbarElements&&e.toolbarElements.fullscreen&&e.toolbarElements.fullscreen.classList.toggle(`active`)}function N(e){Te(e,`bold`,e.options.blockStyles.bold)}function ne(e){Te(e,`italic`,e.options.blockStyles.italic)}function P(e){Te(e,`strikethrough`,`~~`)}function re(e){var t=e.options.blockStyles.code;function n(e){if(typeof e!=`object`)throw`fencing_line() takes a 'line' object (not a line number, or line text). Got: `+typeof e+`: `+e;return e.styles&&e.styles[2]&&e.styles[2].indexOf(`formatting-code-block`)!==-1}function r(e){return e.state.base.base||e.state.base}function i(e,t,i,a,o){i||=e.getLineHandle(t),a||=e.getTokenAt({line:t,ch:1}),o||=!!i.text&&e.getTokenAt({line:t,ch:i.text.length-1});var s=a.type?a.type.split(` `):[];return o&&r(o).indentedCode?`indented`:s.indexOf(`comment`)===-1?!1:r(a).fencedChars||r(o).fencedChars||n(i)?`fenced`:`single`}function a(e,t,n,r){var i=t.line+1,a=n.line+1,o=t.line!==n.line,s=r+`
79
+ `,c=`
80
+ `+r;o&&a++,o&&n.ch===0&&(c=r+`
81
+ `,a--),xe(e,!1,[s,c]),e.setSelection({line:i,ch:0},{line:a,ch:0})}var o=e.codemirror,s=o.getCursor(`start`),c=o.getCursor(`end`),l=o.getTokenAt({line:s.line,ch:s.ch||1}),u=o.getLineHandle(s.line),d=i(o,s.line,u,l),f,p,m;if(d===`single`){var h=u.text.slice(0,s.ch).replace("`",``),g=u.text.slice(s.ch).replace("`",``);o.replaceRange(h+g,{line:s.line,ch:0},{line:s.line,ch:99999999999999}),s.ch--,s!==c&&c.ch--,o.setSelection(s,c),o.focus()}else if(d===`fenced`){if(s.line!==c.line||s.ch!==c.ch){for(f=s.line;f>=0&&(u=o.getLineHandle(f),!n(u));f--);var _=r(o.getTokenAt({line:f,ch:1})).fencedChars,v,y,b,x;n(o.getLineHandle(s.line))?(v=``,y=s.line):n(o.getLineHandle(s.line-1))?(v=``,y=s.line-1):(v=_+`
82
+ `,y=s.line),n(o.getLineHandle(c.line))?(b=``,x=c.line,c.ch===0&&(x+=1)):c.ch!==0&&n(o.getLineHandle(c.line+1))?(b=``,x=c.line+1):(b=_+`
83
+ `,x=c.line+1),c.ch===0&&--x,o.operation(function(){o.replaceRange(b,{line:x,ch:0},{line:x+ +!b,ch:0}),o.replaceRange(v,{line:y,ch:0},{line:y+ +!v,ch:0})}),o.setSelection({line:y+ +!!v,ch:0},{line:x+(v?1:-1),ch:0}),o.focus()}else{var S=s.line;if(n(o.getLineHandle(s.line))&&(i(o,s.line+1)===`fenced`?(f=s.line,S=s.line+1):(p=s.line,S=s.line-1)),f===void 0)for(f=S;f>=0&&(u=o.getLineHandle(f),!n(u));f--);if(p===void 0)for(m=o.lineCount(),p=S;p<m&&(u=o.getLineHandle(p),!n(u));p++);o.operation(function(){o.replaceRange(``,{line:f,ch:0},{line:f+1,ch:0}),o.replaceRange(``,{line:p-1,ch:0},{line:p,ch:0})}),o.focus()}}else if(d===`indented`){if(s.line!==c.line||s.ch!==c.ch)f=s.line,p=c.line,c.ch===0&&p--;else{for(f=s.line;f>=0;f--)if(u=o.getLineHandle(f),!u.text.match(/^\s*$/)&&i(o,f,u)!==`indented`){f+=1;break}for(m=o.lineCount(),p=s.line;p<m;p++)if(u=o.getLineHandle(p),!u.text.match(/^\s*$/)&&i(o,p,u)!==`indented`){--p;break}}var C=o.getLineHandle(p+1),w=C&&o.getTokenAt({line:p+1,ch:C.text.length-1});w&&r(w).indentedCode&&o.replaceRange(`
84
+ `,{line:p+1,ch:0});for(var T=f;T<=p;T++)o.indentLine(T,`subtract`);o.focus()}else{var E=s.line===c.line&&s.ch===c.ch&&s.ch===0,D=s.line!==c.line;E||D?a(o,s,c,t):xe(o,!1,["`","`"])}}function F(e){Ce(e.codemirror,`quote`)}function I(e){Se(e.codemirror,`smaller`)}function ie(e){Se(e.codemirror,`bigger`)}function L(e){Se(e.codemirror,void 0,1)}function R(e){Se(e.codemirror,void 0,2)}function ae(e){Se(e.codemirror,void 0,3)}function z(e){Se(e.codemirror,void 0,4)}function oe(e){Se(e.codemirror,void 0,5)}function se(e){Se(e.codemirror,void 0,6)}function ce(e){var t=e.codemirror,n=`*`;[`-`,`+`,`*`].includes(e.options.unorderedListStyle)&&(n=e.options.unorderedListStyle),Ce(t,`unordered-list`,n)}function le(e){Ce(e.codemirror,`ordered-list`)}function ue(e){Ce(e.codemirror,`check-list`)}function B(e){Ee(e.codemirror)}function de(e){var t=e.options,n=`https://`;if(t.promptURLs){var r=prompt(t.promptTexts.link,n);if(!r)return!1;n=V(r)}we(e,`link`,t.insertTexts.link,n)}function fe(e){var t=e.options,n=`https://`;if(t.promptURLs){var r=prompt(t.promptTexts.image,n);if(!r)return!1;n=V(r)}we(e,`image`,t.insertTexts.image,n)}function V(e){return encodeURI(e).replace(/([\\()])/g,`\\$1`)}function pe(e){e.openBrowseFileWindow()}function me(e,t){var n=e.codemirror,r=M(n),i=e.options,a=t.substr(t.lastIndexOf(`/`)+1),o=a.substring(a.lastIndexOf(`.`)+1).replace(/\?.*$/,``).toLowerCase();if([`png`,`jpg`,`jpeg`,`gif`,`svg`,`apng`,`avif`,`webp`].includes(o))xe(n,r.image,i.insertTexts.uploadedImage,t);else{var s=i.insertTexts.link;s[0]=`[`+a,xe(n,r.link,s,t)}e.updateStatusBar(`upload-image`,e.options.imageTexts.sbOnUploaded.replace(`#image_name#`,a)),setTimeout(function(){e.updateStatusBar(`upload-image`,e.options.imageTexts.sbInit)},1e3)}function he(e){var t=e.codemirror,n=M(t),r=e.options;xe(t,n.table,r.insertTexts.table)}function ge(e){var t=e.codemirror,n=M(t),r=e.options;xe(t,n.image,r.insertTexts.horizontalRule)}function _e(e){var t=e.codemirror;t.undo(),t.focus()}function ve(e){var t=e.codemirror;t.redo(),t.focus()}function ye(e){var t=e.codemirror,n=t.getWrapperElement(),r=n.nextSibling,i=e.toolbarElements&&e.toolbarElements[`side-by-side`],a=!1,o=n.parentNode;r.classList.contains(`editor-preview-active-side`)?(e.options.sideBySideFullscreen===!1&&o.classList.remove(`sided--no-fullscreen`),r.classList.remove(`editor-preview-active-side`),i&&i.classList.remove(`active`),n.classList.remove(`CodeMirror-sided`)):(setTimeout(function(){t.getOption(`fullScreen`)||(e.options.sideBySideFullscreen===!1?o.classList.add(`sided--no-fullscreen`):te(e)),r.classList.add(`editor-preview-active-side`)},1),i&&i.classList.add(`active`),n.classList.add(`CodeMirror-sided`),a=!0);var s=n.lastChild;if(s.classList.contains(`editor-preview-active`)){s.classList.remove(`editor-preview-active`);var c=e.toolbarElements.preview,l=e.toolbar_div;c.classList.remove(`active`),l.classList.remove(`disabled-for-preview`)}if(t.sideBySideRenderingFunction||=function(){var t=e.options.previewRender(e.value(),r);t!=null&&(r.innerHTML=t)},a){var u=e.options.previewRender(e.value(),r);u!=null&&(r.innerHTML=u),t.on(`update`,t.sideBySideRenderingFunction)}else t.off(`update`,t.sideBySideRenderingFunction);t.refresh()}function be(e){var t=e.codemirror,n=t.getWrapperElement(),r=e.toolbar_div,i=e.options.toolbar?e.toolbarElements.preview:!1,a=n.lastChild;if(t.getWrapperElement().nextSibling.classList.contains(`editor-preview-active-side`)&&ye(e),!a||!a.classList.contains(`editor-preview-full`)){if(a=document.createElement(`div`),a.className=`editor-preview-full`,e.options.previewClass){if(Array.isArray(e.options.previewClass))for(var o=0;o<e.options.previewClass.length;o++)a.classList.add(e.options.previewClass[o]);else typeof e.options.previewClass==`string`&&a.classList.add(e.options.previewClass)}n.appendChild(a)}a.classList.contains(`editor-preview-active`)?(a.classList.remove(`editor-preview-active`),i&&(i.classList.remove(`active`),r.classList.remove(`disabled-for-preview`))):(setTimeout(function(){a.classList.add(`editor-preview-active`)},1),i&&(i.classList.add(`active`),r.classList.add(`disabled-for-preview`)));var s=e.options.previewRender(e.value(),a);s!==null&&(a.innerHTML=s)}function xe(e,t,n,r){if(!e.getWrapperElement().lastChild.classList.contains(`editor-preview-active`)){var i,a=n[0],o=n[1],s={},c={};Object.assign(s,e.getCursor(`start`)),Object.assign(c,e.getCursor(`end`)),r&&(a=a.replace(`#url#`,r),o=o.replace(`#url#`,r)),t?(i=e.getLine(s.line),a=i.slice(0,s.ch),o=i.slice(s.ch),e.replaceRange(a+o,{line:s.line,ch:0})):(i=e.getSelection(),e.replaceSelection(a+i+o),s.ch+=a.length,s!==c&&(c.ch+=a.length)),e.setSelection(s,c),e.focus()}}function Se(e,t,n){if(!e.getWrapperElement().lastChild.classList.contains(`editor-preview-active`)){for(var r=e.getCursor(`start`),i=e.getCursor(`end`),a=r.line;a<=i.line;a++)(function(r){var i=e.getLine(r),a=i.search(/[^#]/);i=t===void 0?a<=0?`#`.repeat(n)+` `+i:a==n?i.substr(a+1):`#`.repeat(n)+` `+i.substr(a+1):a<=0?t==`bigger`?`###### `+i:`# `+i:a==6&&t==`smaller`?i.substr(7):a==1&&t==`bigger`?i.substr(2):t==`bigger`?i.substr(1):`#`+i,e.replaceRange(i,{line:r,ch:0},{line:r,ch:99999999999999})})(a);e.focus()}}function Ce(e,t,n){if(!e.getWrapperElement().lastChild.classList.contains(`editor-preview-active`)){var r=/^(\s*)(\*|-|\+|\d*\.)(\s+)/,i=/^\s*/,a=M(e),o=e.getCursor(`start`),s=e.getCursor(`end`),c={quote:/^(\s*)>\s+/,"unordered-list":r,"ordered-list":r,"check-list":/^(\s*)(- \[[ xX]])(\s+)/},l=function(e,t){return{quote:`>`,"unordered-list":n,"ordered-list":`%%i.`,"check-list":`- [ ]`}[e].replace(`%%i`,t)},u=function(e,t){var r={quote:`>`,"unordered-list":`\\`+n,"ordered-list":`\\d+.`,"check-list":`- \\[[ xX]]`},i=new RegExp(r[e]);return t&&i.test(t)},d=function(e,t,n){var a=r.exec(t),o=l(e,f);return a===null?n==0&&(t=o+` `+t):(u(e,a[2])&&(o=``),t=a[1]+o+a[3]+t.replace(i,``).replace(c[e],`$1`)),t},f=1,p=[`unordered-list`,`ordered-list`,`check-list`],m=Object.keys(a)[0];if(!p.includes(m)){var h=e.getLine(o.line);/^\s*- \[[ xX]]\s/.test(h)?m=`check-list`:/^\s*\d+\.\s/.test(h)?m=`ordered-list`:/^\s*[*\-+]\s/.test(h)&&(m=`unordered-list`)}for(var g=o.line;g<=s.line;g++)(function(n){var r=e.getLine(n);a[t]?r=r.replace(c[t],`$1`):p.includes(m)&&p.includes(t)?(r=r.replace(c[m],`$1`),r=d(t,r,!1),f+=1):(r=d(t,r,!1),f+=1),e.replaceRange(r,{line:n,ch:0},{line:n,ch:99999999999999})})(g);e.focus()}}function we(e,t,n,r){if(!(!e.codemirror||e.isPreviewActive())){var i=e.codemirror,a=M(i)[t];if(!a){xe(i,a,n,r);return}var o=i.getCursor(`start`),s=i.getCursor(`end`),c=i.getLine(o.line),l=c.slice(0,o.ch),u=c.slice(o.ch);t==`link`?l=l.replace(/(.*)[^!]\[/,`$1`):t==`image`&&(l=l.replace(/(.*)!\[$/,`$1`)),u=u.replace(/]\(.*?\)/,``),i.replaceRange(l+u,{line:o.line,ch:0},{line:o.line,ch:99999999999999}),o.ch-=n[0].length,o!==s&&(s.ch-=n[0].length),i.setSelection(o,s),i.focus()}}function Te(e,t,n,r){if(!(!e.codemirror||e.isPreviewActive())){r=r===void 0?n:r;var i=e.codemirror,a=M(i),o,s=n,c=r,l=i.getCursor(`start`),u=i.getCursor(`end`);a[t]?(o=i.getLine(l.line),s=o.slice(0,l.ch),c=o.slice(l.ch),t==`bold`?(s=s.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,``),c=c.replace(/(\*\*|__)/,``)):t==`italic`?(s=s.replace(/(\*|_)(?![\s\S]*(\*|_))/,``),c=c.replace(/(\*|_)/,``)):t==`strikethrough`&&(s=s.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,``),c=c.replace(/(\*\*|~~)/,``)),i.replaceRange(s+c,{line:l.line,ch:0},{line:l.line,ch:99999999999999}),t==`bold`||t==`strikethrough`?(l.ch-=2,l!==u&&(u.ch-=2)):t==`italic`&&(--l.ch,l!==u&&--u.ch)):(o=i.getSelection(),t==`bold`?(o=o.split(`**`).join(``),o=o.split(`__`).join(``)):t==`italic`?(o=o.split(`*`).join(``),o=o.split(`_`).join(``)):t==`strikethrough`&&(o=o.split(`~~`).join(``)),i.replaceSelection(s+o+c),l.ch+=n.length,u.ch=l.ch+o.length),i.setSelection(l,u),i.focus()}}function Ee(e){if(!e.getWrapperElement().lastChild.classList.contains(`editor-preview-active`))for(var t=e.getCursor(`start`),n=e.getCursor(`end`),r,i=t.line;i<=n.line;i++)r=e.getLine(i),r=r.replace(/^[ ]*([# ]+|\*|-|[> ]+|[0-9]+(.|\)))[ ]*/,``),e.replaceRange(r,{line:i,ch:0},{line:i,ch:99999999999999})}function De(e,t){if(Math.abs(e)<1024)return``+e+t[0];var n=0;do e/=1024,++n;while(Math.abs(e)>=1024&&n<t.length);return``+e.toFixed(1)+t[n]}function Oe(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]instanceof Array?t[n].concat(e[n]instanceof Array?e[n]:[]):t[n]!==null&&typeof t[n]==`object`&&t[n].constructor===Object?Oe(e[n]||{},t[n]):t[n]);return e}function ke(e){for(var t=1;t<arguments.length;t++)e=Oe(e,arguments[t]);return e}function Ae(e){var t=e.match(/[a-zA-Z0-9_\u00A0-\u02AF\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g),n=0;if(t===null)return n;for(var r=0;r<t.length;r++)t[r].charCodeAt(0)>=19968?n+=t[r].length:n+=1;return n}var H={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`,"check-list":`fa fa-check-square-o`,"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`},je={bold:{name:`bold`,action:N,className:H.bold,title:`Bold`,default:!0},italic:{name:`italic`,action:ne,className:H.italic,title:`Italic`,default:!0},strikethrough:{name:`strikethrough`,action:P,className:H.strikethrough,title:`Strikethrough`},heading:{name:`heading`,action:I,className:H.heading,title:`Heading`,default:!0},"heading-smaller":{name:`heading-smaller`,action:I,className:H[`heading-smaller`],title:`Smaller Heading`},"heading-bigger":{name:`heading-bigger`,action:ie,className:H[`heading-bigger`],title:`Bigger Heading`},"heading-1":{name:`heading-1`,action:L,className:H[`heading-1`],title:`Big Heading`},"heading-2":{name:`heading-2`,action:R,className:H[`heading-2`],title:`Medium Heading`},"heading-3":{name:`heading-3`,action:ae,className:H[`heading-3`],title:`Small Heading`},"separator-1":{name:`separator-1`},code:{name:`code`,action:re,className:H.code,title:`Code`},quote:{name:`quote`,action:F,className:H.quote,title:`Quote`,default:!0},"unordered-list":{name:`unordered-list`,action:ce,className:H[`unordered-list`],title:`Generic List`,default:!0},"ordered-list":{name:`ordered-list`,action:le,className:H[`ordered-list`],title:`Numbered List`,default:!0},"check-list":{name:`check-list`,action:ue,className:H[`check-list`],title:`Check List`,default:!0},"clean-block":{name:`clean-block`,action:B,className:H[`clean-block`],title:`Clean block`},"separator-2":{name:`separator-2`},link:{name:`link`,action:de,className:H.link,title:`Create Link`,default:!0},image:{name:`image`,action:fe,className:H.image,title:`Insert Image`,default:!0},"upload-image":{name:`upload-image`,action:pe,className:H[`upload-image`],title:`Import an image`},table:{name:`table`,action:he,className:H.table,title:`Insert Table`},"horizontal-rule":{name:`horizontal-rule`,action:ge,className:H[`horizontal-rule`],title:`Insert Horizontal Line`},"separator-3":{name:`separator-3`},preview:{name:`preview`,action:be,className:H.preview,noDisable:!0,title:`Toggle Preview`,default:!0},"side-by-side":{name:`side-by-side`,action:ye,className:H[`side-by-side`],noDisable:!0,noMobile:!0,title:`Toggle Side by Side`,default:!0},fullscreen:{name:`fullscreen`,action:te,className:H.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:H.guide,noDisable:!0,title:`Markdown Guide`,default:!0},"separator-5":{name:`separator-5`},undo:{name:`undo`,action:_e,className:H.undo,noDisable:!0,title:`Undo`},redo:{name:`redo`,action:ve,className:H.redo,noDisable:!0,title:`Redo`}},Me={link:[`[`,`](#url#)`],image:[`![`,`](#url#)`],uploadedImage:[`![](#url#)`,``],table:[``,`
85
+
86
+ | Column 1 | Column 2 | Column 3 |
87
+ | -------- | -------- | -------- |
88
+ | Text | Text | Text |
89
+
90
+ `],horizontalRule:[``,`
91
+
92
+ -----
93
+
94
+ `]},U={link:`URL for the link:`,image:`URL of the image:`},Ne={locale:`en-US`,format:{hour:`2-digit`,minute:`2-digit`}},Pe={bold:`**`,code:"```",italic:`*`},Fe={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`},Ie={noFileGiven:`You must select a file.`,typeNotAllowed:`This image type is not allowed.`,fileTooLarge:`Image #image_name# is too big (#image_size#).
95
+ Maximum file size is #image_max_size#.`,importError:`Something went wrong when uploading the image #image_name#.`};function W(e){e||={},e.parent=this;var t=!0;if(e.autoDownloadFontAwesome===!1&&(t=!1),e.autoDownloadFontAwesome!==!0)for(var n=document.styleSheets,r=0;r<n.length;r++)n[r].href&&n[r].href.indexOf(`//maxcdn.bootstrapcdn.com/font-awesome/`)>-1&&(t=!1);if(t){var i=document.createElement(`link`);i.rel=`stylesheet`,i.href=`https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css`,document.getElementsByTagName(`head`)[0].appendChild(i)}if(e.element)this.element=e.element;else if(e.element===null){console.log(`EasyMDE: Error. No element was found.`);return}if(e.toolbar===void 0)for(var a in e.toolbar=[],je)Object.prototype.hasOwnProperty.call(je,a)&&(a.indexOf(`separator-`)!=-1&&e.toolbar.push(`|`),(je[a].default===!0||e.showIcons&&e.showIcons.constructor===Array&&e.showIcons.indexOf(a)!=-1)&&e.toolbar.push(a));if(Object.prototype.hasOwnProperty.call(e,`previewClass`)||(e.previewClass=`editor-preview`),Object.prototype.hasOwnProperty.call(e,`status`)||(e.status=[`autosave`,`lines`,`words`,`cursor`],e.uploadImage&&e.status.unshift(`upload-image`)),e.previewRender||(e.previewRender=function(e){return this.parent.markdown(e)}),e.parsingConfig=ke({highlightFormatting:!0},e.parsingConfig||{}),e.insertTexts=ke({},Me,e.insertTexts||{}),e.promptTexts=ke({},U,e.promptTexts||{}),e.blockStyles=ke({},Pe,e.blockStyles||{}),e.autosave!=null&&(e.autosave.timeFormat=ke({},Ne,e.autosave.timeFormat||{})),e.iconClassMap=ke({},H,e.iconClassMap||{}),e.shortcuts=ke({},S,e.shortcuts||{}),e.maxHeight=e.maxHeight||void 0,e.direction=e.direction||`ltr`,e.maxHeight===void 0?e.minHeight=e.minHeight||`300px`:e.minHeight=e.maxHeight,e.errorCallback=e.errorCallback||function(e){alert(e)},e.uploadImage=e.uploadImage||!1,e.imageMaxSize=e.imageMaxSize||2097152,e.imageAccept=e.imageAccept||`image/png, image/jpeg, image/gif, image/avif`,e.imageTexts=ke({},Fe,e.imageTexts||{}),e.errorMessages=ke({},Ie,e.errorMessages||{}),e.imagePathAbsolute=e.imagePathAbsolute||!1,e.imageCSRFName=e.imageCSRFName||`csrfmiddlewaretoken`,e.imageCSRFHeader=e.imageCSRFHeader||!1,e.imageInputName=e.imageInputName||`image`,e.autosave!=null&&e.autosave.unique_id!=null&&e.autosave.unique_id!=``&&(e.autosave.uniqueId=e.autosave.unique_id),e.overlayMode&&e.overlayMode.combine===void 0&&(e.overlayMode.combine=!0),this.options=e,this.render(),e.initialValue&&(!this.options.autosave||this.options.autosave.foundSavedValue!==!0)&&this.value(e.initialValue),e.uploadImage){var o=this;this.codemirror.on(`dragenter`,function(e,t){o.updateStatusBar(`upload-image`,o.options.imageTexts.sbOnDragEnter),t.stopPropagation(),t.preventDefault()}),this.codemirror.on(`dragend`,function(e,t){o.updateStatusBar(`upload-image`,o.options.imageTexts.sbInit),t.stopPropagation(),t.preventDefault()}),this.codemirror.on(`dragleave`,function(e,t){o.updateStatusBar(`upload-image`,o.options.imageTexts.sbInit),t.stopPropagation(),t.preventDefault()}),this.codemirror.on(`dragover`,function(e,t){o.updateStatusBar(`upload-image`,o.options.imageTexts.sbOnDragEnter),t.stopPropagation(),t.preventDefault()}),this.codemirror.on(`drop`,function(t,n){n.stopPropagation(),n.preventDefault(),e.imageUploadFunction?o.uploadImagesUsingCustomFunction(e.imageUploadFunction,n.dataTransfer.files):o.uploadImages(n.dataTransfer.files)}),this.codemirror.on(`paste`,function(t,n){e.imageUploadFunction?o.uploadImagesUsingCustomFunction(e.imageUploadFunction,n.clipboardData.files):o.uploadImages(n.clipboardData.files)})}}W.prototype.uploadImages=function(e,t,n){if(e.length!==0){for(var r=[],i=0;i<e.length;i++)r.push(e[i].name),this.uploadImage(e[i],t,n);this.updateStatusBar(`upload-image`,this.options.imageTexts.sbOnDrop.replace(`#images_names#`,r.join(`, `)))}},W.prototype.uploadImagesUsingCustomFunction=function(e,t){if(t.length!==0){for(var n=[],r=0;r<t.length;r++)n.push(t[r].name),this.uploadImageUsingCustomFunction(e,t[r]);this.updateStatusBar(`upload-image`,this.options.imageTexts.sbOnDrop.replace(`#images_names#`,n.join(`, `)))}},W.prototype.updateStatusBar=function(e,t){if(this.gui.statusbar){var n=this.gui.statusbar.getElementsByClassName(e);n.length===1?this.gui.statusbar.getElementsByClassName(e)[0].textContent=t:n.length===0?console.log(`EasyMDE: status bar item `+e+` was not found.`):console.log(`EasyMDE: Several status bar items named `+e+` was found.`)}},W.prototype.markdown=function(e){if(g){var t=this.options&&this.options.renderingConfig&&this.options.renderingConfig.markedOptions?this.options.renderingConfig.markedOptions:{};if(t.breaks=!(this.options&&this.options.renderingConfig&&this.options.renderingConfig.singleLineBreaks===!1),this.options&&this.options.renderingConfig&&this.options.renderingConfig.codeSyntaxHighlighting===!0){var n=this.options.renderingConfig.hljs||window.hljs;n&&(t.highlight=function(e,t){return t&&n.getLanguage(t)?n.highlight(t,e).value:n.highlightAuto(e).value})}g.use(t);var r=g.parse(e);return this.options.renderingConfig&&typeof this.options.renderingConfig.sanitizerFunction==`function`&&(r=this.options.renderingConfig.sanitizerFunction.call(this,r)),r=T(r),r=E(r),r}},W.prototype.render=function(e){if(e||=this.element||document.getElementsByTagName(`textarea`)[0],this._rendered&&this._rendered===e)return;this.element=e;var t=this.options,n=this,r={};for(var i in t.shortcuts)t.shortcuts[i]!==null&&x[i]!==null&&(function(e){r[D(t.shortcuts[e])]=function(){var t=x[e];typeof t==`function`?t(n):typeof t==`string`&&window.open(t,`_blank`)}})(i);r.Enter=`newlineAndIndentContinueMarkdownList`,r.Tab=`tabAndIndentMarkdownList`,r[`Shift-Tab`]=`shiftTabAndUnindentMarkdownList`,r.Esc=function(e){e.getOption(`fullScreen`)&&te(n)},this.documentOnKeyDown=function(e){e||=window.event,e.keyCode==27&&n.codemirror.getOption(`fullScreen`)&&te(n)},document.addEventListener(`keydown`,this.documentOnKeyDown,!1);var a,o;t.overlayMode?(s.defineMode(`overlay-mode`,function(e){return s.overlayMode(s.getMode(e,t.spellChecker===!1?`gfm`:`spell-checker`),t.overlayMode.mode,t.overlayMode.combine)}),a=`overlay-mode`,o=t.parsingConfig,o.gitHubSpice=!1):(a=t.parsingConfig,a.name=`gfm`,a.gitHubSpice=!1),t.spellChecker!==!1&&(a=`spell-checker`,o=t.parsingConfig,o.name=`gfm`,o.gitHubSpice=!1,typeof t.spellChecker==`function`?t.spellChecker({codeMirrorInstance:s}):h({codeMirrorInstance:s}));function c(e,t,n){return{addNew:!1}}if(this.codemirror=s.fromTextArea(e,{mode:a,backdrop:o,theme:t.theme==null?`easymde`:t.theme,tabSize:t.tabSize==null?2:t.tabSize,indentUnit:t.tabSize==null?2:t.tabSize,indentWithTabs:t.indentWithTabs!==!1,lineNumbers:t.lineNumbers===!0,autofocus:t.autofocus===!0,extraKeys:r,direction:t.direction,lineWrapping:t.lineWrapping!==!1,allowDropFileTypes:[`text/plain`],placeholder:t.placeholder||e.getAttribute(`placeholder`)||``,styleSelectedText:t.styleSelectedText==null?!w():t.styleSelectedText,scrollbarStyle:t.scrollbarStyle==null?`native`:t.scrollbarStyle,configureMouse:c,inputStyle:t.inputStyle==null?w()?`contenteditable`:`textarea`:t.inputStyle,spellcheck:t.nativeSpellcheck==null||t.nativeSpellcheck,autoRefresh:t.autoRefresh!=null&&t.autoRefresh}),this.codemirror.getScrollerElement().style.minHeight=t.minHeight,t.maxHeight!==void 0&&(this.codemirror.getScrollerElement().style.height=t.maxHeight),t.forceSync===!0){var l=this.codemirror;l.on(`change`,function(){l.save()})}this.gui={};var u=document.createElement(`div`);u.classList.add(`EasyMDEContainer`),u.setAttribute(`role`,`application`);var d=this.codemirror.getWrapperElement();d.parentNode.insertBefore(u,d),u.appendChild(d),t.toolbar!==!1&&(this.gui.toolbar=this.createToolbar()),t.status!==!1&&(this.gui.statusbar=this.createStatusbar()),t.autosave!=null&&t.autosave.enabled===!0&&(this.autosave(),this.codemirror.on(`change`,function(){clearTimeout(n._autosave_timeout),n._autosave_timeout=setTimeout(function(){n.autosave()},n.options.autosave.submit_delay||n.options.autosave.delay||1e3)}));function f(e,t){return e<window.getComputedStyle(document.querySelector(`.CodeMirror-sizer`)).width.replace(`px`,``)?t+`px`:t/e*100+`%`}var p=this;function m(e,t){var n=new URL(t.url,document.baseURI).href;e.setAttribute(`data-img-src`,n),e.setAttribute(`style`,`--bg-image:url(`+n+`);--width:`+t.naturalWidth+`px;--height:`+f(t.naturalWidth,t.naturalHeight)),p.codemirror.setSize()}function g(){t.previewImagesInEditor&&u.querySelectorAll(`.cm-image-marker`).forEach(function(e){var n=e.parentElement;if(n.innerText.match(/^!\[.*?\]\(.*\)/g)&&!n.hasAttribute(`data-img-src`)){var r=n.innerText.match(/!\[.*?\]\((.*?)\)/);if(window.EMDEimagesCache||(window.EMDEimagesCache={}),r&&r.length>=2){var i=r[1];if(t.imagesPreviewHandler){var a=t.imagesPreviewHandler(r[1]);typeof a==`string`&&(i=a)}if(window.EMDEimagesCache[i])m(n,window.EMDEimagesCache[i]);else{window.EMDEimagesCache[i]={};var o=document.createElement(`img`);o.onload=function(){window.EMDEimagesCache[i]={naturalWidth:o.naturalWidth,naturalHeight:o.naturalHeight,url:i},m(n,window.EMDEimagesCache[i])},o.src=i}}}})}this.codemirror.on(`update`,function(){g()}),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element,(t.autofocus===!0||e.autofocus)&&this.codemirror.focus();var _=this.codemirror;setTimeout(function(){_.refresh()}.bind(_),0)},W.prototype.cleanup=function(){document.removeEventListener(`keydown`,this.documentOnKeyDown)};function Le(){if(typeof localStorage==`object`)try{localStorage.setItem(`smde_localStorage`,1),localStorage.removeItem(`smde_localStorage`)}catch{return!1}else return!1;return!0}W.prototype.autosave=function(){if(Le()){var e=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&&(e.element.form!=null&&e.element.form!=null&&e.element.form.addEventListener(`submit`,function(){clearTimeout(e.autosaveTimeoutId),e.autosaveTimeoutId=void 0,localStorage.removeItem(`smde_`+e.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 t=e.value();t===``?localStorage.removeItem(`smde_`+this.options.autosave.uniqueId):localStorage.setItem(`smde_`+this.options.autosave.uniqueId,t);var n=document.getElementById(`autosaved`);if(n!=null&&n!=null&&n!=``){var r=new Date,i=new Intl.DateTimeFormat([this.options.autosave.timeFormat.locale,`en-US`],this.options.autosave.timeFormat.format).format(r);n.innerHTML=(this.options.autosave.text==null?`Autosaved: `:this.options.autosave.text)+i}}else console.log(`EasyMDE: localStorage not available, cannot autosave`)},W.prototype.clearAutosavedValue=function(){if(Le()){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`)},W.prototype.openBrowseFileWindow=function(e,t){var n=this,r=this.gui.toolbar.getElementsByClassName(`imageInput`)[0];r.click();function i(a){n.options.imageUploadFunction?n.uploadImagesUsingCustomFunction(n.options.imageUploadFunction,a.target.files):n.uploadImages(a.target.files,e,t),r.removeEventListener(`change`,i)}r.addEventListener(`change`,i)},W.prototype.uploadImage=function(e,t,n){var r=this;t||=function(e){me(r,e)};function i(e){r.updateStatusBar(`upload-image`,e),setTimeout(function(){r.updateStatusBar(`upload-image`,r.options.imageTexts.sbInit)},1e4),n&&typeof n==`function`&&n(e),r.options.errorCallback(e)}function a(t){var n=r.options.imageTexts.sizeUnits.split(`,`);return t.replace(`#image_name#`,e.name).replace(`#image_size#`,De(e.size,n)).replace(`#image_max_size#`,De(r.options.imageMaxSize,n))}if(e.size>this.options.imageMaxSize){i(a(this.options.errorMessages.fileTooLarge));return}var o=new FormData;o.append(`image`,e),r.options.imageCSRFToken&&!r.options.imageCSRFHeader&&o.append(r.options.imageCSRFName,r.options.imageCSRFToken);var s=new XMLHttpRequest;s.upload.onprogress=function(t){if(t.lengthComputable){var n=``+Math.round(t.loaded*100/t.total);r.updateStatusBar(`upload-image`,r.options.imageTexts.sbProgress.replace(`#file_name#`,e.name).replace(`#progress#`,n))}},s.open(`POST`,this.options.imageUploadEndpoint),r.options.imageCSRFToken&&r.options.imageCSRFHeader&&s.setRequestHeader(r.options.imageCSRFName,r.options.imageCSRFToken),s.onload=function(){try{var e=JSON.parse(this.responseText)}catch{console.error(`EasyMDE: The server did not return a valid json.`),i(a(r.options.errorMessages.importError));return}this.status===200&&e&&!e.error&&e.data&&e.data.filePath?t((r.options.imagePathAbsolute?``:window.location.origin+`/`)+e.data.filePath):e.error&&e.error in r.options.errorMessages?i(a(r.options.errorMessages[e.error])):e.error?i(a(e.error)):(console.error(`EasyMDE: Received an unexpected response after uploading the image.`+this.status+` (`+this.statusText+`)`),i(a(r.options.errorMessages.importError)))},s.onerror=function(e){console.error(`EasyMDE: An unexpected error occurred when trying to upload the image.`+e.target.status+` (`+e.target.statusText+`)`),i(r.options.errorMessages.importError)},s.send(o)},W.prototype.uploadImageUsingCustomFunction=function(e,t){var n=this;function r(e){me(n,e)}function i(e){var t=a(e);n.updateStatusBar(`upload-image`,t),setTimeout(function(){n.updateStatusBar(`upload-image`,n.options.imageTexts.sbInit)},1e4),n.options.errorCallback(t)}function a(e){var r=n.options.imageTexts.sizeUnits.split(`,`);return e.replace(`#image_name#`,t.name).replace(`#image_size#`,De(t.size,r)).replace(`#image_max_size#`,De(n.options.imageMaxSize,r))}e.apply(this,[t,r,i])},W.prototype.setPreviewMaxHeight=function(){var e=this.codemirror.getWrapperElement(),t=e.nextSibling,n=parseInt(window.getComputedStyle(e).paddingTop),r=parseInt(window.getComputedStyle(e).borderTopWidth),i=(parseInt(this.options.maxHeight)+n*2+r*2).toString()+`px`;t.style.height=i},W.prototype.createSideBySide=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.nextSibling;if(!n||!n.classList.contains(`editor-preview-side`)){if(n=document.createElement(`div`),n.className=`editor-preview-side`,this.options.previewClass){if(Array.isArray(this.options.previewClass))for(var r=0;r<this.options.previewClass.length;r++)n.classList.add(this.options.previewClass[r]);else typeof this.options.previewClass==`string`&&n.classList.add(this.options.previewClass)}t.parentNode.insertBefore(n,t.nextSibling)}if(this.options.maxHeight!==void 0&&this.setPreviewMaxHeight(),this.options.syncSideBySidePreviewScroll===!1)return n;var i=!1,a=!1;return e.on(`scroll`,function(e){if(i){i=!1;return}a=!0;var t=e.getScrollInfo().height-e.getScrollInfo().clientHeight,r=parseFloat(e.getScrollInfo().top)/t,o=(n.scrollHeight-n.clientHeight)*r;n.scrollTop=o}),n.onscroll=function(){if(a){a=!1;return}i=!0;var t=n.scrollHeight-n.clientHeight,r=parseFloat(n.scrollTop)/t,o=(e.getScrollInfo().height-e.getScrollInfo().clientHeight)*r;e.scrollTo(0,o)},n},W.prototype.createToolbar=function(e){if(e||=this.options.toolbar,!(!e||e.length===0)){var t;for(t=0;t<e.length;t++)je[e[t]]!=null&&(e[t]=je[e[t]]);var n=document.createElement(`div`);n.className=`editor-toolbar`,n.setAttribute(`role`,`toolbar`);var r=this,i={};for(r.toolbar=e,t=0;t<e.length;t++)if((e[t].name!=`guide`||r.options.toolbarGuideIcon!==!1)&&!(r.options.hideIcons&&r.options.hideIcons.indexOf(e[t].name)!=-1)&&!((e[t].name==`fullscreen`||e[t].name==`side-by-side`)&&w())){if(e[t]===`|`){for(var a=!1,o=t+1;o<e.length;o++)e[o]!==`|`&&(!r.options.hideIcons||r.options.hideIcons.indexOf(e[o].name)==-1)&&(a=!0);if(!a)continue}(function(e){var t=e===`|`?A():e.children?O(e,r.options.toolbarTips,r.options.shortcuts,r):k(e,!0,r.options.toolbarTips,r.options.shortcuts,`button`,r);if(i[e.name||e]=t,n.appendChild(t),e.name===`upload-image`){var a=document.createElement(`input`);a.className=`imageInput`,a.type=`file`,a.multiple=!0,a.name=r.options.imageInputName,a.accept=r.options.imageAccept,a.style.display=`none`,a.style.opacity=0,n.appendChild(a)}})(e[t])}r.toolbar_div=n,r.toolbarElements=i;var s=this.codemirror;s.on(`cursorActivity`,function(){var e=M(s);for(var t in i)(function(t){var n=i[t];e[t]?n.classList.add(`active`):t!=`fullscreen`&&t!=`side-by-side`&&n.classList.remove(`active`)})(t)});var c=s.getWrapperElement();return c.parentNode.insertBefore(n,c),n}},W.prototype.createStatusbar=function(e){e||=this.options.status;var t=this.options,n=this.codemirror;if(!(!e||e.length===0)){var r=[],i,a,o,s;for(i=0;i<e.length;i++)if(a=void 0,o=void 0,s=void 0,typeof e[i]==`object`)r.push({className:e[i].className,defaultValue:e[i].defaultValue,onUpdate:e[i].onUpdate,onActivity:e[i].onActivity});else{var c=e[i];c===`words`?(s=function(e){e.innerHTML=Ae(n.getValue())},a=function(e){e.innerHTML=Ae(n.getValue())}):c===`lines`?(s=function(e){e.innerHTML=n.lineCount()},a=function(e){e.innerHTML=n.lineCount()}):c===`cursor`?(s=function(e){e.innerHTML=`1:1`},o=function(e){var t=n.getCursor(),r=t.line+1,i=t.ch+1;e.innerHTML=r+`:`+i}):c===`autosave`?s=function(e){t.autosave!=null&&t.autosave.enabled===!0&&e.setAttribute(`id`,`autosaved`)}:c===`upload-image`&&(s=function(e){e.innerHTML=t.imageTexts.sbInit}),r.push({className:c,defaultValue:s,onUpdate:a,onActivity:o})}var l=document.createElement(`div`);for(l.className=`editor-statusbar`,i=0;i<r.length;i++){var u=r[i],d=document.createElement(`span`);d.className=u.className,typeof u.defaultValue==`function`&&u.defaultValue(d),typeof u.onUpdate==`function`&&this.codemirror.on(`update`,function(e,t){return function(){t.onUpdate(e)}}(d,u)),typeof u.onActivity==`function`&&this.codemirror.on(`cursorActivity`,function(e,t){return function(){t.onActivity(e)}}(d,u)),l.appendChild(d)}var f=this.codemirror.getWrapperElement();return f.parentNode.insertBefore(l,f.nextSibling),l}},W.prototype.value=function(e){var t=this.codemirror;if(e===void 0)return t.getValue();if(t.getDoc().setValue(e),this.isPreviewActive()){var n=t.getWrapperElement().lastChild,r=this.options.previewRender(e,n);r!==null&&(n.innerHTML=r)}return this},W.toggleBold=N,W.toggleItalic=ne,W.toggleStrikethrough=P,W.toggleBlockquote=F,W.toggleHeadingSmaller=I,W.toggleHeadingBigger=ie,W.toggleHeading1=L,W.toggleHeading2=R,W.toggleHeading3=ae,W.toggleHeading4=z,W.toggleHeading5=oe,W.toggleHeading6=se,W.toggleCodeBlock=re,W.toggleUnorderedList=ce,W.toggleOrderedList=le,W.toggleCheckList=ue,W.cleanBlock=B,W.drawLink=de,W.drawImage=fe,W.drawUploadedImage=pe,W.drawTable=he,W.drawHorizontalRule=ge,W.undo=_e,W.redo=ve,W.togglePreview=be,W.toggleSideBySide=ye,W.toggleFullScreen=te,W.prototype.toggleBold=function(){N(this)},W.prototype.toggleItalic=function(){ne(this)},W.prototype.toggleStrikethrough=function(){P(this)},W.prototype.toggleBlockquote=function(){F(this)},W.prototype.toggleHeadingSmaller=function(){I(this)},W.prototype.toggleHeadingBigger=function(){ie(this)},W.prototype.toggleHeading1=function(){L(this)},W.prototype.toggleHeading2=function(){R(this)},W.prototype.toggleHeading3=function(){ae(this)},W.prototype.toggleHeading4=function(){z(this)},W.prototype.toggleHeading5=function(){oe(this)},W.prototype.toggleHeading6=function(){se(this)},W.prototype.toggleCodeBlock=function(){re(this)},W.prototype.toggleUnorderedList=function(){ce(this)},W.prototype.toggleOrderedList=function(){le(this)},W.prototype.toggleCheckList=function(){ue(this)},W.prototype.cleanBlock=function(){B(this)},W.prototype.drawLink=function(){de(this)},W.prototype.drawImage=function(){fe(this)},W.prototype.drawUploadedImage=function(){pe(this)},W.prototype.drawTable=function(){he(this)},W.prototype.drawHorizontalRule=function(){ge(this)},W.prototype.undo=function(){_e(this)},W.prototype.redo=function(){ve(this)},W.prototype.togglePreview=function(){be(this)},W.prototype.toggleSideBySide=function(){ye(this)},W.prototype.toggleFullScreen=function(){te(this)},W.prototype.isPreviewActive=function(){return this.codemirror.getWrapperElement().lastChild.classList.contains(`editor-preview-active`)},W.prototype.isSideBySideActive=function(){return this.codemirror.getWrapperElement().nextSibling.classList.contains(`editor-preview-active-side`)},W.prototype.isFullscreenActive=function(){return this.codemirror.getOption(`fullScreen`)},W.prototype.getState=function(){var e=this.codemirror;return M(e)},W.prototype.toTextArea=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.parentNode;n&&(this.gui.toolbar&&n.removeChild(this.gui.toolbar),this.gui.statusbar&&n.removeChild(this.gui.statusbar),this.gui.sideBySide&&n.removeChild(this.gui.sideBySide)),n.parentNode.insertBefore(t,n),n.remove(),e.toTextArea(),this.autosaveTimeoutId&&(clearTimeout(this.autosaveTimeoutId),this.autosaveTimeoutId=void 0,this.clearAutosavedValue())},t.exports=W}));export default y();