import{c as cu}from"./@babel.43d8d0a5.js";var Lt={exports:{}};(function(Tt,Ft){(function(b,me){Tt.exports=me()})(cu,function(){var b=navigator.userAgent,me=navigator.platform,O=/gecko\/\d/i.test(b),te=/MSIE \d/.test(b),j=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(b),J=/Edge\/(\d+)/.exec(b),C=te||j||J,F=C&&(te?document.documentMode||6:+(J||j)[1]),k=!J&&/WebKit\//.test(b),K=k&&/Qt\/\d+\.\d+/.test(b),S=!J&&/Chrome\/(\d+)/.exec(b),_=S&&+S[1],G=/Opera\//.test(b),de=/Apple Computer/.test(navigator.vendor),ae=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(b),D=/PhantomJS/.test(b),m=de&&(/Mobile\/\w+/.test(b)||navigator.maxTouchPoints>2),E=/Android/.test(b),H=m||E||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(b),z=m||/Mac/.test(me),ee=/\bCrOS\b/.test(b),fe=/win/i.test(me),ne=G&&b.match(/Version\/(\d*\.\d*)/);ne&&(ne=Number(ne[1])),ne&&ne>=15&&(G=!1,k=!0);var pe=z&&(K||G&&(ne==null||ne<12.11)),ce=O||C&&F>=9;function B(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Ee=function(e,t){var n=e.className,r=B(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 A(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function X(e,t){return A(e).appendChild(t)}function c(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}var xe=function(){this.id=null,this.f=null,this.time=0,this.handler=ue(this.onTimeout,this)};xe.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},xe.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n=t)return r+Math.min(l,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var Ue=[""];function ot(e){for(;Ue.length<=e;)Ue.push(Se(Ue)+" ");return Ue[e]}function Se(e){return e[e.length-1]}function Fe(e,t){for(var n=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Me.test(e))}function Xt(e,t){return t?t.source.indexOf("\\w")>-1&&at(e)?!0:t.test(e):at(e)}function zn(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Yt=/[\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 Ye(e){return e.charCodeAt(0)>=768&&Yt.test(e)}function nr(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function ir(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),l.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var yr=null;function or(e,t,n){var r;yr=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:yr=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:yr=i)}return r!=null?r:yr}var gi=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,a=/[1n]/;function s(u,d,v){this.level=u,this.from=d,this.to=v}return function(u,d){var v=d=="ltr"?"L":"R";if(u.length==0||d=="ltr"&&!r.test(u))return!1;for(var y=u.length,x=[],T=0;T-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function _e(e,t){var n=Zt(e,t);if(!!n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function Ot(e){e.prototype.on=function(t,n){ve(this,t,n)},e.prototype.off=function(t,n){st(this,t,n)}}function ut(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Er(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function vt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function lr(e){ut(e),Er(e)}function on(e){return e.target||e.srcElement}function Nt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),z&&e.ctrlKey&&t==1&&(t=3),t}var mi=function(){if(C&&F<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),Or;function Wn(e){if(Or==null){var t=c("span","\u200B");X(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Or=t.offsetWidth<=1&&t.offsetHeight>2&&!(C&&F<8))}var n=Or?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var ln;function ar(e){if(ln!=null)return ln;var t=X(e,document.createTextNode("A\u062EA")),n=W(t,0,1).getBoundingClientRect(),r=W(t,1,2).getBoundingClientRect();return A(e),!n||n.left==n.right?!1:ln=r.right-n.right<3}var Et=` b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(` `,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),l=o.indexOf("\r");l!=-1?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},sr=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},In=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Pt=null;function xi(e){if(Pt!=null)return Pt;var t=X(e,c("span","x")),n=t.getBoundingClientRect(),r=W(t,0,1).getBoundingClientRect();return Pt=Math.abs(n.left-r.left)>1}var Nr={},Ht={};function zt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Nr[e]=t}function br(e,t){Ht[e]=t}function Pr(e){if(typeof e=="string"&&Ht.hasOwnProperty(e))e=Ht[e];else if(e&&typeof e.name=="string"&&Ht.hasOwnProperty(e.name)){var t=Ht[e.name];typeof t=="string"&&(t={name:t}),e=M(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 Hr(e,t){t=Pr(t);var n=Nr[t.name];if(!n)return Hr(e,"text/plain");var r=n(e,t);if(ur.hasOwnProperty(t.name)){var i=ur[t.name];for(var o in i)!i.hasOwnProperty(o)||(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var ur={};function zr(e,t){var n=ur.hasOwnProperty(e)?ur[e]:ur[e]={};be(t,n)}function _t(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 an(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 Br(e,t,n){return e.startState?e.startState(t,n):!0}var Ke=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};Ke.prototype.eol=function(){return this.pos>=this.string.length},Ke.prototype.sol=function(){return this.pos==this.lineStart},Ke.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ke.prototype.next=function(){if(this.post},Ke.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ke.prototype.skipToEnd=function(){this.pos=this.string.length},Ke.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ke.prototype.backUp=function(e){this.pos-=e},Ke.prototype.column=function(){return this.lastColumnPos0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},Ke.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ke.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ke.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ke.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function se(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?L(n,se(e,n).text.length):ha(t,se(e,t.line).text.length)}function ha(e,t){var n=e.ch;return n==null||n>t?L(e.line,t):n<0?L(e.line,0):e}function po(e,t){for(var n=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},jt.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}},jt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},jt.fromSaved=function(e,t,n){return t instanceof Rn?new jt(e,_t(e.mode,t.state),n,t.lookAhead):new jt(e,_t(e.mode,t),n)},jt.prototype.save=function(e){var t=e!==!1?_t(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Rn(t,this.maxLookAhead):t};function vo(e,t,n,r){var i=[e.state.modeGen],o={};ko(e,t.text,e.doc.mode,n,function(u,d){return i.push(u,d)},o,r);for(var l=n.state,a=function(u){n.baseTokens=i;var d=e.state.overlays[u],v=1,y=0;n.state=!0,ko(e,t.text,d.mode,n,function(x,T){for(var P=v;yx&&i.splice(v,1,x,i[v+1],q),v+=2,y=Math.min(x,q)}if(!!T)if(d.opaque)i.splice(P,v-P,x,"overlay "+T),v=P+2;else for(;Pe.options.maxHighlightLength&&_t(e.doc.mode,r.state),o=vo(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function un(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new jt(r,!0,t);var o=da(e,t,n),l=o>r.first&&se(r,o-1).stateAfter,a=l?jt.fromSaved(r,l,o):new jt(r,Br(r.mode),o);return r.iter(o,t,function(s){yi(e,s.text,a);var u=a.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&ut.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var xo=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function yo(e,t,n,r){var i=e.doc,o=i.mode,l;t=ke(i,t);var a=se(i,t.line),s=un(e,t.line,n),u=new Ke(a.text,e.options.tabSize,s),d;for(r&&(d=[]);(r||u.pose.options.maxHighlightLength?(a=!1,l&&yi(e,t,r,d.pos),d.pos=t.length,v=null):v=bo(bi(n,d,r.state,y),o),y){var x=y[0].name;x&&(v="m-"+(v?x+" "+v:x))}if(!a||u!=v){for(;sl;--a){if(a<=o.first)return o.first;var s=se(o,a-1),u=s.stateAfter;if(u&&(!n||a+(u instanceof Rn?u.lookAhead:0)<=o.modeFrontier))return a;var d=we(s.text,null,e.options.tabSize);(i==null||r>d)&&(i=a-1,r=d)}return i}function pa(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=se(e,r).stateAfter;if(i&&(!(i instanceof Rn)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new qn(l,o.from,s?null:o.to))}}return r}function ba(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t);if(a||o.from==t&&l.type=="bookmark"&&(!n||o.marker.insertLeft)){var s=o.from==null||(l.inclusiveLeft?o.from<=t:o.from0&&a)for(var re=0;re0)){var d=[s,1],v=V(u.from,a.from),y=V(u.to,a.to);(v<0||!l.inclusiveLeft&&!v)&&d.push({from:u.from,to:a.from}),(y>0||!l.inclusiveRight&&!y)&&d.push({from:a.to,to:u.to}),i.splice.apply(i,d),s+=d.length-3}}return i}function Co(e){var t=e.markedSpans;if(!!t){for(var n=0;nt)&&(!r||wi(r,o.marker)<0)&&(r=o.marker)}return r}function Ao(e,t,n,r,i){var o=se(e,t),l=Jt&&o.markedSpans;if(l)for(var a=0;a=0&&v<=0||d<=0&&v>=0)&&(d<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?V(u.to,n)>=0:V(u.to,n)>0)||d>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?V(u.from,r)<=0:V(u.from,r)<0)))return!0}}}function Bt(e){for(var t;t=Do(e);)e=t.find(-1,!0).line;return e}function Sa(e){for(var t;t=Kn(e);)e=t.find(1,!0).line;return e}function Ca(e){for(var t,n;t=Kn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Si(e,t){var n=se(e,t),r=Bt(n);return n==r?t:f(r)}function Fo(e,t){if(t>e.lastLine())return t;var n=se(e,t),r;if(!fr(e,n))return t;for(;r=Kn(n);)n=r.find(1,!0).line;return f(n)+1}function fr(e,t){var n=Jt&&t.markedSpans;if(n){for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Ir=function(e,t,n){this.text=e,Lo(this,t),this.height=n?n(this):1};Ir.prototype.lineNo=function(){return f(this)},Ot(Ir);function La(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Co(e),Lo(e,n);var i=r?r(e):1;i!=e.height&&Dt(e,i)}function Ta(e){e.parent=null,Co(e)}var Da={},Aa={};function Mo(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Aa:Da;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Eo(e,t){var n=U("span",null,null,k?"padding-right: .1px":null),r={pre:U("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;r.pos=0,r.addToken=Ma,ar(e.display.measure)&&(l=Ae(o,e.doc.direction))&&(r.addToken=Oa(r.addToken,l)),r.map=[];var a=t!=e.display.externalMeasured&&f(o);Na(o,r,go(e,o,a)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=Re(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=Re(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Wn(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(k){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 _e(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Re(r.pre.className,r.textClass||"")),r}function Fa(e){var t=c("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ma(e,t,n,r,i,o,l){if(!!t){var a=e.splitSpaces?Ea(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,d;if(!s.test(t))e.col+=t.length,d=document.createTextNode(a),e.map.push(e.pos,e.pos+t.length,d),C&&F<9&&(u=!0),e.pos+=t.length;else{d=document.createDocumentFragment();for(var v=0;;){s.lastIndex=v;var y=s.exec(t),x=y?y.index-v:t.length-v;if(x){var T=document.createTextNode(a.slice(v,v+x));C&&F<9?d.appendChild(c("span",[T])):d.appendChild(T),e.map.push(e.pos,e.pos+x,T),e.col+=x,e.pos+=x}if(!y)break;v+=x+1;var P=void 0;if(y[0]==" "){var q=e.cm.options.tabSize,Z=q-e.col%q;P=d.appendChild(c("span",ot(Z),"cm-tab")),P.setAttribute("role","presentation"),P.setAttribute("cm-text"," "),e.col+=Z}else y[0]=="\r"||y[0]==` `?(P=d.appendChild(c("span",y[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),P.setAttribute("cm-text",y[0]),e.col+=1):(P=e.cm.options.specialCharPlaceholder(y[0]),P.setAttribute("cm-text",y[0]),C&&F<9?d.appendChild(c("span",[P])):d.appendChild(P),e.col+=1);e.map.push(e.pos,e.pos+1,P),e.pos++}}if(e.trailingSpace=a.charCodeAt(t.length-1)==32,n||r||i||u||o||l){var $=n||"";r&&($+=r),i&&($+=i);var Q=c("span",[d],$,o);if(l)for(var re in l)l.hasOwnProperty(re)&&re!="style"&&re!="class"&&Q.setAttribute(re,l[re]);return e.content.appendChild(Q)}e.content.appendChild(d)}}function Ea(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;iu&&v.from<=u));y++);if(v.to>=d)return e(n,r,i,o,l,a,s);e(n,r.slice(0,v.to-u),i,o,null,a,s),o=null,r=r.slice(v.to-u),u=v.to}}}function Oo(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Na(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var l=1;ls||Ce.collapsed&&he.to==s&&he.from==s)){if(he.to!=null&&he.to!=s&&x>he.to&&(x=he.to,P=""),Ce.className&&(T+=" "+Ce.className),Ce.css&&(y=(y?y+";":"")+Ce.css),Ce.startStyle&&he.from==s&&(q+=" "+Ce.startStyle),Ce.endStyle&&he.to==x&&(re||(re=[])).push(Ce.endStyle,he.to),Ce.title&&(($||($={})).title=Ce.title),Ce.attributes)for(var Be in Ce.attributes)($||($={}))[Be]=Ce.attributes[Be];Ce.collapsed&&(!Z||wi(Z.marker,Ce)<0)&&(Z=he)}else he.from>s&&x>he.from&&(x=he.from)}if(re)for(var nt=0;nt=a)break;for(var Ct=Math.min(a,x);;){if(d){var yt=s+d.length;if(!Z){var Ze=yt>Ct?d.slice(0,Ct-s):d;t.addToken(t,Ze,v?v+T:T,q,s+Ze.length==x?P:"",y,$)}if(yt>=Ct){d=d.slice(Ct-s),s=Ct;break}s=yt,q=""}d=i.slice(o,o=n[u++]),v=Mo(n[u++],t.cm.options)}}}function No(e,t,n){this.line=t,this.rest=Ca(t),this.size=this.rest?f(Se(this.rest))-n+1:1,this.node=this.text=null,this.hidden=fr(e,t)}function Un(e,t,n){for(var r=[],i,o=t;o2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Ro(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function Ka(e,t){t=Bt(t);var n=f(t),r=e.display.externalMeasured=new No(e.doc,t,n);r.lineN=n;var i=r.built=Eo(e,r);return r.text=i.pre,X(e.display.lineMeasure,i.pre),r}function qo(e,t,n,r){return Gt(e,qr(e,t),n,r)}function Fi(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(o=s-a,i=o-1,t>=s&&(l="right")),i!=null){if(r=e[u+2],a==s&&n==(r.insertLeft?"left":"right")&&(l=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],l="left";if(n=="right"&&i==s-a)for(;u=0&&(n=e[i]).left==n.right;i--);return n}function Ua(e,t,n,r){var i=jo(t.map,n,r),o=i.node,l=i.start,a=i.end,s=i.collapse,u;if(o.nodeType==3){for(var d=0;d<4;d++){for(;l&&Ye(t.line.text.charAt(i.coverStart+l));)--l;for(;i.coverStart+a0&&(s=r="right");var v;e.options.lineWrapping&&(v=o.getClientRects()).length>1?u=v[r=="right"?v.length-1:0]:u=o.getBoundingClientRect()}if(C&&F<9&&!l&&(!u||!u.left&&!u.right)){var y=o.parentNode.getClientRects()[0];y?u={left:y.left,right:y.left+jr(e.display),top:y.top,bottom:y.bottom}:u=_o}for(var x=u.top-t.rect.top,T=u.bottom-t.rect.top,P=(x+T)/2,q=t.view.measure.heights,Z=0;Z=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!a)return l(u=="before"?s-1:s,u=="before");function d(T,P,q){var Z=a[P],$=Z.level==1;return l(q?T-1:T,$!=q)}var v=or(a,s,u),y=yr,x=d(s,v,u=="before");return y!=null&&(x.other=d(s,y,u!="before")),x}function Zo(e,t){var n=0;t=ke(e.doc,t),e.options.lineWrapping||(n=jr(e.display)*t.ch);var r=se(e.doc,t.line),i=Vt(r)+Xn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Ei(e,t,n,r,i){var o=L(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Oi(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Ei(r.first,0,null,-1,-1);var i=p(r,n),o=r.first+r.size-1;if(i>o)return Ei(r.first+r.size-1,se(r,o).text.length,null,1,1);t<0&&(t=0);for(var l=se(r,i);;){var a=Ya(e,l,i,t,n),s=wa(l,a.ch+(a.xRel>0||a.outside>0?1:0));if(!s)return a;var u=s.find(1);if(u.line==i)return u;l=se(r,i=u.line)}}function Qo(e,t,n,r){r-=Mi(t);var i=t.text.length,o=qt(function(l){return Gt(e,n,l-1).bottom<=r},i,0);return i=qt(function(l){return Gt(e,n,l).top>r},o,i),{begin:o,end:i}}function Jo(e,t,n,r){n||(n=qr(e,t));var i=Yn(e,t,Gt(e,n,r),"line").top;return Qo(e,t,n,i)}function Ni(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Ya(e,t,n,r,i){i-=Vt(t);var o=qr(e,t),l=Mi(t),a=0,s=t.text.length,u=!0,d=Ae(t,e.doc.direction);if(d){var v=(e.options.lineWrapping?Qa:Za)(e,t,n,o,d,r,i);u=v.level!=1,a=u?v.from:v.to-1,s=u?v.to:v.from-1}var y=null,x=null,T=qt(function(ge){var he=Gt(e,o,ge);return he.top+=l,he.bottom+=l,Ni(he,r,i,!1)?(he.top<=i&&he.left<=r&&(y=ge,x=he),!0):!1},a,s),P,q,Z=!1;if(x){var $=r-x.left=re.bottom?1:0}return T=nr(t.text,T,1),Ei(n,T,q,Z,r-P)}function Za(e,t,n,r,i,o,l){var a=qt(function(v){var y=i[v],x=y.level!=1;return Ni(Wt(e,L(n,x?y.to:y.from,x?"before":"after"),"line",t,r),o,l,!0)},0,i.length-1),s=i[a];if(a>0){var u=s.level!=1,d=Wt(e,L(n,u?s.from:s.to,u?"after":"before"),"line",t,r);Ni(d,o,l,!0)&&d.top>l&&(s=i[a-1])}return s}function Qa(e,t,n,r,i,o,l){var a=Qo(e,t,r,l),s=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var d=null,v=null,y=0;y=u||x.to<=s)){var T=x.level!=1,P=Gt(e,r,T?Math.min(u,x.to)-1:Math.max(s,x.from)).right,q=Pq)&&(d=x,v=q)}}return d||(d=i[i.length-1]),d.fromu&&(d={from:d.from,to:u,level:d.level}),d}var wr;function _r(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(wr==null){wr=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)wr.appendChild(document.createTextNode("x")),wr.appendChild(c("br"));wr.appendChild(document.createTextNode("x"))}X(e.measure,wr);var n=wr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),A(e.measure),n||1}function jr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),n=c("pre",[t],"CodeMirror-line-like");X(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Pi(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var a=e.display.gutterSpecs[l].className;n[a]=o.offsetLeft+o.clientLeft+i,r[a]=o.clientWidth}return{fixedPos:Hi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Hi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Vo(e){var t=_r(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/jr(e.display)-3);return function(i){if(fr(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l0&&(u=se(e.doc,s.line).text).length==s.ch){var d=we(u,u.length,e.options.tabSize)-u.length;s=L(s.line,Math.max(0,Math.round((o-Io(e.display).left)/jr(e.display))-d))}return s}function Cr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Jt&&Si(e.doc,t)i.viewFrom?hr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)hr(e);else if(t<=i.viewFrom){var o=Qn(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):hr(e)}else if(n>=i.viewTo){var l=Qn(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):hr(e)}else{var a=Qn(e,t,t,-1),s=Qn(e,n,n+r,1);a&&s?(i.view=i.view.slice(0,a.index).concat(Un(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):hr(e)}var u=i.externalMeasured;u&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Cr(e,t)];if(o.node!=null){var l=o.changes||(o.changes=[]);oe(l,n)==-1&&l.push(n)}}}function hr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Qn(e,t,n,r){var i=Cr(e,t),o,l=e.display.view;if(!Jt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var a=e.display.viewFrom,s=0;s0){if(i==l.length-1)return null;o=a+l[i].size-t,i++}else o=a-t;t+=o,n+=o}for(;Si(e.doc,n)!=n;){if(i==(r<0?0:l.length-1))return null;n+=r*l[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function Ja(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Un(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Un(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Cr(e,n)))),r.viewTo=n}function $o(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||s.to().line0?l:e.defaultCharWidth())+"px"}if(r.other){var a=n.appendChild(c("div","\xA0","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 Jn(e,t){return e.top-t.top||e.left-t.left}function Va(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),l=Io(e.display),a=l.left,s=Math.max(r.sizerWidth,kr(e)-r.sizer.offsetLeft)-l.right,u=i.direction=="ltr";function d(Q,re,ge,he){re<0&&(re=0),re=Math.round(re),he=Math.round(he),o.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+Q+`px; top: `+re+"px; width: "+(ge==null?s-Q:ge)+`px; height: `+(he-re)+"px"))}function v(Q,re,ge){var he=se(i,Q),Ce=he.text.length,Be,nt;function qe(Ze,bt){return Zn(e,L(Q,Ze),"div",he,bt)}function Ct(Ze,bt,lt){var Ve=Jo(e,he,null,Ze),Qe=bt=="ltr"==(lt=="after")?"left":"right",Ge=lt=="after"?Ve.begin:Ve.end-(/\s/.test(he.text.charAt(Ve.end-1))?2:1);return qe(Ge,Qe)[Qe]}var yt=Ae(he,i.direction);return ir(yt,re||0,ge==null?Ce:ge,function(Ze,bt,lt,Ve){var Qe=lt=="ltr",Ge=qe(Ze,Qe?"left":"right"),kt=qe(bt-1,Qe?"right":"left"),rn=re==null&&Ze==0,xr=ge==null&&bt==Ce,ct=Ve==0,Ut=!yt||Ve==yt.length-1;if(kt.top-Ge.top<=3){var it=(u?rn:xr)&&ct,fo=(u?xr:rn)&&Ut,rr=it?a:(Qe?Ge:kt).left,Fr=fo?s:(Qe?kt:Ge).right;d(rr,Ge.top,Fr-rr,Ge.bottom)}else{var Mr,dt,nn,co;Qe?(Mr=u&&rn&&ct?a:Ge.left,dt=u?s:Ct(Ze,lt,"before"),nn=u?a:Ct(bt,lt,"after"),co=u&&xr&&Ut?s:kt.right):(Mr=u?Ct(Ze,lt,"before"):a,dt=!u&&rn&&ct?s:Ge.right,nn=!u&&xr&&Ut?a:kt.left,co=u?Ct(bt,lt,"after"):s),d(Mr,Ge.top,dt-Mr,Ge.bottom),Ge.bottom0?t.blinker=setInterval(function(){e.hasFocus()||Kr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function tl(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Ri(e))}function Ii(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Kr(e))},100)}function Ri(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(_e(e,"focus",e,t),e.state.focused=!0,Oe(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),k&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Wi(e))}function Kr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(_e(e,"blur",e,t),e.state.focused=!1,Ee(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Vn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,l=0;l.005||x<-.005)&&(ie.display.sizerWidth){var P=Math.ceil(d/jr(e.display));P>e.display.maxLineLength&&(e.display.maxLineLength=P,e.display.maxLine=a.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function rl(e){if(e.widgets)for(var t=0;t=l&&(o=p(t,Vt(se(t,s))-e.wrapper.clientHeight),l=s)}return{from:o,to:Math.max(l,o+1)}}function $a(e,t){if(!je(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,o=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),i!=null&&!D){var l=c("div","\u200B",null,`position: absolute; top: `+(t.top-n.viewOffset-Xn(e.display))+`px; height: `+(t.bottom-t.top+Kt(e)+n.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(i),e.display.lineSpace.removeChild(l)}}}function es(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?L(t.line,t.ch+1,"before"):t,t=t.ch?L(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var l=!1,a=Wt(e,t),s=!n||n==t?a:Wt(e,n);i={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=qi(e,i),d=e.doc.scrollTop,v=e.doc.scrollLeft;if(u.scrollTop!=null&&(mn(e,u.scrollTop),Math.abs(e.doc.scrollTop-d)>1&&(l=!0)),u.scrollLeft!=null&&(Lr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-v)>1&&(l=!0)),!l)break}return i}function ts(e,t){var n=qi(e,t);n.scrollTop!=null&&mn(e,n.scrollTop),n.scrollLeft!=null&&Lr(e,n.scrollLeft)}function qi(e,t){var n=e.display,r=_r(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Ai(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+Di(n),s=t.topa-r;if(t.topi+o){var d=Math.min(t.top,(u?a:t.bottom)-o);d!=i&&(l.scrollTop=d)}var v=e.options.fixedGutter?0:n.gutters.offsetWidth,y=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-v,x=kr(e)-n.gutters.offsetWidth,T=t.right-t.left>x;return T&&(t.right=t.left+x),t.left<10?l.scrollLeft=0:t.leftx+y-3&&(l.scrollLeft=t.right+(T?0:10)-x),l}function _i(e,t){t!=null&&(ei(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Gr(e){ei(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function gn(e,t,n){(t!=null||n!=null)&&ei(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function rs(e,t){ei(e),e.curOp.scrollToPos=t}function ei(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Zo(e,t.from),r=Zo(e,t.to);nl(e,n,r,t.margin)}}function nl(e,t,n,r){var i=qi(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});gn(e,i.scrollLeft,i.scrollTop)}function mn(e,t){Math.abs(e.doc.scrollTop-t)<2||(O||Ki(e,{top:t}),il(e,t,!0),O&&Ki(e),bn(e,100))}function il(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 Lr(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,ul(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function xn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Di(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Kt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Tr=function(e,t,n){this.cm=n;var r=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),ve(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),ve(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,C&&F<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Tr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Tr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Tr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Tr.prototype.zeroWidthHack=function(){var e=z&&!ae?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new xe,this.disableVert=new xe},Tr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="";function r(){var i=e.getBoundingClientRect(),o=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},Tr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var yn=function(){};yn.prototype.update=function(){return{bottom:0,right:0}},yn.prototype.setScrollLeft=function(){},yn.prototype.setScrollTop=function(){},yn.prototype.clear=function(){};function Ur(e,t){t||(t=xn(e));var n=e.display.barWidth,r=e.display.barHeight;ol(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Vn(e),ol(e,xn(e)),n=e.display.barWidth,r=e.display.barHeight}function ol(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 ll={native:Tr,null:yn};function al(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Ee(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ll[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ve(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"?Lr(e,t):mn(e,t)},e),e.display.scrollbars.addClass&&Oe(e.display.wrapper,e.display.scrollbars.addClass)}var ns=0;function Dr(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:++ns,markArrays:null},Pa(e.curOp)}function Ar(e){var t=e.curOp;t&&za(t,function(n){for(var r=0;r=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ti(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ls(e){e.updatedDisplay=e.mustUpdate&&ji(e.cm,e.update)}function as(e){var t=e.cm,n=t.display;e.updatedDisplay&&Vn(t),e.barMeasure=xn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=qo(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Kt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-kr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.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 n=+new Date+e.options.workTime,r=un(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var l=o.styles,a=o.text.length>e.options.maxHighlightLength?_t(t.mode,r.state):null,s=vo(e,o,r,!0);a&&(r.state=a),o.styles=s.styles;var u=o.styleClasses,d=s.classes;d?o.styleClasses=d:u&&(o.styleClasses=null);for(var v=!l||l.length!=o.styles.length||u!=d&&(!u||!d||u.bgClass!=d.bgClass||u.textClass!=d.textClass),y=0;!v&&yn)return bn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&St(e,function(){for(var o=0;o=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&$o(e)==0)return!1;fl(e)&&(hr(e),t.dims=Pi(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroml&&n.viewTo-l<20&&(l=Math.min(i,n.viewTo)),Jt&&(o=Si(e.doc,o),l=Fo(e.doc,l));var a=o!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Ja(e,o,l),n.viewOffset=Vt(se(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=$o(e);if(!a&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=hs(e);return s>4&&(n.lineDiv.style.display="none"),ps(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ds(u),A(n.cursorDiv),A(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,bn(e,400)),n.updateLineNumbers=null,!0}function sl(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==kr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Di(e.display)-Ai(e),n.top)}),t.visible=$n(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=$n(e.display,e.doc,n));if(!ji(e,t))break;Vn(e);var i=xn(e);vn(e),Ur(e,i),Ui(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 Ki(e,t){var n=new ti(e,t);if(ji(e,n)){Vn(e),sl(e,n);var r=xn(e);vn(e),Ur(e,r),Ui(e,r),n.finish()}}function ps(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,l=o.firstChild;function a(T){var P=T.nextSibling;return k&&z&&e.display.currentWheelTarget==T?T.style.display="none":T.parentNode.removeChild(T),P}for(var s=r.view,u=r.viewFrom,d=0;d-1&&(x=!1),Po(e,v,u,n)),x&&(A(v.lineNumber),v.lineNumber.appendChild(document.createTextNode(R(e.options,u)))),l=v.node.nextSibling}u+=v.size}for(;l;)l=a(l)}function Gi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",et(e,"gutterChanged",e)}function Ui(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Kt(e)+"px"}function ul(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Hi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",l=0;l=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),C&&F<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!k&&!(O&&H)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Xi(r.gutters,r.lineNumbers),cl(i),n.init(i)}var ri=0,er=null;C?er=-.53:O?er=15:S?er=-.7:de&&(er=-1/3);function hl(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function gs(e){var t=hl(e);return t.x*=er,t.y*=er,t}function dl(e,t){S&&_==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var n=hl(t),r=n.x,i=n.y,o=er;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,o=1);var l=e.display,a=l.scroller,s=a.scrollWidth>a.clientWidth,u=a.scrollHeight>a.clientHeight;if(!!(r&&s||i&&u)){if(i&&z&&k){e:for(var d=t.target,v=l.view;d!=a;d=d.parentNode)for(var y=0;y=0&&V(e,r.to())<=0)return n}return-1};var Pe=function(e,t){this.anchor=e,this.head=t};Pe.prototype.from=function(){return Wr(this.anchor,this.head)},Pe.prototype.to=function(){return gt(this.anchor,this.head)},Pe.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function It(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(y,x){return V(y.from(),x.from())}),n=oe(t,i);for(var o=1;o0:s>=0){var u=Wr(a.from(),l.from()),d=gt(a.to(),l.to()),v=a.empty()?l.from()==l.head:a.from()==a.head;o<=n&&--n,t.splice(--o,2,new Pe(v?d:u,v?u:d))}}return new At(t,n)}function dr(e,t){return new At([new Pe(e,t||e)],0)}function pr(e){return e.text?L(e.from.line+e.text.length-1,Se(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function pl(e,t){if(V(e,t.from)<0)return e;if(V(e,t.to)<=0)return pr(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+=pr(t).ch-t.to.ch),L(n,r)}function Yi(e,t){for(var n=[],r=0;r1&&e.remove(a.line+1,T-1),e.insert(a.line+1,Z)}et(e,"change",e,t)}function vr(e,t,n){function r(i,o,l){if(i.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Se(e.done)}function bl(e,t,n,r){var i=e.history;i.undone.length=0;var o=+new Date,l,a;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=ys(i,i.lastOp==r)))a=Se(l.changes),V(t.from,t.to)==0&&V(t.from,a.to)==0?a.to=pr(t):l.changes.push(Ji(e,t));else{var s=Se(i.done);for((!s||!s.ranges)&&ii(e.sel,i.done),l={changes:[Ji(e,t)],generation:i.generation},i.done.push(l);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=o,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||_e(e,"historyAdded")}function bs(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function ks(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||bs(e,o,Se(i.done),t))?i.done[i.done.length-1]=t:ii(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&yl(i.undone)}function ii(e,t){var n=Se(t);n&&n.ranges&&n.equals(e)||t.push(e)}function kl(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(l){l.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=l.markedSpans),++o})}function ws(e){if(!e)return null;for(var t,n=0;n-1&&(Se(a)[v]=u[v],delete u[v])}}return r}function Vi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=V(t,i)<0;o!=V(n,i)<0?(i=t,t=n):o!=V(t,n)<0&&(t=n)}return new Pe(i,t)}else return new Pe(n||t,t)}function oi(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),ft(e,new At([Vi(e.sel.primary(),t,n,i)],0),r)}function Sl(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:a.to>t.ch))){if(i&&(_e(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--l;continue}else break;if(!s.atomic)continue;if(n){var v=s.find(r<0?1:-1),y=void 0;if((r<0?d:u)&&(v=Fl(e,v,-r,v&&v.line==t.line?o:null)),v&&v.line==t.line&&(y=V(v,n))&&(r<0?y<0:y>0))return Yr(e,v,t,r,i)}var x=s.find(r<0?-1:1);return(r<0?u:d)&&(x=Fl(e,x,r,x.line==t.line?o:null)),x?Yr(e,x,t,r,i):null}}return t}function ai(e,t,n,r,i){var o=r||1,l=Yr(e,t,n,o,i)||!i&&Yr(e,t,n,o,!0)||Yr(e,t,n,-o,i)||!i&&Yr(e,t,n,-o,!0);return l||(e.cantEdit=!0,L(e.first,0))}function Fl(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?ke(e,L(t.line-1)):null:n>0&&t.ch==(r||se(e,t.line)).text.length?t.line=0;--i)Ol(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Ol(e,t)}}function Ol(e,t){if(!(t.text.length==1&&t.text[0]==""&&V(t.from,t.to)==0)){var n=Yi(e,t);bl(e,t,n,e.cm?e.cm.curOp.id:NaN),Sn(e,t,n,ki(e,t));var r=[];vr(e,function(i,o){!o&&oe(r,i.history)==-1&&(zl(i.history,t),r.push(i.history)),Sn(i,t,null,ki(i,t))})}}function si(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,o,l=e.sel,a=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,u=0;u=0;--x){var T=y(x);if(T)return T.v}}}}function Nl(e,t){if(t!=0&&(e.first+=t,e.sel=new At(Fe(e.sel.ranges,function(i){return new Pe(L(i.anchor.line+t,i.anchor.ch),L(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){mt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:L(o,se(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Qt(e,t.from,t.to),n||(n=Yi(e,t)),e.cm?Ls(e.cm,t,r):Qi(e,t,r),li(e,n,Je),e.cantEdit&&ai(e,L(e.firstLine(),0))&&(e.cantEdit=!1)}}function Ls(e,t,n){var r=e.doc,i=e.display,o=t.from,l=t.to,a=!1,s=o.line;e.options.lineWrapping||(s=f(Bt(se(r,o.line))),r.iter(s,l.line+1,function(x){if(x==i.maxLine)return a=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Mt(e),Qi(r,t,n,Vo(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(x){var T=Gn(x);T>i.maxLineLength&&(i.maxLine=x,i.maxLineLength=T,i.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),pa(r,o.line),bn(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?mt(e):o.line==l.line&&t.text.length==1&&!gl(e.doc,t)?cr(e,o.line,"text"):mt(e,o.line,l.line+1,u);var d=wt(e,"changes"),v=wt(e,"change");if(v||d){var y={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};v&&et(e,"change",e,y),d&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(y)}e.display.selForContextMenu=null}function Qr(e,t,n,r,i){var o;r||(r=n),V(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),Zr(e,{from:n,to:r,text:t,origin:i})}function Pl(e,t,n,r){n1||!(this.children[0]instanceof Ln))){var a=[];this.collapse(a),this.children=[new Ln(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var l=i.lines.length%25+25,a=l;a10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=d,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&mt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Dl(e.doc)),e&&et(e,"markerCleared",e,this,r,i),t&&Ar(e),this.parent&&this.parent.clear()}},gr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i0||l==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=U("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Ao(e,t.line,t,n,o)||t.line!=n.line&&Ao(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");ga()}o.addToHistory&&bl(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a=t.line,s=e.cm,u;if(e.iter(a,n.line+1,function(v){s&&o.collapsed&&!s.options.lineWrapping&&Bt(v)==s.display.maxLine&&(u=!0),o.collapsed&&a!=t.line&&Dt(v,0),xa(v,new qn(o,a==t.line?t.ch:null,a==n.line?n.ch:null),e.cm&&e.cm.curOp),++a}),o.collapsed&&e.iter(t.line,n.line+1,function(v){fr(e,v)&&Dt(v,0)}),o.clearOnEnter&&ve(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(va(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Wl,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)mt(s,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var d=t.line;d<=n.line;d++)cr(s,d,"text");o.atomic&&Dl(s.doc),et(s,"markerAdded",s,o)}return o}var An=function(e,t){this.markers=e,this.primary=t;for(var n=0;n=0;s--)Zr(this,r[s]);a?Ll(this,a):this.cm&&Gr(this.cm)}),undo:rt(function(){si(this,"undo")}),redo:rt(function(){si(this,"redo")}),undoSelection:rt(function(){si(this,"undo",!0)}),redoSelection:rt(function(){si(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.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ke(this,e),t=ke(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var a=0;a=s.to||s.from==null&&i!=e.line||s.from!=null&&i==t.line&&s.from>=t.ch)&&(!n||n(s.marker))&&r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n}),ke(this,L(n,t))},indexFromPos:function(e){e=ke(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 d=e.dataTransfer.getData("Text");if(d){var v;if(t.state.draggingText&&!t.state.draggingText.copy&&(v=t.listSelections()),li(t.doc,dr(n,n)),v)for(var y=0;y=0;a--)Qr(e.doc,"",r[a].from,r[a].to,"+delete");Gr(e)})}function eo(e,t,n){var r=nr(e.text,t+n,n);return r<0||r>e.text.length?null:r}function to(e,t,n){var r=eo(e,t.ch,n);return r==null?null:new L(t.line,r,n<0?"after":"before")}function ro(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=Ae(n,t.doc.direction);if(o){var l=i<0?Se(o):o[0],a=i<0==(l.level==1),s=a?"after":"before",u;if(l.level>0||t.doc.direction=="rtl"){var d=qr(t,n);u=i<0?n.text.length-1:0;var v=Gt(t,d,u).top;u=qt(function(y){return Gt(t,d,y).top==v},i<0==(l.level==1)?l.from:l.to-1,u),s=="before"&&(u=eo(n,u,1))}else u=i<0?l.to:l.from;return new L(r,u,s)}}return new L(r,i<0?n.text.length:0,i<0?"before":"after")}function Is(e,t,n,r){var i=Ae(t,e.doc.direction);if(!i)return to(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=or(i,n.ch,n.sticky),l=i[o];if(e.doc.direction=="ltr"&&l.level%2==0&&(r>0?l.to>n.ch:l.from=l.from&&y>=d.begin)){var x=v?"before":"after";return new L(n.line,y,x)}}var T=function(Z,$,Q){for(var re=function(Be,nt){return nt?new L(n.line,a(Be,1),"before"):new L(n.line,Be,"after")};Z>=0&&Z0==(ge.level!=1),Ce=he?Q.begin:a(Q.end,-1);if(ge.from<=Ce&&Ce0?d.end:a(d.begin,-1);return q!=null&&!(r>0&&q==t.text.length)&&(P=T(r>0?0:i.length-1,r,u(q)),P)?P:null}var En={selectAll:Ml,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Je)},killLine:function(e){return $r(e,function(t){if(t.empty()){var n=se(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new L(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),L(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=se(e.doc,i.line-1).text;l&&(i=new L(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),L(i.line-1,l.length-1),i,"+transpose"))}}n.push(new Pe(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return St(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;re&&V(t,this.pos)==0&&n==this.button};var Nn,Pn;function Us(e,t){var n=+new Date;return Pn&&Pn.compare(n,e,t)?(Nn=Pn=null,"triple"):Nn&&Nn.compare(n,e,t)?(Pn=new io(n,e,t),Nn=null,"double"):(Nn=new io(n,e,t),Pn=null,"single")}function ea(e){var t=this,n=t.display;if(!(je(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,$t(n,e)){k||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!oo(t,e)){var r=Sr(t,e),i=Nt(e),o=r?Us(r,i):"single";Y(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Xs(t,i,r,o,e))&&(i==1?r?Zs(t,r,o,e):on(e)==n.scroller&&ut(e):i==2?(r&&oi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(ce?t.display.input.onContextMenu(e):Ii(t)))}}}function Xs(e,t,n,r,i){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,On(e,Gl(o,i),i,function(l){if(typeof l=="string"&&(l=En[l]),!l)return!1;var a=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),a=l(e,n)!=We}finally{e.state.suppressEdits=!1}return a})}function Ys(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var o=ee?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=z?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(z?n.altKey:n.ctrlKey)),i}function Zs(e,t,n,r){C?setTimeout(ue(tl,e),0):e.curOp.focus=Le(ie(e));var i=Ys(e,n,r),o=e.doc.sel,l;e.options.dragDrop&&mi&&!e.isReadOnly()&&n=="single"&&(l=o.contains(t))>-1&&(V((l=o.ranges[l]).from(),t)<0||t.xRel>0)&&(V(l.to(),t)>0||t.xRel<0)?Qs(e,r,t,i):Js(e,r,t,i)}function Qs(e,t,n,r){var i=e.display,o=!1,l=tt(e,function(u){k&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Ii(e)),st(i.wrapper.ownerDocument,"mouseup",l),st(i.wrapper.ownerDocument,"mousemove",a),st(i.scroller,"dragstart",s),st(i.scroller,"drop",l),o||(ut(u),r.addNew||oi(e.doc,n,null,null,r.extend),k&&!de||C&&F==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),a=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return o=!0};k&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,ve(i.wrapper.ownerDocument,"mouseup",l),ve(i.wrapper.ownerDocument,"mousemove",a),ve(i.scroller,"dragstart",s),ve(i.scroller,"drop",l),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function ta(e,t,n){if(n=="char")return new Pe(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Pe(L(t.line,0),ke(e.doc,L(t.line+1,0)));var r=n(e,t);return new Pe(r.from,r.to)}function Js(e,t,n,r){C&&Ii(e);var i=e.display,o=e.doc;ut(t);var l,a,s=o.sel,u=s.ranges;if(r.addNew&&!r.extend?(a=o.sel.contains(n),a>-1?l=u[a]:l=new Pe(n,n)):(l=o.sel.primary(),a=o.sel.primIndex),r.unit=="rectangle")r.addNew||(l=new Pe(n,n)),n=Sr(e,t,!0,!0),a=-1;else{var d=ta(e,n,r.unit);r.extend?l=Vi(l,d.anchor,d.head,r.extend):l=d}r.addNew?a==-1?(a=u.length,ft(o,It(e,u.concat([l]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&r.unit=="char"&&!r.extend?(ft(o,It(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):$i(o,a,l,pt):(a=0,ft(o,new At([l],0),pt),s=o.sel);var v=n;function y(Q){if(V(v,Q)!=0)if(v=Q,r.unit=="rectangle"){for(var re=[],ge=e.options.tabSize,he=we(se(o,n.line).text,n.ch,ge),Ce=we(se(o,Q.line).text,Q.ch,ge),Be=Math.min(he,Ce),nt=Math.max(he,Ce),qe=Math.min(n.line,Q.line),Ct=Math.min(e.lastLine(),Math.max(n.line,Q.line));qe<=Ct;qe++){var yt=se(o,qe).text,Ze=ze(yt,Be,ge);Be==nt?re.push(new Pe(L(qe,Ze),L(qe,Ze))):yt.length>Ze&&re.push(new Pe(L(qe,Ze),L(qe,ze(yt,nt,ge))))}re.length||re.push(new Pe(n,n)),ft(o,It(e,s.ranges.slice(0,a).concat(re),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Q)}else{var bt=l,lt=ta(e,Q,r.unit),Ve=bt.anchor,Qe;V(lt.anchor,Ve)>0?(Qe=lt.head,Ve=Wr(bt.from(),lt.anchor)):(Qe=lt.anchor,Ve=gt(bt.to(),lt.head));var Ge=s.ranges.slice(0);Ge[a]=Vs(e,new Pe(ke(o,Ve),Qe)),ft(o,It(e,Ge,a),pt)}}var x=i.wrapper.getBoundingClientRect(),T=0;function P(Q){var re=++T,ge=Sr(e,Q,!0,r.unit=="rectangle");if(!!ge)if(V(ge,v)!=0){e.curOp.focus=Le(ie(e)),y(ge);var he=$n(i,o);(ge.line>=he.to||ge.linex.bottom?20:0;Ce&&setTimeout(tt(e,function(){T==re&&(i.scroller.scrollTop+=Ce,P(Q))}),50)}}function q(Q){e.state.selectingText=!1,T=1/0,Q&&(ut(Q),i.input.focus()),st(i.wrapper.ownerDocument,"mousemove",Z),st(i.wrapper.ownerDocument,"mouseup",$),o.history.lastSelOrigin=null}var Z=tt(e,function(Q){Q.buttons===0||!Nt(Q)?q(Q):P(Q)}),$=tt(e,q);e.state.selectingText=$,ve(i.wrapper.ownerDocument,"mousemove",Z),ve(i.wrapper.ownerDocument,"mouseup",$)}function Vs(e,t){var n=t.anchor,r=t.head,i=se(e.doc,n.line);if(V(n,r)==0&&n.sticky==r.sticky)return t;var o=Ae(i);if(!o)return t;var l=or(o,n.ch,n.sticky),a=o[l];if(a.from!=n.ch&&a.to!=n.ch)return t;var s=l+(a.from==n.ch==(a.level!=1)?0:1);if(s==0||s==o.length)return t;var u;if(r.line!=n.line)u=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var d=or(o,r.ch,r.sticky),v=d-l||(r.ch-n.ch)*(a.level==1?-1:1);d==s-1||d==s?u=v<0:u=v>0}var y=o[s+(u?-1:0)],x=u==(y.level==1),T=x?y.from:y.to,P=x?"after":"before";return n.ch==T&&n.sticky==P?t:new Pe(new L(n.line,T,P),r)}function ra(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ut(t);var l=e.display,a=l.lineDiv.getBoundingClientRect();if(o>a.bottom||!wt(e,n))return vt(t);o-=a.top-l.viewOffset;for(var s=0;s=i){var d=p(e.doc,o),v=e.display.gutterSpecs[s];return _e(e,n,e,d,v.className,t),vt(t)}}}function oo(e,t){return ra(e,t,"gutterClick",!0)}function na(e,t){$t(e.display,t)||$s(e,t)||je(e,t,"contextmenu")||ce||e.display.input.onContextMenu(t)}function $s(e,t){return wt(e,"gutterContextMenu")?ra(e,t,"gutterContextMenu",!1):!1}function ia(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),pn(e)}var en={toString:function(){return"CodeMirror.Init"}},oa={},hi={};function eu(e){var t=e.optionHandlers;function n(r,i,o,l){e.defaults[r]=i,o&&(t[r]=l?function(a,s,u){u!=en&&o(a,s,u)}:o)}e.defineOption=n,e.Init=en,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Zi(r)},!0),n("indentUnit",2,Zi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){wn(r),pn(r),mt(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var o=[],l=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var d=s.text.indexOf(i,u);if(d==-1)break;u=d+i.length,o.push(L(l,d))}l++});for(var a=o.length-1;a>=0;a--)Qr(r.doc,i,o[a],L(o[a].line,o[a].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,i,o){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),o!=en&&r.refresh()}),n("specialCharPlaceholder",Fa,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",H?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!fe),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){ia(r),kn(r)},!0),n("keyMap","default",function(r,i,o){var l=fi(i),a=o!=en&&fi(o);a&&a.detach&&a.detach(r,l),l.attach&&l.attach(r,a||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,ru,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Xi(i,r.options.lineNumbers),kn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Hi(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Ur(r)},!0),n("scrollbarStyle","native",function(r){al(r),Ur(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=Xi(r.options.gutters,i),kn(r)},!0),n("firstLineNumber",1,kn,!0),n("lineNumberFormatter",function(r){return r},kn,!0),n("showCursorWhenSelecting",!1,vn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Kr(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,tu),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,vn,!0),n("singleCursorHeightPerLine",!0,vn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,wn,!0),n("addModeClass",!1,wn,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,wn,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function tu(e,t,n){var r=n&&n!=en;if(!t!=!r){var i=e.display.dragFunctions,o=t?ve:st;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function ru(e){e.options.lineWrapping?(Oe(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Ee(e.display.wrapper,"CodeMirror-wrap"),Li(e)),zi(e),mt(e),pn(e),setTimeout(function(){return Ur(e)},100)}function Ie(e,t){var n=this;if(!(this instanceof Ie))return new Ie(e,t);this.options=t=t?be(t):{},be(oa,t,!1);var r=t.value;typeof r=="string"?r=new xt(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ie.inputStyles[t.inputStyle](this),o=this.display=new vs(e,r,i,t);o.wrapper.CodeMirror=this,ia(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),al(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new xe,keySeq:null,specialChars:null},t.autofocus&&!H&&o.input.focus(),C&&F<11&&setTimeout(function(){return n.display.input.reset(!0)},20),nu(this),Ps(),Dr(this),this.curOp.forceUpdate=!0,ml(this,r),t.autofocus&&!H||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Ri(n)},20):Kr(this);for(var l in hi)hi.hasOwnProperty(l)&&hi[l](this,t[l],en);fl(this),t.finishInit&&t.finishInit(this);for(var a=0;a20*20}ve(t.scroller,"touchstart",function(s){if(!je(e,s)&&!o(s)&&!oo(e,s)){t.input.ensurePolled(),clearTimeout(n);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),ve(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),ve(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!$t(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var d=e.coordsChar(t.activeTouch,"page"),v;!u.prev||l(u,u.prev)?v=new Pe(d,d):!u.prev.prev||l(u,u.prev.prev)?v=e.findWordAt(d):v=new Pe(L(d.line,0),ke(e.doc,L(d.line+1,0))),e.setSelection(v.anchor,v.head),e.focus(),ut(s)}i()}),ve(t.scroller,"touchcancel",i),ve(t.scroller,"scroll",function(){t.scroller.clientHeight&&(mn(e,t.scroller.scrollTop),Lr(e,t.scroller.scrollLeft,!0),_e(e,"scroll",e))}),ve(t.scroller,"mousewheel",function(s){return dl(e,s)}),ve(t.scroller,"DOMMouseScroll",function(s){return dl(e,s)}),ve(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){je(e,s)||lr(s)},over:function(s){je(e,s)||(Ns(e,s),lr(s))},start:function(s){return Os(e,s)},drop:tt(e,Es),leave:function(s){je(e,s)||ql(e)}};var a=t.input.getField();ve(a,"keyup",function(s){return Vl.call(e,s)}),ve(a,"keydown",tt(e,Jl)),ve(a,"keypress",tt(e,$l)),ve(a,"focus",function(s){return Ri(e,s)}),ve(a,"blur",function(s){return Kr(e,s)})}var lo=[];Ie.defineInitHook=function(e){return lo.push(e)};function Hn(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=un(e,t).state:n="prev");var l=e.options.tabSize,a=se(i,t),s=we(a.text,null,l);a.stateAfter&&(a.stateAfter=null);var u=a.text.match(/^\s*/)[0],d;if(!r&&!/\S/.test(a.text))d=0,n="not";else if(n=="smart"&&(d=i.mode.indent(o,a.text.slice(u.length),a.text),d==We||d>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?d=we(se(i,t-1).text,null,l):d=0:n=="add"?d=s+e.options.indentUnit:n=="subtract"?d=s-e.options.indentUnit:typeof n=="number"&&(d=s+n),d=Math.max(0,d);var v="",y=0;if(e.options.indentWithTabs)for(var x=Math.floor(d/l);x;--x)y+=l,v+=" ";if(yl,s=Et(t),u=null;if(a&&r.ranges.length>1)if(Rt&&Rt.text.join(` `)==t){if(r.ranges.length%Rt.text.length==0){u=[];for(var d=0;d=0;y--){var x=r.ranges[y],T=x.from(),P=x.to();x.empty()&&(n&&n>0?T=L(T.line,T.ch-n):e.state.overwrite&&!a?P=L(P.line,Math.min(se(o,P.line).text.length,P.ch+Se(s).length)):a&&Rt&&Rt.lineWise&&Rt.text.join(` `)==s.join(` `)&&(T=P=L(T.line,0)));var q={from:T,to:P,text:u?u[y%u.length]:s,origin:i||(a?"paste":e.state.cutIncoming>l?"cut":"+input")};Zr(e.doc,q),et(e,"inputRead",e,q)}t&&!a&&aa(e,t),Gr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=v),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function la(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&St(t,function(){return ao(t,n,0,null,"paste")}),!0}function aa(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var a=0;a-1){l=Hn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(se(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Hn(e,i.head.line,"smart"));l&&et(e,"electricInput",e,i.head.line)}}}function sa(e){for(var t=[],n=[],r=0;ro&&(Hn(this,a.head.line,r,!0),o=a.head.line,l==this.doc.sel.primIndex&&Gr(this));else{var s=a.from(),u=a.to(),d=Math.max(o,s.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var v=d;v0&&$i(this.doc,l,new Pe(s,y[l].to()),Je)}}}),getTokenAt:function(r,i){return yo(this,r,i)},getLineTokens:function(r,i){return yo(this,L(r),i,!0)},getTokenTypeAt:function(r){r=ke(this.doc,r);var i=go(this,se(this.doc,r.line)),o=0,l=(i.length-1)/2,a=r.ch,s;if(a==0)s=i[2];else for(;;){var u=o+l>>1;if((u?i[u*2-1]:0)>=a)l=u;else if(i[u*2+1]s&&(r=s,l=!0),a=se(this.doc,r)}else a=r;return Yn(this,a,{top:0,left:0},i||"page",o||l).top+(l?this.doc.height-Vt(a):0)},defaultTextHeight:function(){return _r(this.display)},defaultCharWidth:function(){return jr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,o,l,a){var s=this.display;r=Wt(this,ke(this.doc,r));var u=r.bottom,d=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),l=="over")u=r.top;else if(l=="above"||l=="near"){var v=Math.max(s.wrapper.clientHeight,this.doc.height),y=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(l=="above"||r.bottom+i.offsetHeight>v)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=v&&(u=r.bottom),d+i.offsetWidth>y&&(d=y-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",a=="right"?(d=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(a=="left"?d=0:a=="middle"&&(d=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=d+"px"),o&&ts(this,{left:d,top:u,right:d+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:ht(Jl),triggerOnKeyPress:ht($l),triggerOnKeyUp:Vl,triggerOnMouseDown:ht(ea),execCommand:function(r){if(En.hasOwnProperty(r))return En[r].call(null,this)},triggerElectric:ht(function(r){aa(this,r)}),findPosH:function(r,i,o,l){var a=1;i<0&&(a=-1,i=-i);for(var s=ke(this.doc,r),u=0;u0&&d(o.charAt(l-1));)--l;for(;a.5||this.options.lineWrapping)&&zi(this),_e(this,"refresh",this)}),swapDoc:ht(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),ml(this,r),pn(this),this.display.input.reset(),gn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,et(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ot(e),e.registerHelper=function(r,i,o){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=o},e.registerGlobalHelper=function(r,i,o,l){e.registerHelper(r,i,l),n[r]._global.push({pred:o,val:l})}}function uo(e,t,n,r,i){var o=t,l=n,a=se(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var $=t.line+s;return $=e.first+e.size?!1:(t=new L($,t.ch,t.sticky),a=se(e,$))}function d($){var Q;if(r=="codepoint"){var re=a.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(re))Q=null;else{var ge=n>0?re>=55296&&re<56320:re>=56320&&re<57343;Q=new L(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*(ge?2:1))),-n)}}else i?Q=Is(e.cm,a,t,n):Q=to(a,t,n);if(Q==null)if(!$&&u())t=ro(i,e.cm,a,t.line,s);else return!1;else t=Q;return!0}if(r=="char"||r=="codepoint")d();else if(r=="column")d(!0);else if(r=="word"||r=="group")for(var v=null,y=r=="group",x=e.cm&&e.cm.getHelper(t,"wordChars"),T=!0;!(n<0&&!d(!T));T=!1){var P=a.text.charAt(t.ch)||` `,q=Xt(P,x)?"w":y&&P==` `?"n":!y||/\s/.test(P)?null:"p";if(y&&!T&&!q&&(q="s"),v&&v!=q){n<0&&(n=1,d(),t.sticky="after");break}if(q&&(v=q),n>0&&!d(!T))break}var Z=ai(e,t,o,l,!0);return Ne(o,Z)&&(Z.hitSide=!0),Z}function fa(e,t,n,r){var i=e.doc,o=t.left,l;if(r=="page"){var a=Math.min(e.display.wrapper.clientHeight,Y(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(a-.5*_r(e.display),3);l=(n>0?t.bottom:t.top)+n*s}else r=="line"&&(l=n>0?t.bottom+3:t.top-3);for(var u;u=Oi(e,o,l),!!u.outside;){if(n<0?l<=0:l>=i.height){u.hitSide=!0;break}l+=n*5}return u}var He=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new xe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};He.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,so(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(a){for(var s=a.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}ve(i,"paste",function(a){!o(a)||je(r,a)||la(a,r)||F<=11&&setTimeout(tt(r,function(){return t.updateFromDOM()}),20)}),ve(i,"compositionstart",function(a){t.composing={data:a.data,done:!1}}),ve(i,"compositionupdate",function(a){t.composing||(t.composing={data:a.data,done:!1})}),ve(i,"compositionend",function(a){t.composing&&(a.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),ve(i,"touchstart",function(){return n.forceCompositionEnd()}),ve(i,"input",function(){t.composing||t.readFromDOMSoon()});function l(a){if(!(!o(a)||je(r,a))){if(r.somethingSelected())di({lineWise:!1,text:r.getSelections()}),a.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=sa(r);di({lineWise:!0,text:s.text}),a.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,Je),r.replaceSelection("",null,"cut")})}else return;if(a.clipboardData){a.clipboardData.clearData();var u=Rt.text.join(` `);if(a.clipboardData.setData("Text",u),a.clipboardData.getData("Text")==u){a.preventDefault();return}}var d=ua(),v=d.firstChild;so(v),r.display.lineSpace.insertBefore(d,r.display.lineSpace.firstChild),v.value=Rt.text.join(` `);var y=Le(ye(i));g(v),setTimeout(function(){r.display.lineSpace.removeChild(d),y.focus(),y==i&&n.showPrimarySelection()},50)}}ve(i,"copy",l),ve(i,"cut",l)},He.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},He.prototype.prepareSelection=function(){var e=el(this.cm,!1);return e.focus=Le(ye(this.div))==this.div,e},He.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},He.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},He.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line=t.display.viewFrom&&ca(t,r)||{node:a[0].measure.map[2],offset:0},u=i.linee.firstLine()&&(r=L(r.line-1,se(e.doc,r.line-1).length)),i.ch==se(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var o,l,a;r.line==t.viewFrom||(o=Cr(e,r.line))==0?(l=f(t.view[0].line),a=t.view[0].node):(l=f(t.view[o].line),a=t.view[o-1].node.nextSibling);var s=Cr(e,i.line),u,d;if(s==t.view.length-1?(u=t.viewTo-1,d=t.lineDiv.lastChild):(u=f(t.view[s+1].line)-1,d=t.view[s+1].node.previousSibling),!a)return!1;for(var v=e.doc.splitLines(lu(e,a,d,l,u)),y=Qt(e.doc,L(l,0),L(u,se(e.doc,u).text.length));v.length>1&&y.length>1;)if(Se(v)==Se(y))v.pop(),y.pop(),u--;else if(v[0]==y[0])v.shift(),y.shift(),l++;else break;for(var x=0,T=0,P=v[0],q=y[0],Z=Math.min(P.length,q.length);xr.ch&&$.charCodeAt($.length-T-1)==Q.charCodeAt(Q.length-T-1);)x--,T++;v[v.length-1]=$.slice(0,$.length-T).replace(/^\u200b+/,""),v[0]=v[0].slice(x).replace(/\u200b+$/,"");var ge=L(l,x),he=L(u,y.length?Se(y).length-T:0);if(v.length>1||v[0]||V(ge,he))return Qr(e.doc,v,ge,he,"+input"),!0},He.prototype.ensurePolled=function(){this.forceCompositionEnd()},He.prototype.reset=function(){this.forceCompositionEnd()},He.prototype.forceCompositionEnd=function(){!this.composing||(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},He.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))},He.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&St(this.cm,function(){return mt(e.cm)})},He.prototype.setUneditable=function(e){e.contentEditable="false"},He.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||tt(this.cm,ao)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},He.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},He.prototype.onContextMenu=function(){},He.prototype.resetPosition=function(){},He.prototype.needsContentAttribute=!0;function ca(e,t){var n=Fi(e,t.line);if(!n||n.hidden)return null;var r=se(e.doc,t.line),i=Ro(n,r,t.line),o=Ae(r,e.doc.direction),l="left";if(o){var a=or(o,t.ch);l=a%2?"right":"left"}var s=jo(i.map,t.ch,l);return s.offset=s.collapse=="right"?s.end:s.start,s}function ou(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function tn(e,t){return t&&(e.bad=!0),e}function lu(e,t,n,r,i){var o="",l=!1,a=e.doc.lineSeparator(),s=!1;function u(x){return function(T){return T.id==x}}function d(){l&&(o+=a,s&&(o+=a),l=s=!1)}function v(x){x&&(d(),o+=x)}function y(x){if(x.nodeType==1){var T=x.getAttribute("cm-text");if(T){v(T);return}var P=x.getAttribute("cm-marker"),q;if(P){var Z=e.findMarks(L(r,0),L(i+1,0),u(+P));Z.length&&(q=Z[0].find(0))&&v(Qt(e.doc,q.from,q.to).join(a));return}if(x.getAttribute("contenteditable")=="false")return;var $=/^(pre|div|p|li|table|br)$/i.test(x.nodeName);if(!/^br$/i.test(x.nodeName)&&x.textContent.length==0)return;$&&d();for(var Q=0;Q=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),ve(i,"paste",function(l){je(r,l)||la(l,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function o(l){if(!je(r,l)){if(r.somethingSelected())di({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var a=sa(r);di({lineWise:!0,text:a.text}),l.type=="cut"?r.setSelections(a.ranges,null,Je):(n.prevInput="",i.value=a.text.join(` `),g(i))}else return;l.type=="cut"&&(r.state.cutIncoming=+new Date)}}ve(i,"cut",o),ve(i,"copy",o),ve(e.scroller,"paste",function(l){if(!($t(e,l)||je(r,l))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var a=new Event("paste");a.clipboardData=l.clipboardData,i.dispatchEvent(a)}}),ve(e.lineSpace,"selectstart",function(l){$t(e,l)||ut(l)}),ve(i,"compositionstart",function(){var l=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:l,range:r.markText(l,r.getCursor("to"),{className:"CodeMirror-composing"})}}),ve(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Xe.prototype.createField=function(e){this.wrapper=ua(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;so(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},Xe.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Xe.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=el(e);if(e.options.moveInputWithCursor){var i=Wt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return r},Xe.prototype.showSelection=function(e){var t=this.cm,n=t.display;X(n.cursorDiv,e.cursors),X(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Xe.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&&g(this.textarea),C&&F>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",C&&F>=9&&(this.hasSelection=null));this.resetting=!1}},Xe.prototype.getField=function(){return this.textarea},Xe.prototype.supportsTouch=function(){return!1},Xe.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!H||Le(ye(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},Xe.prototype.blur=function(){this.textarea.blur()},Xe.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Xe.prototype.receivedFocus=function(){this.slowPoll()},Xe.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Xe.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},Xe.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||sr(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(C&&F>=9&&this.hasSelection===i||z&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(o==8203&&!r&&(r="\u200B"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,a=Math.min(r.length,i.length);l1e3||i.indexOf(` `)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Xe.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Xe.prototype.onKeyPress=function(){C&&F>=9&&(this.hasSelection=null),this.fastPoll()},Xe.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Sr(n,e),l=r.scroller.scrollTop;if(!o||G)return;var a=n.options.resetSelectionOnContextMenu;a&&n.doc.sel.contains(o)==-1&&tt(n,ft)(n.doc,dr(o),Je);var s=i.style.cssText,u=t.wrapper.style.cssText,d=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-d.top-5)+"px; left: "+(e.clientX-d.left-5)+`px; z-index: 1000; background: `+(C?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var v;k&&(v=i.ownerDocument.defaultView.scrollY),r.input.focus(),k&&i.ownerDocument.defaultView.scrollTo(null,v),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=x,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function y(){if(i.selectionStart!=null){var P=n.somethingSelected(),q="\u200B"+(P?i.value:"");i.value="\u21DA",i.value=q,t.prevInput=P?"":"\u200B",i.selectionStart=1,i.selectionEnd=q.length,r.selForContextMenu=n.doc.sel}}function x(){if(t.contextMenuPending==x&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=s,C&&F<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!C||C&&F<9)&&y();var P=0,q=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?tt(n,Ml)(n):P++<10?r.detectingSelectAll=setTimeout(q,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(q,200)}}if(C&&F>=9&&y(),ce){lr(e);var T=function(){st(window,"mouseup",T),setTimeout(x,20)};ve(window,"mouseup",T)}else setTimeout(x,50)},Xe.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Xe.prototype.setUneditable=function(){},Xe.prototype.needsContentAttribute=!1;function su(e,t){if(t=t?be(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=Le(ye(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=a.getValue()}var i;if(e.form&&(ve(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=l}}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&&(st(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var a=Ie(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return a}function uu(e){e.off=st,e.on=ve,e.wheelEventPixels=gs,e.Doc=xt,e.splitLines=Et,e.countColumn=we,e.findColumn=ze,e.isWordChar=at,e.Pass=We,e.signal=_e,e.Line=Ir,e.changeEnd=pr,e.scrollbarModel=ll,e.Pos=L,e.cmpPos=V,e.modes=Nr,e.mimeModes=Ht,e.resolveMode=Pr,e.getMode=Hr,e.modeExtensions=ur,e.extendMode=zr,e.copyState=_t,e.startState=Br,e.innerMode=an,e.commands=En,e.keyMap=tr,e.keyName=Ul,e.isModifierKey=Kl,e.lookupKey=Vr,e.normalizeKeyMap=Ws,e.StringStream=Ke,e.SharedTextMarker=An,e.TextMarker=gr,e.LineWidget=Dn,e.e_preventDefault=ut,e.e_stopPropagation=Er,e.e_stop=lr,e.addClass=Oe,e.contains=le,e.rmClass=Ee,e.keyNames=mr}eu(Ie),iu(Ie);var fu="iter insert remove copy getEditor constructor".split(" ");for(var vi in xt.prototype)xt.prototype.hasOwnProperty(vi)&&oe(fu,vi)<0&&(Ie.prototype[vi]=function(e){return function(){return e.apply(this.doc,arguments)}}(xt.prototype[vi]));return Ot(xt),Ie.inputStyles={textarea:Xe,contenteditable:He},Ie.defineMode=function(e){!Ie.defaults.mode&&e!="null"&&(Ie.defaults.mode=e),zt.apply(this,arguments)},Ie.defineMIME=br,Ie.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ie.defineMIME("text/plain","null"),Ie.defineExtension=function(e,t){Ie.prototype[e]=t},Ie.defineDocExtension=function(e,t){xt.prototype[e]=t},Ie.fromTextArea=su,uu(Ie),Ie.version="5.65.18",Ie})})(Lt);var gu=Lt.exports,hu={exports:{}};(function(Tt,Ft){(function(b){b(Lt.exports)})(function(b){var me={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},O={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};b.defineMode("xml",function(te,j){var J=te.indentUnit,C={},F=j.htmlMode?me:O;for(var k in F)C[k]=F[k];for(var k in j)C[k]=j[k];var K,S;function _(c,U){function W(Oe){return U.tokenize=Oe,Oe(c,U)}var le=c.next();if(le=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?W(ae("atom","]]>")):null:c.match("--")?W(ae("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),W(D(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),U.tokenize=ae("meta","?>"),"meta"):(K=c.eat("/")?"closeTag":"openTag",U.tokenize=G,"tag bracket");if(le=="&"){var Le;return c.eat("#")?c.eat("x")?Le=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):Le=c.eatWhile(/[\d]/)&&c.eat(";"):Le=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),Le?"atom":"error"}else return c.eatWhile(/[^&<]/),null}_.isInText=!0;function G(c,U){var W=c.next();if(W==">"||W=="/"&&c.eat(">"))return U.tokenize=_,K=W==">"?"endTag":"selfcloseTag","tag bracket";if(W=="=")return K="equals",null;if(W=="<"){U.tokenize=_,U.state=ee,U.tagName=U.tagStart=null;var le=U.tokenize(c,U);return le?le+" tag error":"tag error"}else return/[\'\"]/.test(W)?(U.tokenize=de(W),U.stringStartCol=c.column(),U.tokenize(c,U)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function de(c){var U=function(W,le){for(;!W.eol();)if(W.next()==c){le.tokenize=G;break}return"string"};return U.isInAttribute=!0,U}function ae(c,U){return function(W,le){for(;!W.eol();){if(W.match(U)){le.tokenize=_;break}W.next()}return c}}function D(c){return function(U,W){for(var le;(le=U.next())!=null;){if(le=="<")return W.tokenize=D(c+1),W.tokenize(U,W);if(le==">")if(c==1){W.tokenize=_;break}else return W.tokenize=D(c-1),W.tokenize(U,W)}return"meta"}}function m(c){return c&&c.toLowerCase()}function E(c,U,W){this.prev=c.context,this.tagName=U||"",this.indent=c.indented,this.startOfLine=W,(C.doNotIndent.hasOwnProperty(U)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function H(c){c.context&&(c.context=c.context.prev)}function z(c,U){for(var W;;){if(!c.context||(W=c.context.tagName,!C.contextGrabbers.hasOwnProperty(m(W))||!C.contextGrabbers[m(W)].hasOwnProperty(m(U))))return;H(c)}}function ee(c,U,W){return c=="openTag"?(W.tagStart=U.column(),fe):c=="closeTag"?ne:ee}function fe(c,U,W){return c=="word"?(W.tagName=U.current(),S="tag",B):C.allowMissingTagName&&c=="endTag"?(S="tag bracket",B(c,U,W)):(S="error",fe)}function ne(c,U,W){if(c=="word"){var le=U.current();return W.context&&W.context.tagName!=le&&C.implicitlyClosed.hasOwnProperty(m(W.context.tagName))&&H(W),W.context&&W.context.tagName==le||C.matchClosing===!1?(S="tag",pe):(S="tag error",ce)}else return C.allowMissingTagName&&c=="endTag"?(S="tag bracket",pe(c,U,W)):(S="error",ce)}function pe(c,U,W){return c!="endTag"?(S="error",pe):(H(W),ee)}function ce(c,U,W){return S="error",pe(c,U,W)}function B(c,U,W){if(c=="word")return S="attribute",Ee;if(c=="endTag"||c=="selfcloseTag"){var le=W.tagName,Le=W.tagStart;return W.tagName=W.tagStart=null,c=="selfcloseTag"||C.autoSelfClosers.hasOwnProperty(m(le))?z(W,le):(z(W,le),W.context=new E(W,le,Le==W.indented)),ee}return S="error",B}function Ee(c,U,W){return c=="equals"?A:(C.allowMissing||(S="error"),B(c,U,W))}function A(c,U,W){return c=="string"?X:c=="word"&&C.allowUnquoted?(S="string",B):(S="error",B(c,U,W))}function X(c,U,W){return c=="string"?X:B(c,U,W)}return{startState:function(c){var U={tokenize:_,state:ee,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(U.baseIndent=c),U},token:function(c,U){if(!U.tagName&&c.sol()&&(U.indented=c.indentation()),c.eatSpace())return null;K=null;var W=U.tokenize(c,U);return(W||K)&&W!="comment"&&(S=null,U.state=U.state(K||W,c,U),S&&(W=S=="error"?W+" error":S)),W},indent:function(c,U,W){var le=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+J;if(le&&le.noIndent)return b.Pass;if(c.tokenize!=G&&c.tokenize!=_)return W?W.match(/^(\s*)/)[0].length:0;if(c.tagName)return C.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+J*(C.multilineTagIndentFactor||1);if(C.alignCDATA&&/$/,blockCommentStart:"",configuration:C.htmlMode?"html":"xml",helperType:C.htmlMode?"html":"xml",skipAttribute:function(c){c.state==A&&(c.state=B)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var U=[],W=c.context;W;W=W.prev)U.push(W.tagName);return U.reverse()}}}),b.defineMIME("text/xml","xml"),b.defineMIME("application/xml","xml"),b.mimeModes.hasOwnProperty("text/html")||b.defineMIME("text/html",{name:"xml",htmlMode:!0})})})();var du={exports:{}};(function(Tt,Ft){(function(b){b(Lt.exports)})(function(b){b.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 me=0;me-1&&te.substring(C+1,te.length);if(F)return b.findModeByExtension(F)},b.findModeByName=function(te){te=te.toLowerCase();for(var j=0;j` "'(~:]+/,ae=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,D=/^\s*\[[^\]]+?\]:.*$/,m=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,E=" ";function H(g,h,ie){return h.f=h.inline=ie,ie(g,h)}function z(g,h,ie){return h.f=h.block=ie,ie(g,h)}function ee(g){return!g||!/\S/.test(g.string)}function fe(g){if(g.linkTitle=!1,g.linkHref=!1,g.linkText=!1,g.em=!1,g.strong=!1,g.strikethrough=!1,g.quote=0,g.indentedCode=!1,g.f==pe){var h=j;if(!h){var ie=b.innerMode(te,g.htmlState);h=ie.mode.name=="xml"&&ie.state.tagStart===null&&!ie.state.context&&ie.state.tokenize.isInText}h&&(g.f=A,g.block=ne,g.htmlState=null)}return g.trailingSpace=0,g.trailingSpaceNewLine=!1,g.prevLine=g.thisLine,g.thisLine={stream:null},null}function ne(g,h){var ie=g.column()===h.indentation,ye=ee(h.prevLine.stream),Y=h.indentedCode,ue=h.prevLine.hr,be=h.list!==!1,we=(h.listStack[h.listStack.length-1]||0)+3;h.indentedCode=!1;var xe=h.indentation;if(h.indentationDiff===null&&(h.indentationDiff=h.indentation,be)){for(h.list=null;xe=4&&(Y||h.prevLine.fencedCodeEnd||h.prevLine.header||ye))return g.skipToEnd(),h.indentedCode=!0,C.code;if(g.eatSpace())return null;if(ie&&h.indentation<=we&&(We=g.match(_))&&We[1].length<=6)return h.quote=0,h.header=We[1].length,h.thisLine.header=!0,O.highlightFormatting&&(h.formatting="header"),h.f=h.inline,B(h);if(h.indentation<=we&&g.eat(">"))return h.quote=ie?1:h.quote+1,O.highlightFormatting&&(h.formatting="quote"),g.eatSpace(),B(h);if(!Te&&!h.setext&&ie&&h.indentation<=we&&(We=g.match(K))){var Je=We[1]?"ol":"ul";return h.indentation=xe+g.current().length,h.list=!0,h.quote=0,h.listStack.push(h.indentation),h.em=!1,h.strong=!1,h.code=!1,h.strikethrough=!1,O.taskLists&&g.match(S,!1)&&(h.taskList=!0),h.f=h.inline,O.highlightFormatting&&(h.formatting=["list","list-"+Je]),B(h)}else{if(ie&&h.indentation<=we&&(We=g.match(ae,!0)))return h.quote=0,h.fencedEndRE=new RegExp(We[1]+"+ *$"),h.localMode=O.fencedCodeBlockHighlighting&&J(We[2]||O.fencedCodeBlockDefaultMode),h.localMode&&(h.localState=b.startState(h.localMode)),h.f=h.block=ce,O.highlightFormatting&&(h.formatting="code-block"),h.code=-1,B(h);if(h.setext||(!oe||!be)&&!h.quote&&h.list===!1&&!h.code&&!Te&&!D.test(g.string)&&(We=g.lookAhead(1))&&(We=We.match(G)))return h.setext?(h.header=h.setext,h.setext=0,g.skipToEnd(),O.highlightFormatting&&(h.formatting="header")):(h.header=We[0].charAt(0)=="="?1:2,h.setext=h.header),h.thisLine.header=!0,h.f=h.inline,B(h);if(Te)return g.skipToEnd(),h.hr=!0,h.thisLine.hr=!0,C.hr;if(g.peek()==="[")return H(g,h,le)}return H(g,h,h.inline)}function pe(g,h){var ie=te.token(g,h.htmlState);if(!j){var ye=b.innerMode(te,h.htmlState);(ye.mode.name=="xml"&&ye.state.tagStart===null&&!ye.state.context&&ye.state.tokenize.isInText||h.md_inside&&g.current().indexOf(">")>-1)&&(h.f=A,h.block=ne,h.htmlState=null)}return ie}function ce(g,h){var ie=h.listStack[h.listStack.length-1]||0,ye=h.indentation=g.quote?h.push(C.formatting+"-"+g.formatting[ie]+"-"+g.quote):h.push("error"))}if(g.taskOpen)return h.push("meta"),h.length?h.join(" "):null;if(g.taskClosed)return h.push("property"),h.length?h.join(" "):null;if(g.linkHref?h.push(C.linkHref,"url"):(g.strong&&h.push(C.strong),g.em&&h.push(C.em),g.strikethrough&&h.push(C.strikethrough),g.emoji&&h.push(C.emoji),g.linkText&&h.push(C.linkText),g.code&&h.push(C.code),g.image&&h.push(C.image),g.imageAltText&&h.push(C.imageAltText,"link"),g.imageMarker&&h.push(C.imageMarker)),g.header&&h.push(C.header,C.header+"-"+g.header),g.quote&&(h.push(C.quote),!O.maxBlockquoteDepth||O.maxBlockquoteDepth>=g.quote?h.push(C.quote+"-"+g.quote):h.push(C.quote+"-"+O.maxBlockquoteDepth)),g.list!==!1){var ye=(g.listStack.length-1)%3;ye?ye===1?h.push(C.list2):h.push(C.list3):h.push(C.list1)}return g.trailingSpaceNewLine?h.push("trailing-space-new-line"):g.trailingSpace&&h.push("trailing-space-"+(g.trailingSpace%2?"a":"b")),h.length?h.join(" "):null}function Ee(g,h){if(g.match(de,!0))return B(h)}function A(g,h){var ie=h.text(g,h);if(typeof ie!="undefined")return ie;if(h.list)return h.list=null,B(h);if(h.taskList){var ye=g.match(S,!0)[1]===" ";return ye?h.taskOpen=!0:h.taskClosed=!0,O.highlightFormatting&&(h.formatting="task"),h.taskList=!1,B(h)}if(h.taskOpen=!1,h.taskClosed=!1,h.header&&g.match(/^#+$/,!0))return O.highlightFormatting&&(h.formatting="header"),B(h);var Y=g.next();if(h.linkTitle){h.linkTitle=!1;var ue=Y;Y==="("&&(ue=")"),ue=(ue+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var be="^\\s*(?:[^"+ue+"\\\\]+|\\\\\\\\|\\\\.)"+ue;if(g.match(new RegExp(be),!0))return C.linkHref}if(Y==="`"){var we=h.formatting;O.highlightFormatting&&(h.formatting="code"),g.eatWhile("`");var xe=g.current().length;if(h.code==0&&(!h.quote||xe==1))return h.code=xe,B(h);if(xe==h.code){var oe=B(h);return h.code=0,oe}else return h.formatting=we,B(h)}else if(h.code)return B(h);if(Y==="\\"&&(g.next(),O.highlightFormatting)){var Te=B(h),We=C.formatting+"-escape";return Te?Te+" "+We:We}if(Y==="!"&&g.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return h.imageMarker=!0,h.image=!0,O.highlightFormatting&&(h.formatting="image"),B(h);if(Y==="["&&h.imageMarker&&g.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return h.imageMarker=!1,h.imageAltText=!0,O.highlightFormatting&&(h.formatting="image"),B(h);if(Y==="]"&&h.imageAltText){O.highlightFormatting&&(h.formatting="image");var Te=B(h);return h.imageAltText=!1,h.image=!1,h.inline=h.f=c,Te}if(Y==="["&&!h.image)return h.linkText&&g.match(/^.*?\]/)||(h.linkText=!0,O.highlightFormatting&&(h.formatting="link")),B(h);if(Y==="]"&&h.linkText){O.highlightFormatting&&(h.formatting="link");var Te=B(h);return h.linkText=!1,h.inline=h.f=g.match(/\(.*?\)| ?\[.*?\]/,!1)?c:A,Te}if(Y==="<"&&g.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){h.f=h.inline=X,O.highlightFormatting&&(h.formatting="link");var Te=B(h);return Te?Te+=" ":Te="",Te+C.linkInline}if(Y==="<"&&g.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){h.f=h.inline=X,O.highlightFormatting&&(h.formatting="link");var Te=B(h);return Te?Te+=" ":Te="",Te+C.linkEmail}if(O.xml&&Y==="<"&&g.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Je=g.string.indexOf(">",g.pos);if(Je!=-1){var pt=g.string.substring(g.start,Je);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(pt)&&(h.md_inside=!0)}return g.backUp(1),h.htmlState=b.startState(te),z(g,h,pe)}if(O.xml&&Y==="<"&&g.match(/^\/\w*?>/))return h.md_inside=!1,"tag";if(Y==="*"||Y==="_"){for(var De=1,ze=g.pos==1?" ":g.string.charAt(g.pos-2);De<3&&g.eat(Y);)De++;var Ue=g.peek()||" ",ot=!/\s/.test(Ue)&&(!m.test(Ue)||/\s/.test(ze)||m.test(ze)),Se=!/\s/.test(ze)&&(!m.test(ze)||/\s/.test(Ue)||m.test(Ue)),Fe=null,w=null;if(De%2&&(!h.em&&ot&&(Y==="*"||!Se||m.test(ze))?Fe=!0:h.em==Y&&Se&&(Y==="*"||!ot||m.test(Ue))&&(Fe=!1)),De>1&&(!h.strong&&ot&&(Y==="*"||!Se||m.test(ze))?w=!0:h.strong==Y&&Se&&(Y==="*"||!ot||m.test(Ue))&&(w=!1)),w!=null||Fe!=null){O.highlightFormatting&&(h.formatting=Fe==null?"strong":w==null?"em":"strong em"),Fe===!0&&(h.em=Y),w===!0&&(h.strong=Y);var oe=B(h);return Fe===!1&&(h.em=!1),w===!1&&(h.strong=!1),oe}}else if(Y===" "&&(g.eat("*")||g.eat("_"))){if(g.peek()===" ")return B(h);g.backUp(1)}if(O.strikethrough){if(Y==="~"&&g.eatWhile(Y)){if(h.strikethrough){O.highlightFormatting&&(h.formatting="strikethrough");var oe=B(h);return h.strikethrough=!1,oe}else if(g.match(/^[^\s]/,!1))return h.strikethrough=!0,O.highlightFormatting&&(h.formatting="strikethrough"),B(h)}else if(Y===" "&&g.match("~~",!0)){if(g.peek()===" ")return B(h);g.backUp(2)}}if(O.emoji&&Y===":"&&g.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){h.emoji=!0,O.highlightFormatting&&(h.formatting="emoji");var I=B(h);return h.emoji=!1,I}return Y===" "&&(g.match(/^ +$/,!1)?h.trailingSpace++:h.trailingSpace&&(h.trailingSpaceNewLine=!0)),B(h)}function X(g,h){var ie=g.next();if(ie===">"){h.f=h.inline=A,O.highlightFormatting&&(h.formatting="link");var ye=B(h);return ye?ye+=" ":ye="",ye+C.linkInline}return g.match(/^[^>]+/,!0),C.linkInline}function c(g,h){if(g.eatSpace())return null;var ie=g.next();return ie==="("||ie==="["?(h.f=h.inline=W(ie==="("?")":"]"),O.highlightFormatting&&(h.formatting="link-string"),h.linkHref=!0,B(h)):"error"}var U={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function W(g){return function(h,ie){var ye=h.next();if(ye===g){ie.f=ie.inline=A,O.highlightFormatting&&(ie.formatting="link-string");var Y=B(ie);return ie.linkHref=!1,Y}return h.match(U[g]),ie.linkHref=!0,B(ie)}}function le(g,h){return g.match(/^([^\]\\]|\\.)*\]:/,!1)?(h.f=Le,g.next(),O.highlightFormatting&&(h.formatting="link"),h.linkText=!0,B(h)):H(g,h,A)}function Le(g,h){if(g.match("]:",!0)){h.f=h.inline=Oe,O.highlightFormatting&&(h.formatting="link");var ie=B(h);return h.linkText=!1,ie}return g.match(/^([^\]\\]|\\.)+/,!0),C.linkText}function Oe(g,h){return g.eatSpace()?null:(g.match(/^[^\s]+/,!0),g.peek()===void 0?h.linkTitle=!0:g.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),h.f=h.inline=A,C.linkHref+" url")}var Re={startState:function(){return{f:ne,prevLine:{stream:null},thisLine:{stream:null},block:ne,htmlState:null,indentation:0,inline:A,text:Ee,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(g){return{f:g.f,prevLine:g.prevLine,thisLine:g.thisLine,block:g.block,htmlState:g.htmlState&&b.copyState(te,g.htmlState),indentation:g.indentation,localMode:g.localMode,localState:g.localMode?b.copyState(g.localMode,g.localState):null,inline:g.inline,text:g.text,formatting:!1,linkText:g.linkText,linkTitle:g.linkTitle,linkHref:g.linkHref,code:g.code,em:g.em,strong:g.strong,strikethrough:g.strikethrough,emoji:g.emoji,header:g.header,setext:g.setext,hr:g.hr,taskList:g.taskList,list:g.list,listStack:g.listStack.slice(0),quote:g.quote,indentedCode:g.indentedCode,trailingSpace:g.trailingSpace,trailingSpaceNewLine:g.trailingSpaceNewLine,md_inside:g.md_inside,fencedEndRE:g.fencedEndRE}},token:function(g,h){if(h.formatting=!1,g!=h.thisLine.stream){if(h.header=0,h.hr=!1,g.match(/^\s*$/,!0))return fe(h),null;if(h.prevLine=h.thisLine,h.thisLine={stream:g},h.taskList=!1,h.trailingSpace=0,h.trailingSpaceNewLine=!1,!h.localState&&(h.f=h.block,h.f!=pe)){var ie=g.match(/^\s*/,!0)[0].replace(/\t/g,E).length;if(h.indentation=ie,h.indentationDiff=null,ie>0)return null}}return h.f(g,h)},innerMode:function(g){return g.block==pe?{state:g.htmlState,mode:te}:g.localState?{state:g.localState,mode:g.localMode}:{state:g,mode:Re}},indent:function(g,h,ie){return g.block==pe&&te.indent?te.indent(g.htmlState,h,ie):g.localState&&g.localMode.indent?g.localMode.indent(g.localState,h,ie):b.Pass},blankLine:fe,getType:B,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Re},"xml"),b.defineMIME("text/markdown","markdown"),b.defineMIME("text/x-markdown","markdown")})})();(function(Tt,Ft){(function(b){b(Lt.exports)})(function(b){b.defineMode("javascript",function(me,O){var te=me.indentUnit,j=O.statementIndent,J=O.jsonld,C=O.json||J,F=O.trackScope!==!1,k=O.typescript,K=O.wordCharacters||/[\w$\xa1-\uffff]/,S=function(){function f($e){return{type:$e,style:"keyword"}}var p=f("keyword a"),N=f("keyword b"),R=f("keyword c"),L=f("keyword d"),V=f("operator"),Ne={type:"atom",style:"atom"};return{if:f("if"),while:p,with:p,else:N,do:N,try:N,finally:N,return:L,break:L,continue:L,new:f("new"),delete:R,void:R,throw:R,debugger:f("debugger"),var:f("var"),const:f("var"),let:f("var"),function:f("function"),catch:f("catch"),for:f("for"),switch:f("switch"),case:f("case"),default:f("default"),in:V,typeof:V,instanceof:V,true:Ne,false:Ne,null:Ne,undefined:Ne,NaN:Ne,Infinity:Ne,this:f("this"),class:f("class"),super:f("atom"),yield:R,export:f("export"),import:f("import"),extends:R,await:R}}(),_=/[+\-*&%=<>!?|~^@]/,G=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function de(f){for(var p=!1,N,R=!1;(N=f.next())!=null;){if(!p){if(N=="/"&&!R)return;N=="["?R=!0:R&&N=="]"&&(R=!1)}p=!p&&N=="\\"}}var ae,D;function m(f,p,N){return ae=f,D=N,p}function E(f,p){var N=f.next();if(N=='"'||N=="'")return p.tokenize=H(N),p.tokenize(f,p);if(N=="."&&f.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return m("number","number");if(N=="."&&f.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(N))return m(N);if(N=="="&&f.eat(">"))return m("=>","operator");if(N=="0"&&f.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return m("number","number");if(/\d/.test(N))return f.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),m("number","number");if(N=="/")return f.eat("*")?(p.tokenize=z,z(f,p)):f.eat("/")?(f.skipToEnd(),m("comment","comment")):Dt(f,p,1)?(de(f),f.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),m("regexp","string-2")):(f.eat("="),m("operator","operator",f.current()));if(N=="`")return p.tokenize=ee,ee(f,p);if(N=="#"&&f.peek()=="!")return f.skipToEnd(),m("meta","meta");if(N=="#"&&f.eatWhile(K))return m("variable","property");if(N=="<"&&f.match("!--")||N=="-"&&f.match("->")&&!/\S/.test(f.string.slice(0,f.start)))return f.skipToEnd(),m("comment","comment");if(_.test(N))return(N!=">"||!p.lexical||p.lexical.type!=">")&&(f.eat("=")?(N=="!"||N=="=")&&f.eat("="):/[<>*+\-|&?]/.test(N)&&(f.eat(N),N==">"&&f.eat(N))),N=="?"&&f.eat(".")?m("."):m("operator","operator",f.current());if(K.test(N)){f.eatWhile(K);var R=f.current();if(p.lastType!="."){if(S.propertyIsEnumerable(R)){var L=S[R];return m(L.type,L.style,R)}if(R=="async"&&f.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return m("async","keyword",R)}return m("variable","variable",R)}}function H(f){return function(p,N){var R=!1,L;if(J&&p.peek()=="@"&&p.match(G))return N.tokenize=E,m("jsonld-keyword","meta");for(;(L=p.next())!=null&&!(L==f&&!R);)R=!R&&L=="\\";return R||(N.tokenize=E),m("string","string")}}function z(f,p){for(var N=!1,R;R=f.next();){if(R=="/"&&N){p.tokenize=E;break}N=R=="*"}return m("comment","comment")}function ee(f,p){for(var N=!1,R;(R=f.next())!=null;){if(!N&&(R=="`"||R=="$"&&f.eat("{"))){p.tokenize=E;break}N=!N&&R=="\\"}return m("quasi","string-2",f.current())}var fe="([{}])";function ne(f,p){p.fatArrowAt&&(p.fatArrowAt=null);var N=f.string.indexOf("=>",f.start);if(!(N<0)){if(k){var R=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(f.string.slice(f.start,N));R&&(N=R.index)}for(var L=0,V=!1,Ne=N-1;Ne>=0;--Ne){var $e=f.string.charAt(Ne),gt=fe.indexOf($e);if(gt>=0&><3){if(!L){++Ne;break}if(--L==0){$e=="("&&(V=!0);break}}else if(gt>=3&><6)++L;else if(K.test($e))V=!0;else if(/["'\/`]/.test($e))for(;;--Ne){if(Ne==0)return;var Wr=f.string.charAt(Ne-1);if(Wr==$e&&f.string.charAt(Ne-2)!="\\"){Ne--;break}}else if(V&&!L){++Ne;break}}V&&!L&&(p.fatArrowAt=Ne)}}var pe={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function ce(f,p,N,R,L,V){this.indented=f,this.column=p,this.type=N,this.prev=L,this.info=V,R!=null&&(this.align=R)}function B(f,p){if(!F)return!1;for(var N=f.localVars;N;N=N.next)if(N.name==p)return!0;for(var R=f.context;R;R=R.prev)for(var N=R.vars;N;N=N.next)if(N.name==p)return!0}function Ee(f,p,N,R,L){var V=f.cc;for(A.state=f,A.stream=L,A.marked=null,A.cc=V,A.style=p,f.lexical.hasOwnProperty("align")||(f.lexical.align=!0);;){var Ne=V.length?V.pop():C?oe:we;if(Ne(N,R)){for(;V.length&&V[V.length-1].lex;)V.pop()();return A.marked?A.marked:N=="variable"&&B(f,R)?"variable-2":p}}}var A={state:null,column:null,marked:null,cc:null};function X(){for(var f=arguments.length-1;f>=0;f--)A.cc.push(arguments[f])}function c(){return X.apply(null,arguments),!0}function U(f,p){for(var N=p;N;N=N.next)if(N.name==f)return!0;return!1}function W(f){var p=A.state;if(A.marked="def",!!F){if(p.context){if(p.lexical.info=="var"&&p.context&&p.context.block){var N=le(f,p.context);if(N!=null){p.context=N;return}}else if(!U(f,p.localVars)){p.localVars=new Re(f,p.localVars);return}}O.globalVars&&!U(f,p.globalVars)&&(p.globalVars=new Re(f,p.globalVars))}}function le(f,p){if(p)if(p.block){var N=le(f,p.prev);return N?N==p.prev?p:new Oe(N,p.vars,!0):null}else return U(f,p.vars)?p:new Oe(p.prev,new Re(f,p.vars),!1);else return null}function Le(f){return f=="public"||f=="private"||f=="protected"||f=="abstract"||f=="readonly"}function Oe(f,p,N){this.prev=f,this.vars=p,this.block=N}function Re(f,p){this.name=f,this.next=p}var g=new Re("this",new Re("arguments",null));function h(){A.state.context=new Oe(A.state.context,A.state.localVars,!1),A.state.localVars=g}function ie(){A.state.context=new Oe(A.state.context,A.state.localVars,!0),A.state.localVars=null}h.lex=ie.lex=!0;function ye(){A.state.localVars=A.state.context.vars,A.state.context=A.state.context.prev}ye.lex=!0;function Y(f,p){var N=function(){var R=A.state,L=R.indented;if(R.lexical.type=="stat")L=R.lexical.indented;else for(var V=R.lexical;V&&V.type==")"&&V.align;V=V.prev)L=V.indented;R.lexical=new ce(L,A.stream.column(),f,null,R.lexical,p)};return N.lex=!0,N}function ue(){var f=A.state;f.lexical.prev&&(f.lexical.type==")"&&(f.indented=f.lexical.indented),f.lexical=f.lexical.prev)}ue.lex=!0;function be(f){function p(N){return N==f?c():f==";"||N=="}"||N==")"||N=="]"?X():c(p)}return p}function we(f,p){return f=="var"?c(Y("vardef",p),Er,be(";"),ue):f=="keyword a"?c(Y("form"),We,we,ue):f=="keyword b"?c(Y("form"),we,ue):f=="keyword d"?A.stream.match(/^\s*$/,!1)?c():c(Y("stat"),pt,be(";"),ue):f=="debugger"?c(be(";")):f=="{"?c(Y("}"),ie,qt,ue,ye):f==";"?c():f=="if"?(A.state.lexical.info=="else"&&A.state.cc[A.state.cc.length-1]==ue&&A.state.cc.pop()(),c(Y("form"),We,we,ue,Or)):f=="function"?c(Et):f=="for"?c(Y("form"),ie,Wn,we,ye,ue):f=="class"||k&&p=="interface"?(A.marked="keyword",c(Y("form",f=="class"?f:p),Nr,ue)):f=="variable"?k&&p=="declare"?(A.marked="keyword",c(we)):k&&(p=="module"||p=="enum"||p=="type")&&A.stream.match(/^\s*\w/,!1)?(A.marked="keyword",p=="enum"?c(se):p=="type"?c(In,be("operator"),Ae,be(";")):c(Y("form"),vt,be("{"),Y("}"),qt,ue,ue)):k&&p=="namespace"?(A.marked="keyword",c(Y("form"),oe,we,ue)):k&&p=="abstract"?(A.marked="keyword",c(we)):c(Y("stat"),Me):f=="switch"?c(Y("form"),We,be("{"),Y("}","switch"),ie,qt,ue,ue,ye):f=="case"?c(oe,be(":")):f=="default"?c(be(":")):f=="catch"?c(Y("form"),h,xe,we,ue,ye):f=="export"?c(Y("stat"),Pr,ue):f=="import"?c(Y("stat"),ur,ue):f=="async"?c(we):p=="@"?c(oe,we):X(Y("stat"),oe,be(";"),ue)}function xe(f){if(f=="(")return c(Pt,be(")"))}function oe(f,p){return Je(f,p,!1)}function Te(f,p){return Je(f,p,!0)}function We(f){return f!="("?X():c(Y(")"),pt,be(")"),ue)}function Je(f,p,N){if(A.state.fatArrowAt==A.stream.start){var R=N?Fe:Se;if(f=="(")return c(h,Y(")"),Ye(Pt,")"),ue,be("=>"),R,ye);if(f=="variable")return X(h,vt,be("=>"),R,ye)}var L=N?ze:De;return pe.hasOwnProperty(f)?c(L):f=="function"?c(Et,L):f=="class"||k&&p=="interface"?(A.marked="keyword",c(Y("form"),xi,ue)):f=="keyword c"||f=="async"?c(N?Te:oe):f=="("?c(Y(")"),pt,be(")"),ue,L):f=="operator"||f=="spread"?c(N?Te:oe):f=="["?c(Y("]"),Ke,ue,L):f=="{"?nr(Xt,"}",null,L):f=="quasi"?X(Ue,L):f=="new"?c(w(N)):c()}function pt(f){return f.match(/[;\}\)\],]/)?X():X(oe)}function De(f,p){return f==","?c(pt):ze(f,p,!1)}function ze(f,p,N){var R=N==!1?De:ze,L=N==!1?oe:Te;if(f=="=>")return c(h,N?Fe:Se,ye);if(f=="operator")return/\+\+|--/.test(p)||k&&p=="!"?c(R):k&&p=="<"&&A.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?c(Y(">"),Ye(Ae,">"),ue,R):p=="?"?c(oe,be(":"),L):c(L);if(f=="quasi")return X(Ue,R);if(f!=";"){if(f=="(")return nr(Te,")","call",R);if(f==".")return c(at,R);if(f=="[")return c(Y("]"),pt,be("]"),ue,R);if(k&&p=="as")return A.marked="keyword",c(Ae,R);if(f=="regexp")return A.state.lastType=A.marked="operator",A.stream.backUp(A.stream.pos-A.stream.start-1),c(L)}}function Ue(f,p){return f!="quasi"?X():p.slice(p.length-2)!="${"?c(Ue):c(pt,ot)}function ot(f){if(f=="}")return A.marked="string-2",A.state.tokenize=ee,c(Ue)}function Se(f){return ne(A.stream,A.state),X(f=="{"?we:oe)}function Fe(f){return ne(A.stream,A.state),X(f=="{"?we:Te)}function w(f){return function(p){return p=="."?c(f?M:I):p=="variable"&&k?c(wt,f?ze:De):X(f?Te:oe)}}function I(f,p){if(p=="target")return A.marked="keyword",c(De)}function M(f,p){if(p=="target")return A.marked="keyword",c(ze)}function Me(f){return f==":"?c(ue,we):X(De,be(";"),ue)}function at(f){if(f=="variable")return A.marked="property",c()}function Xt(f,p){if(f=="async")return A.marked="property",c(Xt);if(f=="variable"||A.style=="keyword"){if(A.marked="property",p=="get"||p=="set")return c(zn);var N;return k&&A.state.fatArrowAt==A.stream.start&&(N=A.stream.match(/^\s*:\s*/,!1))&&(A.state.fatArrowAt=A.stream.pos+N[0].length),c(Yt)}else{if(f=="number"||f=="string")return A.marked=J?"property":A.style+" property",c(Yt);if(f=="jsonld-keyword")return c(Yt);if(k&&Le(p))return A.marked="keyword",c(Xt);if(f=="[")return c(oe,ir,be("]"),Yt);if(f=="spread")return c(Te,Yt);if(p=="*")return A.marked="keyword",c(Xt);if(f==":")return X(Yt)}}function zn(f){return f!="variable"?X(Yt):(A.marked="property",c(Et))}function Yt(f){if(f==":")return c(Te);if(f=="(")return X(Et)}function Ye(f,p,N){function R(L,V){if(N?N.indexOf(L)>-1:L==","){var Ne=A.state.lexical;return Ne.info=="call"&&(Ne.pos=(Ne.pos||0)+1),c(function($e,gt){return $e==p||gt==p?X():X(f)},R)}return L==p||V==p?c():N&&N.indexOf(";")>-1?X(f):c(be(p))}return function(L,V){return L==p||V==p?c():X(f,R)}}function nr(f,p,N){for(var R=3;R"),Ae);if(f=="quasi")return X(st,Mt)}function Bn(f){if(f=="=>")return c(Ae)}function ve(f){return f.match(/[\}\)\]]/)?c():f==","||f==";"?c(ve):X(Zt,ve)}function Zt(f,p){if(f=="variable"||A.style=="keyword")return A.marked="property",c(Zt);if(p=="?"||f=="number"||f=="string")return c(Zt);if(f==":")return c(Ae);if(f=="[")return c(be("variable"),yr,be("]"),Zt);if(f=="(")return X(sr,Zt);if(!f.match(/[;\}\)\],]/))return c()}function st(f,p){return f!="quasi"?X():p.slice(p.length-2)!="${"?c(st):c(Ae,_e)}function _e(f){if(f=="}")return A.marked="string-2",A.state.tokenize=ee,c(st)}function je(f,p){return f=="variable"&&A.stream.match(/^\s*[?:]/,!1)||p=="?"?c(je):f==":"?c(Ae):f=="spread"?c(je):X(Ae)}function Mt(f,p){if(p=="<")return c(Y(">"),Ye(Ae,">"),ue,Mt);if(p=="|"||f=="."||p=="&")return c(Ae);if(f=="[")return c(Ae,be("]"),Mt);if(p=="extends"||p=="implements")return A.marked="keyword",c(Ae);if(p=="?")return c(Ae,be(":"),Ae)}function wt(f,p){if(p=="<")return c(Y(">"),Ye(Ae,">"),ue,Mt)}function Ot(){return X(Ae,ut)}function ut(f,p){if(p=="=")return c(Ae)}function Er(f,p){return p=="enum"?(A.marked="keyword",c(se)):X(vt,ir,Nt,mi)}function vt(f,p){if(k&&Le(p))return A.marked="keyword",c(vt);if(f=="variable")return W(p),c();if(f=="spread")return c(vt);if(f=="[")return nr(on,"]");if(f=="{")return nr(lr,"}")}function lr(f,p){return f=="variable"&&!A.stream.match(/^\s*:/,!1)?(W(p),c(Nt)):(f=="variable"&&(A.marked="property"),f=="spread"?c(vt):f=="}"?X():f=="["?c(oe,be("]"),be(":"),lr):c(be(":"),vt,Nt))}function on(){return X(vt,Nt)}function Nt(f,p){if(p=="=")return c(Te)}function mi(f){if(f==",")return c(Er)}function Or(f,p){if(f=="keyword b"&&p=="else")return c(Y("form","else"),we,ue)}function Wn(f,p){if(p=="await")return c(Wn);if(f=="(")return c(Y(")"),ln,ue)}function ln(f){return f=="var"?c(Er,ar):f=="variable"?c(ar):X(ar)}function ar(f,p){return f==")"?c():f==";"?c(ar):p=="in"||p=="of"?(A.marked="keyword",c(oe,ar)):X(oe,ar)}function Et(f,p){if(p=="*")return A.marked="keyword",c(Et);if(f=="variable")return W(p),c(Et);if(f=="(")return c(h,Y(")"),Ye(Pt,")"),ue,or,we,ye);if(k&&p=="<")return c(Y(">"),Ye(Ot,">"),ue,Et)}function sr(f,p){if(p=="*")return A.marked="keyword",c(sr);if(f=="variable")return W(p),c(sr);if(f=="(")return c(h,Y(")"),Ye(Pt,")"),ue,or,ye);if(k&&p=="<")return c(Y(">"),Ye(Ot,">"),ue,sr)}function In(f,p){if(f=="keyword"||f=="variable")return A.marked="type",c(In);if(p=="<")return c(Y(">"),Ye(Ot,">"),ue)}function Pt(f,p){return p=="@"&&c(oe,Pt),f=="spread"?c(Pt):k&&Le(p)?(A.marked="keyword",c(Pt)):k&&f=="this"?c(ir,Nt):X(vt,ir,Nt)}function xi(f,p){return f=="variable"?Nr(f,p):Ht(f,p)}function Nr(f,p){if(f=="variable")return W(p),c(Ht)}function Ht(f,p){if(p=="<")return c(Y(">"),Ye(Ot,">"),ue,Ht);if(p=="extends"||p=="implements"||k&&f==",")return p=="implements"&&(A.marked="keyword"),c(k?Ae:oe,Ht);if(f=="{")return c(Y("}"),zt,ue)}function zt(f,p){if(f=="async"||f=="variable"&&(p=="static"||p=="get"||p=="set"||k&&Le(p))&&A.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return A.marked="keyword",c(zt);if(f=="variable"||A.style=="keyword")return A.marked="property",c(br,zt);if(f=="number"||f=="string")return c(br,zt);if(f=="[")return c(oe,ir,be("]"),br,zt);if(p=="*")return A.marked="keyword",c(zt);if(k&&f=="(")return X(sr,zt);if(f==";"||f==",")return c(zt);if(f=="}")return c();if(p=="@")return c(oe,zt)}function br(f,p){if(p=="!"||p=="?")return c(br);if(f==":")return c(Ae,Nt);if(p=="=")return c(Te);var N=A.state.lexical.prev,R=N&&N.info=="interface";return X(R?sr:Et)}function Pr(f,p){return p=="*"?(A.marked="keyword",c(Br,be(";"))):p=="default"?(A.marked="keyword",c(oe,be(";"))):f=="{"?c(Ye(Hr,"}"),Br,be(";")):X(we)}function Hr(f,p){if(p=="as")return A.marked="keyword",c(be("variable"));if(f=="variable")return X(Te,Hr)}function ur(f){return f=="string"?c():f=="("?X(oe):f=="."?X(De):X(zr,_t,Br)}function zr(f,p){return f=="{"?nr(zr,"}"):(f=="variable"&&W(p),p=="*"&&(A.marked="keyword"),c(an))}function _t(f){if(f==",")return c(zr,_t)}function an(f,p){if(p=="as")return A.marked="keyword",c(zr)}function Br(f,p){if(p=="from")return A.marked="keyword",c(oe)}function Ke(f){return f=="]"?c():X(Ye(Te,"]"))}function se(){return X(Y("form"),vt,be("{"),Y("}"),Ye(Qt,"}"),ue,ue)}function Qt(){return X(vt,Nt)}function sn(f,p){return f.lastType=="operator"||f.lastType==","||_.test(p.charAt(0))||/[,.]/.test(p.charAt(0))}function Dt(f,p,N){return p.tokenize==E&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(p.lastType)||p.lastType=="quasi"&&/\{\s*$/.test(f.string.slice(0,f.pos-(N||0)))}return{startState:function(f){var p={tokenize:E,lastType:"sof",cc:[],lexical:new ce((f||0)-te,0,"block",!1),localVars:O.localVars,context:O.localVars&&new Oe(null,null,!1),indented:f||0};return O.globalVars&&typeof O.globalVars=="object"&&(p.globalVars=O.globalVars),p},token:function(f,p){if(f.sol()&&(p.lexical.hasOwnProperty("align")||(p.lexical.align=!1),p.indented=f.indentation(),ne(f,p)),p.tokenize!=z&&f.eatSpace())return null;var N=p.tokenize(f,p);return ae=="comment"?N:(p.lastType=ae=="operator"&&(D=="++"||D=="--")?"incdec":ae,Ee(p,N,ae,D,f))},indent:function(f,p){if(f.tokenize==z||f.tokenize==ee)return b.Pass;if(f.tokenize!=E)return 0;var N=p&&p.charAt(0),R=f.lexical,L;if(!/^\s*else\b/.test(p))for(var V=f.cc.length-1;V>=0;--V){var Ne=f.cc[V];if(Ne==ue)R=R.prev;else if(Ne!=Or&&Ne!=ye)break}for(;(R.type=="stat"||R.type=="form")&&(N=="}"||(L=f.cc[f.cc.length-1])&&(L==De||L==ze)&&!/^[,\.=+\-*:?[\(]/.test(p));)R=R.prev;j&&R.type==")"&&R.prev.type=="stat"&&(R=R.prev);var $e=R.type,gt=N==$e;return $e=="vardef"?R.indented+(f.lastType=="operator"||f.lastType==","?R.info.length+1:0):$e=="form"&&N=="{"?R.indented:$e=="form"?R.indented+te:$e=="stat"?R.indented+(sn(f,p)?j||te:0):R.info=="switch"&&!gt&&O.doubleIndentSwitch!=!1?R.indented+(/^(?:case|default)\b/.test(p)?te:2*te):R.align?R.column+(gt?0:1):R.indented+(gt?0:te)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:C?null:"/*",blockCommentEnd:C?null:"*/",blockCommentContinue:C?null:" * ",lineComment:C?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:C?"json":"javascript",jsonldMode:J,jsonMode:C,expressionAllowed:Dt,skipExpression:function(f){Ee(f,"atom","atom","true",new b.StringStream("",2,null))}}}),b.registerHelper("wordChars","javascript",/[\w$]/),b.defineMIME("text/javascript","javascript"),b.defineMIME("text/ecmascript","javascript"),b.defineMIME("application/javascript","javascript"),b.defineMIME("application/x-javascript","javascript"),b.defineMIME("application/ecmascript","javascript"),b.defineMIME("application/json",{name:"javascript",json:!0}),b.defineMIME("application/x-json",{name:"javascript",json:!0}),b.defineMIME("application/manifest+json",{name:"javascript",json:!0}),b.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),b.defineMIME("text/typescript",{name:"javascript",typescript:!0}),b.defineMIME("application/typescript",{name:"javascript",typescript:!0})})})();(function(Tt,Ft){(function(b){b(Lt.exports)})(function(b){b.defineMode("css",function(ce,B){var Ee=B.inline;B.propertyKeywords||(B=b.resolveMode("text/css"));var A=ce.indentUnit,X=B.tokenHooks,c=B.documentTypes||{},U=B.mediaTypes||{},W=B.mediaFeatures||{},le=B.mediaValueKeywords||{},Le=B.propertyKeywords||{},Oe=B.nonStandardPropertyKeywords||{},Re=B.fontProperties||{},g=B.counterDescriptors||{},h=B.colorKeywords||{},ie=B.valueKeywords||{},ye=B.allowNested,Y=B.lineComment,ue=B.supportsAtComponent===!0,be=ce.highlightNonStandardPropertyKeywords!==!1,we,xe;function oe(w,I){return we=I,w}function Te(w,I){var M=w.next();if(X[M]){var Me=X[M](w,I);if(Me!==!1)return Me}if(M=="@")return w.eatWhile(/[\w\\\-]/),oe("def",w.current());if(M=="="||(M=="~"||M=="|")&&w.eat("="))return oe(null,"compare");if(M=='"'||M=="'")return I.tokenize=We(M),I.tokenize(w,I);if(M=="#")return w.eatWhile(/[\w\\\-]/),oe("atom","hash");if(M=="!")return w.match(/^\s*\w*/),oe("keyword","important");if(/\d/.test(M)||M=="."&&w.eat(/\d/))return w.eatWhile(/[\w.%]/),oe("number","unit");if(M==="-"){if(/[\d.]/.test(w.peek()))return w.eatWhile(/[\w.%]/),oe("number","unit");if(w.match(/^-[\w\\\-]*/))return w.eatWhile(/[\w\\\-]/),w.match(/^\s*:/,!1)?oe("variable-2","variable-definition"):oe("variable-2","variable");if(w.match(/^\w+-/))return oe("meta","meta")}else return/[,+>*\/]/.test(M)?oe(null,"select-op"):M=="."&&w.match(/^-?[_a-z][_a-z0-9-]*/i)?oe("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(M)?oe(null,M):w.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(w.current())&&(I.tokenize=Je),oe("variable callee","variable")):/[\w\\\-]/.test(M)?(w.eatWhile(/[\w\\\-]/),oe("property","word")):oe(null,null)}function We(w){return function(I,M){for(var Me=!1,at;(at=I.next())!=null;){if(at==w&&!Me){w==")"&&I.backUp(1);break}Me=!Me&&at=="\\"}return(at==w||!Me&&w!=")")&&(M.tokenize=null),oe("string","string")}}function Je(w,I){return w.next(),w.match(/^\s*[\"\')]/,!1)?I.tokenize=null:I.tokenize=We(")"),oe(null,"(")}function pt(w,I,M){this.type=w,this.indent=I,this.prev=M}function De(w,I,M,Me){return w.context=new pt(M,I.indentation()+(Me===!1?0:A),w.context),M}function ze(w){return w.context.prev&&(w.context=w.context.prev),w.context.type}function Ue(w,I,M){return Fe[M.context.type](w,I,M)}function ot(w,I,M,Me){for(var at=Me||1;at>0;at--)M.context=M.context.prev;return Ue(w,I,M)}function Se(w){var I=w.current().toLowerCase();ie.hasOwnProperty(I)?xe="atom":h.hasOwnProperty(I)?xe="keyword":xe="variable"}var Fe={};return Fe.top=function(w,I,M){if(w=="{")return De(M,I,"block");if(w=="}"&&M.context.prev)return ze(M);if(ue&&/@component/i.test(w))return De(M,I,"atComponentBlock");if(/^@(-moz-)?document$/i.test(w))return De(M,I,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(w))return De(M,I,"atBlock");if(/^@(font-face|counter-style)/i.test(w))return M.stateArg=w,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(w))return"keyframes";if(w&&w.charAt(0)=="@")return De(M,I,"at");if(w=="hash")xe="builtin";else if(w=="word")xe="tag";else{if(w=="variable-definition")return"maybeprop";if(w=="interpolation")return De(M,I,"interpolation");if(w==":")return"pseudo";if(ye&&w=="(")return De(M,I,"parens")}return M.context.type},Fe.block=function(w,I,M){if(w=="word"){var Me=I.current().toLowerCase();return Le.hasOwnProperty(Me)?(xe="property","maybeprop"):Oe.hasOwnProperty(Me)?(xe=be?"string-2":"property","maybeprop"):ye?(xe=I.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(xe+=" error","maybeprop")}else return w=="meta"?"block":!ye&&(w=="hash"||w=="qualifier")?(xe="error","block"):Fe.top(w,I,M)},Fe.maybeprop=function(w,I,M){return w==":"?De(M,I,"prop"):Ue(w,I,M)},Fe.prop=function(w,I,M){if(w==";")return ze(M);if(w=="{"&&ye)return De(M,I,"propBlock");if(w=="}"||w=="{")return ot(w,I,M);if(w=="(")return De(M,I,"parens");if(w=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(I.current()))xe+=" error";else if(w=="word")Se(I);else if(w=="interpolation")return De(M,I,"interpolation");return"prop"},Fe.propBlock=function(w,I,M){return w=="}"?ze(M):w=="word"?(xe="property","maybeprop"):M.context.type},Fe.parens=function(w,I,M){return w=="{"||w=="}"?ot(w,I,M):w==")"?ze(M):w=="("?De(M,I,"parens"):w=="interpolation"?De(M,I,"interpolation"):(w=="word"&&Se(I),"parens")},Fe.pseudo=function(w,I,M){return w=="meta"?"pseudo":w=="word"?(xe="variable-3",M.context.type):Ue(w,I,M)},Fe.documentTypes=function(w,I,M){return w=="word"&&c.hasOwnProperty(I.current())?(xe="tag",M.context.type):Fe.atBlock(w,I,M)},Fe.atBlock=function(w,I,M){if(w=="(")return De(M,I,"atBlock_parens");if(w=="}"||w==";")return ot(w,I,M);if(w=="{")return ze(M)&&De(M,I,ye?"block":"top");if(w=="interpolation")return De(M,I,"interpolation");if(w=="word"){var Me=I.current().toLowerCase();Me=="only"||Me=="not"||Me=="and"||Me=="or"?xe="keyword":U.hasOwnProperty(Me)?xe="attribute":W.hasOwnProperty(Me)?xe="property":le.hasOwnProperty(Me)?xe="keyword":Le.hasOwnProperty(Me)?xe="property":Oe.hasOwnProperty(Me)?xe=be?"string-2":"property":ie.hasOwnProperty(Me)?xe="atom":h.hasOwnProperty(Me)?xe="keyword":xe="error"}return M.context.type},Fe.atComponentBlock=function(w,I,M){return w=="}"?ot(w,I,M):w=="{"?ze(M)&&De(M,I,ye?"block":"top",!1):(w=="word"&&(xe="error"),M.context.type)},Fe.atBlock_parens=function(w,I,M){return w==")"?ze(M):w=="{"||w=="}"?ot(w,I,M,2):Fe.atBlock(w,I,M)},Fe.restricted_atBlock_before=function(w,I,M){return w=="{"?De(M,I,"restricted_atBlock"):w=="word"&&M.stateArg=="@counter-style"?(xe="variable","restricted_atBlock_before"):Ue(w,I,M)},Fe.restricted_atBlock=function(w,I,M){return w=="}"?(M.stateArg=null,ze(M)):w=="word"?(M.stateArg=="@font-face"&&!Re.hasOwnProperty(I.current().toLowerCase())||M.stateArg=="@counter-style"&&!g.hasOwnProperty(I.current().toLowerCase())?xe="error":xe="property","maybeprop"):"restricted_atBlock"},Fe.keyframes=function(w,I,M){return w=="word"?(xe="variable","keyframes"):w=="{"?De(M,I,"top"):Ue(w,I,M)},Fe.at=function(w,I,M){return w==";"?ze(M):w=="{"||w=="}"?ot(w,I,M):(w=="word"?xe="tag":w=="hash"&&(xe="builtin"),"at")},Fe.interpolation=function(w,I,M){return w=="}"?ze(M):w=="{"||w==";"?ot(w,I,M):(w=="word"?xe="variable":w!="variable"&&w!="("&&w!=")"&&(xe="error"),"interpolation")},{startState:function(w){return{tokenize:null,state:Ee?"block":"top",stateArg:null,context:new pt(Ee?"block":"top",w||0,null)}},token:function(w,I){if(!I.tokenize&&w.eatSpace())return null;var M=(I.tokenize||Te)(w,I);return M&&typeof M=="object"&&(we=M[1],M=M[0]),xe=M,we!="comment"&&(I.state=Fe[I.state](we,w,I)),xe},indent:function(w,I){var M=w.context,Me=I&&I.charAt(0),at=M.indent;return M.type=="prop"&&(Me=="}"||Me==")")&&(M=M.prev),M.prev&&(Me=="}"&&(M.type=="block"||M.type=="top"||M.type=="interpolation"||M.type=="restricted_atBlock")?(M=M.prev,at=M.indent):(Me==")"&&(M.type=="parens"||M.type=="atBlock_parens")||Me=="{"&&(M.type=="at"||M.type=="atBlock"))&&(at=Math.max(0,M.indent-A))),at},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:Y,fold:"brace"}});function me(ce){for(var B={},Ee=0;Ee`,triples:"",explode:"[]{}"},O=b.Pos;b.defineOption("autoCloseBrackets",!1,function(D,m,E){E&&E!=b.Init&&(D.removeKeyMap(j),D.state.closeBrackets=null),m&&(J(te(m,"pairs")),D.state.closeBrackets=m,D.addKeyMap(j))});function te(D,m){return m=="pairs"&&typeof D=="string"?D:typeof D=="object"&&D[m]!=null?D[m]:me[m]}var j={Backspace:k,Enter:K};function J(D){for(var m=0;m=0;z--){var fe=H[z].head;D.replaceRange("",O(fe.line,fe.ch-1),O(fe.line,fe.ch+1),"+delete")}}function K(D){var m=F(D),E=m&&te(m,"explode");if(!E||D.getOption("disableInput"))return b.Pass;for(var H=D.listSelections(),z=0;z0?{line:fe.head.line,ch:fe.head.ch+m}:{line:fe.head.line-1};E.push({anchor:ne,head:ne})}D.setSelections(E,z)}function _(D){var m=b.cmpPos(D.anchor,D.head)>0;return{anchor:new O(D.anchor.line,D.anchor.ch+(m?-1:1)),head:new O(D.head.line,D.head.ch+(m?1:-1))}}function G(D,m){var E=F(D);if(!E||D.getOption("disableInput"))return b.Pass;var H=te(E,"pairs"),z=H.indexOf(m);if(z==-1)return b.Pass;for(var ee=te(E,"closeBefore"),fe=te(E,"triples"),ne=H.charAt(z+1)==m,pe=D.listSelections(),ce=z%2==0,B,Ee=0;Ee=0&&D.getRange(X,O(X.line,X.ch+3))==m+m+m?c="skipThree":c="skip";else if(ne&&X.ch>1&&fe.indexOf(m)>=0&&D.getRange(O(X.line,X.ch-2),X)==m+m){if(X.ch>2&&/\bstring/.test(D.getTokenTypeAt(O(X.line,X.ch-2))))return b.Pass;c="addFour"}else if(ne){var W=X.ch==0?" ":D.getRange(O(X.line,X.ch-1),X);if(!b.isWordChar(U)&&W!=m&&!b.isWordChar(W))c="both";else return b.Pass}else if(ce&&(U.length===0||/\s/.test(U)||ee.indexOf(U)>-1))c="both";else return b.Pass;if(!B)B=c;else if(B!=c)return b.Pass}var le=z%2?H.charAt(z-1):m,Le=z%2?m:H.charAt(z+1);D.operation(function(){if(B=="skip")S(D,1);else if(B=="skipThree")S(D,3);else if(B=="surround"){for(var Oe=D.getSelections(),Re=0;Re=m.max))return m.ch=0,m.text=m.cm.getLine(++m.line),!0}function K(m){if(!(m.line<=m.min))return m.text=m.cm.getLine(--m.line),m.ch=m.text.length,!0}function S(m){for(;;){var E=m.text.indexOf(">",m.ch);if(E==-1){if(k(m))continue;return}if(!F(m,E+1)){m.ch=E+1;continue}var H=m.text.lastIndexOf("/",E),z=H>-1&&!/\S/.test(m.text.slice(H+1,E));return m.ch=E+1,z?"selfClose":"regular"}}function _(m){for(;;){var E=m.ch?m.text.lastIndexOf("<",m.ch-1):-1;if(E==-1){if(K(m))continue;return}if(!F(m,E+1)){m.ch=E;continue}J.lastIndex=E,m.ch=E;var H=J.exec(m.text);if(H&&H.index==E)return H}}function G(m){for(;;){J.lastIndex=m.ch;var E=J.exec(m.text);if(!E){if(k(m))continue;return}if(!F(m,E.index+1)){m.ch=E.index+1;continue}return m.ch=E.index+E[0].length,E}}function de(m){for(;;){var E=m.ch?m.text.lastIndexOf(">",m.ch-1):-1;if(E==-1){if(K(m))continue;return}if(!F(m,E+1)){m.ch=E;continue}var H=m.text.lastIndexOf("/",E),z=H>-1&&!/\S/.test(m.text.slice(H+1,E));return m.ch=E+1,z?"selfClose":"regular"}}function ae(m,E){for(var H=[];;){var z=G(m),ee,fe=m.line,ne=m.ch-(z?z[0].length:0);if(!z||!(ee=S(m)))return;if(ee!="selfClose")if(z[1]){for(var pe=H.length-1;pe>=0;--pe)if(H[pe]==z[2]){H.length=pe;break}if(pe<0&&(!E||E==z[2]))return{tag:z[2],from:me(fe,ne),to:me(m.line,m.ch)}}else H.push(z[2])}}function D(m,E){for(var H=[];;){var z=de(m);if(!z)return;if(z=="selfClose"){_(m);continue}var ee=m.line,fe=m.ch,ne=_(m);if(!ne)return;if(ne[1])H.push(ne[2]);else{for(var pe=H.length-1;pe>=0;--pe)if(H[pe]==ne[2]){H.length=pe;break}if(pe<0&&(!E||E==ne[2]))return{tag:ne[2],from:me(m.line,m.ch),to:me(ee,fe)}}}}b.registerHelper("fold","xml",function(m,E){for(var H=new C(m,E.line,0);;){var z=G(H);if(!z||H.line!=E.line)return;var ee=S(H);if(!ee)return;if(!z[1]&&ee!="selfClose"){var fe=me(H.line,H.ch),ne=ae(H,z[2]);return ne&&O(ne.from,fe)>0?{from:fe,to:ne.from}:null}}}),b.findMatchingTag=function(m,E,H){var z=new C(m,E.line,E.ch,H);if(!(z.text.indexOf(">")==-1&&z.text.indexOf("<")==-1)){var ee=S(z),fe=ee&&me(z.line,z.ch),ne=ee&&_(z);if(!(!ee||!ne||O(z,E)>0)){var pe={from:me(z.line,z.ch),to:fe,tag:ne[2]};return ee=="selfClose"?{open:pe,close:null,at:"open"}:ne[1]?{open:D(z,ne[2]),close:pe,at:"close"}:(z=new C(m,fe.line,fe.ch,H),{open:pe,close:ae(z,ne[2]),at:"open"})}}},b.findEnclosingTag=function(m,E,H,z){for(var ee=new C(m,E.line,E.ch,H);;){var fe=D(ee,z);if(!fe)break;var ne=new C(m,E.line,E.ch,H),pe=ae(ne,fe.tag);if(pe)return{open:fe,close:pe}}},b.scanForClosingTag=function(m,E,H,z){var ee=new C(m,E.line,E.ch,z?{from:0,to:z}:null);return ae(ee,H)}})})();(function(Tt,Ft){(function(b){b(Lt.exports,pu.exports)})(function(b){b.defineOption("autoCloseTags",!1,function(k,K,S){if(S!=b.Init&&S&&k.removeKeyMap("autoCloseTags"),!!K){var _={name:"autoCloseTags"};(typeof K!="object"||K.whenClosing!==!1)&&(_["'/'"]=function(G){return J(G)}),(typeof K!="object"||K.whenOpening!==!1)&&(_["'>'"]=function(G){return te(G)}),k.addKeyMap(_)}});var me=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],O=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function te(k){if(k.getOption("disableInput"))return b.Pass;for(var K=k.listSelections(),S=[],_=k.getOption("autoCloseTags"),G=0;Gde.ch&&(H=H.slice(0,H.length-ae.end+de.ch));var ne=H.toLowerCase();if(!H||ae.type=="string"&&(ae.end!=de.ch||!/[\"\']/.test(ae.string.charAt(ae.string.length-1))||ae.string.length==1)||ae.type=="tag"&&E.close||ae.string.indexOf("/")==de.ch-ae.start-1||ee&&C(ee,ne)>-1||F(k,D.mode.xmlCurrentContext&&D.mode.xmlCurrentContext(m)||[],H,de,!0))return b.Pass;var pe=typeof _=="object"&&_.emptyTags;if(pe&&C(pe,H)>-1){S[G]={text:"/>",newPos:b.Pos(de.line,de.ch+2)};continue}var ce=fe&&C(fe,ne)>-1;S[G]={indent:ce,text:">"+(ce?` `:"")+"",newPos:ce?b.Pos(de.line+1,0):b.Pos(de.line,de.ch+1)}}for(var B=typeof _=="object"&&_.dontIndentOnAutoClose,G=K.length-1;G>=0;G--){var Ee=S[G];k.replaceRange(Ee.text,K[G].head,K[G].anchor,"+insert");var A=k.listSelections().slice(0);A[G]={head:Ee.newPos,anchor:Ee.newPos},k.setSelections(A),!B&&Ee.indent&&(k.indentLine(Ee.newPos.line,null,!0),k.indentLine(Ee.newPos.line+1,null,!0))}}function j(k,K){for(var S=k.listSelections(),_=[],G=K?"/":""&&(ee+=">"),_[D]=ee}if(k.replaceSelections(_),S=k.listSelections(),!ae)for(var D=0;D=0&&K[m]==S;m--)++D;_=ae.to;for(var m=1;m",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function j(S){return S&&S.bracketRegex||/[(){}[\]]/}function J(S,_,G){var de=S.getLineHandle(_.line),ae=_.ch-1,D=G&&G.afterCursor;D==null&&(D=/(^| )cm-fat-cursor($| )/.test(S.getWrapperElement().className));var m=j(G),E=!D&&ae>=0&&m.test(de.text.charAt(ae))&&te[de.text.charAt(ae)]||m.test(de.text.charAt(ae+1))&&te[de.text.charAt(++ae)];if(!E)return null;var H=E.charAt(1)==">"?1:-1;if(G&&G.strict&&H>0!=(ae==_.ch))return null;var z=S.getTokenTypeAt(O(_.line,ae+1)),ee=C(S,O(_.line,ae+(H>0?1:0)),H,z,G);return ee==null?null:{from:O(_.line,ae),to:ee&&ee.pos,match:ee&&ee.ch==E.charAt(0),forward:H>0}}function C(S,_,G,de,ae){for(var D=ae&&ae.maxScanLineLength||1e4,m=ae&&ae.maxScanLines||1e3,E=[],H=j(ae),z=G>0?Math.min(_.line+m,S.lastLine()+1):Math.max(S.firstLine()-1,_.line-m),ee=_.line;ee!=z;ee+=G){var fe=S.getLine(ee);if(!!fe){var ne=G>0?0:fe.length-1,pe=G>0?fe.length:-1;if(!(fe.length>D))for(ee==_.line&&(ne=_.ch-(G<0?1:0));ne!=pe;ne+=G){var ce=fe.charAt(ne);if(H.test(ce)&&(de===void 0||(S.getTokenTypeAt(O(ee,ne+1))||"")==(de||""))){var B=te[ce];if(B&&B.charAt(1)==">"==G>0)E.push(ce);else if(E.length)E.pop();else return{pos:O(ee,ne),ch:ce}}}}}return ee-G==(G>0?S.lastLine():S.firstLine())?!1:null}function F(S,_,G){for(var de=S.state.matchBrackets.maxHighlightLineLength||1e3,ae=G&&G.highlightNonMatching,D=[],m=S.listSelections(),E=0;ES.right?1:0:_=K.clientYS.bottom?1:0,F.moveTo(F.pos+_*F.screen)});function k(K){var S=b.wheelEventPixels(K)[F.orientation=="horizontal"?"x":"y"],_=F.pos;F.moveTo(F.pos+S),F.pos!=_&&b.e_preventDefault(K)}b.on(this.node,"mousewheel",k),b.on(this.node,"DOMMouseScroll",k)}me.prototype.setPos=function(j,J){return j<0&&(j=0),j>this.total-this.screen&&(j=this.total-this.screen),!J&&j==this.pos?!1:(this.pos=j,this.inner.style[this.orientation=="horizontal"?"left":"top"]=j*(this.size/this.total)+"px",!0)},me.prototype.moveTo=function(j){this.setPos(j)&&this.scroll(j,this.orientation)};var O=10;me.prototype.update=function(j,J,C){var F=this.screen!=J||this.total!=j||this.size!=C;F&&(this.screen=J,this.total=j,this.size=C);var k=this.screen*(this.size/this.total);kj.clientWidth+1,k=j.scrollHeight>j.clientHeight+1;return this.vert.node.style.display=k?"block":"none",this.horiz.node.style.display=F?"block":"none",k&&(this.vert.update(j.scrollHeight,j.clientHeight,j.viewHeight-(F?C:0)),this.vert.node.style.bottom=F?C+"px":"0"),F&&(this.horiz.update(j.scrollWidth,j.clientWidth,j.viewWidth-(k?C:0)-j.barLeft),this.horiz.node.style.right=k?C+"px":"0",this.horiz.node.style.left=j.barLeft+"px"),{right:k?C:0,bottom:F?C:0}},te.prototype.setScrollTop=function(j){this.vert.setPos(j)},te.prototype.setScrollLeft=function(j){this.horiz.setPos(j)},te.prototype.clear=function(){var j=this.horiz.node.parentNode;j.removeChild(this.horiz.node),j.removeChild(this.vert.node)},b.scrollbarModel.simple=function(j,J){return new te("CodeMirror-simplescroll",j,J)},b.scrollbarModel.overlay=function(j,J){return new te("CodeMirror-overlayscroll",j,J)}})})();export{gu as C};