From 976c0d950461ab884a9d107659d3ba103d8cb269 Mon Sep 17 00:00:00 2001 From: Hizbu Azka Date: Wed, 21 Oct 2026 14:31:59 +0700 Subject: selfhost cm, add dark theme --- assets/cm/chunk-7PWEZHZB.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 assets/cm/chunk-7PWEZHZB.js (limited to 'assets/cm/chunk-7PWEZHZB.js') diff --git a/assets/cm/chunk-7PWEZHZB.js b/assets/cm/chunk-7PWEZHZB.js new file mode 100644 index 0000000..b74c60b --- /dev/null +++ b/assets/cm/chunk-7PWEZHZB.js @@ -0,0 +1,5 @@ +var fe=[],Te=[];(()=>{let s="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,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e>1;if(s=Te[n])e=n+1;else return!0;if(e==t)return!1}}function Ce(s){return s>=127462&&s<=127487}var Oe=8205;function Me(s,e,t=!0,n=!0){return(t?Be:Ye)(s,e,n)}function Be(s,e,t){if(e==s.length)return e;e&&Fe(s.charCodeAt(e))&&Le(s.charCodeAt(e-1))&&e--;let n=ae(s,e);for(e+=Re(n);e=0&&Ce(ae(s,l));)r++,l-=2;if(r%2==0)break;e+=2}else break}return e}function Ye(s,e,t){for(;e>1;){let n=Be(s,e-2,t);if(n=56320&&s<57344}function Le(s){return s>=55296&&s<56320}function Re(s){return s<65536?1:2}var w=class s{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,n){[e,t]=q(this,e,t);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),V.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=q(this,e,t);let n=[];return this.decompose(e,t,n,0),V.from(n,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),n=this.length-this.scanIdentical(e,-1),i=new F(this),r=new F(e);for(let l=t,h=t;;){if(i.next(l),r.next(l),l=0,i.lineBreak!=r.lineBreak||i.done!=r.done||i.value!=r.value)return!1;if(h+=i.value.length,i.done||h>=n)return!0}}iter(e=1){return new F(this,e)}iterRange(e,t=this.length){return new te(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new ne(n)}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]?s.empty:e.length<=32?new S(e):V.from(S.split(e,[]))}},S=class s extends w{constructor(e,t=_e(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let r=0;;r++){let l=this.text[r],h=i+l.length;if((t?n:h)>=e)return new ce(i,h,n,l);i=h+1,n++}}decompose(e,t,n,i){let r=e<=0&&t>=this.length?this:new s(De(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let l=n.pop(),h=ee(r.text,l.text.slice(),0,r.length);if(h.length<=32)n.push(new s(h,l.length+r.length));else{let o=h.length>>1;n.push(new s(h.slice(0,o)),new s(h.slice(o)))}}else n.push(r)}replace(e,t,n){if(!(n instanceof s))return super.replace(e,t,n);[e,t]=q(this,e,t);let i=ee(this.text,ee(n.text,De(this.text,0,e)),t),r=this.length+n.length-(t-e);return i.length<=32?new s(i,r):V.from(s.split(i,[]),r)}sliceString(e,t=this.length,n=` +`){[e,t]=q(this,e,t);let i="";for(let r=0,l=0;r<=t&&le&&l&&(i+=n),er&&(i+=h.slice(Math.max(0,e-r),t-r)),r=o+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let r of e)n.push(r),i+=r.length+1,n.length==32&&(t.push(new s(n,i)),n=[],i=-1);return i>-1&&t.push(new s(n,i)),t}},V=class s extends w{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,i){for(let r=0;;r++){let l=this.children[r],h=i+l.length,o=n+l.lines-1;if((t?o:h)>=e)return l.lineInner(e,t,n,i);i=h+1,n=o+1}}decompose(e,t,n,i){for(let r=0,l=0;l<=t&&r=l){let a=i&((l<=e?1:0)|(o>=t?2:0));l>=e&&o<=t&&!a?n.push(h):h.decompose(e-l,t-l,n,a)}l=o+1}}replace(e,t,n){if([e,t]=q(this,e,t),n.lines=r&&t<=h){let o=l.replace(e-r,t-r,n),a=this.lines-l.lines+o.lines;if(o.lines>4&&o.lines>a>>6){let f=this.children.slice();return f[i]=o,new s(f,this.length-(t-e)+n.length)}return super.replace(r,h,o)}r=h+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=` +`){[e,t]=q(this,e,t);let i="";for(let r=0,l=0;re&&r&&(i+=n),el&&(i+=h.sliceString(e-l,t-l,n)),l=o+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof s))return 0;let n=0,[i,r,l,h]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,r+=t){if(i==l||r==h)return n;let o=this.children[i],a=e.children[r];if(o!=a)return n+o.scanIdentical(a,t);n+=o.length+1}}static from(e,t=e.reduce((n,i)=>n+i.length+1,-1)){let n=0;for(let d of e)n+=d.lines;if(n<32){let d=[];for(let g of e)g.flatten(d);return new S(d,t)}let i=Math.max(32,n>>5),r=i<<1,l=i>>1,h=[],o=0,a=-1,f=[];function u(d){let g;if(d.lines>r&&d instanceof s)for(let m of d.children)u(m);else d.lines>l&&(o>l||!o)?(c(),h.push(d)):d instanceof S&&o&&(g=f[f.length-1])instanceof S&&d.lines+g.lines<=32?(o+=d.lines,a+=d.length+1,f[f.length-1]=new S(g.text.concat(d.text),g.length+1+d.length)):(o+d.lines>i&&c(),o+=d.lines,a+=d.length+1,f.push(d))}function c(){o!=0&&(h.push(f.length==1?f[0]:s.from(f,a)),a=-1,o=f.length=0)}for(let d of e)u(d);return c(),h.length==1?h[0]:new s(h,t)}};w.empty=new S([""],0);function _e(s){let e=-1;for(let t of s)e+=t.length+1;return e}function ee(s,e,t=0,n=1e9){for(let i=0,r=0,l=!0;r=t&&(o>n&&(h=h.slice(0,n-i)),i0?1:(e instanceof S?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],r=this.offsets[n],l=r>>1,h=i instanceof S?i.text.length:i.children.length;if(l==(t>0?h:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(i instanceof S){let o=i.text[l+(t<0?-1:0)];if(this.offsets[n]+=t,o.length>Math.max(0,e))return this.value=e==0?o:t>0?o.slice(e):o.slice(0,o.length-e),this;e-=o.length}else{let o=i.children[l+(t<0?-1:0)];e>o.length?(e-=o.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(o),this.offsets.push(t>0?1:(o instanceof S?o.text.length:o.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},te=class{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new F(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}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 n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.slice(0,n),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!=""}},ne=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(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"&&(w.prototype[Symbol.iterator]=function(){return this.iter()},F.prototype[Symbol.iterator]=te.prototype[Symbol.iterator]=ne.prototype[Symbol.iterator]=function(){return this});var ce=class{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}};function q(s,e,t){return e=Math.max(0,Math.min(s.length,e)),[e,Math.max(e,Math.min(s.length,t))]}function ie(s,e,t=!0,n=!0){return Me(s,e,t,n)}function et(s){return s>=56320&&s<57344}function tt(s){return s>=55296&&s<56320}function gt(s,e){let t=s.charCodeAt(e);if(!tt(t)||e+1==s.length)return t;let n=s.charCodeAt(e+1);return et(n)?(t-55296<<10)+(n-56320)+65536:t}function pt(s){return s<=65535?String.fromCharCode(s):(s-=65536,String.fromCharCode((s>>10)+55296,(s&1023)+56320))}function mt(s){return s<65536?1:2}var de=/\r\n?|\n/,b=(function(s){return s[s.Simple=0]="Simple",s[s.TrackDel=1]="TrackDel",s[s.TrackBefore=2]="TrackBefore",s[s.TrackAfter=3]="TrackAfter",s})(b||(b={})),L=class s{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-i);r+=h}else{if(n!=b.Simple&&a>=e&&(n==b.TrackDel&&ie||n==b.TrackBefore&&ie))return null;if(a>e||a==e&&t<0&&!h)return e==i||t<0?r:r+o;r+=o}i=a}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return r}touchesRange(e,t=e){for(let n=0,i=0;n=0&&i<=t&&h>=e)return it?"cover":!0;i=h}return!1}toString(){let e="";for(let t=0;t=0?":"+i:"")}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 s(e)}static create(e){return new s(e)}},E=class s extends L{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 ge(this,(t,n,i,r,l)=>e=e.replace(i,i+(n-t),l),!1),e}mapDesc(e,t=!1){return pe(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let i=0,r=0;i=0){t[i]=h,t[i+1]=l;let o=i>>1;for(;n.length0&&C(n,t,r.text),r.forward(f),h+=f}let a=e[l++];for(;h>1].toJSON()))}return e}static of(e,t,n){let i=[],r=[],l=0,h=null;function o(f=!1){if(!f&&!i.length)return;lc||u<0||c>t)throw new RangeError(`Invalid change range ${u} to ${c} (in doc of length ${t})`);let g=d?typeof d=="string"?w.of(d.split(n||de)):d:w.empty,m=g.length;if(u==c&&m==0)return;ul&&x(i,u-l,-1),x(i,c-u,m),C(r,i,g),l=c}}return a(e),o(!h),h}static empty(e){return new s(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let i=0;ih&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;n.length=0&&t<=0&&t==s[i+1]?s[i]+=e:i>=0&&e==0&&s[i]==0?s[i+1]+=t:n?(s[i]+=e,s[i+1]+=t):s.push(e,t)}function C(s,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n>1])),!(t||l==s.sections.length||s.sections[l+1]<0);)h=s.sections[l++],o=s.sections[l++];e(i,a,r,f,u),i=a,r=f}}}function pe(s,e,t,n=!1){let i=[],r=n?[]:null,l=new D(s),h=new D(e);for(let o=-1;;){if(l.done&&h.len||h.done&&l.len)throw new Error("Mismatched change set lengths");if(l.ins==-1&&h.ins==-1){let a=Math.min(l.len,h.len);x(i,a,-1),l.forward(a),h.forward(a)}else if(h.ins>=0&&(l.ins<0||o==l.i||l.off==0&&(h.len=0&&o=0){let a=0,f=l.len;for(;f;)if(h.ins==-1){let u=Math.min(f,h.len);a+=u,f-=u,h.forward(u)}else if(h.ins==0&&h.leno||l.ins>=0&&l.len>o)&&(h||n.length>a),r.forward2(o),l.forward(o)}}}}var D=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?w.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?w.empty:t[n].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)}},T=class s{constructor(e,t,n,i){this.from=e,this.to=t,this.flags=n,this.goalColumn=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 undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,t=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new s(n,i,this.flags,this.goalColumn)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return y.range(e,t,void 0,void 0,n);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return y.range(this.anchor,i,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!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 y.range(e.anchor,e.head)}static create(e,t,n,i){return new s(e,t,n,i)}},y=class s{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:s.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.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=>T.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 n=0,i=0;ii.from-r.from),t=e.indexOf(n);for(let i=1;ir.head?s.range(o,h):s.range(h,o))}}return new s(e,t)}};function qe(s,e){for(let t of s.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}var Pe=0,I=class s{constructor(e,t,n,i,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=Pe++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(e={}){return new s(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:Ee),!!e.static,e.enables)}of(e){return new $([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new $(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new $(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}};function Ee(s,e){return s==e||s.length==e.length&&s.every((t,n)=>t===e[n])}var $=class{constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=Pe++}dynamicSlot(e){var t;let n=this.value,i=this.facet.compareInput,r=this.id,l=e[r]>>1,h=this.type==2,o=!1,a=!1,f=[];for(let u of this.dependencies)u=="doc"?o=!0:u=="selection"?a=!0:(((t=e[u.id])!==null&&t!==void 0?t:1)&1)==0&&f.push(e[u.id]);return{create(u){return u.values[l]=n(u),1},update(u,c){if(o&&c.docChanged||a&&(c.docChanged||c.selection)||me(u,f)){let d=n(u);if(h?!Je(d,u.values[l],i):!i(d,u.values[l]))return u.values[l]=d,1}return 0},reconfigure:(u,c)=>{let d,g=c.config.address[r];if(g!=null){let m=he(c,g);if(this.dependencies.every(p=>p instanceof I?c.facet(p)===u.facet(p):p instanceof W?c.field(p,!1)==u.field(p,!1):!0)||(h?Je(d=n(u),m,i):i(d=n(u),m)))return u.values[l]=m,0}else d=n(u);return u.values[l]=d,1}}}get extension(){return this}};function Je(s,e,t){if(s.length!=e.length)return!1;for(let n=0;ns[o.id]),i=t.map(o=>o.type),r=n.filter(o=>!(o&1)),l=s[e.id]>>1;function h(o){let a=[];for(let f=0;fn===i),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(X).find(n=>n.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,i)=>{let r=n.values[t],l=this.updateF(r,i);return this.compareF(r,l)?0:(n.values[t]=l,1)},reconfigure:(n,i)=>{let r=n.facet(X),l=i.facet(X),h;return(h=r.find(o=>o.field==this))&&h!=l.find(o=>o.field==this)?(n.values[t]=h.create(n),1):i.config.address[this.id]!=null?(n.values[t]=i.field(this),0):(n.values[t]=this.create(n),1)}}}init(e){return[this,X.of({field:this,create:e})]}get extension(){return this}},M={lowest:4,low:3,default:2,high:1,highest:0};function U(s){return e=>new se(e,s)}var wt={highest:U(M.highest),high:U(M.high),default:U(M.default),low:U(M.low),lowest:U(M.lowest)},se=class{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}},re=class s{of(e){return new Z(this,e)}reconfigure(e){return s.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}},Z=class{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}},le=class s{constructor(e,t,n,i,r,l){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=i,this.staticValues=r,this.facets=l,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let i=[],r=Object.create(null),l=new Map;for(let c of it(e,t,l))c instanceof W?i.push(c):(r[c.facet.id]||(r[c.facet.id]=[])).push(c);let h=Object.create(null),o=[],a=[];for(let c of i)h[c.id]=a.length<<1,a.push(d=>c.slot(d));let f=n?.config.facets;for(let c in r){let d=r[c],g=d[0].facet,m=f&&f[c]||[];if(d.every(p=>p.type==0))if(h[g.id]=o.length<<1|1,Ee(m,d))o.push(n.facet(g));else{let p=g.combine(d.map(v=>v.value));o.push(n&&g.compare(p,n.facet(g))?n.facet(g):p)}else{for(let p of d)p.type==0?(h[p.id]=o.length<<1|1,o.push(p.value)):(h[p.id]=a.length<<1,a.push(v=>p.dynamicSlot(v)));h[g.id]=a.length<<1,a.push(p=>nt(p,g,d))}}let u=a.map(c=>c(h));return new s(e,l,u,h,o,r)}};function it(s,e,t){let n=[[],[],[],[],[]],i=new Map;function r(l,h){let o=i.get(l);if(o!=null){if(o<=h)return;let a=n[o].indexOf(l);a>-1&&n[o].splice(a,1),l instanceof Z&&t.delete(l.compartment)}if(i.set(l,h),Array.isArray(l))for(let a of l)r(a,h);else if(l instanceof Z){if(t.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let a=e.get(l.compartment)||l.inner;t.set(l.compartment,a),r(a,h)}else if(l instanceof se)r(l.inner,l.prec);else if(l instanceof W)n[h].push(l),l.provides&&r(l.provides,h);else if(l instanceof $)n[h].push(l),l.facet.extensions&&r(l.facet.extensions,M.default);else{let a=l.extension;if(!a)throw new Error(`Unrecognized extension value in extension set (${l}).`);if(a==l)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(a,h)}}return r(s,M.default),n.reduce((l,h)=>l.concat(h))}function G(s,e){if(e&1)return 2;let t=e>>1,n=s.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;s.status[t]=4;let i=s.computeSlot(s,s.config.dynamicSlots[t]);return s.status[t]=2|i}function he(s,e){return e&1?s.config.staticValues[e>>1]:s.values[e>>1]}var We=I.define(),we=I.define({combine:s=>s.some(e=>e),static:!0}),je=I.define({combine:s=>s.length?s[0]:void 0,static:!0}),Ue=I.define(),Ge=I.define(),He=I.define(),Ze=I.define({combine:s=>s.length?s[0]:!1}),J=class{constructor(e,t){this.type=e,this.value=t}static define(){return new ve}},ve=class{of(e){return new J(this,e)}},xe=class{constructor(e){this.map=e}of(e){return new k(this,e)}},k=class s{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 s(this.type,t)}is(e){return this.type==e}static define(e={}){return new xe(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let i of e){let r=i.map(t);r&&n.push(r)}return n}};k.reconfigure=k.define();k.appendConfig=k.define();var A=class s{constructor(e,t,n,i,r,l){this.startState=e,this.changes=t,this.selection=n,this.effects=i,this.annotations=r,this.scrollIntoView=l,this._doc=null,this._state=null,n&&qe(n,t.newLength),r.some(h=>h.type==s.time)||(this.annotations=r.concat(s.time.of(Date.now())))}static create(e,t,n,i,r,l){return new s(e,t,n,i,r,l)}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(s.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}};A.time=J.define();A.userEvent=J.define();A.addToHistory=J.define();A.remote=J.define();function st(s,e){let t=[];for(let n=0,i=0;;){let r,l;if(n=s[n]))r=s[n++],l=s[n++];else if(i=0;i--){let r=n[i](s);r instanceof A?s=r:Array.isArray(r)&&r.length==1&&r[0]instanceof A?s=r[0]:s=Qe(e,z(r),!1)}return s}function lt(s){let e=s.startState,t=e.facet(He),n=s;for(let i=t.length-1;i>=0;i--){let r=t[i](s);r&&Object.keys(r).length&&(n=Ke(n,ke(e,r,s.changes.newLength),!0))}return n==s?s:A.create(e,s.changes,s.selection,n.effects,n.annotations,n.scrollIntoView)}var ht=[];function z(s){return s==null?ht:Array.isArray(s)?s:[s]}var O=(function(s){return s[s.Word=0]="Word",s[s.Space=1]="Space",s[s.Other=2]="Other",s})(O||(O={})),ot=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,ye;try{ye=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function at(s){if(ye)return ye.test(s);for(let e=0;e"\x80"&&(t.toUpperCase()!=t.toLowerCase()||ot.test(t)))return!0}return!1}function ft(s){return e=>{if(!/\S/.test(e))return O.Space;if(at(e))return O.Word;for(let t=0;t-1)return O.Word;return O.Other}}var P=class s{constructor(e,t,n,i,r,l){this.config=e,this.doc=t,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=r,l&&(l._state=this);for(let h=0;hi.set(a,o)),t=null),i.set(h.value.compartment,h.value.extension)):h.is(k.reconfigure)?(t=null,n=h.value):h.is(k.appendConfig)&&(t=null,n=z(n).concat(h.value));let r;t?r=e.startState.values.slice():(t=le.resolve(n,i,this),r=new s(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(o,a)=>a.reconfigure(o,this),null).values);let l=e.startState.facet(we)?e.newSelection:e.newSelection.asSingle();new s(t,e.newDoc,l,r,(h,o)=>o.update(h,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:y.cursor(t.from+e.length,-1)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),i=this.changes(n.changes),r=[n.range],l=z(n.effects);for(let h=1;hl.spec.fromJSON(h,o)))}}return s.create({doc:e.doc,selection:y.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=le.resolve(e.extensions||[],new Map),n=e.doc instanceof w?e.doc:w.of((e.doc||"").split(t.staticFacet(s.lineSeparator)||de)),i=e.selection?e.selection instanceof y?e.selection:y.single(e.selection.anchor,e.selection.head):y.single(0);return qe(i,n.length),t.staticFacet(we)||(i=i.asSingle()),new s(t,n,i,t.dynamicSlots.map(()=>null),(r,l)=>l.create(r),null)}get tabSize(){return this.facet(s.tabSize)}get lineBreak(){return this.facet(s.lineSeparator)||` +`}get readOnly(){return this.facet(Ze)}phrase(e,...t){for(let n of this.facet(s.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,i)=>{if(i=="$")return"$";let r=+(i||1);return!r||r>t.length?n:t[r-1]})),e}languageDataAt(e,t,n=-1){let i=[];for(let r of this.facet(We))for(let l of r(this,t,n))Object.prototype.hasOwnProperty.call(l,e)&&i.push(l[e]);return i}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return ft(t.length?t[0]:"")}wordAt(e){let{text:t,from:n,length:i}=this.doc.lineAt(e),r=this.charCategorizer(e),l=e-n,h=e-n;for(;l>0;){let o=ie(t,l,!1);if(r(t.slice(o,l))!=O.Word)break;l=o}for(;hs.length?s[0]:4});P.lineSeparator=je;P.readOnly=Ze;P.phrases=I.define({compare(s,e){let t=Object.keys(s),n=Object.keys(e);return t.length==n.length&&t.every(i=>s[i]==e[i])}});P.languageData=We;P.changeFilter=Ue;P.transactionFilter=Ge;P.transactionExtender=He;re.reconfigure=k.define();function vt(s,e,t={}){let n={};for(let i of s)for(let r of Object.keys(i)){let l=i[r],h=n[r];if(h===void 0)n[r]=l;else if(!(h===l||l===void 0))if(Object.hasOwnProperty.call(t,r))n[r]=t[r](h,l);else throw new Error("Config merge conflict for field "+r)}for(let i in e)n[i]===void 0&&(n[i]=e[i]);return n}var j=class{eq(e){return this==e}range(e,t=e){return K.create(e,t,this)}};j.prototype.startSide=j.prototype.endSide=0;j.prototype.point=!1;j.prototype.mapMode=b.TrackDel;function be(s,e){return s==e||s.constructor==e.constructor&&s.eq(e)}var K=class s{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new s(e,t,n)}};function Se(s,e){return s.from-e.from||s.value.startSide-e.value.startSide}var Ie=class s{constructor(e,t,n,i){this.from=e,this.to=t,this.value=n,this.maxPoint=i}get length(){return N(this.to)}findIndex(e,t,n,i=0){let r=n?this.to:this.from;for(let l=i,h=r.length;;){if(l==h)return l;let o=l+h>>1,a=r[o]-e||(n?this.value[o].endSide:this.value[o].startSide)-t;if(o==l)return a>=0?l:h;a>=0?h=o:l=o+1}}between(e,t,n,i){for(let r=this.findIndex(t,-1e9,!0),l=this.findIndex(n,1e9,!1,r);rp||m==p&&c.startSide>0&&c.endSide<=0)continue;if(!((p-m||c.endSide-c.startSide)<0))if(a<0&&(a=m),c.point&&(f=Math.max(f,p-m)),(m-n||c.startSide-i)>=0)l.push(c),h.push(m-a),o.push(p-a),n=p,i=c.endSide;else{if(m==p)for(let v=l.length;v>0;v--){if((m-(o[v-1]+a)||c.startSide-l[v-1].endSide)>=0){l.splice(v,0,c),h.splice(v,0,m-a),o.splice(v,0,p-a);continue e}if((m-(h[v-1]+a)||c.endSide-l[v-1].startSide)>0)break}r(m,p,c)}}return{mapped:l.length?new s(h,o,l,f):null,pos:a}}},R=class s{constructor(e,t,n,i){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=i}static create(e,t,n,i){return new s(e,t,n,i)}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:n=!1,filterFrom:i=0,filterTo:r=this.length}=e,l=e.filter;if(t.length==0&&!l)return this;if(n&&(t=t.slice().sort(Se)),this.isEmpty)return t.length?s.of(t):this;let h=new oe(this,null,-1).goto(0),o=0,a=[],f=new H;for(;h.value||o=0){let u=t[o++];f.addInner(u.from,u.to,u.value,!1)||a.push(u)}else h.rangeIndex==1&&h.chunkIndexthis.chunkEnd(h.chunkIndex)||rh.to||r{r||(r=new H),r.addRange(o,a,f,!1)};for(let o=0;o=r&&e<=r+l.length&&l.between(r,e-r,t-r,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return Q.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Q.from(e).goto(t)}static compare(e,t,n,i,r=-1){let l=e.filter(u=>u.maxPoint>0||!u.isEmpty&&u.maxPoint>=r),h=t.filter(u=>u.maxPoint>0||!u.isEmpty&&u.maxPoint>=r),o=Ne(l,h,n),a=new B(l,o,r),f=new B(h,o,r);n.iterGaps((u,c,d)=>Ve(a,u,f,c,d,i)),n.empty&&n.length==0&&Ve(a,0,f,0,0,i)}static eq(e,t,n=0,i){i==null&&(i=999999999);let r=e.filter(f=>!f.isEmpty&&t.indexOf(f)<0),l=t.filter(f=>!f.isEmpty&&e.indexOf(f)<0);if(r.length!=l.length)return!1;if(!r.length)return!0;let h=Ne(r,l),o=new B(r,h,0).goto(n),a=new B(l,h,0).goto(n);for(;;){if(o.to!=a.to||!Ae(o.active,a.active)||o.point&&(!a.point||!be(o.point,a.point)))return!1;if(o.to>i)return!0;o.next(),a.next()}}static spans(e,t,n,i,r=-1){let l=new B(e,null,r).goto(t),h=t,o=l.openStart;for(;;){let a=Math.min(l.to,n);if(l.point){let f=l.activeForPoint(l.to),u=l.pointFromh&&(i.span(h,a,l.active,o),o=l.openEnd(a));if(l.to>n)return o+(l.point&&l.to>n?1:0);h=l.to,l.next()}}static of(e,t=!1){let n=new H;for(let i of e instanceof K?[e]:t?ut(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return s.empty;let t=N(e);for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=s.empty;i=i.nextLayer)t=new s(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}};R.empty=new R([],[],null,-1);function N(s){return s[s.length-1]}function ut(s){if(s.length>1)for(let e=s[0],t=1;t0)return s.slice().sort(Se);e=n}return s}R.empty.nextLayer=R.empty;var H=class s{finishChunk(e){this.chunks.push(new Ie(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,n){this.addRange(e,t,n,!0)}addRange(e,t,n,i){this.addInner(e,t,n,i)||(this.nextLayer||(this.nextLayer=new s)).addRange(e,t,n,i)}addInner(e,t,n,i){let r=e-this.lastTo||n.startSide-this.last.endSide;if(i&&r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<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=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.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 n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+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 Ne(s,e,t){let n=new Map;for(let r of s)for(let l=0;l=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&i.push(new oe(l,t,n,r));return i.length==1?i[0]:new s(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)ue(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)ue(this.heap,n);(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(),ue(this.heap,0)}}};function ue(s,e){for(let t=s[e];;){let n=(e<<1)+1;if(n>=s.length)break;let i=s[n];if(n+1=0&&(i=s[n+1],n++),t.compare(i)<0)break;s[n]=t,s[e]=i,e=n}}var B=class{constructor(e,t,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=Q.from(e,t,n)}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){Y(this.active,e),Y(this.activeTo,e),Y(this.activeRank,e),this.minActive=$e(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:i,rank:r}=this.cursor;for(;t0;)t++;_(this.active,t,n),_(this.activeTo,t,i),_(this.activeRank,t,r),e&&_(e,t,this.cursor.from),this.minActive=$e(this.active,this.activeTo)}next(){let e=this.to,t=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]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&Y(n,i)}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(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&n[i]=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}};function Ve(s,e,t,n,i,r){s.goto(e),t.goto(n);let l=n+i,h=n,o=n-e,a=!!r.boundChange;for(let f=!1;;){let u=s.to+o-t.to,c=u||s.endSide-t.endSide,d=c<0?s.to+o:t.to,g=Math.min(d,l);if(s.point||t.point?(s.point&&t.point&&be(s.point,t.point)&&Ae(s.activeForPoint(s.to),t.activeForPoint(t.to))||r.comparePoint(h,g,s.point,t.point),f=!1):(f&&(r.boundChange(h),f=!1),g>h&&!Ae(s.active,t.active)&&r.compareRange(h,g,s.active,t.active),a&&gl)break;h=d,c<=0&&s.next(),c>=0&&t.next()}}function Ae(s,e){if(s.length!=e.length)return!1;for(let t=0;t=e;n--)s[n+1]=s[n];s[e]=t}function $e(s,e){let t=-1,n=1e9;for(let i=0;i=e)return i;if(i==s.length)break;r+=s.charCodeAt(i)==9?t-r%t:1,i=ie(s,i)}return n===!0?-1:s.length}export{w as a,ce as b,ie as c,gt as d,pt as e,mt as f,b as g,L as h,E as i,T as j,y as k,I as l,W as m,wt as n,re as o,J as p,ve as q,xe as r,k as s,A as t,O as u,P as v,vt as w,j as x,K as y,R as z,H as A,xt as B,kt as C}; -- cgit