@qaecy/cue-ui 0.0.60 → 0.0.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/1359.js +1 -1
- package/1837.js +1 -1
- package/1842.js +1 -0
- package/2317.js +1 -1
- package/2538.js +1 -0
- package/2713.js +7 -0
- package/2775.js +1 -1
- package/2839.js +1 -1
- package/3036.js +1 -1
- package/3202.js +1 -1
- package/3418.js +1 -1
- package/3523.js +1 -1
- package/3577.js +1 -1
- package/3614.js +1 -1
- package/3654.js +1 -0
- package/3656.js +1 -1
- package/366.js +1 -0
- package/4098.js +1 -1
- package/426.js +1 -0
- package/468.js +1 -0
- package/4791.js +1 -1
- package/5649.js +1 -1
- package/5872.js +1 -1
- package/6233.js +1 -1
- package/6419.js +1 -1
- package/6947.js +1 -1
- package/7019.js +1 -0
- package/7193.js +1 -0
- package/7719.js +1 -1
- package/7727.js +1 -1
- package/8725.js +1 -0
- package/9396.js +1 -1
- package/992.js +1 -1
- package/index.js +1 -1
- package/main.js +1 -1
- package/package.json +1 -1
- package/1701.js +0 -1
- package/2530.js +0 -1
- package/329.js +0 -1
- package/3842.js +0 -1
- package/3869.js +0 -1
- package/4311.js +0 -1
- package/6040.js +0 -1
- package/7154.js +0 -1
- package/928.js +0 -1
package/2538.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[2538],{2538(Ei,At,We){"use strict";We.d(At,{B:()=>er});var j=We(7705),g=We(5802),R=We(9769),le=We(3161),Te=We(1771),Ve=We(9131),Ye=We(1380),Se=We(1339),ct=We(2301);class Ke{_parentDiv;_theme;_editor;_content="hello:\n world";extensions=this._updateExtensions();events=new Se.EventEmitter;constructor(i,l){this._parentDiv=i,this._theme=(0,ct.O)(l),this._updateExtensions(),this._build()}set content(i){this._content=i,this._build()}set theme(i){this._theme=(0,ct.O)(i),this._updateExtensions(),this._build()}dispose(){this._editor?.destroy()}_build(){this._editor?.destroy(),this._editor=new le.Lz({state:Ye.$t.create({doc:this._content,extensions:this.extensions}),parent:this._parentDiv})}_updateExtensions(){return this.extensions=[Te.oQ,this._theme,le.Lz.updateListener.of(i=>{if(i.docChanged){const l=i.state.doc.toString();this.events.emit("contentChanged",l)}}),le.w4.of([Ve.Yc])],this.extensions}}var X=We(2166);class ae{constructor(i,l,a,b,C,v,W,ee,ve,et=0,Re){this.p=i,this.stack=l,this.state=a,this.reducePos=b,this.pos=C,this.score=v,this.buffer=W,this.bufferBase=ee,this.curContext=ve,this.lookAhead=et,this.parent=Re}toString(){return`[${this.stack.filter((i,l)=>l%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(i,l,a=0){let b=i.parser.context;return new ae(i,[],l,a,a,0,[],0,b?new se(b,b.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(i,l){this.stack.push(this.state,l,this.bufferBase+this.buffer.length),this.state=i}reduce(i){var l;let a=i>>19,b=65535&i,{parser:C}=this.p,v=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),W=C.dynamicPrecedence(b);if(W&&(this.score+=W),0==a)return b<C.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(C.getGoto(this.state,b,!0),this.reducePos),b<C.minRepeatTerm&&this.storeNode(b,this.reducePos,this.reducePos,v?8:4,!0),void this.reduceContext(b,this.reducePos);let ee=this.stack.length-3*(a-1)-(262144&i?6:0),ve=ee?this.stack[ee-2]:this.p.ranges[0].from;b<C.minRepeatTerm&&ve==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let et=this.reducePos-ve;et>=2e3&&(null===(l=this.p.parser.nodeSet.types[b])||void 0===l||!l.isAnonymous)&&(ve==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=et):this.p.lastBigReductionSize<et&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=ve,this.p.lastBigReductionSize=et));let tt=this.bufferBase+this.buffer.length-(ee?this.stack[ee-1]:0);if(b<C.minRepeatTerm||131072&i){let _t=C.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(b,ve,_t,tt+4,!0)}for(this.state=262144&i?this.stack[ee]:C.getGoto(this.stack[ee-3],b,!0);this.stack.length>ee;)this.stack.pop();this.reduceContext(b,ve)}storeNode(i,l,a,b=4,C=!1){if(0==i&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let v=this.buffer.length;if(v>0&&0==this.buffer[v-4]&&this.buffer[v-1]>-1){if(l==a)return;if(this.buffer[v-2]>=l)return void(this.buffer[v-2]=a)}}if(C&&this.pos!=a){let v=this.buffer.length;if(v>0&&(0!=this.buffer[v-4]||this.buffer[v-1]<0)){let W=!1;for(let ee=v;ee>0&&this.buffer[ee-2]>a;ee-=4)if(this.buffer[ee-1]>=0){W=!0;break}if(W)for(;v>0&&this.buffer[v-2]>a;)this.buffer[v]=this.buffer[v-4],this.buffer[v+1]=this.buffer[v-3],this.buffer[v+2]=this.buffer[v-2],this.buffer[v+3]=this.buffer[v-1],v-=4,b>4&&(b-=4)}this.buffer[v]=i,this.buffer[v+1]=l,this.buffer[v+2]=a,this.buffer[v+3]=b}else this.buffer.push(i,l,a,b)}shift(i,l,a,b){if(131072&i)this.pushState(65535&i,this.pos);else if(262144&i)this.pos=b,this.shiftContext(l,a),l<=this.p.parser.maxNode&&this.buffer.push(l,a,b,4);else{let C=i,{parser:v}=this.p;this.pos=b;let W=v.stateFlag(C,1);!W&&(b>a||l<=v.maxNode)&&(this.reducePos=b),this.pushState(C,W?a:Math.min(a,this.reducePos)),this.shiftContext(l,a),l<=v.maxNode&&this.buffer.push(l,a,b,4)}}apply(i,l,a,b){65536&i?this.reduce(i):this.shift(i,l,a,b)}useNode(i,l){let a=this.p.reused.length-1;(a<0||this.p.reused[a]!=i)&&(this.p.reused.push(i),a++);let b=this.pos;this.reducePos=this.pos=b+i.length,this.pushState(l,b),this.buffer.push(a,b,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,i,this,this.p.stream.reset(this.pos-i.length)))}split(){let i=this,l=i.buffer.length;for(l&&0==i.buffer[l-4]&&(l-=4);l>0&&i.buffer[l-2]>i.reducePos;)l-=4;let a=i.buffer.slice(l),b=i.bufferBase+l;for(;i&&b==i.bufferBase;)i=i.parent;return new ae(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,a,b,this.curContext,this.lookAhead,i)}recoverByDelete(i,l){let a=i<=this.p.parser.maxNode;a&&this.storeNode(i,this.pos,l,4),this.storeNode(0,this.pos,l,a?8:4),this.pos=this.reducePos=l,this.score-=190}canShift(i){for(let l=new ge(this);;){let a=this.p.parser.stateSlot(l.state,4)||this.p.parser.hasAction(l.state,i);if(0==a)return!1;if(!(65536&a))return!0;l.reduce(a)}}recoverByInsert(i){if(this.stack.length>=300)return[];let l=this.p.parser.nextStates(this.state);if(l.length>8||this.stack.length>=120){let b=[];for(let v,C=0;C<l.length;C+=2)(v=l[C+1])!=this.state&&this.p.parser.hasAction(v,i)&&b.push(l[C],v);if(this.stack.length<120)for(let C=0;b.length<8&&C<l.length;C+=2){let v=l[C+1];b.some((W,ee)=>1&ee&&W==v)||b.push(l[C],v)}l=b}let a=[];for(let b=0;b<l.length&&a.length<4;b+=2){let C=l[b+1];if(C==this.state)continue;let v=this.split();v.pushState(C,this.pos),v.storeNode(0,v.pos,v.pos,4,!0),v.shiftContext(l[b],this.pos),v.reducePos=this.pos,v.score-=200,a.push(v)}return a}forceReduce(){let{parser:i}=this.p,l=i.stateSlot(this.state,5);if(!(65536&l))return!1;if(!i.validAction(this.state,l)){let C=this.stack.length-3*(l>>19);if(C<0||i.getGoto(this.stack[C],65535&l,!1)<0){let v=this.findForcedReduction();if(null==v)return!1;l=v}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(l),!0}findForcedReduction(){let{parser:i}=this.p,l=[],a=(b,C)=>{if(!l.includes(b))return l.push(b),i.allActions(b,v=>{if(!(393216&v))if(65536&v){let W=(v>>19)-C;if(W>1){let ee=65535&v,ve=this.stack.length-3*W;if(ve>=0&&i.getGoto(this.stack[ve],ee,!1)>=0)return W<<19|65536|ee}}else{let W=a(v,C+1);if(null!=W)return W}})};return a(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:i}=this.p;return 65535==i.data[i.stateSlot(this.state,1)]&&!i.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(i){if(this.state!=i.state||this.stack.length!=i.stack.length)return!1;for(let l=0;l<this.stack.length;l+=3)if(this.stack[l]!=i.stack[l])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(i){return this.p.parser.dialect.flags[i]}shiftContext(i,l){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,i,this,this.p.stream.reset(l)))}reduceContext(i,l){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,i,this,this.p.stream.reset(l)))}emitContext(){let i=this.buffer.length-1;(i<0||-3!=this.buffer[i])&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let i=this.buffer.length-1;(i<0||-4!=this.buffer[i])&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(i){if(i!=this.curContext.context){let l=new se(this.curContext.tracker,i);l.hash!=this.curContext.hash&&this.emitContext(),this.curContext=l}}setLookAhead(i){return!(i<=this.lookAhead||(this.emitLookAhead(),this.lookAhead=i,0))}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class se{constructor(i,l){this.tracker=i,this.context=l,this.hash=i.strict?i.hash(l):0}}class ge{constructor(i){this.start=i,this.state=i.state,this.stack=i.stack,this.base=this.stack.length}reduce(i){let l=65535&i,a=i>>19;0==a?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(a-1);let b=this.start.p.parser.getGoto(this.stack[this.base-3],l,!0);this.state=b}}class we{constructor(i,l,a){this.stack=i,this.pos=l,this.index=a,this.buffer=i.buffer,0==this.index&&this.maybeNext()}static create(i,l=i.bufferBase+i.buffer.length){return new we(i,l,l-i.bufferBase)}maybeNext(){let i=this.stack.parent;null!=i&&(this.index=this.stack.bufferBase-i.bufferBase,this.stack=i,this.buffer=i.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new we(this.stack,this.pos,this.index)}}function dt(D,i=Uint16Array){if("string"!=typeof D)return D;let l=null;for(let a=0,b=0;a<D.length;){let C=0;for(;;){let v=D.charCodeAt(a++),W=!1;if(126==v){C=65535;break}v>=92&&v--,v>=34&&v--;let ee=v-32;if(ee>=46&&(ee-=46,W=!0),C+=ee,W)break;C*=46}l?l[b++]=C:l=new i(C)}return l}class ze{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Ct=new ze;class Qt{constructor(i,l){this.input=i,this.ranges=l,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Ct,this.rangeIndex=0,this.pos=this.chunkPos=l[0].from,this.range=l[0],this.end=l[l.length-1].to,this.readNext()}resolveOffset(i,l){let a=this.range,b=this.rangeIndex,C=this.pos+i;for(;C<a.from;){if(!b)return null;let v=this.ranges[--b];C-=a.from-v.to,a=v}for(;l<0?C>a.to:C>=a.to;){if(b==this.ranges.length-1)return null;let v=this.ranges[++b];C+=v.from-a.to,a=v}return C}clipPos(i){if(i>=this.range.from&&i<this.range.to)return i;for(let l of this.ranges)if(l.to>i)return Math.max(i,l.from);return this.end}peek(i){let a,b,l=this.chunkOff+i;if(l>=0&&l<this.chunk.length)a=this.pos+i,b=this.chunk.charCodeAt(l);else{let C=this.resolveOffset(i,1);if(null==C)return-1;if(a=C,a>=this.chunk2Pos&&a<this.chunk2Pos+this.chunk2.length)b=this.chunk2.charCodeAt(a-this.chunk2Pos);else{let v=this.rangeIndex,W=this.range;for(;W.to<=a;)W=this.ranges[++v];this.chunk2=this.input.chunk(this.chunk2Pos=a),a+this.chunk2.length>W.to&&(this.chunk2=this.chunk2.slice(0,W.to-a)),b=this.chunk2.charCodeAt(0)}}return a>=this.token.lookAhead&&(this.token.lookAhead=a+1),b}acceptToken(i,l=0){let a=l?this.resolveOffset(l,-1):this.pos;if(null==a||a<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=i,this.token.end=a}acceptTokenTo(i,l){this.token.value=i,this.token.end=l}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:i,chunkPos:l}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=i,this.chunk2Pos=l,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let i=this.input.chunk(this.pos);this.chunk=this.pos+i.length>this.range.to?i.slice(0,this.range.to-this.pos):i,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.next=this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?-1:this.chunk.charCodeAt(this.chunkOff)}advance(i=1){for(this.chunkOff+=i;this.pos+i>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();i-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=i,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(i,l){if(l?(this.token=l,l.start=i,l.lookAhead=i+1,l.value=l.extended=-1):this.token=Ct,this.pos!=i){if(this.pos=i,i==this.end)return this.setDone(),this;for(;i<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;i>=this.range.to;)this.range=this.ranges[++this.rangeIndex];i>=this.chunkPos&&i<this.chunkPos+this.chunk.length?this.chunkOff=i-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(i,l){if(i>=this.chunkPos&&l<=this.chunkPos+this.chunk.length)return this.chunk.slice(i-this.chunkPos,l-this.chunkPos);if(i>=this.chunk2Pos&&l<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(i-this.chunk2Pos,l-this.chunk2Pos);if(i>=this.range.from&&l<=this.range.to)return this.input.read(i,l);let a="";for(let b of this.ranges){if(b.from>=l)break;b.to>i&&(a+=this.input.read(Math.max(b.from,i),Math.min(b.to,l)))}return a}}class Wt{constructor(i,l){this.data=i,this.id=l}token(i,l){let{parser:a}=l.p;!function Nt(D,i,l,a,b,C){let v=0,W=1<<a,{dialect:ee}=l.p.parser;e:for(;0!=(W&D[v]);){let ve=D[v+1];for(let _t=v+3;_t<ve;_t+=2)if((D[_t+1]&W)>0){let yt=D[_t];if(ee.allows(yt)&&(-1==i.token.value||i.token.value==yt||oi(yt,i.token.value,b,C))){i.acceptToken(yt);break}}let et=i.next,Re=0,tt=D[v+2];if(!(i.next<0&&tt>Re&&65535==D[ve+3*tt-3])){for(;Re<tt;){let _t=Re+tt>>1,yt=ve+_t+(_t<<1);if(et<D[yt])tt=_t;else{if(!(et>=(D[yt+1]||65536))){v=D[yt+2],i.advance();continue e}Re=_t+1}}break}v=D[ve+3*tt-1]}}(this.data,i,l,this.id,a.data,a.tokenPrecTable)}}Wt.prototype.contextual=Wt.prototype.fallback=Wt.prototype.extend=!1,Wt.prototype.fallback=Wt.prototype.extend=!1;class He{constructor(i,l={}){this.token=i,this.contextual=!!l.contextual,this.fallback=!!l.fallback,this.extend=!!l.extend}}function ri(D,i,l){for(let b,a=i;65535!=(b=D[a]);a++)if(b==l)return a-i;return-1}function oi(D,i,l,a){let b=ri(l,a,i);return b<0||ri(l,a,D)<b}const Yt=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let Gt=null;function li(D,i,l){let a=D.cursor(X.Qj.IncludeAnonymous);for(a.moveTo(i);;)if(!(l<0?a.childBefore(i):a.childAfter(i)))for(;;){if((l<0?a.to<i:a.from>i)&&!a.type.isError)return l<0?Math.max(0,Math.min(a.to-1,i-25)):Math.min(D.length,Math.max(a.from+1,i+25));if(l<0?a.prevSibling():a.nextSibling())break;if(!a.parent())return l<0?0:D.length}}class ci{constructor(i,l){this.fragments=i,this.nodeSet=l,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let i=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(i){for(this.safeFrom=i.openStart?li(i.tree,i.from+i.offset,1)-i.offset:i.from,this.safeTo=i.openEnd?li(i.tree,i.to+i.offset,-1)-i.offset:i.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(i.tree),this.start.push(-i.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(i){if(i<this.nextStart)return null;for(;this.fragment&&this.safeTo<=i;)this.nextFragment();if(!this.fragment)return null;for(;;){let l=this.trees.length-1;if(l<0)return this.nextFragment(),null;let a=this.trees[l],b=this.index[l];if(b==a.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let C=a.children[b],v=this.start[l]+a.positions[b];if(v>i)return this.nextStart=v,null;if(C instanceof X.PH){if(v==i){if(v<this.safeFrom)return null;let W=v+C.length;if(W<=this.safeTo){let ee=C.prop(X.uY.lookAhead);if(!ee||W+ee<this.fragment.to)return C}}this.index[l]++,v+C.length>=Math.max(this.safeFrom,i)&&(this.trees.push(C),this.start.push(v),this.index.push(0))}else this.index[l]++,this.nextStart=v+C.length}}}class Kt{constructor(i,l){this.stream=l,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=i.tokenizers.map(a=>new ze)}getActions(i){let l=0,a=null,{parser:b}=i.p,{tokenizers:C}=b,v=b.stateSlot(i.state,3),W=i.curContext?i.curContext.hash:0,ee=0;for(let ve=0;ve<C.length;ve++){if(!(1<<ve&v))continue;let et=C[ve],Re=this.tokens[ve];if((!a||et.fallback)&&((et.contextual||Re.start!=i.pos||Re.mask!=v||Re.context!=W)&&(this.updateCachedToken(Re,et,i),Re.mask=v,Re.context=W),Re.lookAhead>Re.end+25&&(ee=Math.max(Re.lookAhead,ee)),0!=Re.value)){let tt=l;if(Re.extended>-1&&(l=this.addActions(i,Re.extended,Re.end,l)),l=this.addActions(i,Re.value,Re.end,l),!et.extend&&(a=Re,l>tt))break}}for(;this.actions.length>l;)this.actions.pop();return ee&&i.setLookAhead(ee),!a&&i.pos==this.stream.end&&(a=new ze,a.value=i.p.parser.eofTerm,a.start=a.end=i.pos,l=this.addActions(i,a.value,a.end,l)),this.mainToken=a,this.actions}getMainToken(i){if(this.mainToken)return this.mainToken;let l=new ze,{pos:a,p:b}=i;return l.start=a,l.end=Math.min(a+1,b.stream.end),l.value=a==b.stream.end?b.parser.eofTerm:0,l}updateCachedToken(i,l,a){let b=this.stream.clipPos(a.pos);if(l.token(this.stream.reset(b,i),a),i.value>-1){let{parser:C}=a.p;for(let v=0;v<C.specialized.length;v++)if(C.specialized[v]==i.value){let W=C.specializers[v](this.stream.read(i.start,i.end),a);if(W>=0&&a.p.parser.dialect.allows(W>>1)){1&W?i.extended=W>>1:i.value=W>>1;break}}}else i.value=0,i.end=this.stream.clipPos(b+1)}putAction(i,l,a,b){for(let C=0;C<b;C+=3)if(this.actions[C]==i)return b;return this.actions[b++]=i,this.actions[b++]=l,this.actions[b++]=a,b}addActions(i,l,a,b){let{state:C}=i,{parser:v}=i.p,{data:W}=v;for(let ee=0;ee<2;ee++)for(let ve=v.stateSlot(C,ee?2:1);;ve+=3){if(65535==W[ve]){if(1!=W[ve+1]){0==b&&2==W[ve+1]&&(b=this.putAction(de(W,ve+2),l,a,b));break}ve=de(W,ve+2)}W[ve]==l&&(b=this.putAction(de(W,ve+1),l,a,b))}return b}}class It{constructor(i,l,a,b){this.parser=i,this.input=l,this.ranges=b,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new Qt(l,b),this.tokens=new Kt(i,this.stream),this.topTerm=i.top[1];let{from:C}=b[0];this.stacks=[ae.start(this,i.top[0],C)],this.fragments=a.length&&this.stream.end-C>4*i.bufferLength?new ci(a,i.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let b,C,i=this.stacks,l=this.minStackPos,a=this.stacks=[];if(this.bigReductionCount>300&&1==i.length){let[v]=i;for(;v.forceReduce()&&v.stack.length&&v.stack[v.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let v=0;v<i.length;v++){let W=i[v];for(;;){if(this.tokens.mainToken=null,W.pos>l)a.push(W);else{if(this.advanceStack(W,a,i))continue;{b||(b=[],C=[]),b.push(W);let ee=this.tokens.getMainToken(W);C.push(ee.value,ee.end)}}break}}if(!a.length){let v=b&&function pe(D){let i=null;for(let l of D){let a=l.p.stoppedAt;(l.pos==l.p.stream.end||null!=a&&l.pos>a)&&l.p.parser.stateFlag(l.state,2)&&(!i||i.score<l.score)&&(i=l)}return i}(b);if(v)return Yt&&console.log("Finish with "+this.stackID(v)),this.stackToTree(v);if(this.parser.strict)throw Yt&&b&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+l);this.recovering||(this.recovering=5)}if(this.recovering&&b){let v=null!=this.stoppedAt&&b[0].pos>this.stoppedAt?b[0]:this.runRecovery(b,C,a);if(v)return Yt&&console.log("Force-finish "+this.stackID(v)),this.stackToTree(v.forceAll())}if(this.recovering){let v=1==this.recovering?1:3*this.recovering;if(a.length>v)for(a.sort((W,ee)=>ee.score-W.score);a.length>v;)a.pop();a.some(W=>W.reducePos>l)&&this.recovering--}else if(a.length>1){e:for(let v=0;v<a.length-1;v++){let W=a[v];for(let ee=v+1;ee<a.length;ee++){let ve=a[ee];if(W.sameState(ve)||W.buffer.length>500&&ve.buffer.length>500){if(!((W.score-ve.score||W.buffer.length-ve.buffer.length)>0)){a.splice(v--,1);continue e}a.splice(ee--,1)}}}a.length>12&&(a.sort((v,W)=>W.score-v.score),a.splice(12,a.length-12))}this.minStackPos=a[0].pos;for(let v=1;v<a.length;v++)a[v].pos<this.minStackPos&&(this.minStackPos=a[v].pos);return null}stopAt(i){if(null!=this.stoppedAt&&this.stoppedAt<i)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=i}advanceStack(i,l,a){let b=i.pos,{parser:C}=this,v=Yt?this.stackID(i)+" -> ":"";if(null!=this.stoppedAt&&b>this.stoppedAt)return i.forceReduce()?i:null;if(this.fragments){let ve=i.curContext&&i.curContext.tracker.strict,et=ve?i.curContext.hash:0;for(let Re=this.fragments.nodeAt(b);Re;){let tt=this.parser.nodeSet.types[Re.type.id]==Re.type?C.getGoto(i.state,Re.type.id):-1;if(tt>-1&&Re.length&&(!ve||(Re.prop(X.uY.contextHash)||0)==et))return i.useNode(Re,tt),Yt&&console.log(v+this.stackID(i)+` (via reuse of ${C.getName(Re.type.id)})`),!0;if(!(Re instanceof X.PH)||0==Re.children.length||Re.positions[0]>0)break;let _t=Re.children[0];if(!(_t instanceof X.PH&&0==Re.positions[0]))break;Re=_t}}let W=C.stateSlot(i.state,4);if(W>0)return i.reduce(W),Yt&&console.log(v+this.stackID(i)+` (via always-reduce ${C.getName(65535&W)})`),!0;if(i.stack.length>=8400)for(;i.stack.length>6e3&&i.forceReduce(););let ee=this.tokens.getActions(i);for(let ve=0;ve<ee.length;){let et=ee[ve++],Re=ee[ve++],tt=ee[ve++],_t=ve==ee.length||!a,yt=_t?i:i.split(),Dt=this.tokens.mainToken;if(yt.apply(et,Re,Dt?Dt.start:yt.pos,tt),Yt&&console.log(v+this.stackID(yt)+` (via ${65536&et?`reduce of ${C.getName(65535&et)}`:"shift"} for ${C.getName(Re)} @ ${b}${yt==i?"":", split"})`),_t)return!0;yt.pos>b?l.push(yt):a.push(yt)}return!1}advanceFully(i,l){let a=i.pos;for(;;){if(!this.advanceStack(i,null,null))return!1;if(i.pos>a)return vt(i,l),!0}}runRecovery(i,l,a){let b=null,C=!1;for(let v=0;v<i.length;v++){let W=i[v],ee=l[v<<1],ve=l[1+(v<<1)],et=Yt?this.stackID(W)+" -> ":"";if(W.deadEnd&&(C||(C=!0,W.restart(),Yt&&console.log(et+this.stackID(W)+" (restarted)"),this.advanceFully(W,a))))continue;let Re=W.split(),tt=et;for(let _t=0;_t<10&&Re.forceReduce()&&(Yt&&console.log(tt+this.stackID(Re)+" (via force-reduce)"),!this.advanceFully(Re,a));_t++)Yt&&(tt=this.stackID(Re)+" -> ");for(let _t of W.recoverByInsert(ee))Yt&&console.log(et+this.stackID(_t)+" (via recover-insert)"),this.advanceFully(_t,a);this.stream.end>W.pos?(ve==W.pos&&(ve++,ee=0),W.recoverByDelete(ee,ve),Yt&&console.log(et+this.stackID(W)+` (via recover-delete ${this.parser.getName(ee)})`),vt(W,a)):(!b||b.score<Re.score)&&(b=Re)}return b}stackToTree(i){return i.close(),X.PH.build({buffer:we.create(i),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:i.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(i){let l=(Gt||(Gt=new WeakMap)).get(i);return l||Gt.set(i,l=String.fromCodePoint(this.nextStackID++)),l+i}}function vt(D,i){for(let l=0;l<i.length;l++){let a=i[l];if(a.pos==D.pos&&a.sameState(D))return void(i[l].score<D.score&&(i[l]=D))}i.push(D)}class Jt{constructor(i,l,a){this.source=i,this.flags=l,this.disabled=a}allows(i){return!this.disabled||0==this.disabled[i]}}const wt=D=>D;class Ne{constructor(i){this.start=i.start,this.shift=i.shift||wt,this.reduce=i.reduce||wt,this.reuse=i.reuse||wt,this.hash=i.hash||(()=>0),this.strict=!1!==i.strict}}class me extends X.iX{constructor(i){if(super(),this.wrappers=[],14!=i.version)throw new RangeError(`Parser version (${i.version}) doesn't match runtime version (14)`);let l=i.nodeNames.split(" ");this.minRepeatTerm=l.length;for(let W=0;W<i.repeatNodeCount;W++)l.push("");let a=Object.keys(i.topRules).map(W=>i.topRules[W][1]),b=[];for(let W=0;W<l.length;W++)b.push([]);function C(W,ee,ve){b[W].push([ee,ee.deserialize(String(ve))])}if(i.nodeProps)for(let W of i.nodeProps){let ee=W[0];"string"==typeof ee&&(ee=X.uY[ee]);for(let ve=1;ve<W.length;){let et=W[ve++];if(et>=0)C(et,ee,W[ve++]);else{let Re=W[ve+-et];for(let tt=-et;tt>0;tt--)C(W[ve++],ee,Re);ve++}}}this.nodeSet=new X.fI(l.map((W,ee)=>X.Z6.define({name:ee>=this.minRepeatTerm?void 0:W,id:ee,props:b[ee],top:a.indexOf(ee)>-1,error:0==ee,skipped:i.skippedNodes&&i.skippedNodes.indexOf(ee)>-1}))),i.propSources&&(this.nodeSet=this.nodeSet.extend(...i.propSources)),this.strict=!1,this.bufferLength=X.cF;let v=dt(i.tokenData);this.context=i.context,this.specializerSpecs=i.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let W=0;W<this.specializerSpecs.length;W++)this.specialized[W]=this.specializerSpecs[W].term;this.specializers=this.specializerSpecs.map(Ie),this.states=dt(i.states,Uint32Array),this.data=dt(i.stateData),this.goto=dt(i.goto),this.maxTerm=i.maxTerm,this.tokenizers=i.tokenizers.map(W=>"number"==typeof W?new Wt(v,W):W),this.topRules=i.topRules,this.dialects=i.dialects||{},this.dynamicPrecedences=i.dynamicPrecedences||null,this.tokenPrecTable=i.tokenPrec,this.termNames=i.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(i,l,a){let b=new It(this,i,l,a);for(let C of this.wrappers)b=C(b,i,l,a);return b}getGoto(i,l,a=!1){let b=this.goto;if(l>=b[0])return-1;for(let C=b[l+1];;){let v=b[C++],W=1&v,ee=b[C++];if(W&&a)return ee;for(let ve=C+(v>>1);C<ve;C++)if(b[C]==i)return ee;if(W)return-1}}hasAction(i,l){let a=this.data;for(let b=0;b<2;b++)for(let v,C=this.stateSlot(i,b?2:1);;C+=3){if(65535==(v=a[C])){if(1!=a[C+1]){if(2==a[C+1])return de(a,C+2);break}v=a[C=de(a,C+2)]}if(v==l||0==v)return de(a,C+1)}return 0}stateSlot(i,l){return this.states[6*i+l]}stateFlag(i,l){return(this.stateSlot(i,0)&l)>0}validAction(i,l){return!!this.allActions(i,a=>a==l||null)}allActions(i,l){let a=this.stateSlot(i,4),b=a?l(a):void 0;for(let C=this.stateSlot(i,1);null==b;C+=3){if(65535==this.data[C]){if(1!=this.data[C+1])break;C=de(this.data,C+2)}b=l(de(this.data,C+1))}return b}nextStates(i){let l=[];for(let a=this.stateSlot(i,1);;a+=3){if(65535==this.data[a]){if(1!=this.data[a+1])break;a=de(this.data,a+2)}if(!(1&this.data[a+2])){let b=this.data[a+1];l.some((C,v)=>1&v&&C==b)||l.push(this.data[a],b)}}return l}configure(i){let l=Object.assign(Object.create(me.prototype),this);if(i.props&&(l.nodeSet=this.nodeSet.extend(...i.props)),i.top){let a=this.topRules[i.top];if(!a)throw new RangeError(`Invalid top rule name ${i.top}`);l.top=a}return i.tokenizers&&(l.tokenizers=this.tokenizers.map(a=>{let b=i.tokenizers.find(C=>C.from==a);return b?b.to:a})),i.specializers&&(l.specializers=this.specializers.slice(),l.specializerSpecs=this.specializerSpecs.map((a,b)=>{let C=i.specializers.find(W=>W.from==a.external);if(!C)return a;let v=Object.assign(Object.assign({},a),{external:C.to});return l.specializers[b]=Ie(v),v})),i.contextTracker&&(l.context=i.contextTracker),i.dialect&&(l.dialect=this.parseDialect(i.dialect)),null!=i.strict&&(l.strict=i.strict),i.wrap&&(l.wrappers=l.wrappers.concat(i.wrap)),null!=i.bufferLength&&(l.bufferLength=i.bufferLength),l}hasWrappers(){return this.wrappers.length>0}getName(i){return this.termNames?this.termNames[i]:String(i<=this.maxNode&&this.nodeSet.types[i].name||i)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(i){let l=this.dynamicPrecedences;return null==l?0:l[i]||0}parseDialect(i){let l=Object.keys(this.dialects),a=l.map(()=>!1);if(i)for(let C of i.split(" ")){let v=l.indexOf(C);v>=0&&(a[v]=!0)}let b=null;for(let C=0;C<l.length;C++)if(!a[C])for(let W,v=this.dialects[l[C]];65535!=(W=this.data[v++]);)(b||(b=new Uint8Array(this.maxTerm+1)))[W]=1;return new Jt(i,a,b)}static deserialize(i){return new me(i)}}function de(D,i){return D[i]|D[i+1]<<16}function Ie(D){if(D.external){let i=D.extend?1:0;return(l,a)=>D.external(l,a)<<1|i}return D.get}var Ae=We(9125);const it=(0,Ae.pn)({String:Ae._A.string,Number:Ae._A.number,"True False":Ae._A.bool,PropertyName:Ae._A.propertyName,Null:Ae._A.null,", :":Ae._A.separator,"[ ]":Ae._A.squareBracket,"{ }":Ae._A.brace}),Je=me.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"\u26a0 JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[it],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});var qe=We(5759);const St=qe.bj.define({name:"json",parser:Je.configure({props:[qe.Oh.add({Object:(0,qe.mz)({except:/^\s*\}/}),Array:(0,qe.mz)({except:/^\s*\]/})}),qe.b_.add({"Object Array":qe.yd})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function kt(){return new qe.Yy(St)}const Et=new Set(["@base","@container","@context","@direction","@graph","@id","@import","@included","@index","@json","@language","@list","@nest","@none","@prefix","@propagate","@protected","@reverse","@set","@type","@value","@version","@vocab"]),Lt=/"(@[a-z]+)"/g,_e=le.Lz.baseTheme({".cm-jsonld-keyword":{color:"var(--color-jsonld-keyword, #c678dd)",fontWeight:"600"}}),k=le.NZ.mark({class:"cm-jsonld-keyword"}),M=le.Z9.fromClass(class{decorations;constructor(D){this.decorations=this._build(D)}update(D){(D.docChanged||D.viewportChanged)&&(this.decorations=this._build(D.view))}_build(D){const i=new Ye.vB;for(const{from:l,to:a}of D.visibleRanges){const b=D.state.doc.sliceString(l,a);let C;for(Lt.lastIndex=0;null!==(C=Lt.exec(b));)if(Et.has(C[1])){const v=l+C.index+1;i.add(v,v+C[1].length,k)}}return i.finish()}},{decorations:D=>D.decorations});class H{_parentDiv;_theme;_editor;_content='{"@context": {}, "@id": ""}';extensions=this._updateExtensions();events=new Se.EventEmitter;constructor(i,l){this._parentDiv=i,this._theme=(0,ct.O)(l),this._updateExtensions(),this._build()}set content(i){this._content=JSON.stringify(i,null,2),this._build()}set theme(i){this._theme=(0,ct.O)(i),this._updateExtensions(),this._build()}dispose(){this._editor?.destroy()}_build(){this._editor?.destroy(),this._editor=new le.Lz({state:Ye.$t.create({doc:this._content,extensions:this.extensions}),parent:this._parentDiv})}_updateExtensions(){return this.extensions=[Te.oQ,kt(),_e,M,this._theme,le.Lz.updateListener.of(i=>{if(i.docChanged){const l=i.state.doc.toString();try{const a=JSON.parse(l);this.events.emit("contentValid",!0),this.events.emit("contentChanged",a)}catch{this.events.emit("contentValid",!1)}}}),le.w4.of([Ve.Yc,{key:"Cmd-k",run:Ve.qh},{key:"Ctrl-k",run:Ve.qh}])],this.extensions}}class I{_parentDiv;_theme;_editor;_content='{"foo": "bar"}';extensions=this._updateExtensions();events=new Se.EventEmitter;constructor(i,l){this._parentDiv=i,this._theme=(0,ct.O)(l),this._updateExtensions(),this._build()}set content(i){this._content=JSON.stringify(i,null,2),this._build()}set theme(i){this._theme=(0,ct.O)(i),this._updateExtensions(),this._build()}dispose(){this._editor?.destroy()}_build(){this._editor?.destroy(),this._editor=new le.Lz({state:Ye.$t.create({doc:this._content,extensions:this.extensions}),parent:this._parentDiv})}_updateExtensions(){return this.extensions=[Te.oQ,kt(),this._theme,le.Lz.updateListener.of(i=>{if(i.docChanged){const l=i.state.doc.toString();try{const a=JSON.parse(l);this.events.emit("contentValid",!0),this.events.emit("contentChanged",a)}catch{this.events.emit("contentValid",!1)}}}),le.w4.of([Ve.Yc,{key:"Cmd-k",run:Ve.qh},{key:"Ctrl-k",run:Ve.qh}])],this.extensions}}var L=We(4906);class K{_parentDiv;_theme;_editor;_content="hello:\n world";extensions=this._updateExtensions();events=new Se.EventEmitter;constructor(i,l){this._parentDiv=i,this._theme=(0,ct.O)(l),this._updateExtensions(),this._build()}set content(i){this._content=i,this._build()}set theme(i){this._theme=(0,ct.O)(i),this._updateExtensions(),this._build()}dispose(){this._editor?.destroy()}_build(){this._editor?.destroy(),this._editor=new le.Lz({state:Ye.$t.create({doc:this._content,extensions:this.extensions}),parent:this._parentDiv})}_updateExtensions(){return this.extensions=[Te.oQ,this._theme,le.Lz.updateListener.of(i=>{if(i.docChanged){const l=i.state.doc.toString();this.events.emit("contentChanged",l)}}),le.w4.of([Ve.Yc])],this.extensions}}var J=We(467);const fe=me.deserialize({version:14,states:")rQYQPOOOzQPO'#CbO!PQPO'#CfO!UQPO'#ChO!ZQPO'#CjOOQO'#C`'#C`OOQO'#Co'#CoOOQO'#Cn'#CnOOQO'#Cq'#CqO#dQPO'#CtOOQO'#Cm'#CmO#kQPO'#ClOOQO'#C_'#C_O#|QQO'#C_OOQO'#D_'#D_QYQPOOO$RQPO,58|O$WQQO,59QO$]QPO,59SOOQO,59U,59UO$bQPO'#CxOOQO'#DR'#DRO%RQSO'#DQOOQO'#DY'#DYOOQO'#D^'#D^OOQO'#DP'#DPOOQO'#Cu'#CuOOQO'#D`'#D`O&RQPO,59`OOQO,59`,59`OOQO'#C{'#C{OOQO'#Cz'#CzO!`QPO'#CyO&YQQO,59WOOQO,58y,58yOOQO-E7]-E7]O&kQQO1G.hOOQO1G.l1G.lOOQO1G.n1G.nO&pQPO,59dOOQO,59l,59lO&uQPO,59lOOQO-E7^-E7^OOQO1G.z1G.zO'QQQO'#C|O'iQQO,59eO'}QQO'#DQOOQO1G.r1G.rOOQO7+$S7+$SO(bQPO'#C|O(mQPO,59eOOQO1G/O1G/OOOQO1G/W1G/WO!`QPO'#DaO(uQQO,59hO$bQPO'#DbO)^QQO1G/PO)rQPO,59hO)}QPO1G/POOQO,59{,59{OOQO-E7_-E7_O!`QPO,59|OOQO-E7`-E7`OOQO1G/h1G/hO!`QPO'#CyO!`QPO,59|O$bQPO'#Db",stateData:"*f~O!XOSPOS~OVPOWUOXVOZQO]RO_SOdUOfWOgWO!ZXO~OW`O~OXaO~OWbO~OXcO~OWUOXVOdUOfWOgWOkdOveOweOxeOyeO}gO!OgO!PgO!ZXO!]hO!^hO~O!YmO~P!`OWUOXVOdUOkdO![oO~OTrO~OXtO~OTuO~OXvO~OWUOXVOdUO![oO~OzxO{yOWtXXtXdtX~OftXgtXktXvtXwtXxtXytX}tX!OtX!PtX!YtX!ZtX!]tX!^tX~P$pO!Y{O~P!`OWUOXVOdUO![oOT`a~OT!QO~Oj!TO~OWUOXVOdUO~Oq!VOTpXWpXXpXdpXrpX![pX~Or!XOTmaWmaXmadma![ma~OTtXqtXrtX![tXjtX~P$pOq!VOjpXrpX~Or!dOjma~Oq!VOTpaWpaXpadparpa![pa~Or!XOTmiWmiXmidmi![mi~Oq!VOjparpa~Or!dOjmi~OdW_]!^!]yv![!P!O}!Xy~",goto:"&_!VPPP!W![P!`PPP!`P!`P!`P!d!h!l#TP#fPP#f#sPP$S$`$i$v$}PP#j%X%bPPPPPP%XPPP%X%m%s%y&TT^O_T[O_TTO_T]O_TZO_SYO_^jXlp!V!_!b!cYnZdq!X!dR!UyoVOXZ_dlpqy!V!X!_!b!c!dSYO__jXlp!V!_!b!cSkXlS|p!_S!R!b!cR!]!V^jXlp!V!_!b!cRqZQqZQwdR!PqSpZqQ!_!XQ!bdR!c!dZoZdq!X!dQ}pQ!S!bT!a!_!c_iXlp!V!_!b!cSfXlZ!Op!V!_!b!cQ_ORs_QlXRzlQ!W|Q!Z!RT!^!W!ZQ!Y}Q![!ST!`!Y![",nodeNames:"\u26a0 Comment TurtleDoc Statement Directive . PrefixID @prefix Pname_ns Iriref Base @base SparqlPrefix PREFIX SparqlBase BASE Triples Subject Iri PrefixedName Pname_ln BlankNode Blank_node_label Anon Collection Object ] [ BlankNodePropertyList PredicateObjectList Verb Predicate ObjectList , ; Literal RdfLiteral String String_literal_quote String_literal_single_quote String_literal_long_single_quote String_literal_long_quote Langtag ^^ NumericLiteral Integer Decimal Double BooleanLiteral",maxTerm:60,nodeProps:[["openedBy",26,"["],["closedBy",27,"]"]],skippedNodes:[0,1],repeatNodeCount:4,tokenData:"#C|~R!UX^$epq$ers%YstD`wxF[xy!7byz!7g{|!7l|}!9d}!O!7l!O!P!9i!Q![!8u![!]!9q!]!^!@b!^!_!@g!b!c!Ah!c!d!GP!d!e!JS!e!r!GP!r!s#!e!s!}!GP!}#O#,V#P#Q#-S#Q#R#-X#R#S#-d#T#U#1q#U#Y!GP#Y#Z#3[#Z#h!GP#h#i#;[#i#o!GP#y#z$e$f$g$e%W%o!GP%p&a!GP&b1p!GP4U4d!GP4e#BY!GP#BY#BZ#Ap#BZ$IS!GP$IS$I_$e$I`$Ib!GP$I|$JO$e$JT$JU$e$KV$KW$e$Kh%#t!GP&/x&Et!GP&FU&FV$e&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~$jY!X~X^$epq$e#y#z$e$f$g$e#BY#BZ$e$IS$I_$e$I|$JO$e$JT$JU$e$KV$KW$e&FU&FV$e~%]]OY&UZ]&U^r&Urs4^s!w&U!w!x'V!x#O&U#O#P1k#P#i&U#i#j,a#j;'S&U;'S;=`4W<%lO&U~&X]OY&UZ]&U^r&Urs'Qs!w&U!w!x'V!x#O&U#O#P1k#P#i&U#i#j,a#j;'S&U;'S;=`4W<%lO&U~'VOv~~'YcOY&UZ]&U^r&Urs'Qs!Q&U!Q![(e![!c&U!c!i(e!i!w&U!w!x'V!x#O&U#O#P1k#P#T&U#T#Z(e#Z#i&U#i#j,a#j;'S&U;'S;=`4W<%lO&U~(hcOY&UZ]&U^r&Urs'Qs!Q&U!Q![)s![!c&U!c!i)s!i!w&U!w!x'V!x#O&U#O#P1k#P#T&U#T#Z)s#Z#i&U#i#j,a#j;'S&U;'S;=`4W<%lO&U~)vcOY&UZ]&U^r&Urs'Qs!Q&U!Q![+R![!c&U!c!i+R!i!w&U!w!x'V!x#O&U#O#P1k#P#T&U#T#Z+R#Z#i&U#i#j,a#j;'S&U;'S;=`4W<%lO&U~+UcOY&UZ]&U^r&Urs'Qs!Q&U!Q![,a![!c&U!c!i,a!i!w&U!w!x'V!x#O&U#O#P1k#P#T&U#T#Z,a#Z#i&U#i#j,a#j;'S&U;'S;=`4W<%lO&U~,dcOY&UZ]&U^r&Urs'Qs!Q&U!Q![-o![!c&U!c!i-o!i!w&U!w!x'V!x#O&U#O#P1k#P#T&U#T#Z-o#Z#i&U#i#j,a#j;'S&U;'S;=`4W<%lO&U~-rcOY&UZ]&U^r&Urs'Qs!Q&U!Q![.}![!c&U!c!i.}!i!w&U!w!x'V!x#O&U#O#P1k#P#T&U#T#Z.}#Z#i&U#i#j,a#j;'S&U;'S;=`4W<%lO&U~/QcOY&UZ]&U^r&Urs'Qs!Q&U!Q![0]![!c&U!c!i0]!i!w&U!w!x'V!x#O&U#O#P1k#P#T&U#T#Z0]#Z#i&U#i#j,a#j;'S&U;'S;=`4W<%lO&U~0`cOY&UZ]&U^r&Urs'Qs!Q&U!Q![&U![!c&U!c!i&U!i!w&U!w!x'V!x#O&U#O#P1k#P#T&U#T#Z&U#Z#i&U#i#j,a#j;'S&U;'S;=`4W<%lO&U~1nhOY&UZ]&U^r&Urs3Ysw&Uwx&Ux!w&U!w!x'V!x#O&U#O#P1k#P#U&U#U#V&U#V#Y&U#Y#Z&U#Z#b&U#b#c&U#c#f&U#f#g&U#g#h&U#h#i&U#i#j,a#j;'S&U;'S;=`4W<%lO&U~3_]v~OY&UZ]&U^r&Urs'Qs!w&U!w!x'V!x#O&U#O#P1k#P#i&U#i#j,a#j;'S&U;'S;=`4W<%lO&U~4ZP;=`<%l&U~4cPv~rs4f~4iZOr4frs5[s!w4f!w!x6{!x#O4f#O#P@_#P#i4f#i#j;m#j;'S4f;'S;=`DY<%lO4f~5_ZOr4frs6Qs!w4f!w!x6{!x#O4f#O#P@_#P#i4f#i#j;m#j;'S4f;'S;=`DY<%lO4f~6TZOr4frs6vs!w4f!w!x6{!x#O4f#O#P@_#P#i4f#i#j;m#j;'S4f;'S;=`DY<%lO4f~6{Oy~~7OaOr4frs5[s!Q4f!Q![8T![!c4f!c!i8T!i!w4f!w!x6{!x#O4f#O#P@_#P#T4f#T#Z8T#Z#i4f#i#j;m#j;'S4f;'S;=`DY<%lO4f~8WaOr4frs5[s!Q4f!Q![9]![!c4f!c!i9]!i!w4f!w!x6{!x#O4f#O#P@_#P#T4f#T#Z9]#Z#i4f#i#j;m#j;'S4f;'S;=`DY<%lO4f~9`aOr4frs5[s!Q4f!Q![:e![!c4f!c!i:e!i!w4f!w!x6{!x#O4f#O#P@_#P#T4f#T#Z:e#Z#i4f#i#j;m#j;'S4f;'S;=`DY<%lO4f~:haOr4frs5[s!Q4f!Q![;m![!c4f!c!i;m!i!w4f!w!x6{!x#O4f#O#P@_#P#T4f#T#Z;m#Z#i4f#i#j;m#j;'S4f;'S;=`DY<%lO4f~;paOr4frs5[s!Q4f!Q![<u![!c4f!c!i<u!i!w4f!w!x6{!x#O4f#O#P@_#P#T4f#T#Z<u#Z#i4f#i#j;m#j;'S4f;'S;=`DY<%lO4f~<xaOr4frs5[s!Q4f!Q![=}![!c4f!c!i=}!i!w4f!w!x6{!x#O4f#O#P@_#P#T4f#T#Z=}#Z#i4f#i#j;m#j;'S4f;'S;=`DY<%lO4f~>QaOr4frs5[s!Q4f!Q![?V![!c4f!c!i?V!i!w4f!w!x6{!x#O4f#O#P@_#P#T4f#T#Z?V#Z#i4f#i#j;m#j;'S4f;'S;=`DY<%lO4f~?YaOr4frs5[s!Q4f!Q![4f![!c4f!c!i4f!i!w4f!w!x6{!x#O4f#O#P@_#P#T4f#T#Z4f#Z#i4f#i#j;m#j;'S4f;'S;=`DY<%lO4f~@bfOr4frsAvsw4fwx4fx!w4f!w!x6{!x#O4f#O#P@_#P#U4f#U#V4f#V#Y4f#Y#Z4f#Z#b4f#b#c4f#c#f4f#f#g4f#g#h4f#h#i4f#i#j;m#j;'S4f;'S;=`DY<%lO4f~AyZOr4frsBls!w4f!w!x6{!x#O4f#O#P@_#P#i4f#i#j;m#j;'S4f;'S;=`DY<%lO4f~BoZOr4frsCbs!w4f!w!x6{!x#O4f#O#P@_#P#i4f#i#j;m#j;'S4f;'S;=`DY<%lO4f~CgZy~Or4frs6vs!w4f!w!x6{!x#O4f#O#P@_#P#i4f#i#j;m#j;'S4f;'S;=`DY<%lO4f~D]P;=`<%l4f~DeVP~OYD`YZDzZsD`stD`t;'SD`;'S;=`FU<%lOD`~EPPP~stES~EVVOYElYZDzZsElstESt;'SEl;'S;=`FO<%lOEl~EoTOYElYZDzZ;'SEl;'S;=`FO<%lOEl~FRP;=`<%lEl~FXP;=`<%lD`~F_]OYGWZ]GW^wGWwx!'`x!wGW!w!xHX!x#OGW#O#P!$m#P#iGW#i#jMc#j;'SGW;'S;=`!'Y<%lOGW~GZ]OYGWZ]GW^wGWwxHSx!wGW!w!xHX!x#OGW#O#P!$m#P#iGW#i#jMc#j;'SGW;'S;=`!'Y<%lOGW~HXOw~~H[cOYGWZ]GW^wGWwxHSx!QGW!Q![Ig![!cGW!c!iIg!i!wGW!w!xHX!x#OGW#O#P!$m#P#TGW#T#ZIg#Z#iGW#i#jMc#j;'SGW;'S;=`!'Y<%lOGW~IjcOYGWZ]GW^wGWwxHSx!QGW!Q![Ju![!cGW!c!iJu!i!wGW!w!xHX!x#OGW#O#P!$m#P#TGW#T#ZJu#Z#iGW#i#jMc#j;'SGW;'S;=`!'Y<%lOGW~JxcOYGWZ]GW^wGWwxHSx!QGW!Q![LT![!cGW!c!iLT!i!wGW!w!xHX!x#OGW#O#P!$m#P#TGW#T#ZLT#Z#iGW#i#jMc#j;'SGW;'S;=`!'Y<%lOGW~LWcOYGWZ]GW^wGWwxHSx!QGW!Q![Mc![!cGW!c!iMc!i!wGW!w!xHX!x#OGW#O#P!$m#P#TGW#T#ZMc#Z#iGW#i#jMc#j;'SGW;'S;=`!'Y<%lOGW~MfcOYGWZ]GW^wGWwxHSx!QGW!Q![Nq![!cGW!c!iNq!i!wGW!w!xHX!x#OGW#O#P!$m#P#TGW#T#ZNq#Z#iGW#i#jMc#j;'SGW;'S;=`!'Y<%lOGW~NtcOYGWZ]GW^wGWwxHSx!QGW!Q![!!P![!cGW!c!i!!P!i!wGW!w!xHX!x#OGW#O#P!$m#P#TGW#T#Z!!P#Z#iGW#i#jMc#j;'SGW;'S;=`!'Y<%lOGW~!!ScOYGWZ]GW^wGWwxHSx!QGW!Q![!#_![!cGW!c!i!#_!i!wGW!w!xHX!x#OGW#O#P!$m#P#TGW#T#Z!#_#Z#iGW#i#jMc#j;'SGW;'S;=`!'Y<%lOGW~!#bcOYGWZ]GW^wGWwxHSx!QGW!Q![GW![!cGW!c!iGW!i!wGW!w!xHX!x#OGW#O#P!$m#P#TGW#T#ZGW#Z#iGW#i#jMc#j;'SGW;'S;=`!'Y<%lOGW~!$phOYGWZ]GW^rGWrsGWswGWwx!&[x!wGW!w!xHX!x#OGW#O#P!$m#P#UGW#U#VGW#V#YGW#Y#ZGW#Z#bGW#b#cGW#c#fGW#f#gGW#g#hGW#h#iGW#i#jMc#j;'SGW;'S;=`!'Y<%lOGW~!&a]w~OYGWZ]GW^wGWwxHSx!wGW!w!xHX!x#OGW#O#P!$m#P#iGW#i#jMc#j;'SGW;'S;=`!'Y<%lOGW~!']P;=`<%lGW~!'ePw~wx!'h~!'kZOw!'hwx!(^x!w!'h!w!x!)}!x#O!'h#O#P!3a#P#i!'h#i#j!.o#j;'S!'h;'S;=`!7[<%lO!'h~!(aZOw!'hwx!)Sx!w!'h!w!x!)}!x#O!'h#O#P!3a#P#i!'h#i#j!.o#j;'S!'h;'S;=`!7[<%lO!'h~!)VZOw!'hwx!)xx!w!'h!w!x!)}!x#O!'h#O#P!3a#P#i!'h#i#j!.o#j;'S!'h;'S;=`!7[<%lO!'h~!)}Ox~~!*QaOw!'hwx!(^x!Q!'h!Q![!+V![!c!'h!c!i!+V!i!w!'h!w!x!)}!x#O!'h#O#P!3a#P#T!'h#T#Z!+V#Z#i!'h#i#j!.o#j;'S!'h;'S;=`!7[<%lO!'h~!+YaOw!'hwx!(^x!Q!'h!Q![!,_![!c!'h!c!i!,_!i!w!'h!w!x!)}!x#O!'h#O#P!3a#P#T!'h#T#Z!,_#Z#i!'h#i#j!.o#j;'S!'h;'S;=`!7[<%lO!'h~!,baOw!'hwx!(^x!Q!'h!Q![!-g![!c!'h!c!i!-g!i!w!'h!w!x!)}!x#O!'h#O#P!3a#P#T!'h#T#Z!-g#Z#i!'h#i#j!.o#j;'S!'h;'S;=`!7[<%lO!'h~!-jaOw!'hwx!(^x!Q!'h!Q![!.o![!c!'h!c!i!.o!i!w!'h!w!x!)}!x#O!'h#O#P!3a#P#T!'h#T#Z!.o#Z#i!'h#i#j!.o#j;'S!'h;'S;=`!7[<%lO!'h~!.raOw!'hwx!(^x!Q!'h!Q![!/w![!c!'h!c!i!/w!i!w!'h!w!x!)}!x#O!'h#O#P!3a#P#T!'h#T#Z!/w#Z#i!'h#i#j!.o#j;'S!'h;'S;=`!7[<%lO!'h~!/zaOw!'hwx!(^x!Q!'h!Q![!1P![!c!'h!c!i!1P!i!w!'h!w!x!)}!x#O!'h#O#P!3a#P#T!'h#T#Z!1P#Z#i!'h#i#j!.o#j;'S!'h;'S;=`!7[<%lO!'h~!1SaOw!'hwx!(^x!Q!'h!Q![!2X![!c!'h!c!i!2X!i!w!'h!w!x!)}!x#O!'h#O#P!3a#P#T!'h#T#Z!2X#Z#i!'h#i#j!.o#j;'S!'h;'S;=`!7[<%lO!'h~!2[aOw!'hwx!(^x!Q!'h!Q![!'h![!c!'h!c!i!'h!i!w!'h!w!x!)}!x#O!'h#O#P!3a#P#T!'h#T#Z!'h#Z#i!'h#i#j!.o#j;'S!'h;'S;=`!7[<%lO!'h~!3dfOr!'hrs!'hsw!'hwx!4xx!w!'h!w!x!)}!x#O!'h#O#P!3a#P#U!'h#U#V!'h#V#Y!'h#Y#Z!'h#Z#b!'h#b#c!'h#c#f!'h#f#g!'h#g#h!'h#h#i!'h#i#j!.o#j;'S!'h;'S;=`!7[<%lO!'h~!4{ZOw!'hwx!5nx!w!'h!w!x!)}!x#O!'h#O#P!3a#P#i!'h#i#j!.o#j;'S!'h;'S;=`!7[<%lO!'h~!5qZOw!'hwx!6dx!w!'h!w!x!)}!x#O!'h#O#P!3a#P#i!'h#i#j!.o#j;'S!'h;'S;=`!7[<%lO!'h~!6iZx~Ow!'hwx!)xx!w!'h!w!x!)}!x#O!'h#O#P!3a#P#i!'h#i#j!.o#j;'S!'h;'S;=`!7[<%lO!'h~!7_P;=`<%l!'h~!7gO!Z~~!7lO!Y~~!7oQ!O!P!7u!Q![!8uT!7xP!Q![!7{T!8QR!OT!Q![!7{!g!h!8Z#X#Y!8ZT!8^R{|!8g}!O!8g!Q![!8mT!8jP!Q![!8mT!8rP!PT!Q![!8m~!8zS}~!O!P!9W!Q![!8u!g!h!8Z#X#Y!8ZT!9ZR!Q![!7{!g!h!8Z#X#Y!8Z~!9iOq~V!9nPTQ!Q![!7{~!9vcW~uv!;R!Q![!;k![!]!;k!c!}!;k#O#P!>y#R#S!;k#T#o!;k%W%o!;k%p&a!;k&b1p!;k4U4d!;k4e$IS!;k$I`$Ib!;k$Kh%#t!;k&/x&Et!;k&FV;'S!;k;'S;:j!@[?&r?Ah!;k?BY?Mn!;k~!;UR!Q![!;_!c!i!;_#T#Z!;_~!;bR!Q![!;k!c!i!;k#T#Z!;k~!;phd~uv!;R}!O!;k!O!P!=[!Q![!;k![!]!;k!c!}!;k#O#P!>y#R#S!;k#T#o!;k$}%O!;k%W%o!;k%p&a!;k&b1p!;k1p4U!;k4U4d!;k4e$IS!;k$I`$Ib!;k$Je$Jg!;k$Kh%#t!;k&/x&Et!;k&FV;'S!;k;'S;:j!@[?&r?Ah!;k?BY?Mn!;k~!=_huv!;R}!O!;k!O!P!=[!Q![!;k![!]!;k!c!}!;k#O#P!>y#R#S!;k#T#o!;k$}%O!;k%W%o!;k%p&a!;k&b1p!;k1p4U!;k4U4d!;k4e$IS!;k$I`$Ib!;k$Je$Jg!;k$Kh%#t!;k&/x&Et!;k&FV;'S!;k;'S;:j!@[?&r?Ah!;k?BY?Mn!;k~!>|dqr!;kst!;ktu!;kuv!;kvw!;kwx!;kxy!;kyz!;kz{!;k{|!;k|}!;k}!O!;k!O!P!;k!P!Q!;k!]!^!;k!_!`!;k!a!b!;k!b!c!;k#R#S!;k#r#s!;k~!@_P;=`<%l!;k~!@gOr~~!@jZqr!@gs!^!@g!_!`!@g!`!a!A]!a#O!@g#P#Q!@g#R#S!@g#T#o!@g#r;'S!@g;'S;=`!Ab<%lO!@g~!AbOX~~!AeP;=`<%l!@gV!AkU!c!}!A}#T#U!A}#U#V!Bz#V#d!A}#d#e!Dg#e#o!A}U!BSRzU}!O!B]!c!}!A}#T#o!A}U!B`R!Q![!Bi!c!}!Bi#T#o!BiU!BnSzU}!O!B]!Q![!Bi!c!}!Bi#T#o!BiV!CPSzU}!O!B]!c!}!A}#T#U!C]#U#o!A}V!CbTzU}!O!B]!c!}!A}#T#g!A}#g#h!Cq#h#o!A}V!CvTzU}!O!B]!c!}!A}#T#X!A}#X#Y!DV#Y#o!A}V!D^RZPzU}!O!B]!c!}!A}#T#o!A}V!DlTzU}!O!B]!c!}!A}#T#f!A}#f#g!D{#g#o!A}V!EQTzU}!O!B]!c!}!A}#T#X!A}#X#Y!Ea#Y#o!A}V!EfTzU}!O!B]!c!}!A}#T#Y!A}#Y#Z!Eu#Z#o!A}V!EzTzU}!O!B]!c!}!A}#T#]!A}#]#^!FZ#^#o!A}V!F`TzU}!O!B]!c!}!A}#T#l!A}#l#m!Fo#m#o!A}V!FvRVPzU}!O!B]!c!}!A}#T#o!A}~!GSf}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!}!GP#R#S!GP#T#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~!Hke}!O!GP!O!P!Hh!Q![!GP!c!}!GP#R#S!GP#T#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~!JPP;=`<%l!GP~!JVg}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!d!Kn!d!}!GP#R#S!GP#T#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~!Kqh}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!u!GP!u!v!M]!v!}!GP#R#S!GP#T#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~!M`h}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!g!GP!g!h!Nz!h!}!GP#R#S!GP#T#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~# Pf_~}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!}!GP#R#S!GP#T#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~#!hh}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!t!GP!t!u#$S!u!}!GP#R#S!GP#T#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~#$Vh}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!g!GP!g!h#%q!h!}!GP#R#S!GP#T#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~#%th}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!h!GP!h!i#'`!i!}!GP#R#S!GP#T#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~#'ch}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!k!GP!k!l#(}!l!}!GP#R#S!GP#T#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~#)Qh}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!z!GP!z!{#*l!{!}!GP#R#S!GP#T#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~#*qf]~}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!}!GP#R#S!GP#T#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~#,[Tk~XY#,kYZ#,k]^#,kpq#,k#P#Q#,}~#,nTXY#,kYZ#,k]^#,kpq#,k#P#Q#,}~#-SOg~~#-XOj~~#-[P#Q#R#-_~#-dO{~~#-gP![!]#-j~#-m`!Q![#.o!c!}#.o#R#S#.o#T#o#.o%W%o#.o%p&a#.o&b1p#.o4U4d#.o4e$IS#.o$I`$Ib#.o$Kh%#t#.o&/x&Et#.o&FV;'S#.o;'S;:j#1k?&r?Ah#.o?BY?Mn#.o~#.tef~}!O#.o!O!P#0V!Q![#.o!c!}#.o#R#S#.o#T#o#.o$}%O#.o%W%o#.o%p&a#.o&b1p#.o1p4U#.o4U4d#.o4e$IS#.o$I`$Ib#.o$Je$Jg#.o$Kh%#t#.o&/x&Et#.o&FV;'S#.o;'S;:j#1k?&r?Ah#.o?BY?Mn#.o~#0Ye}!O#.o!O!P#0V!Q![#.o!c!}#.o#R#S#.o#T#o#.o$}%O#.o%W%o#.o%p&a#.o&b1p#.o1p4U#.o4U4d#.o4e$IS#.o$I`$Ib#.o$Je$Jg#.o$Kh%#t#.o&/x&Et#.o&FV;'S#.o;'S;:j#1k?&r?Ah#.o?BY?Mn#.o~#1nP;=`<%l#.o~#1vf![~}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!}!GP#R#S!GP#T#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~#3_g}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!}!GP#R#S!GP#T#U#4v#U#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~#4yh}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!}!GP#R#S!GP#T#`!GP#`#a#6e#a#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~#6hh}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!}!GP#R#S!GP#T#g!GP#g#h#8S#h#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~#8Vh}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!}!GP#R#S!GP#T#X!GP#X#Y#9q#Y#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~#9vf!^~}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!}!GP#R#S!GP#T#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~#;_h}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!}!GP#R#S!GP#T#f!GP#f#g#<y#g#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~#<|h}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!}!GP#R#S!GP#T#i!GP#i#j#>h#j#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~#>kh}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!}!GP#R#S!GP#T#X!GP#X#Y#@V#Y#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~#@[f!]~}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!}!GP#R#S!GP#T#o!GP$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e$IS!GP$I`$Ib!GP$Je$Jg!GP$Kh%#t!GP&/x&Et!GP&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP~#Auq!X~X^$epq$e}!O!GP!O!P!Hh!Q![!GP![!]!9q!c!}!GP#R#S!GP#T#o!GP#y#z$e$f$g$e$}%O!GP%W%o!GP%p&a!GP&b1p!GP1p4U!GP4U4d!GP4e#BY!GP#BY#BZ#Ap#BZ$IS!GP$IS$I_$e$I`$Ib!GP$I|$JO$e$JT$JU$e$Je$Jg!GP$KV$KW$e$Kh%#t!GP&/x&Et!GP&FU&FV$e&FV;'S!GP;'S;:j!I|?&r?Ah!GP?BY?Mn!GP",tokenizers:[0,1,2],topRules:{TurtleDoc:[0,2]},tokenPrec:421}),Oe=qe.bj.define({parser:fe.configure({props:[(0,Ae.pn)({Comment:Ae._A.comment,"@prefix @base PREFIX BASE":Ae._A.keyword,"String!":Ae._A.string,Integer:Ae._A.integer,"Double Decimal":Ae._A.float,"[ ]":Ae._A.squareBracket,Langtag:Ae._A.annotation,"; . ,":Ae._A.separator,"BlankNode!":Ae._A.propertyName,"true false":Ae._A.bool,"VerbPath Pname_ns Pname_ln Iriref":Ae._A.namespace,Iri:Ae._A.url,"RDFLiteral/Iri! ^^":Ae._A.typeName})]})});var Ee=We(3838),Ue=We(639);const{xsd:P}=Ue.A,f=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,m={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},V=/[\x00-\x20<>\\"\{\}\|\^\`]/,ne={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},ue=/$0^/;class Pe{constructor(i){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,this._isImpliedBy=(i=i||{}).isImpliedBy,this._lineMode=!!i.lineMode){this._n3Mode=!1;for(const l in this)!(l in ne)&&this[l]instanceof RegExp&&(this[l]=ue)}else this._n3Mode=!1!==i.n3;this.comments=!!i.comments,this._literalClosingPos=0}_tokenizeToEnd(i,l){let a=this._input,b=a.length;for(;;){let W,ee;for(;W=this._newline.exec(a);)this.comments&&(ee=this._comment.exec(W[0]))&&C("comment",ee[1],"",this._line,W[0].length),a=a.substr(W[0].length,a.length),b=a.length,this._line++;if(!W&&(W=this._whitespace.exec(a))&&(a=a.substr(W[0].length,a.length)),this._endOfFile.test(a))return l&&(this.comments&&(ee=this._comment.exec(a))&&C("comment",ee[1],"",this._line,a.length),a=null,C("eof","","",this._line,0)),this._input=a;const ve=this._line,et=a[0];let Re="",tt="",_t="",yt=null,Dt=0,Oi=!1;switch(et){case"^":if(a.length<3)break;if("^"!==a[1]){this._n3Mode&&(Dt=1,Re="^");break}if(this._previousMarker="^^",a=a.substr(2),"<"!==a[0]){Oi=!0;break}case"<":if(yt=this._unescapedIri.exec(a))Re="IRI",tt=yt[1];else if(yt=this._iri.exec(a)){if(tt=this._unescape(yt[1]),null===tt||V.test(tt))return v(this);Re="IRI"}else a.length>1&&"<"===a[1]?(Re="<<",Dt=2):this._n3Mode&&a.length>1&&"="===a[1]&&(Dt=2,this._isImpliedBy?(Re="abbreviation",tt="<"):(Re="inverse",tt=">"));break;case">":a.length>1&&">"===a[1]&&(Re=">>",Dt=2);break;case"_":((yt=this._blank.exec(a))||l&&(yt=this._blank.exec(`${a} `)))&&(Re="blank",_t="_",tt=yt[1]);break;case'"':if(yt=this._simpleQuotedString.exec(a))tt=yt[1];else if(({value:tt,matchLength:Dt}=this._parseLiteral(a)),null===tt)return v(this);(null!==yt||0!==Dt)&&(Re="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(yt=this._simpleApostropheString.exec(a))tt=yt[1];else if(({value:tt,matchLength:Dt}=this._parseLiteral(a)),null===tt)return v(this);(null!==yt||0!==Dt)&&(Re="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(yt=this._variable.exec(a))&&(Re="var",tt=yt[0]);break;case"@":"literal"===this._previousMarker&&(yt=this._langcode.exec(a))?(Re="langcode",tt=yt[1]):(yt=this._keyword.exec(a))&&(Re=yt[0]);break;case".":if(1===a.length?l:a[1]<"0"||a[1]>"9"){Re=".",Dt=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(yt=this._number.exec(a)||l&&(yt=this._number.exec(`${a} `)))&&(Re="literal",tt=yt[0],_t="string"==typeof yt[1]?P.double:"string"==typeof yt[2]?P.decimal:P.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(yt=this._sparqlKeyword.exec(a))?Re=yt[0].toUpperCase():Oi=!0;break;case"f":case"t":(yt=this._boolean.exec(a))?(Re="literal",tt=yt[0],_t=P.boolean):Oi=!0;break;case"a":(yt=this._shortPredicates.exec(a))?(Re="abbreviation",tt="a"):Oi=!0;break;case"=":this._n3Mode&&a.length>1&&(Re="abbreviation",">"!==a[1]?(Dt=1,tt="="):(Dt=2,tt=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(Dt=1,Re=et);break;case"{":!this._lineMode&&a.length>=2&&("|"===a[1]?(Re="{|",Dt=2):(Re=et,Dt=1));break;case"|":a.length>=2&&"}"===a[1]&&(Re="|}",Dt=2);break;default:Oi=!0}if(Oi&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(yt=this._prefix.exec(a))?((yt=this._prefixed.exec(a))||l&&(yt=this._prefixed.exec(`${a} `)))&&(Re="prefixed",_t=yt[1]||"",tt=this._unescape(yt[2])):(Re="prefix",tt=yt[1]||"")),"^^"===this._previousMarker)switch(Re){case"prefixed":Re="type";break;case"IRI":Re="typeIRI";break;default:Re=""}if(!Re)return l||!/^'''|^"""/.test(a)&&/\n|\r/.test(a)?v(this):this._input=a;const qi=Dt||yt[0].length,an=C(Re,tt,_t,ve,qi);this.previousToken=an,this._previousMarker=Re,a=a.substr(qi,a.length)}function C(W,ee,ve,et,Re){const tt=a?b-a.length:b,yt={type:W,value:ee,prefix:ve,line:et,start:tt,end:tt+Re};return i(null,yt),yt}function v(W){i(W._syntaxError(/^\S*/.exec(a)[0]))}}_unescape(i){let l=!1;const a=i.replace(f,(b,C,v,W)=>{if("string"==typeof C)return String.fromCharCode(Number.parseInt(C,16));if("string"==typeof v){let ee=Number.parseInt(v,16);return ee<=65535?String.fromCharCode(Number.parseInt(v,16)):String.fromCharCode(55296+((ee-=65536)>>10),56320+(1023&ee))}return W in m?m[W]:(l=!0,"")});return l?null:a}_parseLiteral(i){if(i.length>=3){const l=i.match(/^(?:"""|"|'''|'|)/)[0],a=l.length;let b=Math.max(this._literalClosingPos,a);for(;(b=i.indexOf(l,b))>0;){let C=0;for(;"\\"===i[b-C-1];)C++;if(C%2==0){const v=i.substring(a,b),W=v.split(/\r\n|\r|\n/).length-1,ee=b+a;if(1===a&&0!==W||3===a&&this._lineMode)break;return this._line+=W,{value:this._unescape(v),matchLength:ee}}b++}this._literalClosingPos=i.length-a+1}return{value:"",matchLength:0}}_syntaxError(i){this._input=null;const l=new Error(`Unexpected "${i}" on line ${this._line}.`);return l.context={token:void 0,line:this._line,previousToken:this.previousToken},l}_readStartingBom(i){return i.startsWith("\ufeff")?i.substr(1):i}tokenize(i,l){if(this._line=1,"string"==typeof i){if(this._input=this._readStartingBom(i),"function"!=typeof l){const a=[];let b;if(this._tokenizeToEnd((C,v)=>C?b=C:a.push(v),!0),b)throw b;return a}queueMicrotask(()=>this._tokenizeToEnd(l,!0))}else this._pendingBuffer=null,"function"==typeof i.setEncoding&&i.setEncoding("utf8"),i.on("data",a=>{null!==this._input&&0!==a.length&&(this._pendingBuffer&&(a=Ee.hp.concat([this._pendingBuffer,a]),this._pendingBuffer=null),128&a[a.length-1]?this._pendingBuffer=a:(typeof this._input>"u"?this._input=this._readStartingBom("string"==typeof a?a:a.toString()):this._input+=a,this._tokenizeToEnd(l,!1)))}),i.on("end",()=>{"string"==typeof this._input&&this._tokenizeToEnd(l,!0)}),i.on("error",l)}}var $e=We(6353);let lt=0;class rt{constructor(i){this._contextStack=[],this._graph=null,this._setBase((i=i||{}).baseIRI),i.factory&&bt(this,i.factory);const l="string"==typeof i.format?i.format.match(/\w*$/)[0].toLowerCase():"",a=/turtle/.test(l),b=/trig/.test(l),C=/triple/.test(l),v=/quad/.test(l),W=this._n3Mode=/n3/.test(l),ee=C||v;(this._supportsNamedGraphs=!(a||W))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(a||b||C||W),this._isImpliedBy=i.isImpliedBy,this._supportsRDFStar=""===l||/star|\*$/.test(l),ee&&(this._resolveRelativeIRI=ve=>null),this._blankNodePrefix="string"!=typeof i.blankNodePrefix?"":i.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=i.lexer||new Pe({lineMode:ee,n3:W,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!i.explicitQuantifiers}static _resetBlankNodePrefix(){lt=0}_setBase(i){if(i){const l=i.indexOf("#");l>=0&&(i=i.substr(0,l)),this._base=i,this._basePath=i.indexOf("/")<0?i:i.replace(/[^\/?]*(?:\?.*)?$/,""),i=i.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=i[0],this._baseScheme=i[1]}else this._base="",this._basePath=""}_saveContext(i,l,a,b,C){const v=this._n3Mode;this._contextStack.push({type:i,subject:a,predicate:b,object:C,graph:l,inverse:!!v&&this._inversePredicate,blankPrefix:v?this._prefixes._:"",quantified:v?this._quantified:null}),v&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(i,l){const a=this._contextStack.pop();if(!a||a.type!==i)return this._error(`Unexpected ${l.type}`,l);this._subject=a.subject,this._predicate=a.predicate,this._object=a.object,this._graph=a.graph,this._n3Mode&&(this._inversePredicate=a.inverse,this._prefixes._=a.blankPrefix,this._quantified=a.quantified)}_readInTopContext(i){switch(i.type){case"eof":return null!==this._graph?this._error("Unclosed graph",i):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(i)}}_readEntity(i,l){let a;switch(i.type){case"IRI":case"typeIRI":const b=this._resolveIRI(i.value);if(null===b)return this._error("Invalid IRI",i);a=this._factory.namedNode(b);break;case"type":case"prefixed":const C=this._prefixes[i.prefix];if(void 0===C)return this._error(`Undefined prefix "${i.prefix}:"`,i);a=this._factory.namedNode(C+i.value);break;case"blank":a=this._factory.blankNode(this._prefixes[i.prefix]+i.value);break;case"var":a=this._factory.variable(i.value.substr(1));break;default:return this._error(`Expected entity but got ${i.type}`,i)}return!l&&this._n3Mode&&a.id in this._quantified&&(a=this._quantified[a.id]),a}_readSubject(i){switch(this._predicate=null,i.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._factory.blankNode(),null,null),this._readSubject):this._error("Unexpected graph",i);case"}":return this._readPunctuation(i);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',i);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',i);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",i);if(0===i.prefix.length)return this._literalValue=i.value,this._completeSubjectLiteral;this._subject=this._factory.literal(i.value,this._factory.namedNode(i.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",i);default:if(void 0===(this._subject=this._readEntity(i)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(i){const l=i.type;switch(l){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[i.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${l}`,i):(this._subject=null,"]"===l?this._readBlankNodeTail(i):this._readPunctuation(i));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",i);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",i);default:if(void 0===(this._predicate=this._readEntity(i)))return}return this._readObject}_readObject(i){switch(i.type){case"literal":if(0===i.prefix.length)return this._literalValue=i.value,this._readDataTypeOrLang;this._object=this._factory.literal(i.value,this._factory.namedNode(i.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",i);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",i);default:if(void 0===(this._object=this._readEntity(i)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(i){return"{"===i.type?this._readGraph(i):this._readPredicate(i)}_readGraph(i){return"{"!==i.type?this._error(`Expected graph but got ${i.type}`,i):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(i){return"]"===i.type?(this._subject=null,this._readBlankNodeTail(i)):(this._predicate=null,this._readPredicate(i))}_readBlankNodeTail(i){if("]"!==i.type)return this._readBlankNodePunctuation(i);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const l=null===this._predicate;return this._restoreContext("blank",i),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:l?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(i){switch(i.type){case".":case"}":return this._subject=null,this._readPunctuation(i);default:return this._readPredicate(i)}}_readListItem(i){let l=null,a=null,b=this._readListItem;const C=this._subject,v=this._contextStack,W=v[v.length-1];switch(i.type){case"[":this._saveContext("blank",this._graph,a=this._factory.blankNode(),this.RDF_FIRST,this._subject=l=this._factory.blankNode()),b=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,a=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",i),0!==v.length&&"list"===v[v.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(b=this._readPredicate,this._subject===this.RDF_NIL)return b}else if(b=this._getContextEndReader(),this._object===this.RDF_NIL)return b;a=this.RDF_NIL;break;case"literal":0===i.prefix.length?(this._literalValue=i.value,b=this._readListItemDataTypeOrLang):(l=this._factory.literal(i.value,this._factory.namedNode(i.prefix)),b=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",i);default:if(void 0===(l=this._readEntity(i)))return}if(null===a&&(this._subject=a=this._factory.blankNode()),null===C?null===W.predicate?W.subject=a:W.object=a:this._emit(C,this.RDF_REST,a,this._graph),null!==l){if(this._n3Mode&&("IRI"===i.type||"prefixed"===i.type))return this._saveContext("item",this._graph,a,this.RDF_FIRST,l),this._subject=l,this._predicate=null,this._getPathReader(this._readListItem);this._emit(a,this.RDF_FIRST,l,this._graph)}return b}_readDataTypeOrLang(i){return this._completeObjectLiteral(i,!1)}_readListItemDataTypeOrLang(i){return this._completeObjectLiteral(i,!0)}_completeLiteral(i){let l=this._factory.literal(this._literalValue);switch(i.type){case"type":case"typeIRI":const a=this._readEntity(i);if(void 0===a)return;l=this._factory.literal(this._literalValue,a),i=null;break;case"langcode":l=this._factory.literal(this._literalValue,i.value),i=null}return{token:i,literal:l}}_completeSubjectLiteral(i){return this._subject=this._completeLiteral(i).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(i,l){const a=this._completeLiteral(i);if(a)return this._object=a.literal,l&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===a.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(a.token))}_readFormulaTail(i){return"}"!==i.type?this._readPunctuation(i):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",i),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(i){let l,a=this._graph;const b=this._subject,C=this._inversePredicate;switch(i.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",i);if(this._n3Mode)return this._readFormulaTail(i);this._graph=null;case".":this._subject=null,l=this._contextStack.length?this._readSubject:this._readInTopContext,C&&(this._inversePredicate=!1);break;case";":l=this._readPredicate;break;case",":l=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",i);this._subject=this._factory.quad(b,this._predicate,this._object,this.DEFAULTGRAPH),l=this._readPredicate;break;case"|}":if("Quad"!==this._subject.termType)return this._error("Unexpected asserted triple closing",i);this._subject=null,l=this._readPunctuation;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(a=this._readEntity(i))){l=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,i)}if(null!==b){const v=this._predicate,W=this._object;C?this._emit(W,v,b,a):this._emit(b,v,W,a)}return l}_readBlankNodePunctuation(i){let l;switch(i.type){case";":l=this._readPredicate;break;case",":l=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,i)}return this._emit(this._subject,this._predicate,this._object,this._graph),l}_readQuadPunctuation(i){return"."!==i.type?this._error("Expected dot to follow quad",i):this._readInTopContext}_readPrefix(i){return"prefix"!==i.type?this._error("Expected prefix to follow @prefix",i):(this._prefix=i.value,this._readPrefixIRI)}_readPrefixIRI(i){if("IRI"!==i.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,i);const l=this._readEntity(i);return this._prefixes[this._prefix]=l.value,this._prefixCallback(this._prefix,l),this._readDeclarationPunctuation}_readBaseIRI(i){const l="IRI"===i.type&&this._resolveIRI(i.value);return l?(this._setBase(l),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",i)}_readNamedGraphLabel(i){switch(i.type){case"IRI":case"blank":case"prefixed":return this._readSubject(i),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",i)}}_readNamedGraphBlankLabel(i){return"]"!==i.type?this._error("Invalid graph label",i):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(i){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(i)):"."!==i.type?this._error("Expected declaration to end with a dot",i):this._readInTopContext}_readQuantifierList(i){let l;switch(i.type){case"IRI":case"prefixed":if(void 0!==(l=this._readEntity(i,!0)))break;default:return this._error(`Unexpected ${i.type}`,i)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,l,this.QUANTIFIERS_GRAPH)):this._quantified[l.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(i){return","===i.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(i))}_getPathReader(i){return this._afterPath=i,this._readPath}_readPath(i){switch(i.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const l=this._contextStack,a=l.length&&l[l.length-1];if(a&&"item"===a.type){const b=this._subject;this._restoreContext("item",i),this._emit(this._subject,this.RDF_FIRST,b,this._graph)}return this._afterPath(i)}}_readForwardPath(i){let l,a;const b=this._factory.blankNode();if(void 0!==(a=this._readEntity(i)))return null===this._predicate?(l=this._subject,this._subject=b):(l=this._object,this._object=b),this._emit(l,a,b,this._graph),this._readPath}_readBackwardPath(i){const l=this._factory.blankNode();let a,b;if(void 0!==(a=this._readEntity(i)))return null===this._predicate?(b=this._subject,this._subject=l):(b=this._object,this._object=l),this._emit(l,a,b,this._graph),this._readPath}_readRDFStarTailOrGraph(i){return">>"!==i.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(i))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,i):this._readRDFStarTail(i)}_readRDFStarTail(i){if(">>"!==i.type)return this._error(`Expected >> but got ${i.type}`,i);const l=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",i),null===this._subject?(this._subject=l,this._readPredicate):(this._object=l,this._getContextEndReader())}_getContextEndReader(){const i=this._contextStack;if(!i.length)return this._readPunctuation;switch(i[i.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(i,l,a,b){this._callback(null,this._factory.quad(i,l,a,b||this.DEFAULTGRAPH))}_error(i,l){const a=new Error(`${i} on line ${l.line}.`);a.context={token:l,line:l.line,previousToken:this._lexer.previousToken},this._callback(a),this._callback=mt}_resolveIRI(i){return/^[a-z][a-z0-9+.-]*:/i.test(i)?i:this._resolveRelativeIRI(i)}_resolveRelativeIRI(i){if(!i.length)return this._base;switch(i[0]){case"#":return this._base+i;case"?":return this._base.replace(/(?:\?.*)?$/,i);case"/":return("/"===i[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(i);default:return/^[^/:]*:/.test(i)?null:this._removeDotSegments(this._basePath+i)}}_removeDotSegments(i){if(!/(^|\/)\.\.?($|[/#?])/.test(i))return i;const l=i.length;let a="",b=-1,C=-1,v=0,W="/";for(;b<l;){switch(W){case":":if(C<0&&"/"===i[++b]&&"/"===i[++b])for(;(C=b+1)<l&&"/"!==i[C];)b=C;break;case"?":case"#":b=l;break;case"/":if("."===i[b+1])switch(W=i[1+ ++b],W){case"/":a+=i.substring(v,b-1),v=b+1;break;case void 0:case"?":case"#":return a+i.substring(v,b)+i.substr(b+1);case".":if(W=i[1+ ++b],void 0===W||"/"===W||"?"===W||"#"===W){if(a+=i.substring(v,b-2),(v=a.lastIndexOf("/"))>=C&&(a=a.substr(0,v)),"/"!==W)return`${a}/${i.substr(b+1)}`;v=b+1}}}W=i[++b]}return a+i.substring(v)}parse(i,l,a){let b,C,v;if(l&&(l.onQuad||l.onPrefix||l.onComment)?(b=l.onQuad,C=l.onPrefix,v=l.onComment):(b=l,C=a),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${lt++}_`,this._prefixCallback=C||mt,this._inversePredicate=!1,this._quantified=Object.create(null),!b){const ee=[];let ve;if(this._callback=(et,Re)=>{et?ve=et:Re&&ee.push(Re)},this._lexer.tokenize(i).every(et=>this._readCallback=this._readCallback(et)),ve)throw ve;return ee}let W=(ee,ve)=>{null!==ee?(this._callback(ee),this._callback=mt):this._readCallback&&(this._readCallback=this._readCallback(ve))};v&&(this._lexer.comments=!0,W=(ee,ve)=>{null!==ee?(this._callback(ee),this._callback=mt):this._readCallback&&("comment"===ve.type?v(ve.value):this._readCallback=this._readCallback(ve))}),this._callback=b,this._lexer.tokenize(i,W)}}function mt(){}function bt(D,i){D._factory=i,D.DEFAULTGRAPH=i.defaultGraph(),D.RDF_FIRST=i.namedNode(Ue.A.rdf.first),D.RDF_REST=i.namedNode(Ue.A.rdf.rest),D.RDF_NIL=i.namedNode(Ue.A.rdf.nil),D.N3_FORALL=i.namedNode(Ue.A.r.forAll),D.N3_FORSOME=i.namedNode(Ue.A.r.forSome),D.ABBREVIATIONS={a:i.namedNode(Ue.A.rdf.type),"=":i.namedNode(Ue.A.owl.sameAs),">":i.namedNode(Ue.A.log.implies),"<":i.namedNode(Ue.A.log.isImpliedBy)},D.QUANTIFIERS_GRAPH=i.namedNode("urn:n3:quantifiers")}bt(rt.prototype,$e.Ay);var ai=We(738);class Tt{_parentDiv;_theme;_editor;_content="@prefix ex: <https://example.com> .";extensions=this._updateExtensions();_currentDiagnostics=[];events=new Se.EventEmitter;constructor(i,l){this._parentDiv=i,this._theme=(0,ct.O)(l),this._updateExtensions(),this._build()}set content(i){this._content=i,this._build()}set theme(i){this._theme=(0,ct.O)(i),this._updateExtensions(),this._build()}dispose(){this._editor?.destroy()}_build(){this._editor?.destroy(),this._editor=new le.Lz({state:Ye.$t.create({doc:this._content,extensions:this.extensions}),parent:this._parentDiv})}_updateExtensions(){return this.extensions=[Te.oQ,new qe.Yy(Oe),this._theme,(0,ai.bu)(this._getDiagnostics.bind(this)),le.Lz.updateListener.of(i=>{if(i.docChanged){const l=i.state.doc.toString();this.events.emit("contentChanged",l),this._checkIfValid(l.trim())}}),le.w4.of([Ve.Yc])],this.extensions}_getDiagnostics(){return this._currentDiagnostics}_checkIfValid(i){var l=this;return(0,J.A)(function*(){l._currentDiagnostics=[];const C=i.match(/^\s*(@base|BASE)\s+<([^>]+)>\s*\./im)?.[2];new rt({baseIRI:C}).parse(i,(W,ee)=>{W?(l._handleError(W),l._editor&&l._editor.dispatch({changes:[]})):ee||(l.events.emit("contentValid",!0),l.events.emit("error",void 0))})})()}_createDiagnostic(i){return{from:i.startIndex??0,to:i.endIndex??0,severity:"error",message:i.message}}_handleError(i){const l=i.context.line,a=this._editor?.state.doc;let b=i.context.token.start,C=i.context.token.end;if(a){const ee=a.line(l);b=ee.from+i.context.token.start,C=ee.from+i.context.token.end}const v={line:l,message:i.toString(),startIndex:b,endIndex:C},W=this._createDiagnostic(v);this._currentDiagnostics=[W],this.events.emit("error",v),this.events.emit("contentValid",!1)}}class Gi{constructor(i,l,a){this.parent=i,this.depth=l,this.type=a,this.hash=(i?i.hash+i.hash<<8:0)+l+(l<<4)+a}}function Ut(D,i){for(let l=0,a=i-D.pos-1;;a--,l++){let b=D.peek(a);if(Bi(b)||-1==b)return l}}function $i(D){return 32==D||9==D}function Bi(D){return 10==D||13==D}function Q(D){return $i(D)||Bi(D)}function u(D){return D<0||Q(D)}Gi.top=new Gi(null,-1,0);const d=new Ne({start:Gi.top,reduce:(D,i)=>3!=D.type||20!=i&&34!=i?D:D.parent,shift(D,i,l,a){if(3==i)return new Gi(D,Ut(a,a.pos),1);if(65==i||5==i)return new Gi(D,Ut(a,a.pos),2);if(63==i)return D.parent;if(19==i||33==i)return new Gi(D,0,3);if(13==i&&4==D.type)return D.parent;if(47==i){let b=/[1-9]/.exec(a.read(a.pos,l.pos));if(b)return new Gi(D,D.depth+ +b[0],4)}return D},hash:D=>D.hash});function O(D,i,l=0){return D.peek(l)==i&&D.peek(l+1)==i&&D.peek(l+2)==i&&u(D.peek(l+3))}const T=new He((D,i)=>{if(-1==D.next&&i.canShift(64))return D.acceptToken(64);let l=D.peek(-1);if((Bi(l)||l<0)&&3!=i.context.type){if(O(D,45)){if(!i.canShift(63))return D.acceptToken(1,3);D.acceptToken(63)}if(O(D,46)){if(!i.canShift(63))return D.acceptToken(2,3);D.acceptToken(63)}let a=0;for(;32==D.next;)a++,D.advance();(a<i.context.depth||a==i.context.depth&&1==i.context.type&&(45!=D.next||!u(D.peek(1))))&&-1!=D.next&&!Bi(D.next)&&35!=D.next&&D.acceptToken(63,-a)}},{contextual:!0}),N=new He((D,i)=>{if(3!=i.context.type)if(45==D.next)D.advance(),u(D.next)&&D.acceptToken(1==i.context.type&&i.context.depth==Ut(D,D.pos-1)?4:3);else if(63==D.next)D.advance(),u(D.next)&&D.acceptToken(2==i.context.type&&i.context.depth==Ut(D,D.pos-1)?6:5);else{let l=D.pos;for(;;)if($i(D.next)){if(D.pos==l)return;D.advance()}else if(33==D.next)Ce(D);else{if(38!=D.next){if(42==D.next){je(D);break}if(39==D.next||34==D.next){if(ot(D,!0))break;return}if(91==D.next||123==D.next){if(!gt(D))return;break}$t(D,!0,!1,0);break}je(D)}for(;$i(D.next);)D.advance();if(58==D.next){if(D.pos==l&&i.canShift(29))return;u(D.peek(1))&&D.acceptTokenTo(2==i.context.type&&i.context.depth==Ut(D,l)?66:65,l)}}else 63==D.next&&(D.advance(),u(D.next)&&D.acceptToken(7))},{contextual:!0});function re(D){return D>=48&&D<=57||D>=97&&D<=102||D>=65&&D<=70}function ce(D,i){return 37==D.next?(D.advance(),re(D.next)&&D.advance(),re(D.next)&&D.advance(),!0):!!(function $(D){return D>32&&D<127&&34!=D&&37!=D&&44!=D&&60!=D&&62!=D&&92!=D&&94!=D&&96!=D&&123!=D&&124!=D&&125!=D}(D.next)||i&&44==D.next)&&(D.advance(),!0)}function Ce(D){if(D.advance(),60==D.next){for(D.advance();;)if(!ce(D,!0)){62==D.next&&D.advance();break}}else for(;ce(D,!1););}function je(D){for(D.advance();!u(D.next)&&"f"!=jt(D.next);)D.advance()}function ot(D,i){let l=D.next,a=!1,b=D.pos;for(D.advance();;){let C=D.next;if(C<0)break;if(D.advance(),C==l){if(39!=C)break;if(39!=D.next)break;D.advance()}else if(92==C&&34==l)D.next>=0&&D.advance();else if(Bi(C)){if(i)return!1;a=!0}else if(i&&D.pos>=b+1024)return!1}return!a}function gt(D){for(let i=[],l=D.pos+1024;;)if(91==D.next||123==D.next)i.push(D.next),D.advance();else if(39==D.next||34==D.next){if(!ot(D,!0))return!1}else if(93==D.next||125==D.next){if(i[i.length-1]!=D.next-2)return!1;if(i.pop(),D.advance(),!i.length)return!0}else{if(D.next<0||D.pos>l||Bi(D.next))return!1;D.advance()}}function jt(D){return D<33?"u":D>125?"s":"iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif"[D-33]}function Ci(D,i){let l=jt(D);return"u"!=l&&!(i&&"f"==l)}function $t(D,i,l,a){if("s"!=jt(D.next)&&(63!=D.next&&58!=D.next&&45!=D.next||!Ci(D.peek(1),l)))return!1;D.advance();let b=D.pos;for(;;){let C=D.next,v=0,W=a+1;for(;Q(C);){if(Bi(C)){if(i)return!1;W=0}else W++;C=D.peek(++v)}if(!(C>=0&&(58==C?Ci(D.peek(v+1),l):35==C?32!=D.peek(v-1):Ci(C,l)))||!l&&W<=a||0==W&&!l&&(O(D,45,v)||O(D,46,v)))break;if(i&&"f"==jt(C))return!1;for(let ve=v;ve>=0;ve--)D.advance();if(i&&D.pos>b+1024)return!1}return!0}const zi=new He((D,i)=>{if(33==D.next)Ce(D),D.acceptToken(12);else if(38==D.next||42==D.next){let l=38==D.next?10:11;je(D),D.acceptToken(l)}else 39==D.next||34==D.next?(ot(D,!1),D.acceptToken(9)):$t(D,!1,3==i.context.type,i.context.depth)&&D.acceptToken(8)}),pn=new He((D,i)=>{let l=4==i.context.type?i.context.depth:-1,a=D.pos;e:for(;;){let b=0,C=D.next;for(;32==C;)C=D.peek(++b);if(!b&&(O(D,45,b)||O(D,46,b))||!Bi(C)&&(l<0&&(l=Math.max(i.context.depth+1,b)),b<l))break;for(;;){if(D.next<0)break e;let v=Bi(D.next);if(D.advance(),v)continue e;a=D.pos}}D.acceptTokenTo(13,a)}),gn=(0,Ae.pn)({DirectiveName:Ae._A.keyword,DirectiveContent:Ae._A.attributeValue,"DirectiveEnd DocEnd":Ae._A.meta,QuotedLiteral:Ae._A.string,BlockLiteralHeader:Ae._A.special(Ae._A.string),BlockLiteralContent:Ae._A.content,Literal:Ae._A.content,"Key/Literal Key/QuotedLiteral":Ae._A.definition(Ae._A.propertyName),"Anchor Alias":Ae._A.labelName,Tag:Ae._A.typeName,Comment:Ae._A.lineComment,": , -":Ae._A.separator,"?":Ae._A.punctuation,"[ ]":Ae._A.squareBracket,"{ }":Ae._A.brace}),Un=me.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"\u26a0 DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:d,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[gn],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[T,N,zi,pn,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),Yi=qe.bj.define({name:"yaml",parser:Un.configure({props:[qe.Oh.add({Stream:D=>{for(let i=D.node.resolve(D.pos,-1);i&&i.to>=D.pos;i=i.parent){if("BlockLiteralContent"==i.name&&i.from<i.to)return D.baseIndentFor(i);if("BlockLiteral"==i.name)return D.baseIndentFor(i)+D.unit;if("BlockSequence"==i.name||"BlockMapping"==i.name)return D.column(i.firstChild.from,1);if("QuotedLiteral"==i.name)return null;if("Literal"==i.name){let l=D.column(i.from,1);if(l==D.lineIndent(i.from,1))return l;if(i.to>D.pos)return null}}return null},FlowMapping:(0,qe.Ay)({closing:"}"}),FlowSequence:(0,qe.Ay)({closing:"]"})}),qe.b_.add({"FlowMapping FlowSequence":qe.yd,"Item Pair BlockLiteral":(D,i)=>({from:i.doc.lineAt(D.from).to,to:D.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});class kn{_parentDiv;_theme;_editor;_content="hello:\n world";extensions=this._updateExtensions();events=new Se.EventEmitter;constructor(i,l){this._parentDiv=i,this._theme=(0,ct.O)(l),this._updateExtensions(),this._build()}set content(i){this._content=i,this._build()}set theme(i){this._theme=(0,ct.O)(i),this._updateExtensions(),this._build()}dispose(){this._editor?.destroy()}_build(){this._editor?.destroy(),this._editor=new le.Lz({state:Ye.$t.create({doc:this._content,extensions:this.extensions}),parent:this._parentDiv})}_updateExtensions(){return this.extensions=[Te.oQ,new qe.Yy(Yi),this._theme,le.Lz.updateListener.of(i=>{if(i.docChanged){const l=i.state.doc.toString();this.events.emit("contentChanged",l)}}),le.w4.of([Ve.Yc])],this.extensions}}function ke(D){return 45==D||46==D||58==D||D>=65&&D<=90||95==D||D>=97&&D<=122||D>=161}function Xe(D){return 9==D||10==D||13==D||32==D}let Qe=null,Ot=null,Ft=0;function bi(D,i){let l=D.pos+i;if(Ot==D&&Ft==l)return Qe;for(;Xe(D.peek(i));)i++;let a="";for(;;){let b=D.peek(i);if(!ke(b))break;a+=String.fromCharCode(b),i++}return Ot=D,Ft=l,Qe=a||null}function on(D,i){this.name=D,this.parent=i}const Hi=new Ne({start:null,shift:(D,i,l,a)=>1==i?new on(bi(a,1)||"",D):D,reduce:(D,i)=>11==i&&D?D.parent:D,reuse(D,i,l,a){let b=i.type.id;return 1==b||13==b?new on(bi(a,1)||"",D):D},strict:!1}),On=new He((D,i)=>{if(60==D.next)if(D.advance(),47==D.next){D.advance();let l=bi(D,0);if(!l)return D.acceptToken(5);if(i.context&&l==i.context.name)return D.acceptToken(2);for(let a=i.context;a;a=a.parent)if(a.name==l)return D.acceptToken(3,-2);D.acceptToken(4)}else if(33!=D.next&&63!=D.next)return D.acceptToken(1)},{contextual:!0});function Ti(D,i){return new He(l=>{let a=0,b=i.charCodeAt(0);e:for(;!(l.next<0);l.advance(),a++)if(l.next==b){for(let C=1;C<i.length;C++)if(l.peek(C)!=i.charCodeAt(C))continue e;break}a&&l.acceptToken(D)})}const Nn=Ti(36,"--\x3e"),un=Ti(37,"?>"),zn=Ti(38,"]]>"),yn=(0,Ae.pn)({Text:Ae._A.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":Ae._A.angleBracket,TagName:Ae._A.tagName,"MismatchedCloseTag/TagName":[Ae._A.tagName,Ae._A.invalid],AttributeName:Ae._A.attributeName,AttributeValue:Ae._A.attributeValue,Is:Ae._A.definitionOperator,"EntityReference CharacterReference":Ae._A.character,Comment:Ae._A.blockComment,ProcessingInst:Ae._A.processingInstruction,DoctypeDecl:Ae._A.documentMeta,Cdata:Ae._A.special(Ae._A.string)}),ln=me.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6z-E6zOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6{-E6{OOOP1G.x1G.xOOOS-E6|-E6|OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'mO!bO,59eOOOO-E6w-E6wO'{OpO1G.uO'{OpO1G.uOOOP1G.u1G.uO(TOpO7+$fOOOP7+$f7+$fO(]O!bO<<GuOOOP<<Gu<<GuOOOP<<G}<<G}O'bOpO1G.qO'bOpO1G.qO(hO#tO'#CnO(vO&jO'#CnOOOO1G.q1G.qO)UOpO7+$aOOOP7+$a7+$aOOOP<<HQ<<HQOOOPAN=aAN=aOOOPAN=iAN=iO'bOpO7+$]OOOO7+$]7+$]OOOO'#Cz'#CzO)^O#tO,59YOOOO,59Y,59YOOOO'#C{'#C{O)lO&jO,59YOOOP<<G{<<G{OOOO<<Gw<<GwOOOO-E6x-E6xOOOO1G.t1G.tOOOO-E6y-E6y",stateData:")z~OPQOSVOTWOVWOWWOXWOiXOyPO!QTO!SUO~OvZOx]O~O^`Oz^O~OPQOQcOSVOTWOVWOWWOXWOyPO!QTO!SUO~ORdO~P!SOteO!PgO~OuhO!RjO~O^lOz^O~OvZOxoO~O^qOz^O~O[vO`sOdwOz^O~ORyO~P!SO^{Oz^O~OteO!P}O~OuhO!R!PO~O^!QOz^O~O[!SOz^O~O[!VO`sOd!WOz^O~Oa!YOz^O~Oz^O[mX`mXdmX~O[!VO`sOd!WO~O^!]Oz^O~O[!_Oz^O~O[!aOz^O~O[!cO`sOd!dOz^O~O[!cO`sOd!dO~Oa!eOz^O~Oz^O{!gO}!hO~Oz^O[ma`madma~O[!kOz^O~O[!lOz^O~O[!mO`sOd!nO~OW!qOX!qO{!sO|!qO~OW!tOX!tO}!sO!O!tO~O[!vOz^O~OW!qOX!qO{!yO|!qO~OW!tOX!tO}!yO!O!tO~O",goto:"%cxPPPPPPPPPPyyP!PP!VPP!`!jP!pyyyP!v!|#S$[$k$q$w$}%TPPPP%ZXWORYbXRORYb_t`qru!T!U!bQ!i!YS!p!e!fR!w!oQdRRybXSORYbQYORmYQ[PRn[Q_QQkVjp_krz!R!T!X!Z!^!`!f!j!oQr`QzcQ!RlQ!TqQ!XsQ!ZtQ!^{Q!`!QQ!f!YQ!j!]R!o!eQu`S!UqrU![u!U!bR!b!TQ!r!gR!x!rQ!u!hR!z!uQbRRxbQfTR|fQiUR!OiSXOYTaRb",nodeNames:"\u26a0 StartTag StartCloseTag MissingCloseTag StartCloseTag StartCloseTag Document Text EntityReference CharacterReference Cdata Element EndTag OpenTag TagName Attribute AttributeName Is AttributeValue CloseTag SelfCloseEndTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag DoctypeDecl",maxTerm:50,context:Hi,nodeProps:[["closedBy",1,"SelfCloseEndTag EndTag",13,"CloseTag MissingCloseTag"],["openedBy",12,"StartTag StartCloseTag",19,"OpenTag",20,"StartTag"],["isolate",-6,13,18,19,21,22,24,""]],propSources:[yn],skippedNodes:[0],repeatNodeCount:9,tokenData:"!)v~R!YOX$qXY)iYZ)iZ]$q]^)i^p$qpq)iqr$qrs*vsv$qvw+fwx/ix}$q}!O0[!O!P$q!P!Q2z!Q![$q![!]4n!]!^$q!^!_8U!_!`!#t!`!a!$l!a!b!%d!b!c$q!c!}4n!}#P$q#P#Q!'W#Q#R$q#R#S4n#S#T$q#T#o4n#o%W$q%W%o4n%o%p$q%p&a4n&a&b$q&b1p4n1p4U$q4U4d4n4d4e$q4e$IS4n$IS$I`$q$I`$Ib4n$Ib$Kh$q$Kh%#t4n%#t&/x$q&/x&Et4n&Et&FV$q&FV;'S4n;'S;:j8O;:j;=`)c<%l?&r$q?&r?Ah4n?Ah?BY$q?BY?Mn4n?MnO$qi$zXVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qa%nVVP!O`Ov%gwx&Tx!^%g!^!_&o!_;'S%g;'S;=`'W<%lO%gP&YTVPOv&Tw!^&T!_;'S&T;'S;=`&i<%lO&TP&lP;=`<%l&T`&tS!O`Ov&ox;'S&o;'S;=`'Q<%lO&o`'TP;=`<%l&oa'ZP;=`<%l%gX'eWVP|WOr'^rs&Tsv'^w!^'^!^!_'}!_;'S'^;'S;=`(i<%lO'^W(ST|WOr'}sv'}w;'S'};'S;=`(c<%lO'}W(fP;=`<%l'}X(lP;=`<%l'^h(vV|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oh)`P;=`<%l(oi)fP;=`<%l$qo)t`VP|W!O`zUOX$qXY)iYZ)iZ]$q]^)i^p$qpq)iqr$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk+PV{YVP!O`Ov%gwx&Tx!^%g!^!_&o!_;'S%g;'S;=`'W<%lO%g~+iast,n![!]-r!c!}-r#R#S-r#T#o-r%W%o-r%p&a-r&b1p-r4U4d-r4e$IS-r$I`$Ib-r$Kh%#t-r&/x&Et-r&FV;'S-r;'S;:j/c?&r?Ah-r?BY?Mn-r~,qQ!Q![,w#l#m-V~,zQ!Q![,w!]!^-Q~-VOX~~-YR!Q![-c!c!i-c#T#Z-c~-fS!Q![-c!]!^-Q!c!i-c#T#Z-c~-ug}!O-r!O!P-r!Q![-r![!]-r!]!^/^!c!}-r#R#S-r#T#o-r$}%O-r%W%o-r%p&a-r&b1p-r1p4U-r4U4d-r4e$IS-r$I`$Ib-r$Je$Jg-r$Kh%#t-r&/x&Et-r&FV;'S-r;'S;:j/c?&r?Ah-r?BY?Mn-r~/cOW~~/fP;=`<%l-rk/rW}bVP|WOr'^rs&Tsv'^w!^'^!^!_'}!_;'S'^;'S;=`(i<%lO'^k0eZVP|W!O`Or$qrs%gsv$qwx'^x}$q}!O1W!O!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk1aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a2S!a;'S$q;'S;=`)c<%lO$qk2_X!PQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qm3TZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a3v!a;'S$q;'S;=`)c<%lO$qm4RXdSVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qo4{!P`S^QVP|W!O`Or$qrs%gsv$qwx'^x}$q}!O4n!O!P4n!P!Q$q!Q![4n![!]4n!]!^$q!^!_(o!_!c$q!c!}4n!}#R$q#R#S4n#S#T$q#T#o4n#o$}$q$}%O4n%O%W$q%W%o4n%o%p$q%p&a4n&a&b$q&b1p4n1p4U4n4U4d4n4d4e$q4e$IS4n$IS$I`$q$I`$Ib4n$Ib$Je$q$Je$Jg4n$Jg$Kh$q$Kh%#t4n%#t&/x$q&/x&Et4n&Et&FV$q&FV;'S4n;'S;:j8O;:j;=`)c<%l?&r$q?&r?Ah4n?Ah?BY$q?BY?Mn4n?MnO$qo8RP;=`<%l4ni8]Y|W!O`Oq(oqr8{rs&osv(owx'}x!a(o!a!b!#U!b;'S(o;'S;=`)]<%lO(oi9S_|W!O`Or(ors&osv(owx'}x}(o}!O:R!O!f(o!f!g;e!g!}(o!}#ODh#O#W(o#W#XLp#X;'S(o;'S;=`)]<%lO(oi:YX|W!O`Or(ors&osv(owx'}x}(o}!O:u!O;'S(o;'S;=`)]<%lO(oi;OV!QP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oi;lX|W!O`Or(ors&osv(owx'}x!q(o!q!r<X!r;'S(o;'S;=`)]<%lO(oi<`X|W!O`Or(ors&osv(owx'}x!e(o!e!f<{!f;'S(o;'S;=`)]<%lO(oi=SX|W!O`Or(ors&osv(owx'}x!v(o!v!w=o!w;'S(o;'S;=`)]<%lO(oi=vX|W!O`Or(ors&osv(owx'}x!{(o!{!|>c!|;'S(o;'S;=`)]<%lO(oi>jX|W!O`Or(ors&osv(owx'}x!r(o!r!s?V!s;'S(o;'S;=`)]<%lO(oi?^X|W!O`Or(ors&osv(owx'}x!g(o!g!h?y!h;'S(o;'S;=`)]<%lO(oi@QY|W!O`Or?yrs@psv?yvwA[wxBdx!`?y!`!aCr!a;'S?y;'S;=`Db<%lO?ya@uV!O`Ov@pvxA[x!`@p!`!aAy!a;'S@p;'S;=`B^<%lO@pPA_TO!`A[!`!aAn!a;'SA[;'S;=`As<%lOA[PAsOiPPAvP;=`<%lA[aBQSiP!O`Ov&ox;'S&o;'S;=`'Q<%lO&oaBaP;=`<%l@pXBiX|WOrBdrsA[svBdvwA[w!`Bd!`!aCU!a;'SBd;'S;=`Cl<%lOBdXC]TiP|WOr'}sv'}w;'S'};'S;=`(c<%lO'}XCoP;=`<%lBdiC{ViP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oiDeP;=`<%l?yiDoZ|W!O`Or(ors&osv(owx'}x!e(o!e!fEb!f#V(o#V#WIr#W;'S(o;'S;=`)]<%lO(oiEiX|W!O`Or(ors&osv(owx'}x!f(o!f!gFU!g;'S(o;'S;=`)]<%lO(oiF]X|W!O`Or(ors&osv(owx'}x!c(o!c!dFx!d;'S(o;'S;=`)]<%lO(oiGPX|W!O`Or(ors&osv(owx'}x!v(o!v!wGl!w;'S(o;'S;=`)]<%lO(oiGsX|W!O`Or(ors&osv(owx'}x!c(o!c!dH`!d;'S(o;'S;=`)]<%lO(oiHgX|W!O`Or(ors&osv(owx'}x!}(o!}#OIS#O;'S(o;'S;=`)]<%lO(oiI]V|W!O`yPOr(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oiIyX|W!O`Or(ors&osv(owx'}x#W(o#W#XJf#X;'S(o;'S;=`)]<%lO(oiJmX|W!O`Or(ors&osv(owx'}x#T(o#T#UKY#U;'S(o;'S;=`)]<%lO(oiKaX|W!O`Or(ors&osv(owx'}x#h(o#h#iK|#i;'S(o;'S;=`)]<%lO(oiLTX|W!O`Or(ors&osv(owx'}x#T(o#T#UH`#U;'S(o;'S;=`)]<%lO(oiLwX|W!O`Or(ors&osv(owx'}x#c(o#c#dMd#d;'S(o;'S;=`)]<%lO(oiMkX|W!O`Or(ors&osv(owx'}x#V(o#V#WNW#W;'S(o;'S;=`)]<%lO(oiN_X|W!O`Or(ors&osv(owx'}x#h(o#h#iNz#i;'S(o;'S;=`)]<%lO(oi! RX|W!O`Or(ors&osv(owx'}x#m(o#m#n! n#n;'S(o;'S;=`)]<%lO(oi! uX|W!O`Or(ors&osv(owx'}x#d(o#d#e!!b#e;'S(o;'S;=`)]<%lO(oi!!iX|W!O`Or(ors&osv(owx'}x#X(o#X#Y?y#Y;'S(o;'S;=`)]<%lO(oi!#_V!SP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(ok!$PXaQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qo!$wX[UVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!%mZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!&`!a;'S$q;'S;=`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[On,Nn,un,zn,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function Bn(D,i){let l=i&&i.getChild("TagName");return l?D.sliceString(l.from,l.to):""}function Cn(D,i){let l=i&&i.firstChild;return l&&"OpenTag"==l.name?Bn(D,l):""}function Gn(D){for(let i=D&&D.parent;i;i=i.parent)if("Element"==i.name)return i;return null}class Wn{constructor(i,l,a){this.attrs=l,this.attrValues=a,this.children=[],this.name=i.name,this.completion=Object.assign(Object.assign({type:"type"},i.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"</"+this.name+">",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=i.textContent?i.textContent.map(b=>({label:b,type:"text"})):[]}}const vn=/^[:\-\.\w\u00b7-\uffff]*$/;function Yn(D){return Object.assign(Object.assign({type:"property"},D.completion||{}),{label:D.name})}function Hn(D){return"string"==typeof D?{label:`"${D}"`,type:"constant"}:/^"/.test(D.label)?D:Object.assign(Object.assign({},D),{label:`"${D.label}"`})}function Pn(D,i){let l=[],a=[],b=Object.create(null);for(let ee of i){let ve=Yn(ee);l.push(ve),ee.global&&a.push(ve),ee.values&&(b[ee.name]=ee.values.map(Hn))}let C=[],v=[],W=Object.create(null);for(let ee of D){let ve=a,et=b;ee.attributes&&(ve=ve.concat(ee.attributes.map(tt=>"string"==typeof tt?l.find(_t=>_t.label==tt)||{label:tt,type:"property"}:(tt.values&&(et==b&&(et=Object.create(et)),et[tt.name]=tt.values.map(Hn)),Yn(tt)))));let Re=new Wn(ee,ve,et);W[Re.name]=Re,C.push(Re),ee.top&&v.push(Re)}v.length||(v=C);for(let ee=0;ee<C.length;ee++){let ve=D[ee],et=C[ee];if(ve.children)for(let Re of ve.children)W[Re]&&et.children.push(W[Re]);else et.children=C}return ee=>{var ve;let{doc:et}=ee.state,Re=function Xn(D,i){var l;let a=(0,qe.mv)(D).resolveInner(i,-1),b=null;for(let C=a;!b&&C.parent;C=C.parent)("OpenTag"==C.name||"CloseTag"==C.name||"SelfClosingTag"==C.name||"MismatchedCloseTag"==C.name)&&(b=C);if(b&&(b.to>i||b.lastChild.type.isError)){let C=b.parent;if("TagName"==a.name)return"CloseTag"==b.name||"MismatchedCloseTag"==b.name?{type:"closeTag",from:a.from,context:C}:{type:"openTag",from:a.from,context:Gn(C)};if("AttributeName"==a.name)return{type:"attrName",from:a.from,context:b};if("AttributeValue"==a.name)return{type:"attrValue",from:a.from,context:b};let v=a==b||"Attribute"==a.name?a.childBefore(i):a;return"StartTag"==v?.name?{type:"openTag",from:i,context:Gn(C)}:"StartCloseTag"==v?.name&&v.to<=i?{type:"closeTag",from:i,context:C}:"Is"==v?.name?{type:"attrValue",from:i,context:b}:v?{type:"attrName",from:i,context:b}:null}if("StartCloseTag"==a.name)return{type:"closeTag",from:i,context:a.parent};for(;a.parent&&a.to==i&&(null===(l=a.lastChild)||void 0===l||!l.type.isError);)a=a.parent;return"Element"==a.name||"Text"==a.name||"Document"==a.name?{type:"tag",from:i,context:"Element"==a.name?a:Gn(a)}:null}(ee.state,ee.pos);if(!Re||"tag"==Re.type&&!ee.explicit)return null;let{type:tt,from:_t,context:yt}=Re;if("openTag"==tt){let Dt=v,Oi=Cn(et,yt);if(Oi){let qi=W[Oi];Dt=qi?.children||C}return{from:_t,options:Dt.map(qi=>qi.completion),validFor:vn}}if("closeTag"==tt){let Dt=Cn(et,yt);return Dt?{from:_t,to:ee.pos+(">"==et.sliceString(ee.pos,ee.pos+1)?1:0),options:[(null===(ve=W[Dt])||void 0===ve?void 0:ve.closeNameCompletion)||{label:Dt+">",type:"type"}],validFor:vn}:null}if("attrName"==tt){let Dt=W[Bn(et,yt)];return{from:_t,options:Dt?.attrs||a,validFor:vn}}if("attrValue"==tt){let Dt=function rr(D,i,l){let a=i&&i.getChildren("Attribute").find(C=>C.from<=l&&C.to>=l),b=a&&a.getChild("AttributeName");return b?D.sliceString(b.from,b.to):""}(et,yt,_t);if(!Dt)return null;let Oi=W[Bn(et,yt)],qi=(Oi?.attrValues||b)[Dt];return qi&&qi.length?{from:_t,to:ee.pos+('"'==et.sliceString(ee.pos,ee.pos+1)?1:0),options:qi,validFor:/^"[^"]*"?$/}:null}if("tag"==tt){let Dt=Cn(et,yt),Oi=W[Dt],qi=[],an=yt&&yt.lastChild;Dt&&(!an||"CloseTag"!=an.name||Bn(et,an)!=Dt)&&qi.push(Oi?Oi.closeCompletion:{label:"</"+Dt+">",type:"type",boost:2});let Zn=qi.concat((Oi?.children||(yt?C:v)).map(tr=>tr.openCompletion));if(yt&&Oi?.text.length){let tr=yt.firstChild;tr.to>ee.pos-20&&!/\S/.test(ee.state.sliceDoc(tr.to,ee.pos))&&(Zn=Zn.concat(Oi.text))}return{from:_t,options:Zn,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}return null}}const Tn=qe.bj.define({name:"xml",parser:ln.configure({props:[qe.Oh.add({Element(D){let i=/^\s*<\//.test(D.textAfter);return D.lineIndent(D.node.from)+(i?0:D.unit)},"OpenTag CloseTag SelfClosingTag":D=>D.column(D.node.from)+D.unit}),qe.b_.add({Element(D){let i=D.firstChild,l=D.lastChild;return i&&"OpenTag"==i.name?{from:i.to,to:"CloseTag"==l.name?l.from:D.to}:null}}),qe.Q_.add({"OpenTag CloseTag":D=>D.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"\x3c!--",close:"--\x3e"}},indentOnInput:/^\s*<\/$/}});function Vn(D={}){let i=[Tn.data.of({autocomplete:Pn(D.elements||[],D.attributes||[])})];return!1!==D.autoCloseTags&&i.push(sr),new qe.Yy(Tn,i)}function xn(D,i,l=D.length){if(!i)return"";let a=i.firstChild,b=a&&a.getChild("TagName");return b?D.sliceString(b.from,Math.min(b.to,l)):""}const sr=le.Lz.inputHandler.of((D,i,l,a,b)=>{if(D.composing||D.state.readOnly||i!=l||">"!=a&&"/"!=a||!Tn.isActiveAt(D.state,i,-1))return!1;let C=b(),{state:v}=C,W=v.changeByRange(ee=>{var ve,et,Re;let Dt,{head:tt}=ee,_t=v.doc.sliceString(tt-1,tt)==a,yt=(0,qe.mv)(v).resolveInner(tt,-1);if(_t&&">"==a&&"EndTag"==yt.name){let Oi=yt.parent;if("CloseTag"!=(null===(et=null===(ve=Oi.parent)||void 0===ve?void 0:ve.lastChild)||void 0===et?void 0:et.name)&&(Dt=xn(v.doc,Oi.parent,tt)))return{range:ee,changes:{from:tt,to:tt+(">"===v.doc.sliceString(tt,tt+1)?1:0),insert:`</${Dt}>`}}}else if(_t&&"/"==a&&"StartCloseTag"==yt.name){let Oi=yt.parent;if(yt.from==tt-2&&"CloseTag"!=(null===(Re=Oi.lastChild)||void 0===Re?void 0:Re.name)&&(Dt=xn(v.doc,Oi,tt))){let qi=tt+(">"===v.doc.sliceString(tt,tt+1)?1:0),an=`${Dt}>`;return{range:Ye.OF.cursor(tt+an.length,-1),changes:{from:tt,to:qi,insert:an}}}}return{range:ee}});return!W.changes.empty&&(D.dispatch([C,v.update(W,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});class or{_parentDiv;_theme;_editor;_content="hello:\n world";extensions=this._updateExtensions();events=new Se.EventEmitter;constructor(i,l){this._parentDiv=i,this._theme=(0,ct.O)(l),this._updateExtensions(),this._build()}set content(i){this._content=i,this._build()}set theme(i){this._theme=(0,ct.O)(i),this._updateExtensions(),this._build()}dispose(){this._editor?.destroy()}_build(){this._editor?.destroy(),this._editor=new le.Lz({state:Ye.$t.create({doc:this._content,extensions:this.extensions}),parent:this._parentDiv})}_updateExtensions(){return this.extensions=[Te.oQ,Vn(),this._theme,le.Lz.updateListener.of(i=>{if(i.docChanged){const l=i.state.doc.toString();this.events.emit("contentChanged",l)}}),le.w4.of([Ve.Yc])],this.extensions}}var qn=We(5547);const En=["panel"];let er=(()=>{class D{content=(0,j.geq)("");type=(0,j.hFB)("text");variant=(0,j.hFB)("default");readonly=(0,j.hFB)(!1);contentChanged=(0,j.CGW)();invalid=(0,j.CGW)();error=(0,j.CGW)();panel;_editor;onVariantChange=(0,g.QZP)(()=>{const l=this.variant();void 0!==this._editor&&(this._editor.theme=l)});editorValue=(0,g.vPA)("");onContentChange=(0,g.QZP)(()=>{const l=this.content();if(l===this.editorValue())return;let b=l;const C=this.type();"json"!==C&&"jsonld"!==C&&"object"==typeof b&&(b=JSON.stringify(b,null,2)),void 0!==this._editor&&this._editor.content!==b&&(this._editor.content=b)});ngAfterViewInit(){Promise.resolve().then(()=>this.build())}build(){let l=this.type();if("string"!=typeof this.content()&&"jsonld"!==l&&(l="json"),"csv"===l?this._editor=new Ke(this.panel.nativeElement,this.variant()):"jsonld"===l?this._editor=new H(this.panel.nativeElement,this.variant()):"json"===l?this._editor=new I(this.panel.nativeElement,this.variant()):"sparql"===l?this._editor=new L.j(this.panel.nativeElement,this.variant()):"text"===l?this._editor=new K(this.panel.nativeElement,this.variant()):"ttl"===l?this._editor=new Tt(this.panel.nativeElement,this.variant()):"yml"===l?this._editor=new kn(this.panel.nativeElement,this.variant()):"xml"===l&&(this._editor=new or(this.panel.nativeElement,this.variant())),void 0===this._editor)return;const a=this.content();if(this._editor.content=a,this.editorValue.set(a),this.readonly()){const b=this._editor._editor;b&&b.dispatch({effects:Ye.Pe.appendConfig.of(Ye.$t.readOnly.of(!0))})}this._editor.events.addListener("contentChanged",b=>{this.content()!==b&&(this.editorValue.set(b),this.contentChanged.emit(b),this.content.set(b))}),this._editor.events.addListener("contentValid",b=>{this.invalid.emit(!b)}),this._editor.events.addListener("error",b=>{this.error.emit(b)})}static \u0275fac=function(a){return new(a||D)};static \u0275cmp=qn.VBU({type:D,selectors:[["cue-code-editor"]],viewQuery:function(a,b){if(1&a&&qn.GBs(En,5),2&a){let C;qn.mGM(C=qn.lsd())&&(b.panel=C.first)}},inputs:{content:[1,"content"],type:[1,"type"],variant:[1,"variant"],readonly:[1,"readonly"]},outputs:{content:"contentChange",contentChanged:"contentChanged",invalid:"invalid",error:"error"},decls:2,vars:0,consts:[["panel",""],[1,"panel"]],template:function(a,b){1&a&&qn.Hgh(0,"div",1,0)},dependencies:[R.MD],styles:["[_nghost-%COMP%]{display:contents}.panel[_ngcontent-%COMP%]{overflow-y:auto;height:100%;width:100%;border:1px solid var(--borderColor-default);text-align:left}"]})}return D})()},4906(Ei,At,We){"use strict";We.d(At,{j:()=>Ne});var Te,j=We(467),g=We(738),R=We(3161),le=We(1771);function Ve(me){return new RegExp("^(?:"+me.join("|")+")$","i")}var Ye=Ve(["str","lang","langmatches","datatype","bound","sameterm","isiri","isuri","iri","uri","bnode","count","sum","min","max","avg","sample","group_concat","rand","abs","ceil","floor","round","concat","substr","strlen","replace","ucase","lcase","encode_for_uri","contains","strstarts","strends","strbefore","strafter","year","month","day","hours","minutes","seconds","timezone","tz","now","uuid","struuid","md5","sha1","sha256","sha384","sha512","coalesce","if","strlang","strdt","isnumeric","regex","exists","isblank","isliteral","a","bind"]),Se=Ve(["base","prefix","select","distinct","reduced","construct","describe","ask","from","named","where","order","limit","offset","filter","optional","graph","by","asc","desc","as","having","undef","values","group","minus","in","not","service","silent","using","insert","delete","union","true","false","with","data","copy","to","move","add","create","drop","clear","load","into"]),ct=/[*+\-<>=&|\^\/!\?]/,Ke="[A-Za-z_\\-0-9]",X=new RegExp("[A-Za-z]"),ae=new RegExp("(("+Ke+"|\\.)*("+Ke+"))?:");function se(me,de){var pe=me.next();if(Te=null,"$"==pe||"?"==pe)return"?"==pe&&me.match(/\s/,!1)?"operator":(me.match(/^[A-Za-z0-9_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][A-Za-z0-9_\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]*/),"variableName.local");if("<"==pe&&!me.match(/^[\s\u00a0=]/,!1))return me.match(/^[^\s\u00a0>]*>?/),"atom";if('"'==pe||"'"==pe)return de.tokenize=function we(me){return function(de,pe){for(var Ae,Ie=!1;null!=(Ae=de.next());){if(Ae==me&&!Ie){pe.tokenize=se;break}Ie=!Ie&&"\\"==Ae}return"string"}}(pe),de.tokenize(me,de);if(/[{}\(\),\.;\[\]]/.test(pe))return Te=pe,"bracket";if("#"==pe)return me.skipToEnd(),"comment";if(ct.test(pe))return"operator";if(":"==pe)return ge(me),"atom";if("@"==pe)return me.eatWhile(/[a-z\d\-]/i),"meta";if(X.test(pe)&&me.match(ae))return ge(me),"atom";me.eatWhile(/[_\w\d]/);var Ie=me.current();return Ye.test(Ie)?"builtin":Se.test(Ie)?"keyword":"variable"}function ge(me){me.match(/(\.(?=[\w_\-\\%])|[:\w_-]|\\[-\\_~.!$&'()*+,;=/?#@%]|%[a-f\d][a-f\d])+/i)}function dt(me,de,pe){me.context={prev:me.context,indent:me.indent,col:pe,type:de}}function ze(me){me.indent=me.context.indent,me.context=me.context.prev}const Ct={name:"sparql",startState:function(){return{tokenize:se,context:null,indent:0,col:0}},token:function(me,de){if(me.sol()&&(de.context&&null==de.context.align&&(de.context.align=!1),de.indent=me.indentation()),me.eatSpace())return null;var pe=de.tokenize(me,de);if("comment"!=pe&&de.context&&null==de.context.align&&"pattern"!=de.context.type&&(de.context.align=!0),"("==Te)dt(de,")",me.column());else if("["==Te)dt(de,"]",me.column());else if("{"==Te)dt(de,"}",me.column());else if(/[\]\}\)]/.test(Te)){for(;de.context&&"pattern"==de.context.type;)ze(de);de.context&&Te==de.context.type&&(ze(de),"}"==Te&&de.context&&"pattern"==de.context.type&&ze(de))}else"."==Te&&de.context&&"pattern"==de.context.type?ze(de):/atom|string|variable/.test(pe)&&de.context&&(/[\}\]]/.test(de.context.type)?dt(de,"pattern",me.column()):"pattern"==de.context.type&&!de.context.align&&(de.context.align=!0,de.context.col=me.column()));return pe},indent:function(me,de,pe){var Ie=de&&de.charAt(0),Ae=me.context;if(/[\]\}]/.test(Ie))for(;Ae&&"pattern"==Ae.type;)Ae=Ae.prev;var it=Ae&&Ie==Ae.type;return Ae?"pattern"==Ae.type?Ae.col:Ae.align?Ae.col+(it?0:1):Ae.indent+(it?0:pe.unit):0},languageData:{commentTokens:{line:"#"}}};var Qt=We(1380),Wt=We(5759),Mt=We(9131),He=We(6593);function Nt(me){let de=[];const pe=me.state.doc.toString(),Ie=new He.Parser({sparqlStar:!0});try{Ie.parse(pe)}catch(Ae){const it=Ae.toString();if(it.includes("JSON"))return[];const{from:Je,to:qe}=function ri(me,de){const pe=de.match(/Parse error on line (\d+)/),Ie=pe?parseInt(pe[1],10):-1;if(Ie>0){const Ae=me.split("\n");let it=0;for(let qe=0;qe<Ie-1;qe++)it+=Ae[qe].length+1;return{from:it,to:it+(Ae[Ie-1]?.length||0)}}return{from:0,to:me.length}}(pe,it);de=[{from:Je,to:qe,severity:"error",message:Ae.toString()}]}return de}var oi=We(1339),Yt=We(4284),Gt=We(7573);var It=We(2301);let vt=(()=>{class me{static _instance;_nsMap;static getInstance(){return this._instance||(this._instance=new me),this._instance}compactIRI(pe){let Ie=this._nsMap;void 0===Ie&&(Ie=this._buildNSMap());let Ae=pe;if(pe.includes("#"))Ae=`${pe.split("#")[0]}#`;else{const Je=pe.split("/");Je.pop(),Ae=Je.join("/")+"/"}if(void 0===Ae)return pe;const it=Ie[Ae];return void 0===it?pe:pe.replace(Ae,`${it}:`)}expandIRI(pe){const Ie=pe.split(":")[0];return pe.replace(`${Ie}:`,Yt.B[Ie]??Gt.E[Ie])}_buildNSMap(){const pe={};return Object.keys(Yt.B).forEach(Ie=>pe[Yt.B[Ie]]=Ie),Object.keys(Gt.E).forEach(Ie=>pe[Gt.E[Ie]]=Ie),this._nsMap=pe,pe}}return me})();class Ne{_parentDiv;_theme;_editor;_query="";extensions=[];_contextPatterns=[];_sparqlLang=Wt.Tg.define(Ct);set contextPatterns(de){this._contextPatterns=de}events=new oi.EventEmitter;constructor(de,pe){this._parentDiv=de,this._theme=(0,It.O)(pe),this._updateExtensions()}set query(de){this._query=de,this._editor?this._updateDoc(de):this._build()}set content(de){this.query=de}set theme(de){this._theme=(0,It.O)(de),this._updateExtensions(),this._editor&&this._editor.dispatch({effects:Qt.Pe.reconfigure.of(this.extensions)})}dispose(){this._editor?.destroy()}_build(){this._editor=new R.Lz({state:Qt.$t.create({doc:this._query,extensions:this.extensions}),parent:this._parentDiv}),this._checkForErrors(this._editor.state)}_updateExtensions(){return this.extensions=[le.oQ,R.Lz.lineWrapping,(0,g.bu)(Nt,{needsRefresh:de=>de.docChanged}),this._theme,R.Lz.updateListener.of(de=>{if(de.docChanged){const pe=de.state.doc.toString();let Ie=pe;try{Ie=function li(me){const de=function ci(me){const pe=me.matchAll(/\b([\w-]+):\b/g),Ie=new Set;for(const Pt of pe)Ie.add(Pt[1]);const it=me.matchAll(/PREFIX\s+([\w-]+):\s+<[^>]+>/gi),Je=new Set;for(const Pt of it)Je.add(Pt[1]);const qe=new Set([...Ie].filter(Pt=>"_"!==Pt&&!Je.has(Pt)));return{all:Array.from(Ie),unset:Array.from(qe)}}(me);return de.unset.length&&de.unset.forEach(pe=>{const Ie=function Kt(me){const de=Yt.B[me]??Gt.E[me];return void 0===de?null:`PREFIX ${me}: <${de}>`}(pe);Ie&&(me=`${Ie}\n${me}`)}),me}(pe)}catch{}if(pe!==Ie)return void this._insertPrefixesWithTransaction(de,Ie,pe);this._checkForErrors(de.state),this.events.emit("contentChanged",pe)}}),R.w4.of([Mt.Yc,{key:"Cmd-k",run:Mt.qh},{key:"Ctrl-k",run:Mt.qh}]),this._sparqlLang,this._sparqlLang.data.of({autocomplete:de=>function Jt(me,de){if(0===de.length)return null;const pe=me.state.doc.lineAt(me.pos),Ie=pe.text.slice(0,me.pos-pe.from),Ae=vt.getInstance();for(const Je of de){if(!Je.predicate)continue;const qe=Je.predicate.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),at=new RegExp(`(?:^|\\s)${qe}\\s+(<[^>\\s]*)?$`).exec(Ie);if(null!==at)return{from:me.pos-(at[1]??"").length,filter:!1,options:Je.options.map(Et=>{const Lt=Ae.compactIRI(Et.iri),_e=Lt!==Et.iri?Lt:`<${Et.iri}>`;return{label:_e,displayLabel:Et.label,detail:_e!==`<${Et.iri}>`?_e:Et.iri,type:"constant"}})}}const it=de.filter(Je=>!Je.predicate);if(it.length>0){const qe=/(?:^|\s)(?:\?[\w]+|<[^>]*>|[\w][\w\d]*:[\w\d]+)\s+([\w:]*|<[^>\s]*)?$/.exec(Ie);if(null!==qe)return{from:me.pos-(qe[1]??"").length,filter:!1,options:it.flatMap(St=>St.options).map(St=>{const kt=Ae.compactIRI(St.iri),Et=kt!==St.iri?kt:`<${St.iri}>`;return{label:Et,displayLabel:St.label,detail:Et!==`<${St.iri}>`?Et:St.iri,type:"property"}})}}return null}(de,this._contextPatterns)})],this.extensions}_insertPrefixesWithTransaction(de,pe,Ie){if(!this._editor)return;const Ae=pe.length-Ie.length,it=pe.slice(0,Ae),Je=de.state.selection.main;this._editor.dispatch({changes:{from:0,to:0,insert:it},selection:{anchor:Je.from+Ae,head:Je.to+Ae},scrollIntoView:!0}),this._query=pe,this.events.emit("contentChanged",pe),this._checkForErrors(this._editor.state)}_updateDoc(de){if(!this._editor)return;const pe=this._editor.state.doc.toString();if(de===pe)return;const Ie=de.length-pe.length,Ae=this._editor.state.selection.main;this._editor.dispatch({changes:{from:0,to:pe.length,insert:de},selection:{anchor:Math.max(0,Math.min(Ae.from+Ie,de.length)),head:Math.max(0,Math.min(Ae.to+Ie,de.length))},scrollIntoView:!0}),this._query=de,this.events.emit("contentChanged",de),this._checkForErrors(this._editor.state)}_checkForErrors(de){var pe=this;return(0,j.A)(function*(){if(!pe._editor)return;const Ie=yield Nt(pe._editor);let Ae=!1;if(Ie)for(const it of Ie)if("error"===it.severity){const Je={message:it.message,startIndex:it.from,endIndex:it.to,line:de.doc.lineAt(it.from).number};pe.events.emit("error",Je),Ae=!0;break}Ae||pe.events.emit("error",void 0),pe.events.emit("contentValid",!Ae)})()}}},2301(Ei,At,We){"use strict";We.d(At,{O:()=>ei});var j=We(3161),g=We(5759),R=We(9125);const Te="#DDDDDD",Ve="#B9D2FF",Ye="#b0b0b0",ct="#808080",Ke="#000000",ae="#fc6d24",se="#fda331",ge="#8abeb7",we="#b5bd68",dt="#6fb3d2",ze="#cc99cc",Qt=ae,Wt="#292d30",Mt=Ve+"30",Yt=j.Lz.theme({"&":{color:Te,backgroundColor:"#2E3235"},".cm-content":{caretColor:Te},".cm-cursor, .cm-dropCursor":{borderLeftColor:Te},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#202325"},".cm-panels":{backgroundColor:Wt,color:Ye},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:Ve,outline:`1px solid ${Ye}`,color:Ke},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#e0e0e0",color:Ke},".cm-activeLine":{backgroundColor:Mt},".cm-selectionMatch":{backgroundColor:Mt},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${Ye}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:Ve,color:Ke},".cm-gutters":{borderRight:"1px solid #ffffff10",color:ct,backgroundColor:Wt},".cm-activeLineGutter":{backgroundColor:Mt},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:Ve},".cm-tooltip":{border:"none",backgroundColor:Te,color:Ke},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Te,borderBottomColor:Te},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Mt,color:Ke},"& .cm-completionDetail":{color:ct,opacity:"1"}}},{dark:!0}),Gt=g.cr.define([{tag:R._A.keyword,color:se},{tag:[R._A.name,R._A.deleted,R._A.character,R._A.propertyName,R._A.macroName],color:we},{tag:[R._A.variableName],color:dt},{tag:[R._A.function(R._A.variableName)],color:se},{tag:[R._A.labelName],color:ae},{tag:[R._A.color,R._A.constant(R._A.name),R._A.standard(R._A.name)],color:se},{tag:[R._A.definition(R._A.name),R._A.separator],color:ze},{tag:[R._A.brace],color:ze},{tag:[R._A.annotation],color:Qt},{tag:[R._A.number,R._A.changed,R._A.annotation,R._A.modifier,R._A.self,R._A.namespace],color:se},{tag:[R._A.typeName,R._A.className],color:dt},{tag:[R._A.operator,R._A.operatorKeyword],color:ze},{tag:[R._A.tagName],color:se},{tag:[R._A.squareBracket],color:ze},{tag:[R._A.angleBracket],color:ze},{tag:[R._A.attributeName],color:dt},{tag:[R._A.regexp],color:se},{tag:[R._A.quote],color:Te},{tag:[R._A.string],color:we},{tag:R._A.link,color:"#6987AF",textDecoration:"underline",textUnderlinePosition:"under"},{tag:[R._A.url,R._A.escape,R._A.special(R._A.string)],color:ge},{tag:[R._A.meta],color:"#A54543"},{tag:[R._A.comment],color:ct,fontStyle:"italic"},{tag:R._A.monospace,color:Te},{tag:R._A.strong,fontWeight:"bold",color:se},{tag:R._A.emphasis,fontStyle:"italic",color:dt},{tag:R._A.strikethrough,textDecoration:"line-through"},{tag:R._A.heading,fontWeight:"bold",color:Te},{tag:R._A.special(R._A.heading1),fontWeight:"bold",color:Te},{tag:R._A.heading1,fontWeight:"bold",color:Te},{tag:[R._A.heading2,R._A.heading3,R._A.heading4],fontWeight:"bold",color:Te},{tag:[R._A.heading5,R._A.heading6],color:Te},{tag:[R._A.atom,R._A.bool,R._A.special(R._A.variableName)],color:ge},{tag:[R._A.processingInstruction,R._A.inserted],color:ge},{tag:[R._A.contentSeparator],color:dt},{tag:R._A.invalid,color:Ve,borderBottom:`1px dotted ${Qt}`}]),li=[Yt,(0,g.y9)(Gt)],ci="#2e3440",Kt="#3b4252",It="#434c5e",vt="#4c566a",Jt="#e5e9f0",wt="#eceff4",Ne="#8fbcbb",me="#88c0d0",pe="#5e81ac",Ae="#d08770",it="#ebcb8b",Je="#a3be8c",Pt="#d30102",k=j.Lz.theme({"&":{color:ci,backgroundColor:"#ffffff"},".cm-content":{caretColor:Kt},".cm-cursor, .cm-dropCursor":{borderLeftColor:Kt},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:wt},".cm-panels":{backgroundColor:wt,color:vt},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:`1px solid ${vt}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:Jt},".cm-activeLine":{backgroundColor:wt},".cm-selectionMatch":{backgroundColor:Jt},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${vt}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:wt},".cm-gutters":{backgroundColor:wt,color:ci,border:"none"},".cm-activeLineGutter":{backgroundColor:wt},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Jt},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Jt,borderBottomColor:Jt},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:wt,color:vt},"& .cm-completionDetail":{color:"#555555",opacity:"1"}}},{dark:!1}),M=g.cr.define([{tag:R._A.keyword,color:pe},{tag:[R._A.name,R._A.deleted,R._A.character,R._A.propertyName,R._A.macroName],color:Ae},{tag:[R._A.variableName],color:Ae},{tag:[R._A.function(R._A.variableName)],color:pe},{tag:[R._A.labelName],color:"#81a1c1"},{tag:[R._A.color,R._A.constant(R._A.name),R._A.standard(R._A.name)],color:pe},{tag:[R._A.definition(R._A.name),R._A.separator],color:Je},{tag:[R._A.brace],color:Ne},{tag:[R._A.annotation],color:Pt},{tag:[R._A.number,R._A.changed,R._A.annotation,R._A.modifier,R._A.self,R._A.namespace],color:me},{tag:[R._A.typeName,R._A.className],color:it},{tag:[R._A.operator,R._A.operatorKeyword],color:Je},{tag:[R._A.tagName],color:"#b48ead"},{tag:[R._A.squareBracket],color:"#bf616a"},{tag:[R._A.angleBracket],color:Ae},{tag:[R._A.attributeName],color:it},{tag:[R._A.regexp],color:pe},{tag:[R._A.quote],color:Kt},{tag:[R._A.string],color:Ae},{tag:R._A.link,color:Ne,textDecoration:"underline",textUnderlinePosition:"under"},{tag:[R._A.url,R._A.escape,R._A.special(R._A.string)],color:Ae},{tag:[R._A.meta],color:me},{tag:[R._A.comment],color:It,fontStyle:"italic"},{tag:R._A.strong,fontWeight:"bold",color:pe},{tag:R._A.emphasis,fontStyle:"italic",color:pe},{tag:R._A.strikethrough,textDecoration:"line-through"},{tag:R._A.heading,fontWeight:"bold",color:pe},{tag:R._A.special(R._A.heading1),fontWeight:"bold",color:pe},{tag:R._A.heading1,fontWeight:"bold",color:pe},{tag:[R._A.heading2,R._A.heading3,R._A.heading4],fontWeight:"bold",color:pe},{tag:[R._A.heading5,R._A.heading6],color:pe},{tag:[R._A.atom,R._A.bool,R._A.special(R._A.variableName)],color:Ae},{tag:[R._A.processingInstruction,R._A.inserted],color:Ne},{tag:[R._A.contentSeparator],color:it},{tag:R._A.invalid,color:It,borderBottom:`1px dotted ${Pt}`}]),H=[k,(0,g.y9)(M)],I="var(--cue-color-lightgray)",L="#B9D2FF",K="#b0b0b0",fe="#808080",Oe="#000000",Ee="#fc6d24",Ue="var(--cue-color-green)",P="var(--cue-color-ultralightgray)",f="var(--cue-color-lightgray)",m="var(--cue-success)",V="#cc99cc",ue=Ee,Pe="var(--cue-color-darkblue)",$e=L+"30",ai=j.Lz.theme({"&":{color:I,backgroundColor:"var(--cue-color-blue)"},".cm-content":{caretColor:I},".cm-cursor, .cm-dropCursor":{borderLeftColor:I},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#B9D2FF",color:"#fff"},".cm-panels":{backgroundColor:Pe,color:K},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:L,outline:`1px solid ${K}`,color:Oe},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#e0e0e0",color:Oe},".cm-activeLine":{backgroundColor:$e},".cm-selectionMatch":{backgroundColor:$e},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${K}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:L,color:Oe},".cm-gutters":{borderRight:"1px solid #ffffff10",color:fe,backgroundColor:Pe},".cm-activeLineGutter":{backgroundColor:$e},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:L},".cm-tooltip":{border:"none",backgroundColor:I,color:Oe},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:I,borderBottomColor:I},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:$e,color:Oe},"& .cm-completionDetail":{color:fe,opacity:"1"}}},{dark:!0}),Tt=g.cr.define([{tag:R._A.keyword,color:Ue},{tag:[R._A.name,R._A.deleted,R._A.character,R._A.propertyName,R._A.macroName],color:f},{tag:[R._A.variableName],color:m},{tag:[R._A.function(R._A.variableName)],color:Ue},{tag:[R._A.labelName],color:Ee},{tag:[R._A.color,R._A.constant(R._A.name),R._A.standard(R._A.name)],color:Ue},{tag:[R._A.definition(R._A.name),R._A.separator],color:V},{tag:[R._A.brace],color:V},{tag:[R._A.annotation],color:ue},{tag:[R._A.number,R._A.changed,R._A.annotation,R._A.modifier,R._A.self,R._A.namespace],color:Ue},{tag:[R._A.typeName,R._A.className],color:m},{tag:[R._A.operator,R._A.operatorKeyword],color:V},{tag:[R._A.tagName],color:Ue},{tag:[R._A.squareBracket],color:V},{tag:[R._A.angleBracket],color:V},{tag:[R._A.attributeName],color:m},{tag:[R._A.regexp],color:Ue},{tag:[R._A.quote],color:I},{tag:[R._A.string],color:f},{tag:R._A.link,color:"#6987AF",textDecoration:"underline",textUnderlinePosition:"under"},{tag:[R._A.url,R._A.escape,R._A.special(R._A.string)],color:P},{tag:[R._A.meta],color:"#A54543"},{tag:[R._A.comment],color:fe,fontStyle:"italic"},{tag:R._A.monospace,color:I},{tag:R._A.strong,fontWeight:"bold",color:Ue},{tag:R._A.emphasis,fontStyle:"italic",color:m},{tag:R._A.strikethrough,textDecoration:"line-through"},{tag:R._A.heading,fontWeight:"bold",color:I},{tag:R._A.special(R._A.heading1),fontWeight:"bold",color:I},{tag:R._A.heading1,fontWeight:"bold",color:I},{tag:[R._A.heading2,R._A.heading3,R._A.heading4],fontWeight:"bold",color:I},{tag:[R._A.heading5,R._A.heading6],color:I},{tag:[R._A.atom,R._A.bool,R._A.special(R._A.variableName)],color:P},{tag:[R._A.processingInstruction,R._A.inserted],color:P},{tag:[R._A.contentSeparator],color:m},{tag:R._A.invalid,color:L,borderBottom:`1px dotted ${ue}`}]),Rt=[ai,(0,g.y9)(Tt)],zt="#1a1a1a",hi="#3a6ea8",ki="#444444",Ni="#666666",fi="#000000",pi="#b91c1c",gi="#92400e",xi="#166534",Di="#065f46",Ii="#1e40af",vi="#4c1d95",en=pi,tn="rgba(0,0,0,0.07)",si=hi+"22",cn="#ffffff",wi=j.Lz.theme({"&":{color:zt,backgroundColor:"var(--cue-color-green)"},".cm-content":{caretColor:zt},".cm-cursor, .cm-dropCursor":{borderLeftColor:zt},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"rgba(30,64,175,0.18)"},".cm-panels":{backgroundColor:tn,color:ki},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:hi,outline:`1px solid ${ki}`,color:fi},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#0a0a0a",color:fi},".cm-activeLine":{backgroundColor:si},".cm-selectionMatch":{backgroundColor:si},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${ki}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:hi,color:fi},".cm-gutters":{borderRight:"1px solid #ffffff10",color:Ni,backgroundColor:tn},".cm-activeLineGutter":{backgroundColor:si},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:hi},".cm-tooltip":{border:"none",backgroundColor:cn,color:fi},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:cn,borderBottomColor:cn},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:si,color:fi},"& .cm-completionDetail":{color:Ni,opacity:"1"}}},{dark:!1}),Xi=g.cr.define([{tag:R._A.keyword,color:gi},{tag:[R._A.name,R._A.deleted,R._A.character,R._A.propertyName,R._A.macroName],color:Di},{tag:[R._A.variableName],color:Ii},{tag:[R._A.function(R._A.variableName)],color:gi},{tag:[R._A.labelName],color:"#c2410c"},{tag:[R._A.color,R._A.constant(R._A.name),R._A.standard(R._A.name)],color:gi},{tag:[R._A.definition(R._A.name),R._A.separator],color:vi},{tag:[R._A.brace],color:vi},{tag:[R._A.annotation],color:en},{tag:[R._A.number,R._A.changed,R._A.annotation,R._A.modifier,R._A.self,R._A.namespace],color:gi},{tag:[R._A.typeName,R._A.className],color:Ii},{tag:[R._A.operator,R._A.operatorKeyword],color:vi},{tag:[R._A.tagName],color:gi},{tag:[R._A.squareBracket],color:vi},{tag:[R._A.angleBracket],color:vi},{tag:[R._A.attributeName],color:Ii},{tag:[R._A.regexp],color:gi},{tag:[R._A.quote],color:zt},{tag:[R._A.string],color:Di},{tag:R._A.link,color:"#374151",textDecoration:"underline",textUnderlinePosition:"under"},{tag:[R._A.url,R._A.escape,R._A.special(R._A.string)],color:xi},{tag:[R._A.meta],color:pi},{tag:[R._A.comment],color:Ni,fontStyle:"italic"},{tag:R._A.monospace,color:zt},{tag:R._A.strong,fontWeight:"bold",color:gi},{tag:R._A.emphasis,fontStyle:"italic",color:Ii},{tag:R._A.strikethrough,textDecoration:"line-through"},{tag:R._A.heading,fontWeight:"bold",color:zt},{tag:R._A.special(R._A.heading1),fontWeight:"bold",color:zt},{tag:R._A.heading1,fontWeight:"bold",color:zt},{tag:[R._A.heading2,R._A.heading3,R._A.heading4],fontWeight:"bold",color:zt},{tag:[R._A.heading5,R._A.heading6],color:zt},{tag:[R._A.atom,R._A.bool,R._A.special(R._A.variableName)],color:xi},{tag:[R._A.processingInstruction,R._A.inserted],color:xi},{tag:[R._A.contentSeparator],color:Ii},{tag:R._A.invalid,color:hi,borderBottom:`1px dotted ${en}`}]),Vi=[wi,(0,g.y9)(Xi)];function ei(Ji){return"dark"===Ji?li:"default"===Ji?H:"primary"===Ji?Rt:"accent"===Ji?Vi:H}},3981(Ei,At){"use strict";At.byteLength=function Ye(se){var ge=Ve(se),dt=ge[1];return 3*(ge[0]+dt)/4-dt},At.toByteArray=function ct(se){var ge,Mt,we=Ve(se),dt=we[0],ze=we[1],Ct=new g(function Se(se,ge,we){return 3*(ge+we)/4-we}(0,dt,ze)),Qt=0,Wt=ze>0?dt-4:dt;for(Mt=0;Mt<Wt;Mt+=4)ge=j[se.charCodeAt(Mt)]<<18|j[se.charCodeAt(Mt+1)]<<12|j[se.charCodeAt(Mt+2)]<<6|j[se.charCodeAt(Mt+3)],Ct[Qt++]=ge>>16&255,Ct[Qt++]=ge>>8&255,Ct[Qt++]=255≥return 2===ze&&(ge=j[se.charCodeAt(Mt)]<<2|j[se.charCodeAt(Mt+1)]>>4,Ct[Qt++]=255&ge),1===ze&&(ge=j[se.charCodeAt(Mt)]<<10|j[se.charCodeAt(Mt+1)]<<4|j[se.charCodeAt(Mt+2)]>>2,Ct[Qt++]=ge>>8&255,Ct[Qt++]=255&ge),Ct},At.fromByteArray=function ae(se){for(var ge,we=se.length,dt=we%3,ze=[],Qt=0,Wt=we-dt;Qt<Wt;Qt+=16383)ze.push(X(se,Qt,Qt+16383>Wt?Wt:Qt+16383));return 1===dt?ze.push(We[(ge=se[we-1])>>2]+We[ge<<4&63]+"=="):2===dt&&ze.push(We[(ge=(se[we-2]<<8)+se[we-1])>>10]+We[ge>>4&63]+We[ge<<2&63]+"="),ze.join("")};for(var We=[],j=[],g=typeof Uint8Array<"u"?Uint8Array:Array,R="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",le=0;le<64;++le)We[le]=R[le],j[R.charCodeAt(le)]=le;function Ve(se){var ge=se.length;if(ge%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var we=se.indexOf("=");return-1===we&&(we=ge),[we,we===ge?0:4-we%4]}function Ke(se){return We[se>>18&63]+We[se>>12&63]+We[se>>6&63]+We[63&se]}function X(se,ge,we){for(var ze=[],Ct=ge;Ct<we;Ct+=3)ze.push(Ke((se[Ct]<<16&16711680)+(se[Ct+1]<<8&65280)+(255&se[Ct+2])));return ze.join("")}j[45]=62,j[95]=63},3838(Ei,At,We){"use strict";const g=We(3981),R=We(2020),le="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;At.hp=Se,At.IS=50;const Te=2147483647;function Ye(P){if(P>Te)throw new RangeError('The value "'+P+'" is invalid for option "size"');const f=new Uint8Array(P);return Object.setPrototypeOf(f,Se.prototype),f}function Se(P,f,m){if("number"==typeof P){if("string"==typeof f)throw new TypeError('The "string" argument must be of type string. Received type number');return ae(P)}return ct(P,f,m)}function ct(P,f,m){if("string"==typeof P)return function se(P,f){if(("string"!=typeof f||""===f)&&(f="utf8"),!Se.isEncoding(f))throw new TypeError("Unknown encoding: "+f);const m=0|Wt(P,f);let V=Ye(m);const ne=V.write(P,f);return ne!==m&&(V=V.slice(0,ne)),V}(P,f);if(ArrayBuffer.isView(P))return function we(P){if(fe(P,Uint8Array)){const f=new Uint8Array(P);return dt(f.buffer,f.byteOffset,f.byteLength)}return ge(P)}(P);if(null==P)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof P);if(fe(P,ArrayBuffer)||P&&fe(P.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(fe(P,SharedArrayBuffer)||P&&fe(P.buffer,SharedArrayBuffer)))return dt(P,f,m);if("number"==typeof P)throw new TypeError('The "value" argument must not be of type number. Received type number');const V=P.valueOf&&P.valueOf();if(null!=V&&V!==P)return Se.from(V,f,m);const ne=function ze(P){if(Se.isBuffer(P)){const f=0|Ct(P.length),m=Ye(f);return 0===m.length||P.copy(m,0,0,f),m}return void 0!==P.length?"number"!=typeof P.length||Oe(P.length)?Ye(0):ge(P):"Buffer"===P.type&&Array.isArray(P.data)?ge(P.data):void 0}(P);if(ne)return ne;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof P[Symbol.toPrimitive])return Se.from(P[Symbol.toPrimitive]("string"),f,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof P)}function Ke(P){if("number"!=typeof P)throw new TypeError('"size" argument must be of type number');if(P<0)throw new RangeError('The value "'+P+'" is invalid for option "size"')}function ae(P){return Ke(P),Ye(P<0?0:0|Ct(P))}function ge(P){const f=P.length<0?0:0|Ct(P.length),m=Ye(f);for(let V=0;V<f;V+=1)m[V]=255&P[V];return m}function dt(P,f,m){if(f<0||P.byteLength<f)throw new RangeError('"offset" is outside of buffer bounds');if(P.byteLength<f+(m||0))throw new RangeError('"length" is outside of buffer bounds');let V;return V=void 0===f&&void 0===m?new Uint8Array(P):void 0===m?new Uint8Array(P,f):new Uint8Array(P,f,m),Object.setPrototypeOf(V,Se.prototype),V}function Ct(P){if(P>=Te)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Te.toString(16)+" bytes");return 0|P}function Wt(P,f){if(Se.isBuffer(P))return P.length;if(ArrayBuffer.isView(P)||fe(P,ArrayBuffer))return P.byteLength;if("string"!=typeof P)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof P);const m=P.length,V=arguments.length>2&&!0===arguments[2];if(!V&&0===m)return 0;let ne=!1;for(;;)switch(f){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return Y(P).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*m;case"hex":return m>>>1;case"base64":return K(P).length;default:if(ne)return V?-1:Y(P).length;f=(""+f).toLowerCase(),ne=!0}}function Mt(P,f,m){let V=!1;if((void 0===f||f<0)&&(f=0),f>this.length||((void 0===m||m>this.length)&&(m=this.length),m<=0)||(m>>>=0)<=(f>>>=0))return"";for(P||(P="utf8");;)switch(P){case"hex":return me(this,f,m);case"utf8":case"utf-8":return It(this,f,m);case"ascii":return wt(this,f,m);case"latin1":case"binary":return Ne(this,f,m);case"base64":return Kt(this,f,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return de(this,f,m);default:if(V)throw new TypeError("Unknown encoding: "+P);P=(P+"").toLowerCase(),V=!0}}function He(P,f,m){const V=P[f];P[f]=P[m],P[m]=V}function Nt(P,f,m,V,ne){if(0===P.length)return-1;if("string"==typeof m?(V=m,m=0):m>2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),Oe(m=+m)&&(m=ne?0:P.length-1),m<0&&(m=P.length+m),m>=P.length){if(ne)return-1;m=P.length-1}else if(m<0){if(!ne)return-1;m=0}if("string"==typeof f&&(f=Se.from(f,V)),Se.isBuffer(f))return 0===f.length?-1:ri(P,f,m,V,ne);if("number"==typeof f)return f&=255,"function"==typeof Uint8Array.prototype.indexOf?ne?Uint8Array.prototype.indexOf.call(P,f,m):Uint8Array.prototype.lastIndexOf.call(P,f,m):ri(P,[f],m,V,ne);throw new TypeError("val must be string, number or Buffer")}function ri(P,f,m,V,ne){let rt,ue=1,Pe=P.length,$e=f.length;if(void 0!==V&&("ucs2"===(V=String(V).toLowerCase())||"ucs-2"===V||"utf16le"===V||"utf-16le"===V)){if(P.length<2||f.length<2)return-1;ue=2,Pe/=2,$e/=2,m/=2}function lt(mt,bt){return 1===ue?mt[bt]:mt.readUInt16BE(bt*ue)}if(ne){let mt=-1;for(rt=m;rt<Pe;rt++)if(lt(P,rt)===lt(f,-1===mt?0:rt-mt)){if(-1===mt&&(mt=rt),rt-mt+1===$e)return mt*ue}else-1!==mt&&(rt-=rt-mt),mt=-1}else for(m+$e>Pe&&(m=Pe-$e),rt=m;rt>=0;rt--){let mt=!0;for(let bt=0;bt<$e;bt++)if(lt(P,rt+bt)!==lt(f,bt)){mt=!1;break}if(mt)return rt}return-1}function oi(P,f,m,V){m=Number(m)||0;const ne=P.length-m;V?(V=Number(V))>ne&&(V=ne):V=ne;const ue=f.length;let Pe;for(V>ue/2&&(V=ue/2),Pe=0;Pe<V;++Pe){const $e=parseInt(f.substr(2*Pe,2),16);if(Oe($e))return Pe;P[m+Pe]=$e}return Pe}function Yt(P,f,m,V){return J(Y(f,P.length-m),P,m,V)}function Gt(P,f,m,V){return J(function I(P){const f=[];for(let m=0;m<P.length;++m)f.push(255&P.charCodeAt(m));return f}(f),P,m,V)}function li(P,f,m,V){return J(K(f),P,m,V)}function ci(P,f,m,V){return J(function L(P,f){let m,V,ne;const ue=[];for(let Pe=0;Pe<P.length&&!((f-=2)<0);++Pe)m=P.charCodeAt(Pe),V=m>>8,ne=m%256,ue.push(ne),ue.push(V);return ue}(f,P.length-m),P,m,V)}function Kt(P,f,m){return g.fromByteArray(0===f&&m===P.length?P:P.slice(f,m))}function It(P,f,m){m=Math.min(P.length,m);const V=[];let ne=f;for(;ne<m;){const ue=P[ne];let Pe=null,$e=ue>239?4:ue>223?3:ue>191?2:1;if(ne+$e<=m){let lt,rt,mt,bt;switch($e){case 1:ue<128&&(Pe=ue);break;case 2:lt=P[ne+1],128==(192<)&&(bt=(31&ue)<<6|63<,bt>127&&(Pe=bt));break;case 3:lt=P[ne+1],rt=P[ne+2],128==(192<)&&128==(192&rt)&&(bt=(15&ue)<<12|(63<)<<6|63&rt,bt>2047&&(bt<55296||bt>57343)&&(Pe=bt));break;case 4:lt=P[ne+1],rt=P[ne+2],mt=P[ne+3],128==(192<)&&128==(192&rt)&&128==(192&mt)&&(bt=(15&ue)<<18|(63<)<<12|(63&rt)<<6|63&mt,bt>65535&&bt<1114112&&(Pe=bt))}}null===Pe?(Pe=65533,$e=1):Pe>65535&&(Pe-=65536,V.push(Pe>>>10&1023|55296),Pe=56320|1023&Pe),V.push(Pe),ne+=$e}return function Jt(P){const f=P.length;if(f<=4096)return String.fromCharCode.apply(String,P);let m="",V=0;for(;V<f;)m+=String.fromCharCode.apply(String,P.slice(V,V+=4096));return m}(V)}function wt(P,f,m){let V="";m=Math.min(P.length,m);for(let ne=f;ne<m;++ne)V+=String.fromCharCode(127&P[ne]);return V}function Ne(P,f,m){let V="";m=Math.min(P.length,m);for(let ne=f;ne<m;++ne)V+=String.fromCharCode(P[ne]);return V}function me(P,f,m){const V=P.length;(!f||f<0)&&(f=0),(!m||m<0||m>V)&&(m=V);let ne="";for(let ue=f;ue<m;++ue)ne+=Le[P[ue]];return ne}function de(P,f,m){const V=P.slice(f,m);let ne="";for(let ue=0;ue<V.length-1;ue+=2)ne+=String.fromCharCode(V[ue]+256*V[ue+1]);return ne}function pe(P,f,m){if(P%1!=0||P<0)throw new RangeError("offset is not uint");if(P+f>m)throw new RangeError("Trying to access beyond buffer length")}function Ie(P,f,m,V,ne,ue){if(!Se.isBuffer(P))throw new TypeError('"buffer" argument must be a Buffer instance');if(f>ne||f<ue)throw new RangeError('"value" argument is out of bounds');if(m+V>P.length)throw new RangeError("Index out of range")}function Ae(P,f,m,V,ne){Lt(f,V,ne,P,m,7);let ue=Number(f&BigInt(4294967295));P[m++]=ue,ue>>=8,P[m++]=ue,ue>>=8,P[m++]=ue,ue>>=8,P[m++]=ue;let Pe=Number(f>>BigInt(32)&BigInt(4294967295));return P[m++]=Pe,Pe>>=8,P[m++]=Pe,Pe>>=8,P[m++]=Pe,Pe>>=8,P[m++]=Pe,m}function it(P,f,m,V,ne){Lt(f,V,ne,P,m,7);let ue=Number(f&BigInt(4294967295));P[m+7]=ue,ue>>=8,P[m+6]=ue,ue>>=8,P[m+5]=ue,ue>>=8,P[m+4]=ue;let Pe=Number(f>>BigInt(32)&BigInt(4294967295));return P[m+3]=Pe,Pe>>=8,P[m+2]=Pe,Pe>>=8,P[m+1]=Pe,Pe>>=8,P[m]=Pe,m+8}function Je(P,f,m,V,ne,ue){if(m+V>P.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function qe(P,f,m,V,ne){return f=+f,m>>>=0,ne||Je(P,0,m,4),R.write(P,f,m,V,23,4),m+4}function Pt(P,f,m,V,ne){return f=+f,m>>>=0,ne||Je(P,0,m,8),R.write(P,f,m,V,52,8),m+8}!(Se.TYPED_ARRAY_SUPPORT=function Ve(){try{const P=new Uint8Array(1),f={foo:function(){return 42}};return Object.setPrototypeOf(f,Uint8Array.prototype),Object.setPrototypeOf(P,f),42===P.foo()}catch{return!1}}())&&typeof console<"u"&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(Se.prototype,"parent",{enumerable:!0,get:function(){if(Se.isBuffer(this))return this.buffer}}),Object.defineProperty(Se.prototype,"offset",{enumerable:!0,get:function(){if(Se.isBuffer(this))return this.byteOffset}}),Se.poolSize=8192,Se.from=function(P,f,m){return ct(P,f,m)},Object.setPrototypeOf(Se.prototype,Uint8Array.prototype),Object.setPrototypeOf(Se,Uint8Array),Se.alloc=function(P,f,m){return function X(P,f,m){return Ke(P),P<=0?Ye(P):void 0!==f?"string"==typeof m?Ye(P).fill(f,m):Ye(P).fill(f):Ye(P)}(P,f,m)},Se.allocUnsafe=function(P){return ae(P)},Se.allocUnsafeSlow=function(P){return ae(P)},Se.isBuffer=function(f){return null!=f&&!0===f._isBuffer&&f!==Se.prototype},Se.compare=function(f,m){if(fe(f,Uint8Array)&&(f=Se.from(f,f.offset,f.byteLength)),fe(m,Uint8Array)&&(m=Se.from(m,m.offset,m.byteLength)),!Se.isBuffer(f)||!Se.isBuffer(m))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(f===m)return 0;let V=f.length,ne=m.length;for(let ue=0,Pe=Math.min(V,ne);ue<Pe;++ue)if(f[ue]!==m[ue]){V=f[ue],ne=m[ue];break}return V<ne?-1:ne<V?1:0},Se.isEncoding=function(f){switch(String(f).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Se.concat=function(f,m){if(!Array.isArray(f))throw new TypeError('"list" argument must be an Array of Buffers');if(0===f.length)return Se.alloc(0);let V;if(void 0===m)for(m=0,V=0;V<f.length;++V)m+=f[V].length;const ne=Se.allocUnsafe(m);let ue=0;for(V=0;V<f.length;++V){let Pe=f[V];if(fe(Pe,Uint8Array))ue+Pe.length>ne.length?(Se.isBuffer(Pe)||(Pe=Se.from(Pe)),Pe.copy(ne,ue)):Uint8Array.prototype.set.call(ne,Pe,ue);else{if(!Se.isBuffer(Pe))throw new TypeError('"list" argument must be an Array of Buffers');Pe.copy(ne,ue)}ue+=Pe.length}return ne},Se.byteLength=Wt,Se.prototype._isBuffer=!0,Se.prototype.swap16=function(){const f=this.length;if(f%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let m=0;m<f;m+=2)He(this,m,m+1);return this},Se.prototype.swap32=function(){const f=this.length;if(f%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let m=0;m<f;m+=4)He(this,m,m+3),He(this,m+1,m+2);return this},Se.prototype.swap64=function(){const f=this.length;if(f%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let m=0;m<f;m+=8)He(this,m,m+7),He(this,m+1,m+6),He(this,m+2,m+5),He(this,m+3,m+4);return this},Se.prototype.toString=function(){const f=this.length;return 0===f?"":0===arguments.length?It(this,0,f):Mt.apply(this,arguments)},Se.prototype.toLocaleString=Se.prototype.toString,Se.prototype.equals=function(f){if(!Se.isBuffer(f))throw new TypeError("Argument must be a Buffer");return this===f||0===Se.compare(this,f)},Se.prototype.inspect=function(){let f="";const m=At.IS;return f=this.toString("hex",0,m).replace(/(.{2})/g,"$1 ").trim(),this.length>m&&(f+=" ... "),"<Buffer "+f+">"},le&&(Se.prototype[le]=Se.prototype.inspect),Se.prototype.compare=function(f,m,V,ne,ue){if(fe(f,Uint8Array)&&(f=Se.from(f,f.offset,f.byteLength)),!Se.isBuffer(f))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof f);if(void 0===m&&(m=0),void 0===V&&(V=f?f.length:0),void 0===ne&&(ne=0),void 0===ue&&(ue=this.length),m<0||V>f.length||ne<0||ue>this.length)throw new RangeError("out of range index");if(ne>=ue&&m>=V)return 0;if(ne>=ue)return-1;if(m>=V)return 1;if(this===f)return 0;let Pe=(ue>>>=0)-(ne>>>=0),$e=(V>>>=0)-(m>>>=0);const lt=Math.min(Pe,$e),rt=this.slice(ne,ue),mt=f.slice(m,V);for(let bt=0;bt<lt;++bt)if(rt[bt]!==mt[bt]){Pe=rt[bt],$e=mt[bt];break}return Pe<$e?-1:$e<Pe?1:0},Se.prototype.includes=function(f,m,V){return-1!==this.indexOf(f,m,V)},Se.prototype.indexOf=function(f,m,V){return Nt(this,f,m,V,!0)},Se.prototype.lastIndexOf=function(f,m,V){return Nt(this,f,m,V,!1)},Se.prototype.write=function(f,m,V,ne){if(void 0===m)ne="utf8",V=this.length,m=0;else if(void 0===V&&"string"==typeof m)ne=m,V=this.length,m=0;else{if(!isFinite(m))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");m>>>=0,isFinite(V)?(V>>>=0,void 0===ne&&(ne="utf8")):(ne=V,V=void 0)}const ue=this.length-m;if((void 0===V||V>ue)&&(V=ue),f.length>0&&(V<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");ne||(ne="utf8");let Pe=!1;for(;;)switch(ne){case"hex":return oi(this,f,m,V);case"utf8":case"utf-8":return Yt(this,f,m,V);case"ascii":case"latin1":case"binary":return Gt(this,f,m,V);case"base64":return li(this,f,m,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ci(this,f,m,V);default:if(Pe)throw new TypeError("Unknown encoding: "+ne);ne=(""+ne).toLowerCase(),Pe=!0}},Se.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},Se.prototype.slice=function(f,m){const V=this.length;(f=~~f)<0?(f+=V)<0&&(f=0):f>V&&(f=V),(m=void 0===m?V:~~m)<0?(m+=V)<0&&(m=0):m>V&&(m=V),m<f&&(m=f);const ne=this.subarray(f,m);return Object.setPrototypeOf(ne,Se.prototype),ne},Se.prototype.readUintLE=Se.prototype.readUIntLE=function(f,m,V){f>>>=0,m>>>=0,V||pe(f,m,this.length);let ne=this[f],ue=1,Pe=0;for(;++Pe<m&&(ue*=256);)ne+=this[f+Pe]*ue;return ne},Se.prototype.readUintBE=Se.prototype.readUIntBE=function(f,m,V){f>>>=0,m>>>=0,V||pe(f,m,this.length);let ne=this[f+--m],ue=1;for(;m>0&&(ue*=256);)ne+=this[f+--m]*ue;return ne},Se.prototype.readUint8=Se.prototype.readUInt8=function(f,m){return f>>>=0,m||pe(f,1,this.length),this[f]},Se.prototype.readUint16LE=Se.prototype.readUInt16LE=function(f,m){return f>>>=0,m||pe(f,2,this.length),this[f]|this[f+1]<<8},Se.prototype.readUint16BE=Se.prototype.readUInt16BE=function(f,m){return f>>>=0,m||pe(f,2,this.length),this[f]<<8|this[f+1]},Se.prototype.readUint32LE=Se.prototype.readUInt32LE=function(f,m){return f>>>=0,m||pe(f,4,this.length),(this[f]|this[f+1]<<8|this[f+2]<<16)+16777216*this[f+3]},Se.prototype.readUint32BE=Se.prototype.readUInt32BE=function(f,m){return f>>>=0,m||pe(f,4,this.length),16777216*this[f]+(this[f+1]<<16|this[f+2]<<8|this[f+3])},Se.prototype.readBigUInt64LE=Ee(function(f){_e(f>>>=0,"offset");const m=this[f],V=this[f+7];(void 0===m||void 0===V)&&k(f,this.length-8);const ne=m+256*this[++f]+65536*this[++f]+this[++f]*2**24,ue=this[++f]+256*this[++f]+65536*this[++f]+V*2**24;return BigInt(ne)+(BigInt(ue)<<BigInt(32))}),Se.prototype.readBigUInt64BE=Ee(function(f){_e(f>>>=0,"offset");const m=this[f],V=this[f+7];(void 0===m||void 0===V)&&k(f,this.length-8);const ne=m*2**24+65536*this[++f]+256*this[++f]+this[++f],ue=this[++f]*2**24+65536*this[++f]+256*this[++f]+V;return(BigInt(ne)<<BigInt(32))+BigInt(ue)}),Se.prototype.readIntLE=function(f,m,V){f>>>=0,m>>>=0,V||pe(f,m,this.length);let ne=this[f],ue=1,Pe=0;for(;++Pe<m&&(ue*=256);)ne+=this[f+Pe]*ue;return ue*=128,ne>=ue&&(ne-=Math.pow(2,8*m)),ne},Se.prototype.readIntBE=function(f,m,V){f>>>=0,m>>>=0,V||pe(f,m,this.length);let ne=m,ue=1,Pe=this[f+--ne];for(;ne>0&&(ue*=256);)Pe+=this[f+--ne]*ue;return ue*=128,Pe>=ue&&(Pe-=Math.pow(2,8*m)),Pe},Se.prototype.readInt8=function(f,m){return f>>>=0,m||pe(f,1,this.length),128&this[f]?-1*(255-this[f]+1):this[f]},Se.prototype.readInt16LE=function(f,m){f>>>=0,m||pe(f,2,this.length);const V=this[f]|this[f+1]<<8;return 32768&V?4294901760|V:V},Se.prototype.readInt16BE=function(f,m){f>>>=0,m||pe(f,2,this.length);const V=this[f+1]|this[f]<<8;return 32768&V?4294901760|V:V},Se.prototype.readInt32LE=function(f,m){return f>>>=0,m||pe(f,4,this.length),this[f]|this[f+1]<<8|this[f+2]<<16|this[f+3]<<24},Se.prototype.readInt32BE=function(f,m){return f>>>=0,m||pe(f,4,this.length),this[f]<<24|this[f+1]<<16|this[f+2]<<8|this[f+3]},Se.prototype.readBigInt64LE=Ee(function(f){_e(f>>>=0,"offset");const m=this[f],V=this[f+7];return(void 0===m||void 0===V)&&k(f,this.length-8),(BigInt(this[f+4]+256*this[f+5]+65536*this[f+6]+(V<<24))<<BigInt(32))+BigInt(m+256*this[++f]+65536*this[++f]+this[++f]*2**24)}),Se.prototype.readBigInt64BE=Ee(function(f){_e(f>>>=0,"offset");const m=this[f],V=this[f+7];(void 0===m||void 0===V)&&k(f,this.length-8);const ne=(m<<24)+65536*this[++f]+256*this[++f]+this[++f];return(BigInt(ne)<<BigInt(32))+BigInt(this[++f]*2**24+65536*this[++f]+256*this[++f]+V)}),Se.prototype.readFloatLE=function(f,m){return f>>>=0,m||pe(f,4,this.length),R.read(this,f,!0,23,4)},Se.prototype.readFloatBE=function(f,m){return f>>>=0,m||pe(f,4,this.length),R.read(this,f,!1,23,4)},Se.prototype.readDoubleLE=function(f,m){return f>>>=0,m||pe(f,8,this.length),R.read(this,f,!0,52,8)},Se.prototype.readDoubleBE=function(f,m){return f>>>=0,m||pe(f,8,this.length),R.read(this,f,!1,52,8)},Se.prototype.writeUintLE=Se.prototype.writeUIntLE=function(f,m,V,ne){f=+f,m>>>=0,V>>>=0,ne||Ie(this,f,m,V,Math.pow(2,8*V)-1,0);let ue=1,Pe=0;for(this[m]=255&f;++Pe<V&&(ue*=256);)this[m+Pe]=f/ue&255;return m+V},Se.prototype.writeUintBE=Se.prototype.writeUIntBE=function(f,m,V,ne){f=+f,m>>>=0,V>>>=0,ne||Ie(this,f,m,V,Math.pow(2,8*V)-1,0);let ue=V-1,Pe=1;for(this[m+ue]=255&f;--ue>=0&&(Pe*=256);)this[m+ue]=f/Pe&255;return m+V},Se.prototype.writeUint8=Se.prototype.writeUInt8=function(f,m,V){return f=+f,m>>>=0,V||Ie(this,f,m,1,255,0),this[m]=255&f,m+1},Se.prototype.writeUint16LE=Se.prototype.writeUInt16LE=function(f,m,V){return f=+f,m>>>=0,V||Ie(this,f,m,2,65535,0),this[m]=255&f,this[m+1]=f>>>8,m+2},Se.prototype.writeUint16BE=Se.prototype.writeUInt16BE=function(f,m,V){return f=+f,m>>>=0,V||Ie(this,f,m,2,65535,0),this[m]=f>>>8,this[m+1]=255&f,m+2},Se.prototype.writeUint32LE=Se.prototype.writeUInt32LE=function(f,m,V){return f=+f,m>>>=0,V||Ie(this,f,m,4,4294967295,0),this[m+3]=f>>>24,this[m+2]=f>>>16,this[m+1]=f>>>8,this[m]=255&f,m+4},Se.prototype.writeUint32BE=Se.prototype.writeUInt32BE=function(f,m,V){return f=+f,m>>>=0,V||Ie(this,f,m,4,4294967295,0),this[m]=f>>>24,this[m+1]=f>>>16,this[m+2]=f>>>8,this[m+3]=255&f,m+4},Se.prototype.writeBigUInt64LE=Ee(function(f,m=0){return Ae(this,f,m,BigInt(0),BigInt("0xffffffffffffffff"))}),Se.prototype.writeBigUInt64BE=Ee(function(f,m=0){return it(this,f,m,BigInt(0),BigInt("0xffffffffffffffff"))}),Se.prototype.writeIntLE=function(f,m,V,ne){if(f=+f,m>>>=0,!ne){const lt=Math.pow(2,8*V-1);Ie(this,f,m,V,lt-1,-lt)}let ue=0,Pe=1,$e=0;for(this[m]=255&f;++ue<V&&(Pe*=256);)f<0&&0===$e&&0!==this[m+ue-1]&&($e=1),this[m+ue]=(f/Pe|0)-$e&255;return m+V},Se.prototype.writeIntBE=function(f,m,V,ne){if(f=+f,m>>>=0,!ne){const lt=Math.pow(2,8*V-1);Ie(this,f,m,V,lt-1,-lt)}let ue=V-1,Pe=1,$e=0;for(this[m+ue]=255&f;--ue>=0&&(Pe*=256);)f<0&&0===$e&&0!==this[m+ue+1]&&($e=1),this[m+ue]=(f/Pe|0)-$e&255;return m+V},Se.prototype.writeInt8=function(f,m,V){return f=+f,m>>>=0,V||Ie(this,f,m,1,127,-128),f<0&&(f=255+f+1),this[m]=255&f,m+1},Se.prototype.writeInt16LE=function(f,m,V){return f=+f,m>>>=0,V||Ie(this,f,m,2,32767,-32768),this[m]=255&f,this[m+1]=f>>>8,m+2},Se.prototype.writeInt16BE=function(f,m,V){return f=+f,m>>>=0,V||Ie(this,f,m,2,32767,-32768),this[m]=f>>>8,this[m+1]=255&f,m+2},Se.prototype.writeInt32LE=function(f,m,V){return f=+f,m>>>=0,V||Ie(this,f,m,4,2147483647,-2147483648),this[m]=255&f,this[m+1]=f>>>8,this[m+2]=f>>>16,this[m+3]=f>>>24,m+4},Se.prototype.writeInt32BE=function(f,m,V){return f=+f,m>>>=0,V||Ie(this,f,m,4,2147483647,-2147483648),f<0&&(f=4294967295+f+1),this[m]=f>>>24,this[m+1]=f>>>16,this[m+2]=f>>>8,this[m+3]=255&f,m+4},Se.prototype.writeBigInt64LE=Ee(function(f,m=0){return Ae(this,f,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),Se.prototype.writeBigInt64BE=Ee(function(f,m=0){return it(this,f,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),Se.prototype.writeFloatLE=function(f,m,V){return qe(this,f,m,!0,V)},Se.prototype.writeFloatBE=function(f,m,V){return qe(this,f,m,!1,V)},Se.prototype.writeDoubleLE=function(f,m,V){return Pt(this,f,m,!0,V)},Se.prototype.writeDoubleBE=function(f,m,V){return Pt(this,f,m,!1,V)},Se.prototype.copy=function(f,m,V,ne){if(!Se.isBuffer(f))throw new TypeError("argument should be a Buffer");if(V||(V=0),!ne&&0!==ne&&(ne=this.length),m>=f.length&&(m=f.length),m||(m=0),ne>0&&ne<V&&(ne=V),ne===V||0===f.length||0===this.length)return 0;if(m<0)throw new RangeError("targetStart out of bounds");if(V<0||V>=this.length)throw new RangeError("Index out of range");if(ne<0)throw new RangeError("sourceEnd out of bounds");ne>this.length&&(ne=this.length),f.length-m<ne-V&&(ne=f.length-m+V);const ue=ne-V;return this===f&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(m,V,ne):Uint8Array.prototype.set.call(f,this.subarray(V,ne),m),ue},Se.prototype.fill=function(f,m,V,ne){if("string"==typeof f){if("string"==typeof m?(ne=m,m=0,V=this.length):"string"==typeof V&&(ne=V,V=this.length),void 0!==ne&&"string"!=typeof ne)throw new TypeError("encoding must be a string");if("string"==typeof ne&&!Se.isEncoding(ne))throw new TypeError("Unknown encoding: "+ne);if(1===f.length){const Pe=f.charCodeAt(0);("utf8"===ne&&Pe<128||"latin1"===ne)&&(f=Pe)}}else"number"==typeof f?f&=255:"boolean"==typeof f&&(f=Number(f));if(m<0||this.length<m||this.length<V)throw new RangeError("Out of range index");if(V<=m)return this;let ue;if(m>>>=0,V=void 0===V?this.length:V>>>0,f||(f=0),"number"==typeof f)for(ue=m;ue<V;++ue)this[ue]=f;else{const Pe=Se.isBuffer(f)?f:Se.from(f,ne),$e=Pe.length;if(0===$e)throw new TypeError('The value "'+f+'" is invalid for argument "value"');for(ue=0;ue<V-m;++ue)this[ue+m]=Pe[ue%$e]}return this};const at={};function St(P,f,m){at[P]=class extends m{constructor(){super(),Object.defineProperty(this,"message",{value:f.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${P}]`,delete this.name}get code(){return P}set code(ne){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ne,writable:!0})}toString(){return`${this.name} [${P}]: ${this.message}`}}}function kt(P){let f="",m=P.length;const V="-"===P[0]?1:0;for(;m>=V+4;m-=3)f=`_${P.slice(m-3,m)}${f}`;return`${P.slice(0,m)}${f}`}function Lt(P,f,m,V,ne,ue){if(P>m||P<f){const Pe="bigint"==typeof f?"n":"";let $e;throw $e=ue>3?0===f||f===BigInt(0)?`>= 0${Pe} and < 2${Pe} ** ${8*(ue+1)}${Pe}`:`>= -(2${Pe} ** ${8*(ue+1)-1}${Pe}) and < 2 ** ${8*(ue+1)-1}${Pe}`:`>= ${f}${Pe} and <= ${m}${Pe}`,new at.ERR_OUT_OF_RANGE("value",$e,P)}!function Et(P,f,m){_e(f,"offset"),(void 0===P[f]||void 0===P[f+m])&&k(f,P.length-(m+1))}(V,ne,ue)}function _e(P,f){if("number"!=typeof P)throw new at.ERR_INVALID_ARG_TYPE(f,"number",P)}function k(P,f,m){throw Math.floor(P)!==P?(_e(P,m),new at.ERR_OUT_OF_RANGE(m||"offset","an integer",P)):f<0?new at.ERR_BUFFER_OUT_OF_BOUNDS:new at.ERR_OUT_OF_RANGE(m||"offset",`>= ${m?1:0} and <= ${f}`,P)}St("ERR_BUFFER_OUT_OF_BOUNDS",function(P){return P?`${P} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),St("ERR_INVALID_ARG_TYPE",function(P,f){return`The "${P}" argument must be of type number. Received type ${typeof f}`},TypeError),St("ERR_OUT_OF_RANGE",function(P,f,m){let V=`The value of "${P}" is out of range.`,ne=m;return Number.isInteger(m)&&Math.abs(m)>2**32?ne=kt(String(m)):"bigint"==typeof m&&(ne=String(m),(m>BigInt(2)**BigInt(32)||m<-(BigInt(2)**BigInt(32)))&&(ne=kt(ne)),ne+="n"),V+=` It must be ${f}. Received ${ne}`,V},RangeError);const M=/[^+/0-9A-Za-z-_]/g;function Y(P,f){let m;f=f||1/0;const V=P.length;let ne=null;const ue=[];for(let Pe=0;Pe<V;++Pe){if(m=P.charCodeAt(Pe),m>55295&&m<57344){if(!ne){if(m>56319){(f-=3)>-1&&ue.push(239,191,189);continue}if(Pe+1===V){(f-=3)>-1&&ue.push(239,191,189);continue}ne=m;continue}if(m<56320){(f-=3)>-1&&ue.push(239,191,189),ne=m;continue}m=65536+(ne-55296<<10|m-56320)}else ne&&(f-=3)>-1&&ue.push(239,191,189);if(ne=null,m<128){if((f-=1)<0)break;ue.push(m)}else if(m<2048){if((f-=2)<0)break;ue.push(m>>6|192,63&m|128)}else if(m<65536){if((f-=3)<0)break;ue.push(m>>12|224,m>>6&63|128,63&m|128)}else{if(!(m<1114112))throw new Error("Invalid code point");if((f-=4)<0)break;ue.push(m>>18|240,m>>12&63|128,m>>6&63|128,63&m|128)}}return ue}function K(P){return g.toByteArray(function H(P){if((P=(P=P.split("=")[0]).trim().replace(M,"")).length<2)return"";for(;P.length%4!=0;)P+="=";return P}(P))}function J(P,f,m,V){let ne;for(ne=0;ne<V&&!(ne+m>=f.length||ne>=P.length);++ne)f[ne+m]=P[ne];return ne}function fe(P,f){return P instanceof f||null!=P&&null!=P.constructor&&null!=P.constructor.name&&P.constructor.name===f.name}function Oe(P){return P!=P}const Le=function(){const P="0123456789abcdef",f=new Array(256);for(let m=0;m<16;++m){const V=16*m;for(let ne=0;ne<16;++ne)f[V+ne]=P[m]+P[ne]}return f}();function Ee(P){return typeof BigInt>"u"?Ue:P}function Ue(){throw new Error("BigInt not supported")}},2020(Ei,At){At.read=function(We,j,g,R,le){var Te,Ve,Ye=8*le-R-1,Se=(1<<Ye)-1,ct=Se>>1,Ke=-7,X=g?le-1:0,ae=g?-1:1,se=We[j+X];for(X+=ae,Te=se&(1<<-Ke)-1,se>>=-Ke,Ke+=Ye;Ke>0;Te=256*Te+We[j+X],X+=ae,Ke-=8);for(Ve=Te&(1<<-Ke)-1,Te>>=-Ke,Ke+=R;Ke>0;Ve=256*Ve+We[j+X],X+=ae,Ke-=8);if(0===Te)Te=1-ct;else{if(Te===Se)return Ve?NaN:1/0*(se?-1:1);Ve+=Math.pow(2,R),Te-=ct}return(se?-1:1)*Ve*Math.pow(2,Te-R)},At.write=function(We,j,g,R,le,Te){var Ve,Ye,Se,ct=8*Te-le-1,Ke=(1<<ct)-1,X=Ke>>1,ae=23===le?Math.pow(2,-24)-Math.pow(2,-77):0,se=R?0:Te-1,ge=R?1:-1,we=j<0||0===j&&1/j<0?1:0;for(j=Math.abs(j),isNaN(j)||j===1/0?(Ye=isNaN(j)?1:0,Ve=Ke):(Ve=Math.floor(Math.log(j)/Math.LN2),j*(Se=Math.pow(2,-Ve))<1&&(Ve--,Se*=2),(j+=Ve+X>=1?ae/Se:ae*Math.pow(2,1-X))*Se>=2&&(Ve++,Se/=2),Ve+X>=Ke?(Ye=0,Ve=Ke):Ve+X>=1?(Ye=(j*Se-1)*Math.pow(2,le),Ve+=X):(Ye=j*Math.pow(2,X-1)*Math.pow(2,le),Ve=0));le>=8;We[g+se]=255&Ye,se+=ge,Ye/=256,le-=8);for(Ve=Ve<<le|Ye,ct+=le;ct>0;We[g+se]=255&Ve,se+=ge,Ve/=256,ct-=8);We[g+se-ge]|=128*we}},5376(Ei,At,We){"use strict";var j=this&&this.__createBinding||(Object.create?function(R,le,Te,Ve){void 0===Ve&&(Ve=Te);var Ye=Object.getOwnPropertyDescriptor(le,Te);(!Ye||("get"in Ye?!le.__esModule:Ye.writable||Ye.configurable))&&(Ye={enumerable:!0,get:function(){return le[Te]}}),Object.defineProperty(R,Ve,Ye)}:function(R,le,Te,Ve){void 0===Ve&&(Ve=Te),R[Ve]=le[Te]}),g=this&&this.__exportStar||function(R,le){for(var Te in R)"default"!==Te&&!Object.prototype.hasOwnProperty.call(le,Te)&&j(le,R,Te)};Object.defineProperty(At,"__esModule",{value:!0}),g(We(1006),At),g(We(4122),At),g(We(2653),At),g(We(8327),At),g(We(7265),At),g(We(9797),At),g(We(8866),At)},1006(Ei,At){"use strict";Object.defineProperty(At,"__esModule",{value:!0}),At.BlankNode=void 0,At.BlankNode=class We{constructor(g){this.termType="BlankNode",this.value=g}equals(g){return!!g&&"BlankNode"===g.termType&&g.value===this.value}}},4122(Ei,At,We){"use strict";Object.defineProperty(At,"__esModule",{value:!0}),At.DataFactory=void 0;const j=We(1006),g=We(2653),R=We(8327),le=We(7265),Te=We(9797),Ve=We(8866);let Ye=0;At.DataFactory=class Se{constructor(Ke){this.blankNodeCounter=0,this.blankNodePrefix=(Ke=Ke||{}).blankNodePrefix||`df_${Ye++}_`}namedNode(Ke){return new le.NamedNode(Ke)}blankNode(Ke){return new j.BlankNode(Ke||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(Ke,X){return new R.Literal(Ke,X)}variable(Ke){return new Ve.Variable(Ke)}defaultGraph(){return g.DefaultGraph.INSTANCE}quad(Ke,X,ae,se){return new Te.Quad(Ke,X,ae,se||this.defaultGraph())}fromTerm(Ke){switch(Ke.termType){case"NamedNode":return this.namedNode(Ke.value);case"BlankNode":return this.blankNode(Ke.value);case"Literal":return Ke.language?this.literal(Ke.value,Ke.language):Ke.datatype.equals(R.Literal.XSD_STRING)?this.literal(Ke.value):this.literal(Ke.value,this.fromTerm(Ke.datatype));case"Variable":return this.variable(Ke.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(Ke.subject),this.fromTerm(Ke.predicate),this.fromTerm(Ke.object),this.fromTerm(Ke.graph))}}fromQuad(Ke){return this.fromTerm(Ke)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},2653(Ei,At){"use strict";Object.defineProperty(At,"__esModule",{value:!0}),At.DefaultGraph=void 0;class We{constructor(){this.termType="DefaultGraph",this.value=""}equals(g){return!!g&&"DefaultGraph"===g.termType}}At.DefaultGraph=We,We.INSTANCE=new We},8327(Ei,At,We){"use strict";Object.defineProperty(At,"__esModule",{value:!0}),At.Literal=void 0;const j=We(7265);class g{constructor(le,Te){this.termType="Literal",this.value=le,"string"==typeof Te?(this.language=Te,this.datatype=g.RDF_LANGUAGE_STRING):Te?(this.language="",this.datatype=Te):(this.language="",this.datatype=g.XSD_STRING)}equals(le){return!!le&&"Literal"===le.termType&&le.value===this.value&&le.language===this.language&&this.datatype.equals(le.datatype)}}At.Literal=g,g.RDF_LANGUAGE_STRING=new j.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),g.XSD_STRING=new j.NamedNode("http://www.w3.org/2001/XMLSchema#string")},7265(Ei,At){"use strict";Object.defineProperty(At,"__esModule",{value:!0}),At.NamedNode=void 0,At.NamedNode=class We{constructor(g){this.termType="NamedNode",this.value=g}equals(g){return!!g&&"NamedNode"===g.termType&&g.value===this.value}}},9797(Ei,At){"use strict";Object.defineProperty(At,"__esModule",{value:!0}),At.Quad=void 0,At.Quad=class We{constructor(g,R,le,Te){this.termType="Quad",this.value="",this.subject=g,this.predicate=R,this.object=le,this.graph=Te}equals(g){return!!g&&("Quad"===g.termType||!g.termType)&&this.subject.equals(g.subject)&&this.predicate.equals(g.predicate)&&this.object.equals(g.object)&&this.graph.equals(g.graph)}}},8866(Ei,At){"use strict";Object.defineProperty(At,"__esModule",{value:!0}),At.Variable=void 0,At.Variable=class We{constructor(g){this.termType="Variable",this.value=g}equals(g){return!!g&&"Variable"===g.termType&&g.value===this.value}}},204(Ei){function j(X){this._options=X=X||{};var ae=X.prefixes||{};this._prefixByIri={};var se=[];for(var ge in ae){var we=ae[ge];Ve(we)&&(this._prefixByIri[we]=ge,se.push(we))}var dt=se.join("|").replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&");this._prefixRegex=new RegExp("^("+dt+")([a-zA-Z][\\-_a-zA-Z0-9]*)$"),this._usedPrefixes={},this._sparqlStar=X.sparqlStar,this._indent=Ve(X.indent)?X.indent:" ",this._newline=Ve(X.newline)?X.newline:"\n",this._explicitDatatype=!!X.explicitDatatype}j.prototype.toQuery=function(X){var ae="";return X.queryType&&(ae+=X.queryType.toUpperCase()+" "),X.reduced&&(ae+="REDUCED "),X.distinct&&(ae+="DISTINCT "),X.variables?ae+=ct(X.variables,void 0,function(se){return/^[?$]/.test(se)?se:Ye(se)?this.toEntity(se):"("+this.toExpression(se.expression)+" AS "+Te(se.variable)+")"},this)+" ":X.template&&(ae+=this.group(X.template,!0)+this._newline),X.from&&(ae+=this.graphs("FROM ",X.from.default)+this.graphs("FROM NAMED ",X.from.named)),X.where&&(ae+="WHERE "+this.group(X.where,!0)+this._newline),X.updates&&(ae+=ct(X.updates,";"+this._newline,this.toUpdate,this)),X.group&&(ae+="GROUP BY "+ct(X.group,void 0,function(se){var ge=Ye(se.expression)?this.toEntity(se.expression):"("+this.toExpression(se.expression)+")";return se.variable?"("+ge+" AS "+Te(se.variable)+")":ge},this)+this._newline),X.having&&(ae+="HAVING ("+ct(X.having,void 0,this.toExpression,this)+")"+this._newline),X.order&&(ae+="ORDER BY "+ct(X.order,void 0,function(se){var ge="("+this.toExpression(se.expression)+")";return se.descending?"DESC "+ge:ge},this)+this._newline),Number.isInteger(X.offset)&&(ae+="OFFSET "+X.offset+this._newline),Number.isInteger(X.limit)&&(ae+="LIMIT "+X.limit+this._newline),X.values&&(ae+=this.values(X)),(ae=this.baseAndPrefixes(X)+ae).trim()},j.prototype.baseAndPrefixes=function(X){var ae=X.base?"BASE <"+X.base+">"+this._newline:"",se="";for(var ge in X.prefixes)(this._options.allPrefixes||this._usedPrefixes[ge])&&(se+="PREFIX "+ge+": <"+X.prefixes[ge]+">"+this._newline);return ae+se},j.prototype.toPattern=function(X){var ae=X.type||X instanceof Array&&"array"||(X.subject&&X.predicate&&X.object?"triple":"");if(!(ae in this))throw new Error("Unknown entry type: "+ae);return this[ae](X)},j.prototype.triple=function(X){return this.toEntity(X.subject)+" "+this.toEntity(X.predicate)+" "+this.toEntity(X.object)+"."},j.prototype.array=function(X){return ct(X,this._newline,this.toPattern,this)},j.prototype.bgp=function(X){return this.encodeTriples(X.triples)},j.prototype.encodeTriples=function(X){if(!X.length)return"";for(var ae=[],se=void 0,ge=void 0,we=0;we<X.length;we++){var dt=X[we];Se(dt.subject,se)?Se(dt.predicate,ge)?ae.push(","):ae.push(";"+this._newline,this._indent,this.toEntity(ge=dt.predicate)):(se&&ae.push("."+this._newline),ge=dt.predicate,ae.push(this.toEntity(se=dt.subject)," ",this.toEntity(ge))),ae.push(" ",this.toEntity(dt.object))}return ae.push("."),ae.join("")},j.prototype.graph=function(X){return"GRAPH "+this.toEntity(X.name)+" "+this.group(X)},j.prototype.graphs=function(X,ae){return ae&&0!==ae.length?ct(ae,"",function(se){return X+this.toEntity(se)+this._newline},this):""},j.prototype.group=function(X,ae){return-1===(X=!0!==ae?this.array(X.patterns||X.triples):this.toPattern("group"!==X.type?X:X.patterns)).indexOf(this._newline)?"{ "+X+" }":"{"+this._newline+this.indent(X)+this._newline+"}"},j.prototype.query=function(X){return this.toQuery(X)},j.prototype.filter=function(X){return"FILTER("+this.toExpression(X.expression)+")"},j.prototype.bind=function(X){return"BIND("+this.toExpression(X.expression)+" AS "+Te(X.variable)+")"},j.prototype.optional=function(X){return"OPTIONAL "+this.group(X)},j.prototype.union=function(X){return ct(X.patterns,this._newline+"UNION"+this._newline,function(ae){return this.group(ae,!0)},this)},j.prototype.minus=function(X){return"MINUS "+this.group(X)},j.prototype.values=function(X){var se,ge,ae=Object.keys(X.values.reduce(function(we,dt){for(var ze in dt)we[ze]=!0;return we},{}));return 1===ae.length?se=ge="":(se="(",ge=")"),"VALUES "+se+ae.join(" ")+ge+" {"+this._newline+ct(X.values,this._newline,function(we){return" "+se+ct(ae,void 0,function(dt){return we[dt]?this.toEntity(we[dt]):"UNDEF"},this)+ge},this)+this._newline+"}"},j.prototype.service=function(X){return"SERVICE "+(X.silent?"SILENT ":"")+this.toEntity(X.name)+" "+this.group(X)},j.prototype.toExpression=function(X){if(Ye(X))return this.toEntity(X);switch(X.type.toLowerCase()){case"aggregate":return X.aggregation.toUpperCase()+"("+(X.distinct?"DISTINCT ":"")+this.toExpression(X.expression)+("string"==typeof X.separator?'; SEPARATOR = "'+X.separator.replace(g,R)+'"':"")+")";case"functioncall":return this.toEntity(X.function)+"("+ct(X.args,", ",this.toExpression,this)+")";case"operation":var ae=X.operator.toUpperCase(),se=X.args||[];switch(X.operator.toLowerCase()){case"<":case">":case">=":case"<=":case"&&":case"||":case"=":case"!=":case"+":case"-":case"*":case"/":return(Ye(se[0])?this.toEntity(se[0]):"("+this.toExpression(se[0])+")")+" "+ae+" "+(Ye(se[1])?this.toEntity(se[1]):"("+this.toExpression(se[1])+")");case"!":return"!("+this.toExpression(se[0])+")";case"uplus":return"+("+this.toExpression(se[0])+")";case"uminus":return"-("+this.toExpression(se[0])+")";case"notin":ae="NOT IN";case"in":return this.toExpression(se[0])+" "+ae+"("+(Ve(se[1])?se[1]:ct(se[1],", ",this.toExpression,this))+")";case"notexists":ae="NOT EXISTS";case"exists":return ae+" "+this.group(se[0],!0);default:return ae+"("+ct(se,", ",this.toExpression,this)+")"}default:throw new Error("Unknown expression type: "+X.type)}},j.prototype.toEntity=function(X){if(Ye(X))switch(X.termType){case"Wildcard":return"*";case"Variable":return Te(X);case"BlankNode":return"_:"+X.value;case"Literal":var ae=X.value||"",se=X.language||"",ge=X.datatype;if(X='"'+ae.replace(g,R)+'"',se)X+="@"+se;else if(ge){if(!this._explicitDatatype)switch(ge.value){case"http://www.w3.org/2001/XMLSchema#string":return X;case"http://www.w3.org/2001/XMLSchema#integer":if(/^\d+$/.test(ae))return ae+" "}X+="^^"+this.encodeIRI(ge.value)}return X;case"Quad":if(!this._sparqlStar)throw new Error("SPARQL* support is not enabled");return X.graph&&"DefaultGraph"!==X.graph.termType?"<< GRAPH "+this.toEntity(X.graph)+" { "+this.toEntity(X.subject)+" "+this.toEntity(X.predicate)+" "+this.toEntity(X.object)+" } >>":"<< "+this.toEntity(X.subject)+" "+this.toEntity(X.predicate)+" "+this.toEntity(X.object)+" >>";default:return this.encodeIRI(X.value)}else{var we=X.items.map(this.toEntity,this),dt=X.pathType;switch(dt){case"^":case"!":return dt+we[0];case"*":case"+":case"?":return"("+we[0]+dt+")";default:return"("+we.join(dt)+")"}}};var g=/["\\\t\n\r\b\f]/g,R=function(X){return le[X]},le={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};function Te(X){return"?"+X.value}function Ve(X){return"string"==typeof X}function Ye(X){return"string"==typeof X.termType}function Se(X,ae){if(!(X&&Ye(X)&&ae&&Ye(ae)&&X.termType===ae.termType))return!1;switch(X.termType){case"Literal":return X.value===ae.value&&X.language===ae.language&&Se(X.datatype,ae.datatype);case"Quad":return Se(X.subject,ae.subject)&&Se(X.predicate,ae.predicate)&&Se(X.object,ae.object)&&Se(X.graph,ae.graph);default:return X.value===ae.value}}function ct(X,ae,se,ge){return X.map(se,ge).join(Ve(ae)?ae:" ")}j.prototype.encodeIRI=function(X){var ae=this._prefixRegex.exec(X);if(ae){var se=this._prefixByIri[ae[1]];return this._usedPrefixes[se]=!0,se+":"+ae[2]}return"<"+X+">"},j.prototype.toUpdate=function(X){switch(X.type||X.updateType){case"load":return"LOAD"+(X.source?" "+this.toEntity(X.source):"")+(X.destination?" INTO GRAPH "+this.toEntity(X.destination):"");case"insert":return"INSERT DATA "+this.group(X.insert,!0);case"delete":return"DELETE DATA "+this.group(X.delete,!0);case"deletewhere":return"DELETE WHERE "+this.group(X.delete,!0);case"insertdelete":return(X.graph?"WITH "+this.toEntity(X.graph)+this._newline:"")+(X.delete.length?"DELETE "+this.group(X.delete,!0)+this._newline:"")+(X.insert.length?"INSERT "+this.group(X.insert,!0)+this._newline:"")+(X.using?this.graphs("USING ",X.using.default):"")+(X.using?this.graphs("USING NAMED ",X.using.named):"")+"WHERE "+this.group(X.where,!0);case"add":case"copy":case"move":return X.type.toUpperCase()+" "+(X.silent?"SILENT ":"")+(X.source.default?"DEFAULT":this.toEntity(X.source.name))+" TO "+this.toEntity(X.destination.name);case"create":case"clear":case"drop":return X.type.toUpperCase()+(X.silent?" SILENT ":" ")+(X.graph.default?"DEFAULT":X.graph.named?"NAMED":X.graph.all?"ALL":"GRAPH "+this.toEntity(X.graph.name));default:throw new Error("Unknown update query type: "+X.type)}},j.prototype.indent=function(X){return X.replace(/^/gm,this._indent)},Ei.exports={Generator:function Ke(X={}){return{stringify:function(ae){var se=Object.create(X);return se.prefixes=ae.prefixes,new j(se).toQuery(ae)},createGenerator:function(){return new j(X)}}}}},5510(Ei,At,We){var j=function(){var g=function(Ge,Be,Ze,pt){for(Ze=Ze||{},pt=Ge.length;pt--;Ze[Ge[pt]]=Be);return Ze},R=[6,12,13,15,16,24,32,36,41,45,100,110,113,115,116,123,126,131,197,224,229,308,329,330,331,332,333],le=[2,247],Te=[100,110,113,115,116,123,126,131,329,330,331,332,333],Ve=[2,409],Ye=[1,18],Se=[1,27],ct=[13,16,45,197,224,229,308],Ke=[28,29,53],X=[28,53],ae=[1,42],se=[1,45],ge=[1,41],we=[1,44],dt=[123,126],ze=[1,67],Ct=[39,45,87],Qt=[13,16,45,197,224,308],Wt=[1,87],Mt=[2,281],He=[1,86],Nt=[13,16,45,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],ri=[6,28,29,53,63,70,73,81,83,85],oi=[6,13,16,28,29,53,63,70,73,81,83,85,87,308],Yt=[6,13,16,28,29,45,53,63,70,73,81,82,83,85,87,89,197,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314],Gt=[6,13,16,28,29,31,39,45,47,48,53,63,70,73,81,82,83,85,87,89,109,112,121,123,126,128,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,337,338,340,341,342,343,344,345,346],li=[13,16,308],ci=[112,132,327,334],Kt=[13,16,112,132,308],It=[1,111],vt=[1,117],Jt=[112,132,327,328,334],wt=[13,16,112,132,308,328],Ne=[28,29,45,53,87],me=[1,138],de=[1,151],pe=[1,128],Ie=[1,127],Ae=[1,129],it=[1,140],Je=[1,141],qe=[1,142],Pt=[1,143],at=[1,144],St=[1,145],kt=[1,147],Et=[1,148],Lt=[2,457],_e=[1,158],k=[1,159],M=[1,160],H=[1,152],Y=[1,153],I=[1,156],L=[1,171],K=[1,172],J=[1,173],fe=[1,174],Oe=[1,175],Le=[1,176],Ee=[1,167],Ue=[1,168],P=[1,169],f=[1,170],m=[1,157],V=[1,166],ne=[1,161],ue=[1,162],Pe=[1,163],$e=[1,164],lt=[1,165],rt=[6,13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335],mt=[1,195],bt=[6,31,73,81,83,85],ai=[2,285],Tt=[1,199],Rt=[1,201],qt=[6,31,70,73,81,83,85],zt=[2,283],hi=[1,207],ki=[1,218],yi=[1,223],Ni=[1,219],fi=[1,225],pi=[1,226],di=[1,224],gi=[6,63,70,73,81,83,85],xi=[1,236],Di=[2,334],Ii=[1,243],vi=[1,241],mi=[6,193],en=[2,349],tn=[2,339],si=[28,128],nn=[47,48,193,272],cn=[47,48,193,242,272],Si=[47,48,193,242,246,272],_i=[47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,341,342,343,344,345,346],wi=[39,47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,338,341,342,343,344,345,346],Xi=[1,271],Vi=[1,270],ei=[6,13,16,29,31,39,45,47,48,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,338,341,342,343,344,345,346,347,348,349,350,351],Ji=[1,281],Gi=[1,280],Ut=[13,16,29,31,39,45,47,48,82,85,87,89,112,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346],$i=[45,89],Bi=[13,16,29,31,39,45,47,48,82,85,87,89,112,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346],Q=[13,16,31,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],u=[31,89],d=[48,87],O=[6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337,338],T=[6,13,16,39,45,48,82,87,89,231,263,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337,338,340],N=[1,313],$=[6,85],re=[6,31,81,83,85],ce=[2,361],Ce=[2,353],je=[1,343],ot=[31,112,335],gt=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],ht=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335],jt=[6,109,193],Ci=[31,112],$t=[13,16,45,82,87,224,263,265,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312,346,347,348,349,350,351],zi=[1,390],pn=[1,391],gn=[13,16,87,197,308,314],Un=[13,16,39,45,82,87,224,263,265,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312,346,347,348,349,350,351],Ri=[1,417],rn=[1,418],mn=[13,16,48,197,229,308],Yi=[6,31,85],In=[6,13,16,31,45,73,81,83,85,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],jn=[6,13,16,29,31,45,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,231,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,346,347,348,349,350,351],bn=[29,31,85,112,159,160,161,163,164],kn=[1,443],sn=[1,444],$n=[1,449],Mi=[31,112,193,232,318,335],fn=[13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],G=[13,16,31,45,48,82,87,89,112,193,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],S=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],A=[13,16,31,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],q=[31,45],ie=[1,507],xe=[1,508],ke=[6,13,16,29,31,39,45,47,48,63,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,336,338,341,342,343,344,345,346,347,348,349,350,351],Xe=[29,31,85,112,159,160,161,163,164,335],Qe=[6,13,16,31,45,70,73,81,83,85,87,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],Ot=[13,16,31,45,48,82,87,89,112,193,197,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],Ft=[2,352],bi=[13,16,197,308,314],on=[1,565],Hi=[6,13,16,31,45,76,78,81,83,85,87,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],On=[13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],Ti=[13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335],Nn=[13,16,87,308],un=[2,364],zn=[29,31,85,112,159,160,161,163,164,193,232,318,335],yn=[31,112,193,232,272,318,335],ln=[2,359],Bn=[13,16,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Cn=[29,31,85,112,159,160,161,163,164,193,232,272,318,335],rr=[13,16,31,45,82,87,89,112,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],Gn=[2,347],Xn={trace:function(){},yy:{},symbols_:{error:2,QueryOrUpdate:3,Prologue:4,QueryOrUpdate_group0:5,EOF:6,Query:7,Qry:8,Query_option0:9,Prologue_repetition0:10,BaseDecl:11,BASE:12,IRIREF:13,PrefixDecl:14,PREFIX:15,PNAME_NS:16,SelectClauseWildcard:17,Qry_repetition0:18,WhereClause:19,SolutionModifierNoGroup:20,SelectClauseVars:21,Qry_repetition1:22,SolutionModifier:23,CONSTRUCT:24,ConstructTemplate:25,Qry_repetition2:26,Qry_repetition3:27,WHERE:28,"{":29,Qry_option0:30,"}":31,DESCRIBE:32,Qry_group0:33,Qry_repetition4:34,Qry_option1:35,ASK:36,Qry_repetition5:37,SelectClauseBase:38,"*":39,SelectClauseVars_repetition_plus0:40,SELECT:41,SelectClauseBase_option0:42,SelectClauseItem:43,Var:44,"(":45,Expression:46,AS:47,")":48,SubSelect:49,SubSelect_option0:50,SubSelect_option1:51,DatasetClause:52,FROM:53,DatasetClause_option0:54,iri:55,WhereClause_option0:56,GroupGraphPattern:57,SolutionModifier_option0:58,SolutionModifierNoGroup_option0:59,SolutionModifierNoGroup_option1:60,SolutionModifierNoGroup_option2:61,GroupClause:62,GROUP:63,BY:64,GroupClause_repetition_plus0:65,GroupCondition:66,BuiltInCall:67,FunctionCall:68,HavingClause:69,HAVING:70,HavingClause_repetition_plus0:71,OrderClause:72,ORDER:73,OrderClause_repetition_plus0:74,OrderCondition:75,ASC:76,BrackettedExpression:77,DESC:78,Constraint:79,LimitOffsetClauses:80,LIMIT:81,INTEGER:82,OFFSET:83,ValuesClause:84,VALUES:85,InlineData:86,VAR:87,InlineData_repetition0:88,NIL:89,InlineData_repetition1:90,InlineData_repetition_plus2:91,InlineData_repetition3:92,DataBlock:93,DataBlockValueList:94,DataBlockValueList_repetition_plus0:95,Update:96,Update_repetition0:97,Update1:98,Update_option0:99,LOAD:100,Update1_option0:101,Update1_option1:102,Update1_group0:103,Update1_option2:104,GraphRefAll:105,Update1_group1:106,Update1_option3:107,GraphOrDefault:108,TO:109,CREATE:110,Update1_option4:111,GRAPH:112,INSERTDATA:113,QuadPattern:114,DELETEDATA:115,DELETEWHERE:116,Update1_option5:117,InsertDeleteClause:118,Update1_repetition0:119,IntoGraphClause:120,INTO:121,GraphRef:122,DELETE:123,InsertDeleteClause_option0:124,InsertClause:125,INSERT:126,UsingClause:127,USING:128,UsingClause_option0:129,WithClause:130,WITH:131,DEFAULT:132,GraphOrDefault_option0:133,GraphRefAll_group0:134,Quads:135,Quads_option0:136,Quads_repetition0:137,QuadsNotTriples:138,VarOrIri:139,QuadsNotTriples_option0:140,QuadsNotTriples_option1:141,QuadsNotTriples_option2:142,TriplesTemplate:143,TriplesTemplate_repetition0:144,TriplesSameSubject:145,TriplesTemplate_option0:146,GroupGraphPatternSub:147,GroupGraphPatternSub_option0:148,GroupGraphPatternSub_repetition0:149,GroupGraphPatternSubTail:150,GraphPatternNotTriples:151,GroupGraphPatternSubTail_option0:152,GroupGraphPatternSubTail_option1:153,TriplesBlock:154,TriplesBlock_repetition0:155,TriplesSameSubjectPath:156,TriplesBlock_option0:157,GroupOrUnionGraphPattern:158,OPTIONAL:159,MINUS:160,SERVICE:161,GraphPatternNotTriples_option0:162,FILTER:163,BIND:164,InlineDataOneVar:165,InlineDataFull:166,InlineDataOneVar_repetition0:167,InlineDataFull_repetition0:168,InlineDataFull_repetition_plus1:169,InlineDataFull_repetition2:170,DataBlockValue:171,Literal:172,QuotedTriple:173,UNDEF:174,GroupOrUnionGraphPattern_repetition0:175,ArgList:176,ArgList_option0:177,ArgList_repetition0:178,ExpressionList:179,ExpressionList_repetition0:180,ConstructTemplate_option0:181,ConstructTriples:182,ConstructTriples_repetition0:183,ConstructTriples_option0:184,VarOrTermOrQuotedTP:185,PropertyListNotEmpty:186,TriplesNode:187,PropertyList:188,PropertyList_option0:189,VerbObjectList:190,PropertyListNotEmpty_repetition0:191,SemiOptionalVerbObjectList:192,";":193,SemiOptionalVerbObjectList_option0:194,Verb:195,ObjectList:196,a:197,ObjectList_repetition0:198,Object:199,GraphNode:200,Object_option0:201,PropertyListPathNotEmpty:202,TriplesNodePath:203,TriplesSameSubjectPath_option0:204,O:205,PropertyListPathNotEmpty_repetition0:206,PropertyListPathNotEmptyTail:207,O_group0:208,ObjectListPath:209,ObjectListPath_repetition0:210,ObjectPath:211,GraphNodePath:212,ObjectPath_option0:213,Path:214,Path_repetition0:215,PathSequence:216,PathSequence_repetition0:217,PathEltOrInverse:218,PathElt:219,PathPrimary:220,PathElt_option0:221,PathEltOrInverse_option0:222,IriOrA:223,"!":224,PathNegatedPropertySet:225,PathOneInPropertySet:226,PathNegatedPropertySet_repetition0:227,PathNegatedPropertySet_option0:228,"^":229,TriplesNode_repetition_plus0:230,"[":231,"]":232,TriplesNodePath_repetition_plus0:233,VarOrTermOrQuotedTPExpr:234,VarOrTerm:235,GraphTerm:236,BlankNode:237,ConditionalOrExpression:238,ConditionalAndExpression:239,ConditionalOrExpression_repetition0:240,ConditionalOrExpressionTail:241,"||":242,RelationalExpression:243,ConditionalAndExpression_repetition0:244,ConditionalAndExpressionTail:245,"&&":246,NumericExpression:247,RelationalExpression_group0:248,RelationalExpression_option0:249,IN:250,MultiplicativeExpression:251,NumericExpression_repetition0:252,AdditiveExpressionTail:253,AdditiveExpressionTail_group0:254,NumericLiteralPositive:255,AdditiveExpressionTail_repetition0:256,NumericLiteralNegative:257,AdditiveExpressionTail_repetition1:258,UnaryExpression:259,MultiplicativeExpression_repetition0:260,MultiplicativeExpressionTail:261,MultiplicativeExpressionTail_group0:262,"+":263,PrimaryExpression:264,"-":265,ExprQuotedTP:266,Aggregate:267,FUNC_ARITY0:268,FUNC_ARITY1:269,FUNC_ARITY1_SPARQL_STAR:270,FUNC_ARITY2:271,",":272,FUNC_ARITY3:273,FUNC_ARITY3_SPARQL_STAR:274,BuiltInCall_group0:275,BOUND:276,BNODE:277,BuiltInCall_option0:278,EXISTS:279,COUNT:280,Aggregate_option0:281,Aggregate_group0:282,FUNC_AGGREGATE:283,Aggregate_option1:284,GROUP_CONCAT:285,Aggregate_option2:286,Aggregate_option3:287,GroupConcatSeparator:288,SEPARATOR:289,"=":290,String:291,LANGTAG:292,"^^":293,DECIMAL:294,DOUBLE:295,BOOLEAN:296,INTEGER_POSITIVE:297,DECIMAL_POSITIVE:298,DOUBLE_POSITIVE:299,INTEGER_NEGATIVE:300,DECIMAL_NEGATIVE:301,DOUBLE_NEGATIVE:302,STRING_LITERAL1:303,STRING_LITERAL2:304,STRING_LITERAL_LONG1:305,STRING_LITERAL_LONG2:306,PrefixedName:307,PNAME_LN:308,BLANK_NODE_LABEL:309,ANON:310,QuotedTP:311,"<<":312,qtSubjectOrObject:313,">>":314,DataValueTerm:315,AnnotationPattern:316,"{|":317,"|}":318,AnnotationPatternPath:319,ExprVarOrTerm:320,QueryOrUpdate_group0_option0:321,Prologue_repetition0_group0:322,Qry_group0_repetition_plus0:323,SelectClauseBase_option0_group0:324,DISTINCT:325,REDUCED:326,NAMED:327,SILENT:328,CLEAR:329,DROP:330,ADD:331,MOVE:332,COPY:333,ALL:334,".":335,UNION:336,"|":337,"/":338,PathElt_option0_group0:339,"?":340,"!=":341,"<":342,">":343,"<=":344,">=":345,NOT:346,CONCAT:347,COALESCE:348,SUBSTR:349,REGEX:350,REPLACE:351,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",12:"BASE",13:"IRIREF",15:"PREFIX",16:"PNAME_NS",24:"CONSTRUCT",28:"WHERE",29:"{",31:"}",32:"DESCRIBE",36:"ASK",39:"*",41:"SELECT",45:"(",47:"AS",48:")",53:"FROM",63:"GROUP",64:"BY",70:"HAVING",73:"ORDER",76:"ASC",78:"DESC",81:"LIMIT",82:"INTEGER",83:"OFFSET",85:"VALUES",87:"VAR",89:"NIL",100:"LOAD",109:"TO",110:"CREATE",112:"GRAPH",113:"INSERTDATA",115:"DELETEDATA",116:"DELETEWHERE",121:"INTO",123:"DELETE",126:"INSERT",128:"USING",131:"WITH",132:"DEFAULT",159:"OPTIONAL",160:"MINUS",161:"SERVICE",163:"FILTER",164:"BIND",174:"UNDEF",193:";",197:"a",224:"!",229:"^",231:"[",232:"]",242:"||",246:"&&",250:"IN",263:"+",265:"-",268:"FUNC_ARITY0",269:"FUNC_ARITY1",270:"FUNC_ARITY1_SPARQL_STAR",271:"FUNC_ARITY2",272:",",273:"FUNC_ARITY3",274:"FUNC_ARITY3_SPARQL_STAR",276:"BOUND",277:"BNODE",279:"EXISTS",280:"COUNT",283:"FUNC_AGGREGATE",285:"GROUP_CONCAT",289:"SEPARATOR",290:"=",292:"LANGTAG",293:"^^",294:"DECIMAL",295:"DOUBLE",296:"BOOLEAN",297:"INTEGER_POSITIVE",298:"DECIMAL_POSITIVE",299:"DOUBLE_POSITIVE",300:"INTEGER_NEGATIVE",301:"DECIMAL_NEGATIVE",302:"DOUBLE_NEGATIVE",303:"STRING_LITERAL1",304:"STRING_LITERAL2",305:"STRING_LITERAL_LONG1",306:"STRING_LITERAL_LONG2",308:"PNAME_LN",309:"BLANK_NODE_LABEL",310:"ANON",312:"<<",314:">>",317:"{|",318:"|}",325:"DISTINCT",326:"REDUCED",327:"NAMED",328:"SILENT",329:"CLEAR",330:"DROP",331:"ADD",332:"MOVE",333:"COPY",334:"ALL",335:".",336:"UNION",337:"|",338:"/",340:"?",341:"!=",342:"<",343:">",344:"<=",345:">=",346:"NOT",347:"CONCAT",348:"COALESCE",349:"SUBSTR",350:"REGEX",351:"REPLACE"},productions_:[0,[3,3],[7,2],[4,1],[11,2],[14,3],[8,4],[8,4],[8,5],[8,7],[8,5],[8,4],[17,2],[21,2],[38,2],[43,1],[43,5],[49,4],[49,4],[52,3],[19,2],[23,2],[20,3],[62,3],[66,1],[66,1],[66,3],[66,5],[66,1],[69,2],[72,3],[75,2],[75,2],[75,1],[75,1],[80,2],[80,2],[80,4],[80,4],[84,2],[86,4],[86,4],[86,6],[86,2],[94,3],[96,3],[98,4],[98,3],[98,5],[98,4],[98,2],[98,2],[98,2],[98,5],[120,2],[118,3],[118,1],[125,2],[127,3],[130,2],[108,1],[108,2],[122,2],[105,1],[105,1],[114,3],[135,2],[138,7],[143,3],[57,3],[57,3],[147,2],[150,3],[154,3],[151,1],[151,2],[151,2],[151,3],[151,4],[151,2],[151,6],[151,1],[93,1],[93,1],[165,4],[166,4],[166,6],[171,1],[171,1],[171,1],[171,1],[158,2],[79,1],[79,1],[79,1],[68,2],[176,1],[176,5],[179,1],[179,4],[25,3],[182,3],[145,2],[145,2],[188,1],[186,2],[192,2],[190,2],[195,1],[195,1],[196,2],[199,2],[156,2],[156,2],[202,2],[207,1],[207,2],[205,2],[209,2],[211,2],[214,2],[216,2],[219,2],[218,2],[220,1],[220,2],[220,3],[225,1],[225,1],[225,4],[226,1],[226,2],[187,3],[187,3],[203,3],[203,3],[200,1],[200,1],[212,1],[212,1],[234,1],[235,1],[235,1],[139,1],[139,1],[44,1],[236,1],[236,1],[236,1],[236,1],[46,1],[238,2],[241,2],[239,2],[245,2],[243,1],[243,3],[243,4],[247,2],[253,2],[253,2],[253,2],[251,2],[261,2],[259,2],[259,2],[259,2],[259,1],[264,1],[264,1],[264,1],[264,1],[264,1],[264,1],[264,1],[77,3],[67,1],[67,2],[67,4],[67,4],[67,6],[67,8],[67,8],[67,2],[67,4],[67,2],[67,4],[67,3],[267,5],[267,5],[267,6],[288,4],[172,1],[172,2],[172,3],[172,1],[172,1],[172,1],[172,1],[172,1],[172,1],[255,1],[255,1],[255,1],[257,1],[257,1],[257,1],[291,1],[291,1],[291,1],[291,1],[55,1],[55,1],[307,1],[307,1],[237,1],[237,1],[311,5],[173,5],[313,1],[313,1],[313,1],[313,1],[313,1],[315,1],[315,1],[315,1],[185,1],[185,1],[185,1],[316,3],[319,3],[266,5],[320,1],[320,1],[320,1],[223,1],[223,1],[321,0],[321,1],[5,1],[5,1],[5,1],[9,0],[9,1],[322,1],[322,1],[10,0],[10,2],[18,0],[18,2],[22,0],[22,2],[26,0],[26,2],[27,0],[27,2],[30,0],[30,1],[323,1],[323,2],[33,1],[33,1],[34,0],[34,2],[35,0],[35,1],[37,0],[37,2],[40,1],[40,2],[324,1],[324,1],[42,0],[42,1],[50,0],[50,1],[51,0],[51,1],[54,0],[54,1],[56,0],[56,1],[58,0],[58,1],[59,0],[59,1],[60,0],[60,1],[61,0],[61,1],[65,1],[65,2],[71,1],[71,2],[74,1],[74,2],[88,0],[88,2],[90,0],[90,2],[91,1],[91,2],[92,0],[92,2],[95,1],[95,2],[97,0],[97,4],[99,0],[99,2],[101,0],[101,1],[102,0],[102,1],[103,1],[103,1],[104,0],[104,1],[106,1],[106,1],[106,1],[107,0],[107,1],[111,0],[111,1],[117,0],[117,1],[119,0],[119,2],[124,0],[124,1],[129,0],[129,1],[133,0],[133,1],[134,1],[134,1],[134,1],[136,0],[136,1],[137,0],[137,2],[140,0],[140,1],[141,0],[141,1],[142,0],[142,1],[144,0],[144,3],[146,0],[146,1],[148,0],[148,1],[149,0],[149,2],[152,0],[152,1],[153,0],[153,1],[155,0],[155,3],[157,0],[157,1],[162,0],[162,1],[167,0],[167,2],[168,0],[168,2],[169,1],[169,2],[170,0],[170,2],[175,0],[175,3],[177,0],[177,1],[178,0],[178,3],[180,0],[180,3],[181,0],[181,1],[183,0],[183,3],[184,0],[184,1],[189,0],[189,1],[191,0],[191,2],[194,0],[194,1],[198,0],[198,3],[201,0],[201,1],[204,0],[204,1],[206,0],[206,2],[208,1],[208,1],[210,0],[210,3],[213,0],[213,1],[215,0],[215,3],[217,0],[217,3],[339,1],[339,1],[339,1],[221,0],[221,1],[222,0],[222,1],[227,0],[227,3],[228,0],[228,1],[230,1],[230,2],[233,1],[233,2],[240,0],[240,2],[244,0],[244,2],[248,1],[248,1],[248,1],[248,1],[248,1],[248,1],[249,0],[249,1],[252,0],[252,2],[254,1],[254,1],[256,0],[256,2],[258,0],[258,2],[260,0],[260,2],[262,1],[262,1],[275,1],[275,1],[275,1],[275,1],[275,1],[278,0],[278,1],[281,0],[281,1],[282,1],[282,1],[284,0],[284,1],[286,0],[286,1],[287,0],[287,1]],performAction:function(Be,Ze,pt,Vt,Ht,B,dn){var z=B.length-1;switch(Ht){case 1:if(B[z-1]=B[z-1]||{},ii.base&&(B[z-1].base=ii.base),ii.base="",B[z-1].prefixes=ii.prefixes,ii.prefixes=null,ii.pathOnly){if("path"===B[z-1].type||"termType"in B[z-1])return B[z-1];throw new Error("Received full SPARQL query in path only mode")}if("path"===B[z-1].type||"termType"in B[z-1])throw new Error("Received only path in full SPARQL mode");if("update"===B[z-1].type){const Li={};for(const Ki of B[z-1].updates)if("insert"===Ki.updateType){const Ai={};for(const Fi of Ki.insert)if("bgp"===Fi.type||"graph"===Fi.type)for(const An of Fi.triples)"BlankNode"===An.subject.termType&&(Ai[An.subject.value]=!0),"BlankNode"===An.predicate.termType&&(Ai[An.predicate.value]=!0),"BlankNode"===An.object.termType&&(Ai[An.object.value]=!0);for(const Fi of Object.keys(Ai)){if(Li[Fi])throw new Error("Detected reuse blank node across different INSERT DATA clauses");Li[Fi]=!0}}}return B[z-1];case 2:this.$={...B[z-1],...B[z],type:"query"};break;case 4:ii.base=v(B[z]);break;case 5:ii.prefixes||(ii.prefixes={}),B[z-1]=B[z-1].substr(0,B[z-1].length-1),B[z]=v(B[z]),ii.prefixes[B[z-1]]=B[z];break;case 6:this.$={...B[z-3],...tt(B[z-2]),...B[z-1],...B[z]};break;case 7:if(!ii.skipValidation&&(xt(B[z-3].variables.map(Ki=>ut(Ki.expression))).some(Ki=>"count"===Ki.aggregation&&!(Ki.expression instanceof Wn))||B[z].group))for(const Ki of B[z-3].variables)if("Variable"===Ki.termType){if(!B[z].group||!B[z].group.map(Ai=>be(Ai)).includes(be(Ki)))throw Error("Projection of ungrouped variable (?"+be(Ki)+")")}else if(0===ut(Ki.expression).length){const Ai=nt(Ki.expression);for(const Fi of Ai)if(!B[z].group||!B[z].group.map||!B[z].group.map(An=>be(An)).includes(be(Fi)))throw Error("Use of ungrouped variable in projection of operation (?"+be(Fi)+")")}const Jn=B[z-1].where.filter(Li=>"query"===Li.type);if(Jn.length>0){const Li=B[z-3].variables.filter(Ai=>Ai.variable&&Ai.variable.value).map(Ai=>Ai.variable.value),Ki=xt(Jn.map(Ai=>Ai.variables)).map(Ai=>Ai.value||Ai.variable.value);for(const Ai of Li)if(Ki.indexOf(Ai)>=0)throw Error("Target id of 'AS' (?"+Ai+") already used in subquery")}this.$=b(B[z-3],tt(B[z-2]),B[z-1],B[z]);break;case 8:this.$=b({queryType:"CONSTRUCT",template:B[z-3]},tt(B[z-2]),B[z-1],B[z]);break;case 9:this.$=b({queryType:"CONSTRUCT",template:B[z-2]=B[z-2]?B[z-2].triples:[]},tt(B[z-5]),{where:[{type:"bgp",triples:a([],B[z-2])}]},B[z]);break;case 10:this.$=b({queryType:"DESCRIBE",variables:"*"===B[z-3]?[new Wn]:B[z-3]},tt(B[z-2]),B[z-1],B[z]);break;case 11:this.$=b({queryType:"ASK"},tt(B[z-2]),B[z-1],B[z]);break;case 12:this.$=b(B[z-1],{variables:[new Wn]});break;case 13:const pr=function Wi(Ge){const Be=Ge.slice().sort(),Ze=[];for(let pt=0;pt<Be.length-1;pt++)Be[pt+1]==Be[pt]&&Ze.push(Be[pt]);return Ze}(B[z].map(Li=>Li.value||Li.variable.value));if(pr.length>0)throw Error("Two or more of the resulting columns have the same name (?"+pr[0]+")");this.$=b(B[z-1],{variables:B[z]});break;case 14:this.$=b({queryType:"SELECT"},B[z]&&(B[z-1]=i(B[z]),B[z]={},B[z][B[z-1]]=!0,B[z]));break;case 16:case 27:this.$=ve(B[z-3],{variable:B[z-1]});break;case 17:case 18:this.$=b(B[z-3],B[z-2],B[z-1],B[z],{type:"query"});break;case 19:case 58:this.$={iri:B[z],named:!!B[z-1]};break;case 20:this.$={where:B[z].patterns};break;case 21:this.$=b(B[z-1],B[z]);break;case 22:this.$=b(B[z-2],B[z-1],B[z]);break;case 23:this.$={group:B[z]};break;case 24:case 25:case 28:case 31:case 33:case 34:this.$=ve(B[z]);break;case 26:this.$=ve(B[z-1]);break;case 29:this.$={having:B[z]};break;case 30:this.$={order:B[z]};break;case 32:this.$=ve(B[z],{descending:!0});break;case 35:this.$={limit:_t(B[z])};break;case 36:this.$={offset:_t(B[z])};break;case 37:this.$={limit:_t(B[z-2]),offset:_t(B[z])};break;case 38:this.$={limit:_t(B[z]),offset:_t(B[z-2])};break;case 39:case 43:this.$={type:"values",values:B[z]};break;case 40:case 84:this.$=B[z-1].map(Li=>({[B[z-3]]:Li}));break;case 41:case 85:this.$=B[z-1].map(()=>({}));break;case 42:case 86:var Mn=B[z-4].length;B[z-4]=B[z-4].map(W),this.$=B[z-1].map(function(Li){if(Li.length!==Mn)throw Error("Inconsistent VALUES length");for(var Ki={},Ai=0;Ai<Mn;Ai++)Ki["?"+B[z-4][Ai].value]=Li[Ai];return Ki});break;case 44:case 65:case 100:case 126:case 175:this.$=B[z-1];break;case 45:this.$={type:"update",updates:l(B[z-2],B[z-1])};break;case 46:this.$=b({type:"load",silent:!!B[z-2],source:B[z-1]},B[z]&&{destination:B[z]});break;case 47:this.$={type:i(B[z-2]),silent:!!B[z-1],graph:B[z]};break;case 48:this.$={type:i(B[z-4]),silent:!!B[z-3],source:B[z-2],destination:B[z]};break;case 49:this.$={type:"create",silent:!!B[z-2],graph:{type:"graph",name:B[z]}};break;case 50:this.$={updateType:"insert",insert:Kn(B[z])};break;case 51:this.$={updateType:"delete",delete:Rn(Kn(B[z]))};break;case 52:this.$={updateType:"deletewhere",delete:Rn(B[z])};break;case 53:this.$={updateType:"insertdelete",...B[z-4],...B[z-3],...tt(B[z-2],"using"),where:B[z].patterns};break;case 54:case 57:case 62:case 167:case 191:case 236:this.$=B[z];break;case 55:this.$={delete:Rn(B[z-1]),insert:B[z]||[]};break;case 56:this.$={delete:[],insert:B[z]};break;case 59:this.$={graph:B[z]};break;case 60:this.$={type:"graph",default:!0};break;case 61:case 63:this.$={type:"graph",name:B[z]};break;case 64:this.$={[i(B[z])]:!0};break;case 66:this.$=B[z-1]?C(B[z],[B[z-1]]):C(B[z]);break;case 67:var Or=b(B[z-3]||{triples:[]},{type:"graph",name:B[z-5]});this.$=B[z]?[Or,B[z]]:[Or];break;case 68:case 73:this.$={type:"bgp",triples:C(B[z-2],[B[z-1]])};break;case 69:this.$={type:"group",patterns:[B[z-1]]};break;case 70:for(const Li of B[z-1].filter(Ki=>"bind"===Ki.type)){const Ki=B[z-1].indexOf(Li),Ai=new Set;for(const Fi of B[z-1].slice(0,Ki))("group"===Fi.type||"bgp"===Fi.type)&&ti(Fi).forEach(An=>Ai.add(An));if(Ai.has(Li.variable.value))throw Error("Variable used to bind is already bound (?"+Li.variable.value+")")}this.$={type:"group",patterns:B[z-1]};break;case 71:this.$=B[z-1]?C([B[z-1]],B[z]):C(B[z]);break;case 72:this.$=B[z]?[B[z-2],B[z]]:B[z-2];break;case 75:this.$=b(B[z],{type:"optional"});break;case 76:this.$=b(B[z],{type:"minus"});break;case 77:this.$=b(B[z],{type:"graph",name:B[z-1]});break;case 78:this.$=b(B[z],{type:"service",name:B[z-1],silent:!!B[z-2]});break;case 79:this.$={type:"filter",expression:B[z]};break;case 80:this.$={type:"bind",variable:B[z-1],expression:B[z-3]};break;case 89:this.$=Qi(B[z]);break;case 90:this.$=void 0;break;case 91:this.$=B[z-1].length?{type:"union",patterns:C(B[z-1].map(yt),[yt(B[z])])}:B[z];break;case 95:this.$={...B[z],function:B[z-1]};break;case 96:this.$={type:"functionCall",args:[]};break;case 97:this.$={type:"functionCall",args:l(B[z-2],B[z-1]),distinct:!!B[z-3]};break;case 98:case 115:case 128:case 247:case 249:case 251:case 253:case 255:case 263:case 267:case 297:case 299:case 303:case 307:case 328:case 341:case 349:case 355:case 361:case 367:case 369:case 373:case 375:case 379:case 381:case 385:case 391:case 395:case 401:case 405:case 409:case 411:case 420:case 428:case 430:case 440:case 444:case 446:case 448:this.$=[];break;case 99:this.$=l(B[z-2],B[z-1]);break;case 101:this.$=C(B[z-2],[B[z-1]]);break;case 102:case 112:this.$=Dn(B[z].map(Li=>b(an(B[z-1]),Li)));break;case 103:this.$=Dn(a(B[z].map(Li=>b(an(B[z-1].entity),Li)),B[z-1].triples));break;case 105:this.$=C([B[z-1]],B[z]);break;case 106:this.$=C(B[z]);break;case 107:this.$=he(B[z-1],B[z]);break;case 109:case 237:this.$=ii.factory.namedNode(Yn);break;case 110:case 118:this.$=l(B[z-1],B[z]);break;case 111:this.$=B[z]?{annotation:B[z],object:B[z-1]}:B[z-1];break;case 113:this.$=B[z]?Dn(a(B[z].map(Li=>b(an(B[z-1].entity),Li)),B[z-1].triples)):B[z-1].triples;break;case 114:this.$=he(...B[z-1],B[z]);break;case 116:this.$=he(...B[z]);break;case 117:case 159:case 163:this.$=[B[z-1],B[z]];break;case 119:this.$=B[z]?{object:B[z-1],annotation:B[z]}:B[z-1];break;case 120:this.$=B[z-1].length?et("|",l(B[z-1],B[z])):B[z];break;case 121:this.$=B[z-1].length?et("/",l(B[z-1],B[z])):B[z];break;case 122:this.$=B[z]?et(B[z],[B[z-1]]):B[z-1];break;case 123:this.$=B[z-1]?et(B[z-1],[B[z]]):B[z];break;case 125:case 131:this.$=et(B[z-1],[B[z]]);break;case 129:this.$=et("|",l(B[z-2],B[z-1]));break;case 132:case 134:this.$=function F(Ge){var Be=Zn(),Ze=Be,pt=[],Ht=[];Ge.forEach(function(Mn){pt.push(Mn.entity),a(Ht,Mn.triples)});for(var B=0,dn=0,z=pt.length,Vt=Array(2*z);B<z;)Vt[dn++]=an(Ze,ii.factory.namedNode(Hn),pt[B]),Vt[dn++]=an(Ze,ii.factory.namedNode(Pn),Ze=++B<z?Zn():ii.factory.namedNode(Tn));return{entity:Be,triples:a(Vt,Ht)}}(B[z-1]);break;case 133:case 135:this.$=function Z(Ge){var Be=Zn();return{entity:Be,triples:Ge.map(function(Ze){return b(an(Be),Ze)})}}(B[z-1]);break;case 140:this.$={entity:B[z],triples:[]};break;case 145:this.$=W(B[z]);break;case 149:this.$=ii.factory.namedNode(Tn);break;case 151:case 153:case 158:case 162:this.$=Re(B[z-1],B[z]);break;case 152:this.$=["||",B[z]];break;case 154:this.$=["&&",B[z]];break;case 156:this.$=ee(B[z-1],[B[z-2],B[z]]);break;case 157:this.$=ee(B[z-2]?"notin":"in",[B[z-3],B[z]]);break;case 160:this.$=["+",Re(B[z-1],B[z])];break;case 161:var yr=Dt(B[z-1].value.replace("-",""),B[z-1].datatype);this.$=["-",Re(yr,B[z])];break;case 164:this.$=ee("UPLUS",[B[z]]);break;case 165:this.$=ee(B[z-1],[B[z]]);break;case 166:this.$=ee("UMINUS",[B[z]]);break;case 177:this.$=ee(i(B[z-1]));break;case 178:this.$=ee(i(B[z-3]),[B[z-1]]);break;case 179:this.$=Qi(ee(i(B[z-3]),[B[z-1]]));break;case 180:this.$=ee(i(B[z-5]),[B[z-3],B[z-1]]);break;case 181:this.$=ee(i(B[z-7]),[B[z-5],B[z-3],B[z-1]]);break;case 182:this.$=Qi(ee(i(B[z-7]),[B[z-5],B[z-3],B[z-1]]));break;case 183:this.$=ee(i(B[z-1]),B[z]);break;case 184:this.$=ee("bound",[W(B[z-1])]);break;case 185:this.$=ee(B[z-1],[]);break;case 186:this.$=ee(B[z-3],[B[z-1]]);break;case 187:this.$=ee(B[z-2]?"notexists":"exists",[yt(B[z])]);break;case 188:case 189:this.$=ve(B[z-1],{type:"aggregate",aggregation:i(B[z-4]),distinct:!!B[z-2]});break;case 190:this.$=ve(B[z-2],{type:"aggregate",aggregation:i(B[z-5]),distinct:!!B[z-3],separator:"string"==typeof B[z-1]?B[z-1]:" "});break;case 192:this.$=Dt(B[z]);break;case 193:this.$=function Oi(Ge,Be){return ii.factory.literal(Ge,Be)}(B[z-1],i(B[z].substr(1)));break;case 194:this.$=Dt(B[z-2],B[z]);break;case 195:case 204:this.$=Dt(B[z],xn);break;case 196:case 205:this.$=Dt(B[z],sr);break;case 197:case 206:this.$=Dt(i(B[z]),or);break;case 200:this.$=Dt(B[z].toLowerCase(),qn);break;case 201:this.$=Dt(B[z].substr(1),xn);break;case 202:this.$=Dt(B[z].substr(1),sr);break;case 203:this.$=Dt(B[z].substr(1).toLowerCase(),or);break;case 207:case 208:this.$=_(B[z],1);break;case 209:case 210:this.$=_(B[z],3);break;case 211:this.$=ii.factory.namedNode(v(B[z]));break;case 213:var _n=B[z].indexOf(":"),hn=B[z].substr(0,_n),_r=ii.prefixes[hn];if(!_r)throw new Error("Unknown prefix: "+hn);var Zi=v(_r+B[z].substr(_n+1));this.$=ii.factory.namedNode(Zi);break;case 214:if(B[z]=B[z].substr(0,B[z].length-1),!(B[z]in ii.prefixes))throw new Error("Unknown prefix: "+B[z]);Zi=v(ii.prefixes[B[z]]),this.$=ii.factory.namedNode(Zi);break;case 215:this.$=Zn(B[z].replace(/^(_:)/,""));break;case 216:this.$=Zn();break;case 217:case 218:case 232:this.$=Qi(qi(B[z-3],B[z-2],B[z-1]));break;case 230:case 231:this.$=Qi(B[z-1]);break;case 248:case 250:case 252:case 254:case 256:case 260:case 264:case 268:case 270:case 292:case 294:case 296:case 298:case 300:case 302:case 304:case 306:case 329:case 342:case 356:case 368:case 370:case 372:case 374:case 392:case 402:case 425:case 427:case 429:case 431:case 441:case 445:case 447:case 449:B[z-1].push(B[z]);break;case 259:case 269:case 291:case 293:case 295:case 301:case 305:case 371:case 424:case 426:this.$=[B[z]];break;case 308:B[z-3].push(B[z-2]);break;case 350:case 362:case 376:case 380:case 382:case 386:case 396:case 406:case 410:case 412:case 421:B[z-2].push(B[z-1])}},table:[g(R,le,{3:1,4:2,10:3}),{1:[3]},g(Te,[2,307],{5:4,7:5,321:6,214:7,8:8,96:9,215:10,17:11,21:12,97:16,38:17,6:[2,238],13:Ve,16:Ve,45:Ve,197:Ve,224:Ve,229:Ve,308:Ve,24:[1,13],32:[1,14],36:[1,15],41:Ye}),g([6,13,16,24,32,36,41,45,100,110,113,115,116,123,126,131,197,224,229,308,329,330,331,332,333],[2,3],{322:19,11:20,14:21,12:[1,22],15:[1,23]}),{6:[1,24]},{6:[2,240]},{6:[2,241]},{6:[2,242]},{6:[2,243],9:25,84:26,85:Se},{6:[2,239]},g(ct,[2,411],{216:28,217:29}),g(Ke,[2,249],{18:30}),g(Ke,[2,251],{22:31}),g(X,[2,255],{25:32,27:33,29:[1,34]}),{13:ae,16:se,33:35,39:[1,37],44:39,55:40,87:ge,139:38,307:43,308:we,323:36},g(Ke,[2,267],{37:46}),g(dt,[2,326],{98:47,103:49,106:50,117:55,130:61,100:[1,48],110:[1,51],113:[1,52],115:[1,53],116:[1,54],131:[1,62],329:[1,56],330:[1,57],331:[1,58],332:[1,59],333:[1,60]}),{39:[1,63],40:64,43:65,44:66,45:ze,87:ge},g(Ct,[2,273],{42:68,324:69,325:[1,70],326:[1,71]}),g(R,[2,248]),g(R,[2,245]),g(R,[2,246]),{13:[1,72]},{16:[1,73]},{1:[2,1]},{6:[2,2]},{6:[2,244]},{45:[1,77],85:[1,78],86:74,87:[1,75],89:[1,76]},g([6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],[2,120],{337:[1,79]}),g(Qt,[2,418],{218:80,222:81,229:[1,82]}),{19:83,28:Wt,29:Mt,52:84,53:He,56:85},{19:88,28:Wt,29:Mt,52:89,53:He,56:85},g(Ke,[2,253],{26:90}),{28:[1,91],52:92,53:He},g(Nt,[2,385],{181:93,182:94,183:95,31:[2,383]}),g(ri,[2,263],{34:96}),g(ri,[2,261],{44:39,55:40,307:43,139:97,13:ae,16:se,87:ge,308:we}),g(ri,[2,262]),g(oi,[2,259]),g(Yt,[2,143]),g(Yt,[2,144]),g([6,13,16,28,29,31,39,45,47,48,53,63,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346,347,348,349,350,351],[2,145]),g(Gt,[2,211]),g(Gt,[2,212]),g(Gt,[2,213]),g(Gt,[2,214]),{19:98,28:Wt,29:Mt,52:99,53:He,56:85},{6:[2,309],99:100,193:[1,101]},g(li,[2,311],{101:102,328:[1,103]}),g(ci,[2,317],{104:104,328:[1,105]}),g(Kt,[2,322],{107:106,328:[1,107]}),{111:108,112:[2,324],328:[1,109]},{29:It,114:110},{29:It,114:112},{29:It,114:113},{118:114,123:[1,115],125:116,126:vt},g(Jt,[2,315]),g(Jt,[2,316]),g(wt,[2,319]),g(wt,[2,320]),g(wt,[2,321]),g(dt,[2,327]),{13:ae,16:se,55:118,307:43,308:we},g(Ke,[2,12]),g(Ke,[2,13],{44:66,43:119,45:ze,87:ge}),g(Ne,[2,269]),g(Ne,[2,15]),{13:ae,16:se,44:136,45:me,46:120,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},g(Ct,[2,14]),g(Ct,[2,274]),g(Ct,[2,271]),g(Ct,[2,272]),g(R,[2,4]),{13:[1,177]},g(rt,[2,39]),{29:[1,178]},{29:[1,179]},{87:[1,181],91:180},{45:[1,187],87:[1,185],89:[1,186],93:182,165:183,166:184},g(ct,[2,410]),g([6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337],[2,121],{338:[1,188]}),{13:ae,16:se,45:[1,193],55:194,197:mt,219:189,220:190,223:191,224:[1,192],307:43,308:we},g(Qt,[2,419]),g(bt,ai,{20:196,59:197,69:198,70:Tt}),g(Ke,[2,250]),{29:Rt,57:200},g(li,[2,279],{54:202,327:[1,203]}),{29:[2,282]},g(qt,zt,{23:204,58:205,62:206,63:hi}),g(Ke,[2,252]),{19:208,28:Wt,29:Mt,52:209,53:He,56:85},{29:[1,210]},g(X,[2,256]),{31:[1,211]},{31:[2,384]},{13:ae,16:se,44:215,45:ki,55:220,82:de,87:ge,89:yi,145:212,172:221,185:213,187:214,231:Ni,236:216,237:222,255:154,257:155,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,309:fi,310:pi,311:217,312:di},g(gi,[2,265],{56:85,35:227,52:228,19:229,28:Wt,29:Mt,53:He}),g(oi,[2,260]),g(qt,zt,{58:205,62:206,23:230,63:hi}),g(Ke,[2,268]),{6:[2,45]},g(R,le,{10:3,4:231}),{13:ae,16:se,55:232,307:43,308:we},g(li,[2,312]),{105:233,112:xi,122:234,132:[1,237],134:235,327:[1,238],334:[1,239]},g(ci,[2,318]),g(li,Di,{108:240,133:242,112:Ii,132:vi}),g(Kt,[2,323]),{112:[1,244]},{112:[2,325]},g(mi,[2,50]),g(Nt,en,{135:245,136:246,143:247,144:248,31:tn,112:tn}),g(mi,[2,51]),g(mi,[2,52]),g(si,[2,328],{119:249}),{29:It,114:250},g(si,[2,56]),{29:It,114:251},g(dt,[2,59]),g(Ne,[2,270]),{47:[1,252]},g(nn,[2,150]),g(cn,[2,428],{240:253}),g(Si,[2,430],{244:254}),g(Si,[2,155],{248:255,249:256,250:[2,438],290:[1,257],341:[1,258],342:[1,259],343:[1,260],344:[1,261],345:[1,262],346:[1,263]}),g(_i,[2,440],{252:264}),g(wi,[2,448],{260:265}),{13:ae,16:se,44:136,45:me,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,255:154,257:155,264:266,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},{13:ae,16:se,44:136,45:me,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,255:154,257:155,264:267,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},{13:ae,16:se,44:136,45:me,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,255:154,257:155,264:268,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},g(wi,[2,167]),g(wi,[2,168]),g(wi,[2,169]),g(wi,[2,170],{176:269,45:Xi,89:Vi}),g(wi,[2,171]),g(wi,[2,172]),g(wi,[2,173]),g(wi,[2,174]),{13:ae,16:se,44:136,45:me,46:272,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},g(ei,[2,176]),{89:[1,273]},{45:[1,274]},{45:[1,275]},{45:[1,276]},{45:[1,277]},{45:[1,278]},{45:Ji,89:Gi,179:279},{45:[1,282]},{45:[1,284],89:[1,283]},{279:[1,285]},g(Ut,[2,192],{292:[1,286],293:[1,287]}),g(Ut,[2,195]),g(Ut,[2,196]),g(Ut,[2,197]),g(Ut,[2,198]),g(Ut,[2,199]),g(Ut,[2,200]),{13:ae,16:se,44:39,55:40,82:de,87:ge,139:289,172:291,255:154,257:155,266:290,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,320:288},{45:[1,292]},{45:[1,293]},{45:[1,294]},g($i,[2,452]),g($i,[2,453]),g($i,[2,454]),g($i,[2,455]),g($i,[2,456]),{279:[2,458]},g(Bi,[2,207]),g(Bi,[2,208]),g(Bi,[2,209]),g(Bi,[2,210]),g(Ut,[2,201]),g(Ut,[2,202]),g(Ut,[2,203]),g(Ut,[2,204]),g(Ut,[2,205]),g(Ut,[2,206]),g(R,[2,5]),g(Q,[2,297],{88:295}),g(u,[2,299],{90:296}),{48:[1,297],87:[1,298]},g(d,[2,301]),g(rt,[2,43]),g(rt,[2,82]),g(rt,[2,83]),{29:[1,299]},{29:[1,300]},{87:[1,302],169:301},g(ct,[2,412]),g(O,[2,123]),g(O,[2,416],{221:303,339:304,39:[1,306],263:[1,307],340:[1,305]}),g(T,[2,124]),{13:ae,16:se,45:[1,311],55:194,89:[1,310],197:mt,223:312,225:308,226:309,229:N,307:43,308:we},g(ct,Ve,{215:10,214:314}),g(T,[2,236]),g(T,[2,237]),g($,[2,6]),g(re,[2,287],{60:315,72:316,73:[1,317]}),g(bt,[2,286]),{13:ae,16:se,45:me,55:323,67:321,68:322,71:318,77:320,79:319,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,307:43,308:we,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},g([6,31,63,70,73,81,83,85],[2,20]),g(Nt,ce,{38:17,49:324,147:325,17:326,21:327,148:328,154:329,155:330,29:Ce,31:Ce,85:Ce,112:Ce,159:Ce,160:Ce,161:Ce,163:Ce,164:Ce,41:Ye}),{13:ae,16:se,55:331,307:43,308:we},g(li,[2,280]),g($,[2,7]),g(bt,ai,{59:197,69:198,20:332,70:Tt}),g(qt,[2,284]),{64:[1,333]},g(qt,zt,{58:205,62:206,23:334,63:hi}),g(Ke,[2,254]),g(Nt,en,{144:248,30:335,143:336,31:[2,257]}),g(Ke,[2,100]),{31:[2,387],184:337,335:[1,338]},{13:ae,16:se,44:39,55:40,87:ge,139:342,186:339,190:340,195:341,197:je,307:43,308:we},g(ot,[2,389],{44:39,55:40,307:43,190:340,195:341,139:342,188:344,189:345,186:346,13:ae,16:se,87:ge,197:je,308:we}),g(gt,[2,227]),g(gt,[2,228]),g(gt,[2,229]),{13:ae,16:se,44:215,45:ki,55:220,82:de,87:ge,89:yi,172:221,185:351,187:350,200:348,230:347,231:Ni,234:349,236:216,237:222,255:154,257:155,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,309:fi,310:pi,311:217,312:di},{13:ae,16:se,44:39,55:40,87:ge,139:342,186:352,190:340,195:341,197:je,307:43,308:we},g(gt,[2,146]),g(gt,[2,147]),g(gt,[2,148]),g(gt,[2,149]),{13:ae,16:se,44:354,55:355,82:de,87:ge,172:357,237:356,255:154,257:155,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,309:fi,310:pi,311:358,312:di,313:353},g(ht,[2,215]),g(ht,[2,216]),g(qt,zt,{58:205,62:206,23:359,63:hi}),g(ri,[2,264]),g(gi,[2,266]),g($,[2,11]),g(Te,[2,308],{6:[2,310]}),g(mi,[2,313],{102:360,120:361,121:[1,362]}),g(mi,[2,47]),g(mi,[2,63]),g(mi,[2,64]),{13:ae,16:se,55:363,307:43,308:we},g(mi,[2,336]),g(mi,[2,337]),g(mi,[2,338]),{109:[1,364]},g(jt,[2,60]),{13:ae,16:se,55:365,307:43,308:we},g(li,[2,335]),{13:ae,16:se,55:366,307:43,308:we},{31:[1,367]},g(Ci,[2,341],{137:368}),g(Ci,[2,340]),{13:ae,16:se,44:215,45:ki,55:220,82:de,87:ge,89:yi,145:369,172:221,185:213,187:214,231:Ni,236:216,237:222,255:154,257:155,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,309:fi,310:pi,311:217,312:di},{28:[1,370],127:371,128:[1,372]},g(si,[2,330],{124:373,125:374,126:vt}),g(si,[2,57]),{44:375,87:ge},g(nn,[2,151],{241:376,242:[1,377]}),g(cn,[2,153],{245:378,246:[1,379]}),{13:ae,16:se,44:136,45:me,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,247:380,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},{250:[1,381]},g($t,[2,432]),g($t,[2,433]),g($t,[2,434]),g($t,[2,435]),g($t,[2,436]),g($t,[2,437]),{250:[2,439]},g([47,48,193,242,246,250,272,290,341,342,343,344,345,346],[2,158],{253:382,254:383,255:384,257:385,263:[1,386],265:[1,387],297:L,298:K,299:J,300:fe,301:Oe,302:Le}),g(_i,[2,162],{261:388,262:389,39:zi,338:pn}),g(wi,[2,164]),g(wi,[2,165]),g(wi,[2,166]),g(ei,[2,95]),g(ei,[2,96]),g($t,[2,377],{177:392,325:[1,393]}),{48:[1,394]},g(ei,[2,177]),{13:ae,16:se,44:136,45:me,46:395,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},{13:ae,16:se,44:136,45:me,46:396,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},{13:ae,16:se,44:136,45:me,46:397,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},{13:ae,16:se,44:136,45:me,46:398,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},{13:ae,16:se,44:136,45:me,46:399,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},g(ei,[2,183]),g(ei,[2,98]),g($t,[2,381],{180:400}),{87:[1,401]},g(ei,[2,185]),{13:ae,16:se,44:136,45:me,46:402,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},{29:Rt,57:403},g(Ut,[2,193]),{13:ae,16:se,55:404,307:43,308:we},{13:ae,16:se,44:39,55:40,87:ge,139:342,195:405,197:je,307:43,308:we},g(gn,[2,233]),g(gn,[2,234]),g(gn,[2,235]),g(Un,[2,459],{281:406,325:[1,407]}),g($t,[2,463],{284:408,325:[1,409]}),g($t,[2,465],{286:410,325:[1,411]}),{13:ae,16:se,31:[1,412],55:414,82:de,171:413,172:415,173:416,174:Ri,255:154,257:155,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:rn},{31:[1,419],89:[1,420]},{29:[1,421]},g(d,[2,302]),g(Q,[2,367],{167:422}),g(u,[2,369],{168:423}),{48:[1,424],87:[1,425]},g(d,[2,371]),g(O,[2,122]),g(O,[2,417]),g(O,[2,413]),g(O,[2,414]),g(O,[2,415]),g(T,[2,125]),g(T,[2,127]),g(T,[2,128]),g(mn,[2,420],{227:426}),g(T,[2,130]),{13:ae,16:se,55:194,197:mt,223:427,307:43,308:we},{48:[1,428]},g(Yi,[2,289],{61:429,80:430,81:[1,431],83:[1,432]}),g(re,[2,288]),{64:[1,433]},g(bt,[2,29],{307:43,267:139,275:146,278:149,77:320,67:321,68:322,55:323,79:434,13:ae,16:se,45:me,268:it,269:Je,270:qe,271:Pt,273:at,274:St,276:kt,277:Et,279:Lt,280:_e,283:k,285:M,308:we,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt}),g(In,[2,293]),g(jn,[2,92]),g(jn,[2,93]),g(jn,[2,94]),{45:Xi,89:Vi,176:269},{31:[1,435]},{31:[1,436]},{19:437,28:Wt,29:Mt,56:85},{19:438,28:Wt,29:Mt,56:85},g(bn,[2,355],{149:439}),g(bn,[2,354]),{13:ae,16:se,44:215,45:kn,55:220,82:de,87:ge,89:yi,156:440,172:221,185:441,203:442,231:sn,236:216,237:222,255:154,257:155,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,309:fi,310:pi,311:217,312:di},g(ri,[2,19]),g(Yi,[2,21]),{13:ae,16:se,44:450,45:$n,55:323,65:445,66:446,67:447,68:448,87:ge,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,307:43,308:we,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},g($,[2,8]),{31:[1,451]},{31:[2,258]},{31:[2,101]},g(Nt,[2,386],{31:[2,388]}),g(ot,[2,102]),g(Mi,[2,391],{191:452}),g(Nt,[2,395],{196:453,198:454}),g(Nt,[2,108]),g(Nt,[2,109]),g(ot,[2,103]),g(ot,[2,104]),g(ot,[2,390]),{13:ae,16:se,44:215,45:ki,48:[1,455],55:220,82:de,87:ge,89:yi,172:221,185:351,187:350,200:456,231:Ni,234:349,236:216,237:222,255:154,257:155,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,309:fi,310:pi,311:217,312:di},g(fn,[2,424]),g(G,[2,136]),g(G,[2,137]),g(S,[2,140]),{232:[1,457]},{13:ae,16:se,44:39,55:40,87:ge,139:342,195:458,197:je,307:43,308:we},g(gn,[2,219]),g(gn,[2,220]),g(gn,[2,221]),g(gn,[2,222]),g(gn,[2,223]),g($,[2,10]),g(mi,[2,46]),g(mi,[2,314]),{112:xi,122:459},g(mi,[2,62]),g(li,Di,{133:242,108:460,112:Ii,132:vi}),g(jt,[2,61]),g(mi,[2,49]),g([6,28,126,128,193],[2,65]),{31:[2,66],112:[1,462],138:461},g(Ci,[2,351],{146:463,335:[1,464]}),{29:Rt,57:465},g(si,[2,329]),g(li,[2,332],{129:466,327:[1,467]}),g(si,[2,55]),g(si,[2,331]),{48:[1,468]},g(cn,[2,429]),{13:ae,16:se,44:136,45:me,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,239:469,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},g(Si,[2,431]),{13:ae,16:se,44:136,45:me,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,243:470,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},g(Si,[2,156]),{45:Ji,89:Gi,179:471},g(_i,[2,441]),{13:ae,16:se,44:136,45:me,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,251:472,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},g(wi,[2,444],{256:473}),g(wi,[2,446],{258:474}),g($t,[2,442]),g($t,[2,443]),g(wi,[2,449]),{13:ae,16:se,44:136,45:me,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,255:154,257:155,259:475,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},g($t,[2,450]),g($t,[2,451]),g($t,[2,379],{178:476}),g($t,[2,378]),g([6,13,16,29,31,39,45,47,48,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,338,341,342,343,344,345,346,347,348,349,350,351],[2,175]),{48:[1,477]},{48:[1,478]},{272:[1,479]},{272:[1,480]},{272:[1,481]},{13:ae,16:se,44:136,45:me,46:482,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},{48:[1,483]},{48:[1,484]},g(ei,[2,187]),g(Ut,[2,194]),{13:ae,16:se,44:39,55:40,82:de,87:ge,139:289,172:291,255:154,257:155,266:290,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,320:485},{13:ae,16:se,39:[1,487],44:136,45:me,46:488,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,282:486,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},g(Un,[2,460]),{13:ae,16:se,44:136,45:me,46:489,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},g($t,[2,464]),{13:ae,16:se,44:136,45:me,46:490,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},g($t,[2,466]),g(rt,[2,40]),g(Q,[2,298]),g(A,[2,87]),g(A,[2,88]),g(A,[2,89]),g(A,[2,90]),{13:ae,16:se,55:492,82:de,172:493,255:154,257:155,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,311:494,312:di,315:491},g(rt,[2,41]),g(u,[2,300]),g(q,[2,303],{92:495}),{13:ae,16:se,31:[1,496],55:414,82:de,171:497,172:415,173:416,174:Ri,255:154,257:155,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:rn},{31:[1,498],89:[1,499]},{29:[1,500]},g(d,[2,372]),{13:ae,16:se,48:[2,422],55:194,197:mt,223:312,226:502,228:501,229:N,307:43,308:we},g(T,[2,131]),g(T,[2,126]),g(Yi,[2,22]),g(Yi,[2,290]),{82:[1,503]},{82:[1,504]},{13:ae,16:se,44:510,45:me,55:323,67:321,68:322,74:505,75:506,76:ie,77:320,78:xe,79:509,87:ge,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,307:43,308:we,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},g(In,[2,294]),g(ke,[2,69]),g(ke,[2,70]),g(bt,ai,{59:197,69:198,20:511,70:Tt}),g(qt,zt,{58:205,62:206,23:512,63:hi}),{29:[2,375],31:[2,71],84:522,85:Se,112:[1,518],150:513,151:514,158:515,159:[1,516],160:[1,517],161:[1,519],163:[1,520],164:[1,521],175:523},g(bn,[2,363],{157:524,335:[1,525]}),g(ct,Ve,{215:10,202:526,205:527,208:528,214:529,44:530,87:ge}),g(Xe,[2,399],{215:10,205:527,208:528,214:529,44:530,204:531,202:532,13:Ve,16:Ve,45:Ve,197:Ve,224:Ve,229:Ve,308:Ve,87:ge}),{13:ae,16:se,44:215,45:kn,55:220,82:de,87:ge,89:yi,172:221,185:351,203:536,212:534,231:sn,233:533,234:535,236:216,237:222,255:154,257:155,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,309:fi,310:pi,311:217,312:di},g(ct,Ve,{215:10,205:527,208:528,214:529,44:530,202:537,87:ge}),g(qt,[2,23],{307:43,267:139,275:146,278:149,55:323,67:447,68:448,44:450,66:538,13:ae,16:se,45:$n,87:ge,268:it,269:Je,270:qe,271:Pt,273:at,274:St,276:kt,277:Et,279:Lt,280:_e,283:k,285:M,308:we,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt}),g(Qe,[2,291]),g(Qe,[2,24]),g(Qe,[2,25]),{13:ae,16:se,44:136,45:me,46:539,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},g(Qe,[2,28]),g(qt,zt,{58:205,62:206,23:540,63:hi}),g([31,112,232,318,335],[2,105],{192:541,193:[1,542]}),g(Mi,[2,107]),{13:ae,16:se,44:215,45:ki,55:220,82:de,87:ge,89:yi,172:221,185:351,187:350,199:543,200:544,231:Ni,234:349,236:216,237:222,255:154,257:155,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,309:fi,310:pi,311:217,312:di},g(Ot,[2,132]),g(fn,[2,425]),g(Ot,[2,133]),{13:ae,16:se,44:354,55:355,82:de,87:ge,172:357,237:356,255:154,257:155,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,309:fi,310:pi,311:358,312:di,313:545},g(mi,[2,54]),g(mi,[2,48]),g(Ci,[2,342]),{13:ae,16:se,44:39,55:40,87:ge,139:546,307:43,308:we},g(Ci,[2,68]),g(Nt,[2,350],{31:Ft,112:Ft}),g(mi,[2,53]),{13:ae,16:se,55:547,307:43,308:we},g(li,[2,333]),g(Ne,[2,16]),g(cn,[2,152]),g(Si,[2,154]),g(Si,[2,157]),g(_i,[2,159]),g(_i,[2,160],{262:389,261:548,39:zi,338:pn}),g(_i,[2,161],{262:389,261:549,39:zi,338:pn}),g(wi,[2,163]),{13:ae,16:se,44:136,45:me,46:550,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},g(ei,[2,178]),g(ei,[2,179]),{13:ae,16:se,44:136,45:me,46:551,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},{13:ae,16:se,44:136,45:me,46:552,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},{13:ae,16:se,44:136,45:me,46:553,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},{48:[1,554],272:[1,555]},g(ei,[2,184]),g(ei,[2,186]),{314:[1,556]},{48:[1,557]},{48:[2,461]},{48:[2,462]},{48:[1,558]},{48:[2,467],193:[1,561],287:559,288:560},{13:ae,16:se,55:194,197:mt,223:562,307:43,308:we},g(bi,[2,224]),g(bi,[2,225]),g(bi,[2,226]),{31:[1,563],45:on,94:564},g(rt,[2,84]),g(Q,[2,368]),g(rt,[2,85]),g(u,[2,370]),g(q,[2,373],{170:566}),{48:[1,567]},{48:[2,423],337:[1,568]},g(Yi,[2,35],{83:[1,569]}),g(Yi,[2,36],{81:[1,570]}),g(re,[2,30],{307:43,267:139,275:146,278:149,77:320,67:321,68:322,55:323,79:509,44:510,75:571,13:ae,16:se,45:me,76:ie,78:xe,87:ge,268:it,269:Je,270:qe,271:Pt,273:at,274:St,276:kt,277:Et,279:Lt,280:_e,283:k,285:M,308:we,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt}),g(Hi,[2,295]),{45:me,77:572},{45:me,77:573},g(Hi,[2,33]),g(Hi,[2,34]),{31:[2,275],50:574,84:575,85:Se},{31:[2,277],51:576,84:577,85:Se},g(bn,[2,356]),g(On,[2,357],{152:578,335:[1,579]}),g(Ti,[2,74]),{29:Rt,57:580},{29:Rt,57:581},{13:ae,16:se,44:39,55:40,87:ge,139:582,307:43,308:we},g(Nn,[2,365],{162:583,328:[1,584]}),{13:ae,16:se,45:me,55:323,67:321,68:322,77:320,79:585,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,307:43,308:we,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},{45:[1,586]},g(Ti,[2,81]),{29:Rt,57:587},g(bn,[2,73]),g(Nt,[2,362],{29:un,31:un,85:un,112:un,159:un,160:un,161:un,163:un,164:un}),g(Xe,[2,112]),g(zn,[2,401],{206:588}),g(Nt,[2,405],{209:589,210:590}),g(Nt,[2,403]),g(Nt,[2,404]),g(Xe,[2,113]),g(Xe,[2,400]),{13:ae,16:se,44:215,45:kn,48:[1,591],55:220,82:de,87:ge,89:yi,172:221,185:351,203:536,212:592,231:sn,234:535,236:216,237:222,255:154,257:155,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,309:fi,310:pi,311:217,312:di},g(fn,[2,426]),g(S,[2,138]),g(S,[2,139]),{232:[1,593]},g(Qe,[2,292]),{47:[1,595],48:[1,594]},g($,[2,9]),g(Mi,[2,392]),g(Mi,[2,393],{44:39,55:40,307:43,195:341,139:342,194:596,190:597,13:ae,16:se,87:ge,197:je,308:we}),g(Mi,[2,110],{272:[1,598]}),g(yn,[2,397],{201:599,316:600,317:[1,601]}),{314:[1,602]},{29:[1,603]},g(si,[2,58]),g(wi,[2,445]),g(wi,[2,447]),{48:[1,604],272:[1,605]},{48:[1,606]},{272:[1,607]},{272:[1,608]},g(ei,[2,99]),g($t,[2,382]),g([13,16,39,47,48,87,193,197,242,246,250,263,265,272,290,297,298,299,300,301,302,308,314,338,341,342,343,344,345,346],[2,232]),g(ei,[2,188]),g(ei,[2,189]),{48:[1,609]},{48:[2,468]},{289:[1,610]},{13:ae,16:se,55:492,82:de,172:493,255:154,257:155,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,311:494,312:di,315:611},g(rt,[2,42]),g(q,[2,304]),{13:ae,16:se,55:414,82:de,95:612,171:613,172:415,173:416,174:Ri,255:154,257:155,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:rn},{31:[1,614],45:on,94:615},g(T,[2,129]),g(mn,[2,421]),{82:[1,616]},{82:[1,617]},g(Hi,[2,296]),g(Hi,[2,31]),g(Hi,[2,32]),{31:[2,17]},{31:[2,276]},{31:[2,18]},{31:[2,278]},g(Nt,ce,{155:330,153:618,154:619,29:ln,31:ln,85:ln,112:ln,159:ln,160:ln,161:ln,163:ln,164:ln}),g(On,[2,358]),g(Ti,[2,75]),g(Ti,[2,76]),{29:Rt,57:620},{13:ae,16:se,44:39,55:40,87:ge,139:621,307:43,308:we},g(Nn,[2,366]),g(Ti,[2,79]),{13:ae,16:se,44:136,45:me,46:622,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},g(Ti,[2,91],{336:[1,623]}),g([29,31,85,112,159,160,161,163,164,232,318,335],[2,114],{207:624,193:[1,625]}),g(zn,[2,117]),{13:ae,16:se,44:215,45:kn,55:220,82:de,87:ge,89:yi,172:221,185:351,203:536,211:626,212:627,231:sn,234:535,236:216,237:222,255:154,257:155,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,309:fi,310:pi,311:217,312:di},g(gt,[2,134]),g(fn,[2,427]),g(gt,[2,135]),g(Qe,[2,26]),{44:628,87:ge},g(Mi,[2,106]),g(Mi,[2,394]),g(Nt,[2,396]),g(yn,[2,111]),g(yn,[2,398]),{13:ae,16:se,44:39,55:40,87:ge,139:342,186:629,190:340,195:341,197:je,307:43,308:we},g(ht,[2,217]),g(Nt,en,{144:248,140:630,143:631,31:[2,343]}),g(ei,[2,97]),g($t,[2,380]),g(ei,[2,180]),{13:ae,16:se,44:136,45:me,46:632,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},{13:ae,16:se,44:136,45:me,46:633,55:133,67:132,68:134,77:131,82:de,87:ge,172:135,224:pe,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ie,264:130,265:Ae,266:137,267:139,268:it,269:Je,270:qe,271:Pt,273:at,274:St,275:146,276:kt,277:Et,278:149,279:Lt,280:_e,283:k,285:M,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:m,346:V,347:ne,348:ue,349:Pe,350:$e,351:lt},g(ei,[2,190]),{290:[1,634]},{314:[1,635]},{13:ae,16:se,48:[1,636],55:414,82:de,171:637,172:415,173:416,174:Ri,255:154,257:155,291:150,294:H,295:Y,296:I,297:L,298:K,299:J,300:fe,301:Oe,302:Le,303:Ee,304:Ue,305:P,306:f,307:43,308:we,312:rn},g(Bn,[2,305]),g(rt,[2,86]),g(q,[2,374]),g(Yi,[2,37]),g(Yi,[2,38]),g(bn,[2,72]),g(bn,[2,360]),g(Ti,[2,77]),{29:Rt,57:638},{47:[1,639]},{29:[2,376]},g(zn,[2,402]),g(zn,[2,115],{215:10,208:528,214:529,44:530,205:640,13:Ve,16:Ve,45:Ve,197:Ve,224:Ve,229:Ve,308:Ve,87:ge}),g(zn,[2,118],{272:[1,641]}),g(Cn,[2,407],{213:642,319:643,317:[1,644]}),{48:[1,645]},{318:[1,646]},{31:[1,647]},{31:[2,344]},{48:[1,648]},{48:[1,649]},{291:650,303:Ee,304:Ue,305:P,306:f},g(A,[2,218]),g(q,[2,44]),g(Bn,[2,306]),g(Ti,[2,78]),{44:651,87:ge},g(zn,[2,116]),g(Nt,[2,406]),g(Cn,[2,119]),g(Cn,[2,408]),g(ct,Ve,{215:10,205:527,208:528,214:529,44:530,202:652,87:ge}),g(Qe,[2,27]),g(yn,[2,230]),g(rr,[2,345],{141:653,335:[1,654]}),g(ei,[2,181]),g(ei,[2,182]),{48:[2,191]},{48:[1,655]},{318:[1,656]},g(Nt,en,{144:248,142:657,143:658,31:Gn,112:Gn}),g(rr,[2,346]),g(Ti,[2,80]),g(Cn,[2,231]),g(Ci,[2,67]),g(Ci,[2,348])],defaultActions:{5:[2,240],6:[2,241],7:[2,242],9:[2,239],24:[2,1],25:[2,2],26:[2,244],87:[2,282],94:[2,384],100:[2,45],109:[2,325],166:[2,458],263:[2,439],336:[2,258],337:[2,101],487:[2,461],488:[2,462],560:[2,468],574:[2,17],575:[2,276],576:[2,18],577:[2,278],623:[2,376],631:[2,344],650:[2,191]},parseError:function(Be,Ze){if(!Ze.recoverable){var pt=new Error(Be);throw pt.hash=Ze,pt}this.trace(Be)},parse:function(Be){var Ze=this,pt=[0],Ht=[null],B=[],dn=this.table,z="",Mn=0,Or=0,yr=0,_r=B.slice.call(arguments,1),Zi=Object.create(this.lexer),Jn={yy:{}};for(var lr in this.yy)Object.prototype.hasOwnProperty.call(this.yy,lr)&&(Jn.yy[lr]=this.yy[lr]);Zi.setInput(Be,Jn.yy),Jn.yy.lexer=Zi,Jn.yy.parser=this,typeof Zi.yylloc>"u"&&(Zi.yylloc={});var pr=Zi.yylloc;B.push(pr);var Li=Zi.options&&Zi.options.ranges;this.parseError="function"==typeof Jn.yy.parseError?Jn.yy.parseError:Object.getPrototypeOf(this).parseError;for(var Fi,An,ar,Ln,Er,hr,nr,xr,Ai=function(){var Fn;return"number"!=typeof(Fn=Zi.lex()||1)&&(Fn=Ze.symbols_[Fn]||Fn),Fn},ir={};;){if(this.defaultActions[ar=pt[pt.length-1]]?Ln=this.defaultActions[ar]:((null===Fi||typeof Fi>"u")&&(Fi=Ai()),Ln=dn[ar]&&dn[ar][Fi]),typeof Ln>"u"||!Ln.length||!Ln[0]){var Sr;for(hr in xr=[],dn[ar])this.terminals_[hr]&&hr>2&&xr.push("'"+this.terminals_[hr]+"'");Sr=Zi.showPosition?"Parse error on line "+(Mn+1)+":\n"+Zi.showPosition()+"\nExpecting "+xr.join(", ")+", got '"+(this.terminals_[Fi]||Fi)+"'":"Parse error on line "+(Mn+1)+": Unexpected "+(1==Fi?"end of input":"'"+(this.terminals_[Fi]||Fi)+"'"),this.parseError(Sr,{text:Zi.match,token:this.terminals_[Fi]||Fi,line:Zi.yylineno,loc:pr,expected:xr})}if(Ln[0]instanceof Array&&Ln.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ar+", token: "+Fi);switch(Ln[0]){case 1:pt.push(Fi),Ht.push(Zi.yytext),B.push(Zi.yylloc),pt.push(Ln[1]),Fi=null,An?(Fi=An,An=null):(Or=Zi.yyleng,z=Zi.yytext,Mn=Zi.yylineno,pr=Zi.yylloc,yr>0&&yr--);break;case 2:if(ir.$=Ht[Ht.length-(nr=this.productions_[Ln[1]][1])],ir._$={first_line:B[B.length-(nr||1)].first_line,last_line:B[B.length-1].last_line,first_column:B[B.length-(nr||1)].first_column,last_column:B[B.length-1].last_column},Li&&(ir._$.range=[B[B.length-(nr||1)].range[0],B[B.length-1].range[1]]),typeof(Er=this.performAction.apply(ir,[z,Or,Mn,Jn.yy,Ln[1],Ht,B].concat(_r)))<"u")return Er;nr&&(pt=pt.slice(0,-1*nr*2),Ht=Ht.slice(0,-1*nr),B=B.slice(0,-1*nr)),pt.push(this.productions_[Ln[1]][0]),Ht.push(ir.$),B.push(ir._$),pt.push(dn[pt[pt.length-2]][pt[pt.length-1]]);break;case 3:return!0}}return!0}},Wn=We(2174).Wildcard,vn="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Yn=vn+"type",Hn=vn+"first",Pn=vn+"rest",Tn=vn+"nil",Vn="http://www.w3.org/2001/XMLSchema#",xn=Vn+"integer",sr=Vn+"decimal",or=Vn+"double",qn=Vn+"boolean",En="",er="",D="";function i(Ge){return Ge.toLowerCase()}function l(Ge,Be){return Ge.push(Be),Ge}function a(Ge,Be){return Ge.push.apply(Ge,Be),Ge}function b(Ge){Ge||(Ge={});for(var pt,Be=1,Ze=arguments.length;Be<Ze&&(pt=arguments[Be]||{});Be++)for(var Vt in pt)Ge[Vt]=pt[Vt];return Ge}function C(){for(var Ge=[],Be=0,Ze=arguments.length;Be<Ze;Be++)Ge=Ge.concat.apply(Ge,arguments[Be]);return Ge}function v(Ge){if("<"===Ge[0]&&(Ge=Ge.substring(1,Ge.length-1)),/^[a-z][a-z0-9.+-]*:/i.test(Ge))return Ge;if(!ii.base)throw new Error("Cannot resolve relative IRI "+Ge+" because no base IRI was set.");switch(En!==ii.base&&(er=(En=ii.base).replace(/[^\/:]*$/,""),D=En.match(/^(?:[a-z]+:\/*)?[^\/]*/)[0]),Ge[0]){case void 0:return En;case"#":return En+Ge;case"?":return En.replace(/(?:\?.*)?$/,Ge);case"/":return D+Ge;default:return er+Ge}}function W(Ge){if(Ge){var Be=Ge[0];if("?"===Be||"$"===Be)return ii.factory.variable(Ge.substr(1))}return Ge}function ee(Ge,Be){return{type:"operation",operator:Ge,args:Be||[]}}function ve(Ge,Be){var Ze={expression:"*"===Ge?new Wn:Ge};if(Be)for(var pt in Be)Ze[pt]=Be[pt];return Ze}function et(Ge,Be){return{type:"path",pathType:Ge,items:Be}}function Re(Ge,Be){for(var Vt,Ze=0,pt=Be.length;Ze<pt&&(Vt=Be[Ze]);Ze++)Ge=ee(Vt[0],[Ge,Vt[1]]);return Ge}function tt(Ge,Be){var Ht,Ze=[],pt=[],Vt=Ge.length,B={};if(!Vt)return null;for(var dn=0;dn<Vt&&(Ht=Ge[dn]);dn++)(Ht.named?pt:Ze).push(Ht.iri);return B[Be||"from"]={default:Ze,named:pt},B}function _t(Ge){return parseInt(Ge,10)}function yt(Ge){return"group"===Ge.type&&1===Ge.patterns.length?Ge.patterns[0]:Ge}function Dt(Ge,Be){return Be&&"NamedNode"!==Be.termType&&(Be=ii.factory.namedNode(Be)),ii.factory.literal(Ge,Be)}function qi(Ge,Be,Ze){if(!("termType"in Be))throw new Error("Nested triples cannot contain paths");return ii.factory.quad(Ge,Be,Ze)}function an(Ge,Be,Ze,pt){var Vt={};return null!=Ge&&(Vt.subject=Ge),null!=Be&&(Vt.predicate=Be),null!=Ze&&(Vt.object=Ze),null!=pt&&(Vt.annotations=pt),Vt}function Zn(Ge){return"string"==typeof Ge?Ge.startsWith("e_")?ii.factory.blankNode(Ge):ii.factory.blankNode("e_"+Ge):ii.factory.blankNode("g_"+tr++)}var tr=0;ii._resetBlanks=function(){tr=0};var Mr=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\(.)/g,w={"\\":"\\","'":"'",'"':'"',t:"\t",b:"\b",n:"\n",r:"\r",f:"\f"},h=/[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/,y=String.fromCharCode;function _(Ge,Be){Ge=Ge.substring(Be,Ge.length-Be);try{Ge=Ge.replace(Mr,function(Ze,pt,Vt,Ht){var B;if(pt){if(B=parseInt(pt,16),isNaN(B))throw new Error;return y(B)}if(Vt){if(B=parseInt(Vt,16),isNaN(B))throw new Error;return B<65535?y(B):y(55296+((B-=65536)>>10),56320+(1023&B))}var dn=w[Ht];if(!dn)throw new Error;return dn})}catch{return""}if(h.exec(Ge))throw new Error("Invalid unicode codepoint of surrogate pair without corresponding codepoint in "+Ge);return Ge}function he(Ge,Be,Ze){var pt=[],Vt=[];return Be.forEach(function(Ht){let B=null;Ht.annotation&&(B=Ht.annotation,Ht=Ht.object),pt.push(an(null,Ge,Ht.entity,B)),a(Vt,Ht.triples)}),C(pt,Ze||[],Vt)}function be(Ge){return Ge.variable?Ge.variable.value:Ge.value||Ge.expression.value}function ut(Ge){if(!Ge)return[];if("aggregate"===Ge.type)return[Ge];if("operation"===Ge.type){const Be=[];for(const Ze of Ge.args)Be.push(...ut(Ze));return Be}return[]}function nt(Ge){const Be=new Set,Ze=function(pt){pt&&("Variable"===pt.termType?Be.add(pt):"operation"===pt.type&&pt.args.forEach(Ze))};return Ze(Ge),Be}function xt(Ge,Be=1,Ze=[]){for(const pt of Ge)Be>0&&pt instanceof Array?xt(pt,Be-1,Ze):Ze.push(pt);return Ze}function Zt(Ge){return"Variable"===Ge.termType}function ti(Ge){if(Ge.triples){const Be=[];for(const Ze of Ge.triples)Zt(Ze.subject)&&Be.push(Ze.subject.value),Zt(Ze.predicate)&&Be.push(Ze.predicate.value),Zt(Ze.object)&&Be.push(Ze.object.value);return Be}if(Ge.patterns){const Be=[];for(const Ze of Ge.patterns)Be.push(...ti(Ze));return Be}return[]}function Qi(Ge){if(!ii.sparqlStar)throw new Error("SPARQL-star support is not enabled");return Ge}function Qn(Ge,Be,Ze){for(const pt of Be){const Vt=an("subject"in pt?pt.subject:Ge,pt.predicate,pt.object);Ze.push(Vt),pt.annotations&&Qn(qi(Ge,pt.predicate,pt.object),pt.annotations,Ze)}}function Dn(Ge){if(ii.sparqlStar){const Be=[];return Ge.forEach(Ze=>{const pt=an(Ze.subject,Ze.predicate,Ze.object);Be.push(pt),Ze.annotations&&Qn(qi(Ze.subject,Ze.predicate,Ze.object),Ze.annotations,Be)}),Be}return Ge}function Kn(Ge){for(const Be of Ge){if("graph"===Be.type&&"Variable"===Be.name.termType)throw new Error("Detected illegal variable in GRAPH");if("bgp"===Be.type||"graph"===Be.type)for(const Ze of Be.triples)if("Variable"===Ze.subject.termType||"Variable"===Ze.predicate.termType||"Variable"===Ze.object.termType)throw new Error("Detected illegal variable in BGP")}return Ge}function Rn(Ge){for(const Be of Ge)if("bgp"===Be.type)for(const Ze of Be.triples)if("BlankNode"===Ze.subject.termType||"BlankNode"===Ze.predicate.termType||"BlankNode"===Ze.object.termType)throw new Error("Detected illegal blank node in BGP");return Ge}function ii(){this.yy={}}return Xn.lexer=function(){return{EOF:1,parseError:function(Ze,pt){if(!this.yy.parser)throw new Error(Ze);this.yy.parser.parseError(Ze,pt)},setInput:function(Be,Ze){return this.yy=Ze||this.yy||{},this._input=Be,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var Be=this._input[0];return this.yytext+=Be,this.yyleng++,this.offset++,this.match+=Be,this.matched+=Be,Be.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Be},unput:function(Be){var Ze=Be.length,pt=Be.split(/(?:\r\n?|\n)/g);this._input=Be+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ze),this.offset-=Ze;var Vt=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),pt.length-1&&(this.yylineno-=pt.length-1);var Ht=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:pt?(pt.length===Vt.length?this.yylloc.first_column:0)+Vt[Vt.length-pt.length].length-pt[0].length:this.yylloc.first_column-Ze},this.options.ranges&&(this.yylloc.range=[Ht[0],Ht[0]+this.yyleng-Ze]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(Be){this.unput(this.match.slice(Be))},pastInput:function(){var Be=this.matched.substr(0,this.matched.length-this.match.length);return(Be.length>20?"...":"")+Be.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var Be=this.match;return Be.length<20&&(Be+=this._input.substr(0,20-Be.length)),(Be.substr(0,20)+(Be.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var Be=this.pastInput(),Ze=new Array(Be.length+1).join("-");return Be+this.upcomingInput()+"\n"+Ze+"^"},test_match:function(Be,Ze){var pt,Vt,Ht;if(this.options.backtrack_lexer&&(Ht={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Ht.yylloc.range=this.yylloc.range.slice(0))),(Vt=Be[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=Vt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Vt?Vt[Vt.length-1].length-Vt[Vt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Be[0].length},this.yytext+=Be[0],this.match+=Be[0],this.matches=Be,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Be[0].length),this.matched+=Be[0],pt=this.performAction.call(this,this.yy,this,Ze,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),pt)return pt;if(this._backtrack){for(var B in Ht)this[B]=Ht[B];return!1}return!1},next:function(){if(this.done)return this.EOF;var Be,Ze,pt,Vt;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var Ht=this._currentRules(),B=0;B<Ht.length;B++)if((pt=this._input.match(this.rules[Ht[B]]))&&(!Ze||pt[0].length>Ze[0].length)){if(Ze=pt,Vt=B,this.options.backtrack_lexer){if(!1!==(Be=this.test_match(pt,Ht[B])))return Be;if(this._backtrack){Ze=!1;continue}return!1}if(!this.options.flex)break}return Ze?!1!==(Be=this.test_match(Ze,Ht[Vt]))&&Be:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(Ze){this.conditionStack.push(Ze)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(Ze){return(Ze=this.conditionStack.length-1-Math.abs(Ze||0))>=0?this.conditionStack[Ze]:"INITIAL"},pushState:function(Ze){this.begin(Ze)},stateStackSize:function(){return this.conditionStack.length},options:{flex:!0,"case-insensitive":!0},performAction:function(Ze,pt,Vt,Ht){switch(Vt){case 0:break;case 1:return 12;case 2:return 15;case 3:return 41;case 4:return 325;case 5:return 326;case 6:return 45;case 7:return 47;case 8:return 48;case 9:return 39;case 10:return 24;case 11:return 28;case 12:return 29;case 13:return 31;case 14:return 32;case 15:return 36;case 16:return 53;case 17:return 327;case 18:return 63;case 19:return 64;case 20:return 70;case 21:return 73;case 22:return 76;case 23:return 78;case 24:return 81;case 25:return 83;case 26:return 85;case 27:return 193;case 28:return 100;case 29:return 328;case 30:return 121;case 31:return 329;case 32:return 330;case 33:return 110;case 34:return 331;case 35:return 109;case 36:return 332;case 37:return 333;case 38:return 113;case 39:return 115;case 40:return 116;case 41:return 131;case 42:return 123;case 43:return 126;case 44:return 128;case 45:return 132;case 46:return 112;case 47:return 334;case 48:return 335;case 49:return 159;case 50:return 161;case 51:return 164;case 52:return 174;case 53:return 160;case 54:return 336;case 55:return 163;case 56:return 312;case 57:return 314;case 58:return 317;case 59:return 318;case 60:return 272;case 61:return 197;case 62:return 337;case 63:return 338;case 64:return 229;case 65:return 340;case 66:return 263;case 67:return 224;case 68:return 231;case 69:return 232;case 70:return 242;case 71:return 246;case 72:return 290;case 73:return 341;case 74:return 342;case 75:return 343;case 76:return 344;case 77:return 345;case 78:return 250;case 79:return 346;case 80:return 265;case 81:return 276;case 82:return 277;case 83:return 268;case 84:return 269;case 85:return 270;case 86:return 271;case 87:return 347;case 88:return 348;case 89:return 273;case 90:return 274;case 91:return 350;case 92:return 349;case 93:return 351;case 94:return 279;case 95:return 280;case 96:return 283;case 97:return 285;case 98:return 289;case 99:return 293;case 100:return 296;case 101:return 13;case 102:return 16;case 103:return 308;case 104:return 309;case 105:return 87;case 106:return 292;case 107:return 82;case 108:return 294;case 109:return 295;case 110:return 297;case 111:return 298;case 112:return 299;case 113:return 300;case 114:return 301;case 115:return 302;case 116:return"EXPONENT";case 117:return 303;case 118:return 304;case 119:return 305;case 120:return 306;case 121:return 89;case 122:return 310;case 123:return 6;case 124:return"INVALID";case 125:console.log(pt.yytext)}},rules:[/^(?:\s+|(#[^\n\r]*))/i,/^(?:BASE)/i,/^(?:PREFIX)/i,/^(?:SELECT)/i,/^(?:DISTINCT)/i,/^(?:REDUCED)/i,/^(?:\()/i,/^(?:AS)/i,/^(?:\))/i,/^(?:\*)/i,/^(?:CONSTRUCT)/i,/^(?:WHERE)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:DESCRIBE)/i,/^(?:ASK)/i,/^(?:FROM)/i,/^(?:NAMED)/i,/^(?:GROUP)/i,/^(?:BY)/i,/^(?:HAVING)/i,/^(?:ORDER)/i,/^(?:ASC)/i,/^(?:DESC)/i,/^(?:LIMIT)/i,/^(?:OFFSET)/i,/^(?:VALUES)/i,/^(?:;)/i,/^(?:LOAD)/i,/^(?:SILENT)/i,/^(?:INTO)/i,/^(?:CLEAR)/i,/^(?:DROP)/i,/^(?:CREATE)/i,/^(?:ADD)/i,/^(?:TO)/i,/^(?:MOVE)/i,/^(?:COPY)/i,/^(?:INSERT((\s+|(#[^\n\r]*)\n\r?)+)DATA)/i,/^(?:DELETE((\s+|(#[^\n\r]*)\n\r?)+)DATA)/i,/^(?:DELETE((\s+|(#[^\n\r]*)\n\r?)+)WHERE)/i,/^(?:WITH)/i,/^(?:DELETE)/i,/^(?:INSERT)/i,/^(?:USING)/i,/^(?:DEFAULT)/i,/^(?:GRAPH)/i,/^(?:ALL)/i,/^(?:\.)/i,/^(?:OPTIONAL)/i,/^(?:SERVICE)/i,/^(?:BIND)/i,/^(?:UNDEF)/i,/^(?:MINUS)/i,/^(?:UNION)/i,/^(?:FILTER)/i,/^(?:<<)/i,/^(?:>>)/i,/^(?:\{\|)/i,/^(?:\|\})/i,/^(?:,)/i,/^(?:a)/i,/^(?:\|)/i,/^(?:\/)/i,/^(?:\^)/i,/^(?:\?)/i,/^(?:\+)/i,/^(?:!)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:\|\|)/i,/^(?:&&)/i,/^(?:=)/i,/^(?:!=)/i,/^(?:<)/i,/^(?:>)/i,/^(?:<=)/i,/^(?:>=)/i,/^(?:IN)/i,/^(?:NOT)/i,/^(?:-)/i,/^(?:BOUND)/i,/^(?:BNODE)/i,/^(?:(RAND|NOW|UUID|STRUUID))/i,/^(?:(LANG|DATATYPE|IRI|URI|ABS|CEIL|FLOOR|ROUND|STRLEN|STR|UCASE|LCASE|ENCODE_FOR_URI|YEAR|MONTH|DAY|HOURS|MINUTES|SECONDS|TIMEZONE|TZ|MD5|SHA1|SHA256|SHA384|SHA512|isIRI|isURI|isBLANK|isLITERAL|isNUMERIC))/i,/^(?:(SUBJECT|PREDICATE|OBJECT|isTRIPLE))/i,/^(?:(LANGMATCHES|CONTAINS|STRSTARTS|STRENDS|STRBEFORE|STRAFTER|STRLANG|STRDT|sameTerm))/i,/^(?:CONCAT)/i,/^(?:COALESCE)/i,/^(?:IF)/i,/^(?:TRIPLE)/i,/^(?:REGEX)/i,/^(?:SUBSTR)/i,/^(?:REPLACE)/i,/^(?:EXISTS)/i,/^(?:COUNT)/i,/^(?:SUM|MIN|MAX|AVG|SAMPLE)/i,/^(?:GROUP_CONCAT)/i,/^(?:SEPARATOR)/i,/^(?:\^\^)/i,/^(?:true|false)/i,/^(?:(<(?:[^<>\"\{\}\|\^`\\\u0000-\u0020])*>))/i,/^(?:((([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?)?:))/i,/^(?:(((([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?)?:)((?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|:|[0-9]|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.|:|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|:|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%)))))?)))/i,/^(?:(_:(?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?))/i,/^(?:([\?\$]((?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9])(?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])*)))/i,/^(?:(@[a-zA-Z]+(?:-[a-zA-Z0-9]+)*))/i,/^(?:([0-9]+))/i,/^(?:([0-9]*\.[0-9]+))/i,/^(?:([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+)))/i,/^(?:(\+([0-9]+)))/i,/^(?:(\+([0-9]*\.[0-9]+)))/i,/^(?:(\+([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+))))/i,/^(?:(-([0-9]+)))/i,/^(?:(-([0-9]*\.[0-9]+)))/i,/^(?:(-([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+))))/i,/^(?:([eE][+-]?[0-9]+))/i,/^(?:('(?:(?:[^\u0027\u005C\u000A\u000D])|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])))*'))/i,/^(?:("(?:(?:[^\u0022\u005C\u000A\u000D])|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])))*"))/i,/^(?:('''(?:(?:'|'')?(?:[^'\\]|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f]))))*'''))/i,/^(?:("""(?:(?:"|"")?(?:[^\"\\]|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f]))))*"""))/i,/^(?:(\((\u0020|\u0009|\u000D|\u000A)*\)))/i,/^(?:(\[(\u0020|\u0009|\u000D|\u000A)*\]))/i,/^(?:$)/i,/^(?:.)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125],inclusive:!0}}}}(),ii.prototype=Xn,Xn.Parser=ii,new ii}();Ei.exports=j},2174(Ei){class At{constructor(){return We||this}equals(g){return g&&this.termType===g.termType}}Object.defineProperty(At.prototype,"value",{enumerable:!0,value:"*"}),Object.defineProperty(At.prototype,"termType",{enumerable:!0,value:"Wildcard"});var We=new At;Ei.exports.Wildcard=At},6593(Ei,At,We){const{Parser:j}=We(5510),{Generator:g}=We(204),{Wildcard:R}=We(2174),{DataFactory:le}=We(5376);Ei.exports={Parser:function Te({prefixes:Ve,baseIRI:Ye,factory:Se,pathOnly:ct,sparqlStar:Ke,skipValidation:X,skipUngroupedVariableCheck:ae}={}){const se={};for(const we in Ve??{})se[we]=Ve[we];const ge=new j;return ge.parse=function(){return j.base=Ye||"",j.prefixes=Object.create(se),j.factory=Se||new le,j.sparqlStar=!!Ke,j.pathOnly=!!ct,j.skipValidation=!!X||!!ae,j.prototype.parse.apply(ge,arguments)},ge._resetBlanks=j._resetBlanks,ge},Generator:g,Wildcard:R}},9131(Ei,At,We){"use strict";We.d(At,{Yc:()=>D,b6:()=>li,cL:()=>k,pw:()=>er,qh:()=>Se});var le=We(1380),Te=We(3161),Ve=We(5759),Ye=We(2166);const Se=i=>{let{state:l}=i,a=l.doc.lineAt(l.selection.main.from),b=ze(i.state,a.from);return b.line?Ke(i):!!b.block&&dt(i)};function ct(i,l){return({state:a,dispatch:b})=>{if(a.readOnly)return!1;let C=i(l,a);return!!C&&(b(a.update(C)),!0)}}const Ke=ct(He,0),se=ct(Mt,0),dt=ct((i,l)=>Mt(i,l,function Wt(i){let l=[];for(let a of i.selection.ranges){let b=i.doc.lineAt(a.from),C=a.to<=b.to?b:i.doc.lineAt(a.to);C.from>b.from&&C.from==a.to&&(C=a.to==b.to+1?b:i.doc.lineAt(a.to-1));let v=l.length-1;v>=0&&l[v].to>b.from?l[v].to=C.to:l.push({from:b.from+/^\s*/.exec(b.text)[0].length,to:C.to})}return l}(l)),0);function ze(i,l){let a=i.languageDataAt("commentTokens",l,1);return a.length?a[0]:{}}function Mt(i,l,a=l.selection.ranges){let b=a.map(v=>ze(l,v.from).block);if(!b.every(v=>v))return null;let C=a.map((v,W)=>function Qt(i,{open:l,close:a},b,C){let Re,tt,v=i.sliceDoc(b-50,b),W=i.sliceDoc(C,C+50),ee=/\s*$/.exec(v)[0].length,ve=/^\s*/.exec(W)[0].length,et=v.length-ee;if(v.slice(et-l.length,et)==l&&W.slice(ve,ve+a.length)==a)return{open:{pos:b-ee,margin:ee&&1},close:{pos:C+ve,margin:ve&&1}};C-b<=100?Re=tt=i.sliceDoc(b,C):(Re=i.sliceDoc(b,b+50),tt=i.sliceDoc(C-50,C));let _t=/^\s*/.exec(Re)[0].length,yt=/\s*$/.exec(tt)[0].length,Dt=tt.length-yt-a.length;return Re.slice(_t,_t+l.length)==l&&tt.slice(Dt,Dt+a.length)==a?{open:{pos:b+_t+l.length,margin:/\s/.test(Re.charAt(_t+l.length))?1:0},close:{pos:C-yt-a.length,margin:/\s/.test(tt.charAt(Dt-1))?1:0}}:null}(l,b[W],v.from,v.to));if(2!=i&&!C.every(v=>v))return{changes:l.changes(a.map((v,W)=>C[W]?[]:[{from:v.from,insert:b[W].open+" "},{from:v.to,insert:" "+b[W].close}]))};if(1!=i&&C.some(v=>v)){let v=[];for(let ee,W=0;W<C.length;W++)if(ee=C[W]){let ve=b[W],{open:et,close:Re}=ee;v.push({from:et.pos-ve.open.length,to:et.pos+et.margin},{from:Re.pos-Re.margin,to:Re.pos+ve.close.length})}return{changes:v}}return null}function He(i,l,a=l.selection.ranges){let b=[],C=-1;e:for(let{from:v,to:W}of a){let et,ee=b.length,ve=1e9;for(let Re=v;Re<=W;){let tt=l.doc.lineAt(Re);if(null==et&&(et=ze(l,tt.from).line,!et))continue e;if(tt.from>C&&(v==W||W>tt.from)){C=tt.from;let _t=/^\s*/.exec(tt.text)[0].length,yt=_t==tt.length,Dt=tt.text.slice(_t,_t+et.length)==et?_t:-1;_t<tt.text.length&&_t<ve&&(ve=_t),b.push({line:tt,comment:Dt,token:et,indent:_t,empty:yt,single:!1})}Re=tt.to+1}if(ve<1e9)for(let Re=ee;Re<b.length;Re++)b[Re].indent<b[Re].line.text.length&&(b[Re].indent=ve);b.length==ee+1&&(b[ee].single=!0)}if(2!=i&&b.some(v=>v.comment<0&&(!v.empty||v.single))){let v=[];for(let{line:ee,token:ve,indent:et,empty:Re,single:tt}of b)(tt||!Re)&&v.push({from:ee.from+et,insert:ve+" "});let W=l.changes(v);return{changes:W,selection:l.selection.map(W,1)}}if(1!=i&&b.some(v=>v.comment>=0)){let v=[];for(let{line:W,comment:ee,token:ve}of b)if(ee>=0){let et=W.from+ee,Re=et+ve.length;" "==W.text[Re-W.from]&&Re++,v.push({from:et,to:Re})}return{changes:v}}return null}const Nt=le.YH.define(),ri=le.YH.define(),oi=le.sj.define(),Yt=le.sj.define({combine:i=>(0,le.QR)(i,{minDepth:100,newGroupDelay:500,joinToEvent:(l,a)=>a},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(l,a)=>(b,C)=>l(b,C)||a(b,C)})}),Gt=le.sU.define({create:()=>_e.empty,update(i,l){let a=l.state.facet(Yt),b=l.annotation(Nt);if(b){let ve=pe.fromTransaction(l,b.selection),et=b.side,Re=0==et?i.undone:i.done;return Re=ve?Ie(Re,Re.length,a.minDepth,ve):at(Re,l.startState.selection),new _e(0==et?b.rest:Re,0==et?Re:b.rest)}let C=l.annotation(ri);if(("full"==C||"before"==C)&&(i=i.isolate()),!1===l.annotation(le.ZX.addToHistory))return l.changes.empty?i:i.addMapping(l.changes.desc);let v=pe.fromTransaction(l),W=l.annotation(le.ZX.time),ee=l.annotation(le.ZX.userEvent);return v?i=i.addChanges(v,W,ee,a,l):l.selection&&(i=i.addSelection(l.startState.selection,W,ee,a.newGroupDelay)),("full"==C||"after"==C)&&(i=i.isolate()),i},toJSON:i=>({done:i.done.map(l=>l.toJSON()),undone:i.undone.map(l=>l.toJSON())}),fromJSON:i=>new _e(i.done.map(pe.fromJSON),i.undone.map(pe.fromJSON))});function li(i={}){return[Gt,Yt.of(i),Te.Lz.domEventHandlers({beforeinput(l,a){let b="historyUndo"==l.inputType?It:"historyRedo"==l.inputType?vt:null;return!!b&&(l.preventDefault(),b(a))}})]}function Kt(i,l){return function({state:a,dispatch:b}){if(!l&&a.readOnly)return!1;let C=a.field(Gt,!1);if(!C)return!1;let v=C.pop(i,a,l);return!!v&&(b(v),!0)}}const It=Kt(0,!1),vt=Kt(1,!1),Jt=Kt(0,!0),wt=Kt(1,!0);class pe{constructor(l,a,b,C,v){this.changes=l,this.effects=a,this.mapped=b,this.startSelection=C,this.selectionsAfter=v}setSelAfter(l){return new pe(this.changes,this.effects,this.mapped,this.startSelection,l)}toJSON(){var l,a,b;return{changes:null===(l=this.changes)||void 0===l?void 0:l.toJSON(),mapped:null===(a=this.mapped)||void 0===a?void 0:a.toJSON(),startSelection:null===(b=this.startSelection)||void 0===b?void 0:b.toJSON(),selectionsAfter:this.selectionsAfter.map(C=>C.toJSON())}}static fromJSON(l){return new pe(l.changes&&le.VR.fromJSON(l.changes),[],l.mapped&&le.Gu.fromJSON(l.mapped),l.startSelection&&le.OF.fromJSON(l.startSelection),l.selectionsAfter.map(le.OF.fromJSON))}static fromTransaction(l,a){let b=qe;for(let C of l.startState.facet(oi)){let v=C(l);v.length&&(b=b.concat(v))}return!b.length&&l.changes.empty?null:new pe(l.changes.invert(l.startState.doc),b,void 0,a||l.startState.selection,qe)}static selection(l){return new pe(void 0,qe,void 0,void 0,l)}}function Ie(i,l,a,b){let v=i.slice(l+1>a+20?l-a-1:0,l);return v.push(b),v}function Je(i,l){return i.length?l.length?i.concat(l):i:l}const qe=[];function at(i,l){if(i.length){let a=i[i.length-1],b=a.selectionsAfter.slice(Math.max(0,a.selectionsAfter.length-200));return b.length&&b[b.length-1].eq(l)?i:(b.push(l),Ie(i,i.length-1,1e9,a.setSelAfter(b)))}return[pe.selection([l])]}function St(i){let l=i[i.length-1],a=i.slice();return a[i.length-1]=l.setSelAfter(l.selectionsAfter.slice(0,l.selectionsAfter.length-1)),a}function kt(i,l){if(!i.length)return i;let a=i.length,b=qe;for(;a;){let C=Et(i[a-1],l,b);if(C.changes&&!C.changes.empty||C.effects.length){let v=i.slice(0,a);return v[a-1]=C,v}l=C.mapped,a--,b=C.selectionsAfter}return b.length?[pe.selection(b)]:qe}function Et(i,l,a){let b=Je(i.selectionsAfter.length?i.selectionsAfter.map(ee=>ee.map(l)):qe,a);if(!i.changes)return pe.selection(b);let C=i.changes.map(l),v=l.mapDesc(i.changes,!0),W=i.mapped?i.mapped.composeDesc(v):v;return new pe(C,le.Pe.mapEffects(i.effects,l),W,i.startSelection.map(v),b)}const Lt=/^(input\.type|delete)($|\.)/;let _e=(()=>{class i{constructor(a,b,C=0,v=void 0){this.done=a,this.undone=b,this.prevTime=C,this.prevUserEvent=v}isolate(){return this.prevTime?new i(this.done,this.undone):this}addChanges(a,b,C,v,W){let ee=this.done,ve=ee[ee.length-1];return ee=ve&&ve.changes&&!ve.changes.empty&&a.changes&&(!C||Lt.test(C))&&(!ve.selectionsAfter.length&&b-this.prevTime<v.newGroupDelay&&v.joinToEvent(W,function Ae(i,l){let a=[],b=!1;return i.iterChangedRanges((C,v)=>a.push(C,v)),l.iterChangedRanges((C,v,W,ee)=>{for(let ve=0;ve<a.length;){let et=a[ve++],Re=a[ve++];ee>=et&&W<=Re&&(b=!0)}}),b}(ve.changes,a.changes))||"input.type.compose"==C)?Ie(ee,ee.length-1,v.minDepth,new pe(a.changes.compose(ve.changes),Je(le.Pe.mapEffects(a.effects,ve.changes),ve.effects),ve.mapped,ve.startSelection,qe)):Ie(ee,ee.length,v.minDepth,a),new i(ee,qe,b,C)}addSelection(a,b,C,v){let W=this.done.length?this.done[this.done.length-1].selectionsAfter:qe;return W.length>0&&b-this.prevTime<v&&C==this.prevUserEvent&&C&&/^select($|\.)/.test(C)&&function it(i,l){return i.ranges.length==l.ranges.length&&0===i.ranges.filter((a,b)=>a.empty!=l.ranges[b].empty).length}(W[W.length-1],a)?this:new i(at(this.done,a),this.undone,b,C)}addMapping(a){return new i(kt(this.done,a),kt(this.undone,a),this.prevTime,this.prevUserEvent)}pop(a,b,C){let v=0==a?this.done:this.undone;if(0==v.length)return null;let W=v[v.length-1],ee=W.selectionsAfter[0]||(W.startSelection?W.startSelection.map(W.changes.invertedDesc,1):b.selection);if(C&&W.selectionsAfter.length)return b.update({selection:W.selectionsAfter[W.selectionsAfter.length-1],annotations:Nt.of({side:a,rest:St(v),selection:ee}),userEvent:0==a?"select.undo":"select.redo",scrollIntoView:!0});if(W.changes){let ve=1==v.length?qe:v.slice(0,v.length-1);return W.mapped&&(ve=kt(ve,W.mapped)),b.update({changes:W.changes,selection:W.startSelection,effects:W.effects,annotations:Nt.of({side:a,rest:ve,selection:ee}),filter:!1,userEvent:0==a?"undo":"redo",scrollIntoView:!0})}return null}}return i.empty=new i(qe,qe),i})();const k=[{key:"Mod-z",run:It,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:vt,preventDefault:!0},{linux:"Ctrl-Shift-z",run:vt,preventDefault:!0},{key:"Mod-u",run:Jt,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:wt,preventDefault:!0}];function M(i,l){return le.OF.create(i.ranges.map(l),i.mainIndex)}function H(i,l){return i.update({selection:l,scrollIntoView:!0,userEvent:"select"})}function Y({state:i,dispatch:l},a){let b=M(i.selection,a);return!b.eq(i.selection,!0)&&(l(H(i,b)),!0)}function I(i,l){return le.OF.cursor(l?i.to:i.from)}function L(i,l){return Y(i,a=>a.empty?i.moveByChar(a,l):I(a,l))}function K(i){return i.textDirectionAt(i.state.selection.main.head)==Te.OP.LTR}const J=i=>L(i,!K(i)),fe=i=>L(i,K(i));function m(i,l){return Y(i,a=>a.empty?i.moveByGroup(a,l):I(a,l))}function Rt(i,l,a){if(l.type.prop(a))return!0;let b=l.to-l.from;return b&&(b>2||/[^\s,.;:]/.test(i.sliceDoc(l.from,l.to)))||l.firstChild}function qt(i,l,a){let W,ee,b=(0,Ve.mv)(i).resolveInner(l.head),C=a?Ye.uY.closedBy:Ye.uY.openedBy;for(let ve=l.head;;){let et=a?b.childAfter(ve):b.childBefore(ve);if(!et)break;Rt(i,et,C)?b=et:ve=a?et.to:et.from}return ee=b.type.prop(C)&&(W=a?(0,Ve.jU)(i,b.from,1):(0,Ve.jU)(i,b.to,-1))&&W.matched?a?W.end.to:W.end.from:a?b.to:b.from,le.OF.cursor(ee,a?-1:1)}function ki(i,l){return Y(i,a=>{if(!a.empty)return I(a,l);let b=i.moveVertically(a,l);return b.head!=a.head?b:i.moveToLineBoundary(a,l)})}typeof Intl<"u"&&Intl;const yi=i=>ki(i,!1),Ni=i=>ki(i,!0);function fi(i){let C,l=i.scrollDOM.clientHeight<i.scrollDOM.scrollHeight-2,a=0,b=0;if(l){for(let v of i.state.facet(Te.Lz.scrollMargins)){let W=v(i);W?.top&&(a=Math.max(W?.top,a)),W?.bottom&&(b=Math.max(W?.bottom,b))}C=i.scrollDOM.clientHeight-a-b}else C=(i.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:a,marginBottom:b,selfScroll:l,height:Math.max(i.defaultLineHeight,C-5)}}function pi(i,l){let v,a=fi(i),{state:b}=i,C=M(b.selection,W=>W.empty?i.moveVertically(W,l,a.height):I(W,l));if(C.eq(b.selection))return!1;if(a.selfScroll){let W=i.coordsAtPos(b.selection.main.head),ee=i.scrollDOM.getBoundingClientRect(),ve=ee.top+a.marginTop;W&&W.top>ve&&W.bottom<ee.bottom-a.marginBottom&&(v=Te.Lz.scrollIntoView(C.main.head,{y:"start",yMargin:W.top-ve}))}return i.dispatch(H(b,C),{effects:v}),!0}const di=i=>pi(i,!1),gi=i=>pi(i,!0);function xi(i,l,a){let b=i.lineBlockAt(l.head),C=i.moveToLineBoundary(l,a);if(C.head==l.head&&C.head!=(a?b.to:b.from)&&(C=i.moveToLineBoundary(l,a,!1)),!a&&C.head==b.from&&b.length){let v=/^\s*/.exec(i.state.sliceDoc(b.from,Math.min(b.from+100,b.to)))[0].length;v&&l.head!=b.from+v&&(C=le.OF.cursor(b.from+v))}return C}function Si(i,l){let a=M(i.state.selection,b=>{let C=l(b);return le.OF.range(b.anchor,C.head,C.goalColumn,C.bidiLevel||void 0,C.assoc)});return!a.eq(i.state.selection)&&(i.dispatch(H(i.state,a)),!0)}function _i(i,l){return Si(i,a=>i.moveByChar(a,l))}const wi=i=>_i(i,!K(i)),Xi=i=>_i(i,K(i));function Ut(i,l){return Si(i,a=>i.moveByGroup(a,l))}function ce(i,l){return Si(i,a=>i.moveVertically(a,l))}const Ce=i=>ce(i,!1),je=i=>ce(i,!0);function ot(i,l){return Si(i,a=>i.moveVertically(a,l,fi(i).height))}const gt=i=>ot(i,!1),ht=i=>ot(i,!0),Un=({state:i,dispatch:l})=>(l(H(i,{anchor:0})),!0),Ri=({state:i,dispatch:l})=>(l(H(i,{anchor:i.doc.length})),!0),rn=({state:i,dispatch:l})=>(l(H(i,{anchor:i.selection.main.anchor,head:0})),!0),mn=({state:i,dispatch:l})=>(l(H(i,{anchor:i.selection.main.anchor,head:i.doc.length})),!0);function bn(i,l){let{state:a}=i,b=a.selection,C=a.selection.ranges.slice();for(let v of a.selection.ranges){let W=a.doc.lineAt(v.head);if(l?W.to<i.state.doc.length:W.from>0)for(let ee=v;;){let ve=i.moveVertically(ee,l);if(ve.head<W.from||ve.head>W.to){C.some(et=>et.head==ve.head)||C.push(ve);break}if(ve.head==ee.head)break;ee=ve}}return C.length!=b.ranges.length&&(i.dispatch(H(a,le.OF.create(C,C.length-1))),!0)}function Mi(i,l){if(i.state.readOnly)return!1;let a="delete.selection",{state:b}=i,C=b.changeByRange(v=>{let{from:W,to:ee}=v;if(W==ee){let ve=l(v);ve<W?(a="delete.backward",ve=fn(i,ve,!1)):ve>W&&(a="delete.forward",ve=fn(i,ve,!0)),W=Math.min(W,ve),ee=Math.max(ee,ve)}else W=fn(i,W,!1),ee=fn(i,ee,!0);return W==ee?{range:v}:{changes:{from:W,to:ee},range:le.OF.cursor(W,W<v.head?-1:1)}});return!C.changes.empty&&(i.dispatch(b.update(C,{scrollIntoView:!0,userEvent:a,effects:"delete.selection"==a?Te.Lz.announce.of(b.phrase("Selection deleted")):void 0})),!0)}function fn(i,l,a){if(i instanceof Te.Lz)for(let b of i.state.facet(Te.Lz.atomicRanges).map(C=>C(i)))b.between(l,l,(C,v)=>{C<l&&v>l&&(l=a?v:C)});return l}const G=(i,l,a)=>Mi(i,b=>{let ee,ve,C=b.from,{state:v}=i,W=v.doc.lineAt(C);if(a&&!l&&C>W.from&&C<W.from+200&&!/[^ \t]/.test(ee=W.text.slice(0,C-W.from))){if("\t"==ee[ee.length-1])return C-1;let Re=(0,le.y$)(ee,v.tabSize)%(0,Ve.tp)(v)||(0,Ve.tp)(v);for(let tt=0;tt<Re&&" "==ee[ee.length-1-tt];tt++)C--;ve=C}else ve=(0,le.zK)(W.text,C-W.from,l,l)+W.from,ve==C&&W.number!=(l?v.doc.lines:1)?ve+=l?1:-1:!l&&/[\ufe00-\ufe0f]/.test(W.text.slice(ve-W.from,C-W.from))&&(ve=(0,le.zK)(W.text,ve-W.from,!1,!1)+W.from);return ve}),S=i=>G(i,!1,!0),q=i=>G(i,!0,!1),ie=(i,l)=>Mi(i,a=>{let b=a.head,{state:C}=i,v=C.doc.lineAt(b),W=C.charCategorizer(b);for(let ee=null;;){if(b==(l?v.to:v.from)){b==a.head&&v.number!=(l?C.doc.lines:1)&&(b+=l?1:-1);break}let ve=(0,le.zK)(v.text,b-v.from,l)+v.from,et=v.text.slice(Math.min(b,ve)-v.from,Math.max(b,ve)-v.from),Re=W(et);if(null!=ee&&Re!=ee)break;(" "!=et||b!=a.head)&&(ee=Re),b=ve}return b}),xe=i=>ie(i,!1);function Ti(i){let l=[],a=-1;for(let b of i.selection.ranges){let C=i.doc.lineAt(b.from),v=i.doc.lineAt(b.to);if(!b.empty&&b.to==v.from&&(v=i.doc.lineAt(b.to-1)),a>=C.number){let W=l[l.length-1];W.to=v.to,W.ranges.push(b)}else l.push({from:C.from,to:v.to,ranges:[b]});a=v.number+1}return l}function Nn(i,l,a){if(i.readOnly)return!1;let b=[],C=[];for(let v of Ti(i)){if(a?v.to==i.doc.length:0==v.from)continue;let W=i.doc.lineAt(a?v.to+1:v.from-1),ee=W.length+1;if(a){b.push({from:v.to,to:W.to},{from:v.from,insert:W.text+i.lineBreak});for(let ve of v.ranges)C.push(le.OF.range(Math.min(i.doc.length,ve.anchor+ee),Math.min(i.doc.length,ve.head+ee)))}else{b.push({from:W.from,to:v.from},{from:v.to,insert:i.lineBreak+W.text});for(let ve of v.ranges)C.push(le.OF.range(ve.anchor-ee,ve.head-ee))}}return!!b.length&&(l(i.update({changes:b,scrollIntoView:!0,selection:le.OF.create(C,i.selection.mainIndex),userEvent:"move.line"})),!0)}function yn(i,l,a){if(i.readOnly)return!1;let b=[];for(let v of Ti(i))b.push(a?{from:v.from,insert:i.doc.slice(v.from,v.to)+i.lineBreak}:{from:v.to,insert:i.lineBreak+i.doc.slice(v.from,v.to)});let C=i.changes(b);return l(i.update({changes:C,selection:i.selection.map(C,a?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Wn=Yn(!1);function Yn(i){return({state:l,dispatch:a})=>{if(l.readOnly)return!1;let b=l.changeByRange(C=>{let{from:v,to:W}=C,ee=l.doc.lineAt(v),ve=!i&&v==W&&function Xn(i,l){if(/\(\)|\[\]|\{\}/.test(i.sliceDoc(l-1,l+1)))return{from:l,to:l};let v,a=(0,Ve.mv)(i).resolveInner(l),b=a.childBefore(l),C=a.childAfter(l);return b&&C&&b.to<=l&&C.from>=l&&(v=b.type.prop(Ye.uY.closedBy))&&v.indexOf(C.name)>-1&&i.doc.lineAt(b.to).from==i.doc.lineAt(C.from).from&&!/\S/.test(i.sliceDoc(b.to,C.from))?{from:b.to,to:C.from}:null}(l,v);i&&(v=W=(W<=ee.to?ee:l.doc.lineAt(W)).to);let et=new Ve.KB(l,{simulateBreak:v,simulateDoubleBreak:!!ve}),Re=(0,Ve._v)(et,v);for(null==Re&&(Re=(0,le.y$)(/^\s*/.exec(l.doc.lineAt(v).text)[0],l.tabSize));W<ee.to&&/\s/.test(ee.text[W-ee.from]);)W++;ve?({from:v,to:W}=ve):v>ee.from&&v<ee.from+100&&!/\S/.test(ee.text.slice(0,v))&&(v=ee.from);let tt=["",(0,Ve.EI)(l,Re)];return ve&&tt.push((0,Ve.EI)(l,et.lineIndent(ee.from,-1))),{changes:{from:v,to:W,insert:le.EY.of(tt)},range:le.OF.cursor(v+1+tt[1].length)}});return a(l.update(b,{scrollIntoView:!0,userEvent:"input"})),!0}}function Hn(i,l){let a=-1;return i.changeByRange(b=>{let C=[];for(let W=b.from;W<=b.to;){let ee=i.doc.lineAt(W);ee.number>a&&(b.empty||b.to>ee.from)&&(l(ee,C,b),a=ee.number),W=ee.to+1}let v=i.changes(C);return{changes:C,range:le.OF.range(v.mapPos(b.anchor,1),v.mapPos(b.head,1))}})}const Tn=({state:i,dispatch:l})=>!i.readOnly&&(l(i.update(Hn(i,(a,b)=>{b.push({from:a.from,insert:i.facet(Ve.Xt)})}),{userEvent:"input.indent"})),!0),Vn=({state:i,dispatch:l})=>!i.readOnly&&(l(i.update(Hn(i,(a,b)=>{let C=/^\s*/.exec(a.text)[0];if(!C)return;let v=(0,le.y$)(C,i.tabSize),W=0,ee=(0,Ve.EI)(i,Math.max(0,v-(0,Ve.tp)(i)));for(;W<C.length&&W<ee.length&&C.charCodeAt(W)==ee.charCodeAt(W);)W++;b.push({from:a.from+W,to:a.from+C.length,insert:ee.slice(W)})}),{userEvent:"delete.dedent"})),!0),er=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:i=>Y(i,l=>qt(i.state,l,!K(i))),shift:i=>Si(i,l=>qt(i.state,l,!K(i)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:i=>Y(i,l=>qt(i.state,l,K(i))),shift:i=>Si(i,l=>qt(i.state,l,K(i)))},{key:"Alt-ArrowUp",run:({state:i,dispatch:l})=>Nn(i,l,!1)},{key:"Shift-Alt-ArrowUp",run:({state:i,dispatch:l})=>yn(i,l,!1)},{key:"Alt-ArrowDown",run:({state:i,dispatch:l})=>Nn(i,l,!0)},{key:"Shift-Alt-ArrowDown",run:({state:i,dispatch:l})=>yn(i,l,!0)},{key:"Mod-Alt-ArrowUp",run:i=>bn(i,!1)},{key:"Mod-Alt-ArrowDown",run:i=>bn(i,!0)},{key:"Escape",run:({state:i,dispatch:l})=>{let a=i.selection,b=null;return a.ranges.length>1?b=le.OF.create([a.main]):a.main.empty||(b=le.OF.create([le.OF.cursor(a.main.head)])),!!b&&(l(H(i,b)),!0)}},{key:"Mod-Enter",run:Yn(!0)},{key:"Alt-l",mac:"Ctrl-l",run:({state:i,dispatch:l})=>{let a=Ti(i).map(({from:b,to:C})=>le.OF.range(b,Math.min(C+1,i.doc.length)));return l(i.update({selection:le.OF.create(a),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:i,dispatch:l})=>{let a=M(i.selection,b=>{let C=(0,Ve.mv)(i),v=C.resolveStack(b.from,1);if(b.empty){let W=C.resolveStack(b.from,-1);W.node.from>=v.node.from&&W.node.to<=v.node.to&&(v=W)}for(let W=v;W;W=W.next){let{node:ee}=W;if((ee.from<b.from&&ee.to>=b.to||ee.to>b.to&&ee.from<=b.from)&&W.next)return le.OF.range(ee.to,ee.from)}return b});return!a.eq(i.selection)&&(l(H(i,a)),!0)},preventDefault:!0},{key:"Mod-[",run:Vn},{key:"Mod-]",run:Tn},{key:"Mod-Alt-\\",run:({state:i,dispatch:l})=>{if(i.readOnly)return!1;let a=Object.create(null),b=new Ve.KB(i,{overrideIndentation:v=>a[v]??-1}),C=Hn(i,(v,W,ee)=>{let ve=(0,Ve._v)(b,v.from);if(null==ve)return;/\S/.test(v.text)||(ve=0);let et=/^\s*/.exec(v.text)[0],Re=(0,Ve.EI)(i,ve);(et!=Re||ee.from<v.from+et.length)&&(a[v.from]=ve,W.push({from:v.from,to:v.from+et.length,insert:Re}))});return C.changes.empty||l(i.update(C,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:i=>{if(i.state.readOnly)return!1;let{state:l}=i,a=l.changes(Ti(l).map(({from:C,to:v})=>(C>0?C--:v<l.doc.length&&v++,{from:C,to:v}))),b=M(l.selection,C=>{let v;if(i.lineWrapping){let W=i.lineBlockAt(C.head),ee=i.coordsAtPos(C.head,C.assoc||1);ee&&(v=W.bottom+i.documentTop-ee.bottom+i.defaultLineHeight/2)}return i.moveVertically(C,!0,v)}).map(a);return i.dispatch({changes:a,selection:b,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:i,dispatch:l})=>function si(i,l,a){let b=!1,C=M(i.selection,v=>{let W=(0,Ve.jU)(i,v.head,-1)||(0,Ve.jU)(i,v.head,1)||v.head>0&&(0,Ve.jU)(i,v.head-1,1)||v.head<i.doc.length&&(0,Ve.jU)(i,v.head+1,-1);if(!W||!W.end)return v;b=!0;let ee=W.start.from==v.head?W.end.to:W.end.from;return a?le.OF.range(v.anchor,ee):le.OF.cursor(ee)});return!!b&&(l(H(i,C)),!0)}(i,l,!1)},{key:"Mod-/",run:Se},{key:"Alt-A",run:se},{key:"Ctrl-m",mac:"Shift-Alt-m",run:i=>(i.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:J,shift:wi,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:i=>m(i,!K(i)),shift:i=>Ut(i,!K(i)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:i=>Y(i,l=>xi(i,l,!K(i))),shift:i=>Si(i,l=>xi(i,l,!K(i))),preventDefault:!0},{key:"ArrowRight",run:fe,shift:Xi,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:i=>m(i,K(i)),shift:i=>Ut(i,K(i)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:i=>Y(i,l=>xi(i,l,K(i))),shift:i=>Si(i,l=>xi(i,l,K(i))),preventDefault:!0},{key:"ArrowUp",run:yi,shift:Ce,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Un,shift:rn},{mac:"Ctrl-ArrowUp",run:di,shift:gt},{key:"ArrowDown",run:Ni,shift:je,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Ri,shift:mn},{mac:"Ctrl-ArrowDown",run:gi,shift:ht},{key:"PageUp",run:di,shift:gt},{key:"PageDown",run:gi,shift:ht},{key:"Home",run:i=>Y(i,l=>xi(i,l,!1)),shift:i=>Si(i,l=>xi(i,l,!1)),preventDefault:!0},{key:"Mod-Home",run:Un,shift:rn},{key:"End",run:i=>Y(i,l=>xi(i,l,!0)),shift:i=>Si(i,l=>xi(i,l,!0)),preventDefault:!0},{key:"Mod-End",run:Ri,shift:mn},{key:"Enter",run:Wn,shift:Wn},{key:"Mod-a",run:({state:i,dispatch:l})=>(l(i.update({selection:{anchor:0,head:i.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:S,shift:S,preventDefault:!0},{key:"Delete",run:q,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:xe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:i=>ie(i,!0),preventDefault:!0},{mac:"Mod-Backspace",run:i=>Mi(i,l=>{let a=i.moveToLineBoundary(l,!1).head;return l.head>a?a:Math.max(0,l.head-1)}),preventDefault:!0},{mac:"Mod-Delete",run:i=>Mi(i,l=>{let a=i.moveToLineBoundary(l,!0).head;return l.head<a?a:Math.min(i.state.doc.length,l.head+1)}),preventDefault:!0}].concat([{key:"Ctrl-b",run:J,shift:wi,preventDefault:!0},{key:"Ctrl-f",run:fe,shift:Xi},{key:"Ctrl-p",run:yi,shift:Ce},{key:"Ctrl-n",run:Ni,shift:je},{key:"Ctrl-a",run:i=>Y(i,l=>le.OF.cursor(i.lineBlockAt(l.head).from,1)),shift:i=>Si(i,l=>le.OF.cursor(i.lineBlockAt(l.head).from))},{key:"Ctrl-e",run:i=>Y(i,l=>le.OF.cursor(i.lineBlockAt(l.head).to,-1)),shift:i=>Si(i,l=>le.OF.cursor(i.lineBlockAt(l.head).to))},{key:"Ctrl-d",run:q},{key:"Ctrl-h",run:S},{key:"Ctrl-k",run:i=>Mi(i,l=>{let a=i.lineBlockAt(l.head).to;return l.head<a?a:Math.min(i.state.doc.length,l.head+1)})},{key:"Ctrl-Alt-h",run:xe},{key:"Ctrl-o",run:({state:i,dispatch:l})=>{if(i.readOnly)return!1;let a=i.changeByRange(b=>({changes:{from:b.from,to:b.to,insert:le.EY.of(["",""])},range:le.OF.cursor(b.from)}));return l(i.update(a,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:i,dispatch:l})=>{if(i.readOnly)return!1;let a=i.changeByRange(b=>{if(!b.empty||0==b.from||b.from==i.doc.length)return{range:b};let C=b.from,v=i.doc.lineAt(C),W=C==v.from?C-1:(0,le.zK)(v.text,C-v.from,!1)+v.from,ee=C==v.to?C+1:(0,le.zK)(v.text,C-v.from,!0)+v.from;return{changes:{from:W,to:ee,insert:i.doc.slice(C,ee).append(i.doc.slice(W,C))},range:le.OF.cursor(ee)}});return!a.changes.empty&&(l(i.update(a,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:gi}].map(i=>({mac:i.key,run:i.run,shift:i.shift})))),D={key:"Tab",run:Tn,shift:Vn}},5759(Ei,At,We){"use strict";We.d(At,{Ay:()=>St,EI:()=>Jt,KB:()=>me,Lv:()=>Ni,Oh:()=>de,Q_:()=>Gi,SG:()=>Ji,Tg:()=>re,WD:()=>k,Xt:()=>It,Yy:()=>li,Zt:()=>en,_v:()=>wt,b_:()=>H,bj:()=>se,cr:()=>pi,f7:()=>bt,jU:()=>Bi,mv:()=>ge,mz:()=>Lt,tp:()=>vt,y9:()=>Di,yd:()=>Y});var Ye,g=We(2166),R=We(1380),le=We(3161),Te=We(9125),Ve=We(2316);const Se=new g.uY;function ct(G){return R.sj.define({combine:G?S=>S.concat(G):void 0})}const Ke=new g.uY;let X=(()=>{class G{constructor(A,q,ie=[],xe=""){this.data=A,this.name=xe,R.$t.prototype.hasOwnProperty("tree")||Object.defineProperty(R.$t.prototype,"tree",{get(){return ge(this)}}),this.parser=q,this.extension=[Gt.of(this),R.$t.languageData.of((ke,Xe,Qe)=>{let Ot=ae(ke,Xe,Qe),Ft=Ot.type.prop(Se);if(!Ft)return[];let bi=ke.facet(Ft),on=Ot.type.prop(Ke);if(on){let Hi=Ot.resolve(Xe-Ot.from,Qe);for(let On of on)if(On.test(Hi,ke)){let Ti=ke.facet(On.facet);return"replace"==On.type?Ti:Ti.concat(bi)}}return bi})].concat(ie)}isActiveAt(A,q,ie=-1){return ae(A,q,ie).type.prop(Se)==this.data}findRegions(A){let q=A.facet(Gt);if(q?.data==this.data)return[{from:0,to:A.doc.length}];if(!q||!q.allowsNesting)return[];let ie=[],xe=(ke,Xe)=>{if(ke.prop(Se)==this.data)return void ie.push({from:Xe,to:Xe+ke.length});let Qe=ke.prop(g.uY.mounted);if(Qe){if(Qe.tree.prop(Se)==this.data){if(Qe.overlay)for(let Ot of Qe.overlay)ie.push({from:Ot.from+Xe,to:Ot.to+Xe});else ie.push({from:Xe,to:Xe+ke.length});return}if(Qe.overlay){let Ot=ie.length;if(xe(Qe.tree,Qe.overlay[0].from+Xe),ie.length>Ot)return}}for(let Ot=0;Ot<ke.children.length;Ot++){let Ft=ke.children[Ot];Ft instanceof g.PH&&xe(Ft,ke.positions[Ot]+Xe)}};return xe(ge(A),0),ie}get allowsNesting(){return!0}}return G.setState=R.Pe.define(),G})();function ae(G,S,A){let q=G.facet(Gt),ie=ge(G).topNode;if(!q||q.allowsNesting)for(let xe=ie;xe;xe=xe.enter(S,A,g.Qj.ExcludeBuffers|g.Qj.EnterBracketed))xe.type.isTop&&(ie=xe);return ie}class se extends X{constructor(S,A,q){super(S,A,[],q),this.parser=A}static define(S){let A=ct(S.languageData);return new se(A,S.parser.configure({props:[Se.add(q=>q.isTop?A:void 0)]}),S.name)}configure(S,A){return new se(this.data,this.parser.configure(S),A||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ge(G){let S=G.field(X.state,!1);return S?S.tree:g.PH.empty}class Qt{constructor(S){this.doc=S,this.cursorPos=0,this.string="",this.cursor=S.iter()}get length(){return this.doc.length}syncTo(S){return this.string=this.cursor.next(S-this.cursorPos).value,this.cursorPos=S+this.string.length,this.cursorPos-this.string.length}chunk(S){return this.syncTo(S),this.string}get lineChunks(){return!0}read(S,A){let q=this.cursorPos-this.string.length;return S<q||A>=this.cursorPos?this.doc.sliceString(S,A):this.string.slice(S-q,A-q)}}let Wt=null;class Mt{constructor(S,A,q=[],ie,xe,ke,Xe,Qe){this.parser=S,this.state=A,this.fragments=q,this.tree=ie,this.treeLen=xe,this.viewport=ke,this.skipped=Xe,this.scheduleOn=Qe,this.parse=null,this.tempSkipped=[]}static create(S,A,q){return new Mt(S,A,[],g.PH.empty,0,q,[],null)}startParse(){return this.parser.startParse(new Qt(this.state.doc),this.fragments)}work(S,A){return null!=A&&A>=this.state.doc.length&&(A=void 0),this.tree!=g.PH.empty&&this.isDone(A??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var q;if("number"==typeof S){let ie=Date.now()+S;S=()=>Date.now()>ie}for(this.parse||(this.parse=this.startParse()),null!=A&&(null==this.parse.stoppedAt||this.parse.stoppedAt>A)&&A<this.state.doc.length&&this.parse.stopAt(A);;){let ie=this.parse.advance();if(ie){if(this.fragments=this.withoutTempSkipped(g.rr.addTree(ie,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(q=this.parse.stoppedAt)&&void 0!==q?q:this.state.doc.length,this.tree=ie,this.parse=null,!(this.treeLen<(A??this.state.doc.length)))return!0;this.parse=this.startParse()}if(S())return!1}})}takeTree(){let S,A;this.parse&&(S=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>S)&&this.parse.stopAt(S),this.withContext(()=>{for(;!(A=this.parse.advance()););}),this.treeLen=S,this.tree=A,this.fragments=this.withoutTempSkipped(g.rr.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(S){let A=Wt;Wt=this;try{return S()}finally{Wt=A}}withoutTempSkipped(S){for(let A;A=this.tempSkipped.pop();)S=He(S,A.from,A.to);return S}changes(S,A){let{fragments:q,tree:ie,treeLen:xe,viewport:ke,skipped:Xe}=this;if(this.takeTree(),!S.empty){let Qe=[];if(S.iterChangedRanges((Ot,Ft,bi,on)=>Qe.push({fromA:Ot,toA:Ft,fromB:bi,toB:on})),q=g.rr.applyChanges(q,Qe),ie=g.PH.empty,xe=0,ke={from:S.mapPos(ke.from,-1),to:S.mapPos(ke.to,1)},this.skipped.length){Xe=[];for(let Ot of this.skipped){let Ft=S.mapPos(Ot.from,1),bi=S.mapPos(Ot.to,-1);Ft<bi&&Xe.push({from:Ft,to:bi})}}}return new Mt(this.parser,A,q,ie,xe,ke,Xe,this.scheduleOn)}updateViewport(S){if(this.viewport.from==S.from&&this.viewport.to==S.to)return!1;this.viewport=S;let A=this.skipped.length;for(let q=0;q<this.skipped.length;q++){let{from:ie,to:xe}=this.skipped[q];ie<S.to&&xe>S.from&&(this.fragments=He(this.fragments,ie,xe),this.skipped.splice(q--,1))}return!(this.skipped.length>=A||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(S,A){this.skipped.push({from:S,to:A})}static getSkippingParser(S){return new class extends g.iX{createParse(A,q,ie){let xe=ie[0].from,ke=ie[ie.length-1].to;return{parsedPos:xe,advance(){let Qe=Wt;if(Qe){for(let Ot of ie)Qe.tempSkipped.push(Ot);S&&(Qe.scheduleOn=Qe.scheduleOn?Promise.all([Qe.scheduleOn,S]):S)}return this.parsedPos=ke,new g.PH(g.Z6.none,[],[],ke-xe)},stoppedAt:null,stopAt(){}}}}}isDone(S){S=Math.min(S,this.state.doc.length);let A=this.fragments;return this.treeLen>=S&&A.length&&0==A[0].from&&A[0].to>=S}static get(){return Wt}}function He(G,S,A){return g.rr.applyChanges(G,[{fromA:S,toA:A,fromB:S,toB:A}])}class Nt{constructor(S){this.context=S,this.tree=S.tree}apply(S){if(!S.docChanged&&this.tree==this.context.tree)return this;let A=this.context.changes(S.changes,S.state),q=this.context.treeLen==S.startState.doc.length?void 0:Math.max(S.changes.mapPos(this.context.treeLen),A.viewport.to);return A.work(20,q)||A.takeTree(),new Nt(A)}static init(S){let A=Math.min(3e3,S.doc.length),q=Mt.create(S.facet(Gt).parser,S,{from:0,to:A});return q.work(20,A)||q.takeTree(),new Nt(q)}}X.state=R.sU.define({create:Nt.init,update(G,S){for(let A of S.effects)if(A.is(X.setState))return A.value;return S.startState.facet(Gt)!=S.state.facet(Gt)?Nt.init(S.state):G.apply(S)}});let ri=G=>{let S=setTimeout(()=>G(),500);return()=>clearTimeout(S)};typeof requestIdleCallback<"u"&&(ri=G=>{let S=-1,A=setTimeout(()=>{S=requestIdleCallback(G,{timeout:400})},100);return()=>S<0?clearTimeout(A):cancelIdleCallback(S)});const oi=typeof navigator<"u"&&null!==(Ye=navigator.scheduling)&&void 0!==Ye&&Ye.isInputPending?()=>navigator.scheduling.isInputPending():null,Yt=le.Z9.fromClass(class{constructor(S){this.view=S,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(S){let A=this.view.state.field(X.state).context;(A.updateViewport(S.view.viewport)||this.view.viewport.to>A.treeLen)&&this.scheduleWork(),(S.docChanged||S.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(A)}scheduleWork(){if(this.working)return;let{state:S}=this.view,A=S.field(X.state);(A.tree!=A.context.tree||!A.context.isDone(S.doc.length))&&(this.working=ri(this.work))}work(S){this.working=null;let A=Date.now();if(this.chunkEnd<A&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=A+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:q,viewport:{to:ie}}=this.view,xe=q.field(X.state);if(xe.tree==xe.context.tree&&xe.context.isDone(ie+1e5))return;let ke=Date.now()+Math.min(this.chunkBudget,100,S&&!oi?Math.max(25,S.timeRemaining()-5):1e9),Xe=xe.context.treeLen<ie&&q.doc.length>ie+1e3,Qe=xe.context.work(()=>oi&&oi()||Date.now()>ke,ie+(Xe?0:1e5));this.chunkBudget-=Date.now()-A,(Qe||this.chunkBudget<=0)&&(xe.context.takeTree(),this.view.dispatch({effects:X.setState.of(new Nt(xe.context))})),this.chunkBudget>0&&!(Qe&&!Xe)&&this.scheduleWork(),this.checkAsyncSchedule(xe.context)}checkAsyncSchedule(S){S.scheduleOn&&(this.workScheduled++,S.scheduleOn.then(()=>this.scheduleWork()).catch(A=>(0,le.c_)(this.view.state,A)).then(()=>this.workScheduled--),S.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Gt=R.sj.define({combine:G=>G.length?G[0]:null,enables:G=>[X.state,Yt,le.Lz.contentAttributes.compute([G],S=>{let A=S.facet(G);return A&&A.name?{"data-language":A.name}:{}})]});class li{constructor(S,A=[]){this.language=S,this.support=A,this.extension=[S,A]}}const Kt=R.sj.define(),It=R.sj.define({combine:G=>{if(!G.length)return" ";let S=G[0];if(!S||/\S/.test(S)||Array.from(S).some(A=>A!=S[0]))throw new Error("Invalid indent unit: "+JSON.stringify(G[0]));return S}});function vt(G){let S=G.facet(It);return 9==S.charCodeAt(0)?G.tabSize*S.length:S.length}function Jt(G,S){let A="",q=G.tabSize,ie=G.facet(It)[0];if("\t"==ie){for(;S>=q;)A+="\t",S-=q;ie=" "}for(let xe=0;xe<S;xe++)A+=ie;return A}function wt(G,S){G instanceof R.$t&&(G=new me(G));for(let q of G.state.facet(Kt)){let ie=q(G,S);if(void 0!==ie)return ie}let A=ge(G.state);return A.length>=S?function pe(G,S,A){let q=S.resolveStack(A),ie=S.resolveInner(A,-1).resolve(A,0).enterUnfinishedNodesBefore(A);if(ie!=q.node){let xe=[];for(let ke=ie;ke&&!(ke.from<q.node.from||ke.to>q.node.to||ke.from==q.node.from&&ke.type==q.node.type);ke=ke.parent)xe.push(ke);for(let ke=xe.length-1;ke>=0;ke--)q={node:xe[ke],next:q}}return Ie(q,G,A)}(G,A,S):null}class me{constructor(S,A={}){this.state=S,this.options=A,this.unit=vt(S)}lineAt(S,A=1){let q=this.state.doc.lineAt(S),{simulateBreak:ie,simulateDoubleBreak:xe}=this.options;return null!=ie&&ie>=q.from&&ie<=q.to?xe&&ie==S?{text:"",from:S}:(A<0?ie<S:ie<=S)?{text:q.text.slice(ie-q.from),from:ie}:{text:q.text.slice(0,ie-q.from),from:q.from}:q}textAfterPos(S,A=1){if(this.options.simulateDoubleBreak&&S==this.options.simulateBreak)return"";let{text:q,from:ie}=this.lineAt(S,A);return q.slice(S-ie,Math.min(q.length,S+100-ie))}column(S,A=1){let{text:q,from:ie}=this.lineAt(S,A),xe=this.countColumn(q,S-ie),ke=this.options.overrideIndentation?this.options.overrideIndentation(ie):-1;return ke>-1&&(xe+=ke-this.countColumn(q,q.search(/\S|$/))),xe}countColumn(S,A=S.length){return(0,R.y$)(S,this.state.tabSize,A)}lineIndent(S,A=1){let{text:q,from:ie}=this.lineAt(S,A),xe=this.options.overrideIndentation;if(xe){let ke=xe(ie);if(ke>-1)return ke}return this.countColumn(q,q.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const de=new g.uY;function Ie(G,S,A){for(let q=G;q;q=q.next){let ie=it(q.node);if(ie)return ie(qe.create(S,A,q))}return 0}function it(G){let S=G.type.prop(de);if(S)return S;let q,A=G.firstChild;if(A&&(q=A.type.prop(g.uY.closedBy))){let ie=G.lastChild,xe=ie&&q.indexOf(ie.name)>-1;return ke=>kt(ke,!0,1,void 0,xe&&!function Ae(G){return G.pos==G.options.simulateBreak&&G.options.simulateDoubleBreak}(ke)?ie.from:void 0)}return null==G.parent?Je:null}function Je(){return 0}class qe extends me{constructor(S,A,q){super(S.state,S.options),this.base=S,this.pos=A,this.context=q}get node(){return this.context.node}static create(S,A,q){return new qe(S,A,q)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(S){let A=this.state.doc.lineAt(S.from);for(;;){let q=S.resolve(A.from);for(;q.parent&&q.parent.from==q.from;)q=q.parent;if(Pt(q,S))break;A=this.state.doc.lineAt(q.from)}return this.lineIndent(A.from)}continue(){return Ie(this.context.next,this.base,this.pos)}}function Pt(G,S){for(let A=S;A;A=A.parent)if(G==A)return!0;return!1}function St({closing:G,align:S=!0,units:A=1}){return q=>kt(q,S,A,G)}function kt(G,S,A,q,ie){let xe=G.textAfter,ke=xe.match(/^\s*/)[0].length,Xe=q&&xe.slice(ke,ke+q.length)==q||ie==G.pos+ke,Qe=S?function at(G){let S=G.node,A=S.childAfter(S.from),q=S.lastChild;if(!A)return null;let ie=G.options.simulateBreak,xe=G.state.doc.lineAt(A.from),ke=null==ie||ie<=xe.from?xe.to:Math.min(xe.to,ie);for(let Xe=A.to;;){let Qe=S.childAfter(Xe);if(!Qe||Qe==q)return null;if(!Qe.type.isSkipped){if(Qe.from>=ke)return null;let Ot=/^ */.exec(xe.text.slice(A.to-xe.from))[0].length;return{from:A.from,to:A.to+Ot}}Xe=Qe.to}}(G):null;return Qe?G.column(Xe?Qe.from:Qe.to):G.baseIndent+(Xe?0:G.unit*A)}function Lt({except:G,units:S=1}={}){return A=>{let q=G&&G.test(A.textAfter);return A.baseIndent+(q?0:S*A.unit)}}function k(){return R.$t.transactionFilter.of(G=>{if(!G.docChanged||!G.isUserEvent("input.type")&&!G.isUserEvent("input.complete"))return G;let S=G.startState.languageDataAt("indentOnInput",G.startState.selection.main.head);if(!S.length)return G;let A=G.newDoc,{head:q}=G.newSelection.main,ie=A.lineAt(q);if(q>ie.from+200)return G;let xe=A.sliceString(ie.from,q);if(!S.some(Ot=>Ot.test(xe)))return G;let{state:ke}=G,Xe=-1,Qe=[];for(let{head:Ot}of ke.selection.ranges){let Ft=ke.doc.lineAt(Ot);if(Ft.from==Xe)continue;Xe=Ft.from;let bi=wt(ke,Ft.from);if(null==bi)continue;let on=/^\s*/.exec(Ft.text)[0],Hi=Jt(ke,bi);on!=Hi&&Qe.push({from:Ft.from,to:Ft.from+on.length,insert:Hi})}return Qe.length?[G,{changes:Qe,sequential:!0}]:G})}const M=R.sj.define(),H=new g.uY;function Y(G){let S=G.firstChild,A=G.lastChild;return S&&S.to<A.from?{from:S.to,to:A.type.isError?G.to:A.from}:null}function L(G){let S=G.lastChild;return S&&S.to==G.to&&S.type.isError}function K(G,S,A){for(let q of G.facet(M)){let ie=q(G,S,A);if(ie)return ie}return function I(G,S,A){let q=ge(G);if(q.length<A)return null;let xe=null;for(let ke=q.resolveStack(A,1);ke;ke=ke.next){let Xe=ke.node;if(Xe.to<=A||Xe.from>A)continue;if(xe&&Xe.from<S)break;let Qe=Xe.type.prop(H);if(Qe&&(Xe.to<q.length-50||q.length==G.doc.length||!L(Xe))){let Ot=Qe(Xe,G);Ot&&Ot.from<=A&&Ot.from>=S&&Ot.to>A&&(xe=Ot)}}return xe}(G,S,A)}function J(G,S){let A=S.mapPos(G.from,1),q=S.mapPos(G.to,-1);return A>=q?void 0:{from:A,to:q}}const fe=R.Pe.define({map:J}),Oe=R.Pe.define({map:J});function Le(G){let S=[];for(let{head:A}of G.state.selection.ranges)S.some(q=>q.from<=A&&q.to>=A)||S.push(G.lineBlockAt(A));return S}const Ee=R.sU.define({create:()=>le.NZ.none,update(G,S){S.isUserEvent("delete")&&S.changes.iterChangedRanges((A,q)=>G=Ue(G,A,q)),G=G.map(S.changes);for(let A of S.effects)if(A.is(fe)&&!m(G,A.value.from,A.value.to)){let{preparePlaceholder:q}=S.state.facet(Tt),ie=q?le.NZ.replace({widget:new hi(q(S.state,A.value))}):zt;G=G.update({add:[ie.range(A.value.from,A.value.to)]})}else A.is(Oe)&&(G=G.update({filter:(q,ie)=>A.value.from!=q||A.value.to!=ie,filterFrom:A.value.from,filterTo:A.value.to}));return S.selection&&(G=Ue(G,S.selection.main.head)),G},provide:G=>le.Lz.decorations.from(G),toJSON(G,S){let A=[];return G.between(0,S.doc.length,(q,ie)=>{A.push(q,ie)}),A},fromJSON(G){if(!Array.isArray(G)||G.length%2)throw new RangeError("Invalid JSON for fold state");let S=[];for(let A=0;A<G.length;){let q=G[A++],ie=G[A++];if("number"!=typeof q||"number"!=typeof ie)throw new RangeError("Invalid JSON for fold state");S.push(zt.range(q,ie))}return le.NZ.set(S,!0)}});function Ue(G,S,A=S){let q=!1;return G.between(S,A,(ie,xe)=>{ie<A&&xe>S&&(q=!0)}),q?G.update({filterFrom:S,filterTo:A,filter:(ie,xe)=>ie>=A||xe<=S}):G}function f(G,S,A){var q;let ie=null;return null===(q=G.field(Ee,!1))||void 0===q||q.between(S,A,(xe,ke)=>{(!ie||ie.from>xe)&&(ie={from:xe,to:ke})}),ie}function m(G,S,A){let q=!1;return G.between(S,S,(ie,xe)=>{ie==S&&xe==A&&(q=!0)}),q}function V(G,S){return G.field(Ee,!1)?S:S.concat(R.Pe.appendConfig.of(Rt()))}function Pe(G,S,A=!0){let q=G.state.doc.lineAt(S.from).number,ie=G.state.doc.lineAt(S.to).number;return le.Lz.announce.of(`${G.state.phrase(A?"Folded lines":"Unfolded lines")} ${q} ${G.state.phrase("to")} ${ie}.`)}const bt=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:G=>{for(let S of Le(G)){let A=K(G.state,S.from,S.to);if(A)return G.dispatch({effects:V(G.state,[fe.of(A),Pe(G,A)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:G=>{if(!G.state.field(Ee,!1))return!1;let S=[];for(let A of Le(G)){let q=f(G.state,A.from,A.to);q&&S.push(Oe.of(q),Pe(G,q,!1))}return S.length&&G.dispatch({effects:S}),S.length>0}},{key:"Ctrl-Alt-[",run:G=>{let{state:S}=G,A=[];for(let q=0;q<S.doc.length;){let ie=G.lineBlockAt(q),xe=K(S,ie.from,ie.to);xe&&A.push(fe.of(xe)),q=(xe?G.lineBlockAt(xe.to):ie).to+1}return A.length&&G.dispatch({effects:V(G.state,A)}),!!A.length}},{key:"Ctrl-Alt-]",run:G=>{let S=G.state.field(Ee,!1);if(!S||!S.size)return!1;let A=[];return S.between(0,G.state.doc.length,(q,ie)=>{A.push(Oe.of({from:q,to:ie}))}),G.dispatch({effects:A}),!0}}],ai={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},Tt=R.sj.define({combine:G=>(0,R.QR)(G,ai)});function Rt(G){let S=[Ee,fi];return G&&S.push(Tt.of(G)),S}function qt(G,S){let{state:A}=G,q=A.facet(Tt),ie=ke=>{let Xe=G.lineBlockAt(G.posAtDOM(ke.target)),Qe=f(G.state,Xe.from,Xe.to);Qe&&G.dispatch({effects:Oe.of(Qe)}),ke.preventDefault()};if(q.placeholderDOM)return q.placeholderDOM(G,ie,S);let xe=document.createElement("span");return xe.textContent=q.placeholderText,xe.setAttribute("aria-label",A.phrase("folded code")),xe.title=A.phrase("unfold"),xe.className="cm-foldPlaceholder",xe.onclick=ie,xe}const zt=le.NZ.replace({widget:new class extends le.xO{toDOM(G){return qt(G,null)}}});class hi extends le.xO{constructor(S){super(),this.value=S}eq(S){return this.value==S.value}toDOM(S){return qt(S,this.value)}}const ki={openText:"\u2304",closedText:"\u203a",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class yi extends le.wJ{constructor(S,A){super(),this.config=S,this.open=A}eq(S){return this.config==S.config&&this.open==S.open}toDOM(S){if(this.config.markerDOM)return this.config.markerDOM(this.open);let A=document.createElement("span");return A.textContent=this.open?this.config.openText:this.config.closedText,A.title=S.state.phrase(this.open?"Fold line":"Unfold line"),A}}function Ni(G={}){let S={...ki,...G},A=new yi(S,!0),q=new yi(S,!1),ie=le.Z9.fromClass(class{constructor(ke){this.from=ke.viewport.from,this.markers=this.buildMarkers(ke)}update(ke){(ke.docChanged||ke.viewportChanged||ke.startState.facet(Gt)!=ke.state.facet(Gt)||ke.startState.field(Ee,!1)!=ke.state.field(Ee,!1)||ge(ke.startState)!=ge(ke.state)||S.foldingChanged(ke))&&(this.markers=this.buildMarkers(ke.view))}buildMarkers(ke){let Xe=new R.vB;for(let Qe of ke.viewportLineBlocks){let Ot=f(ke.state,Qe.from,Qe.to)?q:K(ke.state,Qe.from,Qe.to)?A:null;Ot&&Xe.add(Qe.from,Qe.from,Ot)}return Xe.finish()}}),{domEventHandlers:xe}=S;return[ie,(0,le.cU)({class:"cm-foldGutter",markers(ke){var Xe;return(null===(Xe=ke.plugin(ie))||void 0===Xe?void 0:Xe.markers)||R.om.empty},initialSpacer:()=>new yi(S,!1),domEventHandlers:{...xe,click:(ke,Xe,Qe)=>{if(xe.click&&xe.click(ke,Xe,Qe))return!0;let Ot=f(ke.state,Xe.from,Xe.to);if(Ot)return ke.dispatch({effects:Oe.of(Ot)}),!0;let Ft=K(ke.state,Xe.from,Xe.to);return!!Ft&&(ke.dispatch({effects:fe.of(Ft)}),!0)}}}),Rt()]}const fi=le.Lz.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class pi{constructor(S,A){let q;function ie(Xe){let Qe=Ve.G.newName();return(q||(q=Object.create(null)))["."+Qe]=Xe,Qe}this.specs=S;const xe="string"==typeof A.all?A.all:A.all?ie(A.all):void 0,ke=A.scope;this.scope=ke instanceof X?Xe=>Xe.prop(Se)==ke.data:ke?Xe=>Xe==ke:void 0,this.style=(0,Te.az)(S.map(Xe=>({tag:Xe.tag,class:Xe.class||ie(Object.assign({},Xe,{tag:null}))})),{all:xe}).style,this.module=q?new Ve.G(q):null,this.themeType=A.themeType}static define(S,A){return new pi(S,A||{})}}const di=R.sj.define(),gi=R.sj.define({combine:G=>G.length?[G[0]]:null});function xi(G){let S=G.facet(di);return S.length?S:G.facet(gi)}function Di(G,S){let q,A=[mi];return G instanceof pi&&(G.module&&A.push(le.Lz.styleModule.of(G.module)),q=G.themeType),A.push(S?.fallback?gi.of(G):q?di.computeN([le.Lz.darkTheme],ie=>ie.facet(le.Lz.darkTheme)==("dark"==q)?[G]:[]):di.of(G)),A}class vi{constructor(S){this.markCache=Object.create(null),this.tree=ge(S.state),this.decorations=this.buildDeco(S,xi(S.state)),this.decoratedTo=S.viewport.to}update(S){let A=ge(S.state),q=xi(S.state),ie=q!=xi(S.startState),{viewport:xe}=S.view,ke=S.changes.mapPos(this.decoratedTo,1);A.length<xe.to&&!ie&&A.type==this.tree.type&&ke>=xe.to?(this.decorations=this.decorations.map(S.changes),this.decoratedTo=ke):(A!=this.tree||S.viewportChanged||ie)&&(this.tree=A,this.decorations=this.buildDeco(S.view,q),this.decoratedTo=xe.to)}buildDeco(S,A){if(!A||!this.tree.length)return le.NZ.none;let q=new R.vB;for(let{from:ie,to:xe}of S.visibleRanges)(0,Te.DM)(this.tree,A,(ke,Xe,Qe)=>{q.add(ke,Xe,this.markCache[Qe]||(this.markCache[Qe]=le.NZ.mark({class:Qe})))},ie,xe);return q.finish()}}const mi=R.Nb.high(le.Z9.fromClass(vi,{decorations:G=>G.decorations})),en=pi.define([{tag:Te._A.meta,color:"#404740"},{tag:Te._A.link,textDecoration:"underline"},{tag:Te._A.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Te._A.emphasis,fontStyle:"italic"},{tag:Te._A.strong,fontWeight:"bold"},{tag:Te._A.strikethrough,textDecoration:"line-through"},{tag:Te._A.keyword,color:"#708"},{tag:[Te._A.atom,Te._A.bool,Te._A.url,Te._A.contentSeparator,Te._A.labelName],color:"#219"},{tag:[Te._A.literal,Te._A.inserted],color:"#164"},{tag:[Te._A.string,Te._A.deleted],color:"#a11"},{tag:[Te._A.regexp,Te._A.escape,Te._A.special(Te._A.string)],color:"#e40"},{tag:Te._A.definition(Te._A.variableName),color:"#00f"},{tag:Te._A.local(Te._A.variableName),color:"#30a"},{tag:[Te._A.typeName,Te._A.namespace],color:"#085"},{tag:Te._A.className,color:"#167"},{tag:[Te._A.special(Te._A.variableName),Te._A.macroName],color:"#256"},{tag:Te._A.definition(Te._A.propertyName),color:"#00c"},{tag:Te._A.comment,color:"#940"},{tag:Te._A.invalid,color:"#f00"}]),tn=le.Lz.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),cn=R.sj.define({combine:G=>(0,R.QR)(G,{afterCursor:!0,brackets:"()[]{}",maxScanDistance:1e4,renderMatch:wi})}),Si=le.NZ.mark({class:"cm-matchingBracket"}),_i=le.NZ.mark({class:"cm-nonmatchingBracket"});function wi(G){let S=[],A=G.matched?Si:_i;return S.push(A.range(G.start.from,G.start.to)),G.end&&S.push(A.range(G.end.from,G.end.to)),S}function Xi(G){let S=[],A=G.facet(cn);for(let q of G.selection.ranges){if(!q.empty)continue;let ie=Bi(G,q.head,-1,A)||q.head>0&&Bi(G,q.head-1,1,A)||A.afterCursor&&(Bi(G,q.head,1,A)||q.head<G.doc.length&&Bi(G,q.head+1,-1,A));ie&&(S=S.concat(A.renderMatch(ie,G)))}return le.NZ.set(S,!0)}const ei=[le.Z9.fromClass(class{constructor(G){this.paused=!1,this.decorations=Xi(G.state)}update(G){(G.docChanged||G.selectionSet||this.paused)&&(G.view.composing?(this.decorations=this.decorations.map(G.changes),this.paused=!0):(this.decorations=Xi(G.state),this.paused=!1))}},{decorations:G=>G.decorations}),tn];function Ji(G={}){return[cn.of(G),ei]}const Gi=new g.uY;function Ut(G,S,A){let q=G.prop(S<0?g.uY.openedBy:g.uY.closedBy);if(q)return q;if(1==G.name.length){let ie=A.indexOf(G.name);if(ie>-1&&ie%2==(S<0?1:0))return[A[ie+S]]}return null}function $i(G){let S=G.type.prop(Gi);return S?S(G.node):G}function Bi(G,S,A,q={}){let ie=q.maxScanDistance||1e4,xe=q.brackets||"()[]{}",ke=ge(G),Xe=ke.resolveInner(S,A);for(let Qe=Xe;Qe;Qe=Qe.parent){let Ot=Ut(Qe.type,A,xe);if(Ot&&Qe.from<Qe.to){let Ft=$i(Qe);if(Ft&&(A>0?S>=Ft.from&&S<Ft.to:S>Ft.from&&S<=Ft.to))return Q(0,0,A,Qe,Ft,Ot,xe)}}return function u(G,S,A,q,ie,xe,ke){if(A<0?!S:S==G.doc.length)return null;let Xe=A<0?G.sliceDoc(S-1,S):G.sliceDoc(S,S+1),Qe=ke.indexOf(Xe);if(Qe<0||Qe%2==0!=A>0)return null;let Ot={from:A<0?S-1:S,to:A>0?S+1:S},Ft=G.doc.iterRange(S,A>0?G.doc.length:0),bi=0;for(let on=0;!Ft.next().done&&on<=xe;){let Hi=Ft.value;A<0&&(on+=Hi.length);let On=S+on*A;for(let Ti=A>0?0:Hi.length-1,Nn=A>0?Hi.length:-1;Ti!=Nn;Ti+=A){let un=ke.indexOf(Hi[Ti]);if(!(un<0||q.resolveInner(On+Ti,1).type!=ie))if(un%2==0==A>0)bi++;else{if(1==bi)return{start:Ot,end:{from:On+Ti,to:On+Ti+1},matched:un>>1==Qe>>1};bi--}}A>0&&(on+=Hi.length)}return Ft.done?{start:Ot,matched:!1}:null}(G,S,A,ke,Xe.type,ie,xe)}function Q(G,S,A,q,ie,xe,ke){let Xe=q.parent,Qe={from:ie.from,to:ie.to},Ot=0,Ft=Xe?.cursor();if(Ft&&(A<0?Ft.childBefore(q.from):Ft.childAfter(q.to)))do{if(A<0?Ft.to<=q.from:Ft.from>=q.to){if(0==Ot&&xe.indexOf(Ft.type.name)>-1&&Ft.from<Ft.to){let bi=$i(Ft);return{start:Qe,end:bi?{from:bi.from,to:bi.to}:void 0,matched:!0}}if(Ut(Ft.type,A,ke))Ot++;else if(Ut(Ft.type,-A,ke)){if(0==Ot){let bi=$i(Ft);return{start:Qe,end:bi&&bi.from<bi.to?{from:bi.from,to:bi.to}:void 0,matched:!1}}Ot--}}}while(A<0?Ft.prevSibling():Ft.nextSibling());return{start:Qe,matched:!1}}function d(G,S,A,q=0,ie=0){null==S&&-1==(S=G.search(/[^\s\u00a0]/))&&(S=G.length);let xe=ie;for(let ke=q;ke<S;ke++)9==G.charCodeAt(ke)?xe+=A-xe%A:xe++;return xe}class O{constructor(S,A,q,ie){this.string=S,this.tabSize=A,this.indentUnit=q,this.overrideIndent=ie,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return 0==this.pos}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(S){let q,A=this.string.charAt(this.pos);if(q="string"==typeof S?A==S:A&&(S instanceof RegExp?S.test(A):S(A)),q)return++this.pos,A}eatWhile(S){let A=this.pos;for(;this.eat(S););return this.pos>A}eatSpace(){let S=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>S}skipToEnd(){this.pos=this.string.length}skipTo(S){let A=this.string.indexOf(S,this.pos);if(A>-1)return this.pos=A,!0}backUp(S){this.pos-=S}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=d(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var S;return null!==(S=this.overrideIndent)&&void 0!==S?S:d(this.string,null,this.tabSize)}match(S,A,q){if("string"==typeof S){let ie=ke=>q?ke.toLowerCase():ke;return ie(this.string.substr(this.pos,S.length))==ie(S)?(!1!==A&&(this.pos+=S.length),!0):null}{let ie=this.string.slice(this.pos).match(S);return ie&&ie.index>0?null:(ie&&!1!==A&&(this.pos+=ie[0].length),ie)}}current(){return this.string.slice(this.start,this.pos)}}function N(G){if("object"!=typeof G)return G;let S={};for(let A in G){let q=G[A];S[A]=q instanceof Array?q.slice():q}return S}const $=new WeakMap;class re extends X{constructor(S){let ie,A=ct(S.languageData),q=function T(G){return{name:G.name||"",token:G.token,blankLine:G.blankLine||(()=>{}),startState:G.startState||(()=>!0),copyState:G.copyState||N,indent:G.indent||(()=>null),languageData:G.languageData||{},tokenTable:G.tokenTable||ht,mergeTokens:!1!==G.mergeTokens}}(S);super(A,new class extends g.iX{createParse(ke,Xe,Qe){return new ot(ie,ke,Xe,Qe)}},[],S.name),this.topNode=function mn(G,S){let A=g.Z6.define({id:jt.length,name:"Document",props:[Se.add(()=>G),de.add(()=>q=>S.getIndent(q))],top:!0});return jt.push(A),A}(A,this),ie=this,this.streamParser=q,this.stateAfter=new g.uY({perNode:!0}),this.tokenTable=S.tokenTable?new gn(q.tokenTable):Un}static define(S){return new re(S)}getIndent(S){let A,{overrideIndentation:q}=S.options;q&&(A=$.get(S.state),null!=A&&A<S.pos-1e4&&(A=void 0));let xe,ke,ie=ce(this,S.node.tree,S.node.from,S.node.from,A??S.pos);if(ie?(ke=ie.state,xe=ie.pos+1):(ke=this.streamParser.startState(S.unit),xe=S.node.from),S.pos-xe>1e4)return null;for(;xe<S.pos;){let Qe=S.state.doc.lineAt(xe),Ot=Math.min(S.pos,Qe.to);if(Qe.length){let Ft=q?q(Qe.from):-1,bi=new O(Qe.text,S.state.tabSize,S.unit,Ft<0?void 0:Ft);for(;bi.pos<Ot-Qe.from;)gt(this.streamParser.token,bi,ke)}else this.streamParser.blankLine(ke,S.unit);if(Ot==S.pos)break;xe=Qe.to+1}let Xe=S.lineAt(S.pos);return q&&null==A&&$.set(S.state,Xe.from),this.streamParser.indent(ke,/^\s*(.*)/.exec(Xe.text)[1],S)}get allowsNesting(){return!1}}function ce(G,S,A,q,ie){let xe=A>=q&&A+S.length<=ie&&S.prop(G.stateAfter);if(xe)return{state:G.streamParser.copyState(xe),pos:A+S.length};for(let ke=S.children.length-1;ke>=0;ke--){let Xe=S.children[ke],Qe=A+S.positions[ke],Ot=Xe instanceof g.PH&&Qe<ie&&ce(G,Xe,Qe,q,ie);if(Ot)return Ot}return null}function Ce(G,S,A,q,ie){if(ie&&A<=0&&q>=S.length)return S;!ie&&0==A&&S.type==G.topNode&&(ie=!0);for(let xe=S.children.length-1;xe>=0;xe--){let Qe,ke=S.positions[xe],Xe=S.children[xe];if(ke<q&&Xe instanceof g.PH){if(!(Qe=Ce(G,Xe,A-ke,q-ke,ie)))break;return ie?new g.PH(S.type,S.children.slice(0,xe).concat(Qe),S.positions.slice(0,xe+1),ke+Qe.length):Qe}}return null}class ot{constructor(S,A,q,ie){this.lang=S,this.input=A,this.fragments=q,this.ranges=ie,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=ie[ie.length-1].to;let xe=Mt.get(),ke=ie[0].from,{state:Xe,tree:Qe}=function je(G,S,A,q,ie){for(let xe of S){let Ot,Xe=xe.to-(xe.openEnd?25:0),Qe=xe.from+(xe.openStart?25:0)<=A&&Xe>A&&ce(G,xe.tree,0-xe.offset,A,Xe);if(Qe&&Qe.pos<=q&&(Ot=Ce(G,xe.tree,A+xe.offset,Qe.pos+xe.offset,!1)))return{state:Qe.state,tree:Ot}}return{state:G.streamParser.startState(ie?vt(ie):4),tree:g.PH.empty}}(S,q,ke,this.to,xe?.state);this.state=Xe,this.parsedPos=this.chunkStart=ke+Qe.length;for(let Ot=0;Ot<Qe.children.length;Ot++)this.chunks.push(Qe.children[Ot]),this.chunkPos.push(Qe.positions[Ot]);xe&&this.parsedPos<xe.viewport.from-1e5&&ie.some(Ot=>Ot.from<=xe.viewport.from&&Ot.to>=xe.viewport.from)&&(this.state=this.lang.streamParser.startState(vt(xe.state)),xe.skipUntilInView(this.parsedPos,xe.viewport.from),this.parsedPos=xe.viewport.from),this.moveRangeIndex()}advance(){let S=Mt.get(),A=null==this.stoppedAt?this.to:Math.min(this.to,this.stoppedAt),q=Math.min(A,this.chunkStart+512);for(S&&(q=Math.min(q,S.viewport.to));this.parsedPos<q;)this.parseLine(S);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=A?this.finish():S&&this.parsedPos>=S.viewport.to?(S.skipUntilInView(this.parsedPos,A),this.finish()):null}stopAt(S){this.stoppedAt=S}lineAfter(S){let A=this.input.chunk(S);if(this.input.lineChunks)"\n"==A&&(A="");else{let q=A.indexOf("\n");q>-1&&(A=A.slice(0,q))}return S+A.length<=this.to?A:A.slice(0,this.to-S)}nextLine(){let S=this.parsedPos,A=this.lineAfter(S),q=S+A.length;for(let ie=this.rangeIndex;;){let xe=this.ranges[ie].to;if(xe>=q||(A=A.slice(0,xe-(q-A.length)),ie++,ie==this.ranges.length))break;let ke=this.ranges[ie].from,Xe=this.lineAfter(ke);A+=Xe,q=ke+Xe.length}return{line:A,end:q}}skipGapsTo(S,A,q){for(;;){let ie=this.ranges[this.rangeIndex].to,xe=S+A;if(q>0?ie>xe:ie>=xe)break;A+=this.ranges[++this.rangeIndex].from-ie}return A}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(S,A,q,ie){let xe=4;if(this.ranges.length>1){A+=ie=this.skipGapsTo(A,ie,1);let Xe=this.chunk.length;q+=ie=this.skipGapsTo(q,ie,-1),xe+=this.chunk.length-Xe}let ke=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&4==xe&&ke>=0&&this.chunk[ke]==S&&this.chunk[ke+2]==A?this.chunk[ke+2]=q:this.chunk.push(S,A,q,xe),ie}parseLine(S){let{line:A,end:q}=this.nextLine(),ie=0,{streamParser:xe}=this.lang,ke=new O(A,S?S.state.tabSize:4,S?vt(S.state):2);if(ke.eol())xe.blankLine(this.state,ke.indentUnit);else for(;!ke.eol();){let Xe=gt(xe.token,ke,this.state);if(Xe&&(ie=this.emitToken(this.lang.tokenTable.resolve(Xe),this.parsedPos+ke.start,this.parsedPos+ke.pos,ie)),ke.start>1e4)break}this.parsedPos=q,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let S=g.PH.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Ci,topID:0,maxBufferLength:512,reused:this.chunkReused});S=new g.PH(S.type,S.children,S.positions,S.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(S),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new g.PH(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function gt(G,S,A){S.start=S.pos;for(let q=0;q<10;q++){let ie=G(S,A);if(S.pos>S.start)return ie}throw new Error("Stream parser failed to advance stream.")}const ht=Object.create(null),jt=[g.Z6.none],Ci=new g.fI(jt),$t=[],zi=Object.create(null),pn=Object.create(null);for(let[G,S]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])pn[G]=rn(ht,S);class gn{constructor(S){this.extra=S,this.table=Object.assign(Object.create(null),pn)}resolve(S){return S?this.table[S]||(this.table[S]=rn(this.extra,S)):0}}const Un=new gn(ht);function Ri(G,S){$t.indexOf(G)>-1||($t.push(G),console.warn(S))}function rn(G,S){let A=[];for(let Xe of S.split(" ")){let Qe=[];for(let Ot of Xe.split(".")){let Ft=G[Ot]||Te._A[Ot];Ft?"function"==typeof Ft?Qe.length?Qe=Qe.map(Ft):Ri(Ot,`Modifier ${Ot} used at start of tag`):Qe.length?Ri(Ot,`Tag ${Ot} used as modifier`):Qe=Array.isArray(Ft)?Ft:[Ft]:Ri(Ot,`Unknown highlighting tag ${Ot}`)}for(let Ot of Qe)A.push(Ot)}if(!A.length)return 0;let q=S.replace(/ /g,"_"),ie=q+" "+A.map(Xe=>Xe.id),xe=zi[ie];if(xe)return xe.id;let ke=zi[ie]=g.Z6.define({id:jt.length,name:q,props:[(0,Te.pn)({[q]:A})]});return jt.push(ke),ke.id}},738(Ei,At,We){"use strict";We.d(At,{$w:()=>ri,bu:()=>ci});var R=We(3161),le=We(1380),Te=We(4937);class Ve{constructor(L,K,J){this.from=L,this.to=K,this.diagnostic=J}}class Ye{constructor(L,K,J){this.diagnostics=L,this.panel=K,this.selected=J}static init(L,K,J){let fe=J.facet(Gt).markerFilter;fe&&(L=fe(L,J));let Oe=L.slice().sort((ne,ue)=>ne.from-ue.from||ne.to-ue.to),Le=new le.vB,Ee=[],Ue=0,P=J.doc.iter(),f=0,m=J.doc.length;for(let ne=0;;){let Pe,$e,ue=ne==Oe.length?null:Oe[ne];if(!ue&&!Ee.length)break;if(Ee.length)Pe=Ue,$e=Ee.reduce((mt,bt)=>Math.min(mt,bt.to),ue&&ue.from>Pe?ue.from:1e8);else{if(Pe=ue.from,Pe>m)break;$e=ue.to,Ee.push(ue),ne++}for(;ne<Oe.length;){let mt=Oe[ne];if(mt.from!=Pe||!(mt.to>mt.from||mt.to==Pe)){$e=Math.min(mt.from,$e);break}Ee.push(mt),ne++,$e=Math.min(mt.to,$e)}$e=Math.min($e,m);let lt=!1;if(Ee.some(mt=>mt.from==Pe&&(mt.to==$e||$e==m))&&(lt=Pe==$e,!lt&&$e-Pe<10)){let mt=Pe-(f+P.value.length);mt>0&&(P.next(mt),f=Pe);for(let bt=Pe;;){if(bt>=$e){lt=!0;break}if(!P.lineBreak&&f+P.value.length>bt)break;bt=f+P.value.length,f+=P.value.length,P.next()}}let rt=Ae(Ee);if(lt)Le.add(Pe,Pe,R.NZ.widget({widget:new Jt(rt),diagnostics:Ee.slice()}));else{let mt=Ee.reduce((bt,ai)=>ai.markClass?bt+" "+ai.markClass:bt,"");Le.add(Pe,$e,R.NZ.mark({class:"cm-lintRange cm-lintRange-"+rt+mt,diagnostics:Ee.slice(),inclusiveEnd:Ee.some(bt=>bt.to>$e)}))}if(Ue=$e,Ue==m)break;for(let mt=0;mt<Ee.length;mt++)Ee[mt].to<=Ue&&Ee.splice(mt--,1)}let V=Le.finish();return new Ye(V,K,Se(V))}}function Se(I,L=null,K=0){let J=null;return I.between(K,1e9,(fe,Oe,{spec:Le})=>{if(!(L&&Le.diagnostics.indexOf(L)<0))if(J){if(Le.diagnostics.indexOf(J.diagnostic)<0)return!1;J=new Ve(J.from,Oe,J.diagnostic)}else J=new Ve(fe,Oe,L||Le.diagnostics[0])}),J}function Ke(I,L){return I.field(we,!1)?L:L.concat(le.Pe.appendConfig.of(k))}const ae=le.Pe.define(),se=le.Pe.define(),ge=le.Pe.define(),we=le.sU.define({create:()=>new Ye(R.NZ.none,null,null),update(I,L){if(L.docChanged&&I.diagnostics.size){let K=I.diagnostics.map(L.changes),J=null,fe=I.panel;if(I.selected){let Oe=L.changes.mapPos(I.selected.from,1);J=Se(K,I.selected.diagnostic,Oe)||Se(K,null,Oe)}!K.size&&fe&&L.state.facet(Gt).autoPanel&&(fe=null),I=new Ye(K,fe,J)}for(let K of L.effects)if(K.is(ae)){let J=L.state.facet(Gt).autoPanel?K.value.length?Ne.open:null:I.panel;I=Ye.init(K.value,J,L.state)}else K.is(se)?I=new Ye(I.diagnostics,K.value?Ne.open:null,I.selected):K.is(ge)&&(I=new Ye(I.diagnostics,I.panel,K.value));return I},provide:I=>[R.S7.from(I,L=>L.panel),R.Lz.decorations.from(I,L=>L.diagnostics)]}),ze=R.NZ.mark({class:"cm-lintRange cm-lintRange-active"});function Ct(I,L,K){let fe,{diagnostics:J}=I.state.field(we),Oe=-1,Le=-1;J.between(L-(K<0?1:0),L+(K>0?1:0),(Ue,P,{spec:f})=>{if(L>=Ue&&L<=P&&(Ue==P||(L>Ue||K>0)&&(L<P||K<0)))return fe=f.diagnostics,Oe=Ue,Le=P,!1});let Ee=I.state.facet(Gt).tooltipFilter;return fe&&Ee&&(fe=Ee(fe,I.state)),fe?{pos:Oe,end:Le,above:!0,create:()=>({dom:Qt(I,fe)})}:null}function Qt(I,L){return(0,Te.A)("ul",{class:"cm-tooltip-lint"},L.map(K=>vt(I,K,!1)))}const Mt=I=>{let L=I.state.field(we,!1);return!(!L||!L.panel||(I.dispatch({effects:se.of(!1)}),0))},ri=[{key:"Mod-Shift-m",run:I=>{let L=I.state.field(we,!1);(!L||!L.panel)&&I.dispatch({effects:Ke(I.state,[se.of(!0)])});let K=(0,R.ld)(I,Ne.open);return K&&K.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:I=>{let L=I.state.field(we,!1);if(!L)return!1;let K=I.state.selection.main,J=Se(L.diagnostics,null,K.to+1);return!(!J&&(J=Se(L.diagnostics,null,0),!J||J.from==K.from&&J.to==K.to)||(I.dispatch({selection:{anchor:J.from,head:J.to},scrollIntoView:!0}),(0,R.ab)(I,J.from,1,{tooltip:_e,until:fe=>fe.docChanged||fe.newSelection.main.head<J.from||fe.newSelection.main.head>J.to}),0))}}],oi=R.Z9.fromClass(class{constructor(I){this.view=I,this.timeout=-1,this.set=!0;let{delay:L}=I.state.facet(Gt);this.lintTime=Date.now()+L,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,L)}run(){clearTimeout(this.timeout);let I=Date.now();if(I<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-I);else{this.set=!1;let{state:L}=this.view,{sources:K}=L.facet(Gt);K.length&&function Yt(I,L,K){let J=[],fe=-1;for(let Oe of I)Oe.then(Le=>{J.push(Le),clearTimeout(fe),J.length==I.length?L(J):fe=setTimeout(()=>L(J),200)},K)}(K.map(J=>Promise.resolve(J(this.view))),J=>{this.view.state.doc==L.doc&&this.view.dispatch(function X(I,L){return{effects:Ke(I,[ae.of(L)])}}(this.view.state,J.reduce((fe,Oe)=>fe.concat(Oe))))},J=>{(0,R.c_)(this.view.state,J)})}}update(I){let L=I.state.facet(Gt);(I.docChanged||L!=I.startState.facet(Gt)||L.needsRefresh&&L.needsRefresh(I))&&(this.lintTime=Date.now()+L.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,L.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),Gt=le.sj.define({combine:I=>({sources:I.map(L=>L.source).filter(L=>null!=L),...(0,le.QR)(I.map(L=>L.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:li,tooltipFilter:li,needsRefresh:(L,K)=>L?K?J=>L(J)||K(J):L:K,hideOn:(L,K)=>L?K?(J,fe,Oe)=>L(J,fe,Oe)||K(J,fe,Oe):L:K,autoPanel:(L,K)=>L||K})})});function li(I,L){return I?L?(K,J)=>L(I(K,J),J):I:L}function ci(I,L={}){return[Gt.of({source:I,config:L}),oi,k]}function It(I){let L=[];if(I)e:for(let{name:K}of I){for(let J=0;J<K.length;J++){let fe=K[J];if(/[a-zA-Z]/.test(fe)&&!L.some(Oe=>Oe.toLowerCase()==fe.toLowerCase())){L.push(fe);continue e}}L.push("")}return L}function vt(I,L,K){var J;let fe=K?It(L.actions):[];return(0,Te.A)("li",{class:"cm-diagnostic cm-diagnostic-"+L.severity},(0,Te.A)("span",{class:"cm-diagnosticText"},L.renderMessage?L.renderMessage(I):L.message),null===(J=L.actions)||void 0===J?void 0:J.map((Oe,Le)=>{let Ee=!1,Ue=ne=>{if(ne.preventDefault(),Ee)return;Ee=!0;let ue=Se(I.state.field(we).diagnostics,L);ue&&Oe.apply(I,ue.from,ue.to)},{name:P}=Oe,f=fe[Le]?P.indexOf(fe[Le]):-1,m=f<0?P:[P.slice(0,f),(0,Te.A)("u",P.slice(f,f+1)),P.slice(f+1)];return(0,Te.A)("button",{type:"button",class:"cm-diagnosticAction"+(Oe.markClass?" "+Oe.markClass:""),onclick:Ue,onmousedown:Ue,"aria-label":` Action: ${P}${f<0?"":` (access key "${fe[Le]})"`}.`},m)}),L.source&&(0,Te.A)("div",{class:"cm-diagnosticSource"},L.source))}class Jt extends R.xO{constructor(L){super(),this.sev=L}eq(L){return L.sev==this.sev}toDOM(){return(0,Te.A)("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class wt{constructor(L,K){this.diagnostic=K,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=vt(L,K,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Ne{constructor(L){this.view=L,this.items=[],this.list=(0,Te.A)("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:fe=>{if(!(fe.ctrlKey||fe.altKey||fe.metaKey)){if(27==fe.keyCode)Mt(this.view),this.view.focus();else if(38==fe.keyCode||33==fe.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==fe.keyCode||34==fe.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==fe.keyCode)this.moveSelection(0);else if(35==fe.keyCode)this.moveSelection(this.items.length-1);else if(13==fe.keyCode)this.view.focus();else{if(!(fe.keyCode>=65&&fe.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:Oe}=this.items[this.selectedIndex],Le=It(Oe.actions);for(let Ee=0;Ee<Le.length;Ee++)if(Le[Ee].toUpperCase().charCodeAt(0)==fe.keyCode){let Ue=Se(this.view.state.field(we).diagnostics,Oe);Ue&&Oe.actions[Ee].apply(L,Ue.from,Ue.to)}}}fe.preventDefault()}},onclick:fe=>{for(let Oe=0;Oe<this.items.length;Oe++)this.items[Oe].dom.contains(fe.target)&&this.moveSelection(Oe)}}),this.dom=(0,Te.A)("div",{class:"cm-panel-lint"},this.list,(0,Te.A)("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Mt(this.view)},"\xd7")),this.update()}get selectedIndex(){let L=this.view.state.field(we).selected;if(!L)return-1;for(let K=0;K<this.items.length;K++)if(this.items[K].diagnostic==L.diagnostic)return K;return-1}update(){let{diagnostics:L,selected:K}=this.view.state.field(we),J=0,fe=!1,Oe=null,Le=new Set;for(L.between(0,this.view.state.doc.length,(Ee,Ue,{spec:P})=>{for(let f of P.diagnostics){if(Le.has(f))continue;Le.add(f);let V,m=-1;for(let ne=J;ne<this.items.length;ne++)if(this.items[ne].diagnostic==f){m=ne;break}m<0?(V=new wt(this.view,f),this.items.splice(J,0,V),fe=!0):(V=this.items[m],m>J&&(this.items.splice(J,m-J),fe=!0)),K&&V.diagnostic==K.diagnostic?V.dom.hasAttribute("aria-selected")||(V.dom.setAttribute("aria-selected","true"),Oe=V):V.dom.hasAttribute("aria-selected")&&V.dom.removeAttribute("aria-selected"),J++}});J<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)fe=!0,this.items.pop();0==this.items.length&&(this.items.push(new wt(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),fe=!0),Oe?(this.list.setAttribute("aria-activedescendant",Oe.id),this.view.requestMeasure({key:this,read:()=>({sel:Oe.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:Ee,panel:Ue})=>{let P=Ue.height/this.list.offsetHeight;Ee.top<Ue.top?this.list.scrollTop-=(Ue.top-Ee.top)/P:Ee.bottom>Ue.bottom&&(this.list.scrollTop+=(Ee.bottom-Ue.bottom)/P)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),fe&&this.sync()}sync(){let L=this.list.firstChild;function K(){let J=L;L=J.nextSibling,J.remove()}for(let J of this.items)if(J.dom.parentNode==this.list){for(;L!=J.dom;)K();L=J.dom.nextSibling}else this.list.insertBefore(J.dom,L);for(;L;)K()}moveSelection(L){if(this.selectedIndex<0)return;let J=Se(this.view.state.field(we).diagnostics,this.items[L].diagnostic);J&&this.view.dispatch({selection:{anchor:J.from,head:J.to},scrollIntoView:!0,effects:ge.of(J)})}static open(L){return new Ne(L)}}function de(I){return function me(I,L='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${L}>${encodeURIComponent(I)}</svg>')`}(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${I}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const pe=R.Lz.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:de("#f11")},".cm-lintRange-warning":{backgroundImage:de("orange")},".cm-lintRange-info":{backgroundImage:de("#999")},".cm-lintRange-hint":{backgroundImage:de("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function Ie(I){return"error"==I?4:"warning"==I?3:"info"==I?2:1}function Ae(I){let L="hint",K=1;for(let J of I){let fe=Ie(J.severity);fe>K&&(K=fe,L=J.severity)}return L}const _e=(0,R.Ux)(Ct,{hideOn:function ct(I,L){let K=L.pos,J=L.end||K,fe=I.state.facet(Gt).hideOn(I,K,J);if(null!=fe)return fe;let Oe=I.startState.doc.lineAt(L.pos);return!(!I.effects.some(Le=>Le.is(ae))&&!I.changes.touchesRange(Oe.from,Math.max(Oe.to,J)))}}),k=[we,R.Lz.decorations.compute([we],I=>{let{selected:L,panel:K}=I.field(we);return L&&K&&L.from!=L.to?R.NZ.set([ze.range(L.from,L.to)]):R.NZ.none}),_e,pe]},1380(Ei,At,We){"use strict";We.d(At,{YH:()=>Pe,Gu:()=>Jt,VR:()=>wt,Je:()=>yi,OF:()=>Je,$t:()=>gi,sj:()=>at,iR:()=>vt,Nb:()=>I,om:()=>tn,vB:()=>nn,FB:()=>Di,Pe:()=>rt,sU:()=>M,EY:()=>ge,ZX:()=>mt,vS:()=>li,Fh:()=>Kt,QR:()=>xi,y$:()=>$i,zK:()=>oi,kn:()=>Bi,MK:()=>ci});let j=[],g=[];function R(Q){if(Q<768)return!1;for(let u=0,d=j.length;;){let O=u+d>>1;if(Q<j[O])d=O;else{if(!(Q>=g[O]))return!0;u=O+1}if(u==d)return!1}}function le(Q){return Q>=127462&&Q<=127487}function Ye(Q,u,d=!0,O=!0){return(d?Se:ct)(Q,u,O)}function Se(Q,u,d){if(u==Q.length)return u;u&&X(Q.charCodeAt(u))&&ae(Q.charCodeAt(u-1))&&u--;let O=Ke(Q,u);for(u+=se(O);u<Q.length;){let T=Ke(Q,u);if(8205==O||8205==T||d&&R(T))u+=se(T),O=T;else{if(!le(T))break;{let N=0,$=u-2;for(;$>=0&&le(Ke(Q,$));)N++,$-=2;if(N%2==0)break;u+=2}}}return u}function ct(Q,u,d){for(;u>0;){let O=Se(Q,u-2,d);if(O<u)return O;u--}return 0}function Ke(Q,u){let d=Q.charCodeAt(u);if(!ae(d)||u+1==Q.length)return d;let O=Q.charCodeAt(u+1);return X(O)?O-56320+(d-55296<<10)+65536:d}function X(Q){return Q>=56320&&Q<57344}function ae(Q){return Q>=55296&&Q<56320}function se(Q){return Q<65536?1:2}(()=>{let Q="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(u=>u?parseInt(u,36):1);for(let u=0,d=0;u<Q.length;u++)(u%2?g:j).push(d+=Q[u])})();class ge{lineAt(u){if(u<0||u>this.length)throw new RangeError(`Invalid position ${u} in document of length ${this.length}`);return this.lineInner(u,!1,1,0)}line(u){if(u<1||u>this.lines)throw new RangeError(`Invalid line number ${u} in ${this.lines}-line document`);return this.lineInner(u,!0,1,0)}replace(u,d,O){[u,d]=ri(this,u,d);let T=[];return this.decompose(0,u,T,2),O.length&&O.decompose(0,O.length,T,3),this.decompose(d,this.length,T,1),dt.from(T,this.length-(d-u)+O.length)}append(u){return this.replace(this.length,this.length,u)}slice(u,d=this.length){[u,d]=ri(this,u,d);let O=[];return this.decompose(u,d,O,0),dt.from(O,d-u)}eq(u){if(u==this)return!0;if(u.length!=this.length||u.lines!=this.lines)return!1;let d=this.scanIdentical(u,1),O=this.length-this.scanIdentical(u,-1),T=new Wt(this),N=new Wt(u);for(let $=d,re=d;;){if(T.next($),N.next($),$=0,T.lineBreak!=N.lineBreak||T.done!=N.done||T.value!=N.value)return!1;if(re+=T.value.length,T.done||re>=O)return!0}}iter(u=1){return new Wt(this,u)}iterRange(u,d=this.length){return new Mt(this,u,d)}iterLines(u,d){let O;if(null==u)O=this.iter();else{null==d&&(d=this.lines+1);let T=this.line(u).from;O=this.iterRange(T,Math.max(T,d==this.lines+1?this.length:d<=1?0:this.line(d-1).to))}return new He(O)}toString(){return this.sliceString(0)}toJSON(){let u=[];return this.flatten(u),u}constructor(){}static of(u){if(0==u.length)throw new RangeError("A document must have at least one line");return 1!=u.length||u[0]?u.length<=32?new we(u):dt.from(we.split(u,[])):ge.empty}}class we extends ge{constructor(u,d=function ze(Q){let u=-1;for(let d of Q)u+=d.length+1;return u}(u)){super(),this.text=u,this.length=d}get lines(){return this.text.length}get children(){return null}lineInner(u,d,O,T){for(let N=0;;N++){let $=this.text[N],re=T+$.length;if((d?O:re)>=u)return new Nt(T,re,O,$);T=re+1,O++}}decompose(u,d,O,T){let N=u<=0&&d>=this.length?this:new we(Qt(this.text,u,d),Math.min(d,this.length)-Math.max(0,u));if(1&T){let $=O.pop(),re=Ct(N.text,$.text.slice(),0,N.length);if(re.length<=32)O.push(new we(re,$.length+N.length));else{let ce=re.length>>1;O.push(new we(re.slice(0,ce)),new we(re.slice(ce)))}}else O.push(N)}replace(u,d,O){if(!(O instanceof we))return super.replace(u,d,O);[u,d]=ri(this,u,d);let T=Ct(this.text,Ct(O.text,Qt(this.text,0,u)),d),N=this.length+O.length-(d-u);return T.length<=32?new we(T,N):dt.from(we.split(T,[]),N)}sliceString(u,d=this.length,O="\n"){[u,d]=ri(this,u,d);let T="";for(let N=0,$=0;N<=d&&$<this.text.length;$++){let re=this.text[$],ce=N+re.length;N>u&&$&&(T+=O),u<ce&&d>N&&(T+=re.slice(Math.max(0,u-N),d-N)),N=ce+1}return T}flatten(u){for(let d of this.text)u.push(d)}scanIdentical(){return 0}static split(u,d){let O=[],T=-1;for(let N of u)O.push(N),T+=N.length+1,32==O.length&&(d.push(new we(O,T)),O=[],T=-1);return T>-1&&d.push(new we(O,T)),d}}class dt extends ge{constructor(u,d){super(),this.children=u,this.length=d,this.lines=0;for(let O of u)this.lines+=O.lines}lineInner(u,d,O,T){for(let N=0;;N++){let $=this.children[N],re=T+$.length,ce=O+$.lines-1;if((d?ce:re)>=u)return $.lineInner(u,d,O,T);T=re+1,O=ce+1}}decompose(u,d,O,T){for(let N=0,$=0;$<=d&&N<this.children.length;N++){let re=this.children[N],ce=$+re.length;if(u<=ce&&d>=$){let Ce=T&(($<=u?1:0)|(ce>=d?2:0));$>=u&&ce<=d&&!Ce?O.push(re):re.decompose(u-$,d-$,O,Ce)}$=ce+1}}replace(u,d,O){if([u,d]=ri(this,u,d),O.lines<this.lines)for(let T=0,N=0;T<this.children.length;T++){let $=this.children[T],re=N+$.length;if(u>=N&&d<=re){let ce=$.replace(u-N,d-N,O),Ce=this.lines-$.lines+ce.lines;if(ce.lines<Ce>>4&&ce.lines>Ce>>6){let je=this.children.slice();return je[T]=ce,new dt(je,this.length-(d-u)+O.length)}return super.replace(N,re,ce)}N=re+1}return super.replace(u,d,O)}sliceString(u,d=this.length,O="\n"){[u,d]=ri(this,u,d);let T="";for(let N=0,$=0;N<this.children.length&&$<=d;N++){let re=this.children[N],ce=$+re.length;$>u&&N&&(T+=O),u<ce&&d>$&&(T+=re.sliceString(u-$,d-$,O)),$=ce+1}return T}flatten(u){for(let d of this.children)d.flatten(u)}scanIdentical(u,d){if(!(u instanceof dt))return 0;let O=0,[T,N,$,re]=d>0?[0,0,this.children.length,u.children.length]:[this.children.length-1,u.children.length-1,-1,-1];for(;;T+=d,N+=d){if(T==$||N==re)return O;let ce=this.children[T],Ce=u.children[N];if(ce!=Ce)return O+ce.scanIdentical(Ce,d);O+=ce.length+1}}static from(u,d=u.reduce((O,T)=>O+T.length+1,-1)){let O=0;for(let ht of u)O+=ht.lines;if(O<32){let ht=[];for(let jt of u)jt.flatten(ht);return new we(ht,d)}let T=Math.max(32,O>>5),N=T<<1,$=T>>1,re=[],ce=0,Ce=-1,je=[];function ot(ht){let jt;if(ht.lines>N&&ht instanceof dt)for(let Ci of ht.children)ot(Ci);else ht.lines>$&&(ce>$||!ce)?(gt(),re.push(ht)):ht instanceof we&&ce&&(jt=je[je.length-1])instanceof we&&ht.lines+jt.lines<=32?(ce+=ht.lines,Ce+=ht.length+1,je[je.length-1]=new we(jt.text.concat(ht.text),jt.length+1+ht.length)):(ce+ht.lines>T&>(),ce+=ht.lines,Ce+=ht.length+1,je.push(ht))}function gt(){0!=ce&&(re.push(1==je.length?je[0]:dt.from(je,Ce)),Ce=-1,ce=je.length=0)}for(let ht of u)ot(ht);return gt(),1==re.length?re[0]:new dt(re,d)}}function Ct(Q,u,d=0,O=1e9){for(let T=0,N=0,$=!0;N<Q.length&&T<=O;N++){let re=Q[N],ce=T+re.length;ce>=d&&(ce>O&&(re=re.slice(0,O-T)),T<d&&(re=re.slice(d-T)),$?(u[u.length-1]+=re,$=!1):u.push(re)),T=ce+1}return u}function Qt(Q,u,d){return Ct(Q,[""],u,d)}ge.empty=new we([""],0);class Wt{constructor(u,d=1){this.dir=d,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[u],this.offsets=[d>0?1:(u instanceof we?u.text.length:u.children.length)<<1]}nextInner(u,d){for(this.done=this.lineBreak=!1;;){let O=this.nodes.length-1,T=this.nodes[O],N=this.offsets[O],$=N>>1;if($==(d>0?T instanceof we?T.text.length:T.children.length:0)){if(0==O)return this.done=!0,this.value="",this;d>0&&this.offsets[O-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&N)==(d>0?0:1)){if(this.offsets[O]+=d,0==u)return this.lineBreak=!0,this.value="\n",this;u--}else if(T instanceof we){let ce=T.text[$+(d<0?-1:0)];if(this.offsets[O]+=d,ce.length>Math.max(0,u))return this.value=0==u?ce:d>0?ce.slice(u):ce.slice(0,ce.length-u),this;u-=ce.length}else{let ce=T.children[$+(d<0?-1:0)];u>ce.length?(u-=ce.length,this.offsets[O]+=d):(d<0&&this.offsets[O]--,this.nodes.push(ce),this.offsets.push(d>0?1:(ce instanceof we?ce.text.length:ce.children.length)<<1))}}}next(u=0){return u<0&&(this.nextInner(-u,-this.dir),u=this.value.length),this.nextInner(u,this.dir)}}class Mt{constructor(u,d,O){this.value="",this.done=!1,this.cursor=new Wt(u,d>O?-1:1),this.pos=d>O?u.length:0,this.from=Math.min(d,O),this.to=Math.max(d,O)}nextInner(u,d){if(d<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;u+=Math.max(0,d<0?this.pos-this.to:this.from-this.pos);let O=d<0?this.pos-this.from:this.to-this.pos;u>O&&(u=O),O-=u;let{value:T}=this.cursor.next(u);return this.pos+=(T.length+u)*d,this.value=T.length<=O?T:d<0?T.slice(T.length-O):T.slice(0,O),this.done=!this.value,this}next(u=0){return u<0?u=Math.max(u,this.from-this.pos):u>0&&(u=Math.min(u,this.to-this.pos)),this.nextInner(u,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class He{constructor(u){this.inner=u,this.afterBreak=!0,this.value="",this.done=!1}next(u=0){let{done:d,lineBreak:O,value:T}=this.inner.next(u);return d&&this.afterBreak?(this.value="",this.afterBreak=!1):d?(this.done=!0,this.value=""):O?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=T,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(ge.prototype[Symbol.iterator]=function(){return this.iter()},Wt.prototype[Symbol.iterator]=Mt.prototype[Symbol.iterator]=He.prototype[Symbol.iterator]=function(){return this});class Nt{constructor(u,d,O,T){this.from=u,this.to=d,this.number=O,this.text=T}get length(){return this.to-this.from}}function ri(Q,u,d){return[u=Math.max(0,Math.min(Q.length,u)),Math.max(u,Math.min(Q.length,d))]}function oi(Q,u,d=!0,O=!0){return Ye(Q,u,d,O)}function li(Q,u){let d=Q.charCodeAt(u);if(!function Gt(Q){return Q>=55296&&Q<56320}(d)||u+1==Q.length)return d;let O=Q.charCodeAt(u+1);return function Yt(Q){return Q>=56320&&Q<57344}(O)?O-56320+(d-55296<<10)+65536:d}function ci(Q){return Q<=65535?String.fromCharCode(Q):(Q-=65536,String.fromCharCode(55296+(Q>>10),56320+(1023&Q)))}function Kt(Q){return Q<65536?1:2}const It=/\r\n?|\n/;var vt=function(Q){return Q[Q.Simple=0]="Simple",Q[Q.TrackDel=1]="TrackDel",Q[Q.TrackBefore=2]="TrackBefore",Q[Q.TrackAfter=3]="TrackAfter",Q}(vt||(vt={}));class Jt{constructor(u){this.sections=u}get length(){let u=0;for(let d=0;d<this.sections.length;d+=2)u+=this.sections[d];return u}get newLength(){let u=0;for(let d=0;d<this.sections.length;d+=2){let O=this.sections[d+1];u+=O<0?this.sections[d]:O}return u}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(u){for(let d=0,O=0,T=0;d<this.sections.length;){let N=this.sections[d++],$=this.sections[d++];$<0?(u(O,T,N),T+=N):T+=$,O+=N}}iterChangedRanges(u,d=!1){de(this,u,d)}get invertedDesc(){let u=[];for(let d=0;d<this.sections.length;){let O=this.sections[d++],T=this.sections[d++];T<0?u.push(O,T):u.push(T,O)}return new Jt(u)}composeDesc(u){return this.empty?u:u.empty?this:Ie(this,u)}mapDesc(u,d=!1){return u.empty?this:pe(this,u,d)}mapPos(u,d=-1,O=vt.Simple){let T=0,N=0;for(let $=0;$<this.sections.length;){let re=this.sections[$++],ce=this.sections[$++],Ce=T+re;if(ce<0){if(Ce>u)return N+(u-T);N+=re}else{if(O!=vt.Simple&&Ce>=u&&(O==vt.TrackDel&&T<u&&Ce>u||O==vt.TrackBefore&&T<u||O==vt.TrackAfter&&Ce>u))return null;if(Ce>u||Ce==u&&d<0&&!re)return u==T||d<0?N:N+ce;N+=ce}T=Ce}if(u>T)throw new RangeError(`Position ${u} is out of range for changeset of length ${T}`);return N}touchesRange(u,d=u){for(let O=0,T=0;O<this.sections.length&&T<=d;){let re=T+this.sections[O++];if(this.sections[O++]>=0&&T<=d&&re>=u)return!(T<u&&re>d)||"cover";T=re}return!1}toString(){let u="";for(let d=0;d<this.sections.length;){let O=this.sections[d++],T=this.sections[d++];u+=(u?" ":"")+O+(T>=0?":"+T:"")}return u}toJSON(){return this.sections}static fromJSON(u){if(!Array.isArray(u)||u.length%2||u.some(d=>"number"!=typeof d))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Jt(u)}static create(u){return new Jt(u)}}class wt extends Jt{constructor(u,d){super(u),this.inserted=d}apply(u){if(this.length!=u.length)throw new RangeError("Applying change set to a document with the wrong length");return de(this,(d,O,T,N,$)=>u=u.replace(T,T+(O-d),$),!1),u}mapDesc(u,d=!1){return pe(this,u,d,!0)}invert(u){let d=this.sections.slice(),O=[];for(let T=0,N=0;T<d.length;T+=2){let $=d[T],re=d[T+1];if(re>=0){d[T]=re,d[T+1]=$;let ce=T>>1;for(;O.length<ce;)O.push(ge.empty);O.push($?u.slice(N,N+$):ge.empty)}N+=$}return new wt(d,O)}compose(u){return this.empty?u:u.empty?this:Ie(this,u,!0)}map(u,d=!1){return u.empty?this:pe(this,u,d,!0)}iterChanges(u,d=!1){de(this,u,d)}get desc(){return Jt.create(this.sections)}filter(u){let d=[],O=[],T=[],N=new Ae(this);e:for(let $=0,re=0;;){let ce=$==u.length?1e9:u[$++];for(;re<ce||re==ce&&0==N.len;){if(N.done)break e;let je=Math.min(N.len,ce-re);Ne(T,je,-1);let ot=-1==N.ins?-1:0==N.off?N.ins:0;Ne(d,je,ot),ot>0&&me(O,d,N.text),N.forward(je),re+=je}let Ce=u[$++];for(;re<Ce;){if(N.done)break e;let je=Math.min(N.len,Ce-re);Ne(d,je,-1),Ne(T,je,-1==N.ins?-1:0==N.off?N.ins:0),N.forward(je),re+=je}}return{changes:new wt(d,O),filtered:Jt.create(T)}}toJSON(){let u=[];for(let d=0;d<this.sections.length;d+=2){let O=this.sections[d],T=this.sections[d+1];u.push(T<0?O:0==T?[O]:[O].concat(this.inserted[d>>1].toJSON()))}return u}static of(u,d,O){let T=[],N=[],$=0,re=null;function ce(je=!1){if(!je&&!T.length)return;$<d&&Ne(T,d-$,-1);let ot=new wt(T,N);re=re?re.compose(ot.map(re)):ot,T=[],N=[],$=0}return function Ce(je){if(Array.isArray(je))for(let ot of je)Ce(ot);else if(je instanceof wt){if(je.length!=d)throw new RangeError(`Mismatched change set length (got ${je.length}, expected ${d})`);ce(),re=re?re.compose(je.map(re)):je}else{let{from:ot,to:gt=ot,insert:ht}=je;if(ot>gt||ot<0||gt>d)throw new RangeError(`Invalid change range ${ot} to ${gt} (in doc of length ${d})`);let jt=ht?"string"==typeof ht?ge.of(ht.split(O||It)):ht:ge.empty,Ci=jt.length;if(ot==gt&&0==Ci)return;ot<$&&ce(),ot>$&&Ne(T,ot-$,-1),Ne(T,gt-ot,Ci),me(N,T,jt),$=gt}}(u),ce(!re),re}static empty(u){return new wt(u?[u,-1]:[],[])}static fromJSON(u){if(!Array.isArray(u))throw new RangeError("Invalid JSON representation of ChangeSet");let d=[],O=[];for(let T=0;T<u.length;T++){let N=u[T];if("number"==typeof N)d.push(N,-1);else{if(!Array.isArray(N)||"number"!=typeof N[0]||N.some(($,re)=>re&&"string"!=typeof $))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==N.length)d.push(N[0],0);else{for(;O.length<T;)O.push(ge.empty);O[T]=ge.of(N.slice(1)),d.push(N[0],O[T].length)}}}return new wt(d,O)}static createSet(u,d){return new wt(u,d)}}function Ne(Q,u,d,O=!1){if(0==u&&d<=0)return;let T=Q.length-2;T>=0&&d<=0&&d==Q[T+1]?Q[T]+=u:T>=0&&0==u&&0==Q[T]?Q[T+1]+=d:O?(Q[T]+=u,Q[T+1]+=d):Q.push(u,d)}function me(Q,u,d){if(0==d.length)return;let O=u.length-2>>1;if(O<Q.length)Q[Q.length-1]=Q[Q.length-1].append(d);else{for(;Q.length<O;)Q.push(ge.empty);Q.push(d)}}function de(Q,u,d){let O=Q.inserted;for(let T=0,N=0,$=0;$<Q.sections.length;){let re=Q.sections[$++],ce=Q.sections[$++];if(ce<0)T+=re,N+=re;else{let Ce=T,je=N,ot=ge.empty;for(;Ce+=re,je+=ce,ce&&O&&(ot=ot.append(O[$-2>>1])),!(d||$==Q.sections.length||Q.sections[$+1]<0);)re=Q.sections[$++],ce=Q.sections[$++];u(T,Ce,N,je,ot),T=Ce,N=je}}}function pe(Q,u,d,O=!1){let T=[],N=O?[]:null,$=new Ae(Q),re=new Ae(u);for(let ce=-1;;){if($.done&&re.len||re.done&&$.len)throw new Error("Mismatched change set lengths");if(-1==$.ins&&-1==re.ins){let Ce=Math.min($.len,re.len);Ne(T,Ce,-1),$.forward(Ce),re.forward(Ce)}else if(re.ins>=0&&($.ins<0||ce==$.i||0==$.off&&(re.len<$.len||re.len==$.len&&!d))){let Ce=re.len;for(Ne(T,re.ins,-1);Ce;){let je=Math.min($.len,Ce);$.ins>=0&&ce<$.i&&$.len<=je&&(Ne(T,0,$.ins),N&&me(N,T,$.text),ce=$.i),$.forward(je),Ce-=je}re.next()}else{if(!($.ins>=0)){if($.done&&re.done)return N?wt.createSet(T,N):Jt.create(T);throw new Error("Mismatched change set lengths")}{let Ce=0,je=$.len;for(;je;)if(-1==re.ins){let ot=Math.min(je,re.len);Ce+=ot,je-=ot,re.forward(ot)}else{if(!(0==re.ins&&re.len<je))break;je-=re.len,re.next()}Ne(T,Ce,ce<$.i?$.ins:0),N&&ce<$.i&&me(N,T,$.text),ce=$.i,$.forward($.len-je)}}}}function Ie(Q,u,d=!1){let O=[],T=d?[]:null,N=new Ae(Q),$=new Ae(u);for(let re=!1;;){if(N.done&&$.done)return T?wt.createSet(O,T):Jt.create(O);if(0==N.ins)Ne(O,N.len,0,re),N.next();else if(0!=$.len||$.done){if(N.done||$.done)throw new Error("Mismatched change set lengths");{let ce=Math.min(N.len2,$.len),Ce=O.length;if(-1==N.ins){let je=-1==$.ins?-1:$.off?0:$.ins;Ne(O,ce,je,re),T&&je&&me(T,O,$.text)}else-1==$.ins?(Ne(O,N.off?0:N.len,ce,re),T&&me(T,O,N.textBit(ce))):(Ne(O,N.off?0:N.len,$.off?0:$.ins,re),T&&!$.off&&me(T,O,$.text));re=(N.ins>ce||$.ins>=0&&$.len>ce)&&(re||O.length>Ce),N.forward2(ce),$.forward(ce)}}else Ne(O,0,$.ins,re),T&&me(T,O,$.text),$.next()}}class Ae{constructor(u){this.set=u,this.i=0,this.next()}next(){let{sections:u}=this.set;this.i<u.length?(this.len=u[this.i++],this.ins=u[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return-2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:u}=this.set,d=this.i-2>>1;return d>=u.length?ge.empty:u[d]}textBit(u){let{inserted:d}=this.set,O=this.i-2>>1;return O>=d.length&&!u?ge.empty:d[O].slice(this.off,null==u?void 0:this.off+u)}forward(u){u==this.len?this.next():(this.len-=u,this.off+=u)}forward2(u){-1==this.ins?this.forward(u):u==this.ins?this.next():(this.ins-=u,this.off+=u)}}class it{constructor(u,d,O){this.from=u,this.to=d,this.flags=O}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let u=7&this.flags;return 7==u?null:u}get goalColumn(){let u=this.flags>>6;return 16777215==u?void 0:u}map(u,d=-1){let O,T;return this.empty?O=T=u.mapPos(this.from,d):(O=u.mapPos(this.from,1),T=u.mapPos(this.to,-1)),O==this.from&&T==this.to?this:new it(O,T,this.flags)}extend(u,d=u,O=0){if(u<=this.anchor&&d>=this.anchor)return Je.range(u,d,void 0,void 0,O);let T=Math.abs(u-this.anchor)>Math.abs(d-this.anchor)?u:d;return Je.range(this.anchor,T,void 0,void 0,O)}eq(u,d=!1){return!(this.anchor!=u.anchor||this.head!=u.head||this.goalColumn!=u.goalColumn||d&&this.empty&&this.assoc!=u.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(u){if(!u||"number"!=typeof u.anchor||"number"!=typeof u.head)throw new RangeError("Invalid JSON representation for SelectionRange");return Je.range(u.anchor,u.head)}static create(u,d,O){return new it(u,d,O)}}class Je{constructor(u,d){this.ranges=u,this.mainIndex=d}map(u,d=-1){return u.empty?this:Je.create(this.ranges.map(O=>O.map(u,d)),this.mainIndex)}eq(u,d=!1){if(this.ranges.length!=u.ranges.length||this.mainIndex!=u.mainIndex)return!1;for(let O=0;O<this.ranges.length;O++)if(!this.ranges[O].eq(u.ranges[O],d))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new Je([this.main],0)}addRange(u,d=!0){return Je.create([u].concat(this.ranges),d?0:this.mainIndex+1)}replaceRange(u,d=this.mainIndex){let O=this.ranges.slice();return O[d]=u,Je.create(O,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(u=>u.toJSON()),main:this.mainIndex}}static fromJSON(u){if(!u||!Array.isArray(u.ranges)||"number"!=typeof u.main||u.main>=u.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Je(u.ranges.map(d=>it.fromJSON(d)),u.main)}static single(u,d=u){return new Je([Je.range(u,d)],0)}static create(u,d=0){if(0==u.length)throw new RangeError("A selection needs at least one range");for(let O=0,T=0;T<u.length;T++){let N=u[T];if(N.empty?N.from<=O:N.from<O)return Je.normalized(u.slice(),d);O=N.to}return new Je(u,d)}static cursor(u,d=0,O,T){return it.create(u,u,(0==d?0:d<0?8:16)|(null==O?7:Math.min(6,O))|(T??16777215)<<6)}static range(u,d,O,T,N){let $=(O??16777215)<<6|(null==T?7:Math.min(6,T));return!N&&u!=d&&(N=d<u?1:-1),d<u?it.create(d,u,48|$):it.create(u,d,(N?N<0?8:16:0)|$)}static normalized(u,d=0){let O=u[d];u.sort((T,N)=>T.from-N.from),d=u.indexOf(O);for(let T=1;T<u.length;T++){let N=u[T],$=u[T-1];if(N.empty?N.from<=$.to:N.from<$.to){let re=$.from,ce=Math.max(N.to,$.to);T<=d&&d--,u.splice(--T,2,N.anchor>N.head?Je.range(ce,re):Je.range(re,ce))}}return new Je(u,d)}}function qe(Q,u){for(let d of Q.ranges)if(d.to>u)throw new RangeError("Selection points outside of document")}let Pt=0;class at{constructor(u,d,O,T,N){this.combine=u,this.compareInput=d,this.compare=O,this.isStatic=T,this.id=Pt++,this.default=u([]),this.extensions="function"==typeof N?N(this):N}get reader(){return this}static define(u={}){return new at(u.combine||(d=>d),u.compareInput||((d,O)=>d===O),u.compare||(u.combine?(d,O)=>d===O:St),!!u.static,u.enables)}of(u){return new kt([],this,0,u)}compute(u,d){if(this.isStatic)throw new Error("Can't compute a static facet");return new kt(u,this,1,d)}computeN(u,d){if(this.isStatic)throw new Error("Can't compute a static facet");return new kt(u,this,2,d)}from(u,d){return d||(d=O=>O),this.compute([u],O=>d(O.field(u)))}}function St(Q,u){return Q==u||Q.length==u.length&&Q.every((d,O)=>d===u[O])}class kt{constructor(u,d,O,T){this.dependencies=u,this.facet=d,this.type=O,this.value=T,this.id=Pt++}dynamicSlot(u){var d;let O=this.value,T=this.facet.compareInput,N=this.id,$=u[N]>>1,re=2==this.type,ce=!1,Ce=!1,je=[];for(let ot of this.dependencies)"doc"==ot?ce=!0:"selection"==ot?Ce=!0:!(1&(null!==(d=u[ot.id])&&void 0!==d?d:1))&&je.push(u[ot.id]);return{create:ot=>(ot.values[$]=O(ot),1),update(ot,gt){if(ce&>.docChanged||Ce&&(gt.docChanged||gt.selection)||Lt(ot,je)){let ht=O(ot);if(re?!Et(ht,ot.values[$],T):!T(ht,ot.values[$]))return ot.values[$]=ht,1}return 0},reconfigure:(ot,gt)=>{let ht,jt=gt.config.address[N];if(null!=jt){let Ci=Ee(gt,jt);if(this.dependencies.every($t=>$t instanceof at?gt.facet($t)===ot.facet($t):!($t instanceof M)||gt.field($t,!1)==ot.field($t,!1))||(re?Et(ht=O(ot),Ci,T):T(ht=O(ot),Ci)))return ot.values[$]=Ci,0}else ht=O(ot);return ot.values[$]=ht,1}}}}function Et(Q,u,d){if(Q.length!=u.length)return!1;for(let O=0;O<Q.length;O++)if(!d(Q[O],u[O]))return!1;return!0}function Lt(Q,u){let d=!1;for(let O of u)1&Le(Q,O)&&(d=!0);return d}function _e(Q,u,d){let O=d.map(ce=>Q[ce.id]),T=d.map(ce=>ce.type),N=O.filter(ce=>!(1&ce)),$=Q[u.id]>>1;function re(ce){let Ce=[];for(let je=0;je<O.length;je++){let ot=Ee(ce,O[je]);if(2==T[je])for(let gt of ot)Ce.push(gt);else Ce.push(ot)}return u.combine(Ce)}return{create(ce){for(let Ce of O)Le(ce,Ce);return ce.values[$]=re(ce),1},update(ce,Ce){if(!Lt(ce,N))return 0;let je=re(ce);return u.compare(je,ce.values[$])?0:(ce.values[$]=je,1)},reconfigure(ce,Ce){let je=Lt(ce,O),ot=Ce.config.facets[u.id],gt=Ce.facet(u);if(ot&&!je&&St(d,ot))return ce.values[$]=gt,0;let ht=re(ce);return u.compare(ht,gt)?(ce.values[$]=gt,0):(ce.values[$]=ht,1)}}}const k=at.define({static:!0});class M{constructor(u,d,O,T,N){this.id=u,this.createF=d,this.updateF=O,this.compareF=T,this.spec=N,this.provides=void 0}static define(u){let d=new M(Pt++,u.create,u.update,u.compare||((O,T)=>O===T),u);return u.provide&&(d.provides=u.provide(d)),d}create(u){let d=u.facet(k).find(O=>O.field==this);return(d?.create||this.createF)(u)}slot(u){let d=u[this.id]>>1;return{create:O=>(O.values[d]=this.create(O),1),update:(O,T)=>{let N=O.values[d],$=this.updateF(N,T);return this.compareF(N,$)?0:(O.values[d]=$,1)},reconfigure:(O,T)=>{let re,N=O.facet(k),$=T.facet(k);return(re=N.find(ce=>ce.field==this))&&re!=$.find(ce=>ce.field==this)?(O.values[d]=re.create(O),1):null!=T.config.address[this.id]?(O.values[d]=T.field(this),0):(O.values[d]=this.create(O),1)}}}init(u){return[this,k.of({field:this,create:u})]}get extension(){return this}}function Y(Q){return u=>new L(u,Q)}const I={highest:Y(0),high:Y(1),default:Y(2),low:Y(3),lowest:Y(4)};class L{constructor(u,d){this.inner=u,this.prec=d}}class K{of(u){return new J(this,u)}reconfigure(u){return K.reconfigure.of({compartment:this,extension:u})}get(u){return u.config.compartments.get(this)}}class J{constructor(u,d){this.compartment=u,this.inner=d}}class fe{constructor(u,d,O,T,N,$){for(this.base=u,this.compartments=d,this.dynamicSlots=O,this.address=T,this.staticValues=N,this.facets=$,this.statusTemplate=[];this.statusTemplate.length<O.length;)this.statusTemplate.push(0)}staticFacet(u){let d=this.address[u.id];return null==d?u.default:this.staticValues[d>>1]}static resolve(u,d,O){let T=[],N=Object.create(null),$=new Map;for(let gt of function Oe(Q,u,d){let O=[[],[],[],[],[]],T=new Map;return function N($,re){let ce=T.get($);if(null!=ce){if(ce<=re)return;let Ce=O[ce].indexOf($);Ce>-1&&O[ce].splice(Ce,1),$ instanceof J&&d.delete($.compartment)}if(T.set($,re),Array.isArray($))for(let Ce of $)N(Ce,re);else if($ instanceof J){if(d.has($.compartment))throw new RangeError("Duplicate use of compartment in extensions");let Ce=u.get($.compartment)||$.inner;d.set($.compartment,Ce),N(Ce,re)}else if($ instanceof L)N($.inner,$.prec);else if($ instanceof M)O[re].push($),$.provides&&N($.provides,re);else if($ instanceof kt)O[re].push($),$.facet.extensions&&N($.facet.extensions,2);else{let Ce=$.extension;if(!Ce)throw new Error(`Unrecognized extension value in extension set (${$}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);N(Ce,re)}}(Q,2),O.reduce(($,re)=>$.concat(re))}(u,d,$))gt instanceof M?T.push(gt):(N[gt.facet.id]||(N[gt.facet.id]=[])).push(gt);let re=Object.create(null),ce=[],Ce=[];for(let gt of T)re[gt.id]=Ce.length<<1,Ce.push(ht=>gt.slot(ht));let je=O?.config.facets;for(let gt in N){let ht=N[gt],jt=ht[0].facet,Ci=je&&je[gt]||[];if(ht.every($t=>0==$t.type))if(re[jt.id]=ce.length<<1|1,St(Ci,ht))ce.push(O.facet(jt));else{let $t=jt.combine(ht.map(zi=>zi.value));ce.push(O&&jt.compare($t,O.facet(jt))?O.facet(jt):$t)}else{for(let $t of ht)0==$t.type?(re[$t.id]=ce.length<<1|1,ce.push($t.value)):(re[$t.id]=Ce.length<<1,Ce.push(zi=>$t.dynamicSlot(zi)));re[jt.id]=Ce.length<<1,Ce.push($t=>_e($t,jt,ht))}}let ot=Ce.map(gt=>gt(re));return new fe(u,$,ot,re,ce,N)}}function Le(Q,u){if(1&u)return 2;let d=u>>1,O=Q.status[d];if(4==O)throw new Error("Cyclic dependency between fields and/or facets");if(2&O)return O;Q.status[d]=4;let T=Q.computeSlot(Q,Q.config.dynamicSlots[d]);return Q.status[d]=2|T}function Ee(Q,u){return 1&u?Q.config.staticValues[u>>1]:Q.values[u>>1]}const Ue=at.define(),P=at.define({combine:Q=>Q.some(u=>u),static:!0}),f=at.define({combine:Q=>Q.length?Q[0]:void 0,static:!0}),m=at.define(),V=at.define(),ne=at.define(),ue=at.define({combine:Q=>!!Q.length&&Q[0]});class Pe{constructor(u,d){this.type=u,this.value=d}static define(){return new $e}}class $e{of(u){return new Pe(this,u)}}class lt{constructor(u){this.map=u}of(u){return new rt(this,u)}}let rt=(()=>{class Q{constructor(d,O){this.type=d,this.value=O}map(d){let O=this.type.map(this.value,d);return void 0===O?void 0:O==this.value?this:new Q(this.type,O)}is(d){return this.type==d}static define(d={}){return new lt(d.map||(O=>O))}static mapEffects(d,O){if(!d.length)return d;let T=[];for(let N of d){let $=N.map(O);$&&T.push($)}return T}}return Q.reconfigure=Q.define(),Q.appendConfig=Q.define(),Q})(),mt=(()=>{class Q{constructor(d,O,T,N,$,re){this.startState=d,this.changes=O,this.selection=T,this.effects=N,this.annotations=$,this.scrollIntoView=re,this._doc=null,this._state=null,T&&qe(T,O.newLength),$.some(ce=>ce.type==Q.time)||(this.annotations=$.concat(Q.time.of(Date.now())))}static create(d,O,T,N,$,re){return new Q(d,O,T,N,$,re)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(d){for(let O of this.annotations)if(O.type==d)return O.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(d){let O=this.annotation(Q.userEvent);return!(!O||!(O==d||O.length>d.length&&O.slice(0,d.length)==d&&"."==O[d.length]))}}return Q.time=Pe.define(),Q.userEvent=Pe.define(),Q.addToHistory=Pe.define(),Q.remote=Pe.define(),Q})();function bt(Q,u){let d=[];for(let O=0,T=0;;){let N,$;if(O<Q.length&&(T==u.length||u[T]>=Q[O]))N=Q[O++],$=Q[O++];else{if(!(T<u.length))return d;N=u[T++],$=u[T++]}!d.length||d[d.length-1]<N?d.push(N,$):d[d.length-1]<$&&(d[d.length-1]=$)}}function ai(Q,u,d){var O;let T,N,$;return d?(T=u.changes,N=wt.empty(u.changes.length),$=Q.changes.compose(u.changes)):(T=u.changes.map(Q.changes),N=Q.changes.mapDesc(u.changes,!0),$=Q.changes.compose(T)),{changes:$,selection:u.selection?u.selection.map(N):null===(O=Q.selection)||void 0===O?void 0:O.map(T),effects:rt.mapEffects(Q.effects,T).concat(rt.mapEffects(u.effects,N)),annotations:Q.annotations.length?Q.annotations.concat(u.annotations):u.annotations,scrollIntoView:Q.scrollIntoView||u.scrollIntoView}}function Tt(Q,u,d){let O=u.selection,T=ki(u.annotations);return u.userEvent&&(T=T.concat(mt.userEvent.of(u.userEvent))),{changes:u.changes instanceof wt?u.changes:wt.of(u.changes||[],d,Q.facet(f)),selection:O&&(O instanceof Je?O:Je.single(O.anchor,O.head)),effects:ki(u.effects),annotations:T,scrollIntoView:!!u.scrollIntoView}}function Rt(Q,u,d){let O=Tt(Q,u.length?u[0]:{},Q.doc.length);u.length&&!1===u[0].filter&&(d=!1);for(let N=1;N<u.length;N++){!1===u[N].filter&&(d=!1);let $=!!u[N].sequential;O=ai(O,Tt(Q,u[N],$?O.changes.newLength:Q.doc.length),$)}let T=mt.create(Q,O.changes,O.selection,O.effects,O.annotations,O.scrollIntoView);return function zt(Q){let u=Q.startState,d=u.facet(ne),O=Q;for(let T=d.length-1;T>=0;T--){let N=d[T](Q);N&&Object.keys(N).length&&(O=ai(O,Tt(u,N,Q.changes.newLength),!0))}return O==Q?Q:mt.create(u,Q.changes,Q.selection,O.effects,O.annotations,O.scrollIntoView)}(d?function qt(Q){let u=Q.startState,d=!0;for(let T of u.facet(m)){let N=T(Q);if(!1===N){d=!1;break}Array.isArray(N)&&(d=!0===d?N:bt(d,N))}if(!0!==d){let T,N;if(!1===d)N=Q.changes.invertedDesc,T=wt.empty(u.doc.length);else{let $=Q.changes.filter(d);T=$.changes,N=$.filtered.mapDesc($.changes).invertedDesc}Q=mt.create(u,T,Q.selection&&Q.selection.map(N),rt.mapEffects(Q.effects,N),Q.annotations,Q.scrollIntoView)}let O=u.facet(V);for(let T=O.length-1;T>=0;T--){let N=O[T](Q);Q=N instanceof mt?N:Array.isArray(N)&&1==N.length&&N[0]instanceof mt?N[0]:Rt(u,ki(N),!1)}return Q}(T):T)}const hi=[];function ki(Q){return null==Q?hi:Array.isArray(Q)?Q:[Q]}var yi=function(Q){return Q[Q.Word=0]="Word",Q[Q.Space=1]="Space",Q[Q.Other=2]="Other",Q}(yi||(yi={}));const Ni=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let fi;try{fi=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}let gi=(()=>{class Q{constructor(d,O,T,N,$,re){this.config=d,this.doc=O,this.selection=T,this.values=N,this.status=d.statusTemplate.slice(),this.computeSlot=$,re&&(re._state=this);for(let ce=0;ce<this.config.dynamicSlots.length;ce++)Le(this,ce<<1);this.computeSlot=null}field(d,O=!0){let T=this.config.address[d.id];if(null!=T)return Le(this,T),Ee(this,T);if(O)throw new RangeError("Field is not present in this state")}update(...d){return Rt(this,d,!0)}applyTransaction(d){let $,O=this.config,{base:T,compartments:N}=O;for(let ce of d.effects)ce.is(K.reconfigure)?(O&&(N=new Map,O.compartments.forEach((Ce,je)=>N.set(je,Ce)),O=null),N.set(ce.value.compartment,ce.value.extension)):ce.is(rt.reconfigure)?(O=null,T=ce.value):ce.is(rt.appendConfig)&&(O=null,T=ki(T).concat(ce.value));O?$=d.startState.values.slice():(O=fe.resolve(T,N,this),$=new Q(O,this.doc,this.selection,O.dynamicSlots.map(()=>null),(Ce,je)=>je.reconfigure(Ce,this),null).values);let re=d.startState.facet(P)?d.newSelection:d.newSelection.asSingle();new Q(O,d.newDoc,re,$,(ce,Ce)=>Ce.update(ce,d),d)}replaceSelection(d){return"string"==typeof d&&(d=this.toText(d)),this.changeByRange(O=>({changes:{from:O.from,to:O.to,insert:d},range:Je.cursor(O.from+d.length)}))}changeByRange(d){let O=this.selection,T=d(O.ranges[0]),N=this.changes(T.changes),$=[T.range],re=ki(T.effects);for(let ce=1;ce<O.ranges.length;ce++){let Ce=d(O.ranges[ce]),je=this.changes(Ce.changes),ot=je.map(N);for(let ht=0;ht<ce;ht++)$[ht]=$[ht].map(ot);let gt=N.mapDesc(je,!0);$.push(Ce.range.map(gt)),N=N.compose(ot),re=rt.mapEffects(re,ot).concat(rt.mapEffects(ki(Ce.effects),gt))}return{changes:N,selection:Je.create($,O.mainIndex),effects:re}}changes(d=[]){return d instanceof wt?d:wt.of(d,this.doc.length,this.facet(Q.lineSeparator))}toText(d){return ge.of(d.split(this.facet(Q.lineSeparator)||It))}sliceDoc(d=0,O=this.doc.length){return this.doc.sliceString(d,O,this.lineBreak)}facet(d){let O=this.config.address[d.id];return null==O?d.default:(Le(this,O),Ee(this,O))}toJSON(d){let O={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(d)for(let T in d){let N=d[T];N instanceof M&&null!=this.config.address[N.id]&&(O[T]=N.spec.toJSON(this.field(d[T]),this))}return O}static fromJSON(d,O={},T){if(!d||"string"!=typeof d.doc)throw new RangeError("Invalid JSON representation for EditorState");let N=[];if(T)for(let $ in T)if(Object.prototype.hasOwnProperty.call(d,$)){let re=T[$],ce=d[$];N.push(re.init(Ce=>re.spec.fromJSON(ce,Ce)))}return Q.create({doc:d.doc,selection:Je.fromJSON(d.selection),extensions:O.extensions?N.concat([O.extensions]):N})}static create(d={}){let O=fe.resolve(d.extensions||[],new Map),T=d.doc instanceof ge?d.doc:ge.of((d.doc||"").split(O.staticFacet(Q.lineSeparator)||It)),N=d.selection?d.selection instanceof Je?d.selection:Je.single(d.selection.anchor,d.selection.head):Je.single(0);return qe(N,T.length),O.staticFacet(P)||(N=N.asSingle()),new Q(O,T,N,O.dynamicSlots.map(()=>null),($,re)=>re.create($),null)}get tabSize(){return this.facet(Q.tabSize)}get lineBreak(){return this.facet(Q.lineSeparator)||"\n"}get readOnly(){return this.facet(ue)}phrase(d,...O){for(let T of this.facet(Q.phrases))if(Object.prototype.hasOwnProperty.call(T,d)){d=T[d];break}return O.length&&(d=d.replace(/\$(\$|\d*)/g,(T,N)=>{if("$"==N)return"$";let $=+(N||1);return!$||$>O.length?T:O[$-1]})),d}languageDataAt(d,O,T=-1){let N=[];for(let $ of this.facet(Ue))for(let re of $(this,O,T))Object.prototype.hasOwnProperty.call(re,d)&&N.push(re[d]);return N}charCategorizer(d){let O=this.languageDataAt("wordChars",d);return function di(Q){return u=>{if(!/\S/.test(u))return yi.Space;if(function pi(Q){if(fi)return fi.test(Q);for(let u=0;u<Q.length;u++){let d=Q[u];if(/\w/.test(d)||d>"\x80"&&(d.toUpperCase()!=d.toLowerCase()||Ni.test(d)))return!0}return!1}(u))return yi.Word;for(let d=0;d<Q.length;d++)if(u.indexOf(Q[d])>-1)return yi.Word;return yi.Other}}(O.length?O[0]:"")}wordAt(d){let{text:O,from:T,length:N}=this.doc.lineAt(d),$=this.charCategorizer(d),re=d-T,ce=d-T;for(;re>0;){let Ce=oi(O,re,!1);if($(O.slice(Ce,re))!=yi.Word)break;re=Ce}for(;ce<N;){let Ce=oi(O,ce);if($(O.slice(ce,Ce))!=yi.Word)break;ce=Ce}return re==ce?null:Je.range(re+T,ce+T)}}return Q.allowMultipleSelections=P,Q.tabSize=at.define({combine:u=>u.length?u[0]:4}),Q.lineSeparator=f,Q.readOnly=ue,Q.phrases=at.define({compare(u,d){let O=Object.keys(u),T=Object.keys(d);return O.length==T.length&&O.every(N=>u[N]==d[N])}}),Q.languageData=Ue,Q.changeFilter=m,Q.transactionFilter=V,Q.transactionExtender=ne,Q})();function xi(Q,u,d={}){let O={};for(let T of Q)for(let N of Object.keys(T)){let $=T[N],re=O[N];if(void 0===re)O[N]=$;else if(re!==$&&void 0!==$){if(!Object.hasOwnProperty.call(d,N))throw new Error("Config merge conflict for field "+N);O[N]=d[N](re,$)}}for(let T in u)void 0===O[T]&&(O[T]=u[T]);return O}K.reconfigure=rt.define();class Di{eq(u){return this==u}range(u,d=u){return vi.create(u,d,this)}}function Ii(Q,u){return Q==u||Q.constructor==u.constructor&&Q.eq(u)}Di.prototype.startSide=Di.prototype.endSide=0,Di.prototype.point=!1,Di.prototype.mapMode=vt.TrackDel;class vi{constructor(u,d,O){this.from=u,this.to=d,this.value=O}static create(u,d,O){return new vi(u,d,O)}}function mi(Q,u){return Q.from-u.from||Q.value.startSide-u.value.startSide}class en{constructor(u,d,O,T){this.from=u,this.to=d,this.value=O,this.maxPoint=T}get length(){return this.to[this.to.length-1]}findIndex(u,d,O,T=0){let N=O?this.to:this.from;for(let $=T,re=N.length;;){if($==re)return $;let ce=$+re>>1,Ce=N[ce]-u||(O?this.value[ce].endSide:this.value[ce].startSide)-d;if(ce==$)return Ce>=0?$:re;Ce>=0?re=ce:$=ce+1}}between(u,d,O,T){for(let N=this.findIndex(d,-1e9,!0),$=this.findIndex(O,1e9,!1,N);N<$;N++)if(!1===T(this.from[N]+u,this.to[N]+u,this.value[N]))return!1}map(u,d){let O=[],T=[],N=[],$=-1,re=-1;for(let ce=0;ce<this.value.length;ce++){let gt,ht,Ce=this.value[ce],je=this.from[ce]+u,ot=this.to[ce]+u;if(je==ot){let jt=d.mapPos(je,Ce.startSide,Ce.mapMode);if(null==jt||(gt=ht=jt,Ce.startSide!=Ce.endSide&&(ht=d.mapPos(je,Ce.endSide),ht<gt)))continue}else if(gt=d.mapPos(je,Ce.startSide),ht=d.mapPos(ot,Ce.endSide),gt>ht||gt==ht&&Ce.startSide>0&&Ce.endSide<=0)continue;(ht-gt||Ce.endSide-Ce.startSide)<0||($<0&&($=gt),Ce.point&&(re=Math.max(re,ht-gt)),O.push(Ce),T.push(gt-$),N.push(ht-$))}return{mapped:O.length?new en(T,N,O,re):null,pos:$}}}let tn=(()=>{class Q{constructor(d,O,T,N){this.chunkPos=d,this.chunk=O,this.nextLayer=T,this.maxPoint=N}static create(d,O,T,N){return new Q(d,O,T,N)}get length(){let d=this.chunk.length-1;return d<0?0:Math.max(this.chunkEnd(d),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let d=this.nextLayer.size;for(let O of this.chunk)d+=O.value.length;return d}chunkEnd(d){return this.chunkPos[d]+this.chunk[d].length}update(d){let{add:O=[],sort:T=!1,filterFrom:N=0,filterTo:$=this.length}=d,re=d.filter;if(0==O.length&&!re)return this;if(T&&(O=O.slice().sort(mi)),this.isEmpty)return O.length?Q.of(O):this;let ce=new Si(this,null,-1).goto(0),Ce=0,je=[],ot=new nn;for(;ce.value||Ce<O.length;)if(Ce<O.length&&(ce.from-O[Ce].from||ce.startSide-O[Ce].value.startSide)>=0){let gt=O[Ce++];ot.addInner(gt.from,gt.to,gt.value)||je.push(gt)}else 1==ce.rangeIndex&&ce.chunkIndex<this.chunk.length&&(Ce==O.length||this.chunkEnd(ce.chunkIndex)<O[Ce].from)&&(!re||N>this.chunkEnd(ce.chunkIndex)||$<this.chunkPos[ce.chunkIndex])&&ot.addChunk(this.chunkPos[ce.chunkIndex],this.chunk[ce.chunkIndex])?ce.nextChunk():((!re||N>ce.to||$<ce.from||re(ce.from,ce.to,ce.value))&&(ot.addInner(ce.from,ce.to,ce.value)||je.push(vi.create(ce.from,ce.to,ce.value))),ce.next());return ot.finishInner(this.nextLayer.isEmpty&&!je.length?Q.empty:this.nextLayer.update({add:je,filter:re,filterFrom:N,filterTo:$}))}map(d){if(d.empty||this.isEmpty)return this;let O=[],T=[],N=-1;for(let re=0;re<this.chunk.length;re++){let ce=this.chunkPos[re],Ce=this.chunk[re],je=d.touchesRange(ce,ce+Ce.length);if(!1===je)N=Math.max(N,Ce.maxPoint),O.push(Ce),T.push(d.mapPos(ce));else if(!0===je){let{mapped:ot,pos:gt}=Ce.map(ce,d);ot&&(N=Math.max(N,ot.maxPoint),O.push(ot),T.push(gt))}}let $=this.nextLayer.map(d);return 0==O.length?$:new Q(T,O,$||Q.empty,N)}between(d,O,T){if(!this.isEmpty){for(let N=0;N<this.chunk.length;N++){let $=this.chunkPos[N],re=this.chunk[N];if(O>=$&&d<=$+re.length&&!1===re.between($,d-$,O-$,T))return}this.nextLayer.between(d,O,T)}}iter(d=0){return _i.from([this]).goto(d)}get isEmpty(){return this.nextLayer==this}static iter(d,O=0){return _i.from(d).goto(O)}static compare(d,O,T,N,$=-1){let re=d.filter(gt=>gt.maxPoint>0||!gt.isEmpty&>.maxPoint>=$),ce=O.filter(gt=>gt.maxPoint>0||!gt.isEmpty&>.maxPoint>=$),Ce=cn(re,ce,T),je=new Xi(re,Ce,$),ot=new Xi(ce,Ce,$);T.iterGaps((gt,ht,jt)=>Vi(je,gt,ot,ht,jt,N)),T.empty&&0==T.length&&Vi(je,0,ot,0,0,N)}static eq(d,O,T=0,N){null==N&&(N=999999999);let $=d.filter(ot=>!ot.isEmpty&&O.indexOf(ot)<0),re=O.filter(ot=>!ot.isEmpty&&d.indexOf(ot)<0);if($.length!=re.length)return!1;if(!$.length)return!0;let ce=cn($,re),Ce=new Xi($,ce,0).goto(T),je=new Xi(re,ce,0).goto(T);for(;;){if(Ce.to!=je.to||!ei(Ce.active,je.active)||Ce.point&&(!je.point||!Ii(Ce.point,je.point)))return!1;if(Ce.to>N)return!0;Ce.next(),je.next()}}static spans(d,O,T,N,$=-1){let re=new Xi(d,null,$).goto(O),ce=O,Ce=re.openStart;for(;;){let je=Math.min(re.to,T);if(re.point){let ot=re.activeForPoint(re.to),gt=re.pointFrom<O?ot.length+1:re.point.startSide<0?ot.length:Math.min(ot.length,Ce);N.point(ce,je,re.point,ot,gt,re.pointRank),Ce=Math.min(re.openEnd(je),ot.length)}else je>ce&&(N.span(ce,je,re.active,Ce),Ce=re.openEnd(je));if(re.to>T)return Ce+(re.point&&re.to>T?1:0);ce=re.to,re.next()}}static of(d,O=!1){let T=new nn;for(let N of d instanceof vi?[d]:O?function si(Q){if(Q.length>1)for(let u=Q[0],d=1;d<Q.length;d++){let O=Q[d];if(mi(u,O)>0)return Q.slice().sort(mi);u=O}return Q}(d):d)T.add(N.from,N.to,N.value);return T.finish()}static join(d){if(!d.length)return Q.empty;let O=d[d.length-1];for(let T=d.length-2;T>=0;T--)for(let N=d[T];N!=Q.empty;N=N.nextLayer)O=new Q(N.chunkPos,N.chunk,O,Math.max(N.maxPoint,O.maxPoint));return O}}return Q.empty=new Q([],[],null,-1),Q})();tn.empty.nextLayer=tn.empty;class nn{finishChunk(u){this.chunks.push(new en(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,u&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(u,d,O){this.addInner(u,d,O)||(this.nextLayer||(this.nextLayer=new nn)).add(u,d,O)}addInner(u,d,O){let T=u-this.lastTo||O.startSide-this.last.endSide;if(T<=0&&(u-this.lastFrom||O.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(T<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=u),this.from.push(u-this.chunkStart),this.to.push(d-this.chunkStart),this.last=O,this.lastFrom=u,this.lastTo=d,this.value.push(O),O.point&&(this.maxPoint=Math.max(this.maxPoint,d-u)),0))}addChunk(u,d){if((u-this.lastTo||d.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,d.maxPoint),this.chunks.push(d),this.chunkPos.push(u);let O=d.value.length-1;return this.last=d.value[O],this.lastFrom=d.from[O]+u,this.lastTo=d.to[O]+u,!0}finish(){return this.finishInner(tn.empty)}finishInner(u){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return u;let d=tn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(u):u,this.setMaxPoint);return this.from=null,d}}function cn(Q,u,d){let O=new Map;for(let N of Q)for(let $=0;$<N.chunk.length;$++)N.chunk[$].maxPoint<=0&&O.set(N.chunk[$],N.chunkPos[$]);let T=new Set;for(let N of u)for(let $=0;$<N.chunk.length;$++){let re=O.get(N.chunk[$]);null!=re&&(d?d.mapPos(re):re)==N.chunkPos[$]&&!d?.touchesRange(re,re+N.chunk[$].length)&&T.add(N.chunk[$])}return T}class Si{constructor(u,d,O,T=0){this.layer=u,this.skip=d,this.minPoint=O,this.rank=T}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(u,d=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(u,d,!1),this}gotoInner(u,d,O){for(;this.chunkIndex<this.layer.chunk.length;){let T=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(T)||this.layer.chunkEnd(this.chunkIndex)<u||T.maxPoint<this.minPoint))break;this.chunkIndex++,O=!1}if(this.chunkIndex<this.layer.chunk.length){let T=this.layer.chunk[this.chunkIndex].findIndex(u-this.layer.chunkPos[this.chunkIndex],d,!0);(!O||this.rangeIndex<T)&&this.setRangeIndex(T)}this.next()}forward(u,d){(this.to-u||this.endSide-d)<0&&this.gotoInner(u,d,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let u=this.layer.chunkPos[this.chunkIndex],d=this.layer.chunk[this.chunkIndex];if(this.from=u+d.from[this.rangeIndex],this.to=u+d.to[this.rangeIndex],this.value=d.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(u){if(u==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=u}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(u){return this.from-u.from||this.startSide-u.startSide||this.rank-u.rank||this.to-u.to||this.endSide-u.endSide}}class _i{constructor(u){this.heap=u}static from(u,d=null,O=-1){let T=[];for(let N=0;N<u.length;N++)for(let $=u[N];!$.isEmpty;$=$.nextLayer)$.maxPoint>=O&&T.push(new Si($,d,O,N));return 1==T.length?T[0]:new _i(T)}get startSide(){return this.value?this.value.startSide:0}goto(u,d=-1e9){for(let O of this.heap)O.goto(u,d);for(let O=this.heap.length>>1;O>=0;O--)wi(this.heap,O);return this.next(),this}forward(u,d){for(let O of this.heap)O.forward(u,d);for(let O=this.heap.length>>1;O>=0;O--)wi(this.heap,O);(this.to-u||this.value.endSide-d)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let u=this.heap[0];this.from=u.from,this.to=u.to,this.value=u.value,this.rank=u.rank,u.value&&u.next(),wi(this.heap,0)}}}function wi(Q,u){for(let d=Q[u];;){let O=1+(u<<1);if(O>=Q.length)break;let T=Q[O];if(O+1<Q.length&&T.compare(Q[O+1])>=0&&(T=Q[O+1],O++),d.compare(T)<0)break;Q[O]=d,Q[u]=T,u=O}}class Xi{constructor(u,d,O){this.minPoint=O,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=_i.from(u,d,O)}goto(u,d=-1e9){return this.cursor.goto(u,d),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=u,this.endSide=d,this.openStart=-1,this.next(),this}forward(u,d){for(;this.minActive>-1&&(this.activeTo[this.minActive]-u||this.active[this.minActive].endSide-d)<0;)this.removeActive(this.minActive);this.cursor.forward(u,d)}removeActive(u){Ji(this.active,u),Ji(this.activeTo,u),Ji(this.activeRank,u),this.minActive=Ut(this.active,this.activeTo)}addActive(u){let d=0,{value:O,to:T,rank:N}=this.cursor;for(;d<this.activeRank.length&&(N-this.activeRank[d]||T-this.activeTo[d])>0;)d++;Gi(this.active,d,O),Gi(this.activeTo,d,T),Gi(this.activeRank,d,N),u&&Gi(u,d,this.cursor.from),this.minActive=Ut(this.active,this.activeTo)}next(){let u=this.to,d=this.point;this.point=null;let O=this.openStart<0?[]:null;for(;;){let T=this.minActive;if(T>-1&&(this.activeTo[T]-this.cursor.from||this.active[T].endSide-this.cursor.startSide)<0){if(this.activeTo[T]>u){this.to=this.activeTo[T],this.endSide=this.active[T].endSide;break}this.removeActive(T),O&&Ji(O,T)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>u){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let N=this.cursor.value;if(N.point){if(!(d&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=N,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=N.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(O),this.cursor.next()}}}if(O){this.openStart=0;for(let T=O.length-1;T>=0&&O[T]<u;T--)this.openStart++}}activeForPoint(u){if(!this.active.length)return this.active;let d=[];for(let O=this.active.length-1;O>=0&&!(this.activeRank[O]<this.pointRank);O--)(this.activeTo[O]>u||this.activeTo[O]==u&&this.active[O].endSide>=this.point.endSide)&&d.push(this.active[O]);return d.reverse()}openEnd(u){let d=0;for(let O=this.activeTo.length-1;O>=0&&this.activeTo[O]>u;O--)d++;return d}}function Vi(Q,u,d,O,T,N){Q.goto(u),d.goto(O);let $=O+T,re=O,ce=O-u,Ce=!!N.boundChange;for(let je=!1;;){let ot=Q.to+ce-d.to,gt=ot||Q.endSide-d.endSide,ht=gt<0?Q.to+ce:d.to,jt=Math.min(ht,$);if(Q.point||d.point?(Q.point&&d.point&&Ii(Q.point,d.point)&&ei(Q.activeForPoint(Q.to),d.activeForPoint(d.to))||N.comparePoint(re,jt,Q.point,d.point),je=!1):(je&&N.boundChange(re),jt>re&&!ei(Q.active,d.active)&&N.compareRange(re,jt,Q.active,d.active),Ce&&jt<$&&(ot||Q.openEnd(ht)!=d.openEnd(ht))&&(je=!0)),ht>$)break;re=ht,gt<=0&&Q.next(),gt>=0&&d.next()}}function ei(Q,u){if(Q.length!=u.length)return!1;for(let d=0;d<Q.length;d++)if(Q[d]!=u[d]&&!Ii(Q[d],u[d]))return!1;return!0}function Ji(Q,u){for(let d=u,O=Q.length-1;d<O;d++)Q[d]=Q[d+1];Q.pop()}function Gi(Q,u,d){for(let O=Q.length-1;O>=u;O--)Q[O+1]=Q[O];Q[u]=d}function Ut(Q,u){let d=-1,O=1e9;for(let T=0;T<u.length;T++)(u[T]-O||Q[T].endSide-Q[d].endSide)<0&&(d=T,O=u[T]);return d}function $i(Q,u,d=Q.length){let O=0;for(let T=0;T<d&&T<Q.length;)9==Q.charCodeAt(T)?(O+=u-O%u,T++):(O++,T=oi(Q,T));return O}function Bi(Q,u,d,O){for(let T=0,N=0;;){if(N>=u)return T;if(T==Q.length)break;N+=9==Q.charCodeAt(T)?d-N%d:1,T=oi(Q,T)}return!0===O?-1:Q.length}},3161(Ei,At,We){"use strict";We.d(At,{NZ:()=>It,OP:()=>f,Lz:()=>cr,wJ:()=>ur,Z9:()=>Ut,xO:()=>ci,ab:()=>Yo,HJ:()=>Vo,VH:()=>go,A:()=>xo,ld:()=>Vs,Eg:()=>Zo,cU:()=>il,dz:()=>Do,Wu:()=>fl,N$:()=>Po,Ux:()=>Xo,w4:()=>ws,$K:()=>hl,c_:()=>Vi,D4:()=>No,TS:()=>ao,ui:()=>Ko,S7:()=>qr,DK:()=>hs});for(var j=We(1380),g=We(2316),R={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},le={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Te=typeof navigator<"u"&&/Mac/.test(navigator.platform),Ve=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Ye=0;Ye<10;Ye++)R[48+Ye]=R[96+Ye]=String(Ye);for(Ye=1;Ye<=24;Ye++)R[Ye+111]="F"+Ye;for(Ye=65;Ye<=90;Ye++)R[Ye]=String.fromCharCode(Ye+32),le[Ye]=String.fromCharCode(Ye);for(var Se in R)le.hasOwnProperty(Se)||(le[Se]=R[Se]);var Ke=We(4937);let X=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},ae=typeof document<"u"?document:{documentElement:{style:{}}};const se=/Edge\/(\d+)/.exec(X.userAgent),ge=/MSIE \d/.test(X.userAgent),we=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(X.userAgent),dt=!!(ge||we||se),ze=!dt&&/gecko\/(\d+)/i.test(X.userAgent),Ct=!dt&&/Chrome\/(\d+)/.exec(X.userAgent),Qt="webkitFontSmoothing"in ae.documentElement.style,Wt=!dt&&/Apple Computer/.test(X.vendor),Mt=Wt&&(/Mobile\/\w+/.test(X.userAgent)||X.maxTouchPoints>2);var He={mac:Mt||/Mac/.test(X.platform),windows:/Win/.test(X.platform),linux:/Linux|X11/.test(X.platform),ie:dt,ie_version:ge?ae.documentMode||6:we?+we[1]:se?+se[1]:0,gecko:ze,gecko_version:ze?+(/Firefox\/(\d+)/.exec(X.userAgent)||[0,0])[1]:0,chrome:!!Ct,chrome_version:Ct?+Ct[1]:0,ios:Mt,android:/Android\b/.test(X.userAgent),webkit:Qt,webkit_version:Qt?+(/\bAppleWebKit\/(\d+)/.exec(X.userAgent)||[0,0])[1]:0,safari:Wt,safari_version:Wt?+(/\bVersion\/(\d+(\.\d+)?)/.exec(X.userAgent)||[0,0])[1]:0,tabSize:null!=ae.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function Nt(s,e){for(let t in s)"class"==t&&e.class?e.class+=" "+s.class:"style"==t&&e.style?e.style+=";"+s.style:e[t]=s[t];return e}const ri=Object.create(null);function oi(s,e,t){if(s==e)return!0;s||(s=ri),e||(e=ri);let n=Object.keys(s),r=Object.keys(e);if(n.length-(t&&n.indexOf(t)>-1?1:0)!=r.length-(t&&r.indexOf(t)>-1?1:0))return!1;for(let o of n)if(o!=t&&(-1==r.indexOf(o)||s[o]!==e[o]))return!1;return!0}function Gt(s,e,t){let n=!1;if(e)for(let r in e)t&&r in t||(n=!0,"style"==r?s.style.cssText="":s.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(n=!0,"style"==r?s.style.cssText=t[r]:s.setAttribute(r,t[r]));return n}function li(s){let e=Object.create(null);for(let t=0;t<s.attributes.length;t++){let n=s.attributes[t];e[n.name]=n.value}return e}class ci{eq(e){return!1}updateDOM(e,t,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Kt=function(s){return s[s.Text=0]="Text",s[s.WidgetBefore=1]="WidgetBefore",s[s.WidgetAfter=2]="WidgetAfter",s[s.WidgetRange=3]="WidgetRange",s}(Kt||(Kt={}));class It extends j.FB{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new vt(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new wt(e,t,t,n,e.widget||null,!1)}static replace(e){let n,r,t=!!e.block;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:o,end:c}=Ne(e,t);n=(o?t?-3e8:-1:5e8)-1,r=1+(c?t?2e8:1:-6e8)}return new wt(e,n,r,t,e.widget||null,!0)}static line(e){return new Jt(e)}static set(e,t=!1){return j.om.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}It.none=j.om.empty;class vt extends It{constructor(e){let{start:t,end:n}=Ne(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?Nt(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||ri}eq(e){return this==e||e instanceof vt&&this.tagName==e.tagName&&oi(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}vt.prototype.point=!1;class Jt extends It{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Jt&&this.spec.class==e.spec.class&&oi(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Jt.prototype.mapMode=j.iR.TrackBefore,Jt.prototype.point=!0;class wt extends It{constructor(e,t,n,r,o,c){super(t,n,o,e),this.block=r,this.isReplace=c,this.mapMode=r?t<=0?j.iR.TrackBefore:j.iR.TrackAfter:j.iR.TrackDel}get type(){return this.startSide!=this.endSide?Kt.WidgetRange:this.startSide<=0?Kt.WidgetBefore:Kt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof wt&&function me(s,e){return s==e||!!(s&&e&&s.compare(e))}(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function Ne(s,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=s;return null==t&&(t=s.inclusive),null==n&&(n=s.inclusive),{start:t??e,end:n??e}}function de(s,e,t,n=0){let r=t.length-1;r>=0&&t[r]+n>=s?t[r]=Math.max(t[r],e):t.push(s,e)}wt.prototype.point=!0;class pe extends j.FB{constructor(e,t,n){super(),this.tagName=e,this.attributes=t,this.rank=n}eq(e){return e==this||e instanceof pe&&this.tagName==e.tagName&&oi(this.attributes,e.attributes)}static create(e){return new pe(e.tagName,e.attributes||ri,null==e.rank?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return j.om.of(e,t)}}function Ie(s){let e;return e=11==s.nodeType?s.getSelection?s:s.ownerDocument:s,e.getSelection()}function Ae(s,e){return!!e&&(s==e||s.contains(1!=e.nodeType?e.parentNode:e))}function it(s,e){if(!e.anchorNode)return!1;try{return Ae(s,e.anchorNode)}catch{return!1}}function Je(s){return 3==s.nodeType?K(s,0,s.nodeValue.length).getClientRects():1==s.nodeType?s.getClientRects():[]}function qe(s,e,t,n){return!!t&&(St(s,e,t,n,-1)||St(s,e,t,n,1))}function Pt(s){for(var e=0;;e++)if(!(s=s.previousSibling))return e}function at(s){return 1==s.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(s.nodeName)}function St(s,e,t,n,r){for(;;){if(s==t&&e==n)return!0;if(e==(r<0?0:kt(s))){if("DIV"==s.nodeName)return!1;let o=s.parentNode;if(!o||1!=o.nodeType)return!1;e=Pt(s)+(r<0?0:1),s=o}else{if(1!=s.nodeType)return!1;if(1==(s=s.childNodes[e+(r<0?-1:0)]).nodeType&&"false"==s.contentEditable)return!1;e=r<0?kt(s):0}}}function kt(s){return 3==s.nodeType?s.nodeValue.length:s.childNodes.length}function Et(s,e){let t=e?s.left:s.right;return{left:t,right:t,top:s.top,bottom:s.bottom}}function Lt(s){let e=s.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:s.innerWidth,top:0,bottom:s.innerHeight}}function _e(s,e){let t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-s.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-s.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function M(s,e=!0){let t=s.ownerDocument,n=null,r=null;for(let o=s.parentNode;o&&o!=t.body&&(e&&!n||!r);)if(1==o.nodeType)!r&&o.scrollHeight>o.clientHeight&&(r=o),e&&!n&&o.scrollWidth>o.clientWidth&&(n=o),o=o.assignedSlot||o.parentNode;else{if(11!=o.nodeType)break;o=o.host}return{x:n,y:r}}pe.prototype.startSide=pe.prototype.endSide=-1;class H{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?kt(t):0),n,Math.min(e.focusOffset,n?kt(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}let L,Y=null;function I(s){if(s.setActive)return s.setActive();if(Y)return s.focus(Y);let e=[];for(let t=s;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(s.focus(null==Y?{get preventScroll(){return Y={preventScroll:!0},!0}}:void 0),!Y){Y=!1;for(let t=0;t<e.length;){let n=e[t++],r=e[t++],o=e[t++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=o&&(n.scrollLeft=o)}}}function K(s,e,t=e){let n=L||(L=document.createRange());return n.setEnd(s,t),n.setStart(s,e),n}function J(s,e,t,n){let r={key:e,code:e,keyCode:t,which:t,cancelable:!0};n&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=n);let o=new KeyboardEvent("keydown",r);o.synthetic=!0,s.dispatchEvent(o);let c=new KeyboardEvent("keyup",r);return c.synthetic=!0,s.dispatchEvent(c),o.defaultPrevented||c.defaultPrevented}function Le(s){return s instanceof Window?s.pageYOffset>Math.max(0,s.document.documentElement.scrollHeight-s.innerHeight-4):s.scrollTop>Math.max(1,s.scrollHeight-s.clientHeight-4)}function Ee(s,e){for(let t=s,n=e;;){if(3==t.nodeType&&n>0)return{node:t,offset:n};if(1==t.nodeType&&n>0){if("false"==t.contentEditable)return null;t=t.childNodes[n-1],n=kt(t)}else{if(!t.parentNode||at(t))return null;n=Pt(t),t=t.parentNode}}}function Ue(s,e){for(let t=s,n=e;;){if(3==t.nodeType&&n<t.nodeValue.length)return{node:t,offset:n};if(1==t.nodeType&&n<t.childNodes.length){if("false"==t.contentEditable)return null;t=t.childNodes[n],n=0}else{if(!t.parentNode||at(t))return null;n=Pt(t)+1,t=t.parentNode}}}He.safari&&He.safari_version>=26&&(Y=!1);class P{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new P(e.parentNode,Pt(e),t)}static after(e,t){return new P(e.parentNode,Pt(e)+1,t)}}var f=function(s){return s[s.LTR=0]="LTR",s[s.RTL=1]="RTL",s}(f||(f={}));const m=f.LTR,V=f.RTL;function ne(s){let e=[];for(let t=0;t<s.length;t++)e.push(1<<+s[t]);return e}const ue=ne("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Pe=ne("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),$e=Object.create(null),lt=[];for(let s of["()","[]","{}"]){let e=s.charCodeAt(0),t=s.charCodeAt(1);$e[e]=t,$e[t]=-e}function rt(s){return s<=247?ue[s]:1424<=s&&s<=1524?2:1536<=s&&s<=1785?Pe[s-1536]:1774<=s&&s<=2220?4:8192<=s&&s<=8204?256:64336<=s&&s<=65023?4:1}const mt=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class bt{get dir(){return this.level%2?V:m}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let o=-1;for(let c=0;c<e.length;c++){let p=e[c];if(p.from<=t&&p.to>=t){if(p.level==n)return c;(o<0||(0!=r?r<0?p.from<t:p.to>t:e[o].level>p.level))&&(o=c)}}if(o<0)throw new RangeError("Index out of range");return o}}function ai(s,e){if(s.length!=e.length)return!1;for(let t=0;t<s.length;t++){let n=s[t],r=e[t];if(n.from!=r.from||n.to!=r.to||n.direction!=r.direction||!ai(n.inner,r.inner))return!1}return!0}const Tt=[];function hi(s,e,t,n,r,o,c){let p=n%2?2:1;if(n%2==r%2)for(let x=e,E=0;x<t;){let U=!0,te=!1;if(E==o.length||x<o[E].from){let Me=Tt[x];Me!=p&&(U=!1,te=16==Me)}let oe=U||1!=p?null:[],Fe=U?n:n+1,De=x;e:for(;;)if(E<o.length&&De==o[E].from){if(te)break e;let Me=o[E];if(!U)for(let st=Me.to,ft=E+1;;){if(st==t)break e;if(!(ft<o.length&&o[ft].from==st)){if(Tt[st]==p)break e;break}st=o[ft++].to}E++,oe?oe.push(Me):(Me.from>x&&c.push(new bt(x,Me.from,Fe)),ki(s,Me.direction==m!=!(Fe%2)?n+1:n,r,Me.inner,Me.from,Me.to,c),x=Me.to),De=Me.to}else{if(De==t||(U?Tt[De]!=p:Tt[De]==p))break;De++}oe?hi(s,x,De,n+1,r,oe,c):x<De&&c.push(new bt(x,De,Fe)),x=De}else for(let x=t,E=o.length;x>e;){let U=!0,te=!1;if(!E||x>o[E-1].to){let Me=Tt[x-1];Me!=p&&(U=!1,te=16==Me)}let oe=U||1!=p?null:[],Fe=U?n:n+1,De=x;e:for(;;)if(E&&De==o[E-1].to){if(te)break e;let Me=o[--E];if(!U)for(let st=Me.from,ft=E;;){if(st==e)break e;if(!ft||o[ft-1].to!=st){if(Tt[st-1]==p)break e;break}st=o[--ft].from}oe?oe.push(Me):(Me.to<x&&c.push(new bt(Me.to,x,Fe)),ki(s,Me.direction==m!=!(Fe%2)?n+1:n,r,Me.inner,Me.from,Me.to,c),x=Me.from),De=Me.from}else{if(De==e||(U?Tt[De-1]!=p:Tt[De-1]==p))break;De--}oe?hi(s,De,x,n+1,r,oe,c):De<x&&c.push(new bt(De,x,Fe)),x=De}}function ki(s,e,t,n,r,o,c){let p=e%2?2:1;(function Rt(s,e,t,n,r){for(let o=0;o<=n.length;o++){let c=o?n[o-1].to:e,p=o<n.length?n[o].from:t,x=o?256:r;for(let E=c,U=x,te=x;E<p;E++){let oe=rt(s.charCodeAt(E));512==oe?oe=U:8==oe&&4==te&&(oe=16),Tt[E]=4==oe?2:oe,7&oe&&(te=oe),U=oe}for(let E=c,U=x,te=x;E<p;E++){let oe=Tt[E];if(128==oe)E<p-1&&U==Tt[E+1]&&24&U?oe=Tt[E]=U:Tt[E]=256;else if(64==oe){let Fe=E+1;for(;Fe<p&&64==Tt[Fe];)Fe++;let De=E&&8==U||Fe<t&&8==Tt[Fe]?1==te?1:8:256;for(let Me=E;Me<Fe;Me++)Tt[Me]=De;E=Fe-1}else 8==oe&&1==te&&(Tt[E]=1);U=oe,7&oe&&(te=oe)}}})(s,r,o,n,p),function qt(s,e,t,n,r){let o=1==r?2:1;for(let c=0,p=0,x=0;c<=n.length;c++){let U=c<n.length?n[c].from:t;for(let oe,Fe,De,te=c?n[c-1].to:e;te<U;te++)if(Fe=$e[oe=s.charCodeAt(te)])if(Fe<0){for(let Me=p-3;Me>=0;Me-=3)if(lt[Me+1]==-Fe){let st=lt[Me+2],ft=2&st?r:4&st?1&st?o:r:0;ft&&(Tt[te]=Tt[lt[Me]]=ft),p=Me;break}}else{if(189==lt.length)break;lt[p++]=te,lt[p++]=oe,lt[p++]=x}else if(2==(De=Tt[te])||1==De){let Me=De==r;x=Me?0:1;for(let st=p-3;st>=0;st-=3){let ft=lt[st+2];if(2&ft)break;if(Me)lt[st+2]|=2;else{if(4&ft)break;lt[st+2]|=4}}}}}(s,r,o,n,p),function zt(s,e,t,n){for(let r=0,o=n;r<=t.length;r++){let p=r<t.length?t[r].from:e;for(let x=r?t[r-1].to:s;x<p;){let E=Tt[x];if(256==E){let U=x+1;for(;;)if(U==p){if(r==t.length)break;U=t[r++].to,p=r<t.length?t[r].from:e}else{if(256!=Tt[U])break;U++}let te=1==o,Fe=te==(1==(U<e?Tt[U]:n))?te?1:2:n;for(let De=U,Me=r,st=Me?t[Me-1].to:s;De>x;)De==st&&(De=t[--Me].from,st=Me?t[Me-1].to:s),Tt[--De]=Fe;x=U}else o=E,x++}}}(r,o,n,p),hi(s,r,o,e,t,n,c)}function Ni(s){return[new bt(0,s,0)]}let fi="";function pi(s,e,t,n,r){var o;let c=n.head-s.from,p=bt.find(e,c,null!==(o=n.bidiLevel)&&void 0!==o?o:-1,n.assoc),x=e[p],E=x.side(r,t);if(c==E){let oe=p+=r?1:-1;if(oe<0||oe>=e.length)return null;x=e[p=oe],c=x.side(!r,t),E=x.side(r,t)}let U=(0,j.zK)(s.text,c,x.forward(r,t));(U<x.from||U>x.to)&&(U=E),fi=s.text.slice(Math.min(c,U),Math.max(c,U));let te=p==(r?e.length-1:0)?null:e[p+(r?1:-1)];return te&&U==E&&te.level+(r?0:1)<x.level?j.OF.cursor(te.side(!r,t)+s.from,te.forward(r,t)?1:-1,te.level):j.OF.cursor(U+s.from,x.forward(r,t)?-1:1,x.level)}function di(s,e,t){for(let n=e;n<t;n++){let r=rt(s.charCodeAt(n));if(1==r)return m;if(2==r||4==r)return V}return m}const gi=j.sj.define(),xi=j.sj.define(),Di=j.sj.define(),Ii=j.sj.define(),vi=j.sj.define(),mi=j.sj.define(),en=j.sj.define(),tn=j.sj.define(),si=j.sj.define(),nn=j.sj.define({combine:s=>s.some(e=>e)}),cn=j.sj.define({combine:s=>s.some(e=>e)}),Si=j.sj.define();class _i{constructor(e,t,n,r,o,c=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=o,this.isSnapshot=c}map(e){return e.empty?this:new _i(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new _i(j.OF.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const wi=j.Pe.define({map:(s,e)=>s.map(e)}),Xi=j.Pe.define();function Vi(s,e,t){let n=s.facet(Ii);n.length?n[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const ei=j.sj.define({combine:s=>!s.length||s[0]});let Ji=0;const Gi=j.sj.define({combine:s=>s.filter((e,t)=>{for(let n=0;n<t;n++)if(s[n].plugin==e.plugin)return!1;return!0})});class Ut{constructor(e,t,n,r,o){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=o(this),this.extension=this.baseExtensions.concat(Gi.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Gi.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:n,eventObservers:r,provide:o,decorations:c}=t||{};return new Ut(Ji++,e,n,r,p=>{let x=[];return c&&x.push(u.of(E=>{let U=E.plugin(p);return U?c(U):It.none})),o&&x.push(o(p)),x})}static fromClass(e,t){return Ut.define((n,r)=>new e(n,r),t)}}class $i{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(n){if(Vi(t.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){Vi(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null!==(t=this.value)&&void 0!==t&&t.destroy)try{this.value.destroy()}catch(n){Vi(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Bi=j.sj.define(),Q=j.sj.define(),u=j.sj.define(),d=j.sj.define(),O=j.sj.define(),T=j.sj.define(),N=j.sj.define();function $(s,e){let t=s.state.facet(N);if(!t.length)return t;let n=t.map(o=>o instanceof Function?o(s):o),r=[];return j.om.spans(n,e.from,e.to,{point(){},span(o,c,p,x){let E=o-e.from,U=c-e.from,te=r;for(let oe=p.length-1;oe>=0;oe--,x--){let De,Fe=p[oe].spec.bidiIsolate;if(null==Fe&&(Fe=di(e.text,E,U)),x>0&&te.length&&(De=te[te.length-1]).to==E&&De.direction==Fe)De.to=U,te=De.inner;else{let Me={from:E,to:U,direction:Fe,inner:[]};te.push(Me),te=Me.inner}}}}),r}const re=j.sj.define();function ce(s){let e=0,t=0,n=0,r=0;for(let o of s.state.facet(re)){let c=o(s);c&&(null!=c.left&&(e=Math.max(e,c.left)),null!=c.right&&(t=Math.max(t,c.right)),null!=c.top&&(n=Math.max(n,c.top)),null!=c.bottom&&(r=Math.max(r,c.bottom)))}return{left:e,right:t,top:n,bottom:r}}const Ce=j.sj.define();class je{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new je(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(0==t.length)return e;let n=[];for(let r=0,o=0,c=0;;){let E=Math.min(r<e.length?e[r].fromB:1e9,o<t.length?t[o]:1e9);if(1e9==E)break;let U=E+c,te=E,oe=U;for(;;)if(o<t.length&&t[o]<=te){let Fe=t[o+1];o+=2,te=Math.max(te,Fe);for(let De=r;De<e.length&&e[De].fromB<=te;De++)c=e[De].toA-e[De].toB;oe=Math.max(oe,Fe+c)}else{if(!(r<e.length&&e[r].fromB<=te))break;{let Fe=e[r++];te=Math.max(te,Fe.toB),oe=Math.max(oe,Fe.toA),c=Fe.toA-Fe.toB}}n.push(new je(U,oe,E,te))}return n}}class ot{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=j.VR.empty(this.startState.doc.length);for(let o of n)this.changes=this.changes.compose(o.changes);let r=[];this.changes.iterChangedRanges((o,c,p,x)=>r.push(new je(o,c,p,x))),this.changedRanges=r}static create(e,t,n){return new ot(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}const gt=[];class ht{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return 1&this.flags}get children(){return gt}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,4&this.flags){this.flags&=-5;let t=this.domAttrs;t&&function Yt(s,e){for(let t=s.attributes.length-1;t>=0;t--){let n=s.attributes[t].name;null==e[n]&&s.removeAttribute(n)}for(let t in e){let n=e[t];"style"==t?s.style.cssText=n:s.getAttribute(t)!=n&&s.setAttribute(t,n)}}(this.dom,t)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let r of this.children){if(r==e)return n;n+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let n=Pt(this.dom);return new P(this.parent.dom,n+((this.length?e>0:t>0)?1:0),0==e||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&2&this.parent.flags&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof $t)return e;return null}static get(e){return e.cmTile}}class jt extends ht{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(2&this.flags)return;super.sync(e);let r,t=this.dom,n=null,o=e?.node==t?e:null,c=0;for(let p of this.children){if(p.sync(e),c+=p.length+p.breakAfter,r=n?n.nextSibling:t.firstChild,o&&r!=p.dom&&(o.written=!0),p.dom.parentNode==t)for(;r&&r!=p.dom;)r=Ci(r);else t.insertBefore(p.dom,r);n=p.dom}for(r=n?n.nextSibling:t.firstChild,o&&r&&(o.written=!0);r;)r=Ci(r);this.length=c}}function Ci(s){let e=s.nextSibling;return s.parentNode.removeChild(s),e}class $t extends jt{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=ht.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,o=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&o++,r=t.pop()}else{let c=n.children[r++];if(c instanceof zi)t.push(r),n=c,r=0;else{let p=o+c.length,x=e(c,o);if(void 0!==x)return x;o=p+c.breakAfter}}}resolveBlock(e,t){let n,o,r=-1,c=-1;if(this.blockTiles((p,x)=>{let E=x+p.length;if(e>=x&&e<=E){if(p.isWidget()&&t>=-1&&t<=1){if(32&p.flags)return!0;16&p.flags&&(n=void 0)}(x<e||e==E&&(t<-1?p.length:p.covers(1)))&&(!n||!p.isWidget()&&n.isWidget())&&(n=p,r=e-x),(E>e||e==x&&(t>1?p.length:p.covers(-1)))&&(!o||!p.isWidget()&&o.isWidget())&&(o=p,c=e-x)}}),!n&&!o)throw new Error("No tile at position "+e);return n&&t<0||!o?{tile:n,offset:r}:{tile:o,offset:c}}}class zi extends jt{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return!!this.children.length&&(e<0?this.children[0].covers(-1):this.lastChild.covers(1))}get domAttrs(){return this.wrapper.attributes}static of(e,t){let n=new zi(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class pn extends jt{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,n){let r=new pn(t||document.createElement("div"),e);return(!t||!n)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,o=-1,c=null,p=-1;!function x(U,te){for(let oe=0,Fe=0;oe<U.children.length&&Fe<=te;oe++){let De=U.children[oe],Me=Fe+De.length;Me>=te&&(De.isComposite()?x(De,te-Fe):(!c||c.isHidden&&(t>0||n&&Un(c,De)))&&(Me>te||32&De.flags)?(c=De,p=te-Fe):(Fe<te||16&De.flags&&!De.isHidden)&&(r=De,o=te-Fe)),Fe=Me}}(this,e);let E=(t<0?r:c)||r||c;return E?{tile:E,offset:E==r?o:p}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):function gn(s){let e=s.dom.lastChild;if(!e)return s.dom.getBoundingClientRect();let t=Je(e);return t[t.length-1]||null}(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:r,offset:o}=n;if(this.dom.contains(r.dom))return r.isText()?new P(r.dom,Math.min(r.dom.nodeValue.length,o)):r.domPosFor(o,16&r.flags?1:32&r.flags?-1:t);let c=n.tile.parent,p=!1;for(let x of c.children){if(p)return new P(x.dom,0);x==n.tile&&(p=!0)}}return new P(this.dom,0)}}function Un(s,e){let t=s.coordsIn(0,1),n=e.coordsIn(0,1);return t&&n&&n.top<t.bottom}class Ri extends jt{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let n=new Ri(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class rn extends ht{constructor(e,t){super(e,t.length),this.text=t}sync(e){2&this.flags||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let n=this.dom.nodeValue.length;e>n&&(e=n);let r=e,o=e,c=0;0==e&&t<0||e==n&&t>=0?He.chrome||He.gecko||(e?(r--,c=1):o<n&&(o++,c=-1)):t<0?r--:o<n&&o++;let p=K(this.dom,r,o).getClientRects();if(!p.length)return null;let x=p[(c?c<0:t>=0)?0:p.length-1];return He.safari&&!c&&0==x.width&&(x=Array.prototype.find.call(p,E=>E.width)||x),c?Et(x,c<0):x||null}static of(e,t){let n=new rn(t||document.createTextNode(e),e);return t||(n.flags|=2),n}}class mn extends ht{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return!(48&this.flags)&&(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return Et(this.dom.getBoundingClientRect(),this.length?0==e:t<=0);{let o=this.dom.getClientRects(),c=null;if(!o.length)return null;let p=!!(16&this.flags)||!(32&this.flags)&&e>0;for(let x=p?o.length-1:0;c=o[x],!(e>0?0==x:x==o.length-1||c.top<c.bottom);x+=p?-1:1);return Et(c,!p)}}get overrideDOMText(){if(!this.length)return j.EY.empty;let{root:e}=this;if(!e)return j.EY.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,n,r,o){return o||(o=e.toDOM(t),e.editable||(o.contentEditable="false")),new mn(o,n,e,r)}}class Yi extends ht{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return j.EY.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class In{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:o,beforeBreak:c,parents:p}=this;for(;e||t>0;)if(r.isComposite())if(c){if(!e)break;n&&n.break(),e--,c=!1}else if(o==r.children.length){if(!e&&!p.length)break;n&&n.leave(r),c=!!r.breakAfter,({tile:r,index:o}=p.pop()),o++}else{let x=r.children[o],E=x.breakAfter;!(t>0?x.length<=e:x.length<e)||n&&!1===n.skip(x,0,x.length)&&x.isComposite?(p.push({tile:r,index:o}),r=x,o=0,n&&x.isComposite()&&n.enter(x)):(c=!!E,o++,e-=x.length)}else if(o==r.length)c=!!r.breakAfter,({tile:r,index:o}=p.pop()),o++;else{if(!e)break;{let x=Math.min(e,r.length-o);n&&n.skip(r,o,o+x),e-=x,o+=x}}return this.tile=r,this.index=o,this.beforeBreak=c,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class jn{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}}class bn{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){var o;this.flushBuffer();let c=this.ensureMarks(t,n),p=c.lastChild;p&&p.isText()&&!(8&p.flags)&&p.length+e.length<512?(this.cache.reused.set(p,2),(c.children[c.children.length-1]=new rn(p.dom,p.text+e)).parent=c):c.append(r||rn.of(e,null===(o=this.cache.find(rn))||void 0===o?void 0:o.dom)),this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?ie(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let p=t.marks.length-1;p>=0;p--){let x=t.marks[p],E=r.lastChild;if(E instanceof Ri&&E.mark.eq(x.mark))E.dom!=x.dom&&E.setDOM(ie(x.dom)),r=E;else{if(this.cache.reused.get(x)){let te=ht.get(x.dom);te&&te.setDOM(ie(x.dom))}let U=Ri.of(x.mark,x.dom);r.append(U),r=U}this.cache.reused.set(x,2)}let o=ht.get(e.text);o&&this.cache.reused.set(o,2);let c=new rn(e.text,e.text.nodeValue);c.flags|=8,this.pos=e.range.toB,r.append(c)}addInlineWidget(e,t,n){let r=this.afterWidget&&48&e.flags&&(48&this.afterWidget.flags)==(48&e.flags);r||this.flushBuffer();let o=this.ensureMarks(t,n);!r&&!(16&e.flags)&&o.append(this.getBuffer(1)),o.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){(this.afterWidget||this.lastBlock).length+=e,this.pos+=e}addLineStart(e,t){var n;e||(e=S);let r=pn.start(e,t||(null===(n=this.cache.find(pn))||void 0===n?void 0:n.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var n;let r=this.curLine;for(let o=e.length-1;o>=0;o--){let p,c=e[o];if(t>0&&(p=r.lastChild)&&p instanceof Ri&&p.mark.eq(c))r=p,t--;else{let x=Ri.of(c,null===(n=this.cache.find(Ri,E=>E.mark.eq(c)))||void 0===n?void 0:n.dom);r.append(x),r=x,t=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!fn(this.curLine,!1)||"BR"!=e.dom.nodeName&&e.isWidget()&&!(He.ios&&fn(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(ke,0,32)||new mn(ke.toDOM(),0,ke,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=new jn(e.from,e.to,e.value,102*e.rank+e.value.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let n of this.wrappers){let r=t.lastChild;if(n.from<this.pos&&r instanceof zi&&r.wrapper.eq(n.wrapper))t=r;else{let o=zi.of(n.wrapper,null===(e=this.cache.find(zi,c=>c.wrapper.eq(n.wrapper)))||void 0===e?void 0:e.dom);t.append(o),t=o}}return t}blockPosCovered(){let e=this.lastBlock;return null!=e&&!e.breakAfter&&(!e.isWidget()||(160&e.flags)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(Yi,void 0,1);return n&&(n.flags=t),n||new Yi(t)}flushBuffer(){this.afterWidget&&!(32&this.afterWidget.flags)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class kn{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:c}=this.cursor.next(this.skipCount);if(this.skipCount=0,c)throw new Error("Ran out of text content when drawing inline views");this.text=r;let p=this.textOff=Math.min(e,r.length);return o?null:r.slice(0,p)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}}const sn=[mn,pn,rn,Ri,Yi,zi,$t];for(let s=0;s<sn.length;s++)sn[s].bucket=s;class $n{constructor(e){this.view=e,this.buckets=sn.map(()=>[]),this.index=sn.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,o=this.buckets[r],c=this.index[r];for(let p=o.length-1;p>=0;p--){let x=(p+c)%o.length,E=o[x];if((!t||t(E))&&!this.reused.has(E))return o.splice(x,1),x<c&&this.index[r]--,this.reused.set(E,n),E}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let o=0,c=0;;o++){if(o==r.length){if(c)return null;c=1,o=0}let p=r[o];if(!this.reused.has(p)&&(0==c?p.widget.compare(e):p.widget.constructor==e.constructor&&e.updateDOM(p.dom,this.view,p.widget)))return r.splice(o,1),o<this.index[0]&&this.index[0]--,p.widget==e&&p.length==t&&(497&p.flags)==n?(this.reused.set(p,1),p):(this.reused.set(p,2),new mn(p.dom,t,e,-498&p.flags|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class Mi{constructor(e,t,n,r,o){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=o,this.openWidget=!1,this.openMarks=0,this.cache=new $n(e),this.text=new kn(e.state.doc),this.builder=new bn(this.cache,new $t(e,e.contentDOM),j.om.iter(n)),this.cache.reused.set(t,2),this.old=new In(t),this.reuseWalker={skip:(c,p,x)=>{if(this.cache.add(c),c.isComposite())return!1},enter:c=>this.cache.add(c),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,o=0,c=0;;){let p=c<e.length?e[c++]:null,x=p?p.fromA:this.old.root.length;if(x>r){let E=x-r;this.preserve(E,!c,!p),r=x,o+=E}if(!p)break;t&&p.fromA<=t.range.fromA&&p.toA>=t.range.toA?(this.forward(p.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(o,t.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,p.toA),this.emit(t.range.toB,p.toB)):(this.forward(p.fromA,p.toA),this.emit(o,p.toB)),o=p.toB,r=p.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=function q(s){let e=[];for(let t=s.parents.length;t>1;t--){let n=t==s.parents.length?s.tile:s.parents[t].tile;n instanceof Ri&&e.push(n.mark)}return e}(this.old),o=this.openMarks;this.old.advance(e,n?1:-1,{skip:(c,p,x)=>{if(c.isWidget())if(this.openWidget)this.builder.continueWidget(x-p);else{let E=x>0||p<c.length?mn.of(c.widget,this.view,x-p,496&c.flags,this.cache.maybeReuse(c)):this.cache.reuse(c);256&E.flags?(E.flags&=-2,this.builder.addBlockWidget(E)):(this.builder.ensureLine(null),this.builder.addInlineWidget(E,r,o),o=r.length)}else if(c.isText())this.builder.ensureLine(null),p||x!=c.length||this.cache.reused.has(c)?(this.cache.add(c),this.builder.addText(c.text.slice(p,x),r,o)):this.builder.addText(c.text,r,o,this.cache.reuse(c)),o=r.length;else if(c.isLine())c.flags&=-2,this.cache.reused.set(c,1),this.builder.addLine(c);else if(c instanceof Yi)this.cache.add(c);else{if(!(c instanceof Ri))return!1;this.builder.ensureLine(null),this.builder.addMark(c,r,o),this.cache.reused.set(c,1),o=r.length}this.openWidget=!1},enter:c=>{c.isLine()?this.builder.addLineStart(c.attrs,this.cache.maybeReuse(c)):(this.cache.add(c),c instanceof Ri&&r.unshift(c.mark)),this.openWidget=!1},leave:c=>{c.isLine()?r.length&&(r.length=o=0):c instanceof Ri&&(r.shift(),o=Math.min(o,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,o=0,c=j.om.spans(this.decorations,e,t,{point:(p,x,E,U,te,oe)=>{if(E instanceof wt){if(this.disallowBlockEffectsFor[oe]){if(E.block)throw new RangeError("Block decorations may not be specified via plugins");if(x>this.view.state.doc.lineAt(p).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(o=U.length,te>U.length)r.continueWidget(x-p);else{let Fe=E.widget||(E.block?xe.block:xe.inline),De=function G(s){let e=s.isReplace?(s.startSide<0?64:0)|(s.endSide>0?128:0):s.startSide>0?32:16;return s.block&&(e|=256),e}(E),Me=this.cache.findWidget(Fe,x-p,De)||mn.of(Fe,this.view,x-p,De);E.block?(E.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(Me)):(r.ensureLine(n),r.addInlineWidget(Me,U,te))}n=null}else n=function A(s,e){let t=e.spec.attributes,n=e.spec.class;return!t&&!n||(s||(s={class:"cm-line"}),t&&Nt(t,s),n&&(s.class+=" "+n)),s}(n,E);x>p&&this.text.skip(x-p)},span:(p,x,E,U)=>{for(let te=p;te<x;){let oe=this.text.next(Math.min(512,x-te));null==oe?(r.addLineStartIfNotCovered(n),r.addBreak(),te++):(r.ensureLine(n),r.addText(oe,E,te==p?U:E.length),te+=oe.length),n=null}}});r.addLineStartIfNotCovered(n),this.openWidget=c>o,this.openMarks=c}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let o=ht.get(r);if(r==this.view.contentDOM)break;o instanceof Ri?t.push(o):o?.isLine()?n=o:o instanceof zi||("DIV"!=r.nodeName||n||r==this.view.contentDOM?n||t.push(Ri.of(new vt({tagName:r.nodeName.toLowerCase(),attributes:li(r)}),r)):n=new pn(r,S))}return{line:n,marks:t}}}function fn(s,e){let t=n=>{for(let r of n.children)if((e?r.isText():r.length)||t(r))return!0;return!1};return t(s)}const S={class:"cm-line"};function ie(s){let e=ht.get(s);return e&&e.setDOM(s.cloneNode()),s}let xe=(()=>{class s extends ci{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}return s.inline=new s("span"),s.block=new s("div"),s})();const ke=new class extends ci{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Xe{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=It.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new $t(e,e.contentDOM),this.updateInner([new je(0,0,0,e.state.doc.length)],null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:U,toA:te})=>te<this.minWidthFrom||U>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(null!==(t=this.domChanged)&&void 0!==t&&t.newSel?r=this.domChanged.newSel.head:!function zn(s,e){let t=!1;return e&&s.iterChangedRanges((n,r)=>{n<e.to&&r>e.from&&(t=!0)}),t}(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let o=r>-1?function bi(s,e,t){let n=Ft(s,t);if(!n)return null;let{node:r,from:o,to:c}=n,p=r.nodeValue;if(/[\n\r]/.test(p)||s.state.doc.sliceString(n.from,n.to)!=p)return null;let x=e.invertedDesc;return{range:new je(x.mapPos(o),x.mapPos(c),o,c),text:r}}(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:U,to:te}=this.hasComposition;n=new je(U,te,e.changes.mapPos(U,-1),e.changes.mapPos(te,1)).addToSet(n.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(He.ie||He.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let c=this.decorations,p=this.blockWrappers;this.updateDeco();let x=function On(s,e,t){let n=new Hi;return j.om.compare(s,e,t,n),n.changes}(c,this.decorations,e.changes);x.length&&(n=je.extendWithRanges(n,x));let E=function Nn(s,e,t){let n=new Ti;return j.om.compare(s,e,t,n),n.changes}(p,this.blockWrappers,e.changes);return E.length&&(n=je.extendWithRanges(n,E)),o&&!n.some(U=>U.fromA<=o.range.fromA&&U.toA>=o.range.toA)&&(n=o.range.addToSet(n.slice())),!(2&this.tile.flags&&0==n.length||(this.updateInner(n,o),e.transactions.length&&(this.lastUpdate=Date.now()),0))}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let c=this.tile,p=new Mi(this.view,c,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&ht.get(t.text)&&p.cache.reused.set(ht.get(t.text),2),this.tile=p.run(e,t),Qe(c,p.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=He.chrome||He.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(o),o&&(o.written||n.selectionRange.focusNode!=o.node||!this.tile.dom.contains(o.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.tile.children)o.isWidget()&&o.widget instanceof yn&&r.push(o.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let n of t.effects)n.is(Xi)&&(this.editContextFormatting=n.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,o=r==n,c=!o&&!(this.view.state.facet(ei)||n.tabIndex>-1)&&it(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(o||t||c))return;let p=this.forceSelection;this.forceSelection=!1;let E,U,x=this.view.state.selection.main;if(x.empty?U=E=this.inlineDOMNearPos(x.anchor,x.assoc||1):(U=this.inlineDOMNearPos(x.head,x.head==x.from?1:-1),E=this.inlineDOMNearPos(x.anchor,x.anchor==x.from?1:-1)),He.gecko&&x.empty&&!this.hasComposition&&function Ot(s){return 1==s.node.nodeType&&s.node.firstChild&&(0==s.offset||"false"==s.node.childNodes[s.offset-1].contentEditable)&&(s.offset==s.node.childNodes.length||"false"==s.node.childNodes[s.offset].contentEditable)}(E)){let oe=document.createTextNode("");this.view.observer.ignore(()=>E.node.insertBefore(oe,E.node.childNodes[E.offset]||null)),E=U=new P(oe,0),p=!0}let te=this.view.observer.selectionRange;(p||!te.focusNode||(!qe(E.node,E.offset,te.anchorNode,te.anchorOffset)||!qe(U.node,U.offset,te.focusNode,te.focusOffset))&&!this.suppressWidgetCursorChange(te,x))&&(this.view.observer.ignore(()=>{He.android&&He.chrome&&n.contains(te.focusNode)&&function un(s,e){for(let t=s;t&&t!=e;t=t.assignedSlot||t.parentNode)if(1==t.nodeType&&"false"==t.contentEditable)return!0;return!1}(te.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let oe=Ie(this.view.root);if(oe)if(x.empty){if(He.gecko){let Fe=function on(s,e){return 1!=s.nodeType?0:(e&&"false"==s.childNodes[e-1].contentEditable?1:0)|(e<s.childNodes.length&&"false"==s.childNodes[e].contentEditable?2:0)}(E.node,E.offset);if(Fe&&3!=Fe){let De=(1==Fe?Ee:Ue)(E.node,E.offset);De&&(E=new P(De.node,De.offset))}}oe.collapse(E.node,E.offset),null!=x.bidiLevel&&void 0!==oe.caretBidiLevel&&(oe.caretBidiLevel=x.bidiLevel)}else if(oe.extend){oe.collapse(E.node,E.offset);try{oe.extend(U.node,U.offset)}catch{}}else{let Fe=document.createRange();x.anchor>x.head&&([E,U]=[U,E]),Fe.setEnd(U.node,U.offset),Fe.setStart(E.node,E.offset),oe.removeAllRanges(),oe.addRange(Fe)}c&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(E,U)),this.impreciseAnchor=E.precise?null:new P(te.anchorNode,te.anchorOffset),this.impreciseHead=U.precise?null:new P(te.focusNode,te.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&qe(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=Ie(e.root),{anchorNode:r,anchorOffset:o}=e.observer.selectionRange;if(!(n&&t.empty&&t.assoc&&n.modify))return;let c=this.lineAt(t.head,t.assoc);if(!c)return;let p=c.posAtStart;if(t.head==p||t.head==p+c.length)return;let x=this.coordsAt(t.head,-1),E=this.coordsAt(t.head,1);if(!x||!E||x.bottom>E.top)return;let U=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(U.node,U.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let te=e.observer.selectionRange;e.docView.posFromDOM(te.anchorNode,te.anchorOffset)!=t.from&&n.collapse(r,o)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return 2&this.tile.dom.compareDocumentPosition(e)?0:this.view.state.doc.length;let r=n.posAtStart;if(!n.isComposite())return n.isText()?e==n.dom?r+t:r+(t?n.length:0):r;{let o;if(e==n.dom)o=n.dom.childNodes[t];else{let c=0==kt(e)?0:0==t?-1:1;for(;;){let p=e.parentNode;if(p==n.dom)break;0==c&&p.firstChild!=p.lastChild&&(c=e==p.firstChild?-1:1),e=p}o=c<0?e:e.nextSibling}if(o==n.dom.firstChild)return r;for(;o&&!ht.get(o);)o=o.nextSibling;if(!o)return r+n.length;for(let c=0,p=r;;c++){let x=n.children[c];if(x.dom==o)return p;p+=x.length+x.breakAfter}}}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,c,r=-1,o=!1,p=-1,x=!1;return this.tile.blockTiles((E,U)=>{if(E.isWidget()){if(32&E.flags&&U>=e)return!0;16&E.flags&&(o=!0)}else{let te=U+E.length;if(U<=e&&(n=E,r=e-U,o=te<e),te>=e&&!c&&(c=E,p=e-U,x=U>e),U>e&&c)return!0}}),n||c?(o&&c?n=null:x&&n&&(c=null),n&&t<0||!c?n.domIn(r,t):c.domIn(p,t)):this.domAtPos(e,t)}coordsAt(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof yn?null:n.coordsInWidget(r,t,!0):n.coordsIn(r,t)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);return t.isLine()?function r(o,c){if(o.isComposite())for(let p of o.children){if(p.length>=c){let x=r(p,c);if(x)return x}if((c-=p.length)<0)break}else if(o.isText()&&c<o.length){let p=(0,j.zK)(o.text,c);if(p==c)return null;let x=K(o.dom,c,p).getClientRects();for(let E=0;E<x.length;E++){let U=x[E];if(E==x.length-1||U.top<U.bottom&&U.left<U.right)return U}}return null}(t,n):null}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,o=this.view.contentDOM.clientWidth,c=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,p=-1,x=this.view.textDirection==f.LTR,E=0,U=(te,oe,Fe)=>{for(let De=0;De<te.children.length&&!(oe>r);De++){let Me=te.children[De],st=oe+Me.length,ft=Me.dom.getBoundingClientRect(),{height:Bt}=ft;if(Fe&&!De&&(E+=ft.top-Fe.top),Me instanceof zi)st>n&&U(Me,oe,ft);else if(oe>=n&&(E>0&&t.push(-E),t.push(Bt+E),E=0,c)){let ni=Me.dom.lastChild,Pi=ni?Je(ni):[];if(Pi.length){let ui=Pi[Pi.length-1],Xt=x?ui.right-ft.left:ft.right-ui.left;Xt>p&&(p=Xt,this.minWidth=o,this.minWidthFrom=oe,this.minWidthTo=st)}}Fe&&De==te.children.length-1&&(E+=Fe.bottom-ft.bottom),oe=st+Me.breakAfter}};return U(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return"rtl"==getComputedStyle(t.dom).direction?f.RTL:f.LTR}measureTextSize(){let e=this.tile.blockTiles(c=>{if(c.isLine()&&c.children.length&&c.length<=20){let x,p=0;for(let E of c.children){if(!E.isText()||/[^ -~]/.test(E.text))return;let U=Je(E.dom);if(1!=U.length)return;p+=U[0].width,x=U[0].height}if(p)return{lineHeight:c.dom.getBoundingClientRect().height,charWidth:p/c.length,textHeight:x}}});if(e)return e;let n,r,o,t=document.createElement("div");return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let c=Je(t.firstChild)[0];n=t.getBoundingClientRect().height,r=c&&c.width?c.width/27:7,o=c&&c.height?c.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:o}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let o=r==t.viewports.length?null:t.viewports[r],c=o?o.from-1:this.view.state.doc.length;if(c>n){let p=(t.lineBlockAt(c).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(It.replace({widget:new yn(p),block:!0,inclusive:!0,isBlockGap:!0}).range(n,c))}if(!o)break;n=o.to+1}return It.set(e)}updateDeco(){let e=1,t=this.view.state.facet(u).map(o=>(this.dynamicDecorationMap[e++]="function"==typeof o)?o(this.view):o),n=!1,r=this.view.state.facet(O).map((o,c)=>{let p="function"==typeof o;return p&&(n=!0),p?o(this.view):o});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(j.om.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(d).map(o=>"function"==typeof o?o(this.view):o)}scrollIntoView(e){var t;if(e.isSnapshot){let U=this.view.viewState.lineBlockAt(e.range.head);return this.view.scrollDOM.scrollTop=U.top-e.yMargin,void(this.view.scrollDOM.scrollLeft=e.xMargin)}for(let U of this.view.state.facet(Si))try{if(U(this.view,e.range,e))return!0}catch(te){Vi(this.view.state,te,"scroll handler")}let o,{range:n}=e,r=this.coordsAt(n.head,null!==(t=n.assoc)&&void 0!==t?t:n.empty?0:n.head>n.anchor?-1:1);if(!r)return;!n.empty&&(o=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,o.left),top:Math.min(r.top,o.top),right:Math.max(r.right,o.right),bottom:Math.max(r.bottom,o.bottom)});let c=ce(this.view),p={left:r.left-c.left,top:r.top-c.top,right:r.right+c.right,bottom:r.bottom+c.bottom},{offsetWidth:x,offsetHeight:E}=this.view.scrollDOM;if(function k(s,e,t,n,r,o,c,p){let x=s.ownerDocument,E=x.defaultView||window;for(let U=s,te=!1;U&&!te;)if(1==U.nodeType){let oe,Fe=U==x.body,De=1,Me=1;if(Fe)oe=Lt(E);else{if(/^(fixed|sticky)$/.test(getComputedStyle(U).position)&&(te=!0),U.scrollHeight<=U.clientHeight&&U.scrollWidth<=U.clientWidth){U=U.assignedSlot||U.parentNode;continue}let Bt=U.getBoundingClientRect();({scaleX:De,scaleY:Me}=_e(U,Bt)),oe={left:Bt.left,right:Bt.left+U.clientWidth*De,top:Bt.top,bottom:Bt.top+U.clientHeight*Me}}let st=0,ft=0;if("nearest"==r)e.top<oe.top+c?(ft=e.top-(oe.top+c),t>0&&e.bottom>oe.bottom+ft&&(ft=e.bottom-oe.bottom+c)):e.bottom>oe.bottom-c&&(ft=e.bottom-oe.bottom+c,t<0&&e.top-ft<oe.top&&(ft=e.top-(oe.top+c)));else{let Bt=e.bottom-e.top,ni=oe.bottom-oe.top;ft=("center"==r&&Bt<=ni?e.top+Bt/2-ni/2:"start"==r||"center"==r&&t<0?e.top-c:e.bottom-ni+c)-oe.top}if("nearest"==n?e.left<oe.left+o?(st=e.left-(oe.left+o),t>0&&e.right>oe.right+st&&(st=e.right-oe.right+o)):e.right>oe.right-o&&(st=e.right-oe.right+o,t<0&&e.left<oe.left+st&&(st=e.left-(oe.left+o))):st=("center"==n?e.left+(e.right-e.left)/2-(oe.right-oe.left)/2:"start"==n==p?e.left-o:e.right-(oe.right-oe.left)+o)-oe.left,st||ft)if(Fe)E.scrollBy(st,ft);else{let Bt=0,ni=0;if(ft){let Pi=U.scrollTop;U.scrollTop+=ft/Me,ni=(U.scrollTop-Pi)*Me}if(st){let Pi=U.scrollLeft;U.scrollLeft+=st/De,Bt=(U.scrollLeft-Pi)*De}e={left:e.left-Bt,top:e.top-ni,right:e.right-Bt,bottom:e.bottom-ni},Bt&&Math.abs(Bt-st)<1&&(n="nearest"),ni&&Math.abs(ni-ft)<1&&(r="nearest")}if(Fe)break;(e.top<oe.top||e.bottom>oe.bottom||e.left<oe.left||e.right>oe.right)&&(e={left:Math.max(e.left,oe.left),right:Math.min(e.right,oe.right),top:Math.max(e.top,oe.top),bottom:Math.min(e.bottom,oe.bottom)}),U=U.assignedSlot||U.parentNode}else{if(11!=U.nodeType)break;U=U.host}}(this.view.scrollDOM,p,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,x),-x),Math.max(Math.min(e.yMargin,E),-E),this.view.textDirection==f.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(r.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||r.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let U=this.view.docView.lineAt(n.head,1);U&&U.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let t=n=>n.isWidget()||n.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Qe(this.tile)}}function Qe(s,e){let t=e?.get(s);if(1!=t){null==t&&s.destroy();for(let n of s.children)Qe(n,e)}}function Ft(s,e){let t=s.observer.selectionRange;if(!t.focusNode)return null;let n=Ee(t.focusNode,t.focusOffset),r=Ue(t.focusNode,t.focusOffset),o=n||r;if(r&&n&&r.node!=n.node){let p=ht.get(r.node);if(!p||p.isText()&&p.text!=r.node.nodeValue)o=r;else if(s.docView.lastCompositionAfterCursor){let x=ht.get(n.node);!x||x.isText()&&x.text!=n.node.nodeValue||(o=r)}}if(s.docView.lastCompositionAfterCursor=o!=n,!o)return null;let c=e-o.offset;return{from:c,to:c+o.node.nodeValue.length,node:o.node}}let Hi=class{constructor(){this.changes=[]}compareRange(e,t){de(e,t,this.changes)}comparePoint(e,t){de(e,t,this.changes)}boundChange(e){de(e,e,this.changes)}};class Ti{constructor(){this.changes=[]}compareRange(e,t){de(e,t,this.changes)}comparePoint(){}boundChange(e){de(e,e,this.changes)}}class yn extends ci{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function Cn(s,e,t){let n=s.lineBlockAt(e);if(Array.isArray(n.type)){let r;for(let o of n.type){if(o.from>e)break;if(!(o.to<e)){if(o.from<e&&o.to>e)return o;(!r||o.type==Kt.Text&&(r.type!=o.type||(t<0?o.from<e:o.to>e)))&&(r=o)}}return r||n}return n}function Gn(s,e,t,n){let r=s.state.doc.lineAt(e.head),o=s.bidiSpans(r),c=s.textDirectionAt(r.from);for(let p=e,x=null;;){let E=pi(r,o,c,p,t),U=fi;if(!E){if(r.number==(t?s.state.doc.lines:1))return p;U="\n",r=s.state.doc.line(r.number+(t?1:-1)),o=s.bidiSpans(r),E=s.visualLineSide(r,!t)}if(x){if(!x(U))return p}else{if(!n)return E;x=n(U)}p=E}}function vn(s,e,t){for(;;){let n=0;for(let r of s)r.between(e-1,e+1,(o,c,p)=>{if(e>o&&e<c){let x=n||t||(e-o<c-e?-1:1);e=x<0?o:c,n=x}});if(!n)return e}}function Yn(s,e){let t=null;for(let n=0;n<e.ranges.length;n++){let r=e.ranges[n],o=null;if(r.empty){let c=vn(s,r.from,0);c!=r.from&&(o=j.OF.cursor(c,-1))}else{let c=vn(s,r.from,-1),p=vn(s,r.to,1);(c!=r.from||p!=r.to)&&(o=j.OF.range(r.from==r.anchor?c:p,r.from==r.head?c:p))}o&&(t||(t=e.ranges.slice()),t[n]=o)}return t?j.OF.create(t,e.mainIndex):e}function Hn(s,e,t){let n=vn(s.state.facet(T).map(r=>r(s)),t.from,e.head>t.from?-1:1);return n==t.from?t:j.OF.cursor(n,n<t.from?1:-1)}class Pn{constructor(e,t){this.pos=e,this.assoc=t}}function Tn(s,e,t,n){let E,r=s.contentDOM.getBoundingClientRect(),o=r.top+s.viewState.paddingTop,{x:c,y:p}=e,x=p-o;for(;;){if(x<0)return new Pn(0,1);if(x>s.viewState.docHeight)return new Pn(s.state.doc.length,-1);if(E=s.elementAtHeight(x),null==n)break;if(E.type==Kt.Text){if(n<0?E.to<s.viewport.from:E.from>s.viewport.to)break;let oe=s.docView.coordsAt(n<0?E.from:E.to,n>0?-1:1);if(oe&&(n<0?oe.top<=x+o:oe.bottom>=x+o))break}let te=s.viewState.heightOracle.textHeight/2;x=n>0?E.bottom+te:E.top-te}if(s.viewport.from>=E.to||s.viewport.to<=E.from){if(t)return null;if(E.type==Kt.Text){let te=function Bn(s,e,t,n,r){let o=Math.round((n-e.left)*s.defaultCharacterWidth);if(s.lineWrapping&&t.height>1.5*s.defaultLineHeight){let p=s.viewState.heightOracle.textHeight;o+=Math.floor((r-t.top-.5*(s.defaultLineHeight-p))/p)*s.viewState.heightOracle.lineLength}let c=s.state.sliceDoc(t.from,t.to);return t.from+(0,j.kn)(c,o,s.state.tabSize)}(s,r,E,c,p);return new Pn(te,te==E.from?1:-1)}}if(E.type!=Kt.Text)return x<(E.top+E.bottom)/2?new Pn(E.from,1):new Pn(E.to,-1);let U=s.docView.lineAt(E.from,2);return(!U||U.length!=E.length)&&(U=s.docView.lineAt(E.from,-2)),new Vn(s,c,p,s.textDirectionAt(E.from)).scanTile(U,E.from)}class Vn{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[bt.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[bt.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t,n=!1){let x,E,oe,r=0,o=e.length-1,c=new Set,p=this.bidiIn(e[0],e[o]),U=-1,te=1e9;e:for(;r<o;){let De=o-r,Me=r+o>>1;t:if(c.has(Me)){let ft=r+Math.floor(Math.random()*De);for(let Bt=0;Bt<De;Bt++){if(!c.has(ft)){Me=ft;break t}ft++,ft==o&&(ft=r)}break e}c.add(Me);let st=t(Me);if(st)for(let ft=0;ft<st.length;ft++){let Bt=st[ft],ni=0;if(!(0==Bt.width&&st.length>1)){if(Bt.bottom<this.y)(!x||x.bottom<Bt.bottom)&&(x=Bt),ni=1;else if(Bt.top>this.y)(!E||E.top>Bt.top)&&(E=Bt),ni=-1;else{let Pi=Bt.left>this.x?this.x-Bt.left:Bt.right<this.x?this.x-Bt.right:0,ui=Math.abs(Pi);ui<te&&(U=Me,te=ui,oe=Bt),Pi&&(ni=Pi<0==(this.baseDir==f.LTR)?-1:1)}-1!=ni||p&&!this.baseDirAt(e[Me],1)?1==ni&&(!p||this.baseDirAt(e[Me+1],-1))&&(r=Me+1):o=Me}}}if(!oe){if(!E&&!x)return{i:e[0],after:!1};let De=x&&(!E||this.y-x.bottom<E.top-this.y)?x:E;return this.y=(De.top+De.bottom)/2,this.scan(e,t,!0)}if(te&&!n){let{top:De,bottom:Me}=oe;if(x&&x.bottom>(De+De+Me)/3)return this.y=x.bottom-1,this.scan(e,t,!0);if(E&&E.top<(De+Me+Me)/3)return this.y=E.top+1,this.scan(e,t,!0)}let Fe=(p?this.dirAt(e[U],1):this.baseDir)==f.LTR;return{i:U,after:this.x>(oe.left+oe.right)/2==Fe}}scanText(e,t){let n=[];for(let o=0;o<e.length;o=(0,j.zK)(e.text,o))n.push(t+o);n.push(t+e.length);let r=this.scan(n,o=>K(e.dom,n[o]-t,n[o+1]-t).getClientRects());return r.after?new Pn(n[r.i+1],-1):new Pn(n[r.i],1)}scanTile(e,t){if(!e.length)return new Pn(t,1);if(1==e.children.length){let p=e.children[0];if(p.isText())return this.scanText(p,t);if(p.isComposite())return this.scanTile(p,t)}let n=[t];for(let p=0,x=t;p<e.children.length;p++)n.push(x+=e.children[p].length);let r=this.scan(n,p=>{let x=e.children[p];return 48&x.flags?null:(1==x.dom.nodeType?x.dom:K(x.dom,0,x.length)).getClientRects()}),o=e.children[r.i],c=n[r.i];return o.isText()?this.scanText(o,c):o.isComposite()?this.scanTile(o,c):r.after?new Pn(n[r.i+1],-1):new Pn(c,1)}}class sr{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(j.$t.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+="\uffff"}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let o=this.text.length;this.readNode(r);let c=ht.get(r),p=r.nextSibling;if(p==t){c?.breakAfter&&!p&&n!=this.view.contentDOM&&this.lineBreak();break}let x=ht.get(p);(c&&x?c.breakAfter:(c?c.breakAfter:at(r))||at(p)&&("BR"!=r.nodeName||c?.isWidget())&&this.text.length>o)&&!qn(p,t)&&this.lineBreak(),r=p}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let p,o=-1,c=1;if(this.lineSeparator?(o=t.indexOf(this.lineSeparator,n),c=this.lineSeparator.length):(p=r.exec(t))&&(o=p.index,c=p[0].length),this.append(t.slice(n,o<0?t.length:o)),o<0)break;if(this.lineBreak(),c>1)for(let x of this.points)x.node==e&&x.pos>this.text.length&&(x.pos-=c-1);n=o+c}}readNode(e){let t=ht.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let r=n.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(or(e,n.node,n.offset)?t:0))}}function or(s,e,t){for(;;){if(!e||t<kt(e))return!1;if(e==s)return!0;t=Pt(e)+1,e=e.parentNode}}function qn(s,e){let t;for(;s!=e&&s;s=s.nextSibling){let n=ht.get(s);if(!n?.isWidget())return!1;n&&(t||(t=[])).push(n)}if(t)for(let n of t){let r=n.overrideDOMText;if(r?.length)return!1}return!0}class En{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class er{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:o,impreciseAnchor:c}=e.docView,p=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=D(e.docView.tile,t,n,0))){let x=o||c?[]:function C(s){let e=[];if(s.root.activeElement!=s.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:o}=s.observer.selectionRange;return t&&(e.push(new En(t,n)),(r!=t||o!=n)&&e.push(new En(r,o))),e}(e),E=new sr(x,e);E.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=E.text,this.newSel=function v(s,e){if(0==s.length)return null;let t=s[0].pos,n=2==s.length?s[1].pos:t;return t>-1&&n>-1?j.OF.single(t+e,n+e):null}(x,this.bounds.from)}else{let x=e.observer.selectionRange,E=o&&o.node==x.focusNode&&o.offset==x.focusOffset||!Ae(e.contentDOM,x.focusNode)?p.main.head:e.docView.posFromDOM(x.focusNode,x.focusOffset),U=c&&c.node==x.anchorNode&&c.offset==x.anchorOffset||!Ae(e.contentDOM,x.anchorNode)?p.main.anchor:e.docView.posFromDOM(x.anchorNode,x.anchorOffset),te=e.viewport;if((He.ios||He.chrome)&&p.main.empty&&E!=U&&(te.from>0||te.to<e.state.doc.length)){let oe=Math.min(E,U),Fe=Math.max(E,U),De=te.from-oe,Me=te.to-Fe;(0==De||1==De||0==oe)&&(0==Me||-1==Me||Fe==e.state.doc.length)&&(E=0,U=e.state.doc.length)}if(e.inputState.composing>-1&&p.ranges.length>1)this.newSel=p.replaceRange(j.OF.range(U,E));else if(e.lineWrapping&&U==E&&(!p.main.empty||p.main.head!=E)&&e.inputState.lastTouchTime>Date.now()-100){let oe=e.coordsAtPos(E,-1),Fe=0;oe&&(Fe=e.inputState.lastTouchY<=oe.bottom?-1:1),this.newSel=j.OF.create([j.OF.cursor(E,Fe)])}else this.newSel=j.OF.single(U,E)}}}function D(s,e,t,n){if(s.isComposite()){let r=-1,o=-1,c=-1,p=-1;for(let x=0,E=n,U=n;x<s.children.length;x++){let te=s.children[x],oe=E+te.length;if(E<e&&oe>t)return D(te,e,t,E);if(oe>=e&&-1==r&&(r=x,o=E),E>t&&te.dom.parentNode==s.dom){c=x,p=U;break}U=oe,E=oe+te.breakAfter}return{from:o,to:p<0?n+s.length:p,startDOM:(r?s.children[r-1].dom.nextSibling:null)||s.dom.firstChild,endDOM:c<s.children.length&&c>=0?s.children[c].dom:null}}return s.isText()?{from:n,to:n+s.length,startDOM:s.dom,endDOM:s.dom.nextSibling}:null}function i(s,e){let t,{newSel:n}=e,{state:r}=s,o=r.selection.main,c=s.inputState.lastKeyTime>Date.now()-100?s.inputState.lastKeyCode:-1;if(e.bounds){let{from:p,to:x}=e.bounds,E=o.from,U=null;(8===c||He.android&&e.text.length<x-p)&&(E=o.to,U="end");let oe,Fe,te=r.doc.sliceString(p,x,"\uffff");!o.empty&&o.from>=p&&o.to<=x&&(e.typeOver||te!=e.text)&&te.slice(0,o.from-p)==e.text.slice(0,o.from-p)&&te.slice(o.to-p)==e.text.slice(oe=e.text.length-(te.length-(o.to-p)))?t={from:o.from,to:o.to,insert:j.EY.of(e.text.slice(o.from-p,oe).split("\uffff"))}:(Fe=b(te,e.text,E-p,U))&&(He.chrome&&13==c&&Fe.toB==Fe.from+2&&"\uffff\uffff"==e.text.slice(Fe.from,Fe.toB)&&Fe.toB--,t={from:p+Fe.from,to:p+Fe.toA,insert:j.EY.of(e.text.slice(Fe.from,Fe.toB).split("\uffff"))})}else n&&(!s.hasFocus&&r.facet(ei)||W(n,o))&&(n=null);if(!t&&!n)return!1;if((He.mac||He.android)&&t&&t.from==t.to&&t.from==o.head-1&&/^\. ?$/.test(t.insert.toString())&&"off"==s.contentDOM.getAttribute("autocorrect")?(n&&2==t.insert.length&&(n=j.OF.single(n.main.anchor-1,n.main.head-1)),t={from:t.from,to:t.to,insert:j.EY.of([t.insert.toString().replace("."," ")])}):r.doc.lineAt(o.from).to<o.to&&s.docView.lineHasWidget(o.to)&&s.inputState.insertingTextAt>Date.now()-50?t={from:o.from,to:o.to,insert:r.toText(s.inputState.insertingText)}:He.chrome&&t&&t.from==t.to&&t.from==o.head&&"\n "==t.insert.toString()&&s.lineWrapping&&(n&&(n=j.OF.single(n.main.anchor-1,n.main.head-1)),t={from:o.from,to:o.to,insert:j.EY.of([" "])}),t)return l(s,t,n,c);if(n&&!W(n,o)){let p=!1,x="select";return s.inputState.lastSelectionTime>Date.now()-50&&("select"==s.inputState.lastSelectionOrigin&&(p=!0),x=s.inputState.lastSelectionOrigin,"select.pointer"==x&&(n=Yn(r.facet(T).map(E=>E(s)),n))),s.dispatch({selection:n,scrollIntoView:p,userEvent:x}),!0}return!1}function l(s,e,t,n=-1){if(He.ios&&s.inputState.flushIOSKey(e))return!0;let r=s.state.selection.main;if(He.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&" "==s.state.sliceDoc(e.from,r.from))&&1==e.insert.length&&2==e.insert.lines&&J(s.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&0==e.insert.length||8==n&&e.insert.length<e.to-e.from&&e.to>r.head)&&J(s.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&0==e.insert.length&&J(s.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();s.inputState.composing>=0&&s.inputState.composing++;let c,p=()=>c||(c=function a(s,e,t){let n,r=s.state,o=r.selection.main,c=-1;if(e.from==e.to&&e.from<o.from||e.from>o.to){let x=e.from<o.from?-1:1,E=x<0?o.from:o.to,U=vn(r.facet(T).map(te=>te(s)),E,x);e.from==U&&(c=U)}if(c>-1)n={changes:e,selection:j.OF.cursor(e.from+e.insert.length,-1)};else if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&s.inputState.composing<0){let x=o.from<e.from?r.sliceDoc(o.from,e.from):"",E=o.to>e.to?r.sliceDoc(e.to,o.to):"";n=r.replaceSelection(s.state.toText(x+e.insert.sliceString(0,void 0,s.state.lineBreak)+E))}else{let x=r.changes(e),E=t&&t.main.to<=x.newLength?t.main:void 0;if(r.selection.ranges.length>1&&(s.inputState.composing>=0||s.inputState.compositionPendingChange)&&e.to<=o.to+10&&e.to>=o.to-10){let te,U=s.state.sliceDoc(e.from,e.to),oe=t&&Ft(s,t.main.head);te=oe?{from:oe.from,to:oe.to-(e.insert.length-(e.to-e.from))}:s.state.doc.lineAt(o.head);let Fe=o.to-e.to;n=r.changeByRange(De=>{if(De.from==o.from&&De.to==o.to)return{changes:x,range:E||De.map(x)};let Me=De.to-Fe,st=Me-U.length;if(s.state.sliceDoc(st,Me)!=U||Me>=te.from&&st<=te.to)return{range:De};let ft=r.changes({from:st,to:Me,insert:e.insert}),Bt=De.to-o.to;return{changes:ft,range:E?j.OF.range(Math.max(0,E.anchor+Bt),Math.max(0,E.head+Bt)):De.map(ft)}})}else n={changes:x,selection:E&&r.selection.replaceRange(E)}}let p="input.type";return(s.composing||s.inputState.compositionPendingChange&&s.inputState.compositionEndedAt>Date.now()-50)&&(s.inputState.compositionPendingChange=!1,p+=".compose",s.inputState.compositionFirstChange&&(p+=".start",s.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:p,scrollIntoView:!0})}(s,e,t));return s.state.facet(mi).some(x=>x(s,e.from,e.to,o,p))||s.dispatch(p()),!0}function b(s,e,t,n){let r=Math.min(s.length,e.length),o=0;for(;o<r&&s.charCodeAt(o)==e.charCodeAt(o);)o++;if(o==r&&s.length==e.length)return null;let c=s.length,p=e.length;for(;c>0&&p>0&&s.charCodeAt(c-1)==e.charCodeAt(p-1);)c--,p--;return"end"==n&&(t-=c+Math.max(0,o-Math.min(c,p))-o),c<o&&s.length<e.length?(o-=t<=o&&t>=c?o-t:0,p=o+(p-c),c=o):p<o&&(o-=t<=o&&t>=p?o-t:0,c=o+(c-p),p=o),{from:o,toA:c,toB:p}}function W(s,e){return e.head==s.main.head&&e.anchor==s.main.anchor}class ee{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,He.safari&&e.contentDOM.addEventListener("input",()=>null),He.gecko&&function ii(s){Sn.has(s)||(Sn.add(s),s.addEventListener("copy",()=>{}),s.addEventListener("cut",()=>{}))}(e.contentDOM.ownerDocument)}handleEvent(e){!function Mr(s,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n,t=e.target;t!=s.contentDOM;t=t.parentNode)if(!t||11==t.nodeType||(n=ht.get(t))&&n.isWidget()&&!n.isHidden&&n.widget.ignoreEvent(e))return!1;return!0}(this.view,e)||this.ignoreDuringComposition(e)||"keydown"==e.type&&this.keydown(e)||(0!=this.view.updateState?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let r of n.observers)r(this.view,t);for(let r of n.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=function et(s){let e=Object.create(null);function t(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of s){let r=n.spec,o=r&&r.plugin.domEventHandlers,c=r&&r.plugin.domEventObservers;if(o)for(let p in o){let x=o[p];x&&t(p).handlers.push(ve(n.value,x))}if(c)for(let p in c){let x=c[p];x&&t(p).observers.push(ve(n.value,x))}}for(let n in w)t(n).handlers.push(w[n]);for(let n in h)t(n).observers.push(h[n]);return e}(e),n=this.handlers,r=this.view.contentDOM;for(let o in t)if("scroll"!=o){let c=!t[o].handlers.length,p=n[o];p&&c!=!p.handlers.length&&(r.removeEventListener(o,this.handleEvent),p=null),p||r.addEventListener(o,this.handleEvent,{passive:c})}for(let o in n)"scroll"!=o&&!t[o]&&r.removeEventListener(o,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=e.keyCode&&_t.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),He.android&&He.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return!He.ios||e.synthetic||e.altKey||e.metaKey||e.shiftKey||!((t=Re.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||tt.indexOf(e.key)>-1&&e.ctrlKey)?(229!=e.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0)}flushIOSKey(e){let t=this.pendingIOSKey;return!(!t||"Enter"==t.key&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString()))&&(this.pendingIOSKey=void 0,J(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!(!/^key/.test(e.type)||e.synthetic)&&(this.composing>0||!!(He.safari&&!He.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function ve(s,e){return(t,n)=>{try{return e.call(s,n,t)}catch(r){Vi(t.state,r)}}}const Re=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],tt="dthko",_t=[16,17,18,20,91,92,224,225];function Dt(s){return.7*Math.max(0,s)+8}class qi{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=M(e.contentDOM),this.atoms=e.state.facet(T).map(c=>c(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(j.$t.allowMultipleSelections)&&function an(s,e){let t=s.state.facet(gi);return t.length?t[0](e):He.mac?e.metaKey:e.ctrlKey}(e,t),this.dragging=!(!function tr(s,e){let{main:t}=s.state.selection;if(t.empty)return!1;let n=Ie(s.root);if(!n||0==n.rangeCount)return!0;let r=n.getRangeAt(0).getClientRects();for(let o=0;o<r.length;o++){let c=r[o];if(c.left<=e.clientX&&c.right>=e.clientX&&c.top<=e.clientY&&c.bottom>=e.clientY)return!0}return!1}(e,t)||1!=xt(t))&&null}start(e){!1===this.dragging&&this.select(e)}move(e){if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&function Oi(s,e){return Math.max(Math.abs(s.clientX-e.clientX),Math.abs(s.clientY-e.clientY))}(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,o=0,c=this.view.win.innerWidth,p=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:c}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:p}=this.scrollParents.y.getBoundingClientRect());let x=ce(this.view);e.clientX-x.left<=r+6?t=-Dt(r-e.clientX):e.clientX+x.right>=c-6&&(t=Dt(e.clientX-c)),e.clientY-x.top<=o+6?n=-Dt(o-e.clientY):e.clientY+x.bottom>=p-6&&(n=Dt(e.clientY-p)),this.setScrollSpeed(t,n)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),!1===this.dragging&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=Yn(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,!1===this.dragging))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}const w=Object.create(null),h=Object.create(null),y=He.ie&&He.ie_version<15||He.ios&&He.webkit_version<604;function F(s,e,t){for(let n of s.facet(e))t=n(t,s);return t}function Z(s,e){e=F(s.state,tn,e);let n,{state:t}=s,r=1,o=t.toText(e),c=o.lines==t.selection.ranges.length;if(null!=Dn&&t.selection.ranges.every(x=>x.empty)&&Dn==o.toString()){let x=-1;n=t.changeByRange(E=>{let U=t.doc.lineAt(E.from);if(U.from==x)return{range:E};x=U.from;let te=t.toText((c?o.line(r++).text:e)+t.lineBreak);return{changes:{from:U.from,insert:te},range:j.OF.cursor(E.from+te.length)}})}else n=c?t.changeByRange(x=>{let E=o.line(r++);return{changes:{from:x.from,to:x.to,insert:E.text},range:j.OF.cursor(x.from+E.length)}}):t.replaceSelection(o);s.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}function he(s,e,t,n){if(1==n)return j.OF.cursor(e,t);if(2==n)return function ln(s,e,t=1){let n=s.charCategorizer(e),r=s.doc.lineAt(e),o=e-r.from;if(0==r.length)return j.OF.cursor(e);0==o?t=1:o==r.length&&(t=-1);let c=o,p=o;t<0?c=(0,j.zK)(r.text,o,!1):p=(0,j.zK)(r.text,o);let x=n(r.text.slice(c,p));for(;c>0;){let E=(0,j.zK)(r.text,c,!1);if(n(r.text.slice(E,c))!=x)break;c=E}for(;p<r.length;){let E=(0,j.zK)(r.text,p);if(n(r.text.slice(p,E))!=x)break;p=E}return j.OF.range(c+r.from,p+r.from)}(s.state,e,t);{let r=s.docView.lineAt(e,t),o=s.state.doc.lineAt(r?r.posAtEnd:e),p=r?r.posAtEnd:o.to;return p<s.state.doc.length&&p==o.to&&p++,j.OF.range(r?r.posAtStart:o.from,p)}}h.scroll=s=>{s.inputState.lastScrollTop=s.scrollDOM.scrollTop,s.inputState.lastScrollLeft=s.scrollDOM.scrollLeft},h.wheel=h.mousewheel=s=>{s.inputState.lastWheelEvent=Date.now()},w.keydown=(s,e)=>(s.inputState.setSelectionOrigin("select"),27==e.keyCode&&0!=s.inputState.tabFocusMode&&(s.inputState.tabFocusMode=Date.now()+2e3),!1),h.touchstart=(s,e)=>{let t=s.inputState,n=e.targetTouches[0];t.lastTouchTime=Date.now(),n&&(t.lastTouchX=n.clientX,t.lastTouchY=n.clientY),t.setSelectionOrigin("select.pointer")},h.touchmove=s=>{s.inputState.setSelectionOrigin("select.pointer")},w.mousedown=(s,e)=>{if(s.observer.flush(),s.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let n of s.state.facet(Di))if(t=n(s,e),t)break;if(!t&&0==e.button&&(t=function Zt(s,e){let t=s.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),n=xt(e),r=s.state.selection;return{update(o){o.docChanged&&(t.pos=o.changes.mapPos(t.pos),r=r.map(o.changes))},get(o,c,p){let E,x=s.posAndSideAtCoords({x:o.clientX,y:o.clientY},!1),U=he(s,x.pos,x.assoc,n);if(t.pos!=x.pos&&!c){let te=he(s,t.pos,t.assoc,n),oe=Math.min(te.from,U.from),Fe=Math.max(te.to,U.to);U=oe<U.from?j.OF.range(oe,Fe,U.assoc):j.OF.range(Fe,oe,U.assoc)}return c?r.replaceRange(r.main.extend(U.from,U.to,U.assoc)):p&&1==n&&r.ranges.length>1&&(E=function ti(s,e){for(let t=0;t<s.ranges.length;t++){let{from:n,to:r}=s.ranges[t];if(n<=e&&r>=e)return j.OF.create(s.ranges.slice(0,t).concat(s.ranges.slice(t+1)),s.mainIndex==t?0:s.mainIndex-(s.mainIndex>t?1:0))}return null}(r,x.pos))?E:p?r.addRange(U):j.OF.create([U])}}}(s,e)),t){let n=!s.hasFocus;s.inputState.startMouseSelection(new qi(s,e,t,n)),n&&s.observer.ignore(()=>{I(s.contentDOM);let o=s.root.activeElement;o&&!o.contains(s.contentDOM)&&o.blur()});let r=s.inputState.mouseSelection;if(r)return r.start(e),!1===r.dragging}else s.inputState.setSelectionOrigin("select.pointer");return!1};const ye=He.ie&&He.ie_version<=11;let be=null,ut=0,nt=0;function xt(s){if(!ye)return s.detail;let e=be,t=nt;return be=s,nt=Date.now(),ut=!e||t>Date.now()-400&&Math.abs(e.clientX-s.clientX)<2&&Math.abs(e.clientY-s.clientY)<2?(ut+1)%3:1}function Wi(s,e,t,n){if(!(t=F(s.state,tn,t)))return;let r=s.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=s.inputState,c=n&&o&&function Zn(s,e){let t=s.state.facet(xi);return t.length?t[0](e):He.mac?!e.altKey:!e.ctrlKey}(s,e)?{from:o.from,to:o.to}:null,p={from:r,insert:t},x=s.state.changes(c?[c,p]:p);s.focus(),s.dispatch({changes:x,selection:{anchor:x.mapPos(r,-1),head:x.mapPos(r,1)},userEvent:c?"move.drop":"input.drop"}),s.inputState.draggedContent=null}w.dragstart=(s,e)=>{let{selection:{main:t}}=s.state;if(e.target.draggable){let r=s.docView.tile.nearest(e.target);if(r&&r.isWidget()){let o=r.posAtStart,c=o+r.length;(o>=t.to||c<=t.from)&&(t=j.OF.range(o,c))}}let{inputState:n}=s;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",F(s.state,si,s.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1},w.dragend=s=>(s.inputState.draggedContent=null,!1),w.drop=(s,e)=>{if(!e.dataTransfer)return!1;if(s.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let n=Array(t.length),r=0,o=()=>{++r==t.length&&Wi(s,e,n.filter(c=>null!=c).join(s.state.lineBreak),!1)};for(let c=0;c<t.length;c++){let p=new FileReader;p.onerror=o,p.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(p.result)||(n[c]=p.result),o()},p.readAsText(t[c])}return!0}{let n=e.dataTransfer.getData("Text");if(n)return Wi(s,e,n,!0),!0}return!1},w.paste=(s,e)=>{if(s.state.readOnly)return!0;s.observer.flush();let t=y?null:e.clipboardData;return t?(Z(s,t.getData("text/plain")||t.getData("text/uri-list")),!0):(function _(s){let e=s.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{s.focus(),t.remove(),Z(s,t.value)},50)}(s),!1)};let Dn=null;w.copy=w.cut=(s,e)=>{if(!it(s.contentDOM,s.observer.selectionRange))return!1;let{text:t,ranges:n,linewise:r}=function Qn(s){let e=[],t=[],n=!1;for(let r of s.selection.ranges)r.empty||(e.push(s.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:o}of s.selection.ranges){let c=s.doc.lineAt(o);c.number>r&&(e.push(c.text),t.push({from:c.from,to:Math.min(s.doc.length,c.to+1)})),r=c.number}n=!0}return{text:F(s,si,e.join(s.lineBreak)),ranges:t,linewise:n}}(s.state);if(!t&&!r)return!1;Dn=r?t:null,"cut"==e.type&&!s.state.readOnly&&s.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let o=y?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",t),!0):(function Qi(s,e){let t=s.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),s.focus()},50)}(s,t),!1)};const Ui=j.YH.define();function Kn(s,e){let t=[];for(let n of s.facet(en)){let r=n(s,e);r&&t.push(r)}return t.length?s.update({effects:t,annotations:Ui.of(!0)}):null}function Rn(s){setTimeout(()=>{let e=s.hasFocus;if(e!=s.inputState.notifiedFocused){let t=Kn(s.state,e);t?s.dispatch(t):s.update([])}},10)}h.focus=s=>{s.inputState.lastFocusTime=Date.now(),!s.scrollDOM.scrollTop&&(s.inputState.lastScrollTop||s.inputState.lastScrollLeft)&&(s.scrollDOM.scrollTop=s.inputState.lastScrollTop,s.scrollDOM.scrollLeft=s.inputState.lastScrollLeft),Rn(s)},h.blur=s=>{s.observer.clearSelectionRange(),Rn(s)},h.compositionstart=h.compositionupdate=s=>{s.observer.editContext||(null==s.inputState.compositionFirstChange&&(s.inputState.compositionFirstChange=!0),s.inputState.composing<0&&(s.inputState.composing=0))},h.compositionend=s=>{s.observer.editContext||(s.inputState.composing=-1,s.inputState.compositionEndedAt=Date.now(),s.inputState.compositionPendingKey=!0,s.inputState.compositionPendingChange=s.observer.pendingRecords().length>0,s.inputState.compositionFirstChange=null,He.chrome&&He.android?s.observer.flushSoon():s.inputState.compositionPendingChange?Promise.resolve().then(()=>s.observer.flush()):setTimeout(()=>{s.inputState.composing<0&&s.docView.hasComposition&&s.update([])},50))},h.contextmenu=s=>{s.inputState.lastContextMenu=Date.now()},w.beforeinput=(s,e)=>{var t,n;if(("insertText"==e.inputType||"insertCompositionText"==e.inputType)&&(s.inputState.insertingText=e.data,s.inputState.insertingTextAt=Date.now()),"insertReplacementText"==e.inputType&&s.observer.editContext){let o=null===(t=e.dataTransfer)||void 0===t?void 0:t.getData("text/plain"),c=e.getTargetRanges();if(o&&c.length){let p=c[0],x=s.posAtDOM(p.startContainer,p.startOffset),E=s.posAtDOM(p.endContainer,p.endOffset);return l(s,{from:x,to:E,insert:s.state.toText(o)},null),!0}}let r;if(He.chrome&&He.android&&(r=Re.find(o=>o.inputType==e.inputType))&&(s.observer.delayAndroidKey(r.key,r.keyCode),"Backspace"==r.key||"Delete"==r.key)){let o=(null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0;setTimeout(()=>{var c;((null===(c=window.visualViewport)||void 0===c?void 0:c.height)||0)>o+10&&s.hasFocus&&(s.contentDOM.blur(),s.focus())},100)}return He.ios&&"deleteContentForward"==e.inputType&&s.observer.flushSoon(),He.safari&&"insertText"==e.inputType&&s.inputState.composing>=0&&setTimeout(()=>h.compositionend(s,e),20),!1};const Sn=new Set,Ge=["pre-wrap","normal","pre-line","break-spaces"];let Be=!1;function Ze(){Be=!1}class pt{constructor(e){this.lineWrapping=e,this.doc=j.EY.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Ge.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(10*r)]||(t=!0,this.heightSamples[Math.floor(10*r)]=!0)}return t}refresh(e,t,n,r,o,c){let p=Ge.indexOf(e)>-1,x=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=p;if(this.lineWrapping=p,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=o,x){this.heightSamples={};for(let E=0;E<c.length;E++){let U=c[E];U<0?E++:this.heightSamples[Math.floor(10*U)]=!0}}return x}}class Vt{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class Ht{constructor(e,t,n,r,o){this.from=e,this.length=t,this.top=n,this.height=r,this._content=o}get type(){return"number"==typeof this._content?Kt.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof wt?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Ht(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var B=function(s){return s[s.ByPos=0]="ByPos",s[s.ByHeight=1]="ByHeight",s[s.ByPosNoHeight=2]="ByPosNoHeight",s}(B||(B={}));const dn=.001;class z{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(2&this.flags)>0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>dn&&(Be=!0),this.height=e)}replace(e,t,n){return z.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let o=this,c=n.doc;for(let p=r.length-1;p>=0;p--){let{fromA:x,toA:E,fromB:U,toB:te}=r[p],oe=o.lineAt(x,B.ByPosNoHeight,n.setDoc(t),0,0),Fe=oe.to>=E?oe:o.lineAt(E,B.ByPosNoHeight,n,0,0);for(te+=Fe.to-E,E=Fe.to;p>0&&oe.from<=r[p-1].toA;)x=r[p-1].fromA,U=r[p-1].fromB,p--,x<oe.from&&(oe=o.lineAt(x,B.ByPosNoHeight,n,0,0));U+=oe.from-x,x=oe.from;let De=lr.build(n.setDoc(c),e,U,te);o=Mn(o,o.replace(x,E,De))}return o.updateHeight(n,0)}static empty(){return new _n(0,0,0)}static of(e){if(1==e.length)return e[0];let t=0,n=e.length,r=0,o=0;for(;;)if(t==n)if(r>2*o){let p=e[t-1];p.break?e.splice(--t,1,p.left,null,p.right):e.splice(--t,1,p.left,p.right),n+=1+p.break,r-=p.size}else{if(!(o>2*r))break;{let p=e[n];p.break?e.splice(n,1,p.left,null,p.right):e.splice(n,1,p.left,p.right),n+=2+p.break,o-=p.size}}else if(r<o){let p=e[t++];p&&(r+=p.size)}else{let p=e[--n];p&&(o+=p.size)}let c=0;return null==e[t-1]?(c=1,t--):null==e[t]&&(c=1,n++),new _r(z.of(e.slice(0,t)),c,z.of(e.slice(n)))}}function Mn(s,e){return s==e?s:(s.constructor!=e.constructor&&(Be=!0),e)}z.prototype.size=1;const Or=It.replace({});class yr extends z{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new Ht(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new Ht(r,0,n,this.spaceAbove,Or):this.mainBlock(n,r)}lineAt(e,t,n,r,o){let c=this.mainBlock(r,o);return this.spaceAbove?this.blockAt(0,n,r,o).join(c):c}forEachLine(e,t,n,r,o,c){e<=o+this.length&&t>=o&&c(this.lineAt(0,B.ByPos,n,r,o))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class _n extends yr{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new Ht(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,n){let r=n[0];return 1==n.length&&(r instanceof _n||r instanceof hn&&4&r.flags)&&Math.abs(this.length-r.length)<10?(r instanceof hn?r=new _n(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):z.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class hn extends z{constructor(e){super(e,0)}heightMetrics(e,t){let c,n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,o=r-n+1,p=0;if(e.lineWrapping){let x=Math.min(this.height,e.lineHeight*o);c=x/o,this.length>o+1&&(p=(this.height-x)/(this.length-o-1))}else c=this.height/o;return{firstLine:n,lastLine:r,perLine:c,perChar:p}}blockAt(e,t,n,r){let{firstLine:o,lastLine:c,perLine:p,perChar:x}=this.heightMetrics(t,r);if(t.lineWrapping){let E=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),U=t.doc.lineAt(E),te=p+U.length*x,oe=Math.max(n,e-te/2);return new Ht(U.from,U.length,oe,te,0)}{let E=Math.max(0,Math.min(c-o,Math.floor((e-n)/p))),{from:U,length:te}=t.doc.line(o+E);return new Ht(U,te,n+p*E,p,0)}}lineAt(e,t,n,r,o){if(t==B.ByHeight)return this.blockAt(e,n,r,o);if(t==B.ByPosNoHeight){let{from:Fe,to:De}=n.doc.lineAt(e);return new Ht(Fe,De-Fe,0,0,0)}let{firstLine:c,perLine:p,perChar:x}=this.heightMetrics(n,o),E=n.doc.lineAt(e),U=p+E.length*x,te=E.number-c;return new Ht(E.from,E.length,Math.max(r,Math.min(r+p*te+x*(E.from-o-te),r+this.height-U)),U,0)}forEachLine(e,t,n,r,o,c){e=Math.max(e,o),t=Math.min(t,o+this.length);let{firstLine:p,perLine:x,perChar:E}=this.heightMetrics(n,o);for(let U=e,te=r;U<=t;){let oe=n.doc.lineAt(U);if(U==e){let De=oe.number-p;te+=x*De+E*(e-o-De)}let Fe=x+E*oe.length;c(new Ht(oe.from,oe.length,te,Fe,0)),te+=Fe,U=oe.to+1}}replace(e,t,n){let r=this.length-t;if(r>0){let o=n[n.length-1];o instanceof hn?n[n.length-1]=new hn(o.length+r):n.push(null,new hn(r-1))}if(e>0){let o=n[0];o instanceof hn?n[0]=new hn(e+o.length):n.unshift(new hn(e-1),null)}return z.of(n)}decomposeLeft(e,t){t.push(new hn(e-1),null)}decomposeRight(e,t){t.push(null,new hn(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let o=t+this.length;if(r&&r.from<=t+this.length&&r.more){let c=[],p=Math.max(t,r.from),x=-1;for(r.from>t&&c.push(new hn(r.from-t-1).updateHeight(e,t));p<=o&&r.more;){let U=e.doc.lineAt(p).length;c.length&&c.push(null);let te=r.heights[r.index++],oe=0;te<0&&(oe=-te,te=r.heights[r.index++]),-1==x?x=te:Math.abs(te-x)>=dn&&(x=-2);let Fe=new _n(U,te,oe);Fe.outdated=!1,c.push(Fe),p+=U+1}p<=o&&c.push(null,new hn(o-p).updateHeight(e,p));let E=z.of(c);return(x<0||Math.abs(E.height-this.height)>=dn||Math.abs(x-this.heightMetrics(e,t).perLine)>=dn)&&(Be=!0),Mn(this,E)}return(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class _r extends z{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,r){let o=n+this.left.height;return e<o?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,o,r+this.left.length+this.break)}lineAt(e,t,n,r,o){let c=r+this.left.height,p=o+this.left.length+this.break,x=t==B.ByHeight?e<c:e<p,E=x?this.left.lineAt(e,t,n,r,o):this.right.lineAt(e,t,n,c,p);if(this.break||(x?E.to<p:E.from>p))return E;let U=t==B.ByPosNoHeight?B.ByPosNoHeight:B.ByPos;return x?E.join(this.right.lineAt(p,U,n,c,p)):this.left.lineAt(p,U,n,r,o).join(E)}forEachLine(e,t,n,r,o,c){let p=r+this.left.height,x=o+this.left.length+this.break;if(this.break)e<x&&this.left.forEachLine(e,t,n,r,o,c),t>=x&&this.right.forEachLine(e,t,n,p,x,c);else{let E=this.lineAt(x,B.ByPos,n,r,o);e<E.from&&this.left.forEachLine(e,E.from-1,n,r,o,c),E.to>=e&&E.from<=t&&c(E),t>E.to&&this.right.forEachLine(E.to+1,t,n,p,x,c)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let o=[];e>0&&this.decomposeLeft(e,o);let c=o.length;for(let p of n)o.push(p);if(e>0&&Zi(o,c-1),t<this.length){let p=o.length;this.decomposeRight(t,o),Zi(o,p)}return z.of(o)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?z.of(this.break?[e,null,t]:[e,t]):(this.left=Mn(this.left,e),this.right=Mn(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:o,right:c}=this,p=t+o.length+this.break,x=null;return r&&r.from<=t+o.length&&r.more?x=o=o.updateHeight(e,t,n,r):o.updateHeight(e,t,n),r&&r.from<=p+c.length&&r.more?x=c=c.updateHeight(e,p,n,r):c.updateHeight(e,p,n),x?this.balanced(o,c):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Zi(s,e){let t,n;null==s[e]&&(t=s[e-1])instanceof hn&&(n=s[e+1])instanceof hn&&s.splice(e-1,3,new hn(t.length+1+n.length))}class lr{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let n=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof _n?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new _n(n-this.pos,-1,0)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,o=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let c=t-e;n.block?this.addBlock(new yr(c,r,n)):(c||o||r>=5)&&this.addLineDeco(r,o,c)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new _n(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new hn(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof _n)return e;let t=new _n(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof _n||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new _n(0,-1,0));let n=e;for(let r of this.nodes)r instanceof _n&&r.updateHeight(this.oracle,n),n+=r?r.length:1;return this.nodes}static build(e,t,n,r){let o=new lr(n,e);return j.om.spans(t,n,r,o,0),o.finish(n)}}class Li{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&de(e,t,this.changes,5)}}function Ki(s,e){let t=s.getBoundingClientRect(),n=s.ownerDocument,r=n.defaultView||window,o=Math.max(0,t.left),c=Math.min(r.innerWidth,t.right),p=Math.max(0,t.top),x=Math.min(r.innerHeight,t.bottom);for(let E=s.parentNode;E&&E!=n.body;)if(1==E.nodeType){let U=E,te=window.getComputedStyle(U);if((U.scrollHeight>U.clientHeight||U.scrollWidth>U.clientWidth)&&"visible"!=te.overflow){let oe=U.getBoundingClientRect();o=Math.max(o,oe.left),c=Math.min(c,oe.right),p=Math.max(p,oe.top),x=Math.min(E==s.parentNode?r.innerHeight:x,oe.bottom)}E="absolute"==te.position||"fixed"==te.position?U.offsetParent:U.parentNode}else{if(11!=E.nodeType)break;E=E.host}return{left:o-t.left,right:Math.max(o,c)-t.left,top:p-(t.top+e),bottom:Math.max(p,x)-(t.top+e)}}function Fi(s,e){let t=s.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class An{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],o=t[n];if(r.from!=o.from||r.to!=o.to||r.size!=o.size)return!1}return!0}draw(e,t){return It.replace({widget:new ar(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class ar extends ci{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Ln{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Dr,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=f.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(Q).some(r=>"function"!=typeof r&&"cm-lineWrapping"==r.class);this.heightOracle=new pt(n),this.stateDeco=xr(t),this.heightMap=z.empty().applyChanges(this.stateDeco,j.EY.empty,this.heightOracle.setDoc(t.doc),[new je(0,0,0,t.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=It.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:o,to:c})=>r>=o&&r<=c)){let{from:o,to:c}=this.lineBlockAt(r);e.push(new Tr(o,c))}}return this.viewports=e.sort((n,r)=>n.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Dr:new Sr(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Fn(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=xr(this.state);let o=je.extendWithRanges(e.changedRanges,function pr(s,e,t){let n=new Li;return j.om.compare(s,e,t,n,0),n.changes}(n,this.stateDeco,e?e.changes:j.VR.empty(this.state.doc.length))),c=this.heightMap.height,p=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Ze(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=c||Be)&&(e.flags|=2),p?(this.scrollAnchorPos=e.changes.mapPos(p.from,-1),this.scrollAnchorHeight=p.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=c);let x=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<x.from||t.range.head>x.to)||!this.viewportIsAppropriate(x))&&(x=this.getViewport(0,t));let E=x.from!=this.viewport.from||x.to!=this.viewport.to;this.viewport=x,e.flags|=this.updateForViewport(),(E||!e.changes.empty||2&e.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(cn)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,o=n.whiteSpace;this.defaultTextDirection="rtl"==n.direction?f.RTL:f.LTR;let c=this.heightOracle.mustRefreshForWrapping(o)||"refresh"===this.mustMeasureContent,p=t.getBoundingClientRect(),x=c||this.mustMeasureContent||this.contentDOMHeight!=p.height;this.contentDOMHeight=p.height,this.mustMeasureContent=!1;let E=0,U=0;if(p.width&&p.height){let{scaleX:ui,scaleY:Xt}=_e(t,p);(ui>.005&&Math.abs(this.scaleX-ui)>.005||Xt>.005&&Math.abs(this.scaleY-Xt)>.005)&&(this.scaleX=ui,this.scaleY=Xt,E|=16,c=x=!0)}let te=(parseInt(n.paddingTop)||0)*this.scaleY,oe=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=te||this.paddingBottom!=oe)&&(this.paddingTop=te,this.paddingBottom=oe,E|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(x=!0),this.editorWidth=e.scrollDOM.clientWidth,E|=16);let Fe=M(this.view.contentDOM,!1).y;Fe!=this.scrollParent&&(this.scrollParent=Fe,this.scrollAnchorHeight=-1,this.scrollOffset=0);let De=this.getScrollOffset();this.scrollOffset!=De&&(this.scrollAnchorHeight=-1,this.scrollOffset=De),this.scrolledToBottom=Le(this.scrollParent||e.win);let Me=(this.printing?Fi:Ki)(t,this.paddingTop),st=Me.top-this.pixelViewport.top,ft=Me.bottom-this.pixelViewport.bottom;this.pixelViewport=Me;let Bt=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(Bt!=this.inView&&(this.inView=Bt,Bt&&(x=!0)),!this.inView&&!this.scrollTarget&&!function Ai(s){let e=s.getBoundingClientRect(),t=s.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}(e.dom))return 0;let ni=p.width;if((this.contentDOMWidth!=ni||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=p.width,this.editorHeight=e.scrollDOM.clientHeight,E|=16),x){let ui=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(ui)&&(c=!0),c||r.lineWrapping&&Math.abs(ni-this.contentDOMWidth)>r.charWidth){let{lineHeight:Xt,charWidth:ji,textHeight:wn}=e.docView.measureTextSize();c=Xt>0&&r.refresh(o,Xt,ji,wn,Math.max(5,ni/ji),ui),c&&(e.docView.minWidth=0,E|=16)}st>0&&ft>0?U=Math.max(st,ft):st<0&&ft<0&&(U=Math.min(st,ft)),Ze();for(let Xt of this.viewports){let ji=Xt.from==this.viewport.from?ui:e.docView.measureVisibleLineHeights(Xt);this.heightMap=(c?z.empty().applyChanges(this.stateDeco,j.EY.empty,this.heightOracle,[new je(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,c,new Vt(Xt.from,ji))}Be&&(E|=2)}let Pi=!this.viewportIsAppropriate(this.viewport,U)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return Pi&&(2&E&&(E|=this.updateScaler()),this.viewport=this.getViewport(U,this.scrollTarget),E|=this.updateForViewport()),(2&E||Pi)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(c?[]:this.lineGaps,e)),E|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),E}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,o=this.heightOracle,{visibleTop:c,visibleBottom:p}=this,x=new Tr(r.lineAt(c-1e3*n,B.ByHeight,o,0,0).from,r.lineAt(p+1e3*(1-n),B.ByHeight,o,0,0).to);if(t){let{head:E}=t.range;if(E<x.from||E>x.to){let oe,U=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),te=r.lineAt(E,B.ByPos,o,0,0);oe="center"==t.y?(te.top+te.bottom)/2-U/2:"start"==t.y||"nearest"==t.y&&E<x.from?te.top:te.bottom-U,x=new Tr(r.lineAt(oe-500,B.ByHeight,o,0,0).from,r.lineAt(oe+U+500,B.ByHeight,o,0,0).to)}}return x}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new Tr(this.heightMap.lineAt(n,B.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,B.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,B.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(t,B.ByPos,this.heightOracle,0,0),{visibleTop:c,visibleBottom:p}=this;return(0==e||r<=c-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||o>=p+Math.max(10,Math.min(n,250)))&&r>c-2e3&&o<p+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new An(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,o=r>>1,c=r<<1;if(this.defaultTextDirection!=f.LTR&&!n)return[];let p=[],x=(U,te,oe,Fe)=>{if(te-U<o)return;let De=this.state.selection.main,Me=[De.from];De.empty||Me.push(De.to);for(let ft of Me)if(ft>U&&ft<te)return x(U,ft-10,oe,Fe),void x(ft+10,te,oe,Fe);let st=function nr(s,e){for(let t of s)if(e(t))return t}(e,ft=>ft.from>=oe.from&&ft.to<=oe.to&&Math.abs(ft.from-U)<o&&Math.abs(ft.to-te)<o&&!Me.some(Bt=>ft.from<Bt&&ft.to>Bt));if(!st){if(te<oe.to&&t&&n&&t.visibleRanges.some(ni=>ni.from<=te&&ni.to>=te)){let ni=t.moveToLineBoundary(j.OF.cursor(te),!1,!0).head;ni>U&&(te=ni)}let ft=this.gapSize(oe,U,te,Fe);st=new An(U,te,ft,n||ft<2e6?ft:2e6)}p.push(st)},E=U=>{if(U.length<c||U.type!=Kt.Text)return;let te=function Er(s,e,t){let n=[],r=s,o=0;return j.om.spans(t,s,e,{span(){},point(c,p){c>r&&(n.push({from:r,to:c}),o+=c-r),r=p}},20),r<e&&(n.push({from:r,to:e}),o+=e-r),{total:o,ranges:n}}(U.from,U.to,this.stateDeco);if(te.total<c)return;let Fe,De,oe=this.scrollTarget?this.scrollTarget.range.head:null;if(n){let st,ft,Me=r/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=oe){let Bt=hr(te,oe),ni=((this.visibleBottom-this.visibleTop)/2+Me)/U.height;st=Bt-ni,ft=Bt+ni}else st=(this.visibleTop-U.top-Me)/U.height,ft=(this.visibleBottom-U.top+Me)/U.height;Fe=ir(te,st),De=ir(te,ft)}else{let Me=te.total*this.heightOracle.charWidth,st=r*this.heightOracle.charWidth,ft=0;if(Me>2e6)for(let Xt of e)Xt.from>=U.from&&Xt.from<U.to&&Xt.size!=Xt.displaySize&&Xt.from*this.heightOracle.charWidth+ft<this.pixelViewport.left&&(ft=Xt.size-Xt.displaySize);let Pi,ui,Bt=this.pixelViewport.left+ft,ni=this.pixelViewport.right+ft;if(null!=oe){let Xt=hr(te,oe),ji=((ni-Bt)/2+st)/Me;Pi=Xt-ji,ui=Xt+ji}else Pi=(Bt-st)/Me,ui=(ni+st)/Me;Fe=ir(te,Pi),De=ir(te,ui)}Fe>U.from&&x(U.from,Fe,U,te),De<U.to&&x(De,U.to,U,te)};for(let U of this.viewportLines)Array.isArray(U.type)?U.type.forEach(E):E(U);return p}gapSize(e,t,n,r){let o=hr(r,n)-hr(r,t);return this.heightOracle.lineWrapping?e.height*o:r.total*this.heightOracle.charWidth*o}updateLineGaps(e){An.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=It.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];j.om.spans(t,this.viewport.from,this.viewport.to,{span(o,c){n.push({from:o,to:c})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let o=0;o<n.length&&!(8&r);o++){let c=this.visibleRanges[o],p=n[o];(c.from!=p.from||c.to!=p.to)&&(r|=4,e&&e.mapPos(c.from,-1)==p.from&&e.mapPos(c.to,1)==p.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Fn(this.heightMap.lineAt(e,B.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Fn(this.heightMap.lineAt(this.scaler.fromDOM(e),B.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Fn(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Tr{constructor(e,t){this.from=e,this.to=t}}function ir({total:s,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let n=Math.floor(s*t);for(let r=0;;r++){let{from:o,to:c}=e[r],p=c-o;if(n<=p)return o+n;n-=p}}function hr(s,e){let t=0;for(let{from:n,to:r}of s.ranges){if(e<=r){t+=e-n;break}t+=r-n}return t/s.total}const Dr={toDOM:s=>s,fromDOM:s=>s,scale:1,eq(s){return s==this}};function xr(s){let e=s.facet(u).filter(n=>"function"!=typeof n),t=s.facet(O).filter(n=>"function"!=typeof n);return t.length&&e.push(j.om.join(t)),e}class Sr{constructor(e,t,n){let r=0,o=0,c=0;this.viewports=n.map(({from:p,to:x})=>{let E=t.lineAt(p,B.ByPos,e,0,0).top,U=t.lineAt(x,B.ByPos,e,0,0).bottom;return r+=U-E,{from:p,to:x,top:E,bottom:U,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let p of this.viewports)p.domTop=c+(p.top-o)*this.scale,c=p.domBottom=p.domTop+(p.bottom-p.top),o=p.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let o=t<this.viewports.length?this.viewports[t]:null;if(!o||e<o.top)return r+(e-n)*this.scale;if(e<=o.bottom)return o.domTop+(e-o.top);n=o.bottom,r=o.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let o=t<this.viewports.length?this.viewports[t]:null;if(!o||e<o.domTop)return n+(e-r)/this.scale;if(e<=o.domBottom)return o.top+(e-o.domTop);n=o.bottom,r=o.domBottom}}eq(e){return e instanceof Sr&&this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to)}}function Fn(s,e){if(1==e.scale)return s;let t=e.toDOM(s.top),n=e.toDOM(s.bottom);return new Ht(s.from,s.length,t,n-t,Array.isArray(s._content)?s._content.map(r=>Fn(r,e)):s._content)}const Lr=j.sj.define({combine:s=>s.join(" ")}),es=j.sj.define({combine:s=>s.indexOf(!0)>-1}),ts=g.G.newName(),gs=g.G.newName(),ms=g.G.newName(),bs={"&light":"."+gs,"&dark":"."+ms};function is(s,e,t){return new g.G(e,{finish:n=>/&/.test(n)?n.replace(/&\w*/,r=>{if("&"==r)return s;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):s+" "+n})}const Js=is("."+ts,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},bs),eo={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},ns=He.ie&&He.ie_version<=11;class to{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new H,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let n of t)this.queue.push(n);(He.ie&&He.ie_version<=11||He.ios&&e.composing)&&t.some(n=>"childList"==n.type&&n.removedNodes.length||"characterData"==n.type&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&He.android&&!1!==e.constructor.EDIT_CONTEXT&&!(He.chrome&&He.chrome_version<126)&&(this.editContext=new no(e),e.state.facet(ei)&&(e.contentDOM.editContext=this.editContext.editContext)),ns&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver(()=>{var t;(null===(t=this.view.docView)||void 0===t?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){("change"==e.type||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(ei)?n.root.activeElement!=this.dom:!it(this.dom,r))return;let o=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);o&&o.isWidget()&&o.widget.ignoreEvent(e)?t||(this.selectionChanged=!1):(He.ie&&He.ie_version<=11||He.android&&He.chrome)&&!n.state.selection.main.empty&&r.focusNode&&qe(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Ie(e.root);if(!t)return!1;let n=He.safari&&11==e.root.nodeType&&e.root.activeElement==this.dom&&function io(s,e){if(e.getComposedRanges){let r=e.getComposedRanges(s.root)[0];if(r)return ys(s,r)}let t=null;function n(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return s.contentDOM.addEventListener("beforeinput",n,!0),s.dom.ownerDocument.execCommand("indent"),s.contentDOM.removeEventListener("beforeinput",n,!0),t?ys(s,t):null}(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=it(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&function Oe(s,e){let t=e.focusNode,n=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=n)return!1;for(n=Math.min(n,kt(t));;)if(n){if(1!=t.nodeType)return!1;let r=t.childNodes[n-1];"false"==r.contentEditable?n--:(t=r,n=kt(t))}else{if(t==s)return!0;n=Pt(t),t=t.parentNode}}(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(1==n.nodeType)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else{if(11!=n.nodeType)break;n=n.host}if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);for(let n of this.scrollTargets=t)n.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,eo),ns&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),ns&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;this.delayedAndroidKey||(this.flushingAndroidKey=this.view.win.requestAnimationFrame(()=>{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&J(this.dom,o.key,o.keyCode))})),(!this.delayedAndroidKey||"Enter"==e)&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!(null===(n=this.delayedAndroidKey)||void 0===n||!n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let o of e){let c=this.readMutation(o);c&&(c.typeOver&&(r=!0),-1==t?({from:t,to:n}=c):(t=Math.min(c.from,t),n=Math.max(c.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&it(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new er(this.view,e,t,n);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=i(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!W(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty("attributes"==e.type),"childList"==e.type){let n=Os(t,e.previousSibling||e.target.previousSibling,-1),r=Os(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(ei)!=e.state.facet(ei)&&(e.view.contentDOM.editContext=e.state.facet(ei)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resizeScroll)||void 0===n||n.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Os(s,e,t){for(;e;){let n=ht.get(e);if(n&&n.parent==s)return n;let r=e.parentNode;e=r!=s.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function ys(s,e){let t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset,c=s.docView.domAtPos(s.state.selection.main.anchor,1);return qe(c.node,c.offset,r,o)&&([t,n,r,o]=[r,o,t,n]),{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:o}}class no{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:o,head:c}=r,p=this.toEditorPos(n.updateRangeStart),x=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:p,drifted:!1});let E=x-p>n.text.length;p==this.from&&o<this.from?p=o:x==this.to&&o>this.to&&(x=o);let U=b(e.state.sliceDoc(p,x),n.text,(E?r.from:r.to)-p,E?"end":null);if(!U){let oe=j.OF.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));return void(W(oe,r)||e.dispatch({selection:oe,userEvent:"select"}))}let te={from:U.from+p,to:U.toA+p,insert:j.EY.of(n.text.slice(U.from,U.toB).split("\n"))};if((He.mac||He.android)&&te.from==c-1&&/^\. ?$/.test(n.text)&&"off"==e.contentDOM.getAttribute("autocorrect")&&(te={from:p,to:x,insert:j.EY.of([n.text.replace("."," ")])}),this.pendingContextChange=te,!e.state.readOnly){let oe=this.to-this.from+(te.to-te.from+te.insert.length);l(e,te,j.OF.single(this.toEditorPos(n.selectionStart,oe),this.toEditorPos(n.selectionEnd,oe)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),te.from<te.to&&!te.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],o=null;for(let c=this.toEditorPos(n.rangeStart),p=this.toEditorPos(n.rangeEnd);c<p;c++){let x=e.coordsForChar(c);o=x&&new DOMRect(x.left,x.top,x.right-x.left,x.bottom-x.top)||o||new DOMRect,r.push(o)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=n=>{let r=[];for(let o of n.getTextFormats()){let c=o.underlineStyle,p=o.underlineThickness;if(!/none/i.test(c)&&!/none/i.test(p)){let x=this.toEditorPos(o.rangeStart),E=this.toEditorPos(o.rangeEnd);if(x<E){let U=`text-decoration: underline ${/^[a-z]/.test(c)?c+" ":"Dashed"==c?"dashed ":"Squiggle"==c?"wavy ":""}${/thin/i.test(p)?1:2}px`;r.push(It.mark({attributes:{style:U}}).range(x,E))}}}e.dispatch({effects:Xi.of(It.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let r=Ie(n.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((o,c,p,x,E)=>{if(n)return;let U=E.length-(c-o);if(r&&c>=r.to){if(r.from==o&&r.to==c&&r.insert.eq(E))return r=this.pendingContextChange=null,t+=U,void(this.to+=U);r=null,this.revertPending(e.state)}if(o+=t,(c+=t)<=this.from)this.from+=U,this.to+=U;else if(o<this.to){if(o<this.from||c>this.to||this.to-this.from+E.length>3e4)return void(n=!0);this.editContext.updateText(this.toContextPos(o),this.toContextPos(c),E.toString()),this.to+=U}t+=U}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):this.applyEdits(e)&&this.rangeIsValid(e.state)?(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state):(this.pendingContextChange=null,this.reset(e.state)),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}let cr=(()=>{class s{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:r}=t;this.dispatchTransactions=t.dispatchTransactions||r&&(o=>o.forEach(c=>r(c,this)))||(o=>this.update(o)),this.dispatch=this.dispatch.bind(this),this._root=t.root||function fe(s){for(;s;){if(s&&(9==s.nodeType||11==s.nodeType&&s.host))return s;s=s.assignedSlot||s.parentNode}return null}(t.parent)||document,this.viewState=new Ln(this,t.state||j.$t.create(t)),t.scrollTo&&t.scrollTo.is(wi)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Gi).map(o=>new $i(o));for(let o of this.plugins)o.update(this);this.observer=new to(this),this.inputState=new ee(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Xe(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),null!==(n=document.fonts)&&void 0!==n&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let n=1==t.length&&t[0]instanceof j.ZX?t:1==t.length&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(n,this)}update(t){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let o,n=!1,r=!1,c=this.state;for(let Fe of t){if(Fe.startState!=c)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");c=Fe.state}if(this.destroyed)return void(this.viewState.state=c);let p=this.hasFocus,x=0,E=null;t.some(Fe=>Fe.annotation(Ui))?(this.inputState.notifiedFocused=p,x=1):p!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=p,E=Kn(c,p),E||(x=1));let U=this.observer.delayedAndroidKey,te=null;if(U?(this.observer.clearDelayedAndroidKey(),te=this.observer.readChange(),(te&&!this.state.doc.eq(c.doc)||!this.state.selection.eq(c.selection))&&(te=null)):this.observer.clear(),c.facet(j.$t.phrases)!=this.state.facet(j.$t.phrases))return this.setState(c);o=ot.create(this,c,t),o.flags|=x;let oe=this.viewState.scrollTarget;try{this.updateState=2;for(let Fe of t){if(oe&&(oe=oe.map(Fe.changes)),Fe.scrollIntoView){let{main:De}=Fe.state.selection,{x:Me,y:st}=this.state.facet(s.cursorScrollMargin);oe=new _i(De.empty?De:j.OF.cursor(De.head,De.head>De.anchor?-1:1),"nearest","nearest",st,Me)}for(let De of Fe.effects)De.is(wi)&&(oe=De.value.clip(this.state))}this.viewState.update(o,oe),this.bidiCache=Nr.update(this.bidiCache,o.changes),o.empty||(this.updatePlugins(o),this.inputState.update(o)),n=this.docView.update(o),this.state.facet(Ce)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(Fe=>Fe.isUserEvent("select.pointer")))}finally{this.updateState=0}if(o.startState.facet(Lr)!=o.state.facet(Lr)&&(this.viewState.mustMeasureContent=!0),(n||r||oe||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!o.empty)for(let Fe of this.state.facet(vi))try{Fe(o)}catch(De){Vi(this.state,De,"update listener")}(E||te)&&Promise.resolve().then(()=>{E&&this.state==E.startState&&this.dispatch(E),te&&!i(this,te)&&U.force&&J(this.contentDOM,U.key,U.keyCode)})}setState(t){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=t);this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new Ln(this,t),this.plugins=t.facet(Gi).map(r=>new $i(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new Xe(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(t){let n=t.startState.facet(Gi),r=t.state.facet(Gi);if(n!=r){let o=[];for(let c of r){let p=n.indexOf(c);if(p<0)o.push(new $i(c));else{let x=this.plugins[p];x.mustUpdate=t,o.push(x)}}for(let c of this.plugins)c.mustUpdate!=t&&c.destroy(this);this.plugins=o,this.pluginMap.clear()}else for(let o of this.plugins)o.mustUpdate=t;for(let o=0;o<this.plugins.length;o++)this.plugins[o].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let t of this.plugins){let n=t.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){Vi(this.state,r,"doc view update listener")}}}measure(t=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,t&&this.observer.forceFlush();let n=null,r=this.viewState.scrollParent,o=this.viewState.getScrollOffset(),{scrollAnchorPos:c,scrollAnchorHeight:p}=this.viewState;Math.abs(o-this.viewState.scrollOffset)>1&&(p=-1),this.viewState.scrollAnchorHeight=-1;try{for(let x=0;;x++){if(p<0)if(Le(r||this.win))c=-1,p=this.viewState.heightMap.height;else{let De=this.viewState.scrollAnchorAt(o);c=De.from,p=De.top}this.updateState=1;let E=this.viewState.measure();if(!E&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(x>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let U=[];4&E||([this.measureRequests,U]=[U,this.measureRequests]);let te=U.map(De=>{try{return De.read(this)}catch(Me){return Vi(this.state,Me),xs}}),oe=ot.create(this,this.state,[]),Fe=!1;oe.flags|=E,n?n.flags|=E:n=oe,this.updateState=2,oe.empty||(this.updatePlugins(oe),this.inputState.update(oe),this.updateAttrs(),Fe=this.docView.update(oe),Fe&&this.docViewUpdate());for(let De=0;De<U.length;De++)if(te[De]!=xs)try{let Me=U[De];Me.write&&Me.write(te[De],this)}catch(Me){Vi(this.state,Me)}if(Fe&&this.docView.updateSelection(!0),!oe.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,p=-1;continue}{let Me=((c<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(c).top)-p)/this.scaleY;if((Me>1||Me<-1)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){o+=Me,r?r.scrollTop+=Me:this.win.scrollBy(0,Me),p=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let x of this.state.facet(vi))x(n)}get themeClasses(){return ts+" "+(this.state.facet(es)?ms:gs)+" "+this.state.facet(Lr)}updateAttrs(){let t=Ss(this,Bi,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(ei)?"true":"false",class:"cm-content",style:`${He.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),Ss(this,Q,n);let r=this.observer.ignore(()=>{let o=Gt(this.contentDOM,this.contentAttrs,n),c=Gt(this.dom,this.editorAttrs,t);return o||c});return this.editorAttrs=t,this.contentAttrs=n,r}showAnnouncements(t){let n=!0;for(let r of t)for(let o of r.effects)o.is(s.announce)&&(n&&(this.announceDOM.textContent=""),n=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=o.value)}mountStyles(){this.styleModules=this.state.facet(Ce);let t=this.state.facet(s.cspNonce);g.G.mount(this.root,this.styleModules.concat(Js).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(null!=t.key)for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===t.key)return void(this.measureRequests[n]=t);this.measureRequests.push(t)}}plugin(t){let n=this.pluginMap.get(t);return(void 0===n||n&&n.plugin!=t)&&this.pluginMap.set(t,n=this.plugins.find(r=>r.plugin==t)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,n,r){return Hn(this,t,Gn(this,t,n,r))}moveByGroup(t,n){return Hn(this,t,Gn(this,t,n,r=>function Xn(s,e,t){let n=s.state.charCategorizer(e),r=n(t);return o=>{let c=n(o);return r==j.Je.Space&&(r=c),r==c}}(this,t.head,r)))}visualLineSide(t,n){let r=this.bidiSpans(t),o=this.textDirectionAt(t.from),c=r[n?r.length-1:0];return j.OF.cursor(c.side(n,o)+t.from,c.forward(!n,o)?1:-1)}moveToLineBoundary(t,n,r=!0){return function rr(s,e,t,n){let r=Cn(s,e.head,e.assoc||-1),o=n&&r.type==Kt.Text&&(s.lineWrapping||r.widgetLineBreaks)?s.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head):null;if(o){let c=s.dom.getBoundingClientRect(),p=s.textDirectionAt(r.from),x=s.posAtCoords({x:t==(p==f.LTR)?c.right-1:c.left+1,y:(o.top+o.bottom)/2});if(null!=x)return j.OF.cursor(x,t?-1:1)}return j.OF.cursor(t?r.to:r.from,t?-1:1)}(this,t,n,r)}moveVertically(t,n,r){return Hn(this,t,function Wn(s,e,t,n){let r=e.head,o=t?1:-1;if(r==(t?s.state.doc.length:0))return j.OF.cursor(r,e.assoc);let p,c=e.goalColumn,x=s.contentDOM.getBoundingClientRect(),E=s.coordsAtPos(r,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),U=s.documentTop;if(E)null==c&&(c=E.left-x.left),p=o<0?E.top:E.bottom;else{let De=s.viewState.lineBlockAt(r);null==c&&(c=Math.min(x.right-x.left,s.defaultCharacterWidth*(r-De.from))),p=(o<0?De.top:De.bottom)+U}let te=x.left+c,oe=s.viewState.heightOracle.textHeight>>1,Fe=n??oe;for(let De=0;;De+=oe){let Me=p+(Fe+De)*o,st=Tn(s,{x:te,y:Me},!1,o);if(t?Me>x.bottom:Me<x.top)return j.OF.cursor(st.pos,st.assoc);let ft=s.coordsAtPos(st.pos,st.assoc),Bt=ft?(ft.top+ft.bottom)/2:0;if(!ft||(t?Bt>p:Bt<p))return j.OF.cursor(st.pos,st.assoc,void 0,c)}}(this,t,n,r))}domAtPos(t,n=1){return this.docView.domAtPos(t,n)}posAtDOM(t,n=0){return this.docView.posFromDOM(t,n)}posAtCoords(t,n=!0){this.readMeasured();let r=Tn(this,t,n);return r&&r.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),Tn(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let r=this.docView.coordsAt(t,n);if(!r||r.left==r.right)return r;let o=this.state.doc.lineAt(t),c=this.bidiSpans(o);return Et(r,c[bt.find(c,t-o.from,-1,n)].dir==f.LTR==n>0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(nn)||t<this.viewport.from||t>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>ro)return Ni(t.length);let r,n=this.textDirectionAt(t.from);for(let c of this.bidiCache)if(c.from==t.from&&c.dir==n&&(c.fresh||ai(c.isolates,r=$(this,t))))return c.order;r||(r=$(this,t));let o=function yi(s,e,t){if(!s)return[new bt(0,0,e==V?1:0)];if(e==m&&!t.length&&!mt.test(s))return Ni(s.length);if(t.length)for(;s.length>Tt.length;)Tt[Tt.length]=256;let n=[],r=e==m?0:1;return ki(s,r,r,t,0,s.length,n),n}(t.text,n,r);return this.bidiCache.push(new Nr(t.from,t.to,n,r,!0,o)),o}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||He.safari&&(null===(t=this.inputState)||void 0===t?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{I(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((9==t.nodeType?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,n={}){var r,o,c,p;return wi.of(new _i("number"==typeof t?j.OF.cursor(t):t,null!==(r=n.y)&&void 0!==r?r:"nearest",null!==(o=n.x)&&void 0!==o?o:"nearest",null!==(c=n.yMargin)&&void 0!==c?c:5,null!==(p=n.xMargin)&&void 0!==p?p:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(t);return wi.of(new _i(j.OF.cursor(r.from),"start","start",r.top-t,n,!0))}setTabFocusMode(t){null==t?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof t?this.inputState.tabFocusMode=t?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return Ut.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return Ut.define(()=>({}),{eventObservers:t})}static theme(t,n){let r=g.G.newName(),o=[Lr.of(r),Ce.of(is(`.${r}`,t))];return n&&n.dark&&o.push(es.of(!0)),o}static baseTheme(t){return j.Nb.lowest(Ce.of(is("."+ts,t,bs)))}static findFromDOM(t){var n;let r=t.querySelector(".cm-content"),o=r&&ht.get(r)||ht.get(t);return(null===(n=o?.root)||void 0===n?void 0:n.view)||null}}return s.styleModule=Ce,s.inputHandler=mi,s.clipboardInputFilter=tn,s.clipboardOutputFilter=si,s.scrollHandler=Si,s.focusChangeEffect=en,s.perLineTextDirection=nn,s.exceptionSink=Ii,s.updateListener=vi,s.editable=ei,s.mouseSelectionStyle=Di,s.dragMovesSelection=xi,s.clickAddsSelectionRange=gi,s.decorations=u,s.blockWrappers=d,s.outerDecorations=O,s.atomicRanges=T,s.bidiIsolatedRanges=N,s.cursorScrollMargin=j.sj.define({combine:e=>{let t=5,n=5;for(let r of e)"number"==typeof r?t=n=r:({x:t,y:n}=r);return{x:t,y:n}}}),s.scrollMargins=re,s.darkTheme=es,s.cspNonce=j.sj.define({combine:e=>e.length?e[0]:""}),s.contentAttributes=Q,s.editorAttributes=Bi,s.lineWrapping=s.contentAttributes.of({class:"cm-lineWrapping"}),s.announce=j.Pe.define(),s})();const ro=4096,xs={};class Nr{constructor(e,t,n,r,o,c){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=o,this.order=c}static update(e,t){if(t.empty&&!e.some(o=>o.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:f.LTR;for(let o=Math.max(0,e.length-10);o<e.length;o++){let c=e[o];c.dir==r&&!t.touchesRange(c.from,c.to)&&n.push(new Nr(t.mapPos(c.from,1),t.mapPos(c.to,-1),c.dir,c.isolates,!1,c.order))}return n}}function Ss(s,e,t){for(let n=s.state.facet(e),r=n.length-1;r>=0;r--){let o=n[r],c="function"==typeof o?o(s):o;c&&Nt(c,t)}return t}const so=He.mac?"mac":He.windows?"win":He.linux?"linux":"key";function Gr(s,e,t){return e.altKey&&(s="Alt-"+s),e.ctrlKey&&(s="Ctrl-"+s),e.metaKey&&(s="Meta-"+s),!1!==t&&e.shiftKey&&(s="Shift-"+s),s}const ws=j.sj.define({enables:j.Nb.default(cr.domEventHandlers({keydown:(s,e)=>Ps(vs(e.state),s,e,"editor")}))}),ks=new WeakMap;function vs(s){let e=s.facet(ws),t=ks.get(e);return t||ks.set(e,t=function co(s,e=so){let t=Object.create(null),n=Object.create(null),r=(c,p)=>{let x=n[c];if(null==x)n[c]=p;else if(x!=p)throw new Error("Key binding "+c+" is used both as a regular binding and as a multi-stroke prefix")},o=(c,p,x,E,U)=>{var te,oe;let Fe=t[c]||(t[c]=Object.create(null)),De=p.split(/ (?!$)/).map(ft=>function oo(s,e){const t=s.split(/-(?!$)/);let r,o,c,p,n=t[t.length-1];"Space"==n&&(n=" ");for(let x=0;x<t.length-1;++x){const E=t[x];if(/^(cmd|meta|m)$/i.test(E))p=!0;else if(/^a(lt)?$/i.test(E))r=!0;else if(/^(c|ctrl|control)$/i.test(E))o=!0;else if(/^s(hift)?$/i.test(E))c=!0;else{if(!/^mod$/i.test(E))throw new Error("Unrecognized modifier name: "+E);"mac"==e?p=!0:o=!0}}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),p&&(n="Meta-"+n),c&&(n="Shift-"+n),n}(ft,e));for(let ft=1;ft<De.length;ft++){let Bt=De.slice(0,ft).join(" ");r(Bt,!0),Fe[Bt]||(Fe[Bt]={preventDefault:!0,stopPropagation:!1,run:[ni=>{let Pi=gr={view:ni,prefix:Bt,scope:c};return setTimeout(()=>{gr==Pi&&(gr=null)},4e3),!0}]})}let Me=De.join(" ");r(Me,!1);let st=Fe[Me]||(Fe[Me]={preventDefault:!1,stopPropagation:!1,run:(null===(oe=null===(te=Fe._any)||void 0===te?void 0:te.run)||void 0===oe?void 0:oe.slice())||[]});x&&st.run.push(x),E&&(st.preventDefault=!0),U&&(st.stopPropagation=!0)};for(let c of s){let p=c.scope?c.scope.split(" "):["editor"];if(c.any)for(let E of p){let U=t[E]||(t[E]=Object.create(null));U._any||(U._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:te}=c;for(let oe in U)U[oe].run.push(Fe=>te(Fe,rs))}let x=c[e]||c.key;if(x)for(let E of p)o(E,x,c.run,c.preventDefault,c.stopPropagation),c.shift&&o(E,"Shift-"+x,c.shift,c.preventDefault,c.stopPropagation)}return t}(e.reduce((n,r)=>n.concat(r),[]))),t}function ao(s,e,t){return Ps(vs(s.state),e,s,t)}let gr=null,rs=null;function Ps(s,e,t,n){rs=e;let r=function ct(s){var t=!(Te&&s.metaKey&&s.shiftKey&&!s.ctrlKey&&!s.altKey||Ve&&s.shiftKey&&s.key&&1==s.key.length||"Unidentified"==s.key)&&s.key||(s.shiftKey?le:R)[s.keyCode]||s.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(e),o=(0,j.vS)(r,0),c=(0,j.Fh)(o)==r.length&&" "!=r,p="",x=!1,E=!1,U=!1;gr&&gr.view==t&&gr.scope==n&&(p=gr.prefix+" ",_t.indexOf(e.keyCode)<0&&(E=!0,gr=null));let De,Me,te=new Set,oe=st=>{if(st){for(let ft of st.run)if(!te.has(ft)&&(te.add(ft),ft(t)))return st.stopPropagation&&(U=!0),!0;st.preventDefault&&(st.stopPropagation&&(U=!0),E=!0)}return!1},Fe=s[n];return Fe&&(oe(Fe[p+Gr(r,e,!c)])?x=!0:!c||!(e.altKey||e.metaKey||e.ctrlKey)||He.windows&&e.ctrlKey&&e.altKey||He.mac&&e.altKey&&!e.ctrlKey&&!e.metaKey||!(De=R[e.keyCode])||De==r?c&&e.shiftKey&&oe(Fe[p+Gr(r,e,!0)])&&(x=!0):(oe(Fe[p+Gr(De,e,!0)])||e.shiftKey&&(Me=le[e.keyCode])!=r&&Me!=De&&oe(Fe[p+Gr(Me,e,!1)]))&&(x=!0),!x&&oe(Fe._any)&&(x=!0)),E&&(x=!0),x&&U&&e.stopPropagation(),rs=null,x}class wr{constructor(e,t,n,r,o){this.className=e,this.left=t,this.top=n,this.width=r,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let o=_s(e);return[new wr(t,r.left-o.left,r.top-o.top,null,r.bottom-r.top)]}return function uo(s,e,t){if(t.to<=s.viewport.from||t.from>=s.viewport.to)return[];let n=Math.max(t.from,s.viewport.from),r=Math.min(t.to,s.viewport.to),o=s.textDirection==f.LTR,c=s.contentDOM,p=c.getBoundingClientRect(),x=_s(s),E=c.querySelector(".cm-line"),U=E&&window.getComputedStyle(E),te=p.left+(U?parseInt(U.paddingLeft)+Math.min(0,parseInt(U.textIndent)):0),oe=p.right-(U?parseInt(U.paddingRight):0),Fe=Cn(s,n,1),De=Cn(s,r,-1),Me=Fe.type==Kt.Text?Fe:null,st=De.type==Kt.Text?De:null;if(Me&&(s.lineWrapping||Fe.widgetLineBreaks)&&(Me=As(s,n,1,Me)),st&&(s.lineWrapping||De.widgetLineBreaks)&&(st=As(s,r,-1,st)),Me&&st&&Me.from==st.from&&Me.to==st.to)return Bt(ni(t.from,t.to,Me));{let ui=Me?ni(t.from,null,Me):Pi(Fe,!1),Xt=st?ni(null,t.to,st):Pi(De,!0),ji=[];return(Me||Fe).to<(st||De).from-(Me&&st?1:0)||Fe.widgetLineBreaks>1&&ui.bottom+s.defaultLineHeight/2<Xt.top?ji.push(ft(te,ui.bottom,oe,Xt.top)):ui.bottom<Xt.top&&s.elementAtHeight((ui.bottom+Xt.top)/2).type==Kt.Text&&(ui.bottom=Xt.top=(ui.bottom+Xt.top)/2),Bt(ui).concat(ji).concat(Bt(Xt))}function ft(ui,Xt,ji,wn){return new wr(e,ui-x.left,Xt-x.top,Math.max(0,ji-ui),wn-Xt)}function Bt({top:ui,bottom:Xt,horizontal:ji}){let wn=[];for(let mr=0;mr<ji.length;mr+=2)wn.push(ft(ji[mr],ui,ji[mr+1],Xt));return wn}function ni(ui,Xt,ji){let wn=1e9,mr=-1e9,Zr=[];function Ks(vr,br,Cr,Pr,Br){let fr=s.coordsAtPos(vr,vr==ji.to?-2:2),dr=s.coordsAtPos(Cr,Cr==ji.from?2:-2);!fr||!dr||(wn=Math.min(fr.top,dr.top,wn),mr=Math.max(fr.bottom,dr.bottom,mr),Br==f.LTR?Zr.push(o&&br?te:fr.left,o&&Pr?oe:dr.right):Zr.push(!o&&Pr?te:dr.left,!o&&br?oe:fr.right))}let Kr=ui??ji.from,Jr=Xt??ji.to;for(let vr of s.visibleRanges)if(vr.to>Kr&&vr.from<Jr)for(let br=Math.max(vr.from,Kr),Cr=Math.min(vr.to,Jr);;){let Pr=s.state.doc.lineAt(br);for(let Br of s.bidiSpans(Pr)){let fr=Br.from+Pr.from,dr=Br.to+Pr.from;if(fr>=Cr)break;dr>br&&Ks(Math.max(fr,br),null==ui&&fr<=Kr,Math.min(dr,Cr),null==Xt&&dr>=Jr,Br.dir)}if(br=Pr.to+1,br>=Cr)break}return 0==Zr.length&&Ks(Kr,null==ui,Jr,null==Xt,s.textDirection),{top:wn,bottom:mr,horizontal:Zr}}function Pi(ui,Xt){let ji=p.top+(Xt?ui.top:ui.bottom);return{top:ji,bottom:ji,horizontal:[]}}}(e,t,n)}}function _s(s){let e=s.scrollDOM.getBoundingClientRect();return{left:(s.textDirection==f.LTR?e.left:e.right-s.scrollDOM.clientWidth*s.scaleX)-s.scrollDOM.scrollLeft*s.scaleX,top:e.top-s.scrollDOM.scrollTop*s.scaleY}}function As(s,e,t,n){let r=s.coordsAtPos(e,2*t);if(!r)return n;let o=s.dom.getBoundingClientRect(),c=(r.top+r.bottom)/2,p=s.posAtCoords({x:o.left+1,y:c}),x=s.posAtCoords({x:o.right-1,y:c});return null==p||null==x?n:{from:Math.max(n.from,Math.min(p,x)),to:Math.min(n.to,Math.max(p,x))}}class po{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Wr)!=e.state.facet(Wr)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){!1!==this.layer.updateOnDocViewUpdate&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(Wr);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,n)=>!function fo(s,e){return s.constructor==e.constructor&&s.eq(e)}(t,this.drawn[n]))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let r=t.nextSibling;t.remove(),t=r}this.drawn=e,He.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Wr=j.sj.define();function Cs(s){return[Ut.define(e=>new po(e,s)),Wr.of(s)]}const kr=j.sj.define({combine:s=>(0,j.QR)(s,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function go(s={}){return[kr.of(s),mo,bo,Oo,cn.of(!0)]}function Ts(s){return s.startState.facet(kr)!=s.state.facet(kr)}const mo=Cs({above:!0,markers(s){let{state:e}=s,t=e.facet(kr),n=[];for(let r of e.selection.ranges){let o=r==e.selection.main;if(r.empty||t.drawRangeCursor&&!(o&&He.ios&&t.iosSelectionHandles)){let c=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",p=r.empty?r:j.OF.cursor(r.head,r.assoc);for(let x of wr.forRange(s,c,p))n.push(x)}}return n},update(s,e){s.transactions.some(n=>n.selection)&&(e.style.animationName="cm-blink"==e.style.animationName?"cm-blink2":"cm-blink");let t=Ts(s);return t&&Es(s.state,e),s.docChanged||s.selectionSet||t},mount(s,e){Es(e.state,s)},class:"cm-cursorLayer"});function Es(s,e){e.style.animationDuration=s.facet(kr).cursorBlinkRate+"ms"}const bo=Cs({above:!1,markers(s){let e=[],{main:t,ranges:n}=s.state.selection;for(let r of n)if(!r.empty)for(let o of wr.forRange(s,"cm-selectionBackground",r))e.push(o);if(He.ios&&!t.empty&&s.state.facet(kr).iosSelectionHandles){for(let r of wr.forRange(s,"cm-selectionHandle cm-selectionHandle-start",j.OF.cursor(t.from,1)))e.push(r);for(let r of wr.forRange(s,"cm-selectionHandle cm-selectionHandle-end",j.OF.cursor(t.to,1)))e.push(r)}return e},update:(s,e)=>s.docChanged||s.selectionSet||s.viewportChanged||Ts(s),class:"cm-selectionLayer"}),Oo=j.Nb.highest(cr.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),Ds=j.Pe.define({map:(s,e)=>null==s?null:e.mapPos(s)}),Rr=j.sU.define({create:()=>null,update:(s,e)=>(null!=s&&(s=e.changes.mapPos(s)),e.effects.reduce((t,n)=>n.is(Ds)?n.value:t,s))}),yo=Ut.fromClass(class{constructor(s){this.view=s,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(s){var e;let t=s.state.field(Rr);null==t?null!=this.cursor&&(null===(e=this.cursor)||void 0===e||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(s.startState.field(Rr)!=t||s.docChanged||s.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:s}=this,e=s.state.field(Rr),t=null!=e&&s.coordsAtPos(e);if(!t)return null;let n=s.scrollDOM.getBoundingClientRect();return{left:t.left-n.left+s.scrollDOM.scrollLeft*s.scaleX,top:t.top-n.top+s.scrollDOM.scrollTop*s.scaleY,height:t.bottom-t.top}}drawCursor(s){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;s?(this.cursor.style.left=s.left/e+"px",this.cursor.style.top=s.top/t+"px",this.cursor.style.height=s.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(s){this.view.state.field(Rr)!=s&&this.view.dispatch({effects:Ds.of(s)})}},{eventObservers:{dragover(s){this.setDropPos(this.view.posAtCoords({x:s.clientX,y:s.clientY}))},dragleave(s){(s.target==this.view.contentDOM||!this.view.contentDOM.contains(s.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function xo(){return[Rr,yo]}function Rs(s,e,t,n,r){e.lastIndex=0;for(let p,o=s.iterRange(t,n),c=t;!o.next().done;c+=o.value.length)if(!o.lineBreak)for(;p=e.exec(o.value);)r(c+p.index,p)}class ss{constructor(e){const{regexp:t,decoration:n,decorate:r,boundary:o,maxLength:c=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(p,x,E,U)=>r(U,E,E+p[0].length,p,x);else if("function"==typeof n)this.addMatch=(p,x,E,U)=>{let te=n(p,x,E);te&&U(E,E+p[0].length,te)};else{if(!n)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(p,x,E,U)=>U(E,E+p[0].length,n)}this.boundary=o,this.maxLength=c}createDeco(e){let t=new j.vB,n=t.add.bind(t);for(let{from:r,to:o}of function So(s,e){let t=s.visibleRanges;if(1==t.length&&t[0].from==s.viewport.from&&t[0].to==s.viewport.to)return t;let n=[];for(let{from:r,to:o}of t)r=Math.max(s.state.doc.lineAt(r).from,r-e),o=Math.min(s.state.doc.lineAt(o).to,o+e),n.length&&n[n.length-1].to>=r?n[n.length-1].to=o:n.push({from:r,to:o});return n}(e,this.maxLength))Rs(e.state.doc,this.regexp,r,o,(c,p)=>this.addMatch(p,e,c,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((o,c,p,x)=>{x>=e.view.viewport.from&&p<=e.view.viewport.to&&(n=Math.min(p,n),r=Math.max(x,r))}),e.viewportMoved||r-n>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let o of e.visibleRanges){let c=Math.max(o.from,n),p=Math.min(o.to,r);if(p>=c){let x=e.state.doc.lineAt(c),E=x.to<p?e.state.doc.lineAt(p):x,U=Math.max(o.from,x.from),te=Math.min(o.to,E.to);if(this.boundary){for(;c>x.from;c--)if(this.boundary.test(x.text[c-1-x.from])){U=c;break}for(;p<E.to;p++)if(this.boundary.test(E.text[p-E.from])){te=p;break}}let Fe,oe=[],De=(Me,st,ft)=>oe.push(ft.range(Me,st));if(x==E)for(this.regexp.lastIndex=U-x.from;(Fe=this.regexp.exec(x.text))&&Fe.index<te-x.from;)this.addMatch(Fe,e,Fe.index+x.from,De);else Rs(e.state.doc,this.regexp,U,te,(Me,st)=>this.addMatch(st,e,Me,De));t=t.update({filterFrom:U,filterTo:te,filter:(Me,st)=>Me<U||st>te,add:oe})}}return t}}const os=null!=/x/.unicode?"gu":"g",wo=new RegExp("[\0-\b\n-\x1f\x7f-\x9f\xad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]",os),ko={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let ls=null;const Vr=j.sj.define({combine(s){let e=(0,j.QR)(s,{render:null,specialChars:wo,addSpecialChars:null});return(e.replaceTabs=!function vo(){var s;if(null==ls&&typeof document<"u"&&document.body){let e=document.body.style;ls=null!=(null!==(s=e.tabSize)&&void 0!==s?s:e.MozTabSize)}return ls||!1}())&&(e.specialChars=new RegExp("\t|"+e.specialChars.source,os)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,os)),e}});function Po(s={}){return[Vr.of(s),Fs||(Fs=Ut.fromClass(class{constructor(s){this.view=s,this.decorations=It.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(s.state.facet(Vr)),this.decorations=this.decorator.createDeco(s)}makeDecorator(s){return new ss({regexp:s.specialChars,decoration:(e,t,n)=>{let{doc:r}=t.state,o=(0,j.vS)(e[0],0);if(9==o){let c=r.lineAt(n),p=t.state.tabSize,x=(0,j.y$)(c.text,p,n-c.from);return It.replace({widget:new Eo((p-x%p)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=It.replace({widget:new To(s,o)}))},boundary:s.replaceTabs?void 0:/[^]/})}update(s){let e=s.state.facet(Vr);s.startState.facet(Vr)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(s.view)):this.decorations=this.decorator.updateDeco(s,this.decorations)}},{decorations:s=>s.decorations}))]}let Fs=null;class To extends ci{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=function Co(s){return s>=32?"\u2022":10==s?"\u2424":String.fromCharCode(9216+s)}(this.code),n=e.state.phrase("Control character")+" "+(ko[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let o=document.createElement("span");return o.textContent=t,o.title=n,o.setAttribute("aria-label",n),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class Eo extends ci{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function Do(){return Fo}const Ro=It.line({class:"cm-activeLine"}),Fo=Ut.fromClass(class{constructor(s){this.decorations=this.getDeco(s)}update(s){(s.docChanged||s.selectionSet)&&(this.decorations=this.getDeco(s.view))}getDeco(s){let e=-1,t=[];for(let n of s.state.selection.ranges){let r=s.lineBlockAt(n.head);r.from>e&&(t.push(Ro.range(r.from)),e=r.from)}return It.set(t)}},{decorations:s=>s.decorations});function Bs(s,e){let t=s.posAtCoords({x:e.clientX,y:e.clientY},!1),n=s.state.doc.lineAt(t),r=t-n.from,o=r>2e3?-1:r==n.length?function Mo(s,e){let t=s.coordsAtPos(s.viewport.from);return t?Math.round(Math.abs((t.left-e)/s.defaultCharacterWidth)):-1}(s,e.clientX):(0,j.y$)(n.text,s.state.tabSize,t-n.from);return{line:n.number,col:o,off:r}}function No(s){let e=s?.eventFilter||(t=>t.altKey&&0==t.button);return cr.mouseSelectionStyle.of((t,n)=>e(n)?function Lo(s,e){let t=Bs(s,e),n=s.state.selection;return t?{update(r){if(r.docChanged){let o=r.changes.mapPos(r.startState.doc.line(t.line).from),c=r.state.doc.lineAt(o);t={line:c.number,col:t.col,off:Math.min(t.off,c.length)},n=n.map(r.changes)}},get(r,o,c){let p=Bs(s,r);if(!p)return n;let x=function Bo(s,e,t){let n=Math.min(e.line,t.line),r=Math.max(e.line,t.line),o=[];if(e.off>2e3||t.off>2e3||e.col<0||t.col<0){let c=Math.min(e.off,t.off),p=Math.max(e.off,t.off);for(let x=n;x<=r;x++){let E=s.doc.line(x);E.length<=p&&o.push(j.OF.range(E.from+c,E.to+p))}}else{let c=Math.min(e.col,t.col),p=Math.max(e.col,t.col);for(let x=n;x<=r;x++){let E=s.doc.line(x),U=(0,j.kn)(E.text,c,s.tabSize,!0);if(U<0)o.push(j.OF.cursor(E.to));else{let te=(0,j.kn)(E.text,p,s.tabSize);o.push(j.OF.range(E.from+U,E.from+te))}}}return o}(s.state,t,p);return x.length?j.OF.create(c?x.concat(n.ranges):x):n}}:null}(t,n):null)}const Go={Alt:[18,s=>!!s.altKey],Control:[17,s=>!!s.ctrlKey],Shift:[16,s=>!!s.shiftKey],Meta:[91,s=>!!s.metaKey]},Wo={style:"cursor: crosshair"};function Vo(s={}){let[e,t]=Go[s.key||"Alt"],n=Ut.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||t(r))},keyup(r){(r.keyCode==e||!t(r))&&this.set(!1)},mousemove(r){this.set(t(r))}}});return[n,cr.contentAttributes.of(r=>{var o;return null!==(o=r.plugin(n))&&void 0!==o&&o.isDown?Wo:null})]}const Qr="-10000px";class Ms{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(c=>c);let o=null;this.tooltipViews=this.tooltips.map(c=>o=n(c,o))}update(e,t){var n;let r=e.state.facet(this.facet),o=r.filter(x=>x);if(r===this.input){for(let x of this.tooltipViews)x.update&&x.update(e);return!1}let c=[],p=t?[]:null;for(let x=0;x<o.length;x++){let E=o[x],U=-1;if(E){for(let te=0;te<this.tooltips.length;te++){let oe=this.tooltips[te];oe&&oe.create==E.create&&(U=te)}if(U<0)c[x]=this.createTooltipView(E,x?c[x-1]:null),p&&(p[x]=!!E.above);else{let te=c[x]=this.tooltipViews[U];p&&(p[x]=t[U]),te.update&&te.update(e)}}}for(let x of this.tooltipViews)c.indexOf(x)<0&&(this.removeTooltipView(x),null===(n=x.destroy)||void 0===n||n.call(x));return t&&(p.forEach((x,E)=>t[E]=x),t.length=p.length),this.input=r,this.tooltips=o,this.tooltipViews=c,!0}}function Qo(s){let e=s.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Ur=j.sj.define({combine:s=>{var e,t,n;return{position:He.ios?"absolute":(null===(e=s.find(r=>r.position))||void 0===e?void 0:e.position)||"fixed",parent:(null===(t=s.find(r=>r.parent))||void 0===t?void 0:t.parent)||null,tooltipSpace:(null===(n=s.find(r=>r.tooltipSpace))||void 0===n?void 0:n.tooltipSpace)||Qo}}}),Ls=new WeakMap,jr=Ut.fromClass(class{constructor(s){this.view=s,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=s.state.facet(Ur);this.position=e.position,this.parent=e.parent,this.classes=s.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Ms(s,hs,(t,n)=>this.createTooltip(t,n),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),s.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let s of this.manager.tooltipViews)this.intersectionObserver.observe(s.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(s){s.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(s,this.above);e&&this.observeIntersection();let t=e||s.geometryChanged,n=s.state.facet(Ur);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;t=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(s,e){let t=s.create(this.view),n=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),s.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",t.dom.appendChild(r)}return t.dom.style.position=this.position,t.dom.style.top=Qr,t.dom.style.left="0px",this.container.insertBefore(t.dom,n),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var s,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),null===(s=n.destroy)||void 0===s||s.call(n);this.parent&&this.container.remove(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),null===(t=this.intersectionObserver)||void 0===t||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let s=1,e=1,t=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:o}=this.manager.tooltipViews[0];if(He.safari){let c=o.getBoundingClientRect();t=Math.abs(c.top+1e4)>1||Math.abs(c.left)>1}else t=!!o.offsetParent&&o.offsetParent!=this.container.ownerDocument.body}if(t||"absolute"==this.position)if(this.parent){let o=this.parent.getBoundingClientRect();o.width&&o.height&&(s=o.width/this.parent.offsetWidth,e=o.height/this.parent.offsetHeight)}else({scaleX:s,scaleY:e}=this.view.viewState);let n=this.view.scrollDOM.getBoundingClientRect(),r=ce(this.view);return{visible:{left:n.left+r.left,top:n.top+r.top,right:n.right-r.right,bottom:n.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((o,c)=>{let p=this.manager.tooltipViews[c];return p.getCoords?p.getCoords(o.pos):this.view.coordsAtPos(o.pos)}),size:this.manager.tooltipViews.map(({dom:o})=>o.getBoundingClientRect()),space:this.view.state.facet(Ur).tooltipSpace(this.view),scaleX:s,scaleY:e,makeAbsolute:t}}writeMeasure(s){var e;if(s.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let p of this.manager.tooltipViews)p.dom.style.position="absolute"}let{visible:t,space:n,scaleX:r,scaleY:o}=s,c=[];for(let p=0;p<this.manager.tooltips.length;p++){let x=this.manager.tooltips[p],E=this.manager.tooltipViews[p],{dom:U}=E,te=s.pos[p],oe=s.size[p];if(!te||!1!==x.clip&&(te.bottom<=Math.max(t.top,n.top)||te.top>=Math.min(t.bottom,n.bottom)||te.right<Math.max(t.left,n.left)-.1||te.left>Math.min(t.right,n.right)+.1)){U.style.top=Qr;continue}let Fe=x.arrow?E.dom.querySelector(".cm-tooltip-arrow"):null,De=Fe?7:0,Me=oe.right-oe.left,st=null!==(e=Ls.get(E))&&void 0!==e?e:oe.bottom-oe.top,ft=E.offset||jo,Bt=this.view.textDirection==f.LTR,ni=oe.width>n.right-n.left?Bt?n.left:n.right-oe.width:Bt?Math.max(n.left,Math.min(te.left-(Fe?14:0)+ft.x,n.right-Me)):Math.min(Math.max(n.left,te.left-Me+(Fe?14:0)-ft.x),n.right-Me),Pi=this.above[p];!x.strictSide&&(Pi?te.top-st-De-ft.y<n.top:te.bottom+st+De+ft.y>n.bottom)&&Pi==n.bottom-te.bottom>te.top-n.top&&(Pi=this.above[p]=!Pi);let ui=(Pi?te.top-n.top:n.bottom-te.bottom)-De;if(ui<st&&!1!==E.resize){if(ui<this.view.defaultLineHeight){U.style.top=Qr;continue}Ls.set(E,st),U.style.height=(st=ui)/o+"px"}else U.style.height&&(U.style.height="");let Xt=Pi?te.top-st-De-ft.y:te.bottom+De+ft.y,ji=ni+Me;if(!0!==E.overlap)for(let wn of c)wn.left<ji&&wn.right>ni&&wn.top<Xt+st&&wn.bottom>Xt&&(Xt=Pi?wn.top-st-2-De:wn.bottom+De+2);"absolute"==this.position?(U.style.top=(Xt-s.parent.top)/o+"px",Ns(U,(ni-s.parent.left)/r)):(U.style.top=Xt/o+"px",Ns(U,ni/r)),Fe&&(Fe.style.left=(te.left+(Bt?ft.x:-ft.x)-(ni+14-7))/r+"px"),!0!==E.overlap&&c.push({left:ni,top:Xt,right:ji,bottom:Xt+st}),U.classList.toggle("cm-tooltip-above",Pi),U.classList.toggle("cm-tooltip-below",!Pi),E.positioned&&E.positioned(s.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let s of this.manager.tooltipViews)s.dom.style.top=Qr}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Ns(s,e){let t=parseInt(s.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(s.style.left=e+"px")}const jo={x:0,y:0},hs=j.sj.define({enables:[jr,cr.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}})]}),Fr=j.sj.define({combine:s=>s.reduce((e,t)=>e.concat(t),[])});class $r{static create(e){return new $r(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Ms(e,Fr,(t,n)=>this.createHostedView(t,n),t=>t.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)null===(e=t.destroy)||void 0===e||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(void 0!==r)if(void 0===t)t=r;else if(t!==r)return}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const $o=hs.compute([Fr],s=>{let e=s.facet(Fr);return 0===e.length?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var n;return null!==(n=t.end)&&void 0!==n?n:t.pos})),create:$r.create,above:e[0].above,arrow:e.some(t=>t.arrow)}}),Gs=j.sj.define();class zo{constructor(e,t,n,r,o,c){this.view=e,this.source=t,this.field=n,this.locked=r,this.setHover=o,this.hoverTime=c,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let r,o=1;if(n.isWidget())r=n.posAtStart;else{if(r=e.posAtCoords(t),null==r)return;let c=e.coordsAtPos(r);if(!c||t.y<c.top||t.y>c.bottom||t.x<c.left-e.defaultCharacterWidth||t.x>c.right+e.defaultCharacterWidth)return;let p=e.bidiSpans(e.state.doc.lineAt(r)).find(E=>E.from<=r&&E.to>=r),x=p&&p.dir==f.RTL?-1:1;o=t.x<c.left?-x:x}this.activateHover(e,r,o)}activateHover(e,t,n,r){let o=this.source(e,t,n),c=p=>{if(p&&(!Array.isArray(p)||p.length)){let x=Array.isArray(p)?p:[p];r&&this.locked.set(x,r),e.dispatch({effects:this.setHover.of(x)})}};if(o&&"then"in o){let p=this.pending={pos:t};o.then(x=>{this.pending==p&&(this.pending=null,c(x))},x=>Vi(e.state,x,"hover tooltip"))}else c(o)}get tooltip(){let e=this.view.plugin(jr),t=e?e.manager.tooltips.findIndex(n=>n.create==$r.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:o}=this;if(r.length&&!this.locked.has(r)&&o&&!function Ho(s,e){let c,{left:t,right:n,top:r,bottom:o}=s.getBoundingClientRect();if(c=s.querySelector(".cm-tooltip-arrow")){let p=c.getBoundingClientRect();r=Math.min(p.top,r),o=Math.max(p.bottom,o)}return e.clientX>=t-4&&e.clientX<=n+4&&e.clientY>=r-4&&e.clientY<=o+4}(o.dom,e)||this.pending){let{pos:c}=r[0]||this.pending,p=null!==(n=null===(t=r[0])||void 0===t?void 0:t.end)&&void 0!==n?n:c;(c==p?this.view.posAtCoords(this.lastMove)!=c:!function qo(s,e,t,n,r){let c=s.scrollDOM.getBoundingClientRect();if(c.left>n||c.right<n||c.top>r||Math.min(c.bottom,s.documentTop+s.documentPadding.top+s.contentHeight)<r)return!1;let x=s.posAtCoords({x:n,y:r},!1);return x>=e&&x<=t}(this.view,c,p,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:n}=this;n&&n.dom.contains(e.relatedTarget)?this.watchTooltipLeave(n.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function Xo(s,e={}){let t=j.Pe.define(),n=new WeakMap,r=j.sU.define({create:()=>[],update(c,p){let x=n.get(c);if(c.length&&(e.hideOnChange&&(p.docChanged||p.selection)||x&&x(p)?c=[]:e.hideOn&&(c=c.filter(E=>!e.hideOn(p,E)))),p.docChanged&&c.length){let E=[];for(let U of c){let te=p.changes.mapPos(U.pos,-1,j.iR.TrackDel);if(null!=te){let oe=Object.assign(Object.create(null),U);oe.pos=te,null!=oe.end&&(oe.end=p.changes.mapPos(oe.end)),E.push(oe)}}c=E}for(let E of p.effects)E.is(t)&&(c=E.value,x=void 0),(E.is(Ws)&&!E.value||E.value==r)&&(c=[]);return c.length&&x&&n.set(c,x),c},provide:c=>Fr.from(c)});const o=Ut.define(c=>new zo(c,s,r,n,t,e.hoverTime||300));return{active:r,extension:[r,o,Gs.of(o),$o]}}function Yo(s,e,t,n={}){var r;let o=s.state.facet(Gs).map(c=>s.plugin(c)).filter(c=>!!c);if(n.tooltip&&n.tooltip.active){let c=o.find(p=>p.field==n.tooltip.active);c&&(o=[c])}for(let c of o)c.activateHover(s,e,t,null!==(r=n.until)&&void 0!==r?r:()=>!1)}function Zo(s,e){let t=s.plugin(jr);if(!t)return null;let n=t.manager.tooltips.indexOf(e);return n<0?null:t.manager.tooltipViews[n]}const Ws=j.Pe.define(),cs=j.sj.define({combine(s){let e,t;for(let n of s)e=e||n.topContainer,t=t||n.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Vs(s,e){let t=s.plugin(Qs),n=t?t.specs.indexOf(e):-1;return n>-1?t.panels[n]:null}const Qs=Ut.fromClass(class{constructor(s){this.input=s.state.facet(qr),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(s));let e=s.state.facet(cs);this.top=new Hr(s,!0,e.topContainer),this.bottom=new Hr(s,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(s){let e=s.state.facet(cs);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Hr(s.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Hr(s.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=s.state.facet(qr);if(t!=this.input){let n=t.filter(x=>x),r=[],o=[],c=[],p=[];for(let x of n){let U,E=this.specs.indexOf(x);E<0?(U=x(s.view),p.push(U)):(U=this.panels[E],U.update&&U.update(s)),r.push(U),(U.top?o:c).push(U)}this.specs=n,this.panels=r,this.top.sync(o),this.bottom.sync(c);for(let x of p)x.dom.classList.add("cm-panel"),x.mount&&x.mount()}else for(let n of this.panels)n.update&&n.update(s)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:s=>cr.scrollMargins.of(e=>{let t=e.plugin(s);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Hr{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Us(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Us(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Us(s){let e=s.nextSibling;return s.remove(),e}const qr=j.sj.define({enables:Qs});function Ko(s,e){let t,n=new Promise(c=>t=c),r=c=>function Jo(s,e,t){let n=e.content?e.content(s,()=>c(null)):null;if(!n){if(n=(0,Ke.A)("form"),e.input){let p=(0,Ke.A)("input",e.input);/^(text|password|number|email|tel|url)$/.test(p.type)&&p.classList.add("cm-textfield"),p.name||(p.name="input"),n.appendChild((0,Ke.A)("label",(e.label||"")+": ",p))}else n.appendChild(document.createTextNode(e.label||""));n.appendChild(document.createTextNode(" ")),n.appendChild((0,Ke.A)("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let r="FORM"==n.nodeName?[n]:n.querySelectorAll("form");for(let p=0;p<r.length;p++){let x=r[p];x.addEventListener("keydown",E=>{27==E.keyCode?(E.preventDefault(),c(null)):13==E.keyCode&&(E.preventDefault(),c(x))}),x.addEventListener("submit",E=>{E.preventDefault(),c(x)})}let o=(0,Ke.A)("div",n,(0,Ke.A)("button",{onclick:()=>c(null),"aria-label":s.state.phrase("close"),class:"cm-dialog-close",type:"button"},["\xd7"]));function c(p){o.contains(o.ownerDocument.activeElement)&&s.focus(),t(p)}return e.class&&(o.className=e.class),o.classList.add("cm-dialog"),{dom:o,top:e.top,mount:()=>{if(e.focus){let p;p="string"==typeof e.focus?n.querySelector(e.focus):n.querySelector("input")||n.querySelector("button"),p&&"select"in p?p.select():p&&"focus"in p&&p.focus()}}}}(c,e,t);s.state.field(Xr,!1)?s.dispatch({effects:js.of(r)}):s.dispatch({effects:j.Pe.appendConfig.of(Xr.init(()=>[r]))});let o=$s.of(r);return{close:o,result:n.then(c=>((s.win.queueMicrotask||(x=>s.win.setTimeout(x,10)))(()=>{s.state.field(Xr).indexOf(r)>-1&&s.dispatch({effects:o})}),c))}}const Xr=j.sU.define({create:()=>[],update(s,e){for(let t of e.effects)t.is(js)?s=[t.value].concat(s):t.is($s)&&(s=s.filter(n=>n!=t.value));return s},provide:s=>qr.computeN([s],e=>e.field(s))}),js=j.Pe.define(),$s=j.Pe.define();class ur extends j.FB{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}ur.prototype.elementClass="",ur.prototype.toDOM=void 0,ur.prototype.mapMode=j.iR.TrackBefore,ur.prototype.startSide=ur.prototype.endSide=-1,ur.prototype.point=!0;const Yr=j.sj.define(),el=j.sj.define(),tl={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>j.om.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Ir=j.sj.define();function il(s){return[zs(),Ir.of({...tl,...s})]}const us=j.sj.define({combine:s=>s.some(e=>e)});function zs(s){let e=[nl];return s&&!1===s.fixed&&e.push(us.of(!0)),e}const nl=Ut.fromClass(class{constructor(s){this.view=s,this.domAfter=null,this.prevViewport=s.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=s.state.facet(Ir).map(e=>new qs(s,e)),this.fixed=!s.state.facet(us);for(let e of this.gutters)"after"==e.config.side?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),s.scrollDOM.insertBefore(this.dom,s.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(s){if(this.updateGutters(s)){let e=this.prevViewport,t=s.view.viewport,n=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(n<.8*(t.to-t.from))}if(s.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(us)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=s.view.viewport}syncGutters(s){let e=this.dom.nextSibling;s&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=j.om.iter(this.view.state.facet(Yr),this.view.viewport.from),n=[],r=this.gutters.map(o=>new rl(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(o.type)){let c=!0;for(let p of o.type)if(p.type==Kt.Text&&c){fs(t,n,p.from);for(let x of r)x.line(this.view,p,n);c=!1}else if(p.widget)for(let x of r)x.widget(this.view,p)}else if(o.type==Kt.Text){fs(t,n,o.from);for(let c of r)c.line(this.view,o,n)}else if(o.widget)for(let c of r)c.widget(this.view,o);for(let o of r)o.finish();s&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(s){let e=s.startState.facet(Ir),t=s.state.facet(Ir),n=s.docChanged||s.heightChanged||s.viewportChanged||!j.om.eq(s.startState.facet(Yr),s.state.facet(Yr),s.view.viewport.from,s.view.viewport.to);if(e==t)for(let r of this.gutters)r.update(s)&&(n=!0);else{n=!0;let r=[];for(let o of t){let c=e.indexOf(o);c<0?r.push(new qs(this.view,o)):(this.gutters[c].update(s),r.push(this.gutters[c]))}for(let o of this.gutters)o.dom.remove(),r.indexOf(o)<0&&o.destroy();for(let o of r)"after"==o.config.side?this.getDOMAfter().appendChild(o.dom):this.dom.appendChild(o.dom);this.gutters=r}return n}destroy(){for(let s of this.gutters)s.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:s=>cr.scrollMargins.of(e=>{let t=e.plugin(s);if(!t||0==t.gutters.length||!t.fixed)return null;let n=t.dom.offsetWidth*e.scaleX,r=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==f.LTR?{left:n,right:r}:{right:n,left:r}})});function Hs(s){return Array.isArray(s)?s:[s]}function fs(s,e,t){for(;s.value&&s.from<=t;)s.from==t&&e.push(s.value),s.next()}class rl{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=j.om.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,o=(t.top-this.height)/e.scaleY,c=t.height/e.scaleY;if(this.i==r.elements.length){let p=new Xs(e,c,o,n);r.elements.push(p),r.dom.appendChild(p.dom)}else r.elements[this.i].update(e,c,o,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];fs(this.cursor,r,t.from),n.length&&(r=r.concat(n));let o=this.gutter.config.lineMarker(e,t,r);o&&r.unshift(o),0==r.length&&!this.gutter.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let o of e.state.facet(el)){let c=o(e,t.widget,t);c&&(r||(r=[])).push(c)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class qs{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,r=>{let c,o=r.target;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let x=o.getBoundingClientRect();c=(x.top+x.bottom)/2}else c=r.clientY;let p=e.lineBlockAtHeight(c-e.documentTop);t.domEventHandlers[n](e,p,r)&&r.preventDefault()});this.markers=Hs(t.markers(e)),t.initialSpacer&&(this.spacer=new Xs(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Hs(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let n=e.view.viewport;return!j.om.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class Xs{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),function sl(s,e){if(s.length!=e.length)return!1;for(let t=0;t<s.length;t++)if(!s[t].compare(e[t]))return!1;return!0}(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n="cm-gutterElement",r=this.dom.firstChild;for(let o=0,c=0;;){let p=c,x=o<t.length?t[o++]:null,E=!1;if(x){let U=x.elementClass;U&&(n+=" "+U);for(let te=c;te<this.markers.length;te++)if(this.markers[te].compare(x)){p=te,E=!0;break}}else p=this.markers.length;for(;c<p;){let U=this.markers[c++];if(U.toDOM){U.destroy(r);let te=r.nextSibling;r.remove(),r=te}}if(!x)break;x.toDOM&&(E?r=r.nextSibling:this.dom.insertBefore(x.toDOM(e),r)),E&&c++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}}const ol=j.sj.define(),ll=j.sj.define(),Ar=j.sj.define({combine:s=>(0,j.QR)(s,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let r in t){let o=n[r],c=t[r];n[r]=o?(p,x,E)=>o(p,x,E)||c(p,x,E):c}return n}})});class ds extends ur{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function ps(s,e){return s.state.facet(Ar).formatNumber(e,s.state)}const al=Ir.compute([Ar],s=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(ol),lineMarker:(e,t,n)=>n.some(r=>r.toDOM)?null:new ds(ps(e,e.state.doc.lineAt(t.from).number)),widgetMarker:(e,t,n)=>{for(let r of e.state.facet(ll)){let o=r(e,t,n);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(Ar)!=e.state.facet(Ar),initialSpacer:e=>new ds(ps(e,Ys(e.state.doc.lines))),updateSpacer(e,t){let n=ps(t.view,Ys(t.view.state.doc.lines));return n==e.number?e:new ds(n)},domEventHandlers:s.facet(Ar).domEventHandlers,side:"before"}));function hl(s={}){return[Ar.of(s),zs(),al]}function Ys(s){let e=9;for(;e<s;)e=10*e+9;return e}const cl=new class extends ur{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},ul=Yr.compute(["selection"],s=>{let e=[],t=-1;for(let n of s.selection.ranges){let r=s.doc.lineAt(n.head).from;r>t&&(t=r,e.push(cl.range(r)))}return j.om.of(e)});function fl(){return ul}},2166(Ei,At,We){"use strict";We.d(At,{PH:()=>ae,Qj:()=>X,Z6:()=>Ye,cF:()=>j,fI:()=>Se,iX:()=>wt,rr:()=>Jt,uY:()=>le});const j=1024;let g=0;class R{constructor(k,M){this.from=k,this.to=M}}class le{constructor(k={}){this.id=g++,this.perNode=!!k.perNode,this.deserialize=k.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=k.combine||null}add(k){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof k&&(k=Ye.match(k)),M=>{let H=k(M);return void 0===H?null:[this,H]}}}le.closedBy=new le({deserialize:_e=>_e.split(" ")}),le.openedBy=new le({deserialize:_e=>_e.split(" ")}),le.group=new le({deserialize:_e=>_e.split(" ")}),le.isolate=new le({deserialize:_e=>{if(_e&&"rtl"!=_e&&"ltr"!=_e&&"auto"!=_e)throw new RangeError("Invalid value for isolate: "+_e);return _e||"auto"}}),le.contextHash=new le({perNode:!0}),le.lookAhead=new le({perNode:!0}),le.mounted=new le({perNode:!0});class Te{constructor(k,M,H,Y=!1){this.tree=k,this.overlay=M,this.parser=H,this.bracketed=Y}static get(k){return k&&k.props&&k.props[le.mounted.id]}}const Ve=Object.create(null);class Ye{constructor(k,M,H,Y=0){this.name=k,this.props=M,this.id=H,this.flags=Y}static define(k){let M=k.props&&k.props.length?Object.create(null):Ve,Y=new Ye(k.name||"",M,k.id,(k.top?1:0)|(k.skipped?2:0)|(k.error?4:0)|(null==k.name?8:0));if(k.props)for(let I of k.props)if(Array.isArray(I)||(I=I(Y)),I){if(I[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");M[I[0].id]=I[1]}return Y}prop(k){return this.props[k.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(k){if("string"==typeof k){if(this.name==k)return!0;let M=this.prop(le.group);return!!M&&M.indexOf(k)>-1}return this.id==k}static match(k){let M=Object.create(null);for(let H in k)for(let Y of H.split(" "))M[Y]=k[H];return H=>{for(let Y=H.prop(le.group),I=-1;I<(Y?Y.length:0);I++){let L=M[I<0?H.name:Y[I]];if(L)return L}}}}Ye.none=new Ye("",Object.create(null),0,8);class Se{constructor(k){this.types=k;for(let M=0;M<k.length;M++)if(k[M].id!=M)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...k){let M=[];for(let H of this.types){let Y=null;for(let I of k){let L=I(H);if(L){Y||(Y=Object.assign({},H.props));let K=L[1],J=L[0];J.combine&&J.id in Y&&(K=J.combine(Y[J.id],K)),Y[J.id]=K}}M.push(Y?new Ye(H.name,Y,H.id,H.flags):H)}return new Se(M)}}const ct=new WeakMap,Ke=new WeakMap;var X=function(_e){return _e[_e.ExcludeBuffers=1]="ExcludeBuffers",_e[_e.IncludeAnonymous=2]="IncludeAnonymous",_e[_e.IgnoreMounts=4]="IgnoreMounts",_e[_e.IgnoreOverlays=8]="IgnoreOverlays",_e[_e.EnterBracketed=16]="EnterBracketed",_e}(X||{});class ae{constructor(k,M,H,Y,I){if(this.type=k,this.children=M,this.positions=H,this.length=Y,this.props=null,I&&I.length){this.props=Object.create(null);for(let[L,K]of I)this.props["number"==typeof L?L:L.id]=K}}toString(){let k=Te.get(this);if(k&&!k.overlay)return k.tree.toString();let M="";for(let H of this.children){let Y=H.toString();Y&&(M&&(M+=","),M+=Y)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(M.length?"("+M+")":""):M}cursor(k=0){return new Yt(this.topNode,k)}cursorAt(k,M=0,H=0){let Y=ct.get(this)||this.topNode,I=new Yt(Y);return I.moveTo(k,M),ct.set(this,I._tree),I}get topNode(){return new Ct(this,0,0,null)}resolve(k,M=0){let H=dt(ct.get(this)||this.topNode,k,M,!1);return ct.set(this,H),H}resolveInner(k,M=0){let H=dt(Ke.get(this)||this.topNode,k,M,!0);return Ke.set(this,H),H}resolveStack(k,M=0){return function oi(_e,k,M){let H=_e.resolveInner(k,M),Y=null;for(let I=H instanceof Ct?H:H.context.parent;I;I=I.parent)if(I.index<0){let L=I.parent;(Y||(Y=[H])).push(L.resolve(k,M)),I=L}else{let L=Te.get(I.tree);if(L&&L.overlay&&L.overlay[0].from<=k&&L.overlay[L.overlay.length-1].to>=k){let K=new Ct(L.tree,L.overlay[0].from+I.from,-1,I);(Y||(Y=[H])).push(dt(K,k,M,!1))}}return Y?Nt(Y):H}(this,k,M)}iterate(k){let{enter:M,leave:H,from:Y=0,to:I=this.length}=k,L=k.mode||0,K=(L&X.IncludeAnonymous)>0;for(let J=this.cursor(L|X.IncludeAnonymous);;){let fe=!1;if(J.from<=I&&J.to>=Y&&(!K&&J.type.isAnonymous||!1!==M(J))){if(J.firstChild())continue;fe=!0}for(;fe&&H&&(K||!J.type.isAnonymous)&&H(J),!J.nextSibling();){if(!J.parent())return;fe=!0}}}prop(k){return k.perNode?this.props?this.props[k.id]:void 0:this.type.prop(k)}get propValues(){let k=[];if(this.props)for(let M in this.props)k.push([+M,this.props[M]]);return k}balance(k={}){return this.children.length<=8?this:It(Ye.none,this.children,this.positions,0,this.children.length,0,this.length,(M,H,Y)=>new ae(this.type,M,H,Y,this.propValues),k.makeTree||((M,H,Y)=>new ae(Ye.none,M,H,Y)))}static build(k){return function li(_e){var k;let{buffer:M,nodeSet:H,maxBufferLength:Y=j,reused:I=[],minRepeatType:L=H.types.length}=_e,K=Array.isArray(M)?new se(M,M.length):M,J=H.types,fe=0,Oe=0;function Le($e,lt,rt,mt,bt,ai){let{id:Tt,start:Rt,end:qt,size:zt}=K,hi=Oe,ki=fe;if(zt<0){if(K.next(),-1==zt)return rt.push(I[Tt]),void mt.push(Rt-$e);if(-3==zt)return void(fe=Tt);if(-4==zt)return void(Oe=Tt);throw new RangeError(`Unrecognized record size: ${zt}`)}let Ni,fi,yi=J[Tt],pi=Rt-$e;if(qt-Rt<=Y&&(fi=function m($e,lt){let rt=K.fork(),mt=0,bt=0,ai=0,Tt=rt.end-Y,Rt={size:0,start:0,skip:0};e:for(let qt=rt.pos-$e;rt.pos>qt;){let zt=rt.size;if(rt.id==lt&&zt>=0){Rt.size=mt,Rt.start=bt,Rt.skip=ai,ai+=4,mt+=4,rt.next();continue}let hi=rt.pos-zt;if(zt<0||hi<qt||rt.start<Tt)break;let ki=rt.id>=L?4:0,yi=rt.start;for(rt.next();rt.pos>hi;){if(rt.size<0){if(-3!=rt.size&&-4!=rt.size)break e;ki+=4}else rt.id>=L&&(ki+=4);rt.next()}bt=yi,mt+=zt,ai+=ki}return(lt<0||mt==$e)&&(Rt.size=mt,Rt.start=bt,Rt.skip=ai),Rt.size>4?Rt:void 0}(K.pos-lt,bt))){let di=new Uint16Array(fi.size-fi.skip),gi=K.pos-fi.size,xi=di.length;for(;K.pos>gi;)xi=V(fi.start,di,xi);Ni=new ge(di,qt-fi.start,H),pi=fi.start-$e}else{let di=K.pos-zt;K.next();let gi=[],xi=[],Di=Tt>=L?Tt:-1,Ii=0,vi=qt;for(;K.pos>di;)Di>=0&&K.id==Di&&K.size>=0?(K.end<=vi-Y&&(P(gi,xi,Rt,Ii,K.end,vi,Di,hi,ki),Ii=gi.length,vi=K.end),K.next()):ai>2500?Ee(Rt,di,gi,xi):Le(Rt,di,gi,xi,Di,ai+1);if(Di>=0&&Ii>0&&Ii<gi.length&&P(gi,xi,Rt,Ii,Rt,vi,Di,hi,ki),gi.reverse(),xi.reverse(),Di>-1&&Ii>0){let mi=function Ue($e,lt){return(rt,mt,bt)=>{let Rt,qt,ai=0,Tt=rt.length-1;if(Tt>=0&&(Rt=rt[Tt])instanceof ae){if(!Tt&&Rt.type==$e&&Rt.length==bt)return Rt;(qt=Rt.prop(le.lookAhead))&&(ai=mt[Tt]+Rt.length+qt)}return f($e,rt,mt,bt,ai,lt)}}(yi,ki);Ni=It(yi,gi,xi,0,gi.length,0,qt-Rt,mi,mi)}else Ni=f(yi,gi,xi,qt-Rt,hi-qt,ki)}rt.push(Ni),mt.push(pi)}function Ee($e,lt,rt,mt){let bt=[],ai=0,Tt=-1;for(;K.pos>lt;){let{id:Rt,start:qt,end:zt,size:hi}=K;if(hi>4)K.next();else{if(Tt>-1&&qt<Tt)break;Tt<0&&(Tt=zt-Y),bt.push(Rt,qt,zt),ai++,K.next()}}if(ai){let Rt=new Uint16Array(4*ai),qt=bt[bt.length-2];for(let zt=bt.length-3,hi=0;zt>=0;zt-=3)Rt[hi++]=bt[zt],Rt[hi++]=bt[zt+1]-qt,Rt[hi++]=bt[zt+2]-qt,Rt[hi++]=hi;rt.push(new ge(Rt,bt[2]-qt,H)),mt.push(qt-$e)}}function P($e,lt,rt,mt,bt,ai,Tt,Rt,qt){let zt=[],hi=[];for(;$e.length>mt;)zt.push($e.pop()),hi.push(lt.pop()+rt-bt);$e.push(f(H.types[Tt],zt,hi,ai-bt,Rt-ai,qt)),lt.push(bt-rt)}function f($e,lt,rt,mt,bt,ai,Tt){if(ai){let Rt=[le.contextHash,ai];Tt=Tt?[Rt].concat(Tt):[Rt]}if(bt>25){let Rt=[le.lookAhead,bt];Tt=Tt?[Rt].concat(Tt):[Rt]}return new ae($e,lt,rt,mt,Tt)}function V($e,lt,rt){let{id:mt,start:bt,end:ai,size:Tt}=K;if(K.next(),Tt>=0&&mt<L){let Rt=rt;if(Tt>4){let qt=K.pos-(Tt-4);for(;K.pos>qt;)rt=V($e,lt,rt)}lt[--rt]=Rt,lt[--rt]=ai-$e,lt[--rt]=bt-$e,lt[--rt]=mt}else-3==Tt?fe=mt:-4==Tt&&(Oe=mt);return rt}let ne=[],ue=[];for(;K.pos>0;)Le(_e.start||0,_e.bufferStart||0,ne,ue,-1,0);let Pe=null!==(k=_e.length)&&void 0!==k?k:ne.length?ue[0]+ne[0].length:0;return new ae(J[_e.topID],ne.reverse(),ue.reverse(),Pe)}(k)}}ae.empty=new ae(Ye.none,[],[],0);class se{constructor(k,M){this.buffer=k,this.index=M}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new se(this.buffer,this.index)}}class ge{constructor(k,M,H){this.buffer=k,this.length=M,this.set=H}get type(){return Ye.none}toString(){let k=[];for(let M=0;M<this.buffer.length;)k.push(this.childString(M)),M=this.buffer[M+3];return k.join(",")}childString(k){let H=this.buffer[k+3],Y=this.set.types[this.buffer[k]],I=Y.name;if(/\W/.test(I)&&!Y.isError&&(I=JSON.stringify(I)),H==(k+=4))return I;let L=[];for(;k<H;)L.push(this.childString(k)),k=this.buffer[k+3];return I+"("+L.join(",")+")"}findChild(k,M,H,Y,I){let{buffer:L}=this,K=-1;for(let J=k;J!=M&&!(we(I,Y,L[J+1],L[J+2])&&(K=J,H>0));J=L[J+3]);return K}slice(k,M,H){let Y=this.buffer,I=new Uint16Array(M-k),L=0;for(let K=k,J=0;K<M;){I[J++]=Y[K++],I[J++]=Y[K++]-H;let fe=I[J++]=Y[K++]-H;I[J++]=Y[K++]-k,L=Math.max(L,fe)}return new ge(I,L,this.set)}}function we(_e,k,M,H){switch(_e){case-2:return M<k;case-1:return H>=k&&M<k;case 0:return M<k&&H>k;case 1:return M<=k&&H>k;case 2:return H>k;case 4:return!0}}function dt(_e,k,M,H){for(var Y;_e.from==_e.to||(M<1?_e.from>=k:_e.from>k)||(M>-1?_e.to<=k:_e.to<k);){let L=!H&&_e instanceof Ct&&_e.index<0?null:_e.parent;if(!L)return _e;_e=L}let I=H?0:X.IgnoreOverlays;if(H)for(let L=_e,K=L.parent;K;L=K,K=L.parent)L instanceof Ct&&L.index<0&&(null===(Y=K.enter(k,M,I))||void 0===Y?void 0:Y.from)!=L.from&&(_e=K);for(;;){let L=_e.enter(k,M,I);if(!L)return _e;_e=L}}class ze{cursor(k=0){return new Yt(this,k)}getChild(k,M=null,H=null){let Y=Qt(this,k,M,H);return Y.length?Y[0]:null}getChildren(k,M=null,H=null){return Qt(this,k,M,H)}resolve(k,M=0){return dt(this,k,M,!1)}resolveInner(k,M=0){return dt(this,k,M,!0)}matchContext(k){return Wt(this.parent,k)}enterUnfinishedNodesBefore(k){let M=this.childBefore(k),H=this;for(;M;){let Y=M.lastChild;if(!Y||Y.to!=M.to)break;Y.type.isError&&Y.from==Y.to?(H=M,M=Y.prevSibling):M=Y}return H}get node(){return this}get next(){return this.parent}}class Ct extends ze{constructor(k,M,H,Y){super(),this._tree=k,this.from=M,this.index=H,this._parent=Y}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(k,M,H,Y,I=0){for(let L=this;;){for(let{children:K,positions:J}=L._tree,fe=M>0?K.length:-1;k!=fe;k+=M){let Ee,Oe=K[k],Le=J[k]+L.from;if(I&X.EnterBracketed&&Oe instanceof ae&&(Ee=Te.get(Oe))&&!Ee.overlay&&Ee.bracketed&&H>=Le&&H<=Le+Oe.length||we(Y,H,Le,Le+Oe.length))if(Oe instanceof ge){if(I&X.ExcludeBuffers)continue;let Ue=Oe.findChild(0,Oe.buffer.length,M,H-Le,Y);if(Ue>-1)return new He(new Mt(L,Oe,k,Le),null,Ue)}else if(I&X.IncludeAnonymous||!Oe.type.isAnonymous||Gt(Oe)){let Ue;if(!(I&X.IgnoreMounts)&&(Ue=Te.get(Oe))&&!Ue.overlay)return new Ct(Ue.tree,Le,k,L);let P=new Ct(Oe,Le,k,L);return I&X.IncludeAnonymous||!P.type.isAnonymous?P:P.nextChild(M<0?Oe.children.length-1:0,M,H,Y,I)}}if(I&X.IncludeAnonymous||!L.type.isAnonymous||(k=L.index>=0?L.index+M:M<0?-1:L._parent._tree.children.length,L=L._parent,!L))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(k){return this.nextChild(0,1,k,2)}childBefore(k){return this.nextChild(this._tree.children.length-1,-1,k,-2)}prop(k){return this._tree.prop(k)}enter(k,M,H=0){let Y;if(!(H&X.IgnoreOverlays)&&(Y=Te.get(this._tree))&&Y.overlay){let I=k-this.from,L=H&X.EnterBracketed&&Y.bracketed;for(let{from:K,to:J}of Y.overlay)if((M>0||L?K<=I:K<I)&&(M<0||L?J>=I:J>I))return new Ct(Y.tree,Y.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,k,M,H)}nextSignificantParent(){let k=this;for(;k.type.isAnonymous&&k._parent;)k=k._parent;return k}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Qt(_e,k,M,H){let Y=_e.cursor(),I=[];if(!Y.firstChild())return I;if(null!=M)for(let L=!1;!L;)if(L=Y.type.is(M),!Y.nextSibling())return I;for(;;){if(null!=H&&Y.type.is(H))return I;if(Y.type.is(k)&&I.push(Y.node),!Y.nextSibling())return null==H?I:[]}}function Wt(_e,k,M=k.length-1){for(let H=_e;M>=0;H=H.parent){if(!H)return!1;if(!H.type.isAnonymous){if(k[M]&&k[M]!=H.name)return!1;M--}}return!0}class Mt{constructor(k,M,H,Y){this.parent=k,this.buffer=M,this.index=H,this.start=Y}}class He extends ze{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(k,M,H){super(),this.context=k,this._parent=M,this.index=H,this.type=k.buffer.set.types[k.buffer.buffer[H]]}child(k,M,H){let{buffer:Y}=this.context,I=Y.findChild(this.index+4,Y.buffer[this.index+3],k,M-this.context.start,H);return I<0?null:new He(this.context,this,I)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(k){return this.child(1,k,2)}childBefore(k){return this.child(-1,k,-2)}prop(k){return this.type.prop(k)}enter(k,M,H=0){if(H&X.ExcludeBuffers)return null;let{buffer:Y}=this.context,I=Y.findChild(this.index+4,Y.buffer[this.index+3],M>0?1:-1,k-this.context.start,M);return I<0?null:new He(this.context,this,I)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(k){return this._parent?null:this.context.parent.nextChild(this.context.index+k,k,0,4)}get nextSibling(){let{buffer:k}=this.context,M=k.buffer[this.index+3];return M<(this._parent?k.buffer[this._parent.index+3]:k.buffer.length)?new He(this.context,this._parent,M):this.externalSibling(1)}get prevSibling(){let{buffer:k}=this.context,M=this._parent?this._parent.index+4:0;return this.index==M?this.externalSibling(-1):new He(this.context,this._parent,k.findChild(M,this.index,-1,0,4))}get tree(){return null}toTree(){let k=[],M=[],{buffer:H}=this.context,Y=this.index+4,I=H.buffer[this.index+3];return I>Y&&(k.push(H.slice(Y,I,H.buffer[this.index+1])),M.push(0)),new ae(this.type,k,M,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Nt(_e){if(!_e.length)return null;let k=0,M=_e[0];for(let I=1;I<_e.length;I++){let L=_e[I];(L.from>M.from||L.to<M.to)&&(M=L,k=I)}let H=M instanceof Ct&&M.index<0?null:M.parent,Y=_e.slice();return H?Y[k]=H:Y.splice(k,1),new ri(Y,M)}class ri{constructor(k,M){this.heads=k,this.node=M}get next(){return Nt(this.heads)}}class Yt{get name(){return this.type.name}constructor(k,M=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=M&~X.EnterBracketed,k instanceof Ct)this.yieldNode(k);else{this._tree=k.context.parent,this.buffer=k.context;for(let H=k._parent;H;H=H._parent)this.stack.unshift(H.index);this.bufferNode=k,this.yieldBuf(k.index)}}yieldNode(k){return!!k&&(this._tree=k,this.type=k.type,this.from=k.from,this.to=k.to,!0)}yieldBuf(k,M){this.index=k;let{start:H,buffer:Y}=this.buffer;return this.type=M||Y.set.types[Y.buffer[k]],this.from=H+Y.buffer[k+1],this.to=H+Y.buffer[k+2],!0}yield(k){return!!k&&(k instanceof Ct?(this.buffer=null,this.yieldNode(k)):(this.buffer=k.context,this.yieldBuf(k.index,k.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(k,M,H){if(!this.buffer)return this.yield(this._tree.nextChild(k<0?this._tree._tree.children.length-1:0,k,M,H,this.mode));let{buffer:Y}=this.buffer,I=Y.findChild(this.index+4,Y.buffer[this.index+3],k,M-this.buffer.start,H);return!(I<0)&&(this.stack.push(this.index),this.yieldBuf(I))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(k){return this.enterChild(1,k,2)}childBefore(k){return this.enterChild(-1,k,-2)}enter(k,M,H=this.mode){return this.buffer?!(H&X.ExcludeBuffers)&&this.enterChild(1,k,M):this.yield(this._tree.enter(k,M,H))}parent(){if(!this.buffer)return this.yieldNode(this.mode&X.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let k=this.mode&X.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(k)}sibling(k){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+k,k,0,4,this.mode));let{buffer:M}=this.buffer,H=this.stack.length-1;if(k<0){let Y=H<0?0:this.stack[H]+4;if(this.index!=Y)return this.yieldBuf(M.findChild(Y,this.index,-1,0,4))}else{let Y=M.buffer[this.index+3];if(Y<(H<0?M.buffer.length:M.buffer[this.stack[H]+3]))return this.yieldBuf(Y)}return H<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+k,k,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(k){let M,H,{buffer:Y}=this;if(Y){if(k>0){if(this.index<Y.buffer.buffer.length)return!1}else for(let I=0;I<this.index;I++)if(Y.buffer.buffer[I+3]<this.index)return!1;({index:M,parent:H}=Y)}else({index:M,_parent:H}=this._tree);for(;H;({index:M,_parent:H}=H))if(M>-1)for(let I=M+k,L=k<0?-1:H._tree.children.length;I!=L;I+=k){let K=H._tree.children[I];if(this.mode&X.IncludeAnonymous||K instanceof ge||!K.type.isAnonymous||Gt(K))return!1}return!0}move(k,M){if(M&&this.enterChild(k,0,4))return!0;for(;;){if(this.sibling(k))return!0;if(this.atLastNode(k)||!this.parent())return!1}}next(k=!0){return this.move(1,k)}prev(k=!0){return this.move(-1,k)}moveTo(k,M=0){for(;(this.from==this.to||(M<1?this.from>=k:this.from>k)||(M>-1?this.to<=k:this.to<k))&&this.parent(););for(;this.enterChild(1,k,M););return this}get node(){if(!this.buffer)return this._tree;let k=this.bufferNode,M=null,H=0;if(k&&k.context==this.buffer)e:for(let Y=this.index,I=this.stack.length;I>=0;){for(let L=k;L;L=L._parent)if(L.index==Y){if(Y==this.index)return L;M=L,H=I+1;break e}Y=this.stack[--I]}for(let Y=H;Y<this.stack.length;Y++)M=new He(this.buffer,M,this.stack[Y]);return this.bufferNode=new He(this.buffer,M,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(k,M){for(let H=0;;){let Y=!1;if(this.type.isAnonymous||!1!==k(this)){if(this.firstChild()){H++;continue}this.type.isAnonymous||(Y=!0)}for(;;){if(Y&&M&&M(this),Y=this.type.isAnonymous,!H)return;if(this.nextSibling())break;this.parent(),H--,Y=!0}}}matchContext(k){if(!this.buffer)return Wt(this.node.parent,k);let{buffer:M}=this.buffer,{types:H}=M.set;for(let Y=k.length-1,I=this.stack.length-1;Y>=0;I--){if(I<0)return Wt(this._tree,k,Y);let L=H[M.buffer[this.stack[I]]];if(!L.isAnonymous){if(k[Y]&&k[Y]!=L.name)return!1;Y--}}return!0}}function Gt(_e){return _e.children.some(k=>k instanceof ge||!k.type.isAnonymous||Gt(k))}const ci=new WeakMap;function Kt(_e,k){if(!_e.isAnonymous||k instanceof ge||k.type!=_e)return 1;let M=ci.get(k);if(null==M){M=1;for(let H of k.children){if(H.type!=_e||!(H instanceof ae)){M=1;break}M+=Kt(_e,H)}ci.set(k,M)}return M}function It(_e,k,M,H,Y,I,L,K,J){let fe=0;for(let P=H;P<Y;P++)fe+=Kt(_e,k[P]);let Oe=Math.ceil(1.5*fe/8),Le=[],Ee=[];return function Ue(P,f,m,V,ne){for(let ue=m;ue<V;){let Pe=ue,$e=f[ue],lt=Kt(_e,P[ue]);for(ue++;ue<V;ue++){let rt=Kt(_e,P[ue]);if(lt+rt>=Oe)break;lt+=rt}if(ue==Pe+1){if(lt>Oe){let rt=P[Pe];Ue(rt.children,rt.positions,0,rt.children.length,f[Pe]+ne);continue}Le.push(P[Pe])}else Le.push(It(_e,P,f,Pe,ue,$e,f[ue-1]+P[ue-1].length-$e,null,J));Ee.push($e+ne-I)}}(k,M,H,Y,0),(K||J)(Le,Ee,L)}class Jt{constructor(k,M,H,Y,I=!1,L=!1){this.from=k,this.to=M,this.tree=H,this.offset=Y,this.open=(I?1:0)|(L?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(k,M=[],H=!1){let Y=[new Jt(0,k.length,k,0,!1,H)];for(let I of M)I.to>k.length&&Y.push(I);return Y}static applyChanges(k,M,H=128){if(!M.length)return k;let Y=[],I=1,L=k.length?k[0]:null;for(let K=0,J=0,fe=0;;K++){let Oe=K<M.length?M[K]:null,Le=Oe?Oe.fromA:1e9;if(Le-J>=H)for(;L&&L.from<Le;){let Ee=L;if(J>=Ee.from||Le<=Ee.to||fe){let Ue=Math.max(Ee.from,J)-fe,P=Math.min(Ee.to,Le)-fe;Ee=Ue>=P?null:new Jt(Ue,P,Ee.tree,Ee.offset+fe,K>0,!!Oe)}if(Ee&&Y.push(Ee),L.to>Le)break;L=I<k.length?k[I++]:null}if(!Oe)break;J=Oe.toA,fe=Oe.toA-Oe.toB}return Y}}class wt{startParse(k,M,H){return"string"==typeof k&&(k=new Ne(k)),H=H?H.length?H.map(Y=>new R(Y.from,Y.to)):[new R(0,0)]:[new R(0,k.length)],this.createParse(k,M||[],H)}parse(k,M,H){let Y=this.startParse(k,M,H);for(;;){let I=Y.advance();if(I)return I}}}class Ne{constructor(k){this.string=k}get length(){return this.string.length}chunk(k){return this.string.slice(k)}get lineChunks(){return!1}read(k,M){return this.string.slice(k,M)}}new le({perNode:!0})},9125(Ei,At,We){"use strict";We.d(At,{DM:()=>se,_A:()=>vt,az:()=>X,pn:()=>Se});var j=We(2166);let g=0;class R{constructor(Ne,me,de,pe){this.name=Ne,this.set=me,this.base=de,this.modified=pe,this.id=g++}toString(){let{name:Ne}=this;for(let me of this.modified)me.name&&(Ne=`${me.name}(${Ne})`);return Ne}static define(Ne,me){let de="string"==typeof Ne?Ne:"?";if(Ne instanceof R&&(me=Ne),me?.base)throw new Error("Can not derive from a modified tag");let pe=new R(de,[],null,[]);if(pe.set.push(pe),me)for(let Ie of me.set)pe.set.push(Ie);return pe}static defineModifier(Ne){let me=new Te(Ne);return de=>de.modified.indexOf(me)>-1?de:Te.get(de.base||de,de.modified.concat(me).sort((pe,Ie)=>pe.id-Ie.id))}}let le=0;class Te{constructor(Ne){this.name=Ne,this.instances=[],this.id=le++}static get(Ne,me){if(!me.length)return Ne;let de=me[0].instances.find(it=>it.base==Ne&&function Ve(wt,Ne){return wt.length==Ne.length&&wt.every((me,de)=>me==Ne[de])}(me,it.modified));if(de)return de;let pe=[],Ie=new R(Ne.name,pe,Ne,me);for(let it of me)it.instances.push(Ie);let Ae=function Ye(wt){let Ne=[[]];for(let me=0;me<wt.length;me++)for(let de=0,pe=Ne.length;de<pe;de++)Ne.push(Ne[de].concat(wt[me]));return Ne.sort((me,de)=>de.length-me.length)}(me);for(let it of Ne.set)if(!it.modified.length)for(let Je of Ae)pe.push(Te.get(it,Je));return Ie}}function Se(wt){let Ne=Object.create(null);for(let me in wt){let de=wt[me];Array.isArray(de)||(de=[de]);for(let pe of me.split(" "))if(pe){let Ie=[],Ae=2,it=pe;for(let at=0;;){if("..."==it&&at>0&&at+3==pe.length){Ae=1;break}let St=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(it);if(!St)throw new RangeError("Invalid path: "+pe);if(Ie.push("*"==St[0]?"":'"'==St[0][0]?JSON.parse(St[0]):St[0]),at+=St[0].length,at==pe.length)break;let kt=pe[at++];if(at==pe.length&&"!"==kt){Ae=0;break}if("/"!=kt)throw new RangeError("Invalid path: "+pe);it=pe.slice(at)}let Je=Ie.length-1,qe=Ie[Je];if(!qe)throw new RangeError("Invalid path: "+pe);let Pt=new Ke(de,Ae,Je>0?Ie.slice(0,Je):null);Ne[qe]=Pt.sort(Ne[qe])}}return ct.add(Ne)}const ct=new j.uY({combine(wt,Ne){let me,de,pe;for(;wt||Ne;){if(!wt||Ne&&wt.depth>=Ne.depth?(pe=Ne,Ne=Ne.next):(pe=wt,wt=wt.next),me&&me.mode==pe.mode&&!pe.context&&!me.context)continue;let Ie=new Ke(pe.tags,pe.mode,pe.context);me?me.next=Ie:de=Ie,me=Ie}return de}});class Ke{constructor(Ne,me,de,pe){this.tags=Ne,this.mode=me,this.context=de,this.next=pe}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(Ne){return!Ne||Ne.depth<this.depth?(this.next=Ne,this):(Ne.next=this.sort(Ne.next),Ne)}get depth(){return this.context?this.context.length:0}}function X(wt,Ne){let me=Object.create(null);for(let Ie of wt)if(Array.isArray(Ie.tag))for(let Ae of Ie.tag)me[Ae.id]=Ie.class;else me[Ie.tag.id]=Ie.class;let{scope:de,all:pe=null}=Ne||{};return{style:Ie=>{let Ae=pe;for(let it of Ie)for(let Je of it.set){let qe=me[Je.id];if(qe){Ae=Ae?Ae+" "+qe:qe;break}}return Ae},scope:de}}function se(wt,Ne,me,de=0,pe=wt.length){let Ie=new we(de,Array.isArray(Ne)?Ne:[Ne],me);Ie.highlightRange(wt.cursor(),de,pe,"",Ie.highlighters),Ie.flush(pe)}Ke.empty=new Ke([],2,null);class we{constructor(Ne,me,de){this.at=Ne,this.highlighters=me,this.span=de,this.class=""}startSpan(Ne,me){me!=this.class&&(this.flush(Ne),Ne>this.at&&(this.at=Ne),this.class=me)}flush(Ne){Ne>this.at&&this.class&&this.span(this.at,Ne,this.class)}highlightRange(Ne,me,de,pe,Ie){let{type:Ae,from:it,to:Je}=Ne;if(it>=de||Je<=me)return;Ae.isTop&&(Ie=this.highlighters.filter(kt=>!kt.scope||kt.scope(Ae)));let qe=pe,Pt=function dt(wt){let Ne=wt.type.prop(ct);for(;Ne&&Ne.context&&!wt.matchContext(Ne.context);)Ne=Ne.next;return Ne||null}(Ne)||Ke.empty,at=function ae(wt,Ne){let me=null;for(let de of wt){let pe=de.style(Ne);pe&&(me=me?me+" "+pe:pe)}return me}(Ie,Pt.tags);if(at&&(qe&&(qe+=" "),qe+=at,1==Pt.mode&&(pe+=(pe?" ":"")+at)),this.startSpan(Math.max(me,it),qe),Pt.opaque)return;let St=Ne.tree&&Ne.tree.prop(j.uY.mounted);if(St&&St.overlay){let kt=Ne.node.enter(St.overlay[0].from+it,1),Et=this.highlighters.filter(_e=>!_e.scope||_e.scope(St.tree.type)),Lt=Ne.firstChild();for(let _e=0,k=it;;_e++){let M=_e<St.overlay.length?St.overlay[_e]:null,H=M?M.from+it:Je,Y=Math.max(me,k),I=Math.min(de,H);if(Y<I&&Lt)for(;Ne.from<I&&(this.highlightRange(Ne,Y,I,pe,Ie),this.startSpan(Math.min(I,Ne.to),qe),!(Ne.to>=H)&&Ne.nextSibling()););if(!M||H>de)break;k=M.to+it,k>me&&(this.highlightRange(kt.cursor(),Math.max(me,M.from+it),Math.min(de,k),"",Et),this.startSpan(Math.min(de,k),qe))}Lt&&Ne.parent()}else if(Ne.firstChild()){St&&(pe="");do{if(!(Ne.to<=me)){if(Ne.from>=de)break;this.highlightRange(Ne,me,de,pe,Ie),this.startSpan(Math.min(de,Ne.to),qe)}}while(Ne.nextSibling());Ne.parent()}}}const ze=R.define,Ct=ze(),Qt=ze(),Wt=ze(Qt),Mt=ze(Qt),He=ze(),Nt=ze(He),ri=ze(He),oi=ze(),Yt=ze(oi),Gt=ze(),li=ze(),ci=ze(),Kt=ze(ci),It=ze(),vt={comment:Ct,lineComment:ze(Ct),blockComment:ze(Ct),docComment:ze(Ct),name:Qt,variableName:ze(Qt),typeName:Wt,tagName:ze(Wt),propertyName:Mt,attributeName:ze(Mt),className:ze(Qt),labelName:ze(Qt),namespace:ze(Qt),macroName:ze(Qt),literal:He,string:Nt,docString:ze(Nt),character:ze(Nt),attributeValue:ze(Nt),number:ri,integer:ze(ri),float:ze(ri),bool:ze(He),regexp:ze(He),escape:ze(He),color:ze(He),url:ze(He),keyword:Gt,self:ze(Gt),null:ze(Gt),atom:ze(Gt),unit:ze(Gt),modifier:ze(Gt),operatorKeyword:ze(Gt),controlKeyword:ze(Gt),definitionKeyword:ze(Gt),moduleKeyword:ze(Gt),operator:li,derefOperator:ze(li),arithmeticOperator:ze(li),logicOperator:ze(li),bitwiseOperator:ze(li),compareOperator:ze(li),updateOperator:ze(li),definitionOperator:ze(li),typeOperator:ze(li),controlOperator:ze(li),punctuation:ci,separator:ze(ci),bracket:Kt,angleBracket:ze(Kt),squareBracket:ze(Kt),paren:ze(Kt),brace:ze(Kt),content:oi,heading:Yt,heading1:ze(Yt),heading2:ze(Yt),heading3:ze(Yt),heading4:ze(Yt),heading5:ze(Yt),heading6:ze(Yt),contentSeparator:ze(oi),list:ze(oi),quote:ze(oi),emphasis:ze(oi),strong:ze(oi),link:ze(oi),monospace:ze(oi),strikethrough:ze(oi),inserted:ze(),deleted:ze(),changed:ze(),invalid:ze(),meta:It,documentMeta:ze(It),annotation:ze(It),processingInstruction:ze(It),definition:R.defineModifier("definition"),constant:R.defineModifier("constant"),function:R.defineModifier("function"),standard:R.defineModifier("standard"),local:R.defineModifier("local"),special:R.defineModifier("special")};for(let wt in vt){let Ne=vt[wt];Ne instanceof R&&(Ne.name=wt)}X([{tag:vt.link,class:"tok-link"},{tag:vt.heading,class:"tok-heading"},{tag:vt.emphasis,class:"tok-emphasis"},{tag:vt.strong,class:"tok-strong"},{tag:vt.keyword,class:"tok-keyword"},{tag:vt.atom,class:"tok-atom"},{tag:vt.bool,class:"tok-bool"},{tag:vt.url,class:"tok-url"},{tag:vt.labelName,class:"tok-labelName"},{tag:vt.inserted,class:"tok-inserted"},{tag:vt.deleted,class:"tok-deleted"},{tag:vt.literal,class:"tok-literal"},{tag:vt.string,class:"tok-string"},{tag:vt.number,class:"tok-number"},{tag:[vt.regexp,vt.escape,vt.special(vt.string)],class:"tok-string2"},{tag:vt.variableName,class:"tok-variableName"},{tag:vt.local(vt.variableName),class:"tok-variableName tok-local"},{tag:vt.definition(vt.variableName),class:"tok-variableName tok-definition"},{tag:vt.special(vt.variableName),class:"tok-variableName2"},{tag:vt.definition(vt.propertyName),class:"tok-propertyName tok-definition"},{tag:vt.typeName,class:"tok-typeName"},{tag:vt.namespace,class:"tok-namespace"},{tag:vt.className,class:"tok-className"},{tag:vt.macroName,class:"tok-macroName"},{tag:vt.propertyName,class:"tok-propertyName"},{tag:vt.operator,class:"tok-operator"},{tag:vt.comment,class:"tok-comment"},{tag:vt.meta,class:"tok-meta"},{tag:vt.invalid,class:"tok-invalid"},{tag:vt.punctuation,class:"tok-punctuation"}])},1771(Ei,At,We){"use strict";We.d(At,{oQ:()=>tr});var j=We(3161),g=We(1380),R=We(5759),le=We(9131),Te=We(4937);const Ve="function"==typeof String.prototype.normalize?w=>w.normalize("NFKD"):w=>w;class Ye{constructor(h,y,_=0,F=h.length,Z,he){this.test=he,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=h.iterRange(_,F),this.bufferStart=_,this.normalize=Z?ye=>Z(Ve(ye)):Ve,this.query=this.normalize(y)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return(0,g.vS)(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let h=this.peek();if(h<0)return this.done=!0,this;let y=(0,g.MK)(h),_=this.bufferStart+this.bufferPos;this.bufferPos+=(0,g.Fh)(h);let F=this.normalize(y);if(F.length)for(let Z=0,he=_,ye=!0;;Z++){let be=F.charCodeAt(Z),ut=this.match(be,he,ye,this.bufferPos+this.bufferStart,Z==F.length-1);if(ut)return this.value=ut,this;if(Z==F.length-1)break;ye&&Z<y.length&&y.charCodeAt(Z)==be?he++:ye=!1}}}match(h,y,_,F,Z){let he=null;for(let ye=0;ye<this.matches.length;){let be=this.matches[ye],ut=!1;this.query.charCodeAt(be.index)==h&&(be.index==this.query.length-1?he={from:be.from,to:F,precise:Z&&be.precise}:(be.index++,ut=!0)),ut?ye++:this.matches.splice(ye,1)}return this.query.charCodeAt(0)==h&&(1==this.query.length?he={from:y,to:F,precise:_&&Z}:this.matches.push({from:y,index:1,precise:_})),he&&this.test&&!this.test(he.from,he.to,this.buffer,this.bufferStart)&&(he=null),he}}typeof Symbol<"u"&&(Ye.prototype[Symbol.iterator]=function(){return this});const Se={from:-1,to:-1,match:/.*/.exec(""),precise:!0},ct="gm"+(null==/x/.unicode?"":"u");class Ke{constructor(h,y,_,F=0,Z=h.length){if(this.text=h,this.to=Z,this.curLine="",this.done=!1,this.value=Se,/\\[sWDnr]|\n|\r|\[\^/.test(y))return new se(h,y,_,F,Z);this.re=new RegExp(y,ct+(_?.ignoreCase?"i":"")),this.test=_?.test,this.iter=h.iter();let he=h.lineAt(F);this.curLineStart=he.from,this.matchPos=we(h,F),this.getLine(this.curLineStart)}getLine(h){this.iter.next(h),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let h=this.matchPos-this.curLineStart;;){this.re.lastIndex=h;let y=this.matchPos<=this.to&&this.re.exec(this.curLine);if(y){let _=this.curLineStart+y.index,F=_+y[0].length;if(this.matchPos=we(this.text,F+(_==F?1:0)),_==this.curLineStart+this.curLine.length&&this.nextLine(),(_<F||_>this.value.to)&&(!this.test||this.test(_,F,y)))return this.value={from:_,to:F,precise:!0,match:y},this;h=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),h=0}}}}const X=new WeakMap;class ae{constructor(h,y){this.from=h,this.text=y}get to(){return this.from+this.text.length}static get(h,y,_){let F=X.get(h);if(!F||F.from>=_||F.to<=y){let ye=new ae(y,h.sliceString(y,_));return X.set(h,ye),ye}if(F.from==y&&F.to==_)return F;let{text:Z,from:he}=F;return he>y&&(Z=h.sliceString(y,he)+Z,he=y),F.to<_&&(Z+=h.sliceString(F.to,_)),X.set(h,new ae(he,Z)),new ae(y,Z.slice(y-he,_-he))}}class se{constructor(h,y,_,F,Z){this.text=h,this.to=Z,this.done=!1,this.value=Se,this.matchPos=we(h,F),this.re=new RegExp(y,ct+(_?.ignoreCase?"i":"")),this.test=_?.test,this.flat=ae.get(h,F,this.chunkEnd(F+5e3))}chunkEnd(h){return h>=this.to?this.to:this.text.lineAt(h).to}next(){for(;;){let h=this.re.lastIndex=this.matchPos-this.flat.from,y=this.re.exec(this.flat.text);if(y&&!y[0]&&y.index==h&&(this.re.lastIndex=h+1,y=this.re.exec(this.flat.text)),y){let _=this.flat.from+y.index,F=_+y[0].length;if((this.flat.to>=this.to||y.index+y[0].length<=this.flat.text.length-10)&&(!this.test||this.test(_,F,y)))return this.value={from:_,to:F,precise:!0,match:y},this.matchPos=we(this.text,F+(_==F?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=ae.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function we(w,h){if(h>=w.length)return h;let _,y=w.lineAt(h);for(;h<y.to&&(_=y.text.charCodeAt(h-y.from))>=56320&&_<57344;)h++;return h}typeof Symbol<"u"&&(Ke.prototype[Symbol.iterator]=se.prototype[Symbol.iterator]=function(){return this});const ze={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Ct=g.sj.define({combine:w=>(0,g.QR)(w,ze,{highlightWordAroundCursor:(h,y)=>h||y,minSelectionLength:Math.min,maxMatches:Math.min})}),Wt=j.NZ.mark({class:"cm-selectionMatch"}),Mt=j.NZ.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function He(w,h,y,_){return!(0!=y&&w(h.sliceDoc(y-1,y))==g.Je.Word||_!=h.doc.length&&w(h.sliceDoc(_,_+1))==g.Je.Word)}const ri=j.Z9.fromClass(class{constructor(w){this.decorations=this.getDeco(w)}update(w){(w.selectionSet||w.docChanged||w.viewportChanged)&&(this.decorations=this.getDeco(w.view))}getDeco(w){let h=w.state.facet(Ct),{state:y}=w,_=y.selection;if(_.ranges.length>1)return j.NZ.none;let Z,F=_.main,he=null;if(F.empty){if(!h.highlightWordAroundCursor)return j.NZ.none;let be=y.wordAt(F.head);if(!be)return j.NZ.none;he=y.charCategorizer(F.head),Z=y.sliceDoc(be.from,be.to)}else{let be=F.to-F.from;if(be<h.minSelectionLength||be>200)return j.NZ.none;if(h.wholeWords){if(Z=y.sliceDoc(F.from,F.to),he=y.charCategorizer(F.head),!He(he,y,F.from,F.to)||!function Nt(w,h,y,_){return w(h.sliceDoc(y,y+1))==g.Je.Word&&w(h.sliceDoc(_-1,_))==g.Je.Word}(he,y,F.from,F.to))return j.NZ.none}else if(Z=y.sliceDoc(F.from,F.to),!Z)return j.NZ.none}let ye=[];for(let be of w.visibleRanges){let ut=new Ye(y.doc,Z,be.from,be.to);for(;!ut.next().done;){let{from:nt,to:xt}=ut.value;if((!he||He(he,y,nt,xt))&&(F.empty&&nt<=F.from&&xt>=F.to?ye.push(Mt.range(nt,xt)):(nt>=F.to||xt<=F.from)&&ye.push(Wt.range(nt,xt)),ye.length>h.maxMatches))return j.NZ.none}}return j.NZ.set(ye)}},{decorations:w=>w.decorations}),oi=j.Lz.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),ci=g.sj.define({combine:w=>(0,g.QR)(w,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:h=>new m(h),scrollToMatch:h=>j.Lz.scrollIntoView(h)})});class It{constructor(h){this.search=h.search,this.caseSensitive=!!h.caseSensitive,this.literal=!!h.literal,this.regexp=!!h.regexp,this.replace=h.replace||"",this.valid=!!this.search&&(!this.regexp||function ge(w){try{return new RegExp(w,ct),!0}catch{return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!h.wholeWord,this.test=h.test}unquote(h){return this.literal?h:h.replace(/\\([nrt\\])/g,(y,_)=>"n"==_?"\n":"r"==_?"\r":"t"==_?"\t":"\\")}eq(h){return this.search==h.search&&this.replace==h.replace&&this.caseSensitive==h.caseSensitive&&this.regexp==h.regexp&&this.wholeWord==h.wholeWord&&this.test==h.test}create(){return this.regexp?new Je(this):new me(this)}getCursor(h,y=0,_){let F=h.doc?h:g.$t.create({doc:h});return null==_&&(_=F.doc.length),this.regexp?pe(this,F,y,_):wt(this,F,y,_)}}class vt{constructor(h){this.spec=h}}function wt(w,h,y,_){let F;return w.wholeWord&&(F=function Ne(w,h){return(y,_,F,Z)=>((Z>y||Z+F.length<_)&&(Z=Math.max(0,y-2),F=w.sliceString(Z,Math.min(w.length,_+2))),!(h(Ie(F,y-Z))==g.Je.Word&&h(Ae(F,y-Z))==g.Je.Word||h(Ae(F,_-Z))==g.Je.Word&&h(Ie(F,_-Z))==g.Je.Word))}(h.doc,h.charCategorizer(h.selection.main.head))),w.test&&(F=function Jt(w,h,y){return(_,F,Z,he)=>{if(y&&!y(_,F,Z,he))return!1;let ye=_>=he&&F<=he+Z.length?Z.slice(_-he,F-he):h.doc.sliceString(_,F);return w(ye,h,_,F)}}(w.test,h,F)),new Ye(h.doc,w.unquoted,y,_,w.caseSensitive?void 0:Z=>Z.toLowerCase(),F)}class me extends vt{constructor(h){super(h)}nextMatch(h,y,_){let F=wt(this.spec,h,_,h.doc.length).nextOverlapping();if(F.done){let Z=Math.min(h.doc.length,y+this.spec.unquoted.length);F=wt(this.spec,h,0,Z).nextOverlapping()}return F.done||F.value.from==y&&F.value.to==_?null:F.value}prevMatchInRange(h,y,_){for(let F=_;;){let Z=Math.max(y,F-1e4-this.spec.unquoted.length),he=wt(this.spec,h,Z,F),ye=null;for(;!he.nextOverlapping().done;)ye=he.value;if(ye)return ye;if(Z==y)return null;F-=1e4}}prevMatch(h,y,_){let F=this.prevMatchInRange(h,0,y);return F||(F=this.prevMatchInRange(h,Math.max(0,_-this.spec.unquoted.length),h.doc.length)),!F||F.from==y&&F.to==_?null:F}getReplacement(h){return this.spec.unquote(this.spec.replace)}matchAll(h,y){let _=wt(this.spec,h,0,h.doc.length),F=[];for(;!_.next().done;){if(F.length>=y)return null;F.push(_.value)}return F}highlight(h,y,_,F){let Z=wt(this.spec,h,Math.max(0,y-this.spec.unquoted.length),Math.min(_+this.spec.unquoted.length,h.doc.length));for(;!Z.next().done;)F(Z.value.from,Z.value.to)}}function pe(w,h,y,_){let F;return w.wholeWord&&(F=function it(w){return(h,y,_)=>!_[0].length||(w(Ie(_.input,_.index))!=g.Je.Word||w(Ae(_.input,_.index))!=g.Je.Word)&&(w(Ae(_.input,_.index+_[0].length))!=g.Je.Word||w(Ie(_.input,_.index+_[0].length))!=g.Je.Word)}(h.charCategorizer(h.selection.main.head))),w.test&&(F=function de(w,h,y){return(_,F,Z)=>(!y||y(_,F,Z))&&w(Z[0],h,_,F)}(w.test,h,F)),new Ke(h.doc,w.search,{ignoreCase:!w.caseSensitive,test:F},y,_)}function Ie(w,h){return w.slice((0,g.zK)(w,h,!1),h)}function Ae(w,h){return w.slice(h,(0,g.zK)(w,h))}class Je extends vt{nextMatch(h,y,_){let F=pe(this.spec,h,_,h.doc.length).next();return F.done&&(F=pe(this.spec,h,0,y).next()),F.done?null:F.value}prevMatchInRange(h,y,_){for(let F=1;;F++){let Z=Math.max(y,_-1e4*F),he=pe(this.spec,h,Z,_),ye=null;for(;!he.next().done;)ye=he.value;if(ye&&(Z==y||ye.from>Z+10))return ye;if(Z==y)return null}}prevMatch(h,y,_){return this.prevMatchInRange(h,0,y)||this.prevMatchInRange(h,_,h.doc.length)}getReplacement(h){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(y,_)=>{if("&"==_)return h.match[0];if("$"==_)return"$";for(let F=_.length;F>0;F--){let Z=+_.slice(0,F);if(Z>0&&Z<h.match.length)return h.match[Z]+_.slice(F)}return y})}matchAll(h,y){let _=pe(this.spec,h,0,h.doc.length),F=[];for(;!_.next().done;){if(F.length>=y)return null;F.push(_.value)}return F}highlight(h,y,_,F){let Z=pe(this.spec,h,Math.max(0,y-250),Math.min(_+250,h.doc.length));for(;!Z.next().done;)F(Z.value.from,Z.value.to)}}const qe=g.Pe.define(),Pt=g.Pe.define(),at=g.sU.define({create:w=>new Et(Oe(w).create(),null),update(w,h){for(let y of h.effects)y.is(qe)?w=new Et(y.value.create(),w.panel):y.is(Pt)&&(w=new Et(w.query,y.value?fe:null));return w},provide:w=>j.S7.from(w,h=>h.panel)});class Et{constructor(h,y){this.query=h,this.panel=y}}const Lt=j.NZ.mark({class:"cm-searchMatch"}),_e=j.NZ.mark({class:"cm-searchMatch cm-searchMatch-selected"}),k=j.Z9.fromClass(class{constructor(w){this.view=w,this.decorations=this.highlight(w.state.field(at))}update(w){let h=w.state.field(at);(h!=w.startState.field(at)||w.docChanged||w.selectionSet||w.viewportChanged)&&(this.decorations=this.highlight(h))}highlight({query:w,panel:h}){if(!h||!w.spec.valid)return j.NZ.none;let{view:y}=this,_=new g.vB;for(let F=0,Z=y.visibleRanges,he=Z.length;F<he;F++){let{from:ye,to:be}=Z[F];for(;F<he-1&&be>Z[F+1].from-500;)be=Z[++F].to;w.highlight(y.state,ye,be,(ut,nt)=>{let xt=y.state.selection.ranges.some(Zt=>Zt.from==ut&&Zt.to==nt);_.add(ut,nt,xt?_e:Lt)})}return _.finish()}},{decorations:w=>w.decorations});function M(w){return h=>{let y=h.state.field(at,!1);return y&&y.query.spec.valid?w(h,y):Ue(h)}}const H=M((w,{query:h})=>{let{to:y}=w.state.selection.main,_=h.nextMatch(w.state,y,y);if(!_)return!1;let F=g.OF.single(_.from,_.to),Z=w.state.facet(ci);return w.dispatch({selection:F,effects:[Pe(w,_),Z.scrollToMatch(F.main,w)],userEvent:"select.search"}),Ee(w),!0}),Y=M((w,{query:h})=>{let{state:y}=w,{from:_}=y.selection.main,F=h.prevMatch(y,_,_);if(!F)return!1;let Z=g.OF.single(F.from,F.to),he=w.state.facet(ci);return w.dispatch({selection:Z,effects:[Pe(w,F),he.scrollToMatch(Z.main,w)],userEvent:"select.search"}),Ee(w),!0}),I=M((w,{query:h})=>{let y=h.matchAll(w.state,1e3);return!(!y||!y.length||(w.dispatch({selection:g.OF.create(y.map(_=>g.OF.range(_.from,_.to))),userEvent:"select.search.matches"}),0))}),K=M((w,{query:h})=>{let{state:y}=w,{from:_,to:F}=y.selection.main;if(y.readOnly)return!1;let Z=h.nextMatch(y,_,_);if(!Z)return!1;let be,ut,he=Z,ye=[],nt=[];he.precise?he.from==_&&he.to==F&&(ut=y.toText(h.getReplacement(he)),ye.push({from:he.from,to:he.to,insert:ut}),nt.push(j.Lz.announce.of(y.phrase("replaced match on line $",y.doc.lineAt(_).number)+"."))):he=h.nextMatch(y,he.from,he.to);let xt=w.state.changes(ye);return he&&(be=g.OF.single(he.from,he.to).map(xt),nt.push(Pe(w,he)),nt.push(y.facet(ci).scrollToMatch(be.main,w))),w.dispatch({changes:xt,selection:be,effects:nt,userEvent:"input.replace"}),!0}),J=M((w,{query:h})=>{if(w.state.readOnly)return!1;let y=[];for(let F of h.matchAll(w.state,1e9)){let{from:Z,to:he,precise:ye}=F;ye&&y.push({from:Z,to:he,insert:h.getReplacement(F)})}if(!y.length)return!1;let _=w.state.phrase("replaced $ matches",y.length)+".";return w.dispatch({changes:y,effects:j.Lz.announce.of(_),userEvent:"input.replace.all"}),!0});function fe(w){return w.state.facet(ci).createPanel(w)}function Oe(w,h){var y,_,F,Z,he;let ye=w.selection.main,be=ye.empty||ye.to>ye.from+100?"":w.sliceDoc(ye.from,ye.to);if(h&&!be)return h;let ut=w.facet(ci);return new It({search:(null!==(y=h?.literal)&&void 0!==y?y:ut.literal)?be:be.replace(/\n/g,"\\n"),caseSensitive:null!==(_=h?.caseSensitive)&&void 0!==_?_:ut.caseSensitive,literal:null!==(F=h?.literal)&&void 0!==F?F:ut.literal,regexp:null!==(Z=h?.regexp)&&void 0!==Z?Z:ut.regexp,wholeWord:null!==(he=h?.wholeWord)&&void 0!==he?he:ut.wholeWord})}function Le(w){let h=(0,j.ld)(w,fe);return h&&h.dom.querySelector("[main-field]")}function Ee(w){let h=Le(w);h&&h==w.root.activeElement&&h.select()}const Ue=w=>{let h=w.state.field(at,!1);if(h&&h.panel){let y=Le(w);if(y&&y!=w.root.activeElement){let _=Oe(w.state,h.query.spec);_.valid&&w.dispatch({effects:qe.of(_)}),y.focus(),y.select()}}else w.dispatch({effects:[Pt.of(!0),h?qe.of(Oe(w.state,h.query.spec)):g.Pe.appendConfig.of(lt)]});return!0},P=w=>{let h=w.state.field(at,!1);if(!h||!h.panel)return!1;let y=(0,j.ld)(w,fe);return y&&y.dom.contains(w.root.activeElement)&&w.focus(),w.dispatch({effects:Pt.of(!1)}),!0},f=[{key:"Mod-f",run:Ue,scope:"editor search-panel"},{key:"F3",run:H,shift:Y,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:H,shift:Y,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:P,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:w,dispatch:h})=>{let y=w.selection;if(y.ranges.length>1||y.main.empty)return!1;let{from:_,to:F}=y.main,Z=[],he=0;for(let ye=new Ye(w.doc,w.sliceDoc(_,F));!ye.next().done;){if(Z.length>1e3)return!1;ye.value.from==_&&(he=Z.length),Z.push(g.OF.range(ye.value.from,ye.value.to))}return h(w.update({selection:g.OF.create(Z,he),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:w=>{let{state:h}=w,y=String(h.doc.lineAt(w.state.selection.main.head).number),{close:_,result:F}=(0,j.ui)(w,{label:h.phrase("Go to line"),input:{type:"text",name:"line",value:y},focus:!0,submitLabel:h.phrase("go")});return F.then(Z=>{let he=Z&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(Z.elements.line.value);if(!he)return void w.dispatch({effects:_});let ye=h.doc.lineAt(h.selection.main.head),[,be,ut,nt,xt]=he,Zt=nt?+nt.slice(1):0,ti=ut?+ut:ye.number;if(ut&&xt){let Qn=ti/100;be&&(Qn=Qn*("-"==be?-1:1)+ye.number/h.doc.lines),ti=Math.round(h.doc.lines*Qn)}else ut&&be&&(ti=ti*("-"==be?-1:1)+ye.number);let Wi=h.doc.line(Math.max(1,Math.min(h.doc.lines,ti))),Qi=g.OF.cursor(Wi.from+Math.max(0,Math.min(Zt,Wi.length)));w.dispatch({effects:[_,j.Lz.scrollIntoView(Qi.from,{y:"center"})],selection:Qi})}),!0}},{key:"Mod-d",run:({state:w,dispatch:h})=>{let{ranges:y}=w.selection;if(y.some(Z=>Z.from===Z.to))return(({state:w,dispatch:h})=>{let{selection:y}=w,_=g.OF.create(y.ranges.map(F=>w.wordAt(F.head)||g.OF.cursor(F.head)),y.mainIndex);return!_.eq(y)&&(h(w.update({selection:_})),!0)})({state:w,dispatch:h});let _=w.sliceDoc(y[0].from,y[0].to);if(w.selection.ranges.some(Z=>w.sliceDoc(Z.from,Z.to)!=_))return!1;let F=function Gt(w,h){let{main:y,ranges:_}=w.selection,F=w.wordAt(y.head),Z=F&&F.from==y.from&&F.to==y.to;for(let he=!1,ye=new Ye(w.doc,h,_[_.length-1].to);;){if(ye.next(),!ye.done){if(he&&_.some(be=>be.from==ye.value.from))continue;if(Z){let be=w.wordAt(ye.value.from);if(!be||be.from!=ye.value.from||be.to!=ye.value.to)continue}return ye.value}if(he)return null;ye=new Ye(w.doc,h,0,Math.max(0,_[_.length-1].from-1)),he=!0}}(w,_);return!!F&&(h(w.update({selection:w.selection.addRange(g.OF.range(F.from,F.to),!1),effects:j.Lz.scrollIntoView(F.to)})),!0)},preventDefault:!0}];class m{constructor(h){this.view=h;let y=this.query=h.state.field(at).query.spec;function _(F,Z,he){return(0,Te.A)("button",{class:"cm-button",name:F,onclick:Z,type:"button"},he)}this.commit=this.commit.bind(this),this.searchField=(0,Te.A)("input",{value:y.search,placeholder:V(h,"Find"),"aria-label":V(h,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=(0,Te.A)("input",{value:y.replace,placeholder:V(h,"Replace"),"aria-label":V(h,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=(0,Te.A)("input",{type:"checkbox",name:"case",form:"",checked:y.caseSensitive,onchange:this.commit}),this.reField=(0,Te.A)("input",{type:"checkbox",name:"re",form:"",checked:y.regexp,onchange:this.commit}),this.wordField=(0,Te.A)("input",{type:"checkbox",name:"word",form:"",checked:y.wholeWord,onchange:this.commit}),this.dom=(0,Te.A)("div",{onkeydown:F=>this.keydown(F),class:"cm-search"},[this.searchField,_("next",()=>H(h),[V(h,"next")]),_("prev",()=>Y(h),[V(h,"previous")]),_("select",()=>I(h),[V(h,"all")]),(0,Te.A)("label",null,[this.caseField,V(h,"match case")]),(0,Te.A)("label",null,[this.reField,V(h,"regexp")]),(0,Te.A)("label",null,[this.wordField,V(h,"by word")]),...h.state.readOnly?[]:[(0,Te.A)("br"),this.replaceField,_("replace",()=>K(h),[V(h,"replace")]),_("replaceAll",()=>J(h),[V(h,"replace all")])],(0,Te.A)("button",{name:"close",onclick:()=>P(h),"aria-label":V(h,"close"),type:"button"},["\xd7"])])}commit(){let h=new It({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});h.eq(this.query)||(this.query=h,this.view.dispatch({effects:qe.of(h)}))}keydown(h){(0,j.TS)(this.view,h,"search-panel")?h.preventDefault():13==h.keyCode&&h.target==this.searchField?(h.preventDefault(),(h.shiftKey?Y:H)(this.view)):13==h.keyCode&&h.target==this.replaceField&&(h.preventDefault(),K(this.view))}update(h){for(let y of h.transactions)for(let _ of y.effects)_.is(qe)&&!_.value.eq(this.query)&&this.setQuery(_.value)}setQuery(h){this.query=h,this.searchField.value=h.search,this.replaceField.value=h.replace,this.caseField.checked=h.caseSensitive,this.reField.checked=h.regexp,this.wordField.checked=h.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(ci).top}}function V(w,h){return w.state.phrase(h)}const ue=/[\s\.,:;?!]/;function Pe(w,{from:h,to:y}){let _=w.state.doc.lineAt(h),F=w.state.doc.lineAt(y).to,Z=Math.max(_.from,h-30),he=Math.min(F,y+30),ye=w.state.sliceDoc(Z,he);if(Z!=_.from)for(let be=0;be<30;be++)if(!ue.test(ye[be+1])&&ue.test(ye[be])){ye=ye.slice(be);break}if(he!=F)for(let be=ye.length-1;be>ye.length-30;be--)if(!ue.test(ye[be-1])&&ue.test(ye[be])){ye=ye.slice(0,be);break}return j.Lz.announce.of(`${w.state.phrase("current match")}. ${ye} ${w.state.phrase("on line")} ${_.number}.`)}const $e=j.Lz.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),lt=[at,g.Nb.low(k),$e];class qt{constructor(h,y,_,F){this.state=h,this.pos=y,this.explicit=_,this.view=F,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(h){let y=(0,R.mv)(this.state).resolveInner(this.pos,-1);for(;y&&h.indexOf(y.name)<0;)y=y.parent;return y?{from:y.from,to:this.pos,text:this.state.sliceDoc(y.from,this.pos),type:y.type}:null}matchBefore(h){let y=this.state.doc.lineAt(this.pos),_=Math.max(y.from,this.pos-250),F=y.text.slice(_-y.from,this.pos-y.from),Z=F.search(di(h,!1));return Z<0?null:{from:_+Z,to:this.pos,text:F.slice(Z)}}get aborted(){return null==this.abortListeners}addEventListener(h,y,_){"abort"==h&&this.abortListeners&&(this.abortListeners.push(y),_&&_.onDocChange&&(this.abortOnDocChange=!0))}}function zt(w){let h=Object.keys(w).join(""),y=/\w/.test(h);return y&&(h=h.replace(/\w/g,"")),`[${y?"\\w":""}${h.replace(/[^\w\s]/g,"\\$&")}]`}class fi{constructor(h,y,_,F){this.completion=h,this.source=y,this.match=_,this.score=F}}function pi(w){return w.selection.main.from}function di(w,h){var y;let{source:_}=w,F=h&&"^"!=_[0],Z="$"!=_[_.length-1];return F||Z?new RegExp(`${F?"^":""}(?:${_})${Z?"$":""}`,null!==(y=w.flags)&&void 0!==y?y:w.ignoreCase?"i":""):w}const gi=g.YH.define();function xi(w,h,y,_){let{main:F}=w.selection,Z=y-F.from,he=_-F.from;return{...w.changeByRange(ye=>{if(ye!=F&&y!=_&&w.sliceDoc(ye.from+Z,ye.from+he)!=w.sliceDoc(y,_))return{range:ye};let be=w.toText(h);return{changes:{from:ye.from+Z,to:_==F.from?ye.to:ye.from+he,insert:be},range:g.OF.cursor(ye.from+Z+be.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const Di=new WeakMap;function Ii(w){if(!Array.isArray(w))return w;let h=Di.get(w);return h||Di.set(w,h=function ki(w){let h=w.map(F=>"string"==typeof F?{label:F}:F),[y,_]=h.every(F=>/^\w+$/.test(F.label))?[/\w*$/,/\w+$/]:function hi(w){let h=Object.create(null),y=Object.create(null);for(let{label:F}of w){h[F[0]]=!0;for(let Z=1;Z<F.length;Z++)y[F[Z]]=!0}let _=zt(h)+zt(y)+"*$";return[new RegExp("^"+_),new RegExp(_)]}(h);return F=>{let Z=F.matchBefore(_);return Z||F.explicit?{from:Z?Z.from:F.pos,options:h,validFor:y}:null}}(w)),h}const vi=g.Pe.define(),mi=g.Pe.define();class en{constructor(h){this.pattern=h,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let y=0;y<h.length;){let _=(0,g.vS)(h,y),F=(0,g.Fh)(_);this.chars.push(_);let Z=h.slice(y,y+F),he=Z.toUpperCase();this.folded.push((0,g.vS)(he==Z?Z.toLowerCase():he,0)),y+=F}this.astral=h.length!=this.chars.length}ret(h,y){return this.score=h,this.matched=y,this}match(h){if(0==this.pattern.length)return this.ret(-100,[]);if(h.length<this.pattern.length)return null;let{chars:y,folded:_,any:F,precise:Z,byWord:he}=this;if(1==y.length){let Ui=(0,g.vS)(h,0),Kn=(0,g.Fh)(Ui),Rn=Kn==h.length?0:-100;if(Ui!=y[0]){if(Ui!=_[0])return null;Rn+=-200}return this.ret(Rn,[0,Kn])}let ye=h.indexOf(this.pattern);if(0==ye)return this.ret(h.length==this.pattern.length?0:-100,[0,this.pattern.length]);let be=y.length,ut=0;if(ye<0){for(let Ui=0,Kn=Math.min(h.length,200);Ui<Kn&&ut<be;){let Rn=(0,g.vS)(h,Ui);(Rn==y[ut]||Rn==_[ut])&&(F[ut++]=Ui),Ui+=(0,g.Fh)(Rn)}if(ut<be)return null}let nt=0,xt=0,Zt=!1,ti=0,Wi=-1,Qi=-1,Qn=/[a-z]/.test(h),Dn=!0;for(let Ui=0,Kn=Math.min(h.length,200),Rn=0;Ui<Kn&&xt<be;){let Sn=(0,g.vS)(h,Ui);ye<0&&(nt<be&&Sn==y[nt]&&(Z[nt++]=Ui),ti<be&&(Sn==y[ti]||Sn==_[ti]?(0==ti&&(Wi=Ui),Qi=Ui+1,ti++):ti=0));let ii,Ge=Sn<255?Sn>=48&&Sn<=57||Sn>=97&&Sn<=122?2:Sn>=65&&Sn<=90?1:0:(ii=(0,g.MK)(Sn))!=ii.toLowerCase()?1:ii!=ii.toUpperCase()?2:0;(!Ui||1==Ge&&Qn||0==Rn&&0!=Ge)&&(y[xt]==Sn||_[xt]==Sn&&(Zt=!0)?he[xt++]=Ui:he.length&&(Dn=!1)),Rn=Ge,Ui+=(0,g.Fh)(Sn)}return xt==be&&0==he[0]&&Dn?this.result((Zt?-200:0)-100,he,h):ti==be&&0==Wi?this.ret(-200-h.length+(Qi==h.length?0:-100),[0,Qi]):ye>-1?this.ret(-700-h.length,[ye,ye+this.pattern.length]):ti==be?this.ret(-900-h.length,[Wi,Qi]):xt==be?this.result((Zt?-200:0)-100-700+(Dn?0:-1100),he,h):2==y.length?null:this.result((F[0]?-700:0)-200-1100,F,h)}result(h,y,_){let F=[],Z=0;for(let he of y){let ye=he+(this.astral?(0,g.Fh)((0,g.vS)(_,he)):1);Z&&F[Z-1]==he?F[Z-1]=ye:(F[Z++]=he,F[Z++]=ye)}return this.ret(h-_.length,F)}}class tn{constructor(h){this.pattern=h,this.matched=[],this.score=0,this.folded=h.toLowerCase()}match(h){if(h.length<this.pattern.length)return null;let y=h.slice(0,this.pattern.length),_=y==this.pattern?0:y.toLowerCase()==this.folded?-200:null;return null==_?null:(this.matched=[0,y.length],this.score=_+(h.length==this.pattern.length?0:-100),this)}}const si=g.sj.define({combine:w=>(0,g.QR)(w,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:cn,filterStrict:!1,compareCompletions:(h,y)=>(h.sortText||h.label).localeCompare(y.sortText||y.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(h,y)=>h&&y,closeOnBlur:(h,y)=>h&&y,icons:(h,y)=>h&&y,tooltipClass:(h,y)=>_=>nn(h(_),y(_)),optionClass:(h,y)=>_=>nn(h(_),y(_)),addToOptions:(h,y)=>h.concat(y),filterStrict:(h,y)=>h||y})});function nn(w,h){return w?h?w+" "+h:w:h}function cn(w,h,y,_,F,Z){let nt,xt,he=w.textDirection==j.OP.RTL,ye=he,be=!1,ut="top",Zt=h.left-F.left,ti=F.right-h.right,Wi=_.right-_.left,Qi=_.bottom-_.top;if(ye&&Zt<Math.min(Wi,ti)?ye=!1:!ye&&ti<Math.min(Wi,Zt)&&(ye=!0),Wi<=(ye?Zt:ti))nt=Math.max(F.top,Math.min(y.top,F.bottom-Qi))-h.top,xt=Math.min(400,ye?Zt:ti);else{be=!0,xt=Math.min(400,(he?h.right:F.right-h.left)-30);let Ui=F.bottom-h.bottom;Ui>=Qi||Ui>h.top?nt=y.bottom-h.top:(ut="bottom",nt=h.bottom-y.top)}return{style:`${ut}: ${nt/((h.bottom-h.top)/Z.offsetHeight)}px; max-width: ${xt/((h.right-h.left)/Z.offsetWidth)}px`,class:"cm-completionInfo-"+(be?he?"left-narrow":"right-narrow":ye?"left":"right")}}const Si=g.Pe.define();function wi(w,h,y){if(w<=y)return{from:0,to:w};if(h<0&&(h=0),h<=w>>1){let F=Math.floor(h/y);return{from:F*y,to:(F+1)*y}}let _=Math.ceil((w-h)/y);return{from:w-_*y,to:w-(_-1)*y}}class Xi{constructor(h,y,_){this.view=h,this.stateField=y,this.applyCompletion=_,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:be=>this.placeInfo(be),key:this},this.space=null,this.currentClass="";let F=h.state.field(y),{options:Z,selected:he}=F.open,ye=h.state.facet(si);this.optionContent=function _i(w){let h=w.addToOptions.slice();return w.icons&&h.push({render(y){let _=document.createElement("div");return _.classList.add("cm-completionIcon"),y.type&&_.classList.add(...y.type.split(/\s+/g).map(F=>"cm-completionIcon-"+F)),_.setAttribute("aria-hidden","true"),_},position:20}),h.push({render(y,_,F,Z){let he=document.createElement("span");he.className="cm-completionLabel";let ye=y.displayLabel||y.label,be=0;for(let ut=0;ut<Z.length;){let nt=Z[ut++],xt=Z[ut++];nt>be&&he.appendChild(document.createTextNode(ye.slice(be,nt)));let Zt=he.appendChild(document.createElement("span"));Zt.appendChild(document.createTextNode(ye.slice(nt,xt))),Zt.className="cm-completionMatchedText",be=xt}return be<ye.length&&he.appendChild(document.createTextNode(ye.slice(be))),he},position:50},{render(y){if(!y.detail)return null;let _=document.createElement("span");return _.className="cm-completionDetail",_.textContent=y.detail,_},position:80}),h.sort((y,_)=>y.position-_.position).map(y=>y.render)}(ye),this.optionClass=ye.optionClass,this.tooltipClass=ye.tooltipClass,this.range=wi(Z.length,he,ye.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(h.state),this.dom.addEventListener("mousedown",be=>{let{options:ut}=h.state.field(y).open;for(let xt,nt=be.target;nt&&nt!=this.dom;nt=nt.parentNode)if("LI"==nt.nodeName&&(xt=/-(\d+)$/.exec(nt.id))&&+xt[1]<ut.length)return this.applyCompletion(h,ut[+xt[1]]),void be.preventDefault();if(be.target==this.list){let nt=this.list.classList.contains("cm-completionListIncompleteTop")&&be.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&be.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;null!=nt&&(h.dispatch({effects:Si.of(nt)}),be.preventDefault())}}),this.dom.addEventListener("focusout",be=>{let ut=h.state.field(this.stateField,!1);ut&&ut.tooltip&&h.state.facet(si).closeOnBlur&&be.relatedTarget!=h.contentDOM&&h.dispatch({effects:mi.of(null)})}),this.showOptions(Z,F.id)}mount(){this.updateSel()}showOptions(h,y){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(h,y,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(h){var y;let _=h.state.field(this.stateField),F=h.startState.field(this.stateField);if(this.updateTooltipClass(h.state),_!=F){let{options:Z,selected:he,disabled:ye}=_.open;(!F.open||F.open.options!=Z)&&(this.range=wi(Z.length,he,h.state.facet(si).maxRenderedOptions),this.showOptions(Z,_.id)),this.updateSel(),ye!=(null===(y=F.open)||void 0===y?void 0:y.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!ye)}}updateTooltipClass(h){let y=this.tooltipClass(h);if(y!=this.currentClass){for(let _ of this.currentClass.split(" "))_&&this.dom.classList.remove(_);for(let _ of y.split(" "))_&&this.dom.classList.add(_);this.currentClass=y}}positioned(h){this.space=h,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let h=this.view.state.field(this.stateField),y=h.open;(y.selected>-1&&y.selected<this.range.from||y.selected>=this.range.to)&&(this.range=wi(y.options.length,y.selected,this.view.state.facet(si).maxRenderedOptions),this.showOptions(y.options,h.id));let _=this.updateSelectedOption(y.selected);if(_){this.destroyInfo();let{completion:F}=y.options[y.selected],{info:Z}=F;if(!Z)return;let he="string"==typeof Z?document.createTextNode(Z):Z(F);if(!he)return;"then"in he?he.then(ye=>{ye&&this.view.state.field(this.stateField,!1)==h&&this.addInfoPane(ye,F)}).catch(ye=>(0,j.c_)(this.view.state,ye,"completion info")):(this.addInfoPane(he,F),_.setAttribute("aria-describedby",this.info.id))}}addInfoPane(h,y){this.destroyInfo();let _=this.info=document.createElement("div");if(_.className="cm-tooltip cm-completionInfo",_.id="cm-completionInfo-"+Math.floor(65535*Math.random()).toString(16),null!=h.nodeType)_.appendChild(h),this.infoDestroy=null;else{let{dom:F,destroy:Z}=h;_.appendChild(F),this.infoDestroy=Z||null}this.dom.appendChild(_),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(h){let y=null;for(let _=this.list.firstChild,F=this.range.from;_;_=_.nextSibling,F++)"LI"==_.nodeName&&_.id?F==h?_.hasAttribute("aria-selected")||(_.setAttribute("aria-selected","true"),y=_):_.hasAttribute("aria-selected")&&(_.removeAttribute("aria-selected"),_.removeAttribute("aria-describedby")):F--;return y&&function ei(w,h){let y=w.getBoundingClientRect(),_=h.getBoundingClientRect(),F=y.height/w.offsetHeight;_.top<y.top?w.scrollTop-=(y.top-_.top)/F:_.bottom>y.bottom&&(w.scrollTop+=(_.bottom-y.bottom)/F)}(this.list,y),y}measureInfo(){let h=this.dom.querySelector("[aria-selected]");if(!h||!this.info)return null;let y=this.dom.getBoundingClientRect(),_=this.info.getBoundingClientRect(),F=h.getBoundingClientRect(),Z=this.space;if(!Z){let he=this.dom.ownerDocument.documentElement;Z={left:0,top:0,right:he.clientWidth,bottom:he.clientHeight}}return F.top>Math.min(Z.bottom,y.bottom)-10||F.bottom<Math.max(Z.top,y.top)+10?null:this.view.state.facet(si).positionInfo(this.view,y,F,_,Z,this.dom)}placeInfo(h){this.info&&(h?(h.style&&(this.info.style.cssText=h.style),this.info.className="cm-tooltip cm-completionInfo "+(h.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(h,y,_){const F=document.createElement("ul");F.id=y,F.setAttribute("role","listbox"),F.setAttribute("aria-expanded","true"),F.setAttribute("aria-label",this.view.state.phrase("Completions")),F.addEventListener("mousedown",he=>{he.target==F&&he.preventDefault()});let Z=null;for(let he=_.from;he<_.to;he++){let{completion:ye,match:be}=h[he],{section:ut}=ye;if(ut){let Zt="string"==typeof ut?ut:ut.name;Zt!=Z&&(he>_.from||0==_.from)&&(Z=Zt,"string"!=typeof ut&&ut.header?F.appendChild(ut.header(ut)):F.appendChild(document.createElement("completion-section")).textContent=Zt)}const nt=F.appendChild(document.createElement("li"));nt.id=y+"-"+he,nt.setAttribute("role","option");let xt=this.optionClass(ye);xt&&(nt.className=xt);for(let Zt of this.optionContent){let ti=Zt(ye,this.view.state,this.view,be);ti&&nt.appendChild(ti)}}return _.from&&F.classList.add("cm-completionListIncompleteTop"),_.to<h.length&&F.classList.add("cm-completionListIncompleteBottom"),F}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function Vi(w,h){return y=>new Xi(y,w,h)}function Ji(w){return 100*(w.boost||0)+(w.apply?10:0)+(w.info?5:0)+(w.type?1:0)}class Ut{constructor(h,y,_,F,Z,he){this.options=h,this.attrs=y,this.tooltip=_,this.timestamp=F,this.selected=Z,this.disabled=he}setSelected(h,y){return h==this.selected||h>=this.options.length?this:new Ut(this.options,d(y,h),this.tooltip,this.timestamp,h,this.disabled)}static build(h,y,_,F,Z,he){if(F&&!he&&h.some(ut=>ut.isPending))return F.setDisabled();let ye=function Gi(w,h){let y=[],_=null,F=null,Z=nt=>{y.push(nt);let{section:xt}=nt.completion;if(xt){_||(_=[]);let Zt="string"==typeof xt?xt:xt.name;_.some(ti=>ti.name==Zt)||_.push("string"==typeof xt?{name:Zt}:xt)}},he=h.facet(si);for(let nt of w)if(nt.hasResult()){let xt=nt.result.getMatch;if(!1===nt.result.filter)for(let Zt of nt.result.options)Z(new fi(Zt,nt.source,xt?xt(Zt):[],1e9-y.length));else{let ti,Zt=h.sliceDoc(nt.from,nt.to),Wi=he.filterStrict?new tn(Zt):new en(Zt);for(let Qi of nt.result.options)if(ti=Wi.match(Qi.label)){let Qn=Qi.displayLabel?xt?xt(Qi,ti.matched):[]:ti.matched,Dn=ti.score+(Qi.boost||0);if(Z(new fi(Qi,nt.source,Qn,Dn)),"object"==typeof Qi.section&&"dynamic"===Qi.section.rank){let{name:Ui}=Qi.section;F||(F=Object.create(null)),F[Ui]=Math.max(Dn,F[Ui]||-1e9)}}}}if(_){let nt=Object.create(null),xt=0,Zt=(ti,Wi)=>("dynamic"===ti.rank&&"dynamic"===Wi.rank?F[Wi.name]-F[ti.name]:0)||("number"==typeof ti.rank?ti.rank:1e9)-("number"==typeof Wi.rank?Wi.rank:1e9)||(ti.name<Wi.name?-1:1);for(let ti of _.sort(Zt))xt-=1e5,nt[ti.name]=xt;for(let ti of y){let{section:Wi}=ti.completion;Wi&&(ti.score+=nt["string"==typeof Wi?Wi:Wi.name])}}let ye=[],be=null,ut=he.compareCompletions;for(let nt of y.sort((xt,Zt)=>Zt.score-xt.score||ut(xt.completion,Zt.completion))){let xt=nt.completion;!be||be.label!=xt.label||be.detail!=xt.detail||null!=be.type&&null!=xt.type&&be.type!=xt.type||be.apply!=xt.apply||be.boost!=xt.boost?ye.push(nt):Ji(nt.completion)>Ji(be)&&(ye[ye.length-1]=nt),be=nt.completion}return ye}(h,y);if(!ye.length)return F&&h.some(ut=>ut.isPending)?F.setDisabled():null;let be=y.facet(si).selectOnOpen?0:-1;if(F&&F.selected!=be&&-1!=F.selected){let ut=F.options[F.selected].completion;for(let nt=0;nt<ye.length;nt++)if(ye[nt].completion==ut){be=nt;break}}return new Ut(ye,d(_,be),{pos:h.reduce((ut,nt)=>nt.hasResult()?Math.min(ut,nt.from):ut,1e8),create:ot,above:Z.aboveCursor},F?F.timestamp:Date.now(),be,!1)}map(h){return new Ut(this.options,this.attrs,{...this.tooltip,pos:h.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Ut(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class $i{constructor(h,y,_){this.active=h,this.id=y,this.open=_}static start(){return new $i(O,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(h){let{state:y}=h,_=y.facet(si),Z=(_.override||y.languageDataAt("autocomplete",pi(y)).map(Ii)).map(be=>(this.active.find(nt=>nt.source==be)||new N(be,this.active.some(nt=>0!=nt.state)?1:0)).update(h,_));Z.length==this.active.length&&Z.every((be,ut)=>be==this.active[ut])&&(Z=this.active);let he=this.open,ye=h.effects.some(be=>be.is(ce));he&&h.docChanged&&(he=he.map(h.changes)),h.selection||Z.some(be=>be.hasResult()&&h.changes.touchesRange(be.from,be.to))||!function Bi(w,h){if(w==h)return!0;for(let y=0,_=0;;){for(;y<w.length&&!w[y].hasResult();)y++;for(;_<h.length&&!h[_].hasResult();)_++;let F=y==w.length,Z=_==h.length;if(F||Z)return F==Z;if(w[y++].result!=h[_++].result)return!1}}(Z,this.active)||ye?he=Ut.build(Z,y,this.id,he,_,ye):he&&he.disabled&&!Z.some(be=>be.isPending)&&(he=null),!he&&Z.every(be=>!be.isPending)&&Z.some(be=>be.hasResult())&&(Z=Z.map(be=>be.hasResult()?new N(be.source,0):be));for(let be of h.effects)be.is(Si)&&(he=he&&he.setSelected(be.value,this.id));return Z==this.active&&he==this.open?this:new $i(Z,this.id,he)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Q:u}}const Q={"aria-autocomplete":"list"},u={};function d(w,h){let y={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":w};return h>-1&&(y["aria-activedescendant"]=w+"-"+h),y}const O=[];function T(w,h){if(w.isUserEvent("input.complete")){let _=w.annotation(gi);if(_&&h.activateOnCompletion(_))return 12}let y=w.isUserEvent("input.type");return y&&h.activateOnTyping?5:y?1:w.isUserEvent("delete.backward")?2:w.selection?8:w.docChanged?16:0}class N{constructor(h,y,_=!1){this.source=h,this.state=y,this.explicit=_}hasResult(){return!1}get isPending(){return 1==this.state}update(h,y){let _=T(h,y),F=this;(8&_||16&_&&this.touches(h))&&(F=new N(F.source,0)),4&_&&0==F.state&&(F=new N(this.source,1)),F=F.updateFor(h,_);for(let Z of h.effects)if(Z.is(vi))F=new N(F.source,1,Z.value);else if(Z.is(mi))F=new N(F.source,0);else if(Z.is(ce))for(let he of Z.value)he.source==F.source&&(F=he);return F}updateFor(h,y){return this.map(h.changes)}map(h){return this}touches(h){return h.changes.touchesRange(pi(h.state))}}class $ extends N{constructor(h,y,_,F,Z,he){super(h,3,y),this.limit=_,this.result=F,this.from=Z,this.to=he}hasResult(){return!0}updateFor(h,y){var _;if(!(3&y))return this.map(h.changes);let F=this.result;F.map&&!h.changes.empty&&(F=F.map(F,h.changes));let Z=h.changes.mapPos(this.from),he=h.changes.mapPos(this.to,1),ye=pi(h.state);if(ye>he||!F||2&y&&(pi(h.startState)==this.from||ye<this.limit))return new N(this.source,4&y?1:0);let be=h.changes.mapPos(this.limit);return function re(w,h,y,_){if(!w)return!1;let F=h.sliceDoc(y,_);return"function"==typeof w?w(F,y,_,h):di(w,!0).test(F)}(F.validFor,h.state,Z,he)?new $(this.source,this.explicit,be,F,Z,he):F.update&&(F=F.update(F,Z,he,new qt(h.state,ye,!1)))?new $(this.source,this.explicit,be,F,F.from,null!==(_=F.to)&&void 0!==_?_:pi(h.state)):new N(this.source,1,this.explicit)}map(h){if(h.empty)return this;let y=this.result.map?this.result.map(this.result,h):this.result;return y?new $(this.source,this.explicit,h.mapPos(this.limit),y,h.mapPos(this.from),h.mapPos(this.to,1)):new N(this.source,0)}touches(h){return h.changes.touchesRange(this.from,this.to)}}const ce=g.Pe.define({map:(w,h)=>w.map(y=>y.map(h))}),Ce=g.sU.define({create:()=>$i.start(),update:(w,h)=>w.update(h),provide:w=>[j.DK.from(w,h=>h.tooltip),j.Lz.contentAttributes.from(w,h=>h.attrs)]});function je(w,h){const y=h.completion.apply||h.completion.label;let _=w.state.field(Ce).active.find(F=>F.source==h.source);return _ instanceof $&&("string"==typeof y?w.dispatch({...xi(w.state,y,_.from,_.to),annotations:gi.of(h.completion)}):y(w,h.completion,_.from,_.to),!0)}const ot=Vi(Ce,je);function gt(w,h="option"){return y=>{let _=y.state.field(Ce,!1);if(!_||!_.open||_.open.disabled||Date.now()-_.open.timestamp<y.state.facet(si).interactionDelay)return!1;let Z,F=1;"page"==h&&(Z=(0,j.Eg)(y,_.open.tooltip))&&(F=Math.max(2,Math.floor(Z.dom.offsetHeight/Z.dom.querySelector("li").offsetHeight)-1));let{length:he}=_.open.options,ye=_.open.selected>-1?_.open.selected+F*(w?1:-1):w?0:he-1;return ye<0?ye="page"==h?0:he-1:ye>=he&&(ye="page"==h?he-1:0),y.dispatch({effects:Si.of(ye)}),!0}}const jt=w=>!!w.state.field(Ce,!1)&&(w.dispatch({effects:vi.of(!0)}),!0);class $t{constructor(h,y){this.active=h,this.context=y,this.time=Date.now(),this.updates=[],this.done=void 0}}const gn=j.Z9.fromClass(class{constructor(w){this.view=w,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let h of w.state.field(Ce).active)h.isPending&&this.startQuery(h)}update(w){let h=w.state.field(Ce),y=w.state.facet(si);if(!w.selectionSet&&!w.docChanged&&w.startState.field(Ce)==h)return;let _=w.transactions.some(Z=>{let he=T(Z,y);return 8&he||(Z.selection||Z.docChanged)&&!(3&he)});for(let Z=0;Z<this.running.length;Z++){let he=this.running[Z];if(_||he.context.abortOnDocChange&&w.docChanged||he.updates.length+w.transactions.length>50&&Date.now()-he.time>1e3){for(let ye of he.context.abortListeners)try{ye()}catch(be){(0,j.c_)(this.view.state,be)}he.context.abortListeners=null,this.running.splice(Z--,1)}else he.updates.push(...w.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),w.transactions.some(Z=>Z.effects.some(he=>he.is(vi)))&&(this.pendingStart=!0);let F=this.pendingStart?50:y.activateOnTypingDelay;if(this.debounceUpdate=h.active.some(Z=>Z.isPending&&!this.running.some(he=>he.active.source==Z.source))?setTimeout(()=>this.startUpdate(),F):-1,0!=this.composing)for(let Z of w.transactions)Z.isUserEvent("input.type")?this.composing=2:2==this.composing&&Z.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:w}=this.view,h=w.field(Ce);for(let y of h.active)y.isPending&&!this.running.some(_=>_.active.source==y.source)&&this.startQuery(y);this.running.length&&h.open&&h.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(si).updateSyncTime))}startQuery(w){let{state:h}=this.view,y=pi(h),_=new qt(h,y,w.explicit,this.view),F=new $t(w,_);this.running.push(F),Promise.resolve(w.source(_)).then(Z=>{F.context.aborted||(F.done=Z||null,this.scheduleAccept())},Z=>{this.view.dispatch({effects:mi.of(null)}),(0,j.c_)(this.view.state,Z)})}scheduleAccept(){this.running.every(w=>void 0!==w.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(si).updateSyncTime))}accept(){var w;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let h=[],y=this.view.state.facet(si),_=this.view.state.field(Ce);for(let F=0;F<this.running.length;F++){let Z=this.running[F];if(void 0===Z.done)continue;if(this.running.splice(F--,1),Z.done){let ye=pi(Z.updates.length?Z.updates[0].startState:this.view.state),be=Math.min(ye,Z.done.from+(Z.active.explicit?0:1)),ut=new $(Z.active.source,Z.active.explicit,be,Z.done,Z.done.from,null!==(w=Z.done.to)&&void 0!==w?w:ye);for(let nt of Z.updates)ut=ut.update(nt,y);if(ut.hasResult()){h.push(ut);continue}}let he=_.active.find(ye=>ye.source==Z.active.source);if(he&&he.isPending)if(null==Z.done){let ye=new N(Z.active.source,0);for(let be of Z.updates)ye=ye.update(be,y);ye.isPending||h.push(ye)}else this.startQuery(he)}(h.length||_.open&&_.open.disabled)&&this.view.dispatch({effects:ce.of(h)})}},{eventHandlers:{blur(w){let h=this.view.state.field(Ce,!1);if(h&&h.tooltip&&this.view.state.facet(si).closeOnBlur){let y=h.open&&(0,j.Eg)(this.view,h.open.tooltip);(!y||!y.dom.contains(w.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:mi.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:vi.of(!1)}),20),this.composing=0}}}),Un="object"==typeof navigator&&/Win/.test(navigator.platform),Ri=g.Nb.highest(j.Lz.domEventHandlers({keydown(w,h){let y=h.state.field(Ce,!1);if(!y||!y.open||y.open.disabled||y.open.selected<0||w.key.length>1||w.ctrlKey&&(!Un||!w.altKey)||w.metaKey)return!1;let _=y.open.options[y.open.selected],F=y.active.find(he=>he.source==_.source),Z=_.completion.commitCharacters||F.result.commitCharacters;return Z&&Z.indexOf(w.key)>-1&&je(h,_),!1}})),rn=j.Lz.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xb7\xb7\xb7"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25cb'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25cc'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1d465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1d436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1d461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222a'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25a1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1f511}\ufe0e'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25a2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),yn={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},ln=g.Pe.define({map:(w,h)=>h.mapPos(w,-1,g.iR.TrackAfter)??void 0}),Bn=new class extends g.FB{};Bn.startSide=1,Bn.endSide=-1;const Cn=g.sU.define({create:()=>g.om.empty,update(w,h){if(w=w.map(h.changes),h.selection){let y=h.state.doc.lineAt(h.selection.main.head);w=w.update({filter:_=>_>=y.from&&_<=y.to})}for(let y of h.effects)y.is(ln)&&(w=w.update({add:[Bn.range(y.value,y.value+1)]}));return w}}),Gn="()[]{}<>\xab\xbb\xbb\xab\uff3b\uff3d\uff5b\uff5d";function Xn(w){for(let h=0;h<16;h+=2)if(Gn.charCodeAt(h)==w)return Gn.charAt(h+1);return(0,g.MK)(w<128?w:w+1)}function Wn(w,h){return w.languageDataAt("closeBrackets",h)[0]||yn}const vn="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),Yn=j.Lz.inputHandler.of((w,h,y,_)=>{if((vn?w.composing:w.compositionStarted)||w.state.readOnly)return!1;let F=w.state.selection.main;if(_.length>2||2==_.length&&1==(0,g.Fh)((0,g.vS)(_,0))||h!=F.from||y!=F.to)return!1;let Z=function Tn(w,h){let y=Wn(w,w.selection.main.head),_=y.brackets||yn.brackets;for(let F of _){let Z=Xn((0,g.vS)(F,0));if(h==F)return Z==F?En(w,F,_.indexOf(F+F+F)>-1,y):or(w,F,Z,y.before||yn.before);if(h==Z&&Vn(w,w.selection.main.from))return qn(w,0,Z)}return null}(w.state,_);return!!Z&&(w.dispatch(Z),!0)}),Pn=[{key:"Backspace",run:({state:w,dispatch:h})=>{if(w.readOnly)return!1;let _=Wn(w,w.selection.main.head).brackets||yn.brackets,F=null,Z=w.changeByRange(he=>{if(he.empty){let ye=function sr(w,h){let y=w.sliceString(h-2,h);return(0,g.Fh)((0,g.vS)(y,0))==y.length?y:y.slice(1)}(w.doc,he.head);for(let be of _)if(be==ye&&xn(w.doc,he.head)==Xn((0,g.vS)(be,0)))return{changes:{from:he.head-be.length,to:he.head+be.length},range:g.OF.cursor(he.head-be.length)}}return{range:F=he}});return F||h(w.update(Z,{scrollIntoView:!0,userEvent:"delete.backward"})),!F}}];function Vn(w,h){let y=!1;return w.field(Cn).between(0,w.doc.length,_=>{_==h&&(y=!0)}),y}function xn(w,h){let y=w.sliceString(h,h+2);return y.slice(0,(0,g.Fh)((0,g.vS)(y,0)))}function or(w,h,y,_){let F=null,Z=w.changeByRange(he=>{if(!he.empty)return{changes:[{insert:h,from:he.from},{insert:y,from:he.to}],effects:ln.of(he.to+h.length),range:g.OF.range(he.anchor+h.length,he.head+h.length)};let ye=xn(w.doc,he.head);return!ye||/\s/.test(ye)||_.indexOf(ye)>-1?{changes:{insert:h+y,from:he.head},effects:ln.of(he.head+h.length),range:g.OF.cursor(he.head+h.length)}:{range:F=he}});return F?null:w.update(Z,{scrollIntoView:!0,userEvent:"input.type"})}function qn(w,h,y){let _=null,F=w.changeByRange(Z=>Z.empty&&xn(w.doc,Z.head)==y?{changes:{from:Z.head,to:Z.head+y.length,insert:y},range:g.OF.cursor(Z.head+y.length)}:_={range:Z});return _?null:w.update(F,{scrollIntoView:!0,userEvent:"input.type"})}function En(w,h,y,_){let F=_.stringPrefixes||yn.stringPrefixes,Z=null,he=w.changeByRange(ye=>{if(!ye.empty)return{changes:[{insert:h,from:ye.from},{insert:h,from:ye.to}],effects:ln.of(ye.to+h.length),range:g.OF.range(ye.anchor+h.length,ye.head+h.length)};let nt,be=ye.head,ut=xn(w.doc,be);if(ut==h){if(er(w,be))return{changes:{insert:h+h,from:be},effects:ln.of(be+h.length),range:g.OF.cursor(be+h.length)};if(Vn(w,be)){let Zt=y&&w.sliceDoc(be,be+3*h.length)==h+h+h?h+h+h:h;return{changes:{from:be,to:be+Zt.length,insert:Zt},range:g.OF.cursor(be+Zt.length)}}}else{if(y&&w.sliceDoc(be-2*h.length,be)==h+h&&(nt=i(w,be-2*h.length,F))>-1&&er(w,nt))return{changes:{insert:h+h+h+h,from:be},effects:ln.of(be+h.length),range:g.OF.cursor(be+h.length)};if(w.charCategorizer(be)(ut)!=g.Je.Word&&i(w,be,F)>-1&&!function D(w,h,y,_){let F=(0,R.mv)(w).resolveInner(h,-1),Z=_.reduce((he,ye)=>Math.max(he,ye.length),0);for(let he=0;he<5;he++){let ye=w.sliceDoc(F.from,Math.min(F.to,F.from+y.length+Z)),be=ye.indexOf(y);if(!be||be>-1&&_.indexOf(ye.slice(0,be))>-1){let nt=F.firstChild;for(;nt&&nt.from==F.from&&nt.to-nt.from>y.length+be;){if(w.sliceDoc(nt.to-y.length,nt.to)==y)return!1;nt=nt.firstChild}return!0}let ut=F.to==h&&F.parent;if(!ut)break;F=ut}return!1}(w,be,h,F))return{changes:{insert:h+h,from:be},effects:ln.of(be+h.length),range:g.OF.cursor(be+h.length)}}return{range:Z=ye}});return Z?null:w.update(he,{scrollIntoView:!0,userEvent:"input.type"})}function er(w,h){let y=(0,R.mv)(w).resolveInner(h+1);return y.parent&&y.from==h}function i(w,h,y){let _=w.charCategorizer(h);if(_(w.sliceDoc(h-1,h))!=g.Je.Word)return h;for(let F of y){let Z=h-F.length;if(w.sliceDoc(Z,h)==F&&_(w.sliceDoc(Z-1,Z))!=g.Je.Word)return Z}return-1}const a=[{key:"Ctrl-Space",run:jt},{mac:"Alt-`",run:jt},{mac:"Alt-i",run:jt},{key:"Escape",run:w=>{let h=w.state.field(Ce,!1);return!(!h||!h.active.some(y=>0!=y.state)||(w.dispatch({effects:mi.of(null)}),0))}},{key:"ArrowDown",run:gt(!0)},{key:"ArrowUp",run:gt(!1)},{key:"PageDown",run:gt(!0,"page")},{key:"PageUp",run:gt(!1,"page")},{key:"Enter",run:w=>{let h=w.state.field(Ce,!1);return!(w.state.readOnly||!h||!h.open||h.open.selected<0||h.open.disabled||Date.now()-h.open.timestamp<w.state.facet(si).interactionDelay)&&je(w,h.open.options[h.open.selected])}}],b=g.Nb.highest(j.w4.computeN([si],w=>w.facet(si).defaultKeymap?[a]:[]));var Re=We(738);const tr=[(0,j.$K)(),(0,j.Wu)(),(0,j.N$)(),(0,le.b6)(),(0,R.Lv)(),(0,j.VH)(),(0,j.A)(),g.$t.allowMultipleSelections.of(!0),(0,R.WD)(),(0,R.y9)(R.Zt,{fallback:!0}),(0,R.SG)(),function rr(){return[Yn,Cn]}(),function l(w={}){return[Ri,Ce,si.of(w),gn,b,rn]}(),(0,j.D4)(),(0,j.HJ)(),(0,j.dz)(),function Qt(w){let h=[oi,ri];return w&&h.push(Ct.of(w)),h}(),j.w4.of([...Pn,...le.pw,...f,...le.cL,...R.f7,...a,...Re.$w])]},4937(Ei,At,We){"use strict";function j(){var R=arguments[0];"string"==typeof R&&(R=document.createElement(R));var le=1,Te=arguments[1];if(Te&&"object"==typeof Te&&null==Te.nodeType&&!Array.isArray(Te)){for(var Ve in Te)if(Object.prototype.hasOwnProperty.call(Te,Ve)){var Ye=Te[Ve];"string"==typeof Ye?R.setAttribute(Ve,Ye):null!=Ye&&(R[Ve]=Ye)}le++}for(;le<arguments.length;le++)g(R,arguments[le]);return R}function g(R,le){if("string"==typeof le)R.appendChild(document.createTextNode(le));else if(null!=le)if(null!=le.nodeType)R.appendChild(le);else{if(!Array.isArray(le))throw new RangeError("Unsupported child node: "+le);for(var Te=0;Te<le.length;Te++)g(R,le[Te])}}We.d(At,{A:()=>j})},2316(Ei,At,We){"use strict";We.d(At,{G:()=>Te});const g=typeof Symbol>"u"?"__\u037c":Symbol.for("\u037c"),R=typeof Symbol>"u"?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),le=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Te{constructor(ct,Ke){this.rules=[];let{finish:X}=Ke||{};function ae(ge){return/^@/.test(ge)?[ge]:ge.split(/,\s*/)}function se(ge,we,dt,ze){let Ct=[],Qt=/^@(\w+)\b/.exec(ge[0]),Wt=Qt&&"keyframes"==Qt[1];if(Qt&&null==we)return dt.push(ge[0]+";");for(let Mt in we){let He=we[Mt];if(/&/.test(Mt))se(Mt.split(/,\s*/).map(Nt=>ge.map(ri=>Nt.replace(/&/,ri))).reduce((Nt,ri)=>Nt.concat(ri)),He,dt);else if(He&&"object"==typeof He){if(!Qt)throw new RangeError("The value of a property ("+Mt+") should be a primitive value.");se(ae(Mt),He,Ct,Wt)}else null!=He&&Ct.push(Mt.replace(/_.*/,"").replace(/[A-Z]/g,Nt=>"-"+Nt.toLowerCase())+": "+He+";")}(Ct.length||Wt)&&dt.push((!X||Qt||ze?ge:ge.map(X)).join(", ")+" {"+Ct.join(" ")+"}")}for(let ge in ct)se(ae(ge),ct[ge],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let ct=le[g]||1;return le[g]=ct+1,"\u037c"+ct.toString(36)}static mount(ct,Ke,X){let ae=ct[R],se=X&&X.nonce;ae?se&&ae.setNonce(se):ae=new Ye(ct,se),ae.mount(Array.isArray(Ke)?Ke:[Ke],ct)}}let Ve=new Map;class Ye{constructor(ct,Ke){let X=ct.ownerDocument||ct,ae=X.defaultView;if(!ct.head&&ct.adoptedStyleSheets&&ae.CSSStyleSheet){let se=Ve.get(X);if(se)return ct[R]=se;this.sheet=new ae.CSSStyleSheet,Ve.set(X,this)}else this.styleTag=X.createElement("style"),Ke&&this.styleTag.setAttribute("nonce",Ke);this.modules=[],ct[R]=this}mount(ct,Ke){let X=this.sheet,ae=0,se=0;for(let ge=0;ge<ct.length;ge++){let we=ct[ge],dt=this.modules.indexOf(we);if(dt<se&&dt>-1&&(this.modules.splice(dt,1),se--,dt=-1),-1==dt){if(this.modules.splice(se++,0,we),X)for(let ze=0;ze<we.rules.length;ze++)X.insertRule(we.rules[ze],ae++)}else{for(;se<dt;)ae+=this.modules[se++].rules.length;ae+=we.rules.length,se++}}if(X)Ke.adoptedStyleSheets.indexOf(this.sheet)<0&&(Ke.adoptedStyleSheets=[this.sheet,...Ke.adoptedStyleSheets]);else{let ge="";for(let dt=0;dt<this.modules.length;dt++)ge+=this.modules[dt].getRules()+"\n";this.styleTag.textContent=ge;let we=Ke.head||Ke;this.styleTag.parentNode!=we&&we.insertBefore(this.styleTag,we.firstChild)}}setNonce(ct){this.styleTag&&this.styleTag.getAttribute("nonce")!=ct&&this.styleTag.setAttribute("nonce",ct)}}}}]);
|