import{q as hu}from"./index-BPRWoLf4.js";var An={exports:{}},Xo;function pu(){return Xo||(Xo=1,function(Yo,cu){(function(re,Tr){Yo.exports=Tr()})(hu,function(){var re=navigator.userAgent,Tr=navigator.platform,We=/gecko\/\d/i.test(re),On=/MSIE \d/.test(re),Wn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(re),Mr=/Edge\/(\d+)/.exec(re),A=On||Wn||Mr,E=A&&(On?document.documentMode||6:+(Mr||Wn)[1]),ie=!Mr&&/WebKit\//.test(re),qo=ie&&/Qt\/\d+\.\d+/.test(re),ze=!Mr&&/Chrome\/(\d+)/.exec(re),Hn=ze&&+ze[1],Ce=/Opera\//.test(re),Dr=/Apple Computer/.test(navigator.vendor),Zo=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(re),Qo=/PhantomJS/.test(re),Kt=Dr&&(/Mobile\/\w+/.test(re)||navigator.maxTouchPoints>2),Nr=/Android/.test(re),_t=Kt||Nr||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(re),ye=Kt||/Mac/.test(Tr),Jo=/\bCrOS\b/.test(re),jo=/win/i.test(Tr),$e=Ce&&re.match(/Version\/(\d*\.\d*)/);$e&&($e=Number($e[1])),$e&&$e>=15&&(Ce=!1,ie=!0);var Fn=ye&&(qo||Ce&&($e==null||$e<12.11)),pi=We||A&&E>=9;function mt(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var et=function(e,t){var i=e.className,r=mt(t).exec(i);if(r){var n=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(n?r[1]+n:"")}};function Ge(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function pe(e,t){return Ge(e).appendChild(t)}function k(e,t,i,r){var n=document.createElement(e);if(i&&(n.className=i),r&&(n.style.cssText=r),typeof t=="string")n.appendChild(document.createTextNode(t));else if(t)for(var l=0;l=t)return o+(t-l);o+=a-l,o+=i-o%i,l=a+1}}var Ke=function(){this.id=null,this.f=null,this.time=0,this.handler=gi(this.onTimeout,this)};Ke.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ke.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i=t)return r+Math.min(o,t-n);if(n+=l-r,n+=i-n%i,r=l+1,n>=t)return r}}var Wr=[""];function bi(e){for(;Wr.length<=e;)Wr.push(W(Wr)+" ");return Wr[e]}function W(e){return e[e.length-1]}function Hr(e,t){for(var i=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||$o.test(e))}function Fr(e,t){return t?t.source.indexOf("\\w")>-1&&xi(e)?!0:t.test(e):xi(e)}function Rn(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ea=/[\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 Ci(e){return e.charCodeAt(0)>=768&&ea.test(e)}function Bn(e,t,i){for(;(i<0?t>0:ti?-1:1;;){if(t==i)return t;var n=(t+i)/2,l=r<0?Math.ceil(n):Math.floor(n);if(l==t)return e(l)?t:i;e(l)?i=l:t=l+r}}function ta(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var n=!1,l=0;lt||t==i&&o.to==t)&&(r(Math.max(o.from,t),Math.min(o.to,i),o.level==1?"rtl":"ltr",l),n=!0)}n||r(t,i,"ltr")}var Qt=null;function Jt(e,t,i){var r;Qt=null;for(var n=0;nt)return n;l.to==t&&(l.from!=l.to&&i=="before"?r=n:Qt=n),l.from==t&&(l.from!=l.to&&i!="before"?r=n:Qt=n)}return r??Qt}var ra=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,l=/[LRr]/,o=/[Lb1n]/,a=/[1n]/;function s(u,f,h){this.level=u,this.from=f,this.to=h}return function(u,f){var h=f=="ltr"?"L":"R";if(u.length==0||f=="ltr"&&!r.test(u))return!1;for(var d=u.length,c=[],p=0;p-1&&(r[t]=n.slice(0,l).concat(n.slice(l+1)))}}}function G(e,t){var i=wi(e,t);if(i.length)for(var r=Array.prototype.slice.call(arguments,2),n=0;n0}function Ct(e){e.prototype.on=function(t,i){T(this,t,i)},e.prototype.off=function(t,i){ve(this,t,i)}}function oe(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Un(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Si(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function jt(e){oe(e),Un(e)}function Li(e){return e.target||e.srcElement}function Kn(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),ye&&e.ctrlKey&&t==1&&(t=3),t}var ia=function(){if(A&&E<9)return!1;var e=k("div");return"draggable"in e||"dragDrop"in e}(),ki;function na(e){if(ki==null){var t=k("span","​");pe(e,k("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(ki=t.offsetWidth<=1&&t.offsetHeight>2&&!(A&&E<8))}var i=ki?k("span","​"):k("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Ti;function la(e){if(Ti!=null)return Ti;var t=pe(e,document.createTextNode("AخA")),i=tt(t,0,1).getBoundingClientRect(),r=tt(t,1,2).getBoundingClientRect();return Ge(e),!i||i.left==i.right?!1:Ti=r.right-i.right<3}var Mi=` b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var n=e.indexOf(` `,t);n==-1&&(n=e.length);var l=e.slice(t,e.charAt(n-1)=="\r"?n-1:n),o=l.indexOf("\r");o!=-1?(i.push(l.slice(0,o)),t+=o+1):(i.push(l),t=n+1)}return i}:function(e){return e.split(/\r\n?|\n/)},oa=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},aa=function(){var e=k("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Di=null;function sa(e){if(Di!=null)return Di;var t=pe(e,k("span","x")),i=t.getBoundingClientRect(),r=tt(t,0,1).getBoundingClientRect();return Di=Math.abs(i.left-r.left)>1}var Ni={},wt={};function ua(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ni[e]=t}function fa(e,t){wt[e]=t}function Pr(e){if(typeof e=="string"&&wt.hasOwnProperty(e))e=wt[e];else if(e&&typeof e.name=="string"&&wt.hasOwnProperty(e.name)){var t=wt[e.name];typeof t=="string"&&(t={name:t}),e=In(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Pr("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Pr("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ai(e,t){t=Pr(t);var i=Ni[t.name];if(!i)return Ai(e,"text/plain");var r=i(e,t);if(St.hasOwnProperty(t.name)){var n=St[t.name];for(var l in n)n.hasOwnProperty(l)&&(r.hasOwnProperty(l)&&(r["_"+l]=r[l]),r[l]=n[l])}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 St={};function ha(e,t){var i=St.hasOwnProperty(e)?St[e]:St[e]={};nt(t,i)}function lt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var n=t[r];n instanceof Array&&(n=n.concat([])),i[r]=n}return i}function Oi(e,t){for(var i;e.innerMode&&(i=e.innerMode(t),!(!i||i.mode==e));)t=i.state,e=i.mode;return i||{mode:e,state:t}}function _n(e,t,i){return e.startState?e.startState(t,i):!0}var U=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};U.prototype.eol=function(){return this.pos>=this.string.length},U.prototype.sol=function(){return this.pos==this.lineStart},U.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},U.prototype.next=function(){if(this.post},U.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},U.prototype.skipToEnd=function(){this.pos=this.string.length},U.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},U.prototype.backUp=function(e){this.pos-=e},U.prototype.column=function(){return this.lastColumnPos0?null:(l&&t!==!1&&(this.pos+=l[0].length),l)}},U.prototype.current=function(){return this.string.slice(this.start,this.pos)},U.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},U.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},U.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function w(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var n=i.children[r],l=n.chunkSize();if(t=e.first&&ti?g(i,w(e,i).text.length):ca(t,w(e,t.line).text.length)}function ca(e,t){var i=e.ch;return i==null||i>t?g(e.line,t):i<0?g(e.line,0):e}function Yn(e,t){for(var i=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},De.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}},De.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},De.fromSaved=function(e,t,i){return t instanceof Rr?new De(e,lt(e.mode,t.state),i,t.lookAhead):new De(e,lt(e.mode,t),i)},De.prototype.save=function(e){var t=e!==!1?lt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Rr(t,this.maxLookAhead):t};function qn(e,t,i,r){var n=[e.state.modeGen],l={};$n(e,t.text,e.doc.mode,i,function(u,f){return n.push(u,f)},l,r);for(var o=i.state,a=function(u){i.baseTokens=n;var f=e.state.overlays[u],h=1,d=0;i.state=!0,$n(e,t.text,f.mode,i,function(c,p){for(var v=h;dc&&n.splice(h,1,c,n[h+1],y),h+=2,d=Math.min(c,y)}if(p)if(f.opaque)n.splice(v,h-v,c,"overlay "+p),h=v+2;else for(;ve.options.maxHighlightLength&<(e.doc.mode,r.state),l=qn(e,t,r);n&&(r.state=n),t.stateAfter=r.save(!n),t.styles=l.styles,l.classes?t.styleClasses=l.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function $t(e,t,i){var r=e.doc,n=e.display;if(!r.mode.startState)return new De(r,!0,t);var l=da(e,t,i),o=l>r.first&&w(r,l-1).stateAfter,a=o?De.fromSaved(r,o,l):new De(r,_n(r.mode),l);return r.iter(l,t,function(s){Ei(e,s.text,a);var u=a.line;s.stateAfter=u==t-1||u%5==0||u>=n.viewFrom&&ut.start)return l}throw new Error("Mode "+e.name+" failed to advance stream.")}var Jn=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function jn(e,t,i,r){var n=e.doc,l=n.mode,o;t=D(n,t);var a=w(n,t.line),s=$t(e,t.line,i),u=new U(a.text,e.options.tabSize,s),f;for(r&&(f=[]);(r||u.pose.options.maxHighlightLength?(a=!1,o&&Ei(e,t,r,f.pos),f.pos=t.length,h=null):h=Vn(Ii(i,f,r.state,d),l),d){var c=d[0].name;c&&(h="m-"+(h?c+" "+h:c))}if(!a||u!=h){for(;so;--a){if(a<=l.first)return l.first;var s=w(l,a-1),u=s.stateAfter;if(u&&(!i||a+(u instanceof Rr?u.lookAhead:0)<=l.modeFrontier))return a;var f=be(s.text,null,e.options.tabSize);(n==null||r>f)&&(n=a-1,r=f)}return n}function pa(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontieri;r--){var n=w(e,r).stateAfter;if(n&&(!(n instanceof Rr)||r+n.lookAhead=t:l.to>t);(r||(r=[])).push(new Br(o,l.from,s?null:l.to))}}return r}function xa(e,t,i){var r;if(e)for(var n=0;n=t:l.to>t);if(a||l.from==t&&o.type=="bookmark"&&(!i||l.marker.insertLeft)){var s=l.from==null||(o.inclusiveLeft?l.from<=t:l.from0&&a)for(var C=0;C0)){var f=[s,1],h=M(u.from,a.from),d=M(u.to,a.to);(h<0||!o.inclusiveLeft&&!h)&&f.push({from:u.from,to:a.from}),(d>0||!o.inclusiveRight&&!d)&&f.push({from:a.to,to:u.to}),n.splice.apply(n,f),s+=f.length-3}}return n}function rl(e){var t=e.markedSpans;if(t){for(var i=0;it)&&(!r||Bi(r,l.marker)<0)&&(r=l.marker)}return r}function ol(e,t,i,r,n){var l=w(e,t),o=Fe&&l.markedSpans;if(o)for(var a=0;a=0&&h<=0||f<=0&&h>=0)&&(f<=0&&(s.marker.inclusiveRight&&n.inclusiveLeft?M(u.to,i)>=0:M(u.to,i)>0)||f>=0&&(s.marker.inclusiveRight&&n.inclusiveLeft?M(u.from,r)<=0:M(u.from,r)<0)))return!0}}}function we(e){for(var t;t=ll(e);)e=t.find(-1,!0).line;return e}function Sa(e){for(var t;t=Ur(e);)e=t.find(1,!0).line;return e}function La(e){for(var t,i;t=Ur(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function zi(e,t){var i=w(e,t),r=we(i);return i==r?t:H(r)}function al(e,t){if(t>e.lastLine())return t;var i=w(e,t),r;if(!_e(e,i))return t;for(;r=Ur(i);)i=r.find(1,!0).line;return H(i)+1}function _e(e,t){var i=Fe&&t.markedSpans;if(i){for(var r=void 0,n=0;nt.maxLineLength&&(t.maxLineLength=n,t.maxLine=r)})}var Lt=function(e,t,i){this.text=e,il(this,t),this.height=i?i(this):1};Lt.prototype.lineNo=function(){return H(this)},Ct(Lt);function ka(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),rl(e),il(e,i);var n=r?r(e):1;n!=e.height&&Me(e,n)}function Ta(e){e.parent=null,rl(e)}var Ma={},Da={};function sl(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Da:Ma;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function ul(e,t){var i=bt("span",null,null,ie?"padding-right: .1px":null),r={pre:bt("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var l=n?t.rest[n-1]:t.line,o=void 0;r.pos=0,r.addToken=Aa,la(e.display.measure)&&(o=He(l,e.doc.direction))&&(r.addToken=Wa(r.addToken,o)),r.map=[];var a=t!=e.display.externalMeasured&&H(l);Ha(l,r,Zn(e,l,a)),l.styleClasses&&(l.styleClasses.bgClass&&(r.bgClass=vi(l.styleClasses.bgClass,r.bgClass||"")),l.styleClasses.textClass&&(r.textClass=vi(l.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(na(e.display.measure))),n==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(ie){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 G(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=vi(r.pre.className,r.textClass||"")),r}function Na(e){var t=k("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Aa(e,t,i,r,n,l,o){if(t){var a=e.splitSpaces?Oa(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,f;if(!s.test(t))e.col+=t.length,f=document.createTextNode(a),e.map.push(e.pos,e.pos+t.length,f),A&&E<9&&(u=!0),e.pos+=t.length;else{f=document.createDocumentFragment();for(var h=0;;){s.lastIndex=h;var d=s.exec(t),c=d?d.index-h:t.length-h;if(c){var p=document.createTextNode(a.slice(h,h+c));A&&E<9?f.appendChild(k("span",[p])):f.appendChild(p),e.map.push(e.pos,e.pos+c,p),e.col+=c,e.pos+=c}if(!d)break;h+=c+1;var v=void 0;if(d[0]==" "){var y=e.cm.options.tabSize,m=y-e.col%y;v=f.appendChild(k("span",bi(m),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text"," "),e.col+=m}else d[0]=="\r"||d[0]==` `?(v=f.appendChild(k("span",d[0]=="\r"?"␍":"␤","cm-invalidchar")),v.setAttribute("cm-text",d[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(d[0]),v.setAttribute("cm-text",d[0]),A&&E<9?f.appendChild(k("span",[v])):f.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}if(e.trailingSpace=a.charCodeAt(t.length-1)==32,i||r||n||u||l||o){var x=i||"";r&&(x+=r),n&&(x+=n);var b=k("span",[f],x,l);if(o)for(var C in o)o.hasOwnProperty(C)&&C!="style"&&C!="class"&&b.setAttribute(C,o[C]);return e.content.appendChild(b)}e.content.appendChild(f)}}function Oa(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",n=0;nu&&h.from<=u));d++);if(h.to>=f)return e(i,r,n,l,o,a,s);e(i,r.slice(0,h.to-u),n,l,null,a,s),l=null,r=r.slice(h.to-u),u=h.to}}}function fl(e,t,i,r){var n=!r&&i.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!r&&e.cm.display.input.needsContentAttribute&&(n||(n=e.content.appendChild(document.createElement("span"))),n.setAttribute("cm-marker",i.id)),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function Ha(e,t,i){var r=e.markedSpans,n=e.text,l=0;if(!r){for(var o=1;os||N.collapsed&&S.to==s&&S.from==s)){if(S.to!=null&&S.to!=s&&c>S.to&&(c=S.to,v=""),N.className&&(p+=" "+N.className),N.css&&(d=(d?d+";":"")+N.css),N.startStyle&&S.from==s&&(y+=" "+N.startStyle),N.endStyle&&S.to==c&&(C||(C=[])).push(N.endStyle,S.to),N.title&&((x||(x={})).title=N.title),N.attributes)for(var P in N.attributes)(x||(x={}))[P]=N.attributes[P];N.collapsed&&(!m||Bi(m.marker,N)<0)&&(m=S)}else S.from>s&&c>S.from&&(c=S.from)}if(C)for(var J=0;J=a)break;for(var de=Math.min(a,c);;){if(f){var ue=s+f.length;if(!m){var K=ue>de?f.slice(0,de-s):f;t.addToken(t,K,h?h+p:p,y,s+K.length==c?v:"",d,x)}if(ue>=de){f=f.slice(de-s),s=de;break}s=ue,y=""}f=n.slice(l,l=i[u++]),h=sl(i[u++],t.cm.options)}}}function hl(e,t,i){this.line=t,this.rest=La(t),this.size=this.rest?H(W(this.rest))-i+1:1,this.node=this.text=null,this.hidden=_e(e,t)}function _r(e,t,i){for(var r=[],n,l=t;l2&&l.push((s.bottom+u.top)/2-i.top)}}l.push(i.bottom-i.top)}}function ml(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;ri)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}}function _a(e,t){t=we(t);var i=H(t),r=e.display.externalMeasured=new hl(e.doc,t,i);r.lineN=i;var n=r.built=ul(e,r);return r.text=n.pre,pe(e.display.lineMeasure,n.pre),r}function bl(e,t,i,r){return Ae(e,Tt(e,t),i,r)}function Yi(e,t){if(t>=e.display.viewFrom&&t=i.lineN&&tt)&&(l=s-a,n=l-1,t>=s&&(o="right")),n!=null){if(r=e[u+2],a==s&&i==(r.insertLeft?"left":"right")&&(o=i),i=="left"&&n==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],o="left";if(i=="right"&&n==s-a)for(;u=0&&(i=e[n]).left==i.right;n--);return i}function Ya(e,t,i,r){var n=Cl(t.map,i,r),l=n.node,o=n.start,a=n.end,s=n.collapse,u;if(l.nodeType==3){for(var f=0;f<4;f++){for(;o&&Ci(t.line.text.charAt(n.coverStart+o));)--o;for(;n.coverStart+a0&&(s=r="right");var h;e.options.lineWrapping&&(h=l.getClientRects()).length>1?u=h[r=="right"?h.length-1:0]:u=l.getBoundingClientRect()}if(A&&E<9&&!o&&(!u||!u.left&&!u.right)){var d=l.parentNode.getClientRects()[0];d?u={left:d.left,right:d.left+Dt(e.display),top:d.top,bottom:d.bottom}:u=xl}for(var c=u.top-t.rect.top,p=u.bottom-t.rect.top,v=(c+p)/2,y=t.view.measure.heights,m=0;m=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!a)return o(u=="before"?s-1:s,u=="before");function f(p,v,y){var m=a[v],x=m.level==1;return o(y?p-1:p,x!=y)}var h=Jt(a,s,u),d=Qt,c=f(s,h,u=="before");return d!=null&&(c.other=f(s,d,u!="before")),c}function Ml(e,t){var i=0;t=D(e.doc,t),e.options.lineWrapping||(i=Dt(e.display)*t.ch);var r=w(e.doc,t.line),n=Pe(r)+Xr(e.display);return{left:i,right:i,top:n,bottom:n+r.height}}function Zi(e,t,i,r,n){var l=g(e,t,i);return l.xRel=n,r&&(l.outside=r),l}function Qi(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return Zi(r.first,0,null,-1,-1);var n=at(r,i),l=r.first+r.size-1;if(n>l)return Zi(r.first+r.size-1,w(r,l).text.length,null,1,1);t<0&&(t=0);for(var o=w(r,n);;){var a=Za(e,o,n,t,i),s=wa(o,a.ch+(a.xRel>0||a.outside>0?1:0));if(!s)return a;var u=s.find(1);if(u.line==n)return u;o=w(r,n=u.line)}}function Dl(e,t,i,r){r-=qi(t);var n=t.text.length,l=Zt(function(o){return Ae(e,i,o-1).bottom<=r},n,0);return n=Zt(function(o){return Ae(e,i,o).top>r},l,n),{begin:l,end:n}}function Nl(e,t,i,r){i||(i=Tt(e,t));var n=Yr(e,t,Ae(e,i,r),"line").top;return Dl(e,t,i,n)}function Ji(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function Za(e,t,i,r,n){n-=Pe(t);var l=Tt(e,t),o=qi(t),a=0,s=t.text.length,u=!0,f=He(t,e.doc.direction);if(f){var h=(e.options.lineWrapping?Ja:Qa)(e,t,i,l,f,r,n);u=h.level!=1,a=u?h.from:h.to-1,s=u?h.to:h.from-1}var d=null,c=null,p=Zt(function(L){var S=Ae(e,l,L);return S.top+=o,S.bottom+=o,Ji(S,r,n,!1)?(S.top<=n&&S.left<=r&&(d=L,c=S),!0):!1},a,s),v,y,m=!1;if(c){var x=r-c.left=C.bottom?1:0}return p=Bn(t.text,p,1),Zi(i,p,y,m,r-v)}function Qa(e,t,i,r,n,l,o){var a=Zt(function(h){var d=n[h],c=d.level!=1;return Ji(Se(e,g(i,c?d.to:d.from,c?"before":"after"),"line",t,r),l,o,!0)},0,n.length-1),s=n[a];if(a>0){var u=s.level!=1,f=Se(e,g(i,u?s.from:s.to,u?"after":"before"),"line",t,r);Ji(f,l,o,!0)&&f.top>o&&(s=n[a-1])}return s}function Ja(e,t,i,r,n,l,o){var a=Dl(e,t,r,o),s=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var f=null,h=null,d=0;d=u||c.to<=s)){var p=c.level!=1,v=Ae(e,r,p?Math.min(u,c.to)-1:Math.max(s,c.from)).right,y=vy)&&(f=c,h=y)}}return f||(f=n[n.length-1]),f.fromu&&(f={from:f.from,to:u,level:f.level}),f}var ut;function Mt(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ut==null){ut=k("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ut.appendChild(document.createTextNode("x")),ut.appendChild(k("br"));ut.appendChild(document.createTextNode("x"))}pe(e.measure,ut);var i=ut.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),Ge(e.measure),i||1}function Dt(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=k("span","xxxxxxxxxx"),i=k("pre",[t],"CodeMirror-line-like");pe(e.measure,i);var r=t.getBoundingClientRect(),n=(r.right-r.left)/10;return n>2&&(e.cachedCharWidth=n),n||10}function ji(e){for(var t=e.display,i={},r={},n=t.gutters.clientLeft,l=t.gutters.firstChild,o=0;l;l=l.nextSibling,++o){var a=e.display.gutterSpecs[o].className;i[a]=l.offsetLeft+l.clientLeft+n,r[a]=l.clientWidth}return{fixedPos:Vi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Vi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Al(e){var t=Mt(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/Dt(e.display)-3);return function(n){if(_e(e.doc,n))return 0;var l=0;if(n.widgets)for(var o=0;o0&&(u=w(e.doc,s.line).text).length==s.ch){var f=be(u,u.length,e.options.tabSize)-u.length;s=g(s.line,Math.max(0,Math.round((l-yl(e.display).left)/Dt(e.display))-f))}return s}function ht(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var i=e.display.view,r=0;rt)&&(n.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=n.viewTo)Fe&&zi(e.doc,t)n.viewFrom?Ye(e):(n.viewFrom+=r,n.viewTo+=r);else if(t<=n.viewFrom&&i>=n.viewTo)Ye(e);else if(t<=n.viewFrom){var l=Zr(e,i,i+r,1);l?(n.view=n.view.slice(l.index),n.viewFrom=l.lineN,n.viewTo+=r):Ye(e)}else if(i>=n.viewTo){var o=Zr(e,t,t,-1);o?(n.view=n.view.slice(0,o.index),n.viewTo=o.lineN):Ye(e)}else{var a=Zr(e,t,t,-1),s=Zr(e,i,i+r,1);a&&s?(n.view=n.view.slice(0,a.index).concat(_r(e,a.lineN,s.lineN)).concat(n.view.slice(s.index)),n.viewTo+=r):Ye(e)}var u=n.externalMeasured;u&&(i=n.lineN&&t=r.viewTo)){var l=r.view[ht(e,t)];if(l.node!=null){var o=l.changes||(l.changes=[]);$(o,i)==-1&&o.push(i)}}}function Ye(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Zr(e,t,i,r){var n=ht(e,t),l,o=e.display.view;if(!Fe||i==e.doc.first+e.doc.size)return{index:n,lineN:i};for(var a=e.display.viewFrom,s=0;s0){if(n==o.length-1)return null;l=a+o[n].size-t,n++}else l=a-t;t+=l,i+=l}for(;zi(e.doc,i)!=i;){if(n==(r<0?0:o.length-1))return null;i+=r*o[n-(r<0?1:0)].size,n+=r}return{index:n,lineN:i}}function ja(e,t,i){var r=e.display,n=r.view;n.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=_r(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=_r(e,t,r.viewFrom).concat(r.view):r.viewFromi&&(r.view=r.view.slice(0,ht(e,i)))),r.viewTo=i}function Ol(e){for(var t=e.display.view,i=0,r=0;r=e.display.viewTo||s.to().line0?o:e.defaultCharWidth())+"px"}if(r.other){var a=i.appendChild(k("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Qr(e,t){return e.top-t.top||e.left-t.left}function Va(e,t,i){var r=e.display,n=e.doc,l=document.createDocumentFragment(),o=yl(e.display),a=o.left,s=Math.max(r.sizerWidth,st(e)-r.sizer.offsetLeft)-o.right,u=n.direction=="ltr";function f(b,C,L,S){C<0&&(C=0),C=Math.round(C),S=Math.round(S),l.appendChild(k("div",null,"CodeMirror-selected","position: absolute; left: "+b+`px; top: `+C+"px; width: "+(L??s-b)+`px; height: `+(S-C)+"px"))}function h(b,C,L){var S=w(n,b),N=S.text.length,P,J;function R(K,fe){return qr(e,g(b,K),"div",S,fe)}function de(K,fe,V){var X=Nl(e,S,null,K),_=fe=="ltr"==(V=="after")?"left":"right",B=V=="after"?X.begin:X.end-(/\s/.test(S.text.charAt(X.end-1))?2:1);return R(B,_)[_]}var ue=He(S,n.direction);return ta(ue,C||0,L??N,function(K,fe,V,X){var _=V=="ltr",B=R(K,_?"left":"right"),he=R(fe-1,_?"right":"left"),Gt=C==null&&K==0,Ve=L==null&&fe==N,te=X==0,Oe=!ue||X==ue.length-1;if(he.top-B.top<=3){var j=(u?Gt:Ve)&&te,Dn=(u?Ve:Gt)&&Oe,Be=j?a:(_?B:he).left,gt=Dn?s:(_?he:B).right;f(Be,B.top,gt-Be,B.bottom)}else{var yt,le,Ut,Nn;_?(yt=u&&Gt&&te?a:B.left,le=u?s:de(K,V,"before"),Ut=u?a:de(fe,V,"after"),Nn=u&&Ve&&Oe?s:he.right):(yt=u?de(K,V,"before"):a,le=!u&&Gt&&te?s:B.right,Ut=!u&&Ve&&Oe?a:he.left,Nn=u?de(fe,V,"after"):s),f(yt,B.top,le-yt,B.bottom),B.bottom0?t.blinker=setInterval(function(){e.hasFocus()||Nt(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Hl(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||nn(e))}function rn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Nt(e))},100)}function nn(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(G(e,"focus",e,t),e.state.focused=!0,rt(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),ie&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),tn(e))}function Nt(e,t){e.state.delayingBlurEvent||(e.state.focused&&(G(e,"blur",e,t),e.state.focused=!1,et(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Jr(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),n=t.lineDiv.getBoundingClientRect().top,l=0,o=0;o.005||c<-.005)&&(ne.display.sizerWidth){var v=Math.ceil(f/Dt(e.display));v>e.display.maxLineLength&&(e.display.maxLineLength=v,e.display.maxLine=a.line,e.display.maxLineChanged=!0)}}}Math.abs(l)>2&&(t.scroller.scrollTop+=l)}function Fl(e){if(e.widgets)for(var t=0;t=o&&(l=at(t,Pe(w(t,s))-e.wrapper.clientHeight),o=s)}return{from:l,to:Math.max(o,l+1)}}function $a(e,t){if(!Y(e,"scrollCursorIntoView")){var i=e.display,r=i.sizer.getBoundingClientRect(),n=null,l=i.wrapper.ownerDocument;if(t.top+r.top<0?n=!0:t.bottom+r.top>(l.defaultView.innerHeight||l.documentElement.clientHeight)&&(n=!1),n!=null&&!Qo){var o=k("div","​",null,`position: absolute; top: `+(t.top-i.viewOffset-Xr(e.display))+`px; height: `+(t.bottom-t.top+Ne(e)+i.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(n),e.display.lineSpace.removeChild(o)}}}function es(e,t,i,r){r==null&&(r=0);var n;!e.options.lineWrapping&&t==i&&(i=t.sticky=="before"?g(t.line,t.ch+1,"before"):t,t=t.ch?g(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var l=0;l<5;l++){var o=!1,a=Se(e,t),s=!i||i==t?a:Se(e,i);n={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r};var u=ln(e,n),f=e.doc.scrollTop,h=e.doc.scrollLeft;if(u.scrollTop!=null&&(ar(e,u.scrollTop),Math.abs(e.doc.scrollTop-f)>1&&(o=!0)),u.scrollLeft!=null&&(ct(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(o=!0)),!o)break}return n}function ts(e,t){var i=ln(e,t);i.scrollTop!=null&&ar(e,i.scrollTop),i.scrollLeft!=null&&ct(e,i.scrollLeft)}function ln(e,t){var i=e.display,r=Mt(e.display);t.top<0&&(t.top=0);var n=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,l=Xi(e),o={};t.bottom-t.top>l&&(t.bottom=t.top+l);var a=e.doc.height+_i(i),s=t.topa-r;if(t.topn+l){var f=Math.min(t.top,(u?a:t.bottom)-l);f!=n&&(o.scrollTop=f)}var h=e.options.fixedGutter?0:i.gutters.offsetWidth,d=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-h,c=st(e)-i.gutters.offsetWidth,p=t.right-t.left>c;return p&&(t.right=t.left+c),t.left<10?o.scrollLeft=0:t.leftc+d-3&&(o.scrollLeft=t.right+(p?0:10)-c),o}function on(e,t){t!=null&&(Vr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function At(e){Vr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function or(e,t,i){(t!=null||i!=null)&&Vr(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function rs(e,t){Vr(e),e.curOp.scrollToPos=t}function Vr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=Ml(e,t.from),r=Ml(e,t.to);Pl(e,i,r,t.margin)}}function Pl(e,t,i,r){var n=ln(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});or(e,n.scrollLeft,n.scrollTop)}function ar(e,t){Math.abs(e.doc.scrollTop-t)<2||(We||sn(e,{top:t}),El(e,t,!0),We&&sn(e),fr(e,100))}function El(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!i)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function ct(e,t,i,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,Gl(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function sr(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+_i(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+Ne(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var dt=function(e,t,i){this.cm=i;var r=this.vert=k("div",[k("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=k("div",[k("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=n.tabIndex=-1,e(r),e(n),T(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),T(n,"scroll",function(){n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,A&&E<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};dt.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var n=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+n)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var l=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+l)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},dt.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},dt.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},dt.prototype.zeroWidthHack=function(){var e=ye&&!Zo?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Ke,this.disableVert=new Ke},dt.prototype.enableZeroWidthBar=function(e,t,i){e.style.visibility="";function r(){var n=e.getBoundingClientRect(),l=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);l!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},dt.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ur=function(){};ur.prototype.update=function(){return{bottom:0,right:0}},ur.prototype.setScrollLeft=function(){},ur.prototype.setScrollTop=function(){},ur.prototype.clear=function(){};function Ot(e,t){t||(t=sr(e));var i=e.display.barWidth,r=e.display.barHeight;Il(e,t);for(var n=0;n<4&&i!=e.display.barWidth||r!=e.display.barHeight;n++)i!=e.display.barWidth&&e.options.lineWrapping&&Jr(e),Il(e,sr(e)),i=e.display.barWidth,r=e.display.barHeight}function Il(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var Rl={native:dt,null:ur};function Bl(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&et(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Rl[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),T(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?ct(e,t):ar(e,t)},e),e.display.scrollbars.addClass&&rt(e.display.wrapper,e.display.scrollbars.addClass)}var is=0;function pt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++is,markArrays:null},Fa(e.curOp)}function vt(e){var t=e.curOp;t&&Ea(t,function(i){for(var r=0;r=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new $r(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function os(e){e.updatedDisplay=e.mustUpdate&&an(e.cm,e.update)}function as(e){var t=e.cm,i=t.display;e.updatedDisplay&&Jr(t),e.barMeasure=sr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=bl(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Ne(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-st(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function ss(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var i=+new Date+e.options.workTime,r=$t(e,t.highlightFrontier),n=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(l){if(r.line>=e.display.viewFrom){var o=l.styles,a=l.text.length>e.options.maxHighlightLength?lt(t.mode,r.state):null,s=qn(e,l,r,!0);a&&(r.state=a),l.styles=s.styles;var u=l.styleClasses,f=s.classes;f?l.styleClasses=f:u&&(l.styleClasses=null);for(var h=!o||o.length!=l.styles.length||u!=f&&(!u||!f||u.bgClass!=f.bgClass||u.textClass!=f.textClass),d=0;!h&&di)return fr(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),n.length&&ce(e,function(){for(var l=0;l=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&Ol(e)==0)return!1;Ul(e)&&(Ye(e),t.dims=ji(e));var n=r.first+r.size,l=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(n,t.visible.to+e.options.viewportMargin);i.viewFromo&&i.viewTo-o<20&&(o=Math.min(n,i.viewTo)),Fe&&(l=zi(e.doc,l),o=al(e.doc,o));var a=l!=i.viewFrom||o!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;ja(e,l,o),i.viewOffset=Pe(w(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var s=Ol(e);if(!a&&s==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var u=cs(e);return s>4&&(i.lineDiv.style.display="none"),ps(e,i.updateLineNumbers,t.dims),s>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ds(u),Ge(i.cursorDiv),Ge(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,a&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,fr(e,400)),i.updateLineNumbers=null,!0}function zl(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==st(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+_i(e.display)-Xi(e),i.top)}),t.visible=jr(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=jr(e.display,e.doc,i));if(!an(e,t))break;Jr(e);var n=sr(e);lr(e),Ot(e,n),fn(e,n),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function sn(e,t){var i=new $r(e,t);if(an(e,i)){Jr(e),zl(e,i);var r=sr(e);lr(e),Ot(e,r),fn(e,r),i.finish()}}function ps(e,t,i){var r=e.display,n=e.options.lineNumbers,l=r.lineDiv,o=l.firstChild;function a(p){var v=p.nextSibling;return ie&&ye&&e.display.currentWheelTarget==p?p.style.display="none":p.parentNode.removeChild(p),v}for(var s=r.view,u=r.viewFrom,f=0;f-1&&(c=!1),cl(e,h,u,i)),c&&(Ge(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(Hi(e.options,u)))),o=h.node.nextSibling}u+=h.size}for(;o;)o=a(o)}function un(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",q(e,"gutterChanged",e)}function fn(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+Ne(e)+"px"}function Gl(e){var t=e.display,i=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Vi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,l=r+"px",o=0;o=105&&(n.wrapper.style.clipPath="inset(0px)"),n.wrapper.setAttribute("translate","no"),A&&E<8&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),!ie&&!(We&&_t)&&(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,n.gutterSpecs=hn(r.gutters,r.lineNumbers),Kl(n),i.init(n)}var ei=0,Ie=null;A?Ie=-.53:We?Ie=15:ze?Ie=-.7:Dr&&(Ie=-1/3);function _l(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function gs(e){var t=_l(e);return t.x*=Ie,t.y*=Ie,t}function Xl(e,t){ze&&Hn==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var i=_l(t),r=i.x,n=i.y,l=Ie;t.deltaMode===0&&(r=t.deltaX,n=t.deltaY,l=1);var o=e.display,a=o.scroller,s=a.scrollWidth>a.clientWidth,u=a.scrollHeight>a.clientHeight;if(r&&s||n&&u){if(n&&ye&&ie){e:for(var f=t.target,h=o.view;f!=a;f=f.parentNode)for(var d=0;d=0&&M(e,r.to())<=0)return i}return-1};var O=function(e,t){this.anchor=e,this.head=t};O.prototype.from=function(){return Ir(this.anchor,this.head)},O.prototype.to=function(){return Er(this.anchor,this.head)},O.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Le(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort(function(d,c){return M(d.from(),c.from())}),i=$(t,n);for(var l=1;l0:s>=0){var u=Ir(a.from(),o.from()),f=Er(a.to(),o.to()),h=a.empty()?o.from()==o.head:a.from()==a.head;l<=i&&--i,t.splice(--l,2,new O(h?f:u,h?u:f))}}return new ge(t,i)}function qe(e,t){return new ge([new O(e,t||e)],0)}function Ze(e){return e.text?g(e.from.line+e.text.length-1,W(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Yl(e,t){if(M(e,t.from)<0)return e;if(M(e,t.to)<=0)return Ze(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Ze(t).ch-t.to.ch),g(i,r)}function cn(e,t){for(var i=[],r=0;r1&&e.remove(a.line+1,p-1),e.insert(a.line+1,m)}q(e,"change",e,t)}function Qe(e,t,i){function r(n,l,o){if(n.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges)return e.done.pop(),W(e.done)}function Vl(e,t,i,r){var n=e.history;n.undone.length=0;var l=+new Date,o,a;if((n.lastOp==r||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(o=bs(n,n.lastOp==r)))a=W(o.changes),M(t.from,t.to)==0&&M(t.from,a.to)==0?a.to=Ze(t):o.changes.push(vn(e,t));else{var s=W(n.done);for((!s||!s.ranges)&&ri(e.sel,n.done),o={changes:[vn(e,t)],generation:n.generation},n.done.push(o);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(i),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=l,n.lastOp=n.lastSelOp=r,n.lastOrigin=n.lastSelOrigin=t.origin,a||G(e,"historyAdded")}function xs(e,t,i,r){var n=t.charAt(0);return n=="*"||n=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Cs(e,t,i,r){var n=e.history,l=r&&r.origin;i==n.lastSelOp||l&&n.lastSelOrigin==l&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==l||xs(e,l,W(n.done),t))?n.done[n.done.length-1]=t:ri(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=l,n.lastSelOp=i,r&&r.clearRedo!==!1&&jl(n.undone)}function ri(e,t){var i=W(t);i&&i.ranges&&i.equals(e)||t.push(e)}function $l(e,t,i,r){var n=t["spans_"+e.id],l=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(o){o.markedSpans&&((n||(n=t["spans_"+e.id]={}))[l]=o.markedSpans),++l})}function ws(e){if(!e)return null;for(var t,i=0;i-1&&(W(a)[h]=u[h],delete u[h])}}return r}function gn(e,t,i,r){if(r){var n=e.anchor;if(i){var l=M(t,n)<0;l!=M(i,n)<0?(n=t,t=i):l!=M(t,i)<0&&(t=i)}return new O(n,t)}else return new O(i||t,t)}function ii(e,t,i,r,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),ee(e,new ge([gn(e.sel.primary(),t,i,n)],0),r)}function to(e,t,i){for(var r=[],n=e.cm&&(e.cm.display.shift||e.extend),l=0;l=t.ch:a.to>t.ch))){if(n&&(G(s,"beforeCursorEnter"),s.explicitlyCleared))if(l.markedSpans){--o;continue}else break;if(!s.atomic)continue;if(i){var h=s.find(r<0?1:-1),d=void 0;if((r<0?f:u)&&(h=ao(e,h,-r,h&&h.line==t.line?l:null)),h&&h.line==t.line&&(d=M(h,i))&&(r<0?d<0:d>0))return Ht(e,h,t,r,n)}var c=s.find(r<0?-1:1);return(r<0?u:f)&&(c=ao(e,c,r,c.line==t.line?l:null)),c?Ht(e,c,t,r,n):null}}return t}function li(e,t,i,r,n){var l=r||1,o=Ht(e,t,i,l,n)||!n&&Ht(e,t,i,l,!0)||Ht(e,t,i,-l,n)||!n&&Ht(e,t,i,-l,!0);return o||(e.cantEdit=!0,g(e.first,0))}function ao(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?D(e,g(t.line-1)):null:i>0&&t.ch==(r||w(e,t.line)).text.length?t.line=0;--n)fo(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else fo(e,t)}}function fo(e,t){if(!(t.text.length==1&&t.text[0]==""&&M(t.from,t.to)==0)){var i=cn(e,t);Vl(e,t,i,e.cm?e.cm.curOp.id:NaN),dr(e,t,i,Ri(e,t));var r=[];Qe(e,function(n,l){!l&&$(r,n.history)==-1&&(vo(n.history,t),r.push(n.history)),dr(n,t,null,Ri(n,t))})}}function oi(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!i)){for(var n=e.history,l,o=e.sel,a=t=="undo"?n.done:n.undone,s=t=="undo"?n.undone:n.done,u=0;u=0;--c){var p=d(c);if(p)return p.v}}}}function ho(e,t){if(t!=0&&(e.first+=t,e.sel=new ge(Hr(e.sel.ranges,function(n){return new O(g(n.anchor.line+t,n.anchor.ch),g(n.head.line+t,n.head.ch))}),e.sel.primIndex),e.cm)){ae(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;re.lastLine())){if(t.from.linel&&(t={from:t.from,to:g(l,w(e,l).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ot(e,t.from,t.to),i||(i=cn(e,t)),e.cm?ks(e.cm,t,r):pn(e,t,r),ni(e,i,Te),e.cantEdit&&li(e,g(e.firstLine(),0))&&(e.cantEdit=!1)}}function ks(e,t,i){var r=e.doc,n=e.display,l=t.from,o=t.to,a=!1,s=l.line;e.options.lineWrapping||(s=H(we(w(r,l.line))),r.iter(s,o.line+1,function(c){if(c==n.maxLine)return a=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Gn(e),pn(r,t,i,Al(e)),e.options.lineWrapping||(r.iter(s,l.line+t.text.length,function(c){var p=Kr(c);p>n.maxLineLength&&(n.maxLine=c,n.maxLineLength=p,n.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),pa(r,l.line),fr(e,400);var u=t.text.length-(o.line-l.line)-1;t.full?ae(e):l.line==o.line&&t.text.length==1&&!Zl(e.doc,t)?Xe(e,l.line,"text"):ae(e,l.line,o.line+1,u);var f=xe(e,"changes"),h=xe(e,"change");if(h||f){var d={from:l,to:o,text:t.text,removed:t.removed,origin:t.origin};h&&q(e,"change",e,d),f&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}function Pt(e,t,i,r,n){var l;r||(r=i),M(r,i)<0&&(l=[r,i],i=l[0],r=l[1]),typeof t=="string"&&(t=e.splitLines(t)),Ft(e,{from:i,to:r,text:t,origin:n})}function co(e,t,i,r){i1||!(this.children[0]instanceof vr))){var a=[];this.collapse(a),this.children=[new vr(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var o=n.lines.length%25+25,a=o;a10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=f,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&ae(e,r,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&lo(e.doc)),e&&q(e,"markerCleared",e,this,r,n),t&&vt(e),this.parent&&this.parent.clear()}},Je.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,n=0;n0||o==0&&l.clearWhenEmpty!==!1)return l;if(l.replacedWith&&(l.collapsed=!0,l.widgetNode=bt("span",[l.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||l.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(l.widgetNode.insertLeft=!0)),l.collapsed){if(ol(e,t.line,t,i,l)||t.line!=i.line&&ol(e,i.line,t,i,l))throw new Error("Inserting collapsed marker partially overlapping an existing one");ga()}l.addToHistory&&Vl(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var a=t.line,s=e.cm,u;if(e.iter(a,i.line+1,function(h){s&&l.collapsed&&!s.options.lineWrapping&&we(h)==s.display.maxLine&&(u=!0),l.collapsed&&a!=t.line&&Me(h,0),ma(h,new Br(l,a==t.line?t.ch:null,a==i.line?i.ch:null),e.cm&&e.cm.curOp),++a}),l.collapsed&&e.iter(t.line,i.line+1,function(h){_e(e,h)&&Me(h,0)}),l.clearOnEnter&&T(l,"beforeCursorEnter",function(){return l.clear()}),l.readOnly&&(va(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),l.collapsed&&(l.id=++yo,l.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),l.collapsed)ae(s,t.line,i.line+1);else if(l.className||l.startStyle||l.endStyle||l.css||l.attributes||l.title)for(var f=t.line;f<=i.line;f++)Xe(s,f,"text");l.atomic&&lo(s.doc),q(s,"markerAdded",s,l)}return l}var mr=function(e,t){this.markers=e,this.primary=t;for(var i=0;i=0;s--)Ft(this,r[s]);a?io(this,a):this.cm&&At(this.cm)}),undo:Q(function(){oi(this,"undo")}),redo:Q(function(){oi(this,"redo")}),undoSelection:Q(function(){oi(this,"undo",!0)}),redoSelection:Q(function(){oi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,i){e=D(this,e),t=D(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,function(l){var o=l.markedSpans;if(o)for(var a=0;a=s.to||s.from==null&&n!=e.line||s.from!=null&&n==t.line&&s.from>=t.ch)&&(!i||i(s.marker))&&r.push(s.marker.parent||s.marker)}++n}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;re)return t=e,!0;e-=l,++i}),D(this,g(i,t))},indexFromPos:function(e){e=D(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var f=e.dataTransfer.getData("Text");if(f){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),ni(t.doc,qe(i,i)),h)for(var d=0;d=0;a--)Pt(e.doc,"",r[a].from,r[a].to,"+delete");At(e)})}function mn(e,t,i){var r=Bn(e.text,t+i,i);return r<0||r>e.text.length?null:r}function bn(e,t,i){var r=mn(e,t.ch,i);return r==null?null:new g(t.line,r,i<0?"after":"before")}function xn(e,t,i,r,n){if(e){t.doc.direction=="rtl"&&(n=-n);var l=He(i,t.doc.direction);if(l){var o=n<0?W(l):l[0],a=n<0==(o.level==1),s=a?"after":"before",u;if(o.level>0||t.doc.direction=="rtl"){var f=Tt(t,i);u=n<0?i.text.length-1:0;var h=Ae(t,f,u).top;u=Zt(function(d){return Ae(t,f,d).top==h},n<0==(o.level==1)?o.from:o.to-1,u),s=="before"&&(u=mn(i,u,1))}else u=n<0?o.to:o.from;return new g(r,u,s)}}return new g(r,n<0?i.text.length:0,n<0?"before":"after")}function Bs(e,t,i,r){var n=He(t,e.doc.direction);if(!n)return bn(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var l=Jt(n,i.ch,i.sticky),o=n[l];if(e.doc.direction=="ltr"&&o.level%2==0&&(r>0?o.to>i.ch:o.from=o.from&&d>=f.begin)){var c=h?"before":"after";return new g(i.line,d,c)}}var p=function(m,x,b){for(var C=function(P,J){return J?new g(i.line,a(P,1),"before"):new g(i.line,P,"after")};m>=0&&m0==(L.level!=1),N=S?b.begin:a(b.end,-1);if(L.from<=N&&N0?f.end:a(f.begin,-1);return y!=null&&!(r>0&&y==t.text.length)&&(v=p(r>0?0:n.length-1,r,u(y)),v)?v:null}var Cr={selectAll:so,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Te)},killLine:function(e){return Rt(e,function(t){if(t.empty()){var i=w(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line0)n=new g(n.line,n.ch+1),e.replaceRange(l.charAt(n.ch-1)+l.charAt(n.ch-2),g(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var o=w(e.doc,n.line-1).text;o&&(n=new g(n.line,1),e.replaceRange(l.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),g(n.line-1,o.length-1),n,"+transpose"))}}i.push(new O(n,n))}e.setSelections(i)})},newlineAndIndent:function(e){return ce(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;re&&M(t,this.pos)==0&&i==this.button};var Sr,Lr;function Ys(e,t){var i=+new Date;return Lr&&Lr.compare(i,e,t)?(Sr=Lr=null,"triple"):Sr&&Sr.compare(i,e,t)?(Lr=new wn(i,e,t),Sr=null,"double"):(Sr=new wn(i,e,t),Lr=null,"single")}function Ho(e){var t=this,i=t.display;if(!(Y(t,e)||i.activeTouch&&i.input.supportsTouch())){if(i.input.ensurePolled(),i.shift=e.shiftKey,Ee(i,e)){ie||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(!Sn(t,e)){var r=ft(t,e),n=Kn(e),l=r?Ys(r,n):"single";Ar(t).focus(),n==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&qs(t,n,r,l,e))&&(n==1?r?Qs(t,r,l,e):Li(e)==i.scroller&&oe(e):n==2?(r&&ii(t.doc,r),setTimeout(function(){return i.input.focus()},20)):n==3&&(pi?t.display.input.onContextMenu(e):rn(t)))}}}function qs(e,t,i,r,n){var l="Click";return r=="double"?l="Double"+l:r=="triple"&&(l="Triple"+l),l=(t==1?"Left":t==2?"Middle":"Right")+l,wr(e,Lo(l,n),n,function(o){if(typeof o=="string"&&(o=Cr[o]),!o)return!1;var a=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),a=o(e,i)!=Or}finally{e.state.suppressEdits=!1}return a})}function Zs(e,t,i){var r=e.getOption("configureMouse"),n=r?r(e,t,i):{};if(n.unit==null){var l=Jo?i.shiftKey&&i.metaKey:i.altKey;n.unit=l?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(n.extend==null||e.doc.extend)&&(n.extend=e.doc.extend||i.shiftKey),n.addNew==null&&(n.addNew=ye?i.metaKey:i.ctrlKey),n.moveOnDrag==null&&(n.moveOnDrag=!(ye?i.altKey:i.ctrlKey)),n}function Qs(e,t,i,r){A?setTimeout(gi(Hl,e),0):e.curOp.focus=me(xt(e));var n=Zs(e,i,r),l=e.doc.sel,o;e.options.dragDrop&&ia&&!e.isReadOnly()&&i=="single"&&(o=l.contains(t))>-1&&(M((o=l.ranges[o]).from(),t)<0||t.xRel>0)&&(M(o.to(),t)>0||t.xRel<0)?Js(e,r,t,n):js(e,r,t,n)}function Js(e,t,i,r){var n=e.display,l=!1,o=Z(e,function(u){ie&&(n.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:rn(e)),ve(n.wrapper.ownerDocument,"mouseup",o),ve(n.wrapper.ownerDocument,"mousemove",a),ve(n.scroller,"dragstart",s),ve(n.scroller,"drop",o),l||(oe(u),r.addNew||ii(e.doc,i,null,null,r.extend),ie&&!Dr||A&&E==9?setTimeout(function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()},20):n.input.focus())}),a=function(u){l=l||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return l=!0};ie&&(n.scroller.draggable=!0),e.state.draggingText=o,o.copy=!r.moveOnDrag,T(n.wrapper.ownerDocument,"mouseup",o),T(n.wrapper.ownerDocument,"mousemove",a),T(n.scroller,"dragstart",s),T(n.scroller,"drop",o),e.state.delayingBlurEvent=!0,setTimeout(function(){return n.input.focus()},20),n.scroller.dragDrop&&n.scroller.dragDrop()}function Fo(e,t,i){if(i=="char")return new O(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new O(g(t.line,0),D(e.doc,g(t.line+1,0)));var r=i(e,t);return new O(r.from,r.to)}function js(e,t,i,r){A&&rn(e);var n=e.display,l=e.doc;oe(t);var o,a,s=l.sel,u=s.ranges;if(r.addNew&&!r.extend?(a=l.sel.contains(i),a>-1?o=u[a]:o=new O(i,i)):(o=l.sel.primary(),a=l.sel.primIndex),r.unit=="rectangle")r.addNew||(o=new O(i,i)),i=ft(e,t,!0,!0),a=-1;else{var f=Fo(e,i,r.unit);r.extend?o=gn(o,f.anchor,f.head,r.extend):o=f}r.addNew?a==-1?(a=u.length,ee(l,Le(e,u.concat([o]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&r.unit=="char"&&!r.extend?(ee(l,Le(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),s=l.sel):yn(l,a,o,yi):(a=0,ee(l,new ge([o],0),yi),s=l.sel);var h=i;function d(b){if(M(h,b)!=0)if(h=b,r.unit=="rectangle"){for(var C=[],L=e.options.tabSize,S=be(w(l,i.line).text,i.ch,L),N=be(w(l,b.line).text,b.ch,L),P=Math.min(S,N),J=Math.max(S,N),R=Math.min(i.line,b.line),de=Math.min(e.lastLine(),Math.max(i.line,b.line));R<=de;R++){var ue=w(l,R).text,K=mi(ue,P,L);P==J?C.push(new O(g(R,K),g(R,K))):ue.length>K&&C.push(new O(g(R,K),g(R,mi(ue,J,L))))}C.length||C.push(new O(i,i)),ee(l,Le(e,s.ranges.slice(0,a).concat(C),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(b)}else{var fe=o,V=Fo(e,b,r.unit),X=fe.anchor,_;M(V.anchor,X)>0?(_=V.head,X=Ir(fe.from(),V.anchor)):(_=V.anchor,X=Er(fe.to(),V.head));var B=s.ranges.slice(0);B[a]=Vs(e,new O(D(l,X),_)),ee(l,Le(e,B,a),yi)}}var c=n.wrapper.getBoundingClientRect(),p=0;function v(b){var C=++p,L=ft(e,b,!0,r.unit=="rectangle");if(L)if(M(L,h)!=0){e.curOp.focus=me(xt(e)),d(L);var S=jr(n,l);(L.line>=S.to||L.linec.bottom?20:0;N&&setTimeout(Z(e,function(){p==C&&(n.scroller.scrollTop+=N,v(b))}),50)}}function y(b){e.state.selectingText=!1,p=1/0,b&&(oe(b),n.input.focus()),ve(n.wrapper.ownerDocument,"mousemove",m),ve(n.wrapper.ownerDocument,"mouseup",x),l.history.lastSelOrigin=null}var m=Z(e,function(b){b.buttons===0||!Kn(b)?y(b):v(b)}),x=Z(e,y);e.state.selectingText=x,T(n.wrapper.ownerDocument,"mousemove",m),T(n.wrapper.ownerDocument,"mouseup",x)}function Vs(e,t){var i=t.anchor,r=t.head,n=w(e.doc,i.line);if(M(i,r)==0&&i.sticky==r.sticky)return t;var l=He(n);if(!l)return t;var o=Jt(l,i.ch,i.sticky),a=l[o];if(a.from!=i.ch&&a.to!=i.ch)return t;var s=o+(a.from==i.ch==(a.level!=1)?0:1);if(s==0||s==l.length)return t;var u;if(r.line!=i.line)u=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var f=Jt(l,r.ch,r.sticky),h=f-o||(r.ch-i.ch)*(a.level==1?-1:1);f==s-1||f==s?u=h<0:u=h>0}var d=l[s+(u?-1:0)],c=u==(d.level==1),p=c?d.from:d.to,v=c?"after":"before";return i.ch==p&&i.sticky==v?t:new O(new g(i.line,p,v),r)}function Po(e,t,i,r){var n,l;if(t.touches)n=t.touches[0].clientX,l=t.touches[0].clientY;else try{n=t.clientX,l=t.clientY}catch{return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&oe(t);var o=e.display,a=o.lineDiv.getBoundingClientRect();if(l>a.bottom||!xe(e,i))return Si(t);l-=a.top-o.viewOffset;for(var s=0;s=n){var f=at(e.doc,l),h=e.display.gutterSpecs[s];return G(e,i,e,f,h.className,t),Si(t)}}}function Sn(e,t){return Po(e,t,"gutterClick",!0)}function Eo(e,t){Ee(e.display,t)||$s(e,t)||Y(e,t,"contextmenu")||pi||e.display.input.onContextMenu(t)}function $s(e,t){return xe(e,"gutterContextMenu")?Po(e,t,"gutterContextMenu",!1):!1}function Io(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),nr(e)}var Bt={toString:function(){return"CodeMirror.Init"}},Ro={},fi={};function eu(e){var t=e.optionHandlers;function i(r,n,l,o){e.defaults[r]=n,l&&(t[r]=o?function(a,s,u){u!=Bt&&l(a,s,u)}:l)}e.defineOption=i,e.Init=Bt,i("value","",function(r,n){return r.setValue(n)},!0),i("mode",null,function(r,n){r.doc.modeOption=n,dn(r)},!0),i("indentUnit",2,dn,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){cr(r),nr(r),ae(r)},!0),i("lineSeparator",null,function(r,n){if(r.doc.lineSep=n,!!n){var l=[],o=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var f=s.text.indexOf(n,u);if(f==-1)break;u=f+n.length,l.push(g(o,f))}o++});for(var a=l.length-1;a>=0;a--)Pt(r.doc,n,l[a],g(l[a].line,l[a].ch+n.length))}}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,n,l){r.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),l!=Bt&&r.refresh()}),i("specialCharPlaceholder",Na,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",_t?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,n){return r.getInputField().spellcheck=n},!0),i("autocorrect",!1,function(r,n){return r.getInputField().autocorrect=n},!0),i("autocapitalize",!1,function(r,n){return r.getInputField().autocapitalize=n},!0),i("rtlMoveVisually",!jo),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){Io(r),hr(r)},!0),i("keyMap","default",function(r,n,l){var o=si(n),a=l!=Bt&&si(l);a&&a.detach&&a.detach(r,o),o.attach&&o.attach(r,a||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,ru,!0),i("gutters",[],function(r,n){r.display.gutterSpecs=hn(n,r.options.lineNumbers),hr(r)},!0),i("fixedGutter",!0,function(r,n){r.display.gutters.style.left=n?Vi(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return Ot(r)},!0),i("scrollbarStyle","native",function(r){Bl(r),Ot(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,n){r.display.gutterSpecs=hn(r.options.gutters,n),hr(r)},!0),i("firstLineNumber",1,hr,!0),i("lineNumberFormatter",function(r){return r},hr,!0),i("showCursorWhenSelecting",!1,lr,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,n){n=="nocursor"&&(Nt(r),r.display.input.blur()),r.display.input.readOnlyChanged(n)}),i("screenReaderLabel",null,function(r,n){n=n===""?null:n,r.display.input.screenReaderLabelChanged(n)}),i("disableInput",!1,function(r,n){n||r.display.input.reset()},!0),i("dragDrop",!0,tu),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,lr,!0),i("singleCursorHeightPerLine",!0,lr,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,cr,!0),i("addModeClass",!1,cr,!0),i("pollInterval",100),i("undoDepth",200,function(r,n){return r.doc.history.undoDepth=n}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,cr,!0),i("moveInputWithCursor",!0,function(r,n){n||r.display.input.resetPosition()}),i("tabindex",null,function(r,n){return r.display.input.getField().tabIndex=n||""}),i("autofocus",null),i("direction","ltr",function(r,n){return r.doc.setDirection(n)},!0),i("phrases",null)}function tu(e,t,i){var r=i&&i!=Bt;if(!t!=!r){var n=e.display.dragFunctions,l=t?T:ve;l(e.display.scroller,"dragstart",n.start),l(e.display.scroller,"dragenter",n.enter),l(e.display.scroller,"dragover",n.over),l(e.display.scroller,"dragleave",n.leave),l(e.display.scroller,"drop",n.drop)}}function ru(e){e.options.lineWrapping?(rt(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(et(e.display.wrapper,"CodeMirror-wrap"),Ui(e)),$i(e),ae(e),nr(e),setTimeout(function(){return Ot(e)},100)}function I(e,t){var i=this;if(!(this instanceof I))return new I(e,t);this.options=t=t?nt(t):{},nt(Ro,t,!1);var r=t.value;typeof r=="string"?r=new se(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var n=new I.inputStyles[t.inputStyle](this),l=this.display=new vs(e,r,n,t);l.wrapper.CodeMirror=this,Io(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Bl(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 Ke,keySeq:null,specialChars:null},t.autofocus&&!_t&&l.input.focus(),A&&E<11&&setTimeout(function(){return i.display.input.reset(!0)},20),iu(this),Fs(),pt(this),this.curOp.forceUpdate=!0,Ql(this,r),t.autofocus&&!_t||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&nn(i)},20):Nt(this);for(var o in fi)fi.hasOwnProperty(o)&&fi[o](this,t[o],Bt);Ul(this),t.finishInit&&t.finishInit(this);for(var a=0;a20*20}T(t.scroller,"touchstart",function(s){if(!Y(e,s)&&!l(s)&&!Sn(e,s)){t.input.ensurePolled(),clearTimeout(i);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),T(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),T(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!Ee(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var f=e.coordsChar(t.activeTouch,"page"),h;!u.prev||o(u,u.prev)?h=new O(f,f):!u.prev.prev||o(u,u.prev.prev)?h=e.findWordAt(f):h=new O(g(f.line,0),D(e.doc,g(f.line+1,0))),e.setSelection(h.anchor,h.head),e.focus(),oe(s)}n()}),T(t.scroller,"touchcancel",n),T(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ar(e,t.scroller.scrollTop),ct(e,t.scroller.scrollLeft,!0),G(e,"scroll",e))}),T(t.scroller,"mousewheel",function(s){return Xl(e,s)}),T(t.scroller,"DOMMouseScroll",function(s){return Xl(e,s)}),T(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){Y(e,s)||jt(s)},over:function(s){Y(e,s)||(Hs(e,s),jt(s))},start:function(s){return Ws(e,s)},drop:Z(e,Os),leave:function(s){Y(e,s)||xo(e)}};var a=t.input.getField();T(a,"keyup",function(s){return Oo.call(e,s)}),T(a,"keydown",Z(e,Ao)),T(a,"keypress",Z(e,Wo)),T(a,"focus",function(s){return nn(e,s)}),T(a,"blur",function(s){return Nt(e,s)})}var Ln=[];I.defineInitHook=function(e){return Ln.push(e)};function kr(e,t,i,r){var n=e.doc,l;i==null&&(i="add"),i=="smart"&&(n.mode.indent?l=$t(e,t).state:i="prev");var o=e.options.tabSize,a=w(n,t),s=be(a.text,null,o);a.stateAfter&&(a.stateAfter=null);var u=a.text.match(/^\s*/)[0],f;if(!r&&!/\S/.test(a.text))f=0,i="not";else if(i=="smart"&&(f=n.mode.indent(l,a.text.slice(u.length),a.text),f==Or||f>150)){if(!r)return;i="prev"}i=="prev"?t>n.first?f=be(w(n,t-1).text,null,o):f=0:i=="add"?f=s+e.options.indentUnit:i=="subtract"?f=s-e.options.indentUnit:typeof i=="number"&&(f=s+i),f=Math.max(0,f);var h="",d=0;if(e.options.indentWithTabs)for(var c=Math.floor(f/o);c;--c)d+=o,h+=" ";if(do,s=Mi(t),u=null;if(a&&r.ranges.length>1)if(ke&&ke.text.join(` `)==t){if(r.ranges.length%ke.text.length==0){u=[];for(var f=0;f=0;d--){var c=r.ranges[d],p=c.from(),v=c.to();c.empty()&&(i&&i>0?p=g(p.line,p.ch-i):e.state.overwrite&&!a?v=g(v.line,Math.min(w(l,v.line).text.length,v.ch+W(s).length)):a&&ke&&ke.lineWise&&ke.text.join(` `)==s.join(` `)&&(p=v=g(p.line,0)));var y={from:p,to:v,text:u?u[d%u.length]:s,origin:n||(a?"paste":e.state.cutIncoming>o?"cut":"+input")};Ft(e.doc,y),q(e,"inputRead",e,y)}t&&!a&&zo(e,t),At(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Bo(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&ce(t,function(){return kn(t,i,0,null,"paste")}),!0}function zo(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var n=i.ranges[r];if(!(n.head.ch>100||r&&i.ranges[r-1].head.line==n.head.line)){var l=e.getModeAt(n.head),o=!1;if(l.electricChars){for(var a=0;a-1){o=kr(e,n.head.line,"smart");break}}else l.electricInput&&l.electricInput.test(w(e.doc,n.head.line).text.slice(0,n.head.ch))&&(o=kr(e,n.head.line,"smart"));o&&q(e,"electricInput",e,n.head.line)}}}function Go(e){for(var t=[],i=[],r=0;rl&&(kr(this,a.head.line,r,!0),l=a.head.line,o==this.doc.sel.primIndex&&At(this));else{var s=a.from(),u=a.to(),f=Math.max(l,s.line);l=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var h=f;h0&&yn(this.doc,o,new O(s,d[o].to()),Te)}}}),getTokenAt:function(r,n){return jn(this,r,n)},getLineTokens:function(r,n){return jn(this,g(r),n,!0)},getTokenTypeAt:function(r){r=D(this.doc,r);var n=Zn(this,w(this.doc,r.line)),l=0,o=(n.length-1)/2,a=r.ch,s;if(a==0)s=n[2];else for(;;){var u=l+o>>1;if((u?n[u*2-1]:0)>=a)o=u;else if(n[u*2+1]s&&(r=s,o=!0),a=w(this.doc,r)}else a=r;return Yr(this,a,{top:0,left:0},n||"page",l||o).top+(o?this.doc.height-Pe(a):0)},defaultTextHeight:function(){return Mt(this.display)},defaultCharWidth:function(){return Dt(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,n,l,o,a){var s=this.display;r=Se(this,D(this.doc,r));var u=r.bottom,f=r.left;if(n.style.position="absolute",n.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(n),s.sizer.appendChild(n),o=="over")u=r.top;else if(o=="above"||o=="near"){var h=Math.max(s.wrapper.clientHeight,this.doc.height),d=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(o=="above"||r.bottom+n.offsetHeight>h)&&r.top>n.offsetHeight?u=r.top-n.offsetHeight:r.bottom+n.offsetHeight<=h&&(u=r.bottom),f+n.offsetWidth>d&&(f=d-n.offsetWidth)}n.style.top=u+"px",n.style.left=n.style.right="",a=="right"?(f=s.sizer.clientWidth-n.offsetWidth,n.style.right="0px"):(a=="left"?f=0:a=="middle"&&(f=(s.sizer.clientWidth-n.offsetWidth)/2),n.style.left=f+"px"),l&&ts(this,{left:f,top:u,right:f+n.offsetWidth,bottom:u+n.offsetHeight})},triggerOnKeyDown:ne(Ao),triggerOnKeyPress:ne(Wo),triggerOnKeyUp:Oo,triggerOnMouseDown:ne(Ho),execCommand:function(r){if(Cr.hasOwnProperty(r))return Cr[r].call(null,this)},triggerElectric:ne(function(r){zo(this,r)}),findPosH:function(r,n,l,o){var a=1;n<0&&(a=-1,n=-n);for(var s=D(this.doc,r),u=0;u0&&f(l.charAt(o-1));)--o;for(;a.5||this.options.lineWrapping)&&$i(this),G(this,"refresh",this)}),swapDoc:ne(function(r){var n=this.doc;return n.cm=null,this.state.selectingText&&this.state.selectingText(),Ql(this,r),nr(this),this.display.input.reset(),or(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,q(this,"swapDoc",this,n),n}),phrase:function(r){var n=this.options.phrases;return n&&Object.prototype.hasOwnProperty.call(n,r)?n[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ct(e),e.registerHelper=function(r,n,l){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][n]=l},e.registerGlobalHelper=function(r,n,l,o){e.registerHelper(r,n,o),i[r]._global.push({pred:l,val:o})}}function Mn(e,t,i,r,n){var l=t,o=i,a=w(e,t.line),s=n&&e.direction=="rtl"?-i:i;function u(){var x=t.line+s;return x=e.first+e.size?!1:(t=new g(x,t.ch,t.sticky),a=w(e,x))}function f(x){var b;if(r=="codepoint"){var C=a.text.charCodeAt(t.ch+(i>0?0:-1));if(isNaN(C))b=null;else{var L=i>0?C>=55296&&C<56320:C>=56320&&C<57343;b=new g(t.line,Math.max(0,Math.min(a.text.length,t.ch+i*(L?2:1))),-i)}}else n?b=Bs(e.cm,a,t,i):b=bn(a,t,i);if(b==null)if(!x&&u())t=xn(n,e.cm,a,t.line,s);else return!1;else t=b;return!0}if(r=="char"||r=="codepoint")f();else if(r=="column")f(!0);else if(r=="word"||r=="group")for(var h=null,d=r=="group",c=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(i<0&&!f(!p));p=!1){var v=a.text.charAt(t.ch)||` `,y=Fr(v,c)?"w":d&&v==` `?"n":!d||/\s/.test(v)?null:"p";if(d&&!p&&!y&&(y="s"),h&&h!=y){i<0&&(i=1,f(),t.sticky="after");break}if(y&&(h=y),i>0&&!f(!p))break}var m=li(e,t,l,o,!0);return Fi(l,m)&&(m.hitSide=!0),m}function Ko(e,t,i,r){var n=e.doc,l=t.left,o;if(r=="page"){var a=Math.min(e.display.wrapper.clientHeight,Ar(e).innerHeight||n(e).documentElement.clientHeight),s=Math.max(a-.5*Mt(e.display),3);o=(i>0?t.bottom:t.top)+i*s}else r=="line"&&(o=i>0?t.bottom+3:t.top-3);for(var u;u=Qi(e,l,o),!!u.outside;){if(i<0?o<=0:o>=n.height){u.hitSide=!0;break}o+=i*5}return u}var F=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ke,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};F.prototype.init=function(e){var t=this,i=this,r=i.cm,n=i.div=e.lineDiv;n.contentEditable=!0,Tn(n,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function l(a){for(var s=a.target;s;s=s.parentNode){if(s==n)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}T(n,"paste",function(a){!l(a)||Y(r,a)||Bo(a,r)||E<=11&&setTimeout(Z(r,function(){return t.updateFromDOM()}),20)}),T(n,"compositionstart",function(a){t.composing={data:a.data,done:!1}}),T(n,"compositionupdate",function(a){t.composing||(t.composing={data:a.data,done:!1})}),T(n,"compositionend",function(a){t.composing&&(a.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),T(n,"touchstart",function(){return i.forceCompositionEnd()}),T(n,"input",function(){t.composing||t.readFromDOMSoon()});function o(a){if(!(!l(a)||Y(r,a))){if(r.somethingSelected())hi({lineWise:!1,text:r.getSelections()}),a.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=Go(r);hi({lineWise:!0,text:s.text}),a.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,Te),r.replaceSelection("",null,"cut")})}else return;if(a.clipboardData){a.clipboardData.clearData();var u=ke.text.join(` `);if(a.clipboardData.setData("Text",u),a.clipboardData.getData("Text")==u){a.preventDefault();return}}var f=Uo(),h=f.firstChild;Tn(h),r.display.lineSpace.insertBefore(f,r.display.lineSpace.firstChild),h.value=ke.text.join(` `);var d=me(it(n));Xt(h),setTimeout(function(){r.display.lineSpace.removeChild(f),d.focus(),d==n&&i.showPrimarySelection()},50)}}T(n,"copy",o),T(n,"cut",o)},F.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},F.prototype.prepareSelection=function(){var e=Wl(this.cm,!1);return e.focus=me(it(this.div))==this.div,e},F.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},F.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},F.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),n=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||n.line=t.display.viewFrom&&_o(t,r)||{node:a[0].measure.map[2],offset:0},u=n.linee.firstLine()&&(r=g(r.line-1,w(e.doc,r.line-1).length)),n.ch==w(e.doc,n.line).text.length&&n.linet.viewTo-1)return!1;var l,o,a;r.line==t.viewFrom||(l=ht(e,r.line))==0?(o=H(t.view[0].line),a=t.view[0].node):(o=H(t.view[l].line),a=t.view[l-1].node.nextSibling);var s=ht(e,n.line),u,f;if(s==t.view.length-1?(u=t.viewTo-1,f=t.lineDiv.lastChild):(u=H(t.view[s+1].line)-1,f=t.view[s+1].node.previousSibling),!a)return!1;for(var h=e.doc.splitLines(ou(e,a,f,o,u)),d=ot(e.doc,g(o,0),g(u,w(e.doc,u).text.length));h.length>1&&d.length>1;)if(W(h)==W(d))h.pop(),d.pop(),u--;else if(h[0]==d[0])h.shift(),d.shift(),o++;else break;for(var c=0,p=0,v=h[0],y=d[0],m=Math.min(v.length,y.length);cr.ch&&x.charCodeAt(x.length-p-1)==b.charCodeAt(b.length-p-1);)c--,p++;h[h.length-1]=x.slice(0,x.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(c).replace(/\u200b+$/,"");var L=g(o,c),S=g(u,d.length?W(d).length-p:0);if(h.length>1||h[0]||M(L,S))return Pt(e.doc,h,L,S,"+input"),!0},F.prototype.ensurePolled=function(){this.forceCompositionEnd()},F.prototype.reset=function(){this.forceCompositionEnd()},F.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},F.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},F.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ce(this.cm,function(){return ae(e.cm)})},F.prototype.setUneditable=function(e){e.contentEditable="false"},F.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Z(this.cm,kn)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},F.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},F.prototype.onContextMenu=function(){},F.prototype.resetPosition=function(){},F.prototype.needsContentAttribute=!0;function _o(e,t){var i=Yi(e,t.line);if(!i||i.hidden)return null;var r=w(e.doc,t.line),n=ml(i,r,t.line),l=He(r,e.doc.direction),o="left";if(l){var a=Jt(l,t.ch);o=a%2?"right":"left"}var s=Cl(n.map,t.ch,o);return s.offset=s.collapse=="right"?s.end:s.start,s}function lu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function zt(e,t){return t&&(e.bad=!0),e}function ou(e,t,i,r,n){var l="",o=!1,a=e.doc.lineSeparator(),s=!1;function u(c){return function(p){return p.id==c}}function f(){o&&(l+=a,s&&(l+=a),o=s=!1)}function h(c){c&&(f(),l+=c)}function d(c){if(c.nodeType==1){var p=c.getAttribute("cm-text");if(p){h(p);return}var v=c.getAttribute("cm-marker"),y;if(v){var m=e.findMarks(g(r,0),g(n+1,0),u(+v));m.length&&(y=m[0].find(0))&&h(ot(e.doc,y.from,y.to).join(a));return}if(c.getAttribute("contenteditable")=="false")return;var x=/^(pre|div|p|li|table|br)$/i.test(c.nodeName);if(!/^br$/i.test(c.nodeName)&&c.textContent.length==0)return;x&&f();for(var b=0;b=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),T(n,"paste",function(o){Y(r,o)||Bo(o,r)||(r.state.pasteIncoming=+new Date,i.fastPoll())});function l(o){if(!Y(r,o)){if(r.somethingSelected())hi({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var a=Go(r);hi({lineWise:!0,text:a.text}),o.type=="cut"?r.setSelections(a.ranges,null,Te):(i.prevInput="",n.value=a.text.join(` `),Xt(n))}else return;o.type=="cut"&&(r.state.cutIncoming=+new Date)}}T(n,"cut",l),T(n,"copy",l),T(e.scroller,"paste",function(o){if(!(Ee(e,o)||Y(r,o))){if(!n.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var a=new Event("paste");a.clipboardData=o.clipboardData,n.dispatchEvent(a)}}),T(e.lineSpace,"selectstart",function(o){Ee(e,o)||oe(o)}),T(n,"compositionstart",function(){var o=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:o,range:r.markText(o,r.getCursor("to"),{className:"CodeMirror-composing"})}}),T(n,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},z.prototype.createField=function(e){this.wrapper=Uo(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Tn(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},z.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},z.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=Wl(e);if(e.options.moveInputWithCursor){var n=Se(e,i.sel.primary().head,"div"),l=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+o.top-l.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+o.left-l.left))}return r},z.prototype.showSelection=function(e){var t=this.cm,i=t.display;pe(i.cursorDiv,e.cursors),pe(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},z.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&Xt(this.textarea),A&&E>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",A&&E>=9&&(this.hasSelection=null));this.resetting=!1}},z.prototype.getField=function(){return this.textarea},z.prototype.supportsTouch=function(){return!1},z.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!_t||me(it(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},z.prototype.blur=function(){this.textarea.blur()},z.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},z.prototype.receivedFocus=function(){this.slowPoll()},z.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},z.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},z.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||oa(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var n=i.value;if(n==r&&!t.somethingSelected())return!1;if(A&&E>=9&&this.hasSelection===n||ye&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var l=n.charCodeAt(0);if(l==8203&&!r&&(r="​"),l==8666)return this.reset(),this.cm.execCommand("undo")}for(var o=0,a=Math.min(r.length,n.length);o1e3||n.indexOf(` `)>-1?i.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},z.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},z.prototype.onKeyPress=function(){A&&E>=9&&(this.hasSelection=null),this.fastPoll()},z.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var l=ft(i,e),o=r.scroller.scrollTop;if(!l||Ce)return;var a=i.options.resetSelectionOnContextMenu;a&&i.doc.sel.contains(l)==-1&&Z(i,ee)(i.doc,qe(l),Te);var s=n.style.cssText,u=t.wrapper.style.cssText,f=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",n.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+`px; z-index: 1000; background: `+(A?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var h;ie&&(h=n.ownerDocument.defaultView.scrollY),r.input.focus(),ie&&n.ownerDocument.defaultView.scrollTo(null,h),r.input.reset(),i.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=c,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function d(){if(n.selectionStart!=null){var v=i.somethingSelected(),y="​"+(v?n.value:"");n.value="⇚",n.value=y,t.prevInput=v?"":"​",n.selectionStart=1,n.selectionEnd=y.length,r.selForContextMenu=i.doc.sel}}function c(){if(t.contextMenuPending==c&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,n.style.cssText=s,A&&E<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=o),n.selectionStart!=null)){(!A||A&&E<9)&&d();var v=0,y=function(){r.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="​"?Z(i,so)(i):v++<10?r.detectingSelectAll=setTimeout(y,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(y,200)}}if(A&&E>=9&&d(),pi){jt(e);var p=function(){ve(window,"mouseup",p),setTimeout(c,20)};T(window,"mouseup",p)}else setTimeout(c,50)},z.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},z.prototype.setUneditable=function(){},z.prototype.needsContentAttribute=!1;function su(e,t){if(t=t?nt(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=me(it(e));t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=a.getValue()}var n;if(e.form&&(T(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var l=e.form;n=l.submit;try{var o=l.submit=function(){r(),l.submit=n,l.submit(),l.submit=o}}catch{}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(ve(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=n))}},e.style.display="none";var a=I(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return a}function uu(e){e.off=ve,e.on=T,e.wheelEventPixels=gs,e.Doc=se,e.splitLines=Mi,e.countColumn=be,e.findColumn=mi,e.isWordChar=xi,e.Pass=Or,e.signal=G,e.Line=Lt,e.changeEnd=Ze,e.scrollbarModel=Rl,e.Pos=g,e.cmpPos=M,e.modes=Ni,e.mimeModes=wt,e.resolveMode=Pr,e.getMode=Ai,e.modeExtensions=St,e.extendMode=ha,e.copyState=lt,e.startState=_n,e.innerMode=Oi,e.commands=Cr,e.keyMap=Re,e.keyName=ko,e.isModifierKey=So,e.lookupKey=It,e.normalizeKeyMap=Rs,e.StringStream=U,e.SharedTextMarker=mr,e.TextMarker=Je,e.LineWidget=yr,e.e_preventDefault=oe,e.e_stopPropagation=Un,e.e_stop=jt,e.addClass=rt,e.contains=Ue,e.rmClass=et,e.keyNames=je}eu(I),nu(I);var fu="iter insert remove copy getEditor constructor".split(" ");for(var di in se.prototype)se.prototype.hasOwnProperty(di)&&$(fu,di)<0&&(I.prototype[di]=function(e){return function(){return e.apply(this.doc,arguments)}}(se.prototype[di]));return Ct(se),I.inputStyles={textarea:z,contenteditable:F},I.defineMode=function(e){!I.defaults.mode&&e!="null"&&(I.defaults.mode=e),ua.apply(this,arguments)},I.defineMIME=fa,I.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),I.defineMIME("text/plain","null"),I.defineExtension=function(e,t){I.prototype[e]=t},I.defineDocExtension=function(e,t){se.prototype[e]=t},I.fromTextArea=su,uu(I),I.version="5.65.18",I})}(An)),An.exports}export{pu as r};