| 123456789101112131415161718192021222324 |
- import{a as Su}from"./antd-vue-vendor-DcqS7Wvq.js";var zn={exports:{}},Cu=zn.exports,ml;function Bn(){return ml||(ml=1,function(tn,Rn){(function(E,Oe){tn.exports=Oe()})(Cu,function(){"use strict";var E=navigator.userAgent,Oe=navigator.platform,ve=/gecko\/\d/i.test(E),Je=/MSIE \d/.test(E),vt=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(E),Ee=/Edge\/(\d+)/.exec(E),H=Je||vt||Ee,te=H&&(Je?document.documentMode||6:+(Ee||vt)[1]),q=!Ee&&/WebKit\//.test(E),re=q&&/Qt\/\d+\.\d+/.test(E),_=!Ee&&/Chrome\/(\d+)/.exec(E),oe=_&&+_[1],ne=/Opera\//.test(E),Me=/Apple Computer/.test(navigator.vendor),Ne=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(E),Fe=/PhantomJS/.test(E),ee=Me&&(/Mobile\/\w+/.test(E)||navigator.maxTouchPoints>2),J=/Android/.test(E),ie=ee||J||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(E),pe=ee||/Mac/.test(Oe),Ke=/\bCrOS\b/.test(E),ot=/win/i.test(Oe),Ie=ne&&E.match(/Version\/(\d*\.\d*)/);Ie&&(Ie=Number(Ie[1])),Ie&&Ie>=15&&(ne=!1,q=!0);var Be=pe&&(re||ne&&(Ie==null||Ie<12.11)),X=ve||H&&te>=9;function G(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var we=function(e,t){var n=e.className,r=G(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function k(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function z(e,t){return k(e).appendChild(t)}function c(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function O(e,t,n,r){var i=c(e,t,n,r);return i.setAttribute("role","presentation"),i}var T;document.createRange?T=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:T=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function U(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function fe(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch(r){n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function Ae(e,t){var n=e.className;G(t).test(n)||(e.className+=(n?" ":"")+t)}function Tt(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!G(n[r]).test(t)&&(t+=" "+n[r]);return t}var Ut=function(e){e.select()};ee?Ut=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:H&&(Ut=function(e){try{e.select()}catch(t){}});function rt(e){return e.display.wrapper.ownerDocument}function gt(e){return be(e.display.wrapper)}function be(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function Y(e){return rt(e).defaultView}function j(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function V(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function se(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=r||0,a=i||0;;){var l=e.indexOf(" ",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}}var Q=function(){this.id=null,this.f=null,this.time=0,this.handler=j(this.onTimeout,this)};Q.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Q.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function I(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var Ye=50,Mt={toString:function(){return"CodeMirror.Pass"}},at={scroll:!1},xt={origin:"*mouse"},ce={origin:"+move"};function We(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);o==-1&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var lt=[""];function wt(e){for(;lt.length<=e;)lt.push(le(lt)+" ");return lt[e]}function le(e){return e[e.length-1]}function me(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function m(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function M(){}function x(e,t){var n;return Object.create?n=Object.create(e):(M.prototype=e,n=new M),t&&V(t,n),n}var ue=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Qe(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||ue.test(e))}function Gt(e,t){return t?t.source.indexOf("\\w")>-1&&Qe(e)?!0:t.test(e):Qe(e)}function Kn(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var qt=/[\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 Pe(e){return e.charCodeAt(0)>=768&&qt.test(e)}function er(e,t,n){for(;(n<0?t>0:t<e.length)&&Pe(e.charAt(t));)t+=n;return t}function Ft(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function tr(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),a.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var gr=null;function rr(e,t,n){var r;gr=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:gr=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:gr=i)}return r!=null?r:gr}var wi=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,l=/[1n]/;function s(u,d,p){this.level=u,this.from=d,this.to=p}return function(u,d){var p=d=="ltr"?"L":"R";if(u.length==0||d=="ltr"&&!r.test(u))return!1;for(var g=u.length,v=[],b=0;b<g;++b)v.push(n(u.charCodeAt(b)));for(var S=0,L=p;S<g;++S){var N=v[S];N=="m"?v[S]=L:L=N}for(var W=0,A=p;W<g;++W){var P=v[W];P=="1"&&A=="r"?v[W]="n":o.test(P)&&(A=P,P=="r"&&(v[W]="R"))}for(var K=1,B=v[0];K<g-1;++K){var $=v[K];$=="+"&&B=="1"&&v[K+1]=="1"?v[K]="1":$==","&&B==v[K+1]&&(B=="1"||B=="n")&&(v[K]=B),B=$}for(var ye=0;ye<g;++ye){var je=v[ye];if(je==",")v[ye]="N";else if(je=="%"){var ke=void 0;for(ke=ye+1;ke<g&&v[ke]=="%";++ke);for(var bt=ye&&v[ye-1]=="!"||ke<g&&v[ke]=="1"?"1":"N",dt=ye;dt<ke;++dt)v[dt]=bt;ye=ke-1}}for(var ze=0,ht=p;ze<g;++ze){var Ze=v[ze];ht=="L"&&Ze=="1"?v[ze]="L":o.test(Ze)&&(ht=Ze)}for(var Re=0;Re<g;++Re)if(i.test(v[Re])){var He=void 0;for(He=Re+1;He<g&&i.test(v[He]);++He);for(var Te=(Re?v[Re-1]:p)=="L",pt=(He<g?v[He]:p)=="L",$r=Te==pt?Te?"L":"R":p,vr=Re;vr<He;++vr)v[vr]=$r;Re=He-1}for(var tt=[],_t,Xe=0;Xe<g;)if(a.test(v[Xe])){var go=Xe;for(++Xe;Xe<g&&a.test(v[Xe]);++Xe);tt.push(new s(0,go,Xe))}else{var $t=Xe,Tr=tt.length,Mr=d=="rtl"?1:0;for(++Xe;Xe<g&&v[Xe]!="L";++Xe);for(var it=$t;it<Xe;)if(l.test(v[it])){$t<it&&(tt.splice(Tr,0,new s(1,$t,it)),Tr+=Mr);var en=it;for(++it;it<Xe&&l.test(v[it]);++it);tt.splice(Tr,0,new s(2,en,it)),Tr+=Mr,$t=it}else++it;$t<Xe&&tt.splice(Tr,0,new s(1,$t,Xe))}return d=="ltr"&&(tt[0].level==1&&(_t=u.match(/^\s+/))&&(tt[0].from=_t[0].length,tt.unshift(new s(0,0,_t[0].length))),le(tt).level==1&&(_t=u.match(/\s+$/))&&(le(tt).to-=_t[0].length,tt.push(new s(0,g-_t[0].length,g)))),d=="rtl"?tt.reverse():tt}}();function ae(e,t){var n=e.order;return n==null&&(n=e.order=wi(e.text,t)),n}var _n=[],R=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||_n).concat(n)}};function jt(e,t){return e._handlers&&e._handlers[t]||_n}function Ve(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=I(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Se(e,t){var n=jt(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Ce(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Se(e,n||t.type,e,t),st(t)||t.codemirrorIgnore}function Ct(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)I(n,t[r])==-1&&n.push(t[r])}function mt(e,t){return jt(e,t).length>0}function Nt(e){e.prototype.on=function(t,n){R(this,t,n)},e.prototype.off=function(t,n){Ve(this,t,n)}}function $e(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Nr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function st(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function nr(e){$e(e),Nr(e)}function rn(e){return e.target||e.srcElement}function At(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),pe&&e.ctrlKey&&t==1&&(t=3),t}var ki=function(){if(H&&te<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),Ar;function Un(e){if(Ar==null){var t=c("span","");z(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ar=t.offsetWidth<=1&&t.offsetHeight>2&&!(H&&te<8))}var n=Ar?c("span",""):c("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var nn;function ir(e){if(nn!=null)return nn;var t=z(e,document.createTextNode("AخA")),n=T(t,0,1).getBoundingClientRect(),r=T(t,1,2).getBoundingClientRect();return k(e),!n||n.left==n.right?!1:nn=r.right-n.right<3}var Lt=`
- b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
- `,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),a=o.indexOf("\r");a!=-1?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},or=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Gn=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Dt=null;function Si(e){if(Dt!=null)return Dt;var t=z(e,c("span","x")),n=t.getBoundingClientRect(),r=T(t,0,1).getBoundingClientRect();return Dt=Math.abs(n.left-r.left)>1}var Dr={},Ot={};function Wt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Dr[e]=t}function mr(e,t){Ot[e]=t}function Or(e){if(typeof e=="string"&&Ot.hasOwnProperty(e))e=Ot[e];else if(e&&typeof e.name=="string"&&Ot.hasOwnProperty(e.name)){var t=Ot[e.name];typeof t=="string"&&(t={name:t}),e=x(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Or("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Or("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Wr(e,t){t=Or(t);var n=Dr[t.name];if(!n)return Wr(e,"text/plain");var r=n(e,t);if(ar.hasOwnProperty(t.name)){var i=ar[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var ar={};function Pr(e,t){var n=ar.hasOwnProperty(e)?ar[e]:ar[e]={};V(t,n)}function It(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 on(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 zr(e,t,n){return e.startState?e.startState(t,n):!0}var Le=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};Le.prototype.eol=function(){return this.pos>=this.string.length},Le.prototype.sol=function(){return this.pos==this.lineStart},Le.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Le.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Le.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},Le.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Le.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Le.prototype.skipToEnd=function(){this.pos=this.string.length},Le.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Le.prototype.backUp=function(e){this.pos-=e},Le.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=se(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?se(this.string,this.lineStart,this.tabSize):0)},Le.prototype.indentation=function(){return se(this.string,null,this.tabSize)-(this.lineStart?se(this.string,this.lineStart,this.tabSize):0)},Le.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(a){return n?a.toLowerCase():a},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var o=this.string.slice(this.pos).match(e);return o&&o.index>0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},Le.prototype.current=function(){return this.string.slice(this.start,this.pos)},Le.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Le.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Le.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function F(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function Xt(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(o){var a=o.text;i==n.line&&(a=a.slice(0,n.ch)),i==t.line&&(a=a.slice(t.ch)),r.push(a),++i}),r}function an(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function kt(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function f(e){if(e.parent==null)return null;for(var t=e.parent,n=I(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function h(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var l=e.lines[a],s=l.height;if(t<s)break;t-=s}return n+a}function w(e,t){return t>=e.first&&t<e.first+e.size}function C(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function y(e,t,n){if(n===void 0&&(n=null),!(this instanceof y))return new y(e,t,n);this.line=e,this.ch=t,this.sticky=n}function D(e,t){return e.line-t.line||e.ch-t.ch}function de(e,t){return e.sticky==t.sticky&&D(e,t)==0}function _e(e){return y(e.line,e.ch)}function ut(e,t){return D(e,t)<0?t:e}function Hr(e,t){return D(e,t)<0?e:t}function yo(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Z(e,t){if(t.line<e.first)return y(e.first,0);var n=e.first+e.size-1;return t.line>n?y(n,F(e,n).text.length):Cl(t,F(e,t.line).text.length)}function Cl(e,t){var n=e.ch;return n==null||n>t?y(e.line,t):n<0?y(e.line,0):e}function bo(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=Z(e,t[r]);return n}var qn=function(e,t){this.state=e,this.lookAhead=t},Bt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Bt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Bt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Bt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Bt.fromSaved=function(e,t,n){return t instanceof qn?new Bt(e,It(e.mode,t.state),n,t.lookAhead):new Bt(e,It(e.mode,t),n)},Bt.prototype.save=function(e){var t=e!==!1?It(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new qn(t,this.maxLookAhead):t};function xo(e,t,n,r){var i=[e.state.modeGen],o={};To(e,t.text,e.doc.mode,n,function(u,d){return i.push(u,d)},o,r);for(var a=n.state,l=function(u){n.baseTokens=i;var d=e.state.overlays[u],p=1,g=0;n.state=!0,To(e,t.text,d.mode,n,function(v,b){for(var S=p;g<v;){var L=i[p];L>v&&i.splice(p,1,v,i[p+1],L),p+=2,g=Math.min(v,L)}if(b)if(d.opaque)i.splice(S,p-S,v,"overlay "+b),p=S+2;else for(;S<p;S+=2){var N=i[S+1];i[S+1]=(N?N+" ":"")+"overlay "+b}},o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)l(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function wo(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=ln(e,f(t)),i=t.text.length>e.options.maxHighlightLength&&It(e.doc.mode,r.state),o=xo(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 ln(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Bt(r,!0,t);var o=Ll(e,t,n),a=o>r.first&&F(r,o-1).stateAfter,l=a?Bt.fromSaved(r,a,o):new Bt(r,zr(r.mode),o);return r.iter(o,t,function(s){Ci(e,s.text,l);var u=l.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&u<i.viewTo?l.save():null,l.nextLine()}),n&&(r.modeFrontier=l.line),l}function Ci(e,t,n,r){var i=e.doc.mode,o=new Le(t,e.options.tabSize,n);for(o.start=o.pos=r||0,t==""&&ko(i,n.state);!o.eol();)Li(i,o,n.state),o.start=o.pos}function ko(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=on(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function Li(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=on(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var So=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Co(e,t,n,r){var i=e.doc,o=i.mode,a;t=Z(i,t);var l=F(i,t.line),s=ln(e,t.line,n),u=new Le(l.text,e.options.tabSize,s),d;for(r&&(d=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,a=Li(o,u,s.state),r&&d.push(new So(u,a,It(i.mode,s.state)));return r?d:new So(u,a,s.state)}function Lo(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function To(e,t,n,r,i,o,a){var l=n.flattenSpans;l==null&&(l=e.options.flattenSpans);var s=0,u=null,d=new Le(t,e.options.tabSize,r),p,g=e.options.addModeClass&&[null];for(t==""&&Lo(ko(n,r.state),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(l=!1,a&&Ci(e,t,r,d.pos),d.pos=t.length,p=null):p=Lo(Li(n,d,r.state,g),o),g){var v=g[0].name;v&&(p="m-"+(p?v+" "+p:v))}if(!l||u!=p){for(;s<d.start;)s=Math.min(d.start,s+5e3),i(s,u);u=p}d.start=d.pos}for(;s<d.pos;){var b=Math.min(d.pos,s+5e3);i(b,u),s=b}}function Ll(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=F(o,l-1),u=s.stateAfter;if(u&&(!n||l+(u instanceof qn?u.lookAhead:0)<=o.modeFrontier))return l;var d=se(s.text,null,e.options.tabSize);(i==null||r>d)&&(i=l-1,r=d)}return i}function Tl(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=F(e,r).stateAfter;if(i&&(!(i instanceof qn)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var Mo=!1,Yt=!1;function Ml(){Mo=!0}function Nl(){Yt=!0}function jn(e,t,n){this.marker=e,this.from=t,this.to=n}function sn(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Al(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Dl(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function Ol(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=o.from==null||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&a.type=="bookmark"&&(!n||!o.marker.insertLeft)){var s=o.to==null||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new jn(a,o.from,s?null:o.to))}}return r}function Wl(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=o.to==null||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&a.type=="bookmark"&&(!n||o.marker.insertLeft)){var s=o.from==null||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new jn(a,s?null:o.from-t,o.to==null?null:o.to-t))}}return r}function Ti(e,t){if(t.full)return null;var n=w(e,t.from.line)&&F(e,t.from.line).markedSpans,r=w(e,t.to.line)&&F(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=D(t.from,t.to)==0,l=Ol(n,i,a),s=Wl(r,o,a),u=t.text.length==1,d=le(t.text).length+(u?i:0);if(l)for(var p=0;p<l.length;++p){var g=l[p];if(g.to==null){var v=sn(s,g.marker);v?u&&(g.to=v.to==null?null:v.to+d):g.to=i}}if(s)for(var b=0;b<s.length;++b){var S=s[b];if(S.to!=null&&(S.to+=d),S.from==null){var L=sn(l,S.marker);L||(S.from=d,u&&(l||(l=[])).push(S))}else S.from+=d,u&&(l||(l=[])).push(S)}l&&(l=No(l)),s&&s!=l&&(s=No(s));var N=[l];if(!u){var W=t.text.length-2,A;if(W>0&&l)for(var P=0;P<l.length;++P)l[P].to==null&&(A||(A=[])).push(new jn(l[P].marker,null,null));for(var K=0;K<W;++K)N.push(A);N.push(s)}return N}function No(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Pl(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(v){if(v.markedSpans)for(var b=0;b<v.markedSpans.length;++b){var S=v.markedSpans[b].marker;S.readOnly&&(!r||I(r,S)==-1)&&(r||(r=[])).push(S)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],l=a.find(0),s=0;s<i.length;++s){var u=i[s];if(!(D(u.to,l.from)<0||D(u.from,l.to)>0)){var d=[s,1],p=D(u.from,l.from),g=D(u.to,l.to);(p<0||!a.inclusiveLeft&&!p)&&d.push({from:u.from,to:l.from}),(g>0||!a.inclusiveRight&&!g)&&d.push({from:l.to,to:u.to}),i.splice.apply(i,d),s+=d.length-3}}return i}function Ao(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Do(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Xn(e){return e.inclusiveLeft?-1:0}function Yn(e){return e.inclusiveRight?1:0}function Mi(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),o=D(r.from,i.from)||Xn(e)-Xn(t);if(o)return-o;var a=D(r.to,i.to)||Yn(e)-Yn(t);return a||t.id-e.id}function Oo(e,t){var n=Yt&&e.markedSpans,r;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||Mi(r,i.marker)<0)&&(r=i.marker);return r}function Wo(e){return Oo(e,!0)}function Zn(e){return Oo(e,!1)}function zl(e,t){var n=Yt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!r||Mi(r,o.marker)<0)&&(r=o.marker)}return r}function Po(e,t,n,r,i){var o=F(e,t),a=Yt&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var u=s.marker.find(0),d=D(u.from,n)||Xn(s.marker)-Xn(i),p=D(u.to,r)||Yn(s.marker)-Yn(i);if(!(d>=0&&p<=0||d<=0&&p>=0)&&(d<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?D(u.to,n)>=0:D(u.to,n)>0)||d>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?D(u.from,r)<=0:D(u.from,r)<0)))return!0}}}function Pt(e){for(var t;t=Wo(e);)e=t.find(-1,!0).line;return e}function Hl(e){for(var t;t=Zn(e);)e=t.find(1,!0).line;return e}function El(e){for(var t,n;t=Zn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Ni(e,t){var n=F(e,t),r=Pt(n);return n==r?t:f(r)}function zo(e,t){if(t>e.lastLine())return t;var n=F(e,t),r;if(!lr(e,n))return t;for(;r=Zn(n);)n=r.find(1,!0).line;return f(n)+1}function lr(e,t){var n=Yt&&t.markedSpans;if(n){for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&Ai(e,t,r))return!0}}}function Ai(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return Ai(e,r.line,sn(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Ai(e,t,i))return!0}function Zt(e){e=Pt(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==n)break;t+=l.height}return t}function Jn(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=Wo(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=Zn(r);){var o=n.find(0,!0);t-=r.text.length-o.from.ch,r=o.to.line,t+=r.text.length-o.to.ch}return t}function Di(e){var t=e.display,n=e.doc;t.maxLine=F(n,n.first),t.maxLineLength=Jn(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=Jn(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Er=function(e,t,n){this.text=e,Do(this,t),this.height=n?n(this):1};Er.prototype.lineNo=function(){return f(this)},Nt(Er);function Fl(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ao(e),Do(e,n);var i=r?r(e):1;i!=e.height&&kt(e,i)}function Il(e){e.parent=null,Ao(e)}var Bl={},Rl={};function Ho(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Rl:Bl;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Eo(e,t){var n=O("span",null,null,q?"padding-right: .1px":null),r={pre:O("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=_l,ir(e.display.measure)&&(a=ae(o,e.doc.direction))&&(r.addToken=Gl(r.addToken,a)),r.map=[];var l=t!=e.display.externalMeasured&&f(o);ql(o,r,wo(e,o,l)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=Tt(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=Tt(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Un(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(q){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 Se(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Tt(r.pre.className,r.textClass||"")),r}function Kl(e){var t=c("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function _l(e,t,n,r,i,o,a){if(t){var l=e.splitSpaces?Ul(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,d;if(!s.test(t))e.col+=t.length,d=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,d),H&&te<9&&(u=!0),e.pos+=t.length;else{d=document.createDocumentFragment();for(var p=0;;){s.lastIndex=p;var g=s.exec(t),v=g?g.index-p:t.length-p;if(v){var b=document.createTextNode(l.slice(p,p+v));H&&te<9?d.appendChild(c("span",[b])):d.appendChild(b),e.map.push(e.pos,e.pos+v,b),e.col+=v,e.pos+=v}if(!g)break;p+=v+1;var S=void 0;if(g[0]==" "){var L=e.cm.options.tabSize,N=L-e.col%L;S=d.appendChild(c("span",wt(N),"cm-tab")),S.setAttribute("role","presentation"),S.setAttribute("cm-text"," "),e.col+=N}else g[0]=="\r"||g[0]==`
- `?(S=d.appendChild(c("span",g[0]=="\r"?"␍":"","cm-invalidchar")),S.setAttribute("cm-text",g[0]),e.col+=1):(S=e.cm.options.specialCharPlaceholder(g[0]),S.setAttribute("cm-text",g[0]),H&&te<9?d.appendChild(c("span",[S])):d.appendChild(S),e.col+=1);e.map.push(e.pos,e.pos+1,S),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||u||o||a){var W=n||"";r&&(W+=r),i&&(W+=i);var A=c("span",[d],W,o);if(a)for(var P in a)a.hasOwnProperty(P)&&P!="style"&&P!="class"&&A.setAttribute(P,a[P]);return e.content.appendChild(A)}e.content.appendChild(d)}}function Ul(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);o==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(o=" "),r+=o,n=o==" "}return r}function Gl(e,t){return function(n,r,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,d=u+r.length;;){for(var p=void 0,g=0;g<t.length&&(p=t[g],!(p.to>u&&p.from<=u));g++);if(p.to>=d)return e(n,r,i,o,a,l,s);e(n,r.slice(0,p.to-u),i,o,null,l,s),o=null,r=r.slice(p.to-u),u=p.to}}}function Fo(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 ql(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var a=1;a<n.length;a+=2)t.addToken(t,i.slice(o,o=n[a]),Ho(n[a+1],t.cm.options));return}for(var l=i.length,s=0,u=1,d="",p,g,v=0,b,S,L,N,W;;){if(v==s){b=S=L=g="",W=null,N=null,v=1/0;for(var A=[],P=void 0,K=0;K<r.length;++K){var B=r[K],$=B.marker;if($.type=="bookmark"&&B.from==s&&$.widgetNode)A.push($);else if(B.from<=s&&(B.to==null||B.to>s||$.collapsed&&B.to==s&&B.from==s)){if(B.to!=null&&B.to!=s&&v>B.to&&(v=B.to,S=""),$.className&&(b+=" "+$.className),$.css&&(g=(g?g+";":"")+$.css),$.startStyle&&B.from==s&&(L+=" "+$.startStyle),$.endStyle&&B.to==v&&(P||(P=[])).push($.endStyle,B.to),$.title&&((W||(W={})).title=$.title),$.attributes)for(var ye in $.attributes)(W||(W={}))[ye]=$.attributes[ye];$.collapsed&&(!N||Mi(N.marker,$)<0)&&(N=B)}else B.from>s&&v>B.from&&(v=B.from)}if(P)for(var je=0;je<P.length;je+=2)P[je+1]==v&&(S+=" "+P[je]);if(!N||N.from==s)for(var ke=0;ke<A.length;++ke)Fo(t,0,A[ke]);if(N&&(N.from||0)==s){if(Fo(t,(N.to==null?l+1:N.to)-s,N.marker,N.from==null),N.to==null)return;N.to==s&&(N=!1)}}if(s>=l)break;for(var bt=Math.min(l,v);;){if(d){var dt=s+d.length;if(!N){var ze=dt>bt?d.slice(0,bt-s):d;t.addToken(t,ze,p?p+b:b,L,s+ze.length==v?S:"",g,W)}if(dt>=bt){d=d.slice(bt-s),s=bt;break}s=dt,L=""}d=i.slice(o,o=n[u++]),p=Ho(n[u++],t.cm.options)}}}function Io(e,t,n){this.line=t,this.rest=El(t),this.size=this.rest?f(le(this.rest))-n+1:1,this.node=this.text=null,this.hidden=lr(e,t)}function Qn(e,t,n){for(var r=[],i,o=t;o<n;o=i){var a=new Io(e.doc,F(e.doc,o),o);i=o+a.size,r.push(a)}return r}var Fr=null;function jl(e){Fr?Fr.ops.push(e):e.ownsGroup=Fr={ops:[e],delayedCallbacks:[]}}function Xl(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function Yl(e,t){var n=e.ownsGroup;if(n)try{Xl(n)}finally{Fr=null,t(n)}}var un=null;function Ue(e,t){var n=jt(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;Fr?i=Fr.delayedCallbacks:un?i=un:(i=un=[],setTimeout(Zl,0));for(var o=function(l){i.push(function(){return n[l].apply(null,r)})},a=0;a<n.length;++a)o(a)}}function Zl(){var e=un;un=null;for(var t=0;t<e.length;++t)e[t]()}function Bo(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];o=="text"?Ql(e,t):o=="gutter"?Ko(e,t,n,r):o=="class"?Oi(e,t):o=="widget"&&Vl(e,t,r)}t.changes=null}function fn(e){return e.node==e.text&&(e.node=c("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),H&&te<8&&(e.node.style.zIndex=2)),e.node}function Jl(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=fn(t);t.background=r.insertBefore(c("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Ro(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Eo(e,t)}function Ql(e,t){var n=t.text.className,r=Ro(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Oi(e,t)):n&&(t.text.className=n)}function Oi(e,t){Jl(e,t),t.line.wrapClass?fn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Ko(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=fn(t);t.gutterBackground=c("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=fn(t),l=t.gutter=c("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(l.setAttribute("aria-hidden","true"),e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])&&(t.lineNumber=l.appendChild(c("div",C(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,d=o.hasOwnProperty(u)&&o[u];d&&l.appendChild(c("div",[d],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function Vl(e,t,n){t.alignable&&(t.alignable=null);for(var r=G("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);_o(e,t,n)}function $l(e,t,n,r){var i=Ro(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Oi(e,t),Ko(e,t,n,r),_o(e,t,r),t.node}function _o(e,t,n){if(Uo(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Uo(e,t.rest[r],t,n,!1)}function Uo(e,t,n,r,i){if(t.widgets)for(var o=fn(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],u=c("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),es(s,u,n,r),e.display.input.setUneditable(u),i&&s.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),Ue(s,"redraw")}}function es(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function cn(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!U(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),z(t.display.measure,c("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Jt(e,t){for(var n=rn(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Vn(e){return e.lineSpace.offsetTop}function Wi(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Go(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=z(e.measure,c("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Rt(e){return Ye-e.display.nativeBarWidth}function yr(e){return e.display.scroller.clientWidth-Rt(e)-e.display.barWidth}function Pi(e){return e.display.scroller.clientHeight-Rt(e)-e.display.barHeight}function ts(e,t,n){var r=e.options.lineWrapping,i=r&&yr(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],u=a[l+1];Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function qo(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(f(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function rs(e,t){t=Pt(t);var n=f(t),r=e.display.externalMeasured=new Io(e.doc,t,n);r.lineN=n;var i=r.built=Eo(e,r);return r.text=i.pre,z(e.display.lineMeasure,i.pre),r}function jo(e,t,n,r){return Kt(e,Ir(e,t),n,r)}function zi(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[wr(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Ir(e,t){var n=f(t),r=zi(e,n);r&&!r.text?r=null:r&&r.changes&&(Bo(e,r,n,Bi(e)),e.curOp.forceUpdate=!0),r||(r=rs(e,t));var i=qo(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Kt(e,t,n,r,i){t.before&&(n=-1);var o=n+(r||""),a;return t.cache.hasOwnProperty(o)?a=t.cache[o]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(ts(e,t.view,t.rect),t.hasHeights=!0),a=is(e,t,n,r),a.bogus||(t.cache[o]=a)),{left:a.left,right:a.right,top:i?a.rtop:a.top,bottom:i?a.rbottom:a.bottom}}var Xo={left:0,right:0,top:0,bottom:0};function Yo(e,t,n){for(var r,i,o,a,l,s,u=0;u<e.length;u+=3)if(l=e[u],s=e[u+1],t<l?(i=0,o=1,a="left"):t<s?(i=t-l,o=i+1):(u==e.length-3||t==s&&e[u+3]>t)&&(o=s-l,i=o-1,t>=s&&(a="right")),i!=null){if(r=e[u+2],l==s&&n==(r.insertLeft?"left":"right")&&(a=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],a="left";if(n=="right"&&i==s-l)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function ns(e,t){var n=Xo;if(t=="left")for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function is(e,t,n,r){var i=Yo(t.map,n,r),o=i.node,a=i.start,l=i.end,s=i.collapse,u;if(o.nodeType==3){for(var d=0;d<4;d++){for(;a&&Pe(t.line.text.charAt(i.coverStart+a));)--a;for(;i.coverStart+l<i.coverEnd&&Pe(t.line.text.charAt(i.coverStart+l));)++l;if(H&&te<9&&a==0&&l==i.coverEnd-i.coverStart?u=o.parentNode.getBoundingClientRect():u=ns(T(o,a,l).getClientRects(),r),u.left||u.right||a==0)break;l=a,a=a-1,s="right"}H&&te<11&&(u=os(e.display.measure,u))}else{a>0&&(s=r="right");var p;e.options.lineWrapping&&(p=o.getClientRects()).length>1?u=p[r=="right"?p.length-1:0]:u=o.getBoundingClientRect()}if(H&&te<9&&!a&&(!u||!u.left&&!u.right)){var g=o.parentNode.getClientRects()[0];g?u={left:g.left,right:g.left+Rr(e.display),top:g.top,bottom:g.bottom}:u=Xo}for(var v=u.top-t.rect.top,b=u.bottom-t.rect.top,S=(v+b)/2,L=t.view.measure.heights,N=0;N<L.length-1&&!(S<L[N]);N++);var W=N?L[N-1]:0,A=L[N],P={left:(s=="right"?u.right:u.left)-t.rect.left,right:(s=="left"?u.left:u.right)-t.rect.left,top:W,bottom:A};return!u.left&&!u.right&&(P.bogus=!0),e.options.singleCursorHeightPerLine||(P.rtop=v,P.rbottom=b),P}function os(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Si(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function Zo(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Jo(e){e.display.externalMeasure=null,k(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Zo(e.display.view[t])}function dn(e){Jo(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Qo(e){return _&&J?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function Vo(e){return _&&J?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function Hi(e){var t=Pt(e),n=t.widgets,r=0;if(n)for(var i=0;i<n.length;++i)n[i].above&&(r+=cn(n[i]));return r}function $n(e,t,n,r,i){if(!i){var o=Hi(t);n.top+=o,n.bottom+=o}if(r=="line")return n;r||(r="local");var a=Zt(t);if(r=="local"?a+=Vn(e.display):a-=e.display.viewOffset,r=="page"||r=="window"){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+(r=="window"?0:Vo(rt(e)));var s=l.left+(r=="window"?0:Qo(rt(e)));n.left+=s,n.right+=s}return n.top+=a,n.bottom+=a,n}function $o(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=Qo(rt(e)),i-=Vo(rt(e));else if(n=="local"||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function ei(e,t,n,r,i){return r||(r=F(e.doc,t.line)),$n(e,r,jo(e,r,t.ch,i),n)}function zt(e,t,n,r,i,o){r=r||F(e.doc,t.line),i||(i=Ir(e,r));function a(b,S){var L=Kt(e,i,b,S?"right":"left",o);return S?L.left=L.right:L.right=L.left,$n(e,r,L,n)}var l=ae(r,e.doc.direction),s=t.ch,u=t.sticky;if(s>=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!l)return a(u=="before"?s-1:s,u=="before");function d(b,S,L){var N=l[S],W=N.level==1;return a(L?b-1:b,W!=L)}var p=rr(l,s,u),g=gr,v=d(s,p,u=="before");return g!=null&&(v.other=d(s,g,u!="before")),v}function ea(e,t){var n=0;t=Z(e.doc,t),e.options.lineWrapping||(n=Rr(e.display)*t.ch);var r=F(e.doc,t.line),i=Zt(r)+Vn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Ei(e,t,n,r,i){var o=y(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Fi(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Ei(r.first,0,null,-1,-1);var i=h(r,n),o=r.first+r.size-1;if(i>o)return Ei(r.first+r.size-1,F(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=F(r,i);;){var l=as(e,a,i,t,n),s=zl(a,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var u=s.find(1);if(u.line==i)return u;a=F(r,i=u.line)}}function ta(e,t,n,r){r-=Hi(t);var i=t.text.length,o=Ft(function(a){return Kt(e,n,a-1).bottom<=r},i,0);return i=Ft(function(a){return Kt(e,n,a).top>r},o,i),{begin:o,end:i}}function ra(e,t,n,r){n||(n=Ir(e,t));var i=$n(e,t,Kt(e,n,r),"line").top;return ta(e,t,n,i)}function Ii(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function as(e,t,n,r,i){i-=Zt(t);var o=Ir(e,t),a=Hi(t),l=0,s=t.text.length,u=!0,d=ae(t,e.doc.direction);if(d){var p=(e.options.lineWrapping?ss:ls)(e,t,n,o,d,r,i);u=p.level!=1,l=u?p.from:p.to-1,s=u?p.to:p.from-1}var g=null,v=null,b=Ft(function(K){var B=Kt(e,o,K);return B.top+=a,B.bottom+=a,Ii(B,r,i,!1)?(B.top<=i&&B.left<=r&&(g=K,v=B),!0):!1},l,s),S,L,N=!1;if(v){var W=r-v.left<v.right-r,A=W==u;b=g+(A?0:1),L=A?"after":"before",S=W?v.left:v.right}else{!u&&(b==s||b==l)&&b++,L=b==0?"after":b==t.text.length?"before":Kt(e,o,b-(u?1:0)).bottom+a<=i==u?"after":"before";var P=zt(e,y(n,b,L),"line",t,o);S=P.left,N=i<P.top?-1:i>=P.bottom?1:0}return b=er(t.text,b,1),Ei(n,b,L,N,r-S)}function ls(e,t,n,r,i,o,a){var l=Ft(function(p){var g=i[p],v=g.level!=1;return Ii(zt(e,y(n,v?g.to:g.from,v?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),s=i[l];if(l>0){var u=s.level!=1,d=zt(e,y(n,u?s.from:s.to,u?"after":"before"),"line",t,r);Ii(d,o,a,!0)&&d.top>a&&(s=i[l-1])}return s}function ss(e,t,n,r,i,o,a){var l=ta(e,t,r,a),s=l.begin,u=l.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var d=null,p=null,g=0;g<i.length;g++){var v=i[g];if(!(v.from>=u||v.to<=s)){var b=v.level!=1,S=Kt(e,r,b?Math.min(u,v.to)-1:Math.max(s,v.from)).right,L=S<o?o-S+1e9:S-o;(!d||p>L)&&(d=v,p=L)}}return d||(d=i[i.length-1]),d.from<s&&(d={from:s,to:d.to,level:d.level}),d.to>u&&(d={from:d.from,to:u,level:d.level}),d}var br;function Br(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(br==null){br=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)br.appendChild(document.createTextNode("x")),br.appendChild(c("br"));br.appendChild(document.createTextNode("x"))}z(e.measure,br);var n=br.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),k(e.measure),n||1}function Rr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),n=c("pre",[t],"CodeMirror-line-like");z(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Bi(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var l=e.display.gutterSpecs[a].className;n[l]=o.offsetLeft+o.clientLeft+i,r[l]=o.clientWidth}return{fixedPos:Ri(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ri(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function na(e){var t=Br(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Rr(e.display)-3);return function(i){if(lr(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function Ki(e){var t=e.doc,n=na(e);t.iter(function(r){var i=n(r);i!=r.height&&kt(r,i)})}function xr(e,t,n,r){var i=e.display;if(!n&&rn(t).getAttribute("cm-not-content")=="true")return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(p){return null}var s=Fi(e,o,a),u;if(r&&s.xRel>0&&(u=F(e.doc,s.line).text).length==s.ch){var d=se(u,u.length,e.options.tabSize)-u.length;s=y(s.line,Math.max(0,Math.round((o-Go(e.display).left)/Rr(e.display))-d))}return s}function wr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function ft(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Yt&&Ni(e.doc,t)<i.viewTo&&ur(e);else if(n<=i.viewFrom)Yt&&zo(e.doc,n+r)>i.viewFrom?ur(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)ur(e);else if(t<=i.viewFrom){var o=ti(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):ur(e)}else if(n>=i.viewTo){var a=ti(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):ur(e)}else{var l=ti(e,t,t,-1),s=ti(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Qn(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):ur(e)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(i.externalMeasured=null))}function sr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[wr(e,t)];if(o.node!=null){var a=o.changes||(o.changes=[]);I(a,n)==-1&&a.push(n)}}}function ur(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ti(e,t,n,r){var i=wr(e,t),o,a=e.display.view;if(!Yt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var l=e.display.viewFrom,s=0;s<i;s++)l+=a[s].size;if(l!=t){if(r>0){if(i==a.length-1)return null;o=l+a[i].size-t,i++}else o=l-t;t+=o,n+=o}for(;Ni(e.doc,n)!=n;){if(i==(r<0?0:a.length-1))return null;n+=r*a[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function us(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Qn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Qn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(wr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Qn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,wr(e,n)))),r.viewTo=n}function ia(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function hn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function oa(e,t){t===void 0&&(t=!0);var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=e.options.$customCursor;a&&(t=!0);for(var l=0;l<n.sel.ranges.length;l++)if(!(!t&&l==n.sel.primIndex)){var s=n.sel.ranges[l];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var u=s.empty();if(a){var d=a(e,s);d&&_i(e,d,i)}else(u||e.options.showCursorWhenSelecting)&&_i(e,s.head,i);u||fs(e,s,o)}}return r}function _i(e,t,n){var r=zt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(c("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var o=ei(e,t,"div",null,null),a=o.right-o.left;i.style.width=(a>0?a:e.defaultCharWidth())+"px"}if(r.other){var l=n.appendChild(c("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));l.style.display="",l.style.left=r.other.left+"px",l.style.top=r.other.top+"px",l.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function ri(e,t){return e.top-t.top||e.left-t.left}function fs(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=Go(e.display),l=a.left,s=Math.max(r.sizerWidth,yr(e)-r.sizer.offsetLeft)-a.right,u=i.direction=="ltr";function d(A,P,K,B){P<0&&(P=0),P=Math.round(P),B=Math.round(B),o.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+A+`px;
- top: `+P+"px; width: "+(K==null?s-A:K)+`px;
- height: `+(B-P)+"px"))}function p(A,P,K){var B=F(i,A),$=B.text.length,ye,je;function ke(ze,ht){return ei(e,y(A,ze),"div",B,ht)}function bt(ze,ht,Ze){var Re=ra(e,B,null,ze),He=ht=="ltr"==(Ze=="after")?"left":"right",Te=Ze=="after"?Re.begin:Re.end-(/\s/.test(B.text.charAt(Re.end-1))?2:1);return ke(Te,He)[He]}var dt=ae(B,i.direction);return tr(dt,P||0,K==null?$:K,function(ze,ht,Ze,Re){var He=Ze=="ltr",Te=ke(ze,He?"left":"right"),pt=ke(ht-1,He?"right":"left"),$r=P==null&&ze==0,vr=K==null&&ht==$,tt=Re==0,_t=!dt||Re==dt.length-1;if(pt.top-Te.top<=3){var Xe=(u?$r:vr)&&tt,go=(u?vr:$r)&&_t,$t=Xe?l:(He?Te:pt).left,Tr=go?s:(He?pt:Te).right;d($t,Te.top,Tr-$t,Te.bottom)}else{var Mr,it,en,mo;He?(Mr=u&&$r&&tt?l:Te.left,it=u?s:bt(ze,Ze,"before"),en=u?l:bt(ht,Ze,"after"),mo=u&&vr&&_t?s:pt.right):(Mr=u?bt(ze,Ze,"before"):l,it=!u&&$r&&tt?s:Te.right,en=!u&&vr&&_t?l:pt.left,mo=u?bt(ht,Ze,"after"):s),d(Mr,Te.top,it-Mr,Te.bottom),Te.bottom<pt.top&&d(l,Te.bottom,null,pt.top),d(en,pt.top,mo-en,pt.bottom)}(!ye||ri(Te,ye)<0)&&(ye=Te),ri(pt,ye)<0&&(ye=pt),(!je||ri(Te,je)<0)&&(je=Te),ri(pt,je)<0&&(je=pt)}),{start:ye,end:je}}var g=t.from(),v=t.to();if(g.line==v.line)p(g.line,g.ch,v.ch);else{var b=F(i,g.line),S=F(i,v.line),L=Pt(b)==Pt(S),N=p(g.line,g.ch,L?b.text.length+1:null).end,W=p(v.line,L?0:null,v.ch).start;L&&(N.top<W.top-2?(d(N.right,N.top,null,N.bottom),d(l,W.top,W.left,W.bottom)):d(N.right,N.top,W.left-N.right,N.bottom)),N.bottom<W.top&&d(l,N.bottom,null,W.top)}n.appendChild(o)}function Ui(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Kr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function aa(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||qi(e))}function Gi(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Kr(e))},100)}function qi(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Se(e,"focus",e,t),e.state.focused=!0,Ae(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),q&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ui(e))}function Kr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Se(e,"blur",e,t),e.state.focused=!1,we(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function ni(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,a=0;a<t.view.length;a++){var l=t.view[a],s=e.options.lineWrapping,u=void 0,d=0;if(!l.hidden){if(i+=l.line.height,H&&te<8){var p=l.node.offsetTop+l.node.offsetHeight;u=p-n,n=p}else{var g=l.node.getBoundingClientRect();u=g.bottom-g.top,!s&&l.text.firstChild&&(d=l.text.firstChild.getBoundingClientRect().right-g.left-1)}var v=l.line.height-u;if((v>.005||v<-.005)&&(i<r&&(o-=v),kt(l.line,u),la(l.line),l.rest))for(var b=0;b<l.rest.length;b++)la(l.rest[b]);if(d>e.display.sizerWidth){var S=Math.ceil(d/Rr(e.display));S>e.display.maxLineLength&&(e.display.maxLineLength=S,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function la(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function ii(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Vn(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,o=h(t,r),a=h(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;l<o?(o=l,a=h(t,Zt(F(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=h(t,Zt(F(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function cs(e,t){if(!Ce(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&&!Fe){var a=c("div","",null,`position: absolute;
- top: `+(t.top-n.viewOffset-Vn(e.display))+`px;
- height: `+(t.bottom-t.top+Rt(e)+n.barHeight)+`px;
- left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}}function ds(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?y(t.line,t.ch+1,"before"):t,t=t.ch?y(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,l=zt(e,t),s=!n||n==t?l:zt(e,n);i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-r,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+r};var u=ji(e,i),d=e.doc.scrollTop,p=e.doc.scrollLeft;if(u.scrollTop!=null&&(vn(e,u.scrollTop),Math.abs(e.doc.scrollTop-d)>1&&(a=!0)),u.scrollLeft!=null&&(kr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-p)>1&&(a=!0)),!a)break}return i}function hs(e,t){var n=ji(e,t);n.scrollTop!=null&&vn(e,n.scrollTop),n.scrollLeft!=null&&kr(e,n.scrollLeft)}function ji(e,t){var n=e.display,r=Br(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Pi(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Wi(n),s=t.top<r,u=t.bottom>l-r;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var d=Math.min(t.top,(u?l:t.bottom)-o);d!=i&&(a.scrollTop=d)}var p=e.options.fixedGutter?0:n.gutters.offsetWidth,g=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-p,v=yr(e)-n.gutters.offsetWidth,b=t.right-t.left>v;return b&&(t.right=t.left+v),t.left<10?a.scrollLeft=0:t.left<g?a.scrollLeft=Math.max(0,t.left+p-(b?0:10)):t.right>v+g-3&&(a.scrollLeft=t.right+(b?0:10)-v),a}function Xi(e,t){t!=null&&(oi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function _r(e){oi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function pn(e,t,n){(t!=null||n!=null)&&oi(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function ps(e,t){oi(e),e.curOp.scrollToPos=t}function oi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=ea(e,t.from),r=ea(e,t.to);sa(e,n,r,t.margin)}}function sa(e,t,n,r){var i=ji(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});pn(e,i.scrollLeft,i.scrollTop)}function vn(e,t){Math.abs(e.doc.scrollTop-t)<2||(ve||Zi(e,{top:t}),ua(e,t,!0),ve&&Zi(e),yn(e,100))}function ua(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 kr(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,pa(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function gn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Wi(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+Rt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Sr=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),R(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),R(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,H&&te<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Sr.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}},Sr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Sr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Sr.prototype.zeroWidthHack=function(){var e=pe&&!Ne?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Q,this.disableVert=new Q},Sr.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)},Sr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var mn=function(){};mn.prototype.update=function(){return{bottom:0,right:0}},mn.prototype.setScrollLeft=function(){},mn.prototype.setScrollTop=function(){},mn.prototype.clear=function(){};function Ur(e,t){t||(t=gn(e));var n=e.display.barWidth,r=e.display.barHeight;fa(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&ni(e),fa(e,gn(e)),n=e.display.barWidth,r=e.display.barHeight}function fa(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 ca={native:Sr,null:mn};function da(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&we(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ca[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),R(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"?kr(e,t):vn(e,t)},e),e.display.scrollbars.addClass&&Ae(e.display.wrapper,e.display.scrollbars.addClass)}var vs=0;function Cr(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:++vs,markArrays:null},jl(e.curOp)}function Lr(e){var t=e.curOp;t&&Yl(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;gs(n)})}function gs(e){for(var t=e.ops,n=0;n<t.length;n++)ms(t[n]);for(var r=0;r<t.length;r++)ys(t[r]);for(var i=0;i<t.length;i++)bs(t[i]);for(var o=0;o<t.length;o++)xs(t[o]);for(var a=0;a<t.length;a++)ws(t[a])}function ms(e){var t=e.cm,n=t.display;Ss(t),e.updateMaxLine&&Di(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ai(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ys(e){e.updatedDisplay=e.mustUpdate&&Yi(e.cm,e.update)}function bs(e){var t=e.cm,n=t.display;e.updatedDisplay&&ni(t),e.barMeasure=gn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=jo(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+Rt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-yr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function xs(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&kr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==fe(gt(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ur(t,e.barMeasure),e.updatedDisplay&&Qi(t,e.barMeasure),e.selectionChanged&&Ui(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&aa(e.cm)}function ws(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&ha(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&ua(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&kr(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=ds(t,Z(r,e.scrollToPos.from),Z(r,e.scrollToPos.to),e.scrollToPos.margin);cs(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||Se(o[l],"hide");if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&Se(a[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Se(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function yt(e,t){if(e.curOp)return t();Cr(e);try{return t()}finally{Lr(e)}}function Ge(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Cr(e);try{return t.apply(e,arguments)}finally{Lr(e)}}}function nt(e){return function(){if(this.curOp)return e.apply(this,arguments);Cr(this);try{return e.apply(this,arguments)}finally{Lr(this)}}}function qe(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Cr(t);try{return e.apply(this,arguments)}finally{Lr(t)}}}function yn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,j(ks,e))}function ks(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=ln(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength?It(t.mode,r.state):null,s=xo(e,o,r,!0);l&&(r.state=l),o.styles=s.styles;var u=o.styleClasses,d=s.classes;d?o.styleClasses=d:u&&(o.styleClasses=null);for(var p=!a||a.length!=o.styles.length||u!=d&&(!u||!d||u.bgClass!=d.bgClass||u.textClass!=d.textClass),g=0;!p&&g<a.length;++g)p=a[g]!=o.styles[g];p&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&Ci(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return yn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&yt(e,function(){for(var o=0;o<i.length;o++)sr(e,i[o],"text")})}}var ai=function(e,t,n){var r=e.display;this.viewport=t,this.visible=ii(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=yr(e),this.force=n,this.dims=Bi(e),this.events=[]};ai.prototype.signal=function(e,t){mt(e,t)&&this.events.push(arguments)},ai.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Se.apply(null,this.events[e])};function Ss(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Rt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Rt(e)+"px",t.scrollbarsClipped=!0)}function Cs(e){if(e.hasFocus())return null;var t=fe(gt(e));if(!t||!U(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=Y(e).getSelection();r.anchorNode&&r.extend&&U(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function Ls(e){if(!(!e||!e.activeElt||e.activeElt==fe(be(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&U(document.body,e.anchorNode)&&U(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}function Yi(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return ur(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&ia(e)==0)return!1;va(e)&&(ur(e),t.dims=Bi(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Yt&&(o=Ni(e.doc,o),a=zo(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;us(e,o,a),n.viewOffset=Zt(F(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=ia(e);if(!l&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=Cs(e);return s>4&&(n.lineDiv.style.display="none"),Ts(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Ls(u),k(n.cursorDiv),k(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,yn(e,400)),n.updateLineNumbers=null,!0}function ha(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==yr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Wi(e.display)-Pi(e),n.top)}),t.visible=ii(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=ii(e.display,e.doc,n));if(!Yi(e,t))break;ni(e);var i=gn(e);hn(e),Ur(e,i),Qi(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Zi(e,t){var n=new ai(e,t);if(Yi(e,n)){ni(e),ha(e,n);var r=gn(e);hn(e),Ur(e,r),Qi(e,r),n.finish()}}function Ts(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function l(b){var S=b.nextSibling;return q&&pe&&e.display.currentWheelTarget==b?b.style.display="none":b.parentNode.removeChild(b),S}for(var s=r.view,u=r.viewFrom,d=0;d<s.length;d++){var p=s[d];if(!p.hidden)if(!p.node||p.node.parentNode!=o){var g=$l(e,p,u,n);o.insertBefore(g,a)}else{for(;a!=p.node;)a=l(a);var v=i&&t!=null&&t<=u&&p.lineNumber;p.changes&&(I(p.changes,"gutter")>-1&&(v=!1),Bo(e,p,u,n)),v&&(k(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(C(e.options,u)))),a=p.node.nextSibling}u+=p.size}for(;a;)a=l(a)}function Ji(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Ue(e,"gutterChanged",e)}function Qi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Rt(e)+"px"}function pa(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Ri(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var l=n[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function va(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=C(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(c("div",[c("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Ji(e.display),!0}return!1}function Vi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],a=null;if(typeof o!="string"&&(a=o.style,o=o.className),o=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:o,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function ga(e){var t=e.gutters,n=e.gutterSpecs;k(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,l=t.appendChild(c("div",null,"CodeMirror-gutter "+o));a&&(l.style.cssText=a),o=="CodeMirror-linenumbers"&&(e.lineGutter=l,l.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Ji(e)}function bn(e){ga(e.display),ft(e),pa(e)}function Ms(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=c("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=c("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=O("div",null,"CodeMirror-code"),i.selectionDiv=c("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=c("div",null,"CodeMirror-cursors"),i.measure=c("div",null,"CodeMirror-measure"),i.lineMeasure=c("div",null,"CodeMirror-measure"),i.lineSpace=O("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=O("div",[i.lineSpace],"CodeMirror-lines");i.mover=c("div",[o],null,"position: relative"),i.sizer=c("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=c("div",null,null,"position: absolute; height: "+Ye+"px; width: 1px;"),i.gutters=c("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=c("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=c("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),_&&oe>=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),H&&te<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!q&&!(ve&&ie)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Vi(r.gutters,r.lineNumbers),ga(i),n.init(i)}var li=0,Qt=null;H?Qt=-.53:ve?Qt=15:_?Qt=-.7:Me&&(Qt=-1/3);function ma(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 Ns(e){var t=ma(e);return t.x*=Qt,t.y*=Qt,t}function ya(e,t){_&&oe==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=ma(t),r=n.x,i=n.y,o=Qt;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,o=1);var a=e.display,l=a.scroller,s=l.scrollWidth>l.clientWidth,u=l.scrollHeight>l.clientHeight;if(r&&s||i&&u){if(i&&pe&&q){e:for(var d=t.target,p=a.view;d!=l;d=d.parentNode)for(var g=0;g<p.length;g++)if(p[g].node==d){e.display.currentWheelTarget=d;break e}}if(r&&!ve&&!ne&&o!=null){i&&u&&vn(e,Math.max(0,l.scrollTop+i*o)),kr(e,Math.max(0,l.scrollLeft+r*o)),(!i||i&&u)&&$e(t),a.wheelStartX=null;return}if(i&&o!=null){var v=i*o,b=e.doc.scrollTop,S=b+a.wrapper.clientHeight;v<0?b=Math.max(0,b+v-50):S=Math.min(e.doc.height,S+v+50),Zi(e,{top:b,bottom:S})}li<20&&t.deltaMode!==0&&(a.wheelStartX==null?(a.wheelStartX=l.scrollLeft,a.wheelStartY=l.scrollTop,a.wheelDX=r,a.wheelDY=i,setTimeout(function(){if(a.wheelStartX!=null){var L=l.scrollLeft-a.wheelStartX,N=l.scrollTop-a.wheelStartY,W=N&&a.wheelDY&&N/a.wheelDY||L&&a.wheelDX&&L/a.wheelDX;a.wheelStartX=a.wheelStartY=null,W&&(Qt=(Qt*li+W)/(li+1),++li)}},200)):(a.wheelDX+=r,a.wheelDY+=i))}}var St=function(e,t){this.ranges=e,this.primIndex=t};St.prototype.primary=function(){return this.ranges[this.primIndex]},St.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!de(n.anchor,r.anchor)||!de(n.head,r.head))return!1}return!0},St.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new he(_e(this.ranges[t].anchor),_e(this.ranges[t].head));return new St(e,this.primIndex)},St.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},St.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(D(t,r.from())>=0&&D(e,r.to())<=0)return n}return-1};var he=function(e,t){this.anchor=e,this.head=t};he.prototype.from=function(){return Hr(this.anchor,this.head)},he.prototype.to=function(){return ut(this.anchor,this.head)},he.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ht(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(g,v){return D(g.from(),v.from())}),n=I(t,i);for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=D(l.to(),a.from());if(r&&!a.empty()?s>0:s>=0){var u=Hr(l.from(),a.from()),d=ut(l.to(),a.to()),p=l.empty()?a.from()==a.head:l.from()==l.head;o<=n&&--n,t.splice(--o,2,new he(p?d:u,p?u:d))}}return new St(t,n)}function fr(e,t){return new St([new he(e,t||e)],0)}function cr(e){return e.text?y(e.from.line+e.text.length-1,le(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ba(e,t){if(D(e,t.from)<0)return e;if(D(e,t.to)<=0)return cr(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+=cr(t).ch-t.to.ch),y(n,r)}function $i(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new he(ba(i.anchor,t),ba(i.head,t)))}return Ht(e.cm,n,e.sel.primIndex)}function xa(e,t,n){return e.line==t.line?y(n.line,e.ch-t.ch+n.ch):y(n.line+(e.line-t.line),e.ch)}function As(e,t,n){for(var r=[],i=y(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=xa(l.from,i,o),u=xa(cr(l),i,o);if(i=l.to,o=u,n=="around"){var d=e.sel.ranges[a],p=D(d.head,d.anchor)<0;r[a]=new he(p?u:s,p?s:u)}else r[a]=new he(s,s)}return new St(r,e.sel.primIndex)}function eo(e){e.doc.mode=Wr(e.options,e.doc.modeOption),xn(e)}function xn(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,yn(e,100),e.state.modeGen++,e.curOp&&ft(e)}function wa(e,t){return t.from.ch==0&&t.to.ch==0&&le(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function to(e,t,n,r){function i(W){return n?n[W]:null}function o(W,A,P){Fl(W,A,P,r),Ue(W,"change",W,t)}function a(W,A){for(var P=[],K=W;K<A;++K)P.push(new Er(u[K],i(K),r));return P}var l=t.from,s=t.to,u=t.text,d=F(e,l.line),p=F(e,s.line),g=le(u),v=i(u.length-1),b=s.line-l.line;if(t.full)e.insert(0,a(0,u.length)),e.remove(u.length,e.size-u.length);else if(wa(e,t)){var S=a(0,u.length-1);o(p,p.text,v),b&&e.remove(l.line,b),S.length&&e.insert(l.line,S)}else if(d==p)if(u.length==1)o(d,d.text.slice(0,l.ch)+g+d.text.slice(s.ch),v);else{var L=a(1,u.length-1);L.push(new Er(g+d.text.slice(s.ch),v,r)),o(d,d.text.slice(0,l.ch)+u[0],i(0)),e.insert(l.line+1,L)}else if(u.length==1)o(d,d.text.slice(0,l.ch)+u[0]+p.text.slice(s.ch),i(0)),e.remove(l.line+1,b);else{o(d,d.text.slice(0,l.ch)+u[0],i(0)),o(p,g+p.text.slice(s.ch),v);var N=a(1,u.length-1);b>1&&e.remove(l.line+1,b-1),e.insert(l.line+1,N)}Ue(e,"change",e,t)}function dr(e,t,n){function r(i,o,a){if(i.linked)for(var l=0;l<i.linked.length;++l){var s=i.linked[l];if(s.doc!=o){var u=a&&s.sharedHist;n&&!u||(t(s.doc,u),r(s.doc,i,u))}}}r(e,null,!0)}function ka(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ki(e),eo(e),Sa(e),e.options.direction=t.direction,e.options.lineWrapping||Di(e),e.options.mode=t.modeOption,ft(e)}function Sa(e){(e.doc.direction=="rtl"?Ae:we)(e.display.lineDiv,"CodeMirror-rtl")}function Ds(e){yt(e,function(){Sa(e),ft(e)})}function si(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function ro(e,t){var n={from:_e(t.from),to:cr(t),text:Xt(e,t.from,t.to)};return Ta(e,n,t.from.line,t.to.line+1),dr(e,function(r){return Ta(r,n,t.from.line,t.to.line+1)},!0),n}function Ca(e){for(;e.length;){var t=le(e);if(t.ranges)e.pop();else break}}function Os(e,t){if(t)return Ca(e.done),le(e.done);if(e.done.length&&!le(e.done).ranges)return le(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),le(e.done)}function La(e,t,n,r){var i=e.history;i.undone.length=0;var o=+new Date,a,l;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(a=Os(i,i.lastOp==r)))l=le(a.changes),D(t.from,t.to)==0&&D(t.from,l.to)==0?l.to=cr(t):a.changes.push(ro(e,t));else{var s=le(i.done);for((!s||!s.ranges)&&ui(e.sel,i.done),a={changes:[ro(e,t)],generation:i.generation},i.done.push(a);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=o,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||Se(e,"historyAdded")}function Ws(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Ps(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Ws(e,o,le(i.done),t))?i.done[i.done.length-1]=t:ui(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&Ca(i.undone)}function ui(e,t){var n=le(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Ta(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(a){a.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=a.markedSpans),++o})}function zs(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Hs(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(zs(n[i]));return r}function Ma(e,t){var n=Hs(e,t),r=Ti(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],u=0;u<o.length;++u)if(o[u].marker==s.marker)continue e;o.push(s)}else a&&(n[i]=a)}return n}function Gr(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges){r.push(n?St.prototype.deepCopy.call(o):o);continue}var a=o.changes,l=[];r.push({changes:l});for(var s=0;s<a.length;++s){var u=a[s],d=void 0;if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var p in u)(d=p.match(/^spans_(\d+)$/))&&I(t,Number(d[1]))>-1&&(le(l)[p]=u[p],delete u[p])}}return r}function no(e,t,n,r){if(r){var i=e.anchor;if(n){var o=D(t,i)<0;o!=D(n,i)<0?(i=t,t=n):o!=D(t,n)<0&&(t=n)}return new he(i,t)}else return new he(n||t,t)}function fi(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),et(e,new St([no(e.sel.primary(),t,n,i)],0),r)}function Na(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=no(e.sel.ranges[o],t[o],null,i);var a=Ht(e.cm,r,e.sel.primIndex);et(e,a,n)}function io(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,et(e,Ht(e.cm,i,e.sel.primIndex),r)}function Aa(e,t,n,r){et(e,fr(t,n),r)}function Es(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var o=0;o<i.length;o++)this.ranges[o]=new he(Z(e,i[o].anchor),Z(e,i[o].head))},origin:n&&n.origin};return Se(e,"beforeSelectionChange",e,r),e.cm&&Se(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Ht(e.cm,r.ranges,r.ranges.length-1):t}function Da(e,t,n){var r=e.history.done,i=le(r);i&&i.ranges?(r[r.length-1]=t,ci(e,t,n)):et(e,t,n)}function et(e,t,n){ci(e,t,n),Ps(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function ci(e,t,n){(mt(e,"beforeSelectionChange")||e.cm&&mt(e.cm,"beforeSelectionChange"))&&(t=Es(e,t,n));var r=n&&n.bias||(D(t.primary().head,e.sel.primary().head)<0?-1:1);Oa(e,Pa(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&_r(e.cm)}function Oa(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ct(e.cm)),Ue(e,"cursorActivity",e))}function Wa(e){Oa(e,Pa(e,e.sel,null,!1))}function Pa(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=di(e,a.anchor,l&&l.anchor,n,r),u=a.head==a.anchor?s:di(e,a.head,l&&l.head,n,r);(i||s!=a.anchor||u!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new he(s,u))}return i?Ht(e.cm,i,t.primIndex):t}function qr(e,t,n,r,i){var o=F(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,d="selectRight"in s?!s.selectRight:s.inclusiveRight;if((l.from==null||(u?l.from<=t.ch:l.from<t.ch))&&(l.to==null||(d?l.to>=t.ch:l.to>t.ch))){if(i&&(Se(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--a;continue}else break;if(!s.atomic)continue;if(n){var p=s.find(r<0?1:-1),g=void 0;if((r<0?d:u)&&(p=za(e,p,-r,p&&p.line==t.line?o:null)),p&&p.line==t.line&&(g=D(p,n))&&(r<0?g<0:g>0))return qr(e,p,t,r,i)}var v=s.find(r<0?-1:1);return(r<0?u:d)&&(v=za(e,v,r,v.line==t.line?o:null)),v?qr(e,v,t,r,i):null}}return t}function di(e,t,n,r,i){var o=r||1,a=qr(e,t,n,o,i)||!i&&qr(e,t,n,o,!0)||qr(e,t,n,-o,i)||!i&&qr(e,t,n,-o,!0);return a||(e.cantEdit=!0,y(e.first,0))}function za(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?Z(e,y(t.line-1)):null:n>0&&t.ch==(r||F(e,t.line)).text.length?t.line<e.first+e.size-1?y(t.line+1,0):null:new y(t.line,t.ch+n)}function Ha(e){e.setSelection(y(e.firstLine(),0),y(e.lastLine()),at)}function Ea(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(i,o,a,l){i&&(r.from=Z(e,i)),o&&(r.to=Z(e,o)),a&&(r.text=a),l!==void 0&&(r.origin=l)}),Se(e,"beforeChange",e,r),e.cm&&Se(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function jr(e,t,n){if(e.cm){if(!e.cm.curOp)return Ge(e.cm,jr)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((mt(e,"beforeChange")||e.cm&&mt(e.cm,"beforeChange"))&&(t=Ea(e,t,!0),!t))){var r=Mo&&!n&&Pl(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Fa(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Fa(e,t)}}function Fa(e,t){if(!(t.text.length==1&&t.text[0]==""&&D(t.from,t.to)==0)){var n=$i(e,t);La(e,t,n,e.cm?e.cm.curOp.id:NaN),wn(e,t,n,Ti(e,t));var r=[];dr(e,function(i,o){!o&&I(r,i.history)==-1&&(Ka(i.history,t),r.push(i.history)),wn(i,t,null,Ti(i,t))})}}function hi(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,o,a=e.sel,l=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,u=0;u<l.length&&(o=l[u],!(n?o.ranges&&!o.equals(e.sel):!o.ranges));u++);if(u!=l.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(o=l.pop(),o.ranges){if(ui(o,s),n&&!o.equals(e.sel)){et(e,o,{clearRedo:!1});return}a=o}else if(r){l.push(o);return}else break;var d=[];ui(a,s),s.push({changes:d,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var p=mt(e,"beforeChange")||e.cm&&mt(e.cm,"beforeChange"),g=function(S){var L=o.changes[S];if(L.origin=t,p&&!Ea(e,L,!1))return l.length=0,{};d.push(ro(e,L));var N=S?$i(e,L):le(l);wn(e,L,N,Ma(e,L)),!S&&e.cm&&e.cm.scrollIntoView({from:L.from,to:cr(L)});var W=[];dr(e,function(A,P){!P&&I(W,A.history)==-1&&(Ka(A.history,L),W.push(A.history)),wn(A,L,null,Ma(A,L))})},v=o.changes.length-1;v>=0;--v){var b=g(v);if(b)return b.v}}}}function Ia(e,t){if(t!=0&&(e.first+=t,e.sel=new St(me(e.sel.ranges,function(i){return new he(y(i.anchor.line+t,i.anchor.ch),y(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){ft(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)sr(e.cm,r,"gutter")}}function wn(e,t,n,r){if(e.cm&&!e.cm.curOp)return Ge(e.cm,wn)(e,t,n,r);if(t.to.line<e.first){Ia(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Ia(e,i),t={from:y(e.first,0),to:y(t.to.line+i,t.to.ch),text:[le(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:y(o,F(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Xt(e,t.from,t.to),n||(n=$i(e,t)),e.cm?Fs(e.cm,t,r):to(e,t,r),ci(e,n,at),e.cantEdit&&di(e,y(e.firstLine(),0))&&(e.cantEdit=!1)}}function Fs(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=f(Pt(F(r,o.line))),r.iter(s,a.line+1,function(v){if(v==i.maxLine)return l=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Ct(e),to(r,t,n,na(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(v){var b=Jn(v);b>i.maxLineLength&&(i.maxLine=v,i.maxLineLength=b,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),Tl(r,o.line),yn(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?ft(e):o.line==a.line&&t.text.length==1&&!wa(e.doc,t)?sr(e,o.line,"text"):ft(e,o.line,a.line+1,u);var d=mt(e,"changes"),p=mt(e,"change");if(p||d){var g={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};p&&Ue(e,"change",e,g),d&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(g)}e.display.selForContextMenu=null}function Xr(e,t,n,r,i){var o;r||(r=n),D(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),jr(e,{from:n,to:r,text:t,origin:i})}function Ba(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Ra(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var l=0;l<o.ranges.length;l++)Ba(o.ranges[l].anchor,t,n,r),Ba(o.ranges[l].head,t,n,r);continue}for(var s=0;s<o.changes.length;++s){var u=o.changes[s];if(n<u.from.line)u.from=y(u.from.line+r,u.from.ch),u.to=y(u.to.line+r,u.to.ch);else if(t<=u.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}function Ka(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Ra(e.done,n,r,i),Ra(e.undone,n,r,i)}function kn(e,t,n,r){var i=t,o=t;return typeof t=="number"?o=F(e,yo(e,t)):i=f(t),i==null?null:(r(o,i)&&e.cm&&sr(e.cm,i,n),o)}function Sn(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}Sn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,Il(i),Ue(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function Cn(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}Cn.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),(t-=o)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Sn))){var l=[];this.collapse(l),this.children=[new Sn(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,l=a;l<i.lines.length;){var s=new Sn(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Cn(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=I(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new Cn(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if((t-=a)==0)break;e=0}else e-=o}}};var Ln=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};Ln.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=f(n);if(!(r==null||!t)){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=cn(this);kt(n,Math.max(0,n.height-o)),e&&(yt(e,function(){_a(e,n,-o),sr(e,r,"widget")}),Ue(e,"lineWidgetCleared",e,this,r))}},Ln.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=cn(this)-t;i&&(lr(this.doc,r)||kt(r,r.height+i),n&&yt(n,function(){n.curOp.forceUpdate=!0,_a(n,r,i),Ue(n,"lineWidgetChanged",n,e,f(r))}))},Nt(Ln);function _a(e,t,n){Zt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Xi(e,n)}function Is(e,t,n,r){var i=new Ln(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),kn(e,t,"widget",function(a){var l=a.widgets||(a.widgets=[]);if(i.insertAt==null?l.push(i):l.splice(Math.min(l.length,Math.max(0,i.insertAt)),0,i),i.line=a,o&&!lr(e,a)){var s=Zt(a)<e.scrollTop;kt(a,a.height+cn(i)),s&&Xi(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&Ue(o,"lineWidgetAdded",o,i,typeof t=="number"?t:f(t)),i}var Ua=0,hr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Ua};hr.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Cr(e),mt(this,"clear")){var n=this.find();n&&Ue(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=sn(a.markedSpans,this);e&&!this.collapsed?sr(e,f(a),"text"):e&&(l.to!=null&&(i=f(a)),l.from!=null&&(r=f(a))),a.markedSpans=Al(a.markedSpans,l),l.from==null&&this.collapsed&&!lr(this.doc,a)&&e&&kt(a,Br(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=Pt(this.lines[s]),d=Jn(u);d>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=d,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&ft(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Wa(e.doc)),e&&Ue(e,"markerCleared",e,this,r,i),t&&Lr(e),this.parent&&this.parent.clear()}},hr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],a=sn(o.markedSpans,this);if(a.from!=null&&(n=y(t?o:f(o),a.from),e==-1))return n;if(a.to!=null&&(r=y(t?o:f(o),a.to),e==1))return r}return n&&{from:n,to:r}},hr.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||yt(r,function(){var i=t.line,o=f(t.line),a=zi(r,o);if(a&&(Zo(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!lr(n.doc,i)&&n.height!=null){var l=n.height;n.height=null;var s=cn(n)-l;s&&kt(i,i.height+s)}Ue(r,"markerChanged",r,e)})},hr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||I(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},hr.prototype.detachLine=function(e){if(this.lines.splice(I(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Nt(hr);function Yr(e,t,n,r,i){if(r&&r.shared)return Bs(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Ge(e.cm,Yr)(e,t,n,r,i);var o=new hr(e,i),a=D(t,n);if(r&&V(r,o,!1),a>0||a==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=O("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Po(e,t.line,t,n,o)||t.line!=n.line&&Po(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Nl()}o.addToHistory&&La(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l=t.line,s=e.cm,u;if(e.iter(l,n.line+1,function(p){s&&o.collapsed&&!s.options.lineWrapping&&Pt(p)==s.display.maxLine&&(u=!0),o.collapsed&&l!=t.line&&kt(p,0),Dl(p,new jn(o,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l}),o.collapsed&&e.iter(t.line,n.line+1,function(p){lr(e,p)&&kt(p,0)}),o.clearOnEnter&&R(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Ml(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Ua,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)ft(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++)sr(s,d,"text");o.atomic&&Wa(s.doc),Ue(s,"markerAdded",s,o)}return o}var Tn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Tn.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ue(this,"clear")}},Tn.prototype.find=function(e,t){return this.primary.find(e,t)},Nt(Tn);function Bs(e,t,n,r,i){r=V(r),r.shared=!1;var o=[Yr(e,t,n,r,i)],a=o[0],l=r.widgetNode;return dr(e,function(s){l&&(r.widgetNode=l.cloneNode(!0)),o.push(Yr(s,Z(s,t),Z(s,n),r,i));for(var u=0;u<s.linked.length;++u)if(s.linked[u].isParent)return;a=le(o)}),new Tn(o,a)}function Ga(e){return e.findMarks(y(e.first,0),e.clipPos(y(e.lastLine())),function(t){return t.parent})}function Rs(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(D(o,a)){var l=Yr(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}function Ks(e){for(var t=function(r){var i=e[r],o=[i.primary.doc];dr(i.primary.doc,function(s){return o.push(s)});for(var a=0;a<i.markers.length;a++){var l=i.markers[a];I(o,l.doc)==-1&&(l.parent=null,i.markers.splice(a--,1))}},n=0;n<e.length;n++)t(n)}var _s=0,ct=function(e,t,n,r,i){if(!(this instanceof ct))return new ct(e,t,n,r,i);n==null&&(n=0),Cn.call(this,[new Sn([new Er("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=y(n,0);this.sel=fr(o),this.history=new si(null),this.id=++_s,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),to(this,{from:o,to:o,text:e}),et(this,fr(o),at)};ct.prototype=x(Cn.prototype,{constructor:ct,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=an(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:qe(function(e){var t=y(this.first,0),n=this.first+this.size-1;jr(this,{from:t,to:y(n,F(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&pn(this.cm,0,0),et(this,fr(t),at)}),replaceRange:function(e,t,n,r){t=Z(this,t),n=n?Z(this,n):t,Xr(this,e,t,n,r)},getRange:function(e,t,n){var r=Xt(this,Z(this,e),Z(this,t));return n===!1?r:n===""?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(w(this,e))return F(this,e)},getLineNumber:function(e){return f(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=F(this,e)),Pt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Z(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:qe(function(e,t,n){Aa(this,Z(this,typeof e=="number"?y(e,t||0):e),null,n)}),setSelection:qe(function(e,t,n){Aa(this,Z(this,e),Z(this,t||e),n)}),extendSelection:qe(function(e,t,n){fi(this,Z(this,e),t&&Z(this,t),n)}),extendSelections:qe(function(e,t){Na(this,bo(this,e),t)}),extendSelectionsBy:qe(function(e,t){var n=me(this.sel.ranges,e);Na(this,bo(this,n),t)}),setSelections:qe(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new he(Z(this,e[i].anchor),Z(this,e[i].head||e[i].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),et(this,Ht(this.cm,r,t),n)}}),addSelection:qe(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new he(Z(this,e),Z(this,t||e))),et(this,Ht(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=Xt(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Xt(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:qe(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var l=t&&t!="end"&&As(this,r,t),s=r.length-1;s>=0;s--)jr(this,r[s]);l?Da(this,l):this.cm&&_r(this.cm)}),undo:qe(function(){hi(this,"undo")}),redo:qe(function(){hi(this,"redo")}),undoSelection:qe(function(){hi(this,"undo",!0)}),redoSelection:qe(function(){hi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new si(this.history),dr(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Gr(this.history.done),undone:Gr(this.history.undone)}},setHistory:function(e){var t=this.history=new si(this.history);t.done=Gr(e.done.slice(0),null,!0),t.undone=Gr(e.undone.slice(0),null,!0)},setGutterMarker:qe(function(e,t,n){return kn(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&Kn(i)&&(r.gutterMarkers=null),!0})}),clearGutter:qe(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&kn(t,n,"gutter",function(){return n.gutterMarkers[e]=null,Kn(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!w(this,e)||(t=e,e=F(this,e),!e))return null}else if(t=f(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:qe(function(e,t,n){return kn(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i])r[i]=n;else{if(G(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:qe(function(e,t,n){return kn(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",o=r[i];if(o)if(n==null)r[i]=null;else{var a=o.match(G(n));if(!a)return!1;var l=a.index+a[0].length;r[i]=o.slice(0,a.index)+(!a.index||l==o.length?"":" ")+o.slice(l)||null}else return!1;return!0})}),addLineWidget:qe(function(e,t,n){return Is(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Yr(this,Z(this,e),Z(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=Z(this,e),Yr(this,e,e,n,"bookmark")},findMarksAt:function(e){e=Z(this,e);var t=[],n=F(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=Z(this,e),t=Z(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];!(s.to!=null&&i==e.line&&e.ch>=s.to||s.from==null&&i!=e.line||s.from!=null&&i==t.line&&s.from>=t.ch)&&(!n||n(s.marker))&&r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n}),Z(this,y(n,t))},indexFromPos:function(e){e=Z(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new ct(an(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new ct(an(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Rs(r,Ga(this)),r},unlinkDoc:function(e){if(e instanceof xe&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Ks(Ga(this));break}}if(e.history==this.history){var r=[e.id];dr(e,function(i){return r.push(i.id)},!0),e.history=new si(null),e.history.done=Gr(this.history.done,r),e.history.undone=Gr(this.history.undone,r)}},iterLinkedDocs:function(e){dr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Lt(e)},lineSeparator:function(){return this.lineSep||`
- `},setDirection:qe(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&Ds(this.cm))})}),ct.prototype.eachLine=ct.prototype.iter;var qa=0;function Us(e){var t=this;if(ja(t),!(Ce(t,e)||Jt(t.display,e))){$e(e),H&&(qa=+new Date);var n=xr(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,l=function(){++a==i&&Ge(t,function(){n=Z(t.doc,n);var v={from:n,to:n,text:t.doc.splitLines(o.filter(function(b){return b!=null}).join(t.doc.lineSeparator())),origin:"paste"};jr(t.doc,v),Da(t.doc,fr(Z(t.doc,n),Z(t.doc,cr(v))))})()},s=function(v,b){if(t.options.allowDropFileTypes&&I(t.options.allowDropFileTypes,v.type)==-1){l();return}var S=new FileReader;S.onerror=function(){return l()},S.onload=function(){var L=S.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(L)){l();return}o[b]=L,l()},S.readAsText(v)},u=0;u<r.length;u++)s(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var d=e.dataTransfer.getData("Text");if(d){var p;if(t.state.draggingText&&!t.state.draggingText.copy&&(p=t.listSelections()),ci(t.doc,fr(n,n)),p)for(var g=0;g<p.length;++g)Xr(t.doc,"",p[g].anchor,p[g].head,"drag");t.replaceSelection(d,"around","paste"),t.display.input.focus()}}catch(v){}}}}function Gs(e,t){if(H&&(!e.state.draggingText||+new Date-qa<100)){nr(t);return}if(!(Ce(e,t)||Jt(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!Me)){var n=c("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",ne&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),ne&&n.parentNode.removeChild(n)}}function qs(e,t){var n=xr(e,t);if(n){var r=document.createDocumentFragment();_i(e,n,r),e.display.dragCursor||(e.display.dragCursor=c("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),z(e.display.dragCursor,r)}}function ja(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Xa(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var o=0;o<n.length;o++)e(n[o])})}}var Ya=!1;function js(){Ya||(Xs(),Ya=!0)}function Xs(){var e;R(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Xa(Ys)},100))}),R(window,"blur",function(){return Xa(Kr)})}function Ys(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var pr={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Mn=0;Mn<10;Mn++)pr[Mn+48]=pr[Mn+96]=String(Mn);for(var pi=65;pi<=90;pi++)pr[pi]=String.fromCharCode(pi);for(var Nn=1;Nn<=12;Nn++)pr[Nn+111]=pr[Nn+63235]="F"+Nn;var Vt={};Vt.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Vt.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Vt.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Vt.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Vt.default=pe?Vt.macDefault:Vt.pcDefault;function Zs(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,o,a=0;a<t.length-1;a++){var l=t[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))i=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Js(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var i=me(n.split(" "),Zs),o=0;o<i.length;o++){var a=void 0,l=void 0;o==i.length-1?(l=i.join(" "),a=r):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(!s)t[l]=a;else if(s!=a)throw new Error("Inconsistent bindings for "+l)}delete e[n]}for(var u in t)e[u]=t[u];return e}function Zr(e,t,n,r){t=vi(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Zr(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=Zr(e,t.fallthrough[o],n,r);if(a)return a}}}function Za(e){var t=typeof e=="string"?e:pr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Ja(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(Be?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(Be?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Qa(e,t){if(ne&&e.keyCode==34&&e.char)return!1;var n=pr[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),Ja(n,e,t))}function vi(e){return typeof e=="string"?Vt[e]:e}function Jr(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&D(o.from,le(r).to)<=0;){var a=r.pop();if(D(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}yt(e,function(){for(var l=r.length-1;l>=0;l--)Xr(e.doc,"",r[l].from,r[l].to,"+delete");_r(e)})}function oo(e,t,n){var r=er(e.text,t+n,n);return r<0||r>e.text.length?null:r}function ao(e,t,n){var r=oo(e,t.ch,n);return r==null?null:new y(t.line,r,n<0?"after":"before")}function lo(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=ae(n,t.doc.direction);if(o){var a=i<0?le(o):o[0],l=i<0==(a.level==1),s=l?"after":"before",u;if(a.level>0||t.doc.direction=="rtl"){var d=Ir(t,n);u=i<0?n.text.length-1:0;var p=Kt(t,d,u).top;u=Ft(function(g){return Kt(t,d,g).top==p},i<0==(a.level==1)?a.from:a.to-1,u),s=="before"&&(u=oo(n,u,1))}else u=i<0?a.to:a.from;return new y(r,u,s)}}return new y(r,i<0?n.text.length:0,i<0?"before":"after")}function Qs(e,t,n,r){var i=ae(t,e.doc.direction);if(!i)return ao(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=rr(i,n.ch,n.sticky),a=i[o];if(e.doc.direction=="ltr"&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return ao(t,n,r);var l=function(N,W){return oo(t,N instanceof y?N.ch:N,W)},s,u=function(N){return e.options.lineWrapping?(s=s||Ir(e,t),ra(e,t,s,N)):{begin:0,end:t.text.length}},d=u(n.sticky=="before"?l(n,-1):n.ch);if(e.doc.direction=="rtl"||a.level==1){var p=a.level==1==r<0,g=l(n,p?1:-1);if(g!=null&&(p?g<=a.to&&g<=d.end:g>=a.from&&g>=d.begin)){var v=p?"before":"after";return new y(n.line,g,v)}}var b=function(N,W,A){for(var P=function(ye,je){return je?new y(n.line,l(ye,1),"before"):new y(n.line,ye,"after")};N>=0&&N<i.length;N+=W){var K=i[N],B=W>0==(K.level!=1),$=B?A.begin:l(A.end,-1);if(K.from<=$&&$<K.to||($=B?K.from:l(K.to,-1),A.begin<=$&&$<A.end))return P($,B)}},S=b(o+r,r,d);if(S)return S;var L=r>0?d.end:l(d.begin,-1);return L!=null&&!(r>0&&L==t.text.length)&&(S=b(r>0?0:i.length-1,r,u(L)),S)?S:null}var An={selectAll:Ha,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),at)},killLine:function(e){return Jr(e,function(t){if(t.empty()){var n=F(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:y(t.head.line+1,0)}:{from:t.head,to:y(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Jr(e,function(t){return{from:y(t.from().line,0),to:Z(e.doc,y(t.to().line+1,0))}})},delLineLeft:function(e){return Jr(e,function(t){return{from:y(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Jr(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Jr(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(y(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(y(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Va(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return $a(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Vs(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},ce)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},ce)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?$a(e,t.head):r},ce)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=se(e.getLine(o.line),o.ch,r);t.push(wt(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return yt(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=F(e.doc,i.line).text;if(o){if(i.ch==o.length&&(i=new y(i.line,i.ch-1)),i.ch>0)i=new y(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),y(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=F(e.doc,i.line-1).text;a&&(i=new y(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),y(i.line-1,a.length-1),i,"+transpose"))}}n.push(new he(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return yt(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);_r(e)})},openLine:function(e){return e.replaceSelection(`
- `,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Va(e,t){var n=F(e.doc,t),r=Pt(n);return r!=n&&(t=f(r)),lo(!0,e,r,t,1)}function Vs(e,t){var n=F(e.doc,t),r=Hl(n);return r!=n&&(t=f(r)),lo(!0,e,n,t,-1)}function $a(e,t){var n=Va(e,t.line),r=F(e.doc,n.line),i=ae(r,e.doc.direction);if(!i||i[0].level==0){var o=Math.max(n.ch,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return y(n.line,a?0:o,n.sticky)}return n}function gi(e,t,n){if(typeof t=="string"&&(t=An[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Mt}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function $s(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Zr(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Zr(t,e.options.extraKeys,n,e)||Zr(t,e.options.keyMap,n,e)}var eu=new Q;function Dn(e,t,n,r){var i=e.state.keySeq;if(i){if(Za(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:eu.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),el(e,i+" "+t,n,r))return!0}return el(e,t,n,r)}function el(e,t,n,r){var i=$s(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&Ue(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&($e(n),Ui(e)),!!i}function tl(e,t){var n=Qa(t,!0);return n?t.shiftKey&&!e.state.keySeq?Dn(e,"Shift-"+n,t,function(r){return gi(e,r,!0)})||Dn(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return gi(e,r)}):Dn(e,n,t,function(r){return gi(e,r)}):!1}function tu(e,t,n){return Dn(e,"'"+n+"'",t,function(r){return gi(e,r,!0)})}var so=null;function rl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=fe(gt(t)),!Ce(t,e))){H&&te<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=tl(t,e);ne&&(so=r?n:null,!r&&n==88&&!Gn&&(pe?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),ve&&!pe&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&ru(t)}}function ru(e){var t=e.display.lineDiv;Ae(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(we(t,"CodeMirror-crosshair"),Ve(document,"keyup",n),Ve(document,"mouseover",n))}R(document,"keyup",n),R(document,"mouseover",n)}function nl(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ce(this,e)}function il(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(Jt(t.display,e)||Ce(t,e)||e.ctrlKey&&!e.altKey||pe&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(ne&&n==so){so=null,$e(e);return}if(!(ne&&(!e.which||e.which<10)&&tl(t,e))){var i=String.fromCharCode(r==null?n:r);i!="\b"&&(tu(t,e,i)||t.display.input.onKeyPress(e))}}}var nu=400,uo=function(e,t,n){this.time=e,this.pos=t,this.button=n};uo.prototype.compare=function(e,t,n){return this.time+nu>e&&D(t,this.pos)==0&&n==this.button};var On,Wn;function iu(e,t){var n=+new Date;return Wn&&Wn.compare(n,e,t)?(On=Wn=null,"triple"):On&&On.compare(n,e,t)?(Wn=new uo(n,e,t),On=null,"double"):(On=new uo(n,e,t),Wn=null,"single")}function ol(e){var t=this,n=t.display;if(!(Ce(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,Jt(n,e)){q||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!fo(t,e)){var r=xr(t,e),i=At(e),o=r?iu(r,i):"single";Y(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&ou(t,i,r,o,e))&&(i==1?r?lu(t,r,o,e):rn(e)==n.scroller&&$e(e):i==2?(r&&fi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(X?t.display.input.onContextMenu(e):Gi(t)))}}}function ou(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,Dn(e,Ja(o,i),i,function(a){if(typeof a=="string"&&(a=An[a]),!a)return!1;var l=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),l=a(e,n)!=Mt}finally{e.state.suppressEdits=!1}return l})}function au(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var o=Ke?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=pe?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(pe?n.altKey:n.ctrlKey)),i}function lu(e,t,n,r){H?setTimeout(j(aa,e),0):e.curOp.focus=fe(gt(e));var i=au(e,n,r),o=e.doc.sel,a;e.options.dragDrop&&ki&&!e.isReadOnly()&&n=="single"&&(a=o.contains(t))>-1&&(D((a=o.ranges[a]).from(),t)<0||t.xRel>0)&&(D(a.to(),t)>0||t.xRel<0)?su(e,r,t,i):uu(e,r,t,i)}function su(e,t,n,r){var i=e.display,o=!1,a=Ge(e,function(u){q&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Gi(e)),Ve(i.wrapper.ownerDocument,"mouseup",a),Ve(i.wrapper.ownerDocument,"mousemove",l),Ve(i.scroller,"dragstart",s),Ve(i.scroller,"drop",a),o||($e(u),r.addNew||fi(e.doc,n,null,null,r.extend),q&&!Me||H&&te==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),l=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return o=!0};q&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!r.moveOnDrag,R(i.wrapper.ownerDocument,"mouseup",a),R(i.wrapper.ownerDocument,"mousemove",l),R(i.scroller,"dragstart",s),R(i.scroller,"drop",a),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function al(e,t,n){if(n=="char")return new he(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new he(y(t.line,0),Z(e.doc,y(t.line+1,0)));var r=n(e,t);return new he(r.from,r.to)}function uu(e,t,n,r){H&&Gi(e);var i=e.display,o=e.doc;$e(t);var a,l,s=o.sel,u=s.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),l>-1?a=u[l]:a=new he(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),r.unit=="rectangle")r.addNew||(a=new he(n,n)),n=xr(e,t,!0,!0),l=-1;else{var d=al(e,n,r.unit);r.extend?a=no(a,d.anchor,d.head,r.extend):a=d}r.addNew?l==-1?(l=u.length,et(o,Ht(e,u.concat([a]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&r.unit=="char"&&!r.extend?(et(o,Ht(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):io(o,l,a,xt):(l=0,et(o,new St([a],0),xt),s=o.sel);var p=n;function g(A){if(D(p,A)!=0)if(p=A,r.unit=="rectangle"){for(var P=[],K=e.options.tabSize,B=se(F(o,n.line).text,n.ch,K),$=se(F(o,A.line).text,A.ch,K),ye=Math.min(B,$),je=Math.max(B,$),ke=Math.min(n.line,A.line),bt=Math.min(e.lastLine(),Math.max(n.line,A.line));ke<=bt;ke++){var dt=F(o,ke).text,ze=We(dt,ye,K);ye==je?P.push(new he(y(ke,ze),y(ke,ze))):dt.length>ze&&P.push(new he(y(ke,ze),y(ke,We(dt,je,K))))}P.length||P.push(new he(n,n)),et(o,Ht(e,s.ranges.slice(0,l).concat(P),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(A)}else{var ht=a,Ze=al(e,A,r.unit),Re=ht.anchor,He;D(Ze.anchor,Re)>0?(He=Ze.head,Re=Hr(ht.from(),Ze.anchor)):(He=Ze.anchor,Re=ut(ht.to(),Ze.head));var Te=s.ranges.slice(0);Te[l]=fu(e,new he(Z(o,Re),He)),et(o,Ht(e,Te,l),xt)}}var v=i.wrapper.getBoundingClientRect(),b=0;function S(A){var P=++b,K=xr(e,A,!0,r.unit=="rectangle");if(K)if(D(K,p)!=0){e.curOp.focus=fe(gt(e)),g(K);var B=ii(i,o);(K.line>=B.to||K.line<B.from)&&setTimeout(Ge(e,function(){b==P&&S(A)}),150)}else{var $=A.clientY<v.top?-20:A.clientY>v.bottom?20:0;$&&setTimeout(Ge(e,function(){b==P&&(i.scroller.scrollTop+=$,S(A))}),50)}}function L(A){e.state.selectingText=!1,b=1/0,A&&($e(A),i.input.focus()),Ve(i.wrapper.ownerDocument,"mousemove",N),Ve(i.wrapper.ownerDocument,"mouseup",W),o.history.lastSelOrigin=null}var N=Ge(e,function(A){A.buttons===0||!At(A)?L(A):S(A)}),W=Ge(e,L);e.state.selectingText=W,R(i.wrapper.ownerDocument,"mousemove",N),R(i.wrapper.ownerDocument,"mouseup",W)}function fu(e,t){var n=t.anchor,r=t.head,i=F(e.doc,n.line);if(D(n,r)==0&&n.sticky==r.sticky)return t;var o=ae(i);if(!o)return t;var a=rr(o,n.ch,n.sticky),l=o[a];if(l.from!=n.ch&&l.to!=n.ch)return t;var s=a+(l.from==n.ch==(l.level!=1)?0:1);if(s==0||s==o.length)return t;var u;if(r.line!=n.line)u=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var d=rr(o,r.ch,r.sticky),p=d-a||(r.ch-n.ch)*(l.level==1?-1:1);d==s-1||d==s?u=p<0:u=p>0}var g=o[s+(u?-1:0)],v=u==(g.level==1),b=v?g.from:g.to,S=v?"after":"before";return n.ch==b&&n.sticky==S?t:new he(new y(n.line,b,S),r)}function ll(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(g){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&$e(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!mt(e,n))return st(t);o-=l.top-a.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var u=a.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=i){var d=h(e.doc,o),p=e.display.gutterSpecs[s];return Se(e,n,e,d,p.className,t),st(t)}}}function fo(e,t){return ll(e,t,"gutterClick",!0)}function sl(e,t){Jt(e.display,t)||cu(e,t)||Ce(e,t,"contextmenu")||X||e.display.input.onContextMenu(t)}function cu(e,t){return mt(e,"gutterContextMenu")?ll(e,t,"gutterContextMenu",!1):!1}function ul(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),dn(e)}var Qr={toString:function(){return"CodeMirror.Init"}},fl={},mi={};function du(e){var t=e.optionHandlers;function n(r,i,o,a){e.defaults[r]=i,o&&(t[r]=a?function(l,s,u){u!=Qr&&o(l,s,u)}:o)}e.defineOption=n,e.Init=Qr,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,eo(r)},!0),n("indentUnit",2,eo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){xn(r),dn(r),ft(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var o=[],a=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var d=s.text.indexOf(i,u);if(d==-1)break;u=d+i.length,o.push(y(a,d))}a++});for(var l=o.length-1;l>=0;l--)Xr(r.doc,i,o[l],y(o[l].line,o[l].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,i,o){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),o!=Qr&&r.refresh()}),n("specialCharPlaceholder",Kl,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",ie?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!ot),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){ul(r),bn(r)},!0),n("keyMap","default",function(r,i,o){var a=vi(i),l=o!=Qr&&vi(o);l&&l.detach&&l.detach(r,a),a.attach&&a.attach(r,l||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,pu,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Vi(i,r.options.lineNumbers),bn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Ri(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Ur(r)},!0),n("scrollbarStyle","native",function(r){da(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=Vi(r.options.gutters,i),bn(r)},!0),n("firstLineNumber",1,bn,!0),n("lineNumberFormatter",function(r){return r},bn,!0),n("showCursorWhenSelecting",!1,hn,!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,hu),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,hn,!0),n("singleCursorHeightPerLine",!0,hn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,xn,!0),n("addModeClass",!1,xn,!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,xn,!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 hu(e,t,n){var r=n&&n!=Qr;if(!t!=!r){var i=e.display.dragFunctions,o=t?R:Ve;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function pu(e){e.options.lineWrapping?(Ae(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(we(e.display.wrapper,"CodeMirror-wrap"),Di(e)),Ki(e),ft(e),dn(e),setTimeout(function(){return Ur(e)},100)}function xe(e,t){var n=this;if(!(this instanceof xe))return new xe(e,t);this.options=t=t?V(t):{},V(fl,t,!1);var r=t.value;typeof r=="string"?r=new ct(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new xe.inputStyles[t.inputStyle](this),o=this.display=new Ms(e,r,i,t);o.wrapper.CodeMirror=this,ul(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),da(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Q,keySeq:null,specialChars:null},t.autofocus&&!ie&&o.input.focus(),H&&te<11&&setTimeout(function(){return n.display.input.reset(!0)},20),vu(this),js(),Cr(this),this.curOp.forceUpdate=!0,ka(this,r),t.autofocus&&!ie||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&qi(n)},20):Kr(this);for(var a in mi)mi.hasOwnProperty(a)&&mi[a](this,t[a],Qr);va(this),t.finishInit&&t.finishInit(this);for(var l=0;l<co.length;++l)co[l](this);Lr(this),q&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"&&(o.lineDiv.style.textRendering="auto")}xe.defaults=fl,xe.optionHandlers=mi;function vu(e){var t=e.display;R(t.scroller,"mousedown",Ge(e,ol)),H&&te<11?R(t.scroller,"dblclick",Ge(e,function(s){if(!Ce(e,s)){var u=xr(e,s);if(!(!u||fo(e,s)||Jt(e.display,s))){$e(s);var d=e.findWordAt(u);fi(e.doc,d.anchor,d.head)}}})):R(t.scroller,"dblclick",function(s){return Ce(e,s)||$e(s)}),R(t.scroller,"contextmenu",function(s){return sl(e,s)}),R(t.input.getField(),"contextmenu",function(s){t.scroller.contains(s.target)||sl(e,s)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function o(s){if(s.touches.length!=1)return!1;var u=s.touches[0];return u.radiusX<=1&&u.radiusY<=1}function a(s,u){if(u.left==null)return!0;var d=u.left-s.left,p=u.top-s.top;return d*d+p*p>20*20}R(t.scroller,"touchstart",function(s){if(!Ce(e,s)&&!o(s)&&!fo(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)}}),R(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),R(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!Jt(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var d=e.coordsChar(t.activeTouch,"page"),p;!u.prev||a(u,u.prev)?p=new he(d,d):!u.prev.prev||a(u,u.prev.prev)?p=e.findWordAt(d):p=new he(y(d.line,0),Z(e.doc,y(d.line+1,0))),e.setSelection(p.anchor,p.head),e.focus(),$e(s)}i()}),R(t.scroller,"touchcancel",i),R(t.scroller,"scroll",function(){t.scroller.clientHeight&&(vn(e,t.scroller.scrollTop),kr(e,t.scroller.scrollLeft,!0),Se(e,"scroll",e))}),R(t.scroller,"mousewheel",function(s){return ya(e,s)}),R(t.scroller,"DOMMouseScroll",function(s){return ya(e,s)}),R(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){Ce(e,s)||nr(s)},over:function(s){Ce(e,s)||(qs(e,s),nr(s))},start:function(s){return Gs(e,s)},drop:Ge(e,Us),leave:function(s){Ce(e,s)||ja(e)}};var l=t.input.getField();R(l,"keyup",function(s){return nl.call(e,s)}),R(l,"keydown",Ge(e,rl)),R(l,"keypress",Ge(e,il)),R(l,"focus",function(s){return qi(e,s)}),R(l,"blur",function(s){return Kr(e,s)})}var co=[];xe.defineInitHook=function(e){return co.push(e)};function Pn(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=ln(e,t).state:n="prev");var a=e.options.tabSize,l=F(i,t),s=se(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var u=l.text.match(/^\s*/)[0],d;if(!r&&!/\S/.test(l.text))d=0,n="not";else if(n=="smart"&&(d=i.mode.indent(o,l.text.slice(u.length),l.text),d==Mt||d>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?d=se(F(i,t-1).text,null,a):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 p="",g=0;if(e.options.indentWithTabs)for(var v=Math.floor(d/a);v;--v)g+=a,p+=" ";if(g<d&&(p+=wt(d-g)),p!=u)return Xr(i,p,y(t,0),y(t,u.length),"+input"),l.stateAfter=null,!0;for(var b=0;b<i.sel.ranges.length;b++){var S=i.sel.ranges[b];if(S.head.line==t&&S.head.ch<u.length){var L=y(t,u.length);io(i,b,new he(L,L));break}}}var Et=null;function yi(e){Et=e}function ho(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=+new Date-200,l=i=="paste"||e.state.pasteIncoming>a,s=Lt(t),u=null;if(l&&r.ranges.length>1)if(Et&&Et.text.join(`
- `)==t){if(r.ranges.length%Et.text.length==0){u=[];for(var d=0;d<Et.text.length;d++)u.push(o.splitLines(Et.text[d]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=me(s,function(N){return[N]}));for(var p=e.curOp.updateInput,g=r.ranges.length-1;g>=0;g--){var v=r.ranges[g],b=v.from(),S=v.to();v.empty()&&(n&&n>0?b=y(b.line,b.ch-n):e.state.overwrite&&!l?S=y(S.line,Math.min(F(o,S.line).text.length,S.ch+le(s).length)):l&&Et&&Et.lineWise&&Et.text.join(`
- `)==s.join(`
- `)&&(b=S=y(b.line,0)));var L={from:b,to:S,text:u?u[g%u.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};jr(e.doc,L),Ue(e,"inputRead",e,L)}t&&!l&&dl(e,t),_r(e),e.curOp.updateInput<2&&(e.curOp.updateInput=p),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function cl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&yt(t,function(){return ho(t,n,0,null,"paste")}),!0}function dl(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Pn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(F(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Pn(e,i.head.line,"smart"));a&&Ue(e,"electricInput",e,i.head.line)}}}function hl(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:y(i,0),head:y(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function po(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function pl(){var e=c("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=c("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return q?e.style.width="1000px":e.setAttribute("wrap","off"),ee&&(e.style.border="1px solid black"),t}function gu(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){Y(this).focus(),this.display.input.focus()},setOption:function(r,i){var o=this.options,a=o[r];o[r]==i&&r!="mode"||(o[r]=i,t.hasOwnProperty(r)&&Ge(this,t[r])(this,i,a),Se(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](vi(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,o=0;o<i.length;++o)if(i[o]==r||i[o].name==r)return i.splice(o,1),!0},addOverlay:nt(function(r,i){var o=r.token?r:e.getMode(this.options,r);if(o.startState)throw new Error("Overlays may not be stateful.");m(this.state.overlays,{mode:o,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(a){return a.priority}),this.state.modeGen++,ft(this)}),removeOverlay:nt(function(r){for(var i=this.state.overlays,o=0;o<i.length;++o){var a=i[o].modeSpec;if(a==r||typeof r=="string"&&a.name==r){i.splice(o,1),this.state.modeGen++,ft(this);return}}}),indentLine:nt(function(r,i,o){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),w(this.doc,r)&&Pn(this,r,i,o)}),indentSelection:nt(function(r){for(var i=this.doc.sel.ranges,o=-1,a=0;a<i.length;a++){var l=i[a];if(l.empty())l.head.line>o&&(Pn(this,l.head.line,r,!0),o=l.head.line,a==this.doc.sel.primIndex&&_r(this));else{var s=l.from(),u=l.to(),d=Math.max(o,s.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var p=d;p<o;++p)Pn(this,p,r);var g=this.doc.sel.ranges;s.ch==0&&i.length==g.length&&g[a].from().ch>0&&io(this.doc,a,new he(s,g[a].to()),at)}}}),getTokenAt:function(r,i){return Co(this,r,i)},getLineTokens:function(r,i){return Co(this,y(r),i,!0)},getTokenTypeAt:function(r){r=Z(this.doc,r);var i=wo(this,F(this.doc,r.line)),o=0,a=(i.length-1)/2,l=r.ch,s;if(l==0)s=i[2];else for(;;){var u=o+a>>1;if((u?i[u*2-1]:0)>=l)a=u;else if(i[u*2+1]<l)o=u+1;else{s=i[u*2+2];break}}var d=s?s.indexOf("overlay "):-1;return d<0?s:d==0?null:s.slice(0,d-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var o=[];if(!n.hasOwnProperty(i))return o;var a=n[i],l=this.getModeAt(r);if(typeof l[i]=="string")a[l[i]]&&o.push(a[l[i]]);else if(l[i])for(var s=0;s<l[i].length;s++){var u=a[l[i][s]];u&&o.push(u)}else l.helperType&&a[l.helperType]?o.push(a[l.helperType]):a[l.name]&&o.push(a[l.name]);for(var d=0;d<a._global.length;d++){var p=a._global[d];p.pred(l,this)&&I(o,p.val)==-1&&o.push(p.val)}return o},getStateAfter:function(r,i){var o=this.doc;return r=yo(o,r==null?o.first+o.size-1:r),ln(this,r+1,i).state},cursorCoords:function(r,i){var o,a=this.doc.sel.primary();return r==null?o=a.head:typeof r=="object"?o=Z(this.doc,r):o=r?a.from():a.to(),zt(this,o,i||"page")},charCoords:function(r,i){return ei(this,Z(this.doc,r),i||"page")},coordsChar:function(r,i){return r=$o(this,r,i||"page"),Fi(this,r.left,r.top)},lineAtHeight:function(r,i){return r=$o(this,{top:r,left:0},i||"page").top,h(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,o){var a=!1,l;if(typeof r=="number"){var s=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>s&&(r=s,a=!0),l=F(this.doc,r)}else l=r;return $n(this,l,{top:0,left:0},i||"page",o||a).top+(a?this.doc.height-Zt(l):0)},defaultTextHeight:function(){return Br(this.display)},defaultCharWidth:function(){return Rr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,o,a,l){var s=this.display;r=zt(this,Z(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),a=="over")u=r.top;else if(a=="above"||a=="near"){var p=Math.max(s.wrapper.clientHeight,this.doc.height),g=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(a=="above"||r.bottom+i.offsetHeight>p)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=p&&(u=r.bottom),d+i.offsetWidth>g&&(d=g-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",l=="right"?(d=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(l=="left"?d=0:l=="middle"&&(d=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=d+"px"),o&&hs(this,{left:d,top:u,right:d+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:nt(rl),triggerOnKeyPress:nt(il),triggerOnKeyUp:nl,triggerOnMouseDown:nt(ol),execCommand:function(r){if(An.hasOwnProperty(r))return An[r].call(null,this)},triggerElectric:nt(function(r){dl(this,r)}),findPosH:function(r,i,o,a){var l=1;i<0&&(l=-1,i=-i);for(var s=Z(this.doc,r),u=0;u<i&&(s=vo(this.doc,s,l,o,a),!s.hitSide);++u);return s},moveH:nt(function(r,i){var o=this;this.extendSelectionsBy(function(a){return o.display.shift||o.doc.extend||a.empty()?vo(o.doc,a.head,r,i,o.options.rtlMoveVisually):r<0?a.from():a.to()},ce)}),deleteH:nt(function(r,i){var o=this.doc.sel,a=this.doc;o.somethingSelected()?a.replaceSelection("",null,"+delete"):Jr(this,function(l){var s=vo(a,l.head,r,i,!1);return r<0?{from:s,to:l.head}:{from:l.head,to:s}})}),findPosV:function(r,i,o,a){var l=1,s=a;i<0&&(l=-1,i=-i);for(var u=Z(this.doc,r),d=0;d<i;++d){var p=zt(this,u,"div");if(s==null?s=p.left:p.left=s,u=vl(this,p,l,o),u.hitSide)break}return u},moveV:nt(function(r,i){var o=this,a=this.doc,l=[],s=!this.display.shift&&!a.extend&&a.sel.somethingSelected();if(a.extendSelectionsBy(function(d){if(s)return r<0?d.from():d.to();var p=zt(o,d.head,"div");d.goalColumn!=null&&(p.left=d.goalColumn),l.push(p.left);var g=vl(o,p,r,i);return i=="page"&&d==a.sel.primary()&&Xi(o,ei(o,g,"div").top-p.top),g},ce),l.length)for(var u=0;u<a.sel.ranges.length;u++)a.sel.ranges[u].goalColumn=l[u]}),findWordAt:function(r){var i=this.doc,o=F(i,r.line).text,a=r.ch,l=r.ch;if(o){var s=this.getHelper(r,"wordChars");(r.sticky=="before"||l==o.length)&&a?--a:++l;for(var u=o.charAt(a),d=Gt(u,s)?function(p){return Gt(p,s)}:/\s/.test(u)?function(p){return/\s/.test(p)}:function(p){return!/\s/.test(p)&&!Gt(p)};a>0&&d(o.charAt(a-1));)--a;for(;l<o.length&&d(o.charAt(l));)++l}return new he(y(r.line,a),y(r.line,l))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Ae(this.display.cursorDiv,"CodeMirror-overwrite"):we(this.display.cursorDiv,"CodeMirror-overwrite"),Se(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==fe(gt(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:nt(function(r,i){pn(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Rt(this)-this.display.barHeight,width:r.scrollWidth-Rt(this)-this.display.barWidth,clientHeight:Pi(this),clientWidth:yr(this)}},scrollIntoView:nt(function(r,i){r==null?(r={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof r=="number"?r={from:y(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=i||0,r.from.line!=null?ps(this,r):sa(this,r.from,r.to,r.margin)}),setSize:nt(function(r,i){var o=this,a=function(s){return typeof s=="number"||/^\d+$/.test(String(s))?s+"px":s};r!=null&&(this.display.wrapper.style.width=a(r)),i!=null&&(this.display.wrapper.style.height=a(i)),this.options.lineWrapping&&Jo(this);var l=this.display.viewFrom;this.doc.iter(l,this.display.viewTo,function(s){if(s.widgets){for(var u=0;u<s.widgets.length;u++)if(s.widgets[u].noHScroll){sr(o,l,"widget");break}}++l}),this.curOp.forceUpdate=!0,Se(this,"refresh",this)}),operation:function(r){return yt(this,r)},startOperation:function(){return Cr(this)},endOperation:function(){return Lr(this)},refresh:nt(function(){var r=this.display.cachedTextHeight;ft(this),this.curOp.forceUpdate=!0,dn(this),pn(this,this.doc.scrollLeft,this.doc.scrollTop),Ji(this.display),(r==null||Math.abs(r-Br(this.display))>.5||this.options.lineWrapping)&&Ki(this),Se(this,"refresh",this)}),swapDoc:nt(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),ka(this,r),dn(this),this.display.input.reset(),pn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Ue(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}},Nt(e),e.registerHelper=function(r,i,o){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=o},e.registerGlobalHelper=function(r,i,o,a){e.registerHelper(r,i,a),n[r]._global.push({pred:o,val:a})}}function vo(e,t,n,r,i){var o=t,a=n,l=F(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var W=t.line+s;return W<e.first||W>=e.first+e.size?!1:(t=new y(W,t.ch,t.sticky),l=F(e,W))}function d(W){var A;if(r=="codepoint"){var P=l.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(P))A=null;else{var K=n>0?P>=55296&&P<56320:P>=56320&&P<57343;A=new y(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(K?2:1))),-n)}}else i?A=Qs(e.cm,l,t,n):A=ao(l,t,n);if(A==null)if(!W&&u())t=lo(i,e.cm,l,t.line,s);else return!1;else t=A;return!0}if(r=="char"||r=="codepoint")d();else if(r=="column")d(!0);else if(r=="word"||r=="group")for(var p=null,g=r=="group",v=e.cm&&e.cm.getHelper(t,"wordChars"),b=!0;!(n<0&&!d(!b));b=!1){var S=l.text.charAt(t.ch)||`
- `,L=Gt(S,v)?"w":g&&S==`
- `?"n":!g||/\s/.test(S)?null:"p";if(g&&!b&&!L&&(L="s"),p&&p!=L){n<0&&(n=1,d(),t.sticky="after");break}if(L&&(p=L),n>0&&!d(!b))break}var N=di(e,t,o,a,!0);return de(o,N)&&(N.hitSide=!0),N}function vl(e,t,n,r){var i=e.doc,o=t.left,a;if(r=="page"){var l=Math.min(e.display.wrapper.clientHeight,Y(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(l-.5*Br(e.display),3);a=(n>0?t.bottom:t.top)+n*s}else r=="line"&&(a=n>0?t.bottom+3:t.top-3);for(var u;u=Fi(e,o,a),!!u.outside;){if(n<0?a<=0:a>=i.height){u.hitSide=!0;break}a+=n*5}return u}var ge=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Q,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ge.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,po(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(l){for(var s=l.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}R(i,"paste",function(l){!o(l)||Ce(r,l)||cl(l,r)||te<=11&&setTimeout(Ge(r,function(){return t.updateFromDOM()}),20)}),R(i,"compositionstart",function(l){t.composing={data:l.data,done:!1}}),R(i,"compositionupdate",function(l){t.composing||(t.composing={data:l.data,done:!1})}),R(i,"compositionend",function(l){t.composing&&(l.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),R(i,"touchstart",function(){return n.forceCompositionEnd()}),R(i,"input",function(){t.composing||t.readFromDOMSoon()});function a(l){if(!(!o(l)||Ce(r,l))){if(r.somethingSelected())yi({lineWise:!1,text:r.getSelections()}),l.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=hl(r);yi({lineWise:!0,text:s.text}),l.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,at),r.replaceSelection("",null,"cut")})}else return;if(l.clipboardData){l.clipboardData.clearData();var u=Et.text.join(`
- `);if(l.clipboardData.setData("Text",u),l.clipboardData.getData("Text")==u){l.preventDefault();return}}var d=pl(),p=d.firstChild;po(p),r.display.lineSpace.insertBefore(d,r.display.lineSpace.firstChild),p.value=Et.text.join(`
- `);var g=fe(be(i));Ut(p),setTimeout(function(){r.display.lineSpace.removeChild(d),g.focus(),g==i&&n.showPrimarySelection()},50)}}R(i,"copy",a),R(i,"cut",a)},ge.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},ge.prototype.prepareSelection=function(){var e=oa(this.cm,!1);return e.focus=fe(be(this.div))==this.div,e},ge.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},ge.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ge.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var o=bi(t,e.anchorNode,e.anchorOffset),a=bi(t,e.focusNode,e.focusOffset);if(!(o&&!o.bad&&a&&!a.bad&&D(Hr(o,a),r)==0&&D(ut(o,a),i)==0)){var l=t.display.view,s=r.line>=t.display.viewFrom&&gl(t,r)||{node:l[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&gl(t,i);if(!u){var d=l[l.length-1].measure,p=d.maps?d.maps[d.maps.length-1]:d.map;u={node:p[p.length-1],offset:p[p.length-2]-p[p.length-3]}}if(!s||!u){e.removeAllRanges();return}var g=e.rangeCount&&e.getRangeAt(0),v;try{v=T(s.node,s.offset,u.offset,u.node)}catch(b){}v&&(!ve&&t.state.focused?(e.collapse(s.node,s.offset),v.collapsed||(e.removeAllRanges(),e.addRange(v))):(e.removeAllRanges(),e.addRange(v)),g&&e.anchorNode==null?e.addRange(g):ve&&this.startGracePeriod()),this.rememberSelection()}},ge.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},ge.prototype.showMultipleSelections=function(e){z(this.cm.display.cursorDiv,e.cursors),z(this.cm.display.selectionDiv,e.selection)},ge.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},ge.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return U(this.div,t)},ge.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||fe(be(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},ge.prototype.blur=function(){this.div.blur()},ge.prototype.getField=function(){return this.div},ge.prototype.supportsTouch=function(){return!0},ge.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):yt(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},ge.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},ge.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(J&&_&&this.cm.display.gutterSpecs.length&&mu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=bi(t,e.anchorNode,e.anchorOffset),r=bi(t,e.focusNode,e.focusOffset);n&&r&&yt(t,function(){et(t.doc,fr(n,r),at),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},ge.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=y(r.line-1,F(e.doc,r.line-1).length)),i.ch==F(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=y(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,a,l;r.line==t.viewFrom||(o=wr(e,r.line))==0?(a=f(t.view[0].line),l=t.view[0].node):(a=f(t.view[o].line),l=t.view[o-1].node.nextSibling);var s=wr(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),!l)return!1;for(var p=e.doc.splitLines(yu(e,l,d,a,u)),g=Xt(e.doc,y(a,0),y(u,F(e.doc,u).text.length));p.length>1&&g.length>1;)if(le(p)==le(g))p.pop(),g.pop(),u--;else if(p[0]==g[0])p.shift(),g.shift(),a++;else break;for(var v=0,b=0,S=p[0],L=g[0],N=Math.min(S.length,L.length);v<N&&S.charCodeAt(v)==L.charCodeAt(v);)++v;for(var W=le(p),A=le(g),P=Math.min(W.length-(p.length==1?v:0),A.length-(g.length==1?v:0));b<P&&W.charCodeAt(W.length-b-1)==A.charCodeAt(A.length-b-1);)++b;if(p.length==1&&g.length==1&&a==r.line)for(;v&&v>r.ch&&W.charCodeAt(W.length-b-1)==A.charCodeAt(A.length-b-1);)v--,b++;p[p.length-1]=W.slice(0,W.length-b).replace(/^\u200b+/,""),p[0]=p[0].slice(v).replace(/\u200b+$/,"");var K=y(a,v),B=y(u,g.length?le(g).length-b:0);if(p.length>1||p[0]||D(K,B))return Xr(e.doc,p,K,B,"+input"),!0},ge.prototype.ensurePolled=function(){this.forceCompositionEnd()},ge.prototype.reset=function(){this.forceCompositionEnd()},ge.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ge.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},ge.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&yt(this.cm,function(){return ft(e.cm)})},ge.prototype.setUneditable=function(e){e.contentEditable="false"},ge.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Ge(this.cm,ho)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},ge.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},ge.prototype.onContextMenu=function(){},ge.prototype.resetPosition=function(){},ge.prototype.needsContentAttribute=!0;function gl(e,t){var n=zi(e,t.line);if(!n||n.hidden)return null;var r=F(e.doc,t.line),i=qo(n,r,t.line),o=ae(r,e.doc.direction),a="left";if(o){var l=rr(o,t.ch);a=l%2?"right":"left"}var s=Yo(i.map,t.ch,a);return s.offset=s.collapse=="right"?s.end:s.start,s}function mu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Vr(e,t){return t&&(e.bad=!0),e}function yu(e,t,n,r,i){var o="",a=!1,l=e.doc.lineSeparator(),s=!1;function u(v){return function(b){return b.id==v}}function d(){a&&(o+=l,s&&(o+=l),a=s=!1)}function p(v){v&&(d(),o+=v)}function g(v){if(v.nodeType==1){var b=v.getAttribute("cm-text");if(b){p(b);return}var S=v.getAttribute("cm-marker"),L;if(S){var N=e.findMarks(y(r,0),y(i+1,0),u(+S));N.length&&(L=N[0].find(0))&&p(Xt(e.doc,L.from,L.to).join(l));return}if(v.getAttribute("contenteditable")=="false")return;var W=/^(pre|div|p|li|table|br)$/i.test(v.nodeName);if(!/^br$/i.test(v.nodeName)&&v.textContent.length==0)return;W&&d();for(var A=0;A<v.childNodes.length;A++)g(v.childNodes[A]);/^(pre|p)$/i.test(v.nodeName)&&(s=!0),W&&(a=!0)}else v.nodeType==3&&p(v.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;g(t),t!=n;)t=t.nextSibling,s=!1;return o}function bi(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return Vr(e.clipPos(y(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return bu(o,t,n)}}function bu(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!U(r,t))return Vr(y(f(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?le(e.rest):e.line;return Vr(y(f(o),o.text.length),i)}var a=t.nodeType==3?t:null,l=t;for(!a&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(a=t.firstChild,n&&(n=a.nodeValue.length));l.parentNode!=r;)l=l.parentNode;var s=e.measure,u=s.maps;function d(L,N,W){for(var A=-1;A<(u?u.length:0);A++)for(var P=A<0?s.map:u[A],K=0;K<P.length;K+=3){var B=P[K+2];if(B==L||B==N){var $=f(A<0?e.line:e.rest[A]),ye=P[K]+W;return(W<0||B!=L)&&(ye=P[K+(W?1:0)]),y($,ye)}}}var p=d(a,l,n);if(p)return Vr(p,i);for(var g=l.nextSibling,v=a?a.nodeValue.length-n:0;g;g=g.nextSibling){if(p=d(g,g.firstChild,0),p)return Vr(y(p.line,p.ch-v),i);v+=g.textContent.length}for(var b=l.previousSibling,S=n;b;b=b.previousSibling){if(p=d(b,b.firstChild,-1),p)return Vr(y(p.line,p.ch+S),i);S+=b.textContent.length}}var De=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Q,this.hasSelection=!1,this.composing=null,this.resetting=!1};De.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),ee&&(i.style.width="0px"),R(i,"input",function(){H&&te>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),R(i,"paste",function(a){Ce(r,a)||cl(a,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function o(a){if(!Ce(r,a)){if(r.somethingSelected())yi({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var l=hl(r);yi({lineWise:!0,text:l.text}),a.type=="cut"?r.setSelections(l.ranges,null,at):(n.prevInput="",i.value=l.text.join(`
- `),Ut(i))}else return;a.type=="cut"&&(r.state.cutIncoming=+new Date)}}R(i,"cut",o),R(i,"copy",o),R(e.scroller,"paste",function(a){if(!(Jt(e,a)||Ce(r,a))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var l=new Event("paste");l.clipboardData=a.clipboardData,i.dispatchEvent(l)}}),R(e.lineSpace,"selectstart",function(a){Jt(e,a)||$e(a)}),R(i,"compositionstart",function(){var a=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:a,range:r.markText(a,r.getCursor("to"),{className:"CodeMirror-composing"})}}),R(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},De.prototype.createField=function(e){this.wrapper=pl(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;po(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},De.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},De.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=oa(e);if(e.options.moveInputWithCursor){var i=zt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},De.prototype.showSelection=function(e){var t=this.cm,n=t.display;z(n.cursorDiv,e.cursors),z(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},De.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&&Ut(this.textarea),H&&te>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",H&&te>=9&&(this.hasSelection=null));this.resetting=!1}},De.prototype.getField=function(){return this.textarea},De.prototype.supportsTouch=function(){return!1},De.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!ie||fe(be(this.textarea))!=this.textarea))try{this.textarea.focus()}catch(e){}},De.prototype.blur=function(){this.textarea.blur()},De.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},De.prototype.receivedFocus=function(){this.slowPoll()},De.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},De.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)},De.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||or(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(H&&te>=9&&this.hasSelection===i||pe&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(o==8203&&!r&&(r=""),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var a=0,l=Math.min(r.length,i.length);a<l&&r.charCodeAt(a)==i.charCodeAt(a);)++a;return yt(t,function(){ho(t,i.slice(a),r.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
- `)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},De.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},De.prototype.onKeyPress=function(){H&&te>=9&&(this.hasSelection=null),this.fastPoll()},De.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=xr(n,e),a=r.scroller.scrollTop;if(!o||ne)return;var l=n.options.resetSelectionOnContextMenu;l&&n.doc.sel.contains(o)==-1&&Ge(n,et)(n.doc,fr(o),at);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: `+(H?"rgba(255, 255, 255, .05)":"transparent")+`;
- outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var p;q&&(p=i.ownerDocument.defaultView.scrollY),r.input.focus(),q&&i.ownerDocument.defaultView.scrollTo(null,p),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function g(){if(i.selectionStart!=null){var S=n.somethingSelected(),L=""+(S?i.value:"");i.value="⇚",i.value=L,t.prevInput=S?"":"",i.selectionStart=1,i.selectionEnd=L.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=s,H&&te<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=a),i.selectionStart!=null)){(!H||H&&te<9)&&g();var S=0,L=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput==""?Ge(n,Ha)(n):S++<10?r.detectingSelectAll=setTimeout(L,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(L,200)}}if(H&&te>=9&&g(),X){nr(e);var b=function(){Ve(window,"mouseup",b),setTimeout(v,20)};R(window,"mouseup",b)}else setTimeout(v,50)},De.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},De.prototype.setUneditable=function(){},De.prototype.needsContentAttribute=!1;function xu(e,t){if(t=t?V(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=fe(be(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=l.getValue()}var i;if(e.form&&(R(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(s){}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(Ve(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var l=xe(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return l}function wu(e){e.off=Ve,e.on=R,e.wheelEventPixels=Ns,e.Doc=ct,e.splitLines=Lt,e.countColumn=se,e.findColumn=We,e.isWordChar=Qe,e.Pass=Mt,e.signal=Se,e.Line=Er,e.changeEnd=cr,e.scrollbarModel=ca,e.Pos=y,e.cmpPos=D,e.modes=Dr,e.mimeModes=Ot,e.resolveMode=Or,e.getMode=Wr,e.modeExtensions=ar,e.extendMode=Pr,e.copyState=It,e.startState=zr,e.innerMode=on,e.commands=An,e.keyMap=Vt,e.keyName=Qa,e.isModifierKey=Za,e.lookupKey=Zr,e.normalizeKeyMap=Js,e.StringStream=Le,e.SharedTextMarker=Tn,e.TextMarker=hr,e.LineWidget=Ln,e.e_preventDefault=$e,e.e_stopPropagation=Nr,e.e_stop=nr,e.addClass=Ae,e.contains=U,e.rmClass=we,e.keyNames=pr}du(xe),gu(xe);var ku="iter insert remove copy getEditor constructor".split(" ");for(var xi in ct.prototype)ct.prototype.hasOwnProperty(xi)&&I(ku,xi)<0&&(xe.prototype[xi]=function(e){return function(){return e.apply(this.doc,arguments)}}(ct.prototype[xi]));return Nt(ct),xe.inputStyles={textarea:De,contenteditable:ge},xe.defineMode=function(e){!xe.defaults.mode&&e!="null"&&(xe.defaults.mode=e),Wt.apply(this,arguments)},xe.defineMIME=mr,xe.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),xe.defineMIME("text/plain","null"),xe.defineExtension=function(e,t){xe.prototype[e]=t},xe.defineDocExtension=function(e,t){ct.prototype[e]=t},xe.fromTextArea=xu,wu(xe),xe.version="5.65.19",xe})}(zn,zn.exports)),zn.exports}var Lu=Bn();const Nu=Su(Lu);var Hn={exports:{}},Au=Hn.exports,yl;function kl(){return yl||(yl=1,function(tn,Rn){(function(E){E(Bn())})(function(E){"use strict";E.defineMode("javascript",function(Oe,ve){var Je=Oe.indentUnit,vt=ve.statementIndent,Ee=ve.jsonld,H=ve.json||Ee,te=ve.trackScope!==!1,q=ve.typescript,re=ve.wordCharacters||/[\w$\xa1-\uffff]/,_=function(){function f(_e){return{type:_e,style:"keyword"}}var h=f("keyword a"),w=f("keyword b"),C=f("keyword c"),y=f("keyword d"),D=f("operator"),de={type:"atom",style:"atom"};return{if:f("if"),while:h,with:h,else:w,do:w,try:w,finally:w,return:y,break:y,continue:y,new:f("new"),delete:C,void:C,throw:C,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:D,typeof:D,instanceof:D,true:de,false:de,null:de,undefined:de,NaN:de,Infinity:de,this:f("this"),class:f("class"),super:f("atom"),yield:C,export:f("export"),import:f("import"),extends:C,await:C}}(),oe=/[+\-*&%=<>!?|~^@]/,ne=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function Me(f){for(var h=!1,w,C=!1;(w=f.next())!=null;){if(!h){if(w=="/"&&!C)return;w=="["?C=!0:C&&w=="]"&&(C=!1)}h=!h&&w=="\\"}}var Ne,Fe;function ee(f,h,w){return Ne=f,Fe=w,h}function J(f,h){var w=f.next();if(w=='"'||w=="'")return h.tokenize=ie(w),h.tokenize(f,h);if(w=="."&&f.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return ee("number","number");if(w=="."&&f.match(".."))return ee("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(w))return ee(w);if(w=="="&&f.eat(">"))return ee("=>","operator");if(w=="0"&&f.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return ee("number","number");if(/\d/.test(w))return f.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),ee("number","number");if(w=="/")return f.eat("*")?(h.tokenize=pe,pe(f,h)):f.eat("/")?(f.skipToEnd(),ee("comment","comment")):kt(f,h,1)?(Me(f),f.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),ee("regexp","string-2")):(f.eat("="),ee("operator","operator",f.current()));if(w=="`")return h.tokenize=Ke,Ke(f,h);if(w=="#"&&f.peek()=="!")return f.skipToEnd(),ee("meta","meta");if(w=="#"&&f.eatWhile(re))return ee("variable","property");if(w=="<"&&f.match("!--")||w=="-"&&f.match("->")&&!/\S/.test(f.string.slice(0,f.start)))return f.skipToEnd(),ee("comment","comment");if(oe.test(w))return(w!=">"||!h.lexical||h.lexical.type!=">")&&(f.eat("=")?(w=="!"||w=="=")&&f.eat("="):/[<>*+\-|&?]/.test(w)&&(f.eat(w),w==">"&&f.eat(w))),w=="?"&&f.eat(".")?ee("."):ee("operator","operator",f.current());if(re.test(w)){f.eatWhile(re);var C=f.current();if(h.lastType!="."){if(_.propertyIsEnumerable(C)){var y=_[C];return ee(y.type,y.style,C)}if(C=="async"&&f.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return ee("async","keyword",C)}return ee("variable","variable",C)}}function ie(f){return function(h,w){var C=!1,y;if(Ee&&h.peek()=="@"&&h.match(ne))return w.tokenize=J,ee("jsonld-keyword","meta");for(;(y=h.next())!=null&&!(y==f&&!C);)C=!C&&y=="\\";return C||(w.tokenize=J),ee("string","string")}}function pe(f,h){for(var w=!1,C;C=f.next();){if(C=="/"&&w){h.tokenize=J;break}w=C=="*"}return ee("comment","comment")}function Ke(f,h){for(var w=!1,C;(C=f.next())!=null;){if(!w&&(C=="`"||C=="$"&&f.eat("{"))){h.tokenize=J;break}w=!w&&C=="\\"}return ee("quasi","string-2",f.current())}var ot="([{}])";function Ie(f,h){h.fatArrowAt&&(h.fatArrowAt=null);var w=f.string.indexOf("=>",f.start);if(!(w<0)){if(q){var C=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(f.string.slice(f.start,w));C&&(w=C.index)}for(var y=0,D=!1,de=w-1;de>=0;--de){var _e=f.string.charAt(de),ut=ot.indexOf(_e);if(ut>=0&&ut<3){if(!y){++de;break}if(--y==0){_e=="("&&(D=!0);break}}else if(ut>=3&&ut<6)++y;else if(re.test(_e))D=!0;else if(/["'\/`]/.test(_e))for(;;--de){if(de==0)return;var Hr=f.string.charAt(de-1);if(Hr==_e&&f.string.charAt(de-2)!="\\"){de--;break}}else if(D&&!y){++de;break}}D&&!y&&(h.fatArrowAt=de)}}var Be={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function X(f,h,w,C,y,D){this.indented=f,this.column=h,this.type=w,this.prev=y,this.info=D,C!=null&&(this.align=C)}function G(f,h){if(!te)return!1;for(var w=f.localVars;w;w=w.next)if(w.name==h)return!0;for(var C=f.context;C;C=C.prev)for(var w=C.vars;w;w=w.next)if(w.name==h)return!0}function we(f,h,w,C,y){var D=f.cc;for(k.state=f,k.stream=y,k.marked=null,k.cc=D,k.style=h,f.lexical.hasOwnProperty("align")||(f.lexical.align=!0);;){var de=D.length?D.pop():H?I:se;if(de(w,C)){for(;D.length&&D[D.length-1].lex;)D.pop()();return k.marked?k.marked:w=="variable"&&G(f,C)?"variable-2":h}}}var k={state:null,column:null,marked:null,cc:null};function z(){for(var f=arguments.length-1;f>=0;f--)k.cc.push(arguments[f])}function c(){return z.apply(null,arguments),!0}function O(f,h){for(var w=h;w;w=w.next)if(w.name==f)return!0;return!1}function T(f){var h=k.state;if(k.marked="def",!!te){if(h.context){if(h.lexical.info=="var"&&h.context&&h.context.block){var w=U(f,h.context);if(w!=null){h.context=w;return}}else if(!O(f,h.localVars)){h.localVars=new Tt(f,h.localVars);return}}ve.globalVars&&!O(f,h.globalVars)&&(h.globalVars=new Tt(f,h.globalVars))}}function U(f,h){if(h)if(h.block){var w=U(f,h.prev);return w?w==h.prev?h:new Ae(w,h.vars,!0):null}else return O(f,h.vars)?h:new Ae(h.prev,new Tt(f,h.vars),!1);else return null}function fe(f){return f=="public"||f=="private"||f=="protected"||f=="abstract"||f=="readonly"}function Ae(f,h,w){this.prev=f,this.vars=h,this.block=w}function Tt(f,h){this.name=f,this.next=h}var Ut=new Tt("this",new Tt("arguments",null));function rt(){k.state.context=new Ae(k.state.context,k.state.localVars,!1),k.state.localVars=Ut}function gt(){k.state.context=new Ae(k.state.context,k.state.localVars,!0),k.state.localVars=null}rt.lex=gt.lex=!0;function be(){k.state.localVars=k.state.context.vars,k.state.context=k.state.context.prev}be.lex=!0;function Y(f,h){var w=function(){var C=k.state,y=C.indented;if(C.lexical.type=="stat")y=C.lexical.indented;else for(var D=C.lexical;D&&D.type==")"&&D.align;D=D.prev)y=D.indented;C.lexical=new X(y,k.stream.column(),f,null,C.lexical,h)};return w.lex=!0,w}function j(){var f=k.state;f.lexical.prev&&(f.lexical.type==")"&&(f.indented=f.lexical.indented),f.lexical=f.lexical.prev)}j.lex=!0;function V(f){function h(w){return w==f?c():f==";"||w=="}"||w==")"||w=="]"?z():c(h)}return h}function se(f,h){return f=="var"?c(Y("vardef",h),Nr,V(";"),j):f=="keyword a"?c(Y("form"),Mt,se,j):f=="keyword b"?c(Y("form"),se,j):f=="keyword d"?k.stream.match(/^\s*$/,!1)?c():c(Y("stat"),xt,V(";"),j):f=="debugger"?c(V(";")):f=="{"?c(Y("}"),gt,Ft,j,be):f==";"?c():f=="if"?(k.state.lexical.info=="else"&&k.state.cc[k.state.cc.length-1]==j&&k.state.cc.pop()(),c(Y("form"),Mt,se,j,Ar)):f=="function"?c(Lt):f=="for"?c(Y("form"),gt,Un,se,be,j):f=="class"||q&&h=="interface"?(k.marked="keyword",c(Y("form",f=="class"?f:h),Dr,j)):f=="variable"?q&&h=="declare"?(k.marked="keyword",c(se)):q&&(h=="module"||h=="enum"||h=="type")&&k.stream.match(/^\s*\w/,!1)?(k.marked="keyword",h=="enum"?c(F):h=="type"?c(Gn,V("operator"),ae,V(";")):c(Y("form"),st,V("{"),Y("}"),Ft,j,j)):q&&h=="namespace"?(k.marked="keyword",c(Y("form"),I,se,j)):q&&h=="abstract"?(k.marked="keyword",c(se)):c(Y("stat"),ue):f=="switch"?c(Y("form"),Mt,V("{"),Y("}","switch"),gt,Ft,j,j,be):f=="case"?c(I,V(":")):f=="default"?c(V(":")):f=="catch"?c(Y("form"),rt,Q,se,j,be):f=="export"?c(Y("stat"),Or,j):f=="import"?c(Y("stat"),ar,j):f=="async"?c(se):h=="@"?c(I,se):z(Y("stat"),I,V(";"),j)}function Q(f){if(f=="(")return c(Dt,V(")"))}function I(f,h){return at(f,h,!1)}function Ye(f,h){return at(f,h,!0)}function Mt(f){return f!="("?z():c(Y(")"),xt,V(")"),j)}function at(f,h,w){if(k.state.fatArrowAt==k.stream.start){var C=w?me:le;if(f=="(")return c(rt,Y(")"),Pe(Dt,")"),j,V("=>"),C,be);if(f=="variable")return z(rt,st,V("=>"),C,be)}var y=w?We:ce;return Be.hasOwnProperty(f)?c(y):f=="function"?c(Lt,y):f=="class"||q&&h=="interface"?(k.marked="keyword",c(Y("form"),Si,j)):f=="keyword c"||f=="async"?c(w?Ye:I):f=="("?c(Y(")"),xt,V(")"),j,y):f=="operator"||f=="spread"?c(w?Ye:I):f=="["?c(Y("]"),Le,j,y):f=="{"?er(Gt,"}",null,y):f=="quasi"?z(lt,y):f=="new"?c(m(w)):c()}function xt(f){return f.match(/[;\}\)\],]/)?z():z(I)}function ce(f,h){return f==","?c(xt):We(f,h,!1)}function We(f,h,w){var C=w==!1?ce:We,y=w==!1?I:Ye;if(f=="=>")return c(rt,w?me:le,be);if(f=="operator")return/\+\+|--/.test(h)||q&&h=="!"?c(C):q&&h=="<"&&k.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?c(Y(">"),Pe(ae,">"),j,C):h=="?"?c(I,V(":"),y):c(y);if(f=="quasi")return z(lt,C);if(f!=";"){if(f=="(")return er(Ye,")","call",C);if(f==".")return c(Qe,C);if(f=="[")return c(Y("]"),xt,V("]"),j,C);if(q&&h=="as")return k.marked="keyword",c(ae,C);if(f=="regexp")return k.state.lastType=k.marked="operator",k.stream.backUp(k.stream.pos-k.stream.start-1),c(y)}}function lt(f,h){return f!="quasi"?z():h.slice(h.length-2)!="${"?c(lt):c(xt,wt)}function wt(f){if(f=="}")return k.marked="string-2",k.state.tokenize=Ke,c(lt)}function le(f){return Ie(k.stream,k.state),z(f=="{"?se:I)}function me(f){return Ie(k.stream,k.state),z(f=="{"?se:Ye)}function m(f){return function(h){return h=="."?c(f?x:M):h=="variable"&&q?c(mt,f?We:ce):z(f?Ye:I)}}function M(f,h){if(h=="target")return k.marked="keyword",c(ce)}function x(f,h){if(h=="target")return k.marked="keyword",c(We)}function ue(f){return f==":"?c(j,se):z(ce,V(";"),j)}function Qe(f){if(f=="variable")return k.marked="property",c()}function Gt(f,h){if(f=="async")return k.marked="property",c(Gt);if(f=="variable"||k.style=="keyword"){if(k.marked="property",h=="get"||h=="set")return c(Kn);var w;return q&&k.state.fatArrowAt==k.stream.start&&(w=k.stream.match(/^\s*:\s*/,!1))&&(k.state.fatArrowAt=k.stream.pos+w[0].length),c(qt)}else{if(f=="number"||f=="string")return k.marked=Ee?"property":k.style+" property",c(qt);if(f=="jsonld-keyword")return c(qt);if(q&&fe(h))return k.marked="keyword",c(Gt);if(f=="[")return c(I,tr,V("]"),qt);if(f=="spread")return c(Ye,qt);if(h=="*")return k.marked="keyword",c(Gt);if(f==":")return z(qt)}}function Kn(f){return f!="variable"?z(qt):(k.marked="property",c(Lt))}function qt(f){if(f==":")return c(Ye);if(f=="(")return z(Lt)}function Pe(f,h,w){function C(y,D){if(w?w.indexOf(y)>-1:y==","){var de=k.state.lexical;return de.info=="call"&&(de.pos=(de.pos||0)+1),c(function(_e,ut){return _e==h||ut==h?z():z(f)},C)}return y==h||D==h?c():w&&w.indexOf(";")>-1?z(f):c(V(h))}return function(y,D){return y==h||D==h?c():z(f,C)}}function er(f,h,w){for(var C=3;C<arguments.length;C++)k.cc.push(arguments[C]);return c(Y(h,w),Pe(f,h),j)}function Ft(f){return f=="}"?c():z(se,Ft)}function tr(f,h){if(q){if(f==":")return c(ae);if(h=="?")return c(tr)}}function gr(f,h){if(q&&(f==":"||h=="in"))return c(ae)}function rr(f){if(q&&f==":")return k.stream.match(/^\s*\w+\s+is\b/,!1)?c(I,wi,ae):c(ae)}function wi(f,h){if(h=="is")return k.marked="keyword",c()}function ae(f,h){if(h=="keyof"||h=="typeof"||h=="infer"||h=="readonly")return k.marked="keyword",c(h=="typeof"?Ye:ae);if(f=="variable"||h=="void")return k.marked="type",c(Ct);if(h=="|"||h=="&")return c(ae);if(f=="string"||f=="number"||f=="atom")return c(Ct);if(f=="[")return c(Y("]"),Pe(ae,"]",","),j,Ct);if(f=="{")return c(Y("}"),R,j,Ct);if(f=="(")return c(Pe(Ce,")"),_n,Ct);if(f=="<")return c(Pe(ae,">"),ae);if(f=="quasi")return z(Ve,Ct)}function _n(f){if(f=="=>")return c(ae)}function R(f){return f.match(/[\}\)\]]/)?c():f==","||f==";"?c(R):z(jt,R)}function jt(f,h){if(f=="variable"||k.style=="keyword")return k.marked="property",c(jt);if(h=="?"||f=="number"||f=="string")return c(jt);if(f==":")return c(ae);if(f=="[")return c(V("variable"),gr,V("]"),jt);if(f=="(")return z(or,jt);if(!f.match(/[;\}\)\],]/))return c()}function Ve(f,h){return f!="quasi"?z():h.slice(h.length-2)!="${"?c(Ve):c(ae,Se)}function Se(f){if(f=="}")return k.marked="string-2",k.state.tokenize=Ke,c(Ve)}function Ce(f,h){return f=="variable"&&k.stream.match(/^\s*[?:]/,!1)||h=="?"?c(Ce):f==":"?c(ae):f=="spread"?c(Ce):z(ae)}function Ct(f,h){if(h=="<")return c(Y(">"),Pe(ae,">"),j,Ct);if(h=="|"||f=="."||h=="&")return c(ae);if(f=="[")return c(ae,V("]"),Ct);if(h=="extends"||h=="implements")return k.marked="keyword",c(ae);if(h=="?")return c(ae,V(":"),ae)}function mt(f,h){if(h=="<")return c(Y(">"),Pe(ae,">"),j,Ct)}function Nt(){return z(ae,$e)}function $e(f,h){if(h=="=")return c(ae)}function Nr(f,h){return h=="enum"?(k.marked="keyword",c(F)):z(st,tr,At,ki)}function st(f,h){if(q&&fe(h))return k.marked="keyword",c(st);if(f=="variable")return T(h),c();if(f=="spread")return c(st);if(f=="[")return er(rn,"]");if(f=="{")return er(nr,"}")}function nr(f,h){return f=="variable"&&!k.stream.match(/^\s*:/,!1)?(T(h),c(At)):(f=="variable"&&(k.marked="property"),f=="spread"?c(st):f=="}"?z():f=="["?c(I,V("]"),V(":"),nr):c(V(":"),st,At))}function rn(){return z(st,At)}function At(f,h){if(h=="=")return c(Ye)}function ki(f){if(f==",")return c(Nr)}function Ar(f,h){if(f=="keyword b"&&h=="else")return c(Y("form","else"),se,j)}function Un(f,h){if(h=="await")return c(Un);if(f=="(")return c(Y(")"),nn,j)}function nn(f){return f=="var"?c(Nr,ir):f=="variable"?c(ir):z(ir)}function ir(f,h){return f==")"?c():f==";"?c(ir):h=="in"||h=="of"?(k.marked="keyword",c(I,ir)):z(I,ir)}function Lt(f,h){if(h=="*")return k.marked="keyword",c(Lt);if(f=="variable")return T(h),c(Lt);if(f=="(")return c(rt,Y(")"),Pe(Dt,")"),j,rr,se,be);if(q&&h=="<")return c(Y(">"),Pe(Nt,">"),j,Lt)}function or(f,h){if(h=="*")return k.marked="keyword",c(or);if(f=="variable")return T(h),c(or);if(f=="(")return c(rt,Y(")"),Pe(Dt,")"),j,rr,be);if(q&&h=="<")return c(Y(">"),Pe(Nt,">"),j,or)}function Gn(f,h){if(f=="keyword"||f=="variable")return k.marked="type",c(Gn);if(h=="<")return c(Y(">"),Pe(Nt,">"),j)}function Dt(f,h){return h=="@"&&c(I,Dt),f=="spread"?c(Dt):q&&fe(h)?(k.marked="keyword",c(Dt)):q&&f=="this"?c(tr,At):z(st,tr,At)}function Si(f,h){return f=="variable"?Dr(f,h):Ot(f,h)}function Dr(f,h){if(f=="variable")return T(h),c(Ot)}function Ot(f,h){if(h=="<")return c(Y(">"),Pe(Nt,">"),j,Ot);if(h=="extends"||h=="implements"||q&&f==",")return h=="implements"&&(k.marked="keyword"),c(q?ae:I,Ot);if(f=="{")return c(Y("}"),Wt,j)}function Wt(f,h){if(f=="async"||f=="variable"&&(h=="static"||h=="get"||h=="set"||q&&fe(h))&&k.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return k.marked="keyword",c(Wt);if(f=="variable"||k.style=="keyword")return k.marked="property",c(mr,Wt);if(f=="number"||f=="string")return c(mr,Wt);if(f=="[")return c(I,tr,V("]"),mr,Wt);if(h=="*")return k.marked="keyword",c(Wt);if(q&&f=="(")return z(or,Wt);if(f==";"||f==",")return c(Wt);if(f=="}")return c();if(h=="@")return c(I,Wt)}function mr(f,h){if(h=="!"||h=="?")return c(mr);if(f==":")return c(ae,At);if(h=="=")return c(Ye);var w=k.state.lexical.prev,C=w&&w.info=="interface";return z(C?or:Lt)}function Or(f,h){return h=="*"?(k.marked="keyword",c(zr,V(";"))):h=="default"?(k.marked="keyword",c(I,V(";"))):f=="{"?c(Pe(Wr,"}"),zr,V(";")):z(se)}function Wr(f,h){if(h=="as")return k.marked="keyword",c(V("variable"));if(f=="variable")return z(Ye,Wr)}function ar(f){return f=="string"?c():f=="("?z(I):f=="."?z(ce):z(Pr,It,zr)}function Pr(f,h){return f=="{"?er(Pr,"}"):(f=="variable"&&T(h),h=="*"&&(k.marked="keyword"),c(on))}function It(f){if(f==",")return c(Pr,It)}function on(f,h){if(h=="as")return k.marked="keyword",c(Pr)}function zr(f,h){if(h=="from")return k.marked="keyword",c(I)}function Le(f){return f=="]"?c():z(Pe(Ye,"]"))}function F(){return z(Y("form"),st,V("{"),Y("}"),Pe(Xt,"}"),j,j)}function Xt(){return z(st,At)}function an(f,h){return f.lastType=="operator"||f.lastType==","||oe.test(h.charAt(0))||/[,.]/.test(h.charAt(0))}function kt(f,h,w){return h.tokenize==J&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(h.lastType)||h.lastType=="quasi"&&/\{\s*$/.test(f.string.slice(0,f.pos-(w||0)))}return{startState:function(f){var h={tokenize:J,lastType:"sof",cc:[],lexical:new X((f||0)-Je,0,"block",!1),localVars:ve.localVars,context:ve.localVars&&new Ae(null,null,!1),indented:f||0};return ve.globalVars&&typeof ve.globalVars=="object"&&(h.globalVars=ve.globalVars),h},token:function(f,h){if(f.sol()&&(h.lexical.hasOwnProperty("align")||(h.lexical.align=!1),h.indented=f.indentation(),Ie(f,h)),h.tokenize!=pe&&f.eatSpace())return null;var w=h.tokenize(f,h);return Ne=="comment"?w:(h.lastType=Ne=="operator"&&(Fe=="++"||Fe=="--")?"incdec":Ne,we(h,w,Ne,Fe,f))},indent:function(f,h){if(f.tokenize==pe||f.tokenize==Ke)return E.Pass;if(f.tokenize!=J)return 0;var w=h&&h.charAt(0),C=f.lexical,y;if(!/^\s*else\b/.test(h))for(var D=f.cc.length-1;D>=0;--D){var de=f.cc[D];if(de==j)C=C.prev;else if(de!=Ar&&de!=be)break}for(;(C.type=="stat"||C.type=="form")&&(w=="}"||(y=f.cc[f.cc.length-1])&&(y==ce||y==We)&&!/^[,\.=+\-*:?[\(]/.test(h));)C=C.prev;vt&&C.type==")"&&C.prev.type=="stat"&&(C=C.prev);var _e=C.type,ut=w==_e;return _e=="vardef"?C.indented+(f.lastType=="operator"||f.lastType==","?C.info.length+1:0):_e=="form"&&w=="{"?C.indented:_e=="form"?C.indented+Je:_e=="stat"?C.indented+(an(f,h)?vt||Je:0):C.info=="switch"&&!ut&&ve.doubleIndentSwitch!=!1?C.indented+(/^(?:case|default)\b/.test(h)?Je:2*Je):C.align?C.column+(ut?0:1):C.indented+(ut?0:Je)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:H?null:"/*",blockCommentEnd:H?null:"*/",blockCommentContinue:H?null:" * ",lineComment:H?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:H?"json":"javascript",jsonldMode:Ee,jsonMode:H,expressionAllowed:kt,skipExpression:function(f){we(f,"atom","atom","true",new E.StringStream("",2,null))}}}),E.registerHelper("wordChars","javascript",/[\w$]/),E.defineMIME("text/javascript","javascript"),E.defineMIME("text/ecmascript","javascript"),E.defineMIME("application/javascript","javascript"),E.defineMIME("application/x-javascript","javascript"),E.defineMIME("application/ecmascript","javascript"),E.defineMIME("application/json",{name:"javascript",json:!0}),E.defineMIME("application/x-json",{name:"javascript",json:!0}),E.defineMIME("application/manifest+json",{name:"javascript",json:!0}),E.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),E.defineMIME("text/typescript",{name:"javascript",typescript:!0}),E.defineMIME("application/typescript",{name:"javascript",typescript:!0})})}(Hn,Hn.exports)),Hn.exports}var Du=kl();var En={exports:{}},Ou=En.exports,bl;function Sl(){return bl||(bl=1,function(tn,Rn){(function(E){E(Bn())})(function(E){"use strict";E.defineMode("css",function(X,G){var we=G.inline;G.propertyKeywords||(G=E.resolveMode("text/css"));var k=X.indentUnit,z=G.tokenHooks,c=G.documentTypes||{},O=G.mediaTypes||{},T=G.mediaFeatures||{},U=G.mediaValueKeywords||{},fe=G.propertyKeywords||{},Ae=G.nonStandardPropertyKeywords||{},Tt=G.fontProperties||{},Ut=G.counterDescriptors||{},rt=G.colorKeywords||{},gt=G.valueKeywords||{},be=G.allowNested,Y=G.lineComment,j=G.supportsAtComponent===!0,V=X.highlightNonStandardPropertyKeywords!==!1,se,Q;function I(m,M){return se=M,m}function Ye(m,M){var x=m.next();if(z[x]){var ue=z[x](m,M);if(ue!==!1)return ue}if(x=="@")return m.eatWhile(/[\w\\\-]/),I("def",m.current());if(x=="="||(x=="~"||x=="|")&&m.eat("="))return I(null,"compare");if(x=='"'||x=="'")return M.tokenize=Mt(x),M.tokenize(m,M);if(x=="#")return m.eatWhile(/[\w\\\-]/),I("atom","hash");if(x=="!")return m.match(/^\s*\w*/),I("keyword","important");if(/\d/.test(x)||x=="."&&m.eat(/\d/))return m.eatWhile(/[\w.%]/),I("number","unit");if(x==="-"){if(/[\d.]/.test(m.peek()))return m.eatWhile(/[\w.%]/),I("number","unit");if(m.match(/^-[\w\\\-]*/))return m.eatWhile(/[\w\\\-]/),m.match(/^\s*:/,!1)?I("variable-2","variable-definition"):I("variable-2","variable");if(m.match(/^\w+-/))return I("meta","meta")}else return/[,+>*\/]/.test(x)?I(null,"select-op"):x=="."&&m.match(/^-?[_a-z][_a-z0-9-]*/i)?I("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(x)?I(null,x):m.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(m.current())&&(M.tokenize=at),I("variable callee","variable")):/[\w\\\-]/.test(x)?(m.eatWhile(/[\w\\\-]/),I("property","word")):I(null,null)}function Mt(m){return function(M,x){for(var ue=!1,Qe;(Qe=M.next())!=null;){if(Qe==m&&!ue){m==")"&&M.backUp(1);break}ue=!ue&&Qe=="\\"}return(Qe==m||!ue&&m!=")")&&(x.tokenize=null),I("string","string")}}function at(m,M){return m.next(),m.match(/^\s*[\"\')]/,!1)?M.tokenize=null:M.tokenize=Mt(")"),I(null,"(")}function xt(m,M,x){this.type=m,this.indent=M,this.prev=x}function ce(m,M,x,ue){return m.context=new xt(x,M.indentation()+(ue===!1?0:k),m.context),x}function We(m){return m.context.prev&&(m.context=m.context.prev),m.context.type}function lt(m,M,x){return me[x.context.type](m,M,x)}function wt(m,M,x,ue){for(var Qe=ue||1;Qe>0;Qe--)x.context=x.context.prev;return lt(m,M,x)}function le(m){var M=m.current().toLowerCase();gt.hasOwnProperty(M)?Q="atom":rt.hasOwnProperty(M)?Q="keyword":Q="variable"}var me={};return me.top=function(m,M,x){if(m=="{")return ce(x,M,"block");if(m=="}"&&x.context.prev)return We(x);if(j&&/@component/i.test(m))return ce(x,M,"atComponentBlock");if(/^@(-moz-)?document$/i.test(m))return ce(x,M,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(m))return ce(x,M,"atBlock");if(/^@(font-face|counter-style)/i.test(m))return x.stateArg=m,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(m))return"keyframes";if(m&&m.charAt(0)=="@")return ce(x,M,"at");if(m=="hash")Q="builtin";else if(m=="word")Q="tag";else{if(m=="variable-definition")return"maybeprop";if(m=="interpolation")return ce(x,M,"interpolation");if(m==":")return"pseudo";if(be&&m=="(")return ce(x,M,"parens")}return x.context.type},me.block=function(m,M,x){if(m=="word"){var ue=M.current().toLowerCase();return fe.hasOwnProperty(ue)?(Q="property","maybeprop"):Ae.hasOwnProperty(ue)?(Q=V?"string-2":"property","maybeprop"):be?(Q=M.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(Q+=" error","maybeprop")}else return m=="meta"?"block":!be&&(m=="hash"||m=="qualifier")?(Q="error","block"):me.top(m,M,x)},me.maybeprop=function(m,M,x){return m==":"?ce(x,M,"prop"):lt(m,M,x)},me.prop=function(m,M,x){if(m==";")return We(x);if(m=="{"&&be)return ce(x,M,"propBlock");if(m=="}"||m=="{")return wt(m,M,x);if(m=="(")return ce(x,M,"parens");if(m=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(M.current()))Q+=" error";else if(m=="word")le(M);else if(m=="interpolation")return ce(x,M,"interpolation");return"prop"},me.propBlock=function(m,M,x){return m=="}"?We(x):m=="word"?(Q="property","maybeprop"):x.context.type},me.parens=function(m,M,x){return m=="{"||m=="}"?wt(m,M,x):m==")"?We(x):m=="("?ce(x,M,"parens"):m=="interpolation"?ce(x,M,"interpolation"):(m=="word"&&le(M),"parens")},me.pseudo=function(m,M,x){return m=="meta"?"pseudo":m=="word"?(Q="variable-3",x.context.type):lt(m,M,x)},me.documentTypes=function(m,M,x){return m=="word"&&c.hasOwnProperty(M.current())?(Q="tag",x.context.type):me.atBlock(m,M,x)},me.atBlock=function(m,M,x){if(m=="(")return ce(x,M,"atBlock_parens");if(m=="}"||m==";")return wt(m,M,x);if(m=="{")return We(x)&&ce(x,M,be?"block":"top");if(m=="interpolation")return ce(x,M,"interpolation");if(m=="word"){var ue=M.current().toLowerCase();ue=="only"||ue=="not"||ue=="and"||ue=="or"?Q="keyword":O.hasOwnProperty(ue)?Q="attribute":T.hasOwnProperty(ue)?Q="property":U.hasOwnProperty(ue)?Q="keyword":fe.hasOwnProperty(ue)?Q="property":Ae.hasOwnProperty(ue)?Q=V?"string-2":"property":gt.hasOwnProperty(ue)?Q="atom":rt.hasOwnProperty(ue)?Q="keyword":Q="error"}return x.context.type},me.atComponentBlock=function(m,M,x){return m=="}"?wt(m,M,x):m=="{"?We(x)&&ce(x,M,be?"block":"top",!1):(m=="word"&&(Q="error"),x.context.type)},me.atBlock_parens=function(m,M,x){return m==")"?We(x):m=="{"||m=="}"?wt(m,M,x,2):me.atBlock(m,M,x)},me.restricted_atBlock_before=function(m,M,x){return m=="{"?ce(x,M,"restricted_atBlock"):m=="word"&&x.stateArg=="@counter-style"?(Q="variable","restricted_atBlock_before"):lt(m,M,x)},me.restricted_atBlock=function(m,M,x){return m=="}"?(x.stateArg=null,We(x)):m=="word"?(x.stateArg=="@font-face"&&!Tt.hasOwnProperty(M.current().toLowerCase())||x.stateArg=="@counter-style"&&!Ut.hasOwnProperty(M.current().toLowerCase())?Q="error":Q="property","maybeprop"):"restricted_atBlock"},me.keyframes=function(m,M,x){return m=="word"?(Q="variable","keyframes"):m=="{"?ce(x,M,"top"):lt(m,M,x)},me.at=function(m,M,x){return m==";"?We(x):m=="{"||m=="}"?wt(m,M,x):(m=="word"?Q="tag":m=="hash"&&(Q="builtin"),"at")},me.interpolation=function(m,M,x){return m=="}"?We(x):m=="{"||m==";"?wt(m,M,x):(m=="word"?Q="variable":m!="variable"&&m!="("&&m!=")"&&(Q="error"),"interpolation")},{startState:function(m){return{tokenize:null,state:we?"block":"top",stateArg:null,context:new xt(we?"block":"top",m||0,null)}},token:function(m,M){if(!M.tokenize&&m.eatSpace())return null;var x=(M.tokenize||Ye)(m,M);return x&&typeof x=="object"&&(se=x[1],x=x[0]),Q=x,se!="comment"&&(M.state=me[M.state](se,m,M)),Q},indent:function(m,M){var x=m.context,ue=M&&M.charAt(0),Qe=x.indent;return x.type=="prop"&&(ue=="}"||ue==")")&&(x=x.prev),x.prev&&(ue=="}"&&(x.type=="block"||x.type=="top"||x.type=="interpolation"||x.type=="restricted_atBlock")?(x=x.prev,Qe=x.indent):(ue==")"&&(x.type=="parens"||x.type=="atBlock_parens")||ue=="{"&&(x.type=="at"||x.type=="atBlock"))&&(Qe=Math.max(0,x.indent-k))),Qe},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:Y,fold:"brace"}});function Oe(X){for(var G={},we=0;we<X.length;++we)G[X[we].toLowerCase()]=!0;return G}var ve=["domain","regexp","url","url-prefix"],Je=Oe(ve),vt=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],Ee=Oe(vt),H=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],te=Oe(H),q=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],re=Oe(q),_=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],oe=Oe(_),ne=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],Me=Oe(ne),Ne=["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],Fe=Oe(Ne),ee=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],J=Oe(ee),ie=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],pe=Oe(ie),Ke=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],ot=Oe(Ke),Ie=ve.concat(vt).concat(H).concat(q).concat(_).concat(ne).concat(ie).concat(Ke);E.registerHelper("hintWords","css",Ie);function Be(X,G){for(var we=!1,k;(k=X.next())!=null;){if(we&&k=="/"){G.tokenize=null;break}we=k=="*"}return["comment","comment"]}E.defineMIME("text/css",{documentTypes:Je,mediaTypes:Ee,mediaFeatures:te,mediaValueKeywords:re,propertyKeywords:oe,nonStandardPropertyKeywords:Me,fontProperties:Fe,counterDescriptors:J,colorKeywords:pe,valueKeywords:ot,tokenHooks:{"/":function(X,G){return X.eat("*")?(G.tokenize=Be,Be(X,G)):!1}},name:"css"}),E.defineMIME("text/x-scss",{mediaTypes:Ee,mediaFeatures:te,mediaValueKeywords:re,propertyKeywords:oe,nonStandardPropertyKeywords:Me,colorKeywords:pe,valueKeywords:ot,fontProperties:Fe,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(X,G){return X.eat("/")?(X.skipToEnd(),["comment","comment"]):X.eat("*")?(G.tokenize=Be,Be(X,G)):["operator","operator"]},":":function(X){return X.match(/^\s*\{/,!1)?[null,null]:!1},$:function(X){return X.match(/^[\w-]+/),X.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(X){return X.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),E.defineMIME("text/x-less",{mediaTypes:Ee,mediaFeatures:te,mediaValueKeywords:re,propertyKeywords:oe,nonStandardPropertyKeywords:Me,colorKeywords:pe,valueKeywords:ot,fontProperties:Fe,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(X,G){return X.eat("/")?(X.skipToEnd(),["comment","comment"]):X.eat("*")?(G.tokenize=Be,Be(X,G)):["operator","operator"]},"@":function(X){return X.eat("{")?[null,"interpolation"]:X.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)?!1:(X.eatWhile(/[\w\\\-]/),X.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),E.defineMIME("text/x-gss",{documentTypes:Je,mediaTypes:Ee,mediaFeatures:te,propertyKeywords:oe,nonStandardPropertyKeywords:Me,fontProperties:Fe,counterDescriptors:J,colorKeywords:pe,valueKeywords:ot,supportsAtComponent:!0,tokenHooks:{"/":function(X,G){return X.eat("*")?(G.tokenize=Be,Be(X,G)):!1}},name:"css",helperType:"gss"})})}(En,En.exports)),En.exports}var Wu=Sl();var Fn={exports:{}},Pu=Fn.exports,xl;function Tu(){return xl||(xl=1,function(tn,Rn){(function(E){E(Bn())})(function(E){"use strict";var Oe={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},ve={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};E.defineMode("xml",function(Je,vt){var Ee=Je.indentUnit,H={},te=vt.htmlMode?Oe:ve;for(var q in te)H[q]=te[q];for(var q in vt)H[q]=vt[q];var re,_;function oe(c,O){function T(Ae){return O.tokenize=Ae,Ae(c,O)}var U=c.next();if(U=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?T(Ne("atom","]]>")):null:c.match("--")?T(Ne("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),T(Fe(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),O.tokenize=Ne("meta","?>"),"meta"):(re=c.eat("/")?"closeTag":"openTag",O.tokenize=ne,"tag bracket");if(U=="&"){var fe;return c.eat("#")?c.eat("x")?fe=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):fe=c.eatWhile(/[\d]/)&&c.eat(";"):fe=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),fe?"atom":"error"}else return c.eatWhile(/[^&<]/),null}oe.isInText=!0;function ne(c,O){var T=c.next();if(T==">"||T=="/"&&c.eat(">"))return O.tokenize=oe,re=T==">"?"endTag":"selfcloseTag","tag bracket";if(T=="=")return re="equals",null;if(T=="<"){O.tokenize=oe,O.state=Ke,O.tagName=O.tagStart=null;var U=O.tokenize(c,O);return U?U+" tag error":"tag error"}else return/[\'\"]/.test(T)?(O.tokenize=Me(T),O.stringStartCol=c.column(),O.tokenize(c,O)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Me(c){var O=function(T,U){for(;!T.eol();)if(T.next()==c){U.tokenize=ne;break}return"string"};return O.isInAttribute=!0,O}function Ne(c,O){return function(T,U){for(;!T.eol();){if(T.match(O)){U.tokenize=oe;break}T.next()}return c}}function Fe(c){return function(O,T){for(var U;(U=O.next())!=null;){if(U=="<")return T.tokenize=Fe(c+1),T.tokenize(O,T);if(U==">")if(c==1){T.tokenize=oe;break}else return T.tokenize=Fe(c-1),T.tokenize(O,T)}return"meta"}}function ee(c){return c&&c.toLowerCase()}function J(c,O,T){this.prev=c.context,this.tagName=O||"",this.indent=c.indented,this.startOfLine=T,(H.doNotIndent.hasOwnProperty(O)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function ie(c){c.context&&(c.context=c.context.prev)}function pe(c,O){for(var T;;){if(!c.context||(T=c.context.tagName,!H.contextGrabbers.hasOwnProperty(ee(T))||!H.contextGrabbers[ee(T)].hasOwnProperty(ee(O))))return;ie(c)}}function Ke(c,O,T){return c=="openTag"?(T.tagStart=O.column(),ot):c=="closeTag"?Ie:Ke}function ot(c,O,T){return c=="word"?(T.tagName=O.current(),_="tag",G):H.allowMissingTagName&&c=="endTag"?(_="tag bracket",G(c,O,T)):(_="error",ot)}function Ie(c,O,T){if(c=="word"){var U=O.current();return T.context&&T.context.tagName!=U&&H.implicitlyClosed.hasOwnProperty(ee(T.context.tagName))&&ie(T),T.context&&T.context.tagName==U||H.matchClosing===!1?(_="tag",Be):(_="tag error",X)}else return H.allowMissingTagName&&c=="endTag"?(_="tag bracket",Be(c,O,T)):(_="error",X)}function Be(c,O,T){return c!="endTag"?(_="error",Be):(ie(T),Ke)}function X(c,O,T){return _="error",Be(c,O,T)}function G(c,O,T){if(c=="word")return _="attribute",we;if(c=="endTag"||c=="selfcloseTag"){var U=T.tagName,fe=T.tagStart;return T.tagName=T.tagStart=null,c=="selfcloseTag"||H.autoSelfClosers.hasOwnProperty(ee(U))?pe(T,U):(pe(T,U),T.context=new J(T,U,fe==T.indented)),Ke}return _="error",G}function we(c,O,T){return c=="equals"?k:(H.allowMissing||(_="error"),G(c,O,T))}function k(c,O,T){return c=="string"?z:c=="word"&&H.allowUnquoted?(_="string",G):(_="error",G(c,O,T))}function z(c,O,T){return c=="string"?z:G(c,O,T)}return{startState:function(c){var O={tokenize:oe,state:Ke,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(O.baseIndent=c),O},token:function(c,O){if(!O.tagName&&c.sol()&&(O.indented=c.indentation()),c.eatSpace())return null;re=null;var T=O.tokenize(c,O);return(T||re)&&T!="comment"&&(_=null,O.state=O.state(re||T,c,O),_&&(T=_=="error"?T+" error":_)),T},indent:function(c,O,T){var U=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+Ee;if(U&&U.noIndent)return E.Pass;if(c.tokenize!=ne&&c.tokenize!=oe)return T?T.match(/^(\s*)/)[0].length:0;if(c.tagName)return H.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+Ee*(H.multilineTagIndentFactor||1);if(H.alignCDATA&&/<!\[CDATA\[/.test(O))return 0;var fe=O&&/^<(\/)?([\w_:\.-]*)/.exec(O);if(fe&&fe[1])for(;U;)if(U.tagName==fe[2]){U=U.prev;break}else if(H.implicitlyClosed.hasOwnProperty(ee(U.tagName)))U=U.prev;else break;else if(fe)for(;U;){var Ae=H.contextGrabbers[ee(U.tagName)];if(Ae&&Ae.hasOwnProperty(ee(fe[2])))U=U.prev;else break}for(;U&&U.prev&&!U.startOfLine;)U=U.prev;return U?U.indent+Ee:c.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:H.htmlMode?"html":"xml",helperType:H.htmlMode?"html":"xml",skipAttribute:function(c){c.state==k&&(c.state=G)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var O=[],T=c.context;T;T=T.prev)O.push(T.tagName);return O.reverse()}}}),E.defineMIME("text/xml","xml"),E.defineMIME("application/xml","xml"),E.mimeModes.hasOwnProperty("text/html")||E.defineMIME("text/html",{name:"xml",htmlMode:!0})})}(Fn,Fn.exports)),Fn.exports}var In={exports:{}},zu=In.exports,wl;function Hu(){return wl||(wl=1,function(tn,Rn){(function(E){E(Bn(),Tu(),kl(),Sl())})(function(E){"use strict";var Oe={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function ve(re,_,oe){var ne=re.current(),Me=ne.search(_);return Me>-1?re.backUp(ne.length-Me):ne.match(/<\/?$/)&&(re.backUp(ne.length),re.match(_,!1)||re.match(ne)),oe}var Je={};function vt(re){var _=Je[re];return _||(Je[re]=new RegExp("\\s+"+re+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function Ee(re,_){var oe=re.match(vt(_));return oe?/^\s*(.*?)\s*$/.exec(oe[2])[1]:""}function H(re,_){return new RegExp((_?"^":"")+"</\\s*"+re+"\\s*>","i")}function te(re,_){for(var oe in re)for(var ne=_[oe]||(_[oe]=[]),Me=re[oe],Ne=Me.length-1;Ne>=0;Ne--)ne.unshift(Me[Ne])}function q(re,_){for(var oe=0;oe<re.length;oe++){var ne=re[oe];if(!ne[0]||ne[1].test(Ee(_,ne[0])))return ne[2]}}E.defineMode("htmlmixed",function(re,_){var oe=E.getMode(re,{name:"xml",htmlMode:!0,multilineTagIndentFactor:_.multilineTagIndentFactor,multilineTagIndentPastTag:_.multilineTagIndentPastTag,allowMissingTagName:_.allowMissingTagName}),ne={},Me=_&&_.tags,Ne=_&&_.scriptTypes;if(te(Oe,ne),Me&&te(Me,ne),Ne)for(var Fe=Ne.length-1;Fe>=0;Fe--)ne.script.unshift(["type",Ne[Fe].matches,Ne[Fe].mode]);function ee(J,ie){var pe=oe.token(J,ie.htmlState),Ke=/\btag\b/.test(pe),ot;if(Ke&&!/[<>\s\/]/.test(J.current())&&(ot=ie.htmlState.tagName&&ie.htmlState.tagName.toLowerCase())&&ne.hasOwnProperty(ot))ie.inTag=ot+" ";else if(ie.inTag&&Ke&&/>$/.test(J.current())){var Ie=/^([\S]+) (.*)/.exec(ie.inTag);ie.inTag=null;var Be=J.current()==">"&&q(ne[Ie[1]],Ie[2]),X=E.getMode(re,Be),G=H(Ie[1],!0),we=H(Ie[1],!1);ie.token=function(k,z){return k.match(G,!1)?(z.token=ee,z.localState=z.localMode=null,null):ve(k,we,z.localMode.token(k,z.localState))},ie.localMode=X,ie.localState=E.startState(X,oe.indent(ie.htmlState,"",""))}else ie.inTag&&(ie.inTag+=J.current(),J.eol()&&(ie.inTag+=" "));return pe}return{startState:function(){var J=E.startState(oe);return{token:ee,inTag:null,localMode:null,localState:null,htmlState:J}},copyState:function(J){var ie;return J.localState&&(ie=E.copyState(J.localMode,J.localState)),{token:J.token,inTag:J.inTag,localMode:J.localMode,localState:ie,htmlState:E.copyState(oe,J.htmlState)}},token:function(J,ie){return ie.token(J,ie)},indent:function(J,ie,pe){return!J.localMode||/^\s*<\//.test(ie)?oe.indent(J.htmlState,ie,pe):J.localMode.indent?J.localMode.indent(J.localState,ie,pe):E.Pass},innerMode:function(J){return{state:J.localState||J.htmlState,mode:J.localMode||oe}}}},"xml","javascript","css"),E.defineMIME("text/html","htmlmixed")})}(In,In.exports)),In.exports}export{Nu as C,Tu as a,Sl as b,kl as c,Hu as d,Bn as r};
|