
/**
 * 由 Fantastic-admin 提供技术支持
 * Powered by Fantastic-admin
 * Gitee  https://gitee.com/hooray/fantastic-admin
 * Github https://github.com/hooray/fantastic-admin
 */
  
import{E as qt,C as lr,a as ar,t as y,d as hr,s as Dn,l as fr,L as cr,i as ur,g as Et,f as Or,h as dr,b as pr,I as gr,N as mr}from"./notice-df3af3df.js";import"./index-c9fa3ab3.js";import"./index-9d6935c8.js";import"./config-73878767.js";class Q{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=$e(this,e,t);let n=[];return this.decompose(0,e,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(t,this.length,n,1),J.from(n,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=$e(this,e,t);let i=[];return this.decompose(e,t,i,0),J.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),n=new Ze(this),r=new Ze(e);for(let o=t,l=t;;){if(n.next(o),r.next(o),o=0,n.lineBreak!=r.lineBreak||n.done!=r.done||n.value!=r.value)return!1;if(l+=n.value.length,n.done||l>=i)return!0}}iter(e=1){return new Ze(this,e)}iterRange(e,t=this.length){return new Zn(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let n=this.line(e).from;i=this.iterRange(n,Math.max(n,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Ln(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Q.empty:e.length<=32?new V(e):J.from(V.split(e,[]))}}class V extends Q{constructor(e,t=xr(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,n){for(let r=0;;r++){let o=this.text[r],l=n+o.length;if((t?i:l)>=e)return new Sr(n,l,i,o);n=l+1,i++}}decompose(e,t,i,n){let r=e<=0&&t>=this.length?this:new V(Yi(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(n&1){let o=i.pop(),l=gt(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new V(l,o.length+r.length));else{let a=l.length>>1;i.push(new V(l.slice(0,a)),new V(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof V))return super.replace(e,t,i);[e,t]=$e(this,e,t);let n=gt(this.text,gt(i.text,Yi(this.text,0,e)),t),r=this.length+i.length-(t-e);return n.length<=32?new V(n,r):J.from(V.split(n,[]),r)}sliceString(e,t=this.length,i=`
`){[e,t]=$e(this,e,t);let n="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let l=this.text[o],a=r+l.length;r>e&&o&&(n+=i),e<a&&t>r&&(n+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return n}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],n=-1;for(let r of e)i.push(r),n+=r.length+1,i.length==32&&(t.push(new V(i,n)),i=[],n=-1);return n>-1&&t.push(new V(i,n)),t}}class J extends Q{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,n){for(let r=0;;r++){let o=this.children[r],l=n+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,n);n=l+1,i=a+1}}decompose(e,t,i,n){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let l=this.children[r],a=o+l.length;if(e<=a&&t>=o){let f=n&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!f?i.push(l):l.decompose(e-o,t-o,i,f)}o=a+1}}replace(e,t,i){if([e,t]=$e(this,e,t),i.lines<this.lines)for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],l=r+o.length;if(e>=r&&t<=l){let a=o.replace(e-r,t-r,i),f=this.lines-o.lines+a.lines;if(a.lines<f>>5-1&&a.lines>f>>5+1){let h=this.children.slice();return h[n]=a,new J(h,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
`){[e,t]=$e(this,e,t);let n="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let l=this.children[r],a=o+l.length;o>e&&r&&(n+=i),e<a&&t>o&&(n+=l.sliceString(e-o,t-o,i)),o=a+1}return n}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof J))return 0;let i=0,[n,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;n+=t,r+=t){if(n==o||r==l)return i;let a=this.children[n],f=e.children[r];if(a!=f)return i+a.scanIdentical(f,t);i+=a.length+1}}static from(e,t=e.reduce((i,n)=>i+n.length+1,-1)){let i=0;for(let O of e)i+=O.lines;if(i<32){let O=[];for(let d of e)d.flatten(O);return new V(O,t)}let n=Math.max(32,i>>5),r=n<<1,o=n>>1,l=[],a=0,f=-1,h=[];function c(O){let d;if(O.lines>r&&O instanceof J)for(let g of O.children)c(g);else O.lines>o&&(a>o||!a)?(u(),l.push(O)):O instanceof V&&a&&(d=h[h.length-1])instanceof V&&O.lines+d.lines<=32?(a+=O.lines,f+=O.length+1,h[h.length-1]=new V(d.text.concat(O.text),d.length+1+O.length)):(a+O.lines>n&&u(),a+=O.lines,f+=O.length+1,h.push(O))}function u(){a!=0&&(l.push(h.length==1?h[0]:J.from(h,f)),f=-1,a=h.length=0)}for(let O of e)c(O);return u(),l.length==1?l[0]:new J(l,t)}}Q.empty=new V([""],0);function xr(s){let e=-1;for(let t of s)e+=t.length+1;return e}function gt(s,e,t=0,i=1e9){for(let n=0,r=0,o=!0;r<s.length&&n<=i;r++){let l=s[r],a=n+l.length;a>=t&&(a>i&&(l=l.slice(0,i-n)),n<t&&(l=l.slice(t-n)),o?(e[e.length-1]+=l,o=!1):e.push(l)),n=a+1}return e}function Yi(s,e,t){return gt(s,[""],e,t)}class Ze{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof V?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],r=this.offsets[i],o=r>>1,l=n instanceof V?n.text.length:n.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(n instanceof V){let a=n.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=n.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof V?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Zn{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new Ze(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:n}=this.cursor.next(e);return this.pos+=(n.length+e)*t,this.value=n.length<=i?n:t<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Ln{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:n}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Q.prototype[Symbol.iterator]=function(){return this.iter()},Ze.prototype[Symbol.iterator]=Zn.prototype[Symbol.iterator]=Ln.prototype[Symbol.iterator]=function(){return this});class Sr{constructor(e,t,i,n){this.from=e,this.to=t,this.number=i,this.text=n}get length(){return this.to-this.from}}function $e(s,e,t){return e=Math.max(0,Math.min(s.length,e)),[e,Math.max(e,Math.min(s.length,t))]}let Qe="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(s=>s?parseInt(s,36):1);for(let s=1;s<Qe.length;s++)Qe[s]+=Qe[s-1];function wr(s){for(let e=1;e<Qe.length;e+=2)if(Qe[e]>s)return Qe[e-1]<=s;return!1}function Di(s){return s>=127462&&s<=127487}const Zi=8205;function ie(s,e,t=!0,i=!0){return(t?Gn:Tr)(s,e,i)}function Gn(s,e,t){if(e==s.length)return e;e&&Bn(s.charCodeAt(e))&&In(s.charCodeAt(e-1))&&e--;let i=mt(s,e);for(e+=Ut(i);e<s.length;){let n=mt(s,e);if(i==Zi||n==Zi||t&&wr(n))e+=Ut(n),i=n;else if(Di(n)){let r=0,o=e-2;for(;o>=0&&Di(mt(s,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Tr(s,e,t){for(;e>0;){let i=Gn(s,e-2,t);if(i<e)return i;e--}return 0}function Bn(s){return s>=56320&&s<57344}function In(s){return s>=55296&&s<56320}function mt(s,e){let t=s.charCodeAt(e);if(!In(t)||e+1==s.length)return t;let i=s.charCodeAt(e+1);return Bn(i)?(t-55296<<10)+(i-56320)+65536:t}function Ut(s){return s<65536?1:2}const Nt=/\r\n?|\n/;var G=function(s){return s[s.Simple=0]="Simple",s[s.TrackDel=1]="TrackDel",s[s.TrackBefore=2]="TrackBefore",s[s.TrackAfter=3]="TrackAfter",s}(G||(G={}));class se{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,n=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(i,n,r),n+=r):n+=o,i+=r}}iterChangedRanges(e,t=!1){zt(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],n=this.sections[t++];n<0?e.push(i,n):e.push(n,i)}return new se(e)}composeDesc(e){return this.empty?e:e.empty?this:Fn(this,e)}mapDesc(e,t=!1){return e.empty?this:_t(this,e,t)}mapPos(e,t=-1,i=G.Simple){let n=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],f=n+l;if(a<0){if(f>e)return r+(e-n);r+=l}else{if(i!=G.Simple&&f>=e&&(i==G.TrackDel&&n<e&&f>e||i==G.TrackBefore&&n<e||i==G.TrackAfter&&f>e))return null;if(f>e||f==e&&t<0&&!l)return e==n||t<0?r:r+a;r+=a}n=f}if(e>n)throw new RangeError(`Position ${e} is out of range for changeset of length ${n}`);return r}touchesRange(e,t=e){for(let i=0,n=0;i<this.sections.length&&n<=t;){let r=this.sections[i++],o=this.sections[i++],l=n+r;if(o>=0&&n<=t&&l>=e)return n<e&&l>t?"cover":!0;n=l}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],n=this.sections[t++];e+=(e?" ":"")+i+(n>=0?":"+n:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new se(e)}static create(e){return new se(e)}}class C extends se{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return zt(this,(t,i,n,r,o)=>e=e.replace(n,n+(i-t),o),!1),e}mapDesc(e,t=!1){return _t(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let n=0,r=0;n<t.length;n+=2){let o=t[n],l=t[n+1];if(l>=0){t[n]=l,t[n+1]=o;let a=n>>1;for(;i.length<a;)i.push(Q.empty);i.push(o?e.slice(r,r+o):Q.empty)}r+=o}return new C(t,i)}compose(e){return this.empty?e:e.empty?this:Fn(this,e,!0)}map(e,t=!1){return e.empty?this:_t(this,e,t,!0)}iterChanges(e,t=!1){zt(this,e,t)}get desc(){return se.create(this.sections)}filter(e){let t=[],i=[],n=[],r=new Ie(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&r.len==0;){if(r.done)break e;let h=Math.min(r.len,a-l);D(n,h,-1);let c=r.ins==-1?-1:r.off==0?r.ins:0;D(t,h,c),c>0&&fe(i,t,r.text),r.forward(h),l+=h}let f=e[o++];for(;l<f;){if(r.done)break e;let h=Math.min(r.len,f-l);D(t,h,-1),D(n,h,r.ins==-1?-1:r.off==0?r.ins:0),r.forward(h),l+=h}}return{changes:new C(t,i),filtered:se.create(n)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],n=this.sections[t+1];n<0?e.push(i):n==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let n=[],r=[],o=0,l=null;function a(h=!1){if(!h&&!n.length)return;o<t&&D(n,t-o,-1);let c=new C(n,r);l=l?l.compose(c.map(l)):c,n=[],r=[],o=0}function f(h){if(Array.isArray(h))for(let c of h)f(c);else if(h instanceof C){if(h.length!=t)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${t})`);a(),l=l?l.compose(h.map(l)):h}else{let{from:c,to:u=c,insert:O}=h;if(c>u||c<0||u>t)throw new RangeError(`Invalid change range ${c} to ${u} (in doc of length ${t})`);let d=O?typeof O=="string"?Q.of(O.split(i||Nt)):O:Q.empty,g=d.length;if(c==u&&g==0)return;c<o&&a(),c>o&&D(n,c-o,-1),D(n,u-c,g),fe(r,n,d),o=u}}return f(e),a(!l),l}static empty(e){return new C(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let n=0;n<e.length;n++){let r=e[n];if(typeof r=="number")t.push(r,-1);else{if(!Array.isArray(r)||typeof r[0]!="number"||r.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length<n;)i.push(Q.empty);i[n]=Q.of(r.slice(1)),t.push(r[0],i[n].length)}}}return new C(t,i)}static createSet(e,t){return new C(e,t)}}function D(s,e,t,i=!1){if(e==0&&t<=0)return;let n=s.length-2;n>=0&&t<=0&&t==s[n+1]?s[n]+=e:e==0&&s[n]==0?s[n+1]+=t:i?(s[n]+=e,s[n+1]+=t):s.push(e,t)}function fe(s,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<s.length)s[s.length-1]=s[s.length-1].append(t);else{for(;s.length<i;)s.push(Q.empty);s.push(t)}}function zt(s,e,t){let i=s.inserted;for(let n=0,r=0,o=0;o<s.sections.length;){let l=s.sections[o++],a=s.sections[o++];if(a<0)n+=l,r+=l;else{let f=n,h=r,c=Q.empty;for(;f+=l,h+=a,a&&i&&(c=c.append(i[o-2>>1])),!(t||o==s.sections.length||s.sections[o+1]<0);)l=s.sections[o++],a=s.sections[o++];e(n,f,r,h,c),n=f,r=h}}}function _t(s,e,t,i=!1){let n=[],r=i?[]:null,o=new Ie(s),l=new Ie(e);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let f=Math.min(o.len,l.len);D(n,f,-1),o.forward(f),l.forward(f)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!t))){let f=l.len;for(D(n,l.ins,-1);f;){let h=Math.min(o.len,f);o.ins>=0&&a<o.i&&o.len<=h&&(D(n,0,o.ins),r&&fe(r,n,o.text),a=o.i),o.forward(h),f-=h}l.next()}else if(o.ins>=0){let f=0,h=o.len;for(;h;)if(l.ins==-1){let c=Math.min(h,l.len);f+=c,h-=c,l.forward(c)}else if(l.ins==0&&l.len<h)h-=l.len,l.next();else break;D(n,f,a<o.i?o.ins:0),r&&a<o.i&&fe(r,n,o.text),a=o.i,o.forward(o.len-h)}else{if(o.done&&l.done)return r?C.createSet(n,r):se.create(n);throw new Error("Mismatched change set lengths")}}function Fn(s,e,t=!1){let i=[],n=t?[]:null,r=new Ie(s),o=new Ie(e);for(let l=!1;;){if(r.done&&o.done)return n?C.createSet(i,n):se.create(i);if(r.ins==0)D(i,r.len,0,l),r.next();else if(o.len==0&&!o.done)D(i,0,o.ins,l),n&&fe(n,i,o.text),o.next();else{if(r.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(r.len2,o.len),f=i.length;if(r.ins==-1){let h=o.ins==-1?-1:o.off?0:o.ins;D(i,a,h,l),n&&h&&fe(n,i,o.text)}else o.ins==-1?(D(i,r.off?0:r.len,a,l),n&&fe(n,i,r.textBit(a))):(D(i,r.off?0:r.len,o.off?0:o.ins,l),n&&!o.off&&fe(n,i,o.text));l=(r.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>f),r.forward2(a),o.forward(a)}}}}class Ie{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?Q.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?Q.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class ge{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,n;return this.empty?i=n=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),n=e.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new ge(i,n,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return S.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return S.range(this.anchor,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return S.range(e.anchor,e.head)}static create(e,t,i){return new ge(e,t,i)}}class S{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:S.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new S([this.main],0)}addRange(e,t=!0){return S.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,S.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new S(e.ranges.map(t=>ge.fromJSON(t)),e.main)}static single(e,t=e){return new S([S.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;n<e.length;n++){let r=e[n];if(r.empty?r.from<=i:r.from<i)return S.normalized(e.slice(),t);i=r.to}return new S(e,t)}static cursor(e,t=0,i,n){return ge.create(e,e,(t==0?0:t<0?8:16)|(i==null?7:Math.min(6,i))|(n??16777215)<<6)}static range(e,t,i,n){let r=(i??16777215)<<6|(n==null?7:Math.min(6,n));return t<e?ge.create(t,e,48|r):ge.create(e,t,(t>e?8:0)|r)}static normalized(e,t=0){let i=e[t];e.sort((n,r)=>n.from-r.from),t=e.indexOf(i);for(let n=1;n<e.length;n++){let r=e[n],o=e[n-1];if(r.empty?r.from<=o.to:r.from<o.to){let l=o.from,a=Math.max(r.to,o.to);n<=t&&t--,e.splice(--n,2,r.anchor>r.head?S.range(a,l):S.range(l,a))}}return new S(e,t)}}function Un(s,e){for(let t of s.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let bi=0;class b{constructor(e,t,i,n,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=n,this.id=bi++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(e={}){return new b(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:yi),!!e.static,e.enables)}of(e){return new xt([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new xt(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new xt(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function yi(s,e){return s==e||s.length==e.length&&s.every((t,i)=>t===e[i])}class xt{constructor(e,t,i,n){this.dependencies=e,this.facet=t,this.type=i,this.value=n,this.id=bi++}dynamicSlot(e){var t;let i=this.value,n=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,f=!1,h=[];for(let c of this.dependencies)c=="doc"?a=!0:c=="selection"?f=!0:((t=e[c.id])!==null&&t!==void 0?t:1)&1||h.push(e[c.id]);return{create(c){return c.values[o]=i(c),1},update(c,u){if(a&&u.docChanged||f&&(u.docChanged||u.selection)||jt(c,h)){let O=i(c);if(l?!Li(O,c.values[o],n):!n(O,c.values[o]))return c.values[o]=O,1}return 0},reconfigure:(c,u)=>{let O,d=u.config.address[r];if(d!=null){let g=yt(u,d);if(this.dependencies.every(p=>p instanceof b?u.facet(p)===c.facet(p):p instanceof be?u.field(p,!1)==c.field(p,!1):!0)||(l?Li(O=i(c),g,n):n(O=i(c),g)))return c.values[o]=g,0}else O=i(c);return c.values[o]=O,1}}}}function Li(s,e,t){if(s.length!=e.length)return!1;for(let i=0;i<s.length;i++)if(!t(s[i],e[i]))return!1;return!0}function jt(s,e){let t=!1;for(let i of e)Le(s,i)&1&&(t=!0);return t}function br(s,e,t){let i=t.map(a=>s[a.id]),n=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=s[e.id]>>1;function l(a){let f=[];for(let h=0;h<i.length;h++){let c=yt(a,i[h]);if(n[h]==2)for(let u of c)f.push(u);else f.push(c)}return e.combine(f)}return{create(a){for(let f of i)Le(a,f);return a.values[o]=l(a),1},update(a,f){if(!jt(a,r))return 0;let h=l(a);return e.compare(h,a.values[o])?0:(a.values[o]=h,1)},reconfigure(a,f){let h=jt(a,i),c=f.config.facets[e.id],u=f.facet(e);if(c&&!h&&yi(t,c))return a.values[o]=u,0;let O=l(a);return e.compare(O,u)?(a.values[o]=u,0):(a.values[o]=O,1)}}}const Gi=b.define({static:!0});class be{constructor(e,t,i,n,r){this.id=e,this.createF=t,this.updateF=i,this.compareF=n,this.spec=r,this.provides=void 0}static define(e){let t=new be(bi++,e.create,e.update,e.compare||((i,n)=>i===n),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Gi).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,n)=>{let r=i.values[t],o=this.updateF(r,n);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,n)=>n.config.address[this.id]!=null?(i.values[t]=n.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,Gi.of({field:this,create:e})]}get extension(){return this}}const pe={lowest:4,low:3,default:2,high:1,highest:0};function Xe(s){return e=>new Nn(e,s)}const Pi={highest:Xe(pe.highest),high:Xe(pe.high),default:Xe(pe.default),low:Xe(pe.low),lowest:Xe(pe.lowest)};class Nn{constructor(e,t){this.inner=e,this.prec=t}}class $t{of(e){return new Ht(this,e)}reconfigure(e){return $t.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Ht{constructor(e,t){this.compartment=e,this.inner=t}}class bt{constructor(e,t,i,n,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=n,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let n=[],r=Object.create(null),o=new Map;for(let u of yr(e,t,o))u instanceof be?n.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],f=[];for(let u of n)l[u.id]=f.length<<1,f.push(O=>u.slot(O));let h=i==null?void 0:i.config.facets;for(let u in r){let O=r[u],d=O[0].facet,g=h&&h[u]||[];if(O.every(p=>p.type==0))if(l[d.id]=a.length<<1|1,yi(g,O))a.push(i.facet(d));else{let p=d.combine(O.map(m=>m.value));a.push(i&&d.compare(p,i.facet(d))?i.facet(d):p)}else{for(let p of O)p.type==0?(l[p.id]=a.length<<1|1,a.push(p.value)):(l[p.id]=f.length<<1,f.push(m=>p.dynamicSlot(m)));l[d.id]=f.length<<1,f.push(p=>br(p,d,O))}}let c=f.map(u=>u(l));return new bt(e,o,c,l,a,r)}}function yr(s,e,t){let i=[[],[],[],[],[]],n=new Map;function r(o,l){let a=n.get(o);if(a!=null){if(a<=l)return;let f=i[a].indexOf(o);f>-1&&i[a].splice(f,1),o instanceof Ht&&t.delete(o.compartment)}if(n.set(o,l),Array.isArray(o))for(let f of o)r(f,l);else if(o instanceof Ht){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let f=e.get(o.compartment)||o.inner;t.set(o.compartment,f),r(f,l)}else if(o instanceof Nn)r(o.inner,o.prec);else if(o instanceof be)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof xt)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,pe.default);else{let f=o.extension;if(!f)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(f,l)}}return r(s,pe.default),i.reduce((o,l)=>o.concat(l))}function Le(s,e){if(e&1)return 2;let t=e>>1,i=s.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;s.status[t]=4;let n=s.computeSlot(s,s.config.dynamicSlots[t]);return s.status[t]=2|n}function yt(s,e){return e&1?s.config.staticValues[e>>1]:s.values[e>>1]}const zn=b.define(),Kt=b.define({combine:s=>s.some(e=>e),static:!0}),_n=b.define({combine:s=>s.length?s[0]:void 0,static:!0}),jn=b.define(),Hn=b.define(),Kn=b.define(),Jn=b.define({combine:s=>s.length?s[0]:!1});class ye{constructor(e,t){this.type=e,this.value=t}static define(){return new Pr}}class Pr{of(e){return new ye(this,e)}}class Qr{constructor(e){this.map=e}of(e){return new X(this,e)}}class X{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new X(this.type,t)}is(e){return this.type==e}static define(e={}){return new Qr(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let n of e){let r=n.map(t);r&&i.push(r)}return i}}X.reconfigure=X.define();X.appendConfig=X.define();class L{constructor(e,t,i,n,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=n,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&Un(i,t.newLength),r.some(l=>l.type==L.time)||(this.annotations=r.concat(L.time.of(Date.now())))}static create(e,t,i,n,r,o){return new L(e,t,i,n,r,o)}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(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(L.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}L.time=ye.define();L.userEvent=ye.define();L.addToHistory=ye.define();L.remote=ye.define();function vr(s,e){let t=[];for(let i=0,n=0;;){let r,o;if(i<s.length&&(n==e.length||e[n]>=s[i]))r=s[i++],o=s[i++];else if(n<e.length)r=e[n++],o=e[n++];else return t;!t.length||t[t.length-1]<r?t.push(r,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function es(s,e,t){var i;let n,r,o;return t?(n=e.changes,r=C.empty(e.changes.length),o=s.changes.compose(e.changes)):(n=e.changes.map(s.changes),r=s.changes.mapDesc(e.changes,!0),o=s.changes.compose(n)),{changes:o,selection:e.selection?e.selection.map(r):(i=s.selection)===null||i===void 0?void 0:i.map(n),effects:X.mapEffects(s.effects,n).concat(X.mapEffects(e.effects,r)),annotations:s.annotations.length?s.annotations.concat(e.annotations):e.annotations,scrollIntoView:s.scrollIntoView||e.scrollIntoView}}function Jt(s,e,t){let i=e.selection,n=ve(e.annotations);return e.userEvent&&(n=n.concat(L.userEvent.of(e.userEvent))),{changes:e.changes instanceof C?e.changes:C.of(e.changes||[],t,s.facet(_n)),selection:i&&(i instanceof S?i:S.single(i.anchor,i.head)),effects:ve(e.effects),annotations:n,scrollIntoView:!!e.scrollIntoView}}function ts(s,e,t){let i=Jt(s,e.length?e[0]:{},s.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let r=1;r<e.length;r++){e[r].filter===!1&&(t=!1);let o=!!e[r].sequential;i=es(i,Jt(s,e[r],o?i.changes.newLength:s.doc.length),o)}let n=L.create(s,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return qr(t?kr(n):n)}function kr(s){let e=s.startState,t=!0;for(let n of e.facet(jn)){let r=n(s);if(r===!1){t=!1;break}Array.isArray(r)&&(t=t===!0?r:vr(t,r))}if(t!==!0){let n,r;if(t===!1)r=s.changes.invertedDesc,n=C.empty(e.doc.length);else{let o=s.changes.filter(t);n=o.changes,r=o.filtered.mapDesc(o.changes).invertedDesc}s=L.create(e,n,s.selection&&s.selection.map(r),X.mapEffects(s.effects,r),s.annotations,s.scrollIntoView)}let i=e.facet(Hn);for(let n=i.length-1;n>=0;n--){let r=i[n](s);r instanceof L?s=r:Array.isArray(r)&&r.length==1&&r[0]instanceof L?s=r[0]:s=ts(e,ve(r),!1)}return s}function qr(s){let e=s.startState,t=e.facet(Kn),i=s;for(let n=t.length-1;n>=0;n--){let r=t[n](s);r&&Object.keys(r).length&&(i=es(i,Jt(e,r,s.changes.newLength),!0))}return i==s?s:L.create(e,s.changes,s.selection,i.effects,i.annotations,i.scrollIntoView)}const $r=[];function ve(s){return s==null?$r:Array.isArray(s)?s:[s]}var ne=function(s){return s[s.Word=0]="Word",s[s.Space=1]="Space",s[s.Other=2]="Other",s}(ne||(ne={}));const Rr=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let ei;try{ei=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Wr(s){if(ei)return ei.test(s);for(let e=0;e<s.length;e++){let t=s[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||Rr.test(t)))return!0}return!1}function Ar(s){return e=>{if(!/\S/.test(e))return ne.Space;if(Wr(e))return ne.Word;for(let t=0;t<s.length;t++)if(e.indexOf(s[t])>-1)return ne.Word;return ne.Other}}class ${constructor(e,t,i,n,r,o){this.config=e,this.doc=t,this.selection=i,this.values=n,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)Le(this,l<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return Le(this,i),yt(this,i)}update(...e){return ts(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:n}=t;for(let l of e.effects)l.is($t.reconfigure)?(t&&(n=new Map,t.compartments.forEach((a,f)=>n.set(f,a)),t=null),n.set(l.value.compartment,l.value.extension)):l.is(X.reconfigure)?(t=null,i=l.value):l.is(X.appendConfig)&&(t=null,i=ve(i).concat(l.value));let r;t?r=e.startState.values.slice():(t=bt.resolve(i,n,this),r=new $(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,f)=>f.reconfigure(a,this),null).values);let o=e.startState.facet(Kt)?e.newSelection:e.newSelection.asSingle();new $(t,e.newDoc,o,r,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:S.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),n=this.changes(i.changes),r=[i.range],o=ve(i.effects);for(let l=1;l<t.ranges.length;l++){let a=e(t.ranges[l]),f=this.changes(a.changes),h=f.map(n);for(let u=0;u<l;u++)r[u]=r[u].map(h);let c=n.mapDesc(f,!0);r.push(a.range.map(c)),n=n.compose(h),o=X.mapEffects(o,h).concat(X.mapEffects(ve(a.effects),c))}return{changes:n,selection:S.create(r,t.mainIndex),effects:o}}changes(e=[]){return e instanceof C?e:C.of(e,this.doc.length,this.facet($.lineSeparator))}toText(e){return Q.of(e.split(this.facet($.lineSeparator)||Nt))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Le(this,t),yt(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let n=e[i];n instanceof be&&this.config.address[n.id]!=null&&(t[i]=n.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let n=[];if(i){for(let r in i)if(Object.prototype.hasOwnProperty.call(e,r)){let o=i[r],l=e[r];n.push(o.init(a=>o.spec.fromJSON(l,a)))}}return $.create({doc:e.doc,selection:S.fromJSON(e.selection),extensions:t.extensions?n.concat([t.extensions]):n})}static create(e={}){let t=bt.resolve(e.extensions||[],new Map),i=e.doc instanceof Q?e.doc:Q.of((e.doc||"").split(t.staticFacet($.lineSeparator)||Nt)),n=e.selection?e.selection instanceof S?e.selection:S.single(e.selection.anchor,e.selection.head):S.single(0);return Un(n,i.length),t.staticFacet(Kt)||(n=n.asSingle()),new $(t,i,n,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet($.tabSize)}get lineBreak(){return this.facet($.lineSeparator)||`
`}get readOnly(){return this.facet(Jn)}phrase(e,...t){for(let i of this.facet($.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,n)=>{if(n=="$")return"$";let r=+(n||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let n=[];for(let r of this.facet(zn))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&n.push(o[e]);return n}charCategorizer(e){return Ar(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:n}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=ie(t,o,!1);if(r(t.slice(a,o))!=ne.Word)break;o=a}for(;l<n;){let a=ie(t,l);if(r(t.slice(l,a))!=ne.Word)break;l=a}return o==l?null:S.range(o+i,l+i)}}$.allowMultipleSelections=Kt;$.tabSize=b.define({combine:s=>s.length?s[0]:4});$.lineSeparator=_n;$.readOnly=Jn;$.phrases=b.define({compare(s,e){let t=Object.keys(s),i=Object.keys(e);return t.length==i.length&&t.every(n=>s[n]==e[n])}});$.languageData=zn;$.changeFilter=jn;$.transactionFilter=Hn;$.transactionExtender=Kn;$t.reconfigure=X.define();class Se{eq(e){return this==e}range(e,t=e){return Fe.create(e,t,this)}}Se.prototype.startSide=Se.prototype.endSide=0;Se.prototype.point=!1;Se.prototype.mapMode=G.TrackDel;class Fe{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new Fe(e,t,i)}}function ti(s,e){return s.from-e.from||s.value.startSide-e.value.startSide}class Qi{constructor(e,t,i,n){this.from=e,this.to=t,this.value=i,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,n=0){let r=i?this.to:this.from;for(let o=n,l=r.length;;){if(o==l)return o;let a=o+l>>1,f=r[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return f>=0?o:l;f>=0?l=a:o=a+1}}between(e,t,i,n){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);r<o;r++)if(n(this.from[r]+e,this.to[r]+e,this.value[r])===!1)return!1}map(e,t){let i=[],n=[],r=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let f=this.value[a],h=this.from[a]+e,c=this.to[a]+e,u,O;if(h==c){let d=t.mapPos(h,f.startSide,f.mapMode);if(d==null||(u=O=d,f.startSide!=f.endSide&&(O=t.mapPos(h,f.endSide),O<u)))continue}else if(u=t.mapPos(h,f.startSide),O=t.mapPos(c,f.endSide),u>O||u==O&&f.startSide>0&&f.endSide<=0)continue;(O-u||f.endSide-f.startSide)<0||(o<0&&(o=u),f.point&&(l=Math.max(l,O-u)),i.push(f),n.push(u-o),r.push(O-o))}return{mapped:i.length?new Qi(n,r,i,l):null,pos:o}}}class R{constructor(e,t,i,n){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=n}static create(e,t,i,n){return new R(e,t,i,n)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:n=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(ti)),this.isEmpty)return t.length?R.of(t):this;let l=new is(this,null,-1).goto(0),a=0,f=[],h=new Pt;for(;l.value||a<t.length;)if(a<t.length&&(l.from-t[a].from||l.startSide-t[a].value.startSide)>=0){let c=t[a++];h.addInner(c.from,c.to,c.value)||f.push(c)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(l.chunkIndex)<t[a].from)&&(!o||n>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&h.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||n>l.to||r<l.from||o(l.from,l.to,l.value))&&(h.addInner(l.from,l.to,l.value)||f.push(Fe.create(l.from,l.to,l.value))),l.next());return h.finishInner(this.nextLayer.isEmpty&&!f.length?R.empty:this.nextLayer.update({add:f,filter:o,filterFrom:n,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],n=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],f=e.touchesRange(l,l+a.length);if(f===!1)n=Math.max(n,a.maxPoint),t.push(a),i.push(e.mapPos(l));else if(f===!0){let{mapped:h,pos:c}=a.map(l,e);h&&(n=Math.max(n,h.maxPoint),t.push(h),i.push(c))}}let r=this.nextLayer.map(e);return t.length==0?r:new R(i,t,r||R.empty,n)}between(e,t,i){if(!this.isEmpty){for(let n=0;n<this.chunk.length;n++){let r=this.chunkPos[n],o=this.chunk[n];if(t>=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return Ue.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Ue.from(e).goto(t)}static compare(e,t,i,n,r=-1){let o=e.filter(c=>c.maxPoint>0||!c.isEmpty&&c.maxPoint>=r),l=t.filter(c=>c.maxPoint>0||!c.isEmpty&&c.maxPoint>=r),a=Bi(o,l,i),f=new Ee(o,a,r),h=new Ee(l,a,r);i.iterGaps((c,u,O)=>Ii(f,c,h,u,O,n)),i.empty&&i.length==0&&Ii(f,0,h,0,0,n)}static eq(e,t,i=0,n){n==null&&(n=1e9-1);let r=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0),o=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=Bi(r,o),a=new Ee(r,l,0).goto(i),f=new Ee(o,l,0).goto(i);for(;;){if(a.to!=f.to||!ii(a.active,f.active)||a.point&&(!f.point||!a.point.eq(f.point)))return!1;if(a.to>n)return!0;a.next(),f.next()}}static spans(e,t,i,n,r=-1){let o=new Ee(e,null,r).goto(t),l=t,a=o.openStart;for(;;){let f=Math.min(o.to,i);if(o.point){let h=o.activeForPoint(o.to),c=o.pointFrom<t?h.length+1:Math.min(h.length,a);n.point(l,f,o.point,h,c,o.pointRank),a=Math.min(o.openEnd(f),h.length)}else f>l&&(n.span(l,f,o.active,a),a=o.openEnd(f));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,t=!1){let i=new Pt;for(let n of e instanceof Fe?[e]:t?Vr(e):e)i.add(n.from,n.to,n.value);return i.finish()}static join(e){if(!e.length)return R.empty;let t=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let n=e[i];n!=R.empty;n=n.nextLayer)t=new R(n.chunkPos,n.chunk,t,Math.max(n.maxPoint,t.maxPoint));return t}}R.empty=new R([],[],null,-1);function Vr(s){if(s.length>1)for(let e=s[0],t=1;t<s.length;t++){let i=s[t];if(ti(e,i)>0)return s.slice().sort(ti);e=i}return s}R.empty.nextLayer=R.empty;class Pt{finishChunk(e){this.chunks.push(new Qi(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,e&&(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(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new Pt)).add(e,t,i)}addInner(e,t,i){let n=e-this.lastTo||i.startSide-this.last.endSide;if(n<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return n<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(R.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=R.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Bi(s,e,t){let i=new Map;for(let r of s)for(let o=0;o<r.chunk.length;o++)r.chunk[o].maxPoint<=0&&i.set(r.chunk[o],r.chunkPos[o]);let n=new Set;for(let r of e)for(let o=0;o<r.chunk.length;o++){let l=i.get(r.chunk[o]);l!=null&&(t?t.mapPos(l):l)==r.chunkPos[o]&&!(t!=null&&t.touchesRange(l,l+r.chunk[o].length))&&n.add(r.chunk[o])}return n}class is{constructor(e,t,i,n=0){this.layer=e,this.skip=t,this.minPoint=i,this.rank=n}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,i){for(;this.chunkIndex<this.layer.chunk.length;){let n=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(n)||this.layer.chunkEnd(this.chunkIndex)<e||n.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let n=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!i||this.rangeIndex<n)&&this.setRangeIndex(n)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],i=e+t.from[this.rangeIndex];if(this.from=i,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==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=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Ue{constructor(e){this.heap=e}static from(e,t=null,i=-1){let n=[];for(let r=0;r<e.length;r++)for(let o=e[r];!o.isEmpty;o=o.nextLayer)o.maxPoint>=i&&n.push(new is(o,t,i,r));return n.length==1?n[0]:new Ue(n)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)Ct(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)Ct(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Ct(this.heap,0)}}}function Ct(s,e){for(let t=s[e];;){let i=(e<<1)+1;if(i>=s.length)break;let n=s[i];if(i+1<s.length&&n.compare(s[i+1])>=0&&(n=s[i+1],i++),t.compare(n)<0)break;s[i]=t,s[e]=n,e=i}}class Ee{constructor(e,t,i){this.minPoint=i,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=Ue.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){st(this.active,e),st(this.activeTo,e),st(this.activeRank,e),this.minActive=Fi(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:n,rank:r}=this.cursor;for(;t<this.activeRank.length&&(r-this.activeRank[t]||n-this.activeTo[t])>0;)t++;rt(this.active,t,i),rt(this.activeTo,t,n),rt(this.activeRank,t,r),e&&rt(e,t,this.cursor.from),this.minActive=Fi(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let n=this.minActive;if(n>-1&&(this.activeTo[n]-this.cursor.from||this.active[n].endSide-this.cursor.startSide)<0){if(this.activeTo[n]>e){this.to=this.activeTo[n],this.endSide=this.active[n].endSide;break}this.removeActive(n),i&&st(i,n)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=r,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=r.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let n=i.length-1;n>=0&&i[n]<e;n--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function Ii(s,e,t,i,n,r){s.goto(e),t.goto(i);let o=i+n,l=i,a=i-e;for(;;){let f=s.to+a-t.to||s.endSide-t.endSide,h=f<0?s.to+a:t.to,c=Math.min(h,o);if(s.point||t.point?s.point&&t.point&&(s.point==t.point||s.point.eq(t.point))&&ii(s.activeForPoint(s.to),t.activeForPoint(t.to))||r.comparePoint(l,c,s.point,t.point):c>l&&!ii(s.active,t.active)&&r.compareRange(l,c,s.active,t.active),h>o)break;l=h,f<=0&&s.next(),f>=0&&t.next()}}function ii(s,e){if(s.length!=e.length)return!1;for(let t=0;t<s.length;t++)if(s[t]!=e[t]&&!s[t].eq(e[t]))return!1;return!0}function st(s,e){for(let t=e,i=s.length-1;t<i;t++)s[t]=s[t+1];s.pop()}function rt(s,e,t){for(let i=s.length-1;i>=e;i--)s[i+1]=s[i];s[e]=t}function Fi(s,e){let t=-1,i=1e9;for(let n=0;n<e.length;n++)(e[n]-i||s[n].endSide-s[t].endSide)<0&&(t=n,i=e[n]);return t}function Xr(s,e,t,i){for(let n=0,r=0;;){if(r>=e)return n;if(n==s.length)break;r+=s.charCodeAt(n)==9?t-r%t:1,n=ie(s,n)}return i===!0?-1:s.length}const ni="ͼ",Ui=typeof Symbol>"u"?"__"+ni:Symbol.for(ni),si=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Ni=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Re{constructor(e,t){this.rules=[];let{finish:i}=t||{};function n(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,f){let h=[],c=/^@(\w+)\b/.exec(o[0]),u=c&&c[1]=="keyframes";if(c&&l==null)return a.push(o[0]+";");for(let O in l){let d=l[O];if(/&/.test(O))r(O.split(/,\s*/).map(g=>o.map(p=>g.replace(/&/,p))).reduce((g,p)=>g.concat(p)),d,a);else if(d&&typeof d=="object"){if(!c)throw new RangeError("The value of a property ("+O+") should be a primitive value.");r(n(O),d,h,u)}else d!=null&&h.push(O.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+d+";")}(h.length||u)&&a.push((i&&!c&&!f?o.map(i):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in e)r(n(o),e[o],this.rules)}getRules(){return this.rules.join(`
`)}static newName(){let e=Ni[Ui]||1;return Ni[Ui]=e+1,ni+e.toString(36)}static mount(e,t,i){let n=e[si],r=i&&i.nonce;n?r&&n.setNonce(r):n=new Er(e,r),n.mount(Array.isArray(t)?t:[t])}}let zi=new Map;class Er{constructor(e,t){let i=e.ownerDocument||e,n=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&n.CSSStyleSheet){let r=zi.get(i);if(r)return e.adoptedStyleSheets=[r.sheet,...e.adoptedStyleSheets],e[si]=r;this.sheet=new n.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],zi.set(i,this)}else{this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let r=e.head||e;r.insertBefore(this.styleTag,r.firstChild)}this.modules=[],e[si]=this}mount(e){let t=this.sheet,i=0,n=0;for(let r=0;r<e.length;r++){let o=e[r],l=this.modules.indexOf(o);if(l<n&&l>-1&&(this.modules.splice(l,1),n--,l=-1),l==-1){if(this.modules.splice(n++,0,o),t)for(let a=0;a<o.rules.length;a++)t.insertRule(o.rules[a],i++)}else{for(;n<l;)i+=this.modules[n++].rules.length;i+=o.rules.length,n++}}if(!t){let r="";for(let o=0;o<this.modules.length;o++)r+=this.modules[o].getRules()+`
`;this.styleTag.textContent=r}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Oe={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:"'"},Ne={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Cr=typeof navigator<"u"&&/Mac/.test(navigator.platform),Mr=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Y=0;Y<10;Y++)Oe[48+Y]=Oe[96+Y]=String(Y);for(var Y=1;Y<=24;Y++)Oe[Y+111]="F"+Y;for(var Y=65;Y<=90;Y++)Oe[Y]=String.fromCharCode(Y+32),Ne[Y]=String.fromCharCode(Y);for(var Mt in Oe)Ne.hasOwnProperty(Mt)||(Ne[Mt]=Oe[Mt]);function Yr(s){var e=Cr&&s.metaKey&&s.shiftKey&&!s.ctrlKey&&!s.altKey||Mr&&s.shiftKey&&s.key&&s.key.length==1||s.key=="Unidentified",t=!e&&s.key||(s.shiftKey?Ne:Oe)[s.keyCode]||s.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Qt(s){let e;return s.nodeType==11?e=s.getSelection?s:s.ownerDocument:e=s,e.getSelection()}function ri(s,e){return e?s==e||s.contains(e.nodeType!=1?e.parentNode:e):!1}function Dr(s){let e=s.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function St(s,e){if(!e.anchorNode)return!1;try{return ri(s,e.anchorNode)}catch{return!1}}function ze(s){return s.nodeType==3?we(s,0,s.nodeValue.length).getClientRects():s.nodeType==1?s.getClientRects():[]}function Ge(s,e,t,i){return t?_i(s,e,t,i,-1)||_i(s,e,t,i,1):!1}function _e(s){for(var e=0;;e++)if(s=s.previousSibling,!s)return e}function _i(s,e,t,i,n){for(;;){if(s==t&&e==i)return!0;if(e==(n<0?0:oe(s))){if(s.nodeName=="DIV")return!1;let r=s.parentNode;if(!r||r.nodeType!=1)return!1;e=_e(s)+(n<0?0:1),s=r}else if(s.nodeType==1){if(s=s.childNodes[e+(n<0?-1:0)],s.nodeType==1&&s.contentEditable=="false")return!1;e=n<0?oe(s):0}else return!1}}function oe(s){return s.nodeType==3?s.nodeValue.length:s.childNodes.length}function vi(s,e){let t=e?s.left:s.right;return{left:t,right:t,top:s.top,bottom:s.bottom}}function Zr(s){return{left:0,right:s.innerWidth,top:0,bottom:s.innerHeight}}function ns(s,e){let t=e.width/s.offsetWidth,i=e.height/s.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-s.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-s.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function Lr(s,e,t,i,n,r,o,l){let a=s.ownerDocument,f=a.defaultView||window;for(let h=s,c=!1;h&&!c;)if(h.nodeType==1){let u,O=h==a.body,d=1,g=1;if(O)u=Zr(f);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(c=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let w=h.getBoundingClientRect();({scaleX:d,scaleY:g}=ns(h,w)),u={left:w.left,right:w.left+h.clientWidth*d,top:w.top,bottom:w.top+h.clientHeight*g}}let p=0,m=0;if(n=="nearest")e.top<u.top?(m=-(u.top-e.top+o),t>0&&e.bottom>u.bottom+m&&(m=e.bottom-u.bottom+m+o)):e.bottom>u.bottom&&(m=e.bottom-u.bottom+o,t<0&&e.top-m<u.top&&(m=-(u.top+m-e.top+o)));else{let w=e.bottom-e.top,P=u.bottom-u.top;m=(n=="center"&&w<=P?e.top+w/2-P/2:n=="start"||n=="center"&&t<0?e.top-o:e.bottom-P+o)-u.top}if(i=="nearest"?e.left<u.left?(p=-(u.left-e.left+r),t>0&&e.right>u.right+p&&(p=e.right-u.right+p+r)):e.right>u.right&&(p=e.right-u.right+r,t<0&&e.left<u.left+p&&(p=-(u.left+p-e.left+r))):p=(i=="center"?e.left+(e.right-e.left)/2-(u.right-u.left)/2:i=="start"==l?e.left-r:e.right-(u.right-u.left)+r)-u.left,p||m)if(O)f.scrollBy(p,m);else{let w=0,P=0;if(m){let T=h.scrollTop;h.scrollTop+=m/g,P=(h.scrollTop-T)*g}if(p){let T=h.scrollLeft;h.scrollLeft+=p/d,w=(h.scrollLeft-T)*d}e={left:e.left-w,top:e.top-P,right:e.right-w,bottom:e.bottom-P},w&&Math.abs(w-p)<1&&(i="nearest"),P&&Math.abs(P-m)<1&&(n="nearest")}if(O)break;h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function Gr(s){let e=s.ownerDocument;for(let t=s.parentNode;t&&t!=e.body;)if(t.nodeType==1){if(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class Br{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:i}=e;this.set(t,Math.min(e.anchorOffset,t?oe(t):0),i,Math.min(e.focusOffset,i?oe(i):0))}set(e,t,i,n){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=n}}let Pe=null;function ss(s){if(s.setActive)return s.setActive();if(Pe)return s.focus(Pe);let e=[];for(let t=s;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(s.focus(Pe==null?{get preventScroll(){return Pe={preventScroll:!0},!0}}:void 0),!Pe){Pe=!1;for(let t=0;t<e.length;){let i=e[t++],n=e[t++],r=e[t++];i.scrollTop!=n&&(i.scrollTop=n),i.scrollLeft!=r&&(i.scrollLeft=r)}}}let ji;function we(s,e,t=e){let i=ji||(ji=document.createRange());return i.setEnd(s,t),i.setStart(s,e),i}function ke(s,e,t){let i={key:e,code:e,keyCode:t,which:t,cancelable:!0},n=new KeyboardEvent("keydown",i);n.synthetic=!0,s.dispatchEvent(n);let r=new KeyboardEvent("keyup",i);return r.synthetic=!0,s.dispatchEvent(r),n.defaultPrevented||r.defaultPrevented}function Ir(s){for(;s;){if(s&&(s.nodeType==9||s.nodeType==11&&s.host))return s;s=s.assignedSlot||s.parentNode}return null}function rs(s){for(;s.attributes.length;)s.removeAttributeNode(s.attributes[0])}function Fr(s,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(i=Math.min(i,oe(t));;)if(i){if(t.nodeType!=1)return!1;let n=t.childNodes[i-1];n.contentEditable=="false"?i--:(t=n,i=oe(t))}else{if(t==s)return!0;i=_e(t),t=t.parentNode}}function os(s){return s.scrollTop>Math.max(1,s.scrollHeight-s.clientHeight-4)}class Z{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new Z(e.parentNode,_e(e),t)}static after(e,t){return new Z(e.parentNode,_e(e)+1,t)}}const ki=[];class W{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let i of this.children){if(i==e)return t;t+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let i=this.dom,n=null,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=n?n.nextSibling:i.firstChild)){let l=W.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(e,t),o.flags&=-8}if(r=n?n.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&r!=o.dom&&(t.written=!0),o.dom.parentNode==i)for(;r&&r!=o.dom;)r=Hi(r);else i.insertBefore(o.dom,r);n=o.dom}for(r=n?n.nextSibling:i.firstChild,r&&t&&t.node==i&&(t.written=!0);r;)r=Hi(r)}else if(this.flags&1)for(let i of this.children)i.flags&7&&(i.sync(e,t),i.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let i;if(e==this.dom)i=this.dom.childNodes[t];else{let n=oe(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;n==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?n=-1:n=1),e=r}n<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!W.get(i);)i=i.nextSibling;if(!i)return this.length;for(let n=0,r=0;;n++){let o=this.children[n];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(e,t,i=0){let n=-1,r=-1,o=-1,l=-1;for(let a=0,f=i,h=i;a<this.children.length;a++){let c=this.children[a],u=f+c.length;if(f<e&&u>t)return c.domBoundsAround(e,t,f);if(u>=e&&n==-1&&(n=a,r=f),f>t&&c.dom.parentNode==this.dom){o=a,l=h;break}h=u,f=u+c.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(n?this.children[n-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=ki){this.markDirty();for(let n=e;n<t;n++){let r=this.children[n];r.parent==this&&i.indexOf(r)<0&&r.destroy()}this.children.splice(e,t-e,...i);for(let n=0;n<i.length;n++)i[n].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new ls(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,i,n,r,o){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}W.prototype.breakAfter=0;function Hi(s){let e=s.nextSibling;return s.parentNode.removeChild(s),e}class ls{constructor(e,t,i){this.children=e,this.pos=t,this.i=i,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function as(s,e,t,i,n,r,o,l,a){let{children:f}=s,h=f.length?f[e]:null,c=r.length?r[r.length-1]:null,u=c?c.breakAfter:o;if(!(e==i&&h&&!o&&!u&&r.length<2&&h.merge(t,n,r.length?c:null,t==0,l,a))){if(i<f.length){let O=f[i];O&&(n<O.length||O.breakAfter&&(c!=null&&c.breakAfter))?(e==i&&(O=O.split(n),n=0),!u&&c&&O.merge(0,n,c,!0,0,a)?r[r.length-1]=O:((n||O.children.length&&!O.children[0].length)&&O.merge(0,n,null,!1,0,a),r.push(O))):O!=null&&O.breakAfter&&(c?c.breakAfter=1:o=1),i++}for(h&&(h.breakAfter=o,t>0&&(!o&&r.length&&h.merge(t,h.length,r[0],!1,l,0)?h.breakAfter=r.shift().breakAfter:(t<h.length||h.children.length&&h.children[h.children.length-1].length==0)&&h.merge(t,h.length,null,!1,l,0),e++));e<i&&r.length;)if(f[i-1].become(r[r.length-1]))i--,r.pop(),a=r.length?0:l;else if(f[e].become(r[0]))e++,r.shift(),l=r.length?0:a;else break;!r.length&&e&&i<f.length&&!f[e-1].breakAfter&&f[i].merge(0,0,f[e-1],!1,l,a)&&e--,(e<i||r.length)&&s.replaceChildren(e,i,r)}}function hs(s,e,t,i,n,r){let o=s.childCursor(),{i:l,off:a}=o.findPos(t,1),{i:f,off:h}=o.findPos(e,-1),c=e-t;for(let u of i)c+=u.length;s.length+=c,as(s,f,h,l,a,i,0,n,r)}let N=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},oi=typeof document<"u"?document:{documentElement:{style:{}}};const li=/Edge\/(\d+)/.exec(N.userAgent),fs=/MSIE \d/.test(N.userAgent),ai=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(N.userAgent),Rt=!!(fs||ai||li),Ki=!Rt&&/gecko\/(\d+)/i.test(N.userAgent),Yt=!Rt&&/Chrome\/(\d+)/.exec(N.userAgent),Ji="webkitFontSmoothing"in oi.documentElement.style,cs=!Rt&&/Apple Computer/.test(N.vendor),en=cs&&(/Mobile\/\w+/.test(N.userAgent)||N.maxTouchPoints>2);var x={mac:en||/Mac/.test(N.platform),windows:/Win/.test(N.platform),linux:/Linux|X11/.test(N.platform),ie:Rt,ie_version:fs?oi.documentMode||6:ai?+ai[1]:li?+li[1]:0,gecko:Ki,gecko_version:Ki?+(/Firefox\/(\d+)/.exec(N.userAgent)||[0,0])[1]:0,chrome:!!Yt,chrome_version:Yt?+Yt[1]:0,ios:en,android:/Android\b/.test(N.userAgent),webkit:Ji,safari:cs,webkit_version:Ji?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:oi.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Ur=256;class le extends W{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return this.flags&8||i&&(!(i instanceof le)||this.length-(t-e)+i.length>Ur||i.flags&8)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new le(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Z(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return Nr(this.dom,e,t)}}class ae extends W{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let n of t)n.setParent(this)}setAttrs(e){if(rs(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,n,r,o){return i&&(!(i instanceof ae&&i.mark.eq(this.mark))||e&&r<=0||t<this.length&&o<=0)?!1:(hs(this,e,t,i?i.children.slice():[],r-1,o-1),this.markDirty(),!0)}split(e){let t=[],i=0,n=-1,r=0;for(let l of this.children){let a=i+l.length;a>e&&t.push(i<e?l.split(e-i):l),n<0&&i>=e&&(n=r),i=a,r++}let o=this.length-e;return this.length=e,n>-1&&(this.children.length=n,this.markDirty()),new ae(this.mark,t,o)}domAtPos(e){return us(this,e)}coordsAt(e,t){return ds(this,e,t)}}function Nr(s,e,t){let i=s.nodeValue.length;e>i&&(e=i);let n=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?x.chrome||x.gecko||(e?(n--,o=1):r<i&&(r++,o=-1)):t<0?n--:r<i&&r++;let l=we(s,n,r).getClientRects();if(!l.length)return null;let a=l[(o?o<0:t>=0)?0:l.length-1];return x.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,f=>f.width)||a),o?vi(a,o<0):a||null}class me extends W{static create(e,t,i){return new me(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=me.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,i,n,r,o){return i&&(!(i instanceof me)||!this.widget.compare(i.widget)||e>0&&r<=0||t<this.length&&o<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}become(e){return e instanceof me&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return Q.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,i=t&&t.state.doc,n=this.posAtStart;return i?i.slice(n,n+this.length):Q.empty}domAtPos(e){return(this.length?e==0:this.side>0)?Z.before(this.dom):Z.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;let n=this.dom.getClientRects(),r=null;if(!n.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?n.length-1:0;r=n[l],!(e>0?l==0:l==n.length-1||r.top<r.bottom);l+=o?-1:1);return vi(r,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class We extends W{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof We&&e.side==this.side}split(){return new We(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?Z.before(this.dom):Z.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Q.empty}get isHidden(){return!0}}le.prototype.children=me.prototype.children=We.prototype.children=ki;function us(s,e){let t=s.dom,{children:i}=s,n=0;for(let r=0;n<i.length;n++){let o=i[n],l=r+o.length;if(!(l==r&&o.getSide()<=0)){if(e>r&&e<l&&o.dom.parentNode==t)return o.domAtPos(e-r);if(e<=r)break;r=l}}for(let r=n;r>0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=n;r<i.length;r++){let o=i[r];if(o.dom.parentNode==t)return o.domAtPos(0)}return new Z(t,0)}function Os(s,e,t){let i,{children:n}=s;t>0&&e instanceof ae&&n.length&&(i=n[n.length-1])instanceof ae&&i.mark.eq(e.mark)?Os(i,e.children[0],t-1):(n.push(e),e.setParent(s)),s.length+=e.length}function ds(s,e,t){let i=null,n=-1,r=null,o=-1;function l(f,h){for(let c=0,u=0;c<f.children.length&&u<=h;c++){let O=f.children[c],d=u+O.length;d>=h&&(O.children.length?l(O,h-u):(!r||r.isHidden&&t>0)&&(d>h||u==d&&O.getSide()>0)?(r=O,o=h-u):(u<h||u==d&&O.getSide()<0&&!O.isHidden)&&(i=O,n=h-u)),u=d}}l(s,e);let a=(t<0?i:r)||i||r;return a?a.coordsAt(Math.max(0,a==i?n:o),t):zr(s)}function zr(s){let e=s.dom.lastChild;if(!e)return s.dom.getBoundingClientRect();let t=ze(e);return t[t.length-1]||null}function hi(s,e){for(let t in s)t=="class"&&e.class?e.class+=" "+s.class:t=="style"&&e.style?e.style+=";"+s.style:e[t]=s[t];return e}const tn=Object.create(null);function qi(s,e,t){if(s==e)return!0;s||(s=tn),e||(e=tn);let i=Object.keys(s),n=Object.keys(e);if(i.length-(t&&i.indexOf(t)>-1?1:0)!=n.length-(t&&n.indexOf(t)>-1?1:0))return!1;for(let r of i)if(r!=t&&(n.indexOf(r)==-1||s[r]!==e[r]))return!1;return!0}function fi(s,e,t){let i=!1;if(e)for(let n in e)t&&n in t||(i=!0,n=="style"?s.style.cssText="":s.removeAttribute(n));if(t)for(let n in t)e&&e[n]==t[n]||(i=!0,n=="style"?s.style.cssText=t[n]:s.setAttribute(n,t[n]));return i}function _r(s){let e=Object.create(null);for(let t=0;t<s.attributes.length;t++){let i=s.attributes[t];e[i.name]=i.value}return e}class E extends W{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,n,r,o){if(i){if(!(i instanceof E))return!1;this.dom||i.transferDOM(this)}return n&&this.setDeco(i?i.attrs:null),hs(this,e,t,i?i.children.slice():[],r,o),!0}split(e){let t=new E;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i,off:n}=this.childPos(e);n&&(t.append(this.children[i].split(n),0),this.children[i].merge(n,this.children[i].length,null,!1,0,0),i++);for(let r=i;r<this.children.length;r++)t.append(this.children[r],0);for(;i>0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){qi(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Os(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=hi(t,this.attrs||{})),i&&(this.attrs=hi({class:i},this.attrs||{}))}domAtPos(e){return us(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(rs(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(fi(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let n=this.dom.lastChild;for(;n&&W.get(n)instanceof ae;)n=n.lastChild;if(!n||!this.length||n.nodeName!="BR"&&((i=W.get(n))===null||i===void 0?void 0:i.isEditable)==!1&&(!x.ios||!this.children.some(r=>r instanceof le))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof le)||/[^ -~]/.test(i.text))return null;let n=ze(i.dom);if(n.length!=1)return null;e+=n[0].width,t=n[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let i=ds(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:n}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-n.lineHeight)<2&&n.textHeight<r){let o=(r-n.textHeight)/2;return{top:i.top+o,bottom:i.bottom-o,left:i.left,right:i.left}}}return i}become(e){return!1}covers(){return!0}static find(e,t){for(let i=0,n=0;i<e.children.length;i++){let r=e.children[i],o=n+r.length;if(o>=t){if(r instanceof E)return r;if(o>t)break}n=o+r.breakAfter}return null}}class ue extends W{constructor(e,t,i){super(),this.widget=e,this.length=t,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,n,r,o){return i&&(!(i instanceof ue)||!this.widget.compare(i.widget)||e>0&&r<=0||t<this.length&&o<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?Z.before(this.dom):Z.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let i=new ue(this.widget,t,this.deco);return i.breakAfter=this.breakAfter,i}get children(){return ki}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):Q.empty}domBoundsAround(){return null}become(e){return e instanceof ue&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){return this.widget.coordsAt(this.dom,e,t)}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:i}=this.deco;return t==i?!1:e<0?t<0:i>0}}class Wt{eq(e){return!1}updateDOM(e,t){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,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var re=function(s){return s[s.Text=0]="Text",s[s.WidgetBefore=1]="WidgetBefore",s[s.WidgetAfter=2]="WidgetAfter",s[s.WidgetRange=3]="WidgetRange",s}(re||(re={}));class F extends Se{constructor(e,t,i,n){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=n}get heightRelevant(){return!1}static mark(e){return new tt(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return t+=i&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new de(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,n;if(e.isBlockGap)i=-5e8,n=4e8;else{let{start:r,end:o}=ps(e,t);i=(r?t?-3e8:-1:5e8)-1,n=(o?t?2e8:1:-6e8)+1}return new de(e,i,n,t,e.widget||null,!0)}static line(e){return new it(e)}static set(e,t=!1){return R.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}F.none=R.empty;class tt extends F{constructor(e){let{start:t,end:i}=ps(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,i;return this==e||e instanceof tt&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((i=e.attrs)===null||i===void 0?void 0:i.class))&&qi(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}tt.prototype.point=!1;class it extends F{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof it&&this.spec.class==e.spec.class&&qi(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)}}it.prototype.mapMode=G.TrackBefore;it.prototype.point=!0;class de extends F{constructor(e,t,i,n,r,o){super(t,i,r,e),this.block=n,this.isReplace=o,this.mapMode=n?t<=0?G.TrackBefore:G.TrackAfter:G.TrackDel}get type(){return this.startSide!=this.endSide?re.WidgetRange:this.startSide<=0?re.WidgetBefore:re.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof de&&jr(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)}}de.prototype.point=!0;function ps(s,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=s;return t==null&&(t=s.inclusive),i==null&&(i=s.inclusive),{start:t??e,end:i??e}}function jr(s,e){return s==e||!!(s&&e&&s.compare(e))}function ci(s,e,t,i=0){let n=t.length-1;n>=0&&t[n]+i>=s?t[n]=Math.max(t[n],e):t.push(s,e)}class Be{constructor(e,t,i,n){this.doc=e,this.pos=t,this.end=i,this.disallowBlockEffectsFor=n,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof ue&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new E),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(ot(new We(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof ue)&&this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=r,this.textOff=0}let n=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(ot(new le(this.text.slice(this.textOff,this.textOff+n)),t),i),this.atCursorPos=!0,this.textOff+=n,e-=n,i=0}}span(e,t,i,n){this.buildText(t-e,i,n),this.pos=t,this.openStart<0&&(this.openStart=n)}point(e,t,i,n,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof de){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(i instanceof de)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new ue(i.widget||new nn("div"),l,i));else{let a=me.create(i.widget||new nn("span"),l,l?0:i.startSide),f=this.atCursorPos&&!a.isEditable&&r<=n.length&&(e<t||i.startSide>0),h=!a.isEditable&&(e<t||r>n.length||i.startSide<=0),c=this.getLine();this.pendingBuffer==2&&!f&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(n),f&&(c.append(ot(new We(1),n),r),r=n.length+Math.max(0,r-n.length)),c.append(ot(a,n),r),this.atCursorPos=h,this.pendingBuffer=h?e<t||r>n.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=n.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,n,r){let o=new Be(e,t,i,r);return o.openEnd=R.spans(n,t,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function ot(s,e){for(let t of e)s=new ae(t,[s],s.length);return s}class nn extends Wt{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}var B=function(s){return s[s.LTR=0]="LTR",s[s.RTL=1]="RTL",s}(B||(B={}));const Te=B.LTR,$i=B.RTL;function gs(s){let e=[];for(let t=0;t<s.length;t++)e.push(1<<+s[t]);return e}const Hr=gs("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Kr=gs("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),ui=Object.create(null),K=[];for(let s of["()","[]","{}"]){let e=s.charCodeAt(0),t=s.charCodeAt(1);ui[e]=t,ui[t]=-e}function ms(s){return s<=247?Hr[s]:1424<=s&&s<=1524?2:1536<=s&&s<=1785?Kr[s-1536]:1774<=s&&s<=2220?4:8192<=s&&s<=8204?256:64336<=s&&s<=65023?4:1}const Jr=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class ce{get dir(){return this.level%2?$i:Te}constructor(e,t,i){this.from=e,this.to=t,this.level=i}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,i,n){let r=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=t&&l.to>=t){if(l.level==i)return o;(r<0||(n!=0?n<0?l.from<t:l.to>t:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function xs(s,e){if(s.length!=e.length)return!1;for(let t=0;t<s.length;t++){let i=s[t],n=e[t];if(i.from!=n.from||i.to!=n.to||i.direction!=n.direction||!xs(i.inner,n.inner))return!1}return!0}const k=[];function eo(s,e,t,i,n){for(let r=0;r<=i.length;r++){let o=r?i[r-1].to:e,l=r<i.length?i[r].from:t,a=r?256:n;for(let f=o,h=a,c=a;f<l;f++){let u=ms(s.charCodeAt(f));u==512?u=h:u==8&&c==4&&(u=16),k[f]=u==4?2:u,u&7&&(c=u),h=u}for(let f=o,h=a,c=a;f<l;f++){let u=k[f];if(u==128)f<l-1&&h==k[f+1]&&h&24?u=k[f]=h:k[f]=256;else if(u==64){let O=f+1;for(;O<l&&k[O]==64;)O++;let d=f&&h==8||O<t&&k[O]==8?c==1?1:8:256;for(let g=f;g<O;g++)k[g]=d;f=O-1}else u==8&&c==1&&(k[f]=1);h=u,u&7&&(c=u)}}}function to(s,e,t,i,n){let r=n==1?2:1;for(let o=0,l=0,a=0;o<=i.length;o++){let f=o?i[o-1].to:e,h=o<i.length?i[o].from:t;for(let c=f,u,O,d;c<h;c++)if(O=ui[u=s.charCodeAt(c)])if(O<0){for(let g=l-3;g>=0;g-=3)if(K[g+1]==-O){let p=K[g+2],m=p&2?n:p&4?p&1?r:n:0;m&&(k[c]=k[K[g]]=m),l=g;break}}else{if(K.length==189)break;K[l++]=c,K[l++]=u,K[l++]=a}else if((d=k[c])==2||d==1){let g=d==n;a=g?0:1;for(let p=l-3;p>=0;p-=3){let m=K[p+2];if(m&2)break;if(g)K[p+2]|=2;else{if(m&4)break;K[p+2]|=4}}}}}function io(s,e,t,i){for(let n=0,r=i;n<=t.length;n++){let o=n?t[n-1].to:s,l=n<t.length?t[n].from:e;for(let a=o;a<l;){let f=k[a];if(f==256){let h=a+1;for(;;)if(h==l){if(n==t.length)break;h=t[n++].to,l=n<t.length?t[n].from:e}else if(k[h]==256)h++;else break;let c=r==1,u=(h<e?k[h]:i)==1,O=c==u?c?1:2:i;for(let d=h,g=n,p=g?t[g-1].to:s;d>a;)d==p&&(d=t[--g].from,p=g?t[g-1].to:s),k[--d]=O;a=h}else r=f,a++}}}function Oi(s,e,t,i,n,r,o){let l=i%2?2:1;if(i%2==n%2)for(let a=e,f=0;a<t;){let h=!0,c=!1;if(f==r.length||a<r[f].from){let g=k[a];g!=l&&(h=!1,c=g==16)}let u=!h&&l==1?[]:null,O=h?i:i+1,d=a;e:for(;;)if(f<r.length&&d==r[f].from){if(c)break e;let g=r[f];if(!h)for(let p=g.to,m=f+1;;){if(p==t)break e;if(m<r.length&&r[m].from==p)p=r[m++].to;else{if(k[p]==l)break e;break}}if(f++,u)u.push(g);else{g.from>a&&o.push(new ce(a,g.from,O));let p=g.direction==Te!=!(O%2);di(s,p?i+1:i,n,g.inner,g.from,g.to,o),a=g.to}d=g.to}else{if(d==t||(h?k[d]!=l:k[d]==l))break;d++}u?Oi(s,a,d,i+1,n,u,o):a<d&&o.push(new ce(a,d,O)),a=d}else for(let a=t,f=r.length;a>e;){let h=!0,c=!1;if(!f||a>r[f-1].to){let g=k[a-1];g!=l&&(h=!1,c=g==16)}let u=!h&&l==1?[]:null,O=h?i:i+1,d=a;e:for(;;)if(f&&d==r[f-1].to){if(c)break e;let g=r[--f];if(!h)for(let p=g.from,m=f;;){if(p==e)break e;if(m&&r[m-1].to==p)p=r[--m].from;else{if(k[p-1]==l)break e;break}}if(u)u.push(g);else{g.to<a&&o.push(new ce(g.to,a,O));let p=g.direction==Te!=!(O%2);di(s,p?i+1:i,n,g.inner,g.from,g.to,o),a=g.from}d=g.from}else{if(d==e||(h?k[d-1]!=l:k[d-1]==l))break;d--}u?Oi(s,d,a,i+1,n,u,o):d<a&&o.push(new ce(d,a,O)),a=d}}function di(s,e,t,i,n,r,o){let l=e%2?2:1;eo(s,n,r,i,l),to(s,n,r,i,l),io(n,r,i,l),Oi(s,n,r,e,t,i,o)}function no(s,e,t){if(!s)return[new ce(0,0,e==$i?1:0)];if(e==Te&&!t.length&&!Jr.test(s))return Ss(s.length);if(t.length)for(;s.length>k.length;)k[k.length]=256;let i=[],n=e==Te?0:1;return di(s,n,n,t,0,s.length,i),i}function Ss(s){return[new ce(0,s,0)]}let ws="";function so(s,e,t,i,n){var r;let o=i.head-s.from,l=ce.find(e,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc),a=e[l],f=a.side(n,t);if(o==f){let u=l+=n?1:-1;if(u<0||u>=e.length)return null;a=e[l=u],o=a.side(!n,t),f=a.side(n,t)}let h=ie(s.text,o,a.forward(n,t));(h<a.from||h>a.to)&&(h=f),ws=s.text.slice(Math.min(o,h),Math.max(o,h));let c=l==(n?e.length-1:0)?null:e[l+(n?1:-1)];return c&&h==f&&c.level+(n?0:1)<a.level?S.cursor(c.side(!n,t)+s.from,c.forward(n,t)?1:-1,c.level):S.cursor(h+s.from,a.forward(n,t)?-1:1,a.level)}function ro(s,e,t){for(let i=e;i<t;i++){let n=ms(s.charCodeAt(i));if(n==1)return Te;if(n==2||n==4)return $i}return Te}const Ts=b.define(),bs=b.define(),ys=b.define(),Ps=b.define(),pi=b.define(),Qs=b.define(),vs=b.define(),ks=b.define({combine:s=>s.some(e=>e)}),oo=b.define({combine:s=>s.some(e=>e)});class qe{constructor(e,t="nearest",i="nearest",n=5,r=5,o=!1){this.range=e,this.y=t,this.x=i,this.yMargin=n,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new qe(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 qe(S.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const lt=X.define({map:(s,e)=>s.map(e)});function xe(s,e,t){let i=s.facet(Ps);i.length?i[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const At=b.define({combine:s=>s.length?s[0]:!0});let lo=0;const Ce=b.define();class je{constructor(e,t,i,n,r){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=n,this.extension=r(this)}static define(e,t){const{eventHandlers:i,eventObservers:n,provide:r,decorations:o}=t||{};return new je(lo++,e,i,n,l=>{let a=[Ce.of(l)];return o&&a.push(He.of(f=>{let h=f.plugin(l);return h?o(h):F.none})),r&&a.push(r(l)),a})}static fromClass(e,t){return je.define(i=>new e(i),t)}}class Dt{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}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(i){if(xe(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){xe(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){xe(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const qs=b.define(),Ri=b.define(),He=b.define(),$s=b.define(),Wi=b.define(),Rs=b.define();function sn(s,e){let t=s.state.facet(Rs);if(!t.length)return t;let i=t.map(r=>r instanceof Function?r(s):r),n=[];return R.spans(i,e.from,e.to,{point(){},span(r,o,l,a){let f=r-e.from,h=o-e.from,c=n;for(let u=l.length-1;u>=0;u--,a--){let O=l[u].spec.bidiIsolate,d;if(O==null&&(O=ro(e.text,f,h)),a>0&&c.length&&(d=c[c.length-1]).to==f&&d.direction==O)d.to=h,c=d.inner;else{let g={from:f,to:h,direction:O,inner:[]};c.push(g),c=g.inner}}}}),n}const Ws=b.define();function As(s){let e=0,t=0,i=0,n=0;for(let r of s.state.facet(Ws)){let o=r(s);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(n=Math.max(n,o.bottom)))}return{left:e,right:t,top:i,bottom:n}}const Me=b.define();class _{constructor(e,t,i,n){this.fromA=e,this.toA=t,this.fromB=i,this.toB=n}join(e){return new _(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,i=this;for(;t>0;t--){let n=e[t-1];if(!(n.fromA>i.toA)){if(n.toA<i.fromA)break;i=i.join(n),e.splice(t-1,1)}}return e.splice(t,0,i),e}static extendWithRanges(e,t){if(t.length==0)return e;let i=[];for(let n=0,r=0,o=0,l=0;;n++){let a=n==e.length?null:e[n],f=o-l,h=a?a.fromB:1e9;for(;r<t.length&&t[r]<h;){let c=t[r],u=t[r+1],O=Math.max(l,c),d=Math.min(h,u);if(O<=d&&new _(O+f,d+f,O,d).addToSet(i),u>h)break;r+=2}if(!a)return i;new _(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class vt{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=C.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let n=[];this.changes.iterChangedRanges((r,o,l,a)=>n.push(new _(r,o,l,a))),this.changedRanges=n}static create(e,t,i){return new vt(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class rn extends W{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new E],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new _(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:f,toA:h})=>h<this.minWidthFrom||f>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);let n=-1;this.view.inputState.composing>=0&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?n=this.domChanged.newSel.head:!po(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let r=n>-1?ho(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:f,to:h}=this.hasComposition;i=new _(f,h,e.changes.mapPos(f,-1),e.changes.mapPos(h,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(x.ie||x.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=uo(o,l,e.changes);return i=_.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,i);let{observer:n}=this.view;n.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=x.chrome||x.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||n.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.children)o instanceof ue&&o.widget instanceof on&&r.push(o.dom);n.updateGaps(r)}updateChildren(e,t,i){let n=i?i.range.addToSet(e.slice()):e,r=this.childCursor(t);for(let o=n.length-1;;o--){let l=o>=0?n[o]:null;if(!l)break;let{fromA:a,toA:f,fromB:h,toB:c}=l,u,O,d,g;if(i&&i.range.fromB<c&&i.range.toB>h){let T=Be.build(this.view.state.doc,h,i.range.fromB,this.decorations,this.dynamicDecorationMap),A=Be.build(this.view.state.doc,i.range.toB,c,this.decorations,this.dynamicDecorationMap);O=T.breakAtStart,d=T.openStart,g=A.openEnd;let z=this.compositionView(i);A.breakAtStart?z.breakAfter=1:A.content.length&&z.merge(z.length,z.length,A.content[0],!1,A.openStart,0)&&(z.breakAfter=A.content[0].breakAfter,A.content.shift()),T.content.length&&z.merge(0,0,T.content[T.content.length-1],!0,0,T.openEnd)&&T.content.pop(),u=T.content.concat(z).concat(A.content)}else({content:u,breakAtStart:O,openStart:d,openEnd:g}=Be.build(this.view.state.doc,h,c,this.decorations,this.dynamicDecorationMap));let{i:p,off:m}=r.findPos(f,1),{i:w,off:P}=r.findPos(a,-1);as(this,w,P,p,m,u,O,d,g)}i&&this.fixCompositionDOM(i)}compositionView(e){let t=new le(e.text.nodeValue);t.flags|=8;for(let{deco:n}of e.marks)t=new ae(n,[t],t.length);let i=new E;return i.append(t,0),i}fixCompositionDOM(e){let t=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=W.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(e.range.fromB,1),n=this.children[i.i];t(e.line,n);for(let r=e.marks.length-1;r>=-1;r--)i=n.childPos(i.off,1),n=n.children[i.i],t(r>=0?e.marks[r].node:e.text,n)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,n=i==this.dom,r=!n&&St(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(n||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),f=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(x.gecko&&l.empty&&!this.hasComposition&&ao(a)){let c=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(c,a.node.childNodes[a.offset]||null)),a=f=new Z(c,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!Ge(a.node,a.offset,h.anchorNode,h.anchorOffset)||!Ge(f.node,f.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{x.android&&x.chrome&&this.dom.contains(h.focusNode)&&Oo(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let c=Qt(this.view.root);if(c)if(l.empty){if(x.gecko){let u=fo(a.node,a.offset);if(u&&u!=3){let O=Xs(a.node,a.offset,u==1?1:-1);O&&(a=new Z(O.node,O.offset))}}c.collapse(a.node,a.offset),l.bidiLevel!=null&&c.caretBidiLevel!==void 0&&(c.caretBidiLevel=l.bidiLevel)}else if(c.extend){c.collapse(a.node,a.offset);try{c.extend(f.node,f.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,f]=[f,a]),u.setEnd(f.node,f.offset),u.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,f)),this.impreciseAnchor=a.precise?null:new Z(h.anchorNode,h.anchorOffset),this.impreciseHead=f.precise?null:new Z(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Ge(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,i=Qt(e.root),{anchorNode:n,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=E.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),f=this.coordsAt(t.head,1);if(!a||!f||a.bottom>f.top)return;let h=this.domAtPos(t.head+t.assoc);i.collapse(h.node,h.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let c=e.observer.selectionRange;e.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=t.from&&i.collapse(n,r)}moveToLine(e){let t=this.dom,i;if(e.node!=t)return e;for(let n=e.offset;!i&&n<t.childNodes.length;n++){let r=W.get(t.childNodes[n]);r instanceof E&&(i=r.domAtPos(0))}for(let n=e.offset-1;!i&&n>=0;n--){let r=W.get(t.childNodes[n]);r instanceof E&&(i=r.domAtPos(r.length))}return i?new Z(i.node,i.offset,!0):e}nearest(e){for(let t=e;t;){let i=W.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let n=this.children[t];if(i<n.length||n instanceof E)break;t++,i=0}return this.children[t].domAtPos(i)}coordsAt(e,t){let i=null,n=0;for(let r=this.length,o=this.children.length-1;o>=0;o--){let l=this.children[o],a=r-l.breakAfter,f=a-l.length;if(a<e)break;f<=e&&(f<e||l.covers(-1))&&(a>e||l.covers(1))&&(!i||l instanceof E&&!(i instanceof E&&t>=0))&&(i=l,n=f),r=f}return i?i.coordsAt(e-n,t):null}coordsForChar(e){let{i:t,off:i}=this.childPos(e,1),n=this.children[t];if(!(n instanceof E))return null;for(;n.children.length;){let{i:l,off:a}=n.childPos(i,1);for(;;l++){if(l==n.children.length)return null;if((n=n.children[l]).length)break}i=a}if(!(n instanceof le))return null;let r=ie(n.text,i);if(r==i)return null;let o=we(n.dom,i,r).getClientRects();for(let l=0;l<o.length;l++){let a=o[l];if(l==o.length-1||a.top<a.bottom&&a.left<a.right)return a}return null}measureVisibleLineHeights(e){let t=[],{from:i,to:n}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==B.LTR;for(let f=0,h=0;h<this.children.length;h++){let c=this.children[h],u=f+c.length;if(u>n)break;if(f>=i){let O=c.dom.getBoundingClientRect();if(t.push(O.height),o){let d=c.dom.lastChild,g=d?ze(d):[];if(g.length){let p=g[g.length-1],m=a?p.right-O.left:O.right-p.left;m>l&&(l=m,this.minWidth=r,this.minWidthFrom=f,this.minWidthTo=u)}}}f=u+c.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?B.RTL:B.LTR}measureTextSize(){for(let r of this.children)if(r instanceof E){let o=r.measureTextSize();if(o)return o}let e=document.createElement("div"),t,i,n;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let r=ze(e.firstChild)[0];t=e.getBoundingClientRect().height,i=r?r.width/27:7,n=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:i,textHeight:n}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new ls(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,n=0;;n++){let r=n==t.viewports.length?null:t.viewports[n],o=r?r.from-1:this.length;if(o>i){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(F.replace({widget:new on(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return F.set(e)}updateDeco(){let e=this.view.state.facet(He).map((n,r)=>(this.dynamicDecorationMap[r]=typeof n=="function")?n(this.view):n),t=!1,i=this.view.state.facet($s).map((n,r)=>{let o=typeof n=="function";return o&&(t=!0),o?n(this.view):n});i.length&&(this.dynamicDecorationMap[e.length]=t,e.push(R.join(i)));for(let n=e.length;n<e.length+3;n++)this.dynamicDecorationMap[n]=!1;return this.decorations=[...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco]}scrollIntoView(e){if(e.isSnapshot){let f=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=f.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}let{range:t}=e,i=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),n;if(!i)return;!t.empty&&(n=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,n.left),top:Math.min(i.top,n.top),right:Math.max(i.right,n.right),bottom:Math.max(i.bottom,n.bottom)});let r=As(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;Lr(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==B.LTR)}}function ao(s){return s.node.nodeType==1&&s.node.firstChild&&(s.offset==0||s.node.childNodes[s.offset-1].contentEditable=="false")&&(s.offset==s.node.childNodes.length||s.node.childNodes[s.offset].contentEditable=="false")}class on extends Wt{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}}function Vs(s,e){let t=s.observer.selectionRange,i=t.focusNode&&Xs(t.focusNode,t.focusOffset,0);if(!i)return null;let n=e-i.offset;return{from:n,to:n+i.node.nodeValue.length,node:i.node}}function ho(s,e,t){let i=Vs(s,t);if(!i)return null;let{node:n,from:r,to:o}=i,l=n.nodeValue;if(/[\n\r]/.test(l)||s.state.doc.sliceString(i.from,i.to)!=l)return null;let a=e.invertedDesc,f=new _(a.mapPos(r),a.mapPos(o),r,o),h=[];for(let c=n.parentNode;;c=c.parentNode){let u=W.get(c);if(u instanceof ae)h.push({node:c,deco:u.mark});else{if(u instanceof E||c.nodeName=="DIV"&&c.parentNode==s.contentDOM)return{range:f,text:n,marks:h,line:c};if(c!=s.contentDOM)h.push({node:c,deco:new tt({inclusive:!0,attributes:_r(c),tagName:c.tagName.toLowerCase()})});else return null}}}function Xs(s,e,t){if(t<=0)for(let i=s,n=e;;){if(i.nodeType==3)return{node:i,offset:n};if(i.nodeType==1&&n>0)i=i.childNodes[n-1],n=oe(i);else break}if(t>=0)for(let i=s,n=e;;){if(i.nodeType==3)return{node:i,offset:n};if(i.nodeType==1&&n<i.childNodes.length&&t>=0)i=i.childNodes[n],n=0;else break}return null}function fo(s,e){return s.nodeType!=1?0:(e&&s.childNodes[e-1].contentEditable=="false"?1:0)|(e<s.childNodes.length&&s.childNodes[e].contentEditable=="false"?2:0)}let co=class{constructor(){this.changes=[]}compareRange(e,t){ci(e,t,this.changes)}comparePoint(e,t){ci(e,t,this.changes)}};function uo(s,e,t){let i=new co;return R.compare(s,e,t,i),i.changes}function Oo(s,e){for(let t=s;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function po(s,e){let t=!1;return e&&s.iterChangedRanges((i,n)=>{i<e.to&&n>e.from&&(t=!0)}),t}function go(s,e,t=1){let i=s.charCategorizer(e),n=s.doc.lineAt(e),r=e-n.from;if(n.length==0)return S.cursor(e);r==0?t=1:r==n.length&&(t=-1);let o=r,l=r;t<0?o=ie(n.text,r,!1):l=ie(n.text,r);let a=i(n.text.slice(o,l));for(;o>0;){let f=ie(n.text,o,!1);if(i(n.text.slice(f,o))!=a)break;o=f}for(;l<n.length;){let f=ie(n.text,l);if(i(n.text.slice(l,f))!=a)break;l=f}return S.range(o+n.from,l+n.from)}function mo(s,e){return e.left>s?e.left-s:Math.max(0,s-e.right)}function xo(s,e){return e.top>s?e.top-s:Math.max(0,s-e.bottom)}function Zt(s,e){return s.top<e.bottom-1&&s.bottom>e.top+1}function ln(s,e){return e<s.top?{top:e,left:s.left,right:s.right,bottom:s.bottom}:s}function an(s,e){return e>s.bottom?{top:s.top,left:s.left,right:s.right,bottom:e}:s}function gi(s,e,t){let i,n,r,o,l=!1,a,f,h,c;for(let d=s.firstChild;d;d=d.nextSibling){let g=ze(d);for(let p=0;p<g.length;p++){let m=g[p];n&&Zt(n,m)&&(m=ln(an(m,n.bottom),n.top));let w=mo(e,m),P=xo(t,m);if(w==0&&P==0)return d.nodeType==3?hn(d,e,t):gi(d,e,t);if(!i||o>P||o==P&&r>w){i=d,n=m,r=w,o=P;let T=P?t<m.top?-1:1:w?e<m.left?-1:1:0;l=!T||(T>0?p<g.length-1:p>0)}w==0?t>m.bottom&&(!h||h.bottom<m.bottom)?(a=d,h=m):t<m.top&&(!c||c.top>m.top)&&(f=d,c=m):h&&Zt(h,m)?h=an(h,m.bottom):c&&Zt(c,m)&&(c=ln(c,m.top))}}if(h&&h.bottom>=t?(i=a,n=h):c&&c.top<=t&&(i=f,n=c),!i)return{node:s,offset:0};let u=Math.max(n.left,Math.min(n.right,e));if(i.nodeType==3)return hn(i,u,t);if(l&&i.contentEditable!="false")return gi(i,u,t);let O=Array.prototype.indexOf.call(s.childNodes,i)+(e>=(n.left+n.right)/2?1:0);return{node:s,offset:O}}function hn(s,e,t){let i=s.nodeValue.length,n=-1,r=1e9,o=0;for(let l=0;l<i;l++){let a=we(s,l,l+1).getClientRects();for(let f=0;f<a.length;f++){let h=a[f];if(h.top==h.bottom)continue;o||(o=e-h.left);let c=(h.top>t?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&c<r){let u=e>=(h.left+h.right)/2,O=u;if((x.chrome||x.gecko)&&we(s,l).getBoundingClientRect().left==h.right&&(O=!u),c<=0)return{node:s,offset:l+(O?1:0)};n=l+(O?1:0),r=c}}}return{node:s,offset:n>-1?n:o>0?s.nodeValue.length:0}}function Es(s,e,t,i=-1){var n,r;let o=s.contentDOM.getBoundingClientRect(),l=o.top+s.viewState.paddingTop,a,{docHeight:f}=s.viewState,{x:h,y:c}=e,u=c-l;if(u<0)return 0;if(u>f)return s.state.doc.length;for(let T=s.viewState.heightOracle.textHeight/2,A=!1;a=s.elementAtHeight(u),a.type!=re.Text;)for(;u=i>0?a.bottom+T:a.top-T,!(u>=0&&u<=f);){if(A)return t?null:0;A=!0,i=-i}c=l+u;let O=a.from;if(O<s.viewport.from)return s.viewport.from==0?0:t?null:fn(s,o,a,h,c);if(O>s.viewport.to)return s.viewport.to==s.state.doc.length?s.state.doc.length:t?null:fn(s,o,a,h,c);let d=s.dom.ownerDocument,g=s.root.elementFromPoint?s.root:d,p=g.elementFromPoint(h,c);p&&!s.contentDOM.contains(p)&&(p=null),p||(h=Math.max(o.left+1,Math.min(o.right-1,h)),p=g.elementFromPoint(h,c),p&&!s.contentDOM.contains(p)&&(p=null));let m,w=-1;if(p&&((n=s.docView.nearest(p))===null||n===void 0?void 0:n.isEditable)!=!1){if(d.caretPositionFromPoint){let T=d.caretPositionFromPoint(h,c);T&&({offsetNode:m,offset:w}=T)}else if(d.caretRangeFromPoint){let T=d.caretRangeFromPoint(h,c);T&&({startContainer:m,startOffset:w}=T,(!s.contentDOM.contains(m)||x.safari&&So(m,w,h)||x.chrome&&wo(m,w,h))&&(m=void 0))}}if(!m||!s.docView.dom.contains(m)){let T=E.find(s.docView,O);if(!T)return u>a.top+a.height/2?a.to:a.from;({node:m,offset:w}=gi(T.dom,h,c))}let P=s.docView.nearest(m);if(!P)return null;if(P.isWidget&&((r=P.dom)===null||r===void 0?void 0:r.nodeType)==1){let T=P.dom.getBoundingClientRect();return e.y<T.top||e.y<=T.bottom&&e.x<=(T.left+T.right)/2?P.posAtStart:P.posAtEnd}else return P.localPosFromDOM(m,w)+P.posAtStart}function fn(s,e,t,i,n){let r=Math.round((i-e.left)*s.defaultCharacterWidth);if(s.lineWrapping&&t.height>s.defaultLineHeight*1.5){let l=s.viewState.heightOracle.textHeight,a=Math.floor((n-t.top-(s.defaultLineHeight-l)*.5)/l);r+=a*s.viewState.heightOracle.lineLength}let o=s.state.sliceDoc(t.from,t.to);return t.from+Xr(o,r,s.state.tabSize)}function So(s,e,t){let i;if(s.nodeType!=3||e!=(i=s.nodeValue.length))return!1;for(let n=s.nextSibling;n;n=n.nextSibling)if(n.nodeType!=1||n.nodeName!="BR")return!1;return we(s,i-1,i).getBoundingClientRect().left>t}function wo(s,e,t){if(e!=0)return!1;for(let n=s;;){let r=n.parentNode;if(!r||r.nodeType!=1||r.firstChild!=n)return!1;if(r.classList.contains("cm-line"))break;n=r}let i=s.nodeType==1?s.getBoundingClientRect():we(s,0,Math.max(s.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function To(s,e){let t=s.lineBlockAt(e);if(Array.isArray(t.type)){for(let i of t.type)if(i.to>e||i.to==e&&(i.to==t.to||i.type==re.Text))return i}return t}function bo(s,e,t,i){let n=To(s,e.head),r=!i||n.type!=re.Text||!(s.lineWrapping||n.widgetLineBreaks)?null:s.coordsAtPos(e.assoc<0&&e.head>n.from?e.head-1:e.head);if(r){let o=s.dom.getBoundingClientRect(),l=s.textDirectionAt(n.from),a=s.posAtCoords({x:t==(l==B.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return S.cursor(a,t?-1:1)}return S.cursor(t?n.to:n.from,t?-1:1)}function cn(s,e,t,i){let n=s.state.doc.lineAt(e.head),r=s.bidiSpans(n),o=s.textDirectionAt(n.from);for(let l=e,a=null;;){let f=so(n,r,o,l,t),h=ws;if(!f){if(n.number==(t?s.state.doc.lines:1))return l;h=`
`,n=s.state.doc.line(n.number+(t?1:-1)),r=s.bidiSpans(n),f=s.visualLineSide(n,!t)}if(a){if(!a(h))return l}else{if(!i)return f;a=i(h)}l=f}}function yo(s,e,t){let i=s.state.charCategorizer(e),n=i(t);return r=>{let o=i(r);return n==ne.Space&&(n=o),n==o}}function Po(s,e,t,i){let n=e.head,r=t?1:-1;if(n==(t?s.state.doc.length:0))return S.cursor(n,e.assoc);let o=e.goalColumn,l,a=s.contentDOM.getBoundingClientRect(),f=s.coordsAtPos(n,e.assoc||-1),h=s.documentTop;if(f)o==null&&(o=f.left-a.left),l=r<0?f.top:f.bottom;else{let O=s.viewState.lineBlockAt(n);o==null&&(o=Math.min(a.right-a.left,s.defaultCharacterWidth*(n-O.from))),l=(r<0?O.top:O.bottom)+h}let c=a.left+o,u=i??s.viewState.heightOracle.textHeight>>1;for(let O=0;;O+=10){let d=l+(u+O)*r,g=Es(s,{x:c,y:d},!1,r);if(d<a.top||d>a.bottom||(r<0?g<n:g>n)){let p=s.docView.coordsForChar(g),m=!p||d<p.top?-1:1;return S.cursor(g,m,void 0,o)}}}function wt(s,e,t){for(;;){let i=0;for(let n of s)n.between(e-1,e+1,(r,o,l)=>{if(e>r&&e<o){let a=i||t||(e-r<o-e?-1:1);e=a<0?r:o,i=a}});if(!i)return e}}function Lt(s,e,t){let i=wt(s.state.facet(Wi).map(n=>n(s)),t.from,e.head>t.from?-1:1);return i==t.from?t:S.cursor(i,i<t.from?1:-1)}class Qo{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=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.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,x.safari&&e.contentDOM.addEventListener("input",()=>null),x.gecko&&Lo(e.contentDOM.ownerDocument)}handleEvent(e){!Vo(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let i=this.handlers[e];if(i){for(let n of i.observers)n(this.view,t);for(let n of i.handlers){if(t.defaultPrevented)break;if(n(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=vo(e),i=this.handlers,n=this.view.contentDOM;for(let r in t)if(r!="scroll"){let o=!t[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(n.removeEventListener(r,this.handleEvent),l=null),l||n.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!t[r]&&n.removeEventListener(r,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()<this.lastEscPress+2e3)return!0;if(e.keyCode!=27&&Ms.indexOf(e.keyCode)<0&&(this.view.inputState.lastEscPress=0),x.android&&x.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return x.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=Cs.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||ko.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(){let e=this.pendingIOSKey;return e?(this.pendingIOSKey=void 0,ke(this.view.contentDOM,e.key,e.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:x.safari&&!x.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}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 un(s,e){return(t,i)=>{try{return e.call(s,i,t)}catch(n){xe(t.state,n)}}}function vo(s){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of s){let n=i.spec;if(n&&n.domEventHandlers)for(let r in n.domEventHandlers){let o=n.domEventHandlers[r];o&&t(r).handlers.push(un(i.value,o))}if(n&&n.domEventObservers)for(let r in n.domEventObservers){let o=n.domEventObservers[r];o&&t(r).observers.push(un(i.value,o))}}for(let i in j)t(i).handlers.push(j[i]);for(let i in H)t(i).observers.push(H[i]);return e}const Cs=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],ko="dthko",Ms=[16,17,18,20,91,92,224,225],at=6;function ht(s){return Math.max(0,s)*.7+8}function qo(s,e){return Math.max(Math.abs(s.clientX-e.clientX),Math.abs(s.clientY-e.clientY))}class $o{constructor(e,t,i,n){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=n,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=Gr(e.contentDOM),this.atoms=e.state.facet(Wi).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet($.allowMultipleSelections)&&Ro(e,t),this.dragging=Ao(e,t)&&Ls(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&qo(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let i=0,n=0,r=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},o=As(this.view);e.clientX-o.left<=r.left+at?i=-ht(r.left-e.clientX):e.clientX+o.right>=r.right-at&&(i=ht(e.clientX-r.right)),e.clientY-o.top<=r.top+at?n=-ht(r.top-e.clientY):e.clientY+o.bottom>=r.bottom-at&&(n=ht(e.clientY-r.bottom)),this.setScrollSpeed(i,n)}up(e){this.dragging==null&&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(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let i=0;i<e.ranges.length;i++){let n=e.ranges[i],r=null;if(n.empty){let o=wt(this.atoms,n.from,0);o!=n.from&&(r=S.cursor(o,-1))}else{let o=wt(this.atoms,n.from,-1),l=wt(this.atoms,n.to,1);(o!=n.from||l!=n.to)&&(r=S.range(n.from==n.anchor?o:l,n.from==n.head?o:l))}r&&(t||(t=e.ranges.slice()),t[i]=r)}return t?S.create(t,e.mainIndex):e}select(e){let{view:t}=this,i=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Ro(s,e){let t=s.state.facet(Ts);return t.length?t[0](e):x.mac?e.metaKey:e.ctrlKey}function Wo(s,e){let t=s.state.facet(bs);return t.length?t[0](e):x.mac?!e.altKey:!e.ctrlKey}function Ao(s,e){let{main:t}=s.state.selection;if(t.empty)return!1;let i=Qt(s.root);if(!i||i.rangeCount==0)return!0;let n=i.getRangeAt(0).getClientRects();for(let r=0;r<n.length;r++){let o=n[r];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Vo(s,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=s.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=W.get(t))&&i.ignoreEvent(e))return!1;return!0}const j=Object.create(null),H=Object.create(null),Ys=x.ie&&x.ie_version<15||x.ios&&x.webkit_version<604;function Xo(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(),Ds(s,t.value)},50)}function Ds(s,e){let{state:t}=s,i,n=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(mi!=null&&t.selection.ranges.every(a=>a.empty)&&mi==r.toString()){let a=-1;i=t.changeByRange(f=>{let h=t.doc.lineAt(f.from);if(h.from==a)return{range:f};a=h.from;let c=t.toText((o?r.line(n++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:c},range:S.cursor(f.from+c.length)}})}else o?i=t.changeByRange(a=>{let f=r.line(n++);return{changes:{from:a.from,to:a.to,insert:f.text},range:S.cursor(a.from+f.length)}}):i=t.replaceSelection(r);s.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}H.scroll=s=>{s.inputState.lastScrollTop=s.scrollDOM.scrollTop,s.inputState.lastScrollLeft=s.scrollDOM.scrollLeft};j.keydown=(s,e)=>(s.inputState.setSelectionOrigin("select"),e.keyCode==27&&(s.inputState.lastEscPress=Date.now()),!1);H.touchstart=(s,e)=>{s.inputState.lastTouchTime=Date.now(),s.inputState.setSelectionOrigin("select.pointer")};H.touchmove=s=>{s.inputState.setSelectionOrigin("select.pointer")};j.mousedown=(s,e)=>{if(s.observer.flush(),s.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of s.state.facet(ys))if(t=i(s,e),t)break;if(!t&&e.button==0&&(t=Mo(s,e)),t){let i=!s.hasFocus;s.inputState.startMouseSelection(new $o(s,e,t,i)),i&&s.observer.ignore(()=>ss(s.contentDOM));let n=s.inputState.mouseSelection;if(n)return n.start(e),n.dragging===!1}return!1};function On(s,e,t,i){if(i==1)return S.cursor(e,t);if(i==2)return go(s.state,e,t);{let n=E.find(s.docView,e),r=s.state.doc.lineAt(n?n.posAtEnd:e),o=n?n.posAtStart:r.from,l=n?n.posAtEnd:r.to;return l<s.state.doc.length&&l==r.to&&l++,S.range(o,l)}}let Zs=(s,e)=>s>=e.top&&s<=e.bottom,dn=(s,e,t)=>Zs(e,t)&&s>=t.left&&s<=t.right;function Eo(s,e,t,i){let n=E.find(s.docView,e);if(!n)return 1;let r=e-n.posAtStart;if(r==0)return 1;if(r==n.length)return-1;let o=n.coordsAt(r,-1);if(o&&dn(t,i,o))return-1;let l=n.coordsAt(r,1);return l&&dn(t,i,l)?1:o&&Zs(i,o)?-1:1}function pn(s,e){let t=s.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:Eo(s,t,e.clientX,e.clientY)}}const Co=x.ie&&x.ie_version<=11;let gn=null,mn=0,xn=0;function Ls(s){if(!Co)return s.detail;let e=gn,t=xn;return gn=s,xn=Date.now(),mn=!e||t>Date.now()-400&&Math.abs(e.clientX-s.clientX)<2&&Math.abs(e.clientY-s.clientY)<2?(mn+1)%3:1}function Mo(s,e){let t=pn(s,e),i=Ls(e),n=s.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),n=n.map(r.changes))},get(r,o,l){let a=pn(s,r),f,h=On(s,a.pos,a.bias,i);if(t.pos!=a.pos&&!o){let c=On(s,t.pos,t.bias,i),u=Math.min(c.from,h.from),O=Math.max(c.to,h.to);h=u<h.from?S.range(u,O):S.range(O,u)}return o?n.replaceRange(n.main.extend(h.from,h.to)):l&&i==1&&n.ranges.length>1&&(f=Yo(n,a.pos))?f:l?n.addRange(h):S.create([h])}}}function Yo(s,e){for(let t=0;t<s.ranges.length;t++){let{from:i,to:n}=s.ranges[t];if(i<=e&&n>=e)return S.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}j.dragstart=(s,e)=>{let{selection:{main:t}}=s.state;if(e.target.draggable){let n=s.docView.nearest(e.target);if(n&&n.isWidget){let r=n.posAtStart,o=r+n.length;(r>=t.to||o<=t.from)&&(t=S.range(r,o))}}let{inputState:i}=s;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",s.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};j.dragend=s=>(s.inputState.draggedContent=null,!1);function Sn(s,e,t,i){if(!t)return;let n=s.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=s.inputState,o=i&&r&&Wo(s,e)?{from:r.from,to:r.to}:null,l={from:n,insert:t},a=s.state.changes(o?[o,l]:l);s.focus(),s.dispatch({changes:a,selection:{anchor:a.mapPos(n,-1),head:a.mapPos(n,1)},userEvent:o?"move.drop":"input.drop"}),s.inputState.draggedContent=null}j.drop=(s,e)=>{if(!e.dataTransfer)return!1;if(s.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),n=0,r=()=>{++n==t.length&&Sn(s,e,i.filter(o=>o!=null).join(s.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let l=new FileReader;l.onerror=r,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return Sn(s,e,i,!0),!0}return!1};j.paste=(s,e)=>{if(s.state.readOnly)return!0;s.observer.flush();let t=Ys?null:e.clipboardData;return t?(Ds(s,t.getData("text/plain")||t.getData("text/uri-text")),!0):(Xo(s),!1)};function Do(s,e){let t=s.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),s.focus()},50)}function Zo(s){let e=[],t=[],i=!1;for(let n of s.selection.ranges)n.empty||(e.push(s.sliceDoc(n.from,n.to)),t.push(n));if(!e.length){let n=-1;for(let{from:r}of s.selection.ranges){let o=s.doc.lineAt(r);o.number>n&&(e.push(o.text),t.push({from:o.from,to:Math.min(s.doc.length,o.to+1)})),n=o.number}i=!0}return{text:e.join(s.lineBreak),ranges:t,linewise:i}}let mi=null;j.copy=j.cut=(s,e)=>{let{text:t,ranges:i,linewise:n}=Zo(s.state);if(!t&&!n)return!1;mi=n?t:null,e.type=="cut"&&!s.state.readOnly&&s.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=Ys?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(Do(s,t),!1)};const Gs=ye.define();function Bs(s,e){let t=[];for(let i of s.facet(vs)){let n=i(s,e);n&&t.push(n)}return t?s.update({effects:t,annotations:Gs.of(!0)}):null}function Is(s){setTimeout(()=>{let e=s.hasFocus;if(e!=s.inputState.notifiedFocused){let t=Bs(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),Is(s)};H.blur=s=>{s.observer.clearSelectionRange(),Is(s)};H.compositionstart=H.compositionupdate=s=>{s.inputState.compositionFirstChange==null&&(s.inputState.compositionFirstChange=!0),s.inputState.composing<0&&(s.inputState.composing=0)};H.compositionend=s=>{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,x.chrome&&x.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()};j.beforeinput=(s,e)=>{var t;let i;if(x.chrome&&x.android&&(i=Cs.find(n=>n.inputType==e.inputType))&&(s.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let n=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>n+10&&s.hasFocus&&(s.contentDOM.blur(),s.focus())},100)}return!1};const wn=new Set;function Lo(s){wn.has(s)||(wn.add(s),s.addEventListener("copy",()=>{}),s.addEventListener("cut",()=>{}))}const Tn=["pre-wrap","normal","pre-line","break-spaces"];class Go{constructor(e){this.lineWrapping=e,this.doc=Q.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Tn.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i<e.length;i++){let n=e[i];n<0?i++:this.heightSamples[Math.floor(n*10)]||(t=!0,this.heightSamples[Math.floor(n*10)]=!0)}return t}refresh(e,t,i,n,r,o){let l=Tn.indexOf(e)>-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=n,this.lineLength=r,a){this.heightSamples={};for(let f=0;f<o.length;f++){let h=o[f];h<0?f++:this.heightSamples[Math.floor(h*10)]=!0}}return a}}class Bo{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class ee{constructor(e,t,i,n,r){this.from=e,this.length=t,this.top=i,this.height=n,this._content=r}get type(){return typeof this._content=="number"?re.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 de?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new ee(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var q=function(s){return s[s.ByPos=0]="ByPos",s[s.ByHeight=1]="ByHeight",s[s.ByPosNoHeight=2]="ByPosNoHeight",s}(q||(q={}));const Tt=.001;class I{constructor(e,t,i=2){this.length=e,this.height=t,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>Tt&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return I.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,n){let r=this,o=i.doc;for(let l=n.length-1;l>=0;l--){let{fromA:a,toA:f,fromB:h,toB:c}=n[l],u=r.lineAt(a,q.ByPosNoHeight,i.setDoc(t),0,0),O=u.to>=f?u:r.lineAt(f,q.ByPosNoHeight,i,0,0);for(c+=O.to-f,f=O.to;l>0&&u.from<=n[l-1].toA;)a=n[l-1].fromA,h=n[l-1].fromB,l--,a<u.from&&(u=r.lineAt(a,q.ByPosNoHeight,i,0,0));h+=u.from-a,a=u.from;let d=Ai.build(i.setDoc(o),e,h,c);r=r.replace(a,f,d)}return r.updateHeight(i,0)}static empty(){return new U(0,0)}static of(e){if(e.length==1)return e[0];let t=0,i=e.length,n=0,r=0;for(;;)if(t==i)if(n>r*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,n-=l.size}else if(r>n*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(n<r){let l=e[t++];l&&(n+=l.size)}else{let l=e[--i];l&&(r+=l.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,i++),new Io(I.of(e.slice(0,t)),o,I.of(e.slice(i)))}}I.prototype.size=1;class Fs extends I{constructor(e,t,i){super(e,t),this.deco=i}blockAt(e,t,i,n){return new ee(n,this.length,i,this.height,this.deco||0)}lineAt(e,t,i,n,r){return this.blockAt(0,i,n,r)}forEachLine(e,t,i,n,r,o){e<=r+this.length&&t>=r&&o(this.blockAt(0,i,n,r))}updateHeight(e,t=0,i=!1,n){return n&&n.from<=t&&n.more&&this.setHeight(e,n.heights[n.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class U extends Fs{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,n){return new ee(n,this.length,i,this.height,this.breaks)}replace(e,t,i){let n=i[0];return i.length==1&&(n instanceof U||n instanceof M&&n.flags&4)&&Math.abs(this.length-n.length)<10?(n instanceof M?n=new U(n.length,this.height):n.height=this.height,this.outdated||(n.outdated=!1),n):I.of(i)}updateHeight(e,t=0,i=!1,n){return n&&n.from<=t&&n.more?this.setHeight(e,n.heights[n.index++]):(i||this.outdated)&&this.setHeight(e,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 M extends I{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,n=e.doc.lineAt(t+this.length).number,r=n-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:n,perLine:o,perChar:l}}blockAt(e,t,i,n){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,n);if(t.lineWrapping){let f=n+Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length),h=t.doc.lineAt(f),c=l+h.length*a,u=Math.max(i,e-c/2);return new ee(h.from,h.length,u,c,0)}else{let f=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:h,length:c}=t.doc.line(r+f);return new ee(h,c,i+l*f,l,0)}}lineAt(e,t,i,n,r){if(t==q.ByHeight)return this.blockAt(e,i,n,r);if(t==q.ByPosNoHeight){let{from:O,to:d}=i.doc.lineAt(e);return new ee(O,d-O,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),f=i.doc.lineAt(e),h=l+f.length*a,c=f.number-o,u=n+l*c+a*(f.from-r-c);return new ee(f.from,f.length,Math.max(n,Math.min(u,n+this.height-h)),h,0)}forEachLine(e,t,i,n,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:f}=this.heightMetrics(i,r);for(let h=e,c=n;h<=t;){let u=i.doc.lineAt(h);if(h==e){let d=u.number-l;c+=a*d+f*(e-r-d)}let O=a+f*u.length;o(new ee(u.from,u.length,c,O,0)),c+=O,h=u.to+1}}replace(e,t,i){let n=this.length-t;if(n>0){let r=i[i.length-1];r instanceof M?i[i.length-1]=new M(r.length+n):i.push(null,new M(n-1))}if(e>0){let r=i[0];r instanceof M?i[0]=new M(e+r.length):i.unshift(new M(e-1),null)}return I.of(i)}decomposeLeft(e,t){t.push(new M(e-1),null)}decomposeRight(e,t){t.push(null,new M(this.length-e-1))}updateHeight(e,t=0,i=!1,n){let r=t+this.length;if(n&&n.from<=t+this.length&&n.more){let o=[],l=Math.max(t,n.from),a=-1;for(n.from>t&&o.push(new M(n.from-t-1).updateHeight(e,t));l<=r&&n.more;){let h=e.doc.lineAt(l).length;o.length&&o.push(null);let c=n.heights[n.index++];a==-1?a=c:Math.abs(c-a)>=Tt&&(a=-2);let u=new U(h,c);u.outdated=!1,o.push(u),l+=h+1}l<=r&&o.push(null,new M(r-l).updateHeight(e,l));let f=I.of(o);return(a<0||Math.abs(f.height-this.height)>=Tt||Math.abs(a-this.heightMetrics(e,t).perLine)>=Tt)&&(e.heightChanged=!0),f}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Io extends I{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,n){let r=i+this.left.height;return e<r?this.left.blockAt(e,t,i,n):this.right.blockAt(e,t,r,n+this.left.length+this.break)}lineAt(e,t,i,n,r){let o=n+this.left.height,l=r+this.left.length+this.break,a=t==q.ByHeight?e<o:e<l,f=a?this.left.lineAt(e,t,i,n,r):this.right.lineAt(e,t,i,o,l);if(this.break||(a?f.to<l:f.from>l))return f;let h=t==q.ByPosNoHeight?q.ByPosNoHeight:q.ByPos;return a?f.join(this.right.lineAt(l,h,i,o,l)):this.left.lineAt(l,h,i,n,r).join(f)}forEachLine(e,t,i,n,r,o){let l=n+this.left.height,a=r+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,i,n,r,o),t>=a&&this.right.forEachLine(e,t,i,l,a,o);else{let f=this.lineAt(a,q.ByPos,i,n,r);e<f.from&&this.left.forEachLine(e,f.from-1,i,n,r,o),f.to>=e&&f.from<=t&&o(f),t>f.to&&this.right.forEachLine(f.to+1,t,i,l,a,o)}}replace(e,t,i){let n=this.left.length+this.break;if(t<n)return this.balanced(this.left.replace(e,t,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-n,t-n,i));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&bn(r,o-1),t<this.length){let l=r.length;this.decomposeRight(t,r),bn(r,l)}return I.of(r)}decomposeLeft(e,t){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(i++,e>=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,n=i+this.break;if(e>=n)return this.right.decomposeRight(e-n,t);e<i&&this.left.decomposeRight(e,t),this.break&&e<n&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?I.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=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,i=!1,n){let{left:r,right:o}=this,l=t+r.length+this.break,a=null;return n&&n.from<=t+r.length&&n.more?a=r=r.updateHeight(e,t,i,n):r.updateHeight(e,t,i),n&&n.from<=l+o.length&&n.more?a=o=o.updateHeight(e,l,i,n):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function bn(s,e){let t,i;s[e]==null&&(t=s[e-1])instanceof M&&(i=s[e+1])instanceof M&&s.splice(e-1,3,new M(t.length+1+i.length))}const Fo=5;class Ai{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 i=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof U?n.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new U(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e<t||i.heightRelevant){let n=i.widget?i.widget.estimatedHeight:0,r=i.widget?i.widget.lineBreaks:0;n<0&&(n=this.oracle.lineHeight);let o=t-e;i.block?this.addBlock(new Fs(o,n,i)):(o||r||n>=Fo)&&this.addLineDeco(n,r,o)}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||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new U(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new M(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof U)return e;let t=new U(0,-1);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,i){let n=this.ensureLine();n.length+=i,n.collapsed+=i,n.widgetHeight=Math.max(n.widgetHeight,e),n.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof U)&&!this.isCovered?this.nodes.push(new U(0,-1)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let n of this.nodes)n instanceof U&&n.updateHeight(this.oracle,i),i+=n?n.length:1;return this.nodes}static build(e,t,i,n){let r=new Ai(i,e);return R.spans(t,i,n,r,0),r.finish(i)}}function Uo(s,e,t){let i=new No;return R.compare(s,e,t,i,0),i.changes}class No{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,i,n){(e<t||i&&i.heightRelevant||n&&n.heightRelevant)&&ci(e,t,this.changes,5)}}function zo(s,e){let t=s.getBoundingClientRect(),i=s.ownerDocument,n=i.defaultView||window,r=Math.max(0,t.left),o=Math.min(n.innerWidth,t.right),l=Math.max(0,t.top),a=Math.min(n.innerHeight,t.bottom);for(let f=s.parentNode;f&&f!=i.body;)if(f.nodeType==1){let h=f,c=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&c.overflow!="visible"){let u=h.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=f==s.parentNode?u.bottom:Math.min(a,u.bottom)}f=c.position=="absolute"||c.position=="fixed"?h.offsetParent:h.parentNode}else if(f.nodeType==11)f=f.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function _o(s,e){let t=s.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Gt{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let n=e[i],r=t[i];if(n.from!=r.from||n.to!=r.to||n.size!=r.size)return!1}return!0}draw(e,t){return F.replace({widget:new jo(this.size*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class jo extends Wt{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 yn{constructor(e){this.state=e,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.scrollTop=0,this.scrolledToBottom=!0,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Pn,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=B.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(Ri).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new Go(t),this.stateDeco=e.facet(He).filter(i=>typeof i!="function"),this.heightMap=I.empty().applyChanges(this.stateDeco,Q.empty,this.heightOracle.setDoc(e.doc),[new _(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=F.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let n=i?t.head:t.anchor;if(!e.some(({from:r,to:o})=>n>=r&&n<=o)){let{from:r,to:o}=this.lineBlockAt(n);e.push(new ft(r,o))}}this.viewports=e.sort((i,n)=>i.from-n.from),this.scaler=this.heightMap.height<=7e6?Pn:new Jo(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:Ye(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(He).filter(h=>typeof h!="function");let n=e.changedRanges,r=_.extendWithRanges(n,Uo(i,this.stateDeco,e?e.changes:C.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<a.from||t.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let f=!e.changes.empty||e.flags&2||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),f&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(oo)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),n=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?B.RTL:B.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let f=0,h=0;if(l.width&&l.height){let{scaleX:T,scaleY:A}=ns(t,l);(this.scaleX!=T||this.scaleY!=A)&&(this.scaleX=T,this.scaleY=A,f|=8,o=a=!0)}let c=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=c||this.paddingBottom!=u)&&(this.paddingTop=c,this.paddingBottom=u,f|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(n.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,f|=8);let O=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=O&&(this.scrollAnchorHeight=-1,this.scrollTop=O),this.scrolledToBottom=os(e.scrollDOM);let d=(this.printing?_o:zo)(t,this.paddingTop),g=d.top-this.pixelViewport.top,p=d.bottom-this.pixelViewport.bottom;this.pixelViewport=d;let m=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(m!=this.inView&&(this.inView=m,m&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let w=l.width;if((this.contentDOMWidth!=w||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,f|=8),a){let T=e.docView.measureVisibleLineHeights(this.viewport);if(n.mustRefreshForHeights(T)&&(o=!0),o||n.lineWrapping&&Math.abs(w-this.contentDOMWidth)>n.charWidth){let{lineHeight:A,charWidth:z,textHeight:or}=e.docView.measureTextSize();o=A>0&&n.refresh(r,A,z,or,w/z,T),o&&(e.docView.minWidth=0,f|=8)}g>0&&p>0?h=Math.max(g,p):g<0&&p<0&&(h=Math.min(g,p)),n.heightChanged=!1;for(let A of this.viewports){let z=A.from==this.viewport.from?T:e.docView.measureVisibleLineHeights(A);this.heightMap=(o?I.empty().applyChanges(this.stateDeco,Q.empty,this.heightOracle,[new _(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(n,0,o,new Bo(A.from,z))}n.heightChanged&&(f|=2)}let P=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return P&&(this.viewport=this.getViewport(h,this.scrollTarget)),this.updateForViewport(),(f&2||P)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),f|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),f}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),n=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new ft(n.lineAt(o-i*1e3,q.ByHeight,r,0,0).from,n.lineAt(l+(1-i)*1e3,q.ByHeight,r,0,0).to);if(t){let{head:f}=t.range;if(f<a.from||f>a.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),c=n.lineAt(f,q.ByPos,r,0,0),u;t.y=="center"?u=(c.top+c.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&f<a.from?u=c.top:u=c.bottom-h,a=new ft(n.lineAt(u-1e3/2,q.ByHeight,r,0,0).from,n.lineAt(u+h+1e3/2,q.ByHeight,r,0,0).to)}}return a}mapViewport(e,t){let i=t.mapPos(e.from,-1),n=t.mapPos(e.to,1);return new ft(this.heightMap.lineAt(i,q.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(n,q.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},i=0){if(!this.inView)return!0;let{top:n}=this.heightMap.lineAt(e,q.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(t,q.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||n<=o-Math.max(10,Math.min(-i,250)))&&(t==this.state.doc.length||r>=l+Math.max(10,Math.min(i,250)))&&n>o-2*1e3&&r<l+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let i=[];for(let n of e)t.touchesRange(n.from,n.to)||i.push(new Gt(t.mapPos(n.from),t.mapPos(n.to),n.size));return i}ensureLineGaps(e,t){let i=this.heightOracle.lineWrapping,n=i?1e4:2e3,r=n>>1,o=n<<1;if(this.defaultTextDirection!=B.LTR&&!i)return[];let l=[],a=(f,h,c,u)=>{if(h-f<r)return;let O=this.state.selection.main,d=[O.from];O.empty||d.push(O.to);for(let p of d)if(p>f&&p<h){a(f,p-10,c,u),a(p+10,h,c,u);return}let g=Ko(e,p=>p.from>=c.from&&p.to<=c.to&&Math.abs(p.from-f)<r&&Math.abs(p.to-h)<r&&!d.some(m=>p.from<m&&p.to>m));if(!g){if(h<c.to&&t&&i&&t.visibleRanges.some(p=>p.from<=h&&p.to>=h)){let p=t.moveToLineBoundary(S.cursor(h),!1,!0).head;p>f&&(h=p)}g=new Gt(f,h,this.gapSize(c,f,h,u))}l.push(g)};for(let f of this.viewportLines){if(f.length<o)continue;let h=Ho(f.from,f.to,this.stateDeco);if(h.total<o)continue;let c=this.scrollTarget?this.scrollTarget.range.head:null,u,O;if(i){let d=n/this.heightOracle.lineLength*this.heightOracle.lineHeight,g,p;if(c!=null){let m=ut(h,c),w=((this.visibleBottom-this.visibleTop)/2+d)/f.height;g=m-w,p=m+w}else g=(this.visibleTop-f.top-d)/f.height,p=(this.visibleBottom-f.top+d)/f.height;u=ct(h,g),O=ct(h,p)}else{let d=h.total*this.heightOracle.charWidth,g=n*this.heightOracle.charWidth,p,m;if(c!=null){let w=ut(h,c),P=((this.pixelViewport.right-this.pixelViewport.left)/2+g)/d;p=w-P,m=w+P}else p=(this.pixelViewport.left-g)/d,m=(this.pixelViewport.right+g)/d;u=ct(h,p),O=ct(h,m)}u>f.from&&a(f.from,u,f,h),O<f.to&&a(O,f.to,f,h)}return l}gapSize(e,t,i,n){let r=ut(n,i)-ut(n,t);return this.heightOracle.lineWrapping?e.height*r:n.total*this.heightOracle.charWidth*r}updateLineGaps(e){Gt.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=F.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];R.spans(e,this.viewport.from,this.viewport.to,{span(n,r){t.push({from:n,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((n,r)=>n.from!=t[r].from||n.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Ye(this.heightMap.lineAt(e,q.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return Ye(this.heightMap.lineAt(this.scaler.fromDOM(e),q.ByHeight,this.heightOracle,0,0),this.scaler)}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 Ye(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 ft{constructor(e,t){this.from=e,this.to=t}}function Ho(s,e,t){let i=[],n=s,r=0;return R.spans(t,s,e,{span(){},point(o,l){o>n&&(i.push({from:n,to:o}),r+=o-n),n=l}},20),n<e&&(i.push({from:n,to:e}),r+=e-n),{total:r,ranges:i}}function ct({total:s,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let i=Math.floor(s*t);for(let n=0;;n++){let{from:r,to:o}=e[n],l=o-r;if(i<=l)return r+i;i-=l}}function ut(s,e){let t=0;for(let{from:i,to:n}of s.ranges){if(e<=n){t+=e-i;break}t+=n-i}return t/s.total}function Ko(s,e){for(let t of s)if(e(t))return t}const Pn={toDOM(s){return s},fromDOM(s){return s},scale:1};class Jo{constructor(e,t,i){let n=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let f=t.lineAt(l,q.ByPos,e,0,0).top,h=t.lineAt(a,q.ByPos,e,0,0).bottom;return n+=h-f,{from:l,to:a,top:f,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-n)/(t.height-n);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,n=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.top)return n+(e-i)*this.scale;if(e<=r.bottom)return r.domTop+(e-r.top);i=r.bottom,n=r.domBottom}}fromDOM(e){for(let t=0,i=0,n=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.domTop)return i+(e-n)/this.scale;if(e<=r.domBottom)return r.top+(e-r.domTop);i=r.bottom,n=r.domBottom}}}function Ye(s,e){if(e.scale==1)return s;let t=e.toDOM(s.top),i=e.toDOM(s.bottom);return new ee(s.from,s.length,t,i-t,Array.isArray(s._content)?s._content.map(n=>Ye(n,e)):s._content)}const Ot=b.define({combine:s=>s.join(" ")}),xi=b.define({combine:s=>s.indexOf(!0)>-1}),Si=Re.newName(),Us=Re.newName(),Ns=Re.newName(),zs={"&light":"."+Us,"&dark":"."+Ns};function wi(s,e,t){return new Re(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,n=>{if(n=="&")return s;if(!t||!t[n])throw new RangeError(`Unsupported selector: ${n}`);return t[n]}):s+" "+i}})}const el=wi("."+Si,{"&":{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},".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":{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:"#444"},".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",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&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},"&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-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"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".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"}},zs),De="";class tl{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet($.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=De}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let n=e;;){this.findPointBefore(i,n);let r=this.text.length;this.readNode(n);let o=n.nextSibling;if(o==t)break;let l=W.get(n),a=W.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:Qn(n))||Qn(o)&&(n.nodeName!="BR"||n.cmIgnore)&&this.text.length>r)&&this.lineBreak(),n=o}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,n=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=n.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=W.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let n=i.iter();!n.next().done;)n.lineBreak?this.lineBreak():this.append(n.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(il(e,i.node,i.offset)?t:0))}}function il(s,e,t){for(;;){if(!e||t<oe(e))return!1;if(e==s)return!0;t=_e(e)+1,e=e.parentNode}}function Qn(s){return s.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(s.nodeName)}class vn{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class nl{constructor(e,t,i,n){this.typeOver=n,this.bounds=null,this.text="";let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let l=r||o?[]:ol(e),a=new tl(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=ll(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!ri(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),f=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!ri(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if(x.ios&&e.state.selection.main.empty&&a!=f&&(h.from>0||h.to<e.state.doc.length)){let c=h.from-Math.min(a,f),u=h.to-Math.max(a,f);(c==0||c==1)&&(u==0||u==-1)&&(a=0,f=e.state.doc.length)}this.newSel=S.single(f,a)}}}function _s(s,e){let t,{newSel:i}=e,n=s.state.selection.main,r=s.inputState.lastKeyTime>Date.now()-100?s.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=n.from,f=null;(r===8||x.android&&e.text.length<l-o)&&(a=n.to,f="end");let h=rl(s.state.doc.sliceString(o,l,De),e.text,a-o,f);h&&(x.chrome&&r==13&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==De+De&&h.toB--,t={from:o+h.from,to:o+h.toA,insert:Q.of(e.text.slice(h.from,h.toB).split(De))})}else i&&(!s.hasFocus&&s.state.facet(At)||i.main.eq(n))&&(i=null);if(!t&&!i)return!1;if(!t&&e.typeOver&&!n.empty&&i&&i.main.empty?t={from:n.from,to:n.to,insert:s.state.doc.slice(n.from,n.to)}:t&&t.from>=n.from&&t.to<=n.to&&(t.from!=n.from||t.to!=n.to)&&n.to-n.from-(t.to-t.from)<=4?t={from:n.from,to:n.to,insert:s.state.doc.slice(n.from,t.from).append(t.insert).append(s.state.doc.slice(t.to,n.to))}:(x.mac||x.android)&&t&&t.from==t.to&&t.from==n.head-1&&/^\. ?$/.test(t.insert.toString())&&s.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=S.single(i.main.anchor-1,i.main.head-1)),t={from:n.from,to:n.to,insert:Q.of([" "])}):x.chrome&&t&&t.from==t.to&&t.from==n.head&&t.insert.toString()==`
 `&&s.lineWrapping&&(i&&(i=S.single(i.main.anchor-1,i.main.head-1)),t={from:n.from,to:n.to,insert:Q.of([" "])}),t){if(x.ios&&s.inputState.flushIOSKey()||x.android&&(t.from==n.from&&t.to==n.to&&t.insert.length==1&&t.insert.lines==2&&ke(s.contentDOM,"Enter",13)||(t.from==n.from-1&&t.to==n.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>n.head)&&ke(s.contentDOM,"Backspace",8)||t.from==n.from&&t.to==n.to+1&&t.insert.length==0&&ke(s.contentDOM,"Delete",46)))return!0;let o=t.insert.toString();s.inputState.composing>=0&&s.inputState.composing++;let l,a=()=>l||(l=sl(s,t,i));return s.state.facet(Qs).some(f=>f(s,t.from,t.to,o,a))||s.dispatch(a()),!0}else if(i&&!i.main.eq(n)){let o=!1,l="select";return s.inputState.lastSelectionTime>Date.now()-50&&(s.inputState.lastSelectionOrigin=="select"&&(o=!0),l=s.inputState.lastSelectionOrigin),s.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function sl(s,e,t){let i,n=s.state,r=n.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&s.inputState.composing<0){let l=r.from<e.from?n.sliceDoc(r.from,e.from):"",a=r.to>e.to?n.sliceDoc(e.to,r.to):"";i=n.replaceSelection(s.state.toText(l+e.insert.sliceString(0,void 0,s.state.lineBreak)+a))}else{let l=n.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(n.selection.ranges.length>1&&s.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let f=s.state.sliceDoc(e.from,e.to),h,c=t&&Vs(s,t.main.head);if(c){let d=e.insert.length-(e.to-e.from);h={from:c.from,to:c.to-d}}else h=s.state.doc.lineAt(r.head);let u=r.to-e.to,O=r.to-r.from;i=n.changeByRange(d=>{if(d.from==r.from&&d.to==r.to)return{changes:l,range:a||d.map(l)};let g=d.to-u,p=g-f.length;if(d.to-d.from!=O||s.state.sliceDoc(p,g)!=f||d.to>=h.from&&d.from<=h.to)return{range:d};let m=n.changes({from:p,to:g,insert:e.insert}),w=d.to-r.to;return{changes:m,range:a?S.range(Math.max(0,a.anchor+w),Math.max(0,a.head+w)):d.map(m)}})}else i={changes:l,selection:a&&n.selection.replaceRange(a)}}let o="input.type";return(s.composing||s.inputState.compositionPendingChange&&s.inputState.compositionEndedAt>Date.now()-50)&&(s.inputState.compositionPendingChange=!1,o+=".compose",s.inputState.compositionFirstChange&&(o+=".start",s.inputState.compositionFirstChange=!1)),n.update(i,{userEvent:o,scrollIntoView:!0})}function rl(s,e,t,i){let n=Math.min(s.length,e.length),r=0;for(;r<n&&s.charCodeAt(r)==e.charCodeAt(r);)r++;if(r==n&&s.length==e.length)return null;let o=s.length,l=e.length;for(;o>0&&l>0&&s.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o<r&&s.length<e.length){let a=t<=r&&t>=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l<r){let a=t<=r&&t>=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function ol(s){let e=[];if(s.root.activeElement!=s.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:n,focusOffset:r}=s.observer.selectionRange;return t&&(e.push(new vn(t,i)),(n!=t||r!=i)&&e.push(new vn(n,r))),e}function ll(s,e){if(s.length==0)return null;let t=s[0].pos,i=s.length==2?s[1].pos:t;return t>-1&&i>-1?S.single(t+e,i+e):null}const al={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Bt=x.ie&&x.ie_version<=11;class hl{constructor(e){this.view=e,this.active=!1,this.selectionRange=new Br,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.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(x.ie&&x.ie_version<=11||x.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),Bt&&(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),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(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.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){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,i)=>t!=e[i]))){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:i}=this,n=this.selectionRange;if(i.state.facet(At)?i.root.activeElement!=this.dom:!St(i.dom,n))return;let r=n.anchorNode&&i.docView.nearest(n.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(x.ie&&x.ie_version<=11||x.android&&x.chrome)&&!i.state.selection.main.empty&&n.focusNode&&Ge(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=x.safari&&e.root.nodeType==11&&Dr(this.dom.ownerDocument)==this.dom&&fl(this.view)||Qt(e.root);if(!t||this.selectionRange.eq(t))return!1;let i=St(this.dom,t);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Fr(this.dom,t)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(t),i&&(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 i=this.dom;i;)if(i.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=t)i.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,al),Bt&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Bt&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var i;if(!this.delayedAndroidKey){let n=()=>{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&ke(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(n)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.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,i=-1,n=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(n=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:n}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),n=this.selectionChanged&&St(this.dom,this.selectionRange);if(e<0&&!n)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new nl(this.view,e,t,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}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 i=this.view.state,n=_s(this.view,t);return this.view.state==i&&this.view.update([]),n}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let i=kn(t,e.previousSibling||e.target.previousSibling,-1),n=kn(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:n?t.posBefore(n):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{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),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),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function kn(s,e,t){for(;e;){let i=W.get(e);if(i&&i.parent==s)return i;let n=e.parentNode;e=n!=s.dom?n:t>0?e.nextSibling:e.previousSibling}return null}function fl(s){let e=null;function t(a){a.preventDefault(),a.stopImmediatePropagation(),e=a.getTargetRanges()[0]}if(s.contentDOM.addEventListener("beforeinput",t,!0),s.dom.ownerDocument.execCommand("indent"),s.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let i=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset,l=s.docView.domAtPos(s.state.selection.main.anchor);return Ge(l.node,l.offset,r,o)&&([i,n,r,o]=[r,o,i,n]),{anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:o}}class v{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.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){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),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(i=>i.forEach(n=>t(n,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Ir(e.parent)||document,this.viewState=new yn(e.state||$.create(e)),e.scrollTo&&e.scrollTo.is(lt)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ce).map(i=>new Dt(i));for(let i of this.plugins)i.update(this);this.observer=new hl(this),this.inputState=new Qo(this),this.inputState.ensureHandlers(this.plugins),this.docView=new rn(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=e.length==1&&e[0]instanceof L?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,n,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(Gs))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=Bs(r,o),a||(l=1));let f=this.observer.delayedAndroidKey,h=null;if(f?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(h=null)):this.observer.clear(),r.facet($.phrases)!=this.state.facet($.phrases))return this.setState(r);n=vt.create(this,r,e),n.flags|=l;let c=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(c&&(c=c.map(u.changes)),u.scrollIntoView){let{main:O}=u.state.selection;c=new qe(O.empty?O:S.cursor(O.head,O.head>O.anchor?-1:1))}for(let O of u.effects)O.is(lt)&&(c=O.value.clip(this.state))}this.viewState.update(n,c),this.bidiCache=kt.update(this.bidiCache,n.changes),n.empty||(this.updatePlugins(n),this.inputState.update(n)),t=this.docView.update(n),this.state.facet(Me)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(n.startState.facet(Ot)!=n.state.facet(Ot)&&(this.viewState.mustMeasureContent=!0),(t||i||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!n.empty)for(let u of this.state.facet(pi))try{u(n)}catch(O){xe(this.state,O,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!_s(this,h)&&f.force&&ke(this.contentDOM,f.key,f.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new yn(e),this.plugins=e.facet(Ce).map(i=>new Dt(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new rn(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Ce),i=e.state.facet(Ce);if(t!=i){let n=[];for(let r of i){let o=t.indexOf(r);if(o<0)n.push(new Dt(r));else{let l=this.plugins[o];l.mustUpdate=e,n.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let n of this.plugins)n.mustUpdate=e;for(let n=0;n<this.plugins.length;n++)this.plugins[n].update(this);t!=i&&this.inputState.ensureHandlers(this.plugins)}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.scrollDOM,n=i.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(n-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(os(i))r=-1,o=this.viewState.heightMap.height;else{let O=this.viewState.scrollAnchorAt(n);r=O.from,o=O.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let f=[];a&4||([this.measureRequests,f]=[f,this.measureRequests]);let h=f.map(O=>{try{return O.read(this)}catch(d){return xe(this.state,d),qn}}),c=vt.create(this,this.state,[]),u=!1;c.flags|=a,t?t.flags|=a:t=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),u=this.docView.update(c));for(let O=0;O<f.length;O++)if(h[O]!=qn)try{let d=f[O];d.write&&d.write(h[O],this)}catch(d){xe(this.state,d)}if(u&&this.docView.updateSelection(!0),!c.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let d=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o;if(d>1||d<-1){n=n+d,i.scrollTop=n/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(pi))l(t)}get themeClasses(){return Si+" "+(this.state.facet(xi)?Ns:Us)+" "+this.state.facet(Ot)}updateAttrs(){let e=$n(this,qs,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(At)?"true":"false",class:"cm-content",style:`${x.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),$n(this,Ri,t);let i=this.observer.ignore(()=>{let n=fi(this.contentDOM,this.contentAttrs,t),r=fi(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let n of i.effects)if(n.is(v.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=n.value}}mountStyles(){this.styleModules=this.state.facet(Me);let e=this.state.facet(v.cspNonce);Re.mount(this.root,this.styleModules.concat(el).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.spec!=e)&&this.pluginMap.set(e,t=this.plugins.find(i=>i.spec==e)||null),t&&t.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(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return Lt(this,e,cn(this,e,t,i))}moveByGroup(e,t){return Lt(this,e,cn(this,e,t,i=>yo(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),n=this.textDirectionAt(e.from),r=i[t?i.length-1:0];return S.cursor(r.side(t,n)+e.from,r.forward(!t,n)?1:-1)}moveToLineBoundary(e,t,i=!0){return bo(this,e,t,i)}moveVertically(e,t,i){return Lt(this,e,Po(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),Es(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let n=this.state.doc.lineAt(e),r=this.bidiSpans(n),o=r[ce.find(r,e-n.from,-1,t)];return vi(i,o.dir==B.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(ks)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>cl)return Ss(e.length);let t=this.textDirectionAt(e.from),i;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||xs(r.isolates,i=sn(this,e))))return r.order;i||(i=sn(this,e));let n=no(e.text,t,i);return this.bidiCache.push(new kt(e.from,e.to,t,i,!0,n)),n}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||x.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{ss(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.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(e,t={}){return lt.of(new qe(typeof e=="number"?S.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return lt.of(new qe(S.cursor(i.from),"start","start",i.top-e,t,!0))}static domEventHandlers(e){return je.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return je.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=Re.newName(),n=[Ot.of(i),Me.of(wi(`.${i}`,e))];return t&&t.dark&&n.push(xi.of(!0)),n}static baseTheme(e){return Pi.lowest(Me.of(wi("."+Si,e,zs)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),n=i&&W.get(i)||W.get(e);return((t=n==null?void 0:n.rootView)===null||t===void 0?void 0:t.view)||null}}v.styleModule=Me;v.inputHandler=Qs;v.focusChangeEffect=vs;v.perLineTextDirection=ks;v.exceptionSink=Ps;v.updateListener=pi;v.editable=At;v.mouseSelectionStyle=ys;v.dragMovesSelection=bs;v.clickAddsSelectionRange=Ts;v.decorations=He;v.outerDecorations=$s;v.atomicRanges=Wi;v.bidiIsolatedRanges=Rs;v.scrollMargins=Ws;v.darkTheme=xi;v.cspNonce=b.define({combine:s=>s.length?s[0]:""});v.contentAttributes=Ri;v.editorAttributes=qs;v.lineWrapping=v.contentAttributes.of({class:"cm-lineWrapping"});v.announce=X.define();const cl=4096,qn={};class kt{constructor(e,t,i,n,r,o){this.from=e,this.to=t,this.dir=i,this.isolates=n,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let i=[],n=e.length?e[e.length-1].dir:B.LTR;for(let r=Math.max(0,e.length-10);r<e.length;r++){let o=e[r];o.dir==n&&!t.touchesRange(o.from,o.to)&&i.push(new kt(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}}function $n(s,e,t){for(let i=s.state.facet(e),n=i.length-1;n>=0;n--){let r=i[n],o=typeof r=="function"?r(s):r;o&&hi(o,t)}return t}const ul=x.mac?"mac":x.windows?"win":x.linux?"linux":"key";function Ol(s,e){const t=s.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let n,r,o,l;for(let a=0;a<t.length-1;++a){const f=t[a];if(/^(cmd|meta|m)$/i.test(f))l=!0;else if(/^a(lt)?$/i.test(f))n=!0;else if(/^(c|ctrl|control)$/i.test(f))r=!0;else if(/^s(hift)?$/i.test(f))o=!0;else if(/^mod$/i.test(f))e=="mac"?l=!0:r=!0;else throw new Error("Unrecognized modifier name: "+f)}return n&&(i="Alt-"+i),r&&(i="Ctrl-"+i),l&&(i="Meta-"+i),o&&(i="Shift-"+i),i}function dt(s,e,t){return e.altKey&&(s="Alt-"+s),e.ctrlKey&&(s="Ctrl-"+s),e.metaKey&&(s="Meta-"+s),t!==!1&&e.shiftKey&&(s="Shift-"+s),s}const dl=Pi.default(v.domEventHandlers({keydown(s,e){return xl(pl(e.state),s,e,"editor")}})),js=b.define({enables:dl}),Rn=new WeakMap;function pl(s){let e=s.facet(js),t=Rn.get(e);return t||Rn.set(e,t=ml(e.reduce((i,n)=>i.concat(n),[]))),t}let he=null;const gl=4e3;function ml(s,e=ul){let t=Object.create(null),i=Object.create(null),n=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,f,h)=>{var c,u;let O=t[o]||(t[o]=Object.create(null)),d=l.split(/ (?!$)/).map(m=>Ol(m,e));for(let m=1;m<d.length;m++){let w=d.slice(0,m).join(" ");n(w,!0),O[w]||(O[w]={preventDefault:!0,stopPropagation:!1,run:[P=>{let T=he={view:P,prefix:w,scope:o};return setTimeout(()=>{he==T&&(he=null)},gl),!0}]})}let g=d.join(" ");n(g,!1);let p=O[g]||(O[g]={preventDefault:!1,stopPropagation:!1,run:((u=(c=O._any)===null||c===void 0?void 0:c.run)===null||u===void 0?void 0:u.slice())||[]});a&&p.run.push(a),f&&(p.preventDefault=!0),h&&(p.stopPropagation=!0)};for(let o of s){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let f of l){let h=t[f]||(t[f]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let c in h)h[c].run.push(o.any)}let a=o[e]||o.key;if(a)for(let f of l)r(f,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(f,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}function xl(s,e,t,i){let n=Yr(e),r=mt(n,0),o=Ut(r)==n.length&&n!=" ",l="",a=!1,f=!1,h=!1;he&&he.view==t&&he.scope==i&&(l=he.prefix+" ",Ms.indexOf(e.keyCode)<0&&(f=!0,he=null));let c=new Set,u=p=>{if(p){for(let m of p.run)if(!c.has(m)&&(c.add(m),m(t,e)))return p.stopPropagation&&(h=!0),!0;p.preventDefault&&(p.stopPropagation&&(h=!0),f=!0)}return!1},O=s[i],d,g;return O&&(u(O[l+dt(n,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(x.windows&&e.ctrlKey&&e.altKey)&&(d=Oe[e.keyCode])&&d!=n?(u(O[l+dt(d,e,!0)])||e.shiftKey&&(g=Ne[e.keyCode])!=n&&g!=d&&u(O[l+dt(g,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(O[l+dt(n,e,!0)])&&(a=!0),!a&&u(O._any)&&(a=!0)),f&&(a=!0),a&&h&&e.stopPropagation(),a}const Sl=!x.ios,Wn={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Sl&&(Wn[".cm-line"].caretColor="transparent !important",Wn[".cm-content"]={caretColor:"transparent !important"});class Ae extends Se{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Ae.prototype.elementClass="";Ae.prototype.toDOM=void 0;Ae.prototype.mapMode=G.TrackBefore;Ae.prototype.startSide=Ae.prototype.endSide=-1;Ae.prototype.point=!0;const wl=1,Hs=196,Ks=197,Tl=198,An=199,bl=200,yl=201,Pl=202,Ql=2,vl=203,kl=204,ql=3,$l=205,Rl=206,Wl=4,Al=207,Vl=208,Xl=5,El=209,Cl=26,Ml=27,Yl=51,Dl=52,Zl=57,Ll=58,Gl=59,Bl=61,Il=62,Fl=63,Ul=64,Nl=65,zl=67,_l=246,jl=74,Hl=265,Kl=129,Jl=150,ea=151,ta=154,Ke=10,Je=13,Vi=32,Vt=9,Xi=35,ia=40,na=46,Vn=123,Js=39,er=34,sa=new Set([Ml,Yl,Dl,Hl,zl,Kl,Ll,Gl,_l,Ul,Nl,jl,Il,Fl,Jl,ea,ta]);function It(s){return s==Ke||s==Je}const ra=new qt((s,e)=>{if(s.next<0)s.acceptToken(yl);else if(e.context.depth<0)It(s.next)&&s.acceptToken(bl,1);else if(It(s.peek(-1))&&e.canShift(An)){let t=0;for(;s.next==Vi||s.next==Vt;)s.advance(),t++;(s.next==Ke||s.next==Je||s.next==Xi)&&s.acceptToken(An,-t)}else It(s.next)&&s.acceptToken(Tl,1)},{contextual:!0}),oa=new qt((s,e)=>{let t=e.context.depth;if(t<0)return;let i=s.peek(-1);if(i==Ke||i==Je){let n=0,r=0;for(;;){if(s.next==Vi)n++;else if(s.next==Vt)n+=8-n%8;else break;s.advance(),r++}n!=t&&s.next!=Ke&&s.next!=Je&&s.next!=Xi&&(n<t?s.acceptToken(Ks,-r):s.acceptToken(Hs))}});function Ti(s,e){this.parent=s,this.depth=e,this.hash=(s?s.hash+s.hash<<8:0)+e+(e<<4)}const la=new Ti(null,0);function aa(s){let e=0;for(let t=0;t<s.length;t++)e+=s.charCodeAt(t)==Vt?8-e%8:1;return e}const ha=new lr({start:la,reduce(s,e){return s.depth<0&&sa.has(e)?s.parent:s},shift(s,e,t,i){return e==Hs?new Ti(s,aa(i.read(i.pos,t.pos))):e==Ks?s.parent:e==Cl||e==Zl||e==Bl?new Ti(s,-1):s},hash(s){return s.hash}}),fa=new qt(s=>{for(let e=0;e<5;e++){if(s.next!="print".charCodeAt(e))return;s.advance()}if(!/\w/.test(String.fromCharCode(s.next)))for(let e=0;;e++){let t=s.peek(e);if(!(t==Vi||t==Vt)){t!=ia&&t!=na&&t!=Ke&&t!=Je&&t!=Xi&&s.acceptToken(wl);return}}});function Xt(s,e,t,i,n){return new qt(r=>{let o=r.pos;for(;!(r.next<0);)if(r.next==Vn)if(r.peek(1)==Vn)r.advance(2);else{if(r.pos==o){r.acceptToken(i,1);return}break}else if(r.next=="\\")r.advance(),r.next>=0&&r.advance();else if(r.next==s&&(e==1||r.peek(1)==s&&r.peek(2)==s)){if(r.pos==o){r.acceptToken(n,e);return}break}else r.advance();r.pos>o&&r.acceptToken(t)})}const ca=Xt(Js,1,Pl,Ql,vl),ua=Xt(er,1,kl,ql,$l),Oa=Xt(Js,3,Rl,Wl,Al),da=Xt(er,3,Vl,Xl,El),pa=ar({'async "*" "**" FormatConversion FormatSpec':y.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":y.controlKeyword,"in not and or is del":y.operatorKeyword,"from def class global nonlocal lambda":y.definitionKeyword,import:y.moduleKeyword,"with as print":y.keyword,Boolean:y.bool,None:y.null,VariableName:y.variableName,"CallExpression/VariableName":y.function(y.variableName),"FunctionDefinition/VariableName":y.function(y.definition(y.variableName)),"ClassDefinition/VariableName":y.definition(y.className),PropertyName:y.propertyName,"CallExpression/MemberExpression/PropertyName":y.function(y.propertyName),Comment:y.lineComment,Number:y.number,String:y.string,FormatString:y.special(y.string),UpdateOp:y.updateOperator,"ArithOp!":y.arithmeticOperator,BitOp:y.bitwiseOperator,CompareOp:y.compareOperator,AssignOp:y.definitionOperator,Ellipsis:y.punctuation,At:y.meta,"( )":y.paren,"[ ]":y.squareBracket,"{ }":y.brace,".":y.derefOperator,", ;":y.separator}),ga={__proto__:null,await:48,or:58,and:60,in:64,not:66,is:68,if:74,else:76,lambda:80,yield:98,from:100,async:106,for:108,None:168,True:170,False:170,del:184,pass:188,break:192,continue:196,return:200,raise:208,import:212,as:214,global:218,nonlocal:220,assert:224,elif:234,while:238,try:244,except:246,finally:248,with:252,def:256,class:266,match:277,case:283},ma=hr.deserialize({version:14,states:"#!OO`Q#yOOP$_OSOOO%hQ&nO'#H^OOQS'#Cq'#CqOOQS'#Cr'#CrO'WQ#xO'#CpO(yQ&nO'#H]OOQS'#H^'#H^OOQS'#DW'#DWOOQS'#H]'#H]O)gQ#xO'#DaO)zQ#xO'#DhO*[Q#xO'#DlOOQS'#Dw'#DwO*oO,UO'#DwO*wO7[O'#DwO+POWO'#DxO+[O`O'#DxO+gOpO'#DxO+rO!bO'#DxO-tQ&nO'#G}OOQS'#G}'#G}O'WQ#xO'#G|O/WQ&nO'#G|OOQS'#Ee'#EeO/oQ#xO'#EfOOQS'#G{'#G{O/yQ#xO'#GzOOQV'#Gz'#GzO0UQ#xO'#FXOOQS'#G`'#G`O0ZQ#xO'#FWOOQV'#IS'#ISOOQV'#Gy'#GyOOQV'#Fp'#FpQ`Q#yOOO'WQ#xO'#CsO0iQ#xO'#DPO0pQ#xO'#DTO1OQ#xO'#HbO1`Q&nO'#EYO'WQ#xO'#EZOOQS'#E]'#E]OOQS'#E_'#E_OOQS'#Ea'#EaO1tQ#xO'#EcO2[Q#xO'#EgO0UQ#xO'#EiO2oQ&nO'#EiO0UQ#xO'#ElO/oQ#xO'#EoO/oQ#xO'#EsO/oQ#xO'#EvO2zQ#xO'#ExO3RQ#xO'#E}O3^Q#xO'#EyO/oQ#xO'#E}O0UQ#xO'#FPO0UQ#xO'#FUO3cQ#xO'#FZP3jO#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y#b#f#i#l$]$`+[Q#[[Q$YwR$c}Q%m!}Q%t#RQ%z#VQ't%WQ(a%pQ(e%uQ(m%{Q(p%|Q+O(jQ-j,jQ.b-kR/Q.aQ$byQ(]%nR*u(^Q.a-iR/q/gR#UZR#Z[R%]!mQ%Z!mV*e'w*f,a!]!pQ!r#q$O$a$o${%Q%R%S%T%U%V%p%u%{%|&r'['q)P)[)o*q*z+u,p/e0ZR%`!oQ&U#bQ&X#fQ&Z#iQ&]#lR,u+[Q(v&UQ(x&XQ(z&ZQ(|&]Q+`(wQ+a(yQ+b({Q+c(}Q-m,uR.c-nQ$l!SQ&y$`Q)t']R+y)uQ#ymQ$e!PQ$h!QR'R$gQ)a'QR+l)dQ)a'QQ+k)cR+l)dR$j!RXqOs)x+|Q$q!VR'^$rQ$x!YR'_$sR*['kQ*Y'kV-],[-^-xQ.X-bQ.t.RR.u.SU.Q-b.R.SQ.y.UQ/U.iQ/Z.oU/].q/^/mQ/b.vQ/p/cQ/r/hU/t/i/v0OQ0P/xQ0T/}R0U0QR.x.TR/W.i",nodeNames:"⚠ print { { { { Comment Script AssignStatement * BinaryExpression BitOp BitOp BitOp BitOp ArithOp ArithOp @ ArithOp ** UnaryExpression ArithOp BitOp AwaitExpression await ) ( ParenthesizedExpression BinaryExpression or and CompareOp in not is UnaryExpression ConditionalExpression if else LambdaExpression lambda ParamList VariableName AssignOp , : NamedExpression AssignOp YieldExpression yield from TupleExpression ComprehensionExpression async for LambdaExpression ] [ ArrayExpression ArrayComprehensionExpression } { DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression CallExpression ArgList AssignOp MemberExpression . PropertyName Number String FormatString FormatReplacement FormatConversion FormatSpec FormatReplacement FormatReplacement FormatReplacement FormatReplacement ContinuedString Ellipsis None Boolean TypeDef AssignOp UpdateStatement UpdateOp ExpressionStatement DeleteStatement del PassStatement pass BreakStatement break ContinueStatement continue ReturnStatement return YieldStatement PrintStatement RaiseStatement raise ImportStatement import as ScopeStatement global nonlocal AssertStatement assert StatementGroup ; IfStatement Body elif WhileStatement while ForStatement TryStatement try except finally WithStatement with FunctionDefinition def ParamList AssignOp TypeDef ClassDefinition class DecoratedStatement Decorator At MatchStatement match MatchBody MatchClause case CapturePattern LiteralPattern ArithOp ArithOp AsPattern OrPattern LogicOp AttributePattern SequencePattern MappingPattern StarPattern ClassPattern PatternArgList KeywordPattern KeywordPattern Guard",maxTerm:277,context:ha,nodeProps:[["group",-14,8,88,90,91,93,95,97,99,101,102,103,105,108,111,"Statement Statement",-22,10,20,23,27,42,51,52,58,59,62,63,64,65,66,69,72,73,74,82,83,84,85,"Expression",-10,113,115,118,120,121,125,127,132,134,137,"Statement",-9,142,143,146,147,149,150,151,152,153,"Pattern"],["openedBy",25,"(",56,"[",60,"{"],["closedBy",26,")",57,"]",61,"}"]],propSources:[pa],skippedNodes:[0,6],repeatNodeCount:37,tokenData:"%-W#sR!`OX%TXY=|Y[%T[]=|]p%Tpq=|qr@_rsDOst!+|tu%Tuv!Nnvw#!|wx#$Wxy#:Uyz#;Yz{#<^{|#>x|}#@S}!O#AW!O!P#Ci!P!Q#N_!Q!R$!y!R![$&w![!]$1e!]!^$3s!^!_$4w!_!`$7c!`!a$8m!a!b%T!b!c$;U!c!d$<b!d!e$>W!e!h$<b!h!i$H[!i!t$<b!t!u%#r!u!w$<b!w!x$Fl!x!}$<b!}#O%%z#O#P?d#P#Q%'O#Q#R%(S#R#S$<b#S#T%T#T#U$<b#U#V$>W#V#Y$<b#Y#Z$H[#Z#f$<b#f#g%#r#g#i$<b#i#j$Fl#j#o$<b#o#p%)^#p#q%*S#q#r%+^#r#s%,S#s$g%T$g;'S$<b;'S;=`$>Q<%lO$<b!n%^]&m!b&eS&hWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!n&^]&m!b&eSOr%Trs'Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8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Fl!u!}$<b!}#O%T#O#P7o#P#R%T#R#S$<b#S#T%T#T#U$<b#U#V$Fl#V#Y$<b#Y#Z%!S#Z#o$<b#o#p8^#p#q%T#q#r8^#r$g%T$g;'S$<b;'S;=`$>Q<%lO$<b#c%&V]!Zs&m!b&eS&hWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!q%'Z]!YR&m!b&eS&hWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#b%(__%sQ&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a%)gX!_#T&eS&hWOr8^rs9Qsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y<%lO8^#c%*__%rR&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!q%+gX!^!e&eS&hWOr8^rs9Qsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y<%lO8^#a%,_]%|q&m!b&eS&hWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T",tokenizers:[fa,oa,ra,ca,ua,Oa,da,0,1,2,3,4,5,6],topRules:{Script:[0,7]},specialized:[{term:229,get:s=>ga[s]||-1}],tokenPrec:7205});function Xn(s){let e=Object.keys(s).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function xa(s){let e=Object.create(null),t=Object.create(null);for(let{label:n}of s){e[n[0]]=!0;for(let r=1;r<n.length;r++)t[n[r]]=!0}let i=Xn(e)+Xn(t)+"*$";return[new RegExp("^"+i),new RegExp(i)]}function Sa(s){let e=s.map(n=>typeof n=="string"?{label:n}:n),[t,i]=e.every(n=>/^\w+$/.test(n.label))?[/\w*$/,/\w+$/]:xa(e);return n=>{let r=n.matchBefore(i);return r||n.explicit?{from:r?r.from:n.pos,options:e,validFor:t}:null}}function wa(s,e){return t=>{for(let i=Dn(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(s.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}const Ta=ye.define(),ba=v.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:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".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:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class ya{constructor(e,t,i,n){this.field=e,this.line=t,this.from=i,this.to=n}}class Ei{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,G.TrackDel),i=e.mapPos(this.to,1,G.TrackDel);return t==null||i==null?null:new Ei(this.field,t,i)}}class Ci{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],n=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let f=o,h=/^\t*/.exec(a)[0].length;for(let c=0;c<h;c++)f+=e.facet(fr);n.push(t+f.length-h),a=f+a.slice(h)}i.push(a),t+=a.length+1}let l=this.fieldPositions.map(a=>new Ei(a.field,n[a.line]+a.from,n[a.line]+a.to));return{text:i,ranges:l}}static parse(e){let t=[],i=[],n=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",f=-1;for(let h=0;h<t.length;h++)(l!=null?t[h].seq==l:a&&t[h].name==a)&&(f=h);if(f<0){let h=0;for(;h<t.length&&(l==null||t[h].seq!=null&&t[h].seq<l);)h++;t.splice(h,0,{seq:l,name:a}),f=h;for(let c of n)c.field>=f&&c.field++}n.push(new ya(f,i.length,r.index,r.index+a.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}for(let l;l=/\\([{}])/.exec(o);){o=o.slice(0,l.index)+l[1]+o.slice(l.index+l[0].length);for(let a of n)a.line==i.length&&a.from>l.index&&(a.from--,a.to--)}i.push(o)}return new Ci(i,n)}}let Pa=F.widget({widget:new class extends Wt{toDOM(){let s=document.createElement("span");return s.className="cm-snippetFieldPosition",s}ignoreEvent(){return!1}}}),Qa=F.mark({class:"cm-snippetField"});class Ve{constructor(e,t){this.ranges=e,this.active=t,this.deco=F.set(e.map(i=>(i.from==i.to?Pa:Qa).range(i.from,i.to)))}map(e){let t=[];for(let i of this.ranges){let n=i.map(e);if(!n)return null;t.push(n)}return new Ve(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const nt=X.define({map(s,e){return s&&s.map(e)}}),va=X.define(),et=be.define({create(){return null},update(s,e){for(let t of e.effects){if(t.is(nt))return t.value;if(t.is(va)&&s)return new Ve(s.ranges,t.value)}return s&&e.docChanged&&(s=s.map(e.changes)),s&&e.selection&&!s.selectionInsideField(e.selection)&&(s=null),s},provide:s=>v.decorations.from(s,e=>e?e.deco:F.none)});function Mi(s,e){return S.create(s.filter(t=>t.field==e).map(t=>S.range(t.from,t.to)))}function ka(s){let e=Ci.parse(s);return(t,i,n,r)=>{let{text:o,ranges:l}=e.instantiate(t.state,n),a={changes:{from:n,to:r,insert:Q.of(o)},scrollIntoView:!0,annotations:i?Ta.of(i):void 0};if(l.length&&(a.selection=Mi(l,0)),l.length>1){let f=new Ve(l,0),h=a.effects=[nt.of(f)];t.state.field(et,!1)===void 0&&h.push(X.appendConfig.of([et,Aa,Va,ba]))}t.dispatch(t.state.update(a))}}function tr(s){return({state:e,dispatch:t})=>{let i=e.field(et,!1);if(!i||s<0&&i.active==0)return!1;let n=i.active+s,r=s>0&&!i.ranges.some(o=>o.field==n+s);return t(e.update({selection:Mi(i.ranges,n),effects:nt.of(r?null:new Ve(i.ranges,n))})),!0}}const qa=({state:s,dispatch:e})=>s.field(et,!1)?(e(s.update({effects:nt.of(null)})),!0):!1,$a=tr(1),Ra=tr(-1),Wa=[{key:"Tab",run:$a,shift:Ra},{key:"Escape",run:qa}],En=b.define({combine(s){return s.length?s[0]:Wa}}),Aa=Pi.highest(js.compute([En],s=>s.facet(En)));function te(s,e){return Object.assign(Object.assign({},e),{apply:ka(s)})}const Va=v.domEventHandlers({mousedown(s,e){let t=e.state.field(et,!1),i;if(!t||(i=e.posAtCoords({x:s.clientX,y:s.clientY}))==null)return!1;let n=t.ranges.find(r=>r.from<=i&&r.to>=i);return!n||n.field==t.active?!1:(e.dispatch({selection:Mi(t.ranges,n.field),effects:nt.of(t.ranges.some(r=>r.field>n.field)?new Ve(t.ranges,n.field):null)}),!0)}}),ir=new class extends Se{};ir.startSide=1;ir.endSide=-1;const Cn=new mr,nr=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function pt(s){return(e,t,i)=>{if(i)return!1;let n=e.node.getChild("VariableName");return n&&t(n,s),!0}}const Xa={FunctionDefinition:pt("function"),ClassDefinition:pt("class"),ForStatement(s,e,t){if(t){for(let i=s.node.firstChild;i;i=i.nextSibling)if(i.name=="VariableName")e(i,"variable");else if(i.name=="in")break}},ImportStatement(s,e){var t,i;let{node:n}=s,r=((t=n.firstChild)===null||t===void 0?void 0:t.name)=="from";for(let o=n.getChild("import");o;o=o.nextSibling)o.name=="VariableName"&&((i=o.nextSibling)===null||i===void 0?void 0:i.name)!="as"&&e(o,r?"variable":"namespace")},AssignStatement(s,e){for(let t=s.node.firstChild;t;t=t.nextSibling)if(t.name=="VariableName")e(t,"variable");else if(t.name==":"||t.name=="AssignOp")break},ParamList(s,e){for(let t=null,i=s.node.firstChild;i;i=i.nextSibling)i.name=="VariableName"&&(!t||!/\*|AssignOp/.test(t.name))&&e(i,"variable"),t=i},CapturePattern:pt("variable"),AsPattern:pt("variable"),__proto__:null};function sr(s,e){let t=Cn.get(e);if(t)return t;let i=[],n=!0;function r(o,l){let a=s.sliceString(o.from,o.to);i.push({label:a,type:l})}return e.cursor(gr.IncludeAnonymous).iterate(o=>{if(o.name){let l=Xa[o.name];if(l&&l(o,r,n)||!n&&nr.has(o.name))return!1;n=!1}else if(o.to-o.from>8192){for(let l of sr(s,o.node))i.push(l);return!1}}),Cn.set(e,i),i}const Mn=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,rr=["String","FormatString","Comment","PropertyName"];function Ea(s){let e=Dn(s.state).resolveInner(s.pos,-1);if(rr.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&Mn.test(s.state.sliceDoc(e.from,e.to));if(!t&&!s.explicit)return null;let i=[];for(let n=e;n;n=n.parent)nr.has(n.name)&&(i=i.concat(sr(s.state.doc,n)));return{options:i,from:t?e.from:s.pos,validFor:Mn}}const Ca=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(s=>({label:s,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(s=>({label:s,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(s=>({label:s,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(s=>({label:s,type:"function"}))),Ma=[te("def ${name}(${params}):\n	${}",{label:"def",detail:"function",type:"keyword"}),te("for ${name} in ${collection}:\n	${}",{label:"for",detail:"loop",type:"keyword"}),te("while ${}:\n	${}",{label:"while",detail:"loop",type:"keyword"}),te("try:\n	${}\nexcept ${error}:\n	${}",{label:"try",detail:"/ except block",type:"keyword"}),te(`if \${}:
	
`,{label:"if",detail:"block",type:"keyword"}),te("if ${}:\n	${}\nelse:\n	${}",{label:"if",detail:"/ else block",type:"keyword"}),te("class ${name}:\n	def __init__(self, ${params}):\n			${}",{label:"class",detail:"definition",type:"keyword"}),te("import ${module}",{label:"import",detail:"statement",type:"keyword"}),te("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],Ya=wa(rr,Sa(Ca.concat(Ma)));function Yn(s,e){let t=s.lineIndent(e.from),i=s.lineAt(s.pos,-1),n=i.from+i.text.length;return/^\s*($|#)/.test(i.text)&&s.node.to<n+100&&!/\S/.test(s.state.sliceDoc(n,s.node.to))&&s.lineIndent(s.pos,-1)<=t||/^\s*(else:|elif |except |finally:)/.test(s.textAfter)&&s.lineIndent(s.pos,-1)>t?null:t+s.unit}const Ft=cr.define({name:"python",parser:ma.configure({props:[ur.add({Body:s=>{var e;return(e=Yn(s,s.node))!==null&&e!==void 0?e:s.continue()},IfStatement:s=>/^\s*(else:|elif )/.test(s.textAfter)?s.baseIndent:s.continue(),TryStatement:s=>/^\s*(except |finally:|else:)/.test(s.textAfter)?s.baseIndent:s.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":Et({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":Et({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":Et({closing:"]"}),"String FormatString":()=>null,Script:s=>{if(s.pos+/\s*/.exec(s.textAfter)[0].length>=s.node.to){let e=null;for(let t=s.node,i=t.to;t=t.lastChild,!(!t||t.to!=i);)t.type.name=="Body"&&(e=t);if(e){let t=Yn(s,e);if(t!=null)return t}}return s.continue()}}),Or.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":dr,Body:(s,e)=>({from:s.from+1,to:s.to-(s.to==e.doc.length?0:1)})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/}});function Ia(){return new pr(Ft,[Ft.data.of({autocomplete:Ea}),Ft.data.of({autocomplete:Ya})])}export{Ya as globalCompletion,Ea as localCompletionSource,Ia as python,Ft as pythonLanguage};
