PageSourceSearch

https://finding-calculang-foc.netlify.app/_node/@codemirror/[email protected]/index.66d24d9c.js

js finding-calculang-foc.netlify.app collected 2026-10-03 10:44:41 UTC 48,046 bytes, 5 lines download raw bytes

vendor: 48,046 bytes, lines 1-5
1class v{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,n){[t,e]=N(this,t,e);let i=[];return this.decompose(0,t,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(e,this.length,i,1),A.from(i,this.length-(e-t)+n.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=N(this,t,e);let n=[];return this.decompose(t,e,n,0),A.from(n,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),n=this.length-this.scanIdentical(t,-1),i=new q(this),s=new q(t);for(let r=e,o=e;;){if(i.next(r),s.next(r),r=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(o+=i.value.length,i.done||o>=n)return!0}}iter(t=1){return new q(this,t)}iterRange(t,e=this.length){return new yt(this,t,e)}iterLines(t,e){let n;if(t==null)n=this.iter();else{e==null&&(e=this.lines+1);let i=this.line(t).from;n=this.iterRange(i,Math.max(i,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new St(n)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?v.empty:t.length<=32?new m(t):A.from(m.split(t,[]))}}class m extends v{constructor(t,e=Ht(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,n,i){for(let s=0;;s++){let r=this.text[s],o=i+r.length;if((e?n:o)>=t)return new kt(i,o,n,r);i=o+1,n++}}decompose(t,e,n,i){let s=t<=0&&e>=this.length?this:new m(wt(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(i&1){let r=n.pop(),o=Y(s.text,r.text.slice(),0,s.length);if(o.length<=32)n.push(new m(o,r.length+s.length));else{let a=o.length>>1;n.push(new m(o.slice(0,a)),new m(o.slice(a)))}}else n.push(s)}replace(t,e,n){if(!(n instanceof m))return super.replace(t,e,n);[t,e]=N(this,t,e);let i=Y(this.text,Y(n.text,wt(this.text,0,t)),e),s=this.length+n.length-(e-t);return i.length<=32?new m(i,s):A.from(m.split(i,[]),s)}sliceString(t,e=this.length,n=`
2`){[t,e]=N(this,t,e);let i="";for(let s=0,r=0;s<=e&&r<this.text.length;r++){let o=this.text[r],a=s+o.length;s>t&&r&&(i+=n),t<a&&e>s&&(i+=o.slice(Math.max(0,t-s),e-s)),s=a+1}return i}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let n=[],i=-1;for(let s of t)n.push(s),i+=s.length+1,n.length==32&&(e.push(new m(n,i)),n=[],i=-1);return i>-1&&e.push(new m(n,i)),e}}class A extends v{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let n of t)this.lines+=n.lines}lineInner(t,e,n,i){for(let s=0;;s++){let r=this.children[s],o=i+r.length,a=n+r.lines-1;if((e?a:o)>=t)return r.lineInner(t,e,n,i);i=o+1,n=a+1}}decompose(t,e,n,i){for(let s=0,r=0;r<=e&&s<this.children.length;s++){let o=this.children[s],a=r+o.length;if(t<=a&&e>=r){let l=i&((r<=t?1:0)|(a>=e?2:0));r>=t&&a<=e&&!l?n.push(o):o.decompose(t-r,e-r,n,l)}r=a+1}}replace(t,e,n){if([t,e]=N(this,t,e),n.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let r=this.children[i],o=s+r.length;if(t>=s&&e<=o){let a=r.replace(t-s,e-s,n),l=this.lines-r.lines+a.lines;if(a.lines<l>>4&&a.lines>l>>6){let c=this.children.slice();return c[i]=a,new A(c,this.length-(e-t)+n.length)}return super.replace(s,o,a)}s=o+1}return super.replace(t,e,n)}sliceString(t,e=this.length,n=`
3`){[t,e]=N(this,t,e);let i="";for(let s=0,r=0;s<this.children.length&&r<=e;s++){let o=this.children[s],a=r+o.length;r>t&&s&&(i+=n),t<a&&e>r&&(i+=o.sliceString(t-r,e-r,n)),r=a+1}return i}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof A))return 0;let n=0,[i,s,r,o]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=e,s+=e){if(i==r||s==o)return n;let a=this.children[i],l=t.children[s];if(a!=l)return n+a.scanIdentical(l,e);n+=a.length+1}}static from(t,e=t.reduce((n,i)=>n+i.length+1,-1)){let n=0;for(let u of t)n+=u.lines;if(n<32){let u=[];for(let p of t)p.flatten(u);return new m(u,e)}let i=Math.max(32,n>>5),s=i<<1,r=i>>1,o=[],a=0,l=-1,c=[];function f(u){let p;if(u.lines>s&&u instanceof A)for(let E of u.children)f(E);else u.lines>r&&(a>r||!a)?(g(),o.push(u)):u instanceof m&&a&&(p=c[c.length-1])instanceof m&&u.lines+p.lines<=32?(a+=u.lines,l+=u.length+1,c[c.length-1]=new m(p.text.concat(u.text),p.length+1+u.length)):(a+u.lines>i&&g(),a+=u.lines,l+=u.length+1,c.push(u))}function g(){a!=0&&(o.push(c.length==1?c[0]:A.from(c,l)),l=-1,a=c.length=0)}for(let u of t)f(u);return g(),o.length==1?o[0]:new A(o,e)}}v.empty=new m([""],0);function Ht(h){let t=-1;for(let e of h)t+=e.length+1;return t}function Y(h,t,e=0,n=1e9){for(let i=0,s=0,r=!0;s<h.length&&i<=n;s++){let o=h[s],a=i+o.length;a>=e&&(a>n&&(o=o.slice(0,n-i)),i<e&&(o=o.slice(e-i)),r?(t[t.length-1]+=o,r=!1):t.push(o)),i=a+1}return t}function wt(h,t,e){return Y(h,[""],t,e)}class q{constructor(t,e=1){this.dir=e,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[e>0?1:(t instanceof m?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],s=this.offsets[n],r=s>>1,o=i instanceof m?i.text.length:i.children.length;if(r==(e>0?o:0)){if(n==0)return this.done=!0,this.value="",this;e>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(e>0?0:1)){if(this.offsets[n]+=e,t==0)return this.lineBreak=!0,this.value=`
4`,this;t--}else if(i instanceof m){let a=i.text[r+(e<0?-1:0)];if(this.offsets[n]+=e,a.length>Math.max(0,t))return this.value=t==0?a:e>0?a.slice(t):a.slice(0,a.length-t),this;t-=a.length}else{let a=i.children[r+(e<0?-1:0)];t>a.length?(t-=a.length,this.offsets[n]+=e):(e<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(e>0?1:(a instanceof m?a.text.length:a.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class yt{constructor(t,e,n){this.value="",this.done=!1,this.cursor=new q(t,e>n?-1:1),this.pos=e>n?t.length:0,this.from=Math.min(e,n),this.to=Math.max(e,n)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let n=e<0?this.pos-this.from:this.to-this.pos;t>n&&(t=n),n-=t;let{value:i}=this.cursor.next(t);return this.pos+=(i.length+t)*e,this.value=i.length<=n?i:e<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class St{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:n,value:i}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(v.prototype[Symbol.iterator]=function(){return this.iter()},q.prototype[Symbol.iterator]=yt.prototype[Symbol.iterator]=St.prototype[Symbol.iterator]=function(){return this});class kt{constructor(t,e,n,i){this.from=t,this.to=e,this.number=n,this.text=i}get length(){return this.to-this.from}}function N(h,t,e){return t=Math.max(0,Math.min(h.length,t)),[t,Math.max(t,Math.min(h.length,e))]}let J="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(h=>h?parseInt(h,36):1);for(let h=1;h<J.length;h++)J[h]+=J[h-1];function Qt(h){for(let t=1;t<J.length;t+=2)if(J[t]>h)return J[t-1]<=h;return!1}function It(h){return h>=127462&&h<=127487}const bt=8205;function $(h,t,e=!0,n=!0){return(e?Pt:Xt)(h,t,n)}function Pt(h,t,e){if(t==h.length)return t;t&&Et(h.charCodeAt(t))&&Mt(h.charCodeAt(t-1))&&t--;let n=K(h,t);for(t+=st(n);t<h.length;){let i=K(h,t);if(n==bt||i==bt||e&&Qt(i))t+=st(i),n=i;else if(It(i)){let s=0,r=t-2;for(;r>=0&&It(K(h,r));)s++,r-=2;if(s%2==0)break;t+=2}else break}return t}function Xt(h,t,e){for(;t>0;){let n=Pt(h,t-2,e);if(n<t)return n;t--}return 0}function Et(h){return h>=56320&&h<57344}function Mt(h){return h>=55296&&h<56320}function K(h,t){let e=h.charCodeAt(t);if(!Mt(e)||t+1==h.length)return e;let n=h.charCodeAt(t+1);return Et(n)?(e-55296<<10)+(n-56320)+65536:e}function Yt(h){return h<=65535?String.fromCharCode(h):(h-=65536,String.fromCharCode((h>>10)+55296,(h&1023)+56320))}function st(h){return h<65536?1:2}const rt=/\r\n?|\n/;var R=function(h){return h[h.Simple=0]="Simple",h[h.TrackDel=1]="TrackDel",h[h.TrackBefore=2]="TrackBefore",h[h.TrackAfter=3]="TrackAfter",h}(R||(R={}));class M{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;e<this.sections.length;e+=2)t+=this.sections[e];return t}get newLength(){let t=0;for(let e=0;e<this.sections.length;e+=2){let n=this.sections[e+1];t+=n<0?this.sections[e]:n}return t}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(t){for(let e=0,n=0,i=0;e<this.sections.length;){let s=this.sections[e++],r=this.sections[e++];r<0?(t(n,i,s),i+=s):i+=r,n+=s}}iterChangedRanges(t,e=!1){ht(this,t,e)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],i=this.sections[e++];i<0?t.push(n,i):t.push(i,n)}return new M(t)}composeDesc(t){return this.empty?t:t.empty?this:At(this,t)}mapDesc(t,e=!1){return t.empty?this:ot(this,t,e)}mapPos(t,e=-1,n=R.Simple){let i=0,s=0;for(let r=0;r<this.sections.length;){let o=this.sections[r++],a=this.sections[r++],l=i+o;if(a<0){if(l>t)return s+(t-i);s+=o}else{if(n!=R.Simple&&l>=t&&(n==R.TrackDel&&i<t&&l>t||n==R.TrackBefore&&i<t||n==R.TrackAfter&&l>t))return null;if(l>t||l==t&&e<0&&!o)return t==i||e<0?s:s+a;s+=a}i=l}if(t>i)throw new RangeError(`Position ${t} is out of range for changeset of length ${i}`);return s}touchesRange(t,e=t){for(let n=0,i=0;n<this.sections.length&&i<=e;){let s=this.sections[n++],r=this.sections[n++],o=i+s;if(r>=0&&i<=e&&o>=t)return i<t&&o>e?"cover":!0;i=o}return!1}toString(){let t="";for(let e=0;e<this.sections.length;){let n=this.sections[e++],i=this.sections[e++];t+=(t?" ":"")+n+(i>=0?":"+i:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new M(t)}static create(t){return new M(t)}}class y extends M{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return ht(this,(e,n,i,s,r)=>t=t.replace(i,i+(n-e),r),!1),t}mapDesc(t,e=!1){return ot(this,t,e,!0)}invert(t){let e=this.sections.slice(),n=[];for(let i=0,s=0;i<e.length;i+=2){let r=e[i],o=e[i+1];if(o>=0){e[i]=o,e[i+1]=r;let a=i>>1;for(;n.length<a;)n.push(v.empty);n.push(r?t.slice(s,s+r):v.empty)}s+=r}return new y(e,n)}compose(t){return this.empty?t:t.empty?this:At(this,t,!0)}map(t,e=!1){return t.empty?this:ot(this,t,e,!0)}iterChanges(t,e=!1){ht(this,t,e)}get desc(){return M.create(this.sections)}filter(t){let e=[],n=[],i=[],s=new z(this);t:for(let r=0,o=0;;){let a=r==t.length?1e9:t[r++];for(;o<a||o==a&&s.len==0;){if(s.done)break t;let c=Math.min(s.len,a-o);S(i,c,-1);let f=s.ins==-1?-1:s.off==0?s.ins:0;S(e,c,f),f>0&&O(n,e,s.text),s.forward(c),o+=c}let l=t[r++];for(;o<l;){if(s.done)break t;let c=Math.min(s.len,l-o);S(e,c,-1),S(i,c,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(c),o+=c}}return{changes:new y(e,n),filtered:M.create(i)}}toJSON(){let t=[];for(let e=0;e<this.sections.length;e+=2){let n=this.sections[e],i=this.sections[e+1];i<0?t.push(n):i==0?t.push([n]):t.push([n].concat(this.inserted[e>>1].toJSON()))}return t}static of(t,e,n){let i=[],s=[],r=0,o=null;function a(c=!1){if(!c&&!i.length)return;r<e&&S(i,e-r,-1);let f=new y(i,s);o=o?o.compose(f.map(o)):f,i=[],s=[],r=0}function l(c){if(Array.isArray(c))for(let f of c)l(f);else if(c instanceof y){if(c.length!=e)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${e})`);a(),o=o?o.compose(c.map(o)):c}else{let{from:f,to:g=f,insert:u}=c;if(f>g||f<0||g>e)throw new RangeError(`Invalid change range ${f} to ${g} (in doc of length ${e})`);let p=u?typeof u=="string"?v.of(u.split(n||rt)):u:v.empty,E=p.length;if(f==g&&E==0)return;f<r&&a(),f>r&&S(i,f-r,-1),S(i,g-f,E),O(s,i,p),r=g}}return l(t),a(!o),o}static empty(t){return new y(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],n=[];for(let i=0;i<t.length;i++){let s=t[i];if(typeof s=="number")e.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((r,o)=>o&&typeof r!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)e.push(s[0],0);else{for(;n.length<i;)n.push(v.empty);n[i]=v.of(s.slice(1)),e.push(s[0],n[i].length)}}}return new y(e,n)}static createSet(t,e){return new y(t,e)}}function S(h,t,e,n=!1){if(t==0&&e<=0)return;let i=h.length-2;i>=0&&e<=0&&e==h[i+1]?h[i]+=t:t==0&&h[i]==0?h[i+1]+=e:n?(h[i]+=t,h[i+1]+=e):h.push(t,e)}function O(h,t,e){if(e.length==0)return;let n=t.length-2>>1;if(n<h.length)h[h.length-1]=h[h.length-1].append(e);else{for(;h.length<n;)h.push(v.empty);h.push(e)}}function ht(h,t,e){let n=h.inserted;for(let i=0,s=0,r=0;r<h.sections.length;){let o=h.sections[r++],a=h.sections[r++];if(a<0)i+=o,s+=o;else{let l=i,c=s,f=v.empty;for(;l+=o,c+=a,a&&n&&(f=f.append(n[r-2>>1])),!(e||r==h.sections.length||h.sections[r+1]<0);)o=h.sections[r++],a=h.sections[r++];t(i,l,s,c,f),i=l,s=c}}}function ot(h,t,e,n=!1){let i=[],s=n?[]:null,r=new z(h),o=new z(t);for(let a=-1;;)if(r.ins==-1&&o.ins==-1){let l=Math.min(r.len,o.len);S(i,l,-1),r.forward(l),o.forward(l)}else if(o.ins>=0&&(r.ins<0||a==r.i||r.off==0&&(o.len<r.len||o.len==r.len&&!e))){let l=o.len;for(S(i,o.ins,-1);l;){let c=Math.min(r.len,l);r.ins>=0&&a<r.i&&r.len<=c&&(S(i,0,r.ins),s&&O(s,i,r.text),a=r.i),r.forward(c),l-=c}o.next()}else if(r.ins>=0){let l=0,c=r.len;for(;c;)if(o.ins==-1){let f=Math.min(c,o.len);l+=f,c-=f,o.forward(f)}else if(o.ins==0&&o.len<c)c-=o.len,o.next();else break;S(i,l,a<r.i?r.ins:0),s&&a<r.i&&O(s,i,r.text),a=r.i,r.forward(r.len-c)}else{if(r.done&&o.done)return s?y.createSet(i,s):M.create(i);throw new Error("Mismatched change set lengths")}}function At(h,t,e=!1){let n=[],i=e?[]:null,s=new z(h),r=new z(t);for(let o=!1;;){if(s.done&&r.done)return i?y.createSet(n,i):M.create(n);if(s.ins==0)S(n,s.len,0,o),s.next();else if(r.len==0&&!r.done)S(n,0,r.ins,o),i&&O(i,n,r.text),r.next();else{if(s.done||r.done)throw new Error("Mismatched change set lengths");{let a=Math.min(s.len2,r.len),l=n.length;if(s.ins==-1){let c=r.ins==-1?-1:r.off?0:r.ins;S(n,a,c,o),i&&c&&O(i,n,r.text)}else r.ins==-1?(S(n,s.off?0:s.len,a,o),i&&O(i,n,s.textBit(a))):(S(n,s.off?0:s.len,r.off?0:r.ins,o),i&&!r.off&&O(i,n,r.text));o=(s.ins>a||r.ins>=0&&r.len>a)&&(o||n.length>l),s.forward2(a),r.forward(a)}}}}class z{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[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:t}=this.set,e=this.i-2>>1;return e>=t.length?v.empty:t[e]}textBit(t){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length&&!t?v.empty:e[n].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class T{constructor(t,e,n){this.from=t,this.to=e,this.flags=n}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 t=this.flags&7;return t==7?null:t}get goalColumn(){let t=this.flags>>6;return t==16777215?void 0:t}map(t,e=-1){let n,i;return this.empty?n=i=t.mapPos(this.from,e):(n=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new T(n,i,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return d.range(t,e);let n=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return d.range(this.anchor,n)}eq(t,e=!1){return this.anchor==t.anchor&&this.head==t.head&&(!e||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return d.range(t.anchor,t.head)}static create(t,e,n){return new T(t,e,n)}}class d{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:d.create(this.ranges.map(n=>n.map(t,e)),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(t.ranges[n],e))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new d([this.main],0)}addRange(t,e=!0){return d.create([t].concat(this.ranges),e?0:this.mainIndex+1)}replaceRange(t,e=this.mainIndex){let n=this.ranges.slice();return n[e]=t,d.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(t=>t.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new d(t.ranges.map(e=>T.fromJSON(e)),t.main)}static single(t,e=t){return new d([d.range(t,e)],0)}static create(t,e=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;i<t.length;i++){let s=t[i];if(s.empty?s.from<=n:s.from<n)return d.normalized(t.slice(),e);n=s.to}return new d(t,e)}static cursor(t,e=0,n,i){return T.create(t,t,(e==0?0:e<0?8:16)|(n==null?7:Math.min(6,n))|(i??16777215)<<6)}static range(t,e,n,i){let s=(n??16777215)<<6|(i==null?7:Math.min(6,i));return e<t?T.create(e,t,48|s):T.create(t,e,(e>t?8:0)|s)}static normalized(t,e=0){let n=t[e];t.sort((i,s)=>i.from-s.from),e=t.indexOf(n);for(let i=1;i<t.length;i++){let s=t[i],r=t[i-1];if(s.empty?s.from<=r.to:s.from<r.to){let o=r.from,a=Math.max(s.to,r.to);i<=e&&e--,t.splice(--i,2,s.anchor>s.head?d.range(a,o):d.range(o,a))}}return new d(t,e)}}function Rt(h,t){for(let e of h.ranges)if(e.to>t)throw new RangeError("Selection points outside of document")}let at=0;class P{constructor(t,e,n,i,s){this.combine=t,this.compareInput=e,this.compare=n,this.isStatic=i,this.id=at++,this.default=t([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(t={}){return new P(t.combine||(e=>e),t.compareInput||((e,n)=>e===n),t.compare||(t.combine?(e,n)=>e===n:lt),!!t.static,t.enables)}of(t){return new Z([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new Z(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new Z(t,this,2,e)}from(t,e){return e||(e=n=>n),this.compute([t],n=>e(n.field(t)))}}function lt(h,t){return h==t||h.length==t.length&&h.every((e,n)=>e===t[n])}class Z{constructor(t,e,n,i){this.dependencies=t,this.facet=e,this.type=n,this.value=i,this.id=at++}dynamicSlot(t){var e;let n=this.value,i=this.facet.compareInput,s=this.id,r=t[s]>>1,o=this.type==2,a=!1,l=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?l=!0:((e=t[f.id])!==null&&e!==void 0?e:1)&1||c.push(t[f.id]);return{create(f){return f.values[r]=n(f),1},update(f,g){if(a&&g.docChanged||l&&(g.docChanged||g.selection)||ct(f,c)){let u=n(f);if(o?!Ct(u,f.values[r],i):!i(u,f.values[r]))return f.values[r]=u,1}return 0},reconfigure:(f,g)=>{let u,p=g.config.address[s];if(p!=null){let E=_(g,p);if(this.dependencies.every(w=>w instanceof P?g.facet(w)===f.facet(w):w instanceof F?g.field(w,!1)==f.field(w,!1):!0)||(o?Ct(u=n(f),E,i):i(u=n(f),E)))return f.values[r]=E,0}else u=n(f);return f.values[r]=u,1}}}}function Ct(h,t,e){if(h.length!=t.length)return!1;for(let n=0;n<h.length;n++)if(!e(h[n],t[n]))return!1;return!0}function ct(h,t){let e=!1;for(let n of t)W(h,n)&1&&(e=!0);return e}function Kt(h,t,e){let n=e.map(a=>h[a.id]),i=e.map(a=>a.type),s=n.filter(a=>!(a&1)),r=h[t.id]>>1;function o(a){let l=[];for(let c=0;c<n.length;c++){let f=_(a,n[c]);if(i[c]==2)for(let g of f)l.push(g);else l.push(f)}return t.combine(l)}return{create(a){for(let l of n)W(a,l);return a.values[r]=o(a),1},update(a,l){if(!ct(a,s))return 0;let c=o(a);return t.compare(c,a.values[r])?0:(a.values[r]=c,1)},reconfigure(a,l){let c=ct(a,n),f=l.config.facets[t.id],g=l.facet(t);if(f&&!c&&lt(e,f))return a.values[r]=g,0;let u=o(a);return t.compare(u,g)?(a.values[r]=g,0):(a.values[r]=u,1)}}}const Ot=P.define({static:!0});class F{constructor(t,e,n,i,s){this.id=t,this.createF=e,this.updateF=n,this.compareF=i,this.spec=s,this.provides=void 0}static define(t){let e=new F(at++,t.create,t.update,t.compare||((n,i)=>n===i),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){return(t.facet(Ot).find(n=>n.field==this)?.create||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:n=>(n.values[e]=this.create(n),1),update:(n,i)=>{let s=n.values[e],r=this.updateF(s,i);return this.compareF(s,r)?0:(n.values[e]=r,1)},reconfigure:(n,i)=>i.config.address[this.id]!=null?(n.values[e]=i.field(this),0):(n.values[e]=this.create(n),1)}}init(t){return[this,Ot.of({field:this,create:t})]}get extension(){return this}}const B={lowest:4,low:3,default:2,high:1,highest:0};function V(h){return t=>new Tt(t,h)}const Zt={highest:V(B.highest),high:V(B.high),default:V(B.default),low:V(B.low),lowest:V(B.lowest)};class Tt{constructor(t,e){this.inner=t,this.prec=e}}class H{of(t){return new ft(this,t)}reconfigure(t){return H.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class ft{constructor(t,e){this.compartment=t,this.inner=e}}class nt{constructor(t,e,n,i,s,r){for(this.base=t,this.compartments=e,this.dynamicSlots=n,this.address=i,this.staticValues=s,this.facets=r,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(t){let e=this.address[t.id];return e==null?t.default:this.staticValues[e>>1]}static resolve(t,e,n){let i=[],s=Object.create(null),r=new Map;for(let g of _t(t,e,r))g instanceof F?i.push(g):(s[g.facet.id]||(s[g.facet.id]=[])).push(g);let o=Object.create(null),a=[],l=[];for(let g of i)o[g.id]=l.length<<1,l.push(u=>g.slot(u));let c=n?.config.facets;for(let g in s){let u=s[g],p=u[0].facet,E=c&&c[g]||[];if(u.every(w=>w.type==0))if(o[p.id]=a.length<<1|1,lt(E,u))a.push(n.facet(p));else{let w=p.combine(u.map(it=>it.value));a.push(n&&p.compare(w,n.facet(p))?n.facet(p):w)}else{for(let w of u)w.type==0?(o[w.id]=a.length<<1|1,a.push(w.value)):(o[w.id]=l.length<<1,l.push(it=>w.dynamicSlot(it)));o[p.id]=l.length<<1,l.push(w=>Kt(w,p,u))}}let f=l.map(g=>g(o));return new nt(t,r,f,o,a,s)}}function _t(h,t,e){let n=[[],[],[],[],[]],i=new Map;function s(r,o){let a=i.get(r);if(a!=null){if(a<=o)return;let l=n[a].indexOf(r);l>-1&&n[a].splice(l,1),r instanceof ft&&e.delete(r.compartment)}if(i.set(r,o),Array.isArray(r))for(let l of r)s(l,o);else if(r instanceof ft){if(e.has(r.compartment))throw new RangeError("Duplicate use of compartment in extensions");let l=t.get(r.compartment)||r.inner;e.set(r.compartment,l),s(l,o)}else if(r instanceof Tt)s(r.inner,r.prec);else if(r instanceof F)n[o].push(r),r.provides&&s(r.provides,o);else if(r instanceof Z)n[o].push(r),r.facet.extensions&&s(r.facet.extensions,B.default);else{let l=r.extension;if(!l)throw new Error(`Unrecognized extension value in extension set (${r}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(l,o)}}return s(h,B.default),n.reduce((r,o)=>r.concat(o))}function W(h,t){if(t&1)return 2;let e=t>>1,n=h.status[e];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;h.status[e]=4;let i=h.computeSlot(h,h.config.dynamicSlots[e]);return h.status[e]=2|i}function _(h,t){return t&1?h.config.staticValues[t>>1]:h.values[t>>1]}const Bt=P.define(),ut=P.define({combine:h=>h.some(t=>t),static:!0}),Ft=P.define({combine:h=>h.length?h[0]:void 0,static:!0}),Nt=P.define(),Jt=P.define(),Lt=P.define(),Dt=P.define({combine:h=>h.length?h[0]:!1});class L{constructor(t,e){this.type=t,this.value=e}static define(){return new jt}}class jt{of(t){return new L(this,t)}}class qt{constructor(t){this.map=t}of(t){return new k(this,t)}}class k{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return e===void 0?void 0:e==this.value?this:new k(this.type,e)}is(t){return this.type==t}static define(t={}){return new qt(t.map||(e=>e))}static mapEffects(t,e){if(!t.length)return t;let n=[];for(let i of t){let s=i.map(e);s&&n.push(s)}return n}}k.reconfigure=k.define(),k.appendConfig=k.define();class I{constructor(t,e,n,i,s,r){this.startState=t,this.changes=e,this.selection=n,this.effects=i,this.annotations=s,this.scrollIntoView=r,this._doc=null,this._state=null,n&&Rt(n,e.newLength),s.some(o=>o.type==I.time)||(this.annotations=s.concat(I.time.of(Date.now())))}static create(t,e,n,i,s,r){return new I(t,e,n,i,s,r)}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(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(I.userEvent);return!!(e&&(e==t||e.length>t.length&&e.slice(0,t.length)==t&&e[t.length]=="."))}}I.time=L.define(),I.userEvent=L.define(),I.addToHistory=L.define(),I.remote=L.define();function te(h,t){let e=[];for(let n=0,i=0;;){let s,r;if(n<h.length&&(i==t.length||t[i]>=h[n]))s=h[n++],r=h[n++];else if(i<t.length)s=t[i++],r=t[i++];else return e;!e.length||e[e.length-1]<s?e.push(s,r):e[e.length-1]<r&&(e[e.length-1]=r)}}function $t(h,t,e){var n;let i,s,r;return e?(i=t.changes,s=y.empty(t.changes.length),r=h.changes.compose(t.changes)):(i=t.changes.map(h.changes),s=h.changes.mapDesc(t.changes,!0),r=h.changes.compose(i)),{changes:r,selection:t.selection?t.selection.map(s):(n=h.selection)===null||n===void 0?void 0:n.map(i),effects:k.mapEffects(h.effects,i).concat(k.mapEffects(t.effects,s)),annotations:h.annotations.length?h.annotations.concat(t.annotations):t.annotations,scrollIntoView:h.scrollIntoView||t.scrollIntoView}}function gt(h,t,e){let n=t.selection,i=D(t.annotations);return t.userEvent&&(i=i.concat(I.userEvent.of(t.userEvent))),{changes:t.changes instanceof y?t.changes:y.of(t.changes||[],e,h.facet(Ft)),selection:n&&(n instanceof d?n:d.single(n.anchor,n.head)),effects:D(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function zt(h,t,e){let n=gt(h,t.length?t[0]:{},h.doc.length);t.length&&t[0].filter===!1&&(e=!1);for(let s=1;s<t.length;s++){t[s].filter===!1&&(e=!1);let r=!!t[s].sequential;n=$t(n,gt(h,t[s],r?n.changes.newLength:h.doc.length),r)}let i=I.create(h,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return ne(e?ee(i):i)}function ee(h){let t=h.startState,e=!0;for(let i of t.facet(Nt)){let s=i(h);if(s===!1){e=!1;break}Array.isArray(s)&&(e=e===!0?s:te(e,s))}if(e!==!0){let i,s;if(e===!1)s=h.changes.invertedDesc,i=y.empty(t.doc.length);else{let r=h.changes.filter(e);i=r.changes,s=r.filtered.mapDesc(r.changes).invertedDesc}h=I.create(t,i,h.selection&&h.selection.map(s),k.mapEffects(h.effects,s),h.annotations,h.scrollIntoView)}let n=t.facet(Jt);for(let i=n.length-1;i>=0;i--){let s=n[i](h);s instanceof I?h=s:Array.isArray(s)&&s.length==1&&s[0]instanceof I?h=s[0]:h=zt(t,D(s),!1)}return h}function ne(h){let t=h.startState,e=t.facet(Lt),n=h;for(let i=e.length-1;i>=0;i--){let s=e[i](h);s&&Object.keys(s).length&&(n=$t(n,gt(t,s,h.changes.newLength),!0))}return n==h?h:I.create(t,h.changes,h.selection,n.effects,n.annotations,n.scrollIntoView)}const ie=[];function D(h){return h==null?ie:Array.isArray(h)?h:[h]}var C=function(h){return h[h.Word=0]="Word",h[h.Space=1]="Space",h[h.Other=2]="Other",h}(C||(C={}));const se=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let dt;try{dt=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function re(h){if(dt)return dt.test(h);for(let t=0;t<h.length;t++){let e=h[t];if(/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||se.test(e)))return!0}return!1}function he(h){return t=>{if(!/\S/.test(t))return C.Space;if(re(t))return C.Word;for(let e=0;e<h.length;e++)if(t.indexOf(h[e])>-1)return C.Word;return C.Other}}class x{constructor(t,e,n,i,s,r){this.config=t,this.doc=e,this.selection=n,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=s,r&&(r._state=this);for(let o=0;o<this.config.dynamicSlots.length;o++)W(this,o<<1);this.computeSlot=null}field(t,e=!0){let n=this.config.address[t.id];if(n==null){if(e)throw new RangeError("Field is not present in this state");return}return W(this,n),_(this,n)}update(...t){return zt(this,t,!0)}applyTransaction(t){let e=this.config,{base:n,compartments:i}=e;for(let o of t.effects)o.is(H.reconfigure)?(e&&(i=new Map,e.compartments.forEach((a,l)=>i.set(l,a)),e=null),i.set(o.value.compartment,o.value.extension)):o.is(k.reconfigure)?(e=null,n=o.value):o.is(k.appendConfig)&&(e=null,n=D(n).concat(o.value));let s;e?s=t.startState.values.slice():(e=nt.resolve(n,i,this),s=new x(e,this.doc,this.selection,e.dynamicSlots.map(()=>null),(o,a)=>a.reconfigure(o,this),null).values);let r=t.startState.facet(ut)?t.newSelection:t.newSelection.asSingle();new x(e,t.newDoc,r,s,(o,a)=>a.update(o,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:t},range:d.cursor(e.from+t.length)}))}changeByRange(t){let e=this.selection,n=t(e.ranges[0]),i=this.changes(n.changes),s=[n.range],r=D(n.effects);for(let o=1;o<e.ranges.length;o++){let a=t(e.ranges[o]),l=this.changes(a.changes),c=l.map(i);for(let g=0;g<o;g++)s[g]=s[g].map(c);let f=i.mapDesc(l,!0);s.push(a.range.map(f)),i=i.compose(c),r=k.mapEffects(r,c).concat(k.mapEffects(D(a.effects),f))}return{changes:i,selection:d.create(s,e.mainIndex),effects:r}}changes(t=[]){return t instanceof y?t:y.of(t,this.doc.length,this.facet(x.lineSeparator))}toText(t){return v.of(t.split(this.facet(x.lineSeparator)||rt))}sliceDoc(t=0,e=this.doc.length){return this.doc.sliceString(t,e,this.lineBreak)}facet(t){let e=this.config.address[t.id];return e==null?t.default:(W(this,e),_(this,e))}toJSON(t){let e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let n in t){let i=t[n];i instanceof F&&this.config.address[i.id]!=null&&(e[n]=i.spec.toJSON(this.field(t[n]),this))}return e}static fromJSON(t,e={},n){if(!t||typeof t.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(n){for(let s in n)if(Object.prototype.hasOwnProperty.call(t,s)){let r=n[s],o=t[s];i.push(r.init(a=>r.spec.fromJSON(o,a)))}}return x.create({doc:t.doc,selection:d.fromJSON(t.selection),extensions:e.extensions?i.concat([e.extensions]):i})}static create(t={}){let e=nt.resolve(t.extensions||[],new Map),n=t.doc instanceof v?t.doc:v.of((t.doc||"").split(e.staticFacet(x.lineSeparator)||rt)),i=t.selection?t.selection instanceof d?t.selection:d.single(t.selection.anchor,t.selection.head):d.single(0);return Rt(i,n.length),e.staticFacet(ut)||(i=i.asSingle()),new x(e,n,i,e.dynamicSlots.map(()=>null),(s,r)=>r.create(s),null)}get tabSize(){return this.facet(x.tabSize)}get lineBreak(){return this.facet(x.lineSeparator)||`
5`}get readOnly(){return this.facet(Dt)}phrase(t,...e){for(let n of this.facet(x.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,(n,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>e.length?n:e[s-1]})),t}languageDataAt(t,e,n=-1){let i=[];for(let s of this.facet(Bt))for(let r of s(this,e,n))Object.prototype.hasOwnProperty.call(r,t)&&i.push(r[t]);return i}charCategorizer(t){return he(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:e,from:n,length:i}=this.doc.lineAt(t),s=this.charCategorizer(t),r=t-n,o=t-n;for(;r>0;){let a=$(e,r,!1);if(s(e.slice(a,r))!=C.Word)break;r=a}for(;o<i;){let a=$(e,o);if(s(e.slice(o,a))!=C.Word)break;o=a}return r==o?null:d.range(r+n,o+n)}}x.allowMultipleSelections=ut,x.tabSize=P.define({combine:h=>h.length?h[0]:4}),x.lineSeparator=Ft,x.readOnly=Dt,x.phrases=P.define({compare(h,t){let e=Object.keys(h),n=Object.keys(t);return e.length==n.length&&e.every(i=>h[i]==t[i])}}),x.languageData=Bt,x.changeFilter=Nt,x.transactionFilter=Jt,x.transactionExtender=Lt,H.reconfigure=k.define();function oe(h,t,e={}){let n={};for(let i of h)for(let s of Object.keys(i)){let r=i[s],o=n[s];if(o===void 0)n[s]=r;else if(!(o===r||r===void 0))if(Object.hasOwnProperty.call(e,s))n[s]=e[s](o,r);else throw new Error("Config merge conflict for field "+s)}for(let i in t)n[i]===void 0&&(n[i]=t[i]);return n}class U{eq(t){return this==t}range(t,e=t){return j.create(t,e,this)}}U.prototype.startSide=U.prototype.endSide=0,U.prototype.point=!1,U.prototype.mapMode=R.TrackDel;class j{constructor(t,e,n){this.from=t,this.to=e,this.value=n}static create(t,e,n){return new j(t,e,n)}}function pt(h,t){return h.from-t.from||h.value.startSide-t.value.startSide}class vt{constructor(t,e,n,i){this.from=t,this.to=e,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(t,e,n,i=0){let s=n?this.to:this.from;for(let r=i,o=s.length;;){if(r==o)return r;let a=r+o>>1,l=s[a]-t||(n?this.value[a].endSide:this.value[a].startSide)-e;if(a==r)return l>=0?r:o;l>=0?o=a:r=a+1}}between(t,e,n,i){for(let s=this.findIndex(e,-1e9,!0),r=this.findIndex(n,1e9,!1,s);s<r;s++)if(i(this.from[s]+t,this.to[s]+t,this.value[s])===!1)return!1}map(t,e){let n=[],i=[],s=[],r=-1,o=-1;for(let a=0;a<this.value.length;a++){let l=this.value[a],c=this.from[a]+t,f=this.to[a]+t,g,u;if(c==f){let p=e.mapPos(c,l.startSide,l.mapMode);if(p==null||(g=u=p,l.startSide!=l.endSide&&(u=e.mapPos(c,l.endSide),u<g)))continue}else if(g=e.mapPos(c,l.startSide),u=e.mapPos(f,l.endSide),g>u||g==u&&l.startSide>0&&l.endSide<=0)continue;(u-g||l.endSide-l.startSide)<0||(r<0&&(r=g),l.point&&(o=Math.max(o,u-g)),n.push(l),i.push(g-r),s.push(u-r))}return{mapped:n.length?new vt(i,s,n,o):null,pos:r}}}class b{constructor(t,e,n,i){this.chunkPos=t,this.chunk=e,this.nextLayer=n,this.maxPoint=i}static create(t,e,n,i){return new b(t,e,n,i)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:n=!1,filterFrom:i=0,filterTo:s=this.length}=t,r=t.filter;if(e.length==0&&!r)return this;if(n&&(e=e.slice().sort(pt)),this.isEmpty)return e.length?b.of(e):this;let o=new Wt(this,null,-1).goto(0),a=0,l=[],c=new Q;for(;o.value||a<e.length;)if(a<e.length&&(o.from-e[a].from||o.startSide-e[a].value.startSide)>=0){let f=e[a++];c.addInner(f.from,f.to,f.value)||l.push(f)}else o.rangeIndex==1&&o.chunkIndex<this.chunk.length&&(a==e.length||this.chunkEnd(o.chunkIndex)<e[a].from)&&(!r||i>this.chunkEnd(o.chunkIndex)||s<this.chunkPos[o.chunkIndex])&&c.addChunk(this.chunkPos[o.chunkIndex],this.chunk[o.chunkIndex])?o.nextChunk():((!r||i>o.to||s<o.from||r(o.from,o.to,o.value))&&(c.addInner(o.from,o.to,o.value)||l.push(j.create(o.from,o.to,o.value))),o.next());return c.finishInner(this.nextLayer.isEmpty&&!l.length?b.empty:this.nextLayer.update({add:l,filter:r,filterFrom:i,filterTo:s}))}map(t){if(t.empty||this.isEmpty)return this;let e=[],n=[],i=-1;for(let r=0;r<this.chunk.length;r++){let o=this.chunkPos[r],a=this.chunk[r],l=t.touchesRange(o,o+a.length);if(l===!1)i=Math.max(i,a.maxPoint),e.push(a),n.push(t.mapPos(o));else if(l===!0){let{mapped:c,pos:f}=a.map(o,t);c&&(i=Math.max(i,c.maxPoint),e.push(c),n.push(f))}}let s=this.nextLayer.map(t);return e.length==0?s:new b(n,e,s||b.empty,i)}between(t,e,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],r=this.chunk[i];if(e>=s&&t<=s+r.length&&r.between(s,t-s,e-s,n)===!1)return}this.nextLayer.between(t,e,n)}}iter(t=0){return X.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return X.from(t).goto(e)}static compare(t,e,n,i,s=-1){let r=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),a=Vt(r,o,n),l=new G(r,a,s),c=new G(o,a,s);n.iterGaps((f,g,u)=>Ut(l,f,c,g,u,i)),n.empty&&n.length==0&&Ut(l,0,c,0,0,i)}static eq(t,e,n=0,i){i==null&&(i=999999999);let s=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0),r=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0);if(s.length!=r.length)return!1;if(!s.length)return!0;let o=Vt(s,r),a=new G(s,o,0).goto(n),l=new G(r,o,0).goto(n);for(;;){if(a.to!=l.to||!xt(a.active,l.active)||a.point&&(!l.point||!a.point.eq(l.point)))return!1;if(a.to>i)return!0;a.next(),l.next()}}static spans(t,e,n,i,s=-1){let r=new G(t,null,s).goto(e),o=e,a=r.openStart;for(;;){let l=Math.min(r.to,n);if(r.point){let c=r.activeForPoint(r.to),f=r.pointFrom<e?c.length+1:r.point.startSide<0?c.length:Math.min(c.length,a);i.point(o,l,r.point,c,f,r.pointRank),a=Math.min(r.openEnd(l),c.length)}else l>o&&(i.span(o,l,r.active,a),a=r.openEnd(l));if(r.to>n)return a+(r.point&&r.to>n?1:0);o=r.to,r.next()}}static of(t,e=!1){let n=new Q;for(let i of t instanceof j?[t]:e?ae(t):t)n.add(i.from,i.to,i.value);return n.finish()}static join(t){if(!t.length)return b.empty;let e=t[t.length-1];for(let n=t.length-2;n>=0;n--)for(let i=t[n];i!=b.empty;i=i.nextLayer)e=new b(i.chunkPos,i.chunk,e,Math.max(i.maxPoint,e.maxPoint));return e}}b.empty=new b([],[],null,-1);function ae(h){if(h.length>1)for(let t=h[0],e=1;e<h.length;e++){let n=h[e];if(pt(t,n)>0)return h.slice().sort(pt);t=n}return h}b.empty.nextLayer=b.empty;class Q{finishChunk(t){this.chunks.push(new vt(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,t&&(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(t,e,n){this.addInner(t,e,n)||(this.nextLayer||(this.nextLayer=new Q)).add(t,e,n)}addInner(t,e,n){let i=t-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&(t-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=n,this.lastFrom=t,this.lastTo=e,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let n=e.value.length-1;return this.last=e.value[n],this.lastFrom=e.from[n]+t,this.lastTo=e.to[n]+t,!0}finish(){return this.finishInner(b.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let e=b.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function Vt(h,t,e){let n=new Map;for(let s of h)for(let r=0;r<s.chunk.length;r++)s.chunk[r].maxPoint<=0&&n.set(s.chunk[r],s.chunkPos[r]);let i=new Set;for(let s of t)for(let r=0;r<s.chunk.length;r++){let o=n.get(s.chunk[r]);o!=null&&(e?e.mapPos(o):o)==s.chunkPos[r]&&!e?.touchesRange(o,o+s.chunk[r].length)&&i.add(s.chunk[r])}return i}class Wt{constructor(t,e,n,i=0){this.layer=t,this.skip=e,this.minPoint=n,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,e=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}gotoInner(t,e,n){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<t||i.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],e,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(t,e){(this.to-t||this.endSide-e)<0&&this.gotoInner(t,e,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let t=this.layer.chunkPos[this.chunkIndex],e=this.layer.chunk[this.chunkIndex],n=t+e.from[this.rangeIndex];if(this.from=n,this.to=t+e.to[this.rangeIndex],this.value=e.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(t){if(t==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=t}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide}}class X{constructor(t){this.heap=t}static from(t,e=null,n=-1){let i=[];for(let s=0;s<t.length;s++)for(let r=t[s];!r.isEmpty;r=r.nextLayer)r.maxPoint>=n&&i.push(new Wt(r,e,n,s));return i.length==1?i[0]:new X(i)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let n of this.heap)n.goto(t,e);for(let n=this.heap.length>>1;n>=0;n--)mt(this.heap,n);return this.next(),this}forward(t,e){for(let n of this.heap)n.forward(t,e);for(let n=this.heap.length>>1;n>=0;n--)mt(this.heap,n);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),mt(this.heap,0)}}}function mt(h,t){for(let e=h[t];;){let n=(t<<1)+1;if(n>=h.length)break;let i=h[n];if(n+1<h.length&&i.compare(h[n+1])>=0&&(i=h[n+1],n++),e.compare(i)<0)break;h[n]=e,h[t]=i,t=n}}class G{constructor(t,e,n){this.minPoint=n,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=X.from(t,e,n)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){tt(this.active,t),tt(this.activeTo,t),tt(this.activeRank,t),this.minActive=Gt(this.active,this.activeTo)}addActive(t){let e=0,{value:n,to:i,rank:s}=this.cursor;for(;e<this.activeRank.length&&(s-this.activeRank[e]||i-this.activeTo[e])>0;)e++;et(this.active,e,n),et(this.activeTo,e,i),et(this.activeRank,e,s),t&&et(t,e,this.cursor.from),this.minActive=Gt(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>t){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&tt(n,i)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(n),this.cursor.next();else if(e&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let i=n.length-1;i>=0&&n[i]<t;i--)this.openStart++}}activeForPoint(t){if(!this.active.length)return this.active;let e=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>t||this.activeTo[n]==t&&this.active[n].endSide>=this.point.endSide)&&e.push(this.active[n]);return e.reverse()}openEnd(t){let e=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>t;n--)e++;return e}}function Ut(h,t,e,n,i,s){h.goto(t),e.goto(n);let r=n+i,o=n,a=n-t;for(;;){let l=h.to+a-e.to||h.endSide-e.endSide,c=l<0?h.to+a:e.to,f=Math.min(c,r);if(h.point||e.point?h.point&&e.point&&(h.point==e.point||h.point.eq(e.point))&&xt(h.activeForPoint(h.to),e.activeForPoint(e.to))||s.comparePoint(o,f,h.point,e.point):f>o&&!xt(h.active,e.active)&&s.compareRange(o,f,h.active,e.active),c>r)break;o=c,l<=0&&h.next(),l>=0&&e.next()}}function xt(h,t){if(h.length!=t.length)return!1;for(let e=0;e<h.length;e++)if(h[e]!=t[e]&&!h[e].eq(t[e]))return!1;return!0}function tt(h,t){for(let e=t,n=h.length-1;e<n;e++)h[e]=h[e+1];h.pop()}function et(h,t,e){for(let n=h.length-1;n>=t;n--)h[n+1]=h[n];h[t]=e}function Gt(h,t){let e=-1,n=1e9;for(let i=0;i<t.length;i++)(t[i]-n||h[i].endSide-h[e].endSide)<0&&(e=i,n=t[i]);return e}function le(h,t,e=h.length){let n=0;for(let i=0;i<e;)h.charCodeAt(i)==9?(n+=t-n%t,i++):(n++,i=$(h,i));return n}function ce(h,t,e,n){for(let i=0,s=0;;){if(s>=t)return i;if(i==h.length)break;s+=h.charCodeAt(i)==9?e-s%e:1,i=$(h,i)}return n===!0?-1:h.length}export{L as Annotation,jt as AnnotationType,M as ChangeDesc,y as ChangeSet,C as CharCategory,H as Compartment,d as EditorSelection,x as EditorState,P as Facet,kt as Line,R as MapMode,Zt as Prec,j as Range,b as RangeSet,Q as RangeSetBuilder,U as RangeValue,T as SelectionRange,k as StateEffect,qt as StateEffectType,F as StateField,v as Text,I as Transaction,K as codePointAt,st as codePointSize,oe as combineConfig,le as countColumn,$ as findClusterBreak,ce as findColumn,Yt as fromCodePoint};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.