pocketbase/ui/dist/assets/index-Bd1MzT5k.js

15 lines
354 KiB
JavaScript
Raw Normal View History

let bs=[],El=[];(()=>{let n="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(t=>t?parseInt(t,36):1);for(let t=0,e=0;t<n.length;t++)(t%2?El:bs).push(e=e+n[t])})();function Mf(n){if(n<768)return!1;for(let t=0,e=bs.length;;){let i=t+e>>1;if(n<bs[i])e=i;else if(n>=El[i])t=i+1;else return!0;if(t==e)return!1}}function Yr(n){return n>=127462&&n<=127487}const Xr=8205;function Df(n,t,e=!0,i=!0){return(e?Il:Of)(n,t,i)}function Il(n,t,e){if(t==n.length)return t;t&&Nl(n.charCodeAt(t))&&Fl(n.charCodeAt(t-1))&&t--;let i=_n(n,t);for(t+=_r(i);t<n.length;){let s=_n(n,t);if(i==Xr||s==Xr||e&&Mf(s))t+=_r(s),i=s;else if(Yr(s)){let r=0,o=t-2;for(;o>=0&&Yr(_n(n,o));)r++,o-=2;if(r%2==0)break;t+=2}else break}return t}function Of(n,t,e){for(;t>0;){let i=Il(n,t-2,e);if(i<t)return i;t--}return 0}function _n(n,t){let e=n.charCodeAt(t);if(!Fl(e)||t+1==n.length)return e;let i=n.charCodeAt(t+1);return Nl(i)?(e-55296<<10)+(i-56320)+65536:e}function Nl(n){return n>=56320&&n<57344}function Fl(n){return n>=55296&&n<56320}function _r(n){return n<65536?1:2}class F{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,i){[t,e]=Ue(this,t,e);let s=[];return this.decompose(0,t,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(e,this.length,s,1),Ut.from(s,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=Ue(this,t,e);let i=[];return this.decompose(t,e,i,0),Ut.from(i,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),i=this.length-this.scanIdentical(t,-1),s=new mi(this),r=new mi(t);for(let o=e,l=e;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(t=1){return new mi(this,t)}iterRange(t,e=this.length){return new Vl(this,t,e)}iterLines(t,e){let i;if(t==null)i=this.iter();else{e==null&&(e=this.lines+1);let s=this.line(t).from;i=this.iterRange(s,Math.max(s,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new Hl(i)}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]?F.empty:t.length<=32?new _(t):Ut.from(_.split(t,[]))}}class _ extends F{constructor(t,e=Tf(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((e?i:l)>=t)return new Bf(s,l,i,o)
2025-03-14 15:11:41 +08:00
`){[t,e]=Ue(this,t,e);let s="";for(let r=0,o=0;r<=e&&o<this.text.length;o++){let l=this.text[o],a=r+l.length;r>t&&o&&(s+=i),t<a&&e>r&&(s+=l.slice(Math.max(0,t-r),e-r)),r=a+1}return s}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let i=[],s=-1;for(let r of t)i.push(r),s+=r.length+1,i.length==32&&(e.push(new _(i,s)),i=[],s=-1);return s>-1&&e.push(new _(i,s)),e}}class Ut extends F{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let i of t)this.lines+=i.lines}lineInner(t,e,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((e?a:l)>=t)return o.lineInner(t,e,i,s);s=l+1,i=a+1}}decompose(t,e,i,s){for(let r=0,o=0;o<=e&&r<this.children.length;r++){let l=this.children[r],a=o+l.length;if(t<=a&&e>=o){let f=s&((o<=t?1:0)|(a>=e?2:0));o>=t&&a<=e&&!f?i.push(l):l.decompose(t-o,e-o,i,f)}o=a+1}}replace(t,e,i){if([t,e]=Ue(this,t,e),i.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(t>=r&&e<=l){let a=o.replace(t-r,e-r,i),f=this.lines-o.lines+a.lines;if(a.lines<f>>4&&a.lines>f>>6){let h=this.children.slice();return h[s]=a,new Ut(h,this.length-(e-t)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(t,e,i)}sliceString(t,e=this.length,i=`
`){[t,e]=Ue(this,t,e);let s="";for(let r=0,o=0;r<this.children.length&&o<=e;r++){let l=this.children[r],a=o+l.length;o>t&&r&&(s+=i),t<a&&e>o&&(s+=l.sliceString(t-o,e-o,i)),o=a+1}return s}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof Ut))return 0;let i=0,[s,r,o,l]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;s+=e,r+=e){if(s==o||r==l)return i;let a=this.children[s],f=t.children[r];if(a!=f)return i+a.scanIdentical(f,e);i+=a.length+1}}static from(t,e=t.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of t)i+=d.lines;if(i<32){let d=[];for(let p of t)p.flatten(d);return new _(d,e)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,f=-1,h=[];function c(d){let p;if(d.lines>r&&d instanceof Ut)for(let g of d.children)c(g);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof _&&a&&(p=h[h.length-1])instanceof _&&d.lines+p.lines<=32?(a+=d.lines,f+=d.length+1,h[h.length-1]=new _(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,f+=d.length+1,h.push(d))}function u(){a!=0&&(l.push(h.length==1?h[0]:Ut.from(h,f)),f=-1,a=h.length=0)}for(let d of t)c(d);return u(),l.length==1?l[0]:new Ut(l,e)}}F.empty=new _([""],0);function Tf(n){let t=-1;for(let e of n)t+=e.length+1;return t}function fn(n,t,e=0,i=1e9){for(let s=0,r=0,o=!0;r<n.length&&s<=i;r++){let l=n[r],a=s+l.length;a>=e&&(a>i&&(l=l.slice(0,i-s)),s<e&&(l=l.slice(e-s)),o?(t[t.length-1]+=l,o=!1):t.push(l)),s=a+1}return t}function Qr(n,t,e){return fn(n,[""],t,e)}class mi{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 _?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof _?s.text.length:s.children.length;if(o==(e>0?l:0)){if(i==0)return this.done=!0,this.value="",this;e>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(e>0?0:1)){if(this.offsets[i]+=e,t==0)return this.lineBreak=!0,this.value=`
`,this;t--}else if(s instanceof _){let a=s.text[o+(e<0?-1:0)];if(this.offsets[i]+=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=s.children[o+(e<0?-1:0)];t>a.length?(t-=a.length,this.offsets[i]+=e):(e<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(e>0?1:(a instanceof _?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 Vl{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new mi(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i)}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 i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:s}=this.cursor.next(t);return this.pos+=(s.length+t)*e,this.value=s.length<=i?s:e<0?s.slice(s.length-i):s.slice(0,i),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 Hl{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:i,value:s}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(F.prototype[Symbol.iterator]=function(){return this.iter()},mi.prototype[Symbol.iterator]=Vl.prototype[Symbol.iterator]=Hl.prototype[Symbol.iterator]=function(){return this});class Bf{constructor(t,e,i,s){this.from=t,this.to=e,this.number=i,this.text=s}get length(){return this.to-this.from}}function Ue(n,t,e){return t=Math.max(0,Math.min(n.length,t)),[t,Math.max(t,Math.min(n.length,e))]}function ot(n,t,e=!0,i=!0){return Df(n,t,e,i)}function Pf(n){return n>=56320&&n<57344}function Rf(n){return n>=55296&&n<56320}function yt(n,t){let e=n.charCodeAt(t);if(!Rf(e)||t+1==n.length)return e;let i=n.charCodeAt(t+1);return Pf(i)?(e-55296<<10)+(i-56320)+65536:e}function ur(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Gt(n){return n<65536?1:2}const xs=/\r\n?|\n/;var at=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(at||(at={}));class Qt{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 i=this.sections[e+1];t+=i<0?this.sections[e]:i}return t}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(t){for(let e=0,i=0,s=0;e<this.sections.length;){let r=this.sections[e++],o=this.sections[e++];o<0?(t(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(t,e=!1){ws(this,t,e)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let i=this.sections[e++],s=this.sections[e++];s<0?t.push(i,s):t.push(s,i)}return new Qt(t)}composeDesc(t){return this.empty?t:t.empty?this:Wl(this,t)}mapDesc(t,e=!1){return t.empty?this:Ss(this,t,e)}mapPos(t,e=-1,i=at.Simple){let s=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],f=s+l;if(a<0){if(f>t)return r+(t-s);r+=l}else{if(i!=at.Simple&&f>=t&&(i==at.TrackDel&&s<t&&f>t||i==at.TrackBefore&&s<t||i==at.TrackAfter&&f>t))return null;if(f>t||f==t&&e<0&&!l)return t==s||e<0?r:r+a;r+=a}s=f}if(t>s)throw new RangeError(`Position ${t} is out of range for changeset of length ${s}`);return r}touchesRange(t,e=t){for(let i=0,s=0;i<this.sections.length&&s<=e;){let r=this.sections[i++],o=this.sections[i++],l=s+r;if(o>=0&&s<=e&&l>=t)return s<t&&l>e?"cover":!0;s=l}return!1}toString(){let t="";for(let e=0;e<this.sections.length;){let i=this.sections[e++],s=this.sections[e++];t+=(t?" ":"")+i+(s>=0?":"+s:""
`}get readOnly(){return this.facet(Jl)}phrase(t,...e){for(let i of this.facet(H.phrases))if(Object.prototype.hasOwnProperty.call(i,t)){t=i[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>e.length?i:e[r-1]})),t}languageDataAt(t,e,i=-1){let s=[];for(let r of this.facet(Kl))for(let o of r(this,e,i))Object.prototype.hasOwnProperty.call(o,t)&&s.push(o[t]);return s}charCategorizer(t){return Kf(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:e,from:i,length:s}=this.doc.lineAt(t),r=this.charCategorizer(t),o=t-i,l=t-i;for(;o>0;){let a=ot(e,o,!1);if(r(e.slice(a,o))!=J.Word)break;o=a}for(;l<s;){let a=ot(e,l);if(r(e.slice(l,a))!=J.Word)break;l=a}return o==l?null:b.range(o+i,l+i)}}H.allowMultipleSelections=Cs;H.tabSize=T.define({combine:n=>n.length?n[0]:4});H.lineSeparator=$l;H.readOnly=Jl;H.phrases=T.define({compare(n,t){let e=Object.keys(n),i=Object.keys(t);return e.length==i.length&&e.every(s=>n[s]==t[s])}});H.languageData=Kl;H.changeFilter=jl;H.transactionFilter=Ul;H.transactionExtender=Gl;Wn.reconfigure=N.define();function Ee(n,t,e={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(e,r))i[r]=e[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in t)i[s]===void 0&&(i[s]=t[s]);return i}class De{eq(t){return this==t}range(t,e=t){return Ds.create(t,e,this)}}De.prototype.startSide=De.prototype.endSide=0;De.prototype.point=!1;De.prototype.mapMode=at.TrackDel;let Ds=class _l{constructor(t,e,i){this.from=t,this.to=e,this.value=i}static create(t,e,i){return new _l(t,e,i)}};function Os(n,t){return n.from-t.from||n.value.startSide-t.value.startSide}class gr{constructor(t,e,i,s){this.from=t,this.to=e,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(t,e,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,f=r[a]-t||(i?this.value[a].endSide:this.value[a].startSide)-e;if(a==o)return f>=0?o:l;f>=0?l=a:o=a+1}}between(t,e,i,s){for(let r=this.findIndex(e,-1e9,!0),o=this.findIndex(i,1e9,!1,r);r<o;r++)if(s(this.from[r]+t,this.to[r]+t,this.value[r])===!1)return!1}map(t,e){let i=[],s=[],r=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let f=this.value[a],h=this.from[a]+t,c=this.to[a]+t,u,d;if(h==c){let p=e.mapPos(h,f.startSide,f.mapMode);if(p==null||(u=d=p,f.startSide!=f.endSide&&(d=e.mapPos(h,f.endSide),d<u)))continue}else if(u=e.mapPos(h,f.startSide),d=e.mapPos(c,f.endSide),u>d||u==d&&f.startSide>0&&f.endSide<=0)continue;(d-u||f.endSide-f.startSide)<0||(o<0&&(o=u),f.point&&(l=Math.max(l,d-u)),i.push(f),s.push(u-o),r.push(d-o))}return{mapped:i.length?new gr(s,r,i,l):null,pos:o}}}class K{constructor(t,e,i,s){this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=s}static create(t,e,i,s){return new K(t,e,i,s)}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:i=!1,filterFrom:s=0,filterTo:r=this.length}=t,o=t.filter;if(e.length==0&&!o)return this;if(i&&(e=e.slice().sort(Os)),this.isEmpty)return e.length?K.of(e):this;let l=new Ql(this,null,-1).goto(0),a=0,f=[],h=new Oe;for(;l.value||a<e.length;)if(a<e.length&&(l.from-e[a].from||l.startSide-e[a].value.startSide)>=0){let c=e[a++];h.addInner(c.from,c.to,c.value)||f.push(c)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==e.length||this.chunkEnd(l.chunkIndex)<e[a].from)&&(!o||s>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&h.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||s>l.to||r<l.from||o(l.from,l.to,l.value))&&(h.addInner(l.from,l.to,l.value)||f.push(Ds.create(l.from,l.to,l.value))),l.next());return h.finishInner(this.nextLayer.isEmpty&&!f.length?K.empty:this.nextLayer.update({add:f,filter:o,filterFrom:s,filterTo:r}))}map(
`)}static newName(){let t=so[no]||1;return so[no]=t+1,Ps+t.toString(36)}static mount(t,e,i){let s=t[Rs],r=i&&i.nonce;s?r&&s.setNonce(r):s=new jf(t,r),s.mount(Array.isArray(e)?e:[e],t)}}let ro=new Map;class jf{constructor(t,e){let i=t.ownerDocument||t,s=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&s.CSSStyleSheet){let r=ro.get(i);if(r)return t[Rs]=r;this.sheet=new s.CSSStyleSheet,ro.set(i,this)}else this.styleTag=i.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[Rs]=this}mount(t,e){let i=this.sheet,s=0,r=0;for(let o=0;o<t.length;o++){let l=t[o],a=this.modules.indexOf(l);if(a<r&&a>-1&&(this.modules.splice(a,1),r--,a=-1),a==-1){if(this.modules.splice(r++,0,l),i)for(let f=0;f<l.rules.length;f++)i.insertRule(l.rules[f],s++)}else{for(;r<a;)s+=this.modules[r++].rules.length;s+=l.rules.length,r++}}if(i)e.adoptedStyleSheets.indexOf(this.sheet)<0&&(e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets]);else{let o="";for(let a=0;a<this.modules.length;a++)o+=this.modules[a].getRules()+`
2025-05-11 05:10:45 +08:00
`;this.styleTag.textContent=o;let l=e.head||e;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}var pe={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:"'"},vi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Uf=typeof navigator<"u"&&/Mac/.test(navigator.platform),Gf=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var rt=0;rt<10;rt++)pe[48+rt]=pe[96+rt]=String(rt);for(var rt=1;rt<=24;rt++)pe[rt+111]="F"+rt;for(var rt=65;rt<=90;rt++)pe[rt]=String.fromCharCode(rt+32),vi[rt]=String.fromCharCode(rt);for(var Zn in pe)vi.hasOwnProperty(Zn)||(vi[Zn]=pe[Zn]);function Jf(n){var t=Uf&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Gf&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",e=!t&&n.key||(n.shiftKey?vi:pe)[n.keyCode]||n.key||"Unidentified";return e=="Esc"&&(e="Escape"),e=="Del"&&(e="Delete"),e=="Left"&&(e="ArrowLeft"),e=="Up"&&(e="ArrowUp"),e=="Right"&&(e="ArrowRight"),e=="Down"&&(e="ArrowDown"),e}function Ci(n){let t;return n.nodeType==11?t=n.getSelection?n:n.ownerDocument:t=n,t.getSelection()}function Ls(n,t){return t?n==t||n.contains(t.nodeType!=1?t.parentNode:t):!1}function un(n,t){if(!t.anchorNode)return!1;try{return Ls(n,t.anchorNode)}catch{return!1}}function Ge(n){return n.nodeType==3?Be(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function bi(n,t,e,i){return e?oo(n,t,e,i,-1)||oo(n,t,e,i,1):!1}function Te(n){for(var t=0;;t++)if(n=n.previousSibling,!n)return t}function Sn(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function oo(n,t,e,i,s){for(;;){if(n==e&&t==i)return!0;if(t==(s<0?0:Zt(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;t=Te(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[t+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;t=s<0?Zt(n):0}else return!1}}function Zt(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Ei(n,t){let e=t?n.left:n.right;return{left:e,right:e,top:n.top,bottom:n.bottom}}function Yf(n){let t=n.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function Zl(n,t){let e=t.width/n.offsetWidth,i=t.height/n.offsetHeight;return(e>.995&&e<1.005||!isFinite(e)||Math.abs(t.width-n.offsetWidth)<1)&&(e=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-n.offsetHeight)<1)&&(i=1),{scaleX:e,scaleY:i}}function Xf(n,t,e,i,s,r,o,l){let a=n.ownerDocument,f=a.defaultView||window;for(let h=n,c=!1;h&&!c;)if(h.nodeType==1){let u,d=h==a.body,p=1,g=1;if(d)u=Yf(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 x=h.getBoundingClientRect();({scaleX:p,scaleY:g}=Zl(h,x)),u={left:x.left,right:x.left+h.clientWidth*p,top:x.top,bottom:x.top+h.clientHeight*g}}let m=0,y=0;if(s=="nearest")t.top<u.top?(y=t.top-(u.top+o),e>0&&t.bottom>u.bottom+y&&(y=t.bottom-u.bottom+o)):t.bottom>u.bottom&&(y=t.bottom-u.bottom+o,e<0&&t.top-y<u.top&&(y=t.top-(u.top+o)));else{let x=t.bottom-t.top,S=u.bottom-u.top;y=(s=="center"&&x<=S?t.top+x/2-S/2:s=="start"||s=="center"&&e<0?t.top-o:t.bottom-S+o)-u.top}if(i=="nearest"?t.left<u.left?(m=t.left-(u.left+r),e>0&&t.right>u.right+m&&(
`,s=n.state.doc.line(s.number+(e?1:-1)),r=n.bidiSpans(s),f=n.visualLineSide(s,!e)}if(a){if(!a(h))return l}else{if(!i)return f;a=i(h)}l=f}}function Pc(n,t,e){let i=n.state.charCategorizer(t),s=i(e);return r=>{let o=i(r);return s==J.Space&&(s=o),s==o}}function Rc(n,t,e,i){let s=t.head,r=e?1:-1;if(s==(e?n.state.doc.length:0))return b.cursor(s,t.assoc);let o=t.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),f=n.coordsAtPos(s,t.assoc||-1),h=n.documentTop;if(f)o==null&&(o=f.left-a.left),l=r<0?f.top:f.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+h}let c=a.left+o,u=i??n.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,g=Ea(n,{x:c,y:p},!1,r);if(p<a.top||p>a.bottom||(r<0?g<s:g>s)){let m=n.docView.coordsForChar(g),y=!m||p<m.top?-1:1;return b.cursor(g,y,void 0,o)}}}function pn(n,t,e){for(;;){let i=0;for(let s of n)s.between(t-1,t+1,(r,o,l)=>{if(t>r&&t<o){let a=i||e||(t-r<o-t?-1:1);t=a<0?r:o,i=a}});if(!i)return t}}function ns(n,t,e){let i=pn(n.state.facet(Sr).map(s=>s(n)),e.from,t.head>e.from?-1:1);return i==e.from?e:b.cursor(i,i<e.from?1:-1)}const di="￿";class Lc{constructor(t,e){this.points=t,this.text="",this.lineSeparator=e.facet(H.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=di}readRange(t,e){if(!t)return this;let i=t.parentNode;for(let s=t;;){this.findPointBefore(i,s);let r=this.text.length;this.readNode(s);let o=s.nextSibling;if(o==e)break;let l=$.get(s),a=$.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:Sn(s))||Sn(o)&&(s.nodeName!="BR"||s.cmIgnore)&&this.text.length>r)&&this.lineBreak(),s=o}return this.findPointBefore(i,e),this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=e.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(e))&&(r=l.index,o=l[0].length),this.append(e.slice(i,r<0?e.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==t&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(t){if(t.cmIgnore)return;let e=$.get(t),i=e&&e.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointInside(t,e){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(Ec(t,i.node,i.offset)?e:0))}}function Ec(n,t,e){for(;;){if(!t||e<Zt(t))return!1;if(t==n)return!0;e=Te(t)+1,t=t.parentNode}}class wo{constructor(t,e){this.node=t,this.offset=e,this.pos=-1}}class Ic{constructor(t,e,i,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=e>-1;let{impreciseHead:r,impreciseAnchor:o}=t.docView;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,i,0))){let l=r||o?[]:Vc(t),a=new Lc(l,t.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=Hc(l,this.bounds.from)}else{let l=t.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!Ls(t.contentDOM,l.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(l.focusNode,l.focusOffset),f=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Ls(t.contentDOM,l.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=t.viewport;if((D.ios||D.chrome)&&t.state.selection.main.empty&&a!=f&&(h.from>0||h.to<t.state.doc.length)){let c=Math.min(a,f),u=Math.max(a,f),d=h.from-c,p=h.to-u;(d==0||d==1||c==0)&&(p==0||p==-1||u==t.state.doc.length)&&(a=0,f=t.state.doc.length)}this.newSel=b.single(f,a)}}}function Ia(n,t){let e,{newSel:i}=t,s=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(t.bounds){let{from:o
2025-05-11 05:10:45 +08:00
`&&n.lineWrapping&&(i&&(i=b.single(i.main.anchor-1,i.main.head-1)),e={from:s.from,to:s.to,insert:F.of([" "])}),e)return vr(n,e,i,r);if(i&&!i.main.eq(s)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function vr(n,t,e,i=-1){if(D.ios&&n.inputState.flushIOSKey(t))return!0;let s=n.state.selection.main;if(D.android&&(t.to==s.to&&(t.from==s.from||t.from==s.from-1&&n.state.sliceDoc(t.from,s.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&qe(n.contentDOM,"Enter",13)||(t.from==s.from-1&&t.to==s.to&&t.insert.length==0||i==8&&t.insert.length<t.to-t.from&&t.to>s.head)&&qe(n.contentDOM,"Backspace",8)||t.from==s.from&&t.to==s.to+1&&t.insert.length==0&&qe(n.contentDOM,"Delete",46)))return!0;let r=t.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,l=()=>o||(o=Nc(n,t,e));return n.state.facet(va).some(a=>a(n,t.from,t.to,r,l))||n.dispatch(l()),!0}function Nc(n,t,e){let i,s=n.state,r=s.selection.main;if(t.from>=r.from&&t.to<=r.to&&t.to-t.from>=(r.to-r.from)/3&&(!e||e.main.empty&&e.main.from==t.from+t.insert.length)&&n.inputState.composing<0){let l=r.from<t.from?s.sliceDoc(r.from,t.from):"",a=r.to>t.to?s.sliceDoc(t.to,r.to):"";i=s.replaceSelection(n.state.toText(l+t.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let l=s.changes(t),a=e&&e.main.to<=l.newLength?e.main:void 0;if(s.selection.ranges.length>1&&n.inputState.composing>=0&&t.to<=r.to&&t.to>=r.to-10){let f=n.state.sliceDoc(t.from,t.to),h,c=e&&La(n,e.main.head);if(c){let p=t.insert.length-(t.to-t.from);h={from:c.from,to:c.to-p}}else h=n.state.doc.lineAt(r.head);let u=r.to-t.to,d=r.to-r.from;i=s.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let g=p.to-u,m=g-f.length;if(p.to-p.from!=d||n.state.sliceDoc(m,g)!=f||p.to>=h.from&&p.from<=h.to)return{range:p};let y=s.changes({from:m,to:g,insert:t.insert}),x=p.to-r.to;return{changes:y,range:a?b.range(Math.max(0,a.anchor+x),Math.max(0,a.head+x)):p.map(y)}})}else i={changes:l,selection:a&&s.selection.replaceRange(a)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:o,scrollIntoView:!0})}function Fc(n,t,e,i){let s=Math.min(n.length,t.length),r=0;for(;r<s&&n.charCodeAt(r)==t.charCodeAt(r);)r++;if(r==s&&n.length==t.length)return null;let o=n.length,l=t.length;for(;o>0&&l>0&&n.charCodeAt(o-1)==t.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));e-=o+a-r}if(o<r&&n.length<t.length){let a=e<=r&&e>=o?r-e:0;r-=a,l=r+(l-o),o=r}else if(l<r){let a=e<=r&&e>=l?r-e:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function Vc(n){let t=[];if(n.root.activeElement!=n.contentDOM)return t;let{anchorNode:e,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return e&&(t.push(new wo(e,i)),(s!=e||r!=i)&&t.push(new wo(s,r))),t}function Hc(n,t){if(n.length==0)return null;let e=n[0].pos,i=n.length==2?n[1].pos:e;return e>-1&&i>-1?b.single(e+t,i+t):null}class Wc{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,D.safari&&t.contentDOM.addEventListener("input",()=>null),D.gecko&&iu(t.contentDOM.ownerDocument)}handleEve
`))};if(f.from==this.from&&r<this.from?f.from=r:f.to==this.to&&r>this.to&&(f.to=r),f.from==f.to&&!f.insert.length){let h=b.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));h.main.eq(s)||t.dispatch({selection:h,userEvent:"select"});return}if((D.mac||D.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:a,insert:F.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!t.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);vr(t,f,b.single(this.toEditorPos(i.selectionStart,h),this.toEditorPos(i.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state))},this.handlers.characterboundsupdate=i=>{let s=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=t.coordsForChar(o);r=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||r||new DOMRect,s.push(r)}e.updateCharacterBounds(i.rangeStart,s)},this.handlers.textformatupdate=i=>{let s=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(o!="None"&&l!="None"){let a=this.toEditorPos(r.rangeStart),f=this.toEditorPos(r.rangeEnd);if(a<f){let h=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;s.push(P.mark({attributes:{style:h}}).range(a,f))}}}t.dispatch({effects:Oa.of(P.set(s))})},this.handlers.compositionstart=()=>{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(t.state)}};for(let i in this.handlers)e.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let s=Ci(i.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let e=0,i=!1,s=this.pendingContextChange;return t.changes.iterChanges((r,o,l,a,f)=>{if(i)return;let h=f.length-(o-r);if(s&&o>=s.to)if(s.from==r&&s.to==o&&s.insert.eq(f)){s=this.pendingContextChange=null,e+=h,this.to+=h;return}else s=null,this.revertPending(t.state);if(r+=e,o+=e,o<=this.from)this.from+=h,this.to+=h;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+f.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),f.toString()),this.to+=h}e+=h}),s&&!i&&this.revertPending(t.state),!i}update(t){let e=this.pendingContextChange,i=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(i.from,i.to)&&t.transactions.some(s=>!s.isUserEvent("input.type")&&s.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:e}=t.selection.main;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to))}setSelection(t){let{main:e}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),s=this.toContextPos(e.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(i,s)}rangeIsValid(t){let{head:e}=t.selection.main;return!(this.from>0&&e-this.from<500||this.to<t.doc.length&&this.to-e<500||this.to-this.from>1e4*3)}toEditorPos(t,e=this.to-this.from){t=Math.min(t,e);let i=this
--Ÿ­؜\u2028\u2029\uFEFF-]`,_s),Fu={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let os=null;function Vu(){var n;if(os==null&&typeof document<"u"&&document.body){let t=document.body.style;os=((n=t.tabSize)!==null&&n!==void 0?n:t.MozTabSize)!=null}return os||!1}const yn=T.define({combine(n){let t=Ee(n,{render:null,specialChars:Nu,addSpecialChars:null});return(t.replaceTabs=!Vu())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,_s)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,_s)),t}});function Om(n={}){return[yn.of(n),Hu()]}let Ko=null;function Hu(){return Ko||(Ko=ct.fromClass(class{constructor(n){this.view=n,this.decorations=P.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(yn)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Iu({regexp:n.specialChars,decoration:(t,e,i)=>{let{doc:s}=e.state,r=yt(t[0],0);if(r==9){let o=s.lineAt(i),l=e.state.tabSize,a=ei(o.text,l,i-o.from);return P.replace({widget:new Ku((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=P.replace({widget:new qu(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let t=n.state.facet(yn);n.startState.facet(yn)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const Wu="•";function zu(n){return n>=32?Wu:n==10?"␤":String.fromCharCode(9216+n)}class qu extends Ie{constructor(t,e){super(),this.options=t,this.code=e}eq(t){return t.code==this.code}toDOM(t){let e=zu(this.code),i=t.state.phrase("Control character")+" "+(Fu[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,e);if(s)return s;let r=document.createElement("span");return r.textContent=e,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Ku extends Ie{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}class $u extends Ie{constructor(t){super(),this.content=t}toDOM(t){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),e.setAttribute("aria-hidden","true"),e}coordsAt(t){let e=t.firstChild?Ge(t.firstChild):[];if(!e.length)return null;let i=window.getComputedStyle(t.parentNode),s=Ei(e[0],i.direction!="rtl"),r=parseInt(i.lineHeight);return s.bottom-s.top>r*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s}ignoreEvent(){return!1}}function Tm(n){let t=ct.fromClass(class{constructor(e){this.view=e,this.placeholder=n?P.set([P.widget({widget:new $u(n),side:1}).range(0)]):P.none}get decorations(){return this.view.state.doc.length?P.none:this.placeholder}},{decorations:e=>e.decorations});return typeof n=="string"?[t,O.contentAttributes.of({"aria-placeholder":n})]:t}const Qs=2e3;function ju(n,t,e){let i=Math.min(t.line,e.line),s=Math.max(t.line,e.line),r=[];if(t.off>Qs||e.off>Qs||t.col<0||e.col<0){let o=Math.min(t.off,e.off),l=Math.max(t.off,e.off);for(let a=i;a<=s;a++){let f=n.doc.line(a);f.length<=l&&r.push(b.range(f.from+o,f.to+l))}}else{let o=Math.min(t.col,e.col),l=Math.max(t.col,e.col);for(let a=i;a<=s;a++){let f=n.doc.line(a),h=Bs(f.t
2025-03-14 15:11:41 +08:00
`&&(e="");else{let i=e.indexOf(`
`);i>-1&&(e=e.slice(0,i))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),i=t+e.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(e=e.slice(0,r-(i-e.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);e+=l,i=o+l.length}return{line:e,end:i}}skipGapsTo(t,e,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=t+e;if(i>0?s>r:s>=r)break;let o=this.ranges[++this.rangeIndex].from;e+=o-s}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(t,e,i,s){let r=4;if(this.ranges.length>1){s=this.skipGapsTo(e,s,1),e+=s;let l=this.chunk.length;s=this.skipGapsTo(i,s,-1),i+=s,r+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&r==4&&o>=0&&this.chunk[o]==t&&this.chunk[o+2]==e?this.chunk[o+2]=i:this.chunk.push(t,e,i,r),s}parseLine(t){let{line:e,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new wh(e,t?t.state.tabSize:4,t?Le(t.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=vh(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let t=U.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Yd,topID:0,maxBufferLength:2048,reused:this.chunkReused});t=new U(t.type,t.children,t.positions,t.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(t),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new U(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function vh(n,t,e){t.start=t.pos;for(let i=0;i<10;i++){let s=n(t,e);if(t.pos>t.start)return s}throw new Error("Stream parser failed to advance stream.")}const Lr=Object.create(null),Ti=[gt.none],Yd=new Dr(Ti),fl=[],cl=Object.create(null),Ch=Object.create(null);for(let[n,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Ch[n]=Mh(Lr,t);class Ah{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),Ch)}resolve(t){return t?this.table[t]||(this.table[t]=Mh(this.extra,t)):0}}const Xd=new Ah(Lr);function us(n,t){fl.indexOf(n)>-1||(fl.push(n),console.warn(t))}function Mh(n,t){let e=[];for(let l of t.split(" ")){let a=[];for(let f of l.split(".")){let h=n[f]||M[f];h?typeof h=="function"?a.length?a=a.map(h):us(f,`Modifier ${f} used at start of tag`):a.length?us(f,`Tag ${f} used as modifier`):a=Array.isArray(h)?h:[h]:us(f,`Unknown highlighting tag ${f}`)}for(let f of a)e.push(f)}if(!e.length)return 0;let i=t.replace(/ /g,"_"),s=i+" "+e.map(l=>l.id),r=cl[s];if(r)return r.id;let o=cl[s]=gt.define({id:Ti.length,name:i,props:[xd({[i]:e})]});return Ti.push(o),o.id}function _d(n,t){let e=gt.define({id:Ti.length,name:"Document",props:[Ce.add(()=>n),dh.add(()=>i=>t.getIndent(i))],top:!0});return Ti.push(e),e}X.RTL,X.LTR;const Qd=n=>{let{state:t}=n,e=t.doc.lineAt(t.selection.main.from),i=Ir(n.state,e.from);return i.line?Zd(n):i.block?ep(n):!1};function Er(n,t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let s=n(t,e);return s?(i(e.update(s)),!0):!1}}const Zd=Er(sp,0),tp=Er(Dh,0),ep=Er((n,t)=>Dh(n,t,np(t)),0);function Ir(n,t){let e=n.languageDataAt("commentTokens",t,1);return e.length?e[0]:{}}const fi=50;function ip(n,{open:t,close:e},i,s){let r=n.sliceDoc(i-fi,i),o=n.sliceDoc(s,s+fi),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,f=r.length-l;if(r.slice(f-t.length,f)==t&&o.slice(a,a+e.length)==e)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let h,c;s-i<=2*fi?
`:i=="r"?"\r":i=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new Sg(this):new xg(this)}getCursor(t,e=0,i){let s=t.doc?t:H.create({doc:t});return i==null&&(i=s.doc.length),this.regexp?He(this,s,e,i):Ve(this,s,e,i)}}class cf{constructor(t){this.spec=t}}function Ve(n,t,e,i){return new ti(t.doc,n.unquoted,e,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?bg(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function bg(n,t){return(e,i,s,r)=>((r>e||r+s.length<i)&&(r=Math.max(0,e-2),s=n.sliceString(r,Math.min(n.length,i+2))),(t(En(s,e-r))!=J.Word||t(In(s,e-r))!=J.Word)&&(t(In(s,i-r))!=J.Word||t(En(s,i-r))!=J.Word))}class xg extends cf{constructor(t){super(t)}nextMatch(t,e,i){let s=Ve(this.spec,t,i,t.doc.length).nextOverlapping();if(s.done){let r=Math.min(t.doc.length,e+this.spec.unquoted.length);s=Ve(this.spec,t,0,r).nextOverlapping()}return s.done||s.value.from==e&&s.value.to==i?null:s.value}prevMatchInRange(t,e,i){for(let s=i;;){let r=Math.max(e,s-1e4-this.spec.unquoted.length),o=Ve(this.spec,t,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==e)return null;s-=1e4}}prevMatch(t,e,i){let s=this.prevMatchInRange(t,0,e);return s||(s=this.prevMatchInRange(t,Math.max(0,i-this.spec.unquoted.length),t.doc.length)),s&&(s.from!=e||s.to!=i)?s:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,e){let i=Ve(this.spec,t,0,t.doc.length),s=[];for(;!i.next().done;){if(s.length>=e)return null;s.push(i.value)}return s}highlight(t,e,i,s){let r=Ve(this.spec,t,Math.max(0,e-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function He(n,t,e,i){return new af(t.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?wg(t.charCategorizer(t.selection.main.head)):void 0},e,i)}function En(n,t){return n.slice(ot(n,t,!1),t)}function In(n,t){return n.slice(t,ot(n,t))}function wg(n){return(t,e,i)=>!i[0].length||(n(En(i.input,i.index))!=J.Word||n(In(i.input,i.index))!=J.Word)&&(n(In(i.input,i.index+i[0].length))!=J.Word||n(En(i.input,i.index+i[0].length))!=J.Word)}class Sg extends cf{nextMatch(t,e,i){let s=He(this.spec,t,i,t.doc.length).next();return s.done&&(s=He(this.spec,t,0,e).next()),s.done?null:s.value}prevMatchInRange(t,e,i){for(let s=1;;s++){let r=Math.max(e,i-s*1e4),o=He(this.spec,t,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==e||l.from>r+10))return l;if(r==e)return null}}prevMatch(t,e,i){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(e,i)=>{if(i=="&")return t.match[0];if(i=="$")return"$";for(let s=i.length;s>0;s--){let r=+i.slice(0,s);if(r>0&&r<t.match.length)return t.match[r]+i.slice(s)}return e})}matchAll(t,e){let i=He(this.spec,t,0,t.doc.length),s=[];for(;!i.next().done;){if(s.length>=e)return null;s.push(i.value)}return s}highlight(t,e,i,s){let r=He(this.spec,t,Math.max(0,e-250),Math.min(i+250,t.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const Bi=N.define(),Vr=N.define(),ue=mt.define({create(n){return new gs(cr(n).create(),null)},update(n,t){for(let e of t.effects)e.is(Bi)?n=new gs(e.value.create(),n.panel):e.is(Vr)&&(n=new gs(n.query,e.value?Hr:null));return n},provide:n=>Dn.from(n,t=>t.panel)});class gs{constructor(t,e){this.query=t,this.panel=e}}const kg=P.mark({class:"cm-searchMatch"}),vg=P.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Cg=ct.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(ue))}update(n){let t=n.state.field(ue);(t!=n.startState.field(ue)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:n,panel:t}){if(!t||!n.spec.valid)return P.none;let{view:e}=this,i=new Oe;for(let s=0,r=e.visibleRanges,o=r.length;s<o;s++){let{from:l,to:a}=r[s];for(;s<o-1&&a>r[s+1].from-2*250;)a=r[++s].to;n.highlight(e.state,l