-1&&qi>0){let Ic=O(pe,oe);Xe=ql(pe,Ie,ut,0,Ie.length,0,C-T,Ic,Ic)}else Xe=m(pe,Ie,ut,C-T,Y-C,oe)}v.push(Xe),_.push(Oe)}function u(w,Q,v,_){let z=[],k=0,P=-1;for(;l.pos>Q;){let{id:T,start:C,end:j,size:Y}=l;if(Y>4)l.next();else{if(P>-1&&C=0;j-=3)T[Y++]=z[j],T[Y++]=z[j+1]-C,T[Y++]=z[j+2]-C,T[Y++]=Y;v.push(new Ft(T,z[2]-C,n)),_.push(C-w)}}function O(w,Q){return(v,_,z)=>{let k=0,P=v.length-1,T,C;if(P>=0&&(T=v[P])instanceof D){if(!P&&T.type==w&&T.length==z)return T;(C=T.prop(V.lookAhead))&&(k=_[P]+T.length+C)}return m(w,v,_,z,k,Q)}}function p(w,Q,v,_,z,k,P,T,C){let j=[],Y=[];for(;w.length>_;)j.push(w.pop()),Y.push(Q.pop()+v-z);w.push(m(n.types[P],j,Y,k-z,T-k,C)),Q.push(z-v)}function m(w,Q,v,_,z,k,P){if(k){let T=[V.contextHash,k];P=P?[T].concat(P):[T]}if(z>25){let T=[V.lookAhead,z];P=P?[T].concat(P):[T]}return new D(w,Q,v,_,P)}function y(w,Q){let v=l.fork(),_=0,z=0,k=0,P=v.end-r,T={size:0,start:0,skip:0};e:for(let C=v.pos-w;v.pos>C;){let j=v.size;if(v.id==Q&&j>=0){T.size=_,T.start=z,T.skip=k,k+=4,_+=4,v.next();continue}let Y=v.pos-j;if(j<0||Y=o?4:0,pe=v.start;for(v.next();v.pos>Y;){if(v.size<0)if(v.size==-3||v.size==-4)oe+=4;else break e;else v.id>=o&&(oe+=4);v.next()}z=pe,_+=j,k+=oe}return(Q<0||_==w)&&(T.size=_,T.start=z,T.skip=k),T.size>4?T:void 0}function b(w,Q,v){let{id:_,start:z,end:k,size:P}=l;if(l.next(),P>=0&&_4){let C=l.pos-(P-4);for(;l.pos>C;)v=b(w,Q,v)}Q[--v]=T,Q[--v]=k-w,Q[--v]=z-w,Q[--v]=_}else P==-3?c=_:P==-4&&(h=_);return v}let S=[],g=[];for(;l.pos>0;)f(i.start||0,i.bufferStart||0,S,g,-1,0);let x=(e=i.length)!==null&&e!==void 0?e:S.length?g[0]+S[0].length:0;return new D(a[i.topID],S.reverse(),g.reverse(),x)}var Ff=new WeakMap;function rs(i,e){if(!i.isAnonymous||e instanceof Ft||e.type!=i)return 1;let t=Ff.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=i||!(n instanceof D)){t=1;break}t+=rs(i,n)}Ff.set(e,t)}return t}function ql(i,e,t,n,r,s,o,l,a){let c=0;for(let p=n;p=h)break;Q+=v}if(g==x+1){if(Q>h){let v=p[x];O(v.children,v.positions,0,v.children.length,m[x]+S);continue}f.push(p[x])}else{let v=m[g-1]+p[g-1].length-w;f.push(ql(i,p,m,x,g,w,v,null,a))}u.push(w+S-s)}}return O(e,t,n,r,0),(l||a)(f,u,o)}var Ht=class{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof ki?this.setBuffer(e.context.buffer,e.index,t):e instanceof ze&&this.map.set(e.tree,t)}get(e){return e instanceof ki?this.getBuffer(e.context.buffer,e.index):e instanceof ze?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}},Tt=class i{constructor(e,t,n,r,s=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let r=[new i(0,e.length,e,0,!1,n)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,c=0;;l++){let h=l=n)for(;o&&o.from=u.from||f<=u.to||c){let O=Math.max(u.from,a)-c,p=Math.min(u.to,f)-c;u=O>=p?null:new i(O,p,u.tree,u.offset+c,l>0,!!h)}if(u&&r.push(u),o.to>f)break;o=snew Ae(r.from,r.to)):[new Ae(0,0)]:[new Ae(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let s=r.advance();if(s)return s}}},Xl=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};function tn(i){return(e,t,n,r)=>new Zl(e,i,t,n,r)}var os=class{constructor(e,t,n,r,s,o){this.parser=e,this.parse=t,this.overlay=n,this.bracketed=r,this.target=s,this.from=o}};function Hf(i){if(!i.length||i.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(i))}var _l=class{constructor(e,t,n,r,s,o,l,a){this.parser=e,this.predicate=t,this.mounts=n,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}},Rl=new V({perNode:!0}),Zl=class{constructor(e,t,n,r,s){this.nest=t,this.input=n,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new D(n.type,n.children,n.positions,n.length,n.propValues.concat([[Rl,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[V.mounted.id]=new Gt(t,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)l=!1;else if(e.hasNode(r)){if(t){let c=t.mounts.find(h=>h.frag.from<=r.from&&h.frag.to>=r.to&&h.mount.overlay);if(c)for(let h of c.mount.overlay){let f=h.from+c.pos,u=h.to+c.pos;f>=r.from&&u<=r.to&&!t.ranges.some(O=>O.fromf)&&t.ranges.push({from:f,to:u})}}l=!1}else if(n&&(o=q0(n.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew Ae(f.from-r.from,f.to-r.from)):null,!!s.bracketed,r.tree,h.length?h[0].from:r.from)),s.overlay?h.length&&(n={ranges:h,depth:0,prev:n}):l=!1}}else if(t&&(a=t.predicate(r))&&(a===!0&&(a=new Ae(r.from,r.to)),a.from=0&&t.ranges[c].to==a.from?t.ranges[c]={from:t.ranges[c].from,to:a.to}:t.ranges.push(a)}if(l&&r.firstChild())t&&t.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(t&&!--t.depth){let c=Jf(this.ranges,t.ranges);c.length&&(Hf(c),this.inner.splice(t.index,0,new os(t.parser,t.parser.startParse(this.input,eu(t.mounts,c),c),t.ranges.map(h=>new Ae(h.from-t.start,h.to-t.start)),t.bracketed,t.target,c[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}};function q0(i,e,t){for(let n of i){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function Kf(i,e,t,n,r,s){if(e=e&&t.enter(n,1,U.IgnoreOverlays|U.ExcludeBuffers)))if(t.to<=e)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof D)t=t.children[0];else break}return!1}},Al=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(Rl))!==null&&t!==void 0?t:n.to,this.inner=new ls(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Rl))!==null&&e!==void 0?e:t.to,this.inner=new ls(t.tree,-t.offset)}}findMounts(e,t){var n;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(n=s.tree)===null||n===void 0?void 0:n.prop(V.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=s.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:s.from-a.offset,mount:o})}}}return r}};function Jf(i,e){let t=null,n=e;for(let r=1,s=0;r=l)break;a.to<=o||(t||(n=t=e.slice()),a.froml&&t.splice(s+1,0,new Ae(l,a.to))):a.to>l?t[s--]=new Ae(l,a.to):t.splice(s--,1))}}return n}function M0(i,e,t,n){let r=0,s=0,o=!1,l=!1,a=-1e9,c=[];for(;;){let h=r==i.length?1e9:o?i[r].to:i[r].from,f=s==e.length?1e9:l?e[s].to:e[s].from;if(o!=l){let u=Math.max(a,t),O=Math.min(h,f,n);unew Ae(u.from+n,u.to+n)),f=M0(e,h,a,c);for(let u=0,O=a;;u++){let p=u==f.length,m=p?c:f[u].from;if(m>O&&t.push(new Tt(O,m,r.tree,-o,s.from>=O||s.openStart,s.to<=m||s.openEnd)),p)break;O=f[u].to}}else t.push(new Tt(a,c,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return t}var L0=0,je=class i{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=L0++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n=typeof e=="string"?e:"?";if(e instanceof i&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let r=new i(n,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new fs(e);return n=>n.modified.indexOf(t)>-1?n:fs.get(n.base||n,n.modified.concat(t).sort((r,s)=>r.id-s.id))}},W0=0,fs=class i{constructor(e){this.name=e,this.instances=[],this.id=W0++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(l=>l.base==e&&j0(t,l.modified));if(n)return n;let r=[],s=new je(e.name,r,e,t);for(let l of t)l.instances.push(s);let o=V0(t);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(i.get(l,a));return s}};function j0(i,e){return i.length==e.length&&i.every((t,n)=>t==e[n])}function V0(i){let e=[[]];for(let t=0;tn.length-t.length)}function ue(i){let e=Object.create(null);for(let t in i){let n=i[t];Array.isArray(n)||(n=[n]);for(let r of t.split(" "))if(r){let s=[],o=2,l=r;for(let f=0;;){if(l=="..."&&f>0&&f+3==r.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+r);if(s.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==r.length)break;let O=r[f++];if(f==r.length&&O=="!"){o=0;break}if(O!="/")throw new RangeError("Invalid path: "+r);l=r.slice(f)}let a=s.length-1,c=s[a];if(!c)throw new RangeError("Invalid path: "+r);let h=new wi(n,o,a>0?s.slice(0,a):null);e[c]=h.sort(e[c])}}return su.add(e)}var su=new V({combine(i,e){let t,n,r;for(;i||e;){if(!i||e&&i.depth>=e.depth?(r=e,e=e.next):(r=i,i=i.next),t&&t.mode==r.mode&&!r.context&&!t.context)continue;let s=new wi(r.tags,r.mode,r.context);t?t.next=s:n=s,t=s}return n}}),wi=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=r;for(let l of s)for(let a of l.set){let c=t[a.id];if(c){o=o?o+" "+c:c;break}}return o},scope:n}}function D0(i,e){let t=null;for(let n of i){let r=n.style(e);r&&(t=t?t+" "+r:r)}return t}function ou(i,e,t,n=0,r=i.length){let s=new Ml(n,Array.isArray(e)?e:[e],t);s.highlightRange(i.cursor(),n,r,"",s.highlighters),s.flush(r)}var Ml=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,s){let{type:o,from:l,to:a}=e;if(l>=n||a<=t)return;o.isTop&&(s=this.highlighters.filter(O=>!O.scope||O.scope(o)));let c=r,h=Y0(e)||wi.empty,f=D0(s,h.tags);if(f&&(c&&(c+=" "),c+=f,h.mode==1&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(t,l),c),h.opaque)return;let u=e.tree&&e.tree.prop(V.mounted);if(u&&u.overlay){let O=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(y=>!y.scope||y.scope(u.tree.type)),m=e.firstChild();for(let y=0,b=l;;y++){let S=y=g||!e.nextSibling())););if(!S||g>n)break;b=S.to+l,b>t&&(this.highlightRange(O.cursor(),Math.max(t,S.from+l),Math.min(n,b),"",p),this.startSpan(Math.min(n,b),c))}m&&e.parent()}else if(e.firstChild()){u&&(r="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,s),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}};function Y0(i){let e=i.type.prop(su);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}var R=je.define,as=R(),Kt=R(),nu=R(Kt),ru=R(Kt),Jt=R(),cs=R(Jt),El=R(Jt),bt=R(),xi=R(bt),mt=R(),gt=R(),Ll=R(),Wn=R(Ll),hs=R(),d={comment:as,lineComment:R(as),blockComment:R(as),docComment:R(as),name:Kt,variableName:R(Kt),typeName:nu,tagName:R(nu),propertyName:ru,attributeName:R(ru),className:R(Kt),labelName:R(Kt),namespace:R(Kt),macroName:R(Kt),literal:Jt,string:cs,docString:R(cs),character:R(cs),attributeValue:R(cs),number:El,integer:R(El),float:R(El),bool:R(Jt),regexp:R(Jt),escape:R(Jt),color:R(Jt),url:R(Jt),keyword:mt,self:R(mt),null:R(mt),atom:R(mt),unit:R(mt),modifier:R(mt),operatorKeyword:R(mt),controlKeyword:R(mt),definitionKeyword:R(mt),moduleKeyword:R(mt),operator:gt,derefOperator:R(gt),arithmeticOperator:R(gt),logicOperator:R(gt),bitwiseOperator:R(gt),compareOperator:R(gt),updateOperator:R(gt),definitionOperator:R(gt),typeOperator:R(gt),controlOperator:R(gt),punctuation:Ll,separator:R(Ll),bracket:Wn,angleBracket:R(Wn),squareBracket:R(Wn),paren:R(Wn),brace:R(Wn),content:bt,heading:xi,heading1:R(xi),heading2:R(xi),heading3:R(xi),heading4:R(xi),heading5:R(xi),heading6:R(xi),contentSeparator:R(bt),list:R(bt),quote:R(bt),emphasis:R(bt),strong:R(bt),link:R(bt),monospace:R(bt),strikethrough:R(bt),inserted:R(),deleted:R(),changed:R(),invalid:R(),meta:hs,documentMeta:R(hs),annotation:R(hs),processingInstruction:R(hs),definition:je.defineModifier("definition"),constant:je.defineModifier("constant"),function:je.defineModifier("function"),standard:je.defineModifier("standard"),local:je.defineModifier("local"),special:je.defineModifier("special")};for(let i in d){let e=d[i];e instanceof je&&(e.name=i)}var uv=Wl([{tag:d.link,class:"tok-link"},{tag:d.heading,class:"tok-heading"},{tag:d.emphasis,class:"tok-emphasis"},{tag:d.strong,class:"tok-strong"},{tag:d.keyword,class:"tok-keyword"},{tag:d.atom,class:"tok-atom"},{tag:d.bool,class:"tok-bool"},{tag:d.url,class:"tok-url"},{tag:d.labelName,class:"tok-labelName"},{tag:d.inserted,class:"tok-inserted"},{tag:d.deleted,class:"tok-deleted"},{tag:d.literal,class:"tok-literal"},{tag:d.string,class:"tok-string"},{tag:d.number,class:"tok-number"},{tag:[d.regexp,d.escape,d.special(d.string)],class:"tok-string2"},{tag:d.variableName,class:"tok-variableName"},{tag:d.local(d.variableName),class:"tok-variableName tok-local"},{tag:d.definition(d.variableName),class:"tok-variableName tok-definition"},{tag:d.special(d.variableName),class:"tok-variableName2"},{tag:d.definition(d.propertyName),class:"tok-propertyName tok-definition"},{tag:d.typeName,class:"tok-typeName"},{tag:d.namespace,class:"tok-namespace"},{tag:d.className,class:"tok-className"},{tag:d.macroName,class:"tok-macroName"},{tag:d.propertyName,class:"tok-propertyName"},{tag:d.operator,class:"tok-operator"},{tag:d.comment,class:"tok-comment"},{tag:d.meta,class:"tok-meta"},{tag:d.invalid,class:"tok-invalid"},{tag:d.punctuation,class:"tok-punctuation"}]);var jl,Xt=new V;function sn(i){return W.define({combine:i?e=>e.concat(i):void 0})}var ps=new V,ge=class{constructor(e,t,n=[],r=""){this.data=e,this.name=r,J.prototype.hasOwnProperty("tree")||Object.defineProperty(J.prototype,"tree",{get(){return I(this)}}),this.parser=t,this.extension=[nn.of(this),J.languageData.of((s,o,l)=>{let a=lu(s,o,l),c=a.type.prop(Xt);if(!c)return[];let h=s.facet(c),f=a.type.prop(ps);if(f){let u=a.resolve(o-a.from,l);for(let O of f)if(O.test(u,s)){let p=s.facet(O.facet);return O.type=="replace"?p:p.concat(h)}}return h})].concat(n)}isActiveAt(e,t,n=-1){return lu(e,t,n).type.prop(Xt)==this.data}findRegions(e){let t=e.facet(nn);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(s,o)=>{if(s.prop(Xt)==this.data){n.push({from:o,to:o+s.length});return}let l=s.prop(V.mounted);if(l){if(l.tree.prop(Xt)==this.data){if(l.overlay)for(let a of l.overlay)n.push({from:a.from+o,to:a.to+o});else n.push({from:o,to:o+s.length});return}else if(l.overlay){let a=n.length;if(r(l.tree,l.overlay[0].from+o),n.length>a)return}}for(let a=0;an.isTop?t:void 0)]}),e.name)}configure(e,t){return new i(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function I(i){let e=i.field(ge.state,!1);return e?e.tree:D.empty}function ms(i,e,t=50){var n;let r=(n=i.field(ge.state,!1))===null||n===void 0?void 0:n.context;if(!r)return null;let s=r.viewport;r.updateViewport({from:0,to:e});let o=r.isDone(e)||r.work(t,e)?r.tree:null;return r.updateViewport(s),o}var Bl=class{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},jn=null,vi=class i{constructor(e,t,n=[],r,s,o,l,a){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new i(e,t,[],D.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Bl(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=D.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Tt.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=jn;jn=this;try{return e()}finally{jn=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=au(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((c,h,f,u)=>a.push({fromA:c,toA:h,fromB:f,toB:u})),n=Tt.applyChanges(n,a),r=D.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let c of this.skipped){let h=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);he.from&&(this.fragments=au(this.fragments,r,s),this.skipped.splice(n--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Ct{createParse(t,n,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let a=jn;if(a){for(let c of r)a.tempSkipped.push(c);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new D(se.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return jn}};function au(i,e,t){return Tt.applyChanges(i,[{fromA:e,toA:t,fromB:e,toB:t}])}var Vn=class i{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new i(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=vi.create(e.facet(nn).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new i(n)}};ge.state=ae.define({create:Vn.init,update(i,e){for(let t of e.effects)if(t.is(ge.setState))return t.value;return e.startState.facet(nn)!=e.state.facet(nn)?Vn.init(e.state):i.apply(e)}});var Ou=i=>{let e=setTimeout(()=>i(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Ou=i=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(i,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});var Vl=typeof navigator<"u"&&(!((jl=navigator.scheduling)===null||jl===void 0)&&jl.isInputPending)?()=>navigator.scheduling.isInputPending():null,B0=We.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(ge.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(ge.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Ou(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndr+1e3,a=s.context.work(()=>Vl&&Vl()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:ge.setState.of(new Vn(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Je(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),nn=W.define({combine(i){return i.length?i[0]:null},enables:i=>[ge.state,B0,E.contentAttributes.compute([i],e=>{let t=e.facet(i);return t&&t.name?{"data-language":t.name}:{}})]}),he=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},et=class i{constructor(e,t,n,r,s,o=void 0){this.name=e,this.alias=t,this.extensions=n,this.filename=r,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:n}=e;if(!t){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(n)}return new i(e.name,(e.alias||[]).concat(e.name).map(r=>r.toLowerCase()),e.extensions||[],e.filename,t,n)}static matchFilename(e,t){for(let r of e)if(r.filename&&r.filename.test(t))return r;let n=/\.([^.]+)$/.exec(t);if(n){for(let r of e)if(r.extensions.indexOf(n[1])>-1)return r}return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let r of e)if(r.alias.some(s=>s==t))return r;if(n)for(let r of e)for(let s of r.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return r}return null}},I0=W.define(),ti=W.define({combine:i=>{if(!i.length)return" ";let e=i[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(i[0]));return e}});function ei(i){let e=i.facet(ti);return e.charCodeAt(0)==9?i.tabSize*e.length:e.length}function Yn(i,e){let t="",n=i.tabSize,r=i.facet(ti)[0];if(r==" "){for(;e>=n;)t+=" ",e-=n;r=" "}for(let s=0;s=e?U0(i,t,e):null}var Pi=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=ei(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=n.from&&r<=n.to?s&&r==e?{text:"",from:e}:(t<0?r-1&&(s+=o-this.countColumn(n,n.search(/\S|$/))),s}countColumn(e,t=e.length){return Me(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},Qe=new V;function U0(i,e,t){let n=e.resolveStack(t),r=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(r!=n.node){let s=[];for(let o=r;o&&!(o.fromn.node.to||o.from==n.node.from&&o.type==n.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)n={node:s[o],next:n}}return du(n,i,t)}function du(i,e,t){for(let n=i;n;n=n.next){let r=G0(n.node);if(r)return r(Il.create(e,t,n))}return 0}function N0(i){return i.pos==i.options.simulateBreak&&i.options.simulateDoubleBreak}function G0(i){let e=i.type.prop(Qe);if(e)return e;let t=i.firstChild,n;if(t&&(n=t.type.prop(V.closedBy))){let r=i.lastChild,s=r&&n.indexOf(r.name)>-1;return o=>pu(o,!0,1,void 0,s&&!N0(o)?r.from:void 0)}return i.parent==null?F0:null}function F0(){return 0}var Il=class i extends Pi{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new i(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(H0(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return du(this.context.next,this.base,this.pos)}};function H0(i,e){for(let t=e;t;t=t.parent)if(i==t)return!0;return!1}function K0(i){let e=i.node,t=e.childAfter(e.from),n=e.lastChild;if(!t)return null;let r=i.options.simulateBreak,s=i.state.doc.lineAt(t.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==n)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let c=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+c}}l=a.to}}function _t({closing:i,align:e=!0,units:t=1}){return n=>pu(n,e,t,i)}function pu(i,e,t,n,r){let s=i.textAfter,o=s.match(/^\s*/)[0].length,l=n&&s.slice(o,o+n.length)==n||r==i.pos+o,a=e?K0(i):null;return a?l?i.column(a.from):i.column(a.to):i.baseIndent+(l?0:i.unit*t)}var mu=i=>i.baseIndent;function Rt({except:i,units:e=1}={}){return t=>{let n=i&&i.test(t.textAfter);return t.baseIndent+(n?0:e*t.unit)}}var gu=W.define(),$e=new V;function Qt(i){let e=i.firstChild,t=i.lastChild;return e&&e.tol.prop(Xt)==o.data:o?l=>l==o:void 0,this.style=Wl(e.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=n?new Ge(n):null,this.themeType=t.themeType}static define(e,t){return new i(e,t||{})}},Ul=W.define(),bu=W.define({combine(i){return i.length?[i[0]]:null}});function Dl(i){let e=i.facet(Ul);return e.length?e:i.facet(bu)}function Qu(i,e){let t=[J0],n;return i instanceof rn&&(i.module&&t.push(E.styleModule.of(i.module)),n=i.themeType),e?.fallback?t.push(bu.of(i)):n?t.push(Ul.computeN([E.darkTheme],r=>r.facet(E.darkTheme)==(n=="dark")?[i]:[])):t.push(Ul.of(i)),t}var Nl=class{constructor(e){this.markCache=Object.create(null),this.tree=I(e.state),this.decorations=this.buildDeco(e,Dl(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=I(e.state),n=Dl(e.state),r=n!=Dl(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return q.none;let n=new di;for(let{from:r,to:s}of e.visibleRanges)ou(this.tree,t,(o,l,a)=>{n.add(o,l,this.markCache[a]||(this.markCache[a]=q.mark({class:a})))},r,s);return n.finish()}},J0=Ot.high(We.fromClass(Nl,{decorations:i=>i.decorations})),yv=rn.define([{tag:d.meta,color:"#404740"},{tag:d.link,textDecoration:"underline"},{tag:d.heading,textDecoration:"underline",fontWeight:"bold"},{tag:d.emphasis,fontStyle:"italic"},{tag:d.strong,fontWeight:"bold"},{tag:d.strikethrough,textDecoration:"line-through"},{tag:d.keyword,color:"#708"},{tag:[d.atom,d.bool,d.url,d.contentSeparator,d.labelName],color:"#219"},{tag:[d.literal,d.inserted],color:"#164"},{tag:[d.string,d.deleted],color:"#a11"},{tag:[d.regexp,d.escape,d.special(d.string)],color:"#e40"},{tag:d.definition(d.variableName),color:"#00f"},{tag:d.local(d.variableName),color:"#30a"},{tag:[d.typeName,d.namespace],color:"#085"},{tag:d.className,color:"#167"},{tag:[d.special(d.variableName),d.macroName],color:"#256"},{tag:d.definition(d.propertyName),color:"#00c"},{tag:d.comment,color:"#940"},{tag:d.invalid,color:"#f00"}]);var eb=1e4,tb="()[]{}";var Jl=new V;function Gl(i,e,t){let n=i.prop(e<0?V.openedBy:V.closedBy);if(n)return n;if(i.name.length==1){let r=t.indexOf(i.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function Fl(i){let e=i.type.prop(Jl);return e?e(i.node):i}function $i(i,e,t,n={}){let r=n.maxScanDistance||eb,s=n.brackets||tb,o=I(i),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let c=Gl(a.type,t,s);if(c&&a.from0?e>=h.from&&eh.from&&e<=h.to))return ib(i,e,t,a,h,c,s)}}return nb(i,e,t,o,l.type,r,s)}function ib(i,e,t,n,r,s,o){let l=n.parent,a={from:r.from,to:r.to},c=0,h=l?.cursor();if(h&&(t<0?h.childBefore(n.from):h.childAfter(n.to)))do if(t<0?h.to<=n.from:h.from>=n.to){if(c==0&&s.indexOf(h.type.name)>-1&&h.from0)return null;let c={from:t<0?e-1:e,to:t>0?e+1:e},h=i.doc.iterRange(e,t>0?i.doc.length:0),f=0;for(let u=0;!h.next().done&&u<=s;){let O=h.value;t<0&&(u+=O.length);let p=e+u*t;for(let m=t>0?0:O.length-1,y=t>0?O.length:-1;m!=y;m+=t){let b=o.indexOf(O[m]);if(!(b<0||n.resolveInner(p+m,1).type!=r))if(b%2==0==t>0)f++;else{if(f==1)return{start:c,end:{from:p+m,to:p+m+1},matched:b>>1==a>>1};f--}}t>0&&(u+=O.length)}return h.done?{start:c,matched:!1}:null}function cu(i,e,t,n=0,r=0){e==null&&(e=i.search(/[^\s\u00a0]/),e==-1&&(e=i.length));let s=r;for(let o=n;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosn?o.toLowerCase():o,s=this.string.substr(this.pos,e.length);return r(s)==r(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}};function rb(i){return{name:i.name||"",token:i.token,blankLine:i.blankLine||(()=>{}),startState:i.startState||(()=>!0),copyState:i.copyState||sb,indent:i.indent||(()=>null),languageData:i.languageData||{},tokenTable:i.tokenTable||ta,mergeTokens:i.mergeTokens!==!1}}function sb(i){if(typeof i!="object")return i;let e={};for(let t in i){let n=i[t];e[t]=n instanceof Array?n.slice():n}return e}var hu=new WeakMap,Os=class i extends ge{constructor(e){let t=sn(e.languageData),n=rb(e),r,s=new class extends Ct{createParse(o,l,a){return new Hl(r,o,l,a)}};super(t,s,[],e.name),this.topNode=cb(t,this),r=this,this.streamParser=n,this.stateAfter=new V({perNode:!0}),this.tokenTable=e.tokenTable?new ds(n.tokenTable):ab}static define(e){return new i(e)}getIndent(e){let t,{overrideIndentation:n}=e.options;n&&(t=hu.get(e.state),t!=null&&t1e4)return null;for(;s=n&&t+e.length<=r&&e.prop(i.stateAfter);if(s)return{state:i.streamParser.copyState(s),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],c=l instanceof D&&a=e.length)return e;!r&&t==0&&e.type==i.topNode&&(r=!0);for(let s=e.children.length-1;s>=0;s--){let o=e.positions[s],l=e.children[s],a;if(ot&&ea(i,s.tree,0-s.offset,t,l),c;if(a&&a.pos<=n&&(c=Su(i,s.tree,t+s.offset,a.pos+s.offset,!1)))return{state:a.state,tree:c}}return{state:i.streamParser.startState(r?ei(r):4),tree:D.empty}}var Hl=class{constructor(e,t,n,r){this.lang=e,this.input=t,this.fragments=n,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let s=vi.get(),o=r[0].from,{state:l,tree:a}=ob(e,n,o,this.to,s?.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let c=0;cc.from<=s.viewport.from&&c.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(ei(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let e=vi.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(t,this.chunkStart+512);for(e&&(n=Math.min(n,e.viewport.to));this.parsedPos=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==`
+`){[e,t]=Wi(this,e,t);let r="";for(let s=0,o=0;se&&s&&(r+=n),eo&&(r+=l.sliceString(e-o,t-o,n)),o=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof i))return 0;let n=0,[r,s,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==o||s==l)return n;let a=this.children[r],c=e.children[s];if(a!=c)return n+a.scanIdentical(c,t);n+=a.length+1}}static from(e,t=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let O of e)n+=O.lines;if(n<32){let O=[];for(let p of e)p.flatten(O);return new Ee(O,t)}let r=Math.max(32,n>>5),s=r<<1,o=r>>1,l=[],a=0,c=-1,h=[];function f(O){let p;if(O.lines>s&&O instanceof i)for(let g of O.children)f(g);else O.lines>o&&(a>o||!a)?(u(),l.push(O)):O instanceof Ee&&a&&(p=h[h.length-1])instanceof Ee&&O.lines+p.lines<=32?(a+=O.lines,c+=O.length+1,h[h.length-1]=new Ee(p.text.concat(O.text),p.length+1+O.length)):(a+O.lines>r&&u(),a+=O.lines,c+=O.length+1,h.push(O))}function u(){a!=0&&(l.push(h.length==1?h[0]:i.from(h,c)),c=-1,a=h.length=0)}for(let O of e)f(O);return u(),l.length==1?l[0]:new i(l,t)}};B.empty=new Ee([""],0);function Um(i){let e=-1;for(let t of i)e+=t.length+1;return e}function xr(i,e,t=0,n=1e9){for(let r=0,s=0,o=!0;s=t&&(a>n&&(l=l.slice(0,n-r)),r