SIGN IN SIGN UP
BookStackApp / BookStack UNCLAIMED

A platform to create documentation/wiki content built with PHP & Laravel

0 0 18 PHP
// See the "/licenses" URI for full package license details
var hs=[],_O=[];(()=>{let i="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(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<i.length;e++)(e%2?_O:hs).push(t=t+i[e])})();function Fd(i){if(i<768)return!1;for(let e=0,t=hs.length;;){let n=e+t>>1;if(i<hs[n])t=n;else if(i>=_O[n])e=n+1;else return!0;if(e==t)return!1}}function ZO(i){return i>=127462&&i<=127487}var VO=8205;function zO(i,e,t=!0,n=!0){return(t?CO:Hd)(i,e,n)}function CO(i,e,t){if(e==i.length)return e;e&&qO(i.charCodeAt(e))&&AO(i.charCodeAt(e-1))&&e--;let n=ls(i,e);for(e+=YO(n);e<i.length;){let r=ls(i,e);if(n==VO||r==VO||t&&Fd(r))e+=YO(r),n=r;else if(ZO(r)){let s=0,o=e-2;for(;o>=0&&ZO(ls(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function Hd(i,e,t){for(;e>0;){let n=CO(i,e-2,t);if(n<e)return n;e--}return 0}function ls(i,e){let t=i.charCodeAt(e);if(!AO(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return qO(n)?(t-55296<<10)+(n-56320)+65536:t}function qO(i){return i>=56320&&i<57344}function AO(i){return i>=55296&&i<56320}function YO(i){return i<65536?1:2}var q=class i{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]=gi(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),pi.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=gi(this,e,t);let n=[];return this.decompose(e,t,n,0),pi.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),r=new Nt(this),s=new Nt(e);for(let o=t,a=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new Nt(this,e)}iterRange(e,t=this.length){return new Gn(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Ln(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]?i.empty:e.length<=32?new Ze(e):pi.from(Ze.split(e,[]))}},Ze=class i extends q{constructor(e,t=Kd(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.text[s],a=r+o.length;if((t?n:a)>=e)return new f
`){[e,t]=gi(this,e,t);let r="";for(let s=0,o=0;s<=t&&o<this.text.length;o++){let a=this.text[o],O=s+a.length;s>e&&o&&(r+=n),e<O&&t>s&&(r+=a.slice(Math.max(0,e-s),t-s)),s=O+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let s of e)n.push(s),r+=s.length+1,n.length==32&&(t.push(new i(n,r)),n=[],r=-1);return r>-1&&t.push(new i(n,r)),t}},pi=class i extends q{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,r){for(let s=0;;s++){let o=this.children[s],a=r+o.length,O=n+o.lines-1;if((t?O:a)>=e)return o.lineInner(e,t,n,r);r=a+1,n=O+1}}decompose(e,t,n,r){for(let s=0,o=0;o<=t&&s<this.children.length;s++){let a=this.children[s],O=o+a.length;if(e<=O&&t>=o){let l=r&((o<=e?1:0)|(O>=t?2:0));o>=e&&O<=t&&!l?n.push(a):a.decompose(e-o,t-o,n,l)}o=O+1}}replace(e,t,n){if([e,t]=gi(this,e,t),n.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let o=this.children[r],a=s+o.length;if(e>=s&&t<=a){let O=o.replace(e-s,t-s,n),l=this.lines-o.lines+O.lines;if(O.lines<l>>4&&O.lines>l>>6){let h=this.children.slice();return h[r]=O,new i(h,this.length-(t-e)+n.length)}return super.replace(s,a,O)}s=a+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=`
`){[e,t]=gi(this,e,t);let r="";for(let s=0,o=0;s<this.children.length&&o<=t;s++){let a=this.children[s],O=o+a.length;o>e&&s&&(r+=n),e<O&&t>o&&(r+=a.sliceString(e-o,t-o,n)),o=O+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof i))return 0;let n=0,[r,s,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==o||s==a)return n;let O=this.children[r],l=e.children[s];if(O!=l)return n+O.scanIdentical(l,t);n+=O.length+1}}static from(e,t=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let d of e)n+=d.lines;if(n<32){let d=[];for(let $ of e)$.flatten(d);return new Ze(d,t)}let r=Math.max(32,n>>5),s=r<<1,o=r>>1,a=[],O=0,l=-1,h=[];function c(d){let $;if(d.lines>s&&d instanceof i)for(let p of d.children)c(p);else d.lines>o&&(O>o||!O)?(f(),a.push(d)):d instanceof Ze&&O&&($=h[h.length-1])instanceof Ze&&d.lines+$.lines<=32?(O+=d.lines,l+=d.length+1,h[h.length-1]=new Ze($.text.concat(d.text),$.length+1+d.length)):(O+d.lines>r&&f(),O+=d.lines,l+=d.length+1,h.push(d))}function f(){O!=0&&(a.push(h.length==1?h[0]:i.from(h,l)),l=-1,O=h.length=0)}for(let d of e)c(d);return f(),a.length==1?a[0]:new i(a,t)}};q.empty=new Ze([""],0);function Kd(i){let e=-1;for(let t of i)e+=t.length+1;return e}function En(i,e,t=0,n=1e9){for(let r=0,s=0,o=!0;s<i.length&&r<=n;s++){let a=i[s],O=r+a.length;O>=t&&(O>n&&(a=a.slice(0,n-r)),r<t&&(a=a.slice(t-r)),o?(e[e.length-1]+=a,o=!1):e.push(a)),r=O+1}return e}function WO(i,e,t){return En(i,[""],e,t)}var Nt=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Ze?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],s=this.offsets[n],o=s>>1,a=r instanceof Ze?r.text.length:r.children.length;if(o==(t>0?a: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((s&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(r instanceof Ze){let O=r.text[o+(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=r.children[o+(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 Ze?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)}},Gn=class{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new Nt(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:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.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!=""}},Ln=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=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=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<"u"&&(q.prototype[Symbol.iterator]=function(){return this.iter()},Nt.prototype[Symbol.iterator]=Gn.prototype[Symbol.iterator]=Ln.prototype[Symbol.iterator]=function(){return this});var fs=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function gi(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function le(i,e,t=!0,n=!0){return zO(i,e,t,n)}function Jd(i){return i>=56320&&i<57344}function e$(i){return i>=55296&&i<56320}function xs(i,e){let t=i.charCodeAt(e);if(!e$(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return Jd(n)?(t-55296<<10)+(n-56320)+65536:t}function ks(i){return i<65536?1:2}var us=/\r\n?|\n/,Oe=(function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i})(Oe||(Oe={})),pt=class i{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(n,r,s),r+=s):r+=o,n+=s}}iterChangedRanges(e,t=!1){ds(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];r<0?e.push(n,r):e.push(r,n)}return new i(e)}composeDesc(e){return this.empty?e:e.empty?this:LO(this,e)}mapDesc(e,t=!1){return e.empty?this:$s(this,e,t)}mapPos(e,t=-1,n=Oe.Simple){let r=0,s=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],O=this.sections[o++],l=r+a;if(O<0){if(l>e)return s+(e-r);s+=a}else{if(n!=Oe.Simple&&l>=e&&(n==Oe.TrackDel&&r<e&&l>e||n==Oe.TrackBefore&&r<e||n==Oe.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!a)return e==r||t<0?s:s+O;s+=O}r=l}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let s=this.sections[n++],o=this.sections[n++],a=r+s;if(o>=0&&r<=t&&a>=e)return r<e&&a>t?"cover":!0;r=a}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>type
`}get readOnly(){return this.facet(HO)}phrase(e,...t){for(let n of this.facet(i.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>t.length?n:t[s-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let s of this.facet(DO))for(let o of s(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){return l$(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-n,a=e-n;for(;o>0;){let O=le(t,o,!1);if(s(t.slice(O,o))!=We.Word)break;o=O}for(;a<r;){let O=le(t,a);if(s(t.slice(a,O))!=We.Word)break;a=O}return o==a?null:S.range(o+n,a+n)}};B.allowMultipleSelections=ms;B.tabSize=Z.define({combine:i=>i.length?i[0]:4});B.lineSeparator=BO;B.readOnly=HO;B.phrases=Z.define({compare(i,e){let t=Object.keys(i),n=Object.keys(e);return t.length==n.length&&t.every(r=>i[r]==e[r])}});B.languageData=DO;B.changeFilter=IO;B.transactionFilter=NO;B.transactionExtender=FO;mt.reconfigure=D.define();function Xt(i,e,t={}){let n={};for(let r of i)for(let s of Object.keys(r)){let o=r[s],a=n[s];if(a===void 0)n[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,s))n[s]=t[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let r in e)n[r]===void 0&&(n[r]=e[r]);return n}var Ie=class{eq(e){return this==e}range(e,t=e){return Gi.create(e,t,this)}};Ie.prototype.startSide=Ie.prototype.endSide=0;Ie.prototype.point=!1;Ie.prototype.mapMode=Oe.TrackDel;var Gi=class i{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new i(e,t,n)}};function ys(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}var bs=class i{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let s=n?this.to:this.from;for(let o=r,a=s.length;;){if(o==a)return o;let O=o+a>>1,l=s[O]-e||(n?this.value[O].endSide:this.value[O].startSide)-t;if(O==o)return l>=0?o:a;l>=0?a=O:o=O+1}}between(e,t,n,r){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,s);s<o;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let n=[],r=[],s=[],o=-1,a=-1;for(let O=0;O<this.value.length;O++){let l=this.value[O],h=this.from[O]+e,c=this.to[O]+e,f,d;if(h==c){let $=t.mapPos(h,l.startSide,l.mapMode);if($==null||(f=d=$,l.startSide!=l.endSide&&(d=t.mapPos(h,l.endSide),d<f)))continue}else if(f=t.mapPos(h,l.startSide),d=t.mapPos(c,l.endSide),f>d||f==d&&l.startSide>0&&l.endSide<=0)continue;(d-f||l.endSide-l.startSide)<0||(o<0&&(o=f),l.point&&(a=Math.max(a,d-f)),n.push(l),r.push(f-o),s.push(d-o))}return{mapped:n.length?new i(r,s,n,a):null,pos:o}}},K=class i{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new i(e,t,n,r)}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:r=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(n&&(t=t.slice().sort(ys)),this.isEmpty)return t.length?i.of(t):this;let a=new In(this,null,-1).goto(0),O=0,l=[],h=new Ht;for(;a.value||O<t.length;)if(O<t.length&&(a.from-t[O].from||a.startSide-t[O].value.startSide)>=0){let c=t[O++];h.addInner(c.from,c.to,c.value)||l.push(c)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(O==t.length||this.chunkEnd(a.chunkIndex)<t[O].from)&&(!o||r>this.chunkEnd(a.chunkIndex)||s<this.chunkPos[a.chunkIndex])&&h.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||r>a.to||s<a.from||o(a.from,a.to,a.value))&&(h.addInner(a.from,a.to,a.value)||l.push(Gi.create(a.from,a.to,a.value))),a.next());return h.finishInner(this.nextLayer.isEmpty&&!l.length?i.empty:this.nextLayer.update({add:l,filter:o,filterFrom:r,filt
`)}static newName(){let e=tl[el]||1;return tl[el]=e+1,"\u037C"+e.toString(36)}static mount(e,t,n){let r=e[vs],s=n&&n.nonce;r?s&&r.setNonce(s):r=new Rs(e,s),r.mount(Array.isArray(t)?t:[t],e)}},il=new Map,Rs=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=il.get(n);if(s)return e[vs]=s;this.sheet=new r.CSSStyleSheet,il.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[vs]=this}mount(e,t){let n=this.sheet,r=0,s=0;for(let o=0;o<e.length;o++){let a=e[o],O=this.modules.indexOf(a);if(O<s&&O>-1&&(this.modules.splice(O,1),s--,O=-1),O==-1){if(this.modules.splice(s++,0,a),n)for(let l=0;l<a.rules.length;l++)n.insertRule(a.rules[l],r++)}else{for(;s<O;)r+=this.modules[s++].rules.length;r+=a.rules.length,s++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let o="";for(let O=0;O<this.modules.length;O++)o+=this.modules[O].getRules()+`
`;this.styleTag.textContent=o;let a=t.head||t;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}};var Qt={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:"'"},Si={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},c$=typeof navigator<"u"&&/Mac/.test(navigator.platform),f$=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(re=0;re<10;re++)Qt[48+re]=Qt[96+re]=String(re);var re;for(re=1;re<=24;re++)Qt[re+111]="F"+re;var re;for(re=65;re<=90;re++)Qt[re]=String.fromCharCode(re+32),Si[re]=String.fromCharCode(re);var re;for(Fn in Qt)Si.hasOwnProperty(Fn)||(Si[Fn]=Qt[Fn]);var Fn;function nl(i){var e=c$&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||f$&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?Si:Qt)[i.keyCode]||i.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}var Se=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Cs=typeof document<"u"?document:{documentElement:{style:{}}},qs=/Edge\/(\d+)/.exec(Se.userAgent),Ul=/MSIE \d/.test(Se.userAgent),As=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Se.userAgent),br=!!(Ul||As||qs),rl=!br&&/gecko\/(\d+)/i.test(Se.userAgent),Zs=!br&&/Chrome\/(\d+)/.exec(Se.userAgent),sl="webkitFontSmoothing"in Cs.documentElement.style,Ws=!br&&/Apple Computer/.test(Se.vendor),ol=Ws&&(/Mobile\/\w+/.test(Se.userAgent)||Se.maxTouchPoints>2),X={mac:ol||/Mac/.test(Se.platform),windows:/Win/.test(Se.platform),linux:/Linux|X11/.test(Se.platform),ie:br,ie_version:Ul?Cs.documentMode||6:As?+As[1]:qs?+qs[1]:0,gecko:rl,gecko_version:rl?+(/Firefox\/(\d+)/.exec(Se.userAgent)||[0,0])[1]:0,chrome:!!Zs,chrome_version:Zs?+Zs[1]:0,ios:ol,android:/Android\b/.test(Se.userAgent),webkit:sl,webkit_version:sl?+(/\bAppleWebKit\/(\d+)/.exec(Se.userAgent)||[0,0])[1]:0,safari:Ws,safari_version:Ws?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Se.userAgent)||[0,0])[1]:0,tabSize:Cs.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function nn(i){let e;return i.nodeType==11?e=i.getSelection?i:i.ownerDocument:e=i,e.getSelection()}function Us(i,e){return e?i==e||i.contains(e.nodeType!=1?e.parentNode:e):!1}function sr(i,e){if(!e.anchorNode)return!1;try{return Us(i,e.anchorNode)}catch{return!1}}function rn(i){return i.nodeType==3?ti(i,0,i.nodeValue.length).getClientRects():i.nodeType==1?i.getClientRects():[]}function Ni(i,e,t,n){return t?al(i,e,t,n,-1)||al(i,e,t,n,1):!1}function ei(i){for(var e=0;;e++)if(i=i.previousSibling,!i)return e}function cr(i){return i.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(i.nodeName)}function al(i,e,t,n,r){for(;;){if(i==t&&e==n)return!0;if(e==(r<0?0:lt(i))){if(i.nodeName=="DIV")return!1;let s=i.parentNode;if(!s||s.nodeType!=1)return!1;e=ei(i)+(r<0?0:1),i=s}else if(i.nodeType==1){if(i=i.childNodes[e+(r<0?-1:0)],i.nodeType==1&&i.contentEditable=="false")return!1;e=r<0?lt(i):0}else return!1}}function lt(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function Tr(i,e){let t=e?i.left:i.right;return{left:t,right:t,top:i.top,bottom:i.bottom}}function u$(i){let e=i.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:i.innerWidth,top:0,bottom:i.innerHeight}}function Ml(
`,r=i.state.doc.line(r.number+(t?1:-1)),s=i.bidiSpans(r),l=i.visualLineSide(r,!t)}if(O){if(!O(h))return a}else{if(!n)return l;O=n(h)}a=l}}function B$(i,e,t){let n=i.state.charCategorizer(e),r=n(t);return s=>{let o=n(s);return r==We.Space&&(r=o),r==o}}function I$(i,e,t,n){let r=e.head,s=t?1:-1;if(r==(t?i.state.doc.length:0))return S.cursor(r,e.assoc);let o=e.goalColumn,a,O=i.contentDOM.getBoundingClientRect(),l=i.coordsAtPos(r,e.assoc||-1),h=i.documentTop;if(l)o==null&&(o=l.left-O.left),a=s<0?l.top:l.bottom;else{let d=i.viewState.lineBlockAt(r);o==null&&(o=Math.min(O.right-O.left,i.defaultCharacterWidth*(r-d.from))),a=(s<0?d.top:d.bottom)+h}let c=O.left+o,f=n??i.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let $=a+(f+d)*s,p=Sh(i,{x:c,y:$},!1,s);if($<O.top||$>O.bottom||(s<0?p<r:p>r)){let m=i.docView.coordsForChar(p),Q=!m||$<m.top?-1:1;return S.cursor(p,Q,void 0,o)}}}function Ji(i,e,t){for(;;){let n=0;for(let r of i)r.between(e-1,e+1,(s,o,a)=>{if(e>s&&e<o){let O=n||t||(e-s<o-e?-1:1);e=O<0?s:o,n=O}});if(!n)return e}}function yh(i,e){let t=null;for(let n=0;n<e.ranges.length;n++){let r=e.ranges[n],s=null;if(r.empty){let o=Ji(i,r.from,0);o!=r.from&&(s=S.cursor(o,-1))}else{let o=Ji(i,r.from,-1),a=Ji(i,r.to,1);(o!=r.from||a!=r.to)&&(s=S.range(r.from==r.anchor?o:a,r.from==r.head?o:a))}s&&(t||(t=e.ranges.slice()),t[n]=s)}return t?S.create(t,e.mainIndex):e}function Ys(i,e,t){let n=Ji(i.state.facet(un).map(r=>r(i)),t.from,e.head>t.from?-1:1);return n==t.from?t:S.cursor(n,n<t.from?1:-1)}var Di="\uFFFF",Fs=class{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(B.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Di}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let s=this.text.length;this.readNode(r);let o=r.nextSibling;if(o==t)break;let a=F.get(r),O=F.get(o);(a&&O?a.breakAfter:(a?a.breakAfter:cr(r))||cr(o)&&(r.nodeName!="BR"||r.cmIgnore)&&this.text.length>s)&&!F$(o,t)&&this.lineBreak(),r=o}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(a=r.exec(t))&&(s=a.index,o=a[0].length),this.append(t.slice(n,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let O of this.points)O.node==e&&O.pos>this.text.length&&(O.pos-=o-1);n=s+o}}readNode(e){if(e.cmIgnore)return;let t=F.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let r=n.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(N$(e,n.node,n.offset)?t:0))}};function N$(i,e,t){for(;;){if(!e||t<lt(e))return!1;if(e==i)return!0;t=ei(e)+1,e=e.parentNode}}function F$(i,e){let t;for(;!(i==e||!i);i=i.nextSibling){let n=F.get(i);if(!(n?.isWidget||i.cmIgnore))return!1;n&&(t||(t=[])).push(n)}if(t)for(let n of t){let r=n.overrideDOMText;if(r?.length)return!1}return!0}var pr=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},Hs=class{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let a=s||o?[]:K$(e),O=new Fs(a,e.state);O.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=O.text,this.newSel=J$(a,this.bounds.from)}else{let a=e.observer.selectionRange,O=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!Us(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),l=o&&o.node==a.anchorNode&&o
`&&i.lineWrapping&&(n&&(n=S.single(n.main.anchor-1,n.main.head-1)),t={from:r.from,to:r.to,insert:q.of([" "])}),t)return xo(i,t,n,s);if(n&&!n.main.eq(r)){let o=!1,a="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(o=!0),a=i.inputState.lastSelectionOrigin,a=="select.pointer"&&(n=yh(i.state.facet(un).map(O=>O(i)),n))),i.dispatch({selection:n,scrollIntoView:o,userEvent:a}),!0}else return!1}function xo(i,e,t,n=-1){if(X.ios&&i.inputState.flushIOSKey(e))return!0;let r=i.state.selection.main;if(X.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&i.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Ti(i.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||n==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&Ti(i.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Ti(i.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,a=()=>o||(o=H$(i,e,t));return i.state.facet(Oh).some(O=>O(i,e.from,e.to,s,a))||i.dispatch(a()),!0}function H$(i,e,t){let n,r=i.state,s=r.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let O=e.from<s.from?-1:1,l=O<0?s.from:s.to,h=Ji(r.facet(un).map(c=>c(i)),l,O);e.from==h&&(o=h)}if(o>-1)n={changes:e,selection:S.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&i.inputState.composing<0){let O=s.from<e.from?r.sliceDoc(s.from,e.from):"",l=s.to>e.to?r.sliceDoc(e.to,s.to):"";n=r.replaceSelection(i.state.toText(O+e.insert.sliceString(0,void 0,i.state.lineBreak)+l))}else{let O=r.changes(e),l=t&&t.main.to<=O.newLength?t.main:void 0;if(r.selection.ranges.length>1&&(i.inputState.composing>=0||i.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let h=i.state.sliceDoc(e.from,e.to),c,f=t&&gh(i,t.main.head);if(f){let $=e.insert.length-(e.to-e.from);c={from:f.from,to:f.to-$}}else c=i.state.doc.lineAt(s.head);let d=s.to-e.to;n=r.changeByRange($=>{if($.from==s.from&&$.to==s.to)return{changes:O,range:l||$.map(O)};let p=$.to-d,m=p-h.length;if(i.state.sliceDoc(m,p)!=h||p>=c.from&&m<=c.to)return{range:$};let Q=r.changes({from:m,to:p,insert:e.insert}),g=$.to-s.to;return{changes:Q,range:l?S.range(Math.max(0,l.anchor+g),Math.max(0,l.head+g)):$.map(Q)}})}else n={changes:O,selection:l&&r.selection.replaceRange(l)}}let a="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,a+=".compose",i.inputState.compositionFirstChange&&(a+=".start",i.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:a,scrollIntoView:!0})}function Th(i,e,t,n){let r=Math.min(i.length,e.length),s=0;for(;s<r&&i.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&i.length==e.length)return null;let o=i.length,a=e.length;for(;o>0&&a>0&&i.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(n=="end"){let O=Math.max(0,s-Math.min(o,a));t-=o+O-s}if(o<s&&i.length<e.length){let O=t<=s&&t>=o?s-t:0;s-=O,a=s+(a-o),o=s}else if(a<s){let O=t<=s&&t>=a?s-t:0;s-=O,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function K$(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}=i.observer.selectionRange;return t&&(e.push(new pr(t,n)),(r!=t||s!=n)&&e.push(new pr(r,s))),e}function J$(i,e){if(i.length==0)return null;let t=i[0].pos,n=i.length==2?i[1].pos:t;return t>-1&&n>-1?S.single(t+e,n+e):null}var Ks=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.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.co
`))};if((X.mac||X.android)&&c.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(c={from:a,to:O,insert:q.of([n.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let f=this.to-this.from+(c.to-c.from+c.insert.length);xo(e,c,S.single(this.toEditorPos(n.selectionStart,f),this.toEditorPos(n.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),c.from<c.to&&!c.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],s=null;for(let o=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);o<a;o++){let O=e.coordsForChar(o);s=O&&new DOMRect(O.left,O.top,O.right-O.left,O.bottom-O.top)||s||new DOMRect,r.push(s)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=n=>{let r=[];for(let s of n.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let O=this.toEditorPos(s.rangeStart),l=this.toEditorPos(s.rangeEnd);if(O<l){let h=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;r.push(U.mark({attributes:{style:h}}).range(O,l))}}}e.dispatch({effects:uh.of(U.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let r=nn(n.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,a,O,l)=>{if(n)return;let h=l.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(l)){r=this.pendingContextChange=null,t+=h,this.to+=h;return}else r=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=h,this.to+=h;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+l.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),l.toString()),this.to+=h}t+=h}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n
`&&(t="");else{let n=t.indexOf(`
`);n>-1&&(t=t.slice(0,n))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),n=e+t.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=n||(t=t.slice(0,s-(n-t.length)),r++,r==this.ranges.length))break;let o=this.ranges[r].from,a=this.lineAfter(o);t+=a,n=o+a.length}return{line:t,end:n}}skipGapsTo(e,t,n){for(;;){let r=this.ranges[this.rangeIndex].to,s=e+t;if(n>0?r>s:r>=s)break;let o=this.ranges[++this.rangeIndex].from;t+=o-r}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,n,r){let s=4;if(this.ranges.length>1){r=this.skipGapsTo(t,r,1),t+=r;let a=this.chunk.length;r=this.skipGapsTo(n,r,-1),n+=r,s+=this.chunk.length-a}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=n:this.chunk.push(e,t,n,s),r}parseLine(e){let{line:t,end:n}=this.nextLine(),r=0,{streamParser:s}=this.lang,o=new zr(t,e?e.state.tabSize:4,e?At(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let a=Pc(s.token,o,this.state);if(a&&(r=this.emitToken(this.lang.tokenTable.resolve(a),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=z.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Vm,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new z(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new z(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function Pc(i,e,t){e.start=e.pos;for(let n=0;n<10;n++){let r=i(e,t);if(e.pos>e.start)return r}throw new Error("Stream parser failed to advance stream.")}var na=Object.create(null),gn=[ie.none],Vm=new St(gn),Oc=[],lc=Object.create(null),yc=Object.create(null);for(let[i,e]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"]])yc[i]=bc(na,e);var qr=class{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),yc)}resolve(e){return e?this.table[e]||(this.table[e]=bc(this.extra,e)):0}},Ym=new qr(na);function Do(i,e){Oc.indexOf(i)>-1||(Oc.push(i),console.warn(e))}function bc(i,e){let t=[];for(let a of e.split(" ")){let O=[];for(let l of a.split(".")){let h=i[l]||u[l];h?typeof h=="function"?O.length?O=O.map(h):Do(l,`Modifier ${l} used at start of tag`):O.length?Do(l,`Tag ${l} used as modifier`):O=Array.isArray(h)?h:[h]:Do(l,`Unknown highlighting tag ${l}`)}for(let l of O)t.push(l)}if(!t.length)return 0;let n=e.replace(/ /g,"_"),r=n+" "+t.map(a=>a.id),s=lc[r];if(s)return s.id;let o=lc[r]=ie.define({id:gn.length,name:n,props:[se({[n]:t})]});return gn.push(o),o.id}function _m(i,e){let t=ie.define({id:gn.length,name:"Document",props:[bt.add(()=>i),de.add(()=>n=>e.getIndent(n))],top:!0});return gn.push(t),t}var Vy={rtl:U.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:te.RTL}),ltr:U.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:te.LTR}),auto:U.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var zm=i=>{let{state:e}=i,t=e.doc.lineAt(e.selection.main.from),n=ha(i.state,t.from);return n.line?Cm(i):n.block?Am(i):!1};function la(i,e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=i(e,t);return r?(n(t.update(r)),!0):!1}}var Cm=la(Mm,0);var qm=la(Vc,0);var Am=la((i,e)=>Vc(i,e,Um(e)),0);function ha(i,e){let t=i.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}var yn=50;function Wm(i,{open:e,close:t},n,r){
\${}
} catch (\${error}) {
\${}
}`,{label:"try",detail:"/ catch block",type:"keyword"}),Te("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Te(`if (\${}) {
\${}
} else {
\${}
}`,{label:"if",detail:"/ else block",type:"keyword"}),Te(`class \${name} {
constructor(\${params}) {
\${}
}
}`,{label:"class",detail:"definition",type:"keyword"}),Te('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Te('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],RS=tu.concat([Te("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Te("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Te("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Kf=new wi,iu=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function vn(i){return(e,t)=>{let n=e.node.getChild("VariableDefinition");return n&&t(n,i),!0}}var ZS=["FunctionDeclaration"],VS={FunctionDeclaration:vn("function"),ClassDeclaration:vn("class"),ClassExpression:()=>!0,EnumDeclaration:vn("constant"),TypeAliasDeclaration:vn("type"),NamespaceDeclaration:vn("namespace"),VariableDefinition(i,e){i.matchContext(ZS)||e(i,"variable")},TypeDefinition(i,e){e(i,"type")},__proto__:null};function nu(i,e){let t=Kf.get(e);if(t)return t;let n=[],r=!0;function s(o,a){let O=i.sliceString(o.from,o.to);n.push({label:O,type:a})}return e.cursor(L.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let a=VS[o.name];if(a&&a(o,s)||iu.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of nu(i,o.node))n.push(a);return!1}}),Kf.set(e,n),n}var Jf=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,ru=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function YS(i){let e=G(i.state).resolveInner(i.pos,-1);if(ru.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&Jf.test(i.state.sliceDoc(e.from,e.to));if(!t&&!i.explicit)return null;let n=[];for(let r=e;r;r=r.parent)iu.has(r.name)&&(n=n.concat(nu(i.state.doc,r)));return{options:n,from:t?e.from:i.pos,validFor:Jf}}var tt=ue.define({name:"javascript",parser:jf.configure({props:[de.add({IfStatement:_e({except:/^\s*({|else\b)/}),TryStatement:_e({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:uc,SwitchBody:i=>{let e=i.textAfter,t=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return i.baseIndent+(t?0:n?1:2)*i.unit},Block:Wr({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"TemplateString BlockComment":()=>null,"Statement Property":_e({except:/^\s*{/}),JSXElement(i){let e=/^\s*<\//.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},JSXEscape(i){let e=/\s*\}/.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},"JSXOpenTag JSXSelfClosingTag"(i){return i.column(i.node.from)+i.unit}}),be.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Ut,BlockComment(i){return{from:i.from+2,to:i.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),su={test:i=>/^JSX/.test(i.name),facet:Ri({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Ca=tt.configure({dialect:"ts"},"typescript"),qa=tt.configure({dialect:"jsx",props:[Ar.add(i=>i.isTop?[su]:void 0)]}),Aa=tt.configure({dialect:"jsx ts",props:[Ar.add(i=>i.isTop?[su]:void 0)]},"typescript"),ou=i=>({label:i,type:"keyword"}),au="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(ou),_S=au.concat(["declare","implements","private","protected","public"].map(ou));function hi(i={}){let e=i.jsx?i.typescript?Aa:qa:i.typescript?Ca:tt,t=i.typescript?RS.concat(_S):tu.concat(au);return new oe(e,[tt.data.of({autocomplete:Nf(ru,If(t))}),tt.data.of({autocomplete:YS}),i.jsx?qS:[]])}function zS(i){for(;;){if(i.name=="JSXOpenTag"||i.name=="JSXSelfClosingTag"||i.name=="JSXFragmentTag")return i;if(i.name=="JSXEscape"||!i.parent)return null;
`+t.scrub(),s=this.advance(r);return s>-1&&s<r.length?this.complete(e,n,s):!1}finish(e,t){return(this.stage==2||this.stage==3)&&Vn(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,n){return e.addLeafElement(t,W(b.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(cd(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(W(b.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(ld(e,Vn(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=Vn(e,this.pos),n=0;if(t>this.pos){let r=hd(e,t,this.start);if(r){let s=Ha(e,r.to-this.start);s>0&&(this.nextStage(r),n=s)}}return n||(n=Ha(e,this.pos)),n>0&&n<e.length?n:-1}else return Ha(e,this.pos)}}};function Ha(i,e){for(;e<i.length;e++){let t=i.charCodeAt(e);if(t==10)break;if(!Be(t))return-1}return e}var rO=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:ed(t),s=t.next;if(r<0)return!1;let o=W(b.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,W(s==61?b.SetextHeading1:b.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),o])),!0}finish(){return!1}},rd={LinkReference(i,e){return e.content.charCodeAt(0)==91?new nO(e):null},SetextHeading(){return new rO}},XP=[(i,e)=>Ju(e)>=0,(i,e)=>Fu(e)>=0,(i,e)=>Hu(e)>=0,(i,e)=>uO(e,i,!0)>=0,(i,e)=>dO(e,i,!0)>=0,(i,e)=>fO(e,i,!0)>=0,(i,e)=>nd(e,i,!0)>=0],vP={text:"",end:0},sO=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new eO,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=is.create(b.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new hO(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let n=0;;){let r=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;n<e.markers.length&&(!r||e.markers[n].from<r.end);){let s=e.markers[n++];this.addNode(s.type,s.from,s.to)}if(!r)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let n of this.parser.blockParsers)if(n){let r=n(this,e);if(r!=!1){if(r==!0)return null;e.forward();continue e}}break}let t=new Ja(this.lineStart+e.pos,e.text.slice(e.pos));for(let n of this.parser.leafBlockParsers)if(n){let r=n(this,t);r&&t.parsers.push(r)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break e}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
`+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=fd(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=vP;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let n=this.absoluteLineStart,r=this.rangeI;for(;this.ranges[r].to<t.end;){r++;let s=this.ranges[r].from,o=this.lineChunkAt(s);t.end=s+o.length,t.text=t.text.slice(0,this.ranges[r-1].to-n)+o,n=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let r=this.stack[e.depth],s=this.parser.skipContextMarkup[r.type];if(!s)throw new Error("Unhandled block context "+b[r.type]);if(!s(r,this,e))break;e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
`?"":t;else{let r=t.indexOf(`
`);n=r<0?t:t.slice(0,r)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=is.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e=="number"&&(e=new z(this.parser.nodeSet.types[e],Ai,Ai,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(lO(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?sd(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let n of e.parsers)if(n.finish(this,e))return;let t=lO(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(b.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e=="string"?W(this.parser.getNodeType(e),t,n,r):new rs(e,t)}get buffer(){return new ns(this.parser.nodeSet)}};function sd(i,e,t,n,r){let s=i[e].to,o=[],a=[],O=t.from+n;function l(h,c){for(;c?h>=s:h>s;){let f=i[e+1].from-s;n+=f,h+=f,e++,s=i[e].to}}for(let h=t.firstChild;h;h=h.nextSibling){l(h.from+n,!0);let c=h.from+n,f,d=r.get(h.tree);d?f=d:h.to+n>s?(f=sd(i,e,h,n,r),l(h.to+n,!1)):f=h.toTree(),o.push(f),a.push(c-O)}return l(t.to+n,!1),new z(t.type,o,a,t.to+n-O,t.tree?t.tree.propValues:void 0)}var _n=class i extends yt{constructor(e,t,n,r,s,o,a,O,l){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=a,this.inlineNames=O,this.wrappers=l,this.nodeTypes=Object.create(null);for(let h of e.types)this.nodeTypes[h.name]=h.id}createParse(e,t,n){let r=new sO(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}configure(e){let t=oO(e);if(!t)return this;let{nodeSet:n,skipContextMarkup:r}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),a=this.blockNames.slice(),O=this.inlineParsers.slice(),l=this.inlineNames.slice(),h=this.endLeafBlock.slice(),c=this.wrappers;if(Zn(t.defineNodes)){r=Object.assign({},r);let f=n.types.slice(),d;for(let $ of t.defineNodes){let{name:p,block:m,composite:Q,style:g}=typeof $=="string"?{name:$}:$;if(f.some(y=>y.name==p))continue;Q&&(r[f.length]=(y,x,w)=>Q(x,w,y.value));let P=f.length,k=Q?["Block","BlockContext"]:m?P>=b.ATXHeading1&&P<=b.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;f.push(ie.define({id:P,name:p,props:k&&[[Y.group,k]]})),g&&(d||(d={}),Array.isArray(g)||g instanceof Ye?d[p]=g:Object.assign(d,g))}n=new St(f),d&&(n=n.extend(se(d)))}if(Zn(t.props)&&(n=n.extend(...t.props)),Zn(t.remove))for(let f of t.remove){let d=this.blockNames.indexOf(f),$=this.inlineNames.indexOf(f);d>-1&&(s[d]=o[d]=void 0),$>-1&&(O[$]=void 0)}if(Zn(t.parseBlock))for(let f of t.parseBlock){let d=a.indexOf(f.name);if(d>-1)s[d]=f.parse,o[d]=f.leaf;else{let $=f.before?ts(a,f.before):f.after?ts(a,f.after)+1:a.length-1;s.splice($,0,f.parse),o.splice($,0,f.leaf),a.splice($,0,f.name)}f.endLeaf&&h.push(f.endLeaf)}if(Zn(t.parseInline))for(let f of t.parseInline){let d=l.indexOf(f.name);if(d>-1)O[d]=f.parse;else{let $=f.before?ts(l,f.before):f.after?ts(l,f.after)+1:l.length-1;O.splice($,0,f.parse),l.splice($,0,f.name)}}return t.wrap&&(c=c.concat(t.wrap)),new i(n,s,o,a,h,r,O,l,c)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new OO(this,e,t);e:for(let r=t;r<n.end;){let s=n.char(r);for(let o of this.inlineParsers)if(o){let a=o(n,s,r);if(a>=0){r=a;continue e}}r++}return n.resol
`;)s--;this.fragmentEnd=s?s-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(Y.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,a=e.block.children.length,O=o,l=a;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let h=fd(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,h);else{let c=new z(e.parser.nodeSet.types[b.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(c,t.tree),e.addNode(c,h)}if(t.type.is("Block")&&(ZP.indexOf(t.type.id)<0?(o=t.to-n,a=e.block.children.length):(o=O,a=l,O=t.to-n,l=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>a;)e.block.children.pop(),e.block.positions.pop();return o-s}};function fd(i,e){let t=i;for(let n=1;n<e.length;n++){let r=e[n-1].to,s=e[n].from;r<i&&(t-=s-r)}return t}var VP=se({"Blockquote/...":u.quote,HorizontalRule:u.contentSeparator,"ATXHeading1/... SetextHeading1/...":u.heading1,"ATXHeading2/... SetextHeading2/...":u.heading2,"ATXHeading3/...":u.heading3,"ATXHeading4/...":u.heading4,"ATXHeading5/...":u.heading5,"ATXHeading6/...":u.heading6,"Comment CommentBlock":u.comment,Escape:u.escape,Entity:u.character,"Emphasis/...":u.emphasis,"StrongEmphasis/...":u.strong,"Link/... Image/...":u.link,"OrderedList/... BulletList/...":u.list,"BlockQuote/...":u.quote,"InlineCode CodeText":u.monospace,"URL Autolink":u.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":u.processingInstruction,"CodeInfo LinkLabel":u.labelName,LinkTitle:u.string,Paragraph:u.content}),ud=new _n(new St(od).extend(VP),Object.keys(es).map(i=>es[i]),Object.keys(es).map(i=>rd[i]),Object.keys(es),XP,Nu,Object.keys(Ka).map(i=>Ka[i]),Object.keys(Ka),[]);function YP(i,e,t){let n=[];for(let r=i.firstChild,s=e;;r=r.nextSibling){let o=r?r.from:t;if(o>s&&n.push({from:s,to:o}),!r)break;s=r.to}return n}function dd(i){let{codeParser:e,htmlParser:t}=i;return{wrap:Xi((r,s)=>{let o=r.type.id;if(e&&(o==b.CodeBlock||o==b.FencedCode)){let a="";if(o==b.FencedCode){let l=r.node.getChild(b.CodeInfo);l&&(a=s.read(l.from,l.to))}let O=e(a);if(O)return{parser:O,overlay:l=>l.type.id==b.CodeText}}else if(t&&(o==b.HTMLBlock||o==b.HTMLTag||o==b.CommentBlock))return{parser:t,overlay:YP(r.node,r.from,r.to)};return null})}}var _P={resolve:"Strikethrough",mark:"StrikethroughMark"},zP={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":u.strikethrough}},{name:"StrikethroughMark",style:u.processingInstruction}],parseInline:[{name:"Strikethrough",parse(i,e,t){if(e!=126||i.char(t+1)!=126||i.char(t+2)==126)return-1;let n=i.slice(t-1,t),r=i.slice(t+2,t+3),s=/\s|^$/.test(n),o=/\s|^$/.test(r),a=zn.test(n),O=zn.test(r);return i.addDelimiter(_P,t,t+2,!o&&(!O||s||a),!s&&(!a||o||O))},after:"Emphasis"}]};function Yn(i,e,t=0,n,r=0){let s=0,o=!0,a=-1,O=-1,l=!1,h=()=>{n.push(i.elt("TableCell",r+a,r+O,i.parser.parseInline(e.slice(a,O),r+a)))};for(let c=t;c<e.length;c++){let f=e.charCodeAt(c);f==124&&!l?((!o||a>-1)&&s++,o=!1,n&&(a>-1&&h(),n.push(i.elt("TableDelimiter",c+r,c+r+1))),a=O=-1):(l||f!=32&&f!=9)&&(a<0&&(a=c),O=c+1),l=!l&&f==92}return a>-1&&(s++,n&&h()),s}function Eu(i,e){for(let t=e;t<i.length;t++){let n=i.charCodeAt(t);if(n==124)return!0;n==92&&t++}return!1}var $d=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,ss=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&$d.test(r=t.text.slice(t.pos))){let s=[];Yn(e,n.content,0,s,n.start)==Yn(e,r,t.pos)&&(this.rows=[e.elt("TableHeader",n.start,n.start+n.content.length,s),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let r=[];Yn(e,t.text,t.pos,r,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,r))}return!1}finish(e,t){return
`);let t=i.textContent.trimEnd(),n="";e!==null&&(n=e.className.replace("language-",""));let r=document.createElement("div");i.parentNode.insertBefore(r,i);let s=H1(i);s&&r.setAttribute("dir",s);let o=Wi("content-code-block",{parent:r,doc:t,extensions:$a(r)});new jt(o).setMode(n,t),i.remove(),F1(o)}function IT(i){let e=i.querySelectorAll("pre");for(let t of e)Nd(t)}function NT(){let i=document.querySelectorAll(".page-content pre, .comment-box .content pre");for(let e of i)Nd(e)}function FT(i,e,t,n){let r=Wi("content-code-block",{parent:i,doc:t,extensions:$a(i),root:e}),s=new jt(r);return s.setMode(n,t),s}function HT(i,e){let t=i.textContent,n={parent:i.parentElement,doc:t,extensions:[...Br(i.parentElement)]},r=new jt(Wi("code-editor",n));return r.setMode(e,t),i.style.display="none",r}function KT(i,e){let t=i.value,n={parent:i.parentElement,doc:t,extensions:[...Br(i.parentElement),v.updateListener.of(o=>{o.docChanged&&(i.value=o.state.doc.toString())})]},r=Wi("code-input",n),s=new jt(r);return s.setMode(e,t),i.style.display="none",s}function JT(i,e,t,n){let r=i.textContent,s={parent:i.parentElement,doc:r,extensions:[ct.of(n),...Br(i.parentElement),v.updateListener.of(a=>{e(a)}),v.domEventHandlers(t)]};window.$events.emitPublic(i,"editor-markdown-cm6::pre-init",{editorViewConfig:s});let o=Wi("markdown-editor",s);return new jt(o).setMode("markdown",""),i.style.display="none",o}export{NT as highlight,IT as highlightWithin,KT as inlineEditor,JT as markdownEditor,HT as popupEditor,FT as wysiwygView};
//# sourceMappingURL=code.js.map