@bigbinary/neeto-editor 1.12.6 → 1.12.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +1 -1
  2. package/package.json +1 -1
  3. package/types.d.ts +3 -0
package/index.js CHANGED
@@ -31,7 +31,7 @@ return e.mode.CTRGladman=function(){var t=e.lib.BlockCipherMode.extend();functio
31
31
 
32
32
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
33
  */
34
- return function(t){var n=e,r=n.lib,i=r.WordArray,o=r.Hasher,s=n.algo,a=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),l=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),c=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),d=i.create([0,1518500249,1859775393,2400959708,2840853838]),p=i.create([1352829926,1548603684,1836072691,2053994217,0]),h=s.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,s,h,w,_,x,E,k,M,D,C,S=this._hash.words,N=d.words,A=p.words,O=a.words,T=l.words,I=c.words,L=u.words;for(x=o=S[0],E=s=S[1],k=h=S[2],M=w=S[3],D=_=S[4],n=0;n<80;n+=1)C=o+e[t+O[n]]|0,C+=n<16?f(s,h,w)+N[0]:n<32?m(s,h,w)+N[1]:n<48?g(s,h,w)+N[2]:n<64?b(s,h,w)+N[3]:y(s,h,w)+N[4],C=(C=v(C|=0,I[n]))+_|0,o=_,_=w,w=v(h,10),h=s,s=C,C=x+e[t+T[n]]|0,C+=n<16?y(E,k,M)+A[0]:n<32?b(E,k,M)+A[1]:n<48?g(E,k,M)+A[2]:n<64?m(E,k,M)+A[3]:f(E,k,M)+A[4],C=(C=v(C|=0,L[n]))+D|0,x=D,D=M,M=v(k,10),k=E,E=C;C=S[1]+h+M|0,S[1]=S[2]+w+D|0,S[2]=S[3]+_+x|0,S[3]=S[4]+o+E|0,S[4]=S[0]+s+k|0,S[0]=C},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32,t[(r+64>>>9<<4)+14]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,s=0;s<5;s++){var a=o[s];o[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function f(e,t,n){return e^t^n}function m(e,t,n){return e&t|~e&n}function g(e,t,n){return(e|~t)^n}function b(e,t,n){return e&n|t&~n}function y(e,t,n){return e^(t|~n)}function v(e,t){return e<<t|e>>>32-t}n.RIPEMD160=o._createHelper(h),n.HmacRIPEMD160=o._createHmacHelper(h)}(),e.RIPEMD160}(uu())),Yu(),Qu||(Qu=1,Ju.exports=function(e){return function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,o=t.algo,s=o.SHA1,a=o.HMAC,l=o.PBKDF2=r.extend({cfg:r.extend({keySize:128/32,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=a.create(n.hasher,e),o=i.create(),s=i.create([1]),l=o.words,c=s.words,u=n.keySize,d=n.iterations;l.length<u;){var p=r.update(t).finalize(s);r.reset();for(var h=p.words,f=h.length,m=p,g=1;g<d;g++){m=r.finalize(m),r.reset();for(var b=m.words,y=0;y<f;y++)h[y]^=b[y]}o.concat(p),c[0]++}return o.sigBytes=4*u,o}});t.PBKDF2=function(e,t,n){return l.create(n).compute(e,t)}}(),e.PBKDF2}(uu(),Ou(),Yu())),ed(),rd(),sd(),cd(),pd(),md(),gd||(gd=1,bd.exports=function(e){return e.mode.ECB=((t=e.lib.BlockCipherMode.extend()).Encryptor=t.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),t.Decryptor=t.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),t),e.mode.ECB;var t}(uu(),rd())),yd||(yd=1,vd.exports=function(e){return e.pad.AnsiX923={pad:function(e,t){var n=e.sigBytes,r=4*t,i=r-n%r,o=n+i-1;e.clamp(),e.words[o>>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923}(uu(),rd())),wd||(wd=1,_d.exports=function(e){return e.pad.Iso10126={pad:function(t,n){var r=4*n,i=r-t.sigBytes%r;t.concat(e.lib.WordArray.random(i-1)).concat(e.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Iso10126}(uu(),rd())),xd||(xd=1,Ed.exports=function(e){return e.pad.Iso97971={pad:function(t,n){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,n)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971}(uu(),rd())),kd||(kd=1,Md.exports=function(e){return e.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},e.pad.ZeroPadding}(uu(),rd())),Dd||(Dd=1,Cd.exports=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding}(uu(),rd())),Sd||(Sd=1,Nd.exports=function(e){return function(t){var n=e,r=n.lib.CipherParams,i=n.enc.Hex;n.format.Hex={stringify:function(e){return e.ciphertext.toString(i)},parse:function(e){var t=i.parse(e);return r.create({ciphertext:t})}}}(),e.format.Hex}(uu(),rd())),Ad||(Ad=1,Od.exports=function(e){return function(){var t=e,n=t.lib.BlockCipher,r=t.algo,i=[],o=[],s=[],a=[],l=[],c=[],u=[],d=[],p=[],h=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var f=r^r<<1^r<<2^r<<3^r<<4;f=f>>>8^255&f^99,i[n]=f,o[f]=n;var m=e[n],g=e[m],b=e[g],y=257*e[f]^16843008*f;s[n]=y<<24|y>>>8,a[n]=y<<16|y>>>16,l[n]=y<<8|y>>>24,c[n]=y,y=16843009*b^65537*g^257*m^16843008*n,u[f]=y<<24|y>>>8,d[f]=y<<16|y>>>16,p[f]=y<<8|y>>>24,h[f]=y,n?(n=m^e[e[e[b^m]]],r^=e[e[r]]):n=r=1}}();var f=[0,1,2,4,8,16,32,64,128,27,54],m=r.AES=n.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),o=this._keySchedule=[],s=0;s<r;s++)s<n?o[s]=t[s]:(c=o[s-1],s%n?n>6&&s%n==4&&(c=i[c>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c]):(c=i[(c=c<<8|c>>>24)>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c],c^=f[s/n|0]<<24),o[s]=o[s-n]^c);for(var a=this._invKeySchedule=[],l=0;l<r;l++){if(s=r-l,l%4)var c=o[s];else c=o[s-4];a[l]=l<4||s<=4?c:u[i[c>>>24]]^d[i[c>>>16&255]]^p[i[c>>>8&255]]^h[i[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,l,c,i)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,d,p,h,o),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,o,s,a){for(var l=this._nRounds,c=e[t]^n[0],u=e[t+1]^n[1],d=e[t+2]^n[2],p=e[t+3]^n[3],h=4,f=1;f<l;f++){var m=r[c>>>24]^i[u>>>16&255]^o[d>>>8&255]^s[255&p]^n[h++],g=r[u>>>24]^i[d>>>16&255]^o[p>>>8&255]^s[255&c]^n[h++],b=r[d>>>24]^i[p>>>16&255]^o[c>>>8&255]^s[255&u]^n[h++],y=r[p>>>24]^i[c>>>16&255]^o[u>>>8&255]^s[255&d]^n[h++];c=m,u=g,d=b,p=y}m=(a[c>>>24]<<24|a[u>>>16&255]<<16|a[d>>>8&255]<<8|a[255&p])^n[h++],g=(a[u>>>24]<<24|a[d>>>16&255]<<16|a[p>>>8&255]<<8|a[255&c])^n[h++],b=(a[d>>>24]<<24|a[p>>>16&255]<<16|a[c>>>8&255]<<8|a[255&u])^n[h++],y=(a[p>>>24]<<24|a[c>>>16&255]<<16|a[u>>>8&255]<<8|a[255&d])^n[h++],e[t]=m,e[t+1]=g,e[t+2]=b,e[t+3]=y},keySize:256/32});t.AES=n._createHelper(m)}(),e.AES}(uu(),xu(),Su(),ed(),rd())),Ld(),Fd||(Fd=1,zd.exports=function(e){return function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=r.RC4=n.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[],i=0;i<256;i++)r[i]=i;i=0;for(var o=0;i<256;i++){var s=i%n,a=t[s>>>2]>>>24-s%4*8&255;o=(o+r[i]+a)%256;var l=r[i];r[i]=r[o],r[o]=l}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:256/32,ivSize:0});function o(){for(var e=this._S,t=this._i,n=this._j,r=0,i=0;i<4;i++){n=(n+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[n],e[n]=o,r|=e[(e[t]+e[n])%256]<<24-8*i}return this._i=t,this._j=n,r}t.RC4=n._createHelper(i);var s=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});t.RC4Drop=n._createHelper(s)}(),e.RC4}(uu(),xu(),Su(),ed(),rd())),jd||(jd=1,Rd.exports=function(e){return function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=[],o=[],s=[],a=r.Rabbit=n.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)l.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var o=t.words,s=o[0],a=o[1],c=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),d=c>>>16|4294901760&u,p=u<<16|65535&c;for(i[0]^=c,i[1]^=d,i[2]^=u,i[3]^=p,i[4]^=c,i[5]^=d,i[6]^=u,i[7]^=p,n=0;n<4;n++)l.call(this)}},_doProcessBlock:function(e,t){var n=this._X;l.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),e[t+r]^=i[r]},blockSize:128/32,ivSize:64/32});function l(){for(var e=this._X,t=this._C,n=0;n<8;n++)o[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],i=65535&r,a=r>>>16,l=((i*i>>>17)+i*a>>>15)+a*a,c=((4294901760&r)*r|0)+((65535&r)*r|0);s[n]=l^c}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}t.Rabbit=n._createHelper(a)}(),e.Rabbit}(uu(),xu(),Su(),ed(),rd())),Bd||(Bd=1,Pd.exports=function(e){return function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=[],o=[],s=[],a=r.RabbitLegacy=n.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)l.call(this);for(i=0;i<8;i++)r[i]^=n[i+4&7];if(t){var o=t.words,s=o[0],a=o[1],c=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),d=c>>>16|4294901760&u,p=u<<16|65535&c;for(r[0]^=c,r[1]^=d,r[2]^=u,r[3]^=p,r[4]^=c,r[5]^=d,r[6]^=u,r[7]^=p,i=0;i<4;i++)l.call(this)}},_doProcessBlock:function(e,t){var n=this._X;l.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),e[t+r]^=i[r]},blockSize:128/32,ivSize:64/32});function l(){for(var e=this._X,t=this._C,n=0;n<8;n++)o[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],i=65535&r,a=r>>>16,l=((i*i>>>17)+i*a>>>15)+a*a,c=((4294901760&r)*r|0)+((65535&r)*r|0);s[n]=l^c}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}t.RabbitLegacy=n._createHelper(a)}(),e.RabbitLegacy}(uu(),xu(),Su(),ed(),rd())));const Hd=async e=>{const t=await(e=>new Promise(((t,n)=>{const r=new FileReader;r.onload=e=>{const n=Ud.lib.WordArray.create(e.target.result);t(Ud.MD5(n))},r.onerror=()=>n(new Error("Corrupted file")),r.readAsArrayBuffer(e)})))(e);return t.toString(Ud.enc.Base64)};class $d{constructor(e){let{url:t,file:n,progress:r=se}=e;tu(this,"create",(async()=>{const e=await this.generateUrl(),{url:t,headers:n}=e.directUpload;return await this.uploadToCloud(t,n),e})),tu(this,"generateUrl",(async()=>{const e={blob:{filename:this.file.name,byteSize:this.file.size,contentType:this.file.type,checksum:await Hd(this.file)}};return nu(this.url,e)})),tu(this,"abort",(()=>this.abortController.abort())),tu(this,"uploadToCloud",((e,t)=>{const n={headers:t,onUploadProgress:this.progress,signal:this.abortController.signal};return ru(e,this.file,n)})),this.url=t,this.file=n,this.progress=r,this.abortController=new AbortController}}class Wd extends et.exports.BasePlugin{constructor(t,n){super(t,n),tu(this,"upload",(t=>{if(e(t))return Promise.resolve();const n=t.map((e=>this.uploadFile(this.uppy.getFile(e))));return Promise.all(n)})),tu(this,"uploadFile",(async t=>{this.uppy.on("file-removed",(r=>{r.id===t.id&&(n.abort(),e(this.uppy.getFiles())&&this.uppy.emit("complete"))})),this.uppy.on("upload-cancel",(e=>{e===t.id&&n.abort()})),this.uppy.on("cancel-all",(()=>n.abort()));const n=new $d({file:t.data,url:this.opts.directUploadUrl,progress:e=>{e.lengthComputable&&this.uppy.emit("upload-progress",t,{uploader:this,bytesUploaded:e.loaded,bytesTotal:e.total,progress:Math.round(e.loaded/e.total*100)})}});try{const e=await n.create();return this.uppy.setFileState(t.id,{response:{status:"success"}}),this.uppy.emit("upload-success",t,e),t}catch(e){if(!this.uppy.getFile(t.id))return null;throw this.uppy.setFileState(t.id,{response:{status:"error"}}),this.uppy.emit("upload-error",t,e),e}})),this.type="uploader",this.id=n.id||"ActiveStorageUpload",this.title=n.title||"Active Storage Upload"}install(){this.uppy.addUploader(this.upload)}uninstall(){this.uppy.removeUploader(this.upload)}}const Vd=e=>{let{endpoint:t,uppyConfig:n,onSuccess:r=(e=>{})}=e;const[o,s]=i(!1),a=e=>{const{maxFileSize:t}=n.restrictions;return!(e.size>t)||(h.error(`File size is too large. Max size is ${Zc(n.restrictions.maxFileSize)}.`),!1)},l=function(e){if("function"!=typeof e)throw new TypeError("useUppy: expected a function that returns a new Uppy instance");const t=Vc(void 0);if(void 0===t.current&&(t.current=e(),!(t.current instanceof qc)))throw new TypeError(`useUppy: factory function must return an Uppy instance, got ${typeof t.current}`);return Wc((()=>()=>{t.current.close({reason:"unmount"}),t.current=void 0}),[t]),t.current}((()=>new Rr({...n,onBeforeFileAdded:a}).use(Wd,{directUploadUrl:t,...Qc}).on("upload",(()=>s(!0))).on("upload-success",((e,t)=>{let{blobUrl:n}=t;return null==r?void 0:r(n)})).on("cancel-all",(()=>s(!1))).on("complete",(()=>{l.reset(),s(!1)}))));return{uppy:l,isUploading:o}};var qd={exports:{}};!function(e,t){!function(){function t(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}function n(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){a(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function i(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var o="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof Ee&&Ee.global===Ee?Ee:void 0,s=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=o.saveAs||("object"!=typeof window||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(e,t,s){var a=o.URL||o.webkitURL,l=document.createElement("a");t=t||e.name||"download",l.download=t,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?i(l):r(l.href)?n(e,t,s):i(l,l.target="_blank")):(l.href=a.createObjectURL(e),setTimeout((function(){a.revokeObjectURL(l.href)}),4e4),setTimeout((function(){i(l)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,o,s){if(o=o||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(t(e,s),o);else if(r(e))n(e,o,s);else{var a=document.createElement("a");a.href=e,a.target="_blank",setTimeout((function(){i(a)}))}}:function(e,t,r,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof e)return n(e,t,r);var a="application/octet-stream"===e.type,l=/constructor/i.test(o.HTMLElement)||o.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||a&&l||s)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=c?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=e:location=e,i=null},u.readAsDataURL(e)}else{var d=o.URL||o.webkitURL,p=d.createObjectURL(e);i?i.location=p:location.href=p,i=null,setTimeout((function(){d.revokeObjectURL(p)}),4e4)}});o.saveAs=a.saveAs=a,e.exports=a}()}(qd);var Kd=qd.exports;const Gd={autoProceed:!1,allowMultipleUploads:!1,restrictions:{maxFileSize:100*1024*1024}},Yd="Download",Qd="Rename",Jd="Delete";function Zd(){return Zd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zd.apply(this,arguments)}var Xd={grad:.9,turn:360,rad:360/(2*Math.PI)},ep=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},tp=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},np=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},rp=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},ip=function(e){return{r:np(e.r,0,255),g:np(e.g,0,255),b:np(e.b,0,255),a:np(e.a)}},op=function(e){return{r:tp(e.r),g:tp(e.g),b:tp(e.b),a:tp(e.a,3)}},sp=/^#([0-9a-f]{3,8})$/i,ap=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},lp=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),s=o-Math.min(t,n,r),a=s?o===t?(n-r)/s:o===n?2+(r-t)/s:4+(t-n)/s:0;return{h:60*(a<0?a+6:a),s:o?s/o*100:0,v:o/255*100,a:i}},cp=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),s=r*(1-n),a=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),c=o%6;return{r:255*[r,a,s,s,l,r][c],g:255*[l,r,r,a,s,s][c],b:255*[s,s,l,r,r,a][c],a:i}},up=function(e){return{h:rp(e.h),s:np(e.s,0,100),l:np(e.l,0,100),a:np(e.a)}},dp=function(e){return{h:tp(e.h),s:tp(e.s),l:tp(e.l),a:tp(e.a,3)}},pp=function(e){return cp((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},hp=function(e){return{h:(t=lp(e)).h,s:(i=(200-(n=t.s))*(r=t.v)/100)>0&&i<200?n*r/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,n,r,i},fp=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,mp=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,bp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,yp={string:[[function(e){var t=sp.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?tp(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?tp(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=gp.exec(e)||bp.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:ip({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=fp.exec(e)||mp.exec(e);if(!t)return null;var n,r,i=up({h:(n=t[1],r=t[2],void 0===r&&(r="deg"),Number(n)*(Xd[r]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return pp(i)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=void 0===i?1:i;return ep(t)&&ep(n)&&ep(r)?ip({r:Number(t),g:Number(n),b:Number(r),a:Number(o)}):null},"rgb"],[function(e){var t=e.h,n=e.s,r=e.l,i=e.a,o=void 0===i?1:i;if(!ep(t)||!ep(n)||!ep(r))return null;var s=up({h:Number(t),s:Number(n),l:Number(r),a:Number(o)});return pp(s)},"hsl"],[function(e){var t=e.h,n=e.s,r=e.v,i=e.a,o=void 0===i?1:i;if(!ep(t)||!ep(n)||!ep(r))return null;var s=function(e){return{h:rp(e.h),s:np(e.s,0,100),v:np(e.v,0,100),a:np(e.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(o)});return cp(s)},"hsv"]]},vp=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0](e);if(r)return[r,t[n][1]]}return[null,void 0]},wp=function(e,t){var n=hp(e);return{h:n.h,s:np(n.s+100*t,0,100),l:n.l,a:n.a}},_p=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},xp=function(e,t){var n=hp(e);return{h:n.h,s:n.s,l:np(n.l+100*t,0,100),a:n.a}},Ep=function(){function e(e){this.parsed=function(e){return"string"==typeof e?vp(e.trim(),yp.string):"object"==typeof e&&null!==e?vp(e,yp.object):[null,void 0]}(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return tp(_p(this.rgba),2)},e.prototype.isDark=function(){return _p(this.rgba)<.5},e.prototype.isLight=function(){return _p(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=op(this.rgba)).r,n=e.g,r=e.b,o=(i=e.a)<1?ap(tp(255*i)):"","#"+ap(t)+ap(n)+ap(r)+o;var e,t,n,r,i,o},e.prototype.toRgb=function(){return op(this.rgba)},e.prototype.toRgbString=function(){return t=(e=op(this.rgba)).r,n=e.g,r=e.b,(i=e.a)<1?"rgba("+t+", "+n+", "+r+", "+i+")":"rgb("+t+", "+n+", "+r+")";var e,t,n,r,i},e.prototype.toHsl=function(){return dp(hp(this.rgba))},e.prototype.toHslString=function(){return t=(e=dp(hp(this.rgba))).h,n=e.s,r=e.l,(i=e.a)<1?"hsla("+t+", "+n+"%, "+r+"%, "+i+")":"hsl("+t+", "+n+"%, "+r+"%)";var e,t,n,r,i},e.prototype.toHsv=function(){return e=lp(this.rgba),{h:tp(e.h),s:tp(e.s),v:tp(e.v),a:tp(e.a,3)};var e},e.prototype.invert=function(){return kp({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),kp(wp(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),kp(wp(this.rgba,-e))},e.prototype.grayscale=function(){return kp(wp(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),kp(xp(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),kp(xp(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?kp({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):tp(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=hp(this.rgba);return"number"==typeof e?kp({h:e,s:t.s,l:t.l,a:t.a}):tp(t.h)},e.prototype.isEqual=function(e){return this.toHex()===kp(e).toHex()},e}(),kp=function(e){return e instanceof Ep?e:new Ep(e)},Mp=[];var Dp=1/0,Cp="[object Symbol]",Sp="object"==typeof Ee&&Ee&&Ee.Object===Object&&Ee,Np="object"==typeof self&&self&&self.Object===Object&&self,Ap=Sp||Np||Function("return this")(),Op=Object.prototype,Tp=0,Ip=Op.toString,Lp=Ap.Symbol,Fp=Lp?Lp.prototype:void 0,zp=Fp?Fp.toString:void 0;function jp(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&Ip.call(e)==Cp}(e))return zp?zp.call(e):"";var t=e+"";return"0"==t&&1/e==-Dp?"-0":t}var Rp=function(e){var t,n=++Tp;return(null==(t=e)?"":jp(t))+n},Bp={"3d":r.createElement("path",{d:"M18 14.625V3.375L9 0 0 3.375v11.25L9 18l9-3.375zM9 2.136l5.918 2.22-5.98 2.242-5.919-2.22L9 2.137zM2 13.239V5.065l6.438 2.414v8.174L2 13.24zM9.438 15.7L16 13.239V5.018l-6.563 2.46V15.7z",transform:"translate(15 10)",fillRule:"evenodd"}),acrobat:r.createElement("path",{d:"M10.15 1.095C9.938.33 9.42-.051 8.984.005c-.528.068-1.09.382-1.314.876-.63 1.416.685 5.582.887 6.279-1.28 3.863-5.66 11.5-7.806 12.017-.045-.505.225-1.965 3.055-3.785.146-.157.315-.348.393-.472-2.392 1.168-5.492 3.044-3.628 4.448.102.079.259.146.439.213 1.426.528 3.425-1.201 5.435-5.121 2.213-.73 3.999-1.28 6.526-1.662 2.762 1.875 4.616 2.257 5.874 1.774.348-.135.898-.573 1.055-1.145-1.022 1.258-3.414.382-5.323-.82 1.763-.191 3.582-.303 4.369-.056 1 .314.965.808.954.876.079-.27.191-.708-.022-1.056-.842-1.37-4.706-.573-6.11-.427-2.212-1.336-3.74-3.717-4.358-5.436.573-2.212 1.19-3.818.742-5.413zm-.954 4.638C8.826 4.42 8.309 1.5 9.14.556c1.628.932.618 3.144.056 5.177zm3.044 6.514c-2.134.393-3.583.944-5.66 1.764.617-1.202 1.785-4.268 2.346-6.29.787 1.573 1.741 3.111 3.314 4.526z",transform:"translate(14 9)",fillRule:"evenodd"}),audio:r.createElement("path",{d:"M.25 4.75v4.5h3L7 13V1L3.25 4.75h-3zM10.375 7A3.375 3.375 0 0 0 8.5 3.977v6.037A3.355 3.355 0 0 0 10.375 7zM8.5.421v1.545A5.254 5.254 0 0 1 12.25 7a5.254 5.254 0 0 1-3.75 5.032v1.545A6.747 6.747 0 0 0 13.75 7 6.747 6.747 0 0 0 8.5.421z",transform:"translate(17 12)",fillRule:"evenodd"}),binary:r.createElement("path",{d:"M2.338 6.112c1.192 0 1.928-1.072 1.928-2.68 0-1.56-.576-2.504-1.8-2.504C1.274.928.538 2 .538 3.608c0 1.56.576 2.504 1.8 2.504zM1.61 3.408c0-1.008.24-1.568.776-1.568.376 0 .616.336.728.888l-1.504.776v-.096zM2.418 5.2c-.368 0-.608-.32-.72-.856l1.496-.768v.056c0 1.008-.24 1.568-.776 1.568zm7.03.8l.088-.944H8.36V.896L7.272.984v.592l-1.184.112.024.824h1.16v2.544h-1.32V6zm5.199 0l.088-.944h-1.176V.896L12.47.984v.592l-1.184.112.024.824h1.16v2.544h-1.32V6zM4.25 14l.088-.944H3.162v-4.16l-1.088.088v.592L.89 9.688l.024.824h1.16v2.544H.754V14zm5.198 0l.088-.944H8.36v-4.16l-1.088.088v.592l-1.184.112.024.824h1.16v2.544h-1.32V14zm3.287.112c1.192 0 1.928-1.072 1.928-2.68 0-1.56-.576-2.504-1.8-2.504-1.192 0-1.928 1.072-1.928 2.68 0 1.56.576 2.504 1.8 2.504zm-.728-2.704c0-1.008.24-1.568.776-1.568.376 0 .616.336.728.888l-1.504.776v-.096zm.808 1.792c-.368 0-.608-.32-.72-.856l1.496-.768v.056c0 1.008-.24 1.568-.776 1.568z",transform:"translate(16 11)",fillRule:"evenodd"}),code:r.createElement("path",{d:"M4.078 13.67c-1.875-.527-2.812-1.738-2.812-3.634V9.49C1.266 8.437.844 7.911 0 7.911V6.138c.844 0 1.266-.529 1.266-1.586v-.64c.015-.938.257-1.696.726-2.274C2.466 1.06 3.162.64 4.078.38l.492 1.375c-.656.25-.997.95-1.023 2.102v.695c0 1.167-.482 1.99-1.445 2.469.963.479 1.445 1.304 1.445 2.476v.688c.026 1.15.367 1.851 1.023 2.101l-.492 1.383zm7.844 0c1.875-.527 2.812-1.738 2.812-3.634V9.49c0-1.052.422-1.578 1.266-1.578V6.138c-.844 0-1.266-.529-1.266-1.586v-.64c-.015-.938-.257-1.696-.726-2.274-.474-.578-1.17-.998-2.086-1.258l-.492 1.375c.656.25.997.95 1.023 2.102v.695c0 1.167.482 1.99 1.445 2.469-.963.479-1.445 1.304-1.445 2.476v.688c-.026 1.15-.367 1.851-1.023 2.101l.492 1.383z",transform:"translate(16 13)",fillRule:"evenodd"}),code2:r.createElement("path",{d:"M7.4 10.6L2.8 6l4.6-4.6L6 0 0 6l6 6 1.4-1.4zm5.2 0L17.2 6l-4.6-4.6L14 0l6 6-6 6-1.4-1.4z",transform:"translate(14 14)",fillRule:"evenodd"}),compressed:r.createElement("path",{d:"M.25 0A.25.25 0 0 0 0 .25v1.5c0 .138.112.25.25.25h1.5A.25.25 0 0 0 2 1.75V.25A.25.25 0 0 0 1.75 0H.25zM1 17a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1H1zm0 4v3h2v-3H1zM2 2.25A.25.25 0 0 1 2.25 2h1.5a.25.25 0 0 1 .25.25v1.5a.25.25 0 0 1-.25.25h-1.5A.25.25 0 0 1 2 3.75v-1.5zM.25 4a.25.25 0 0 0-.25.25v1.5c0 .138.112.25.25.25h1.5A.25.25 0 0 0 2 5.75v-1.5A.25.25 0 0 0 1.75 4H.25zM2 6.25A.25.25 0 0 1 2.25 6h1.5a.25.25 0 0 1 .25.25v1.5a.25.25 0 0 1-.25.25h-1.5A.25.25 0 0 1 2 7.75v-1.5zM.25 8a.25.25 0 0 0-.25.25v1.5c0 .138.112.25.25.25h1.5A.25.25 0 0 0 2 9.75v-1.5A.25.25 0 0 0 1.75 8H.25zM2 10.25a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25v1.5a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25v-1.5zM.25 12a.25.25 0 0 0-.25.25v1.5c0 .138.112.25.25.25h1.5a.25.25 0 0 0 .25-.25v-1.5a.25.25 0 0 0-.25-.25H.25zM2 14.25a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25v1.5a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25v-1.5z",transform:"translate(15 1)",fillRule:"evenodd"}),document:r.createElement("path",{d:"M12 4H0v2h12V4zM0 10h18V8H0v2zM0 0v2h18V0H0z",transform:"translate(15 15)",fillRule:"evenodd"}),drive:r.createElement("path",{d:"M2.199.289A.5.5 0 0 1 2.652 0h8.696a.5.5 0 0 1 .453.289l1.867 4a.5.5 0 0 1-.453.711H.785a.5.5 0 0 1-.453-.711l1.867-4zM13 6H1a.752.752 0 0 0-.75.75v4.5c0 .412.338.75.75.75h12c.412 0 .75-.338.75-.75v-4.5A.752.752 0 0 0 13 6zm-9.75 4.5c-.825 0-1.5-.675-1.5-1.5s.675-1.5 1.5-1.5 1.5.675 1.5 1.5-.675 1.5-1.5 1.5z",transform:"translate(17 13)",fillRule:"evenodd"}),font:r.createElement("path",{d:"M3.722 8.702l-.686 1.89c-.053.14-.094.28-.123.421-.03.135-.044.252-.044.352 0 .304.097.527.29.668.2.14.501.21.905.21h.414V13H.083v-.756h.343c.176 0 .325-.018.448-.053a.81.81 0 0 0 .334-.22c.1-.105.193-.249.281-.43.094-.182.197-.416.308-.704L5.787.15h1.406l4.07 11.136c.07.187.14.343.21.466.077.123.165.222.264.298.1.07.214.12.343.15.129.03.281.044.457.044h.237V13H7.826v-.756h.413c.72 0 1.081-.287 1.081-.862 0-.1-.014-.202-.044-.307a3.274 3.274 0 0 0-.105-.36l-.72-2.013H3.72zM7.009 4.65c-.188-.533-.36-1.031-.519-1.494a15.92 15.92 0 0 1-.378-1.354 7.12 7.12 0 0 1-.15.633 16.95 16.95 0 0 1-.395 1.283c-.082.229-.175.484-.28.765L4.063 7.796h4.061L7.009 4.65zm8.411 5.74c0 .562.117.984.351 1.265.24.275.61.413 1.108.413.363 0 .691-.059.984-.176.3-.117.551-.284.756-.5.211-.218.372-.481.483-.792.112-.31.168-.656.168-1.037V8.104l-1.152.053c-.51.023-.937.088-1.283.193-.34.1-.615.243-.826.43a1.546 1.546 0 0 0-.457.678c-.088.27-.132.58-.132.931zm2.18-6.32c-.346 0-.627.05-.844.15a1.182 1.182 0 0 0-.501.404 1.594 1.594 0 0 0-.237.624c-.041.24-.062.5-.062.782-.498 0-.879-.085-1.143-.255-.257-.17-.386-.463-.386-.879 0-.31.085-.574.255-.79.17-.218.401-.393.694-.528.299-.14.644-.243 1.037-.308a7.76 7.76 0 0 1 1.257-.097c.55 0 1.031.056 1.441.167.41.106.753.282 1.029.528.275.246.48.568.615.967.14.392.21.876.21 1.45v4.667c0 .252.021.46.062.624a.928.928 0 0 0 .194.395c.088.1.202.17.343.211.146.041.319.062.518.062h.053V13H19.7l-.281-1.547h-.15c-.187.252-.369.483-.544.694-.176.211-.37.393-.58.545-.211.152-.452.27-.721.352a3.053 3.053 0 0 1-.958.131c-.399 0-.77-.058-1.116-.175a2.369 2.369 0 0 1-.888-.519 2.516 2.516 0 0 1-.58-.896c-.14-.364-.211-.791-.211-1.284 0-.955.34-1.664 1.02-2.127.68-.462 1.707-.714 3.084-.755l1.495-.053V6.285a6.93 6.93 0 0 0-.053-.888 1.778 1.778 0 0 0-.229-.703 1.14 1.14 0 0 0-.51-.457c-.216-.111-.51-.167-.878-.167z",transform:"translate(13 12)",fillRule:"evenodd"}),image:r.createElement("path",{d:"M13 0L9.25 5l2.85 3.8-1.6 1.2C8.81 7.75 6 4 6 4l-6 8h22L13 0z",transform:"translate(13 14)",fillRule:"evenodd"}),presentation:r.createElement("path",{d:"M2 4H0v10c0 1.1.9 2 2 2h14v-2H2V4zm16-4H6C4.9 0 4 .9 4 2v8c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V2c0-1.1-.9-2-2-2zm0 10H6V2h12v8z",transform:"matrix(-1 0 0 1 34 12)",fillRule:"evenodd"}),settings:r.createElement("path",{d:"M13.572 8.735c.03-.24.053-.48.053-.735s-.023-.495-.053-.735l1.583-1.237a.378.378 0 0 0 .09-.48l-1.5-2.595a.377.377 0 0 0-.457-.165l-1.868.75a5.48 5.48 0 0 0-1.268-.735L9.868.815A.366.366 0 0 0 9.5.5h-3a.366.366 0 0 0-.367.315l-.285 1.988a5.762 5.762 0 0 0-1.268.735l-1.868-.75a.366.366 0 0 0-.457.165l-1.5 2.595a.37.37 0 0 0 .09.48l1.583 1.237c-.03.24-.053.488-.053.735 0 .248.022.495.053.735L.845 9.973a.378.378 0 0 0-.09.48l1.5 2.595c.09.165.292.225.458.165l1.867-.75c.39.3.81.547 1.268.735l.285 1.987c.022.18.18.315.367.315h3a.366.366 0 0 0 .367-.315l.285-1.988a5.762 5.762 0 0 0 1.268-.734l1.867.75c.173.067.368 0 .458-.165l1.5-2.595a.378.378 0 0 0-.09-.48l-1.582-1.238zM8 10.625A2.628 2.628 0 0 1 5.375 8 2.628 2.628 0 0 1 8 5.375 2.628 2.628 0 0 1 10.625 8 2.628 2.628 0 0 1 8 10.625z",transform:"translate(16 11)",fillRule:"evenodd"}),spreadsheet:r.createElement("path",{d:"M0 8h6V5H0v3zm0 5h6v-3H0v3zM0 3h6V0H0v3zm8 5h12V5H8v3zm0 5h12v-3H8v3zM8 0v3h12V0H8z",transform:"translate(14 14)",fillRule:"evenodd"}),vector:r.createElement("path",{d:"M14.5 2V1a1 1 0 0 0-1-1h-3a1 1 0 0 0-1 1v1H3.937a2 2 0 1 0 0 1h3.936A9 9 0 0 0 3 11v1h2v-1a7.003 7.003 0 0 1 4.594-6.576A1 1 0 0 0 10.5 5h3a1 1 0 0 0 .906-.576A7.003 7.003 0 0 1 19 11v1h2v-1a9 9 0 0 0-4.873-8h3.936a2 2 0 1 0 0-1H14.5zm-1-1h-3v3h3V1zM2 1.5a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm19 1a1 1 0 1 0 2 0 1 1 0 0 0-2 0z",transform:"translate(12 14)",fillRule:"evenodd"}),video:r.createElement("path",{d:"M10.75 3.875V1.25A.752.752 0 0 0 10 .5H1a.752.752 0 0 0-.75.75v7.5c0 .412.338.75.75.75h9c.412 0 .75-.338.75-.75V6.125l3 3V.875l-3 3z",transform:"translate(17 14)"})};!function(e){e.forEach((function(e){Mp.indexOf(e)<0&&(e(Ep,yp),Mp.push(e))}))}([function(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var i in n)r[n[i]]=i;var o={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var i,s,a=r[this.toHex()];if(a)return a;if(null==t?void 0:t.closest){var l=this.toRgb(),c=1/0,u="black";if(!o.length)for(var d in n)o[d]=new e(n[d]).toRgb();for(var p in n){var h=(i=l,s=o[p],Math.pow(i.r-s.r,2)+Math.pow(i.g-s.g,2)+Math.pow(i.b-s.b,2));h<c&&(c=h,u=p)}return u}},t.string.push([function(t){var r=t.toLowerCase(),i="transparent"===r?"#0000":n[r];return i?new e(i).toRgb():null},"name"])}]);var Pp={color:yl.exports.string,extension:yl.exports.string,fold:yl.exports.bool,foldColor:yl.exports.string,glyphColor:yl.exports.string,gradientColor:yl.exports.string,gradientOpacity:yl.exports.number,labelColor:yl.exports.string,labelTextColor:yl.exports.string,labelUppercase:yl.exports.bool,radius:yl.exports.number,type:yl.exports.oneOf(["3d","acrobat","audio","binary","code","code2","compressed","document","drive","font","image","presentation","settings","spreadsheet","vector","video"])},Up=40,Hp=48,$p={WIDTH:Up,HEIGHT:Hp,X_OFFSET:0},Wp=12,Vp=14,qp=function(e){var t=e.color,n=void 0===t?"whitesmoke":t,i=e.extension,o=e.fold,s=void 0===o||o,a=e.foldColor,l=e.glyphColor,c=e.gradientColor,u=void 0===c?"white":c,d=e.gradientOpacity,p=void 0===d?.25:d,h=e.labelColor,f=e.labelTextColor,m=void 0===f?"white":f,g=e.labelUppercase,b=void 0!==g&&g,y=e.radius,v=void 0===y?4:y,w=e.type,_=Rp();return r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 "+Up+" "+Hp,width:"100%",style:{maxWidth:"100%"}},r.createElement("defs",null,r.createElement("clipPath",{id:"pageRadius"+_},r.createElement("rect",{x:$p.X_OFFSET,y:"0",rx:v,ry:v,width:$p.WIDTH,height:$p.HEIGHT})),r.createElement("clipPath",{id:"foldCrop"},r.createElement("rect",{width:$p.WIDTH,height:Wp,transform:"rotate(-45 0 "+Wp+")"})),r.createElement("linearGradient",{x1:"100%",y1:"0%",y2:"100%",id:"pageGradient"+_},r.createElement("stop",{stopColor:u,stopOpacity:p,offset:"0%"}),r.createElement("stop",{stopColor:u,stopOpacity:"0",offset:"66.67%"}))),r.createElement("g",{id:"file",clipPath:"url(#pageRadius"+_+")"},s?r.createElement(r.Fragment,null,r.createElement("path",{d:"M"+$p.X_OFFSET+" 0 h "+($p.WIDTH-Wp)+" L "+($p.WIDTH+$p.X_OFFSET)+" "+Wp+" v "+($p.HEIGHT-Wp)+" H "+$p.X_OFFSET+" Z",fill:n}),r.createElement("path",{d:"M"+$p.X_OFFSET+" 0 h "+($p.WIDTH-Wp)+" L "+($p.WIDTH+$p.X_OFFSET)+" "+Wp+" v "+($p.HEIGHT-Wp)+" H "+$p.X_OFFSET+" Z",fill:"url(#pageGradient"+_+")"})):r.createElement(r.Fragment,null,r.createElement("rect",{x:$p.X_OFFSET,y:"0",width:$p.WIDTH,height:$p.HEIGHT,fill:n}),r.createElement("rect",{x:$p.X_OFFSET,y:"0",width:$p.WIDTH,height:$p.HEIGHT,fill:"url(#pageGradient"+_+")"}))),s&&r.createElement("g",{transform:"translate(28 "+Wp+") rotate(-90)"},r.createElement("rect",{width:$p.WIDTH,height:$p.HEIGHT,fill:a||kp(n).darken(.1).toHex(),rx:v,ry:v,clipPath:"url(#foldCrop)"})),i&&r.createElement(r.Fragment,null,r.createElement("g",{id:"label"},r.createElement("rect",{fill:h||kp(n).darken(.3).toHex(),x:$p.X_OFFSET,y:$p.HEIGHT-Vp,width:$p.WIDTH,height:Vp,clipPath:"url(#pageRadius"+_+")"})),r.createElement("g",{id:"labelText",transform:"translate("+$p.X_OFFSET+" 34)"},r.createElement("text",{x:$p.WIDTH/2,y:"10",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontSize:"9",fill:m,textAnchor:"middle",style:{fontWeight:"bold",textAlign:"center",pointerEvents:"none",textTransform:b?"uppercase":"none",userSelect:"none"}},i))),w&&r.createElement("g",{transform:"translate(-4 "+(i?0:6)+")",fill:l||kp(n).darken(.15).toHex()},Bp[w]))};qp.propTypes=Pp;var Kp={"3dm":{labelColor:"#8D1A11",type:"3d"},"3ds":{labelColor:"#5FB9AD",type:"3d"},"3g2":{type:"video"},"3gp":{type:"video"},"7zip":{type:"compressed"},aac:{type:"audio"},aep:{type:"video"},ai:{color:"#423325",gradientOpacity:0,labelColor:"#423325",labelTextColor:"#FF7F18",labelUppercase:!0,foldColor:"#FF7F18",radius:2},aif:{type:"audio"},aiff:{type:"audio"},asf:{type:"video"},asp:{type:"code"},aspx:{type:"code"},avi:{type:"video"},bin:{type:"binary"},bmp:{type:"image"},c:{type:"code"},cpp:{type:"code"},cs:{type:"code"},css:{type:"code"},csv:{type:"spreadsheet"},cue:{type:"document"},dll:{type:"settings"},dmg:{type:"drive"},doc:{color:"#2C5898",foldColor:"#254A80",glyphColor:"rgba(255,255,255,0.4)",labelColor:"#2C5898",labelUppercase:!0,type:"document"},docx:{color:"#2C5898",foldColor:"#254A80",glyphColor:"rgba(255,255,255,0.4)",labelColor:"#2C5898",labelUppercase:!0,type:"document"},dwg:{type:"vector"},dxf:{type:"vector"},eot:{type:"font"},eps:{type:"vector"},exe:{type:"settings"},flac:{type:"audio"},flv:{type:"video"},fnt:{type:"font"},fodp:{type:"presentation"},fods:{type:"spreadsheet"},fodt:{type:"document"},fon:{type:"font"},gif:{type:"image"},gz:{type:"compressed"},htm:{type:"code"},html:{type:"code"},indd:{color:"#4B2B36",gradientOpacity:0,labelColor:"#4B2B36",labelTextColor:"#FF408C",labelUppercase:!0,foldColor:"#FF408C",radius:2},ini:{type:"settings"},java:{type:"code"},jpeg:{type:"image"},jpg:{type:"image"},js:{labelColor:"#F7DF1E",type:"code"},json:{type:"code"},jsx:{labelColor:"#00D8FF",type:"code"},m4a:{type:"audio"},m4v:{type:"video"},max:{labelColor:"#5FB9AD",type:"3d"},md:{type:"document"},mid:{type:"audio"},mkv:{type:"video"},mov:{type:"video"},mp3:{type:"audio"},mp4:{type:"video"},mpeg:{type:"video"},mpg:{type:"video"},obj:{type:"3d"},odp:{type:"presentation"},ods:{type:"spreadsheet"},odt:{type:"document"},ogg:{type:"audio"},ogv:{type:"video"},otf:{type:"font"},pdf:{labelColor:"#D93831",type:"acrobat"},php:{labelColor:"#8892BE",type:"code"},pkg:{type:"3d"},plist:{type:"settings"},png:{type:"image"},ppt:{color:"#D14423",foldColor:"#AB381D",glyphColor:"rgba(255,255,255,0.4)",labelColor:"#D14423",labelUppercase:!0,type:"presentation"},pptx:{color:"#D14423",foldColor:"#AB381D",glyphColor:"rgba(255,255,255,0.4)",labelColor:"#D14423",labelUppercase:!0,type:"presentation"},pr:{type:"video"},ps:{type:"vector"},psd:{color:"#34364E",gradientOpacity:0,labelColor:"#34364E",labelTextColor:"#31C5F0",labelUppercase:!0,foldColor:"#31C5F0",radius:2},py:{labelColor:"#FFDE57",type:"code"},rar:{type:"compressed"},rb:{labelColor:"#BB271A",type:"code"},rm:{type:"video"},rtf:{type:"document"},scss:{labelColor:"#C16A98",type:"code"},sitx:{type:"compressed"},svg:{type:"vector"},swf:{type:"video"},sys:{type:"settings"},tar:{type:"compressed"},tex:{type:"document"},tif:{type:"image"},tiff:{type:"image"},ts:{labelColor:"#3478C7",type:"code"},ttf:{type:"font"},txt:{type:"document"},wav:{type:"audio"},webm:{type:"video"},wmv:{type:"video"},woff:{type:"font"},wpd:{type:"document"},wps:{type:"document"},xlr:{type:"spreadsheet"},xls:{color:"#1A754C",foldColor:"#16613F",glyphColor:"rgba(255,255,255,0.4)",labelColor:"#1A754C",labelUppercase:!0,type:"spreadsheet"},xlsx:{color:"#1A754C",foldColor:"#16613F",glyphColor:"rgba(255,255,255,0.4)",labelColor:"#1A754C",labelUppercase:!0,type:"spreadsheet"},yml:{type:"code"},zip:{type:"compressed"},zipx:{type:"compressed"}};const Gp=e=>{let{fileName:t}=e;const n=t.match(/([^.]+)$/)[1];return r.createElement("div",{className:"ne-attachments__attachment-file-icon"},r.createElement(qp,Zd({},Kp[n],{extension:n})))},{Menu:Yp,MenuItem:Qp}=y,Jp=t=>{let{attachment:n,endpoint:o,onChange:s,attachments:a}=t;const[l,c]=i(!1),[u,d]=i(!1),[p,w]=i(!1),[_,x]=i(""),E=async()=>{w(!0);try{const{signedId:e}=n;await ou(o,e),s(a.filter((t=>t.signedId!==e)))}catch(e){h.error(e)}},k={[Yd]:()=>{Kd(n.url,n.fileName)},[Qd]:async()=>{try{const{signedId:e}=n,t={blob:{filename:_}},{blob:{filename:r}}=await iu(o,e,t);s(a.map((t=>t.signedId===e?ce("filename",r,t):t)))}catch(e){h.error(e)}finally{c(!1),x("")}},[Jd]:E};return r.createElement(r.Fragment,null,r.createElement("div",{className:"ne-attachments__attachment"},l?r.createElement(r.Fragment,null,r.createElement(f,{content:_,position:"top"},r.createElement(m,{autoFocus:!0,error:e(_)?"Filename cannot be empty":"",value:_,onChange:e=>x(e.target.value),onKeyDown:t=>(t=>{let{event:n,key:r}=t;const i=k[r];"Enter"===n.key&&i&&!e(_)&&i(),"Escape"===n.key&&(c(!1),x(""))})({event:t,key:Qd})})),r.createElement(g,{icon:N,size:"small",style:"text",onClick:()=>c(!1)})):r.createElement(r.Fragment,null,r.createElement(Gp,{fileName:n.filename}),r.createElement(f,{content:n.filename,position:"top"},r.createElement(b,{style:"body2"},n.filename)),r.createElement(y,{buttonStyle:"text",icon:A},r.createElement(Yp,null,Object.entries(k).map((e=>{let[t,i]=e;return r.createElement(Qp.Button,{key:t,onClick:()=>(e=>{let{key:t,handler:r}=e;t===Qd?(c(!0),x(n.filename)):t===Jd?(x(n.filename),d(!0)):r()})({key:t,handler:i})},t)})))))),r.createElement(v,{isOpen:u,isSubmitting:p,message:`Are you sure you want to remove ${_}?`,title:"Remove Attachment?",onClose:()=>d(!1),onSubmit:E}))},Zp=e=>{let{attachment:t,uppy:n,removeUploadingFile:i}=e;const o=`${t.progress}%`;return r.createElement("div",{className:"ne-attachments__attachment"},r.createElement(O,{className:"ne-attachments__attachment__progress-icon",size:16}),r.createElement("div",{className:"ne-attachments__attachment__progress"},r.createElement(b,{style:"body2"},t.filename),r.createElement(b,{style:"body2"},o)),r.createElement(g,{icon:N,size:"small",style:"text",onClick:()=>{n.removeFile(t.id),i(t.id)}}))},Xp=(e,n)=>{let{endpoint:l=Ye,attachments:c=[],className:u="",onChange:d=(e=>{}),isIndependent:p=!0,dragDropRef:f=null}=e;const[m,b]=i([]),y=o(null),{uppy:v,isUploading:w}=Vd({endpoint:l,uppyConfig:Gd}),_=()=>{const e=v.getFiles().map((e=>({id:e.id,filename:e.name,signedId:"awaiting",url:"",progress:0})));b((t=>[...t,...e])),y.current.value=null,x()},x=async()=>{try{const e=await v.upload();if(t(e))return;const n=e.successful.map((e=>({filename:e.name,signedId:e.response.signedId,url:e.response.blobUrl})));b([]),d([...c,...n])}catch(e){h.error(e)}},E=(e,t)=>{b((n=>n.map((n=>({...n,progress:n.filename!==e.name?n.progress:t.progress})))))},k=e=>{b((t=>t.filter((t=>t.id!==e))))},M=()=>y.current.click();return s(n,(()=>({handleUploadAttachments:M})),[]),a((()=>(v.on("upload-progress",E),null!=f&&f.current&&v.use($e,{target:f.current,onDrop:_}),()=>{v.off("upload-progress",E)})),[]),r.createElement("div",{className:qe("ne-attachments",{[u]:u})},r.createElement("div",{className:"ne-attachments__items"},c.map((e=>r.createElement(Jp,{attachment:e,attachments:c,endpoint:l,key:e.signedId,onChange:d}))),m.map((e=>r.createElement(Zp,{attachment:e,key:e.id,removeUploadingFile:k,uppy:v})))),r.createElement("div",null,p&&r.createElement(g,{disabled:w,label:"Add attachments",loading:w,size:"medium",style:"link",onClick:M}),r.createElement("input",{multiple:!0,disabled:w,ref:y,type:"file",onChange:e=>{Array.from(e.target.files).forEach((e=>{v.addFile({name:e.name,type:e.type,data:e})})),_()}})))};var eh=r.forwardRef(Xp);function th(e){this.content=e}function nh(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let e=0;i.text[e]==o.text[e];e++)n++;return n}if(i.content.size||o.content.size){let e=nh(i.content,o.content,n+1);if(null!=e)return e}n+=i.nodeSize}else n+=i.nodeSize}}function rh(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let s=e.child(--i),a=t.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e<t&&s.text[s.text.length-e-1]==a.text[a.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let e=rh(s.content,a.content,n-1,r-1);if(e)return e}n-=l,r-=l}else n-=l,r-=l}}th.prototype={constructor:th,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return-1==i?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new th(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new th(n)},addToStart:function(e,t){return new th([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new th(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(-1==o?i.length:o,0,t,n),new th(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=th.from(e)).size?new th(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=th.from(e)).size?new th(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=th.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach((function(t,n){e[t]=n})),e},get size(){return this.content.length>>1}},th.from=function(e){if(e instanceof th)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new th(t)};class ih{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,((s,a)=>{s.isText?(i+=s.text.slice(Math.max(e,a)-a,t-a),o=!n):s.isLeaf?(r?i+="function"==typeof r?r(s):r:s.type.spec.leafText&&(i+=s.type.spec.leafText(s)),o=!n):!o&&s.isBlock&&(i+=n,o=!0)}),0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new ih(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,o=0;o<t;i++){let s=this.content[i],a=o+s.nodeSize;a>e&&((o<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=a}return new ih(n,r)}cutByIndex(e,t){return e==t?ih.empty:0==e&&t==this.content.length?this:new ih(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new ih(r,i)}addToStart(e){return new ih([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ih(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return nh(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return rh(this,e,t,n)}findIndex(e,t=-1){if(0==e)return sh(0,e);if(e==this.size)return sh(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?sh(n+1,i):sh(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return ih.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new ih(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ih.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new ih(t||e,n)}static from(e){if(!e)return ih.empty;if(e instanceof ih)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new ih([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}ih.empty=new ih([],0);const oh={index:0,offset:0};function sh(e,t){return oh.index=e,oh.offset=t,oh}function ah(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!ah(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!ah(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class lh{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ah(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return lh.none;if(e instanceof lh)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}}lh.none=[];class ch extends Error{}class uh{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=ph(this.content,e+this.openStart,t);return n&&new uh(n,this.openStart,this.openEnd)}removeBetween(e,t){return new uh(dh(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return uh.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new uh(ih.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new uh(e,n,r)}}function dh(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(dh(o.content,t-i-1,n-i-1)))}function ph(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=ph(s.content,t-o-1,n);return a&&e.replaceChild(i,s.copy(a))}function hh(e,t,n){if(n.openStart>e.depth)throw new ch("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ch("Inconsistent open depths");return fh(e,t,n,0)}function fh(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let s=fh(e,t,n,r+1);return o.copy(o.content.replaceChild(i,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:i,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(ih.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return vh(o,wh(e,i,s,t,r))}{let r=e.parent,i=r.content;return vh(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}}return vh(o,_h(e,t,r))}function mh(e,t){if(!t.type.compatibleContent(e.type))throw new ch("Cannot join "+t.type.name+" onto "+e.type.name)}function gh(e,t,n){let r=e.node(n);return mh(r,t.node(n)),r}function bh(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function yh(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(bh(e.nodeAfter,r),o++));for(let e=o;e<s;e++)bh(i.child(e),r);t&&t.depth==n&&t.textOffset&&bh(t.nodeBefore,r)}function vh(e,t){if(!e.type.validContent(t))throw new ch("Invalid content for node "+e.type.name);return e.copy(t)}function wh(e,t,n,r,i){let o=e.depth>i&&gh(e,t,i+1),s=r.depth>i&&gh(n,r,i+1),a=[];return yh(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(mh(o,s),bh(vh(o,wh(e,t,n,r,i+1)),a)):(o&&bh(vh(o,_h(e,t,i+1)),a),yh(t,n,i,a),s&&bh(vh(s,_h(n,r,i+1)),a)),yh(r,null,i,a),new ih(a)}function _h(e,t,n){let r=[];if(yh(null,e,n,r),e.depth>n){bh(vh(gh(e,t,n+1),_h(e,t,n+1)),r)}return yh(t,null,n,r),new ih(r)}uh.empty=new uh(ih.empty,0,0);class xh{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return lh.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Dh(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(i),s=i-o;if(n.push(t,e,r+o),!s)break;if(t=t.child(e),t.isText)break;i=s-1,r+=o+1}return new xh(t,n,i)}static resolveCached(e,t){for(let n=0;n<Eh.length;n++){let r=Eh[n];if(r.pos==t&&r.doc==e)return r}let n=Eh[kh]=xh.resolve(e,t);return kh=(kh+1)%Mh,n}}let Eh=[],kh=0,Mh=12;class Dh{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Ch=Object.create(null);class Sh{constructor(e,t,n,r=lh.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||ih.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&ah(this.attrs,t||e.defaultAttrs||Ch)&&lh.sameSet(this.marks,n||lh.none)}copy(e=null){return e==this.content?this:new Sh(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Sh(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return uh.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o),a=r.node(o).content.cut(r.pos-s,i.pos-s);return new uh(a,r.depth-o,i.depth-o)}replace(e,t,n){return hh(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return xh.resolveCached(this,e)}resolveNoCache(e){return xh.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Ah(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=ih.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){if(!this.type.validContent(this.content))throw new RangeError(`Invalid content for node ${this.type.name}: ${this.content.toString().slice(0,50)}`);let e=lh.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!lh.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e=>e.type.name))}`);this.content.forEach((e=>e.check()))}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=ih.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}Sh.prototype.text=void 0;class Nh extends Sh{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ah(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Nh(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Nh(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Ah(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Oh{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new Th(e,t);if(null==n.next)return Oh.empty;let r=Ih(n);n.next&&n.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return n(Bh(e,0));function n(r){let i=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Bh(e,n).forEach((e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let o=t[r.join(",")]=new Oh(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Rh);o.next.push({type:i[e][0],next:t[r.join(",")]||n(r)})}return o}}(function(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach((e=>e.to=t))}function o(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(o(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),i(o(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return i(o(e.expr,t),s),i(o(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(o(e.expr,t));if("range"==e.type){let s=t;for(let t=0;t<e.min;t++){let t=n();i(o(e.expr,s),t),s=t}if(-1==e.max)i(o(e.expr,s),s);else for(let t=e.min;t<e.max;t++){let t=n();r(s,t),i(o(e.expr,s),t),s=t}return[r(s)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=o(e.exprs[r],t);if(r==e.exprs.length-1)return s;i(s,t=n())}}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),!i||n.isText||n.hasRequiredAttrs()||(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,n),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function i(o,s){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return ih.from(s.map((e=>e.createAndFill())));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=i(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map(((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r})).join("\n")}}Oh.empty=new Oh(!0);class Th{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Ih(e){let t=[];do{t.push(Lh(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function Lh(e){let t=[];do{t.push(Fh(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Fh(e){let t=function(e){if(e.eat("(")){let t=Ih(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.groups.indexOf(t)>-1&&i.push(r)}0==i.length&&e.err("No node type or group '"+t+"' found");return i}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=jh(e,t)}return t}function zh(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function jh(e,t){let n=zh(e),r=n;return e.eat(",")&&(r="}"!=e.next?zh(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function Rh(e,t){return t-e}function Bh(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(Rh)}function Ph(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Uh(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=t.default}n[r]=i}return n}function Hh(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new Wh(e[n]);return t}class $h{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=Hh(n.attrs),this.defaultAttrs=Ph(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Oh.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Uh(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Sh(this,this.computeAttrs(e),ih.from(t),lh.setFrom(n))}createChecked(e=null,t,n){if(t=ih.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new Sh(this,this.computeAttrs(e),t,lh.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=ih.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(ih.empty,!0);return i?new Sh(this,e,t.append(i),lh.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:lh.none:e}static compile(e,t){let n=Object.create(null);e.forEach(((e,r)=>n[e]=new $h(e,t,r)));let r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class Wh{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Vh{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Hh(r.attrs),this.excluded=null;let i=Ph(this.attrs);this.instance=i?new lh(this,i):null}create(e=null){return!e&&this.instance?this.instance:new lh(this,Uh(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,i)=>n[e]=new Vh(e,r++,t,i))),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class qh{constructor(e){this.cached=Object.create(null),this.spec={nodes:th.from(e.nodes),marks:th.from(e.marks||{}),topNode:e.topNode},this.nodes=$h.compile(this.spec.nodes,this),this.marks=Vh.compile(this.spec.marks,this);let t=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new RangeError(e+" can not be both a node and a mark");let n=this.nodes[e],r=n.spec.content||"",i=n.spec.marks;n.contentMatch=t[r]||(t[r]=Oh.parse(r,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.markSet="_"==i?null:i?Kh(this,i.split(" ")):""!=i&&n.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:Kh(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof $h))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Nh(n,n.defaultAttrs,e,lh.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Sh.fromJSON(this,e)}markFromJSON(e){return lh.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Kh(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Gh{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((e=>{e.tag?this.tags.push(e):e.style&&this.styles.push(e)})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e,t={}){let n=new rf(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new rf(this,t,!0);return n.addAll(e,t.from,t.to),uh.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(of(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(!(0!=o.indexOf(e)||r.context&&!n.matchesContext(r.context)||o.length>e.length&&(61!=o.charCodeAt(e.length)||o.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach((e=>{n(e=sf(e)),e.mark=t}))}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach((e=>{n(e=sf(e)),e.node=t}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Gh(e,Gh.schemaRules(e)))}}const Yh={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Qh={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Jh={ol:!0,ul:!0},Zh=1,Xh=2,ef=4;function tf(e,t,n){return null!=t?(t?Zh:0)|("full"===t?Xh:0):e&&"pre"==e.whitespace?Zh|Xh:n&~ef}class nf{constructor(e,t,n,r,i,o,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=lh.none,this.stashMarks=[],this.match=o||(s&ef?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(ih.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Zh)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=ih.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(ih.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t<n.length;t++){let r=n[t];(this.type?this.type.allowsMarkType(r.type):af(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Yh.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class rf{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,i=t.topNode,o=tf(null,t.preserveWhitespace,0)|(n?ef:0);r=i?new nf(i.type,i.attrs,lh.none,lh.none,!0,t.topMatch||i.type.contentMatch,o):new nf(n?null:e.schema.topNodeType,null,lh.none,lh.none,!0,null,o),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){let t=e.getAttribute("style"),n=t?this.readStyles(function(e){let t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t)):null,r=this.top;if(null!=n)for(let e=0;e<n.length;e++)this.addPendingMark(n[e]);if(this.addElement(e),null!=n)for(let e=0;e<n.length;e++)this.removePendingMark(n[e],r)}}addTextNode(e){let t=e.nodeValue,n=this.top;if(n.options&Xh||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(n.options&Zh)t=n.options&Xh?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],i=e.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let n,r=e.nodeName.toLowerCase();Jh.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&Jh.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(i?i.ignore:Qh.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let t,n=this.top,o=this.needsBlock;if(Yh.hasOwnProperty(r))t=!0,n.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),t&&this.sync(n),this.needsBlock=o}else this.addElementByRule(e,i,!1===i.consuming?n:void 0)}leafFallback(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}ignoreFallback(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=lh.none;e:for(let n=0;n<e.length;n+=2)for(let r;;){let i=this.parser.matchStyle(e[n],e[n+1],this,r);if(!i)continue e;if(i.ignore)return null;if(t=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(t),!1!==i.consuming)break;r=i}return t}addElementByRule(e,t,n){let r,i,o;if(t.node)i=this.parser.schema.nodes[t.node],i.isLeaf?this.insertNode(i.create(t.attrs))||this.leafFallback(e):r=this.enter(i,t.attrs||null,t.preserveWhitespace);else{o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o)}let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e)));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(e,t,n){let r=t||0;for(let i=t?e.childNodes[t]:e.firstChild,o=null==n?null:e.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=i,!o.length))break;if(i.solid)break}if(!t)return!1;this.sync(n);for(let e=0;e<t.length;e++)this.enterInner(t[e],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let n=t.activeMarks;for(let r=0;r<e.marks.length;r++)t.type&&!t.type.allowsMarkType(e.marks[r].type)||(n=e.marks[r].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}enterInner(e,t=null,n=!1,r){this.closeExtra();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let o=tf(e,r,i.options);i.options&ef&&0==i.content.length&&(o|=ef),this.nodes.push(new nf(e,t,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)){t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}addPendingMark(e){let t=function(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function of(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function sf(e){let t={};for(let n in e)t[n]=e[n];return t}function af(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t)return!0;if(o.indexOf(i)<0&&s(i))return!0}};if(s(i.contentMatch))return!0}}class lf{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=uf(t).createDocumentFragment());let r=n,i=[];return e.forEach((e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(this.marks[t.type.name]){if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}else o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=lf.renderSpec(uf(t),this.nodes[e.type.name](e));if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&lf.renderSpec(uf(n),r(e,t))}static renderSpec(e,t,n=null){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,i=t[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?e.createElementNS(n,i):e.createElement(i),a=t[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let e in a)if(null!=a[e]){let t=e.indexOf(" ");t>0?s.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):s.setAttribute(e,a[e])}}for(let i=l;i<t.length;i++){let o=t[i];if(0===o){if(i<t.length-1||i>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:i}=lf.renderSpec(e,o,n);if(s.appendChild(t),i){if(r)throw new RangeError("Multiple content holes");r=i}}}return{dom:s,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new lf(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=cf(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return cf(e.marks)}}function cf(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function uf(e){return e.document||window.document}const df=65535,pf=Math.pow(2,16);function hf(e,t){return e+t*pf}function ff(e){return e&df}const mf=1,gf=2,bf=4,yf=8;class vf{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&yf)>0}get deletedBefore(){return(this.delInfo&(mf|bf))>0}get deletedAfter(){return(this.delInfo&(gf|bf))>0}get deletedAcross(){return(this.delInfo&bf)>0}}class wf{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&wf.empty)return wf.empty}recover(e){let t=0,n=ff(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+function(e){return(e-(e&df))/pf}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let l=this.ranges[s+i],c=this.ranges[s+o],u=a+l;if(e<=u){let i=a+r+((l?e==a?-1:e==u?1:t:t)<0?0:c);if(n)return i;let o=e==(t<0?a:u)?null:hf(s/3,e-a),d=e==a?gf:e==u?mf:bf;return(t<0?e!=a:e!=u)&&(d|=yf),new vf(i,d,o)}r+=c-l}return n?e+r:new vf(e+r,0,null)}touches(e,t){let n=0,r=ff(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let a=this.ranges[t+i];if(e<=s+a&&t==3*r)return!0;n+=this.ranges[t+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),l=this.ranges[r+t],c=this.ranges[r+n];e(s,s+l,a,a+c),i+=c-l}}invert(){return new wf(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?wf.empty:new wf(e<0?[0,-e,0]:[0,0,e])}}wf.empty=new wf([]);class _f{constructor(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(e=0,t=this.maps.length){return new _f(this.maps,this.mirror,e,t)}copy(){return new _f(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,n=this.maps.length;t<e.maps.length;t++){let r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new _f;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this.maps[n].mapResult(e,t);if(null!=i.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this.maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new vf(e,r,null)}}const xf=Object.create(null);class Ef{getMap(){return wf.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=xf[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in xf)throw new RangeError("Duplicate use of step JSON ID "+e);return xf[e]=t,t.prototype.jsonID=e,t}}class kf{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new kf(e,null)}static fail(e){return new kf(null,e)}static fromReplace(e,t,n,r){try{return kf.ok(e.replace(t,n,r))}catch(e){if(e instanceof ch)return kf.fail(e.message);throw e}}}function Mf(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(Mf(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return ih.fromArray(r)}class Df extends Ef{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new uh(Mf(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return kf.fromReplace(e,this.from,this.to,i)}invert(){return new Cf(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Df(t.pos,n.pos,this.mark)}merge(e){return e instanceof Df&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Df(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Df(t.from,t.to,e.markFromJSON(t.mark))}}Ef.jsonID("addMark",Df);class Cf extends Ef{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new uh(Mf(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return kf.fromReplace(e,this.from,this.to,n)}invert(){return new Df(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Cf(t.pos,n.pos,this.mark)}merge(e){return e instanceof Cf&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Cf(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Cf(t.from,t.to,e.markFromJSON(t.mark))}}Ef.jsonID("removeMark",Cf);class Sf extends Ef{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return kf.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return kf.fromReplace(e,this.pos,this.pos+1,new uh(ih.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new Sf(this.pos,t.marks[n]);return new Sf(this.pos,this.mark)}}return new Nf(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Sf(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Sf(t.pos,e.markFromJSON(t.mark))}}Ef.jsonID("addNodeMark",Sf);class Nf extends Ef{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return kf.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return kf.fromReplace(e,this.pos,this.pos+1,new uh(ih.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new Sf(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Nf(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Nf(t.pos,e.markFromJSON(t.mark))}}Ef.jsonID("removeNodeMark",Nf);class Af extends Ef{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Tf(e,this.from,this.to)?kf.fail("Structure replace would overwrite content"):kf.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new wf([this.from,this.to-this.from,this.slice.size])}invert(e){return new Af(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new Af(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof Af)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?uh.empty:new uh(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Af(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?uh.empty:new uh(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Af(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Af(t.from,t.to,uh.fromJSON(e,t.slice),!!t.structure)}}Ef.jsonID("replace",Af);class Of extends Ef{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(Tf(e,this.from,this.gapFrom)||Tf(e,this.gapTo,this.to)))return kf.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return kf.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?kf.fromReplace(e,this.from,this.to,n):kf.fail("Content does not fit in gap")}getMap(){return new wf([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Of(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new Of(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Of(t.from,t.to,t.gapFrom,t.gapTo,uh.fromJSON(e,t.slice),t.insert,!!t.structure)}}function Tf(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function If(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Lf(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,o,t))return n;if(0==n||r.type.spec.isolating||!If(r,i,o))break}return null}function Ff(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;a&&e<i;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?s:null}(r,t);return o?i.map(zf).concat({type:t,attrs:n}).concat(o.map(zf)):null}function zf(e){return{type:e,attrs:null}}function jf(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>o;e--,t--){let n=i.node(e),o=i.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),a=r&&r[t]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(o+1,n.childCount)||!a.type.validContent(s))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function Rf(e,t){let n=e.resolve(t),r=n.index();return function(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Bf(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,o=r.index(t)+(n>0?1:0),s=r.node(t),a=!1;if(1==e)a=s.canReplace(o,o,i);else{let e=s.contentMatchAt(o).findWrapping(i.firstChild.type);a=e&&s.canReplaceWith(o,o,e[0])}if(a)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Pf(e,t,n=t,r=uh.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return Uf(i,o,r)?new Af(t,n,r):new Hf(i,o,r).fit()}function Uf(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Ef.jsonID("replaceAround",Of);class Hf{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=ih.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=ih.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let a=new uh(i,o,s);return e>-1?new Of(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new Af(n.pos,r.pos,a):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let n,r=null;t?(r=Vf(this.unplaced.content,t-1).firstChild,n=r.content):n=this.unplaced.content;let i=n.firstChild;for(let n=this.depth;n>=0;n--){let o,{type:s,match:a}=this.frontier[n],l=null;if(1==e&&(i?a.matchType(i.type)||(l=a.fillBefore(ih.from(i),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:t,frontierDepth:n,parent:r,inject:l};if(2==e&&i&&(o=a.findWrapping(i.type)))return{sliceDepth:t,frontierDepth:n,parent:r,wrap:o};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Vf(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new uh(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Vf(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new uh($f(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new uh($f(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let o=this.unplaced,s=n?n.content:o.content,a=o.openStart-e,l=0,c=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));u=u.matchFragment(r)}let p=s.size+e-(o.content.size-o.openEnd);for(;l<s.childCount;){let e=s.child(l),t=u.matchType(e.type);if(!t)break;l++,(l>1||0==a||e.content.size)&&(u=t,c.push(qf(e.mark(d.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?p:-1)))}let h=l==s.childCount;h||(p=-1),this.placed=Wf(this.placed,t,ih.from(c)),this.frontier[t].match=u,h&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<p;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=h?0==e?uh.empty:new uh($f(o.content,e-1,1),e-1,p<0?o.openEnd:e-1):new uh($f(o.content,e,l),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Kf(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=Kf(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Kf(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Wf(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Wf(this.placed,this.depth,ih.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(ih.empty,!0);e.childCount&&(this.placed=Wf(this.placed,this.frontier.length,e))}}function $f(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy($f(e.firstChild.content,t-1,n)))}function Wf(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Wf(e.lastChild.content,t-1,n)))}function Vf(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function qf(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,qf(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(ih.empty,!0)))),e.copy(r)}function Kf(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function Gf(e){return e.spec.defining||e.spec.definingForContent}function Yf(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(Yf(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(ih.empty,!0))}return e}function Qf(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let i=e.start(r);if(i<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}class Jf extends Ef{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return kf.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return kf.fromReplace(e,this.pos,this.pos+1,new uh(ih.from(r),0,t.isLeaf?0:1))}getMap(){return wf.empty}invert(e){return new Jf(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Jf(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new Jf(t.pos,t.attr,t.value)}}Ef.jsonID("attr",Jf);let Zf=class extends Error{};Zf=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(Zf.prototype=Object.create(Error.prototype)).constructor=Zf,Zf.prototype.name="TransformError";class Xf{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new _f}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Zf(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=uh.empty){let r=Pf(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new uh(ih.from(n),0,0))}delete(e,t){return this.replace(e,t,uh.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(Uf(i,o,r))return e.step(new Af(t,n,r));let s=Qf(i,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?a=e:i.before(e)==t&&s.splice(1,0,-e)}let l=s.indexOf(a),c=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=c[e].type,n=Gf(t);if(n&&i.node(l).type!=t)u=e;else if(n||!t.isTextblock)break}for(let t=r.openStart;t>=0;t--){let a=(t+u+1)%(r.openStart+1),d=c[a];if(d)for(let t=0;t<s.length;t++){let c=s[(t+l)%s.length],u=!0;c<0&&(u=!1,c=-c);let p=i.node(c-1),h=i.index(c-1);if(p.canReplaceWith(h,h,d.type,d.marks))return e.replace(i.before(c),u?o.after(c):n,new uh(Yf(r.content,0,r.openStart,a),a,r.openEnd))}}let d=e.steps.length;for(let a=s.length-1;a>=0&&(e.replace(t,n,r),!(e.steps.length>d));a--){let e=s[a];e<0||(t=i.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}(e.doc,t,r.type);null!=i&&(t=n=i)}e.replaceRange(t,n,new uh(ih.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=Qf(r,i);for(let t=0;t<o.length;t++){let n=o[t],s=t==o.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o)return e.delete(r.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),a=i.after(o+1),l=s,c=a,u=ih.empty,d=0;for(let e=o,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=ih.from(r.node(e).copy(u)),d++):l--;let p=ih.empty,h=0;for(let e=o,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,p=ih.from(i.node(e).copy(p)),h++):c++;e.step(new Of(l,c,s,a,new uh(u.append(p),d,h),u.size-d,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=new Af(t-n,t+n,uh.empty,!0);e.step(r)}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=ih.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=ih.from(n[e].type.create(n[e].attrs,r))}let i=t.start,o=t.end;e.step(new Of(i,o,i,o,new uh(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(r,i)&&function(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(e.doc,e.mapping.slice(o).map(n),r)){e.clearIncompatible(e.mapping.slice(o).map(n,1),r);let s=e.mapping.slice(o),a=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new Of(a,l,a+1,l-1,new uh(ih.from(r.create(i,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r=[]){return function(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Of(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new uh(ih.from(s),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Jf(e,t,n)),this}addNodeMark(e,t){return this.step(new Sf(e,t)),this}removeNodeMark(e,t){if(!(t instanceof lh)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(n.marks)))return this}return this.step(new Nf(e,t)),this}split(e,t=1,n){return function(e,t,n=1,r){let i=e.doc.resolve(t),o=ih.empty,s=ih.empty;for(let e=i.depth,t=i.depth-n,a=n-1;e>t;e--,a--){o=ih.from(i.node(e).copy(o));let t=r&&r[a];s=ih.from(t?t.type.create(t.attrs,s):i.node(e).copy(s))}e.step(new Af(t,t,new uh(o.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let i,o,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,c)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,t),d=Math.min(l+e.nodeSize,n),p=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(p)||(i&&i.to==c&&i.mark.eq(u[e])?i.to=d:s.push(i=new Cf(c,d,u[e])));o&&o.to==c?o.to=d:a.push(o=new Df(c,d,r))}})),s.forEach((t=>e.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;o++;let a=null;if(r instanceof Vh){let t,n=e.marks;for(;t=r.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(a=[r]):a=e.marks;if(a&&a.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,l=a[e];for(let e=0;e<i.length;e++){let t=i[e];t.step==o-1&&l.eq(i[e].style)&&(n=t)}n?(n.to=r,n.step=o):i.push({style:l,from:Math.max(s,t),to:r,step:o})}}})),i.forEach((t=>e.step(new Cf(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,r=n.contentMatch){let i=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<i.childCount;t++){let a=i.child(t),l=s+a.nodeSize,c=r.matchType(a.type);if(c){r=c;for(let t=0;t<a.marks.length;t++)n.allowsMarkType(a.marks[t].type)||e.step(new Cf(s,l,a.marks[t]))}else o.push(new Af(s,l,uh.empty));s=l}if(!r.validEnd){let t=r.fillBefore(ih.empty,!0);e.replace(s,s,new uh(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}(this,e,t,n),this}}const em=Object.create(null);class tm{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new nm(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=uh.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:l}=o[s],c=e.mapping.slice(i);e.replaceRange(c.map(a.pos),c.map(l.pos),s?uh.empty:t),0==s&&pm(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],a=e.mapping.slice(n),l=a.map(o.pos),c=a.map(s.pos);i?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),pm(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new om(e):dm(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?dm(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):dm(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new cm(e.node(0))}static atStart(e){return dm(e,e,0,0,1)||new cm(e)}static atEnd(e){return dm(e,e,e.content.size,e.childCount,-1)||new cm(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=em[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in em)throw new RangeError("Duplicate use of selection JSON ID "+e);return em[e]=t,t.prototype.jsonID=e,t}getBookmark(){return om.between(this.$anchor,this.$head).getBookmark()}}tm.prototype.visible=!0;class nm{constructor(e,t){this.$from=e,this.$to=t}}let rm=!1;function im(e){rm||e.parent.inlineContent||(rm=!0,console["warn"]("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class om extends tm{constructor(e,t=e){im(e),im(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return tm.near(n);let r=e.resolve(t.map(this.anchor));return new om(r.parent.inlineContent?r:n,n)}replace(e,t=uh.empty){if(super.replace(e,t),t==uh.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof om&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new sm(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new om(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=tm.findFrom(t,n,!0)||tm.findFrom(t,-n,!0);if(!e)return tm.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(tm.findFrom(e,-n,!0)||tm.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new om(e,t)}}tm.jsonID("text",om);class sm{constructor(e,t){this.anchor=e,this.head=t}map(e){return new sm(e.map(this.anchor),e.map(this.head))}resolve(e){return om.between(e.resolve(this.anchor),e.resolve(this.head))}}class am extends tm{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?tm.near(i):new am(i)}content(){return new uh(ih.from(this.node),0,0)}eq(e){return e instanceof am&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new lm(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new am(e.resolve(t.anchor))}static create(e,t){return new am(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}am.prototype.visible=!1,tm.jsonID("node",am);class lm{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new sm(n,n):new lm(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&am.isSelectable(n)?new am(t):tm.near(t)}}class cm extends tm{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=uh.empty){if(t==uh.empty){e.delete(0,e.doc.content.size);let t=tm.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new cm(e)}map(e){return new cm(e)}eq(e){return e instanceof cm}getBookmark(){return um}}tm.jsonID("all",cm);const um={map(){return this},resolve:e=>new cm(e)};function dm(e,t,n,r,i,o=!1){if(t.inlineContent)return om.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&am.isSelectable(r))return am.create(e,n-(i<0?r.nodeSize:0))}else{let t=dm(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function pm(e,t,n){let r=e.steps.length-1;if(r<t)return;let i,o=e.steps[r];(o instanceof Af||o instanceof Of)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==i&&(i=r)})),e.setSelection(tm.near(e.doc.resolve(i),n)))}const hm=1,fm=2,mm=4;class gm extends Xf{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|hm)&~fm,this.storedMarks=null,this}get selectionSet(){return(this.updated&hm)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=fm,this}ensureMarks(e){return lh.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&fm)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~fm,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||lh.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(tm.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=mm,this}get scrolledIntoView(){return(this.updated&mm)>0}}function bm(e,t){return t&&e?e.bind(t):e}class ym{constructor(e,t,n){this.name=e,this.init=bm(t.init,n),this.apply=bm(t.apply,n)}}const vm=[new ym("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new ym("selection",{init:(e,t)=>e.selection||tm.atStart(t.doc),apply:e=>e.selection}),new ym("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new ym("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class wm{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=vm.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new ym(e.key,e.spec.state,e))}))}}class _m{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let a=r?r[o].n:0,l=r?r[o].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new _m(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new gm(this)}static create(e){let t=new wm(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new _m(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new wm(this.schema,e.plugins),n=t.fields,r=new _m(t);for(let t=0;t<n.length;t++){let i=n[t].name;r[i]=this.hasOwnProperty(i)?this[i]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new wm(e.schema,e.plugins),i=new _m(r);return r.fields.forEach((r=>{if("doc"==r.name)i.doc=Sh.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=tm.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,o))return void(i[r.name]=a.fromJSON.call(s,e,t[o],i))}i[r.name]=r.init(e,i)}})),i}}function xm(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=xm(i,t,{})),n[r]=i}return n}class Em{constructor(e){this.spec=e,this.props={},e.props&&xm(e.props,this,this.props),this.key=e.key?e.key.key:Mm("plugin")}getState(e){return e[this.key]}}const km=Object.create(null);function Mm(e){return e in km?e+"$"+ ++km[e]:(km[e]=0,e+"$")}class Dm{constructor(e="key"){this.key=Mm(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Cm="undefined"!=typeof navigator?navigator:null,Sm="undefined"!=typeof document?document:null,Nm=Cm&&Cm.userAgent||"",Am=/Edge\/(\d+)/.exec(Nm),Om=/MSIE \d/.exec(Nm),Tm=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Nm),Im=!!(Om||Tm||Am),Lm=Om?document.documentMode:Tm?+Tm[1]:Am?+Am[1]:0,Fm=!Im&&/gecko\/(\d+)/i.test(Nm);Fm&&(/Firefox\/(\d+)/.exec(Nm)||[0,0])[1];const zm=!Im&&/Chrome\/(\d+)/.exec(Nm),jm=!!zm,Rm=zm?+zm[1]:0,Bm=!Im&&!!Cm&&/Apple Computer/.test(Cm.vendor),Pm=Bm&&(/Mobile\/\w+/.test(Nm)||!!Cm&&Cm.maxTouchPoints>2),Um=Pm||!!Cm&&/Mac/.test(Cm.platform),Hm=/Android \d/.test(Nm),$m=!!Sm&&"webkitFontSmoothing"in Sm.documentElement.style,Wm=$m?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,Vm=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},qm=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let Km=null;const Gm=function(e,t,n){let r=Km||(Km=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},Ym=function(e,t,n,r){return n&&(Jm(e,t,n,r,-1)||Jm(e,t,n,r,1))},Qm=/^(img|br|input|textarea|hr)$/i;function Jm(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Zm(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Xm(e)||Qm.test(e.nodeName)||"false"==e.contentEditable)return!1;t=Vm(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?Zm(e):0}}}function Zm(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Xm(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const eg=function(e){let t=e.isCollapsed;return t&&jm&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function tg(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function ng(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function rg(e,t){return"number"==typeof e?e:e[t]}function ig(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function og(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;s=qm(s)){if(1!=s.nodeType)continue;let e=s,n=e==o.body,a=n?ng(o):ig(e),l=0,c=0;if(t.top<a.top+rg(r,"top")?c=-(a.top-t.top+rg(i,"top")):t.bottom>a.bottom-rg(r,"bottom")&&(c=t.bottom-a.bottom+rg(i,"bottom")),t.left<a.left+rg(r,"left")?l=-(a.left-t.left+rg(i,"left")):t.right>a.right-rg(r,"right")&&(l=t.right-a.right+rg(i,"right")),l||c)if(n)o.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}if(n)break}}function sg(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=qm(r));return t}function ag(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let lg=null;function cg(e,t){let n,r,i=2e8,o=0,s=t.top,a=t.top;for(let l=e.firstChild,c=0;l;l=l.nextSibling,c++){let e;if(1==l.nodeType)e=l.getClientRects();else{if(3!=l.nodeType)continue;e=Gm(l).getClientRects()}for(let u=0;u<e.length;u++){let d=e[u];if(d.top<=s&&d.bottom>=a){s=Math.max(d.bottom,s),a=Math.min(d.top,a);let e=d.left>t.left?d.left-t.left:d.right<t.left?t.left-d.right:0;if(e<i){n=l,i=e,r=e&&3==n.nodeType?{left:d.right<t.left?d.right:d.left,top:t.top}:t,1==l.nodeType&&e&&(o=c+(t.left>=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(o=c+1)}}return n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let n=hg(r,1);if(n.top!=n.bottom&&ug(t,n))return{node:e,offset:i+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:e,offset:o}:cg(n,r)}function ug(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function dg(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let n=e.childNodes[o];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(ug(t,i))return dg(n,t,i)}}if((o=(o+1)%r)==i)break}return e}function pg(e,t){let n,r=e.dom.ownerDocument,i=0;if(r.caretPositionFromPoint)try{let e=r.caretPositionFromPoint(t.left,t.top);e&&({offsetNode:n,offset:i}=e)}catch(e){}if(!n&&r.caretRangeFromPoint){let e=r.caretRangeFromPoint(t.left,t.top);e&&({startContainer:n,startOffset:i}=e)}let o,s=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!s||!e.dom.contains(1!=s.nodeType?s.parentNode:s)){let n=e.dom.getBoundingClientRect();if(!ug(t,n))return null;if(s=dg(e.dom,t,n),!s)return null}if(Bm)for(let e=s;n&&e;e=qm(e))e.draggable&&(n=void 0);if(s=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(s,t),n){if(Fm&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let e,r=n.childNodes[i];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&i++}n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(o=function(e,t,n,r){let i=-1;for(let n=t;n!=e.dom;){let t=e.docView.nearestDesc(n,!0);if(!t)return null;if(t.node.isBlock&&t.parent){let e=t.dom.getBoundingClientRect();if(e.left>r.left||e.top>r.top)i=t.posBefore;else{if(!(e.right<r.left||e.bottom<r.top))break;i=t.posAfter}}n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,1)}(e,n,i,t))}null==o&&(o=function(e,t,n){let{node:r,offset:i}=cg(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,s,t));let a=e.docView.nearestDesc(s,!0);return{pos:o,inside:a?a.posAtStart-a.border:-1}}function hg(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const fg=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function mg(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=$m||Fm;if(3==r.nodeType){if(!s||!fg.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,gg(hg(Gm(r,e,t),1),o<0)}{let e=hg(Gm(r,i,i),n);if(Fm&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=hg(Gm(r,i-1,i-1),-1);if(t.top==e.top){let n=hg(Gm(r,i,i+1),-1);if(n.top!=e.top)return gg(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&i&&(n<0||i==Zm(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return bg(e.getBoundingClientRect(),!1)}if(null==o&&i<Zm(r)){let e=r.childNodes[i];if(1==e.nodeType)return bg(e.getBoundingClientRect(),!0)}return bg(r.getBoundingClientRect(),n>=0)}if(null==o&&i&&(n<0||i==Zm(r))){let e=r.childNodes[i-1],t=3==e.nodeType?Gm(e,Zm(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return gg(hg(t,1),!1)}if(null==o&&i<Zm(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?Gm(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return gg(hg(t,-1),!0)}return gg(hg(3==r.nodeType?Gm(r):r,-n),n>=0)}function gg(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function bg(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function yg(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}const vg=/[\u0590-\u08ac]/;let wg=null,_g=null,xg=!1;function Eg(e,t,n){return wg==t&&_g==n?xg:(wg=t,_g=n,xg="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return yg(e,t,(()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.dom;break}t=n.dom.parentNode}let r=mg(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=Gm(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return vg.test(r.parent.textContent)&&a.modify?yg(e,t,(()=>{let t=a.getRangeAt(0),i=a.focusNode,o=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");let l=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||i==a.focusNode&&o==a.focusOffset;return a.removeAllRanges(),a.addRange(t),null!=s&&(a.caretBidiLevel=s),l})):"left"==n||"backward"==n?o:s}(e,t,n))}const kg=0,Mg=1,Dg=2,Cg=3;class Sg{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=kg,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>Vm(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n,r=0,i=0;for(let t=0;r<this.children.length;r++){let n=this.children[r],o=t+n.size;if(o>e||n instanceof Fg){i=e-t;break}t=o}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof Ng&&n.side>=0;r--);if(t<=0){let e,n=!0;for(;e=r?this.children[r-1]:null,e&&e.dom.parentNode!=this.contentDOM;r--,n=!1);return e&&t&&n&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?Vm(e.dom)+1:0}}{let e,n=!0;for(;e=r<this.children.length?this.children[r]:null,e&&e.dom.parentNode!=this.contentDOM;r++,n=!1);return e&&n&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?Vm(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let o=n,s=0;;s++){let n=this.children[s],a=o+n.size;if(-1==r&&e<=a){let i=o+n.border;if(e>=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=Vm(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=Vm(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=a}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),o=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],c=a+l.size;if(i>a&&o<c)return l.setSelection(e-a-l.border,t-a-l.border,n,r);a=c}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.getSelection(),c=!1;if((Fm||Bm)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(c=!(!t||"\n"!=e.nodeValue[t-1]),c&&t==e.nodeValue.length)for(let t,n=e;n;n=n.parentNode){if(t=n.nextSibling){"BR"==t.nodeName&&(s=a={node:t.parentNode,offset:Vm(t)+1});break}let e=n.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];c=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(Fm&&l.focusNode&&l.focusNode!=a.node&&1==l.focusNode.nodeType){let e=l.focusNode.childNodes[l.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||c&&Bm)&&Ym(s.node,s.offset,l.anchorNode,l.anchorOffset)&&Ym(a.node,a.offset,l.focusNode,l.focusOffset))return;let u=!1;if((l.extend||e==t)&&!c){l.collapse(s.node,s.offset);try{if(e!=t)try{l.extend(a.node,a.offset)}catch(e){}u=!0}catch(e){if(!(e instanceof DOMException))throw e}}if(!u){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s)return this.dirty=e==n||t==o?Dg:Mg,void(e!=r||t!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-r,t-r):i.dirty=Cg);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?Cg:Dg}n=o}this.dirty=Dg}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?Dg:Mg;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class Ng extends Sg{constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,(()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r))),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==kg&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Ag extends Sg{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class Og extends Sg{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=lf.renderSpec(document,t.type.spec.toDOM(t,n))),new Og(e,t,o.dom,o.contentDOM||o.dom)}parseRule(){return this.dirty&Cg||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return this.dirty!=Cg&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=kg){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=kg}}slice(e,t,n){let r=Og.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=Gg(i,t,o,n)),e>0&&(i=Gg(i,0,e,n));for(let e=0;e<i.length;e++)i[e].parent=r;return r.children=i,r}}class Tg extends Sg{constructor(e,t,n,r,i,o,s,a,l){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s,o&&this.updateChildren(a,l)}static create(e,t,n,r,i,o){let s,a=i.nodeViews[t.type.name],l=a&&a(t,i,(()=>s?s.parent?s.parent.posBeforeChild(s):void 0:o),n,r),c=l&&l.dom,u=l&&l.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else c||({dom:c,contentDOM:u}=lf.renderSpec(document,t.type.spec.toDOM(t)));u||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let d=c;return c=$g(c,n,t),l?s=new zg(e,t,n,r,c,u||null,d,l,i,o+1):t.isText?new Lg(e,t,n,r,c,d,i):new Tg(e,t,n,r,c,u||null,d,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>ih.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return this.dirty==kg&&e.eq(this.node)&&Wg(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,a=new qg(this,o&&o.node,e);!function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,i,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){if(s<i.length&&i[s].to==o){let e,t=i[s++];for(;s<i.length&&i[s].to==o;)(e||(e=[t])).push(i[s++]);if(e){e.sort(Kg);for(let t=0;t<e.length;t++)n(e[t],c,!!l)}else n(t,c,!!l)}let u,d;if(l)d=-1,u=l,l=null;else{if(!(c<e.childCount))break;d=c,u=e.child(c++)}for(let e=0;e<a.length;e++)a[e].to<=o&&a.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let p=o+u.nodeSize;if(u.isText){let e=p;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<p&&(l=u.cut(e-o),u=u.cut(0,e-o),p=e,d=-1)}let h=u.isInline&&!u.isLeaf?a.filter((e=>!e.inline)):a.slice();r(u,h,t.forChild(o,u),d),o=p}}(this.node,this.innerDeco,((t,i,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?lh.none:this.node.child(i).marks,n,e),a.placeWidget(t,e,r)}),((t,o,l,c)=>{let u;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,o,l,c)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(t,o,l,u,e)||a.updateNextNode(t,o,l,e,c)||a.addNode(t,o,l,e,r),r+=t.nodeSize})),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Dg)&&(o&&this.protectLocalComposition(e,o),jg(this.contentDOM,this.children,e),Pm&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof om)||n<t||r>t+this.node.content.size)return null;let i=e.domSelection(),o=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=Zm(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(i.focusNode,i.focusOffset);if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let e=o.nodeValue,i=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;l+=t.text}if(o>=n){let e=a<r?l.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new Ag(this,i,t,r);e.input.compositionNodes.push(o),this.children=Gg(this.children,n,n+r.length,e,o)}update(e,t,n,r){return!(this.dirty==Cg||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=kg}updateOuterDeco(e){if(Wg(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Ug(this.dom,this.nodeDOM,Pg(this.outerDeco,this.node,t),Pg(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Ig(e,t,n,r,i){return $g(r,t,e),new Tg(void 0,e,t,n,r,r,r,i,0)}class Lg extends Tg{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(this.dirty==Cg||this.dirty!=kg&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),this.dirty==kg&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=kg,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new Lg(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=Cg)}get domAtom(){return!1}}class Fg extends Sg{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==kg&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class zg extends Tg{constructor(e,t,n,r,i,o,s,a,l,c){super(e,t,n,r,i,o,s,l,c),this.spec=a}update(e,t,n,r){if(this.dirty==Cg)return!1;if(this.spec.update){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function jg(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let s=t[o],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=Vg(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(s instanceof Og){let t=r?r.previousSibling:e.lastChild;jg(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Vg(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Rg=function(e){e&&(this.nodeName=e)};Rg.prototype=Object.create(null);const Bg=[new Rg];function Pg(e,t,n){if(0==e.length)return Bg;let r=n?Bg[0]:new Rg,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new Rg(s.nodeName));for(let e in s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new Rg(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o))}}}return i}function Ug(e,t,n,r){if(n==Bg&&r==Bg)return t;let i=t;for(let t=0;t<r.length;t++){let o=r[t],s=n[t];if(t){let t;s&&s.nodeName==o.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==o.nodeName||(t=document.createElement(o.nodeName),t.pmIsDeco=!0,t.appendChild(i),s=Bg[0]),i=t}Hg(i,s||Bg[0],o)}return i}function Hg(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function $g(e,t,n){return Ug(e,e,Bg,Pg(t,n,1!=e.nodeType))}function Wg(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Vg(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class qg{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof Og)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let r=0,i=this.stack.length>>1,o=Math.min(i,e.length);for(;r<o&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=kg,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++)if(this.top.children[t].matchesMark(e[i])){r=t;break}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=Og.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(let r=this.index,i=Math.min(this.top.children.length,r+5);r<i;r++){let i=this.top.children[r];if(i.matchesNode(e,t,n)&&!this.preMatch.matched.has(i)){o=r;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return o.dirty==Cg&&o.dom==o.contentDOM&&(o.dirty=Dg),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,i){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof Tg){let a=this.preMatch.matched.get(s);if(null!=a&&a!=i)return!1;let l=s.dom;if(!(this.lock&&(l==this.lock||1==l.nodeType&&l.contains(this.lock.parentNode))&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=Cg&&Wg(t,s.outerDeco)))&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(e,t,n,r,i){this.top.children.splice(this.index++,0,Tg.create(this.top,e,t,n,r,i)),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new Ng(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Og;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Lg)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Bm||jm)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new Fg(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}}function Kg(e,t){return e.type.side-t.type.side}function Gg(e,t,n,r,i){let o=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,u=a+=l.size;c>=n||u<=t?o.push(l):(c<t&&o.push(l.slice(0,t-c,r)),i&&(o.push(i),i=void 0),u>n&&o.push(l.slice(n-c,l.size,r)))}return o}function Yg(e,t=null){let n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(eg(n)){for(a=c;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&am.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==Zm(e);r||i;){if(e==n)return!0;let t=Vm(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==Zm(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new am(s==e?c:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=r.resolve(t)}if(!l){l=ib(e,a,c,"pointer"==t||e.state.selection.head<c.pos&&!o?1:-1)}return l}function Qg(e){return e.editable?e.hasFocus():sb(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Jg(e,t=!1){let n=e.state.selection;if(nb(e,n),Qg(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&jm){let t=e.domSelection(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Ym(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setEnd(r.parentNode,Vm(r)+1):n.setEnd(r,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&Im&&Lm<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let r,i,{anchor:o,head:s}=n;!Zg||n instanceof om||(n.$from.parent.inlineContent||(r=Xg(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=Xg(e,n.to))),e.docView.setSelection(o,s,e.root,t),Zg&&(r&&tb(r),i&&tb(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelection(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Qg(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Zg=Bm||jm&&Rm<63;function Xg(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Bm&&i&&"false"==i.contentEditable)return eb(i);if(!(i&&"false"!=i.contentEditable||o&&"false"!=o.contentEditable)){if(i)return eb(i);if(o)return eb(o)}}function eb(e){return e.contentEditable="true",Bm&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function tb(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function nb(e,t){if(t instanceof am){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(rb(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else rb(e)}function rb(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function ib(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||om.between(t,n,r)}function ob(e){return!(e.editable&&!e.hasFocus())&&sb(e)}function sb(e){let t=e.domSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function ab(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&tm.findFrom(o,t)}function lb(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function cb(e,t,n){let r=e.state.selection;if(!(r instanceof om)){if(r instanceof am&&r.node.isInline)return lb(e,new om(t>0?r.$to:r.$from));{let n=ab(e.state,t);return!!n&&lb(e,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=ab(e.state,t);return!!(n&&n instanceof am)&&lb(e,n)}if(!(Um&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(am.isSelectable(o)?lb(e,new am(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!$m&&lb(e,new om(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function ub(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function db(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function pb(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(Fm&&1==n.nodeType&&r<ub(n)&&db(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(db(e))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(fb(n))break;{let t=n.previousSibling;for(;t&&db(t);)i=n.parentNode,o=Vm(t),t=t.previousSibling;if(t)n=t,r=ub(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?mb(e,t,n,r):i&&mb(e,t,i,o)}function hb(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=ub(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!db(n.childNodes[r]))break;i=n,o=++r}else{if(fb(n))break;{let t=n.nextSibling;for(;t&&db(t);)i=t.parentNode,o=Vm(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=ub(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}i&&mb(e,t,i,o)}function fb(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function mb(e,t,n,r){if(eg(t)){let e=document.createRange();e.setEnd(n,r),e.setStart(n,r),t.removeAllRanges(),t.addRange(e)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();let{state:i}=e;setTimeout((()=>{e.state==i&&Jg(e)}),50)}function gb(e,t,n){let r=e.state.selection;if(r instanceof om&&!r.empty||n.indexOf("s")>-1)return!1;if(Um&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=ab(e.state,t);if(n&&n instanceof am)return lb(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof cm?tm.near(n,t):tm.findFrom(n,t);return!!s&&lb(e,s)}return!1}function bb(e,t){if(!(e.state.selection instanceof om))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function yb(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function vb(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||Um&&72==n&&"c"==r?bb(e,-1)||pb(e):46==n||Um&&68==n&&"c"==r?bb(e,1)||hb(e):13==n||27==n||(37==n||Um&&66==n&&"c"==r?cb(e,-1,r)||pb(e):39==n||Um&&70==n&&"c"==r?cb(e,1,r)||hb(e):38==n||Um&&80==n&&"c"==r?gb(e,-1,r)||pb(e):40==n||Um&&78==n&&"c"==r?function(e){if(!Bm||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;yb(e,n,"true"),setTimeout((()=>yb(e,n,"false")),20)}return!1}(e)||gb(e,1,r)||hb(e):r==(Um?"m":"c")&&(66==n||73==n||89==n||90==n))}function wb(e,t){e.someProp("transformCopied",(e=>{t=e(t)}));let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||lf.fromSchema(e.state.schema),a=Ab(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,u=l.firstChild,d=0;for(;u&&1==u.nodeType&&(c=Sb[u.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=a.createElement(c[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++}u=l.firstChild}u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let p=e.someProp("clipboardTextSerializer",(e=>e(t)))||t.content.textBetween(0,t.content.size,"\n\n");return{dom:l,text:p}}function _b(e,t,n,r,i){let o,s,a=i.parent.type.spec.code;if(!n&&!t)return null;let l=t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",(e=>{t=e(t,a||r)})),a)return t?new uh(ih.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):uh.empty;let n=e.someProp("clipboardTextParser",(e=>e(t,i,r)));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=lf.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(e=>{n=e(n)})),o=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=Ab().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&Sb[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join(""));if(r.innerHTML=e,n)for(let e=0;e<n.length;e++)r=r.querySelector(n[e])||r;return r}(n),$m&&function(e){let t=e.querySelectorAll(jm?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let e=+u[3];e>0&&o.firstChild;e--)o=o.firstChild;if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||Gh.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!l&&!u),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||xb.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(u)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:i,openStart:o,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;i=ih.from(t.create(n[e+1],i)),o++,s++}return new uh(i,o,s)}(Cb(s,+u[1],+u[2]),u[4]);else if(s=uh.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach((e=>{if(!o)return;let t,n=i.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&r.length&&kb(n,r,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=Mb(o[o.length-1],r.length));let t=Eb(e,n);o.push(t),i=i.matchType(t.type),r=n}})),o)return ih.from(o)}return e}(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=Cb(s,e,t)}return e.someProp("transformPasted",(e=>{s=e(s)})),s}const xb=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Eb(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,ih.from(e));return e}function kb(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=kb(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(ih.from(Eb(n,e,i+1))))}}function Mb(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,Mb(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(ih.empty,!0);return e.copy(n.append(r))}function Db(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return i<r-1&&(a=Db(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(ih.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Cb(e,t,n){return t<e.openStart&&(e=new uh(Db(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new uh(Db(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const Sb={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Nb=null;function Ab(){return Nb||(Nb=document.implementation.createHTMLDocument("title"))}const Ob={},Tb={},Ib={touchstart:!0,touchmove:!0};class Lb{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Fb(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function zb(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>jb(e,t))}))}function jb(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Rb(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Bb(e){return{left:e.clientX,top:e.clientY}}function Pb(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,(t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1))))return!0;return!1}function Ub(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Hb(e,t,n,r,i){return Pb(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(i?function(e,t){if(-1==t)return!1;let n,r,i=e.state.selection;i instanceof am&&(n=i.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(am.isSelectable(t)){r=n&&i.$from.depth>0&&e>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(e);break}}return null!=r&&(Ub(e,am.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&am.isSelectable(r))&&(Ub(e,new am(n),"pointer"),!0)}(e,n))}function $b(e,t,n,r){return Pb(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function Wb(e,t,n,r){return Pb(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(Ub(e,om.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),o=i.before(t);if(n.inlineContent)Ub(e,om.create(r,o+1,o+1+n.content.size),"pointer");else{if(!am.isSelectable(n))continue;Ub(e,am.create(r,o),"pointer")}return!0}}(e,n,r)}function Vb(e){return Zb(e)}Tb.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Gb(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!Hm||!jm||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Pm||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||vb(e,n)?n.preventDefault():Fb(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,tg(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},Tb.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},Tb.keypress=(e,t)=>{let n=t;if(Gb(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Um&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof om&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const qb=Um?"metaKey":"ctrlKey";Ob.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Vb(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[qb]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=e.posAtCoords(Bb(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Kb(e,s,n,!!r)):("doubleClick"==o?$b:Wb)(e,s.pos,s.inside,n)?n.preventDefault():Fb(e,"pointer"))};class Kb{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[qb],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof am&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Fm||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Fb(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>Jg(this.view))),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Bb(e))),this.updateAllowDefault(e),this.allowDefault||!t?Fb(this.view,"pointer"):Hb(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Bm&&this.mightDrag&&!this.mightDrag.node.isAtom||jm&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Ub(this.view,tm.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Fb(this.view,"pointer")}move(e){this.updateAllowDefault(e),Fb(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function Gb(e,t){return!!e.composing||!!(Bm&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Ob.touchstart=e=>{e.input.lastTouch=Date.now(),Vb(e),Fb(e,"pointer")},Ob.touchmove=e=>{e.input.lastTouch=Date.now(),Fb(e,"pointer")},Ob.contextmenu=e=>Vb(e);const Yb=Hm?5e3:-1;function Qb(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>Zb(e)),t))}function Jb(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Zb(e,t=!1){if(!(Hm&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Jb(e),t||e.docView&&e.docView.dirty){let t=Yg(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}Tb.compositionstart=Tb.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),Zb(e,!0),e.markCursor=null;else if(Zb(e),Fm&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelection();for(let e=t.focusNode,n=t.focusOffset;e&&1==e.nodeType&&0!=n;){let r=n<0?e.lastChild:e.childNodes[n-1];if(!r)break;if(3==r.nodeType){t.collapse(r,r.nodeValue.length);break}e=r,n=-1}}e.input.composing=!0}Qb(e,Yb)},Tb.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,Qb(e,20))};const Xb=Im&&Lm<15||Pm&&Wm<604;function ey(e,t,n,r){let i=_b(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,r,i||uh.empty))))return!0;if(!i)return!1;let o=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),s=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Ob.copy=Tb.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=Xb?null:n.clipboardData,s=r.content(),{dom:a,text:l}=wb(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Tb.paste=(e,t)=>{let n=t;if(e.composing&&!Hm)return;let r=Xb?null:n.clipboardData;r&&ey(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ey(e,r.value,null,t):ey(e,r.textContent,r.innerHTML,t)}),50)}(e,n)};class ty{constructor(e,t){this.slice=e,this.move=t}}const ny=Um?"altKey":"ctrlKey";Ob.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(Bb(n));if(o&&o.pos>=i.from&&o.pos<=(i instanceof am?i.to-1:i.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(am.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(am.create(e.state.doc,t.posBefore)))}let s=e.state.selection.content(),{dom:a,text:l}=wb(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Xb?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Xb||n.dataTransfer.setData("text/plain",l),e.dragging=new ty(s,!n[ny])},Ob.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},Tb.dragover=Tb.dragenter=(e,t)=>t.preventDefault(),Tb.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(Bb(n));if(!i)return;let o=e.state.doc.resolve(i.pos),s=r&&r.slice;s?e.someProp("transformPasted",(e=>{s=e(s)})):s=_b(e,n.dataTransfer.getData(Xb?"Text":"text/plain"),Xb?null:n.dataTransfer.getData("text/html"),!1,o);let a=!(!r||n[ny]);if(e.someProp("handleDrop",(t=>t(e,n,s||uh.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?Bf(e.state.doc,o.pos,s):o.pos;null==l&&(l=o.pos);let c=e.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,p=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(p))return;let h=c.doc.resolve(u);if(d&&am.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new am(h));else{let t=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),c.setSelection(ib(e,h,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},Ob.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&Jg(e)}),20))},Ob.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},Ob.beforeinput=(e,t)=>{if(jm&&Hm&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,tg(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let e in Tb)Ob[e]=Tb[e];function ry(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class iy{constructor(e,t){this.toDOM=e,this.spec=t||cy,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new ay(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof iy&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ry(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class oy{constructor(e,t){this.attrs=e,this.spec=t||cy}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new ay(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof oy&&ry(this.attrs,e.attrs)&&ry(this.spec,e.spec)}static is(e){return e.type instanceof oy}destroy(){}}class sy{constructor(e,t){this.attrs=e,this.spec=t||cy}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new ay(i.pos-n,o.pos-n,this)}valid(e,t){let n,{index:r,offset:i}=e.content.findIndex(t.from);return i==t.from&&!(n=e.child(r)).isText&&i+n.nodeSize==t.to}eq(e){return this==e||e instanceof sy&&ry(this.attrs,e.attrs)&&ry(this.spec,e.spec)}destroy(){}}class ay{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new ay(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new ay(e,e,new iy(t,n))}static inline(e,t,n,r){return new ay(e,t,new oy(n,r))}static node(e,t,n,r){return new ay(e,t,new sy(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof oy}}const ly=[],cy={};class uy{constructor(e,t){this.local=e.length?e:ly,this.children=t.length?t:ly}static create(e,t){return t.length?gy(t,e,0,cy):dy}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==dy||0==e.maps.length?this:this.mapInner(e,t,0,0,n||cy)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let a=e.slice();for(let e=0,t=o;e<n.maps.length;e++){let r=0;n.maps[e].forEach(((e,n,o,s)=>{let l=s-o-(n-e);for(let s=0;s<a.length;s+=3){let c=a[s+1];if(c<0||e>c+t-r)continue;let u=a[s]+t-r;n>=u?a[s+1]=e<=u?-2:-1:o>=i&&l&&(a[s]+=l,a[s+1]+=l)}r+=l})),t=n.maps[e].map(t,-1)}let l=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){l=!0,a[t+1]=-1;continue}let c=n.map(e[t]+o),u=c-i;if(u<0||u>=r.content.size){l=!0;continue}let d=n.map(e[t+1]+o,-1)-i,{index:p,offset:h}=r.content.findIndex(u),f=r.maybeChild(p);if(f&&h==u&&h+f.nodeSize==d){let r=a[t+2].mapInner(n,f,c+1,e[t]+o+1,s);r!=dy?(a[t]=u,a[t+1]=d,a[t+2]=r):(a[t+1]=-2,l=!0)}else l=!0}if(l){let l=function(e,t,n,r,i,o,s){function a(e,t){for(let o=0;o<e.local.length;o++){let a=e.local[o].map(r,i,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[o].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&a(e[n+2],t[n]+o+1);return n}(a,e,t,n,i,o,s),c=gy(l,r,0,s);t=c.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new uy(t.sort(by),a)}(this.children,o||[],e,t,n,r,i):o?new uy(o.sort(by),ly):dy}add(e,t){return t.length?this==dy?uy.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach(((e,o)=>{let s,a=o+n;if(s=fy(t,e,a)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,s,a+1):r.splice(i,0,o,o+e.nodeSize,gy(s,e,a+1,cy)),i+=3}}));let o=hy(i?my(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new uy(o.length?this.local.concat(o).sort(by):this.local,r||this.children)}remove(e){return 0==e.length||this==dy?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,o=n[r]+t,s=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>o&&t.to<s&&(e[n]=null,(i||(i=[])).push(t));if(!i)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(i,o+1);a!=dy?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,i=0;i<e.length;i++)if(n=e[i])for(let e=0;e<r.length;e++)r[e].eq(n,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new uy(r,n):dy}forChild(e,t){if(this==dy)return this;if(t.isLeaf)return uy.empty;let n,r;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,o=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>i&&t.type instanceof oy){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new uy(r.sort(by),ly);return n?new py([e,n]):e}return n||dy}eq(e){if(this==e)return!0;if(!(e instanceof uy)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return yy(this.localsInner(e))}localsInner(e){if(this==dy)return ly;if(e.inlineContent||!this.local.some(oy.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof oy||t.push(this.local[e]);return t}}uy.empty=new uy([],[]),uy.removeOverlap=yy;const dy=uy.empty;class py{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,cy)));return py.from(n)}forChild(e,t){if(t.isLeaf)return uy.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=dy&&(i instanceof py?n=n.concat(i.members):n.push(i))}return py.from(n)}eq(e){if(!(e instanceof py)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?yy(n?t:t.sort(by)):ly}static from(e){switch(e.length){case 0:return dy;case 1:return e[0];default:return new py(e)}}}function hy(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new ay(i.from+t,i.to+t,i.type))}return n}function fy(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t,o=0;o<e.length;o++)(t=e[o])&&t.from>n&&t.to<r&&((i||(i=[])).push(t),e[o]=null);return i}function my(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function gy(e,t,n,r){let i=[],o=!1;t.forEach(((t,s)=>{let a=fy(e,t,s+n);if(a){o=!0;let e=gy(a,t,n+s+1,r);e!=dy&&i.push(s,s+t.nodeSize,e)}}));let s=hy(o?my(e):e,-n).sort(by);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||i.length?new uy(s,i):dy}function by(e,t){return e.from-t.from||e.to-t.to}function yy(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from!=r.from){o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),vy(t,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),vy(t,i+1,o.copy(r.to,o.to)))}}return t}function vy(e,t,n){for(;t<e.length&&by(n,e[t])>0;)t++;e.splice(t,0,n)}function wy(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=dy&&t.push(r)})),e.cursorWrapper&&t.push(uy.create(e.state.doc,[e.cursorWrapper.deco])),py.from(t)}const _y={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},xy=Im&&Lm<=11;class Ey{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class ky{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Ey,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);Im&&Lm<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),xy&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,_y)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout((()=>this.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(ob(this.view)){if(this.suppressingSelectionUpdates)return Jg(this.view);if(Im&&Lm<=11&&!this.view.state.selection.empty){let e=this.view.domSelection();if(e.focusNode&&Ym(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(e){if(0==e.rangeCount)return!0;let t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);let n=e.domSelection(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&ob(e)&&!this.ignoreSelectionChange(n),i=-1,o=-1,s=!1,a=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],a);n&&(i=i<0?n.from:Math.min(n.from,i),o=o<0?n.to:Math.max(n.to,o),n.typeOver&&(s=!0))}if(Fm&&a.length>1){let e=a.filter((e=>"BR"==e.nodeName));if(2==e.length){let t=e[0],n=e[1];t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}}let l=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&e.input.lastTouch<Date.now()-300&&eg(n)&&(l=Yg(e))&&l.eq(tm.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Jg(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,o),function(e){if(My.has(e))return;if(My.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=Fm,Dy)return;console["warn"]("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Dy=!0}}(e)),this.handleDOMChange(i,o,s,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Jg(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++)t.push(e.addedNodes[n]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(Im&&Lm<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!o||Array.prototype.indexOf.call(e.addedNodes,o)<0)&&(i=o)}let o=r&&r.parentNode==e.target?Vm(r)+1:0,s=n.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?Vm(i):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let My=new WeakMap,Dy=!1;function Cy(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Bm&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||Bm&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}function Sy(e,t,n,r,i){if(t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Yg(e,t);if(n&&!e.state.selection.eq(n)){let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let a,l,c=e.state.selection,u=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),c=e.domSelection(),u=c.anchorNode;if(u&&e.dom.contains(1==u.nodeType?u:u.parentNode)&&(r=[{node:u,offset:c.anchorOffset}],eg(c)||r.push({node:c.focusNode,offset:c.focusOffset})),jm&&8===e.input.lastKeyCode)for(let e=s;e>o;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let d=e.state.doc,p=e.someProp("domParser")||Gh.fromSchema(e.state.schema),h=d.resolve(a),f=null,m=p.parse(i,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Cy,context:h});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+a,head:t+a}}return{doc:m,sel:f,from:a,to:l}}(e,t,n),d=e.state.doc,p=d.slice(u.from,u.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(a=e.state.selection.to,l="end"):(a=e.state.selection.from,l="start"),e.input.lastKeyCode=null;let h=function(e,t,n,r,i){let o=e.findDiffStart(t,n);if(null==o)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i){r-=s+Math.max(0,o-Math.min(s,a))-o}if(s<o&&e.size<t.size){o-=r<=o&&r>=s?o-r:0,a=o+(a-s),s=o}else if(a<o){o-=r<=o&&r>=a?o-r:0,s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}(p.content,u.doc.content,u.from,a,l);if((Pm&&e.input.lastIOSEnter>Date.now()-225||Hm)&&i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",(t=>t(e,tg(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!h){if(!(r&&c instanceof om&&!c.empty&&c.$head.sameParent(c.$anchor))||e.composing||u.sel&&u.sel.anchor!=u.sel.head){if(u.sel){let t=Ny(e,e.state.doc,u.sel);t&&!t.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(t))}return}h={start:c.from,endA:c.to,endB:c.to}}if(jm&&e.cursorWrapper&&u.sel&&u.sel.anchor==e.cursorWrapper.deco.from&&u.sel.head==u.sel.anchor){let e=h.endB-h.start;u.sel={anchor:u.sel.anchor+e,head:u.sel.anchor+e}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&h.start==h.endB&&e.state.selection instanceof om&&(h.start>e.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?h.start=e.state.selection.from:h.endA<e.state.selection.to&&h.endA>=e.state.selection.to-2&&e.state.selection.to<=u.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),Im&&Lm<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>u.from&&"  "==u.doc.textBetween(h.start-u.from-1,h.start-u.from+1)&&(h.start--,h.endA--,h.endB--);let f,m=u.doc.resolveNoCache(h.start-u.from),g=u.doc.resolveNoCache(h.endB-u.from),b=d.resolve(h.start),y=m.sameParent(g)&&m.parent.inlineContent&&b.end()>=h.endA;if((Pm&&e.input.lastIOSEnter>Date.now()-225&&(!y||i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!y&&m.pos<u.doc.content.size&&(f=tm.findFrom(u.doc.resolve(m.pos+1),1,!0))&&f.head==g.pos)&&e.someProp("handleKeyDown",(t=>t(e,tg(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>h.start&&function(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||Ay(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(Ay(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||Ay(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(d,h.start,h.endA,m,g)&&e.someProp("handleKeyDown",(t=>t(e,tg(8,"Backspace")))))return void(Hm&&jm&&e.domObserver.suppressSelectionUpdates());jm&&Hm&&h.endB==h.start&&(e.input.lastAndroidDelete=Date.now()),Hm&&!y&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==h.endA&&(h.endB-=2,g=u.doc.resolveNoCache(h.endB-u.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,tg(13,"Enter"))}))}),20));let v,w,_,x=h.start,E=h.endA;if(y)if(m.pos==g.pos)Im&&Lm<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Jg(e)),20)),v=e.state.tr.delete(x,E),w=d.resolve(h.start).marksAcross(d.resolve(h.endA));else if(h.endA==h.endB&&(_=function(e,t){let n,r,i,o=e.firstChild.marks,s=t.firstChild.marks,a=o,l=s;for(let e=0;e<s.length;e++)a=s[e].removeFromSet(a);for(let e=0;e<o.length;e++)l=o[e].removeFromSet(l);if(1==a.length&&0==l.length)r=a[0],n="add",i=e=>e.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",i=e=>e.mark(r.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(i(t.child(e)));if(ih.from(c).eq(e))return{mark:r,type:n}}(m.parent.content.cut(m.parentOffset,g.parentOffset),b.parent.content.cut(b.parentOffset,h.endA-b.start()))))v=e.state.tr,"add"==_.type?v.addMark(x,E,_.mark):v.removeMark(x,E,_.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let t=m.parent.textBetween(m.parentOffset,g.parentOffset);if(e.someProp("handleTextInput",(n=>n(e,x,E,t))))return;v=e.state.tr.insertText(t,x,E)}if(v||(v=e.state.tr.replace(x,E,u.doc.slice(h.start-u.from,h.endB-u.from))),u.sel){let t=Ny(e,v.doc,u.sel);t&&!(jm&&Hm&&e.composing&&t.empty&&(h.start!=h.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==x||t.head==v.mapping.map(E)-1)||Im&&t.empty&&t.head==x)&&v.setSelection(t)}w&&v.ensureMarks(w),e.dispatch(v.scrollIntoView())}function Ny(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:ib(e,t.resolve(n.anchor),t.resolve(n.head))}function Ay(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}class Oy{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Lb,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(zy),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Ly(this),Iy(this),this.nodeViews=Fy(this),this.docView=Ig(this.state.doc,Ty(this),wy(this),this.dom,this),this.domObserver=new ky(this,((e,t,n,r)=>Sy(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in Ob){let n=Ob[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Rb(e,t)||jb(e,t)||!e.editable&&t.type in Tb||n(e,t)},Ib[t]?{passive:!0}:void 0)}Bm&&e.dom.addEventListener("input",(()=>null)),zb(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&zb(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(zy),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(Jb(this),i=!0),this.state=e;let o=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(o||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Fy(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(o||t.handleDOMEvents!=this._props.handleDOMEvents)&&zb(this),this.editable=Ly(this),Iy(this);let s=wy(this),a=Ty(this),l=n.plugins==e.plugins||n.doc.eq(e.doc)?e.scrollToSelection>n.scrollToSelection?"to selection":"preserve":"reset",c=r||!this.docView.matchesNode(e.doc,a,s);!c&&e.selection.eq(n.selection)||(i=!0);let u="preserve"==l&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(o,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=i-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:sg(e.dom)}}(this);if(i){this.domObserver.stop();let t=c&&(Im||jm)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(n.selection,e.selection);if(c){let n=jm?this.trackWrites=this.domSelection().focusNode:null;!r&&this.docView.update(e.doc,a,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Ig(e.doc,a,s,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return Ym(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Jg(this,t):(nb(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():u&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;ag(n,0==r?0:r-t)}(u)}scrollToSelection(){let e=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(this.state.selection instanceof am){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&og(this,t.getBoundingClientRect(),e)}else og(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let r=0;r<this.directPlugins.length;r++){let i=this.directPlugins[r].props[e];if(null!=i&&(n=t?t(i):i))return n}let i=this.state.plugins;if(i)for(let r=0;r<i.length;r++){let o=i[r].props[e];if(null!=o&&(n=t?t(o):o))return n}}hasFocus(){if(Im){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(lg)return e.focus(lg);let t=sg(e);e.focus(null==lg?{get preventScroll(){return lg={preventScroll:!0},!0}}:void 0),lg||(lg=!1,ag(t,0))}(this.dom),Jg(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return e||document}posAtCoords(e){return pg(this,e)}coordsAtPos(e,t=1){return mg(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return Eg(this,t||this.state,e)}destroy(){this.docView&&(!function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],wy(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){jb(e,t)||!Ob[t.type]||!e.editable&&t.type in Tb||Ob[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelection(){return this.root.getSelection()}}function Ty(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e&&(t.class+=" "+n[e]),"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),[ay.node(0,e.state.doc.content.size,t)]}function Iy(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:ay.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Ly(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function Fy(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function zy(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var jy={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:"'"},Ry={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},By="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent);"undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent);for(var Py="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Uy="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Hy=Py||By&&+By[1]<57,$y=0;$y<10;$y++)jy[48+$y]=jy[96+$y]=String($y);for($y=1;$y<=24;$y++)jy[$y+111]="F"+$y;for($y=65;$y<=90;$y++)jy[$y]=String.fromCharCode($y+32),Ry[$y]=String.fromCharCode($y);for(var Wy in jy)Ry.hasOwnProperty(Wy)||(Ry[Wy]=jy[Wy]);const Vy="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function qy(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let e=0;e<o.length-1;e++){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);Vy?i=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function Ky(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function Gy(e){let t=function(e){let t=Object.create(null);for(let n in e)t[qy(n)]=e[n];return t}(e);return function(e,n){let r,i=function(e){var t=!(Hy&&(e.ctrlKey||e.altKey||e.metaKey)||Uy&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?Ry:jy)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),o=1==i.length&&" "!=i,s=t[Ky(i,n,!o)];if(s&&s(e.state,e.dispatch,e))return!0;if(o&&(n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(r=jy[n.keyCode])&&r!=i){let i=t[Ky(r,n,!0)];if(i&&i(e.state,e.dispatch,e))return!0}else if(o&&n.shiftKey){let r=t[Ky(i,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}return!1}}function Yy(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function Qy(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Jy(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function Zy(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Xy(e,t,n){let r,i,o=t.nodeBefore,s=t.nodeAfter;if(o.type.spec.isolating||s.type.spec.isolating)return!1;if(function(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(o,o+1)||!i.isTextblock&&!Rf(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(r=(i=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&i.matchType(r[0]||s.type).validEnd){if(n){let i=t.pos+s.nodeSize,a=ih.empty;for(let e=r.length-1;e>=0;e--)a=ih.from(r[e].create(null,a));a=ih.from(o.copy(a));let l=e.tr.step(new Of(t.pos-1,i,t.pos,i,new uh(a,1,0),r.length,!0)),c=i+2*r.length;Rf(l.doc,c)&&l.join(c),n(l.scrollIntoView())}return!0}let l=tm.findFrom(t,1),c=l&&l.$from.blockRange(l.$to),u=c&&Lf(c);if(null!=u&&u>=t.depth)return n&&n(e.tr.lift(c,u).scrollIntoView()),!0;if(a&&Yy(s,"start",!0)&&Yy(o,"end")){let r=o,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let a=s,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=ih.empty;for(let e=i.length-1;e>=0;e--)r=ih.from(i[e].copy(r));n(e.tr.step(new Of(t.pos-i.length,t.pos+s.nodeSize,t.pos+l,t.pos+s.nodeSize-l,new uh(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function ev(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(om.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}const tv=ev(-1),nv=ev(1);function rv(e,t=null){return function(n,r){let{from:i,to:o}=n.selection,s=!1;return n.doc.nodesBetween(i,o,((r,i)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{let t=n.doc.resolve(i),r=t.index();s=t.parent.canReplaceWith(r,r+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(i,o,e,t).scrollIntoView()),!0)}}function iv(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==i.index(s.depth-1))return!1;let e=n.doc.resolve(s.start-2);l=new Dh(e,e,s.depth),s.endIndex<s.parent.childCount&&(s=new Dh(i,n.doc.resolve(o.end(s.depth)),s.depth)),a=!0}let c=Ff(l,e,t,s);return!!c&&(r&&r(function(e,t,n,r,i){let o=ih.empty;for(let e=n.length-1;e>=0;e--)o=ih.from(n[e].type.create(n[e].attrs,o));e.step(new Of(t.start-(r?2:0),t.end,t.start,t.end,new uh(o,0,0),n.length,!0));let s=0;for(let e=0;e<n.length;e++)n[e].type==i&&(s=e+1);let a=n.length-s,l=t.start+n.length-(r?2:0),c=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&jf(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=c.child(n).nodeSize;return e}(n.tr,s,c,a,e).scrollIntoView()),!0)}}function ov(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,(t=>t.childCount>0&&t.firstChild.type==e));return!!o&&(!n||(r.node(o.depth-1).type==e?function(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new Of(o-1,s,o,s,new uh(ih.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Dh(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const a=Lf(r);if(null==a)return!1;i.lift(r,a);let l=i.mapping.map(o,-1)-1;Rf(i.doc,l)&&i.join(l);return t(i.scrollIntoView()),!0}(t,n,e,o):function(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,o=n.startIndex;t>o;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?ih.empty:ih.from(i))))return!1;let d=o.pos,p=d+s.nodeSize;return r.step(new Of(d-(a?1:0),p+(l?1:0),d+1,p-1,new uh((a?ih.empty:ih.from(i.copy(ih.empty))).append(l?ih.empty:ih.from(i.copy(ih.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}(t,n,o)))}}function sv(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class av{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(o);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],a=!!e,l=e||i.tr,c={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),i=n(...e)(r);return s.push(i),c}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(l),s.every((e=>!0===e)))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=!1,i=e||n.tr,o=this.buildProps(i,r),s=Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...o,dispatch:void 0})])));return{...s,chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r;i.storedMarks&&e.setStoredMarks(i.storedMarks);const s={tr:e,editor:r,view:o,state:sv({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map((([e,t])=>[e,(...e)=>t(...e)(s)])))}};return s}}function lv(e,t,n){if(void 0===e.config[t]&&e.parent)return lv(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?lv(e.parent,t,n):null})}return e.config[t]}function cv(e){return{baseExtensions:e.filter((e=>"extension"===e.type)),nodeExtensions:e.filter((e=>"node"===e.type)),markExtensions:e.filter((e=>"mark"===e.type))}}function uv(e){const t=[],{nodeExtensions:n,markExtensions:r}=cv(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=lv(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage});if(!n)return;n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...o,...r}})}))}))}))})),i.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=lv(e,"addAttributes",n);if(!r)return;const i=r();Object.entries(i).forEach((([n,r])=>{const i={...o,...r};(null==r?void 0:r.isRequired)&&void 0===(null==r?void 0:r.default)&&delete i.default,t.push({type:e.name,name:n,attribute:i})}))})),t}function dv(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function pv(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{n[e]?n[e]="class"===e?[n[e],t].join(" "):"style"===e?[n[e],t].join("; "):t:n[e]=t})),n}),{})}function hv(e,t){return t.filter((e=>e.attribute.rendered)).map((t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]})).reduce(((e,t)=>pv(e,t)),{})}function fv(e){return"function"==typeof e}function mv(e,t=void 0,...n){return fv(e)?t?e.bind(t)(...n):e(...n):e}function gv(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const i=t.reduce(((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}}),{});return{...r,...i}}}}function bv(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function yv(e,t){return t.nodes[e]||t.marks[e]||null}function vv(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function wv(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class _v{constructor(e){this.find=e.find,this.handler=e.handler}}function xv(e){var t;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null===(t=c.nodeBefore||c.nodeAfter)||void 0===t?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let u=!1;const d=((e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,((e,t,i,o)=>{var s,a;const l=(null===(a=(s=e.type.spec).toText)||void 0===a?void 0:a.call(s,{node:e,pos:t,parent:i,index:o}))||e.textContent||"%leaf%";n+=l.slice(0,Math.max(0,r-t))})),n})(c)+o;return s.forEach((e=>{if(u)return;const t=((e,t)=>{if(wv(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[];return r.push(n.text),r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(d,e.find);if(!t)return;const s=l.state.tr,c=sv({state:l.state,transaction:s}),p={from:r-(t[0].length-o.length),to:i},{commands:h,chain:f,can:m}=new av({editor:n,state:c});null!==e.handler({state:c,range:p,match:t,commands:h,chain:f,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:i,text:o}),l.dispatch(s),u=!0)})),u}function Ev(e){const{editor:t,rules:n}=e,r=new Em({state:{init:()=>null,apply(e,t){const n=e.getMeta(r);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(e,i,o,s)=>xv({editor:t,from:i,to:o,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:i}=e.state.selection;i&&xv({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;const{$cursor:o}=e.state.selection;return!!o&&xv({editor:t,from:o.pos,to:o.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}class kv{constructor(e){this.find=e.find,this.handler=e.handler}}function Mv(e){const{editor:t,state:n,from:r,to:i,rule:o}=e,{commands:s,chain:a,can:l}=new av({editor:t,state:n}),c=[];n.doc.nodesBetween(r,i,((e,t)=>{if(!e.isTextblock||e.type.spec.code)return;const u=Math.max(r,t),d=Math.min(i,t+e.content.size),p=((e,t)=>{if(wv(t))return[...e.matchAll(t)];const n=t(e);return n?n.map((t=>{const n=[];return n.push(t.text),n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n})):[]})(e.textBetween(u-t,d-t,void 0,""),o.find);p.forEach((e=>{if(void 0===e.index)return;const t=u+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},d=o.handler({state:n,range:i,match:e,commands:s,chain:a,can:l});c.push(d)}))}));return c.every((e=>null!==e))}function Dv(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1;const s=n.map((e=>new Em({view(e){const t=t=>{var n;r=(null===(n=e.dom.parentElement)||void 0===n?void 0:n.contains(t.target))?e.dom.parentElement:null};return window.addEventListener("dragstart",t),{destroy(){window.removeEventListener("dragstart",t)}}},props:{handleDOMEvents:{drop:e=>(o=r===e.dom.parentElement,!1),paste:(e,t)=>{var n;const r=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html");return i=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(n,r,s)=>{const a=n[0],l="paste"===a.getMeta("uiEvent")&&!i,c="drop"===a.getMeta("uiEvent")&&!o;if(!l&&!c)return;const u=r.doc.content.findDiffStart(s.doc.content),d=r.doc.content.findDiffEnd(s.doc.content);if("number"!=typeof u||!d||u===d.b)return;const p=s.tr,h=sv({state:s,transaction:p});return Mv({editor:t,state:h,from:Math.max(u-1,0),to:d.b-1,rule:e})&&p.steps.length?p:void 0}})));return s}class Cv{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Cv.resolve(e),this.schema=function(e){var t;const n=uv(e),{nodeExtensions:r,markExtensions:i}=cv(e),o=null===(t=r.find((e=>lv(e,"topNode"))))||void 0===t?void 0:t.name,s=Object.fromEntries(r.map((t=>{const r=n.filter((e=>e.type===t.name)),i={name:t.name,options:t.options,storage:t.storage},o=e.reduce(((e,n)=>{const r=lv(n,"extendNodeSchema",i);return{...e,...r?r(t):{}}}),{}),s=bv({...o,content:mv(lv(t,"content",i)),marks:mv(lv(t,"marks",i)),group:mv(lv(t,"group",i)),inline:mv(lv(t,"inline",i)),atom:mv(lv(t,"atom",i)),selectable:mv(lv(t,"selectable",i)),draggable:mv(lv(t,"draggable",i)),code:mv(lv(t,"code",i)),defining:mv(lv(t,"defining",i)),isolating:mv(lv(t,"isolating",i)),attrs:Object.fromEntries(r.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),a=mv(lv(t,"parseHTML",i));a&&(s.parseDOM=a.map((e=>gv(e,r))));const l=lv(t,"renderHTML",i);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:hv(e,r)}));const c=lv(t,"renderText",i);return c&&(s.toText=c),[t.name,s]}))),a=Object.fromEntries(i.map((t=>{const r=n.filter((e=>e.type===t.name)),i={name:t.name,options:t.options,storage:t.storage},o=e.reduce(((e,n)=>{const r=lv(n,"extendMarkSchema",i);return{...e,...r?r(t):{}}}),{}),s=bv({...o,inclusive:mv(lv(t,"inclusive",i)),excludes:mv(lv(t,"excludes",i)),group:mv(lv(t,"group",i)),spanning:mv(lv(t,"spanning",i)),code:mv(lv(t,"code",i)),attrs:Object.fromEntries(r.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),a=mv(lv(t,"parseHTML",i));a&&(s.parseDOM=a.map((e=>gv(e,r))));const l=lv(t,"renderHTML",i);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:hv(e,r)})),[t.name,s]})));return new qh({topNode:o,nodes:s,marks:a})}(this.extensions),this.extensions.forEach((e=>{var t;this.editor.extensionStorage[e.name]=e.storage;const n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:yv(e.name,this.schema)};if("mark"===e.type){(null===(t=mv(lv(e,"keepOnSplit",n)))||void 0===t||t)&&this.splittableMarks.push(e.name)}const r=lv(e,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const i=lv(e,"onCreate",n);i&&this.editor.on("create",i);const o=lv(e,"onUpdate",n);o&&this.editor.on("update",o);const s=lv(e,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=lv(e,"onTransaction",n);a&&this.editor.on("transaction",a);const l=lv(e,"onFocus",n);l&&this.editor.on("focus",l);const c=lv(e,"onBlur",n);c&&this.editor.on("blur",c);const u=lv(e,"onDestroy",n);u&&this.editor.on("destroy",u)}))}static resolve(e){const t=Cv.sort(Cv.flatten(e)),n=function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return[...new Set(t)]}(t.map((e=>e.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((e=>`'${e}'`)).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map((e=>{const t=lv(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...this.flatten(t())]:e})).flat(10)}static sort(e){const t=100;return e.sort(((e,n)=>{const r=lv(e,"priority")||t,i=lv(n,"priority")||t;return r>i?-1:r<i?1:0}))}get commands(){return this.extensions.reduce(((e,t)=>{const n=lv(t,"addCommands",{name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:yv(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=Cv.sort([...this.extensions].reverse()),n=[],r=[],i=t.map((t=>{const i={name:t.name,options:t.options,storage:t.storage,editor:e,type:yv(t.name,this.schema)},o=[],s=lv(t,"addKeyboardShortcuts",i);let a={};if("mark"===t.type&&t.config.exitable&&(a.ArrowRight=()=>ww.handleExit({editor:e,mark:t})),s){const t=Object.fromEntries(Object.entries(s()).map((([t,n])=>[t,()=>n({editor:e})])));a={...a,...t}}const l=new Em({props:{handleKeyDown:Gy(a)}});o.push(l);const c=lv(t,"addInputRules",i);vv(t,e.options.enableInputRules)&&c&&n.push(...c());const u=lv(t,"addPasteRules",i);vv(t,e.options.enablePasteRules)&&u&&r.push(...u());const d=lv(t,"addProseMirrorPlugins",i);if(d){const e=d();o.push(...e)}return o})).flat();return[Ev({editor:e,rules:n}),...Dv({editor:e,rules:r}),...i]}get attributes(){return uv(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=cv(this.extensions);return Object.fromEntries(t.filter((e=>!!lv(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:t.storage,editor:e,type:dv(t.name,this.schema)},i=lv(t,"addNodeView",r);if(!i)return[];return[t.name,(r,o,s,a)=>{const l=hv(r,n);return i()({editor:e,node:r,getPos:s,decorations:a,HTMLAttributes:l,extension:t})}]})))}}function Sv(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function Nv(e,t){const n={...e};return Sv(e)&&Sv(t)&&Object.keys(t).forEach((r=>{Sv(t[r])?r in e?n[r]=Nv(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})})),n}class Av{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=mv(lv(this,"addOptions",{name:this.name}))),this.storage=mv(lv(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Av(e)}configure(e={}){const t=this.extend();return t.options=Nv(this.options,e),t.storage=mv(lv(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Av(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=mv(lv(t,"addOptions",{name:t.name})),t.storage=mv(lv(t,"addStorage",{name:t.name,options:t.options})),t}}function Ov(e,t,n){const{from:r,to:i}=t,{blockSeparator:o="\n\n",textSerializers:s={}}=n||{};let a="",l=!0;return e.nodesBetween(r,i,((e,n,c,u)=>{var d;const p=null==s?void 0:s[e.type.name];p?(e.isBlock&&!l&&(a+=o,l=!0),c&&(a+=p({node:e,pos:n,parent:c,index:u,range:t}))):e.isText?(a+=null===(d=null==e?void 0:e.text)||void 0===d?void 0:d.slice(Math.max(r,n)-n,i-n),l=!1):e.isBlock&&!l&&(a+=o,l=!0)})),a}function Tv(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}const Iv=Av.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Em({key:new Dm("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map((e=>e.$from.pos))),a=Math.max(...o.map((e=>e.$to.pos)));return Ov(r,{from:s,to:a},{textSerializers:Tv(n)})}}})]}});function Lv(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:wv(t[r])?t[r].test(e[r]):t[r]===e[r]))}function Fv(e,t,n={}){return e.find((e=>e.type===t&&Lv(e.attrs,n)))}function zv(e,t,n={}){return!!Fv(e,t,n)}function jv(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&0!==r.offset&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const i=Fv([...r.node.marks],t,n);if(!i)return;let o=r.index,s=e.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(Fv([...r.node.marks],t,n);o>0&&i.isInSet(e.parent.child(o-1).marks);)o-=1,s-=e.parent.child(o).nodeSize;for(;a<e.parent.childCount&&zv([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Rv(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function Bv(e){return e instanceof om}function Pv(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Uv(e,t=null){if(!t)return null;const n=tm.atStart(e),r=tm.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const i=n.from,o=r.to;return"all"===t?om.create(e,Pv(0,i,o),Pv(e.content.size,i,o)):om.create(e,Pv(t,i,o),Pv(t,i,o))}function Hv(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function $v(e){const t=`<body>${e}</body>`;return(new window.DOMParser).parseFromString(t,"text/html").body}function Wv(e,t,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof e&&null!==e)try{return Array.isArray(e)?ih.fromArray(e.map((e=>t.nodeFromJSON(e)))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Wv("",t,n)}if("string"==typeof e){const r=Gh.fromSchema(t);return n.slice?r.parseSlice($v(e),n.parseOptions).content:r.parse($v(e),n.parseOptions)}return Wv("",t,n)}function Vv(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function qv(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,s=t?dv(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);a.push({node:e,from:n,to:o})}));const l=i-r,c=a.filter((e=>!s||s.name===e.node.type.name)).filter((e=>Lv(e.node.attrs,n,{strict:!1})));if(o)return!!c.length;return c.reduce(((e,t)=>e+t.to-t.from),0)>=l}function Kv(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Gv(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}function Yv(e,t,n={}){return Wv(e,t,{slice:!1,parseOptions:n})}function Qv(e,t){const n=[];return e.descendants(((e,r)=>{t(e)&&n.push({node:e,pos:r})})),n}function Jv(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function Zv(e,t){const n=Rv(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,(e=>{s.push(...e.marks)}));const a=s.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function Xv(e,t){const n=Kv("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=dv(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,(e=>{o.push(e)}));const s=o.reverse().find((e=>e.type.name===n.name));return s?{...s.attrs}:{}}(e,t):"mark"===n?Zv(e,t):{}}function ew(e){const t=function(e,t=JSON.stringify){const n={};return e.filter((e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter(((e,n)=>{const r=t.filter(((e,t)=>t!==n));return!r.some((t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}))}function tw(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach((t=>{const i=jv(n.resolve(e-1),t.type);i&&r.push({mark:t,...i})})):n.nodesBetween(e,t,((e,t)=>{r.push(...e.marks.map((n=>({from:t,to:t+e.nodeSize,mark:n}))))})),r}function nw(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Rv(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!o||o.name===e.type.name)).find((e=>Lv(e.attrs,n,{strict:!1})));let s=0;const a=[];if(i.forEach((({$from:t,$to:n})=>{const r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);s+=o-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:o}))))}))})),0===s)return!1;const l=a.filter((e=>!o||o.name===e.mark.type.name)).filter((e=>Lv(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),c=a.filter((e=>!o||e.mark.type!==o&&e.mark.type.excludes(o))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+c:l)>=s}function rw(e,t){const{nodeExtensions:n}=cv(t),r=n.find((t=>t.name===e));if(!r)return!1;const i=mv(lv(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof i&&i.split(" ").includes("list")}function iw(e,t,n){const r=0,i=e.state.doc.content.size,o=Pv(t,r,i),s=Pv(n,r,i),a=e.coordsAtPos(o),l=e.coordsAtPos(s,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),p=Math.max(a.right,l.right),h={top:c,bottom:u,left:d,right:p,width:p-d,height:u-c,x:d,y:c};return{...h,toJSON:()=>h}}function ow(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}function sw(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(r)}}const aw=(e,t)=>{const n=Jv((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!Rf(e.doc,n.pos)||(e.join(n.pos),!0)},lw=(e,t)=>{const n=Jv((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!Rf(e.doc,r)||(e.join(r),!0)};var cw=Object.freeze({__proto__:null,blur:()=>({editor:e,view:t})=>(requestAnimationFrame((()=>{var n;e.isDestroyed||(t.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(e=!1)=>({commands:t})=>t.setContent("",e),clearNodes:()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return!n||(i.forEach((({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,((e,n)=>{if(e.type.isText)return;const{doc:r,mapping:i}=t,o=r.resolve(i.map(n)),s=r.resolve(i.map(n+e.nodeSize)),a=o.blockRange(s);if(!a)return;const l=Lf(a);if(e.type.isTextblock){const{defaultType:e}=o.parent.contentMatchAt(o.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)}))})),!0)},command:e=>t=>e(t),createParagraphNear:()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof cm||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Zy(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(n,o.createAndFill());s.setSelection(om.create(s.doc,n+1)),t(s.scrollIntoView())}return!0})(e,t),deleteNode:e=>({tr:t,state:n,dispatch:r})=>{const i=dv(e,n.schema),o=t.selection.$anchor;for(let e=o.depth;e>0;e-=1){if(o.node(e).type===i){if(r){const n=o.before(e),r=o.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},deleteRange:e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},deleteSelection:()=>({state:e,dispatch:t})=>((e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0))(e,t),enter:()=>({commands:e})=>e.keyboardShortcut("Enter"),exitCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=Zy(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,s.createAndFill());i.setSelection(tm.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0})(e,t),extendMarkRange:(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Rv(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(i){const e=jv(l,o,t);if(e&&e.from<=c&&e.to>=u){const t=om.create(s,e.from,e.to);n.setSelection(t)}}return!0},first:e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1},focus:(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const s=()=>{Hv()&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===e||!1===e)return!0;if(o&&null===e&&!Bv(n.state.selection))return s(),!0;const a=Uv(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},forEach:(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),insertContent:(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),insertContentAt:(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const i=Wv(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===i.toString())return!0;let{from:s,to:a}="number"==typeof e?{from:e,to:e}:e,l=!0,c=!0;if((i.toString().startsWith("<")?i:[i]).forEach((e=>{e.check(),l=!!l&&(e.isText&&0===e.marks.length),c=!!c&&e.isBlock})),s===a&&c){const{parent:e}=r.doc.resolve(s);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(s-=1,a+=1)}l?r.insertText(t,s,a):r.replaceWith(s,a,i),n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof Af||i instanceof Of))return;const o=e.mapping.maps[r];let s=0;o.forEach(((e,t,n,r)=>{0===s&&(s=r)})),e.setSelection(tm.near(e.doc.resolve(s),n))}(r,r.steps.length-1,-1)}return!0},joinBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;let i=Qy(r);if(!i){let n=r.blockRange(),i=n&&Lf(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Xy(e,i,t))return!0;if(0==r.parent.content.size&&(Yy(o,"end")||am.isSelectable(o))){let n=Pf(e.doc,r.before(),r.after(),uh.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Yy(o,"end")?tm.findFrom(r.doc.resolve(r.mapping.map(i.pos,-1)),-1):am.create(r.doc,i.pos-o.nodeSize)),t(r.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1||(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),0))})(e,t),joinForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;let i=Jy(r);if(!i)return!1;let o=i.nodeAfter;if(Xy(e,i,t))return!0;if(0==r.parent.content.size&&(Yy(o,"start")||am.isSelectable(o))){let n=Pf(e.doc,r.before(),r.after(),uh.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Yy(o,"start")?tm.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):am.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1||(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),0))})(e,t),keyboardShortcut:e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=function(e){const t=e.split(/-(?!$)/);let n,r,i,o,s=t[t.length-1];"Space"===s&&(s=" ");for(let e=0;e<t.length-1;e+=1){const s=t[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))i=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);Hv()||Vv()?o=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),o&&(s=`Meta-${s}`),i&&(s=`Shift-${s}`),s}(e).split(/-(?!$)/),s=o.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction((()=>{n.someProp("handleKeyDown",(e=>e(n,a)))}));return null==l||l.steps.forEach((e=>{const t=e.map(r.mapping);t&&i&&r.maybeStep(t)})),!0},lift:(e,t={})=>({state:n,dispatch:r})=>!!qv(n,dv(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&Lf(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)})(n,r),liftEmptyBlock:()=>({state:e,dispatch:t})=>((e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(jf(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Lf(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)})(e,t),liftListItem:e=>({state:t,dispatch:n})=>ov(dv(e,t.schema))(t,n),newlineInCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))})(e,t),resetAttributes:(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Kv("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(o=dv(e,r.schema)),"mark"===a&&(s=Rv(e,r.schema)),i&&n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,Gv(e.attrs,t)),s&&e.marks.length&&e.marks.forEach((i=>{s===i.type&&n.addMark(r,r+e.nodeSize,s.create(Gv(i.attrs,t)))}))}))})),!0)},scrollIntoView:()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),selectAll:()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),selectNodeBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=Qy(r)}let s=o&&o.nodeBefore;return!(!s||!am.isSelectable(s)||(t&&t(e.tr.setSelection(am.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),0))})(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=Jy(r)}let s=o&&o.nodeAfter;return!(!s||!am.isSelectable(s)||(t&&t(e.tr.setSelection(am.create(e.doc,o.pos)).scrollIntoView()),0))})(e,t),selectParentNode:()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:r,to:i}=e.selection,o=r.sharedDepth(i);return 0!=o&&(n=r.before(o),t&&t(e.tr.setSelection(am.create(e.doc,n))),!0)})(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>nv(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>tv(e,t),setContent:(e,t=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:s}=r,a=Yv(e,i.schema,n);return o&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!t),!0},setMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Rv(e,r.schema);if(i)if(s){const e=Zv(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const i=e.$from.pos,o=e.$to.pos;r.doc.nodesBetween(i,o,((e,r)=>{const s=Math.max(r,i),a=Math.min(r+e.nodeSize,o);e.marks.find((e=>e.type===l))?e.marks.forEach((e=>{l===e.type&&n.addMark(s,a,l.create({...e.attrs,...t}))})):n.addMark(s,a,l.create(t))}))}));return function(e,t,n){var r;const{selection:i}=t;let o=null;if(Bv(i)&&(o=i.$cursor),o){const t=null!==(r=e.storedMarks)&&void 0!==r?r:o.marks();return!!n.isInSet(t)||!t.some((e=>e.type.excludes(n)))}const{ranges:s}=i;return s.some((({$from:t,$to:r})=>{let i=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,((e,t,r)=>{if(i)return!1;if(e.isInline){const t=!r||r.type.allowsMarkType(n),o=!!n.isInSet(e.marks)||!e.marks.some((e=>e.type.excludes(n)));i=t&&o}return!i})),i}))}(r,n,l)},setMeta:(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),setNode:(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=dv(e,n.schema);return o.isTextblock?i().command((({commands:e})=>!!rv(o,t)(n)||e.clearNodes())).command((({state:e})=>rv(o,t)(e,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=Pv(e,0,n.content.size),i=am.create(n,r);t.setSelection(i)}return!0},setTextSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,o=om.atStart(n).from,s=om.atEnd(n).to,a=Pv(r,o,s),l=Pv(i,o,s),c=om.create(n,a,l);t.setSelection(c)}return!0},sinkListItem:e=>({state:t,dispatch:n})=>{const r=dv(e,t.schema);return(i=r,function(e,t){let{$from:n,$to:r}=e.selection,o=n.blockRange(r,(e=>e.childCount>0&&e.firstChild.type==i));if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=i)return!1;if(t){let n=l.lastChild&&l.lastChild.type==a.type,r=ih.from(n?i.create():null),s=new uh(ih.from(i.create(null,ih.from(a.type.create(null,r)))),n?3:1,0),c=o.start,u=o.end;t(e.tr.step(new Of(c-(n?3:1),u,c,u,s,1,!0)).scrollIntoView())}return!0})(t,n);var i},splitBlock:({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=t,{$from:a,$to:l}=o,c=ow(i.extensionManager.attributes,a.node().type.name,a.node().attrs);if(o instanceof am&&o.node.isBlock)return!(!a.parentOffset||!jf(s,a.pos))&&(r&&(e&&sw(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const r=l.parentOffset===l.parent.content.size;o instanceof om&&t.deleteSelection();const s=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let u=r&&s?[{type:s,attrs:c}]:void 0,d=jf(t.doc,t.mapping.map(a.pos),1,u);if(u||d||!jf(t.doc,t.mapping.map(a.pos),1,s?[{type:s}]:void 0)||(d=!0,u=s?[{type:s,attrs:c}]:void 0),d&&(t.split(t.mapping.map(a.pos),1,u),s&&!r&&!a.parentOffset&&a.parent.type!==s)){const e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,s)&&t.setNodeMarkup(t.mapping.map(a.before()),s)}e&&sw(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0},splitListItem:e=>({tr:t,state:n,dispatch:r,editor:i})=>{var o;const s=dv(e,n.schema),{$from:a,$to:l}=n.selection,c=n.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==s)return!1;const d=i.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let e=ih.empty;const n=a.index(-1)?1:a.index(-2)?2:3;for(let t=a.depth-n;t>=a.depth-3;t-=1)e=ih.from(a.node(t).copy(e));const r=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,i=ow(d,a.node().type.name,a.node().attrs),l=(null===(o=s.contentMatch.defaultType)||void 0===o?void 0:o.createAndFill(i))||void 0;e=e.append(ih.from(s.createAndFill(null,l)||void 0));const c=a.before(a.depth-(n-1));t.replace(c,a.after(-r),new uh(e,4-n,0));let u=-1;t.doc.nodesBetween(c,t.doc.content.size,((e,t)=>{if(u>-1)return!1;e.isTextblock&&0===e.content.size&&(u=t+1)})),u>-1&&t.setSelection(om.near(t.doc.resolve(u))),t.scrollIntoView()}return!0}const p=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,h=ow(d,u.type.name,u.attrs),f=ow(d,a.node().type.name,a.node().attrs);t.delete(a.pos,l.pos);const m=p?[{type:s,attrs:h},{type:p,attrs:f}]:[{type:s,attrs:h}];return!!jf(t.doc,a.pos,2)&&(r&&t.split(a.pos,2,m).scrollIntoView(),!0)},toggleList:(e,t)=>({editor:n,tr:r,state:i,dispatch:o,chain:s,commands:a,can:l})=>{const{extensions:c}=n.extensionManager,u=dv(e,i.schema),d=dv(t,i.schema),{selection:p}=i,{$from:h,$to:f}=p,m=h.blockRange(f);if(!m)return!1;const g=Jv((e=>rw(e.type.name,c)))(p);if(m.depth>=1&&g&&m.depth-g.depth<=1){if(g.node.type===u)return a.liftListItem(d);if(rw(g.node.type.name,c)&&u.validContent(g.node.content)&&o)return s().command((()=>(r.setNodeMarkup(g.pos,u),!0))).command((()=>aw(r,u))).command((()=>lw(r,u))).run()}return s().command((()=>!!l().wrapInList(u)||a.clearNodes())).wrapInList(u).command((()=>aw(r,u))).command((()=>lw(r,u))).run()},toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Rv(e,r.schema);return nw(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},toggleNode:(e,t,n={})=>({state:r,commands:i})=>{const o=dv(e,r.schema),s=dv(t,r.schema);return qv(r,o,n)?i.setNode(s):i.setNode(o,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const i=dv(e,n.schema);return qv(n,i,t)?r.lift(i):r.wrapIn(i,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const t=e.tr,n=o.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(o.text){const n=t.doc.resolve(o.from).marks();t.replaceWith(o.from,o.to,e.schema.text(o.text,n))}else t.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=Rv(e,r.schema),{$from:c,empty:u,ranges:d}=a;if(!i)return!0;if(u&&s){let{from:e,to:t}=a;const r=null===(o=c.marks().find((e=>e.type===l)))||void 0===o?void 0:o.attrs,i=jv(c,l,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,l)}else d.forEach((e=>{n.removeMark(e.$from.pos,e.$to.pos,l)}));return n.removeStoredMark(l),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Kv("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(o=dv(e,r.schema)),"mark"===a&&(s=Rv(e,r.schema)),i&&n.selection.ranges.forEach((e=>{const i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,((e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),s&&e.marks.length&&e.marks.forEach((o=>{if(s===o.type){const l=Math.max(r,i),c=Math.min(r+e.nodeSize,a);n.addMark(l,c,s.create({...o.attrs,...t}))}}))}))})),!0)},wrapIn:(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&Ff(s,e,t);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(dv(e,n.schema),t)(n,r),wrapInList:(e,t={})=>({state:n,dispatch:r})=>iv(dv(e,n.schema),t)(n,r)});const uw=Av.create({name:"commands",addCommands:()=>({...cw})}),dw=Av.create({name:"editable",addProseMirrorPlugins(){return[new Em({key:new Dm("editable"),props:{editable:()=>this.editor.options.editable}})]}}),pw=Av.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Em({key:new Dm("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),hw=Av.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:r}=t,{empty:i,$anchor:o}=n,{pos:s,parent:a}=o,l=tm.atStart(r).from===s;return!(!(i&&l&&a.type.isTextblock)||a.textContent.length)&&e.clearNodes()})),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()])),t=()=>this.editor.commands.first((({commands:e})=>[()=>e.deleteSelection(),()=>e.joinForward(),()=>e.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Hv()||Vv()?i:r},addProseMirrorPlugins(){return[new Em({key:new Dm("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some((e=>e.docChanged))&&!t.doc.eq(n.doc)))return;const{empty:r,from:i,to:o}=t.selection,s=tm.atStart(t.doc).from,a=tm.atEnd(t.doc).to,l=i===s&&o===a,c=0===n.doc.textBetween(0,n.doc.content.size," "," ").length;if(r||!l||!c)return;const u=n.tr,d=sv({state:n,transaction:u}),{commands:p}=new av({editor:this.editor,state:d});return p.clearNodes(),u.steps.length?u:void 0}})]}}),fw=Av.create({name:"tabindex",addProseMirrorPlugins(){return[new Em({key:new Dm("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var mw=Object.freeze({__proto__:null,ClipboardTextSerializer:Iv,Commands:uw,Editable:dw,FocusEvents:pw,Keymap:hw,Tabindex:fw});const gw=`.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 1px !important;\n height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}`;function bw(e){return new _v({find:e.find,handler:({state:t,range:n,match:r})=>{const i=mv(e.getAttributes,void 0,r);if(!1===i||null===i)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length;if(tw(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>c)).length)return null;u<n.to&&o.delete(u,n.to),c>n.from&&o.delete(n.from+r,c),l=n.from+r+s.length,o.addMark(n.from+r,l,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function yw(e){return new _v({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=mv(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function vw(e){return new _v({find:e.find,handler:({state:t,range:n,match:r})=>{const i=mv(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),a=s&&Ff(s,e.type,i);if(!a)return null;o.wrap(s,a);const l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Rf(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)}})}class ww{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=mv(lv(this,"addOptions",{name:this.name}))),this.storage=mv(lv(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ww(e)}configure(e={}){const t=this.extend();return t.options=Nv(this.options,e),t.storage=mv(lv(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new ww(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=mv(lv(t,"addOptions",{name:t.name})),t.storage=mv(lv(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const i=r.marks(),o=!!i.find((e=>(null==e?void 0:e.type.name)===t.name));if(!o)return!1;const s=i.find((e=>(null==e?void 0:e.type.name)===t.name));return s&&n.removeStoredMark(s),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}}class _w{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=mv(lv(this,"addOptions",{name:this.name}))),this.storage=mv(lv(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new _w(e)}configure(e={}){const t=this.extend();return t.options=Nv(this.options,e),t.storage=mv(lv(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new _w(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=mv(lv(t,"addOptions",{name:t.name})),t.storage=mv(lv(t,"addStorage",{name:t.name,options:t.options})),t}}function xw(e){return new kv({find:e.find,handler:({state:t,range:n,match:r})=>{const i=mv(e.getAttributes,void 0,r);if(!1===i||null===i)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length;if(tw(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>c)).length)return null;u<n.to&&o.delete(u,n.to),c>n.from&&o.delete(n.from+r,c),l=n.from+r+s.length,o.addMark(n.from+r,l,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}var Ew="top",kw="bottom",Mw="right",Dw="left",Cw="auto",Sw=[Ew,kw,Mw,Dw],Nw="start",Aw="end",Ow="clippingParents",Tw="viewport",Iw="popper",Lw="reference",Fw=Sw.reduce((function(e,t){return e.concat([t+"-"+Nw,t+"-"+Aw])}),[]),zw=[].concat(Sw,[Cw]).reduce((function(e,t){return e.concat([t,t+"-"+Nw,t+"-"+Aw])}),[]),jw=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Rw(e){return e?(e.nodeName||"").toLowerCase():null}function Bw(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Pw(e){return e instanceof Bw(e).Element||e instanceof Element}function Uw(e){return e instanceof Bw(e).HTMLElement||e instanceof HTMLElement}function Hw(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Bw(e).ShadowRoot||e instanceof ShadowRoot)}var $w={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];Uw(i)&&Rw(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});Uw(r)&&Rw(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function Ww(e){return e.split("-")[0]}var Vw=Math.max,qw=Math.min,Kw=Math.round;function Gw(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function Yw(){return!/^((?!chrome|android).)*safari/i.test(Gw())}function Qw(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Uw(e)&&(i=e.offsetWidth>0&&Kw(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Kw(r.height)/e.offsetHeight||1);var s=(Pw(e)?Bw(e):window).visualViewport,a=!Yw()&&n,l=(r.left+(a&&s?s.offsetLeft:0))/i,c=(r.top+(a&&s?s.offsetTop:0))/o,u=r.width/i,d=r.height/o;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l,x:l,y:c}}function Jw(e){var t=Qw(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Zw(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Hw(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Xw(e){return Bw(e).getComputedStyle(e)}function e_(e){return["table","td","th"].indexOf(Rw(e))>=0}function t_(e){return((Pw(e)?e.ownerDocument:e.document)||window.document).documentElement}function n_(e){return"html"===Rw(e)?e:e.assignedSlot||e.parentNode||(Hw(e)?e.host:null)||t_(e)}function r_(e){return Uw(e)&&"fixed"!==Xw(e).position?e.offsetParent:null}function i_(e){for(var t=Bw(e),n=r_(e);n&&e_(n)&&"static"===Xw(n).position;)n=r_(n);return n&&("html"===Rw(n)||"body"===Rw(n)&&"static"===Xw(n).position)?t:n||function(e){var t=/firefox/i.test(Gw());if(/Trident/i.test(Gw())&&Uw(e)&&"fixed"===Xw(e).position)return null;var n=n_(e);for(Hw(n)&&(n=n.host);Uw(n)&&["html","body"].indexOf(Rw(n))<0;){var r=Xw(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function o_(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function s_(e,t,n){return Vw(e,qw(t,n))}function a_(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function l_(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var c_={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Ww(n.placement),l=o_(a),c=[Dw,Mw].indexOf(a)>=0?"height":"width";if(o&&s){var u=function(e,t){return a_("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:l_(e,Sw))}(i.padding,n),d=Jw(o),p="y"===l?Ew:Dw,h="y"===l?kw:Mw,f=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],m=s[l]-n.rects.reference[l],g=i_(o),b=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,y=f/2-m/2,v=u[p],w=b-d[c]-u[h],_=b/2-d[c]/2+y,x=s_(v,_,w),E=l;n.modifiersData[r]=((t={})[E]=x,t.centerOffset=x-_,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&Zw(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function u_(e){return e.split("-")[1]}var d_={top:"auto",right:"auto",bottom:"auto",left:"auto"};function p_(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,p=s.x,h=void 0===p?0:p,f=s.y,m=void 0===f?0:f,g="function"==typeof u?u({x:h,y:m}):{x:h,y:m};h=g.x,m=g.y;var b=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),v=Dw,w=Ew,_=window;if(c){var x=i_(n),E="clientHeight",k="clientWidth";if(x===Bw(n)&&"static"!==Xw(x=t_(n)).position&&"absolute"===a&&(E="scrollHeight",k="scrollWidth"),i===Ew||(i===Dw||i===Mw)&&o===Aw)w=kw,m-=(d&&x===_&&_.visualViewport?_.visualViewport.height:x[E])-r.height,m*=l?1:-1;if(i===Dw||(i===Ew||i===kw)&&o===Aw)v=Mw,h-=(d&&x===_&&_.visualViewport?_.visualViewport.width:x[k])-r.width,h*=l?1:-1}var M,D=Object.assign({position:a},c&&d_),C=!0===u?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:Kw(t*r)/r||0,y:Kw(n*r)/r||0}}({x:h,y:m}):{x:h,y:m};return h=C.x,m=C.y,l?Object.assign({},D,((M={})[w]=y?"0":"",M[v]=b?"0":"",M.transform=(_.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",M)):Object.assign({},D,((t={})[w]=y?m+"px":"",t[v]=b?h+"px":"",t.transform="",t))}var h_={passive:!0};var f_={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,s=r.resize,a=void 0===s||s,l=Bw(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach((function(e){e.addEventListener("scroll",n.update,h_)})),a&&l.addEventListener("resize",n.update,h_),function(){o&&c.forEach((function(e){e.removeEventListener("scroll",n.update,h_)})),a&&l.removeEventListener("resize",n.update,h_)}},data:{}},m_={left:"right",right:"left",bottom:"top",top:"bottom"};function g_(e){return e.replace(/left|right|bottom|top/g,(function(e){return m_[e]}))}var b_={start:"end",end:"start"};function y_(e){return e.replace(/start|end/g,(function(e){return b_[e]}))}function v_(e){var t=Bw(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function w_(e){return Qw(t_(e)).left+v_(e).scrollLeft}function __(e){var t=Xw(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function x_(e){return["html","body","#document"].indexOf(Rw(e))>=0?e.ownerDocument.body:Uw(e)&&__(e)?e:x_(n_(e))}function E_(e,t){var n;void 0===t&&(t=[]);var r=x_(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=Bw(r),s=i?[o].concat(o.visualViewport||[],__(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(E_(n_(s)))}function k_(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function M_(e,t,n){return t===Tw?k_(function(e,t){var n=Bw(e),r=t_(e),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var c=Yw();(c||!c&&"fixed"===t)&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+w_(e),y:l}}(e,n)):Pw(t)?function(e,t){var n=Qw(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):k_(function(e){var t,n=t_(e),r=v_(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=Vw(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Vw(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+w_(e),l=-r.scrollTop;return"rtl"===Xw(i||n).direction&&(a+=Vw(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(t_(e)))}function D_(e,t,n,r){var i="clippingParents"===t?function(e){var t=E_(n_(e)),n=["absolute","fixed"].indexOf(Xw(e).position)>=0&&Uw(e)?i_(e):e;return Pw(n)?t.filter((function(e){return Pw(e)&&Zw(e,n)&&"body"!==Rw(e)})):[]}(e):[].concat(t),o=[].concat(i,[n]),s=o[0],a=o.reduce((function(t,n){var i=M_(e,n,r);return t.top=Vw(i.top,t.top),t.right=qw(i.right,t.right),t.bottom=qw(i.bottom,t.bottom),t.left=Vw(i.left,t.left),t}),M_(e,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function C_(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?Ww(i):null,s=i?u_(i):null,a=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case Ew:t={x:a,y:n.y-r.height};break;case kw:t={x:a,y:n.y+n.height};break;case Mw:t={x:n.x+n.width,y:l};break;case Dw:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=o?o_(o):null;if(null!=c){var u="y"===c?"height":"width";switch(s){case Nw:t[c]=t[c]-(n[u]/2-r[u]/2);break;case Aw:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}function S_(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.strategy,s=void 0===o?e.strategy:o,a=n.boundary,l=void 0===a?Ow:a,c=n.rootBoundary,u=void 0===c?Tw:c,d=n.elementContext,p=void 0===d?Iw:d,h=n.altBoundary,f=void 0!==h&&h,m=n.padding,g=void 0===m?0:m,b=a_("number"!=typeof g?g:l_(g,Sw)),y=p===Iw?Lw:Iw,v=e.rects.popper,w=e.elements[f?y:p],_=D_(Pw(w)?w:w.contextElement||t_(e.elements.popper),l,u,s),x=Qw(e.elements.reference),E=C_({reference:x,element:v,strategy:"absolute",placement:i}),k=k_(Object.assign({},v,E)),M=p===Iw?k:x,D={top:_.top-M.top+b.top,bottom:M.bottom-_.bottom+b.bottom,left:_.left-M.left+b.left,right:M.right-_.right+b.right},C=e.modifiersData.offset;if(p===Iw&&C){var S=C[i];Object.keys(D).forEach((function(e){var t=[Mw,kw].indexOf(e)>=0?1:-1,n=[Ew,kw].indexOf(e)>=0?"y":"x";D[e]+=S[n]*t}))}return D}function N_(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?zw:l,u=u_(r),d=u?a?Fw:Fw.filter((function(e){return u_(e)===u})):Sw,p=d.filter((function(e){return c.indexOf(e)>=0}));0===p.length&&(p=d);var h=p.reduce((function(t,n){return t[n]=S_(e,{placement:n,boundary:i,rootBoundary:o,padding:s})[Ww(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var A_={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,f=void 0===h||h,m=n.allowedAutoPlacements,g=t.options.placement,b=Ww(g),y=l||(b===g||!f?[g_(g)]:function(e){if(Ww(e)===Cw)return[];var t=g_(e);return[y_(e),t,y_(t)]}(g)),v=[g].concat(y).reduce((function(e,n){return e.concat(Ww(n)===Cw?N_(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:f,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,_=t.rects.popper,x=new Map,E=!0,k=v[0],M=0;M<v.length;M++){var D=v[M],C=Ww(D),S=u_(D)===Nw,N=[Ew,kw].indexOf(C)>=0,A=N?"width":"height",O=S_(t,{placement:D,boundary:u,rootBoundary:d,altBoundary:p,padding:c}),T=N?S?Mw:Dw:S?kw:Ew;w[A]>_[A]&&(T=g_(T));var I=g_(T),L=[];if(o&&L.push(O[C]<=0),a&&L.push(O[T]<=0,O[I]<=0),L.every((function(e){return e}))){k=D,E=!1;break}x.set(D,L)}if(E)for(var F=function(e){var t=v.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return k=t,"break"},z=f?3:1;z>0;z--){if("break"===F(z))break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function O_(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function T_(e){return[Ew,Mw,kw,Dw].some((function(t){return e[t]>=0}))}var I_={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=S_(t,{elementContext:"reference"}),a=S_(t,{altBoundary:!0}),l=O_(s,r),c=O_(a,i,o),u=T_(l),d=T_(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}};var L_={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,s=zw.reduce((function(e,n){return e[n]=function(e,t,n){var r=Ww(e),i=[Dw,Ew].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[Dw,Mw].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,o),e}),{}),a=s[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}};var F_={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=C_({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var z_={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,h=void 0===p||p,f=n.tetherOffset,m=void 0===f?0:f,g=S_(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),b=Ww(t.placement),y=u_(t.placement),v=!y,w=o_(b),_="x"===w?"y":"x",x=t.modifiersData.popperOffsets,E=t.rects.reference,k=t.rects.popper,M="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,D="number"==typeof M?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),C=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,S={x:0,y:0};if(x){if(o){var N,A="y"===w?Ew:Dw,O="y"===w?kw:Mw,T="y"===w?"height":"width",I=x[w],L=I+g[A],F=I-g[O],z=h?-k[T]/2:0,j=y===Nw?E[T]:k[T],R=y===Nw?-k[T]:-E[T],B=t.elements.arrow,P=h&&B?Jw(B):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},H=U[A],$=U[O],W=s_(0,E[T],P[T]),V=v?E[T]/2-z-W-H-D.mainAxis:j-W-H-D.mainAxis,q=v?-E[T]/2+z+W+$+D.mainAxis:R+W+$+D.mainAxis,K=t.elements.arrow&&i_(t.elements.arrow),G=K?"y"===w?K.clientTop||0:K.clientLeft||0:0,Y=null!=(N=null==C?void 0:C[w])?N:0,Q=I+q-Y,J=s_(h?qw(L,I+V-Y-G):L,I,h?Vw(F,Q):F);x[w]=J,S[w]=J-I}if(a){var Z,X="x"===w?Ew:Dw,ee="x"===w?kw:Mw,te=x[_],ne="y"===_?"height":"width",re=te+g[X],ie=te-g[ee],oe=-1!==[Ew,Dw].indexOf(b),se=null!=(Z=null==C?void 0:C[_])?Z:0,ae=oe?re:te-E[ne]-k[ne]-se+D.altAxis,le=oe?te+E[ne]+k[ne]-se-D.altAxis:ie,ce=h&&oe?function(e,t,n){var r=s_(e,t,n);return r>n?n:r}(ae,te,le):s_(h?ae:re,te,h?le:ie);x[_]=ce,S[_]=ce-te}t.modifiersData[r]=S}},requiresIfExists:["offset"]};function j_(e,t,n){void 0===n&&(n=!1);var r,i,o=Uw(t),s=Uw(t)&&function(e){var t=e.getBoundingClientRect(),n=Kw(t.width)/e.offsetWidth||1,r=Kw(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),a=t_(t),l=Qw(e,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==Rw(t)||__(a))&&(c=(r=t)!==Bw(r)&&Uw(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:v_(r)),Uw(t)?((u=Qw(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):a&&(u.x=w_(a))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function R_(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var B_={placement:"bottom",modifiers:[],strategy:"absolute"};function P_(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function U_(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,i=t.defaultOptions,o=void 0===i?B_:i;return function(e,t,n){void 0===n&&(n=o);var i,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},B_,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,u={state:a,setOptions:function(n){var i="function"==typeof n?n(a.options):n;d(),a.options=Object.assign({},o,a.options,i),a.scrollParents={reference:Pw(e)?E_(e):e.contextElement?E_(e.contextElement):[],popper:E_(t)};var s=function(e){var t=R_(e);return jw.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(r,a.options.modifiers)));return a.orderedModifiers=s.filter((function(e){return e.enabled})),a.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var o=i({state:a,name:t,instance:u,options:r}),s=function(){};l.push(o||s)}})),u.update()},forceUpdate:function(){if(!c){var e=a.elements,t=e.reference,n=e.popper;if(P_(t,n)){a.rects={reference:j_(t,i_(n),"fixed"===a.options.strategy),popper:Jw(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(e){return a.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<a.orderedModifiers.length;r++)if(!0!==a.reset){var i=a.orderedModifiers[r],o=i.fn,s=i.options,l=void 0===s?{}:s,d=i.name;"function"==typeof o&&(a=o({state:a,options:l,name:d,instance:u})||a)}else a.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){u.forceUpdate(),e(a)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(i())}))}))),s}),destroy:function(){d(),c=!0}};if(!P_(e,t))return u;function d(){l.forEach((function(e){return e()})),l=[]}return u.setOptions(n).then((function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)})),u}}var H_=U_({defaultModifiers:[f_,F_,{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,l=void 0===a||a,c={placement:Ww(t.placement),variation:u_(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,p_(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,p_(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},$w,L_,A_,z_,c_,I_]}),$_='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',W_="tippy-box",V_="tippy-content",q_="tippy-backdrop",K_="tippy-arrow",G_="tippy-svg-arrow",Y_={passive:!0,capture:!0},Q_=function(){return document.body};function J_(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Z_(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function X_(e,t){return"function"==typeof e?e.apply(void 0,t):e}function ex(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function tx(e){return[].concat(e)}function nx(e,t){-1===e.indexOf(t)&&e.push(t)}function rx(e){return[].slice.call(e)}function ix(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function ox(){return document.createElement("div")}function sx(e){return["Element","Fragment"].some((function(t){return Z_(e,t)}))}function ax(e){return sx(e)?[e]:function(e){return Z_(e,"NodeList")}(e)?rx(e):Array.isArray(e)?e:rx(document.querySelectorAll(e))}function lx(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function cx(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function ux(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function dx(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var px={isTouch:!1},hx=0;function fx(){px.isTouch||(px.isTouch=!0,window.performance&&document.addEventListener("mousemove",mx))}function mx(){var e=performance.now();e-hx<20&&(px.isTouch=!1,document.removeEventListener("mousemove",mx)),hx=e}function gx(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var bx=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,yx=Object.assign({appendTo:Q_,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),vx=Object.keys(yx);function wx(e){var t=(e.plugins||[]).reduce((function(t,n){var r,i=n.name,o=n.defaultValue;i&&(t[i]=void 0!==e[i]?e[i]:null!=(r=yx[i])?r:o);return t}),{});return Object.assign({},e,t)}function _x(e,t){var n=Object.assign({},t,{content:X_(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(wx(Object.assign({},yx,{plugins:t}))):vx).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},yx.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function xx(e,t){e["innerHTML"]=t}function Ex(e){var t=ox();return!0===e?t.className=K_:(t.className=G_,sx(e)?t.appendChild(e):xx(t,e)),t}function kx(e,t){sx(t.content)?(xx(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?xx(e,t.content):e.textContent=t.content)}function Mx(e){var t=e.firstElementChild,n=rx(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(V_)})),arrow:n.find((function(e){return e.classList.contains(K_)||e.classList.contains(G_)})),backdrop:n.find((function(e){return e.classList.contains(q_)}))}}function Dx(e){var t=ox(),n=ox();n.className=W_,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ox();function i(n,r){var i=Mx(t),o=i.box,s=i.content,a=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||kx(s,e.props),r.arrow?a?n.arrow!==r.arrow&&(o.removeChild(a),o.appendChild(Ex(r.arrow))):o.appendChild(Ex(r.arrow)):a&&o.removeChild(a)}return r.className=V_,r.setAttribute("data-state","hidden"),kx(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}Dx.$$tippy=!0;var Cx=1,Sx=[],Nx=[];function Ax(e,t){var n,r,i,o,s,a,l,c,u=_x(e,Object.assign({},yx,wx(ix(t)))),d=!1,p=!1,h=!1,f=!1,m=[],g=ex(K,u.interactiveDebounce),b=Cx++,y=(c=u.plugins).filter((function(e,t){return c.indexOf(e)===t})),v={id:b,reference:e,popper:ox(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:y,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(i)},setProps:function(t){if(v.state.isDestroyed)return;I("onBeforeUpdate",[v,t]),V();var n=v.props,r=_x(e,Object.assign({},n,ix(t),{ignoreAttributes:!0}));v.props=r,W(),n.interactiveDebounce!==r.interactiveDebounce&&(z(),g=ex(K,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?tx(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");F(),T(),x&&x(n,r);v.popperInstance&&(J(),X().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));I("onAfterUpdate",[v,t])},setContent:function(e){v.setProps({content:e})},show:function(){var e=v.state.isVisible,t=v.state.isDestroyed,n=!v.state.isEnabled,r=px.isTouch&&!v.props.touch,i=J_(v.props.duration,0,yx.duration);if(e||t||n||r)return;if(S().hasAttribute("disabled"))return;if(I("onShow",[v],!1),!1===v.props.onShow(v))return;v.state.isVisible=!0,C()&&(_.style.visibility="visible");T(),P(),v.state.isMounted||(_.style.transition="none");if(C()){var o=A(),s=o.box,l=o.content;lx([s,l],0)}a=function(){var e;if(v.state.isVisible&&!f){if(f=!0,_.offsetHeight,_.style.transition=v.props.moveTransition,C()&&v.props.animation){var t=A(),n=t.box,r=t.content;lx([n,r],i),cx([n,r],"visible")}L(),F(),nx(Nx,v),null==(e=v.popperInstance)||e.forceUpdate(),I("onMount",[v]),v.props.animation&&C()&&function(e,t){H(e,t)}(i,(function(){v.state.isShown=!0,I("onShown",[v])}))}},function(){var e,t=v.props.appendTo,n=S();e=v.props.interactive&&t===Q_||"parent"===t?n.parentNode:X_(t,[n]);e.contains(_)||e.appendChild(_);v.state.isMounted=!0,J()}()},hide:function(){var e=!v.state.isVisible,t=v.state.isDestroyed,n=!v.state.isEnabled,r=J_(v.props.duration,1,yx.duration);if(e||t||n)return;if(I("onHide",[v],!1),!1===v.props.onHide(v))return;v.state.isVisible=!1,v.state.isShown=!1,f=!1,d=!1,C()&&(_.style.visibility="hidden");if(z(),U(),T(!0),C()){var i=A(),o=i.box,s=i.content;v.props.animation&&(lx([o,s],r),cx([o,s],"hidden"))}L(),F(),v.props.animation?C()&&function(e,t){H(e,(function(){!v.state.isVisible&&_.parentNode&&_.parentNode.contains(_)&&t()}))}(r,v.unmount):v.unmount()},hideWithInteractivity:function(e){N().addEventListener("mousemove",g),nx(Sx,g),g(e)},enable:function(){v.state.isEnabled=!0},disable:function(){v.hide(),v.state.isEnabled=!1},unmount:function(){v.state.isVisible&&v.hide();if(!v.state.isMounted)return;Z(),X().forEach((function(e){e._tippy.unmount()})),_.parentNode&&_.parentNode.removeChild(_);Nx=Nx.filter((function(e){return e!==v})),v.state.isMounted=!1,I("onHidden",[v])},destroy:function(){if(v.state.isDestroyed)return;v.clearDelayTimeouts(),v.unmount(),V(),delete e._tippy,v.state.isDestroyed=!0,I("onDestroy",[v])}};if(!u.render)return v;var w=u.render(v),_=w.popper,x=w.onUpdate;_.setAttribute("data-tippy-root",""),_.id="tippy-"+v.id,v.popper=_,e._tippy=v,_._tippy=v;var E=y.map((function(e){return e.fn(v)})),k=e.hasAttribute("aria-expanded");return W(),F(),T(),I("onCreate",[v]),u.showOnCreate&&ee(),_.addEventListener("mouseenter",(function(){v.props.interactive&&v.state.isVisible&&v.clearDelayTimeouts()})),_.addEventListener("mouseleave",(function(){v.props.interactive&&v.props.trigger.indexOf("mouseenter")>=0&&N().addEventListener("mousemove",g)})),v;function M(){var e=v.props.touch;return Array.isArray(e)?e:[e,0]}function D(){return"hold"===M()[0]}function C(){var e;return!(null==(e=v.props.render)||!e.$$tippy)}function S(){return l||e}function N(){var e,t,n=S().parentNode;return n?null!=(t=tx(n)[0])&&null!=(e=t.ownerDocument)&&e.body?t.ownerDocument:document:document}function A(){return Mx(_)}function O(e){return v.state.isMounted&&!v.state.isVisible||px.isTouch||o&&"focus"===o.type?0:J_(v.props.delay,e?0:1,yx.delay)}function T(e){void 0===e&&(e=!1),_.style.pointerEvents=v.props.interactive&&!e?"":"none",_.style.zIndex=""+v.props.zIndex}function I(e,t,n){var r;(void 0===n&&(n=!0),E.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=v.props)[e].apply(r,t)}function L(){var t=v.props.aria;if(t.content){var n="aria-"+t.content,r=_.id;tx(v.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(v.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function F(){!k&&v.props.aria.expanded&&tx(v.props.triggerTarget||e).forEach((function(e){v.props.interactive?e.setAttribute("aria-expanded",v.state.isVisible&&e===S()?"true":"false"):e.removeAttribute("aria-expanded")}))}function z(){N().removeEventListener("mousemove",g),Sx=Sx.filter((function(e){return e!==g}))}function j(t){if(!px.isTouch||!h&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!v.props.interactive||!dx(_,n)){if(tx(v.props.triggerTarget||e).some((function(e){return dx(e,n)}))){if(px.isTouch)return;if(v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else I("onClickOutside",[v,t]);!0===v.props.hideOnClick&&(v.clearDelayTimeouts(),v.hide(),p=!0,setTimeout((function(){p=!1})),v.state.isMounted||U())}}}function R(){h=!0}function B(){h=!1}function P(){var e=N();e.addEventListener("mousedown",j,!0),e.addEventListener("touchend",j,Y_),e.addEventListener("touchstart",B,Y_),e.addEventListener("touchmove",R,Y_)}function U(){var e=N();e.removeEventListener("mousedown",j,!0),e.removeEventListener("touchend",j,Y_),e.removeEventListener("touchstart",B,Y_),e.removeEventListener("touchmove",R,Y_)}function H(e,t){var n=A().box;function r(e){e.target===n&&(ux(n,"remove",r),t())}if(0===e)return t();ux(n,"remove",s),ux(n,"add",r),s=r}function $(t,n,r){void 0===r&&(r=!1),tx(v.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),m.push({node:e,eventType:t,handler:n,options:r})}))}function W(){var e;D()&&($("touchstart",q,{passive:!0}),$("touchend",G,{passive:!0})),(e=v.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch($(e,q),e){case"mouseenter":$("mouseleave",G);break;case"focus":$(bx?"focusout":"blur",Y);break;case"focusin":$("focusout",Y)}}))}function V(){m.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),m=[]}function q(e){var t,n=!1;if(v.state.isEnabled&&!Q(e)&&!p){var r="focus"===(null==(t=o)?void 0:t.type);o=e,l=e.currentTarget,F(),!v.state.isVisible&&Z_(e,"MouseEvent")&&Sx.forEach((function(t){return t(e)})),"click"===e.type&&(v.props.trigger.indexOf("mouseenter")<0||d)&&!1!==v.props.hideOnClick&&v.state.isVisible?n=!0:ee(e),"click"===e.type&&(d=!n),n&&!r&&te(e)}}function K(e){var t=e.target,n=S().contains(t)||_.contains(t);if("mousemove"!==e.type||!n){var r=X().concat(_).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:u}:null})).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,s=i.placement.split("-")[0],a=i.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,c="top"===s?a.bottom.y:0,u="right"===s?a.left.x:0,d="left"===s?a.right.x:0,p=t.top-r+l>o,h=r-t.bottom-c>o,f=t.left-n+u>o,m=n-t.right-d>o;return p||h||f||m}))})(r,e)&&(z(),te(e))}}function G(e){Q(e)||v.props.trigger.indexOf("click")>=0&&d||(v.props.interactive?v.hideWithInteractivity(e):te(e))}function Y(e){v.props.trigger.indexOf("focusin")<0&&e.target!==S()||v.props.interactive&&e.relatedTarget&&_.contains(e.relatedTarget)||te(e)}function Q(e){return!!px.isTouch&&D()!==e.type.indexOf("touch")>=0}function J(){Z();var t=v.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,s=t.moveTransition,l=C()?Mx(_).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||S()}:e,u={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(C()){var n=A().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}},d=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},u];C()&&l&&d.push({name:"arrow",options:{element:l,padding:3}}),d.push.apply(d,(null==n?void 0:n.modifiers)||[]),v.popperInstance=H_(c,_,Object.assign({},n,{placement:r,onFirstUpdate:a,modifiers:d}))}function Z(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function X(){return rx(_.querySelectorAll("[data-tippy-root]"))}function ee(e){v.clearDelayTimeouts(),e&&I("onTrigger",[v,e]),P();var t=O(!0),r=M(),i=r[0],o=r[1];px.isTouch&&"hold"===i&&o&&(t=o),t?n=setTimeout((function(){v.show()}),t):v.show()}function te(e){if(v.clearDelayTimeouts(),I("onUntrigger",[v,e]),v.state.isVisible){if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&d)){var t=O(!1);t?r=setTimeout((function(){v.state.isVisible&&v.hide()}),t):i=requestAnimationFrame((function(){v.hide()}))}}else U()}}function Ox(e,t){void 0===t&&(t={});var n=yx.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",fx,Y_),window.addEventListener("blur",gx);var r=Object.assign({},t,{plugins:n}),i=ax(e).reduce((function(e,t){var n=t&&Ax(t,r);return n&&e.push(n),e}),[]);return sx(e)?i[0]:i}Ox.defaultProps=yx,Ox.setDefaultProps=function(e){Object.keys(e).forEach((function(t){yx[t]=e[t]}))},Ox.currentInput=px,Object.assign({},$w,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),Ox.setDefaultProps({render:Dx});class Tx{constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:e,state:t,from:n,to:r})=>{const{doc:i,selection:o}=t,{empty:s}=o,a=!i.textBetween(n,r).length&&Bv(t.selection),l=this.element.contains(document.activeElement);return!(!e.hasFocus()&&!l||s||a||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.editor=e,this.element=t,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=Ox(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(e=>{this.blurHandler({event:e})})))}update(e,t){var n,r,i;const{state:o,composing:s}=e,{doc:a,selection:l}=o,c=t&&t.doc.eq(a)&&t.selection.eq(l);if(s||c)return;this.createTooltip();const{ranges:u}=l,d=Math.min(...u.map((e=>e.$from.pos))),p=Math.max(...u.map((e=>e.$to.pos)));(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:o,oldState:t,from:d,to:p}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(i=this.tippyOptions)||void 0===i?void 0:i.getReferenceClientRect)||(()=>{if(o.selection instanceof am){const t=e.nodeDOM(d);if(t)return t.getBoundingClientRect()}return iw(e,d,p)})}),this.show()):this.hide()}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Ix=e=>new Em({key:"string"==typeof e.pluginKey?new Dm(e.pluginKey):e.pluginKey,view:t=>new Tx({view:t,...e})});Av.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[Ix({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});class Lx{constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:e,state:t})=>{const{selection:n}=t,{$anchor:r,empty:i}=n,o=1===r.depth,s=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent;return!!(e.hasFocus()&&i&&o&&s&&this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.editor=e,this.element=t,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=Ox(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(e=>{this.blurHandler({event:e})})))}update(e,t){var n,r,i;const{state:o}=e,{doc:s,selection:a}=o,{from:l,to:c}=a;if(t&&t.doc.eq(s)&&t.selection.eq(a))return;this.createTooltip();(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:o,oldState:t}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(i=this.tippyOptions)||void 0===i?void 0:i.getReferenceClientRect)||(()=>iw(e,l,c))}),this.show()):this.hide()}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}Av.create({name:"floatingMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[(e={pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow},new Em({key:"string"==typeof e.pluginKey?new Dm(e.pluginKey):e.pluginKey,view:t=>new Lx({view:t,...e})}))]:[];var e}});const Fx=e=>{const[t,n]=i(null);return a((()=>{if(!t)return;if(e.editor.isDestroyed)return;const{pluginKey:n="bubbleMenu",editor:r,tippyOptions:i={},shouldShow:o=null}=e,s=Ix({pluginKey:n,editor:r,element:t,tippyOptions:i,shouldShow:o});return r.registerPlugin(s),()=>r.unregisterPlugin(n)}),[e.editor,t]),r.createElement("div",{ref:n,className:e.className,style:{visibility:"hidden"}},e.children)};class zx extends class extends class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach((e=>e.apply(this,t))),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter((e=>e!==t)):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout((()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))}),0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=function(e,t){const n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;const r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}(gw,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e){this.setOptions({editable:e}),this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const n=fv(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(e){if(this.isDestroyed)return;const t="string"==typeof e?`${e}$`:e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((e=>!e.key.startsWith(t)))});this.view.updateState(n)}createExtensionManager(){const e=[...this.options.enableCoreExtensions?Object.values(mw):[],...this.options.extensions].filter((e=>["extension","node","mark"].includes(null==e?void 0:e.type)));this.extensionManager=new Cv(e,this)}createCommandManager(){this.commandManager=new av({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=Yv(this.options.content,this.schema,this.options.parseOptions),t=Uv(e,this.options.autofocus);this.view=new Oy(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:_m.create({doc:e,selection:t||void 0})});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews();this.view.dom.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach((e=>{var t;return null===(t=this.capturedTransaction)||void 0===t?void 0:t.step(e)})):void(this.capturedTransaction=e);const t=this.state.apply(e),n=!this.state.selection.eq(t.selection);this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const r=e.getMeta("focus"),i=e.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return Xv(this.state,e)}isActive(e,t){const n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return qv(e,null,n)||nw(e,null,n);const r=Kv(t,e.schema);return"node"===r?qv(e,t,n):"mark"===r&&nw(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(e,t){const n=lf.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return function(e,t){return Ov(e,{from:0,to:e.content.size},t)}(this.state.doc,{blockSeparator:t,textSerializers:{...n,...Tv(this.schema)}})}get isEmpty(){return function(e){var t;const n=null===(t=e.type.createAndFill())||void 0===t?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(null===(e=this.view)||void 0===e?void 0:e.docView)}}{constructor(){super(...arguments),this.contentComponent=null}}const jx=({renderers:e})=>r.createElement(r.Fragment,null,Array.from(e).map((([e,t])=>ue.createPortal(t.reactElement,t.element,e))));class Rx extends r.Component{constructor(e){super(e),this.editorContentRef=r.createRef(),this.state={renderers:new Map}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:e}=this.props;if(e&&e.options.element){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=this,e.createNodeViews()}}componentWillUnmount(){const{editor:e}=this.props;if(!e)return;if(e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild)return;const t=document.createElement("div");t.append(...e.options.element.childNodes),e.setOptions({element:t})}render(){const{editor:e,...t}=this.props;return r.createElement(r.Fragment,null,r.createElement("div",{ref:this.editorContentRef,...t}),r.createElement(jx,{renderers:this.state.renderers}))}}const Bx=r.memo(Rx),Px=l({onDragStart:void 0}),Ux=()=>c(Px),Hx=e=>{const t=e.as||"div",{nodeViewContentRef:n}=Ux();return r.createElement(t,{...e,ref:n,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style}})},$x=r.forwardRef(((e,t)=>{const{onDragStart:n}=Ux(),i=e.as||"div";return r.createElement(i,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})}));class Wx{constructor(e,{editor:t,props:n={},as:r="div",className:i=""}){this.ref=null,this.id=Math.floor(4294967295*Math.random()).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.render()}render(){const e=this.component,t=this.props;(function(e){return!("function"!=typeof e||!e.prototype||!e.prototype.isReactComponent)}(e)||function(e){var t;return!("object"!=typeof e||"Symbol(react.forward_ref)"!==(null===(t=e.$$typeof)||void 0===t?void 0:t.toString()))}(e))&&(t.ref=e=>{this.ref=e}),this.reactElement=r.createElement(e,{...t}),queueMicrotask((()=>{de((()=>{var e;(null===(e=this.editor)||void 0===e?void 0:e.contentComponent)&&this.editor.contentComponent.setState({renderers:this.editor.contentComponent.state.renderers.set(this.id,this)})}))}))}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){queueMicrotask((()=>{de((()=>{var e;if(null===(e=this.editor)||void 0===e?void 0:e.contentComponent){const{renderers:e}=this.editor.contentComponent.state;e.delete(this.id),this.editor.contentComponent.setState({renderers:e})}}))}))}}class Vx extends class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,i,o,s,a;const{view:l}=this.editor,c=e.target,u=3===c.nodeType?null===(t=c.parentElement)||void 0===t?void 0:t.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(c))||!u)return;let d=0,p=0;if(this.dom!==u){const t=this.dom.getBoundingClientRect(),n=u.getBoundingClientRect(),a=null!==(r=e.offsetX)&&void 0!==r?r:null===(i=e.nativeEvent)||void 0===i?void 0:i.offsetX,l=null!==(o=e.offsetY)&&void 0!==o?o:null===(s=e.nativeEvent)||void 0===s?void 0:s.offsetY;d=n.x-t.x+a,p=n.y-t.y+l}null===(a=e.dataTransfer)||void 0===a||a.setDragImage(this.dom,d,p);const h=am.create(l.state.doc,this.getPos()),f=l.state.tr.setSelection(h);l.dispatch(f)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!(null===(t=this.contentDOM)||void 0===t?void 0:t.contains(n))))return!1;const r="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!r)return!0;const{isEditable:i}=this.editor,{isDragging:o}=this,s=!!this.node.type.spec.draggable,a=am.isSelectable(this.node),l="copy"===e.type,c="paste"===e.type,u="cut"===e.type,d="mousedown"===e.type,p=e.type.startsWith("drag");if(!s&&a&&p&&e.preventDefault(),s&&p&&!o)return e.preventDefault(),!1;if(s&&i&&!o&&d){const e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener("dragend",(()=>{this.isDragging=!1}),{once:!0}),document.addEventListener("mouseup",(()=>{this.isDragging=!1}),{once:!0}))}return!(o||r||l||c||u||d&&a)}ignoreMutation(e){if(!this.dom||!this.contentDOM)return!0;if("function"==typeof this.options.ignoreMutation)return this.options.ignoreMutation({mutation:e});if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===e.type)return!1;if(this.dom.contains(e.target)&&"childList"===e.type&&Hv()&&this.editor.isFocused){if([...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every((e=>e.isContentEditable)))return!1}return this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command((({tr:t})=>{const n=this.getPos();return t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0}))}deleteNode(){const e=this.getPos(),t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}}{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const e=e=>e.charAt(0).toUpperCase()+e.substring(1);this.component.displayName=e(this.extension.name)}const t=e=>{const t=this.component,n=this.onDragStart.bind(this);return r.createElement(Px.Provider,{value:{onDragStart:n,nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&e.appendChild(this.contentDOMElement)}}},r.createElement(t,{...e}))};t.displayName="ReactNodeView",this.contentDOMElement=this.node.isLeaf?null:document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let n=this.node.isInline?"span":"div";this.options.as&&(n=this.options.as);const{className:i=""}=this.options;this.renderer=new Wx(t,{editor:this.editor,props:e,as:n,className:`node-${this.node.type.name} ${i}`.trim()})}get dom(){var e;if(this.renderer.element.firstElementChild&&!(null===(e=this.renderer.element.firstElementChild)||void 0===e?void 0:e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(e,t){const n=e=>{this.renderer.updateProps(e)};if(e.type!==this.node.type)return!1;if("function"==typeof this.options.update){const r=this.node,i=this.decorations;return this.node=e,this.decorations=t,this.options.update({oldNode:r,oldDecorations:i,newNode:e,newDecorations:t,updateProps:()=>n({node:e,decorations:t})})}return e===this.node&&this.decorations===t||(this.node=e,this.decorations=t,n({node:e,decorations:t})),!0}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy(),this.contentDOMElement=null}}function qx(e,t){return n=>n.editor.contentComponent?new Vx(e,n,t):{}}const Kx=(e={},t=[])=>{const[n,r]=i(null),o=function(){const[,e]=i(0);return()=>e((e=>e+1))}();return a((()=>{let t=!0;const n=new zx(e);return r(n),n.on("transaction",(()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{t&&o()}))}))})),()=>{n.destroy(),t=!1}}),t),n},Gx=e=>{let{error:t,isFixedMenuActive:n,children:i}=e;const o=!_e(t)&&n,s=qe({"neeto-editor-error":o});return r.createElement(r.Fragment,null,r.createElement("div",{className:s},i),o&&r.createElement("p",{className:"neeto-ui-input__error"},(()=>{if(!t)return null;let e;return he(String,t)?e=t:he(Array,t)?e=t[0]:he(Object,t)&&(e=t.message),_e(e)?null:e})()))},Yx=[Ke.BOLD,Ke.ITALIC,Ke.UNDERLINE,Ke.STRIKETHROUGH,Ke.LINK,Ke.PARAGRAPH,Ke.H1,Ke.H2,Ke.LIST_BULLETS,Ke.LIST_ORDERED,Ke.CODE],Qx=12,Jx=1,Zx=21,Xx=e=>{let{editor:t,isActive:n,children:i}=e;return n&&t?r.createElement(r.Fragment,null,i,r.createElement("p",{className:"neeto-editor-character-count","data-cy":"neeto-editor-character-count"},t.storage.characterCount.characters()," characters")):i},eE=Av.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize"}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){return t.textBetween(0,t.content.size,void 0," ").length}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;return t.textBetween(0,t.content.size," "," ").split(" ").filter((e=>""!==e)).length}},addProseMirrorPlugins(){return[new Em({key:new Dm("characterCount"),filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n)return!0;if(r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r)return!1;if(!e.getMeta("paste"))return!1;const o=e.selection.$head.pos,s=o-(i-n),a=o;e.deleteRange(s,a);return!(this.storage.characters({node:e.doc})>n)}})]}}),tE=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,nE=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,rE=ww.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[bw({find:tE,type:this.type})]},addPasteRules(){return[xw({find:nE,type:this.type})]}}),iE=_w.create({name:"doc",topNode:!0,content:"block+"}),oE=Av.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new Em({key:new Dm("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,o=[];if(!n||!r)return uy.create(e,[]);let s=0;"deepest"===this.options.mode&&e.descendants(((e,t)=>{if(e.isText)return;if(!(i>=t&&i<=t+e.nodeSize-1))return!1;s+=1}));let a=0;return e.descendants(((e,t)=>{if(e.isText)return!1;if(!(i>=t&&i<=t+e.nodeSize-1))return!1;a+=1;if("deepest"===this.options.mode&&s-a>0||"shallowest"===this.options.mode&&a>1)return"deepest"===this.options.mode;o.push(ay.node(t,t+e.nodeSize,{class:this.options.className}))})),uy.create(e,o)}}})]}}),sE=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,aE=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,lE=ww.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}`}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:e}){return["mark",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[bw({find:sE,type:this.type})]},addPasteRules(){return[xw({find:aE,type:this.type})]}});function cE(e){this.j={},this.jr=[],this.jd=null,this.t=e}cE.prototype={accepts:function(){return!!this.t},tt:function(e,t){if(t&&t.j)return this.j[e]=t,t;var n=t,r=this.j[e];if(r)return n&&(r.t=n),r;r=uE();var i=fE(this,e);return i?(Object.assign(r.j,i.j),r.jr.append(i.jr),r.jr=i.jd,r.t=n||i.t):r.t=n,this.j[e]=r,r}};var uE=function(){return new cE},dE=function(e){return new cE(e)},pE=function(e,t,n){e.j[t]||(e.j[t]=n)},hE=function(e,t,n){e.jr.push([t,n])},fE=function(e,t){var n=e.j[t];if(n)return n;for(var r=0;r<e.jr.length;r++){var i=e.jr[r][0],o=e.jr[r][1];if(i.test(t))return o}return e.jd},mE=function(e,t,n){for(var r=0;r<t.length;r++)pE(e,t[r],n)},gE=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0],i=t[n][1];pE(e,r,i)}},bE=function(e,t,n,r){for(var i,o=0,s=t.length;o<s&&(i=e.j[t[o]]);)e=i,o++;if(o>=s)return[];for(;o<s-1;)i=r(),pE(e,t[o],i),e=i,o++;pE(e,t[s-1],n)},yE="DOMAIN",vE="LOCALHOST",wE="TLD",_E="NUM",xE="PROTOCOL",EE="MAILTO",kE="WS",ME="NL",DE="OPENBRACE",CE="OPENBRACKET",SE="OPENANGLEBRACKET",NE="OPENPAREN",AE="CLOSEBRACE",OE="CLOSEBRACKET",TE="CLOSEANGLEBRACKET",IE="CLOSEPAREN",LE="AMPERSAND",FE="APOSTROPHE",zE="ASTERISK",jE="AT",RE="BACKSLASH",BE="BACKTICK",PE="CARET",UE="COLON",HE="COMMA",$E="DOLLAR",WE="DOT",VE="EQUALS",qE="EXCLAMATION",KE="HYPHEN",GE="PERCENT",YE="PIPE",QE="PLUS",JE="POUND",ZE="QUERY",XE="QUOTE",ek="SEMI",tk="SLASH",nk="TILDE",rk="UNDERSCORE",ik="SYM",ok=Object.freeze({__proto__:null,DOMAIN:yE,LOCALHOST:vE,TLD:wE,NUM:_E,PROTOCOL:xE,MAILTO:EE,WS:kE,NL:ME,OPENBRACE:DE,OPENBRACKET:CE,OPENANGLEBRACKET:SE,OPENPAREN:NE,CLOSEBRACE:AE,CLOSEBRACKET:OE,CLOSEANGLEBRACKET:TE,CLOSEPAREN:IE,AMPERSAND:LE,APOSTROPHE:FE,ASTERISK:zE,AT:jE,BACKSLASH:RE,BACKTICK:BE,CARET:PE,COLON:UE,COMMA:HE,DOLLAR:$E,DOT:WE,EQUALS:VE,EXCLAMATION:qE,HYPHEN:KE,PERCENT:GE,PIPE:YE,PLUS:QE,POUND:JE,QUERY:ZE,QUOTE:XE,SEMI:ek,SLASH:tk,TILDE:nk,UNDERSCORE:rk,SYM:ik}),sk="aaa aarp abarth abb abbott abbvie abc able abogado abudhabi ac academy accenture accountant accountants aco actor ad adac ads adult ae aeg aero aetna af afamilycompany afl africa ag agakhan agency ai aig airbus airforce airtel akdn al alfaromeo alibaba alipay allfinanz allstate ally alsace alstom am amazon americanexpress americanfamily amex amfam amica amsterdam analytics android anquan anz ao aol apartments app apple aq aquarelle ar arab aramco archi army arpa art arte as asda asia associates at athleta attorney au auction audi audible audio auspost author auto autos avianca aw aws ax axa az azure ba baby baidu banamex bananarepublic band bank bar barcelona barclaycard barclays barefoot bargains baseball basketball bauhaus bayern bb bbc bbt bbva bcg bcn bd be beats beauty beer bentley berlin best bestbuy bet bf bg bh bharti bi bible bid bike bing bingo bio biz bj black blackfriday blockbuster blog bloomberg blue bm bms bmw bn bnpparibas bo boats boehringer bofa bom bond boo book booking bosch bostik boston bot boutique box br bradesco bridgestone broadway broker brother brussels bs bt budapest bugatti build builders business buy buzz bv bw by bz bzh ca cab cafe cal call calvinklein cam camera camp cancerresearch canon capetown capital capitalone car caravan cards care career careers cars casa case cash casino cat catering catholic cba cbn cbre cbs cc cd center ceo cern cf cfa cfd cg ch chanel channel charity chase chat cheap chintai christmas chrome church ci cipriani circle cisco citadel citi citic city cityeats ck cl claims cleaning click clinic clinique clothing cloud club clubmed cm cn co coach codes coffee college cologne com comcast commbank community company compare computer comsec condos construction consulting contact contractors cooking cookingchannel cool coop corsica country coupon coupons courses cpa cr credit creditcard creditunion cricket crown crs cruise cruises csc cu cuisinella cv cw cx cy cymru cyou cz dabur dad dance data date dating datsun day dclk dds de deal dealer deals degree delivery dell deloitte delta democrat dental dentist desi design dev dhl diamonds diet digital direct directory discount discover dish diy dj dk dm dnp do docs doctor dog domains dot download drive dtv dubai duck dunlop dupont durban dvag dvr dz earth eat ec eco edeka edu education ee eg email emerck energy engineer engineering enterprises epson equipment er ericsson erni es esq estate et etisalat eu eurovision eus events exchange expert exposed express extraspace fage fail fairwinds faith family fan fans farm farmers fashion fast fedex feedback ferrari ferrero fi fiat fidelity fido film final finance financial fire firestone firmdale fish fishing fit fitness fj fk flickr flights flir florist flowers fly fm fo foo food foodnetwork football ford forex forsale forum foundation fox fr free fresenius frl frogans frontdoor frontier ftr fujitsu fujixerox fun fund furniture futbol fyi ga gal gallery gallo gallup game games gap garden gay gb gbiz gd gdn ge gea gent genting george gf gg ggee gh gi gift gifts gives giving gl glade glass gle global globo gm gmail gmbh gmo gmx gn godaddy gold goldpoint golf goo goodyear goog google gop got gov gp gq gr grainger graphics gratis green gripe grocery group gs gt gu guardian gucci guge guide guitars guru gw gy hair hamburg hangout haus hbo hdfc hdfcbank health healthcare help helsinki here hermes hgtv hiphop hisamitsu hitachi hiv hk hkt hm hn hockey holdings holiday homedepot homegoods homes homesense honda horse hospital host hosting hot hoteles hotels hotmail house how hr hsbc ht hu hughes hyatt hyundai ibm icbc ice icu id ie ieee ifm ikano il im imamat imdb immo immobilien in inc industries infiniti info ing ink institute insurance insure int international intuit investments io ipiranga iq ir irish is ismaili ist istanbul it itau itv iveco jaguar java jcb je jeep jetzt jewelry jio jll jm jmp jnj jo jobs joburg jot joy jp jpmorgan jprs juegos juniper kaufen kddi ke kerryhotels kerrylogistics kerryproperties kfh kg kh ki kia kim kinder kindle kitchen kiwi km kn koeln komatsu kosher kp kpmg kpn kr krd kred kuokgroup kw ky kyoto kz la lacaixa lamborghini lamer lancaster lancia land landrover lanxess lasalle lat latino latrobe law lawyer lb lc lds lease leclerc lefrak legal lego lexus lgbt li lidl life lifeinsurance lifestyle lighting like lilly limited limo lincoln linde link lipsy live living lixil lk llc llp loan loans locker locus loft lol london lotte lotto love lpl lplfinancial lr ls lt ltd ltda lu lundbeck luxe luxury lv ly ma macys madrid maif maison makeup man management mango map market marketing markets marriott marshalls maserati mattel mba mc mckinsey md me med media meet melbourne meme memorial men menu merckmsd mg mh miami microsoft mil mini mint mit mitsubishi mk ml mlb mls mm mma mn mo mobi mobile moda moe moi mom monash money monster mormon mortgage moscow moto motorcycles mov movie mp mq mr ms msd mt mtn mtr mu museum mutual mv mw mx my mz na nab nagoya name nationwide natura navy nba nc ne nec net netbank netflix network neustar new news next nextdirect nexus nf nfl ng ngo nhk ni nico nike nikon ninja nissan nissay nl no nokia northwesternmutual norton now nowruz nowtv np nr nra nrw ntt nu nyc nz obi observer off office okinawa olayan olayangroup oldnavy ollo om omega one ong onl online onyourside ooo open oracle orange org organic origins osaka otsuka ott ovh pa page panasonic paris pars partners parts party passagens pay pccw pe pet pf pfizer pg ph pharmacy phd philips phone photo photography photos physio pics pictet pictures pid pin ping pink pioneer pizza pk pl place play playstation plumbing plus pm pn pnc pohl poker politie porn post pr pramerica praxi press prime pro prod productions prof progressive promo properties property protection pru prudential ps pt pub pw pwc py qa qpon quebec quest qvc racing radio raid re read realestate realtor realty recipes red redstone redumbrella rehab reise reisen reit reliance ren rent rentals repair report republican rest restaurant review reviews rexroth rich richardli ricoh ril rio rip rmit ro rocher rocks rodeo rogers room rs rsvp ru rugby ruhr run rw rwe ryukyu sa saarland safe safety sakura sale salon samsclub samsung sandvik sandvikcoromant sanofi sap sarl sas save saxo sb sbi sbs sc sca scb schaeffler schmidt scholarships school schule schwarz science scjohnson scot sd se search seat secure security seek select sener services ses seven sew sex sexy sfr sg sh shangrila sharp shaw shell shia shiksha shoes shop shopping shouji show showtime si silk sina singles site sj sk ski skin sky skype sl sling sm smart smile sn sncf so soccer social softbank software sohu solar solutions song sony soy spa space sport spot spreadbetting sr srl ss st stada staples star statebank statefarm stc stcgroup stockholm storage store stream studio study style su sucks supplies supply support surf surgery suzuki sv swatch swiftcover swiss sx sy sydney systems sz tab taipei talk taobao target tatamotors tatar tattoo tax taxi tc tci td tdk team tech technology tel temasek tennis teva tf tg th thd theater theatre tiaa tickets tienda tiffany tips tires tirol tj tjmaxx tjx tk tkmaxx tl tm tmall tn to today tokyo tools top toray toshiba total tours town toyota toys tr trade trading training travel travelchannel travelers travelersinsurance trust trv tt tube tui tunes tushu tv tvs tw tz ua ubank ubs ug uk unicom university uno uol ups us uy uz va vacations vana vanguard vc ve vegas ventures verisign versicherung vet vg vi viajes video vig viking villas vin vip virgin visa vision viva vivo vlaanderen vn vodka volkswagen volvo vote voting voto voyage vu vuelos wales walmart walter wang wanggou watch watches weather weatherchannel webcam weber website wed wedding weibo weir wf whoswho wien wiki williamhill win windows wine winners wme wolterskluwer woodside work works world wow ws wtc wtf xbox xerox xfinity xihuan xin xxx xyz yachts yahoo yamaxun yandex ye yodobashi yoga yokohama you youtube yt yun za zappos zara zero zip zm zone zuerich zw vermögensberater-ctb vermögensberatung-pwb ελ ευ бг бел дети ею католик ком қаз мкд мон москва онлайн орг рус рф сайт срб укр გე հայ ישראל קום ابوظبي اتصالات ارامكو الاردن البحرين الجزائر السعودية العليان المغرب امارات ایران بارت بازار بھارت بيتك پاکستان ڀارت تونس سودان سورية شبكة عراق عرب عمان فلسطين قطر كاثوليك كوم مصر مليسيا موريتانيا موقع همراه कॉम नेट भारत भारतम् भारोत संगठन বাংলা ভারত ভাৰত ਭਾਰਤ ભારત ଭାରତ இந்தியா இலங்கை சிங்கப்பூர் భారత్ ಭಾರತ ഭാരതം ලංකා คอม ไทย ລາວ 닷넷 닷컴 삼성 한국 アマゾン グーグル クラウド コム ストア セール ファッション ポイント みんな 世界 中信 中国 中國 中文网 亚马逊 企业 佛山 信息 健康 八卦 公司 公益 台湾 台灣 商城 商店 商标 嘉里 嘉里大酒店 在线 大众汽车 大拿 天主教 娱乐 家電 广东 微博 慈善 我爱你 手机 招聘 政务 政府 新加坡 新闻 时尚 書籍 机构 淡马锡 游戏 澳門 点看 移动 组织机构 网址 网店 网站 网络 联通 诺基亚 谷歌 购物 通販 集团 電訊盈科 飞利浦 食品 餐厅 香格里拉 香港".split(" "),ak=/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/,lk=/(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEDD-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDDFF\uDE70-\uDE74\uDE78-\uDE7C\uDE80-\uDE86\uDE90-\uDEAC\uDEB0-\uDEBA\uDEC0-\uDEC5\uDED0-\uDED9\uDEE0-\uDEE7\uDEF0-\uDEF6])/,ck=/\uFE0F/,uk=/\d/,dk=/\s/;function pk(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=uE(),n=dE(_E),r=dE(yE),i=uE(),o=dE(kE),s=[[uk,r],[ak,r],[lk,r],[ck,r]],a=function(){var e=dE(yE);return e.j={"-":i},e.jr=[].concat(s),e},l=function(e){var t=a();return t.t=e,t};gE(t,[["'",dE(FE)],["{",dE(DE)],["[",dE(CE)],["<",dE(SE)],["(",dE(NE)],["}",dE(AE)],["]",dE(OE)],[">",dE(TE)],[")",dE(IE)],["&",dE(LE)],["*",dE(zE)],["@",dE(jE)],["`",dE(BE)],["^",dE(PE)],[":",dE(UE)],[",",dE(HE)],["$",dE($E)],[".",dE(WE)],["=",dE(VE)],["!",dE(qE)],["-",dE(KE)],["%",dE(GE)],["|",dE(YE)],["+",dE(QE)],["#",dE(JE)],["?",dE(ZE)],['"',dE(XE)],["/",dE(tk)],[";",dE(ek)],["~",dE(nk)],["_",dE(rk)],["\\",dE(RE)]]),pE(t,"\n",dE(ME)),hE(t,dk,o),pE(o,"\n",uE()),hE(o,dk,o);for(var c=0;c<sk.length;c++)bE(t,sk[c],l(wE),a);var u=a(),d=a(),p=a(),h=a();bE(t,"file",u,a),bE(t,"ftp",d,a),bE(t,"http",p,a),bE(t,"mailto",h,a);var f=a(),m=dE(xE),g=dE(EE);pE(d,"s",f),pE(d,":",m),pE(p,"s",f),pE(p,":",m),pE(u,":",m),pE(f,":",m),pE(h,":",g);for(var b=a(),y=0;y<e.length;y++)bE(t,e[y],b,a);return pE(b,":",m),bE(t,"localhost",l(vE),a),hE(t,uk,n),hE(t,ak,r),hE(t,lk,r),hE(t,ck,r),hE(n,uk,n),hE(n,ak,r),hE(n,lk,r),hE(n,ck,r),pE(n,"-",i),pE(r,"-",i),pE(i,"-",i),hE(r,uk,r),hE(r,ak,r),hE(r,lk,r),hE(r,ck,r),hE(i,uk,r),hE(i,ak,r),hE(i,lk,r),hE(i,ck,r),t.jd=dE(ik),t}var hk={defaultProtocol:"http",events:null,format:fk,formatHref:fk,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:0,className:null,attributes:null,ignoreTags:[]};function fk(e){return e}function mk(){}function gk(e,t){function n(t,n){this.t=e,this.v=t,this.tk=n}return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Object.create(e.prototype);for(var i in n)r[i]=n[i];r.constructor=t,t.prototype=r}(mk,n,t),n}mk.prototype={t:"token",isLink:!1,toString:function(){return this.v},toHref:function(){return this.toString()},startIndex:function(){return this.tk[0].s},endIndex:function(){return this.tk[this.tk.length-1].e},toObject:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hk.defaultProtocol;return{type:this.t,value:this.v,isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}}};var bk=gk("email",{isLink:!0}),yk=gk("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),vk=gk("text"),wk=gk("nl"),_k=gk("url",{isLink:!0,toHref:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hk.defaultProtocol,t=this.tk,n=!1,r=!1,i=[],o=0;t[o].t===xE;)n=!0,i.push(t[o].v),o++;for(;t[o].t===tk;)r=!0,i.push(t[o].v),o++;for(;o<t.length;o++)i.push(t[o].v);return i=i.join(""),n||r||(i="".concat(e,"://").concat(i)),i},hasProtocol:function(){return this.tk[0].t===xE}}),xk=Object.freeze({__proto__:null,MultiToken:mk,Base:mk,createTokenClass:gk,MailtoEmail:bk,Email:yk,Text:vk,Nl:wk,Url:_k});function Ek(){var e=uE(),t=uE(),n=uE(),r=uE(),i=uE(),o=uE(),s=uE(),a=dE(_k),l=uE(),c=dE(_k),u=dE(_k),d=uE(),p=uE(),h=uE(),f=uE(),m=uE(),g=dE(_k),b=dE(_k),y=dE(_k),v=dE(_k),w=uE(),_=uE(),x=uE(),E=uE(),k=uE(),M=uE(),D=dE(yk),C=uE(),S=dE(yk),N=dE(bk),A=uE(),O=uE(),T=uE(),I=uE(),L=dE(wk);pE(e,ME,L),pE(e,xE,t),pE(e,EE,n),pE(t,tk,r),pE(r,tk,i),pE(e,wE,o),pE(e,yE,o),pE(e,vE,a),pE(e,_E,o),pE(i,wE,u),pE(i,yE,u),pE(i,_E,u),pE(i,vE,u),pE(o,WE,s),pE(k,WE,M),pE(s,wE,a),pE(s,yE,o),pE(s,_E,o),pE(s,vE,o),pE(M,wE,D),pE(M,yE,k),pE(M,_E,k),pE(M,vE,k),pE(a,WE,s),pE(D,WE,M),pE(a,UE,l),pE(a,tk,u),pE(l,_E,c),pE(c,tk,u),pE(D,UE,C),pE(C,_E,S);var F=[LE,zE,jE,RE,BE,PE,$E,yE,VE,KE,vE,_E,GE,YE,QE,JE,xE,tk,ik,nk,wE,rk],z=[FE,TE,AE,OE,IE,UE,HE,WE,qE,SE,DE,CE,NE,ZE,XE,ek];pE(u,DE,p),pE(u,CE,h),pE(u,SE,f),pE(u,NE,m),pE(d,DE,p),pE(d,CE,h),pE(d,SE,f),pE(d,NE,m),pE(p,AE,u),pE(h,OE,u),pE(f,TE,u),pE(m,IE,u),pE(g,AE,u),pE(b,OE,u),pE(y,TE,u),pE(v,IE,u),pE(w,AE,u),pE(_,OE,u),pE(x,TE,u),pE(E,IE,u),mE(p,F,g),mE(h,F,b),mE(f,F,y),mE(m,F,v),mE(p,z,w),mE(h,z,_),mE(f,z,x),mE(m,z,E),mE(g,F,g),mE(b,F,b),mE(y,F,y),mE(v,F,v),mE(g,z,g),mE(b,z,b),mE(y,z,y),mE(v,z,v),mE(w,F,g),mE(_,F,b),mE(x,F,y),mE(E,F,v),mE(w,z,w),mE(_,z,_),mE(x,z,x),mE(E,z,E),mE(u,F,u),mE(d,F,u),mE(u,z,d),mE(d,z,d),pE(n,wE,N),pE(n,yE,N),pE(n,_E,N),pE(n,vE,N),mE(N,F,N),mE(N,z,A),mE(A,F,N),mE(A,z,A);var j=[LE,FE,zE,RE,BE,PE,AE,$E,yE,VE,KE,_E,DE,GE,YE,QE,JE,ZE,tk,ik,nk,wE,rk];return mE(o,j,O),pE(o,jE,T),mE(a,j,O),pE(a,jE,T),mE(s,j,O),mE(O,j,O),pE(O,jE,T),pE(O,WE,I),mE(I,j,O),pE(T,wE,k),pE(T,yE,k),pE(T,_E,k),pE(T,vE,D),e}function kk(e,t,n){var r=n[0].s,i=n[n.length-1].e;return new e(t.substr(r,i-r),n)}var Mk="undefined"!=typeof console&&console&&console.warn||function(){},Dk={scanner:null,parser:null,pluginQueue:[],customProtocols:[],initialized:!1};function Ck(e){if(Dk.initialized&&Mk('linkifyjs: already initialized - will not register custom protocol "'.concat(e,'" until you manually call linkify.init(). To avoid this warning, please register all custom protocols before invoking linkify the first time.')),!/^[a-z-]+$/.test(e))throw Error("linkifyjs: protocols containing characters other than a-z or - (hyphen) are not supported");Dk.customProtocols.push(e)}function Sk(e){return Dk.initialized||function(){Dk.scanner={start:pk(Dk.customProtocols),tokens:ok},Dk.parser={start:Ek(),tokens:xk};for(var e={createTokenClass:gk},t=0;t<Dk.pluginQueue.length;t++)Dk.pluginQueue[t][1]({scanner:Dk.scanner,parser:Dk.parser,utils:e});Dk.initialized=!0}(),function(e,t,n){for(var r=n.length,i=0,o=[],s=[];i<r;){for(var a=e,l=null,c=null,u=0,d=null,p=-1;i<r&&!(l=fE(a,n[i].t));)s.push(n[i++]);for(;i<r&&(c=l||fE(a,n[i].t));)l=null,(a=c).accepts()?(p=0,d=a):p>=0&&p++,i++,u++;if(p<0)for(var h=i-u;h<i;h++)s.push(n[h]);else{s.length>0&&(o.push(kk(vk,t,s)),s=[]),i-=p,u-=p;var f=d.t,m=n.slice(i-u,i);o.push(kk(f,t,m))}}return s.length>0&&o.push(kk(vk,t,s)),o}(Dk.parser.start,e,function(e,t){for(var n=function(e){for(var t=[],n=e.length,r=0;r<n;){var i=e.charCodeAt(r),o=void 0,s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,(function(e){return e.toLowerCase()}))),r=n.length,i=[],o=0,s=0;s<r;){for(var a=e,l=null,c=0,u=null,d=-1,p=-1;s<r&&(l=fE(a,n[s]));)(a=l).accepts()?(d=0,p=0,u=a):d>=0&&(d+=n[s].length,p++),c+=n[s].length,o+=n[s].length,s++;o-=d,s-=p,c-=d,i.push({t:u.t,v:t.substr(o-c,c),s:o-c,e:o})}return i}(Dk.scanner.start,e))}function Nk(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Sk(e),r=[],i=0;i<n.length;i++){var o=n[i];!o.isLink||t&&o.t!==t||r.push(o.toObject())}return r}function Ak(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Sk(e);return 1===n.length&&n[0].isLink&&(!t||n[0].t===t)}function Ok(e){return new Em({key:new Dm("autolink"),appendTransaction:(t,n,r)=>{const i=t.some((e=>e.docChanged))&&!n.doc.eq(r.doc),o=t.some((e=>e.getMeta("preventAutolink")));if(!i||o)return;const{tr:s}=r,a=function(e,t){const n=new Xf(e);return t.forEach((e=>{e.steps.forEach((e=>{n.step(e)}))})),n}(n.doc,[...t]),{mapping:l}=a,c=function(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach(((e,i)=>{const o=[];if(e.ranges.length)e.forEach(((e,t)=>{o.push({from:e,to:t})}));else{const{from:e,to:t}=n[i];if(void 0===e||void 0===t)return;o.push({from:e,to:t})}o.forEach((({from:e,to:n})=>{const o=t.slice(i).map(e,-1),s=t.slice(i).map(n),a=t.invert().map(o,-1),l=t.invert().map(s);r.push({oldRange:{from:a,to:l},newRange:{from:o,to:s}})}))})),ew(r)}(a);return c.forEach((({oldRange:t,newRange:i})=>{tw(t.from,t.to,n.doc).filter((t=>t.mark.type===e.type)).forEach((t=>{const i=tw(l.map(t.from),l.map(t.to),r.doc).filter((t=>t.mark.type===e.type));if(!i.length)return;const o=i[0],a=n.doc.textBetween(t.from,t.to,void 0," "),c=r.doc.textBetween(o.from,o.to,void 0," "),u=Ak(a),d=Ak(c);u&&!d&&s.removeMark(o.from,o.to,e.type)}));const o=function(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,((e,t)=>{n(e)&&r.push({node:e,pos:t})})),r}(r.doc,i,(e=>e.isTextblock));let a,c;if(o.length>1?(a=o[0],c=r.doc.textBetween(a.pos,a.pos+a.node.nodeSize,void 0," ")):o.length&&r.doc.textBetween(i.from,i.to," "," ").endsWith(" ")&&(a=o[0],c=r.doc.textBetween(a.pos,i.to,void 0," ")),a&&c){const t=c.split(" ").filter((e=>""!==e));if(t.length<=0)return!1;const n=t[t.length-1],r=a.pos+c.lastIndexOf(n);if(!n)return!1;Nk(n).filter((e=>e.isLink)).filter((t=>!e.validate||e.validate(t.value))).map((e=>({...e,from:r+e.start+1,to:r+e.end+1}))).forEach((t=>{s.addMark(t.from,t.to,e.type.create({href:t.href}))}))}})),s.steps.length?s:void 0}})}const Tk=ww.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(Ck)},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},class:{default:this.options.HTMLAttributes.class}}},parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:e}){return["a",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{setLink:e=>({chain:t})=>t().setMark(this.name,e).setMeta("preventAutolink",!0).run(),toggleLink:e=>({chain:t})=>t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[xw({find:e=>Nk(e).filter((e=>!this.options.validate||this.options.validate(e.value))).filter((e=>e.isLink)).map((e=>({text:e.value,index:e.start,data:e}))),type:this.type,getAttributes:e=>{var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[];var t;return this.options.autolink&&e.push(Ok({type:this.type,validate:this.options.validate})),this.options.openOnClick&&e.push((t={type:this.type},new Em({key:new Dm("handleClickLink"),props:{handleClick:(e,n,r)=>{var i;const o=Xv(e.state,t.type.name);return!(!(null===(i=r.target)||void 0===i?void 0:i.closest("a"))||!o.href||(window.open(o.href,o.target),0))}}}))),this.options.linkOnPaste&&e.push(function(e){return new Em({key:new Dm("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{state:i}=t,{selection:o}=i,{empty:s}=o;if(s)return!1;let a="";r.content.forEach((e=>{a+=e.textContent}));const l=Nk(a).find((e=>e.isLink&&e.value===a));return!(!a||!l||(e.editor.commands.setMark(e.type,{href:l.href}),0))}}})}({editor:this.editor,type:this.type})),e}}),Ik=ww.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Lk=/^\s*>\s$/,Fk=_w.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[vw({find:Lk,type:this.type})]}}),zk=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,jk=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,Rk=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Bk=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Pk=ww.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],renderHTML({HTMLAttributes:e}){return["strong",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[bw({find:zk,type:this.type}),bw({find:Rk,type:this.type})]},addPasteRules(){return[xw({find:jk,type:this.type}),xw({find:Bk,type:this.type})]}}),Uk=/^\s*([-+*])\s$/,Hk=_w.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[vw({find:Uk,type:this.type})]}}),$k=/^```([a-z]+)?[\s\n]$/,Wk=/^~~~([a-z]+)?[\s\n]$/,Vk=_w.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,r=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter((e=>e.startsWith(n))).map((e=>e.replace(n,"")))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",pv(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes())},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!(!o||!s)&&e.chain().command((({tr:e})=>(e.delete(r.pos-2,r.pos),!0))).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type)return!1;if(!(i.parentOffset===i.parent.nodeSize-2))return!1;const s=i.after();if(void 0===s)return!1;return!r.nodeAt(s)&&e.commands.exitCode()}}},addInputRules(){return[yw({find:$k,type:this.type,getAttributes:e=>({language:e[1]})}),yw({find:Wk,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Em({key:new Dm("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=null==i?void 0:i.mode;if(!n||!o)return!1;const{tr:s}=e.state;return s.replaceSelectionWith(this.type.create({language:o})),s.setSelection(om.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,"\n")),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}});function qk(e={}){return new Em({view:t=>new Kk(t,e)})}class Kk{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map((t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))}destroy(){this.handlers.forEach((({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t)))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),i=n?t.bottom:t.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:t.left,right:t.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos);e={left:t.left-this.width/2,right:t.left+this.width/2,top:t.top,bottom:t.bottom}}let n,r,i=this.editorView.dom.offsetParent;if(this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!i||i==document.body&&"static"==getComputedStyle(i).position)n=-pageXOffset,r=-pageYOffset;else{let e=i.getBoundingClientRect();n=e.left-i.scrollLeft,r=e.top-i.scrollTop}this.element.style.left=e.left-n+"px",this.element.style.top=e.top-r+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,t):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&(e=Bf(this.editorView.state.doc,e,this.editorView.dragging.slice),null==e))return this.setCursor(null);this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const Gk=Av.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[qk(this.options)]}});class Yk extends tm{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return Yk.valid(n)?new Yk(n):tm.near(n)}content(){return uh.empty}eq(e){return e instanceof Yk&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new Yk(e.resolve(t.pos))}getBookmark(){return new Qk(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&Yk.valid(e))return e;let r=e.pos,i=null;for(let n=e.depth;;n--){let o=e.node(n);if(t>0?e.indexAfter(n)<o.childCount:e.index(n)>0){i=o.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(Yk.valid(s))return s}for(;;){let o=t>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!am.isSelectable(i)){e=e.doc.resolve(r+i.nodeSize*t),n=!1;continue e}break}i=o,r+=t;let s=e.doc.resolve(r);if(Yk.valid(s))return s}return null}}}Yk.prototype.visible=!1,Yk.findFrom=Yk.findGapCursorFrom,tm.jsonID("gapcursor",Yk);class Qk{constructor(e){this.pos=e}map(e){return new Qk(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Yk.valid(t)?new Yk(t):tm.near(t)}}const Jk=Gy({ArrowLeft:Zk("horiz",-1),ArrowRight:Zk("horiz",1),ArrowUp:Zk("vert",-1),ArrowDown:Zk("vert",1)});function Zk(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,i){let o=e.selection,s=t>0?o.$to:o.$from,a=o.empty;if(o instanceof om){if(!i.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=Yk.findGapCursorFrom(s,t,a);return!!l&&(r&&r(e.tr.setSelection(new Yk(l))),!0)}}function Xk(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Yk.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&am.isSelectable(e.state.doc.nodeAt(i.inside)))&&(e.dispatch(e.state.tr.setSelection(new Yk(r))),!0)}function eM(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof Yk))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=ih.empty;for(let e=r.length-1;e>=0;e--)i=ih.from(r[e].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new uh(i,0,0));return o.setSelection(om.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function tM(e){if(!(e.selection instanceof Yk))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",uy.create(e.doc,[ay.widget(e.selection.head,t,{key:"gapcursor"})])}const nM=Av.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Em({props:{decorations:tM,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&Yk.valid(n)?new Yk(n):null,handleClick:Xk,handleKeyDown:Jk,handleDOMEvents:{beforeinput:eM}}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=mv(lv(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),rM=_w.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",pv(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command((()=>{const{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:s}=r.extensionManager,a=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{if(t&&a&&o){const t=a.filter((e=>s.includes(e.type.name)));e.ensureMarks(t)}return!0})).run()}))])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),iM=_w.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((e=>({tag:`h${e}`,attrs:{level:e}})))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,pv(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce(((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})})),{})},addInputRules(){return this.options.levels.map((e=>yw({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}})))}});var oM=200,sM=function(){};sM.prototype.append=function(e){return e.length?(e=sM.from(e),!this.length&&e||e.length<oM&&this.leafAppend(e)||this.length<oM&&e.leafPrepend(this)||this.appendInner(e)):this},sM.prototype.prepend=function(e){return e.length?sM.from(e).append(this):this},sM.prototype.appendInner=function(e){return new lM(this,e)},sM.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?sM.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},sM.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},sM.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},sM.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},sM.from=function(e){return e instanceof sM?e:e&&e.length?new aM(e):sM.empty};var aM=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=oM)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=oM)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(sM);sM.empty=new aM([]);var lM=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;return!(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r))&&(!(n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;return!(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i))&&(!(n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(sM),cM=sM;const uM=500;class dM{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--){if(this.items.get(i-1).selection){--i;break}}t&&(n=this.remapping(i,this.items.length),r=n.maps.length);let o,s,a=e.tr,l=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(i,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new pM(e.map));let t,i=e.step.map(n.slice(r));i&&a.maybeStep(i).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new pM(t,void 0,void 0,l.length+c.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(r)):e.selection,s=new dM(this.items.slice(0,i).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:o}}addTransform(e,t,n,r){let i=[],o=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<e.steps.length;n++){let l,c=e.steps[n].invert(e.docs[n]),u=new pM(e.mapping.maps[n],c,t);(l=a&&a.merge(u))&&(u=l,n?i.pop():s=s.slice(0,s.length-1)),i.push(u),t&&(o++,t=void 0),r||(a=u)}let l=o-n.depth;return l>fM&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,l),o-=l),new dM(s.append(i),o)}remapping(e,t){let n=new _f;return this.items.forEach(((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new dM(this.items.append(e.map((e=>new pM(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let l=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(i.slice(a+1,r));c&&s++,n.push(new pM(l,o,c))}else n.push(new pM(l))}),r);let l=[];for(let e=t;e<o;e++)l.push(new pM(i.maps[e]));let c=this.items.slice(0,r).append(l).append(n),u=new dM(c,s);return u.emptyItemCount()>uM&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach(((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=o.selection&&o.selection.map(t.slice(n));a&&i++;let l,c=new pM(s.invert(),e,a),u=r.length-1;(l=r.length&&r[u].merge(c))?r[u]=l:r.push(c)}}else o.map&&n--}),this.items.length,0),new dM(cM.from(r.reverse()),i)}}dM.empty=new dM(cM.empty,0);class pM{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new pM(t.getMap().invert(),t,this.selection)}}}class hM{constructor(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r}}const fM=20;function mM(e){let t=[];return e.forEach(((e,n,r,i)=>t.push(r,i))),t}function gM(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function bM(e,t,n,r){let i=wM(t),o=_M.get(t).spec.config,s=(r?e.undone:e.done).popEvent(t,i);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),o,i),c=new hM(r?l:s.remaining,r?s.remaining:l,null,0);n(s.transform.setSelection(a).setMeta(_M,{redo:r,historyState:c}).scrollIntoView())}let yM=!1,vM=null;function wM(e){let t=e.plugins;if(vM!=t){yM=!1,vM=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){yM=!0;break}}return yM}const _M=new Dm("history"),xM=new Dm("closeHistory");function EM(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Em({key:_M,state:{init:()=>new hM(dM.empty,dM.empty,null,0),apply:(t,n,r)=>function(e,t,n,r){let i,o=n.getMeta(_M);if(o)return o.historyState;n.getMeta(xM)&&(e=new hM(e.done,e.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(_M))return s.getMeta(_M).redo?new hM(e.done.addTransform(n,void 0,r,wM(t)),e.undone,mM(n.mapping.maps[n.steps.length-1]),e.prevTime):new hM(e.done,e.undone.addTransform(n,void 0,r,wM(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new hM(e.done.rebased(n,i),e.undone.rebased(n,i),gM(e.prevRanges,n.mapping),e.prevTime):new hM(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),gM(e.prevRanges,n.mapping),e.prevTime);{let i=0==e.prevTime||!s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)})),n}(n,e.prevRanges)),o=s?gM(e.prevRanges,n.mapping):mM(n.mapping.maps[n.steps.length-1]);return new hM(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,wM(t)),dM.empty,o,n.time)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?kM:"historyRedo"==n?MM:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}const kM=(e,t)=>{let n=_M.getState(e);return!(!n||0==n.done.eventCount)&&(t&&bM(n,e,t,!1),!0)},MM=(e,t)=>{let n=_M.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&bM(n,e,t,!0),!0)},DM=Av.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>kM(e,t),redo:()=>({state:e,dispatch:t})=>MM(e,t)}),addProseMirrorPlugins(){return[EM(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),CM=_w.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",pv(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{var n;if(t){const{$to:t}=e.selection,r=t.end();if(t.nodeAfter)e.setSelection(om.create(e.doc,t.pos));else{const i=null===(n=t.parent.type.contentMatch.defaultType)||void 0===n?void 0:n.create();i&&(e.insert(r,i),e.setSelection(om.create(e.doc,r)))}e.scrollIntoView()}return!0})).run()}},addInputRules(){return[(e={find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type},new _v({find:e.find,handler:({state:t,range:n,match:r})=>{const i=mv(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from;let a=n.to;if(r[1]){let t=s+r[0].lastIndexOf(r[1]);t>a?t=a:a=t+r[1].length;const n=r[0][r[0].length-1];o.insertText(n,s+r[0].length-1),o.replaceWith(t,a,e.type.create(i))}else r[0]&&o.replaceWith(s,a,e.type.create(i))}}))];var e}}),SM=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,NM=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,AM=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,OM=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,TM=ww.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:e}){return["em",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[bw({find:SM,type:this.type}),bw({find:AM,type:this.type})]},addPasteRules(){return[xw({find:NM,type:this.type}),xw({find:OM,type:this.type})]}}),IM=_w.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",pv(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),LM=/^(\d+)\.\s$/,FM=_w.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return 1===t?["ol",pv(this.options.HTMLAttributes,n),0]:["ol",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[vw({find:LM,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}),zM=_w.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),jM=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,RM=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,BM=ww.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[bw({find:jM,type:this.type})]},addPasteRules(){return[xw({find:RM,type:this.type})]}}),PM=_w.create({name:"text",group:"inline"}),UM=Av.create({name:"starterKit",addExtensions(){var e,t,n,r,i,o,s,a,l,c,u,d,p,h,f,m,g,b;const y=[];return!1!==this.options.blockquote&&y.push(Fk.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&y.push(Pk.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&y.push(Hk.configure(null===(n=this.options)||void 0===n?void 0:n.bulletList)),!1!==this.options.code&&y.push(rE.configure(null===(r=this.options)||void 0===r?void 0:r.code)),!1!==this.options.codeBlock&&y.push(Vk.configure(null===(i=this.options)||void 0===i?void 0:i.codeBlock)),!1!==this.options.document&&y.push(iE.configure(null===(o=this.options)||void 0===o?void 0:o.document)),!1!==this.options.dropcursor&&y.push(Gk.configure(null===(s=this.options)||void 0===s?void 0:s.dropcursor)),!1!==this.options.gapcursor&&y.push(nM.configure(null===(a=this.options)||void 0===a?void 0:a.gapcursor)),!1!==this.options.hardBreak&&y.push(rM.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&y.push(iM.configure(null===(c=this.options)||void 0===c?void 0:c.heading)),!1!==this.options.history&&y.push(DM.configure(null===(u=this.options)||void 0===u?void 0:u.history)),!1!==this.options.horizontalRule&&y.push(CM.configure(null===(d=this.options)||void 0===d?void 0:d.horizontalRule)),!1!==this.options.italic&&y.push(TM.configure(null===(p=this.options)||void 0===p?void 0:p.italic)),!1!==this.options.listItem&&y.push(IM.configure(null===(h=this.options)||void 0===h?void 0:h.listItem)),!1!==this.options.orderedList&&y.push(FM.configure(null===(f=this.options)||void 0===f?void 0:f.orderedList)),!1!==this.options.paragraph&&y.push(zM.configure(null===(m=this.options)||void 0===m?void 0:m.paragraph)),!1!==this.options.strike&&y.push(BM.configure(null===(g=this.options)||void 0===g?void 0:g.strike)),!1!==this.options.text&&y.push(PM.configure(null===(b=this.options)||void 0===b?void 0:b.text)),y}});var HM={exports:{}};function $M(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((function(t){var n=e[t];"object"!=typeof n||Object.isFrozen(n)||$M(n)})),e}HM.exports=$M,HM.exports.default=$M;class WM{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function VM(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function qM(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t];return t.forEach((function(e){for(const t in e)n[t]=e[t]})),n}const KM="</span>",GM=e=>!!e.scope||e.sublanguage&&e.language;class YM{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=VM(e)}openNode(e){if(!GM(e))return;let t="";t=e.sublanguage?`language-${e.language}`:((e,{prefix:t})=>{if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix}),this.span(t)}closeNode(e){GM(e)&&(this.buffer+=KM)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const QM=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class JM{constructor(){this.rootNode=QM(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=QM({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{JM._collapse(e)})))}}class ZM extends JM{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root;n.sublanguage=!0,n.language=t,this.add(n)}toHTML(){return new YM(this,this.options).value()}finalize(){return!0}}function XM(e){return e?"string"==typeof e?e:e.source:null}function eD(e){return rD("(?=",e,")")}function tD(e){return rD("(?:",e,")*")}function nD(e){return rD("(?:",e,")?")}function rD(...e){const t=e.map((e=>XM(e))).join("");return t}function iD(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e),n="("+(t.capture?"":"?:")+e.map((e=>XM(e))).join("|")+")";return n}function oD(e){return new RegExp(e.toString()+"|").exec("").length-1}const sD=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function aD(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n;let r=XM(e),i="";for(;r.length>0;){const e=sD.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],"("===e[0]&&n++)}return i})).map((e=>`(${e})`)).join(t)}const lD="[a-zA-Z]\\w*",cD="[a-zA-Z_]\\w*",uD="\\b\\d+(\\.\\d+)?",dD="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",pD="\\b(0b[01]+)",hD={begin:"\\\\[\\s\\S]",relevance:0},fD={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[hD]},mD={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[hD]},gD=function(e,t,n={}){const r=qM({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=iD("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:rD(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},bD=gD("//","$"),yD=gD("/\\*","\\*/"),vD=gD("#","$"),wD={scope:"number",begin:uD,relevance:0},_D={scope:"number",begin:dD,relevance:0},xD={scope:"number",begin:pD,relevance:0},ED={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[hD,{begin:/\[/,end:/\]/,relevance:0,contains:[hD]}]}]},kD={scope:"title",begin:lD,relevance:0},MD={scope:"title",begin:cD,relevance:0},DD={begin:"\\.\\s*"+cD,relevance:0};var CD=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:lD,UNDERSCORE_IDENT_RE:cD,NUMBER_RE:uD,C_NUMBER_RE:dD,BINARY_NUMBER_RE:pD,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=rD(t,/.*\b/,e.binary,/\b.*/)),qM({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:hD,APOS_STRING_MODE:fD,QUOTE_STRING_MODE:mD,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},COMMENT:gD,C_LINE_COMMENT_MODE:bD,C_BLOCK_COMMENT_MODE:yD,HASH_COMMENT_MODE:vD,NUMBER_MODE:wD,C_NUMBER_MODE:_D,BINARY_NUMBER_MODE:xD,REGEXP_MODE:ED,TITLE_MODE:kD,UNDERSCORE_TITLE_MODE:MD,METHOD_GUARD:DD,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}});function SD(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function ND(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function AD(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=SD,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function OD(e,t){Array.isArray(e.illegal)&&(e.illegal=iD(...e.illegal))}function TD(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function ID(e,t){void 0===e.relevance&&(e.relevance=1)}const LD=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t]})),e.keywords=n.keywords,e.begin=rD(n.beforeMatch,eD(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},FD=["of","and","for","in","not","or","if","then","parent","list","value"],zD="keyword";function jD(e,t,n=zD){const r=Object.create(null);return"string"==typeof e?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach((function(n){Object.assign(r,jD(e[n],t,n))})),r;function i(e,n){t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((function(t){const n=t.split("|");r[n[0]]=[e,RD(n[0],n[1])]}))}}function RD(e,t){return t?Number(t):function(e){return FD.includes(e.toLowerCase())}(e)?0:1}const BD={},PD=e=>{console.error(e)},UD=(e,...t)=>{console.log(`WARN: ${e}`,...t)},HD=(e,t)=>{BD[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),BD[`${e}/${t}`]=!0)},$D=new Error;function WD(e,t,{key:n}){let r=0;const i=e[n],o={},s={};for(let e=1;e<=t.length;e++)s[e+r]=i[e],o[e+r]=!0,r+=oD(t[e-1]);e[n]=s,e[n]._emit=o,e[n]._multi=!0}function VD(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw PD("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),$D;if("object"!=typeof e.beginScope||null===e.beginScope)throw PD("beginScope must be object"),$D;WD(e,e.begin,{key:"beginScope"}),e.begin=aD(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw PD("skip, excludeEnd, returnEnd not compatible with endScope: {}"),$D;if("object"!=typeof e.endScope||null===e.endScope)throw PD("endScope must be object"),$D;WD(e,e.end,{key:"endScope"}),e.end=aD(e.end,{joinWith:""})}}(e)}function qD(e){function t(t,n){return new RegExp(XM(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=oD(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=t(aD(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=qM(e.classNameAliases||{}),function n(i,o){const s=i;if(i.isCompiled)return s;[ND,TD,VD,LD].forEach((e=>e(i,o))),e.compilerExtensions.forEach((e=>e(i,o))),i.__beforeBegin=null,[AD,OD,ID].forEach((e=>e(i,o))),i.isCompiled=!0;let a=null;return"object"==typeof i.keywords&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),a=i.keywords.$pattern,delete i.keywords.$pattern),a=a||/\w+/,i.keywords&&(i.keywords=jD(i.keywords,e.case_insensitive)),s.keywordPatternRe=t(a,!0),o&&(i.begin||(i.begin=/\B|\b/),s.beginRe=t(s.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(s.endRe=t(s.end)),s.terminatorEnd=XM(s.end)||"",i.endsWithParent&&o.terminatorEnd&&(s.terminatorEnd+=(i.end?"|":"")+o.terminatorEnd)),i.illegal&&(s.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return qM(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(KD(e))return qM(e,{starts:e.starts?qM(e.starts):null});if(Object.isFrozen(e))return qM(e);return e}("self"===e?i:e)}))),i.contains.forEach((function(e){n(e,s)})),i.starts&&n(i.starts,o),s.matcher=function(e){const t=new r;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(s),s}(e)}function KD(e){return!!e&&(e.endsWithParent||KD(e.starts))}var GD="11.6.0";class YD extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const QD=VM,JD=qM,ZD=Symbol("nomatch"),XD=7;var eC=function(e){const t=Object.create(null),n=Object.create(null),r=[];let i=!0;const o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:ZM};function l(e){return a.noHighlightRe.test(e)}function c(e,t,n){let r="",i="";"object"==typeof t?(r=e,n=t.ignoreIllegals,i=t.language):(HD("10.7.0","highlight(lang, code, ...args) has been deprecated."),HD("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=e,r=t),void 0===n&&(n=!0);const o={code:r,language:i};y("before:highlight",o);const s=o.result?o.result:u(o.language,o.code,n);return s.code=o.code,y("after:highlight",s),s}function u(e,n,r,s){const l=Object.create(null);function c(){if(!k.keywords)return void D.addText(C);let e=0;k.keywordPatternRe.lastIndex=0;let t=k.keywordPatternRe.exec(C),n="";for(;t;){n+=C.substring(e,t.index);const i=_.case_insensitive?t[0].toLowerCase():t[0],o=(r=i,k.keywords[r]);if(o){const[e,r]=o;if(D.addText(n),n="",l[i]=(l[i]||0)+1,l[i]<=XD&&(S+=r),e.startsWith("_"))n+=t[0];else{const n=_.classNameAliases[e]||e;D.addKeyword(t[0],n)}}else n+=t[0];e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(C)}var r;n+=C.substring(e),D.addText(n)}function p(){null!=k.subLanguage?function(){if(""===C)return;let e=null;if("string"==typeof k.subLanguage){if(!t[k.subLanguage])return void D.addText(C);e=u(k.subLanguage,C,!0,M[k.subLanguage]),M[k.subLanguage]=e._top}else e=d(C,k.subLanguage.length?k.subLanguage:null);k.relevance>0&&(S+=e.relevance),D.addSublanguage(e._emitter,e.language)}():c(),C=""}function h(e,t){let n=1;const r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}const r=_.classNameAliases[e[n]]||e[n],i=t[n];r?D.addKeyword(i,r):(C=i,c(),C=""),n++}}function f(e,t){return e.scope&&"string"==typeof e.scope&&D.openNode(_.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(D.addKeyword(C,_.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),C=""):e.beginScope._multi&&(h(e.beginScope,t),C="")),k=Object.create(e,{parent:{value:k}}),k}function g(e,t,n){let r=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(e.endRe,n);if(r){if(e["on:end"]){const n=new WM(e);e["on:end"](t,n),n.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return g(e.parent,t,n)}function b(e){return 0===k.matcher.regexIndex?(C+=e[0],1):(O=!0,0)}function y(e){const t=e[0],r=n.substring(e.index),i=g(k,e,r);if(!i)return ZD;const o=k;k.endScope&&k.endScope._wrap?(p(),D.addKeyword(t,k.endScope._wrap)):k.endScope&&k.endScope._multi?(p(),h(k.endScope,e)):o.skip?C+=t:(o.returnEnd||o.excludeEnd||(C+=t),p(),o.excludeEnd&&(C=t));do{k.scope&&D.closeNode(),k.skip||k.subLanguage||(S+=k.relevance),k=k.parent}while(k!==i.parent);return i.starts&&f(i.starts,e),o.returnEnd?0:t.length}let v={};function w(t,o){const s=o&&o[0];if(C+=t,null==s)return p(),0;if("begin"===v.type&&"end"===o.type&&v.index===o.index&&""===s){if(C+=n.slice(o.index,o.index+1),!i){const t=new Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=v.rule,t}return 1}if(v=o,"begin"===o.type)return function(e){const t=e[0],n=e.rule,r=new WM(n),i=[n.__beforeBegin,n["on:begin"]];for(const n of i)if(n&&(n(e,r),r.isMatchIgnored))return b(t);return n.skip?C+=t:(n.excludeBegin&&(C+=t),p(),n.returnBegin||n.excludeBegin||(C=t)),f(n,e),n.returnBegin?0:t.length}(o);if("illegal"===o.type&&!r){const e=new Error('Illegal lexeme "'+s+'" for mode "'+(k.scope||"<unnamed>")+'"');throw e.mode=k,e}if("end"===o.type){const e=y(o);if(e!==ZD)return e}if("illegal"===o.type&&""===s)return 1;if(A>1e5&&A>3*o.index){throw new Error("potential infinite loop, way more iterations than matches")}return C+=s,s.length}const _=m(e);if(!_)throw PD(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const x=qD(_);let E="",k=s||x;const M={},D=new a.__emitter(a);!function(){const e=[];for(let t=k;t!==_;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach((e=>D.openNode(e)))}();let C="",S=0,N=0,A=0,O=!1;try{for(k.matcher.considerAll();;){A++,O?O=!1:k.matcher.considerAll(),k.matcher.lastIndex=N;const e=k.matcher.exec(n);if(!e)break;const t=w(n.substring(N,e.index),e);N=e.index+t}return w(n.substring(N)),D.closeAllNodes(),D.finalize(),E=D.toHTML(),{language:e,value:E,relevance:S,illegal:!1,_emitter:D,_top:k}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:QD(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:N,context:n.slice(N-100,N+100),mode:t.mode,resultSoFar:E},_emitter:D};if(i)return{language:e,value:QD(n),illegal:!1,relevance:0,errorRaised:t,_emitter:D,_top:k};throw t}}function d(e,n){n=n||a.languages||Object.keys(t);const r=function(e){const t={value:QD(e),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return t._emitter.addText(e),t}(e),i=n.filter(m).filter(b).map((t=>u(t,e,!1)));i.unshift(r);const o=i.sort(((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(m(e.language).supersetOf===t.language)return 1;if(m(t.language).supersetOf===e.language)return-1}return 0})),[l,c]=o,d=l;return d.secondBest=c,d}function p(e){let t=null;const r=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=a.languageDetectRe.exec(t);if(n){const t=m(n[1]);return t||(UD(o.replace("{}",n[1])),UD("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find((e=>l(e)||m(e)))}(e);if(l(r))return;if(y("before:highlightElement",{el:e,language:r}),e.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),a.throwUnescapedHTML)){throw new YD("One of your code blocks includes unescaped HTML.",e.innerHTML)}t=e;const i=t.textContent,s=r?c(i,{language:r,ignoreIllegals:!0}):d(i);e.innerHTML=s.value,function(e,t,r){const i=t&&n[t]||r;e.classList.add("hljs"),e.classList.add(`language-${i}`)}(e,r,s.language),e.result={language:s.language,re:s.relevance,relevance:s.relevance},s.secondBest&&(e.secondBest={language:s.secondBest.language,relevance:s.secondBest.relevance}),y("after:highlightElement",{el:e,result:s,text:i})}let h=!1;function f(){if("loading"===document.readyState)return void(h=!0);document.querySelectorAll(a.cssSelector).forEach(p)}function m(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function g(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{n[e.toLowerCase()]=t}))}function b(e){const t=m(e);return t&&!t.disableAutodetect}function y(e,t){const n=e;r.forEach((function(e){e[n]&&e[n](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){h&&f()}),!1),Object.assign(e,{highlight:c,highlightAuto:d,highlightAll:f,highlightElement:p,highlightBlock:function(e){return HD("10.7.0","highlightBlock will be removed entirely in v12.0"),HD("10.7.0","Please use highlightElement now."),p(e)},configure:function(e){a=JD(a,e)},initHighlighting:()=>{f(),HD("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){f(),HD("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,r){let o=null;try{o=r(e)}catch(e){if(PD("Language definition for '{}' could not be registered.".replace("{}",n)),!i)throw e;PD(e),o=s}o.name||(o.name=n),t[n]=o,o.rawDefinition=r.bind(null,e),o.aliases&&g(o.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:m,registerAliases:g,autoDetection:b,inherit:JD,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),r.push(e)}}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=GD,e.regex={concat:rD,lookahead:eD,either:iD,optional:nD,anyNumberOfTimes:tD};for(const e in CD)"object"==typeof CD[e]&&HM.exports(CD[e]);return Object.assign(e,CD),e}({}),tC=eC;eC.HighlightJS=eC,eC.default=eC;var nC=tC;function rC(e,t=[]){return e.map((e=>{const n=[...t,...e.properties?e.properties.className:[]];return e.children?rC(e.children,n):{text:e.value,classes:n}})).flat()}function iC(e){return e.value||e.children||[]}function oC({doc:e,name:t,lowlight:n,defaultLanguage:r}){const i=[];return Qv(e,(e=>e.type.name===t)).forEach((e=>{let t=e.pos+1;const o=e.node.attrs.language||r,s=n.listLanguages();var a;rC(o&&(s.includes(o)||(a=o,Boolean(nC.getLanguage(a))))?iC(n.highlight(o,e.node.textContent)):iC(n.highlightAuto(e.node.textContent))).forEach((e=>{const n=t+e.text.length;if(e.classes.length){const r=ay.inline(t,n,{class:e.classes.join(" ")});i.push(r)}t=n}))})),uy.create(e,i)}function sC({name:e,lowlight:t,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every((e=>"function"==typeof t[e])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new Em({key:new Dm("lowlight"),state:{init:(r,{doc:i})=>oC({doc:i,name:e,lowlight:t,defaultLanguage:n}),apply:(r,i,o,s)=>{const a=o.selection.$head.parent.type.name,l=s.selection.$head.parent.type.name,c=Qv(o.doc,(t=>t.type.name===e)),u=Qv(s.doc,(t=>t.type.name===e));return r.docChanged&&([a,l].includes(e)||u.length!==c.length||r.steps.some((e=>void 0!==e.from&&void 0!==e.to&&c.some((t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))))?oC({doc:r.doc,name:e,lowlight:t,defaultLanguage:n}):i.map(r.mapping,r.doc)}},props:{decorations:e=>r.getState(e)}});return r}const aC=Vk.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:{},defaultLanguage:null}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],sC({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});const lC=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],cC=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],uC=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],dC=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],pC=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();var hC="[0-9](_*[0-9])*",fC=`\\.(${hC})`,mC="[0-9a-fA-F](_*[0-9a-fA-F])*",gC={className:"number",variants:[{begin:`(\\b(${hC})((${fC})|\\.)?|(${fC}))`+`[eE][+-]?(${hC})[fFdD]?\\b`},{begin:`\\b(${hC})((${fC})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${fC})[fFdD]?\\b`},{begin:`\\b(${hC})[fFdD]\\b`},{begin:`\\b0[xX]((${mC})\\.?|(${mC})?\\.(${mC}))`+`[pP][+-]?(${hC})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${mC})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function bC(e,t,n){return-1===n?"":e.replace(t,(r=>bC(e,t,n-1)))}const yC="[A-Za-z$_][0-9A-Za-z$_]*",vC=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],wC=["true","false","null","undefined","NaN","Infinity"],_C=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],xC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],EC=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],kC=["arguments","this","super","console","window","document","localStorage","module","global"],MC=[].concat(EC,_C,xC);var DC="[0-9](_*[0-9])*",CC=`\\.(${DC})`,SC="[0-9a-fA-F](_*[0-9a-fA-F])*",NC={className:"number",variants:[{begin:`(\\b(${DC})((${CC})|\\.)?|(${CC}))`+`[eE][+-]?(${DC})[fFdD]?\\b`},{begin:`\\b(${DC})((${CC})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${CC})[fFdD]?\\b`},{begin:`\\b(${DC})[fFdD]\\b`},{begin:`\\b0[xX]((${SC})\\.?|(${SC})?\\.(${SC}))`+`[pP][+-]?(${DC})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${SC})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};const AC=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],OC=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],TC=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],IC=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],LC=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),FC=TC.concat(IC);const zC=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],jC=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],RC=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],BC=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],PC=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function UC(e){return e?"string"==typeof e?e:e.source:null}function HC(e){return $C("(?=",e,")")}function $C(...e){const t=e.map((e=>UC(e))).join("");return t}function WC(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e),n="("+(t.capture?"":"?:")+e.map((e=>UC(e))).join("|")+")";return n}const VC=e=>$C(/\b/,e,/\w$/.test(e)?/\b/:/\B/),qC=["Protocol","Type"].map(VC),KC=["init","self"].map(VC),GC=["Any","Self"],YC=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],QC=["false","nil","true"],JC=["assignment","associativity","higherThan","left","lowerThan","none","right"],ZC=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],XC=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],eS=WC(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),tS=WC(eS,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),nS=$C(eS,tS,"*"),rS=WC(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),iS=WC(rS,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),oS=$C(rS,iS,"*"),sS=$C(/[A-Z]/,iS,"*"),aS=["autoclosure",$C(/convention\(/,WC("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",$C(/objc\(/,oS,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],lS=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];const cS="[A-Za-z$_][0-9A-Za-z$_]*",uS=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],dS=["true","false","null","undefined","NaN","Infinity"],pS=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],hS=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],fS=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],mS=["arguments","this","super","console","window","document","localStorage","module","global"],gS=[].concat(fS,pS,hS);function bS(e){const t=e.regex,n=cS,r="<>",i="</>",o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,r=e.input[n];if("<"===r||","===r)return void t.ignoreMatch();let i;">"===r&&(((e,{after:t})=>{const n="</"+e[0].slice(1);return-1!==e.input.indexOf(n,t)})(e,{after:n})||t.ignoreMatch());(i=e.input.substring(n).match(/^\s+extends\s+/))&&0===i.index&&t.ignoreMatch()}},s={$pattern:cS,keyword:uS,literal:dS,built_in:gS,"variable.language":mS},a="[0-9](_?[0-9])*",l=`\\.(${a})`,c=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,u={className:"number",variants:[{begin:`(\\b(${c})((${l})|\\.)?|(${l}))`+`[eE][+-]?(${a})\\b`},{begin:`\\b(${c})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},p={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},f={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},m={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},g=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,f,u];d.contains=g.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(g)});const b=[].concat(m,d.contains),y=b.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(b)}]),v={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:y},w={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},_={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...pS,...hS]}},x={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[v],illegal:/%/};const E={match:t.concat(/\b/,(k=[...fS,"super"],t.concat("(?!",k.join("|"),")")),n,t.lookahead(/\(/)),className:"title.function",relevance:0};var k;const M={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},D={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},v]},C="(\\("+"[^()]*(\\("+"[^()]*(\\("+"[^()]*"+"\\)[^()]*)*"+"\\)[^()]*)*"+"\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",S={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[v]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:y,CLASS_REFERENCE:_},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,f,m,u,_,{className:"attr",begin:n+t.lookahead(":"),relevance:0},S,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r,end:i},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},x,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\("+"[^()]*(\\("+"[^()]*(\\("+"[^()]*"+"\\)[^()]*)*"+"\\)[^()]*)*"+"\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[v,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},M,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[v]},E,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},w,D,{match:/\$[(.]/}]}}var yS={exports:{}};function vS(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((function(t){var n=e[t];"object"!=typeof n||Object.isFrozen(n)||vS(n)})),e}yS.exports=vS,yS.exports.default=vS;class wS{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function _S(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function xS(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t];return t.forEach((function(e){for(const t in e)n[t]=e[t]})),n}const ES="</span>",kS=e=>!!e.scope||e.sublanguage&&e.language;class MS{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=_S(e)}openNode(e){if(!kS(e))return;let t="";t=e.sublanguage?`language-${e.language}`:((e,{prefix:t})=>{if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix}),this.span(t)}closeNode(e){kS(e)&&(this.buffer+=ES)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const DS=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class CS{constructor(){this.rootNode=DS(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=DS({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{CS._collapse(e)})))}}class SS extends CS{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root;n.sublanguage=!0,n.language=t,this.add(n)}toHTML(){return new MS(this,this.options).value()}finalize(){return!0}}function NS(e){return e?"string"==typeof e?e:e.source:null}function AS(e){return IS("(?=",e,")")}function OS(e){return IS("(?:",e,")*")}function TS(e){return IS("(?:",e,")?")}function IS(...e){const t=e.map((e=>NS(e))).join("");return t}function LS(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e),n="("+(t.capture?"":"?:")+e.map((e=>NS(e))).join("|")+")";return n}function FS(e){return new RegExp(e.toString()+"|").exec("").length-1}const zS=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function jS(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n;let r=NS(e),i="";for(;r.length>0;){const e=zS.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],"("===e[0]&&n++)}return i})).map((e=>`(${e})`)).join(t)}const RS="[a-zA-Z]\\w*",BS="[a-zA-Z_]\\w*",PS="\\b\\d+(\\.\\d+)?",US="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",HS="\\b(0b[01]+)",$S={begin:"\\\\[\\s\\S]",relevance:0},WS={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[$S]},VS={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[$S]},qS=function(e,t,n={}){const r=xS({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=LS("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:IS(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},KS=qS("//","$"),GS=qS("/\\*","\\*/"),YS=qS("#","$"),QS={scope:"number",begin:PS,relevance:0},JS={scope:"number",begin:US,relevance:0},ZS={scope:"number",begin:HS,relevance:0},XS={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[$S,{begin:/\[/,end:/\]/,relevance:0,contains:[$S]}]}]},eN={scope:"title",begin:RS,relevance:0},tN={scope:"title",begin:BS,relevance:0},nN={begin:"\\.\\s*"+BS,relevance:0};var rN=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:RS,UNDERSCORE_IDENT_RE:BS,NUMBER_RE:PS,C_NUMBER_RE:US,BINARY_NUMBER_RE:HS,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=IS(t,/.*\b/,e.binary,/\b.*/)),xS({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:$S,APOS_STRING_MODE:WS,QUOTE_STRING_MODE:VS,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},COMMENT:qS,C_LINE_COMMENT_MODE:KS,C_BLOCK_COMMENT_MODE:GS,HASH_COMMENT_MODE:YS,NUMBER_MODE:QS,C_NUMBER_MODE:JS,BINARY_NUMBER_MODE:ZS,REGEXP_MODE:XS,TITLE_MODE:eN,UNDERSCORE_TITLE_MODE:tN,METHOD_GUARD:nN,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}});function iN(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function oN(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function sN(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=iN,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function aN(e,t){Array.isArray(e.illegal)&&(e.illegal=LS(...e.illegal))}function lN(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function cN(e,t){void 0===e.relevance&&(e.relevance=1)}const uN=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t]})),e.keywords=n.keywords,e.begin=IS(n.beforeMatch,AS(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},dN=["of","and","for","in","not","or","if","then","parent","list","value"],pN="keyword";function hN(e,t,n=pN){const r=Object.create(null);return"string"==typeof e?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach((function(n){Object.assign(r,hN(e[n],t,n))})),r;function i(e,n){t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((function(t){const n=t.split("|");r[n[0]]=[e,fN(n[0],n[1])]}))}}function fN(e,t){return t?Number(t):function(e){return dN.includes(e.toLowerCase())}(e)?0:1}const mN={},gN=e=>{console.error(e)},bN=(e,...t)=>{console.log(`WARN: ${e}`,...t)},yN=(e,t)=>{mN[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),mN[`${e}/${t}`]=!0)},vN=new Error;function wN(e,t,{key:n}){let r=0;const i=e[n],o={},s={};for(let e=1;e<=t.length;e++)s[e+r]=i[e],o[e+r]=!0,r+=FS(t[e-1]);e[n]=s,e[n]._emit=o,e[n]._multi=!0}function _N(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw gN("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),vN;if("object"!=typeof e.beginScope||null===e.beginScope)throw gN("beginScope must be object"),vN;wN(e,e.begin,{key:"beginScope"}),e.begin=jS(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw gN("skip, excludeEnd, returnEnd not compatible with endScope: {}"),vN;if("object"!=typeof e.endScope||null===e.endScope)throw gN("endScope must be object"),vN;wN(e,e.end,{key:"endScope"}),e.end=jS(e.end,{joinWith:""})}}(e)}function xN(e){function t(t,n){return new RegExp(NS(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=FS(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=t(jS(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=xS(e.classNameAliases||{}),function n(i,o){const s=i;if(i.isCompiled)return s;[oN,lN,_N,uN].forEach((e=>e(i,o))),e.compilerExtensions.forEach((e=>e(i,o))),i.__beforeBegin=null,[sN,aN,cN].forEach((e=>e(i,o))),i.isCompiled=!0;let a=null;return"object"==typeof i.keywords&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),a=i.keywords.$pattern,delete i.keywords.$pattern),a=a||/\w+/,i.keywords&&(i.keywords=hN(i.keywords,e.case_insensitive)),s.keywordPatternRe=t(a,!0),o&&(i.begin||(i.begin=/\B|\b/),s.beginRe=t(s.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(s.endRe=t(s.end)),s.terminatorEnd=NS(s.end)||"",i.endsWithParent&&o.terminatorEnd&&(s.terminatorEnd+=(i.end?"|":"")+o.terminatorEnd)),i.illegal&&(s.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return xS(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(EN(e))return xS(e,{starts:e.starts?xS(e.starts):null});if(Object.isFrozen(e))return xS(e);return e}("self"===e?i:e)}))),i.contains.forEach((function(e){n(e,s)})),i.starts&&n(i.starts,o),s.matcher=function(e){const t=new r;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(s),s}(e)}function EN(e){return!!e&&(e.endsWithParent||EN(e.starts))}var kN="11.6.0";class MN extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const DN=_S,CN=xS,SN=Symbol("nomatch"),NN=7;var AN=function(e){const t=Object.create(null),n=Object.create(null),r=[];let i=!0;const o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:SS};function l(e){return a.noHighlightRe.test(e)}function c(e,t,n){let r="",i="";"object"==typeof t?(r=e,n=t.ignoreIllegals,i=t.language):(yN("10.7.0","highlight(lang, code, ...args) has been deprecated."),yN("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=e,r=t),void 0===n&&(n=!0);const o={code:r,language:i};y("before:highlight",o);const s=o.result?o.result:u(o.language,o.code,n);return s.code=o.code,y("after:highlight",s),s}function u(e,n,r,s){const l=Object.create(null);function c(){if(!k.keywords)return void D.addText(C);let e=0;k.keywordPatternRe.lastIndex=0;let t=k.keywordPatternRe.exec(C),n="";for(;t;){n+=C.substring(e,t.index);const i=_.case_insensitive?t[0].toLowerCase():t[0],o=(r=i,k.keywords[r]);if(o){const[e,r]=o;if(D.addText(n),n="",l[i]=(l[i]||0)+1,l[i]<=NN&&(S+=r),e.startsWith("_"))n+=t[0];else{const n=_.classNameAliases[e]||e;D.addKeyword(t[0],n)}}else n+=t[0];e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(C)}var r;n+=C.substring(e),D.addText(n)}function p(){null!=k.subLanguage?function(){if(""===C)return;let e=null;if("string"==typeof k.subLanguage){if(!t[k.subLanguage])return void D.addText(C);e=u(k.subLanguage,C,!0,M[k.subLanguage]),M[k.subLanguage]=e._top}else e=d(C,k.subLanguage.length?k.subLanguage:null);k.relevance>0&&(S+=e.relevance),D.addSublanguage(e._emitter,e.language)}():c(),C=""}function h(e,t){let n=1;const r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}const r=_.classNameAliases[e[n]]||e[n],i=t[n];r?D.addKeyword(i,r):(C=i,c(),C=""),n++}}function f(e,t){return e.scope&&"string"==typeof e.scope&&D.openNode(_.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(D.addKeyword(C,_.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),C=""):e.beginScope._multi&&(h(e.beginScope,t),C="")),k=Object.create(e,{parent:{value:k}}),k}function g(e,t,n){let r=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(e.endRe,n);if(r){if(e["on:end"]){const n=new wS(e);e["on:end"](t,n),n.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return g(e.parent,t,n)}function b(e){return 0===k.matcher.regexIndex?(C+=e[0],1):(O=!0,0)}function y(e){const t=e[0],r=n.substring(e.index),i=g(k,e,r);if(!i)return SN;const o=k;k.endScope&&k.endScope._wrap?(p(),D.addKeyword(t,k.endScope._wrap)):k.endScope&&k.endScope._multi?(p(),h(k.endScope,e)):o.skip?C+=t:(o.returnEnd||o.excludeEnd||(C+=t),p(),o.excludeEnd&&(C=t));do{k.scope&&D.closeNode(),k.skip||k.subLanguage||(S+=k.relevance),k=k.parent}while(k!==i.parent);return i.starts&&f(i.starts,e),o.returnEnd?0:t.length}let v={};function w(t,o){const s=o&&o[0];if(C+=t,null==s)return p(),0;if("begin"===v.type&&"end"===o.type&&v.index===o.index&&""===s){if(C+=n.slice(o.index,o.index+1),!i){const t=new Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=v.rule,t}return 1}if(v=o,"begin"===o.type)return function(e){const t=e[0],n=e.rule,r=new wS(n),i=[n.__beforeBegin,n["on:begin"]];for(const n of i)if(n&&(n(e,r),r.isMatchIgnored))return b(t);return n.skip?C+=t:(n.excludeBegin&&(C+=t),p(),n.returnBegin||n.excludeBegin||(C=t)),f(n,e),n.returnBegin?0:t.length}(o);if("illegal"===o.type&&!r){const e=new Error('Illegal lexeme "'+s+'" for mode "'+(k.scope||"<unnamed>")+'"');throw e.mode=k,e}if("end"===o.type){const e=y(o);if(e!==SN)return e}if("illegal"===o.type&&""===s)return 1;if(A>1e5&&A>3*o.index){throw new Error("potential infinite loop, way more iterations than matches")}return C+=s,s.length}const _=m(e);if(!_)throw gN(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const x=xN(_);let E="",k=s||x;const M={},D=new a.__emitter(a);!function(){const e=[];for(let t=k;t!==_;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach((e=>D.openNode(e)))}();let C="",S=0,N=0,A=0,O=!1;try{for(k.matcher.considerAll();;){A++,O?O=!1:k.matcher.considerAll(),k.matcher.lastIndex=N;const e=k.matcher.exec(n);if(!e)break;const t=w(n.substring(N,e.index),e);N=e.index+t}return w(n.substring(N)),D.closeAllNodes(),D.finalize(),E=D.toHTML(),{language:e,value:E,relevance:S,illegal:!1,_emitter:D,_top:k}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:DN(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:N,context:n.slice(N-100,N+100),mode:t.mode,resultSoFar:E},_emitter:D};if(i)return{language:e,value:DN(n),illegal:!1,relevance:0,errorRaised:t,_emitter:D,_top:k};throw t}}function d(e,n){n=n||a.languages||Object.keys(t);const r=function(e){const t={value:DN(e),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return t._emitter.addText(e),t}(e),i=n.filter(m).filter(b).map((t=>u(t,e,!1)));i.unshift(r);const o=i.sort(((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(m(e.language).supersetOf===t.language)return 1;if(m(t.language).supersetOf===e.language)return-1}return 0})),[l,c]=o,d=l;return d.secondBest=c,d}function p(e){let t=null;const r=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=a.languageDetectRe.exec(t);if(n){const t=m(n[1]);return t||(bN(o.replace("{}",n[1])),bN("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find((e=>l(e)||m(e)))}(e);if(l(r))return;if(y("before:highlightElement",{el:e,language:r}),e.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),a.throwUnescapedHTML)){throw new MN("One of your code blocks includes unescaped HTML.",e.innerHTML)}t=e;const i=t.textContent,s=r?c(i,{language:r,ignoreIllegals:!0}):d(i);e.innerHTML=s.value,function(e,t,r){const i=t&&n[t]||r;e.classList.add("hljs"),e.classList.add(`language-${i}`)}(e,r,s.language),e.result={language:s.language,re:s.relevance,relevance:s.relevance},s.secondBest&&(e.secondBest={language:s.secondBest.language,relevance:s.secondBest.relevance}),y("after:highlightElement",{el:e,result:s,text:i})}let h=!1;function f(){if("loading"===document.readyState)return void(h=!0);document.querySelectorAll(a.cssSelector).forEach(p)}function m(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function g(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{n[e.toLowerCase()]=t}))}function b(e){const t=m(e);return t&&!t.disableAutodetect}function y(e,t){const n=e;r.forEach((function(e){e[n]&&e[n](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){h&&f()}),!1),Object.assign(e,{highlight:c,highlightAuto:d,highlightAll:f,highlightElement:p,highlightBlock:function(e){return yN("10.7.0","highlightBlock will be removed entirely in v12.0"),yN("10.7.0","Please use highlightElement now."),p(e)},configure:function(e){a=CN(a,e)},initHighlighting:()=>{f(),yN("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){f(),yN("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,r){let o=null;try{o=r(e)}catch(e){if(gN("Language definition for '{}' could not be registered.".replace("{}",n)),!i)throw e;gN(e),o=s}o.name||(o.name=n),t[n]=o,o.rawDefinition=r.bind(null,e),o.aliases&&g(o.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:m,registerAliases:g,autoDetection:b,inherit:CN,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),r.push(e)}}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=kN,e.regex={concat:IS,lookahead:AS,either:LS,optional:TS,anyNumberOfTimes:OS};for(const e in rN)"object"==typeof rN[e]&&yS.exports(rN[e]);return Object.assign(e,rN),e}({}),ON=AN;AN.HighlightJS=AN,AN.default=AN;var TN={exports:{}};!function(e){!function(){var t;function n(e){for(var t,n,r,i,o=1,s=[].slice.call(arguments),a=0,l=e.length,c="",u=!1,d=!1,p=function(){return s[o++]},h=function(){for(var n="";/\d/.test(e[a]);)n+=e[a++],t=e[a];return n.length>0?parseInt(n):null};a<l;++a)if(t=e[a],u)switch(u=!1,"."==t?(d=!1,t=e[++a]):"0"==t&&"."==e[a+1]?(d=!0,t=e[a+=2]):d=!0,i=h(),t){case"b":c+=parseInt(p(),10).toString(2);break;case"c":c+="string"==typeof(n=p())||n instanceof String?n:String.fromCharCode(parseInt(n,10));break;case"d":c+=parseInt(p(),10);break;case"f":r=String(parseFloat(p()).toFixed(i||6)),c+=d?r:r.replace(/^0/,"");break;case"j":c+=JSON.stringify(p());break;case"o":c+="0"+parseInt(p(),10).toString(8);break;case"s":c+=p();break;case"x":c+="0x"+parseInt(p(),10).toString(16);break;case"X":c+="0x"+parseInt(p(),10).toString(16).toUpperCase();break;default:c+=t}else"%"===t?u=!0:c+=t;return c}(t=e.exports=n).format=n,t.vsprintf=function(e,t){return n.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(n.apply(null,arguments))})}()}(TN);var IN=TN.exports;const LN=Object.assign(FN(Error),{eval:FN(EvalError),range:FN(RangeError),reference:FN(ReferenceError),syntax:FN(SyntaxError),type:FN(TypeError),uri:FN(URIError)});function FN(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){const r=t?IN(t,...n):t;return new e(r)}}const zN={}.hasOwnProperty,jN="hljs-";function RN(e,t,n={}){let r=n.prefix;if("string"!=typeof e)throw LN("Expected `string` for name, got `%s`",e);if(!ON.getLanguage(e))throw LN("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw LN("Expected `string` for value, got `%s`",t);null==r&&(r=jN),ON.configure({__emitter:BN,classPrefix:r});const i=ON.highlight(t,{language:e,ignoreIllegals:!0});if(ON.configure({}),i.errorRaised)throw i.errorRaised;return i._emitter.root.data.language=i.language,i._emitter.root.data.relevance=i.relevance,i._emitter.root}class BN{constructor(e){this.options=e,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(e){if(""===e)return;const t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})}addKeyword(e,t){this.openNode(t),this.addText(e),this.closeNode()}addSublanguage(e,t){const n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:"element",tagName:"span",properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){const t=e.split(".").map(((e,t)=>t?e+"_".repeat(t):this.options.classPrefix+e)),n={type:"element",tagName:"span",properties:{className:t},children:[]};this.stack[this.stack.length-1].children.push(n),this.stack.push(n)}closeNode(){this.stack.pop()}closeAllNodes(){}finalize(){}toHTML(){return""}}const PN={highlight:RN,highlightAuto:function(e,t={}){const n=t.subset||ON.listLanguages();t.prefix;let r=-1,i={type:"root",data:{language:null,relevance:0},children:[]};if("string"!=typeof e)throw LN("Expected `string` for value, got `%s`",e);for(;++r<n.length;){const o=n[r];if(!ON.getLanguage(o))continue;const s=RN(o,e,t);s.data.relevance>i.data.relevance&&(i=s)}return i},registerLanguage:function(e,t){ON.registerLanguage(e,t)},registered:function(e){return Boolean(ON.getLanguage(e))},listLanguages:function(){return ON.listLanguages()},registerAlias:function(e,t){if("string"==typeof e)ON.registerAliases(t,{languageName:e});else{let t;for(t in e)zN.call(e,t)&&ON.registerAliases(e[t],{languageName:t})}}};PN.registerLanguage("arduino",(function(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line "+"pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+"\\s*\\(",p={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},h={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},f=[h,c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:p,contains:f.concat([{begin:/\(/,end:/\)/,keywords:p,contains:f.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:p,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:p,relevance:0},{begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[a,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:p,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(m,g,h,f,[c,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:p,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:p},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n})),PN.registerLanguage("bash",(function(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);const a={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},l=e.SHEBANG({binary:`(${["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"].join("|")})`,relevance:10}),c={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","for","while","in","do","done","case","esac","function"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[l,e.SHEBANG(),c,a,e.HASH_COMMENT_MODE,o,{match:/(\/[a-z._-]+)+/},s,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},n]}})),PN.registerLanguage("c",(function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line "+"pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+"\\s*\\(",p={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream "+"auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set "+"unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos "+"asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp "+"fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper "+"isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow "+"printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp "+"strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan "+"vfprintf vprintf vsprintf endl initializer_list unique_ptr"},h=[c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],f={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:p,contains:h.concat([{begin:/\(/,end:/\)/,keywords:p,contains:h.concat(["self"]),relevance:0}]),relevance:0},m={begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:p,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:p,relevance:0},{begin:d,returnBegin:!0,contains:[e.inherit(u,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:p,disableAutodetect:!0,illegal:"</",contains:[].concat(f,m,h,[c,{begin:e.IDENT_RE+"::",keywords:p},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:c,strings:a,keywords:p}}})),PN.registerLanguage("cpp",(function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line "+"pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+"\\s*\\(",p={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},h={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},f=[h,c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:p,contains:f.concat([{begin:/\(/,end:/\)/,keywords:p,contains:f.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:p,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:p,relevance:0},{begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[a,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:p,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(m,g,h,f,[c,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:p,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:p},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}})),PN.registerLanguage("csharp",(function(e){const t={keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},n=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),r={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},i={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},o=e.inherit(i,{illegal:/\n/}),s={className:"subst",begin:/\{/,end:/\}/,keywords:t},a=e.inherit(s,{illegal:/\n/}),l={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,a]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]},u=e.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},a]});s.contains=[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.C_BLOCK_COMMENT_MODE],a.contains=[u,l,o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const d={variants:[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},p={begin:"<",end:">",contains:[{beginKeywords:"in out"},n]},h=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",f={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:t,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},d,r,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},n,p,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,p,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+h+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:t,contains:[{beginKeywords:["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"].join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,p],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,relevance:0,contains:[d,r,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},f]}})),PN.registerLanguage("css",(function(e){const t=e.regex,n=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"("+"%|em|ex|ch|rem"+"|vw|vh|vmin|vmax"+"|cm|mm|in|pt|pc|px"+"|deg|grad|rad|turn"+"|s|ms"+"|Hz|kHz"+"|dpi|dpcm|dppx"+")?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(e),r=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+"[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+uC.join("|")+")"},{begin:":(:)?("+dC.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+pC.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...r,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...r,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:cC.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...r,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+lC.join("|")+")\\b"}]}})),PN.registerLanguage("diff",(function(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}})),PN.registerLanguage("go",(function(e){const t={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:t,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{begin:e.C_NUMBER_RE+"[i]",relevance:1},e.C_NUMBER_MODE]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}})),PN.registerLanguage("graphql",(function(e){const t=e.regex;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(/[_A-Za-z][_0-9A-Za-z]*/,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}})),PN.registerLanguage("ini",(function(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},o={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[r,o,i,s,n,"self"],relevance:0},l=t.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:t.concat(l,"(\\s*\\.\\s*",l,")*",t.lookahead(/\s*=\s*[^#\s]/)),className:"attr",starts:{end:/$/,contains:[r,a,o,i,s,n]}}]}})),PN.registerLanguage("java",(function(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+bC("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),i={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},o={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},s={className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:i,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:i,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,gC,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},gC,o]}})),PN.registerLanguage("javascript",(function(e){const t=e.regex,n=yC,r="<>",i="</>",o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,r=e.input[n];if("<"===r||","===r)return void t.ignoreMatch();let i;">"===r&&(((e,{after:t})=>{const n="</"+e[0].slice(1);return-1!==e.input.indexOf(n,t)})(e,{after:n})||t.ignoreMatch());(i=e.input.substring(n).match(/^\s+extends\s+/))&&0===i.index&&t.ignoreMatch()}},s={$pattern:yC,keyword:vC,literal:wC,built_in:MC,"variable.language":kC},a="[0-9](_?[0-9])*",l=`\\.(${a})`,c=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,u={className:"number",variants:[{begin:`(\\b(${c})((${l})|\\.)?|(${l}))`+`[eE][+-]?(${a})\\b`},{begin:`\\b(${c})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},p={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},f={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},m={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},g=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,f,u];d.contains=g.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(g)});const b=[].concat(m,d.contains),y=b.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(b)}]),v={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:y},w={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},_={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[..._C,...xC]}},x={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[v],illegal:/%/},E={match:t.concat(/\b/,(k=[...EC,"super"],t.concat("(?!",k.join("|"),")")),n,t.lookahead(/\(/)),className:"title.function",relevance:0};var k;const M={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},D={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},v]},C="(\\("+"[^()]*(\\("+"[^()]*(\\("+"[^()]*"+"\\)[^()]*)*"+"\\)[^()]*)*"+"\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",S={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[v]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:y,CLASS_REFERENCE:_},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,f,m,u,_,{className:"attr",begin:n+t.lookahead(":"),relevance:0},S,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r,end:i},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},x,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\("+"[^()]*(\\("+"[^()]*(\\("+"[^()]*"+"\\)[^()]*)*"+"\\)[^()]*)*"+"\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[v,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},M,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[v]},E,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},w,D,{match:/\$[(.]/}]}})),PN.registerLanguage("json",(function(e){const t=["true","false","null"],n={scope:"literal",beginKeywords:t.join(" ")};return{name:"JSON",keywords:{literal:t},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}})),PN.registerLanguage("kotlin",(function(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline "+"crossinline dynamic final enum if else do while for when throw try catch finally "+"import package is in fun override companion reified inline lateinit init "+"interface annotation data sealed internal infix operator out by constructor super "+"tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,i,r]}]};r.contains.push(o);const s={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},a={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},l=NC,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),u={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},d=u;return d.variants[1].contains=[u],u.variants[1].contains=[d],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n,s,a,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[u,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,s,a,o,e.C_NUMBER_MODE]},c]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},s,a]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},l]}})),PN.registerLanguage("less",(function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"("+"%|em|ex|ch|rem"+"|vw|vh|vmin|vmax"+"|cm|mm|in|pt|pc|px"+"|deg|grad|rad|turn"+"|s|ms"+"|Hz|kHz"+"|dpi|dpcm|dppx"+")?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(e),n=FC,r="[\\w-]+",i="("+r+"|@\\{"+r+"\\})",o=[],s=[],a=function(e){return{className:"string",begin:"~?"+e+".*?"+e}},l=function(e,t,n){return{className:e,begin:t,relevance:n}},c={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:OC.join(" ")},u={begin:"\\(",end:"\\)",contains:s,keywords:c,relevance:0};s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a("'"),a('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,u,l("variable","@@?"+r,10),l("variable","@\\{"+r+"\\}"),l("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const d=s.concat({begin:/\{/,end:/\}/,contains:o}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},h={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+LC.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},f={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:c,returnEnd:!0,contains:s,relevance:0}},m={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:d}},g={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,l("keyword","all\\b"),l("variable","@\\{"+r+"\\}"),{begin:"\\b("+AC.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,l("selector-tag",i,0),l("selector-id","#"+i),l("selector-class","\\."+i,0),l("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+TC.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+IC.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:d},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:r+":(:)?"+`(${n.join("|")})`,returnBegin:!0,contains:[g]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,m,b,h,g,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:o}})),PN.registerLanguage("lua",(function(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len "+"__gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert "+"collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring "+"module next pairs pcall print rawequal rawget rawset require select setfenv "+"setmetatable tonumber tostring type unpack xpcall arg self "+"coroutine resume yield status wrap create running debug getupvalue "+"debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv "+"io lines write close flush open output type read stderr stdin input stdout popen tmpfile "+"math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan "+"os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall "+"string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower "+"table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}})),PN.registerLanguage("makefile",(function(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort "+"word wordlist firstword lastword dir notdir suffix basename "+"addsuffix addprefix join wildcard realpath abspath error warning "+"shell origin flavor foreach if or and call eval file value"},contains:[t]},i={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},o={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif "+"include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,r,i,{className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},o]}})),PN.registerLanguage("markdown",(function(e){const t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},n={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},r={className:"strong",contains:[],variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},i={className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{begin:/_(?!_)/,end:/_/,relevance:0}]},o=e.inherit(r,{contains:[]}),s=e.inherit(i,{contains:[]});r.contains.push(s),i.contains.push(o);let a=[t,n];return[r,i,o,s].forEach((e=>{e.contains=e.contains.concat(a)})),a=a.concat(r,i),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:a},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:a}]}]},t,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},r,i,{className:"quote",begin:"^>\\s+",contains:a,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},n,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}})),PN.registerLanguage("objectivec",(function(e){const t=/[a-zA-Z@][a-zA-Z0-9_]*/,n={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},illegal:"</",contains:[{className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line "+"pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+n.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:n,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}})),PN.registerLanguage("perl",(function(e){const t=e.regex,n=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"].join(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},o={begin:/->\{/,end:/\}/},s={variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,`(?![A-Za-z])(?![@$%])`)},{begin:/[$%@][^\s\w{]/,relevance:0}]},a=[e.BACKSLASH_ESCAPE,i,s],l=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],c=(e,r,i="\\1")=>{const o="\\1"===i?i:t.concat(i,r);return t.concat(t.concat("(?:",e,")"),r,/(?:\\.|[^\\\/])*?/,o,/(?:\\.|[^\\\/])*?/,i,n)},u=(e,r,i)=>t.concat(t.concat("(?:",e,")"),r,/(?:\\.|[^\\\/])*?/,i,n),d=[s,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:a,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:c("s|tr|y",t.either(...l,{capture:!0}))},{begin:c("s|tr|y","\\(","\\)")},{begin:c("s|tr|y","\\[","\\]")},{begin:c("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:u("(?:m|qr)?",/\//,/\//)},{begin:u("m|qr",t.either(...l,{capture:!0}),/\1/)},{begin:u("m|qr",/\(/,/\)/)},{begin:u("m|qr",/\[/,/\]/)},{begin:u("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=d,o.contains=d,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:d}})),PN.registerLanguage("php",(function(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o={scope:"variable",match:"\\$+"+r},s={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},a=e.inherit(e.APOS_STRING_MODE,{illegal:null}),l="[ \t\n]",c={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(s)}),a,e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(s)})]},u={scope:"number",variants:[{begin:`\\b0[bB][01]+(?:_[01]+)*\\b`},{begin:`\\b0[oO][0-7]+(?:_[0-7]+)*\\b`},{begin:`\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b`},{begin:`(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?`}],relevance:0},d=["false","null","true"],p=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],h=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],f={keyword:p,literal:(e=>{const t=[];return e.forEach((e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())})),t})(d),built_in:h},m=e=>e.map((e=>e.replace(/\|\d+$/,""))),g={variants:[{match:[/new/,t.concat(l,"+"),t.concat("(?!",m(h).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},b=t.concat(r,"\\b(?!\\()"),y={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),b],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),b],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},v={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},w={relevance:0,begin:/\(/,end:/\)/,keywords:f,contains:[v,o,y,e.C_BLOCK_COMMENT_MODE,c,u,g]},_={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",m(p).join("\\b|"),"|",m(h).join("\\b|"),"\\b)"),r,t.concat(l,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[w]};w.contains.push(_);const x=[v,y,e.C_BLOCK_COMMENT_MODE,c,u,g];return{case_insensitive:!1,keywords:f,contains:[{begin:t.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:d,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:d,keyword:["new","array"]},contains:["self",...x]},...x,{scope:"meta",match:i}]},e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},o,_,y,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},g,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",o,y,e.C_BLOCK_COMMENT_MODE,c,u]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},c,u]}})),PN.registerLanguage("php-template",(function(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}})),PN.registerLanguage("plaintext",(function(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}})),PN.registerLanguage("python",(function(e){const t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},o={className:"meta",begin:/^(>>>|\.\.\.) /},s={className:"subst",begin:/\{/,end:/\}/,keywords:i,illegal:/#/},a={begin:/\{\{/,relevance:0},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o,a,s]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,s]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},c="[0-9](_?[0-9])*",u=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,d=`\\b|${r.join("|")}`,p={className:"number",relevance:0,variants:[{begin:`(\\b(${c})|(${u}))[eE][+-]?(${c})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${c})[jJ](?=${d})`}]},h={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},f={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:["self",o,p,l,e.HASH_COMMENT_MODE]}]};return s.contains=[l,p,o],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:i,illegal:/(<\/|->|\?)|=>/,contains:[o,p,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},l,h,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[f]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[p,f,l]}]}})),PN.registerLanguage("python-repl",(function(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}})),PN.registerLanguage("r",(function(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 "+"NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F "+"abs acos acosh all any anyNA Arg as.call as.character "+"as.complex as.double as.environment as.integer as.logical "+"as.null.default as.numeric as.raw asin asinh atan atanh attr "+"attributes baseenv browser c call ceiling class Conj cos cosh "+"cospi cummax cummin cumprod cumsum digamma dim dimnames "+"emptyenv exp expression floor forceAndCall gamma gc.time "+"globalenv Im interactive invisible is.array is.atomic is.call "+"is.character is.complex is.double is.environment is.expression "+"is.finite is.function is.infinite is.integer is.language "+"is.list is.logical is.matrix is.na is.name is.nan is.null "+"is.numeric is.object is.pairlist is.raw is.recursive is.single "+"is.symbol lazyLoadDBfetch length lgamma list log max min "+"missing Mod names nargs nzchar oldClass on.exit pos.to.env "+"proc.time prod quote range Re rep retracemem return round "+"seq_along seq_len seq.int sign signif sin sinh sinpi sqrt "+"standardGeneric substitute sum switch tan tanh tanpi tracemem "+"trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}})),PN.registerLanguage("ruby",(function(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__"],"variable.language":["self","super"],keyword:["alias","and","attr_accessor","attr_reader","attr_writer","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","include","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield"],built_in:["proc","lambda"],literal:["true","false","nil"]},s={className:"doctag",begin:"@[A-Za-z]+"},a={begin:"#<",end:">"},l=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^=begin","^=end",{contains:[s],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:o},u={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},d="[0-9](_?[0-9])*",p={className:"number",relevance:0,variants:[{begin:`\\b(${"[1-9](_?[0-9])*|0"})(\\.(${d}))?([eE][+-]?(${d})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},h={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},f=[u,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/class\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{relevance:0,match:[i,/\.new[ (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[h]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[u,{begin:n}],relevance:0},p,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])"+`(?![A-Za-z])(?![@$?'])`},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(a,l),relevance:0}].concat(a,l);c.contains=f,h.contains=f;const m=[{begin:/^\s*=>/,starts:{end:"$",contains:f}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:f}}];return l.unshift(a),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(m).concat(l).concat(f)}})),PN.registerLanguage("rust",(function(e){const t=e.regex,n={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let\b)/,e.IDENT_RE,t.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",i=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],o=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:o,keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:i},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+r},{begin:"\\b0o([0-7_]+)"+r},{begin:"\\b0x([A-Fa-f0-9_]+)"+r},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+r}],relevance:0},{begin:[/fn/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,e.UNDERSCORE_IDENT_RE,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:i,type:o}},{className:"punctuation",begin:"->"},n]}})),PN.registerLanguage("scss",(function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"("+"%|em|ex|ch|rem"+"|vw|vh|vmin|vmax"+"|cm|mm|in|pt|pc|px"+"|deg|grad|rad|turn"+"|s|ms"+"|Hz|kHz"+"|dpi|dpcm|dppx"+")?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(e),n=BC,r=RC,i="@[a-z-]+",o={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+zC.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+PC.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,o,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:jC.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}})),PN.registerLanguage("shell",(function(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}})),PN.registerLanguage("sql",(function(e){const t=e.regex,n=e.COMMENT("--","$"),r=["true","false","unknown"],i=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],o=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],s=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],a=o,l=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!o.includes(e))),c={begin:t.concat(/\b/,t.either(...a),/\s*\(/),relevance:0,keywords:{built_in:a}};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(e,{exceptions:t,when:n}={}){const r=n;return t=t||[],e.map((e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e))}(l,{when:e=>e.length<3}),literal:r,type:i,built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{begin:t.either(...s),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:l.concat(s),literal:r,type:i}},{className:"type",begin:t.either("double precision","large object","with timezone","without timezone")},c,{className:"variable",begin:/@[a-z0-9]+/},{className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}})),PN.registerLanguage("swift",(function(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,WC(...qC,...KC)],className:{2:"keyword"}},o={match:$C(/\./,WC(...YC)),relevance:0},s=YC.filter((e=>"string"==typeof e)).concat(["_|0"]),a={variants:[{className:"keyword",match:WC(...YC.filter((e=>"string"!=typeof e)).concat(GC).map(VC),...KC)}]},l={$pattern:WC(/\b\w+/,/#\w+/),keyword:s.concat(ZC),literal:QC},c=[i,o,a],u=[{match:$C(/\./,WC(...XC)),relevance:0},{className:"built_in",match:$C(/\b/,WC(...XC),/(?=\()/)}],d={match:/->/,relevance:0},p=[d,{className:"operator",relevance:0,variants:[{match:nS},{match:`\\.(\\.|${tS})+`}]}],h="([0-9]_*)+",f="([0-9a-fA-F]_*)+",m={className:"number",relevance:0,variants:[{match:`\\b(${h})(\\.(${h}))?`+`([eE][+-]?(${h}))?\\b`},{match:`\\b0x(${f})(\\.(${f}))?`+`([pP][+-]?(${h}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},g=(e="")=>({className:"subst",variants:[{match:$C(/\\/,e,/[0\\tnr"']/)},{match:$C(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),b=(e="")=>({className:"subst",match:$C(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),y=(e="")=>({className:"subst",label:"interpol",begin:$C(/\\/,e,/\(/),end:/\)/}),v=(e="")=>({begin:$C(e,/"""/),end:$C(/"""/,e),contains:[g(e),b(e),y(e)]}),w=(e="")=>({begin:$C(e,/"/),end:$C(/"/,e),contains:[g(e),y(e)]}),_={className:"string",variants:[v(),v("#"),v("##"),v("###"),w(),w("#"),w("##"),w("###")]},x={match:$C(/`/,oS,/`/)},E=[x,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${iS}+`}],k=[{match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:lS,contains:[...p,m,_]}]}},{className:"keyword",match:$C(/@/,WC(...aS))},{className:"meta",match:$C(/@/,oS)}],M={match:HC(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:$C(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,iS,"+")},{className:"type",match:sS,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:$C(/\s+&\s+/,HC(sS)),relevance:0}]},D={begin:/</,end:/>/,keywords:l,contains:[...r,...c,...k,d,M]};M.contains.push(D);const C={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{match:$C(oS,/\s*:/),keywords:"_|0",relevance:0},...r,...c,...u,...p,m,_,...E,...k,M]},S={begin:/</,end:/>/,contains:[...r,M]},N={begin:/\(/,end:/\)/,keywords:l,contains:[{begin:WC(HC($C(oS,/\s*:/)),HC($C(oS,/\s+/,oS,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:oS}]},...r,...c,...p,m,_,...k,M,C],endsParent:!0,illegal:/["']/},A={match:[/func/,/\s+/,WC(x.match,oS,nS)],className:{1:"keyword",3:"title.function"},contains:[S,N,t],illegal:[/\[/,/%/]},O={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[S,N,t],illegal:/\[|%/},T={match:[/operator/,/\s+/,nS],className:{1:"keyword",3:"title"}},I={begin:[/precedencegroup/,/\s+/,sS],className:{1:"keyword",3:"title"},contains:[M],keywords:[...JC,...QC],end:/}/};for(const e of _.variants){const t=e.contains.find((e=>"interpol"===e.label));t.keywords=l;const n=[...c,...u,...p,m,_,...E];t.contains=[...n,{begin:/\(/,end:/\)/,contains:["self",...n]}]}return{name:"Swift",keywords:l,contains:[...r,A,O,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:l,contains:[e.inherit(e.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c]},T,I,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...c,...u,...p,m,_,...E,...k,M,C]}})),PN.registerLanguage("typescript",(function(e){const t=bS(e),n=cS,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[t.exports.CLASS_REFERENCE]},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[t.exports.CLASS_REFERENCE]},s={$pattern:cS,keyword:uS.concat(["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"]),literal:dS,built_in:gS.concat(r),"variable.language":mS},a={className:"meta",begin:"@"+n},l=(e,t,n)=>{const r=e.contains.findIndex((e=>e.label===t));if(-1===r)throw new Error("can not find mode to replace");e.contains.splice(r,1,n)};Object.assign(t.keywords,s),t.exports.PARAMS_CONTAINS.push(a),t.contains=t.contains.concat([a,i,o]),l(t,"shebang",e.SHEBANG()),l(t,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/});const c=t.contains.find((e=>"func.def"===e.label));return c.relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx"]}),t})),PN.registerLanguage("vbnet",(function(e){const t=e.regex,n=/\d{1,2}\/\d{1,2}\/\d{4}/,r=/\d{4}-\d{1,2}-\d{1,2}/,i=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,s={className:"literal",variants:[{begin:t.concat(/# */,t.either(r,n),/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,i,/ *#/)},{begin:t.concat(/# */,t.either(r,n),/ +/,t.either(i,o),/ *#/)}]},a=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),l=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval "+"call case catch class compare const continue custom declare default delegate dim distinct do "+"each equals else elseif end enum erase error event exit explicit finally for friend from function "+"get global goto group handles if implements imports in inherits interface into iterator "+"join key let lib loop me mid module mustinherit mustoverride mybase myclass "+"namespace narrowing new next notinheritable notoverridable "+"of off on operator option optional order overloads overridable overrides "+"paramarray partial preserve private property protected public "+"raiseevent readonly redim removehandler resume return "+"select set shadows shared skip static step stop structure strict sub synclock "+"take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor "+"cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s,{className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{className:"label",begin:/^\w+:/},a,l,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[l]}]}})),PN.registerLanguage("wasm",(function(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);return t.contains.push("self"),{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"]},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},{className:"variable",begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},{className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}})),PN.registerLanguage("xml",(function(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(i,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),a=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,a,s,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,o,a,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}})),PN.registerLanguage("yaml",(function(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},i=e.inherit(r,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),o={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},s={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},a={begin:/\{/,end:/\}/,contains:[s],illegal:"\\n",relevance:0},l={begin:"\\[",end:"\\]",contains:[s],illegal:"\\n",relevance:0},c=[{className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},o,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},a,l,r],u=[...c];return u.pop(),u.push(i),s.contains=u,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:c}}));const UN=()=>r.createElement($x,{"data-cy":"neeto-editor-code-block"},r.createElement("pre",null,r.createElement(Hx,{as:"code"})));var HN=aC.extend({addNodeView:()=>new qx(UN)}).configure({lowlight:PN});const $N={underline:{},highlight:{},codeBlock:{},figCaption:{},embeds:{},link:{},emojiSuggestion:{},emojiPicker:{},customCommands:{},characterCount:{},focus:{mode:"shallowest"},starterKit:{document:!1,codeBlock:!1,code:!1},placeholder:{}};var WN=Av.create({name:"paste-unformatted",addCommands:()=>({pasteUnformatted:()=>async e=>{let{editor:t}=e;const n=await navigator.clipboard.readText();t.commands.insertContent(n)}})}),VN=_w.create({name:"external-video",addOptions:()=>({inline:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},title:{default:null},frameborder:{default:"0"},allow:{default:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"},allowfullscreen:{default:"allowfullscreen"}}),parseHTML:()=>[{tag:"iframe[src]"}],renderHTML(e){let{HTMLAttributes:t}=e;return["iframe",pv(this.options.HTMLAttributes,{...t,class:"video-wrapper"})]},addCommands(){return{setExternalVideo:e=>t=>{let{commands:n}=t;return n.insertContent({type:this.name,attrs:e})}}}});const qN=new Dm("suggestion");function KN({pluginKey:e=qN,editor:t,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:s="span",decorationClass:a="suggestion",command:l=(()=>null),items:c=(()=>[]),render:u=(()=>({})),allow:d=(()=>!0)}){let p;const h=null==u?void 0:u(),f=new Em({key:e,view(){return{update:async(e,n)=>{var r,i,o,s,a,u,d;const f=null===(r=this.key)||void 0===r?void 0:r.getState(n),m=null===(i=this.key)||void 0===i?void 0:i.getState(e.state),g=f.active&&m.active&&f.range.from!==m.range.from,b=!f.active&&m.active,y=f.active&&!m.active,v=b||g,w=!b&&!y&&f.query!==m.query&&!g,_=y||g;if(!v&&!w&&!_)return;const x=_&&!v?f:m,E=e.dom.querySelector(`[data-decoration-id="${x.decorationId}"]`);p={editor:t,range:x.range,query:x.query,text:x.text,items:[],command:e=>{l({editor:t,range:x.range,props:e})},decorationNode:E,clientRect:E?()=>{var n;const{decorationId:r}=null===(n=this.key)||void 0===n?void 0:n.getState(t.state),i=e.dom.querySelector(`[data-decoration-id="${r}"]`);return(null==i?void 0:i.getBoundingClientRect())||null}:null},v&&(null===(o=null==h?void 0:h.onBeforeStart)||void 0===o||o.call(h,p)),w&&(null===(s=null==h?void 0:h.onBeforeUpdate)||void 0===s||s.call(h,p)),(w||v)&&(p.items=await c({editor:t,query:x.query})),_&&(null===(a=null==h?void 0:h.onExit)||void 0===a||a.call(h,p)),w&&(null===(u=null==h?void 0:h.onUpdate)||void 0===u||u.call(h,p)),v&&(null===(d=null==h?void 0:h.onStart)||void 0===d||d.call(h,p))},destroy:()=>{var e;p&&(null===(e=null==h?void 0:h.onExit)||void 0===e||e.call(h,p))}}},state:{init:()=>({active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}),apply(e,s,a,l){const{isEditable:c}=t,{composing:u}=t.view,{selection:p}=e,{empty:h,from:f}=p,m={...s};if(m.composing=u,c&&(h||t.view.composing)){!(f<s.range.from||f>s.range.to)||u||s.composing||(m.active=!1);const e=function(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:s}=e,a=n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),l=new RegExp(`\\s${a}$`),c=o?"^":"",u=r?new RegExp(`${c}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${c}(?:^)?${a}[^\\s${a}]*`,"gm"),d=(null===(t=s.nodeBefore)||void 0===t?void 0:t.isText)&&s.nodeBefore.text;if(!d)return null;const p=s.pos-d.length,h=Array.from(d.matchAll(u)).pop();if(!h||void 0===h.input||void 0===h.index)return null;const f=h.input.slice(Math.max(0,h.index-1),h.index),m=new RegExp(`^[${null==i?void 0:i.join("")}\0]?$`).test(f);if(null!==i&&!m)return null;const g=p+h.index;let b=g+h[0].length;return r&&l.test(d.slice(b-1,b+1))&&(h[0]+=" ",b+=1),g<s.pos&&b>=s.pos?{range:{from:g,to:b},query:h[0].slice(n.length),text:h[0]}:null}({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:p.$from}),a=`id_${Math.floor(4294967295*Math.random())}`;e&&d({editor:t,state:l,range:e.range})?(m.active=!0,m.decorationId=s.decorationId?s.decorationId:a,m.range=e.range,m.query=e.query,m.text=e.text):m.active=!1}else m.active=!1;return m.active||(m.decorationId=null,m.range={from:0,to:0},m.query=null,m.text=null),m}},props:{handleKeyDown(e,t){var n;const{active:r,range:i}=f.getState(e.state);return r&&(null===(n=null==h?void 0:h.onKeyDown)||void 0===n?void 0:n.call(h,{view:e,event:t,range:i}))||!1},decorations(e){const{active:t,range:n,decorationId:r}=f.getState(e);return t?uy.create(e.doc,[ay.inline(n.from,n.to,{nodeName:s,class:a,"data-decoration-id":r})]):null}}});return f}function GN(e){return e&&e.__esModule?e.default:e}function YN(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var QN,JN,ZN,XN,eA,tA,nA={},rA=[],iA=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function oA(e,t){for(var n in t)e[n]=t[n];return e}function sA(e){var t=e.parentNode;t&&t.removeChild(e)}function aA(e,t,n){var r,i,o,s={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?QN.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return lA(e,s,r,i,null)}function lA(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++ZN:i};return null==i&&null!=JN.vnode&&JN.vnode(o),o}function cA(e){return e.children}function uA(e,t){this.props=e,this.context=t}function dA(e,t){if(null==t)return e.__?dA(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?dA(e):null}function pA(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return pA(e)}}function hA(e){(!e.__d&&(e.__d=!0)&&XN.push(e)&&!fA.__r++||tA!==JN.debounceRendering)&&((tA=JN.debounceRendering)||eA)(fA)}function fA(){for(var e;fA.__r=XN.length;)e=XN.sort((function(e,t){return e.__v.__b-t.__v.__b})),XN=[],e.some((function(e){var t,n,r,i,o,s;e.__d&&(o=(i=(t=e).__v).__e,(s=t.__P)&&(n=[],(r=oA({},i)).__v=i.__v+1,EA(s,i,r,t.__n,void 0!==s.ownerSVGElement,null!=i.__h?[o]:null,n,null==o?dA(i):o,i.__h),kA(n,i),i.__e!=o&&pA(i)))}))}function mA(e,t,n,r,i,o,s,a,l,c){var u,d,p,h,f,m,g,b=r&&r.__k||rA,y=b.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(h=n.__k[u]=null==(h=t[u])||"boolean"==typeof h?null:"string"==typeof h||"number"==typeof h||"bigint"==typeof h?lA(null,h,null,null,h):Array.isArray(h)?lA(cA,{children:h},null,null,null):h.__b>0?lA(h.type,h.props,h.key,null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(p=b[u])||p&&h.key==p.key&&h.type===p.type)b[u]=void 0;else for(d=0;d<y;d++){if((p=b[d])&&h.key==p.key&&h.type===p.type){b[d]=void 0;break}p=null}EA(e,h,p=p||nA,i,o,s,a,l,c),f=h.__e,(d=h.ref)&&p.ref!=d&&(g||(g=[]),p.ref&&g.push(p.ref,null,h),g.push(d,h.__c||f,h)),null!=f?(null==m&&(m=f),"function"==typeof h.type&&h.__k===p.__k?h.__d=l=gA(h,l,e):l=yA(e,h,p,b,f,l),"function"==typeof n.type&&(n.__d=l)):l&&p.__e==l&&l.parentNode!=e&&(l=dA(p))}for(n.__e=m,u=y;u--;)null!=b[u]&&("function"==typeof n.type&&null!=b[u].__e&&b[u].__e==n.__d&&(n.__d=dA(r,u+1)),DA(b[u],b[u]));if(g)for(u=0;u<g.length;u++)MA(g[u],g[++u],g[++u])}function gA(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?gA(r,t,n):yA(n,r,r,i,r.__e,t));return t}function bA(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){bA(e,t)})):t.push(e)),t}function yA(e,t,n,r,i,o){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<r.length;l+=2)if(a==i)break e;e.insertBefore(i,o),s=o}return void 0!==s?s:i.nextSibling}function vA(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||iA.test(t)?n:n+"px"}function wA(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||vA(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||vA(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?xA:_A,o):e.removeEventListener(t,o?xA:_A,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function _A(e){this.l[e.type+!1](JN.event?JN.event(e):e)}function xA(e){this.l[e.type+!0](JN.event?JN.event(e):e)}function EA(e,t,n,r,i,o,s,a,l){var c,u,d,p,h,f,m,g,b,y,v,w=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(c=JN.__b)&&c(t);try{e:if("function"==typeof w){if(g=t.props,b=(c=w.contextType)&&r[c.__c],y=c?b?b.props.value:c.__:r,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in w&&w.prototype.render?t.__c=u=new w(g,y):(t.__c=u=new uA(g,y),u.constructor=w,u.render=CA),b&&b.sub(u),u.props=g,u.state||(u.state={}),u.context=y,u.__n=r,d=u.__d=!0,u.__h=[]),null==u.__s&&(u.__s=u.state),null!=w.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=oA({},u.__s)),oA(u.__s,w.getDerivedStateFromProps(g,u.__s))),p=u.props,h=u.state,d)null==w.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==w.getDerivedStateFromProps&&g!==p&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,y),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,y)||t.__v===n.__v){u.props=g,u.state=u.__s,t.__v!==n.__v&&(u.__d=!1),u.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),u.__h.length&&s.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,y),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(p,h,f)}))}u.context=y,u.props=g,u.state=u.__s,(c=JN.__r)&&c(t),u.__d=!1,u.__v=t,u.__P=e,c=u.render(u.props,u.state,u.context),u.state=u.__s,null!=u.getChildContext&&(r=oA(oA({},r),u.getChildContext())),d||null==u.getSnapshotBeforeUpdate||(f=u.getSnapshotBeforeUpdate(p,h)),v=null!=c&&c.type===cA&&null==c.key?c.props.children:c,mA(e,Array.isArray(v)?v:[v],t,n,r,i,o,s,a,l),u.base=t.__e,t.__h=null,u.__h.length&&s.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,i,o,s,a){var l,c,u,d=n.props,p=t.props,h=t.type,f=0;if("svg"===h&&(i=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&"setAttribute"in l==!!h&&(h?l.localName===h:3===l.nodeType)){e=l,o[f]=null;break}if(null==e){if(null===h)return document.createTextNode(p);e=i?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,p.is&&p),o=null,a=!1}if(null===h)d===p||a&&e.data===p||(e.data=p);else{if(o=o&&QN.call(e.childNodes),c=(d=n.props||nA).dangerouslySetInnerHTML,u=p.dangerouslySetInnerHTML,!a){if(null!=o)for(d={},f=0;f<e.attributes.length;f++)d[e.attributes[f].name]=e.attributes[f].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||wA(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||wA(e,o,t[o],n[o],r)}(e,p,d,i,a),u)t.__k=[];else if(f=t.props.children,mA(e,Array.isArray(f)?f:[f],t,n,r,i&&"foreignObject"!==h,o,s,o?o[0]:n.__k&&dA(n,0),a),null!=o)for(f=o.length;f--;)null!=o[f]&&sA(o[f]);a||("value"in p&&void 0!==(f=p.value)&&(f!==d.value||f!==e.value||"progress"===h&&!f)&&wA(e,"value",f,d.value,!1),"checked"in p&&void 0!==(f=p.checked)&&f!==e.checked&&wA(e,"checked",f,d.checked,!1))}return e}(n.__e,t,n,r,i,o,s,l);(c=JN.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),JN.__e(e,t,n)}}function kA(e,t){JN.__c&&JN.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){JN.__e(e,t.__v)}}))}function MA(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){JN.__e(e,n)}}function DA(e,t,n){var r,i;if(JN.unmount&&JN.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||MA(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){JN.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&DA(r[i],t,"function"!=typeof e.type);n||null==e.__e||sA(e.__e),e.__e=e.__d=void 0}function CA(e,t,n){return this.constructor(e,n)}function SA(e,t,n){var r,i,o;JN.__&&JN.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],EA(t,e=(!r&&n||t).__k=aA(cA,null,[e]),i||nA,nA,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?QN.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),kA(o,e)}QN=rA.slice,JN={__e:function(e,t){for(var n,r,i;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),i=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),i=n.__d),i)return n.__E=n}catch(t){e=t}throw e}},ZN=0,uA.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=oA({},this.state),"function"==typeof e&&(e=e(oA({},n),this.props)),e&&oA(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),hA(this))},uA.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),hA(this))},uA.prototype.render=cA,XN=[],eA="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,fA.__r=0;var NA=0;function AA(e,t,n,r,i){var o,s,a={};for(s in t)"ref"==s?o=t[s]:a[s]=t[s];var l={type:e,props:a,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--NA,__source:r,__self:i};if("function"==typeof e&&(o=e.defaultProps))for(s in o)void 0===a[s]&&(a[s]=o[s]);return JN.vnode&&JN.vnode(l),l}var OA={set:function(e,t){try{window.localStorage[`emoji-mart.${e}`]=JSON.stringify(t)}catch(e){}},get:function(e){try{const t=window.localStorage[`emoji-mart.${e}`];if(t)return JSON.parse(t)}catch(e){}}};const TA=new Map,IA=[{v:14,emoji:"🫠"},{v:13.1,emoji:"😶‍🌫️"},{v:13,emoji:"🥸"},{v:12.1,emoji:"🧑‍🦰"},{v:12,emoji:"🥱"},{v:11,emoji:"🥰"},{v:5,emoji:"🤩"},{v:4,emoji:"👱‍♀️"},{v:3,emoji:"🤣"},{v:2,emoji:"👋🏻"},{v:1,emoji:"🙃"}];function LA(e){if(TA.has(e))return TA.get(e);const t=FA(e);return TA.set(e,t),t}const FA=(()=>{let e=null;try{navigator.userAgent.includes("jsdom")||(e=document.createElement("canvas").getContext("2d"))}catch{}if(!e)return()=>!1;const t=25,n=20,r=Math.floor(t/2);return e.font=r+"px Arial, Sans-Serif",e.textBaseline="top",e.canvas.width=2*n,e.canvas.height=t,r=>{e.clearRect(0,0,2*n,t),e.fillStyle="#FF0000",e.fillText(r,0,22),e.fillStyle="#0000FF",e.fillText(r,n,22);const i=e.getImageData(0,0,n,t).data,o=i.length;let s=0;for(;s<o&&!i[s+3];s+=4);if(s>=o)return!1;const a=n+s/4%n,l=Math.floor(s/4/n),c=e.getImageData(a,l,1,1).data;return i[s]===c[0]&&i[s+2]===c[2]&&!(e.measureText(r).width>=n)}})();var zA={latestVersion:function(){for(const{v:e,emoji:t}of IA)if(LA(t))return e},noCountryFlags:function(){return!LA("🇨🇦")}};const jA=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart"];let RA=null;var BA,PA={add:function(e){RA||(RA=OA.get("frequently")||{});const t=e.id||e;t&&(RA[t]||(RA[t]=0),RA[t]+=1,OA.set("last",t),OA.set("frequently",RA))},get:function({maxFrequentRows:e,perLine:t}){if(!e)return[];RA||(RA=OA.get("frequently"));let n=[];if(!RA){RA={};for(let e in jA.slice(0,t)){const r=jA[e];RA[r]=t-e,n.push(r)}return n}const r=e*t,i=OA.get("last");for(let e in RA)n.push(e);if(n.sort(((e,t)=>{const n=RA[t],r=RA[e];return n==r?e.localeCompare(t):n-r})),n.length>r){const e=n.slice(r);n=n.slice(0,r);for(let t of e)t!=i&&delete RA[t];i&&-1==n.indexOf(i)&&(delete RA[n[n.length-1]],n.splice(-1,1,i)),OA.set("frequently",RA)}return n}};BA=JSON.parse('{"search":"Search","search_no_results_1":"Oh no!","search_no_results_2":"That emoji couldn’t be found","pick":"Pick an emoji…","add_custom":"Add custom emoji","categories":{"activity":"Activity","custom":"Custom","flags":"Flags","foods":"Food & Drink","frequent":"Frequently used","nature":"Animals & Nature","objects":"Objects","people":"Smileys & People","places":"Travel & Places","search":"Search Results","symbols":"Symbols"},"skins":{"1":"Default","2":"Light","3":"Medium-Light","4":"Medium","5":"Medium-Dark","6":"Dark","choose":"Choose default skin tone"}}');var UA={autoFocus:{value:!1},emojiButtonColors:{value:null},emojiButtonRadius:{value:"100%"},emojiButtonSize:{value:36},emojiSize:{value:24},emojiVersion:{value:14,choices:[1,2,3,4,5,11,12,12.1,13,13.1,14]},icons:{value:"auto",choices:["auto","outline","solid"]},locale:{value:"en",choices:["en","ar","cs","de","es","fa","fi","fr","it","ja","nl","pl","pt","ru","uk","zh"]},maxFrequentRows:{value:4},navPosition:{value:"top",choices:["top","bottom","none"]},noCountryFlags:{value:!1},noResultsEmoji:{value:null},perLine:{value:9},previewEmoji:{value:null},previewPosition:{value:"bottom",choices:["top","bottom","none"]},searchPosition:{value:"sticky",choices:["sticky","static","none"]},set:{value:"native",choices:["native","apple","facebook","google","twitter"]},skin:{value:1,choices:[1,2,3,4,5,6]},skinTonePosition:{value:"preview",choices:["preview","search","none"]},theme:{value:"auto",choices:["auto","light","dark"]},categories:null,categoryIcons:null,custom:null,data:null,i18n:null,getImageURL:null,getSpritesheetURL:null,onAddCustomEmoji:null,onClickOutside:null,onEmojiSelect:null,stickySearch:{deprecated:!0,value:!0}};let HA=null,$A=null;const WA={};async function VA(e){if(WA[e])return WA[e];const t=await fetch(e),n=await t.json();return WA[e]=n,n}let qA=null,KA=null,GA=!1;function YA(e,{caller:t}={}){return qA||(qA=new Promise((e=>{KA=e}))),e?async function(e){GA=!0;let{emojiVersion:t,set:n,locale:r}=e;if(t||(t=UA.emojiVersion.value),n||(n=UA.set.value),r||(r=UA.locale.value),$A)$A.categories=$A.categories.filter((e=>!!!e.name));else{$A=("function"==typeof e.data?await e.data():e.data)||await VA(`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/sets/${t}/${n}.json`),$A.emoticons={},$A.natives={},$A.categories.unshift({id:"frequent",emojis:[]});for(const e in $A.aliases){const t=$A.aliases[e],n=$A.emojis[t];n&&(n.aliases||(n.aliases=[]),n.aliases.push(e))}}if(HA=("function"==typeof e.i18n?await e.i18n():e.i18n)||("en"==r?GN(BA):await VA(`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/i18n/${r}.json`)),e.custom)for(let t in e.custom){t=parseInt(t);const n=e.custom[t],r=e.custom[t-1];if(n.emojis&&n.emojis.length){n.id||(n.id=`custom_${t+1}`),n.name||(n.name=HA.categories.custom),r&&!n.icon&&(n.target=r.target||r),$A.categories.push(n);for(const e of n.emojis)$A.emojis[e.id]=e}}e.categories&&($A.categories=$A.categories.filter((t=>-1!=e.categories.indexOf(t.id))).sort(((t,n)=>e.categories.indexOf(t.id)-e.categories.indexOf(n.id))));let i=null,o=null;"native"==n&&(i=zA.latestVersion(),o=e.noCountryFlags||zA.noCountryFlags());let s=$A.categories.length,a=!1;for(;s--;){const t=$A.categories[s];if("frequent"==t.id){let{maxFrequentRows:n,perLine:r}=e;n||(n=UA.maxFrequentRows.value),r||(r=UA.perLine.value),t.emojis=PA.get({maxFrequentRows:n,perLine:r})}if(!t.emojis||!t.emojis.length){$A.categories.splice(s,1);continue}const{categoryIcons:n}=e;if(n){const e=n[t.id];e&&!t.icon&&(t.icon=e)}let r=t.emojis.length;for(;r--;){const e=t.emojis[r],n=e.id?e:$A.emojis[e],s=()=>{t.emojis.splice(r,1)};if(n)if(i&&n.version>i)s();else if(!o||"flags"!=t.id||eO.includes(n.id)){if(!n.search){if(a=!0,n.search=","+[[n.id,!1],[n.name,!0],[n.keywords,!1],[n.emoticons,!1]].map((([e,t])=>{if(e)return(Array.isArray(e)?e:[e]).map((e=>(t?e.split(/[-|_|\s]+/):[e]).map((e=>e.toLowerCase())))).flat()})).flat().filter((e=>e&&e.trim())).join(","),n.emoticons)for(const e of n.emoticons)$A.emoticons[e]||($A.emoticons[e]=n.id);let e=0;for(const t of n.skins){if(!t)continue;e++;const{native:r}=t;r&&($A.natives[r]=n.id,n.search+=`,${r}`);const i=1==e?"":`:skin-tone-${e}:`;t.shortcodes=`:${n.id}:${i}`}}}else s();else s()}}a&&XA.reset();KA()}(e):t&&!GA&&console.warn(`\`${t}\` requires data to be initialized first. Promise will be pending until \`init\` is called.`),qA}function QA(e,t,n){e||(e={});const r={};for(let i in t)r[i]=JA(i,e,t,n);return r}function JA(e,t,n,r){const i=n[e];let o=r&&r.getAttribute(e)||(null!=t[e]&&null!=t[e]?t[e]:null);return i?(null!=o&&i.value&&typeof i.value!=typeof o&&(o="boolean"==typeof i.value?"false"!=o:i.value.constructor(o)),i.transform&&o&&(o=i.transform(o)),(null==o||i.choices&&-1==i.choices.indexOf(o))&&(o=i.value),o):o}let ZA=null;var XA={search:async function(e,{maxResults:t,caller:n}={}){if(!e||!e.trim().length)return null;t||(t=90),await YA(null,{caller:n||"SearchIndex.search"});const r=e.toLowerCase().replace(/(\w)-/,"$1 ").split(/[\s|,]+/).filter(((e,t,n)=>e.trim()&&n.indexOf(e)==t));if(!r.length)return;let i,o,s=ZA||(ZA=Object.values($A.emojis));for(const e of r){if(!s.length)break;i=[],o={};for(const t of s){if(!t.search)continue;const n=t.search.indexOf(`,${e}`);-1!=n&&(i.push(t),o[t.id]||(o[t.id]=0),o[t.id]+=t.id==e?0:n+1)}s=i}return i.length<2||(i.sort(((e,t)=>{const n=o[e.id],r=o[t.id];return n==r?e.id.localeCompare(t.id):n-r})),i.length>t&&(i=i.slice(0,t))),i},get:function(e){return e.id?e:$A.emojis[e]||$A.emojis[$A.aliases[e]]||$A.emojis[$A.natives[e]]},reset:function(){ZA=null},SHORTCODES_REGEX:/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/};const eO=["checkered_flag","crossed_flags","pirate_flag","rainbow-flag","transgender_flag","triangular_flag_on_post","waving_black_flag","waving_white_flag"];var tO={categories:{activity:{outline:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:AA("path",{d:"M12 0C5.373 0 0 5.372 0 12c0 6.627 5.373 12 12 12 6.628 0 12-5.373 12-12 0-6.628-5.372-12-12-12m9.949 11H17.05c.224-2.527 1.232-4.773 1.968-6.113A9.966 9.966 0 0 1 21.949 11M13 11V2.051a9.945 9.945 0 0 1 4.432 1.564c-.858 1.491-2.156 4.22-2.392 7.385H13zm-2 0H8.961c-.238-3.165-1.536-5.894-2.393-7.385A9.95 9.95 0 0 1 11 2.051V11zm0 2v8.949a9.937 9.937 0 0 1-4.432-1.564c.857-1.492 2.155-4.221 2.393-7.385H11zm4.04 0c.236 3.164 1.534 5.893 2.392 7.385A9.92 9.92 0 0 1 13 21.949V13h2.04zM4.982 4.887C5.718 6.227 6.726 8.473 6.951 11h-4.9a9.977 9.977 0 0 1 2.931-6.113M2.051 13h4.9c-.226 2.527-1.233 4.771-1.969 6.113A9.972 9.972 0 0 1 2.051 13m16.967 6.113c-.735-1.342-1.744-3.586-1.968-6.113h4.899a9.961 9.961 0 0 1-2.931 6.113"})}),solid:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:AA("path",{d:"M16.17 337.5c0 44.98 7.565 83.54 13.98 107.9C35.22 464.3 50.46 496 174.9 496c9.566 0 19.59-.4707 29.84-1.271L17.33 307.3C16.53 317.6 16.17 327.7 16.17 337.5zM495.8 174.5c0-44.98-7.565-83.53-13.98-107.9c-4.688-17.54-18.34-31.23-36.04-35.95C435.5 27.91 392.9 16 337 16c-9.564 0-19.59 .4707-29.84 1.271l187.5 187.5C495.5 194.4 495.8 184.3 495.8 174.5zM26.77 248.8l236.3 236.3c142-36.1 203.9-150.4 222.2-221.1L248.9 26.87C106.9 62.96 45.07 177.2 26.77 248.8zM256 335.1c0 9.141-7.474 16-16 16c-4.094 0-8.188-1.564-11.31-4.689L164.7 283.3C161.6 280.2 160 276.1 160 271.1c0-8.529 6.865-16 16-16c4.095 0 8.189 1.562 11.31 4.688l64.01 64C254.4 327.8 256 331.9 256 335.1zM304 287.1c0 9.141-7.474 16-16 16c-4.094 0-8.188-1.564-11.31-4.689L212.7 235.3C209.6 232.2 208 228.1 208 223.1c0-9.141 7.473-16 16-16c4.094 0 8.188 1.562 11.31 4.688l64.01 64.01C302.5 279.8 304 283.9 304 287.1zM256 175.1c0-9.141 7.473-16 16-16c4.094 0 8.188 1.562 11.31 4.688l64.01 64.01c3.125 3.125 4.688 7.219 4.688 11.31c0 9.133-7.468 16-16 16c-4.094 0-8.189-1.562-11.31-4.688l-64.01-64.01C257.6 184.2 256 180.1 256 175.1z"})})},custom:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:AA("path",{d:"M417.1 368c-5.937 10.27-16.69 16-27.75 16c-5.422 0-10.92-1.375-15.97-4.281L256 311.4V448c0 17.67-14.33 32-31.1 32S192 465.7 192 448V311.4l-118.3 68.29C68.67 382.6 63.17 384 57.75 384c-11.06 0-21.81-5.734-27.75-16c-8.828-15.31-3.594-34.88 11.72-43.72L159.1 256L41.72 187.7C26.41 178.9 21.17 159.3 29.1 144C36.63 132.5 49.26 126.7 61.65 128.2C65.78 128.7 69.88 130.1 73.72 132.3L192 200.6V64c0-17.67 14.33-32 32-32S256 46.33 256 64v136.6l118.3-68.29c3.838-2.213 7.939-3.539 12.07-4.051C398.7 126.7 411.4 132.5 417.1 144c8.828 15.31 3.594 34.88-11.72 43.72L288 256l118.3 68.28C421.6 333.1 426.8 352.7 417.1 368z"})}),flags:{outline:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:AA("path",{d:"M0 0l6.084 24H8L1.916 0zM21 5h-4l-1-4H4l3 12h3l1 4h13L21 5zM6.563 3h7.875l2 8H8.563l-2-8zm8.832 10l-2.856 1.904L12.063 13h3.332zM19 13l-1.5-6h1.938l2 8H16l3-2z"})}),solid:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:AA("path",{d:"M64 496C64 504.8 56.75 512 48 512h-32C7.25 512 0 504.8 0 496V32c0-17.75 14.25-32 32-32s32 14.25 32 32V496zM476.3 0c-6.365 0-13.01 1.35-19.34 4.233c-45.69 20.86-79.56 27.94-107.8 27.94c-59.96 0-94.81-31.86-163.9-31.87C160.9 .3055 131.6 4.867 96 15.75v350.5c32-9.984 59.87-14.1 84.85-14.1c73.63 0 124.9 31.78 198.6 31.78c31.91 0 68.02-5.971 111.1-23.09C504.1 355.9 512 344.4 512 332.1V30.73C512 11.1 495.3 0 476.3 0z"})})},foods:{outline:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:AA("path",{d:"M17 4.978c-1.838 0-2.876.396-3.68.934.513-1.172 1.768-2.934 4.68-2.934a1 1 0 0 0 0-2c-2.921 0-4.629 1.365-5.547 2.512-.064.078-.119.162-.18.244C11.73 1.838 10.798.023 9.207.023 8.579.022 7.85.306 7 .978 5.027 2.54 5.329 3.902 6.492 4.999 3.609 5.222 0 7.352 0 12.969c0 4.582 4.961 11.009 9 11.009 1.975 0 2.371-.486 3-1 .629.514 1.025 1 3 1 4.039 0 9-6.418 9-11 0-5.953-4.055-8-7-8M8.242 2.546c.641-.508.943-.523.965-.523.426.169.975 1.405 1.357 3.055-1.527-.629-2.741-1.352-2.98-1.846.059-.112.241-.356.658-.686M15 21.978c-1.08 0-1.21-.109-1.559-.402l-.176-.146c-.367-.302-.816-.452-1.266-.452s-.898.15-1.266.452l-.176.146c-.347.292-.477.402-1.557.402-2.813 0-7-5.389-7-9.009 0-5.823 4.488-5.991 5-5.991 1.939 0 2.484.471 3.387 1.251l.323.276a1.995 1.995 0 0 0 2.58 0l.323-.276c.902-.78 1.447-1.251 3.387-1.251.512 0 5 .168 5 6 0 3.617-4.187 9-7 9"})}),solid:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:AA("path",{d:"M481.9 270.1C490.9 279.1 496 291.3 496 304C496 316.7 490.9 328.9 481.9 337.9C472.9 346.9 460.7 352 448 352H64C51.27 352 39.06 346.9 30.06 337.9C21.06 328.9 16 316.7 16 304C16 291.3 21.06 279.1 30.06 270.1C39.06 261.1 51.27 256 64 256H448C460.7 256 472.9 261.1 481.9 270.1zM475.3 388.7C478.3 391.7 480 395.8 480 400V416C480 432.1 473.3 449.3 461.3 461.3C449.3 473.3 432.1 480 416 480H96C79.03 480 62.75 473.3 50.75 461.3C38.74 449.3 32 432.1 32 416V400C32 395.8 33.69 391.7 36.69 388.7C39.69 385.7 43.76 384 48 384H464C468.2 384 472.3 385.7 475.3 388.7zM50.39 220.8C45.93 218.6 42.03 215.5 38.97 211.6C35.91 207.7 33.79 203.2 32.75 198.4C31.71 193.5 31.8 188.5 32.99 183.7C54.98 97.02 146.5 32 256 32C365.5 32 457 97.02 479 183.7C480.2 188.5 480.3 193.5 479.2 198.4C478.2 203.2 476.1 207.7 473 211.6C469.1 215.5 466.1 218.6 461.6 220.8C457.2 222.9 452.3 224 447.3 224H64.67C59.73 224 54.84 222.9 50.39 220.8zM372.7 116.7C369.7 119.7 368 123.8 368 128C368 131.2 368.9 134.3 370.7 136.9C372.5 139.5 374.1 141.6 377.9 142.8C380.8 143.1 384 144.3 387.1 143.7C390.2 143.1 393.1 141.6 395.3 139.3C397.6 137.1 399.1 134.2 399.7 131.1C400.3 128 399.1 124.8 398.8 121.9C397.6 118.1 395.5 116.5 392.9 114.7C390.3 112.9 387.2 111.1 384 111.1C379.8 111.1 375.7 113.7 372.7 116.7V116.7zM244.7 84.69C241.7 87.69 240 91.76 240 96C240 99.16 240.9 102.3 242.7 104.9C244.5 107.5 246.1 109.6 249.9 110.8C252.8 111.1 256 112.3 259.1 111.7C262.2 111.1 265.1 109.6 267.3 107.3C269.6 105.1 271.1 102.2 271.7 99.12C272.3 96.02 271.1 92.8 270.8 89.88C269.6 86.95 267.5 84.45 264.9 82.7C262.3 80.94 259.2 79.1 256 79.1C251.8 79.1 247.7 81.69 244.7 84.69V84.69zM116.7 116.7C113.7 119.7 112 123.8 112 128C112 131.2 112.9 134.3 114.7 136.9C116.5 139.5 118.1 141.6 121.9 142.8C124.8 143.1 128 144.3 131.1 143.7C134.2 143.1 137.1 141.6 139.3 139.3C141.6 137.1 143.1 134.2 143.7 131.1C144.3 128 143.1 124.8 142.8 121.9C141.6 118.1 139.5 116.5 136.9 114.7C134.3 112.9 131.2 111.1 128 111.1C123.8 111.1 119.7 113.7 116.7 116.7L116.7 116.7z"})})},frequent:{outline:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[AA("path",{d:"M13 4h-2l-.001 7H9v2h2v2h2v-2h4v-2h-4z"}),AA("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"})]}),solid:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:AA("path",{d:"M256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512zM232 256C232 264 236 271.5 242.7 275.1L338.7 339.1C349.7 347.3 364.6 344.3 371.1 333.3C379.3 322.3 376.3 307.4 365.3 300L280 243.2V120C280 106.7 269.3 96 255.1 96C242.7 96 231.1 106.7 231.1 120L232 256z"})})},nature:{outline:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[AA("path",{d:"M15.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 15.5 8M8.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 8.5 8"}),AA("path",{d:"M18.933 0h-.027c-.97 0-2.138.787-3.018 1.497-1.274-.374-2.612-.51-3.887-.51-1.285 0-2.616.133-3.874.517C7.245.79 6.069 0 5.093 0h-.027C3.352 0 .07 2.67.002 7.026c-.039 2.479.276 4.238 1.04 5.013.254.258.882.677 1.295.882.191 3.177.922 5.238 2.536 6.38.897.637 2.187.949 3.2 1.102C8.04 20.6 8 20.795 8 21c0 1.773 2.35 3 4 3 1.648 0 4-1.227 4-3 0-.201-.038-.393-.072-.586 2.573-.385 5.435-1.877 5.925-7.587.396-.22.887-.568 1.104-.788.763-.774 1.079-2.534 1.04-5.013C23.929 2.67 20.646 0 18.933 0M3.223 9.135c-.237.281-.837 1.155-.884 1.238-.15-.41-.368-1.349-.337-3.291.051-3.281 2.478-4.972 3.091-5.031.256.015.731.27 1.265.646-1.11 1.171-2.275 2.915-2.352 5.125-.133.546-.398.858-.783 1.313M12 22c-.901 0-1.954-.693-2-1 0-.654.475-1.236 1-1.602V20a1 1 0 1 0 2 0v-.602c.524.365 1 .947 1 1.602-.046.307-1.099 1-2 1m3-3.48v.02a4.752 4.752 0 0 0-1.262-1.02c1.092-.516 2.239-1.334 2.239-2.217 0-1.842-1.781-2.195-3.977-2.195-2.196 0-3.978.354-3.978 2.195 0 .883 1.148 1.701 2.238 2.217A4.8 4.8 0 0 0 9 18.539v-.025c-1-.076-2.182-.281-2.973-.842-1.301-.92-1.838-3.045-1.853-6.478l.023-.041c.496-.826 1.49-1.45 1.804-3.102 0-2.047 1.357-3.631 2.362-4.522C9.37 3.178 10.555 3 11.948 3c1.447 0 2.685.192 3.733.57 1 .9 2.316 2.465 2.316 4.48.313 1.651 1.307 2.275 1.803 3.102.035.058.068.117.102.178-.059 5.967-1.949 7.01-4.902 7.19m6.628-8.202c-.037-.065-.074-.13-.113-.195a7.587 7.587 0 0 0-.739-.987c-.385-.455-.648-.768-.782-1.313-.076-2.209-1.241-3.954-2.353-5.124.531-.376 1.004-.63 1.261-.647.636.071 3.044 1.764 3.096 5.031.027 1.81-.347 3.218-.37 3.235"})]}),solid:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:AA("path",{d:"M332.7 19.85C334.6 8.395 344.5 0 356.1 0C363.6 0 370.6 3.52 375.1 9.502L392 32H444.1C456.8 32 469.1 37.06 478.1 46.06L496 64H552C565.3 64 576 74.75 576 88V112C576 156.2 540.2 192 496 192H426.7L421.6 222.5L309.6 158.5L332.7 19.85zM448 64C439.2 64 432 71.16 432 80C432 88.84 439.2 96 448 96C456.8 96 464 88.84 464 80C464 71.16 456.8 64 448 64zM416 256.1V480C416 497.7 401.7 512 384 512H352C334.3 512 320 497.7 320 480V364.8C295.1 377.1 268.8 384 240 384C211.2 384 184 377.1 160 364.8V480C160 497.7 145.7 512 128 512H96C78.33 512 64 497.7 64 480V249.8C35.23 238.9 12.64 214.5 4.836 183.3L.9558 167.8C-3.331 150.6 7.094 133.2 24.24 128.1C41.38 124.7 58.76 135.1 63.05 152.2L66.93 167.8C70.49 182 83.29 191.1 97.97 191.1H303.8L416 256.1z"})})},objects:{outline:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[AA("path",{d:"M12 0a9 9 0 0 0-5 16.482V21s2.035 3 5 3 5-3 5-3v-4.518A9 9 0 0 0 12 0zm0 2c3.86 0 7 3.141 7 7s-3.14 7-7 7-7-3.141-7-7 3.14-7 7-7zM9 17.477c.94.332 1.946.523 3 .523s2.06-.19 3-.523v.834c-.91.436-1.925.689-3 .689a6.924 6.924 0 0 1-3-.69v-.833zm.236 3.07A8.854 8.854 0 0 0 12 21c.965 0 1.888-.167 2.758-.451C14.155 21.173 13.153 22 12 22c-1.102 0-2.117-.789-2.764-1.453z"}),AA("path",{d:"M14.745 12.449h-.004c-.852-.024-1.188-.858-1.577-1.824-.421-1.061-.703-1.561-1.182-1.566h-.009c-.481 0-.783.497-1.235 1.537-.436.982-.801 1.811-1.636 1.791l-.276-.043c-.565-.171-.853-.691-1.284-1.794-.125-.313-.202-.632-.27-.913-.051-.213-.127-.53-.195-.634C7.067 9.004 7.039 9 6.99 9A1 1 0 0 1 7 7h.01c1.662.017 2.015 1.373 2.198 2.134.486-.981 1.304-2.058 2.797-2.075 1.531.018 2.28 1.153 2.731 2.141l.002-.008C14.944 8.424 15.327 7 16.979 7h.032A1 1 0 1 1 17 9h-.011c-.149.076-.256.474-.319.709a6.484 6.484 0 0 1-.311.951c-.429.973-.79 1.789-1.614 1.789"})]}),solid:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",children:AA("path",{d:"M112.1 454.3c0 6.297 1.816 12.44 5.284 17.69l17.14 25.69c5.25 7.875 17.17 14.28 26.64 14.28h61.67c9.438 0 21.36-6.401 26.61-14.28l17.08-25.68c2.938-4.438 5.348-12.37 5.348-17.7L272 415.1h-160L112.1 454.3zM191.4 .0132C89.44 .3257 16 82.97 16 175.1c0 44.38 16.44 84.84 43.56 115.8c16.53 18.84 42.34 58.23 52.22 91.45c.0313 .25 .0938 .5166 .125 .7823h160.2c.0313-.2656 .0938-.5166 .125-.7823c9.875-33.22 35.69-72.61 52.22-91.45C351.6 260.8 368 220.4 368 175.1C368 78.61 288.9-.2837 191.4 .0132zM192 96.01c-44.13 0-80 35.89-80 79.1C112 184.8 104.8 192 96 192S80 184.8 80 176c0-61.76 50.25-111.1 112-111.1c8.844 0 16 7.159 16 16S200.8 96.01 192 96.01z"})})},people:{outline:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[AA("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"}),AA("path",{d:"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0"})]}),solid:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:AA("path",{d:"M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM256 432C332.1 432 396.2 382 415.2 314.1C419.1 300.4 407.8 288 393.6 288H118.4C104.2 288 92.92 300.4 96.76 314.1C115.8 382 179.9 432 256 432V432zM176.4 160C158.7 160 144.4 174.3 144.4 192C144.4 209.7 158.7 224 176.4 224C194 224 208.4 209.7 208.4 192C208.4 174.3 194 160 176.4 160zM336.4 224C354 224 368.4 209.7 368.4 192C368.4 174.3 354 160 336.4 160C318.7 160 304.4 174.3 304.4 192C304.4 209.7 318.7 224 336.4 224z"})})},places:{outline:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[AA("path",{d:"M6.5 12C5.122 12 4 13.121 4 14.5S5.122 17 6.5 17 9 15.879 9 14.5 7.878 12 6.5 12m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5M17.5 12c-1.378 0-2.5 1.121-2.5 2.5s1.122 2.5 2.5 2.5 2.5-1.121 2.5-2.5-1.122-2.5-2.5-2.5m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5"}),AA("path",{d:"M22.482 9.494l-1.039-.346L21.4 9h.6c.552 0 1-.439 1-.992 0-.006-.003-.008-.003-.008H23c0-1-.889-2-1.984-2h-.642l-.731-1.717C19.262 3.012 18.091 2 16.764 2H7.236C5.909 2 4.738 3.012 4.357 4.283L3.626 6h-.642C1.889 6 1 7 1 8h.003S1 8.002 1 8.008C1 8.561 1.448 9 2 9h.6l-.043.148-1.039.346a2.001 2.001 0 0 0-1.359 2.097l.751 7.508a1 1 0 0 0 .994.901H3v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h6v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h1.096a.999.999 0 0 0 .994-.901l.751-7.508a2.001 2.001 0 0 0-1.359-2.097M6.273 4.857C6.402 4.43 6.788 4 7.236 4h9.527c.448 0 .834.43.963.857L19.313 9H4.688l1.585-4.143zM7 21H5v-1h2v1zm12 0h-2v-1h2v1zm2.189-3H2.811l-.662-6.607L3 11h18l.852.393L21.189 18z"})]}),solid:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:AA("path",{d:"M39.61 196.8L74.8 96.29C88.27 57.78 124.6 32 165.4 32H346.6C387.4 32 423.7 57.78 437.2 96.29L472.4 196.8C495.6 206.4 512 229.3 512 256V448C512 465.7 497.7 480 480 480H448C430.3 480 416 465.7 416 448V400H96V448C96 465.7 81.67 480 64 480H32C14.33 480 0 465.7 0 448V256C0 229.3 16.36 206.4 39.61 196.8V196.8zM109.1 192H402.9L376.8 117.4C372.3 104.6 360.2 96 346.6 96H165.4C151.8 96 139.7 104.6 135.2 117.4L109.1 192zM96 256C78.33 256 64 270.3 64 288C64 305.7 78.33 320 96 320C113.7 320 128 305.7 128 288C128 270.3 113.7 256 96 256zM416 320C433.7 320 448 305.7 448 288C448 270.3 433.7 256 416 256C398.3 256 384 270.3 384 288C384 305.7 398.3 320 416 320z"})})},symbols:{outline:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:AA("path",{d:"M0 0h11v2H0zM4 11h3V6h4V4H0v2h4zM15.5 17c1.381 0 2.5-1.116 2.5-2.493s-1.119-2.493-2.5-2.493S13 13.13 13 14.507 14.119 17 15.5 17m0-2.986c.276 0 .5.222.5.493 0 .272-.224.493-.5.493s-.5-.221-.5-.493.224-.493.5-.493M21.5 19.014c-1.381 0-2.5 1.116-2.5 2.493S20.119 24 21.5 24s2.5-1.116 2.5-2.493-1.119-2.493-2.5-2.493m0 2.986a.497.497 0 0 1-.5-.493c0-.271.224-.493.5-.493s.5.222.5.493a.497.497 0 0 1-.5.493M22 13l-9 9 1.513 1.5 8.99-9.009zM17 11c2.209 0 4-1.119 4-2.5V2s.985-.161 1.498.949C23.01 4.055 23 6 23 6s1-1.119 1-3.135C24-.02 21 0 21 0h-2v6.347A5.853 5.853 0 0 0 17 6c-2.209 0-4 1.119-4 2.5s1.791 2.5 4 2.5M10.297 20.482l-1.475-1.585a47.54 47.54 0 0 1-1.442 1.129c-.307-.288-.989-1.016-2.045-2.183.902-.836 1.479-1.466 1.729-1.892s.376-.871.376-1.336c0-.592-.273-1.178-.818-1.759-.546-.581-1.329-.871-2.349-.871-1.008 0-1.79.293-2.344.879-.556.587-.832 1.181-.832 1.784 0 .813.419 1.748 1.256 2.805-.847.614-1.444 1.208-1.794 1.784a3.465 3.465 0 0 0-.523 1.833c0 .857.308 1.56.924 2.107.616.549 1.423.823 2.42.823 1.173 0 2.444-.379 3.813-1.137L8.235 24h2.819l-2.09-2.383 1.333-1.135zm-6.736-6.389a1.02 1.02 0 0 1 .73-.286c.31 0 .559.085.747.254a.849.849 0 0 1 .283.659c0 .518-.419 1.112-1.257 1.784-.536-.651-.805-1.231-.805-1.742a.901.901 0 0 1 .302-.669M3.74 22c-.427 0-.778-.116-1.057-.349-.279-.232-.418-.487-.418-.766 0-.594.509-1.288 1.527-2.083.968 1.134 1.717 1.946 2.248 2.438-.921.507-1.686.76-2.3.76"})}),solid:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:AA("path",{d:"M500.3 7.251C507.7 13.33 512 22.41 512 31.1V175.1C512 202.5 483.3 223.1 447.1 223.1C412.7 223.1 383.1 202.5 383.1 175.1C383.1 149.5 412.7 127.1 447.1 127.1V71.03L351.1 90.23V207.1C351.1 234.5 323.3 255.1 287.1 255.1C252.7 255.1 223.1 234.5 223.1 207.1C223.1 181.5 252.7 159.1 287.1 159.1V63.1C287.1 48.74 298.8 35.61 313.7 32.62L473.7 .6198C483.1-1.261 492.9 1.173 500.3 7.251H500.3zM74.66 303.1L86.5 286.2C92.43 277.3 102.4 271.1 113.1 271.1H174.9C185.6 271.1 195.6 277.3 201.5 286.2L213.3 303.1H239.1C266.5 303.1 287.1 325.5 287.1 351.1V463.1C287.1 490.5 266.5 511.1 239.1 511.1H47.1C21.49 511.1-.0019 490.5-.0019 463.1V351.1C-.0019 325.5 21.49 303.1 47.1 303.1H74.66zM143.1 359.1C117.5 359.1 95.1 381.5 95.1 407.1C95.1 434.5 117.5 455.1 143.1 455.1C170.5 455.1 191.1 434.5 191.1 407.1C191.1 381.5 170.5 359.1 143.1 359.1zM440.3 367.1H496C502.7 367.1 508.6 372.1 510.1 378.4C513.3 384.6 511.6 391.7 506.5 396L378.5 508C372.9 512.1 364.6 513.3 358.6 508.9C352.6 504.6 350.3 496.6 353.3 489.7L391.7 399.1H336C329.3 399.1 323.4 395.9 321 389.6C318.7 383.4 320.4 376.3 325.5 371.1L453.5 259.1C459.1 255 467.4 254.7 473.4 259.1C479.4 263.4 481.6 271.4 478.7 278.3L440.3 367.1zM116.7 219.1L19.85 119.2C-8.112 90.26-6.614 42.31 24.85 15.34C51.82-8.137 93.26-3.642 118.2 21.83L128.2 32.32L137.7 21.83C162.7-3.642 203.6-8.137 231.6 15.34C262.6 42.31 264.1 90.26 236.1 119.2L139.7 219.1C133.2 225.6 122.7 225.6 116.7 219.1H116.7z"})})}},search:{loupe:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:AA("path",{d:"M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"})}),delete:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:AA("path",{d:"M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z"})})}};function nO(e){let{id:t,skin:n,emoji:r}=e;if(e.shortcodes){const r=e.shortcodes.match(XA.SHORTCODES_REGEX);r&&(t=r[1],r[2]&&(n=r[2]))}if(r||(r=XA.get(t||e.native)),!r)return e.fallback;const i=r.skins[n-1]||r.skins[0],o=i.src||("native"==e.set||e.spritesheet?void 0:"function"==typeof e.getImageURL?e.getImageURL(e.set,i.unified):`https://cdn.jsdelivr.net/npm/emoji-datasource-${e.set}@14.0.0/img/${e.set}/64/${i.unified}.png`),s="function"==typeof e.getSpritesheetURL?e.getSpritesheetURL(e.set):`https://cdn.jsdelivr.net/npm/emoji-datasource-${e.set}@14.0.0/img/${e.set}/sheets-256/64.png`;return AA("span",{class:"emoji-mart-emoji","data-emoji-set":e.set,children:o?AA("img",{style:{height:e.size||"1em",width:"auto",display:"inline-block",position:"relative",top:".1em"},alt:i.native||i.shortcodes,src:o}):"native"==e.set?AA("span",{style:{fontSize:e.size,fontFamily:'"EmojiMart", "Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "Android Emoji"'},children:i.native}):AA("span",{style:{display:"block",width:e.size,height:e.size,backgroundImage:`url(${s})`,backgroundSize:`${100*$A.sheet.cols}% ${100*$A.sheet.rows}%`,backgroundPosition:`${100/($A.sheet.cols-1)*i.x}% ${100/($A.sheet.rows-1)*i.y}%`}})})}const rO="undefined"!=typeof window?window.HTMLElement:Object;class iO extends rO{static get observedAttributes(){return Object.keys(this.Props)}update(e={}){for(let t in e)this.attributeChangedCallback(t,null,e[t])}attributeChangedCallback(e,t,n){if(!this.component)return;const r=JA(e,{[e]:n},this.constructor.Props,this);this.component.componentWillReceiveProps?this.component.componentWillReceiveProps({[e]:r}):(this.component.props[e]=r,this.component.forceUpdate())}constructor(e={}){if(super(),this.props=e,e.parent||e.ref){let t=null;const n=e.parent||(t=e.ref&&e.ref.current);t&&(t.innerHTML=""),n&&n.appendChild(this)}}}class oO extends iO{setShadow(){this.attachShadow({mode:"open"})}injectStyles(e){if(!e)return;const t=document.createElement("style");t.textContent=e,this.shadowRoot.insertBefore(t,this.shadowRoot.firstChild)}constructor(e,{styles:t}={}){super(e),this.setShadow(),this.injectStyles(t)}}var sO={fallback:"",id:"",native:"",shortcodes:"",size:{value:"",transform:e=>/\D/.test(e)?e:`${e}px`},set:UA.set,skin:UA.skin};class aO extends iO{async connectedCallback(){const e=QA(this.props,sO,this);e.element=this,e.ref=e=>{this.component=e},await YA(),SA(AA(nO,{...e}),this)}constructor(e){super(e)}}YN(aO,"Props",sO),"undefined"==typeof customElements||customElements.get("em-emoji")||customElements.define("em-emoji",aO);var lO,cO=[],uO=JN.__b,dO=JN.__r,pO=JN.diffed,hO=JN.__c,fO=JN.unmount;function mO(){var e;for(cO.sort((function(e,t){return e.__v.__b-t.__v.__b}));e=cO.pop();)if(e.__P)try{e.__H.__h.forEach(bO),e.__H.__h.forEach(yO),e.__H.__h=[]}catch(t){e.__H.__h=[],JN.__e(t,e.__v)}}JN.__b=function(e){uO&&uO(e)},JN.__r=function(e){dO&&dO(e);var t=e.__c.__H;t&&(t.__h.forEach(bO),t.__h.forEach(yO),t.__h=[])},JN.diffed=function(e){pO&&pO(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==cO.push(t)&&lO===JN.requestAnimationFrame||((lO=JN.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),gO&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);gO&&(t=requestAnimationFrame(n))})(mO))},JN.__c=function(e,t){t.some((function(e){try{e.__h.forEach(bO),e.__h=e.__h.filter((function(e){return!e.__||yO(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],JN.__e(n,e.__v)}})),hO&&hO(e,t)},JN.unmount=function(e){fO&&fO(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{bO(e)}catch(e){t=e}})),t&&JN.__e(t,n.__v))};var gO="function"==typeof requestAnimationFrame;function bO(e){var t=e.__c;"function"==typeof t&&(e.__c=void 0,t())}function yO(e){e.__c=e.__()}function vO(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function wO(e){this.props=e}(wO.prototype=new uA).isPureReactComponent=!0,wO.prototype.shouldComponentUpdate=function(e,t){return vO(this.props,e)||vO(this.state,t)};var _O=JN.__b;JN.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),_O&&_O(e)};var xO=JN.__e;JN.__e=function(e,t,n){if(e.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);xO(e,t,n)};var EO=JN.unmount;function kO(){this.__u=0,this.t=null,this.__b=null}function MO(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function DO(){this.u=null,this.o=null}JN.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),EO&&EO(e)},(kO.prototype=new uA).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var i=MO(r.__v),o=!1,s=function(){o||(o=!0,n.__R=null,i?i(a):a())};n.__R=s;var a=function(){if(!--r.__u){if(r.state.__e){var e=r.state.__e;r.__v.__k[0]=function e(t,n,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)})),t.__c&&t.__c.__P===n&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate()}},l=!0===t.__h;r.__u++||l||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(s,s)},kO.prototype.componentWillUnmount=function(){this.t=[]},kO.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=function(e,t){for(var n in t)e[n]=t[n];return e}({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)}))),t}(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__e&&aA(cA,null,e.fallback);return i&&(i.__h=null),[aA(cA,null,t.__e?null:e.children),i]};var CO=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};(DO.prototype=new uA).__e=function(e){var t=this,n=MO(t.__v),r=t.o.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),CO(t,e,r)):i()};n?n(o):o()}},DO.prototype.render=function(e){this.u=null,this.o=new Map;var t=bA(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},DO.prototype.componentDidUpdate=DO.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){CO(e,n,t)}))};var SO="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,NO=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,AO="undefined"!=typeof document,OO=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};uA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(uA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var TO=JN.event;function IO(){}function LO(){return this.cancelBubble}function FO(){return this.defaultPrevented}JN.event=function(e){return TO&&(e=TO(e)),e.persist=IO,e.isPropagationStopped=LO,e.isDefaultPrevented=FO,e.nativeEvent=e};var zO={configurable:!0,get:function(){return this.class}},jO=JN.vnode;JN.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){var i=-1===t.indexOf("-");for(var o in r={},n){var s=n[o];AO&&"children"===o&&"noscript"===t||"value"===o&&"defaultValue"in n&&null==s||("defaultValue"===o&&"value"in n&&null==n.value?o="value":"download"===o&&!0===s?s="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!OO(n.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(o)?o=o.toLowerCase():i&&NO.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===s&&(s=void 0),r[o]=s)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=bA(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=bA(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r,n.class!=n.className&&(zO.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",zO))}e.$$typeof=SO,jO&&jO(e)};var RO=JN.__r;JN.__r=function(e){RO&&RO(e),e.__c};const BO={light:"outline",dark:"solid"};class PO extends wO{renderIcon(e){const{icon:t}=e;if(t){if(t.svg)return AA("span",{class:"flex",dangerouslySetInnerHTML:{__html:t.svg}});if(t.src)return AA("img",{src:t.src})}const n=tO.categories[e.id]||tO.categories.custom;return n["auto"==this.props.icons?BO[this.props.theme]:this.props.icons]||n}render(){let e=null;return AA("nav",{id:"nav",class:"padding","data-position":this.props.position,children:AA("div",{class:"flex relative",children:[this.categories.map(((t,n)=>{const r=t.name||HA.categories[t.id],i=!this.props.unfocused&&t.id==this.state.categoryId;return i&&(e=n),AA("button",{"aria-label":r,"aria-selected":i||void 0,title:r,type:"button",class:"flex flex-grow flex-center",onMouseDown:e=>e.preventDefault(),onClick:()=>{this.props.onClick({category:t,i:n})},children:this.renderIcon(t)})})),AA("div",{class:"bar",style:{width:`${100/this.categories.length}%`,opacity:null==e?0:1,transform:`translateX(${100*e}%)`}})]})})}constructor(){super(),this.categories=$A.categories.filter((e=>!e.target)),this.state={categoryId:this.categories[0].id}}}class UO extends wO{shouldComponentUpdate(e){for(let t in e)if("children"!=t&&e[t]!=this.props[t])return!0;return!1}render(){return this.props.children}}const HO=10;class $O extends uA{getInitialState(e=this.props){return{skin:OA.get("skin")||e.skin,theme:this.initTheme(e.theme)}}componentWillMount(){this.observers=[],this.dir=HA.rtl?"rtl":"ltr",this.refs={menu:{current:null},navigation:{current:null},scroll:{current:null},search:{current:null},searchInput:{current:null},skinToneButton:{current:null},skinToneRadio:{current:null}},this.initGrid(),0==this.props.stickySearch&&"sticky"==this.props.searchPosition&&(console.warn("[EmojiMart] Deprecation warning: `stickySearch` has been renamed `searchPosition`."),this.props.searchPosition="static")}componentDidMount(){if(this.register(),this.shadowRoot=this.base.parentNode,this.props.autoFocus){const{searchInput:e}=this.refs;e.current&&e.current.focus()}}componentWillReceiveProps(e){this.nextState||(this.nextState={});for(const t in e)this.nextState[t]=e[t];clearTimeout(this.nextStateTimer),this.nextStateTimer=setTimeout((()=>{let e=!1;for(const t in this.nextState)this.props[t]=this.nextState[t],"custom"!==t&&"categories"!==t||(e=!0);delete this.nextState;const t=this.getInitialState();if(e)return this.reset(t);this.setState(t)}))}componentWillUnmount(){this.unregister()}async reset(e={}){await YA(this.props),this.initGrid(),this.unobserve(),this.setState(e,(()=>{this.observeCategories(),this.observeRows()}))}register(){document.addEventListener("click",this.handleClickOutside),this.observe()}unregister(){document.removeEventListener("click",this.handleClickOutside),this.unobserve()}observe(){this.observeCategories(),this.observeRows()}unobserve(){for(const e of this.observers)e.disconnect()}initGrid(){const{categories:e}=$A;this.refs.categories=new Map;const t=$A.categories.map((e=>e.id)).join(",");this.navKey&&this.navKey!=t&&this.refs.scroll.current&&(this.refs.scroll.current.scrollTop=0),this.navKey=t,this.grid=[],this.grid.setsize=0;const n=(e,t)=>{const n=[];n.__categoryId=t.id,n.__index=e.length,this.grid.push(n);const r=this.grid.length-1,i=r%HO?{}:{current:null};return i.index=r,i.posinset=this.grid.setsize+1,e.push(i),n};for(let t of e){const e=[];let r=n(e,t);for(let i of t.emojis)r.length==this.props.perLine&&(r=n(e,t)),this.grid.setsize+=1,r.push(i);this.refs.categories.set(t.id,{root:{current:null},rows:e})}}initTheme(e){if("auto"!=e)return e;if(!this.darkMedia){if(this.darkMedia=matchMedia("(prefers-color-scheme: dark)"),this.darkMedia.media.match(/^not/))return"light";this.darkMedia.addListener((()=>{"auto"==this.props.theme&&this.setState({theme:this.darkMedia.matches?"dark":"light"})}))}return this.darkMedia.matches?"dark":"light"}getEmojiByPos([e,t]){const n=this.state.searchResults||this.grid,r=n[e]&&n[e][t];if(r)return XA.get(r)}observeCategories(){const e=this.refs.navigation.current;if(!e)return;const t=new Map,n=t=>{t!=e.state.categoryId&&e.setState({categoryId:t})},r={root:this.refs.scroll.current,threshold:[0,1]},i=new IntersectionObserver((e=>{for(const n of e){const e=n.target.dataset.id;t.set(e,n.intersectionRatio)}const r=[...t],i=r[r.length-1];if(1==i[1])return n(i[0]);for(const[e,t]of r)if(t){n(e);break}}),r);for(const{root:e}of this.refs.categories.values())i.observe(e.current);this.observers.push(i)}observeRows(){const e={...this.state.visibleRows},t=new IntersectionObserver((t=>{for(const n of t){const t=parseInt(n.target.dataset.index);n.isIntersecting?e[t]=!0:delete e[t]}this.setState({visibleRows:e})}),{root:this.refs.scroll.current,rootMargin:`${this.props.emojiButtonSize*(HO+5)}px 0px ${this.props.emojiButtonSize*HO}px`});for(const{rows:e}of this.refs.categories.values())for(const n of e)n.current&&t.observe(n.current);this.observers.push(t)}preventDefault(e){e.preventDefault()}unfocusSearch(){const e=this.refs.searchInput.current;e&&e.blur()}navigate({e:e,input:t,left:n,right:r,up:i,down:o}){const s=this.state.searchResults||this.grid;if(!s.length)return;let[a,l]=this.state.pos;const c=(()=>{if(0==a&&0==l&&!e.repeat&&(n||i))return null;if(-1==a)return e.repeat||!r&&!o||t.selectionStart!=t.value.length?null:[0,0];if(n||r){let e=s[a];const t=n?-1:1;if(l+=t,!e[l]){if(a+=t,e=s[a],!e)return a=n?0:s.length-1,l=n?0:s[a].length-1,[a,l];l=n?e.length-1:0}return[a,l]}if(i||o){a+=i?-1:1;const e=s[a];return e?(e[l]||(l=e.length-1),[a,l]):(a=i?0:s.length-1,l=i?0:s[a].length-1,[a,l])}})();c?(e.preventDefault(),this.setState({pos:c,keyboard:!0},(()=>{this.scrollTo({row:c[0]})}))):this.state.pos[0]>-1&&this.setState({pos:[-1,-1]})}scrollTo({categoryId:e,row:t}){const n=this.state.searchResults||this.grid;if(!n.length)return;const r=this.refs.scroll.current,i=r.getBoundingClientRect();let o=0;if(t>=0&&(e=n[t].__categoryId),e){o=(this.refs[e]||this.refs.categories.get(e).root).current.getBoundingClientRect().top-(i.top-r.scrollTop)+1}if(t>=0)if(t){const e=o+n[t].__index*this.props.emojiButtonSize,s=e+this.props.emojiButtonSize+.88*this.props.emojiButtonSize;if(e<r.scrollTop)o=e;else{if(!(s>r.scrollTop+i.height))return;o=s-i.height}}else o=0;this.ignoreMouse(),r.scrollTop=o}ignoreMouse(){this.mouseIsIgnored=!0,clearTimeout(this.ignoreMouseTimer),this.ignoreMouseTimer=setTimeout((()=>{delete this.mouseIsIgnored}),100)}handleEmojiOver(e){this.mouseIsIgnored||this.state.showSkins||this.setState({pos:e||[-1,-1],keyboard:!1})}handleEmojiClick({emoji:e,pos:t}){if(this.props.onEmojiSelect&&(!e&&t&&(e=this.getEmojiByPos(t)),e)){const t=function(e,{skinIndex:t}={}){const n=e.skins[t]||(t=0,e.skins[t]),r={id:e.id,name:e.name,native:n.native,unified:n.unified,keywords:e.keywords,shortcodes:n.shortcodes||e.shortcodes};return e.skins.length>1&&(r.skin=t+1),n.src&&(r.src=n.src),e.aliases&&e.aliases.length&&(r.aliases=e.aliases),e.emoticons&&e.emoticons.length&&(r.emoticons=e.emoticons),r}(e,{skinIndex:this.state.skin-1});this.props.maxFrequentRows&&PA.add(t,this.props),this.props.onEmojiSelect(t)}}closeSkins(){this.state.showSkins&&(this.setState({showSkins:null,tempSkin:null}),this.base.removeEventListener("click",this.handleBaseClick),this.base.removeEventListener("keydown",this.handleBaseKeydown))}handleSkinMouseOver(e){this.setState({tempSkin:e})}handleSkinClick(e){this.ignoreMouse(),this.closeSkins(),this.setState({skin:e,tempSkin:null}),OA.set("skin",e)}renderNav(){return AA(PO,{ref:this.refs.navigation,icons:this.props.icons,theme:this.state.theme,unfocused:!!this.state.searchResults,position:this.props.navPosition,onClick:this.handleCategoryClick},this.navKey)}renderPreview(){const e=this.getEmojiByPos(this.state.pos),t=this.state.searchResults&&!this.state.searchResults.length;return AA("div",{id:"preview",class:"flex flex-middle",dir:this.dir,"data-position":this.props.previewPosition,children:[AA("div",{class:"flex flex-middle flex-grow",children:[AA("div",{class:"flex flex-auto flex-middle flex-center",style:{height:this.props.emojiButtonSize,fontSize:this.props.emojiButtonSize},children:AA(nO,{emoji:e,id:t?this.props.noResultsEmoji||"cry":this.props.previewEmoji||("top"==this.props.previewPosition?"point_down":"point_up"),set:this.props.set,size:this.props.emojiButtonSize,skin:this.state.tempSkin||this.state.skin,spritesheet:!0,getSpritesheetURL:this.props.getSpritesheetURL})}),AA("div",{class:`margin-${this.dir[0]}`,children:AA("div",e?{class:`padding-${this.dir[2]} align-${this.dir[0]}`,children:[AA("div",{class:"ellipsis",style:{fontSize:"1.1em"},children:e.name}),AA("div",{class:"ellipsis color-c",style:{fontSize:".9em"},children:e.skins[0].shortcodes})]}:t?{class:`padding-${this.dir[2]} align-${this.dir[0]}`,children:[AA("div",{class:"ellipsis",style:{fontSize:"1.1em"},children:HA.search_no_results_1}),AA("div",{class:"ellipsis color-c",style:{fontSize:".9em"},children:HA.search_no_results_2})]}:{class:"color-c",style:{fontSize:21},children:HA.pick})})]}),!e&&"preview"==this.props.skinTonePosition&&this.renderSkinToneButton()]})}renderEmojiButton(e,{pos:t,posinset:n,grid:r}){const i=this.props.emojiButtonSize,o=this.state.tempSkin||this.state.skin,s=(e.skins[o-1]||e.skins[0]).native,a=function(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every(((e,n)=>e==t[n]))}(this.state.pos,t),l=t.concat(e.id).join("");return AA(UO,{selected:a,skin:o,size:i,children:AA("button",{"aria-label":s,"aria-selected":a||void 0,"aria-posinset":n,"aria-setsize":r.setsize,"data-keyboard":this.state.keyboard,title:"none"==this.props.previewPosition?e.name:void 0,type:"button",class:"flex flex-center flex-middle",tabindex:"-1",onClick:()=>this.handleEmojiClick({emoji:e}),onMouseEnter:()=>this.handleEmojiOver(t),onMouseLeave:()=>this.handleEmojiOver(),style:{width:this.props.emojiButtonSize,height:this.props.emojiButtonSize,fontSize:this.props.emojiSize,lineHeight:0},children:[AA("div",{"aria-hidden":"true",class:"background",style:{borderRadius:this.props.emojiButtonRadius,backgroundColor:this.props.emojiButtonColors?this.props.emojiButtonColors[(n-1)%this.props.emojiButtonColors.length]:void 0}}),AA(nO,{emoji:e,set:this.props.set,size:this.props.emojiSize,skin:o,spritesheet:!0,getSpritesheetURL:this.props.getSpritesheetURL})]})},l)}renderSearch(){const e="none"==this.props.previewPosition||"search"==this.props.skinTonePosition;return AA("div",{children:[AA("div",{class:"spacer"}),AA("div",{class:"flex flex-middle",children:[e&&"rtl"==this.dir&&this.renderSkinToneButton(),AA("div",{class:"search relative flex-grow",children:[AA("input",{type:"search",ref:this.refs.searchInput,placeholder:HA.search,onClick:this.handleSearchClick,onInput:this.handleSearchInput,onKeyDown:this.handleSearchKeyDown,autoComplete:"off"}),AA("span",{class:"icon loupe flex",children:tO.search.loupe}),this.state.searchResults&&AA("button",{title:"Clear","aria-label":"Clear",type:"button",class:"icon delete flex",onClick:this.clearSearch,onMouseDown:this.preventDefault,children:tO.search.delete})]}),e&&"ltr"==this.dir&&this.renderSkinToneButton()]})]})}renderSearchResults(){const{searchResults:e}=this.state;return e?AA("div",{class:"category",ref:this.refs.search,children:[AA("div",{class:`sticky padding-small align-${this.dir[0]}`,children:HA.categories.search}),AA("div",{children:e.length?e.map(((t,n)=>AA("div",{class:"flex",children:t.map(((t,r)=>this.renderEmojiButton(t,{pos:[n,r],posinset:n*this.props.perLine+r+1,grid:e})))}))):AA("div",{class:`padding-small align-${this.dir[0]}`,children:this.props.onAddCustomEmoji&&AA("a",{onClick:this.props.onAddCustomEmoji,children:HA.add_custom})})})]}):null}renderCategories(){const{categories:e}=$A,t=!!this.state.searchResults;return AA("div",{style:{visibility:t?"hidden":void 0,display:t?"none":void 0},children:e.map((e=>{const{root:t,rows:n}=this.refs.categories.get(e.id);return AA("div",{"data-id":e.target?e.target.id:e.id,class:"category",ref:t,children:[AA("div",{class:`sticky padding-small align-${this.dir[0]}`,children:e.name||HA.categories[e.id]}),AA("div",{class:"relative",style:{height:n.length*this.props.emojiButtonSize},children:n.map(((t,n)=>{const r=t.index-t.index%HO,i=this.state.visibleRows[r],o="current"in t?t:void 0;if(!i&&!o)return null;const s=n*this.props.perLine,a=s+this.props.perLine,l=e.emojis.slice(s,a);return AA("div",{"data-index":t.index,ref:o,class:"flex row",style:{top:n*this.props.emojiButtonSize},children:i&&l.map(((e,n)=>{const r=XA.get(e);return this.renderEmojiButton(r,{pos:[t.index,n],posinset:t.posinset+n,grid:this.grid})}))},t.index)}))})]})}))})}renderSkinToneButton(){return"none"==this.props.skinTonePosition?null:AA("div",{class:"flex flex-auto flex-center flex-middle",style:{position:"relative",width:this.props.emojiButtonSize,height:this.props.emojiButtonSize},children:AA("button",{type:"button",ref:this.refs.skinToneButton,class:"skin-tone-button flex flex-auto flex-center flex-middle","aria-selected":this.state.showSkins?"":void 0,"aria-label":HA.skins.choose,title:HA.skins.choose,onClick:this.openSkins,style:{width:this.props.emojiSize,height:this.props.emojiSize},children:AA("span",{class:`skin-tone skin-tone-${this.state.skin}`})})})}renderLiveRegion(){const e=this.getEmojiByPos(this.state.pos);return AA("div",{"aria-live":"polite",class:"sr-only",children:e?e.name:""})}renderSkins(){const e=this.refs.skinToneButton.current.getBoundingClientRect(),t=this.base.getBoundingClientRect(),n={};return"ltr"==this.dir?n.right=t.right-e.right-3:n.left=e.left-t.left-3,"bottom"==this.props.previewPosition&&"preview"==this.props.skinTonePosition?n.bottom=t.bottom-e.top+6:(n.top=e.bottom-t.top+3,n.bottom="auto"),AA("div",{ref:this.refs.menu,role:"radiogroup",dir:this.dir,"aria-label":HA.skins.choose,class:"menu hidden","data-position":n.top?"top":"bottom",style:n,children:[...Array(6).keys()].map((e=>{const t=e+1,n=this.state.skin==t;return AA("div",{children:[AA("input",{type:"radio",name:"skin-tone",value:t,"aria-label":HA.skins[t],ref:n?this.refs.skinToneRadio:null,defaultChecked:n,onChange:()=>this.handleSkinMouseOver(t),onKeyDown:e=>{"Enter"!=e.code&&"Space"!=e.code&&"Tab"!=e.code||(e.preventDefault(),this.handleSkinClick(t))}}),AA("button",{"aria-hidden":"true",tabindex:"-1",onClick:()=>this.handleSkinClick(t),onMouseEnter:()=>this.handleSkinMouseOver(t),onMouseLeave:()=>this.handleSkinMouseOver(),class:"option flex flex-grow flex-middle",children:[AA("span",{class:`skin-tone skin-tone-${t}`}),AA("span",{class:"margin-small-lr",children:HA.skins[t]})]})]})}))})}render(){return AA("section",{id:"root",class:"flex flex-column",style:{width:this.props.perLine*this.props.emojiButtonSize+28},"data-emoji-set":this.props.set,"data-theme":this.state.theme,"data-menu":this.state.showSkins?"":void 0,children:["top"==this.props.previewPosition&&this.renderPreview(),"top"==this.props.navPosition&&this.renderNav(),"sticky"==this.props.searchPosition&&AA("div",{class:"padding-lr",children:this.renderSearch()}),AA("div",{ref:this.refs.scroll,class:"scroll flex-grow padding-lr",children:AA("div",{style:{width:this.props.perLine*this.props.emojiButtonSize},children:["static"==this.props.searchPosition&&this.renderSearch(),this.renderSearchResults(),this.renderCategories(),AA("div",{class:"spacer"})]})}),"bottom"==this.props.navPosition&&this.renderNav(),"bottom"==this.props.previewPosition&&this.renderPreview(),this.state.showSkins&&this.renderSkins(),this.renderLiveRegion()]})}constructor(e){super(),YN(this,"handleClickOutside",(e=>{const{element:t}=this.props;e.target!=t&&(this.state.showSkins&&this.closeSkins(),this.props.onClickOutside&&this.props.onClickOutside())})),YN(this,"handleBaseClick",(e=>{this.state.showSkins&&(e.target.closest(".menu")||(e.preventDefault(),e.stopImmediatePropagation(),this.closeSkins()))})),YN(this,"handleBaseKeydown",(e=>{this.state.showSkins&&"Escape"==e.key&&(e.preventDefault(),e.stopImmediatePropagation(),this.closeSkins())})),YN(this,"handleSearchClick",(()=>{this.getEmojiByPos(this.state.pos)&&this.setState({pos:[-1,-1]})})),YN(this,"handleSearchInput",(async()=>{const e=this.refs.searchInput.current;if(!e)return;const{value:t}=e,n=await XA.search(t),r=()=>{this.refs.scroll.current&&(this.refs.scroll.current.scrollTop=0)};if(!n)return this.setState({searchResults:n,pos:[-1,-1]},r);const i=e.selectionStart==e.value.length?[0,0]:[-1,-1],o=[];o.setsize=n.length;let s=null;for(let e of n)o.length&&s.length!=this.props.perLine||(s=[],s.__categoryId="search",s.__index=o.length,o.push(s)),s.push(e);this.ignoreMouse(),this.setState({searchResults:o,pos:i},r)})),YN(this,"handleSearchKeyDown",(e=>{const t=e.currentTarget;switch(e.stopImmediatePropagation(),e.key){case"ArrowLeft":this.navigate({e:e,input:t,left:!0});break;case"ArrowRight":this.navigate({e:e,input:t,right:!0});break;case"ArrowUp":this.navigate({e:e,input:t,up:!0});break;case"ArrowDown":this.navigate({e:e,input:t,down:!0});break;case"Enter":e.preventDefault(),this.handleEmojiClick({pos:this.state.pos});break;case"Escape":e.preventDefault(),this.state.searchResults?this.clearSearch():this.unfocusSearch()}})),YN(this,"clearSearch",(()=>{const e=this.refs.searchInput.current;e&&(e.value="",e.focus(),this.handleSearchInput())})),YN(this,"handleCategoryClick",(({category:e,i:t})=>{this.scrollTo(0==t?{row:-1}:{categoryId:e.id})})),YN(this,"openSkins",(e=>{const{currentTarget:t}=e,n=t.getBoundingClientRect();this.setState({showSkins:n},(async()=>{await async function(e=1){for(let t in[...Array(e).keys()])await new Promise(requestAnimationFrame)}(2);const e=this.refs.menu.current;e&&(e.classList.remove("hidden"),this.refs.skinToneRadio.current.focus(),this.base.addEventListener("click",this.handleBaseClick,!0),this.base.addEventListener("keydown",this.handleBaseKeydown,!0))}))})),this.state={pos:[-1,-1],visibleRows:{0:!0},...this.getInitialState(e)}}}class WO extends oO{async connectedCallback(){const e=QA(this.props,UA,this);e.element=this,e.ref=e=>{this.component=e},await YA(e),SA(AA($O,{...e}),this.shadowRoot)}disconnectedCallback(){this.component&&this.component.unregister()}constructor(e){super(e,{styles:GN(VO)})}}YN(WO,"Props",UA),"undefined"==typeof customElements||customElements.get("em-emoji-picker")||customElements.define("em-emoji-picker",WO);var VO={};VO=':host {\n display: flex;\n width: -webkit-min-content;\n width: -moz-min-content;\n width: min-content;\n height: 435px;\n min-height: 230px;\n border-radius: var(--border-radius);\n box-shadow: var(--shadow);\n --border-radius: 10px;\n --category-icon-size: 18px;\n --font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;\n --font-size: 15px;\n --shadow-color: 0deg 0% 0%;\n --shadow:\n 0.3px 0.5px 2.7px hsl(var(--shadow-color) / 0.14),\n 0.4px 0.8px 1px -3.2px hsl(var(--shadow-color) / 0.14),\n 1px 2px 2.5px -4.5px hsl(var(--shadow-color) / 0.14);\n}\n\n[data-theme=light] {\n --em-rgb-color: var(--rgb-color, 34, 36, 39);\n --em-rgb-accent: var(--rgb-accent, 34, 102, 237);\n --em-rgb-background: var(--rgb-background, 255, 255, 255);\n --em-rgb-input: var(--rgb-input, 255, 255, 255);\n --em-color-border: var(--color-border, rgba(0, 0, 0, .05));\n --em-color-border-over: var(--color-border-over, rgba(0, 0, 0, .1));\n}\n\n[data-theme=dark] {\n --em-rgb-color: var(--rgb-color, 222, 222, 221);\n --em-rgb-accent: var(--rgb-accent, 58, 130, 247);\n --em-rgb-background: var(--rgb-background, 21, 22, 23);\n --em-rgb-input: var(--rgb-input, 0, 0, 0);\n --em-color-border: var(--color-border, rgba(255, 255, 255, .1));\n --em-color-border-over: var(--color-border-over, rgba(255, 255, 255, .2));\n}\n\n#root {\n --color-a: rgb(var(--em-rgb-color));\n --color-b: rgba(var(--em-rgb-color), .65);\n --color-c: rgba(var(--em-rgb-color), .45);\n --padding: 12px;\n --padding-small: calc(var(--padding) / 2);\n --sidebar-width: 16px;\n --duration: 225ms;\n --duration-fast: 125ms;\n --duration-instant: 50ms;\n --easing: cubic-bezier(.4, .0, .2, 1);\n position: relative;\n width: 100%;\n text-align: left;\n border-radius: var(--border-radius);\n background-color: rgb(var(--em-rgb-background));\n}\n\n@media (prefers-reduced-motion) {\n #root {\n --duration: 0;\n --duration-fast: 0;\n --duration-instant: 0;\n }\n}\n\n#root[data-menu] button {\n cursor: auto;\n}\n\n#root[data-menu] .menu button {\n cursor: pointer;\n}\n\n:host, #root, input, button {\n color: rgb(var(--em-rgb-color));\n font-family: var(--font-family);\n font-size: var(--font-size);\n line-height: normal;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n*, *:before, *:after {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n min-width: 0;\n}\n\n.relative {\n position: relative;\n}\n\n.flex {\n display: flex;\n}\n\n.flex-auto {\n flex: 0 0 auto;\n}\n\n.flex-center {\n justify-content: center;\n}\n\n.flex-column {\n flex-direction: column;\n}\n\n.flex-grow {\n flex: 1 1 auto;\n}\n\n.flex-middle {\n align-items: center;\n}\n\n.flex-wrap {\n flex-wrap: wrap;\n}\n\n.padding {\n padding: var(--padding);\n}\n\n.padding-t {\n padding-top: var(--padding);\n}\n\n.padding-lr {\n padding-left: var(--padding);\n padding-right: var(--padding);\n}\n\n.padding-r {\n padding-right: var(--padding);\n}\n\n.padding-small {\n padding: var(--padding-small);\n}\n\n.padding-small-b {\n padding-bottom: var(--padding-small);\n}\n\n.padding-small-lr {\n padding-left: var(--padding-small);\n padding-right: var(--padding-small);\n}\n\n.margin {\n margin: var(--padding);\n}\n\n.margin-r {\n margin-right: var(--padding);\n}\n\n.margin-l {\n margin-left: var(--padding);\n}\n\n.margin-small-l {\n margin-left: var(--padding-small);\n}\n\n.margin-small-lr {\n margin-left: var(--padding-small);\n margin-right: var(--padding-small);\n}\n\n.align-l {\n text-align: left;\n}\n\n.align-r {\n text-align: right;\n}\n\n.color-a {\n color: var(--color-a);\n}\n\n.color-b {\n color: var(--color-b);\n}\n\n.color-c {\n color: var(--color-c);\n}\n\n.ellipsis {\n white-space: nowrap;\n max-width: 100%;\n width: auto;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.sr-only {\n position: absolute;\n left: -10000px;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n}\n\na {\n cursor: pointer;\n color: rgb(var(--em-rgb-accent));\n}\n\na:hover {\n text-decoration: underline;\n}\n\n.spacer {\n height: 10px;\n}\n\n.scroll {\n overflow: auto;\n overflow-x: hidden;\n padding-right: 0;\n}\n\n.scroll::-webkit-scrollbar {\n width: var(--sidebar-width);\n height: var(--sidebar-width);\n}\n\n.scroll::-webkit-scrollbar-track {\n border: 0;\n}\n\n.scroll::-webkit-scrollbar-button {\n width: 0;\n height: 0;\n display: none;\n}\n\n.scroll::-webkit-scrollbar-corner {\n background-color: transparent;\n}\n\n.scroll::-webkit-scrollbar-thumb {\n min-height: 20%;\n min-height: 65px;\n border: 4px solid rgb(var(--em-rgb-background));\n border-radius: 8px;\n}\n\n.scroll::-webkit-scrollbar-thumb:hover {\n background-color: var(--em-color-border-over) !important;\n}\n\n.scroll:hover::-webkit-scrollbar-thumb {\n background-color: var(--em-color-border);\n}\n\n.sticky {\n position: -webkit-sticky;\n position: sticky;\n z-index: 1;\n top: -1px;\n font-weight: 500;\n background-color: rgba(var(--em-rgb-background), 0.9);\n -webkit-backdrop-filter: blur(4px);\n backdrop-filter: blur(4px);\n}\n\n.search {\n z-index: 2;\n position: relative;\n}\n\n.search input, .search button {\n font-size: calc(var(--font-size) - 1px);\n}\n\n.search input[type=search] {\n display: block;\n border: 0;\n outline: 0;\n width: 100%;\n padding: 10px 2em 10px 2.2em;\n border-radius: 10px;\n background-color: var(--em-color-border);\n transition-duration: var(--duration);\n transition-property: background-color, box-shadow;\n transition-timing-function: var(--easing);\n}\n\n.search input[type=search]::-moz-placeholder {\n color: inherit;\n opacity: 0.6;\n}\n\n.search input[type=search]:-ms-input-placeholder {\n color: inherit;\n opacity: 0.6;\n}\n\n.search input[type=search]::placeholder {\n color: inherit;\n opacity: 0.6;\n}\n\n.search input[type=search], .search input[type=search]::-webkit-search-decoration, .search input[type=search]::-webkit-search-cancel-button, .search input[type=search]::-webkit-search-results-button, .search input[type=search]::-webkit-search-results-decoration {\n -webkit-appearance: none;\n appearance: none;\n}\n\n.search input[type=search]:focus {\n background-color: rgb(var(--em-rgb-input));\n box-shadow: inset 0 0 0 1px rgb(var(--em-rgb-accent)), 0 1px 3px rgba(65, 69, 73, 0.2);\n}\n\n.search .icon {\n z-index: 1;\n position: absolute;\n top: 50%;\n color: rgba(var(--em-rgb-color), 0.7);\n transform: translateY(-50%);\n}\n\n.search .loupe {\n left: 0.7em;\n pointer-events: none;\n}\n\n.search .delete {\n right: 0.7em;\n}\n\nsvg {\n fill: currentColor;\n width: 1em;\n height: 1em;\n}\n\nbutton {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n cursor: pointer;\n color: currentColor;\n border: 0;\n background-color: transparent;\n}\n\n#nav {\n z-index: 2;\n position: relative;\n padding-top: 12px;\n padding-bottom: 12px;\n padding-right: var(--sidebar-width);\n}\n\n#nav button {\n color: var(--color-b);\n transition: color var(--duration) var(--easing);\n}\n\n#nav button:hover {\n color: var(--color-a);\n}\n\n#nav svg, #nav img {\n width: var(--category-icon-size);\n height: var(--category-icon-size);\n}\n\n#nav .bar {\n position: absolute;\n bottom: -12px;\n left: 0;\n width: 100%;\n height: 3px;\n background-color: rgb(var(--em-rgb-accent));\n border-radius: 3px 3px 0 0;\n transition: transform var(--duration) var(--easing);\n}\n\n#nav button[aria-selected] {\n color: rgb(var(--em-rgb-accent));\n}\n\n#preview {\n z-index: 2;\n position: relative;\n padding: calc(var(--padding) + 4px) var(--padding);\n padding-right: var(--sidebar-width);\n}\n\n#nav:before, #preview:before {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n height: 2px;\n}\n\n#nav[data-position=top]:before, #preview[data-position=top]:before {\n top: 100%;\n background: linear-gradient(to bottom, var(--em-color-border), transparent);\n}\n\n#nav[data-position=bottom]:before, #preview[data-position=bottom]:before {\n bottom: 100%;\n background: linear-gradient(to top, var(--em-color-border), transparent);\n}\n\n.category button {\n position: relative;\n font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;\n}\n\n.category button > * {\n position: relative;\n}\n\n.category button .background {\n position: absolute;\n inset: 0;\n opacity: 0;\n background-color: var(--em-color-border);\n transition: opacity var(--duration-fast) var(--easing) var(--duration-instant);\n}\n\n.category button:hover .background {\n transition-duration: var(--duration-instant);\n transition-delay: 0ms;\n}\n\n.category button[aria-selected] .background {\n opacity: 1;\n}\n\n.category button[data-keyboard] .background {\n transition: none;\n}\n\n.row {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n}\n\n.skin-tone-button {\n border-radius: 100%;\n border: 1px solid transparent;\n}\n\n.skin-tone-button:hover {\n border-color: var(--em-color-border);\n}\n\n.skin-tone-button:active .skin-tone {\n transform: scale(0.85) !important;\n}\n\n.skin-tone-button .skin-tone {\n transition: transform var(--duration) var(--easing);\n}\n\n.skin-tone-button[aria-selected] {\n border-left-width: 0;\n border-right-width: 0;\n border-top-color: rgba(0, 0, 0, 0.05);\n border-bottom-color: transparent;\n background-color: var(--em-color-border);\n}\n\n.skin-tone-button[aria-selected] .skin-tone {\n transform: scale(0.9);\n}\n\n.menu {\n z-index: 2;\n position: absolute;\n white-space: nowrap;\n padding: 4px;\n border: 1px solid var(--em-color-border);\n background-color: rgba(var(--em-rgb-background), 0.9);\n -webkit-backdrop-filter: blur(4px);\n backdrop-filter: blur(4px);\n border-radius: 10px;\n box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.05);\n transition-property: opacity, transform;\n transition-duration: var(--duration);\n transition-timing-function: var(--easing);\n}\n\n.menu.hidden {\n opacity: 0;\n}\n\n.menu[data-position=bottom] {\n transform-origin: bottom right;\n}\n\n.menu[data-position=bottom].hidden {\n transform: scale(0.9) rotate(-3deg) translateY(5%);\n}\n\n.menu[data-position=top] {\n transform-origin: top right;\n}\n\n.menu[data-position=top].hidden {\n transform: scale(0.9) rotate(3deg) translateY(-5%);\n}\n\n.menu input[type=radio] {\n position: absolute;\n overflow: hidden;\n clip: rect(0 0 0 0);\n width: 1px;\n height: 1px;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.menu input[type=radio]:checked + .option {\n box-shadow: 0 0 0 2px rgb(var(--em-rgb-accent));\n}\n\n.option {\n width: 100%;\n padding: 4px 6px;\n border-radius: 6px;\n}\n\n.option:hover {\n color: #fff;\n background-color: rgb(var(--em-rgb-accent));\n}\n\n.skin-tone {\n position: relative;\n display: inline-block;\n width: 16px;\n height: 16px;\n border-radius: 100%;\n overflow: hidden;\n}\n\n.skin-tone:after {\n content: "";\n position: absolute;\n inset: 0;\n border-radius: 100%;\n border: 1px solid rgba(0, 0, 0, 0.8);\n mix-blend-mode: overlay;\n box-shadow: inset 0 -2px 3px #000, inset 0 1px 2px #fff;\n background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);\n}\n\n.skin-tone-1 {\n background-color: #ffc93a;\n}\n\n.skin-tone-2 {\n background-color: #ffdab7;\n}\n\n.skin-tone-3 {\n background-color: #e7b98f;\n}\n\n.skin-tone-4 {\n background-color: #c88c61;\n}\n\n.skin-tone-5 {\n background-color: #a46134;\n}\n\n.skin-tone-6 {\n background-color: #5d4437;\n}\n\n[data-emoji-set=twitter] .skin-tone:after {\n border-color: rgba(0, 0, 0, 0.5);\n box-shadow: none;\n}\n\n[data-emoji-set=twitter] .skin-tone-1 {\n background-color: #FADE72;\n}\n\n[data-emoji-set=twitter] .skin-tone-2 {\n background-color: #F3DFD0;\n}\n\n[data-emoji-set=twitter] .skin-tone-3 {\n background-color: #EED3A8;\n}\n\n[data-emoji-set=twitter] .skin-tone-4 {\n background-color: #CFAD8D;\n}\n\n[data-emoji-set=twitter] .skin-tone-5 {\n background-color: #A8805D;\n}\n\n[data-emoji-set=twitter] .skin-tone-6 {\n background-color: #765542;\n}\n\n[data-emoji-set=google] .skin-tone:after {\n box-shadow: inset 0 0 2px 2px rgba(0, 0, 0, 0.4);\n}\n\n[data-emoji-set=google] .skin-tone-1 {\n background-color: #F5C748;\n}\n\n[data-emoji-set=google] .skin-tone-2 {\n background-color: #F1D5AA;\n}\n\n[data-emoji-set=google] .skin-tone-3 {\n background-color: #D4B48D;\n}\n\n[data-emoji-set=google] .skin-tone-4 {\n background-color: #AA876B;\n}\n\n[data-emoji-set=google] .skin-tone-5 {\n background-color: #916544;\n}\n\n[data-emoji-set=google] .skin-tone-6 {\n background-color: #61493F;\n}\n\n[data-emoji-set=facebook] .skin-tone:after {\n border-color: rgba(0, 0, 0, 0.4);\n box-shadow: inset 0 -2px 3px #000, inset 0 1px 4px #fff;\n}\n\n[data-emoji-set=facebook] .skin-tone-1 {\n background-color: #F5C748;\n}\n\n[data-emoji-set=facebook] .skin-tone-2 {\n background-color: #F1D5AA;\n}\n\n[data-emoji-set=facebook] .skin-tone-3 {\n background-color: #D4B48D;\n}\n\n[data-emoji-set=facebook] .skin-tone-4 {\n background-color: #AA876B;\n}\n\n[data-emoji-set=facebook] .skin-tone-5 {\n background-color: #916544;\n}\n\n[data-emoji-set=facebook] .skin-tone-6 {\n background-color: #61493F;\n}\n';const qO=()=>oe.get("https://cdn.jsdelivr.net/npm/@emoji-mart/data");class KO extends r.Component{constructor(){super(...arguments),tu(this,"ref",r.createRef()),tu(this,"fetchEmojiData",(async()=>{try{const{data:e}=await qO();return e}catch{return{}}})),tu(this,"onKeyDown",(e=>{let{event:t}=e;return"Escape"===t.key&&(this.props.editor.chain().focus().deleteRange(this.props.range).run(),!0)})),tu(this,"handleSelect",(e=>{this.props.editor.chain().focus().deleteRange(this.props.range).setEmoji(e).run()}))}componentDidMount(){new WO({...this.props,onEmojiSelect:this.handleSelect,style:{maxWidth:"100%"},theme:"light",native:!0,previewPosition:"none",showSkinTones:!1,data:this.fetchEmojiData,ref:this.ref})}render(){return r.createElement("div",{"data-cy":"neeto-editor-emoji-picker",ref:this.ref})}}KO.defaultProps={editor:{},range:{}},KO.propTypes={editor:yl.exports.object.isRequired,range:yl.exports.object};const GO=new Dm("emoji-picker"),YO=_w.create({name:"emojiPicker",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:()=>({suggestion:{char:"::",startOfLine:!1,pluginKey:GO,items:()=>[],render:()=>{let e,t;return{onStart(n){e=new Wx(KO,{props:n,editor:n.editor}),t=Ox("body",{theme:"light",getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onKeyDown(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t)},onExit(){t[0].destroy(),e.destroy()}}}}}),addProseMirrorPlugins(){return[KN({editor:this.editor,...this.options.suggestion})]}});class QO extends r.Component{constructor(){super(...arguments),tu(this,"state",{isLoading:!1,selectedIndex:0,emojiSuggestions:[]}),tu(this,"fetchEmojiData",(async()=>{this.setState({isLoading:!0});try{const{data:e}=await qO();return this.setState({isLoading:!1}),e}catch{return this.setState({isLoading:!1}),{}}})),tu(this,"searchEmoji",(async()=>{if(this.props.query)return(await XA.search(this.props.query)).slice(0,5);return(await Promise.all(["+1","-1","smile","tada","heart"].map((e=>XA.search(e))))).map((e=>e[0]))})),tu(this,"searchEmojiAndSetState",(async()=>{const e=await this.searchEmoji();this.setState({emojiSuggestions:e})})),tu(this,"setEditorState",(async()=>{const e=await this.searchEmoji();this.props.editor.chain().focus().deleteRange(this.props.range).setEmoji(e[0]).run()})),tu(this,"onKeyDown",(e=>{let{event:t}=e;return"ArrowLeft"===t.key||"ArrowDown"===t.key?(this.setState((e=>{let{selectedIndex:t,emojiSuggestions:n}=e;return{selectedIndex:(t+n.length-1)%n.length}})),!0):"ArrowRight"===t.key||"ArrowUp"===t.key?(this.setState((e=>{let{selectedIndex:t,emojiSuggestions:n}=e;return{selectedIndex:(t+1)%n.length}})),!0):"Enter"===t.key?(this.selectItem(this.state.selectedIndex),!0):" "===t.key?(_e(this.props.query)?this.props.editor.chain().focus().insertContent(" ").run():this.setEditorState(),!0):"Escape"===t.key&&(this.props.editor.chain().focus().insertContent(" ").run(),!0)})),tu(this,"selectItem",(e=>{this.props.editor.chain().focus().deleteRange(this.props.range).setEmoji(this.state.emojiSuggestions[e]).run()}))}componentDidMount(){YA({data:this.fetchEmojiData,theme:"light",previewPosition:"none"}),this.searchEmojiAndSetState()}componentDidUpdate(e){this.props.query!==e.query&&this.searchEmojiAndSetState()}render(){return r.createElement("div",{className:"neeto-editor-emoji-suggestion"},this.state.isLoading&&r.createElement(w,null),!this.state.isLoading&&(this.state.emojiSuggestions.length>0?this.state.emojiSuggestions.map(((e,t)=>r.createElement("div",{"data-cy":`neeto-editor-emoji-suggestion-${e.id}`,key:e.id,className:qe("neeto-editor-emoji-suggestion__item",{"neeto-editor-emoji-suggestion__item--selected":t===this.state.selectedIndex}),onClick:()=>this.selectItem(t)},e.skins[0].native))):r.createElement("p",null,"No results")))}}const JO=new Dm("emoji-suggestion"),ZO=_w.create({name:"emojiSuggestion",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:()=>({HTMLAttributes:{class:"neeto-editor-emoji"},renderEmoji(e){let{node:t}=e;return t.attrs.label},suggestion:{}}),addAttributes:()=>({label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML:()=>[{tag:"span[data-emoji]"}],renderHTML(e){let{node:t,HTMLAttributes:n}=e;return["span",pv({"data-emoji":""},this.options.HTMLAttributes,n),this.options.renderEmoji({node:t})]},renderText(e){let{node:t}=e;return this.options.renderEmoji({node:t})},addCommands(){return{setEmoji:e=>t=>{var n;let{chain:r}=t;r().focus().insertContent([{type:this.name,attrs:{label:(null==e?void 0:e.native)||(null==e||null===(n=e.skins[0])||void 0===n?void 0:n.native)||""}},{type:"text",text:" "}]).run()}}},addProseMirrorPlugins(){return[KN({editor:this.editor,...this.options.suggestion})]}}),XO={char:":",startOfLine:!1,pluginKey:JO,command:e=>{let{editor:t,range:n,props:r}=e;t.chain().focus().deleteRange(n).setEmoji(r).run()},items:()=>[],render:()=>{let e,t;return{onStart(n){e=new Wx(QO,{props:n,editor:n.editor}),t=Ox("body",{theme:"light",getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start",zIndex:99999})},onUpdate(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t)},onExit(){t[0].destroy(),e.destroy()}}}};var eT,tT=ZO.configure({suggestion:XO}),nT=void 0&&(void 0).__extends||(eT=function(e,t){return eT=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},eT(e,t)},function(e,t){function n(){this.constructor=e}eT(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),rT=void 0&&(void 0).__assign||function(){return rT=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},rT.apply(this,arguments)},iT={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},oT={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},sT={width:"20px",height:"20px",position:"absolute"},aT={top:rT(rT({},iT),{top:"-5px"}),right:rT(rT({},oT),{left:void 0,right:"-5px"}),bottom:rT(rT({},iT),{top:void 0,bottom:"-5px"}),left:rT(rT({},oT),{left:"-5px"}),topRight:rT(rT({},sT),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:rT(rT({},sT),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:rT(rT({},sT),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:rT(rT({},sT),{left:"-10px",top:"-10px",cursor:"nw-resize"})},lT=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onMouseDown=function(e){t.props.onResizeStart(e,t.props.direction)},t.onTouchStart=function(e){t.props.onResizeStart(e,t.props.direction)},t}return nT(t,e),t.prototype.render=function(){return n.createElement("div",{className:this.props.className||"",style:rT(rT({position:"absolute",userSelect:"none"},aT[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(n.PureComponent),cT=void 0&&(void 0).__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),uT=void 0&&(void 0).__assign||function(){return uT=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},uT.apply(this,arguments)},dT={width:"auto",height:"auto"},pT=function(e,t,n){return Math.max(Math.min(e,n),t)},hT=function(e,t){return Math.round(e/t)*t},fT=function(e,t){return new RegExp(e,"i").test(t)},mT=function(e){return Boolean(e.touches&&e.touches.length)},gT=function(e,t,n){void 0===n&&(n=0);var r=t.reduce((function(n,r,i){return Math.abs(r-e)<Math.abs(t[n]-e)?i:n}),0),i=Math.abs(t[r]-e);return 0===n||i<n?t[r]:e},bT=function(e){return"auto"===(e=e.toString())||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:e+"px"},yT=function(e,t,n,r){if(e&&"string"==typeof e){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%"))return t*(Number(e.replace("%",""))/100);if(e.endsWith("vw"))return n*(Number(e.replace("vw",""))/100);if(e.endsWith("vh"))return r*(Number(e.replace("vh",""))/100)}return e},vT=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],wT="__resizable_base__",_T=function(e){function t(t){var n=e.call(this,t)||this;return n.ratio=1,n.resizable=null,n.parentLeft=0,n.parentTop=0,n.resizableLeft=0,n.resizableRight=0,n.resizableTop=0,n.resizableBottom=0,n.targetLeft=0,n.targetTop=0,n.appendBase=function(){if(!n.resizable||!n.window)return null;var e=n.parentNode;if(!e)return null;var t=n.window.document.createElement("div");return t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.transform="scale(0, 0)",t.style.left="0",t.style.flex="0 0 100%",t.classList?t.classList.add(wT):t.className+=wT,e.appendChild(t),t},n.removeBase=function(e){var t=n.parentNode;t&&t.removeChild(e)},n.ref=function(e){e&&(n.resizable=e)},n.state={isResizing:!1,width:void 0===(n.propsSize&&n.propsSize.width)?"auto":n.propsSize&&n.propsSize.width,height:void 0===(n.propsSize&&n.propsSize.height)?"auto":n.propsSize&&n.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},n.onResizeStart=n.onResizeStart.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.onMouseUp=n.onMouseUp.bind(n),n}return cT(t,e),Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||dT},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var e=0,t=0;if(this.resizable&&this.window){var n=this.resizable.offsetWidth,r=this.resizable.offsetHeight,i=this.resizable.style.position;"relative"!==i&&(this.resizable.style.position="relative"),e="auto"!==this.resizable.style.width?this.resizable.offsetWidth:n,t="auto"!==this.resizable.style.height?this.resizable.offsetHeight:r,this.resizable.style.position=i}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var e=this,t=this.props.size,n=function(t){if(void 0===e.state[t]||"auto"===e.state[t])return"auto";if(e.propsSize&&e.propsSize[t]&&e.propsSize[t].toString().endsWith("%")){if(e.state[t].toString().endsWith("%"))return e.state[t].toString();var n=e.getParentSize();return Number(e.state[t].toString().replace("px",""))/n[t]*100+"%"}return bT(e.state[t])};return{width:t&&void 0!==t.width&&!this.state.isResizing?bT(t.width):n("width"),height:t&&void 0!==t.height&&!this.state.isResizing?bT(t.height):n("height")}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,n=this.parentNode.style.flexWrap;"wrap"!==n&&(t=!0,this.parentNode.style.flexWrap="wrap"),e.style.position="relative",e.style.minWidth="100%",e.style.minHeight="100%";var r={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=n),this.removeBase(e),r},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(this.resizable&&this.window){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==e.flexBasis?e.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(e,t){var n=this.propsSize&&this.propsSize[t];return"auto"!==this.state[t]||this.state.original[t]!==e||void 0!==n&&"auto"!==n?e:"auto"},t.prototype.calculateNewMaxFromBoundary=function(e,t){var n,r,i=this.props.boundsByDirection,o=this.state.direction,s=i&&fT("left",o),a=i&&fT("top",o);if("parent"===this.props.bounds){var l=this.parentNode;l&&(n=s?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),r=a?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(n=s?this.resizableRight:this.window.innerWidth-this.resizableLeft,r=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(n=s?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),r=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return n&&Number.isFinite(n)&&(e=e&&e<n?e:n),r&&Number.isFinite(r)&&(t=t&&t<r?t:r),{maxWidth:e,maxHeight:t}},t.prototype.calculateNewSizeFromDirection=function(e,t){var n=this.props.scale||1,r=this.props.resizeRatio||1,i=this.state,o=i.direction,s=i.original,a=this.props,l=a.lockAspectRatio,c=a.lockAspectRatioExtraHeight,u=a.lockAspectRatioExtraWidth,d=s.width,p=s.height,h=c||0,f=u||0;return fT("right",o)&&(d=s.width+(e-s.x)*r/n,l&&(p=(d-f)/this.ratio+h)),fT("left",o)&&(d=s.width-(e-s.x)*r/n,l&&(p=(d-f)/this.ratio+h)),fT("bottom",o)&&(p=s.height+(t-s.y)*r/n,l&&(d=(p-h)*this.ratio+f)),fT("top",o)&&(p=s.height-(t-s.y)*r/n,l&&(d=(p-h)*this.ratio+f)),{newWidth:d,newHeight:p}},t.prototype.calculateNewSizeFromAspectRatio=function(e,t,n,r){var i=this.props,o=i.lockAspectRatio,s=i.lockAspectRatioExtraHeight,a=i.lockAspectRatioExtraWidth,l=void 0===r.width?10:r.width,c=void 0===n.width||n.width<0?e:n.width,u=void 0===r.height?10:r.height,d=void 0===n.height||n.height<0?t:n.height,p=s||0,h=a||0;if(o){var f=(u-p)*this.ratio+h,m=(d-p)*this.ratio+h,g=(l-h)/this.ratio+p,b=(c-h)/this.ratio+p,y=Math.max(l,f),v=Math.min(c,m),w=Math.max(u,g),_=Math.min(d,b);e=pT(e,y,v),t=pT(t,w,_)}else e=pT(e,l,c),t=pT(t,u,d);return{newWidth:e,newHeight:t}},t.prototype.setBoundingClientRect=function(){if("parent"===this.props.bounds){var e=this.parentNode;if(e){var t=e.getBoundingClientRect();this.parentLeft=t.left,this.parentTop=t.top}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var n=this.props.bounds.getBoundingClientRect();this.targetLeft=n.left,this.targetTop=n.top}if(this.resizable){var r=this.resizable.getBoundingClientRect(),i=r.left,o=r.top,s=r.right,a=r.bottom;this.resizableLeft=i,this.resizableRight=s,this.resizableTop=o,this.resizableBottom=a}},t.prototype.onResizeStart=function(e,t){if(this.resizable&&this.window){var n,r=0,i=0;if(e.nativeEvent&&function(e){return Boolean((e.clientX||0===e.clientX)&&(e.clientY||0===e.clientY))}(e.nativeEvent)?(r=e.nativeEvent.clientX,i=e.nativeEvent.clientY):e.nativeEvent&&mT(e.nativeEvent)&&(r=e.nativeEvent.touches[0].clientX,i=e.nativeEvent.touches[0].clientY),this.props.onResizeStart)if(this.resizable)if(!1===this.props.onResizeStart(e,t,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var o=this.window.getComputedStyle(this.resizable);if("auto"!==o.flexBasis){var s=this.parentNode;if(s){var a=this.window.getComputedStyle(s).flexDirection;this.flexDir=a.startsWith("row")?"row":"column",n=o.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:r,y:i,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:uT(uT({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||"auto"}),direction:t,flexBasis:n};this.setState(l)}},t.prototype.onMouseMove=function(e){var t=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&mT(e))try{e.preventDefault(),e.stopPropagation()}catch(e){}var n=this.props,r=n.maxWidth,i=n.maxHeight,o=n.minWidth,s=n.minHeight,a=mT(e)?e.touches[0].clientX:e.clientX,l=mT(e)?e.touches[0].clientY:e.clientY,c=this.state,u=c.direction,d=c.original,p=c.width,h=c.height,f=this.getParentSize(),m=function(e,t,n,r,i,o,s){return r=yT(r,e.width,t,n),i=yT(i,e.height,t,n),o=yT(o,e.width,t,n),s=yT(s,e.height,t,n),{maxWidth:void 0===r?void 0:Number(r),maxHeight:void 0===i?void 0:Number(i),minWidth:void 0===o?void 0:Number(o),minHeight:void 0===s?void 0:Number(s)}}(f,this.window.innerWidth,this.window.innerHeight,r,i,o,s);r=m.maxWidth,i=m.maxHeight,o=m.minWidth,s=m.minHeight;var g=this.calculateNewSizeFromDirection(a,l),b=g.newHeight,y=g.newWidth,v=this.calculateNewMaxFromBoundary(r,i);this.props.snap&&this.props.snap.x&&(y=gT(y,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(b=gT(b,this.props.snap.y,this.props.snapGap));var w=this.calculateNewSizeFromAspectRatio(y,b,{width:v.maxWidth,height:v.maxHeight},{width:o,height:s});if(y=w.newWidth,b=w.newHeight,this.props.grid){var _=hT(y,this.props.grid[0]),x=hT(b,this.props.grid[1]),E=this.props.snapGap||0;y=0===E||Math.abs(_-y)<=E?_:y,b=0===E||Math.abs(x-b)<=E?x:b}var k={width:y-d.width,height:b-d.height};if(p&&"string"==typeof p)if(p.endsWith("%"))y=y/f.width*100+"%";else if(p.endsWith("vw")){y=y/this.window.innerWidth*100+"vw"}else if(p.endsWith("vh")){y=y/this.window.innerHeight*100+"vh"}if(h&&"string"==typeof h)if(h.endsWith("%"))b=b/f.height*100+"%";else if(h.endsWith("vw")){b=b/this.window.innerWidth*100+"vw"}else if(h.endsWith("vh")){b=b/this.window.innerHeight*100+"vh"}var M={width:this.createSizeForCssProperty(y,"width"),height:this.createSizeForCssProperty(b,"height")};"row"===this.flexDir?M.flexBasis=M.width:"column"===this.flexDir&&(M.flexBasis=M.height),de((function(){t.setState(M)})),this.props.onResize&&this.props.onResize(e,u,this.resizable,k)}},t.prototype.onMouseUp=function(e){var t=this.state,n=t.isResizing,r=t.direction,i=t.original;if(n&&this.resizable){var o={width:this.size.width-i.width,height:this.size.height-i.height};this.props.onResizeStop&&this.props.onResizeStop(e,r,this.resizable,o),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:uT(uT({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(e){this.setState({width:e.width,height:e.height})},t.prototype.renderResizer=function(){var e=this,t=this.props,r=t.enable,i=t.handleStyles,o=t.handleClasses,s=t.handleWrapperStyle,a=t.handleWrapperClass,l=t.handleComponent;if(!r)return null;var c=Object.keys(r).map((function(t){return!1!==r[t]?n.createElement(lT,{key:t,direction:t,onResizeStart:e.onResizeStart,replaceStyles:i&&i[t],className:o&&o[t]},l&&l[t]?l[t]:null):null}));return n.createElement("div",{className:a,style:s},c)},t.prototype.render=function(){var e=this,t=Object.keys(this.props).reduce((function(t,n){return-1!==vT.indexOf(n)||(t[n]=e.props[n]),t}),{}),r=uT(uT(uT({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(r.flexBasis=this.state.flexBasis);var i=this.props.as||"div";return n.createElement(i,uT({ref:this.ref,style:r,className:this.props.className},t),this.state.isResizing&&n.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(n.PureComponent);const xT=e=>{let{align:t,updateAttributes:n,deleteNode:i}=e;const o=[{Icon:M,alignPos:"left",optionName:"Align left"},{Icon:D,alignPos:"center",optionName:"Align Center"},{Icon:C,alignPos:"right",optionName:"Align right"},{Icon:S,optionName:"Delete"}];return r.createElement(y,{buttonProps:{className:"neeto-editor__image-menu-btn"},buttonSize:"small",buttonStyle:"secondary",className:"neeto-editor__image-menu",icon:T,position:"top"},o.map((e=>{let{Icon:o,optionName:s,alignPos:a}=e;return r.createElement(g,{icon:o,key:s,style:a===t?"secondary":"text",tooltipProps:{content:ae(s),position:"top"},onClick:()=>(e=>e?n({align:e}):i())(a)})})))},ET=t=>{var n;let{node:i,editor:s,getPos:a,updateAttributes:l,deleteNode:c}=t;const u=o(null),{alt:d,src:p,figheight:h,figwidth:f,align:m}=i.attrs,{view:g}=s;let b=h,y=f;const v=u.current?null===(n=u.current.querySelector("figcaption>div"))||void 0===n?void 0:n.textContent:d;return r.createElement($x,{className:`neeto-editor__image-wrapper neeto-editor__image--${m}`},r.createElement("figure",{ref:u},r.createElement(xT,{align:m,deleteNode:c,updateAttributes:l}),r.createElement(_T,{lockAspectRatio:!0,className:"neeto-editor__image",size:{height:b,width:y},onResizeStop:(e,t,n)=>{b=n.offsetHeight,y=n.offsetWidth,g.dispatch(g.state.tr.setNodeMarkup(a(),void 0,{...i.attrs,figheight:b,figwidth:y,height:b,width:y})),s.commands.focus()}},r.createElement("img",Zd({},i.attrs,{alt:v,src:p}))),r.createElement(Hx,{as:"figcaption",className:qe({"is-empty":e(v)})})))},kT=_w.create({name:"image",addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",draggable:!0,isolating:!0,addAttributes:()=>({src:{default:null,parseHTML:e=>{var t;return null===(t=e.querySelector("img"))||void 0===t?void 0:t.getAttribute("src")}},alt:{default:"",parseHTML:e=>{var t;return null===(t=e.querySelector("img"))||void 0===t?void 0:t.getAttribute("alt")}},figheight:{default:288,parseHTML:e=>{var t;return null===(t=e.querySelector("img"))||void 0===t?void 0:t.getAttribute("figheight")}},figwidth:{default:"fit-content",parseHTML:e=>{var t;return null===(t=e.querySelector("img"))||void 0===t?void 0:t.getAttribute("figwidth")}},align:{default:"left",parseHTML:e=>{var t;return null===(t=e.querySelector("img"))||void 0===t?void 0:t.getAttribute("align")}}}),parseHTML:()=>[{tag:"figure",contentElement:"figcaption"}],renderHTML(e){let{node:t,HTMLAttributes:n}=e;const{align:r,src:i,figheight:o,figwidth:s}=t.attrs,a={class:"neeto-editor__image",style:`height:${o}px;width:${s}px;`};return["a",{href:i,target:"_blank",rel:"noopener noreferrer",class:`neeto-editor__image-wrapper neeto-editor__image--${r}`},["figure",this.options.HTMLAttributes,["div",a,["img",pv(n,{draggable:!1,contenteditable:!1})]],["figcaption",0]]]},addNodeView:()=>qx(ET),addCommands(){return{setFigure:e=>{let{caption:t,...n}=e;return e=>{let{chain:r}=e;return r().insertContent({type:this.name,attrs:n,content:t?[{type:"text",text:t}]:[]}).command((e=>{let{tr:t,commands:n}=e;const{doc:r,selection:i}=t,o=r.resolve(i.to).end();return n.setTextSelection(o)})).run()}}}}}),MT=async(e,t)=>{if(e.size<=Kc){const n=new $d({file:e,url:t}),{blobUrl:r}=await n.create();return r}const n=Kc/(1024*1024);return h.error(`Image size should be less than ${n} MB`),""};var DT=t=>{let{uploadEndpoint:n}=t;return kT.extend({addProseMirrorPlugins:()=>[new Em({props:{handleDOMEvents:{paste(t,r){var i,o;const{schema:s,selection:{$anchor:{pos:a}}}=t.state;if(!(null===(i=r.clipboardData)||void 0===i||null===(o=i.files)||void 0===o?void 0:o.length))return;const l=Array.from(r.clipboardData.files).filter((e=>/image/i.test(e.type)));e(l)||(r.preventDefault(),l.forEach((async e=>{const r=s.nodes.image.create({src:await MT(e,n)});if(r.attrs.src){const e=t.state.tr.insert(a,r);t.dispatch(e)}})))}}}})]})},CT=_w.create({name:"figcaption",selectable:!1,draggable:!1,parseHTML:()=>[{tag:"figcaption"}]});const ST=e=>{let{onSubmit:t,shortcuts:n}=e;return Av.create({name:"keyboard-shortcuts",addKeyboardShortcuts(){return{"Mod-Enter":()=>(null==t||t(this.editor.getHTML()),this.editor.commands.blur(),!0),...n}}})};var NT=e=>{let{onSubmit:t,shortcuts:n}=e;return ST({onSubmit:t,shortcuts:n})};const AT=new Dm("mention"),OT=_w.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderLabel({options:e,node:t}){var n;return`${e.suggestion.char}${null!==(n=t.attrs.label)&&void 0!==n?n:t.attrs.id}`},suggestion:{char:"@",pluginKey:AT,command:({editor:e,range:t,props:n})=>{var r,i;const o=e.view.state.selection.$to.nodeAfter;(null===(r=null==o?void 0:o.text)||void 0===r?void 0:r.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),null===(i=window.getSelection())||void 0===i||i.collapseToEnd()},allow:({state:e,range:t})=>{const n=e.doc.resolve(t.from),r=e.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(r)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:t}){return["span",pv({"data-type":this.name},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e})]},renderText({node:e}){return this.options.renderLabel({options:this.options,node:e})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command((({tr:e,state:t})=>{let n=!1;const{selection:r}=t,{empty:i,anchor:o}=r;return!!i&&(t.doc.nodesBetween(o-1,o,((t,r)=>{if(t.type.name===this.name)return n=!0,e.insertText(this.options.suggestion.char||"",r,r+t.nodeSize),!1})),n)}))}},addProseMirrorPlugins(){return[KN({editor:this.editor,...this.options.suggestion})]}}),TT=e=>{let{wrapperRef:t,index:n}=e;if(!t.current||n>=t.current.children.length)return;const r=8,i=t.current,o=i.children[n],s=o.clientHeight+r;let a=i.scrollTop;o.offsetTop+s>a+i.clientHeight?a=o.offsetTop-i.clientHeight+s:a>o.offsetTop&&(a=o.offsetTop-r),t.current.scrollTop=a};class IT extends r.Component{constructor(e){super(e),tu(this,"selectItem",(e=>{const{items:t,command:n}=this.props,r=t[e];r&&n({label:r.name,id:r.key})})),tu(this,"upHandler",(()=>{const{items:e}=this.props;this.setState((t=>{const{selectedIndex:n}=t;return{selectedIndex:(n+e.length-1)%e.length}}))})),tu(this,"downHandler",(()=>{const{items:e}=this.props;this.setState((t=>{const{selectedIndex:n}=t;return{selectedIndex:(n+1)%e.length}}))})),tu(this,"enterHandler",(()=>{const{selectedIndex:e}=this.state;this.selectItem(e)})),tu(this,"onKeyDown",(e=>{let{event:t}=e;const n={ArrowUp:this.upHandler,ArrowDown:this.downHandler,Enter:this.enterHandler};return!!Object.prototype.hasOwnProperty.call(n,t.key)&&(n[t.key](),!0)})),this.state={selectedIndex:0},this.mentionRef=r.createRef()}componentDidUpdate(e){const{items:t}=this.props;t!==e.items&&this.setState({selectedIndex:0}),TT({wrapperRef:this.mentionRef,index:this.state.selectedIndex})}render(){const{selectedIndex:t}=this.state,{items:n}=this.props;return e(n)?r.createElement("div",{className:"neeto-editor-mentions__wrapper"},r.createElement("p",{className:"neeto-editor-mentions__item"},"No Results")):r.createElement("div",{className:"neeto-editor-mentions__wrapper","data-cy":"neeto-editor-mention-list",ref:this.mentionRef},n.map(((e,n)=>{let{key:i,name:o,imageUrl:s}=e;return r.createElement("button",{"data-cy":`neeto-editor-mention-list-${o}`,key:i,type:"button",className:qe("neeto-editor-mentions__item",{active:n===t}),onClick:()=>this.selectItem(n)},r.createElement(_,{user:{name:o,imageUrl:s}}),r.createElement("p",null,o))})))}}function LT(e){return Array.isArray?Array.isArray(e):"[object Array]"===$T(e)}const FT=1/0;function zT(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-FT?"-0":t}(e)}function jT(e){return"string"==typeof e}function RT(e){return"number"==typeof e}function BT(e){return!0===e||!1===e||function(e){return PT(e)&&null!==e}(e)&&"[object Boolean]"==$T(e)}function PT(e){return"object"==typeof e}function UT(e){return null!=e}function HT(e){return!e.trim().length}function $T(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const WT="Extended search is not available",VT="Incorrect 'index' type",qT=Object.prototype.hasOwnProperty;class KT{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let n=GT(e);t+=n.weight,this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function GT(e){let t=null,n=null,r=null,i=1,o=null;if(jT(e)||LT(e))r=e,t=YT(e),n=QT(e);else{if(!qT.call(e,"name"))throw new Error((e=>`Missing ${e} property in key`)("name"));const s=e.name;if(r=s,qT.call(e,"weight")&&(i=e.weight,i<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(s));t=YT(s),n=QT(s),o=e.getFn}return{path:t,id:n,weight:i,src:r,getFn:o}}function YT(e){return LT(e)?e:e.split(".")}function QT(e){return LT(e)?e.join("."):e}const JT={useExtendedSearch:!1,getFn:function(e,t){let n=[],r=!1;const i=(e,t,o)=>{if(UT(e))if(t[o]){const s=e[t[o]];if(!UT(s))return;if(o===t.length-1&&(jT(s)||RT(s)||BT(s)))n.push(zT(s));else if(LT(s)){r=!0;for(let e=0,n=s.length;e<n;e+=1)i(s[e],t,o+1)}else t.length&&i(s,t,o+1)}else n.push(e)};return i(e,jT(t)?t.split("."):t,0),r?n:n[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var ZT={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...JT};const XT=/[^ ]+/g;class eI{constructor({getFn:e=ZT.getFn,fieldNormWeight:t=ZT.fieldNormWeight}={}){this.norm=function(e=1,t=3){const n=new Map,r=Math.pow(10,t);return{get(t){const i=t.match(XT).length;if(n.has(i))return n.get(i);const o=1/Math.pow(i,.5*e),s=parseFloat(Math.round(o*r)/r);return n.set(i,s),s},clear(){n.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach(((e,t)=>{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,jT(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const t=this.size();jT(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,n=this.size();t<n;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!UT(e)||HT(e))return;let n={v:e,i:t,n:this.norm.get(e)};this.records.push(n)}_addObject(e,t){let n={i:t,$:{}};this.keys.forEach(((t,r)=>{let i=t.getFn?t.getFn(e):this.getFn(e,t.path);if(UT(i))if(LT(i)){let e=[];const t=[{nestedArrIndex:-1,value:i}];for(;t.length;){const{nestedArrIndex:n,value:r}=t.pop();if(UT(r))if(jT(r)&&!HT(r)){let t={v:r,i:n,n:this.norm.get(r)};e.push(t)}else LT(r)&&r.forEach(((e,n)=>{t.push({nestedArrIndex:n,value:e})}))}n.$[r]=e}else if(jT(i)&&!HT(i)){let e={v:i,n:this.norm.get(i)};n.$[r]=e}})),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function tI(e,t,{getFn:n=ZT.getFn,fieldNormWeight:r=ZT.fieldNormWeight}={}){const i=new eI({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(GT)),i.setSources(t),i.create(),i}function nI(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:i=ZT.distance,ignoreLocation:o=ZT.ignoreLocation}={}){const s=t/e.length;if(o)return s;const a=Math.abs(r-n);return i?s+a/i:a?1:s}const rI=32;function iI(e,t,n,{location:r=ZT.location,distance:i=ZT.distance,threshold:o=ZT.threshold,findAllMatches:s=ZT.findAllMatches,minMatchCharLength:a=ZT.minMatchCharLength,includeMatches:l=ZT.includeMatches,ignoreLocation:c=ZT.ignoreLocation}={}){if(t.length>rI)throw new Error((e=>`Pattern length exceeds max of ${e}.`)(rI));const u=t.length,d=e.length,p=Math.max(0,Math.min(r,d));let h=o,f=p;const m=a>1||l,g=m?Array(d):[];let b;for(;(b=e.indexOf(t,f))>-1;){let e=nI(t,{currentLocation:b,expectedLocation:p,distance:i,ignoreLocation:c});if(h=Math.min(e,h),f=b+u,m){let e=0;for(;e<u;)g[b+e]=1,e+=1}}f=-1;let y=[],v=1,w=u+d;const _=1<<u-1;for(let r=0;r<u;r+=1){let o=0,a=w;for(;o<a;){nI(t,{errors:r,currentLocation:p+a,expectedLocation:p,distance:i,ignoreLocation:c})<=h?o=a:w=a,a=Math.floor((w-o)/2+o)}w=a;let l=Math.max(1,p-a+1),b=s?d:Math.min(p+a,d)+u,x=Array(b+2);x[b+1]=(1<<r)-1;for(let o=b;o>=l;o-=1){let s=o-1,a=n[e.charAt(s)];if(m&&(g[s]=+!!a),x[o]=(x[o+1]<<1|1)&a,r&&(x[o]|=(y[o+1]|y[o])<<1|1|y[o+1]),x[o]&_&&(v=nI(t,{errors:r,currentLocation:s,expectedLocation:p,distance:i,ignoreLocation:c}),v<=h)){if(h=v,f=s,f<=p)break;l=Math.max(1,2*p-f)}}if(nI(t,{errors:r+1,currentLocation:p,expectedLocation:p,distance:i,ignoreLocation:c})>h)break;y=x}const x={isMatch:f>=0,score:Math.max(.001,v)};if(m){const e=function(e=[],t=ZT.minMatchCharLength){let n=[],r=-1,i=-1,o=0;for(let s=e.length;o<s;o+=1){let s=e[o];s&&-1===r?r=o:s||-1===r||(i=o-1,i-r+1>=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}(g,a);e.length?l&&(x.indices=e):x.isMatch=!1}return x}function oI(e){let t={};for(let n=0,r=e.length;n<r;n+=1){const i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}class sI{constructor(e,{location:t=ZT.location,threshold:n=ZT.threshold,distance:r=ZT.distance,includeMatches:i=ZT.includeMatches,findAllMatches:o=ZT.findAllMatches,minMatchCharLength:s=ZT.minMatchCharLength,isCaseSensitive:a=ZT.isCaseSensitive,ignoreLocation:l=ZT.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:o,minMatchCharLength:s,isCaseSensitive:a,ignoreLocation:l},this.pattern=a?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const c=(e,t)=>{this.chunks.push({pattern:e,alphabet:oI(e),startIndex:t})},u=this.pattern.length;if(u>rI){let e=0;const t=u%rI,n=u-t;for(;e<n;)c(this.pattern.substr(e,rI),e),e+=rI;if(t){const e=u-rI;c(this.pattern.substr(e),e)}}else c(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,includeMatches:n}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let t={isMatch:!0,score:0};return n&&(t.indices=[[0,e.length-1]]),t}const{location:r,distance:i,threshold:o,findAllMatches:s,minMatchCharLength:a,ignoreLocation:l}=this.options;let c=[],u=0,d=!1;this.chunks.forEach((({pattern:t,alphabet:p,startIndex:h})=>{const{isMatch:f,score:m,indices:g}=iI(e,t,p,{location:r+h,distance:i,threshold:o,findAllMatches:s,minMatchCharLength:a,includeMatches:n,ignoreLocation:l});f&&(d=!0),u+=m,f&&g&&(c=[...c,...g])}));let p={isMatch:d,score:d?u/this.chunks.length:1};return d&&n&&(p.indices=c),p}}class aI{constructor(e){this.pattern=e}static isMultiMatch(e){return lI(e,this.multiRegex)}static isSingleMatch(e){return lI(e,this.singleRegex)}search(){}}function lI(e,t){const n=e.match(t);return n?n[1]:null}class cI extends aI{constructor(e,{location:t=ZT.location,threshold:n=ZT.threshold,distance:r=ZT.distance,includeMatches:i=ZT.includeMatches,findAllMatches:o=ZT.findAllMatches,minMatchCharLength:s=ZT.minMatchCharLength,isCaseSensitive:a=ZT.isCaseSensitive,ignoreLocation:l=ZT.ignoreLocation}={}){super(e),this._bitapSearch=new sI(e,{location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:o,minMatchCharLength:s,isCaseSensitive:a,ignoreLocation:l})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class uI extends aI{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,n=0;const r=[],i=this.pattern.length;for(;(t=e.indexOf(this.pattern,n))>-1;)n=t+i,r.push([t,n-1]);const o=!!r.length;return{isMatch:o,score:o?0:1,indices:r}}}const dI=[class extends aI{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},uI,class extends aI{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},class extends aI{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends aI{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends aI{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},class extends aI{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},cI],pI=dI.length,hI=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,fI="|";const mI=new Set([cI.type,uI.type]);class gI{constructor(e,{isCaseSensitive:t=ZT.isCaseSensitive,includeMatches:n=ZT.includeMatches,minMatchCharLength:r=ZT.minMatchCharLength,ignoreLocation:i=ZT.ignoreLocation,findAllMatches:o=ZT.findAllMatches,location:s=ZT.location,threshold:a=ZT.threshold,distance:l=ZT.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:n,minMatchCharLength:r,findAllMatches:o,ignoreLocation:i,location:s,threshold:a,distance:l},this.pattern=t?e:e.toLowerCase(),this.query=function(e,t={}){return e.split(fI).map((e=>{let n=e.trim().split(hI).filter((e=>e&&!!e.trim())),r=[];for(let e=0,i=n.length;e<i;e+=1){const i=n[e];let o=!1,s=-1;for(;!o&&++s<pI;){const e=dI[s];let n=e.isMultiMatch(i);n&&(r.push(new e(n,t)),o=!0)}if(!o)for(s=-1;++s<pI;){const e=dI[s];let n=e.isSingleMatch(i);if(n){r.push(new e(n,t));break}}}return r}))}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:r}=this.options;e=r?e:e.toLowerCase();let i=0,o=[],s=0;for(let r=0,a=t.length;r<a;r+=1){const a=t[r];o.length=0,i=0;for(let t=0,r=a.length;t<r;t+=1){const r=a[t],{isMatch:l,indices:c,score:u}=r.search(e);if(!l){s=0,i=0,o.length=0;break}if(i+=1,s+=u,n){const e=r.constructor.type;mI.has(e)?o=[...o,...c]:o.push(c)}}if(i){let e={isMatch:!0,score:s/i};return n&&(e.indices=o),e}}return{isMatch:!1,score:1}}}const bI=[];function yI(e,t){for(let n=0,r=bI.length;n<r;n+=1){let r=bI[n];if(r.condition(e,t))return new r(e,t)}return new sI(e,t)}const vI="$and",wI="$or",_I="$path",xI="$val",EI=e=>!(!e[vI]&&!e[wI]),kI=e=>({[vI]:Object.keys(e).map((t=>({[t]:e[t]})))});function MI(e,t,{auto:n=!0}={}){const r=e=>{let i=Object.keys(e);const o=(e=>!!e[_I])(e);if(!o&&i.length>1&&!EI(e))return r(kI(e));if((e=>!LT(e)&&PT(e)&&!EI(e))(e)){const r=o?e[_I]:i[0],s=o?e[xI]:e[r];if(!jT(s))throw new Error((e=>`Invalid value for key ${e}`)(r));const a={keyId:QT(r),pattern:s};return n&&(a.searcher=yI(s,t)),a}let s={children:[],operator:i[0]};return i.forEach((t=>{const n=e[t];LT(n)&&n.forEach((e=>{s.children.push(r(e))}))})),s};return EI(e)||(e=kI(e)),r(e)}function DI(e,t){const n=e.matches;t.matches=[],UT(n)&&n.forEach((e=>{if(!UT(e.indices)||!e.indices.length)return;const{indices:n,value:r}=e;let i={indices:n,value:r};e.key&&(i.key=e.key.src),e.idx>-1&&(i.refIndex=e.idx),t.matches.push(i)}))}function CI(e,t){t.score=e.score}class SI{constructor(e,t={},n){if(this.options={...ZT,...t},this.options.useExtendedSearch&&!1)throw new Error(WT);this._keyStore=new KT(this.options.keys),this.setCollection(e,n)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof eI))throw new Error(VT);this._myIndex=t||tI(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){UT(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=(()=>!1)){const t=[];for(let n=0,r=this._docs.length;n<r;n+=1){const i=this._docs[n];e(i,n)&&(this.removeAt(n),n-=1,r-=1,t.push(i))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){const{includeMatches:n,includeScore:r,shouldSort:i,sortFn:o,ignoreFieldNorm:s}=this.options;let a=jT(e)?jT(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return function(e,{ignoreFieldNorm:t=ZT.ignoreFieldNorm}){e.forEach((e=>{let n=1;e.matches.forEach((({key:e,norm:r,score:i})=>{const o=e?e.weight:null;n*=Math.pow(0===i&&o?Number.EPSILON:i,(o||1)*(t?1:r))})),e.score=n}))}(a,{ignoreFieldNorm:s}),i&&a.sort(o),RT(t)&&t>-1&&(a=a.slice(0,t)),function(e,t,{includeMatches:n=ZT.includeMatches,includeScore:r=ZT.includeScore}={}){const i=[];return n&&i.push(DI),r&&i.push(CI),e.map((e=>{const{idx:n}=e,r={item:t[n],refIndex:n};return i.length&&i.forEach((t=>{t(e,r)})),r}))}(a,this._docs,{includeMatches:n,includeScore:r})}_searchStringList(e){const t=yI(e,this.options),{records:n}=this._myIndex,r=[];return n.forEach((({v:e,i:n,n:i})=>{if(!UT(e))return;const{isMatch:o,score:s,indices:a}=t.searchIn(e);o&&r.push({item:e,idx:n,matches:[{score:s,value:e,norm:i,indices:a}]})})),r}_searchLogical(e){const t=MI(e,this.options),n=(e,t,r)=>{if(!e.children){const{keyId:n,searcher:i}=e,o=this._findMatches({key:this._keyStore.get(n),value:this._myIndex.getValueForItemAtKeyId(t,n),searcher:i});return o&&o.length?[{idx:r,item:t,matches:o}]:[]}const i=[];for(let o=0,s=e.children.length;o<s;o+=1){const s=e.children[o],a=n(s,t,r);if(a.length)i.push(...a);else if(e.operator===vI)return[]}return i},r=this._myIndex.records,i={},o=[];return r.forEach((({$:e,i:r})=>{if(UT(e)){let s=n(t,e,r);s.length&&(i[r]||(i[r]={idx:r,item:e,matches:[]},o.push(i[r])),s.forEach((({matches:e})=>{i[r].matches.push(...e)})))}})),o}_searchObjectList(e){const t=yI(e,this.options),{keys:n,records:r}=this._myIndex,i=[];return r.forEach((({$:e,i:r})=>{if(!UT(e))return;let o=[];n.forEach(((n,r)=>{o.push(...this._findMatches({key:n,value:e[r],searcher:t}))})),o.length&&i.push({idx:r,item:e,matches:o})})),i}_findMatches({key:e,value:t,searcher:n}){if(!UT(t))return[];let r=[];if(LT(t))t.forEach((({v:t,i:i,n:o})=>{if(!UT(t))return;const{isMatch:s,score:a,indices:l}=n.searchIn(t);s&&r.push({score:a,key:e,value:t,idx:i,norm:o,indices:l})}));else{const{v:i,n:o}=t,{isMatch:s,score:a,indices:l}=n.searchIn(i);s&&r.push({score:a,key:e,value:i,norm:o,indices:l})}return r}}SI.version="6.6.2",SI.createIndex=tI,SI.parseIndex=function(e,{getFn:t=ZT.getFn,fieldNormWeight:n=ZT.fieldNormWeight}={}){const{keys:r,records:i}=e,o=new eI({getFn:t,fieldNormWeight:n});return o.setKeys(r),o.setIndexRecords(i),o},SI.config=ZT,SI.parseQuery=MI,function(...e){bI.push(...e)}(gI);const NI=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.sort(((e,t)=>e.name.localeCompare(t.name)))},AI=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=NI(e);return e=>{let{query:n}=e;if(!n)return t.slice(0,10);const r=new SI(t,{keys:["name"],threshold:.25}).search(n).slice(0,10);return me("item",r)}},OI={render:()=>{let e,t;return{onStart:n=>{e=new Wx(IT,{props:n,editor:n.editor}),t=Ox("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){var r;return"Escape"===n.event.key?(t[0].hide(),!0):null===(r=e.ref)||void 0===r?void 0:r.onKeyDown(n)},onExit(){t[0].destroy(),e.destroy()}}}},TI=OT.extend({addCommands(){return{setMention:e=>{let{id:t,label:n}=e;return e=>{let{chain:r}=e;r().focus().insertContent([{type:this.name,attrs:{id:t,label:n}},{type:"text",text:" "}]).run()}}}}});var II=e=>{let{suggestion:t={},...n}=e;return TI.configure({...n,suggestion:{...OI,...t}})};const LI=Av.create({name:"placeholder",addOptions:()=>({excludeNodeTypes:["variable","codeBlock"],emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!1,includeChildren:!1}),addProseMirrorPlugins(){return[new Em({props:{decorations:e=>{let{doc:t,selection:n}=e;const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,o=[];return r?(t.descendants(((e,t)=>{const n=i>=t&&i<=t+e.nodeSize,r=!e.isLeaf&&!e.childCount,s=this.options.excludeNodeTypes.includes(e.type.name);if((n||!this.options.showOnlyCurrent)&&!s&&r){const n=[this.options.emptyNodeClass];this.editor.isEmpty&&n.push(this.options.emptyEditorClass);const r=ay.node(t,t+e.nodeSize,{class:n.join(" "),"data-placeholder":this.options.placeholder});o.push(r)}return this.options.includeChildren})),uy.create(t,o)):null}}})]}});var FI={exports:{}};
34
+ return function(t){var n=e,r=n.lib,i=r.WordArray,o=r.Hasher,s=n.algo,a=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),l=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),c=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),d=i.create([0,1518500249,1859775393,2400959708,2840853838]),p=i.create([1352829926,1548603684,1836072691,2053994217,0]),h=s.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,s,h,w,_,x,E,k,M,D,C,S=this._hash.words,N=d.words,A=p.words,O=a.words,T=l.words,I=c.words,L=u.words;for(x=o=S[0],E=s=S[1],k=h=S[2],M=w=S[3],D=_=S[4],n=0;n<80;n+=1)C=o+e[t+O[n]]|0,C+=n<16?f(s,h,w)+N[0]:n<32?m(s,h,w)+N[1]:n<48?g(s,h,w)+N[2]:n<64?b(s,h,w)+N[3]:y(s,h,w)+N[4],C=(C=v(C|=0,I[n]))+_|0,o=_,_=w,w=v(h,10),h=s,s=C,C=x+e[t+T[n]]|0,C+=n<16?y(E,k,M)+A[0]:n<32?b(E,k,M)+A[1]:n<48?g(E,k,M)+A[2]:n<64?m(E,k,M)+A[3]:f(E,k,M)+A[4],C=(C=v(C|=0,L[n]))+D|0,x=D,D=M,M=v(k,10),k=E,E=C;C=S[1]+h+M|0,S[1]=S[2]+w+D|0,S[2]=S[3]+_+x|0,S[3]=S[4]+o+E|0,S[4]=S[0]+s+k|0,S[0]=C},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32,t[(r+64>>>9<<4)+14]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,s=0;s<5;s++){var a=o[s];o[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function f(e,t,n){return e^t^n}function m(e,t,n){return e&t|~e&n}function g(e,t,n){return(e|~t)^n}function b(e,t,n){return e&n|t&~n}function y(e,t,n){return e^(t|~n)}function v(e,t){return e<<t|e>>>32-t}n.RIPEMD160=o._createHelper(h),n.HmacRIPEMD160=o._createHmacHelper(h)}(),e.RIPEMD160}(uu())),Yu(),Qu||(Qu=1,Ju.exports=function(e){return function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,o=t.algo,s=o.SHA1,a=o.HMAC,l=o.PBKDF2=r.extend({cfg:r.extend({keySize:128/32,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=a.create(n.hasher,e),o=i.create(),s=i.create([1]),l=o.words,c=s.words,u=n.keySize,d=n.iterations;l.length<u;){var p=r.update(t).finalize(s);r.reset();for(var h=p.words,f=h.length,m=p,g=1;g<d;g++){m=r.finalize(m),r.reset();for(var b=m.words,y=0;y<f;y++)h[y]^=b[y]}o.concat(p),c[0]++}return o.sigBytes=4*u,o}});t.PBKDF2=function(e,t,n){return l.create(n).compute(e,t)}}(),e.PBKDF2}(uu(),Ou(),Yu())),ed(),rd(),sd(),cd(),pd(),md(),gd||(gd=1,bd.exports=function(e){return e.mode.ECB=((t=e.lib.BlockCipherMode.extend()).Encryptor=t.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),t.Decryptor=t.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),t),e.mode.ECB;var t}(uu(),rd())),yd||(yd=1,vd.exports=function(e){return e.pad.AnsiX923={pad:function(e,t){var n=e.sigBytes,r=4*t,i=r-n%r,o=n+i-1;e.clamp(),e.words[o>>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923}(uu(),rd())),wd||(wd=1,_d.exports=function(e){return e.pad.Iso10126={pad:function(t,n){var r=4*n,i=r-t.sigBytes%r;t.concat(e.lib.WordArray.random(i-1)).concat(e.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Iso10126}(uu(),rd())),xd||(xd=1,Ed.exports=function(e){return e.pad.Iso97971={pad:function(t,n){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,n)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971}(uu(),rd())),kd||(kd=1,Md.exports=function(e){return e.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},e.pad.ZeroPadding}(uu(),rd())),Dd||(Dd=1,Cd.exports=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding}(uu(),rd())),Sd||(Sd=1,Nd.exports=function(e){return function(t){var n=e,r=n.lib.CipherParams,i=n.enc.Hex;n.format.Hex={stringify:function(e){return e.ciphertext.toString(i)},parse:function(e){var t=i.parse(e);return r.create({ciphertext:t})}}}(),e.format.Hex}(uu(),rd())),Ad||(Ad=1,Od.exports=function(e){return function(){var t=e,n=t.lib.BlockCipher,r=t.algo,i=[],o=[],s=[],a=[],l=[],c=[],u=[],d=[],p=[],h=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var f=r^r<<1^r<<2^r<<3^r<<4;f=f>>>8^255&f^99,i[n]=f,o[f]=n;var m=e[n],g=e[m],b=e[g],y=257*e[f]^16843008*f;s[n]=y<<24|y>>>8,a[n]=y<<16|y>>>16,l[n]=y<<8|y>>>24,c[n]=y,y=16843009*b^65537*g^257*m^16843008*n,u[f]=y<<24|y>>>8,d[f]=y<<16|y>>>16,p[f]=y<<8|y>>>24,h[f]=y,n?(n=m^e[e[e[b^m]]],r^=e[e[r]]):n=r=1}}();var f=[0,1,2,4,8,16,32,64,128,27,54],m=r.AES=n.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),o=this._keySchedule=[],s=0;s<r;s++)s<n?o[s]=t[s]:(c=o[s-1],s%n?n>6&&s%n==4&&(c=i[c>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c]):(c=i[(c=c<<8|c>>>24)>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c],c^=f[s/n|0]<<24),o[s]=o[s-n]^c);for(var a=this._invKeySchedule=[],l=0;l<r;l++){if(s=r-l,l%4)var c=o[s];else c=o[s-4];a[l]=l<4||s<=4?c:u[i[c>>>24]]^d[i[c>>>16&255]]^p[i[c>>>8&255]]^h[i[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,l,c,i)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,d,p,h,o),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,o,s,a){for(var l=this._nRounds,c=e[t]^n[0],u=e[t+1]^n[1],d=e[t+2]^n[2],p=e[t+3]^n[3],h=4,f=1;f<l;f++){var m=r[c>>>24]^i[u>>>16&255]^o[d>>>8&255]^s[255&p]^n[h++],g=r[u>>>24]^i[d>>>16&255]^o[p>>>8&255]^s[255&c]^n[h++],b=r[d>>>24]^i[p>>>16&255]^o[c>>>8&255]^s[255&u]^n[h++],y=r[p>>>24]^i[c>>>16&255]^o[u>>>8&255]^s[255&d]^n[h++];c=m,u=g,d=b,p=y}m=(a[c>>>24]<<24|a[u>>>16&255]<<16|a[d>>>8&255]<<8|a[255&p])^n[h++],g=(a[u>>>24]<<24|a[d>>>16&255]<<16|a[p>>>8&255]<<8|a[255&c])^n[h++],b=(a[d>>>24]<<24|a[p>>>16&255]<<16|a[c>>>8&255]<<8|a[255&u])^n[h++],y=(a[p>>>24]<<24|a[c>>>16&255]<<16|a[u>>>8&255]<<8|a[255&d])^n[h++],e[t]=m,e[t+1]=g,e[t+2]=b,e[t+3]=y},keySize:256/32});t.AES=n._createHelper(m)}(),e.AES}(uu(),xu(),Su(),ed(),rd())),Ld(),Fd||(Fd=1,zd.exports=function(e){return function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=r.RC4=n.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[],i=0;i<256;i++)r[i]=i;i=0;for(var o=0;i<256;i++){var s=i%n,a=t[s>>>2]>>>24-s%4*8&255;o=(o+r[i]+a)%256;var l=r[i];r[i]=r[o],r[o]=l}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:256/32,ivSize:0});function o(){for(var e=this._S,t=this._i,n=this._j,r=0,i=0;i<4;i++){n=(n+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[n],e[n]=o,r|=e[(e[t]+e[n])%256]<<24-8*i}return this._i=t,this._j=n,r}t.RC4=n._createHelper(i);var s=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});t.RC4Drop=n._createHelper(s)}(),e.RC4}(uu(),xu(),Su(),ed(),rd())),jd||(jd=1,Rd.exports=function(e){return function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=[],o=[],s=[],a=r.Rabbit=n.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)l.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var o=t.words,s=o[0],a=o[1],c=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),d=c>>>16|4294901760&u,p=u<<16|65535&c;for(i[0]^=c,i[1]^=d,i[2]^=u,i[3]^=p,i[4]^=c,i[5]^=d,i[6]^=u,i[7]^=p,n=0;n<4;n++)l.call(this)}},_doProcessBlock:function(e,t){var n=this._X;l.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),e[t+r]^=i[r]},blockSize:128/32,ivSize:64/32});function l(){for(var e=this._X,t=this._C,n=0;n<8;n++)o[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],i=65535&r,a=r>>>16,l=((i*i>>>17)+i*a>>>15)+a*a,c=((4294901760&r)*r|0)+((65535&r)*r|0);s[n]=l^c}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}t.Rabbit=n._createHelper(a)}(),e.Rabbit}(uu(),xu(),Su(),ed(),rd())),Bd||(Bd=1,Pd.exports=function(e){return function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=[],o=[],s=[],a=r.RabbitLegacy=n.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)l.call(this);for(i=0;i<8;i++)r[i]^=n[i+4&7];if(t){var o=t.words,s=o[0],a=o[1],c=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),d=c>>>16|4294901760&u,p=u<<16|65535&c;for(r[0]^=c,r[1]^=d,r[2]^=u,r[3]^=p,r[4]^=c,r[5]^=d,r[6]^=u,r[7]^=p,i=0;i<4;i++)l.call(this)}},_doProcessBlock:function(e,t){var n=this._X;l.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),e[t+r]^=i[r]},blockSize:128/32,ivSize:64/32});function l(){for(var e=this._X,t=this._C,n=0;n<8;n++)o[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],i=65535&r,a=r>>>16,l=((i*i>>>17)+i*a>>>15)+a*a,c=((4294901760&r)*r|0)+((65535&r)*r|0);s[n]=l^c}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}t.RabbitLegacy=n._createHelper(a)}(),e.RabbitLegacy}(uu(),xu(),Su(),ed(),rd())));const Hd=async e=>{const t=await(e=>new Promise(((t,n)=>{const r=new FileReader;r.onload=e=>{const n=Ud.lib.WordArray.create(e.target.result);t(Ud.MD5(n))},r.onerror=()=>n(new Error("Corrupted file")),r.readAsArrayBuffer(e)})))(e);return t.toString(Ud.enc.Base64)};class $d{constructor(e){let{url:t,file:n,progress:r=se}=e;tu(this,"create",(async()=>{const e=await this.generateUrl(),{url:t,headers:n}=e.directUpload;return await this.uploadToCloud(t,n),e})),tu(this,"generateUrl",(async()=>{const e={blob:{filename:this.file.name,byteSize:this.file.size,contentType:this.file.type,checksum:await Hd(this.file)}};return nu(this.url,e)})),tu(this,"abort",(()=>this.abortController.abort())),tu(this,"uploadToCloud",((e,t)=>{const n={headers:t,onUploadProgress:this.progress,signal:this.abortController.signal};return ru(e,this.file,n)})),this.url=t,this.file=n,this.progress=r,this.abortController=new AbortController}}class Wd extends et.exports.BasePlugin{constructor(t,n){super(t,n),tu(this,"upload",(t=>{if(e(t))return Promise.resolve();const n=t.map((e=>this.uploadFile(this.uppy.getFile(e))));return Promise.all(n)})),tu(this,"uploadFile",(async t=>{this.uppy.on("file-removed",(r=>{r.id===t.id&&(n.abort(),e(this.uppy.getFiles())&&this.uppy.emit("complete"))})),this.uppy.on("upload-cancel",(e=>{e===t.id&&n.abort()})),this.uppy.on("cancel-all",(()=>n.abort()));const n=new $d({file:t.data,url:this.opts.directUploadUrl,progress:e=>{e.lengthComputable&&this.uppy.emit("upload-progress",t,{uploader:this,bytesUploaded:e.loaded,bytesTotal:e.total,progress:Math.round(e.loaded/e.total*100)})}});try{const e=await n.create();return this.uppy.setFileState(t.id,{response:{status:"success"}}),this.uppy.emit("upload-success",t,e),t}catch(e){if(!this.uppy.getFile(t.id))return null;throw this.uppy.setFileState(t.id,{response:{status:"error"}}),this.uppy.emit("upload-error",t,e),e}})),this.type="uploader",this.id=n.id||"ActiveStorageUpload",this.title=n.title||"Active Storage Upload"}install(){this.uppy.addUploader(this.upload)}uninstall(){this.uppy.removeUploader(this.upload)}}const Vd=e=>{let{endpoint:t,uppyConfig:n,onSuccess:r=(e=>{})}=e;const[o,s]=i(!1),a=e=>{const{maxFileSize:t}=n.restrictions;return!(e.size>t)||(h.error(`File size is too large. Max size is ${Zc(n.restrictions.maxFileSize)}.`),!1)},l=function(e){if("function"!=typeof e)throw new TypeError("useUppy: expected a function that returns a new Uppy instance");const t=Vc(void 0);if(void 0===t.current&&(t.current=e(),!(t.current instanceof qc)))throw new TypeError(`useUppy: factory function must return an Uppy instance, got ${typeof t.current}`);return Wc((()=>()=>{t.current.close({reason:"unmount"}),t.current=void 0}),[t]),t.current}((()=>new Rr({...n,onBeforeFileAdded:a}).use(Wd,{directUploadUrl:t,...Qc}).on("upload",(()=>s(!0))).on("upload-success",((e,t)=>{let{blobUrl:n}=t;return null==r?void 0:r(n)})).on("cancel-all",(()=>s(!1))).on("complete",(()=>{l.reset(),s(!1)}))));return{uppy:l,isUploading:o}};var qd={exports:{}};!function(e,t){!function(){function t(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}function n(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){a(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function i(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var o="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof Ee&&Ee.global===Ee?Ee:void 0,s=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=o.saveAs||("object"!=typeof window||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(e,t,s){var a=o.URL||o.webkitURL,l=document.createElement("a");t=t||e.name||"download",l.download=t,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?i(l):r(l.href)?n(e,t,s):i(l,l.target="_blank")):(l.href=a.createObjectURL(e),setTimeout((function(){a.revokeObjectURL(l.href)}),4e4),setTimeout((function(){i(l)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,o,s){if(o=o||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(t(e,s),o);else if(r(e))n(e,o,s);else{var a=document.createElement("a");a.href=e,a.target="_blank",setTimeout((function(){i(a)}))}}:function(e,t,r,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof e)return n(e,t,r);var a="application/octet-stream"===e.type,l=/constructor/i.test(o.HTMLElement)||o.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||a&&l||s)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=c?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=e:location=e,i=null},u.readAsDataURL(e)}else{var d=o.URL||o.webkitURL,p=d.createObjectURL(e);i?i.location=p:location.href=p,i=null,setTimeout((function(){d.revokeObjectURL(p)}),4e4)}});o.saveAs=a.saveAs=a,e.exports=a}()}(qd);var Kd=qd.exports;const Gd={autoProceed:!1,allowMultipleUploads:!1,restrictions:{maxFileSize:100*1024*1024}},Yd="Download",Qd="Rename",Jd="Delete";function Zd(){return Zd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zd.apply(this,arguments)}var Xd={grad:.9,turn:360,rad:360/(2*Math.PI)},ep=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},tp=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},np=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},rp=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},ip=function(e){return{r:np(e.r,0,255),g:np(e.g,0,255),b:np(e.b,0,255),a:np(e.a)}},op=function(e){return{r:tp(e.r),g:tp(e.g),b:tp(e.b),a:tp(e.a,3)}},sp=/^#([0-9a-f]{3,8})$/i,ap=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},lp=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),s=o-Math.min(t,n,r),a=s?o===t?(n-r)/s:o===n?2+(r-t)/s:4+(t-n)/s:0;return{h:60*(a<0?a+6:a),s:o?s/o*100:0,v:o/255*100,a:i}},cp=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),s=r*(1-n),a=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),c=o%6;return{r:255*[r,a,s,s,l,r][c],g:255*[l,r,r,a,s,s][c],b:255*[s,s,l,r,r,a][c],a:i}},up=function(e){return{h:rp(e.h),s:np(e.s,0,100),l:np(e.l,0,100),a:np(e.a)}},dp=function(e){return{h:tp(e.h),s:tp(e.s),l:tp(e.l),a:tp(e.a,3)}},pp=function(e){return cp((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},hp=function(e){return{h:(t=lp(e)).h,s:(i=(200-(n=t.s))*(r=t.v)/100)>0&&i<200?n*r/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,n,r,i},fp=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,mp=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,bp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,yp={string:[[function(e){var t=sp.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?tp(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?tp(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=gp.exec(e)||bp.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:ip({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=fp.exec(e)||mp.exec(e);if(!t)return null;var n,r,i=up({h:(n=t[1],r=t[2],void 0===r&&(r="deg"),Number(n)*(Xd[r]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return pp(i)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=void 0===i?1:i;return ep(t)&&ep(n)&&ep(r)?ip({r:Number(t),g:Number(n),b:Number(r),a:Number(o)}):null},"rgb"],[function(e){var t=e.h,n=e.s,r=e.l,i=e.a,o=void 0===i?1:i;if(!ep(t)||!ep(n)||!ep(r))return null;var s=up({h:Number(t),s:Number(n),l:Number(r),a:Number(o)});return pp(s)},"hsl"],[function(e){var t=e.h,n=e.s,r=e.v,i=e.a,o=void 0===i?1:i;if(!ep(t)||!ep(n)||!ep(r))return null;var s=function(e){return{h:rp(e.h),s:np(e.s,0,100),v:np(e.v,0,100),a:np(e.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(o)});return cp(s)},"hsv"]]},vp=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0](e);if(r)return[r,t[n][1]]}return[null,void 0]},wp=function(e,t){var n=hp(e);return{h:n.h,s:np(n.s+100*t,0,100),l:n.l,a:n.a}},_p=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},xp=function(e,t){var n=hp(e);return{h:n.h,s:n.s,l:np(n.l+100*t,0,100),a:n.a}},Ep=function(){function e(e){this.parsed=function(e){return"string"==typeof e?vp(e.trim(),yp.string):"object"==typeof e&&null!==e?vp(e,yp.object):[null,void 0]}(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return tp(_p(this.rgba),2)},e.prototype.isDark=function(){return _p(this.rgba)<.5},e.prototype.isLight=function(){return _p(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=op(this.rgba)).r,n=e.g,r=e.b,o=(i=e.a)<1?ap(tp(255*i)):"","#"+ap(t)+ap(n)+ap(r)+o;var e,t,n,r,i,o},e.prototype.toRgb=function(){return op(this.rgba)},e.prototype.toRgbString=function(){return t=(e=op(this.rgba)).r,n=e.g,r=e.b,(i=e.a)<1?"rgba("+t+", "+n+", "+r+", "+i+")":"rgb("+t+", "+n+", "+r+")";var e,t,n,r,i},e.prototype.toHsl=function(){return dp(hp(this.rgba))},e.prototype.toHslString=function(){return t=(e=dp(hp(this.rgba))).h,n=e.s,r=e.l,(i=e.a)<1?"hsla("+t+", "+n+"%, "+r+"%, "+i+")":"hsl("+t+", "+n+"%, "+r+"%)";var e,t,n,r,i},e.prototype.toHsv=function(){return e=lp(this.rgba),{h:tp(e.h),s:tp(e.s),v:tp(e.v),a:tp(e.a,3)};var e},e.prototype.invert=function(){return kp({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),kp(wp(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),kp(wp(this.rgba,-e))},e.prototype.grayscale=function(){return kp(wp(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),kp(xp(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),kp(xp(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?kp({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):tp(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=hp(this.rgba);return"number"==typeof e?kp({h:e,s:t.s,l:t.l,a:t.a}):tp(t.h)},e.prototype.isEqual=function(e){return this.toHex()===kp(e).toHex()},e}(),kp=function(e){return e instanceof Ep?e:new Ep(e)},Mp=[];var Dp=1/0,Cp="[object Symbol]",Sp="object"==typeof Ee&&Ee&&Ee.Object===Object&&Ee,Np="object"==typeof self&&self&&self.Object===Object&&self,Ap=Sp||Np||Function("return this")(),Op=Object.prototype,Tp=0,Ip=Op.toString,Lp=Ap.Symbol,Fp=Lp?Lp.prototype:void 0,zp=Fp?Fp.toString:void 0;function jp(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&Ip.call(e)==Cp}(e))return zp?zp.call(e):"";var t=e+"";return"0"==t&&1/e==-Dp?"-0":t}var Rp=function(e){var t,n=++Tp;return(null==(t=e)?"":jp(t))+n},Bp={"3d":r.createElement("path",{d:"M18 14.625V3.375L9 0 0 3.375v11.25L9 18l9-3.375zM9 2.136l5.918 2.22-5.98 2.242-5.919-2.22L9 2.137zM2 13.239V5.065l6.438 2.414v8.174L2 13.24zM9.438 15.7L16 13.239V5.018l-6.563 2.46V15.7z",transform:"translate(15 10)",fillRule:"evenodd"}),acrobat:r.createElement("path",{d:"M10.15 1.095C9.938.33 9.42-.051 8.984.005c-.528.068-1.09.382-1.314.876-.63 1.416.685 5.582.887 6.279-1.28 3.863-5.66 11.5-7.806 12.017-.045-.505.225-1.965 3.055-3.785.146-.157.315-.348.393-.472-2.392 1.168-5.492 3.044-3.628 4.448.102.079.259.146.439.213 1.426.528 3.425-1.201 5.435-5.121 2.213-.73 3.999-1.28 6.526-1.662 2.762 1.875 4.616 2.257 5.874 1.774.348-.135.898-.573 1.055-1.145-1.022 1.258-3.414.382-5.323-.82 1.763-.191 3.582-.303 4.369-.056 1 .314.965.808.954.876.079-.27.191-.708-.022-1.056-.842-1.37-4.706-.573-6.11-.427-2.212-1.336-3.74-3.717-4.358-5.436.573-2.212 1.19-3.818.742-5.413zm-.954 4.638C8.826 4.42 8.309 1.5 9.14.556c1.628.932.618 3.144.056 5.177zm3.044 6.514c-2.134.393-3.583.944-5.66 1.764.617-1.202 1.785-4.268 2.346-6.29.787 1.573 1.741 3.111 3.314 4.526z",transform:"translate(14 9)",fillRule:"evenodd"}),audio:r.createElement("path",{d:"M.25 4.75v4.5h3L7 13V1L3.25 4.75h-3zM10.375 7A3.375 3.375 0 0 0 8.5 3.977v6.037A3.355 3.355 0 0 0 10.375 7zM8.5.421v1.545A5.254 5.254 0 0 1 12.25 7a5.254 5.254 0 0 1-3.75 5.032v1.545A6.747 6.747 0 0 0 13.75 7 6.747 6.747 0 0 0 8.5.421z",transform:"translate(17 12)",fillRule:"evenodd"}),binary:r.createElement("path",{d:"M2.338 6.112c1.192 0 1.928-1.072 1.928-2.68 0-1.56-.576-2.504-1.8-2.504C1.274.928.538 2 .538 3.608c0 1.56.576 2.504 1.8 2.504zM1.61 3.408c0-1.008.24-1.568.776-1.568.376 0 .616.336.728.888l-1.504.776v-.096zM2.418 5.2c-.368 0-.608-.32-.72-.856l1.496-.768v.056c0 1.008-.24 1.568-.776 1.568zm7.03.8l.088-.944H8.36V.896L7.272.984v.592l-1.184.112.024.824h1.16v2.544h-1.32V6zm5.199 0l.088-.944h-1.176V.896L12.47.984v.592l-1.184.112.024.824h1.16v2.544h-1.32V6zM4.25 14l.088-.944H3.162v-4.16l-1.088.088v.592L.89 9.688l.024.824h1.16v2.544H.754V14zm5.198 0l.088-.944H8.36v-4.16l-1.088.088v.592l-1.184.112.024.824h1.16v2.544h-1.32V14zm3.287.112c1.192 0 1.928-1.072 1.928-2.68 0-1.56-.576-2.504-1.8-2.504-1.192 0-1.928 1.072-1.928 2.68 0 1.56.576 2.504 1.8 2.504zm-.728-2.704c0-1.008.24-1.568.776-1.568.376 0 .616.336.728.888l-1.504.776v-.096zm.808 1.792c-.368 0-.608-.32-.72-.856l1.496-.768v.056c0 1.008-.24 1.568-.776 1.568z",transform:"translate(16 11)",fillRule:"evenodd"}),code:r.createElement("path",{d:"M4.078 13.67c-1.875-.527-2.812-1.738-2.812-3.634V9.49C1.266 8.437.844 7.911 0 7.911V6.138c.844 0 1.266-.529 1.266-1.586v-.64c.015-.938.257-1.696.726-2.274C2.466 1.06 3.162.64 4.078.38l.492 1.375c-.656.25-.997.95-1.023 2.102v.695c0 1.167-.482 1.99-1.445 2.469.963.479 1.445 1.304 1.445 2.476v.688c.026 1.15.367 1.851 1.023 2.101l-.492 1.383zm7.844 0c1.875-.527 2.812-1.738 2.812-3.634V9.49c0-1.052.422-1.578 1.266-1.578V6.138c-.844 0-1.266-.529-1.266-1.586v-.64c-.015-.938-.257-1.696-.726-2.274-.474-.578-1.17-.998-2.086-1.258l-.492 1.375c.656.25.997.95 1.023 2.102v.695c0 1.167.482 1.99 1.445 2.469-.963.479-1.445 1.304-1.445 2.476v.688c-.026 1.15-.367 1.851-1.023 2.101l.492 1.383z",transform:"translate(16 13)",fillRule:"evenodd"}),code2:r.createElement("path",{d:"M7.4 10.6L2.8 6l4.6-4.6L6 0 0 6l6 6 1.4-1.4zm5.2 0L17.2 6l-4.6-4.6L14 0l6 6-6 6-1.4-1.4z",transform:"translate(14 14)",fillRule:"evenodd"}),compressed:r.createElement("path",{d:"M.25 0A.25.25 0 0 0 0 .25v1.5c0 .138.112.25.25.25h1.5A.25.25 0 0 0 2 1.75V.25A.25.25 0 0 0 1.75 0H.25zM1 17a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1H1zm0 4v3h2v-3H1zM2 2.25A.25.25 0 0 1 2.25 2h1.5a.25.25 0 0 1 .25.25v1.5a.25.25 0 0 1-.25.25h-1.5A.25.25 0 0 1 2 3.75v-1.5zM.25 4a.25.25 0 0 0-.25.25v1.5c0 .138.112.25.25.25h1.5A.25.25 0 0 0 2 5.75v-1.5A.25.25 0 0 0 1.75 4H.25zM2 6.25A.25.25 0 0 1 2.25 6h1.5a.25.25 0 0 1 .25.25v1.5a.25.25 0 0 1-.25.25h-1.5A.25.25 0 0 1 2 7.75v-1.5zM.25 8a.25.25 0 0 0-.25.25v1.5c0 .138.112.25.25.25h1.5A.25.25 0 0 0 2 9.75v-1.5A.25.25 0 0 0 1.75 8H.25zM2 10.25a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25v1.5a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25v-1.5zM.25 12a.25.25 0 0 0-.25.25v1.5c0 .138.112.25.25.25h1.5a.25.25 0 0 0 .25-.25v-1.5a.25.25 0 0 0-.25-.25H.25zM2 14.25a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25v1.5a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25v-1.5z",transform:"translate(15 1)",fillRule:"evenodd"}),document:r.createElement("path",{d:"M12 4H0v2h12V4zM0 10h18V8H0v2zM0 0v2h18V0H0z",transform:"translate(15 15)",fillRule:"evenodd"}),drive:r.createElement("path",{d:"M2.199.289A.5.5 0 0 1 2.652 0h8.696a.5.5 0 0 1 .453.289l1.867 4a.5.5 0 0 1-.453.711H.785a.5.5 0 0 1-.453-.711l1.867-4zM13 6H1a.752.752 0 0 0-.75.75v4.5c0 .412.338.75.75.75h12c.412 0 .75-.338.75-.75v-4.5A.752.752 0 0 0 13 6zm-9.75 4.5c-.825 0-1.5-.675-1.5-1.5s.675-1.5 1.5-1.5 1.5.675 1.5 1.5-.675 1.5-1.5 1.5z",transform:"translate(17 13)",fillRule:"evenodd"}),font:r.createElement("path",{d:"M3.722 8.702l-.686 1.89c-.053.14-.094.28-.123.421-.03.135-.044.252-.044.352 0 .304.097.527.29.668.2.14.501.21.905.21h.414V13H.083v-.756h.343c.176 0 .325-.018.448-.053a.81.81 0 0 0 .334-.22c.1-.105.193-.249.281-.43.094-.182.197-.416.308-.704L5.787.15h1.406l4.07 11.136c.07.187.14.343.21.466.077.123.165.222.264.298.1.07.214.12.343.15.129.03.281.044.457.044h.237V13H7.826v-.756h.413c.72 0 1.081-.287 1.081-.862 0-.1-.014-.202-.044-.307a3.274 3.274 0 0 0-.105-.36l-.72-2.013H3.72zM7.009 4.65c-.188-.533-.36-1.031-.519-1.494a15.92 15.92 0 0 1-.378-1.354 7.12 7.12 0 0 1-.15.633 16.95 16.95 0 0 1-.395 1.283c-.082.229-.175.484-.28.765L4.063 7.796h4.061L7.009 4.65zm8.411 5.74c0 .562.117.984.351 1.265.24.275.61.413 1.108.413.363 0 .691-.059.984-.176.3-.117.551-.284.756-.5.211-.218.372-.481.483-.792.112-.31.168-.656.168-1.037V8.104l-1.152.053c-.51.023-.937.088-1.283.193-.34.1-.615.243-.826.43a1.546 1.546 0 0 0-.457.678c-.088.27-.132.58-.132.931zm2.18-6.32c-.346 0-.627.05-.844.15a1.182 1.182 0 0 0-.501.404 1.594 1.594 0 0 0-.237.624c-.041.24-.062.5-.062.782-.498 0-.879-.085-1.143-.255-.257-.17-.386-.463-.386-.879 0-.31.085-.574.255-.79.17-.218.401-.393.694-.528.299-.14.644-.243 1.037-.308a7.76 7.76 0 0 1 1.257-.097c.55 0 1.031.056 1.441.167.41.106.753.282 1.029.528.275.246.48.568.615.967.14.392.21.876.21 1.45v4.667c0 .252.021.46.062.624a.928.928 0 0 0 .194.395c.088.1.202.17.343.211.146.041.319.062.518.062h.053V13H19.7l-.281-1.547h-.15c-.187.252-.369.483-.544.694-.176.211-.37.393-.58.545-.211.152-.452.27-.721.352a3.053 3.053 0 0 1-.958.131c-.399 0-.77-.058-1.116-.175a2.369 2.369 0 0 1-.888-.519 2.516 2.516 0 0 1-.58-.896c-.14-.364-.211-.791-.211-1.284 0-.955.34-1.664 1.02-2.127.68-.462 1.707-.714 3.084-.755l1.495-.053V6.285a6.93 6.93 0 0 0-.053-.888 1.778 1.778 0 0 0-.229-.703 1.14 1.14 0 0 0-.51-.457c-.216-.111-.51-.167-.878-.167z",transform:"translate(13 12)",fillRule:"evenodd"}),image:r.createElement("path",{d:"M13 0L9.25 5l2.85 3.8-1.6 1.2C8.81 7.75 6 4 6 4l-6 8h22L13 0z",transform:"translate(13 14)",fillRule:"evenodd"}),presentation:r.createElement("path",{d:"M2 4H0v10c0 1.1.9 2 2 2h14v-2H2V4zm16-4H6C4.9 0 4 .9 4 2v8c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V2c0-1.1-.9-2-2-2zm0 10H6V2h12v8z",transform:"matrix(-1 0 0 1 34 12)",fillRule:"evenodd"}),settings:r.createElement("path",{d:"M13.572 8.735c.03-.24.053-.48.053-.735s-.023-.495-.053-.735l1.583-1.237a.378.378 0 0 0 .09-.48l-1.5-2.595a.377.377 0 0 0-.457-.165l-1.868.75a5.48 5.48 0 0 0-1.268-.735L9.868.815A.366.366 0 0 0 9.5.5h-3a.366.366 0 0 0-.367.315l-.285 1.988a5.762 5.762 0 0 0-1.268.735l-1.868-.75a.366.366 0 0 0-.457.165l-1.5 2.595a.37.37 0 0 0 .09.48l1.583 1.237c-.03.24-.053.488-.053.735 0 .248.022.495.053.735L.845 9.973a.378.378 0 0 0-.09.48l1.5 2.595c.09.165.292.225.458.165l1.867-.75c.39.3.81.547 1.268.735l.285 1.987c.022.18.18.315.367.315h3a.366.366 0 0 0 .367-.315l.285-1.988a5.762 5.762 0 0 0 1.268-.734l1.867.75c.173.067.368 0 .458-.165l1.5-2.595a.378.378 0 0 0-.09-.48l-1.582-1.238zM8 10.625A2.628 2.628 0 0 1 5.375 8 2.628 2.628 0 0 1 8 5.375 2.628 2.628 0 0 1 10.625 8 2.628 2.628 0 0 1 8 10.625z",transform:"translate(16 11)",fillRule:"evenodd"}),spreadsheet:r.createElement("path",{d:"M0 8h6V5H0v3zm0 5h6v-3H0v3zM0 3h6V0H0v3zm8 5h12V5H8v3zm0 5h12v-3H8v3zM8 0v3h12V0H8z",transform:"translate(14 14)",fillRule:"evenodd"}),vector:r.createElement("path",{d:"M14.5 2V1a1 1 0 0 0-1-1h-3a1 1 0 0 0-1 1v1H3.937a2 2 0 1 0 0 1h3.936A9 9 0 0 0 3 11v1h2v-1a7.003 7.003 0 0 1 4.594-6.576A1 1 0 0 0 10.5 5h3a1 1 0 0 0 .906-.576A7.003 7.003 0 0 1 19 11v1h2v-1a9 9 0 0 0-4.873-8h3.936a2 2 0 1 0 0-1H14.5zm-1-1h-3v3h3V1zM2 1.5a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm19 1a1 1 0 1 0 2 0 1 1 0 0 0-2 0z",transform:"translate(12 14)",fillRule:"evenodd"}),video:r.createElement("path",{d:"M10.75 3.875V1.25A.752.752 0 0 0 10 .5H1a.752.752 0 0 0-.75.75v7.5c0 .412.338.75.75.75h9c.412 0 .75-.338.75-.75V6.125l3 3V.875l-3 3z",transform:"translate(17 14)"})};!function(e){e.forEach((function(e){Mp.indexOf(e)<0&&(e(Ep,yp),Mp.push(e))}))}([function(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var i in n)r[n[i]]=i;var o={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var i,s,a=r[this.toHex()];if(a)return a;if(null==t?void 0:t.closest){var l=this.toRgb(),c=1/0,u="black";if(!o.length)for(var d in n)o[d]=new e(n[d]).toRgb();for(var p in n){var h=(i=l,s=o[p],Math.pow(i.r-s.r,2)+Math.pow(i.g-s.g,2)+Math.pow(i.b-s.b,2));h<c&&(c=h,u=p)}return u}},t.string.push([function(t){var r=t.toLowerCase(),i="transparent"===r?"#0000":n[r];return i?new e(i).toRgb():null},"name"])}]);var Pp={color:yl.exports.string,extension:yl.exports.string,fold:yl.exports.bool,foldColor:yl.exports.string,glyphColor:yl.exports.string,gradientColor:yl.exports.string,gradientOpacity:yl.exports.number,labelColor:yl.exports.string,labelTextColor:yl.exports.string,labelUppercase:yl.exports.bool,radius:yl.exports.number,type:yl.exports.oneOf(["3d","acrobat","audio","binary","code","code2","compressed","document","drive","font","image","presentation","settings","spreadsheet","vector","video"])},Up=40,Hp=48,$p={WIDTH:Up,HEIGHT:Hp,X_OFFSET:0},Wp=12,Vp=14,qp=function(e){var t=e.color,n=void 0===t?"whitesmoke":t,i=e.extension,o=e.fold,s=void 0===o||o,a=e.foldColor,l=e.glyphColor,c=e.gradientColor,u=void 0===c?"white":c,d=e.gradientOpacity,p=void 0===d?.25:d,h=e.labelColor,f=e.labelTextColor,m=void 0===f?"white":f,g=e.labelUppercase,b=void 0!==g&&g,y=e.radius,v=void 0===y?4:y,w=e.type,_=Rp();return r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 "+Up+" "+Hp,width:"100%",style:{maxWidth:"100%"}},r.createElement("defs",null,r.createElement("clipPath",{id:"pageRadius"+_},r.createElement("rect",{x:$p.X_OFFSET,y:"0",rx:v,ry:v,width:$p.WIDTH,height:$p.HEIGHT})),r.createElement("clipPath",{id:"foldCrop"},r.createElement("rect",{width:$p.WIDTH,height:Wp,transform:"rotate(-45 0 "+Wp+")"})),r.createElement("linearGradient",{x1:"100%",y1:"0%",y2:"100%",id:"pageGradient"+_},r.createElement("stop",{stopColor:u,stopOpacity:p,offset:"0%"}),r.createElement("stop",{stopColor:u,stopOpacity:"0",offset:"66.67%"}))),r.createElement("g",{id:"file",clipPath:"url(#pageRadius"+_+")"},s?r.createElement(r.Fragment,null,r.createElement("path",{d:"M"+$p.X_OFFSET+" 0 h "+($p.WIDTH-Wp)+" L "+($p.WIDTH+$p.X_OFFSET)+" "+Wp+" v "+($p.HEIGHT-Wp)+" H "+$p.X_OFFSET+" Z",fill:n}),r.createElement("path",{d:"M"+$p.X_OFFSET+" 0 h "+($p.WIDTH-Wp)+" L "+($p.WIDTH+$p.X_OFFSET)+" "+Wp+" v "+($p.HEIGHT-Wp)+" H "+$p.X_OFFSET+" Z",fill:"url(#pageGradient"+_+")"})):r.createElement(r.Fragment,null,r.createElement("rect",{x:$p.X_OFFSET,y:"0",width:$p.WIDTH,height:$p.HEIGHT,fill:n}),r.createElement("rect",{x:$p.X_OFFSET,y:"0",width:$p.WIDTH,height:$p.HEIGHT,fill:"url(#pageGradient"+_+")"}))),s&&r.createElement("g",{transform:"translate(28 "+Wp+") rotate(-90)"},r.createElement("rect",{width:$p.WIDTH,height:$p.HEIGHT,fill:a||kp(n).darken(.1).toHex(),rx:v,ry:v,clipPath:"url(#foldCrop)"})),i&&r.createElement(r.Fragment,null,r.createElement("g",{id:"label"},r.createElement("rect",{fill:h||kp(n).darken(.3).toHex(),x:$p.X_OFFSET,y:$p.HEIGHT-Vp,width:$p.WIDTH,height:Vp,clipPath:"url(#pageRadius"+_+")"})),r.createElement("g",{id:"labelText",transform:"translate("+$p.X_OFFSET+" 34)"},r.createElement("text",{x:$p.WIDTH/2,y:"10",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontSize:"9",fill:m,textAnchor:"middle",style:{fontWeight:"bold",textAlign:"center",pointerEvents:"none",textTransform:b?"uppercase":"none",userSelect:"none"}},i))),w&&r.createElement("g",{transform:"translate(-4 "+(i?0:6)+")",fill:l||kp(n).darken(.15).toHex()},Bp[w]))};qp.propTypes=Pp;var Kp={"3dm":{labelColor:"#8D1A11",type:"3d"},"3ds":{labelColor:"#5FB9AD",type:"3d"},"3g2":{type:"video"},"3gp":{type:"video"},"7zip":{type:"compressed"},aac:{type:"audio"},aep:{type:"video"},ai:{color:"#423325",gradientOpacity:0,labelColor:"#423325",labelTextColor:"#FF7F18",labelUppercase:!0,foldColor:"#FF7F18",radius:2},aif:{type:"audio"},aiff:{type:"audio"},asf:{type:"video"},asp:{type:"code"},aspx:{type:"code"},avi:{type:"video"},bin:{type:"binary"},bmp:{type:"image"},c:{type:"code"},cpp:{type:"code"},cs:{type:"code"},css:{type:"code"},csv:{type:"spreadsheet"},cue:{type:"document"},dll:{type:"settings"},dmg:{type:"drive"},doc:{color:"#2C5898",foldColor:"#254A80",glyphColor:"rgba(255,255,255,0.4)",labelColor:"#2C5898",labelUppercase:!0,type:"document"},docx:{color:"#2C5898",foldColor:"#254A80",glyphColor:"rgba(255,255,255,0.4)",labelColor:"#2C5898",labelUppercase:!0,type:"document"},dwg:{type:"vector"},dxf:{type:"vector"},eot:{type:"font"},eps:{type:"vector"},exe:{type:"settings"},flac:{type:"audio"},flv:{type:"video"},fnt:{type:"font"},fodp:{type:"presentation"},fods:{type:"spreadsheet"},fodt:{type:"document"},fon:{type:"font"},gif:{type:"image"},gz:{type:"compressed"},htm:{type:"code"},html:{type:"code"},indd:{color:"#4B2B36",gradientOpacity:0,labelColor:"#4B2B36",labelTextColor:"#FF408C",labelUppercase:!0,foldColor:"#FF408C",radius:2},ini:{type:"settings"},java:{type:"code"},jpeg:{type:"image"},jpg:{type:"image"},js:{labelColor:"#F7DF1E",type:"code"},json:{type:"code"},jsx:{labelColor:"#00D8FF",type:"code"},m4a:{type:"audio"},m4v:{type:"video"},max:{labelColor:"#5FB9AD",type:"3d"},md:{type:"document"},mid:{type:"audio"},mkv:{type:"video"},mov:{type:"video"},mp3:{type:"audio"},mp4:{type:"video"},mpeg:{type:"video"},mpg:{type:"video"},obj:{type:"3d"},odp:{type:"presentation"},ods:{type:"spreadsheet"},odt:{type:"document"},ogg:{type:"audio"},ogv:{type:"video"},otf:{type:"font"},pdf:{labelColor:"#D93831",type:"acrobat"},php:{labelColor:"#8892BE",type:"code"},pkg:{type:"3d"},plist:{type:"settings"},png:{type:"image"},ppt:{color:"#D14423",foldColor:"#AB381D",glyphColor:"rgba(255,255,255,0.4)",labelColor:"#D14423",labelUppercase:!0,type:"presentation"},pptx:{color:"#D14423",foldColor:"#AB381D",glyphColor:"rgba(255,255,255,0.4)",labelColor:"#D14423",labelUppercase:!0,type:"presentation"},pr:{type:"video"},ps:{type:"vector"},psd:{color:"#34364E",gradientOpacity:0,labelColor:"#34364E",labelTextColor:"#31C5F0",labelUppercase:!0,foldColor:"#31C5F0",radius:2},py:{labelColor:"#FFDE57",type:"code"},rar:{type:"compressed"},rb:{labelColor:"#BB271A",type:"code"},rm:{type:"video"},rtf:{type:"document"},scss:{labelColor:"#C16A98",type:"code"},sitx:{type:"compressed"},svg:{type:"vector"},swf:{type:"video"},sys:{type:"settings"},tar:{type:"compressed"},tex:{type:"document"},tif:{type:"image"},tiff:{type:"image"},ts:{labelColor:"#3478C7",type:"code"},ttf:{type:"font"},txt:{type:"document"},wav:{type:"audio"},webm:{type:"video"},wmv:{type:"video"},woff:{type:"font"},wpd:{type:"document"},wps:{type:"document"},xlr:{type:"spreadsheet"},xls:{color:"#1A754C",foldColor:"#16613F",glyphColor:"rgba(255,255,255,0.4)",labelColor:"#1A754C",labelUppercase:!0,type:"spreadsheet"},xlsx:{color:"#1A754C",foldColor:"#16613F",glyphColor:"rgba(255,255,255,0.4)",labelColor:"#1A754C",labelUppercase:!0,type:"spreadsheet"},yml:{type:"code"},zip:{type:"compressed"},zipx:{type:"compressed"}};const Gp=e=>{let{fileName:t}=e;const n=t.match(/([^.]+)$/)[1];return r.createElement("div",{className:"ne-attachments__attachment-file-icon"},r.createElement(qp,Zd({},Kp[n],{extension:n})))},{Menu:Yp,MenuItem:Qp}=y,Jp=t=>{let{attachment:n,endpoint:o,onChange:s,attachments:a,disabled:l}=t;const[c,u]=i(!1),[d,p]=i(!1),[w,_]=i(!1),[x,E]=i(""),k=async()=>{_(!0);try{const{signedId:e}=n;await ou(o,e),s(a.filter((t=>t.signedId!==e)))}catch(e){h.error(e)}},M={[Yd]:()=>{Kd(n.url,n.fileName)},[Qd]:async()=>{try{const{signedId:e}=n,t={blob:{filename:x}},{blob:{filename:r}}=await iu(o,e,t);s(a.map((t=>t.signedId===e?ce("filename",r,t):t)))}catch(e){h.error(e)}finally{u(!1),E("")}},[Jd]:k};return r.createElement(r.Fragment,null,r.createElement("div",{className:"ne-attachments__attachment"},c?r.createElement(r.Fragment,null,r.createElement(f,{content:x,position:"top"},r.createElement(m,{autoFocus:!0,error:e(x)?"Filename cannot be empty":"",value:x,onChange:e=>E(e.target.value),onKeyDown:t=>(t=>{let{event:n,key:r}=t;n.preventDefault();const i=M[r];"Enter"===n.key&&i&&!e(x)&&i(),"Escape"===n.key&&(u(!1),E(""))})({event:t,key:Qd})})),r.createElement(g,{icon:N,size:"small",style:"text",onClick:()=>u(!1)})):r.createElement(r.Fragment,null,r.createElement(Gp,{fileName:n.filename}),r.createElement(f,{content:n.filename,position:"top"},r.createElement(b,{style:"body2"},n.filename)),r.createElement(f,{content:"You are not permitted to update or delete attachments",disabled:!l,position:"top"},r.createElement("span",null,r.createElement(y,{buttonStyle:"text",disabled:l,icon:A},r.createElement(Yp,null,Object.entries(M).map((e=>{let[t,i]=e;return r.createElement(Qp.Button,{key:t,onClick:()=>(e=>{let{key:t,handler:r}=e;t===Qd?(u(!0),E(n.filename)):t===Jd?(E(n.filename),p(!0)):r()})({key:t,handler:i})},t)})))))))),r.createElement(v,{isOpen:d,isSubmitting:w,message:`Are you sure you want to remove ${x}?`,title:"Remove Attachment?",onClose:()=>p(!1),onSubmit:k}))},Zp=e=>{let{attachment:t,uppy:n,removeUploadingFile:i}=e;const o=`${t.progress}%`;return r.createElement("div",{className:"ne-attachments__attachment"},r.createElement(O,{className:"ne-attachments__attachment__progress-icon",size:16}),r.createElement("div",{className:"ne-attachments__attachment__progress"},r.createElement(b,{style:"body2"},t.filename),r.createElement(b,{style:"body2"},o)),r.createElement(g,{icon:N,size:"small",style:"text",onClick:()=>{n.removeFile(t.id),i(t.id)}}))},Xp=(e,n)=>{let{endpoint:l=Ye,attachments:c=[],className:u="",onChange:d=(e=>{}),isIndependent:p=!0,disabled:f=!1,dragDropRef:m=null}=e;const[b,y]=i([]),v=o(null),{uppy:w,isUploading:_}=Vd({endpoint:l,uppyConfig:Gd}),x=()=>{const e=w.getFiles().map((e=>({id:e.id,filename:e.name,signedId:"awaiting",url:"",progress:0})));y((t=>[...t,...e])),v.current.value=null,E()},E=async()=>{try{const e=await w.upload();if(t(e))return;const n=e.successful.map((e=>({filename:e.name,signedId:e.response.signedId,url:e.response.blobUrl})));y([]),d([...c,...n])}catch(e){h.error(e)}},k=(e,t)=>{y((n=>n.map((n=>({...n,progress:n.filename!==e.name?n.progress:t.progress})))))},M=e=>{y((t=>t.filter((t=>t.id!==e))))},D=()=>v.current.click();return s(n,(()=>({handleUploadAttachments:D})),[]),a((()=>(w.on("upload-progress",k),null!=m&&m.current&&w.use($e,{target:m.current,onDrop:x}),()=>{w.off("upload-progress",k)})),[]),r.createElement("div",{className:qe("ne-attachments",{[u]:u})},r.createElement("div",{className:"ne-attachments__items"},c.map((e=>r.createElement(Jp,{attachment:e,attachments:c,disabled:f,endpoint:l,key:e.signedId,onChange:d}))),b.map((e=>r.createElement(Zp,{attachment:e,key:e.id,removeUploadingFile:M,uppy:w})))),r.createElement("div",null,p&&r.createElement(g,{disabled:_,label:"Add attachments",loading:_,size:"medium",style:"link",onClick:D}),r.createElement("input",{multiple:!0,disabled:_,ref:v,type:"file",onChange:e=>{Array.from(e.target.files).forEach((e=>{w.addFile({name:e.name,type:e.type,data:e})})),x()}})))};var eh=r.forwardRef(Xp);function th(e){this.content=e}function nh(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let e=0;i.text[e]==o.text[e];e++)n++;return n}if(i.content.size||o.content.size){let e=nh(i.content,o.content,n+1);if(null!=e)return e}n+=i.nodeSize}else n+=i.nodeSize}}function rh(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let s=e.child(--i),a=t.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e<t&&s.text[s.text.length-e-1]==a.text[a.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let e=rh(s.content,a.content,n-1,r-1);if(e)return e}n-=l,r-=l}else n-=l,r-=l}}th.prototype={constructor:th,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return-1==i?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new th(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new th(n)},addToStart:function(e,t){return new th([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new th(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(-1==o?i.length:o,0,t,n),new th(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=th.from(e)).size?new th(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=th.from(e)).size?new th(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=th.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach((function(t,n){e[t]=n})),e},get size(){return this.content.length>>1}},th.from=function(e){if(e instanceof th)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new th(t)};class ih{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,((s,a)=>{s.isText?(i+=s.text.slice(Math.max(e,a)-a,t-a),o=!n):s.isLeaf?(r?i+="function"==typeof r?r(s):r:s.type.spec.leafText&&(i+=s.type.spec.leafText(s)),o=!n):!o&&s.isBlock&&(i+=n,o=!0)}),0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new ih(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,o=0;o<t;i++){let s=this.content[i],a=o+s.nodeSize;a>e&&((o<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=a}return new ih(n,r)}cutByIndex(e,t){return e==t?ih.empty:0==e&&t==this.content.length?this:new ih(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new ih(r,i)}addToStart(e){return new ih([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ih(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return nh(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return rh(this,e,t,n)}findIndex(e,t=-1){if(0==e)return sh(0,e);if(e==this.size)return sh(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?sh(n+1,i):sh(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return ih.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new ih(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ih.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new ih(t||e,n)}static from(e){if(!e)return ih.empty;if(e instanceof ih)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new ih([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}ih.empty=new ih([],0);const oh={index:0,offset:0};function sh(e,t){return oh.index=e,oh.offset=t,oh}function ah(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!ah(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!ah(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class lh{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ah(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return lh.none;if(e instanceof lh)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}}lh.none=[];class ch extends Error{}class uh{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=ph(this.content,e+this.openStart,t);return n&&new uh(n,this.openStart,this.openEnd)}removeBetween(e,t){return new uh(dh(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return uh.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new uh(ih.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new uh(e,n,r)}}function dh(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(dh(o.content,t-i-1,n-i-1)))}function ph(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=ph(s.content,t-o-1,n);return a&&e.replaceChild(i,s.copy(a))}function hh(e,t,n){if(n.openStart>e.depth)throw new ch("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ch("Inconsistent open depths");return fh(e,t,n,0)}function fh(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let s=fh(e,t,n,r+1);return o.copy(o.content.replaceChild(i,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:i,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(ih.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return vh(o,wh(e,i,s,t,r))}{let r=e.parent,i=r.content;return vh(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}}return vh(o,_h(e,t,r))}function mh(e,t){if(!t.type.compatibleContent(e.type))throw new ch("Cannot join "+t.type.name+" onto "+e.type.name)}function gh(e,t,n){let r=e.node(n);return mh(r,t.node(n)),r}function bh(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function yh(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(bh(e.nodeAfter,r),o++));for(let e=o;e<s;e++)bh(i.child(e),r);t&&t.depth==n&&t.textOffset&&bh(t.nodeBefore,r)}function vh(e,t){if(!e.type.validContent(t))throw new ch("Invalid content for node "+e.type.name);return e.copy(t)}function wh(e,t,n,r,i){let o=e.depth>i&&gh(e,t,i+1),s=r.depth>i&&gh(n,r,i+1),a=[];return yh(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(mh(o,s),bh(vh(o,wh(e,t,n,r,i+1)),a)):(o&&bh(vh(o,_h(e,t,i+1)),a),yh(t,n,i,a),s&&bh(vh(s,_h(n,r,i+1)),a)),yh(r,null,i,a),new ih(a)}function _h(e,t,n){let r=[];if(yh(null,e,n,r),e.depth>n){bh(vh(gh(e,t,n+1),_h(e,t,n+1)),r)}return yh(t,null,n,r),new ih(r)}uh.empty=new uh(ih.empty,0,0);class xh{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return lh.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Dh(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(i),s=i-o;if(n.push(t,e,r+o),!s)break;if(t=t.child(e),t.isText)break;i=s-1,r+=o+1}return new xh(t,n,i)}static resolveCached(e,t){for(let n=0;n<Eh.length;n++){let r=Eh[n];if(r.pos==t&&r.doc==e)return r}let n=Eh[kh]=xh.resolve(e,t);return kh=(kh+1)%Mh,n}}let Eh=[],kh=0,Mh=12;class Dh{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Ch=Object.create(null);class Sh{constructor(e,t,n,r=lh.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||ih.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&ah(this.attrs,t||e.defaultAttrs||Ch)&&lh.sameSet(this.marks,n||lh.none)}copy(e=null){return e==this.content?this:new Sh(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Sh(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return uh.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o),a=r.node(o).content.cut(r.pos-s,i.pos-s);return new uh(a,r.depth-o,i.depth-o)}replace(e,t,n){return hh(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return xh.resolveCached(this,e)}resolveNoCache(e){return xh.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Ah(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=ih.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){if(!this.type.validContent(this.content))throw new RangeError(`Invalid content for node ${this.type.name}: ${this.content.toString().slice(0,50)}`);let e=lh.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!lh.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e=>e.type.name))}`);this.content.forEach((e=>e.check()))}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=ih.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}Sh.prototype.text=void 0;class Nh extends Sh{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ah(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Nh(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Nh(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Ah(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Oh{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new Th(e,t);if(null==n.next)return Oh.empty;let r=Ih(n);n.next&&n.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return n(Bh(e,0));function n(r){let i=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Bh(e,n).forEach((e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let o=t[r.join(",")]=new Oh(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Rh);o.next.push({type:i[e][0],next:t[r.join(",")]||n(r)})}return o}}(function(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach((e=>e.to=t))}function o(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(o(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),i(o(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return i(o(e.expr,t),s),i(o(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(o(e.expr,t));if("range"==e.type){let s=t;for(let t=0;t<e.min;t++){let t=n();i(o(e.expr,s),t),s=t}if(-1==e.max)i(o(e.expr,s),s);else for(let t=e.min;t<e.max;t++){let t=n();r(s,t),i(o(e.expr,s),t),s=t}return[r(s)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=o(e.exprs[r],t);if(r==e.exprs.length-1)return s;i(s,t=n())}}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),!i||n.isText||n.hasRequiredAttrs()||(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,n),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function i(o,s){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return ih.from(s.map((e=>e.createAndFill())));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=i(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map(((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r})).join("\n")}}Oh.empty=new Oh(!0);class Th{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Ih(e){let t=[];do{t.push(Lh(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function Lh(e){let t=[];do{t.push(Fh(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Fh(e){let t=function(e){if(e.eat("(")){let t=Ih(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.groups.indexOf(t)>-1&&i.push(r)}0==i.length&&e.err("No node type or group '"+t+"' found");return i}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=jh(e,t)}return t}function zh(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function jh(e,t){let n=zh(e),r=n;return e.eat(",")&&(r="}"!=e.next?zh(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function Rh(e,t){return t-e}function Bh(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(Rh)}function Ph(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Uh(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=t.default}n[r]=i}return n}function Hh(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new Wh(e[n]);return t}class $h{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=Hh(n.attrs),this.defaultAttrs=Ph(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Oh.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Uh(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Sh(this,this.computeAttrs(e),ih.from(t),lh.setFrom(n))}createChecked(e=null,t,n){if(t=ih.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new Sh(this,this.computeAttrs(e),t,lh.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=ih.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(ih.empty,!0);return i?new Sh(this,e,t.append(i),lh.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:lh.none:e}static compile(e,t){let n=Object.create(null);e.forEach(((e,r)=>n[e]=new $h(e,t,r)));let r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class Wh{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Vh{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Hh(r.attrs),this.excluded=null;let i=Ph(this.attrs);this.instance=i?new lh(this,i):null}create(e=null){return!e&&this.instance?this.instance:new lh(this,Uh(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,i)=>n[e]=new Vh(e,r++,t,i))),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class qh{constructor(e){this.cached=Object.create(null),this.spec={nodes:th.from(e.nodes),marks:th.from(e.marks||{}),topNode:e.topNode},this.nodes=$h.compile(this.spec.nodes,this),this.marks=Vh.compile(this.spec.marks,this);let t=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new RangeError(e+" can not be both a node and a mark");let n=this.nodes[e],r=n.spec.content||"",i=n.spec.marks;n.contentMatch=t[r]||(t[r]=Oh.parse(r,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.markSet="_"==i?null:i?Kh(this,i.split(" ")):""!=i&&n.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:Kh(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof $h))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Nh(n,n.defaultAttrs,e,lh.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Sh.fromJSON(this,e)}markFromJSON(e){return lh.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Kh(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Gh{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((e=>{e.tag?this.tags.push(e):e.style&&this.styles.push(e)})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e,t={}){let n=new rf(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new rf(this,t,!0);return n.addAll(e,t.from,t.to),uh.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(of(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(!(0!=o.indexOf(e)||r.context&&!n.matchesContext(r.context)||o.length>e.length&&(61!=o.charCodeAt(e.length)||o.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach((e=>{n(e=sf(e)),e.mark=t}))}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach((e=>{n(e=sf(e)),e.node=t}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Gh(e,Gh.schemaRules(e)))}}const Yh={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Qh={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Jh={ol:!0,ul:!0},Zh=1,Xh=2,ef=4;function tf(e,t,n){return null!=t?(t?Zh:0)|("full"===t?Xh:0):e&&"pre"==e.whitespace?Zh|Xh:n&~ef}class nf{constructor(e,t,n,r,i,o,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=lh.none,this.stashMarks=[],this.match=o||(s&ef?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(ih.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Zh)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=ih.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(ih.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t<n.length;t++){let r=n[t];(this.type?this.type.allowsMarkType(r.type):af(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Yh.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class rf{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,i=t.topNode,o=tf(null,t.preserveWhitespace,0)|(n?ef:0);r=i?new nf(i.type,i.attrs,lh.none,lh.none,!0,t.topMatch||i.type.contentMatch,o):new nf(n?null:e.schema.topNodeType,null,lh.none,lh.none,!0,null,o),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){let t=e.getAttribute("style"),n=t?this.readStyles(function(e){let t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t)):null,r=this.top;if(null!=n)for(let e=0;e<n.length;e++)this.addPendingMark(n[e]);if(this.addElement(e),null!=n)for(let e=0;e<n.length;e++)this.removePendingMark(n[e],r)}}addTextNode(e){let t=e.nodeValue,n=this.top;if(n.options&Xh||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(n.options&Zh)t=n.options&Xh?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],i=e.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let n,r=e.nodeName.toLowerCase();Jh.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&Jh.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(i?i.ignore:Qh.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let t,n=this.top,o=this.needsBlock;if(Yh.hasOwnProperty(r))t=!0,n.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),t&&this.sync(n),this.needsBlock=o}else this.addElementByRule(e,i,!1===i.consuming?n:void 0)}leafFallback(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}ignoreFallback(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=lh.none;e:for(let n=0;n<e.length;n+=2)for(let r;;){let i=this.parser.matchStyle(e[n],e[n+1],this,r);if(!i)continue e;if(i.ignore)return null;if(t=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(t),!1!==i.consuming)break;r=i}return t}addElementByRule(e,t,n){let r,i,o;if(t.node)i=this.parser.schema.nodes[t.node],i.isLeaf?this.insertNode(i.create(t.attrs))||this.leafFallback(e):r=this.enter(i,t.attrs||null,t.preserveWhitespace);else{o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o)}let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e)));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(e,t,n){let r=t||0;for(let i=t?e.childNodes[t]:e.firstChild,o=null==n?null:e.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=i,!o.length))break;if(i.solid)break}if(!t)return!1;this.sync(n);for(let e=0;e<t.length;e++)this.enterInner(t[e],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let n=t.activeMarks;for(let r=0;r<e.marks.length;r++)t.type&&!t.type.allowsMarkType(e.marks[r].type)||(n=e.marks[r].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}enterInner(e,t=null,n=!1,r){this.closeExtra();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let o=tf(e,r,i.options);i.options&ef&&0==i.content.length&&(o|=ef),this.nodes.push(new nf(e,t,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)){t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}addPendingMark(e){let t=function(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function of(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function sf(e){let t={};for(let n in e)t[n]=e[n];return t}function af(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t)return!0;if(o.indexOf(i)<0&&s(i))return!0}};if(s(i.contentMatch))return!0}}class lf{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=uf(t).createDocumentFragment());let r=n,i=[];return e.forEach((e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(this.marks[t.type.name]){if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}else o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=lf.renderSpec(uf(t),this.nodes[e.type.name](e));if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&lf.renderSpec(uf(n),r(e,t))}static renderSpec(e,t,n=null){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,i=t[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?e.createElementNS(n,i):e.createElement(i),a=t[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let e in a)if(null!=a[e]){let t=e.indexOf(" ");t>0?s.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):s.setAttribute(e,a[e])}}for(let i=l;i<t.length;i++){let o=t[i];if(0===o){if(i<t.length-1||i>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:i}=lf.renderSpec(e,o,n);if(s.appendChild(t),i){if(r)throw new RangeError("Multiple content holes");r=i}}}return{dom:s,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new lf(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=cf(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return cf(e.marks)}}function cf(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function uf(e){return e.document||window.document}const df=65535,pf=Math.pow(2,16);function hf(e,t){return e+t*pf}function ff(e){return e&df}const mf=1,gf=2,bf=4,yf=8;class vf{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&yf)>0}get deletedBefore(){return(this.delInfo&(mf|bf))>0}get deletedAfter(){return(this.delInfo&(gf|bf))>0}get deletedAcross(){return(this.delInfo&bf)>0}}class wf{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&wf.empty)return wf.empty}recover(e){let t=0,n=ff(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+function(e){return(e-(e&df))/pf}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let l=this.ranges[s+i],c=this.ranges[s+o],u=a+l;if(e<=u){let i=a+r+((l?e==a?-1:e==u?1:t:t)<0?0:c);if(n)return i;let o=e==(t<0?a:u)?null:hf(s/3,e-a),d=e==a?gf:e==u?mf:bf;return(t<0?e!=a:e!=u)&&(d|=yf),new vf(i,d,o)}r+=c-l}return n?e+r:new vf(e+r,0,null)}touches(e,t){let n=0,r=ff(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let a=this.ranges[t+i];if(e<=s+a&&t==3*r)return!0;n+=this.ranges[t+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),l=this.ranges[r+t],c=this.ranges[r+n];e(s,s+l,a,a+c),i+=c-l}}invert(){return new wf(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?wf.empty:new wf(e<0?[0,-e,0]:[0,0,e])}}wf.empty=new wf([]);class _f{constructor(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(e=0,t=this.maps.length){return new _f(this.maps,this.mirror,e,t)}copy(){return new _f(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,n=this.maps.length;t<e.maps.length;t++){let r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new _f;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this.maps[n].mapResult(e,t);if(null!=i.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this.maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new vf(e,r,null)}}const xf=Object.create(null);class Ef{getMap(){return wf.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=xf[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in xf)throw new RangeError("Duplicate use of step JSON ID "+e);return xf[e]=t,t.prototype.jsonID=e,t}}class kf{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new kf(e,null)}static fail(e){return new kf(null,e)}static fromReplace(e,t,n,r){try{return kf.ok(e.replace(t,n,r))}catch(e){if(e instanceof ch)return kf.fail(e.message);throw e}}}function Mf(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(Mf(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return ih.fromArray(r)}class Df extends Ef{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new uh(Mf(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return kf.fromReplace(e,this.from,this.to,i)}invert(){return new Cf(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Df(t.pos,n.pos,this.mark)}merge(e){return e instanceof Df&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Df(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Df(t.from,t.to,e.markFromJSON(t.mark))}}Ef.jsonID("addMark",Df);class Cf extends Ef{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new uh(Mf(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return kf.fromReplace(e,this.from,this.to,n)}invert(){return new Df(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Cf(t.pos,n.pos,this.mark)}merge(e){return e instanceof Cf&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Cf(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Cf(t.from,t.to,e.markFromJSON(t.mark))}}Ef.jsonID("removeMark",Cf);class Sf extends Ef{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return kf.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return kf.fromReplace(e,this.pos,this.pos+1,new uh(ih.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new Sf(this.pos,t.marks[n]);return new Sf(this.pos,this.mark)}}return new Nf(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Sf(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Sf(t.pos,e.markFromJSON(t.mark))}}Ef.jsonID("addNodeMark",Sf);class Nf extends Ef{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return kf.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return kf.fromReplace(e,this.pos,this.pos+1,new uh(ih.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new Sf(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Nf(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Nf(t.pos,e.markFromJSON(t.mark))}}Ef.jsonID("removeNodeMark",Nf);class Af extends Ef{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Tf(e,this.from,this.to)?kf.fail("Structure replace would overwrite content"):kf.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new wf([this.from,this.to-this.from,this.slice.size])}invert(e){return new Af(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new Af(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof Af)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?uh.empty:new uh(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Af(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?uh.empty:new uh(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Af(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Af(t.from,t.to,uh.fromJSON(e,t.slice),!!t.structure)}}Ef.jsonID("replace",Af);class Of extends Ef{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(Tf(e,this.from,this.gapFrom)||Tf(e,this.gapTo,this.to)))return kf.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return kf.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?kf.fromReplace(e,this.from,this.to,n):kf.fail("Content does not fit in gap")}getMap(){return new wf([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Of(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new Of(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Of(t.from,t.to,t.gapFrom,t.gapTo,uh.fromJSON(e,t.slice),t.insert,!!t.structure)}}function Tf(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function If(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Lf(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,o,t))return n;if(0==n||r.type.spec.isolating||!If(r,i,o))break}return null}function Ff(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;a&&e<i;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?s:null}(r,t);return o?i.map(zf).concat({type:t,attrs:n}).concat(o.map(zf)):null}function zf(e){return{type:e,attrs:null}}function jf(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>o;e--,t--){let n=i.node(e),o=i.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),a=r&&r[t]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(o+1,n.childCount)||!a.type.validContent(s))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function Rf(e,t){let n=e.resolve(t),r=n.index();return function(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Bf(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,o=r.index(t)+(n>0?1:0),s=r.node(t),a=!1;if(1==e)a=s.canReplace(o,o,i);else{let e=s.contentMatchAt(o).findWrapping(i.firstChild.type);a=e&&s.canReplaceWith(o,o,e[0])}if(a)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Pf(e,t,n=t,r=uh.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return Uf(i,o,r)?new Af(t,n,r):new Hf(i,o,r).fit()}function Uf(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Ef.jsonID("replaceAround",Of);class Hf{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=ih.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=ih.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let a=new uh(i,o,s);return e>-1?new Of(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new Af(n.pos,r.pos,a):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let n,r=null;t?(r=Vf(this.unplaced.content,t-1).firstChild,n=r.content):n=this.unplaced.content;let i=n.firstChild;for(let n=this.depth;n>=0;n--){let o,{type:s,match:a}=this.frontier[n],l=null;if(1==e&&(i?a.matchType(i.type)||(l=a.fillBefore(ih.from(i),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:t,frontierDepth:n,parent:r,inject:l};if(2==e&&i&&(o=a.findWrapping(i.type)))return{sliceDepth:t,frontierDepth:n,parent:r,wrap:o};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Vf(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new uh(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Vf(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new uh($f(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new uh($f(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let o=this.unplaced,s=n?n.content:o.content,a=o.openStart-e,l=0,c=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));u=u.matchFragment(r)}let p=s.size+e-(o.content.size-o.openEnd);for(;l<s.childCount;){let e=s.child(l),t=u.matchType(e.type);if(!t)break;l++,(l>1||0==a||e.content.size)&&(u=t,c.push(qf(e.mark(d.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?p:-1)))}let h=l==s.childCount;h||(p=-1),this.placed=Wf(this.placed,t,ih.from(c)),this.frontier[t].match=u,h&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<p;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=h?0==e?uh.empty:new uh($f(o.content,e-1,1),e-1,p<0?o.openEnd:e-1):new uh($f(o.content,e,l),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Kf(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=Kf(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Kf(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Wf(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Wf(this.placed,this.depth,ih.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(ih.empty,!0);e.childCount&&(this.placed=Wf(this.placed,this.frontier.length,e))}}function $f(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy($f(e.firstChild.content,t-1,n)))}function Wf(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Wf(e.lastChild.content,t-1,n)))}function Vf(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function qf(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,qf(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(ih.empty,!0)))),e.copy(r)}function Kf(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function Gf(e){return e.spec.defining||e.spec.definingForContent}function Yf(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(Yf(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(ih.empty,!0))}return e}function Qf(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let i=e.start(r);if(i<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}class Jf extends Ef{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return kf.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return kf.fromReplace(e,this.pos,this.pos+1,new uh(ih.from(r),0,t.isLeaf?0:1))}getMap(){return wf.empty}invert(e){return new Jf(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Jf(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new Jf(t.pos,t.attr,t.value)}}Ef.jsonID("attr",Jf);let Zf=class extends Error{};Zf=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(Zf.prototype=Object.create(Error.prototype)).constructor=Zf,Zf.prototype.name="TransformError";class Xf{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new _f}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Zf(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=uh.empty){let r=Pf(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new uh(ih.from(n),0,0))}delete(e,t){return this.replace(e,t,uh.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(Uf(i,o,r))return e.step(new Af(t,n,r));let s=Qf(i,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?a=e:i.before(e)==t&&s.splice(1,0,-e)}let l=s.indexOf(a),c=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=c[e].type,n=Gf(t);if(n&&i.node(l).type!=t)u=e;else if(n||!t.isTextblock)break}for(let t=r.openStart;t>=0;t--){let a=(t+u+1)%(r.openStart+1),d=c[a];if(d)for(let t=0;t<s.length;t++){let c=s[(t+l)%s.length],u=!0;c<0&&(u=!1,c=-c);let p=i.node(c-1),h=i.index(c-1);if(p.canReplaceWith(h,h,d.type,d.marks))return e.replace(i.before(c),u?o.after(c):n,new uh(Yf(r.content,0,r.openStart,a),a,r.openEnd))}}let d=e.steps.length;for(let a=s.length-1;a>=0&&(e.replace(t,n,r),!(e.steps.length>d));a--){let e=s[a];e<0||(t=i.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}(e.doc,t,r.type);null!=i&&(t=n=i)}e.replaceRange(t,n,new uh(ih.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=Qf(r,i);for(let t=0;t<o.length;t++){let n=o[t],s=t==o.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o)return e.delete(r.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),a=i.after(o+1),l=s,c=a,u=ih.empty,d=0;for(let e=o,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=ih.from(r.node(e).copy(u)),d++):l--;let p=ih.empty,h=0;for(let e=o,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,p=ih.from(i.node(e).copy(p)),h++):c++;e.step(new Of(l,c,s,a,new uh(u.append(p),d,h),u.size-d,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=new Af(t-n,t+n,uh.empty,!0);e.step(r)}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=ih.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=ih.from(n[e].type.create(n[e].attrs,r))}let i=t.start,o=t.end;e.step(new Of(i,o,i,o,new uh(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(r,i)&&function(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(e.doc,e.mapping.slice(o).map(n),r)){e.clearIncompatible(e.mapping.slice(o).map(n,1),r);let s=e.mapping.slice(o),a=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new Of(a,l,a+1,l-1,new uh(ih.from(r.create(i,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r=[]){return function(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Of(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new uh(ih.from(s),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Jf(e,t,n)),this}addNodeMark(e,t){return this.step(new Sf(e,t)),this}removeNodeMark(e,t){if(!(t instanceof lh)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(n.marks)))return this}return this.step(new Nf(e,t)),this}split(e,t=1,n){return function(e,t,n=1,r){let i=e.doc.resolve(t),o=ih.empty,s=ih.empty;for(let e=i.depth,t=i.depth-n,a=n-1;e>t;e--,a--){o=ih.from(i.node(e).copy(o));let t=r&&r[a];s=ih.from(t?t.type.create(t.attrs,s):i.node(e).copy(s))}e.step(new Af(t,t,new uh(o.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let i,o,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,c)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,t),d=Math.min(l+e.nodeSize,n),p=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(p)||(i&&i.to==c&&i.mark.eq(u[e])?i.to=d:s.push(i=new Cf(c,d,u[e])));o&&o.to==c?o.to=d:a.push(o=new Df(c,d,r))}})),s.forEach((t=>e.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;o++;let a=null;if(r instanceof Vh){let t,n=e.marks;for(;t=r.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(a=[r]):a=e.marks;if(a&&a.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,l=a[e];for(let e=0;e<i.length;e++){let t=i[e];t.step==o-1&&l.eq(i[e].style)&&(n=t)}n?(n.to=r,n.step=o):i.push({style:l,from:Math.max(s,t),to:r,step:o})}}})),i.forEach((t=>e.step(new Cf(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,r=n.contentMatch){let i=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<i.childCount;t++){let a=i.child(t),l=s+a.nodeSize,c=r.matchType(a.type);if(c){r=c;for(let t=0;t<a.marks.length;t++)n.allowsMarkType(a.marks[t].type)||e.step(new Cf(s,l,a.marks[t]))}else o.push(new Af(s,l,uh.empty));s=l}if(!r.validEnd){let t=r.fillBefore(ih.empty,!0);e.replace(s,s,new uh(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}(this,e,t,n),this}}const em=Object.create(null);class tm{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new nm(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=uh.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:l}=o[s],c=e.mapping.slice(i);e.replaceRange(c.map(a.pos),c.map(l.pos),s?uh.empty:t),0==s&&pm(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],a=e.mapping.slice(n),l=a.map(o.pos),c=a.map(s.pos);i?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),pm(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new om(e):dm(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?dm(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):dm(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new cm(e.node(0))}static atStart(e){return dm(e,e,0,0,1)||new cm(e)}static atEnd(e){return dm(e,e,e.content.size,e.childCount,-1)||new cm(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=em[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in em)throw new RangeError("Duplicate use of selection JSON ID "+e);return em[e]=t,t.prototype.jsonID=e,t}getBookmark(){return om.between(this.$anchor,this.$head).getBookmark()}}tm.prototype.visible=!0;class nm{constructor(e,t){this.$from=e,this.$to=t}}let rm=!1;function im(e){rm||e.parent.inlineContent||(rm=!0,console["warn"]("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class om extends tm{constructor(e,t=e){im(e),im(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return tm.near(n);let r=e.resolve(t.map(this.anchor));return new om(r.parent.inlineContent?r:n,n)}replace(e,t=uh.empty){if(super.replace(e,t),t==uh.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof om&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new sm(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new om(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=tm.findFrom(t,n,!0)||tm.findFrom(t,-n,!0);if(!e)return tm.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(tm.findFrom(e,-n,!0)||tm.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new om(e,t)}}tm.jsonID("text",om);class sm{constructor(e,t){this.anchor=e,this.head=t}map(e){return new sm(e.map(this.anchor),e.map(this.head))}resolve(e){return om.between(e.resolve(this.anchor),e.resolve(this.head))}}class am extends tm{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?tm.near(i):new am(i)}content(){return new uh(ih.from(this.node),0,0)}eq(e){return e instanceof am&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new lm(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new am(e.resolve(t.anchor))}static create(e,t){return new am(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}am.prototype.visible=!1,tm.jsonID("node",am);class lm{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new sm(n,n):new lm(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&am.isSelectable(n)?new am(t):tm.near(t)}}class cm extends tm{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=uh.empty){if(t==uh.empty){e.delete(0,e.doc.content.size);let t=tm.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new cm(e)}map(e){return new cm(e)}eq(e){return e instanceof cm}getBookmark(){return um}}tm.jsonID("all",cm);const um={map(){return this},resolve:e=>new cm(e)};function dm(e,t,n,r,i,o=!1){if(t.inlineContent)return om.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&am.isSelectable(r))return am.create(e,n-(i<0?r.nodeSize:0))}else{let t=dm(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function pm(e,t,n){let r=e.steps.length-1;if(r<t)return;let i,o=e.steps[r];(o instanceof Af||o instanceof Of)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==i&&(i=r)})),e.setSelection(tm.near(e.doc.resolve(i),n)))}const hm=1,fm=2,mm=4;class gm extends Xf{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|hm)&~fm,this.storedMarks=null,this}get selectionSet(){return(this.updated&hm)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=fm,this}ensureMarks(e){return lh.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&fm)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~fm,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||lh.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(tm.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=mm,this}get scrolledIntoView(){return(this.updated&mm)>0}}function bm(e,t){return t&&e?e.bind(t):e}class ym{constructor(e,t,n){this.name=e,this.init=bm(t.init,n),this.apply=bm(t.apply,n)}}const vm=[new ym("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new ym("selection",{init:(e,t)=>e.selection||tm.atStart(t.doc),apply:e=>e.selection}),new ym("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new ym("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class wm{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=vm.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new ym(e.key,e.spec.state,e))}))}}class _m{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let a=r?r[o].n:0,l=r?r[o].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new _m(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new gm(this)}static create(e){let t=new wm(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new _m(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new wm(this.schema,e.plugins),n=t.fields,r=new _m(t);for(let t=0;t<n.length;t++){let i=n[t].name;r[i]=this.hasOwnProperty(i)?this[i]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new wm(e.schema,e.plugins),i=new _m(r);return r.fields.forEach((r=>{if("doc"==r.name)i.doc=Sh.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=tm.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,o))return void(i[r.name]=a.fromJSON.call(s,e,t[o],i))}i[r.name]=r.init(e,i)}})),i}}function xm(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=xm(i,t,{})),n[r]=i}return n}class Em{constructor(e){this.spec=e,this.props={},e.props&&xm(e.props,this,this.props),this.key=e.key?e.key.key:Mm("plugin")}getState(e){return e[this.key]}}const km=Object.create(null);function Mm(e){return e in km?e+"$"+ ++km[e]:(km[e]=0,e+"$")}class Dm{constructor(e="key"){this.key=Mm(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Cm="undefined"!=typeof navigator?navigator:null,Sm="undefined"!=typeof document?document:null,Nm=Cm&&Cm.userAgent||"",Am=/Edge\/(\d+)/.exec(Nm),Om=/MSIE \d/.exec(Nm),Tm=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Nm),Im=!!(Om||Tm||Am),Lm=Om?document.documentMode:Tm?+Tm[1]:Am?+Am[1]:0,Fm=!Im&&/gecko\/(\d+)/i.test(Nm);Fm&&(/Firefox\/(\d+)/.exec(Nm)||[0,0])[1];const zm=!Im&&/Chrome\/(\d+)/.exec(Nm),jm=!!zm,Rm=zm?+zm[1]:0,Bm=!Im&&!!Cm&&/Apple Computer/.test(Cm.vendor),Pm=Bm&&(/Mobile\/\w+/.test(Nm)||!!Cm&&Cm.maxTouchPoints>2),Um=Pm||!!Cm&&/Mac/.test(Cm.platform),Hm=/Android \d/.test(Nm),$m=!!Sm&&"webkitFontSmoothing"in Sm.documentElement.style,Wm=$m?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,Vm=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},qm=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let Km=null;const Gm=function(e,t,n){let r=Km||(Km=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},Ym=function(e,t,n,r){return n&&(Jm(e,t,n,r,-1)||Jm(e,t,n,r,1))},Qm=/^(img|br|input|textarea|hr)$/i;function Jm(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Zm(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Xm(e)||Qm.test(e.nodeName)||"false"==e.contentEditable)return!1;t=Vm(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?Zm(e):0}}}function Zm(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Xm(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const eg=function(e){let t=e.isCollapsed;return t&&jm&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function tg(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function ng(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function rg(e,t){return"number"==typeof e?e:e[t]}function ig(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function og(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;s=qm(s)){if(1!=s.nodeType)continue;let e=s,n=e==o.body,a=n?ng(o):ig(e),l=0,c=0;if(t.top<a.top+rg(r,"top")?c=-(a.top-t.top+rg(i,"top")):t.bottom>a.bottom-rg(r,"bottom")&&(c=t.bottom-a.bottom+rg(i,"bottom")),t.left<a.left+rg(r,"left")?l=-(a.left-t.left+rg(i,"left")):t.right>a.right-rg(r,"right")&&(l=t.right-a.right+rg(i,"right")),l||c)if(n)o.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}if(n)break}}function sg(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=qm(r));return t}function ag(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let lg=null;function cg(e,t){let n,r,i=2e8,o=0,s=t.top,a=t.top;for(let l=e.firstChild,c=0;l;l=l.nextSibling,c++){let e;if(1==l.nodeType)e=l.getClientRects();else{if(3!=l.nodeType)continue;e=Gm(l).getClientRects()}for(let u=0;u<e.length;u++){let d=e[u];if(d.top<=s&&d.bottom>=a){s=Math.max(d.bottom,s),a=Math.min(d.top,a);let e=d.left>t.left?d.left-t.left:d.right<t.left?t.left-d.right:0;if(e<i){n=l,i=e,r=e&&3==n.nodeType?{left:d.right<t.left?d.right:d.left,top:t.top}:t,1==l.nodeType&&e&&(o=c+(t.left>=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(o=c+1)}}return n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let n=hg(r,1);if(n.top!=n.bottom&&ug(t,n))return{node:e,offset:i+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:e,offset:o}:cg(n,r)}function ug(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function dg(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let n=e.childNodes[o];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(ug(t,i))return dg(n,t,i)}}if((o=(o+1)%r)==i)break}return e}function pg(e,t){let n,r=e.dom.ownerDocument,i=0;if(r.caretPositionFromPoint)try{let e=r.caretPositionFromPoint(t.left,t.top);e&&({offsetNode:n,offset:i}=e)}catch(e){}if(!n&&r.caretRangeFromPoint){let e=r.caretRangeFromPoint(t.left,t.top);e&&({startContainer:n,startOffset:i}=e)}let o,s=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!s||!e.dom.contains(1!=s.nodeType?s.parentNode:s)){let n=e.dom.getBoundingClientRect();if(!ug(t,n))return null;if(s=dg(e.dom,t,n),!s)return null}if(Bm)for(let e=s;n&&e;e=qm(e))e.draggable&&(n=void 0);if(s=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(s,t),n){if(Fm&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let e,r=n.childNodes[i];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&i++}n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(o=function(e,t,n,r){let i=-1;for(let n=t;n!=e.dom;){let t=e.docView.nearestDesc(n,!0);if(!t)return null;if(t.node.isBlock&&t.parent){let e=t.dom.getBoundingClientRect();if(e.left>r.left||e.top>r.top)i=t.posBefore;else{if(!(e.right<r.left||e.bottom<r.top))break;i=t.posAfter}}n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,1)}(e,n,i,t))}null==o&&(o=function(e,t,n){let{node:r,offset:i}=cg(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,s,t));let a=e.docView.nearestDesc(s,!0);return{pos:o,inside:a?a.posAtStart-a.border:-1}}function hg(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const fg=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function mg(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=$m||Fm;if(3==r.nodeType){if(!s||!fg.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,gg(hg(Gm(r,e,t),1),o<0)}{let e=hg(Gm(r,i,i),n);if(Fm&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=hg(Gm(r,i-1,i-1),-1);if(t.top==e.top){let n=hg(Gm(r,i,i+1),-1);if(n.top!=e.top)return gg(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&i&&(n<0||i==Zm(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return bg(e.getBoundingClientRect(),!1)}if(null==o&&i<Zm(r)){let e=r.childNodes[i];if(1==e.nodeType)return bg(e.getBoundingClientRect(),!0)}return bg(r.getBoundingClientRect(),n>=0)}if(null==o&&i&&(n<0||i==Zm(r))){let e=r.childNodes[i-1],t=3==e.nodeType?Gm(e,Zm(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return gg(hg(t,1),!1)}if(null==o&&i<Zm(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?Gm(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return gg(hg(t,-1),!0)}return gg(hg(3==r.nodeType?Gm(r):r,-n),n>=0)}function gg(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function bg(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function yg(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}const vg=/[\u0590-\u08ac]/;let wg=null,_g=null,xg=!1;function Eg(e,t,n){return wg==t&&_g==n?xg:(wg=t,_g=n,xg="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return yg(e,t,(()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.dom;break}t=n.dom.parentNode}let r=mg(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=Gm(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return vg.test(r.parent.textContent)&&a.modify?yg(e,t,(()=>{let t=a.getRangeAt(0),i=a.focusNode,o=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");let l=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||i==a.focusNode&&o==a.focusOffset;return a.removeAllRanges(),a.addRange(t),null!=s&&(a.caretBidiLevel=s),l})):"left"==n||"backward"==n?o:s}(e,t,n))}const kg=0,Mg=1,Dg=2,Cg=3;class Sg{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=kg,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>Vm(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n,r=0,i=0;for(let t=0;r<this.children.length;r++){let n=this.children[r],o=t+n.size;if(o>e||n instanceof Fg){i=e-t;break}t=o}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof Ng&&n.side>=0;r--);if(t<=0){let e,n=!0;for(;e=r?this.children[r-1]:null,e&&e.dom.parentNode!=this.contentDOM;r--,n=!1);return e&&t&&n&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?Vm(e.dom)+1:0}}{let e,n=!0;for(;e=r<this.children.length?this.children[r]:null,e&&e.dom.parentNode!=this.contentDOM;r++,n=!1);return e&&n&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?Vm(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let o=n,s=0;;s++){let n=this.children[s],a=o+n.size;if(-1==r&&e<=a){let i=o+n.border;if(e>=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=Vm(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=Vm(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=a}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),o=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],c=a+l.size;if(i>a&&o<c)return l.setSelection(e-a-l.border,t-a-l.border,n,r);a=c}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.getSelection(),c=!1;if((Fm||Bm)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(c=!(!t||"\n"!=e.nodeValue[t-1]),c&&t==e.nodeValue.length)for(let t,n=e;n;n=n.parentNode){if(t=n.nextSibling){"BR"==t.nodeName&&(s=a={node:t.parentNode,offset:Vm(t)+1});break}let e=n.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];c=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(Fm&&l.focusNode&&l.focusNode!=a.node&&1==l.focusNode.nodeType){let e=l.focusNode.childNodes[l.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||c&&Bm)&&Ym(s.node,s.offset,l.anchorNode,l.anchorOffset)&&Ym(a.node,a.offset,l.focusNode,l.focusOffset))return;let u=!1;if((l.extend||e==t)&&!c){l.collapse(s.node,s.offset);try{if(e!=t)try{l.extend(a.node,a.offset)}catch(e){}u=!0}catch(e){if(!(e instanceof DOMException))throw e}}if(!u){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s)return this.dirty=e==n||t==o?Dg:Mg,void(e!=r||t!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-r,t-r):i.dirty=Cg);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?Cg:Dg}n=o}this.dirty=Dg}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?Dg:Mg;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class Ng extends Sg{constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,(()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r))),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==kg&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Ag extends Sg{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class Og extends Sg{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=lf.renderSpec(document,t.type.spec.toDOM(t,n))),new Og(e,t,o.dom,o.contentDOM||o.dom)}parseRule(){return this.dirty&Cg||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return this.dirty!=Cg&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=kg){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=kg}}slice(e,t,n){let r=Og.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=Gg(i,t,o,n)),e>0&&(i=Gg(i,0,e,n));for(let e=0;e<i.length;e++)i[e].parent=r;return r.children=i,r}}class Tg extends Sg{constructor(e,t,n,r,i,o,s,a,l){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s,o&&this.updateChildren(a,l)}static create(e,t,n,r,i,o){let s,a=i.nodeViews[t.type.name],l=a&&a(t,i,(()=>s?s.parent?s.parent.posBeforeChild(s):void 0:o),n,r),c=l&&l.dom,u=l&&l.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else c||({dom:c,contentDOM:u}=lf.renderSpec(document,t.type.spec.toDOM(t)));u||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let d=c;return c=$g(c,n,t),l?s=new zg(e,t,n,r,c,u||null,d,l,i,o+1):t.isText?new Lg(e,t,n,r,c,d,i):new Tg(e,t,n,r,c,u||null,d,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>ih.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return this.dirty==kg&&e.eq(this.node)&&Wg(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,a=new qg(this,o&&o.node,e);!function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,i,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){if(s<i.length&&i[s].to==o){let e,t=i[s++];for(;s<i.length&&i[s].to==o;)(e||(e=[t])).push(i[s++]);if(e){e.sort(Kg);for(let t=0;t<e.length;t++)n(e[t],c,!!l)}else n(t,c,!!l)}let u,d;if(l)d=-1,u=l,l=null;else{if(!(c<e.childCount))break;d=c,u=e.child(c++)}for(let e=0;e<a.length;e++)a[e].to<=o&&a.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let p=o+u.nodeSize;if(u.isText){let e=p;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<p&&(l=u.cut(e-o),u=u.cut(0,e-o),p=e,d=-1)}let h=u.isInline&&!u.isLeaf?a.filter((e=>!e.inline)):a.slice();r(u,h,t.forChild(o,u),d),o=p}}(this.node,this.innerDeco,((t,i,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?lh.none:this.node.child(i).marks,n,e),a.placeWidget(t,e,r)}),((t,o,l,c)=>{let u;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,o,l,c)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(t,o,l,u,e)||a.updateNextNode(t,o,l,e,c)||a.addNode(t,o,l,e,r),r+=t.nodeSize})),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Dg)&&(o&&this.protectLocalComposition(e,o),jg(this.contentDOM,this.children,e),Pm&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof om)||n<t||r>t+this.node.content.size)return null;let i=e.domSelection(),o=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=Zm(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(i.focusNode,i.focusOffset);if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let e=o.nodeValue,i=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;l+=t.text}if(o>=n){let e=a<r?l.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new Ag(this,i,t,r);e.input.compositionNodes.push(o),this.children=Gg(this.children,n,n+r.length,e,o)}update(e,t,n,r){return!(this.dirty==Cg||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=kg}updateOuterDeco(e){if(Wg(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Ug(this.dom,this.nodeDOM,Pg(this.outerDeco,this.node,t),Pg(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Ig(e,t,n,r,i){return $g(r,t,e),new Tg(void 0,e,t,n,r,r,r,i,0)}class Lg extends Tg{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(this.dirty==Cg||this.dirty!=kg&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),this.dirty==kg&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=kg,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new Lg(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=Cg)}get domAtom(){return!1}}class Fg extends Sg{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==kg&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class zg extends Tg{constructor(e,t,n,r,i,o,s,a,l,c){super(e,t,n,r,i,o,s,l,c),this.spec=a}update(e,t,n,r){if(this.dirty==Cg)return!1;if(this.spec.update){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function jg(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let s=t[o],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=Vg(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(s instanceof Og){let t=r?r.previousSibling:e.lastChild;jg(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Vg(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Rg=function(e){e&&(this.nodeName=e)};Rg.prototype=Object.create(null);const Bg=[new Rg];function Pg(e,t,n){if(0==e.length)return Bg;let r=n?Bg[0]:new Rg,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new Rg(s.nodeName));for(let e in s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new Rg(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o))}}}return i}function Ug(e,t,n,r){if(n==Bg&&r==Bg)return t;let i=t;for(let t=0;t<r.length;t++){let o=r[t],s=n[t];if(t){let t;s&&s.nodeName==o.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==o.nodeName||(t=document.createElement(o.nodeName),t.pmIsDeco=!0,t.appendChild(i),s=Bg[0]),i=t}Hg(i,s||Bg[0],o)}return i}function Hg(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function $g(e,t,n){return Ug(e,e,Bg,Pg(t,n,1!=e.nodeType))}function Wg(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Vg(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class qg{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof Og)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let r=0,i=this.stack.length>>1,o=Math.min(i,e.length);for(;r<o&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=kg,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++)if(this.top.children[t].matchesMark(e[i])){r=t;break}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=Og.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(let r=this.index,i=Math.min(this.top.children.length,r+5);r<i;r++){let i=this.top.children[r];if(i.matchesNode(e,t,n)&&!this.preMatch.matched.has(i)){o=r;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return o.dirty==Cg&&o.dom==o.contentDOM&&(o.dirty=Dg),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,i){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof Tg){let a=this.preMatch.matched.get(s);if(null!=a&&a!=i)return!1;let l=s.dom;if(!(this.lock&&(l==this.lock||1==l.nodeType&&l.contains(this.lock.parentNode))&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=Cg&&Wg(t,s.outerDeco)))&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(e,t,n,r,i){this.top.children.splice(this.index++,0,Tg.create(this.top,e,t,n,r,i)),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new Ng(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Og;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Lg)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Bm||jm)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new Fg(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}}function Kg(e,t){return e.type.side-t.type.side}function Gg(e,t,n,r,i){let o=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,u=a+=l.size;c>=n||u<=t?o.push(l):(c<t&&o.push(l.slice(0,t-c,r)),i&&(o.push(i),i=void 0),u>n&&o.push(l.slice(n-c,l.size,r)))}return o}function Yg(e,t=null){let n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(eg(n)){for(a=c;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&am.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==Zm(e);r||i;){if(e==n)return!0;let t=Vm(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==Zm(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new am(s==e?c:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=r.resolve(t)}if(!l){l=ib(e,a,c,"pointer"==t||e.state.selection.head<c.pos&&!o?1:-1)}return l}function Qg(e){return e.editable?e.hasFocus():sb(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Jg(e,t=!1){let n=e.state.selection;if(nb(e,n),Qg(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&jm){let t=e.domSelection(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Ym(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setEnd(r.parentNode,Vm(r)+1):n.setEnd(r,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&Im&&Lm<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let r,i,{anchor:o,head:s}=n;!Zg||n instanceof om||(n.$from.parent.inlineContent||(r=Xg(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=Xg(e,n.to))),e.docView.setSelection(o,s,e.root,t),Zg&&(r&&tb(r),i&&tb(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelection(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Qg(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Zg=Bm||jm&&Rm<63;function Xg(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Bm&&i&&"false"==i.contentEditable)return eb(i);if(!(i&&"false"!=i.contentEditable||o&&"false"!=o.contentEditable)){if(i)return eb(i);if(o)return eb(o)}}function eb(e){return e.contentEditable="true",Bm&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function tb(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function nb(e,t){if(t instanceof am){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(rb(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else rb(e)}function rb(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function ib(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||om.between(t,n,r)}function ob(e){return!(e.editable&&!e.hasFocus())&&sb(e)}function sb(e){let t=e.domSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function ab(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&tm.findFrom(o,t)}function lb(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function cb(e,t,n){let r=e.state.selection;if(!(r instanceof om)){if(r instanceof am&&r.node.isInline)return lb(e,new om(t>0?r.$to:r.$from));{let n=ab(e.state,t);return!!n&&lb(e,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=ab(e.state,t);return!!(n&&n instanceof am)&&lb(e,n)}if(!(Um&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(am.isSelectable(o)?lb(e,new am(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!$m&&lb(e,new om(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function ub(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function db(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function pb(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(Fm&&1==n.nodeType&&r<ub(n)&&db(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(db(e))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(fb(n))break;{let t=n.previousSibling;for(;t&&db(t);)i=n.parentNode,o=Vm(t),t=t.previousSibling;if(t)n=t,r=ub(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?mb(e,t,n,r):i&&mb(e,t,i,o)}function hb(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=ub(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!db(n.childNodes[r]))break;i=n,o=++r}else{if(fb(n))break;{let t=n.nextSibling;for(;t&&db(t);)i=t.parentNode,o=Vm(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=ub(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}i&&mb(e,t,i,o)}function fb(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function mb(e,t,n,r){if(eg(t)){let e=document.createRange();e.setEnd(n,r),e.setStart(n,r),t.removeAllRanges(),t.addRange(e)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();let{state:i}=e;setTimeout((()=>{e.state==i&&Jg(e)}),50)}function gb(e,t,n){let r=e.state.selection;if(r instanceof om&&!r.empty||n.indexOf("s")>-1)return!1;if(Um&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=ab(e.state,t);if(n&&n instanceof am)return lb(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof cm?tm.near(n,t):tm.findFrom(n,t);return!!s&&lb(e,s)}return!1}function bb(e,t){if(!(e.state.selection instanceof om))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function yb(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function vb(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||Um&&72==n&&"c"==r?bb(e,-1)||pb(e):46==n||Um&&68==n&&"c"==r?bb(e,1)||hb(e):13==n||27==n||(37==n||Um&&66==n&&"c"==r?cb(e,-1,r)||pb(e):39==n||Um&&70==n&&"c"==r?cb(e,1,r)||hb(e):38==n||Um&&80==n&&"c"==r?gb(e,-1,r)||pb(e):40==n||Um&&78==n&&"c"==r?function(e){if(!Bm||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;yb(e,n,"true"),setTimeout((()=>yb(e,n,"false")),20)}return!1}(e)||gb(e,1,r)||hb(e):r==(Um?"m":"c")&&(66==n||73==n||89==n||90==n))}function wb(e,t){e.someProp("transformCopied",(e=>{t=e(t)}));let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||lf.fromSchema(e.state.schema),a=Ab(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,u=l.firstChild,d=0;for(;u&&1==u.nodeType&&(c=Sb[u.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=a.createElement(c[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++}u=l.firstChild}u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let p=e.someProp("clipboardTextSerializer",(e=>e(t)))||t.content.textBetween(0,t.content.size,"\n\n");return{dom:l,text:p}}function _b(e,t,n,r,i){let o,s,a=i.parent.type.spec.code;if(!n&&!t)return null;let l=t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",(e=>{t=e(t,a||r)})),a)return t?new uh(ih.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):uh.empty;let n=e.someProp("clipboardTextParser",(e=>e(t,i,r)));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=lf.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(e=>{n=e(n)})),o=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=Ab().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&Sb[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join(""));if(r.innerHTML=e,n)for(let e=0;e<n.length;e++)r=r.querySelector(n[e])||r;return r}(n),$m&&function(e){let t=e.querySelectorAll(jm?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let e=+u[3];e>0&&o.firstChild;e--)o=o.firstChild;if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||Gh.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!l&&!u),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||xb.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(u)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:i,openStart:o,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;i=ih.from(t.create(n[e+1],i)),o++,s++}return new uh(i,o,s)}(Cb(s,+u[1],+u[2]),u[4]);else if(s=uh.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach((e=>{if(!o)return;let t,n=i.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&r.length&&kb(n,r,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=Mb(o[o.length-1],r.length));let t=Eb(e,n);o.push(t),i=i.matchType(t.type),r=n}})),o)return ih.from(o)}return e}(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=Cb(s,e,t)}return e.someProp("transformPasted",(e=>{s=e(s)})),s}const xb=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Eb(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,ih.from(e));return e}function kb(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=kb(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(ih.from(Eb(n,e,i+1))))}}function Mb(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,Mb(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(ih.empty,!0);return e.copy(n.append(r))}function Db(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return i<r-1&&(a=Db(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(ih.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Cb(e,t,n){return t<e.openStart&&(e=new uh(Db(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new uh(Db(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const Sb={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Nb=null;function Ab(){return Nb||(Nb=document.implementation.createHTMLDocument("title"))}const Ob={},Tb={},Ib={touchstart:!0,touchmove:!0};class Lb{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Fb(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function zb(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>jb(e,t))}))}function jb(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Rb(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Bb(e){return{left:e.clientX,top:e.clientY}}function Pb(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,(t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1))))return!0;return!1}function Ub(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Hb(e,t,n,r,i){return Pb(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(i?function(e,t){if(-1==t)return!1;let n,r,i=e.state.selection;i instanceof am&&(n=i.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(am.isSelectable(t)){r=n&&i.$from.depth>0&&e>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(e);break}}return null!=r&&(Ub(e,am.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&am.isSelectable(r))&&(Ub(e,new am(n),"pointer"),!0)}(e,n))}function $b(e,t,n,r){return Pb(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function Wb(e,t,n,r){return Pb(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(Ub(e,om.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),o=i.before(t);if(n.inlineContent)Ub(e,om.create(r,o+1,o+1+n.content.size),"pointer");else{if(!am.isSelectable(n))continue;Ub(e,am.create(r,o),"pointer")}return!0}}(e,n,r)}function Vb(e){return Zb(e)}Tb.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Gb(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!Hm||!jm||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Pm||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||vb(e,n)?n.preventDefault():Fb(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,tg(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},Tb.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},Tb.keypress=(e,t)=>{let n=t;if(Gb(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Um&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof om&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const qb=Um?"metaKey":"ctrlKey";Ob.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Vb(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[qb]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=e.posAtCoords(Bb(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Kb(e,s,n,!!r)):("doubleClick"==o?$b:Wb)(e,s.pos,s.inside,n)?n.preventDefault():Fb(e,"pointer"))};class Kb{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[qb],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof am&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Fm||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Fb(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>Jg(this.view))),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Bb(e))),this.updateAllowDefault(e),this.allowDefault||!t?Fb(this.view,"pointer"):Hb(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Bm&&this.mightDrag&&!this.mightDrag.node.isAtom||jm&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Ub(this.view,tm.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Fb(this.view,"pointer")}move(e){this.updateAllowDefault(e),Fb(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function Gb(e,t){return!!e.composing||!!(Bm&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Ob.touchstart=e=>{e.input.lastTouch=Date.now(),Vb(e),Fb(e,"pointer")},Ob.touchmove=e=>{e.input.lastTouch=Date.now(),Fb(e,"pointer")},Ob.contextmenu=e=>Vb(e);const Yb=Hm?5e3:-1;function Qb(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>Zb(e)),t))}function Jb(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Zb(e,t=!1){if(!(Hm&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Jb(e),t||e.docView&&e.docView.dirty){let t=Yg(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}Tb.compositionstart=Tb.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),Zb(e,!0),e.markCursor=null;else if(Zb(e),Fm&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelection();for(let e=t.focusNode,n=t.focusOffset;e&&1==e.nodeType&&0!=n;){let r=n<0?e.lastChild:e.childNodes[n-1];if(!r)break;if(3==r.nodeType){t.collapse(r,r.nodeValue.length);break}e=r,n=-1}}e.input.composing=!0}Qb(e,Yb)},Tb.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,Qb(e,20))};const Xb=Im&&Lm<15||Pm&&Wm<604;function ey(e,t,n,r){let i=_b(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,r,i||uh.empty))))return!0;if(!i)return!1;let o=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),s=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Ob.copy=Tb.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=Xb?null:n.clipboardData,s=r.content(),{dom:a,text:l}=wb(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Tb.paste=(e,t)=>{let n=t;if(e.composing&&!Hm)return;let r=Xb?null:n.clipboardData;r&&ey(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ey(e,r.value,null,t):ey(e,r.textContent,r.innerHTML,t)}),50)}(e,n)};class ty{constructor(e,t){this.slice=e,this.move=t}}const ny=Um?"altKey":"ctrlKey";Ob.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(Bb(n));if(o&&o.pos>=i.from&&o.pos<=(i instanceof am?i.to-1:i.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(am.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(am.create(e.state.doc,t.posBefore)))}let s=e.state.selection.content(),{dom:a,text:l}=wb(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Xb?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Xb||n.dataTransfer.setData("text/plain",l),e.dragging=new ty(s,!n[ny])},Ob.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},Tb.dragover=Tb.dragenter=(e,t)=>t.preventDefault(),Tb.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(Bb(n));if(!i)return;let o=e.state.doc.resolve(i.pos),s=r&&r.slice;s?e.someProp("transformPasted",(e=>{s=e(s)})):s=_b(e,n.dataTransfer.getData(Xb?"Text":"text/plain"),Xb?null:n.dataTransfer.getData("text/html"),!1,o);let a=!(!r||n[ny]);if(e.someProp("handleDrop",(t=>t(e,n,s||uh.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?Bf(e.state.doc,o.pos,s):o.pos;null==l&&(l=o.pos);let c=e.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,p=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(p))return;let h=c.doc.resolve(u);if(d&&am.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new am(h));else{let t=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),c.setSelection(ib(e,h,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},Ob.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&Jg(e)}),20))},Ob.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},Ob.beforeinput=(e,t)=>{if(jm&&Hm&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,tg(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let e in Tb)Ob[e]=Tb[e];function ry(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class iy{constructor(e,t){this.toDOM=e,this.spec=t||cy,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new ay(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof iy&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ry(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class oy{constructor(e,t){this.attrs=e,this.spec=t||cy}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new ay(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof oy&&ry(this.attrs,e.attrs)&&ry(this.spec,e.spec)}static is(e){return e.type instanceof oy}destroy(){}}class sy{constructor(e,t){this.attrs=e,this.spec=t||cy}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new ay(i.pos-n,o.pos-n,this)}valid(e,t){let n,{index:r,offset:i}=e.content.findIndex(t.from);return i==t.from&&!(n=e.child(r)).isText&&i+n.nodeSize==t.to}eq(e){return this==e||e instanceof sy&&ry(this.attrs,e.attrs)&&ry(this.spec,e.spec)}destroy(){}}class ay{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new ay(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new ay(e,e,new iy(t,n))}static inline(e,t,n,r){return new ay(e,t,new oy(n,r))}static node(e,t,n,r){return new ay(e,t,new sy(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof oy}}const ly=[],cy={};class uy{constructor(e,t){this.local=e.length?e:ly,this.children=t.length?t:ly}static create(e,t){return t.length?gy(t,e,0,cy):dy}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==dy||0==e.maps.length?this:this.mapInner(e,t,0,0,n||cy)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let a=e.slice();for(let e=0,t=o;e<n.maps.length;e++){let r=0;n.maps[e].forEach(((e,n,o,s)=>{let l=s-o-(n-e);for(let s=0;s<a.length;s+=3){let c=a[s+1];if(c<0||e>c+t-r)continue;let u=a[s]+t-r;n>=u?a[s+1]=e<=u?-2:-1:o>=i&&l&&(a[s]+=l,a[s+1]+=l)}r+=l})),t=n.maps[e].map(t,-1)}let l=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){l=!0,a[t+1]=-1;continue}let c=n.map(e[t]+o),u=c-i;if(u<0||u>=r.content.size){l=!0;continue}let d=n.map(e[t+1]+o,-1)-i,{index:p,offset:h}=r.content.findIndex(u),f=r.maybeChild(p);if(f&&h==u&&h+f.nodeSize==d){let r=a[t+2].mapInner(n,f,c+1,e[t]+o+1,s);r!=dy?(a[t]=u,a[t+1]=d,a[t+2]=r):(a[t+1]=-2,l=!0)}else l=!0}if(l){let l=function(e,t,n,r,i,o,s){function a(e,t){for(let o=0;o<e.local.length;o++){let a=e.local[o].map(r,i,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[o].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&a(e[n+2],t[n]+o+1);return n}(a,e,t,n,i,o,s),c=gy(l,r,0,s);t=c.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new uy(t.sort(by),a)}(this.children,o||[],e,t,n,r,i):o?new uy(o.sort(by),ly):dy}add(e,t){return t.length?this==dy?uy.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach(((e,o)=>{let s,a=o+n;if(s=fy(t,e,a)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,s,a+1):r.splice(i,0,o,o+e.nodeSize,gy(s,e,a+1,cy)),i+=3}}));let o=hy(i?my(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new uy(o.length?this.local.concat(o).sort(by):this.local,r||this.children)}remove(e){return 0==e.length||this==dy?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,o=n[r]+t,s=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>o&&t.to<s&&(e[n]=null,(i||(i=[])).push(t));if(!i)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(i,o+1);a!=dy?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,i=0;i<e.length;i++)if(n=e[i])for(let e=0;e<r.length;e++)r[e].eq(n,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new uy(r,n):dy}forChild(e,t){if(this==dy)return this;if(t.isLeaf)return uy.empty;let n,r;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,o=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>i&&t.type instanceof oy){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new uy(r.sort(by),ly);return n?new py([e,n]):e}return n||dy}eq(e){if(this==e)return!0;if(!(e instanceof uy)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return yy(this.localsInner(e))}localsInner(e){if(this==dy)return ly;if(e.inlineContent||!this.local.some(oy.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof oy||t.push(this.local[e]);return t}}uy.empty=new uy([],[]),uy.removeOverlap=yy;const dy=uy.empty;class py{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,cy)));return py.from(n)}forChild(e,t){if(t.isLeaf)return uy.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=dy&&(i instanceof py?n=n.concat(i.members):n.push(i))}return py.from(n)}eq(e){if(!(e instanceof py)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?yy(n?t:t.sort(by)):ly}static from(e){switch(e.length){case 0:return dy;case 1:return e[0];default:return new py(e)}}}function hy(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new ay(i.from+t,i.to+t,i.type))}return n}function fy(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t,o=0;o<e.length;o++)(t=e[o])&&t.from>n&&t.to<r&&((i||(i=[])).push(t),e[o]=null);return i}function my(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function gy(e,t,n,r){let i=[],o=!1;t.forEach(((t,s)=>{let a=fy(e,t,s+n);if(a){o=!0;let e=gy(a,t,n+s+1,r);e!=dy&&i.push(s,s+t.nodeSize,e)}}));let s=hy(o?my(e):e,-n).sort(by);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||i.length?new uy(s,i):dy}function by(e,t){return e.from-t.from||e.to-t.to}function yy(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from!=r.from){o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),vy(t,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),vy(t,i+1,o.copy(r.to,o.to)))}}return t}function vy(e,t,n){for(;t<e.length&&by(n,e[t])>0;)t++;e.splice(t,0,n)}function wy(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=dy&&t.push(r)})),e.cursorWrapper&&t.push(uy.create(e.state.doc,[e.cursorWrapper.deco])),py.from(t)}const _y={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},xy=Im&&Lm<=11;class Ey{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class ky{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Ey,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);Im&&Lm<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),xy&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,_y)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout((()=>this.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(ob(this.view)){if(this.suppressingSelectionUpdates)return Jg(this.view);if(Im&&Lm<=11&&!this.view.state.selection.empty){let e=this.view.domSelection();if(e.focusNode&&Ym(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(e){if(0==e.rangeCount)return!0;let t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);let n=e.domSelection(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&ob(e)&&!this.ignoreSelectionChange(n),i=-1,o=-1,s=!1,a=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],a);n&&(i=i<0?n.from:Math.min(n.from,i),o=o<0?n.to:Math.max(n.to,o),n.typeOver&&(s=!0))}if(Fm&&a.length>1){let e=a.filter((e=>"BR"==e.nodeName));if(2==e.length){let t=e[0],n=e[1];t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}}let l=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&e.input.lastTouch<Date.now()-300&&eg(n)&&(l=Yg(e))&&l.eq(tm.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Jg(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,o),function(e){if(My.has(e))return;if(My.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=Fm,Dy)return;console["warn"]("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Dy=!0}}(e)),this.handleDOMChange(i,o,s,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Jg(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++)t.push(e.addedNodes[n]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(Im&&Lm<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!o||Array.prototype.indexOf.call(e.addedNodes,o)<0)&&(i=o)}let o=r&&r.parentNode==e.target?Vm(r)+1:0,s=n.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?Vm(i):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let My=new WeakMap,Dy=!1;function Cy(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Bm&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||Bm&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}function Sy(e,t,n,r,i){if(t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Yg(e,t);if(n&&!e.state.selection.eq(n)){let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let a,l,c=e.state.selection,u=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),c=e.domSelection(),u=c.anchorNode;if(u&&e.dom.contains(1==u.nodeType?u:u.parentNode)&&(r=[{node:u,offset:c.anchorOffset}],eg(c)||r.push({node:c.focusNode,offset:c.focusOffset})),jm&&8===e.input.lastKeyCode)for(let e=s;e>o;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let d=e.state.doc,p=e.someProp("domParser")||Gh.fromSchema(e.state.schema),h=d.resolve(a),f=null,m=p.parse(i,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Cy,context:h});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+a,head:t+a}}return{doc:m,sel:f,from:a,to:l}}(e,t,n),d=e.state.doc,p=d.slice(u.from,u.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(a=e.state.selection.to,l="end"):(a=e.state.selection.from,l="start"),e.input.lastKeyCode=null;let h=function(e,t,n,r,i){let o=e.findDiffStart(t,n);if(null==o)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i){r-=s+Math.max(0,o-Math.min(s,a))-o}if(s<o&&e.size<t.size){o-=r<=o&&r>=s?o-r:0,a=o+(a-s),s=o}else if(a<o){o-=r<=o&&r>=a?o-r:0,s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}(p.content,u.doc.content,u.from,a,l);if((Pm&&e.input.lastIOSEnter>Date.now()-225||Hm)&&i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",(t=>t(e,tg(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!h){if(!(r&&c instanceof om&&!c.empty&&c.$head.sameParent(c.$anchor))||e.composing||u.sel&&u.sel.anchor!=u.sel.head){if(u.sel){let t=Ny(e,e.state.doc,u.sel);t&&!t.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(t))}return}h={start:c.from,endA:c.to,endB:c.to}}if(jm&&e.cursorWrapper&&u.sel&&u.sel.anchor==e.cursorWrapper.deco.from&&u.sel.head==u.sel.anchor){let e=h.endB-h.start;u.sel={anchor:u.sel.anchor+e,head:u.sel.anchor+e}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&h.start==h.endB&&e.state.selection instanceof om&&(h.start>e.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?h.start=e.state.selection.from:h.endA<e.state.selection.to&&h.endA>=e.state.selection.to-2&&e.state.selection.to<=u.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),Im&&Lm<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>u.from&&"  "==u.doc.textBetween(h.start-u.from-1,h.start-u.from+1)&&(h.start--,h.endA--,h.endB--);let f,m=u.doc.resolveNoCache(h.start-u.from),g=u.doc.resolveNoCache(h.endB-u.from),b=d.resolve(h.start),y=m.sameParent(g)&&m.parent.inlineContent&&b.end()>=h.endA;if((Pm&&e.input.lastIOSEnter>Date.now()-225&&(!y||i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!y&&m.pos<u.doc.content.size&&(f=tm.findFrom(u.doc.resolve(m.pos+1),1,!0))&&f.head==g.pos)&&e.someProp("handleKeyDown",(t=>t(e,tg(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>h.start&&function(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||Ay(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(Ay(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||Ay(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(d,h.start,h.endA,m,g)&&e.someProp("handleKeyDown",(t=>t(e,tg(8,"Backspace")))))return void(Hm&&jm&&e.domObserver.suppressSelectionUpdates());jm&&Hm&&h.endB==h.start&&(e.input.lastAndroidDelete=Date.now()),Hm&&!y&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==h.endA&&(h.endB-=2,g=u.doc.resolveNoCache(h.endB-u.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,tg(13,"Enter"))}))}),20));let v,w,_,x=h.start,E=h.endA;if(y)if(m.pos==g.pos)Im&&Lm<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Jg(e)),20)),v=e.state.tr.delete(x,E),w=d.resolve(h.start).marksAcross(d.resolve(h.endA));else if(h.endA==h.endB&&(_=function(e,t){let n,r,i,o=e.firstChild.marks,s=t.firstChild.marks,a=o,l=s;for(let e=0;e<s.length;e++)a=s[e].removeFromSet(a);for(let e=0;e<o.length;e++)l=o[e].removeFromSet(l);if(1==a.length&&0==l.length)r=a[0],n="add",i=e=>e.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",i=e=>e.mark(r.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(i(t.child(e)));if(ih.from(c).eq(e))return{mark:r,type:n}}(m.parent.content.cut(m.parentOffset,g.parentOffset),b.parent.content.cut(b.parentOffset,h.endA-b.start()))))v=e.state.tr,"add"==_.type?v.addMark(x,E,_.mark):v.removeMark(x,E,_.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let t=m.parent.textBetween(m.parentOffset,g.parentOffset);if(e.someProp("handleTextInput",(n=>n(e,x,E,t))))return;v=e.state.tr.insertText(t,x,E)}if(v||(v=e.state.tr.replace(x,E,u.doc.slice(h.start-u.from,h.endB-u.from))),u.sel){let t=Ny(e,v.doc,u.sel);t&&!(jm&&Hm&&e.composing&&t.empty&&(h.start!=h.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==x||t.head==v.mapping.map(E)-1)||Im&&t.empty&&t.head==x)&&v.setSelection(t)}w&&v.ensureMarks(w),e.dispatch(v.scrollIntoView())}function Ny(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:ib(e,t.resolve(n.anchor),t.resolve(n.head))}function Ay(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}class Oy{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Lb,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(zy),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Ly(this),Iy(this),this.nodeViews=Fy(this),this.docView=Ig(this.state.doc,Ty(this),wy(this),this.dom,this),this.domObserver=new ky(this,((e,t,n,r)=>Sy(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in Ob){let n=Ob[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Rb(e,t)||jb(e,t)||!e.editable&&t.type in Tb||n(e,t)},Ib[t]?{passive:!0}:void 0)}Bm&&e.dom.addEventListener("input",(()=>null)),zb(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&zb(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(zy),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(Jb(this),i=!0),this.state=e;let o=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(o||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Fy(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(o||t.handleDOMEvents!=this._props.handleDOMEvents)&&zb(this),this.editable=Ly(this),Iy(this);let s=wy(this),a=Ty(this),l=n.plugins==e.plugins||n.doc.eq(e.doc)?e.scrollToSelection>n.scrollToSelection?"to selection":"preserve":"reset",c=r||!this.docView.matchesNode(e.doc,a,s);!c&&e.selection.eq(n.selection)||(i=!0);let u="preserve"==l&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(o,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=i-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:sg(e.dom)}}(this);if(i){this.domObserver.stop();let t=c&&(Im||jm)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(n.selection,e.selection);if(c){let n=jm?this.trackWrites=this.domSelection().focusNode:null;!r&&this.docView.update(e.doc,a,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Ig(e.doc,a,s,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return Ym(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Jg(this,t):(nb(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():u&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;ag(n,0==r?0:r-t)}(u)}scrollToSelection(){let e=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(this.state.selection instanceof am){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&og(this,t.getBoundingClientRect(),e)}else og(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let r=0;r<this.directPlugins.length;r++){let i=this.directPlugins[r].props[e];if(null!=i&&(n=t?t(i):i))return n}let i=this.state.plugins;if(i)for(let r=0;r<i.length;r++){let o=i[r].props[e];if(null!=o&&(n=t?t(o):o))return n}}hasFocus(){if(Im){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(lg)return e.focus(lg);let t=sg(e);e.focus(null==lg?{get preventScroll(){return lg={preventScroll:!0},!0}}:void 0),lg||(lg=!1,ag(t,0))}(this.dom),Jg(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return e||document}posAtCoords(e){return pg(this,e)}coordsAtPos(e,t=1){return mg(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return Eg(this,t||this.state,e)}destroy(){this.docView&&(!function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],wy(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){jb(e,t)||!Ob[t.type]||!e.editable&&t.type in Tb||Ob[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelection(){return this.root.getSelection()}}function Ty(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e&&(t.class+=" "+n[e]),"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),[ay.node(0,e.state.doc.content.size,t)]}function Iy(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:ay.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Ly(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function Fy(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function zy(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var jy={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:"'"},Ry={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},By="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent);"undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent);for(var Py="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Uy="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Hy=Py||By&&+By[1]<57,$y=0;$y<10;$y++)jy[48+$y]=jy[96+$y]=String($y);for($y=1;$y<=24;$y++)jy[$y+111]="F"+$y;for($y=65;$y<=90;$y++)jy[$y]=String.fromCharCode($y+32),Ry[$y]=String.fromCharCode($y);for(var Wy in jy)Ry.hasOwnProperty(Wy)||(Ry[Wy]=jy[Wy]);const Vy="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function qy(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let e=0;e<o.length-1;e++){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);Vy?i=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function Ky(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function Gy(e){let t=function(e){let t=Object.create(null);for(let n in e)t[qy(n)]=e[n];return t}(e);return function(e,n){let r,i=function(e){var t=!(Hy&&(e.ctrlKey||e.altKey||e.metaKey)||Uy&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?Ry:jy)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),o=1==i.length&&" "!=i,s=t[Ky(i,n,!o)];if(s&&s(e.state,e.dispatch,e))return!0;if(o&&(n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(r=jy[n.keyCode])&&r!=i){let i=t[Ky(r,n,!0)];if(i&&i(e.state,e.dispatch,e))return!0}else if(o&&n.shiftKey){let r=t[Ky(i,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}return!1}}function Yy(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function Qy(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Jy(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function Zy(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Xy(e,t,n){let r,i,o=t.nodeBefore,s=t.nodeAfter;if(o.type.spec.isolating||s.type.spec.isolating)return!1;if(function(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(o,o+1)||!i.isTextblock&&!Rf(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(r=(i=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&i.matchType(r[0]||s.type).validEnd){if(n){let i=t.pos+s.nodeSize,a=ih.empty;for(let e=r.length-1;e>=0;e--)a=ih.from(r[e].create(null,a));a=ih.from(o.copy(a));let l=e.tr.step(new Of(t.pos-1,i,t.pos,i,new uh(a,1,0),r.length,!0)),c=i+2*r.length;Rf(l.doc,c)&&l.join(c),n(l.scrollIntoView())}return!0}let l=tm.findFrom(t,1),c=l&&l.$from.blockRange(l.$to),u=c&&Lf(c);if(null!=u&&u>=t.depth)return n&&n(e.tr.lift(c,u).scrollIntoView()),!0;if(a&&Yy(s,"start",!0)&&Yy(o,"end")){let r=o,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let a=s,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=ih.empty;for(let e=i.length-1;e>=0;e--)r=ih.from(i[e].copy(r));n(e.tr.step(new Of(t.pos-i.length,t.pos+s.nodeSize,t.pos+l,t.pos+s.nodeSize-l,new uh(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function ev(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(om.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}const tv=ev(-1),nv=ev(1);function rv(e,t=null){return function(n,r){let{from:i,to:o}=n.selection,s=!1;return n.doc.nodesBetween(i,o,((r,i)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{let t=n.doc.resolve(i),r=t.index();s=t.parent.canReplaceWith(r,r+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(i,o,e,t).scrollIntoView()),!0)}}function iv(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==i.index(s.depth-1))return!1;let e=n.doc.resolve(s.start-2);l=new Dh(e,e,s.depth),s.endIndex<s.parent.childCount&&(s=new Dh(i,n.doc.resolve(o.end(s.depth)),s.depth)),a=!0}let c=Ff(l,e,t,s);return!!c&&(r&&r(function(e,t,n,r,i){let o=ih.empty;for(let e=n.length-1;e>=0;e--)o=ih.from(n[e].type.create(n[e].attrs,o));e.step(new Of(t.start-(r?2:0),t.end,t.start,t.end,new uh(o,0,0),n.length,!0));let s=0;for(let e=0;e<n.length;e++)n[e].type==i&&(s=e+1);let a=n.length-s,l=t.start+n.length-(r?2:0),c=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&jf(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=c.child(n).nodeSize;return e}(n.tr,s,c,a,e).scrollIntoView()),!0)}}function ov(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,(t=>t.childCount>0&&t.firstChild.type==e));return!!o&&(!n||(r.node(o.depth-1).type==e?function(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new Of(o-1,s,o,s,new uh(ih.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Dh(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const a=Lf(r);if(null==a)return!1;i.lift(r,a);let l=i.mapping.map(o,-1)-1;Rf(i.doc,l)&&i.join(l);return t(i.scrollIntoView()),!0}(t,n,e,o):function(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,o=n.startIndex;t>o;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?ih.empty:ih.from(i))))return!1;let d=o.pos,p=d+s.nodeSize;return r.step(new Of(d-(a?1:0),p+(l?1:0),d+1,p-1,new uh((a?ih.empty:ih.from(i.copy(ih.empty))).append(l?ih.empty:ih.from(i.copy(ih.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}(t,n,o)))}}function sv(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class av{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(o);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],a=!!e,l=e||i.tr,c={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),i=n(...e)(r);return s.push(i),c}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(l),s.every((e=>!0===e)))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=!1,i=e||n.tr,o=this.buildProps(i,r),s=Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...o,dispatch:void 0})])));return{...s,chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r;i.storedMarks&&e.setStoredMarks(i.storedMarks);const s={tr:e,editor:r,view:o,state:sv({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map((([e,t])=>[e,(...e)=>t(...e)(s)])))}};return s}}function lv(e,t,n){if(void 0===e.config[t]&&e.parent)return lv(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?lv(e.parent,t,n):null})}return e.config[t]}function cv(e){return{baseExtensions:e.filter((e=>"extension"===e.type)),nodeExtensions:e.filter((e=>"node"===e.type)),markExtensions:e.filter((e=>"mark"===e.type))}}function uv(e){const t=[],{nodeExtensions:n,markExtensions:r}=cv(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=lv(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage});if(!n)return;n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...o,...r}})}))}))}))})),i.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=lv(e,"addAttributes",n);if(!r)return;const i=r();Object.entries(i).forEach((([n,r])=>{const i={...o,...r};(null==r?void 0:r.isRequired)&&void 0===(null==r?void 0:r.default)&&delete i.default,t.push({type:e.name,name:n,attribute:i})}))})),t}function dv(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function pv(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{n[e]?n[e]="class"===e?[n[e],t].join(" "):"style"===e?[n[e],t].join("; "):t:n[e]=t})),n}),{})}function hv(e,t){return t.filter((e=>e.attribute.rendered)).map((t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]})).reduce(((e,t)=>pv(e,t)),{})}function fv(e){return"function"==typeof e}function mv(e,t=void 0,...n){return fv(e)?t?e.bind(t)(...n):e(...n):e}function gv(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const i=t.reduce(((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}}),{});return{...r,...i}}}}function bv(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function yv(e,t){return t.nodes[e]||t.marks[e]||null}function vv(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function wv(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class _v{constructor(e){this.find=e.find,this.handler=e.handler}}function xv(e){var t;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null===(t=c.nodeBefore||c.nodeAfter)||void 0===t?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let u=!1;const d=((e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,((e,t,i,o)=>{var s,a;const l=(null===(a=(s=e.type.spec).toText)||void 0===a?void 0:a.call(s,{node:e,pos:t,parent:i,index:o}))||e.textContent||"%leaf%";n+=l.slice(0,Math.max(0,r-t))})),n})(c)+o;return s.forEach((e=>{if(u)return;const t=((e,t)=>{if(wv(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[];return r.push(n.text),r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(d,e.find);if(!t)return;const s=l.state.tr,c=sv({state:l.state,transaction:s}),p={from:r-(t[0].length-o.length),to:i},{commands:h,chain:f,can:m}=new av({editor:n,state:c});null!==e.handler({state:c,range:p,match:t,commands:h,chain:f,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:i,text:o}),l.dispatch(s),u=!0)})),u}function Ev(e){const{editor:t,rules:n}=e,r=new Em({state:{init:()=>null,apply(e,t){const n=e.getMeta(r);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(e,i,o,s)=>xv({editor:t,from:i,to:o,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:i}=e.state.selection;i&&xv({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;const{$cursor:o}=e.state.selection;return!!o&&xv({editor:t,from:o.pos,to:o.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}class kv{constructor(e){this.find=e.find,this.handler=e.handler}}function Mv(e){const{editor:t,state:n,from:r,to:i,rule:o}=e,{commands:s,chain:a,can:l}=new av({editor:t,state:n}),c=[];n.doc.nodesBetween(r,i,((e,t)=>{if(!e.isTextblock||e.type.spec.code)return;const u=Math.max(r,t),d=Math.min(i,t+e.content.size),p=((e,t)=>{if(wv(t))return[...e.matchAll(t)];const n=t(e);return n?n.map((t=>{const n=[];return n.push(t.text),n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n})):[]})(e.textBetween(u-t,d-t,void 0,""),o.find);p.forEach((e=>{if(void 0===e.index)return;const t=u+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},d=o.handler({state:n,range:i,match:e,commands:s,chain:a,can:l});c.push(d)}))}));return c.every((e=>null!==e))}function Dv(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1;const s=n.map((e=>new Em({view(e){const t=t=>{var n;r=(null===(n=e.dom.parentElement)||void 0===n?void 0:n.contains(t.target))?e.dom.parentElement:null};return window.addEventListener("dragstart",t),{destroy(){window.removeEventListener("dragstart",t)}}},props:{handleDOMEvents:{drop:e=>(o=r===e.dom.parentElement,!1),paste:(e,t)=>{var n;const r=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html");return i=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(n,r,s)=>{const a=n[0],l="paste"===a.getMeta("uiEvent")&&!i,c="drop"===a.getMeta("uiEvent")&&!o;if(!l&&!c)return;const u=r.doc.content.findDiffStart(s.doc.content),d=r.doc.content.findDiffEnd(s.doc.content);if("number"!=typeof u||!d||u===d.b)return;const p=s.tr,h=sv({state:s,transaction:p});return Mv({editor:t,state:h,from:Math.max(u-1,0),to:d.b-1,rule:e})&&p.steps.length?p:void 0}})));return s}class Cv{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Cv.resolve(e),this.schema=function(e){var t;const n=uv(e),{nodeExtensions:r,markExtensions:i}=cv(e),o=null===(t=r.find((e=>lv(e,"topNode"))))||void 0===t?void 0:t.name,s=Object.fromEntries(r.map((t=>{const r=n.filter((e=>e.type===t.name)),i={name:t.name,options:t.options,storage:t.storage},o=e.reduce(((e,n)=>{const r=lv(n,"extendNodeSchema",i);return{...e,...r?r(t):{}}}),{}),s=bv({...o,content:mv(lv(t,"content",i)),marks:mv(lv(t,"marks",i)),group:mv(lv(t,"group",i)),inline:mv(lv(t,"inline",i)),atom:mv(lv(t,"atom",i)),selectable:mv(lv(t,"selectable",i)),draggable:mv(lv(t,"draggable",i)),code:mv(lv(t,"code",i)),defining:mv(lv(t,"defining",i)),isolating:mv(lv(t,"isolating",i)),attrs:Object.fromEntries(r.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),a=mv(lv(t,"parseHTML",i));a&&(s.parseDOM=a.map((e=>gv(e,r))));const l=lv(t,"renderHTML",i);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:hv(e,r)}));const c=lv(t,"renderText",i);return c&&(s.toText=c),[t.name,s]}))),a=Object.fromEntries(i.map((t=>{const r=n.filter((e=>e.type===t.name)),i={name:t.name,options:t.options,storage:t.storage},o=e.reduce(((e,n)=>{const r=lv(n,"extendMarkSchema",i);return{...e,...r?r(t):{}}}),{}),s=bv({...o,inclusive:mv(lv(t,"inclusive",i)),excludes:mv(lv(t,"excludes",i)),group:mv(lv(t,"group",i)),spanning:mv(lv(t,"spanning",i)),code:mv(lv(t,"code",i)),attrs:Object.fromEntries(r.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),a=mv(lv(t,"parseHTML",i));a&&(s.parseDOM=a.map((e=>gv(e,r))));const l=lv(t,"renderHTML",i);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:hv(e,r)})),[t.name,s]})));return new qh({topNode:o,nodes:s,marks:a})}(this.extensions),this.extensions.forEach((e=>{var t;this.editor.extensionStorage[e.name]=e.storage;const n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:yv(e.name,this.schema)};if("mark"===e.type){(null===(t=mv(lv(e,"keepOnSplit",n)))||void 0===t||t)&&this.splittableMarks.push(e.name)}const r=lv(e,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const i=lv(e,"onCreate",n);i&&this.editor.on("create",i);const o=lv(e,"onUpdate",n);o&&this.editor.on("update",o);const s=lv(e,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=lv(e,"onTransaction",n);a&&this.editor.on("transaction",a);const l=lv(e,"onFocus",n);l&&this.editor.on("focus",l);const c=lv(e,"onBlur",n);c&&this.editor.on("blur",c);const u=lv(e,"onDestroy",n);u&&this.editor.on("destroy",u)}))}static resolve(e){const t=Cv.sort(Cv.flatten(e)),n=function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return[...new Set(t)]}(t.map((e=>e.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((e=>`'${e}'`)).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map((e=>{const t=lv(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...this.flatten(t())]:e})).flat(10)}static sort(e){const t=100;return e.sort(((e,n)=>{const r=lv(e,"priority")||t,i=lv(n,"priority")||t;return r>i?-1:r<i?1:0}))}get commands(){return this.extensions.reduce(((e,t)=>{const n=lv(t,"addCommands",{name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:yv(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=Cv.sort([...this.extensions].reverse()),n=[],r=[],i=t.map((t=>{const i={name:t.name,options:t.options,storage:t.storage,editor:e,type:yv(t.name,this.schema)},o=[],s=lv(t,"addKeyboardShortcuts",i);let a={};if("mark"===t.type&&t.config.exitable&&(a.ArrowRight=()=>ww.handleExit({editor:e,mark:t})),s){const t=Object.fromEntries(Object.entries(s()).map((([t,n])=>[t,()=>n({editor:e})])));a={...a,...t}}const l=new Em({props:{handleKeyDown:Gy(a)}});o.push(l);const c=lv(t,"addInputRules",i);vv(t,e.options.enableInputRules)&&c&&n.push(...c());const u=lv(t,"addPasteRules",i);vv(t,e.options.enablePasteRules)&&u&&r.push(...u());const d=lv(t,"addProseMirrorPlugins",i);if(d){const e=d();o.push(...e)}return o})).flat();return[Ev({editor:e,rules:n}),...Dv({editor:e,rules:r}),...i]}get attributes(){return uv(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=cv(this.extensions);return Object.fromEntries(t.filter((e=>!!lv(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:t.storage,editor:e,type:dv(t.name,this.schema)},i=lv(t,"addNodeView",r);if(!i)return[];return[t.name,(r,o,s,a)=>{const l=hv(r,n);return i()({editor:e,node:r,getPos:s,decorations:a,HTMLAttributes:l,extension:t})}]})))}}function Sv(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function Nv(e,t){const n={...e};return Sv(e)&&Sv(t)&&Object.keys(t).forEach((r=>{Sv(t[r])?r in e?n[r]=Nv(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})})),n}class Av{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=mv(lv(this,"addOptions",{name:this.name}))),this.storage=mv(lv(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Av(e)}configure(e={}){const t=this.extend();return t.options=Nv(this.options,e),t.storage=mv(lv(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Av(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=mv(lv(t,"addOptions",{name:t.name})),t.storage=mv(lv(t,"addStorage",{name:t.name,options:t.options})),t}}function Ov(e,t,n){const{from:r,to:i}=t,{blockSeparator:o="\n\n",textSerializers:s={}}=n||{};let a="",l=!0;return e.nodesBetween(r,i,((e,n,c,u)=>{var d;const p=null==s?void 0:s[e.type.name];p?(e.isBlock&&!l&&(a+=o,l=!0),c&&(a+=p({node:e,pos:n,parent:c,index:u,range:t}))):e.isText?(a+=null===(d=null==e?void 0:e.text)||void 0===d?void 0:d.slice(Math.max(r,n)-n,i-n),l=!1):e.isBlock&&!l&&(a+=o,l=!0)})),a}function Tv(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}const Iv=Av.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Em({key:new Dm("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map((e=>e.$from.pos))),a=Math.max(...o.map((e=>e.$to.pos)));return Ov(r,{from:s,to:a},{textSerializers:Tv(n)})}}})]}});function Lv(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:wv(t[r])?t[r].test(e[r]):t[r]===e[r]))}function Fv(e,t,n={}){return e.find((e=>e.type===t&&Lv(e.attrs,n)))}function zv(e,t,n={}){return!!Fv(e,t,n)}function jv(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&0!==r.offset&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const i=Fv([...r.node.marks],t,n);if(!i)return;let o=r.index,s=e.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(Fv([...r.node.marks],t,n);o>0&&i.isInSet(e.parent.child(o-1).marks);)o-=1,s-=e.parent.child(o).nodeSize;for(;a<e.parent.childCount&&zv([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Rv(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function Bv(e){return e instanceof om}function Pv(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Uv(e,t=null){if(!t)return null;const n=tm.atStart(e),r=tm.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const i=n.from,o=r.to;return"all"===t?om.create(e,Pv(0,i,o),Pv(e.content.size,i,o)):om.create(e,Pv(t,i,o),Pv(t,i,o))}function Hv(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function $v(e){const t=`<body>${e}</body>`;return(new window.DOMParser).parseFromString(t,"text/html").body}function Wv(e,t,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof e&&null!==e)try{return Array.isArray(e)?ih.fromArray(e.map((e=>t.nodeFromJSON(e)))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Wv("",t,n)}if("string"==typeof e){const r=Gh.fromSchema(t);return n.slice?r.parseSlice($v(e),n.parseOptions).content:r.parse($v(e),n.parseOptions)}return Wv("",t,n)}function Vv(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function qv(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,s=t?dv(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);a.push({node:e,from:n,to:o})}));const l=i-r,c=a.filter((e=>!s||s.name===e.node.type.name)).filter((e=>Lv(e.node.attrs,n,{strict:!1})));if(o)return!!c.length;return c.reduce(((e,t)=>e+t.to-t.from),0)>=l}function Kv(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Gv(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}function Yv(e,t,n={}){return Wv(e,t,{slice:!1,parseOptions:n})}function Qv(e,t){const n=[];return e.descendants(((e,r)=>{t(e)&&n.push({node:e,pos:r})})),n}function Jv(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function Zv(e,t){const n=Rv(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,(e=>{s.push(...e.marks)}));const a=s.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function Xv(e,t){const n=Kv("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=dv(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,(e=>{o.push(e)}));const s=o.reverse().find((e=>e.type.name===n.name));return s?{...s.attrs}:{}}(e,t):"mark"===n?Zv(e,t):{}}function ew(e){const t=function(e,t=JSON.stringify){const n={};return e.filter((e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter(((e,n)=>{const r=t.filter(((e,t)=>t!==n));return!r.some((t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}))}function tw(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach((t=>{const i=jv(n.resolve(e-1),t.type);i&&r.push({mark:t,...i})})):n.nodesBetween(e,t,((e,t)=>{r.push(...e.marks.map((n=>({from:t,to:t+e.nodeSize,mark:n}))))})),r}function nw(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Rv(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!o||o.name===e.type.name)).find((e=>Lv(e.attrs,n,{strict:!1})));let s=0;const a=[];if(i.forEach((({$from:t,$to:n})=>{const r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);s+=o-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:o}))))}))})),0===s)return!1;const l=a.filter((e=>!o||o.name===e.mark.type.name)).filter((e=>Lv(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),c=a.filter((e=>!o||e.mark.type!==o&&e.mark.type.excludes(o))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+c:l)>=s}function rw(e,t){const{nodeExtensions:n}=cv(t),r=n.find((t=>t.name===e));if(!r)return!1;const i=mv(lv(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof i&&i.split(" ").includes("list")}function iw(e,t,n){const r=0,i=e.state.doc.content.size,o=Pv(t,r,i),s=Pv(n,r,i),a=e.coordsAtPos(o),l=e.coordsAtPos(s,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),p=Math.max(a.right,l.right),h={top:c,bottom:u,left:d,right:p,width:p-d,height:u-c,x:d,y:c};return{...h,toJSON:()=>h}}function ow(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}function sw(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(r)}}const aw=(e,t)=>{const n=Jv((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!Rf(e.doc,n.pos)||(e.join(n.pos),!0)},lw=(e,t)=>{const n=Jv((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!Rf(e.doc,r)||(e.join(r),!0)};var cw=Object.freeze({__proto__:null,blur:()=>({editor:e,view:t})=>(requestAnimationFrame((()=>{var n;e.isDestroyed||(t.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(e=!1)=>({commands:t})=>t.setContent("",e),clearNodes:()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return!n||(i.forEach((({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,((e,n)=>{if(e.type.isText)return;const{doc:r,mapping:i}=t,o=r.resolve(i.map(n)),s=r.resolve(i.map(n+e.nodeSize)),a=o.blockRange(s);if(!a)return;const l=Lf(a);if(e.type.isTextblock){const{defaultType:e}=o.parent.contentMatchAt(o.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)}))})),!0)},command:e=>t=>e(t),createParagraphNear:()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof cm||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Zy(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(n,o.createAndFill());s.setSelection(om.create(s.doc,n+1)),t(s.scrollIntoView())}return!0})(e,t),deleteNode:e=>({tr:t,state:n,dispatch:r})=>{const i=dv(e,n.schema),o=t.selection.$anchor;for(let e=o.depth;e>0;e-=1){if(o.node(e).type===i){if(r){const n=o.before(e),r=o.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},deleteRange:e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},deleteSelection:()=>({state:e,dispatch:t})=>((e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0))(e,t),enter:()=>({commands:e})=>e.keyboardShortcut("Enter"),exitCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=Zy(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,s.createAndFill());i.setSelection(tm.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0})(e,t),extendMarkRange:(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Rv(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(i){const e=jv(l,o,t);if(e&&e.from<=c&&e.to>=u){const t=om.create(s,e.from,e.to);n.setSelection(t)}}return!0},first:e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1},focus:(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const s=()=>{Hv()&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===e||!1===e)return!0;if(o&&null===e&&!Bv(n.state.selection))return s(),!0;const a=Uv(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},forEach:(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),insertContent:(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),insertContentAt:(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const i=Wv(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===i.toString())return!0;let{from:s,to:a}="number"==typeof e?{from:e,to:e}:e,l=!0,c=!0;if((i.toString().startsWith("<")?i:[i]).forEach((e=>{e.check(),l=!!l&&(e.isText&&0===e.marks.length),c=!!c&&e.isBlock})),s===a&&c){const{parent:e}=r.doc.resolve(s);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(s-=1,a+=1)}l?r.insertText(t,s,a):r.replaceWith(s,a,i),n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof Af||i instanceof Of))return;const o=e.mapping.maps[r];let s=0;o.forEach(((e,t,n,r)=>{0===s&&(s=r)})),e.setSelection(tm.near(e.doc.resolve(s),n))}(r,r.steps.length-1,-1)}return!0},joinBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;let i=Qy(r);if(!i){let n=r.blockRange(),i=n&&Lf(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Xy(e,i,t))return!0;if(0==r.parent.content.size&&(Yy(o,"end")||am.isSelectable(o))){let n=Pf(e.doc,r.before(),r.after(),uh.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Yy(o,"end")?tm.findFrom(r.doc.resolve(r.mapping.map(i.pos,-1)),-1):am.create(r.doc,i.pos-o.nodeSize)),t(r.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1||(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),0))})(e,t),joinForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;let i=Jy(r);if(!i)return!1;let o=i.nodeAfter;if(Xy(e,i,t))return!0;if(0==r.parent.content.size&&(Yy(o,"start")||am.isSelectable(o))){let n=Pf(e.doc,r.before(),r.after(),uh.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Yy(o,"start")?tm.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):am.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1||(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),0))})(e,t),keyboardShortcut:e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=function(e){const t=e.split(/-(?!$)/);let n,r,i,o,s=t[t.length-1];"Space"===s&&(s=" ");for(let e=0;e<t.length-1;e+=1){const s=t[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))i=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);Hv()||Vv()?o=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),o&&(s=`Meta-${s}`),i&&(s=`Shift-${s}`),s}(e).split(/-(?!$)/),s=o.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction((()=>{n.someProp("handleKeyDown",(e=>e(n,a)))}));return null==l||l.steps.forEach((e=>{const t=e.map(r.mapping);t&&i&&r.maybeStep(t)})),!0},lift:(e,t={})=>({state:n,dispatch:r})=>!!qv(n,dv(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&Lf(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)})(n,r),liftEmptyBlock:()=>({state:e,dispatch:t})=>((e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(jf(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Lf(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)})(e,t),liftListItem:e=>({state:t,dispatch:n})=>ov(dv(e,t.schema))(t,n),newlineInCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))})(e,t),resetAttributes:(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Kv("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(o=dv(e,r.schema)),"mark"===a&&(s=Rv(e,r.schema)),i&&n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,Gv(e.attrs,t)),s&&e.marks.length&&e.marks.forEach((i=>{s===i.type&&n.addMark(r,r+e.nodeSize,s.create(Gv(i.attrs,t)))}))}))})),!0)},scrollIntoView:()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),selectAll:()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),selectNodeBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=Qy(r)}let s=o&&o.nodeBefore;return!(!s||!am.isSelectable(s)||(t&&t(e.tr.setSelection(am.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),0))})(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=Jy(r)}let s=o&&o.nodeAfter;return!(!s||!am.isSelectable(s)||(t&&t(e.tr.setSelection(am.create(e.doc,o.pos)).scrollIntoView()),0))})(e,t),selectParentNode:()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:r,to:i}=e.selection,o=r.sharedDepth(i);return 0!=o&&(n=r.before(o),t&&t(e.tr.setSelection(am.create(e.doc,n))),!0)})(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>nv(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>tv(e,t),setContent:(e,t=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:s}=r,a=Yv(e,i.schema,n);return o&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!t),!0},setMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Rv(e,r.schema);if(i)if(s){const e=Zv(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const i=e.$from.pos,o=e.$to.pos;r.doc.nodesBetween(i,o,((e,r)=>{const s=Math.max(r,i),a=Math.min(r+e.nodeSize,o);e.marks.find((e=>e.type===l))?e.marks.forEach((e=>{l===e.type&&n.addMark(s,a,l.create({...e.attrs,...t}))})):n.addMark(s,a,l.create(t))}))}));return function(e,t,n){var r;const{selection:i}=t;let o=null;if(Bv(i)&&(o=i.$cursor),o){const t=null!==(r=e.storedMarks)&&void 0!==r?r:o.marks();return!!n.isInSet(t)||!t.some((e=>e.type.excludes(n)))}const{ranges:s}=i;return s.some((({$from:t,$to:r})=>{let i=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,((e,t,r)=>{if(i)return!1;if(e.isInline){const t=!r||r.type.allowsMarkType(n),o=!!n.isInSet(e.marks)||!e.marks.some((e=>e.type.excludes(n)));i=t&&o}return!i})),i}))}(r,n,l)},setMeta:(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),setNode:(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=dv(e,n.schema);return o.isTextblock?i().command((({commands:e})=>!!rv(o,t)(n)||e.clearNodes())).command((({state:e})=>rv(o,t)(e,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=Pv(e,0,n.content.size),i=am.create(n,r);t.setSelection(i)}return!0},setTextSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,o=om.atStart(n).from,s=om.atEnd(n).to,a=Pv(r,o,s),l=Pv(i,o,s),c=om.create(n,a,l);t.setSelection(c)}return!0},sinkListItem:e=>({state:t,dispatch:n})=>{const r=dv(e,t.schema);return(i=r,function(e,t){let{$from:n,$to:r}=e.selection,o=n.blockRange(r,(e=>e.childCount>0&&e.firstChild.type==i));if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=i)return!1;if(t){let n=l.lastChild&&l.lastChild.type==a.type,r=ih.from(n?i.create():null),s=new uh(ih.from(i.create(null,ih.from(a.type.create(null,r)))),n?3:1,0),c=o.start,u=o.end;t(e.tr.step(new Of(c-(n?3:1),u,c,u,s,1,!0)).scrollIntoView())}return!0})(t,n);var i},splitBlock:({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=t,{$from:a,$to:l}=o,c=ow(i.extensionManager.attributes,a.node().type.name,a.node().attrs);if(o instanceof am&&o.node.isBlock)return!(!a.parentOffset||!jf(s,a.pos))&&(r&&(e&&sw(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const r=l.parentOffset===l.parent.content.size;o instanceof om&&t.deleteSelection();const s=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let u=r&&s?[{type:s,attrs:c}]:void 0,d=jf(t.doc,t.mapping.map(a.pos),1,u);if(u||d||!jf(t.doc,t.mapping.map(a.pos),1,s?[{type:s}]:void 0)||(d=!0,u=s?[{type:s,attrs:c}]:void 0),d&&(t.split(t.mapping.map(a.pos),1,u),s&&!r&&!a.parentOffset&&a.parent.type!==s)){const e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,s)&&t.setNodeMarkup(t.mapping.map(a.before()),s)}e&&sw(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0},splitListItem:e=>({tr:t,state:n,dispatch:r,editor:i})=>{var o;const s=dv(e,n.schema),{$from:a,$to:l}=n.selection,c=n.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==s)return!1;const d=i.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let e=ih.empty;const n=a.index(-1)?1:a.index(-2)?2:3;for(let t=a.depth-n;t>=a.depth-3;t-=1)e=ih.from(a.node(t).copy(e));const r=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,i=ow(d,a.node().type.name,a.node().attrs),l=(null===(o=s.contentMatch.defaultType)||void 0===o?void 0:o.createAndFill(i))||void 0;e=e.append(ih.from(s.createAndFill(null,l)||void 0));const c=a.before(a.depth-(n-1));t.replace(c,a.after(-r),new uh(e,4-n,0));let u=-1;t.doc.nodesBetween(c,t.doc.content.size,((e,t)=>{if(u>-1)return!1;e.isTextblock&&0===e.content.size&&(u=t+1)})),u>-1&&t.setSelection(om.near(t.doc.resolve(u))),t.scrollIntoView()}return!0}const p=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,h=ow(d,u.type.name,u.attrs),f=ow(d,a.node().type.name,a.node().attrs);t.delete(a.pos,l.pos);const m=p?[{type:s,attrs:h},{type:p,attrs:f}]:[{type:s,attrs:h}];return!!jf(t.doc,a.pos,2)&&(r&&t.split(a.pos,2,m).scrollIntoView(),!0)},toggleList:(e,t)=>({editor:n,tr:r,state:i,dispatch:o,chain:s,commands:a,can:l})=>{const{extensions:c}=n.extensionManager,u=dv(e,i.schema),d=dv(t,i.schema),{selection:p}=i,{$from:h,$to:f}=p,m=h.blockRange(f);if(!m)return!1;const g=Jv((e=>rw(e.type.name,c)))(p);if(m.depth>=1&&g&&m.depth-g.depth<=1){if(g.node.type===u)return a.liftListItem(d);if(rw(g.node.type.name,c)&&u.validContent(g.node.content)&&o)return s().command((()=>(r.setNodeMarkup(g.pos,u),!0))).command((()=>aw(r,u))).command((()=>lw(r,u))).run()}return s().command((()=>!!l().wrapInList(u)||a.clearNodes())).wrapInList(u).command((()=>aw(r,u))).command((()=>lw(r,u))).run()},toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Rv(e,r.schema);return nw(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},toggleNode:(e,t,n={})=>({state:r,commands:i})=>{const o=dv(e,r.schema),s=dv(t,r.schema);return qv(r,o,n)?i.setNode(s):i.setNode(o,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const i=dv(e,n.schema);return qv(n,i,t)?r.lift(i):r.wrapIn(i,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const t=e.tr,n=o.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(o.text){const n=t.doc.resolve(o.from).marks();t.replaceWith(o.from,o.to,e.schema.text(o.text,n))}else t.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=Rv(e,r.schema),{$from:c,empty:u,ranges:d}=a;if(!i)return!0;if(u&&s){let{from:e,to:t}=a;const r=null===(o=c.marks().find((e=>e.type===l)))||void 0===o?void 0:o.attrs,i=jv(c,l,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,l)}else d.forEach((e=>{n.removeMark(e.$from.pos,e.$to.pos,l)}));return n.removeStoredMark(l),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Kv("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(o=dv(e,r.schema)),"mark"===a&&(s=Rv(e,r.schema)),i&&n.selection.ranges.forEach((e=>{const i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,((e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),s&&e.marks.length&&e.marks.forEach((o=>{if(s===o.type){const l=Math.max(r,i),c=Math.min(r+e.nodeSize,a);n.addMark(l,c,s.create({...o.attrs,...t}))}}))}))})),!0)},wrapIn:(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&Ff(s,e,t);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(dv(e,n.schema),t)(n,r),wrapInList:(e,t={})=>({state:n,dispatch:r})=>iv(dv(e,n.schema),t)(n,r)});const uw=Av.create({name:"commands",addCommands:()=>({...cw})}),dw=Av.create({name:"editable",addProseMirrorPlugins(){return[new Em({key:new Dm("editable"),props:{editable:()=>this.editor.options.editable}})]}}),pw=Av.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Em({key:new Dm("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),hw=Av.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:r}=t,{empty:i,$anchor:o}=n,{pos:s,parent:a}=o,l=tm.atStart(r).from===s;return!(!(i&&l&&a.type.isTextblock)||a.textContent.length)&&e.clearNodes()})),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()])),t=()=>this.editor.commands.first((({commands:e})=>[()=>e.deleteSelection(),()=>e.joinForward(),()=>e.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Hv()||Vv()?i:r},addProseMirrorPlugins(){return[new Em({key:new Dm("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some((e=>e.docChanged))&&!t.doc.eq(n.doc)))return;const{empty:r,from:i,to:o}=t.selection,s=tm.atStart(t.doc).from,a=tm.atEnd(t.doc).to,l=i===s&&o===a,c=0===n.doc.textBetween(0,n.doc.content.size," "," ").length;if(r||!l||!c)return;const u=n.tr,d=sv({state:n,transaction:u}),{commands:p}=new av({editor:this.editor,state:d});return p.clearNodes(),u.steps.length?u:void 0}})]}}),fw=Av.create({name:"tabindex",addProseMirrorPlugins(){return[new Em({key:new Dm("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var mw=Object.freeze({__proto__:null,ClipboardTextSerializer:Iv,Commands:uw,Editable:dw,FocusEvents:pw,Keymap:hw,Tabindex:fw});const gw=`.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 1px !important;\n height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}`;function bw(e){return new _v({find:e.find,handler:({state:t,range:n,match:r})=>{const i=mv(e.getAttributes,void 0,r);if(!1===i||null===i)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length;if(tw(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>c)).length)return null;u<n.to&&o.delete(u,n.to),c>n.from&&o.delete(n.from+r,c),l=n.from+r+s.length,o.addMark(n.from+r,l,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function yw(e){return new _v({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=mv(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function vw(e){return new _v({find:e.find,handler:({state:t,range:n,match:r})=>{const i=mv(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),a=s&&Ff(s,e.type,i);if(!a)return null;o.wrap(s,a);const l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Rf(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)}})}class ww{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=mv(lv(this,"addOptions",{name:this.name}))),this.storage=mv(lv(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ww(e)}configure(e={}){const t=this.extend();return t.options=Nv(this.options,e),t.storage=mv(lv(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new ww(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=mv(lv(t,"addOptions",{name:t.name})),t.storage=mv(lv(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const i=r.marks(),o=!!i.find((e=>(null==e?void 0:e.type.name)===t.name));if(!o)return!1;const s=i.find((e=>(null==e?void 0:e.type.name)===t.name));return s&&n.removeStoredMark(s),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}}class _w{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=mv(lv(this,"addOptions",{name:this.name}))),this.storage=mv(lv(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new _w(e)}configure(e={}){const t=this.extend();return t.options=Nv(this.options,e),t.storage=mv(lv(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new _w(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=mv(lv(t,"addOptions",{name:t.name})),t.storage=mv(lv(t,"addStorage",{name:t.name,options:t.options})),t}}function xw(e){return new kv({find:e.find,handler:({state:t,range:n,match:r})=>{const i=mv(e.getAttributes,void 0,r);if(!1===i||null===i)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length;if(tw(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>c)).length)return null;u<n.to&&o.delete(u,n.to),c>n.from&&o.delete(n.from+r,c),l=n.from+r+s.length,o.addMark(n.from+r,l,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}var Ew="top",kw="bottom",Mw="right",Dw="left",Cw="auto",Sw=[Ew,kw,Mw,Dw],Nw="start",Aw="end",Ow="clippingParents",Tw="viewport",Iw="popper",Lw="reference",Fw=Sw.reduce((function(e,t){return e.concat([t+"-"+Nw,t+"-"+Aw])}),[]),zw=[].concat(Sw,[Cw]).reduce((function(e,t){return e.concat([t,t+"-"+Nw,t+"-"+Aw])}),[]),jw=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Rw(e){return e?(e.nodeName||"").toLowerCase():null}function Bw(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Pw(e){return e instanceof Bw(e).Element||e instanceof Element}function Uw(e){return e instanceof Bw(e).HTMLElement||e instanceof HTMLElement}function Hw(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Bw(e).ShadowRoot||e instanceof ShadowRoot)}var $w={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];Uw(i)&&Rw(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});Uw(r)&&Rw(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function Ww(e){return e.split("-")[0]}var Vw=Math.max,qw=Math.min,Kw=Math.round;function Gw(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function Yw(){return!/^((?!chrome|android).)*safari/i.test(Gw())}function Qw(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Uw(e)&&(i=e.offsetWidth>0&&Kw(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Kw(r.height)/e.offsetHeight||1);var s=(Pw(e)?Bw(e):window).visualViewport,a=!Yw()&&n,l=(r.left+(a&&s?s.offsetLeft:0))/i,c=(r.top+(a&&s?s.offsetTop:0))/o,u=r.width/i,d=r.height/o;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l,x:l,y:c}}function Jw(e){var t=Qw(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Zw(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Hw(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Xw(e){return Bw(e).getComputedStyle(e)}function e_(e){return["table","td","th"].indexOf(Rw(e))>=0}function t_(e){return((Pw(e)?e.ownerDocument:e.document)||window.document).documentElement}function n_(e){return"html"===Rw(e)?e:e.assignedSlot||e.parentNode||(Hw(e)?e.host:null)||t_(e)}function r_(e){return Uw(e)&&"fixed"!==Xw(e).position?e.offsetParent:null}function i_(e){for(var t=Bw(e),n=r_(e);n&&e_(n)&&"static"===Xw(n).position;)n=r_(n);return n&&("html"===Rw(n)||"body"===Rw(n)&&"static"===Xw(n).position)?t:n||function(e){var t=/firefox/i.test(Gw());if(/Trident/i.test(Gw())&&Uw(e)&&"fixed"===Xw(e).position)return null;var n=n_(e);for(Hw(n)&&(n=n.host);Uw(n)&&["html","body"].indexOf(Rw(n))<0;){var r=Xw(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function o_(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function s_(e,t,n){return Vw(e,qw(t,n))}function a_(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function l_(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var c_={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Ww(n.placement),l=o_(a),c=[Dw,Mw].indexOf(a)>=0?"height":"width";if(o&&s){var u=function(e,t){return a_("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:l_(e,Sw))}(i.padding,n),d=Jw(o),p="y"===l?Ew:Dw,h="y"===l?kw:Mw,f=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],m=s[l]-n.rects.reference[l],g=i_(o),b=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,y=f/2-m/2,v=u[p],w=b-d[c]-u[h],_=b/2-d[c]/2+y,x=s_(v,_,w),E=l;n.modifiersData[r]=((t={})[E]=x,t.centerOffset=x-_,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&Zw(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function u_(e){return e.split("-")[1]}var d_={top:"auto",right:"auto",bottom:"auto",left:"auto"};function p_(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,p=s.x,h=void 0===p?0:p,f=s.y,m=void 0===f?0:f,g="function"==typeof u?u({x:h,y:m}):{x:h,y:m};h=g.x,m=g.y;var b=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),v=Dw,w=Ew,_=window;if(c){var x=i_(n),E="clientHeight",k="clientWidth";if(x===Bw(n)&&"static"!==Xw(x=t_(n)).position&&"absolute"===a&&(E="scrollHeight",k="scrollWidth"),i===Ew||(i===Dw||i===Mw)&&o===Aw)w=kw,m-=(d&&x===_&&_.visualViewport?_.visualViewport.height:x[E])-r.height,m*=l?1:-1;if(i===Dw||(i===Ew||i===kw)&&o===Aw)v=Mw,h-=(d&&x===_&&_.visualViewport?_.visualViewport.width:x[k])-r.width,h*=l?1:-1}var M,D=Object.assign({position:a},c&&d_),C=!0===u?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:Kw(t*r)/r||0,y:Kw(n*r)/r||0}}({x:h,y:m}):{x:h,y:m};return h=C.x,m=C.y,l?Object.assign({},D,((M={})[w]=y?"0":"",M[v]=b?"0":"",M.transform=(_.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",M)):Object.assign({},D,((t={})[w]=y?m+"px":"",t[v]=b?h+"px":"",t.transform="",t))}var h_={passive:!0};var f_={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,s=r.resize,a=void 0===s||s,l=Bw(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach((function(e){e.addEventListener("scroll",n.update,h_)})),a&&l.addEventListener("resize",n.update,h_),function(){o&&c.forEach((function(e){e.removeEventListener("scroll",n.update,h_)})),a&&l.removeEventListener("resize",n.update,h_)}},data:{}},m_={left:"right",right:"left",bottom:"top",top:"bottom"};function g_(e){return e.replace(/left|right|bottom|top/g,(function(e){return m_[e]}))}var b_={start:"end",end:"start"};function y_(e){return e.replace(/start|end/g,(function(e){return b_[e]}))}function v_(e){var t=Bw(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function w_(e){return Qw(t_(e)).left+v_(e).scrollLeft}function __(e){var t=Xw(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function x_(e){return["html","body","#document"].indexOf(Rw(e))>=0?e.ownerDocument.body:Uw(e)&&__(e)?e:x_(n_(e))}function E_(e,t){var n;void 0===t&&(t=[]);var r=x_(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=Bw(r),s=i?[o].concat(o.visualViewport||[],__(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(E_(n_(s)))}function k_(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function M_(e,t,n){return t===Tw?k_(function(e,t){var n=Bw(e),r=t_(e),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var c=Yw();(c||!c&&"fixed"===t)&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+w_(e),y:l}}(e,n)):Pw(t)?function(e,t){var n=Qw(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):k_(function(e){var t,n=t_(e),r=v_(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=Vw(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Vw(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+w_(e),l=-r.scrollTop;return"rtl"===Xw(i||n).direction&&(a+=Vw(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(t_(e)))}function D_(e,t,n,r){var i="clippingParents"===t?function(e){var t=E_(n_(e)),n=["absolute","fixed"].indexOf(Xw(e).position)>=0&&Uw(e)?i_(e):e;return Pw(n)?t.filter((function(e){return Pw(e)&&Zw(e,n)&&"body"!==Rw(e)})):[]}(e):[].concat(t),o=[].concat(i,[n]),s=o[0],a=o.reduce((function(t,n){var i=M_(e,n,r);return t.top=Vw(i.top,t.top),t.right=qw(i.right,t.right),t.bottom=qw(i.bottom,t.bottom),t.left=Vw(i.left,t.left),t}),M_(e,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function C_(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?Ww(i):null,s=i?u_(i):null,a=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case Ew:t={x:a,y:n.y-r.height};break;case kw:t={x:a,y:n.y+n.height};break;case Mw:t={x:n.x+n.width,y:l};break;case Dw:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=o?o_(o):null;if(null!=c){var u="y"===c?"height":"width";switch(s){case Nw:t[c]=t[c]-(n[u]/2-r[u]/2);break;case Aw:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}function S_(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.strategy,s=void 0===o?e.strategy:o,a=n.boundary,l=void 0===a?Ow:a,c=n.rootBoundary,u=void 0===c?Tw:c,d=n.elementContext,p=void 0===d?Iw:d,h=n.altBoundary,f=void 0!==h&&h,m=n.padding,g=void 0===m?0:m,b=a_("number"!=typeof g?g:l_(g,Sw)),y=p===Iw?Lw:Iw,v=e.rects.popper,w=e.elements[f?y:p],_=D_(Pw(w)?w:w.contextElement||t_(e.elements.popper),l,u,s),x=Qw(e.elements.reference),E=C_({reference:x,element:v,strategy:"absolute",placement:i}),k=k_(Object.assign({},v,E)),M=p===Iw?k:x,D={top:_.top-M.top+b.top,bottom:M.bottom-_.bottom+b.bottom,left:_.left-M.left+b.left,right:M.right-_.right+b.right},C=e.modifiersData.offset;if(p===Iw&&C){var S=C[i];Object.keys(D).forEach((function(e){var t=[Mw,kw].indexOf(e)>=0?1:-1,n=[Ew,kw].indexOf(e)>=0?"y":"x";D[e]+=S[n]*t}))}return D}function N_(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?zw:l,u=u_(r),d=u?a?Fw:Fw.filter((function(e){return u_(e)===u})):Sw,p=d.filter((function(e){return c.indexOf(e)>=0}));0===p.length&&(p=d);var h=p.reduce((function(t,n){return t[n]=S_(e,{placement:n,boundary:i,rootBoundary:o,padding:s})[Ww(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var A_={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,f=void 0===h||h,m=n.allowedAutoPlacements,g=t.options.placement,b=Ww(g),y=l||(b===g||!f?[g_(g)]:function(e){if(Ww(e)===Cw)return[];var t=g_(e);return[y_(e),t,y_(t)]}(g)),v=[g].concat(y).reduce((function(e,n){return e.concat(Ww(n)===Cw?N_(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:f,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,_=t.rects.popper,x=new Map,E=!0,k=v[0],M=0;M<v.length;M++){var D=v[M],C=Ww(D),S=u_(D)===Nw,N=[Ew,kw].indexOf(C)>=0,A=N?"width":"height",O=S_(t,{placement:D,boundary:u,rootBoundary:d,altBoundary:p,padding:c}),T=N?S?Mw:Dw:S?kw:Ew;w[A]>_[A]&&(T=g_(T));var I=g_(T),L=[];if(o&&L.push(O[C]<=0),a&&L.push(O[T]<=0,O[I]<=0),L.every((function(e){return e}))){k=D,E=!1;break}x.set(D,L)}if(E)for(var F=function(e){var t=v.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return k=t,"break"},z=f?3:1;z>0;z--){if("break"===F(z))break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function O_(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function T_(e){return[Ew,Mw,kw,Dw].some((function(t){return e[t]>=0}))}var I_={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=S_(t,{elementContext:"reference"}),a=S_(t,{altBoundary:!0}),l=O_(s,r),c=O_(a,i,o),u=T_(l),d=T_(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}};var L_={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,s=zw.reduce((function(e,n){return e[n]=function(e,t,n){var r=Ww(e),i=[Dw,Ew].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[Dw,Mw].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,o),e}),{}),a=s[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}};var F_={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=C_({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var z_={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,h=void 0===p||p,f=n.tetherOffset,m=void 0===f?0:f,g=S_(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),b=Ww(t.placement),y=u_(t.placement),v=!y,w=o_(b),_="x"===w?"y":"x",x=t.modifiersData.popperOffsets,E=t.rects.reference,k=t.rects.popper,M="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,D="number"==typeof M?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),C=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,S={x:0,y:0};if(x){if(o){var N,A="y"===w?Ew:Dw,O="y"===w?kw:Mw,T="y"===w?"height":"width",I=x[w],L=I+g[A],F=I-g[O],z=h?-k[T]/2:0,j=y===Nw?E[T]:k[T],R=y===Nw?-k[T]:-E[T],B=t.elements.arrow,P=h&&B?Jw(B):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},H=U[A],$=U[O],W=s_(0,E[T],P[T]),V=v?E[T]/2-z-W-H-D.mainAxis:j-W-H-D.mainAxis,q=v?-E[T]/2+z+W+$+D.mainAxis:R+W+$+D.mainAxis,K=t.elements.arrow&&i_(t.elements.arrow),G=K?"y"===w?K.clientTop||0:K.clientLeft||0:0,Y=null!=(N=null==C?void 0:C[w])?N:0,Q=I+q-Y,J=s_(h?qw(L,I+V-Y-G):L,I,h?Vw(F,Q):F);x[w]=J,S[w]=J-I}if(a){var Z,X="x"===w?Ew:Dw,ee="x"===w?kw:Mw,te=x[_],ne="y"===_?"height":"width",re=te+g[X],ie=te-g[ee],oe=-1!==[Ew,Dw].indexOf(b),se=null!=(Z=null==C?void 0:C[_])?Z:0,ae=oe?re:te-E[ne]-k[ne]-se+D.altAxis,le=oe?te+E[ne]+k[ne]-se-D.altAxis:ie,ce=h&&oe?function(e,t,n){var r=s_(e,t,n);return r>n?n:r}(ae,te,le):s_(h?ae:re,te,h?le:ie);x[_]=ce,S[_]=ce-te}t.modifiersData[r]=S}},requiresIfExists:["offset"]};function j_(e,t,n){void 0===n&&(n=!1);var r,i,o=Uw(t),s=Uw(t)&&function(e){var t=e.getBoundingClientRect(),n=Kw(t.width)/e.offsetWidth||1,r=Kw(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),a=t_(t),l=Qw(e,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==Rw(t)||__(a))&&(c=(r=t)!==Bw(r)&&Uw(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:v_(r)),Uw(t)?((u=Qw(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):a&&(u.x=w_(a))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function R_(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var B_={placement:"bottom",modifiers:[],strategy:"absolute"};function P_(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function U_(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,i=t.defaultOptions,o=void 0===i?B_:i;return function(e,t,n){void 0===n&&(n=o);var i,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},B_,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,u={state:a,setOptions:function(n){var i="function"==typeof n?n(a.options):n;d(),a.options=Object.assign({},o,a.options,i),a.scrollParents={reference:Pw(e)?E_(e):e.contextElement?E_(e.contextElement):[],popper:E_(t)};var s=function(e){var t=R_(e);return jw.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(r,a.options.modifiers)));return a.orderedModifiers=s.filter((function(e){return e.enabled})),a.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var o=i({state:a,name:t,instance:u,options:r}),s=function(){};l.push(o||s)}})),u.update()},forceUpdate:function(){if(!c){var e=a.elements,t=e.reference,n=e.popper;if(P_(t,n)){a.rects={reference:j_(t,i_(n),"fixed"===a.options.strategy),popper:Jw(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(e){return a.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<a.orderedModifiers.length;r++)if(!0!==a.reset){var i=a.orderedModifiers[r],o=i.fn,s=i.options,l=void 0===s?{}:s,d=i.name;"function"==typeof o&&(a=o({state:a,options:l,name:d,instance:u})||a)}else a.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){u.forceUpdate(),e(a)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(i())}))}))),s}),destroy:function(){d(),c=!0}};if(!P_(e,t))return u;function d(){l.forEach((function(e){return e()})),l=[]}return u.setOptions(n).then((function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)})),u}}var H_=U_({defaultModifiers:[f_,F_,{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,l=void 0===a||a,c={placement:Ww(t.placement),variation:u_(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,p_(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,p_(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},$w,L_,A_,z_,c_,I_]}),$_='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',W_="tippy-box",V_="tippy-content",q_="tippy-backdrop",K_="tippy-arrow",G_="tippy-svg-arrow",Y_={passive:!0,capture:!0},Q_=function(){return document.body};function J_(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Z_(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function X_(e,t){return"function"==typeof e?e.apply(void 0,t):e}function ex(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function tx(e){return[].concat(e)}function nx(e,t){-1===e.indexOf(t)&&e.push(t)}function rx(e){return[].slice.call(e)}function ix(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function ox(){return document.createElement("div")}function sx(e){return["Element","Fragment"].some((function(t){return Z_(e,t)}))}function ax(e){return sx(e)?[e]:function(e){return Z_(e,"NodeList")}(e)?rx(e):Array.isArray(e)?e:rx(document.querySelectorAll(e))}function lx(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function cx(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function ux(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function dx(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var px={isTouch:!1},hx=0;function fx(){px.isTouch||(px.isTouch=!0,window.performance&&document.addEventListener("mousemove",mx))}function mx(){var e=performance.now();e-hx<20&&(px.isTouch=!1,document.removeEventListener("mousemove",mx)),hx=e}function gx(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var bx=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,yx=Object.assign({appendTo:Q_,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),vx=Object.keys(yx);function wx(e){var t=(e.plugins||[]).reduce((function(t,n){var r,i=n.name,o=n.defaultValue;i&&(t[i]=void 0!==e[i]?e[i]:null!=(r=yx[i])?r:o);return t}),{});return Object.assign({},e,t)}function _x(e,t){var n=Object.assign({},t,{content:X_(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(wx(Object.assign({},yx,{plugins:t}))):vx).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},yx.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function xx(e,t){e["innerHTML"]=t}function Ex(e){var t=ox();return!0===e?t.className=K_:(t.className=G_,sx(e)?t.appendChild(e):xx(t,e)),t}function kx(e,t){sx(t.content)?(xx(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?xx(e,t.content):e.textContent=t.content)}function Mx(e){var t=e.firstElementChild,n=rx(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(V_)})),arrow:n.find((function(e){return e.classList.contains(K_)||e.classList.contains(G_)})),backdrop:n.find((function(e){return e.classList.contains(q_)}))}}function Dx(e){var t=ox(),n=ox();n.className=W_,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ox();function i(n,r){var i=Mx(t),o=i.box,s=i.content,a=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||kx(s,e.props),r.arrow?a?n.arrow!==r.arrow&&(o.removeChild(a),o.appendChild(Ex(r.arrow))):o.appendChild(Ex(r.arrow)):a&&o.removeChild(a)}return r.className=V_,r.setAttribute("data-state","hidden"),kx(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}Dx.$$tippy=!0;var Cx=1,Sx=[],Nx=[];function Ax(e,t){var n,r,i,o,s,a,l,c,u=_x(e,Object.assign({},yx,wx(ix(t)))),d=!1,p=!1,h=!1,f=!1,m=[],g=ex(K,u.interactiveDebounce),b=Cx++,y=(c=u.plugins).filter((function(e,t){return c.indexOf(e)===t})),v={id:b,reference:e,popper:ox(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:y,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(i)},setProps:function(t){if(v.state.isDestroyed)return;I("onBeforeUpdate",[v,t]),V();var n=v.props,r=_x(e,Object.assign({},n,ix(t),{ignoreAttributes:!0}));v.props=r,W(),n.interactiveDebounce!==r.interactiveDebounce&&(z(),g=ex(K,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?tx(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");F(),T(),x&&x(n,r);v.popperInstance&&(J(),X().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));I("onAfterUpdate",[v,t])},setContent:function(e){v.setProps({content:e})},show:function(){var e=v.state.isVisible,t=v.state.isDestroyed,n=!v.state.isEnabled,r=px.isTouch&&!v.props.touch,i=J_(v.props.duration,0,yx.duration);if(e||t||n||r)return;if(S().hasAttribute("disabled"))return;if(I("onShow",[v],!1),!1===v.props.onShow(v))return;v.state.isVisible=!0,C()&&(_.style.visibility="visible");T(),P(),v.state.isMounted||(_.style.transition="none");if(C()){var o=A(),s=o.box,l=o.content;lx([s,l],0)}a=function(){var e;if(v.state.isVisible&&!f){if(f=!0,_.offsetHeight,_.style.transition=v.props.moveTransition,C()&&v.props.animation){var t=A(),n=t.box,r=t.content;lx([n,r],i),cx([n,r],"visible")}L(),F(),nx(Nx,v),null==(e=v.popperInstance)||e.forceUpdate(),I("onMount",[v]),v.props.animation&&C()&&function(e,t){H(e,t)}(i,(function(){v.state.isShown=!0,I("onShown",[v])}))}},function(){var e,t=v.props.appendTo,n=S();e=v.props.interactive&&t===Q_||"parent"===t?n.parentNode:X_(t,[n]);e.contains(_)||e.appendChild(_);v.state.isMounted=!0,J()}()},hide:function(){var e=!v.state.isVisible,t=v.state.isDestroyed,n=!v.state.isEnabled,r=J_(v.props.duration,1,yx.duration);if(e||t||n)return;if(I("onHide",[v],!1),!1===v.props.onHide(v))return;v.state.isVisible=!1,v.state.isShown=!1,f=!1,d=!1,C()&&(_.style.visibility="hidden");if(z(),U(),T(!0),C()){var i=A(),o=i.box,s=i.content;v.props.animation&&(lx([o,s],r),cx([o,s],"hidden"))}L(),F(),v.props.animation?C()&&function(e,t){H(e,(function(){!v.state.isVisible&&_.parentNode&&_.parentNode.contains(_)&&t()}))}(r,v.unmount):v.unmount()},hideWithInteractivity:function(e){N().addEventListener("mousemove",g),nx(Sx,g),g(e)},enable:function(){v.state.isEnabled=!0},disable:function(){v.hide(),v.state.isEnabled=!1},unmount:function(){v.state.isVisible&&v.hide();if(!v.state.isMounted)return;Z(),X().forEach((function(e){e._tippy.unmount()})),_.parentNode&&_.parentNode.removeChild(_);Nx=Nx.filter((function(e){return e!==v})),v.state.isMounted=!1,I("onHidden",[v])},destroy:function(){if(v.state.isDestroyed)return;v.clearDelayTimeouts(),v.unmount(),V(),delete e._tippy,v.state.isDestroyed=!0,I("onDestroy",[v])}};if(!u.render)return v;var w=u.render(v),_=w.popper,x=w.onUpdate;_.setAttribute("data-tippy-root",""),_.id="tippy-"+v.id,v.popper=_,e._tippy=v,_._tippy=v;var E=y.map((function(e){return e.fn(v)})),k=e.hasAttribute("aria-expanded");return W(),F(),T(),I("onCreate",[v]),u.showOnCreate&&ee(),_.addEventListener("mouseenter",(function(){v.props.interactive&&v.state.isVisible&&v.clearDelayTimeouts()})),_.addEventListener("mouseleave",(function(){v.props.interactive&&v.props.trigger.indexOf("mouseenter")>=0&&N().addEventListener("mousemove",g)})),v;function M(){var e=v.props.touch;return Array.isArray(e)?e:[e,0]}function D(){return"hold"===M()[0]}function C(){var e;return!(null==(e=v.props.render)||!e.$$tippy)}function S(){return l||e}function N(){var e,t,n=S().parentNode;return n?null!=(t=tx(n)[0])&&null!=(e=t.ownerDocument)&&e.body?t.ownerDocument:document:document}function A(){return Mx(_)}function O(e){return v.state.isMounted&&!v.state.isVisible||px.isTouch||o&&"focus"===o.type?0:J_(v.props.delay,e?0:1,yx.delay)}function T(e){void 0===e&&(e=!1),_.style.pointerEvents=v.props.interactive&&!e?"":"none",_.style.zIndex=""+v.props.zIndex}function I(e,t,n){var r;(void 0===n&&(n=!0),E.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=v.props)[e].apply(r,t)}function L(){var t=v.props.aria;if(t.content){var n="aria-"+t.content,r=_.id;tx(v.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(v.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function F(){!k&&v.props.aria.expanded&&tx(v.props.triggerTarget||e).forEach((function(e){v.props.interactive?e.setAttribute("aria-expanded",v.state.isVisible&&e===S()?"true":"false"):e.removeAttribute("aria-expanded")}))}function z(){N().removeEventListener("mousemove",g),Sx=Sx.filter((function(e){return e!==g}))}function j(t){if(!px.isTouch||!h&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!v.props.interactive||!dx(_,n)){if(tx(v.props.triggerTarget||e).some((function(e){return dx(e,n)}))){if(px.isTouch)return;if(v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else I("onClickOutside",[v,t]);!0===v.props.hideOnClick&&(v.clearDelayTimeouts(),v.hide(),p=!0,setTimeout((function(){p=!1})),v.state.isMounted||U())}}}function R(){h=!0}function B(){h=!1}function P(){var e=N();e.addEventListener("mousedown",j,!0),e.addEventListener("touchend",j,Y_),e.addEventListener("touchstart",B,Y_),e.addEventListener("touchmove",R,Y_)}function U(){var e=N();e.removeEventListener("mousedown",j,!0),e.removeEventListener("touchend",j,Y_),e.removeEventListener("touchstart",B,Y_),e.removeEventListener("touchmove",R,Y_)}function H(e,t){var n=A().box;function r(e){e.target===n&&(ux(n,"remove",r),t())}if(0===e)return t();ux(n,"remove",s),ux(n,"add",r),s=r}function $(t,n,r){void 0===r&&(r=!1),tx(v.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),m.push({node:e,eventType:t,handler:n,options:r})}))}function W(){var e;D()&&($("touchstart",q,{passive:!0}),$("touchend",G,{passive:!0})),(e=v.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch($(e,q),e){case"mouseenter":$("mouseleave",G);break;case"focus":$(bx?"focusout":"blur",Y);break;case"focusin":$("focusout",Y)}}))}function V(){m.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),m=[]}function q(e){var t,n=!1;if(v.state.isEnabled&&!Q(e)&&!p){var r="focus"===(null==(t=o)?void 0:t.type);o=e,l=e.currentTarget,F(),!v.state.isVisible&&Z_(e,"MouseEvent")&&Sx.forEach((function(t){return t(e)})),"click"===e.type&&(v.props.trigger.indexOf("mouseenter")<0||d)&&!1!==v.props.hideOnClick&&v.state.isVisible?n=!0:ee(e),"click"===e.type&&(d=!n),n&&!r&&te(e)}}function K(e){var t=e.target,n=S().contains(t)||_.contains(t);if("mousemove"!==e.type||!n){var r=X().concat(_).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:u}:null})).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,s=i.placement.split("-")[0],a=i.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,c="top"===s?a.bottom.y:0,u="right"===s?a.left.x:0,d="left"===s?a.right.x:0,p=t.top-r+l>o,h=r-t.bottom-c>o,f=t.left-n+u>o,m=n-t.right-d>o;return p||h||f||m}))})(r,e)&&(z(),te(e))}}function G(e){Q(e)||v.props.trigger.indexOf("click")>=0&&d||(v.props.interactive?v.hideWithInteractivity(e):te(e))}function Y(e){v.props.trigger.indexOf("focusin")<0&&e.target!==S()||v.props.interactive&&e.relatedTarget&&_.contains(e.relatedTarget)||te(e)}function Q(e){return!!px.isTouch&&D()!==e.type.indexOf("touch")>=0}function J(){Z();var t=v.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,s=t.moveTransition,l=C()?Mx(_).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||S()}:e,u={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(C()){var n=A().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}},d=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},u];C()&&l&&d.push({name:"arrow",options:{element:l,padding:3}}),d.push.apply(d,(null==n?void 0:n.modifiers)||[]),v.popperInstance=H_(c,_,Object.assign({},n,{placement:r,onFirstUpdate:a,modifiers:d}))}function Z(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function X(){return rx(_.querySelectorAll("[data-tippy-root]"))}function ee(e){v.clearDelayTimeouts(),e&&I("onTrigger",[v,e]),P();var t=O(!0),r=M(),i=r[0],o=r[1];px.isTouch&&"hold"===i&&o&&(t=o),t?n=setTimeout((function(){v.show()}),t):v.show()}function te(e){if(v.clearDelayTimeouts(),I("onUntrigger",[v,e]),v.state.isVisible){if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&d)){var t=O(!1);t?r=setTimeout((function(){v.state.isVisible&&v.hide()}),t):i=requestAnimationFrame((function(){v.hide()}))}}else U()}}function Ox(e,t){void 0===t&&(t={});var n=yx.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",fx,Y_),window.addEventListener("blur",gx);var r=Object.assign({},t,{plugins:n}),i=ax(e).reduce((function(e,t){var n=t&&Ax(t,r);return n&&e.push(n),e}),[]);return sx(e)?i[0]:i}Ox.defaultProps=yx,Ox.setDefaultProps=function(e){Object.keys(e).forEach((function(t){yx[t]=e[t]}))},Ox.currentInput=px,Object.assign({},$w,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),Ox.setDefaultProps({render:Dx});class Tx{constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:e,state:t,from:n,to:r})=>{const{doc:i,selection:o}=t,{empty:s}=o,a=!i.textBetween(n,r).length&&Bv(t.selection),l=this.element.contains(document.activeElement);return!(!e.hasFocus()&&!l||s||a||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.editor=e,this.element=t,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=Ox(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(e=>{this.blurHandler({event:e})})))}update(e,t){var n,r,i;const{state:o,composing:s}=e,{doc:a,selection:l}=o,c=t&&t.doc.eq(a)&&t.selection.eq(l);if(s||c)return;this.createTooltip();const{ranges:u}=l,d=Math.min(...u.map((e=>e.$from.pos))),p=Math.max(...u.map((e=>e.$to.pos)));(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:o,oldState:t,from:d,to:p}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(i=this.tippyOptions)||void 0===i?void 0:i.getReferenceClientRect)||(()=>{if(o.selection instanceof am){const t=e.nodeDOM(d);if(t)return t.getBoundingClientRect()}return iw(e,d,p)})}),this.show()):this.hide()}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Ix=e=>new Em({key:"string"==typeof e.pluginKey?new Dm(e.pluginKey):e.pluginKey,view:t=>new Tx({view:t,...e})});Av.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[Ix({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});class Lx{constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:e,state:t})=>{const{selection:n}=t,{$anchor:r,empty:i}=n,o=1===r.depth,s=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent;return!!(e.hasFocus()&&i&&o&&s&&this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.editor=e,this.element=t,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=Ox(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(e=>{this.blurHandler({event:e})})))}update(e,t){var n,r,i;const{state:o}=e,{doc:s,selection:a}=o,{from:l,to:c}=a;if(t&&t.doc.eq(s)&&t.selection.eq(a))return;this.createTooltip();(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:o,oldState:t}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(i=this.tippyOptions)||void 0===i?void 0:i.getReferenceClientRect)||(()=>iw(e,l,c))}),this.show()):this.hide()}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}Av.create({name:"floatingMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[(e={pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow},new Em({key:"string"==typeof e.pluginKey?new Dm(e.pluginKey):e.pluginKey,view:t=>new Lx({view:t,...e})}))]:[];var e}});const Fx=e=>{const[t,n]=i(null);return a((()=>{if(!t)return;if(e.editor.isDestroyed)return;const{pluginKey:n="bubbleMenu",editor:r,tippyOptions:i={},shouldShow:o=null}=e,s=Ix({pluginKey:n,editor:r,element:t,tippyOptions:i,shouldShow:o});return r.registerPlugin(s),()=>r.unregisterPlugin(n)}),[e.editor,t]),r.createElement("div",{ref:n,className:e.className,style:{visibility:"hidden"}},e.children)};class zx extends class extends class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach((e=>e.apply(this,t))),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter((e=>e!==t)):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout((()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))}),0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=function(e,t){const n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;const r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}(gw,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e){this.setOptions({editable:e}),this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const n=fv(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(e){if(this.isDestroyed)return;const t="string"==typeof e?`${e}$`:e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((e=>!e.key.startsWith(t)))});this.view.updateState(n)}createExtensionManager(){const e=[...this.options.enableCoreExtensions?Object.values(mw):[],...this.options.extensions].filter((e=>["extension","node","mark"].includes(null==e?void 0:e.type)));this.extensionManager=new Cv(e,this)}createCommandManager(){this.commandManager=new av({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=Yv(this.options.content,this.schema,this.options.parseOptions),t=Uv(e,this.options.autofocus);this.view=new Oy(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:_m.create({doc:e,selection:t||void 0})});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews();this.view.dom.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach((e=>{var t;return null===(t=this.capturedTransaction)||void 0===t?void 0:t.step(e)})):void(this.capturedTransaction=e);const t=this.state.apply(e),n=!this.state.selection.eq(t.selection);this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const r=e.getMeta("focus"),i=e.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return Xv(this.state,e)}isActive(e,t){const n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return qv(e,null,n)||nw(e,null,n);const r=Kv(t,e.schema);return"node"===r?qv(e,t,n):"mark"===r&&nw(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(e,t){const n=lf.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return function(e,t){return Ov(e,{from:0,to:e.content.size},t)}(this.state.doc,{blockSeparator:t,textSerializers:{...n,...Tv(this.schema)}})}get isEmpty(){return function(e){var t;const n=null===(t=e.type.createAndFill())||void 0===t?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(null===(e=this.view)||void 0===e?void 0:e.docView)}}{constructor(){super(...arguments),this.contentComponent=null}}const jx=({renderers:e})=>r.createElement(r.Fragment,null,Array.from(e).map((([e,t])=>ue.createPortal(t.reactElement,t.element,e))));class Rx extends r.Component{constructor(e){super(e),this.editorContentRef=r.createRef(),this.state={renderers:new Map}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:e}=this.props;if(e&&e.options.element){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=this,e.createNodeViews()}}componentWillUnmount(){const{editor:e}=this.props;if(!e)return;if(e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild)return;const t=document.createElement("div");t.append(...e.options.element.childNodes),e.setOptions({element:t})}render(){const{editor:e,...t}=this.props;return r.createElement(r.Fragment,null,r.createElement("div",{ref:this.editorContentRef,...t}),r.createElement(jx,{renderers:this.state.renderers}))}}const Bx=r.memo(Rx),Px=l({onDragStart:void 0}),Ux=()=>c(Px),Hx=e=>{const t=e.as||"div",{nodeViewContentRef:n}=Ux();return r.createElement(t,{...e,ref:n,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style}})},$x=r.forwardRef(((e,t)=>{const{onDragStart:n}=Ux(),i=e.as||"div";return r.createElement(i,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})}));class Wx{constructor(e,{editor:t,props:n={},as:r="div",className:i=""}){this.ref=null,this.id=Math.floor(4294967295*Math.random()).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.render()}render(){const e=this.component,t=this.props;(function(e){return!("function"!=typeof e||!e.prototype||!e.prototype.isReactComponent)}(e)||function(e){var t;return!("object"!=typeof e||"Symbol(react.forward_ref)"!==(null===(t=e.$$typeof)||void 0===t?void 0:t.toString()))}(e))&&(t.ref=e=>{this.ref=e}),this.reactElement=r.createElement(e,{...t}),queueMicrotask((()=>{de((()=>{var e;(null===(e=this.editor)||void 0===e?void 0:e.contentComponent)&&this.editor.contentComponent.setState({renderers:this.editor.contentComponent.state.renderers.set(this.id,this)})}))}))}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){queueMicrotask((()=>{de((()=>{var e;if(null===(e=this.editor)||void 0===e?void 0:e.contentComponent){const{renderers:e}=this.editor.contentComponent.state;e.delete(this.id),this.editor.contentComponent.setState({renderers:e})}}))}))}}class Vx extends class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,i,o,s,a;const{view:l}=this.editor,c=e.target,u=3===c.nodeType?null===(t=c.parentElement)||void 0===t?void 0:t.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(c))||!u)return;let d=0,p=0;if(this.dom!==u){const t=this.dom.getBoundingClientRect(),n=u.getBoundingClientRect(),a=null!==(r=e.offsetX)&&void 0!==r?r:null===(i=e.nativeEvent)||void 0===i?void 0:i.offsetX,l=null!==(o=e.offsetY)&&void 0!==o?o:null===(s=e.nativeEvent)||void 0===s?void 0:s.offsetY;d=n.x-t.x+a,p=n.y-t.y+l}null===(a=e.dataTransfer)||void 0===a||a.setDragImage(this.dom,d,p);const h=am.create(l.state.doc,this.getPos()),f=l.state.tr.setSelection(h);l.dispatch(f)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!(null===(t=this.contentDOM)||void 0===t?void 0:t.contains(n))))return!1;const r="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!r)return!0;const{isEditable:i}=this.editor,{isDragging:o}=this,s=!!this.node.type.spec.draggable,a=am.isSelectable(this.node),l="copy"===e.type,c="paste"===e.type,u="cut"===e.type,d="mousedown"===e.type,p=e.type.startsWith("drag");if(!s&&a&&p&&e.preventDefault(),s&&p&&!o)return e.preventDefault(),!1;if(s&&i&&!o&&d){const e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener("dragend",(()=>{this.isDragging=!1}),{once:!0}),document.addEventListener("mouseup",(()=>{this.isDragging=!1}),{once:!0}))}return!(o||r||l||c||u||d&&a)}ignoreMutation(e){if(!this.dom||!this.contentDOM)return!0;if("function"==typeof this.options.ignoreMutation)return this.options.ignoreMutation({mutation:e});if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===e.type)return!1;if(this.dom.contains(e.target)&&"childList"===e.type&&Hv()&&this.editor.isFocused){if([...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every((e=>e.isContentEditable)))return!1}return this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command((({tr:t})=>{const n=this.getPos();return t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0}))}deleteNode(){const e=this.getPos(),t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}}{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const e=e=>e.charAt(0).toUpperCase()+e.substring(1);this.component.displayName=e(this.extension.name)}const t=e=>{const t=this.component,n=this.onDragStart.bind(this);return r.createElement(Px.Provider,{value:{onDragStart:n,nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&e.appendChild(this.contentDOMElement)}}},r.createElement(t,{...e}))};t.displayName="ReactNodeView",this.contentDOMElement=this.node.isLeaf?null:document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let n=this.node.isInline?"span":"div";this.options.as&&(n=this.options.as);const{className:i=""}=this.options;this.renderer=new Wx(t,{editor:this.editor,props:e,as:n,className:`node-${this.node.type.name} ${i}`.trim()})}get dom(){var e;if(this.renderer.element.firstElementChild&&!(null===(e=this.renderer.element.firstElementChild)||void 0===e?void 0:e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(e,t){const n=e=>{this.renderer.updateProps(e)};if(e.type!==this.node.type)return!1;if("function"==typeof this.options.update){const r=this.node,i=this.decorations;return this.node=e,this.decorations=t,this.options.update({oldNode:r,oldDecorations:i,newNode:e,newDecorations:t,updateProps:()=>n({node:e,decorations:t})})}return e===this.node&&this.decorations===t||(this.node=e,this.decorations=t,n({node:e,decorations:t})),!0}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy(),this.contentDOMElement=null}}function qx(e,t){return n=>n.editor.contentComponent?new Vx(e,n,t):{}}const Kx=(e={},t=[])=>{const[n,r]=i(null),o=function(){const[,e]=i(0);return()=>e((e=>e+1))}();return a((()=>{let t=!0;const n=new zx(e);return r(n),n.on("transaction",(()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{t&&o()}))}))})),()=>{n.destroy(),t=!1}}),t),n},Gx=e=>{let{error:t,isFixedMenuActive:n,children:i}=e;const o=!_e(t)&&n,s=qe({"neeto-editor-error":o});return r.createElement(r.Fragment,null,r.createElement("div",{className:s},i),o&&r.createElement("p",{className:"neeto-ui-input__error"},(()=>{if(!t)return null;let e;return he(String,t)?e=t:he(Array,t)?e=t[0]:he(Object,t)&&(e=t.message),_e(e)?null:e})()))},Yx=[Ke.BOLD,Ke.ITALIC,Ke.UNDERLINE,Ke.STRIKETHROUGH,Ke.LINK,Ke.PARAGRAPH,Ke.H1,Ke.H2,Ke.LIST_BULLETS,Ke.LIST_ORDERED,Ke.CODE],Qx=12,Jx=1,Zx=21,Xx=e=>{let{editor:t,isActive:n,children:i}=e;return n&&t?r.createElement(r.Fragment,null,i,r.createElement("p",{className:"neeto-editor-character-count","data-cy":"neeto-editor-character-count"},t.storage.characterCount.characters()," characters")):i},eE=Av.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize"}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){return t.textBetween(0,t.content.size,void 0," ").length}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;return t.textBetween(0,t.content.size," "," ").split(" ").filter((e=>""!==e)).length}},addProseMirrorPlugins(){return[new Em({key:new Dm("characterCount"),filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n)return!0;if(r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r)return!1;if(!e.getMeta("paste"))return!1;const o=e.selection.$head.pos,s=o-(i-n),a=o;e.deleteRange(s,a);return!(this.storage.characters({node:e.doc})>n)}})]}}),tE=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,nE=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,rE=ww.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[bw({find:tE,type:this.type})]},addPasteRules(){return[xw({find:nE,type:this.type})]}}),iE=_w.create({name:"doc",topNode:!0,content:"block+"}),oE=Av.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new Em({key:new Dm("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,o=[];if(!n||!r)return uy.create(e,[]);let s=0;"deepest"===this.options.mode&&e.descendants(((e,t)=>{if(e.isText)return;if(!(i>=t&&i<=t+e.nodeSize-1))return!1;s+=1}));let a=0;return e.descendants(((e,t)=>{if(e.isText)return!1;if(!(i>=t&&i<=t+e.nodeSize-1))return!1;a+=1;if("deepest"===this.options.mode&&s-a>0||"shallowest"===this.options.mode&&a>1)return"deepest"===this.options.mode;o.push(ay.node(t,t+e.nodeSize,{class:this.options.className}))})),uy.create(e,o)}}})]}}),sE=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,aE=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,lE=ww.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}`}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:e}){return["mark",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[bw({find:sE,type:this.type})]},addPasteRules(){return[xw({find:aE,type:this.type})]}});function cE(e){this.j={},this.jr=[],this.jd=null,this.t=e}cE.prototype={accepts:function(){return!!this.t},tt:function(e,t){if(t&&t.j)return this.j[e]=t,t;var n=t,r=this.j[e];if(r)return n&&(r.t=n),r;r=uE();var i=fE(this,e);return i?(Object.assign(r.j,i.j),r.jr.append(i.jr),r.jr=i.jd,r.t=n||i.t):r.t=n,this.j[e]=r,r}};var uE=function(){return new cE},dE=function(e){return new cE(e)},pE=function(e,t,n){e.j[t]||(e.j[t]=n)},hE=function(e,t,n){e.jr.push([t,n])},fE=function(e,t){var n=e.j[t];if(n)return n;for(var r=0;r<e.jr.length;r++){var i=e.jr[r][0],o=e.jr[r][1];if(i.test(t))return o}return e.jd},mE=function(e,t,n){for(var r=0;r<t.length;r++)pE(e,t[r],n)},gE=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0],i=t[n][1];pE(e,r,i)}},bE=function(e,t,n,r){for(var i,o=0,s=t.length;o<s&&(i=e.j[t[o]]);)e=i,o++;if(o>=s)return[];for(;o<s-1;)i=r(),pE(e,t[o],i),e=i,o++;pE(e,t[s-1],n)},yE="DOMAIN",vE="LOCALHOST",wE="TLD",_E="NUM",xE="PROTOCOL",EE="MAILTO",kE="WS",ME="NL",DE="OPENBRACE",CE="OPENBRACKET",SE="OPENANGLEBRACKET",NE="OPENPAREN",AE="CLOSEBRACE",OE="CLOSEBRACKET",TE="CLOSEANGLEBRACKET",IE="CLOSEPAREN",LE="AMPERSAND",FE="APOSTROPHE",zE="ASTERISK",jE="AT",RE="BACKSLASH",BE="BACKTICK",PE="CARET",UE="COLON",HE="COMMA",$E="DOLLAR",WE="DOT",VE="EQUALS",qE="EXCLAMATION",KE="HYPHEN",GE="PERCENT",YE="PIPE",QE="PLUS",JE="POUND",ZE="QUERY",XE="QUOTE",ek="SEMI",tk="SLASH",nk="TILDE",rk="UNDERSCORE",ik="SYM",ok=Object.freeze({__proto__:null,DOMAIN:yE,LOCALHOST:vE,TLD:wE,NUM:_E,PROTOCOL:xE,MAILTO:EE,WS:kE,NL:ME,OPENBRACE:DE,OPENBRACKET:CE,OPENANGLEBRACKET:SE,OPENPAREN:NE,CLOSEBRACE:AE,CLOSEBRACKET:OE,CLOSEANGLEBRACKET:TE,CLOSEPAREN:IE,AMPERSAND:LE,APOSTROPHE:FE,ASTERISK:zE,AT:jE,BACKSLASH:RE,BACKTICK:BE,CARET:PE,COLON:UE,COMMA:HE,DOLLAR:$E,DOT:WE,EQUALS:VE,EXCLAMATION:qE,HYPHEN:KE,PERCENT:GE,PIPE:YE,PLUS:QE,POUND:JE,QUERY:ZE,QUOTE:XE,SEMI:ek,SLASH:tk,TILDE:nk,UNDERSCORE:rk,SYM:ik}),sk="aaa aarp abarth abb abbott abbvie abc able abogado abudhabi ac academy accenture accountant accountants aco actor ad adac ads adult ae aeg aero aetna af afamilycompany afl africa ag agakhan agency ai aig airbus airforce airtel akdn al alfaromeo alibaba alipay allfinanz allstate ally alsace alstom am amazon americanexpress americanfamily amex amfam amica amsterdam analytics android anquan anz ao aol apartments app apple aq aquarelle ar arab aramco archi army arpa art arte as asda asia associates at athleta attorney au auction audi audible audio auspost author auto autos avianca aw aws ax axa az azure ba baby baidu banamex bananarepublic band bank bar barcelona barclaycard barclays barefoot bargains baseball basketball bauhaus bayern bb bbc bbt bbva bcg bcn bd be beats beauty beer bentley berlin best bestbuy bet bf bg bh bharti bi bible bid bike bing bingo bio biz bj black blackfriday blockbuster blog bloomberg blue bm bms bmw bn bnpparibas bo boats boehringer bofa bom bond boo book booking bosch bostik boston bot boutique box br bradesco bridgestone broadway broker brother brussels bs bt budapest bugatti build builders business buy buzz bv bw by bz bzh ca cab cafe cal call calvinklein cam camera camp cancerresearch canon capetown capital capitalone car caravan cards care career careers cars casa case cash casino cat catering catholic cba cbn cbre cbs cc cd center ceo cern cf cfa cfd cg ch chanel channel charity chase chat cheap chintai christmas chrome church ci cipriani circle cisco citadel citi citic city cityeats ck cl claims cleaning click clinic clinique clothing cloud club clubmed cm cn co coach codes coffee college cologne com comcast commbank community company compare computer comsec condos construction consulting contact contractors cooking cookingchannel cool coop corsica country coupon coupons courses cpa cr credit creditcard creditunion cricket crown crs cruise cruises csc cu cuisinella cv cw cx cy cymru cyou cz dabur dad dance data date dating datsun day dclk dds de deal dealer deals degree delivery dell deloitte delta democrat dental dentist desi design dev dhl diamonds diet digital direct directory discount discover dish diy dj dk dm dnp do docs doctor dog domains dot download drive dtv dubai duck dunlop dupont durban dvag dvr dz earth eat ec eco edeka edu education ee eg email emerck energy engineer engineering enterprises epson equipment er ericsson erni es esq estate et etisalat eu eurovision eus events exchange expert exposed express extraspace fage fail fairwinds faith family fan fans farm farmers fashion fast fedex feedback ferrari ferrero fi fiat fidelity fido film final finance financial fire firestone firmdale fish fishing fit fitness fj fk flickr flights flir florist flowers fly fm fo foo food foodnetwork football ford forex forsale forum foundation fox fr free fresenius frl frogans frontdoor frontier ftr fujitsu fujixerox fun fund furniture futbol fyi ga gal gallery gallo gallup game games gap garden gay gb gbiz gd gdn ge gea gent genting george gf gg ggee gh gi gift gifts gives giving gl glade glass gle global globo gm gmail gmbh gmo gmx gn godaddy gold goldpoint golf goo goodyear goog google gop got gov gp gq gr grainger graphics gratis green gripe grocery group gs gt gu guardian gucci guge guide guitars guru gw gy hair hamburg hangout haus hbo hdfc hdfcbank health healthcare help helsinki here hermes hgtv hiphop hisamitsu hitachi hiv hk hkt hm hn hockey holdings holiday homedepot homegoods homes homesense honda horse hospital host hosting hot hoteles hotels hotmail house how hr hsbc ht hu hughes hyatt hyundai ibm icbc ice icu id ie ieee ifm ikano il im imamat imdb immo immobilien in inc industries infiniti info ing ink institute insurance insure int international intuit investments io ipiranga iq ir irish is ismaili ist istanbul it itau itv iveco jaguar java jcb je jeep jetzt jewelry jio jll jm jmp jnj jo jobs joburg jot joy jp jpmorgan jprs juegos juniper kaufen kddi ke kerryhotels kerrylogistics kerryproperties kfh kg kh ki kia kim kinder kindle kitchen kiwi km kn koeln komatsu kosher kp kpmg kpn kr krd kred kuokgroup kw ky kyoto kz la lacaixa lamborghini lamer lancaster lancia land landrover lanxess lasalle lat latino latrobe law lawyer lb lc lds lease leclerc lefrak legal lego lexus lgbt li lidl life lifeinsurance lifestyle lighting like lilly limited limo lincoln linde link lipsy live living lixil lk llc llp loan loans locker locus loft lol london lotte lotto love lpl lplfinancial lr ls lt ltd ltda lu lundbeck luxe luxury lv ly ma macys madrid maif maison makeup man management mango map market marketing markets marriott marshalls maserati mattel mba mc mckinsey md me med media meet melbourne meme memorial men menu merckmsd mg mh miami microsoft mil mini mint mit mitsubishi mk ml mlb mls mm mma mn mo mobi mobile moda moe moi mom monash money monster mormon mortgage moscow moto motorcycles mov movie mp mq mr ms msd mt mtn mtr mu museum mutual mv mw mx my mz na nab nagoya name nationwide natura navy nba nc ne nec net netbank netflix network neustar new news next nextdirect nexus nf nfl ng ngo nhk ni nico nike nikon ninja nissan nissay nl no nokia northwesternmutual norton now nowruz nowtv np nr nra nrw ntt nu nyc nz obi observer off office okinawa olayan olayangroup oldnavy ollo om omega one ong onl online onyourside ooo open oracle orange org organic origins osaka otsuka ott ovh pa page panasonic paris pars partners parts party passagens pay pccw pe pet pf pfizer pg ph pharmacy phd philips phone photo photography photos physio pics pictet pictures pid pin ping pink pioneer pizza pk pl place play playstation plumbing plus pm pn pnc pohl poker politie porn post pr pramerica praxi press prime pro prod productions prof progressive promo properties property protection pru prudential ps pt pub pw pwc py qa qpon quebec quest qvc racing radio raid re read realestate realtor realty recipes red redstone redumbrella rehab reise reisen reit reliance ren rent rentals repair report republican rest restaurant review reviews rexroth rich richardli ricoh ril rio rip rmit ro rocher rocks rodeo rogers room rs rsvp ru rugby ruhr run rw rwe ryukyu sa saarland safe safety sakura sale salon samsclub samsung sandvik sandvikcoromant sanofi sap sarl sas save saxo sb sbi sbs sc sca scb schaeffler schmidt scholarships school schule schwarz science scjohnson scot sd se search seat secure security seek select sener services ses seven sew sex sexy sfr sg sh shangrila sharp shaw shell shia shiksha shoes shop shopping shouji show showtime si silk sina singles site sj sk ski skin sky skype sl sling sm smart smile sn sncf so soccer social softbank software sohu solar solutions song sony soy spa space sport spot spreadbetting sr srl ss st stada staples star statebank statefarm stc stcgroup stockholm storage store stream studio study style su sucks supplies supply support surf surgery suzuki sv swatch swiftcover swiss sx sy sydney systems sz tab taipei talk taobao target tatamotors tatar tattoo tax taxi tc tci td tdk team tech technology tel temasek tennis teva tf tg th thd theater theatre tiaa tickets tienda tiffany tips tires tirol tj tjmaxx tjx tk tkmaxx tl tm tmall tn to today tokyo tools top toray toshiba total tours town toyota toys tr trade trading training travel travelchannel travelers travelersinsurance trust trv tt tube tui tunes tushu tv tvs tw tz ua ubank ubs ug uk unicom university uno uol ups us uy uz va vacations vana vanguard vc ve vegas ventures verisign versicherung vet vg vi viajes video vig viking villas vin vip virgin visa vision viva vivo vlaanderen vn vodka volkswagen volvo vote voting voto voyage vu vuelos wales walmart walter wang wanggou watch watches weather weatherchannel webcam weber website wed wedding weibo weir wf whoswho wien wiki williamhill win windows wine winners wme wolterskluwer woodside work works world wow ws wtc wtf xbox xerox xfinity xihuan xin xxx xyz yachts yahoo yamaxun yandex ye yodobashi yoga yokohama you youtube yt yun za zappos zara zero zip zm zone zuerich zw vermögensberater-ctb vermögensberatung-pwb ελ ευ бг бел дети ею католик ком қаз мкд мон москва онлайн орг рус рф сайт срб укр გე հայ ישראל קום ابوظبي اتصالات ارامكو الاردن البحرين الجزائر السعودية العليان المغرب امارات ایران بارت بازار بھارت بيتك پاکستان ڀارت تونس سودان سورية شبكة عراق عرب عمان فلسطين قطر كاثوليك كوم مصر مليسيا موريتانيا موقع همراه कॉम नेट भारत भारतम् भारोत संगठन বাংলা ভারত ভাৰত ਭਾਰਤ ભારત ଭାରତ இந்தியா இலங்கை சிங்கப்பூர் భారత్ ಭಾರತ ഭാരതം ලංකා คอม ไทย ລາວ 닷넷 닷컴 삼성 한국 アマゾン グーグル クラウド コム ストア セール ファッション ポイント みんな 世界 中信 中国 中國 中文网 亚马逊 企业 佛山 信息 健康 八卦 公司 公益 台湾 台灣 商城 商店 商标 嘉里 嘉里大酒店 在线 大众汽车 大拿 天主教 娱乐 家電 广东 微博 慈善 我爱你 手机 招聘 政务 政府 新加坡 新闻 时尚 書籍 机构 淡马锡 游戏 澳門 点看 移动 组织机构 网址 网店 网站 网络 联通 诺基亚 谷歌 购物 通販 集团 電訊盈科 飞利浦 食品 餐厅 香格里拉 香港".split(" "),ak=/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/,lk=/(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEDD-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDDFF\uDE70-\uDE74\uDE78-\uDE7C\uDE80-\uDE86\uDE90-\uDEAC\uDEB0-\uDEBA\uDEC0-\uDEC5\uDED0-\uDED9\uDEE0-\uDEE7\uDEF0-\uDEF6])/,ck=/\uFE0F/,uk=/\d/,dk=/\s/;function pk(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=uE(),n=dE(_E),r=dE(yE),i=uE(),o=dE(kE),s=[[uk,r],[ak,r],[lk,r],[ck,r]],a=function(){var e=dE(yE);return e.j={"-":i},e.jr=[].concat(s),e},l=function(e){var t=a();return t.t=e,t};gE(t,[["'",dE(FE)],["{",dE(DE)],["[",dE(CE)],["<",dE(SE)],["(",dE(NE)],["}",dE(AE)],["]",dE(OE)],[">",dE(TE)],[")",dE(IE)],["&",dE(LE)],["*",dE(zE)],["@",dE(jE)],["`",dE(BE)],["^",dE(PE)],[":",dE(UE)],[",",dE(HE)],["$",dE($E)],[".",dE(WE)],["=",dE(VE)],["!",dE(qE)],["-",dE(KE)],["%",dE(GE)],["|",dE(YE)],["+",dE(QE)],["#",dE(JE)],["?",dE(ZE)],['"',dE(XE)],["/",dE(tk)],[";",dE(ek)],["~",dE(nk)],["_",dE(rk)],["\\",dE(RE)]]),pE(t,"\n",dE(ME)),hE(t,dk,o),pE(o,"\n",uE()),hE(o,dk,o);for(var c=0;c<sk.length;c++)bE(t,sk[c],l(wE),a);var u=a(),d=a(),p=a(),h=a();bE(t,"file",u,a),bE(t,"ftp",d,a),bE(t,"http",p,a),bE(t,"mailto",h,a);var f=a(),m=dE(xE),g=dE(EE);pE(d,"s",f),pE(d,":",m),pE(p,"s",f),pE(p,":",m),pE(u,":",m),pE(f,":",m),pE(h,":",g);for(var b=a(),y=0;y<e.length;y++)bE(t,e[y],b,a);return pE(b,":",m),bE(t,"localhost",l(vE),a),hE(t,uk,n),hE(t,ak,r),hE(t,lk,r),hE(t,ck,r),hE(n,uk,n),hE(n,ak,r),hE(n,lk,r),hE(n,ck,r),pE(n,"-",i),pE(r,"-",i),pE(i,"-",i),hE(r,uk,r),hE(r,ak,r),hE(r,lk,r),hE(r,ck,r),hE(i,uk,r),hE(i,ak,r),hE(i,lk,r),hE(i,ck,r),t.jd=dE(ik),t}var hk={defaultProtocol:"http",events:null,format:fk,formatHref:fk,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:0,className:null,attributes:null,ignoreTags:[]};function fk(e){return e}function mk(){}function gk(e,t){function n(t,n){this.t=e,this.v=t,this.tk=n}return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Object.create(e.prototype);for(var i in n)r[i]=n[i];r.constructor=t,t.prototype=r}(mk,n,t),n}mk.prototype={t:"token",isLink:!1,toString:function(){return this.v},toHref:function(){return this.toString()},startIndex:function(){return this.tk[0].s},endIndex:function(){return this.tk[this.tk.length-1].e},toObject:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hk.defaultProtocol;return{type:this.t,value:this.v,isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}}};var bk=gk("email",{isLink:!0}),yk=gk("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),vk=gk("text"),wk=gk("nl"),_k=gk("url",{isLink:!0,toHref:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hk.defaultProtocol,t=this.tk,n=!1,r=!1,i=[],o=0;t[o].t===xE;)n=!0,i.push(t[o].v),o++;for(;t[o].t===tk;)r=!0,i.push(t[o].v),o++;for(;o<t.length;o++)i.push(t[o].v);return i=i.join(""),n||r||(i="".concat(e,"://").concat(i)),i},hasProtocol:function(){return this.tk[0].t===xE}}),xk=Object.freeze({__proto__:null,MultiToken:mk,Base:mk,createTokenClass:gk,MailtoEmail:bk,Email:yk,Text:vk,Nl:wk,Url:_k});function Ek(){var e=uE(),t=uE(),n=uE(),r=uE(),i=uE(),o=uE(),s=uE(),a=dE(_k),l=uE(),c=dE(_k),u=dE(_k),d=uE(),p=uE(),h=uE(),f=uE(),m=uE(),g=dE(_k),b=dE(_k),y=dE(_k),v=dE(_k),w=uE(),_=uE(),x=uE(),E=uE(),k=uE(),M=uE(),D=dE(yk),C=uE(),S=dE(yk),N=dE(bk),A=uE(),O=uE(),T=uE(),I=uE(),L=dE(wk);pE(e,ME,L),pE(e,xE,t),pE(e,EE,n),pE(t,tk,r),pE(r,tk,i),pE(e,wE,o),pE(e,yE,o),pE(e,vE,a),pE(e,_E,o),pE(i,wE,u),pE(i,yE,u),pE(i,_E,u),pE(i,vE,u),pE(o,WE,s),pE(k,WE,M),pE(s,wE,a),pE(s,yE,o),pE(s,_E,o),pE(s,vE,o),pE(M,wE,D),pE(M,yE,k),pE(M,_E,k),pE(M,vE,k),pE(a,WE,s),pE(D,WE,M),pE(a,UE,l),pE(a,tk,u),pE(l,_E,c),pE(c,tk,u),pE(D,UE,C),pE(C,_E,S);var F=[LE,zE,jE,RE,BE,PE,$E,yE,VE,KE,vE,_E,GE,YE,QE,JE,xE,tk,ik,nk,wE,rk],z=[FE,TE,AE,OE,IE,UE,HE,WE,qE,SE,DE,CE,NE,ZE,XE,ek];pE(u,DE,p),pE(u,CE,h),pE(u,SE,f),pE(u,NE,m),pE(d,DE,p),pE(d,CE,h),pE(d,SE,f),pE(d,NE,m),pE(p,AE,u),pE(h,OE,u),pE(f,TE,u),pE(m,IE,u),pE(g,AE,u),pE(b,OE,u),pE(y,TE,u),pE(v,IE,u),pE(w,AE,u),pE(_,OE,u),pE(x,TE,u),pE(E,IE,u),mE(p,F,g),mE(h,F,b),mE(f,F,y),mE(m,F,v),mE(p,z,w),mE(h,z,_),mE(f,z,x),mE(m,z,E),mE(g,F,g),mE(b,F,b),mE(y,F,y),mE(v,F,v),mE(g,z,g),mE(b,z,b),mE(y,z,y),mE(v,z,v),mE(w,F,g),mE(_,F,b),mE(x,F,y),mE(E,F,v),mE(w,z,w),mE(_,z,_),mE(x,z,x),mE(E,z,E),mE(u,F,u),mE(d,F,u),mE(u,z,d),mE(d,z,d),pE(n,wE,N),pE(n,yE,N),pE(n,_E,N),pE(n,vE,N),mE(N,F,N),mE(N,z,A),mE(A,F,N),mE(A,z,A);var j=[LE,FE,zE,RE,BE,PE,AE,$E,yE,VE,KE,_E,DE,GE,YE,QE,JE,ZE,tk,ik,nk,wE,rk];return mE(o,j,O),pE(o,jE,T),mE(a,j,O),pE(a,jE,T),mE(s,j,O),mE(O,j,O),pE(O,jE,T),pE(O,WE,I),mE(I,j,O),pE(T,wE,k),pE(T,yE,k),pE(T,_E,k),pE(T,vE,D),e}function kk(e,t,n){var r=n[0].s,i=n[n.length-1].e;return new e(t.substr(r,i-r),n)}var Mk="undefined"!=typeof console&&console&&console.warn||function(){},Dk={scanner:null,parser:null,pluginQueue:[],customProtocols:[],initialized:!1};function Ck(e){if(Dk.initialized&&Mk('linkifyjs: already initialized - will not register custom protocol "'.concat(e,'" until you manually call linkify.init(). To avoid this warning, please register all custom protocols before invoking linkify the first time.')),!/^[a-z-]+$/.test(e))throw Error("linkifyjs: protocols containing characters other than a-z or - (hyphen) are not supported");Dk.customProtocols.push(e)}function Sk(e){return Dk.initialized||function(){Dk.scanner={start:pk(Dk.customProtocols),tokens:ok},Dk.parser={start:Ek(),tokens:xk};for(var e={createTokenClass:gk},t=0;t<Dk.pluginQueue.length;t++)Dk.pluginQueue[t][1]({scanner:Dk.scanner,parser:Dk.parser,utils:e});Dk.initialized=!0}(),function(e,t,n){for(var r=n.length,i=0,o=[],s=[];i<r;){for(var a=e,l=null,c=null,u=0,d=null,p=-1;i<r&&!(l=fE(a,n[i].t));)s.push(n[i++]);for(;i<r&&(c=l||fE(a,n[i].t));)l=null,(a=c).accepts()?(p=0,d=a):p>=0&&p++,i++,u++;if(p<0)for(var h=i-u;h<i;h++)s.push(n[h]);else{s.length>0&&(o.push(kk(vk,t,s)),s=[]),i-=p,u-=p;var f=d.t,m=n.slice(i-u,i);o.push(kk(f,t,m))}}return s.length>0&&o.push(kk(vk,t,s)),o}(Dk.parser.start,e,function(e,t){for(var n=function(e){for(var t=[],n=e.length,r=0;r<n;){var i=e.charCodeAt(r),o=void 0,s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,(function(e){return e.toLowerCase()}))),r=n.length,i=[],o=0,s=0;s<r;){for(var a=e,l=null,c=0,u=null,d=-1,p=-1;s<r&&(l=fE(a,n[s]));)(a=l).accepts()?(d=0,p=0,u=a):d>=0&&(d+=n[s].length,p++),c+=n[s].length,o+=n[s].length,s++;o-=d,s-=p,c-=d,i.push({t:u.t,v:t.substr(o-c,c),s:o-c,e:o})}return i}(Dk.scanner.start,e))}function Nk(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Sk(e),r=[],i=0;i<n.length;i++){var o=n[i];!o.isLink||t&&o.t!==t||r.push(o.toObject())}return r}function Ak(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Sk(e);return 1===n.length&&n[0].isLink&&(!t||n[0].t===t)}function Ok(e){return new Em({key:new Dm("autolink"),appendTransaction:(t,n,r)=>{const i=t.some((e=>e.docChanged))&&!n.doc.eq(r.doc),o=t.some((e=>e.getMeta("preventAutolink")));if(!i||o)return;const{tr:s}=r,a=function(e,t){const n=new Xf(e);return t.forEach((e=>{e.steps.forEach((e=>{n.step(e)}))})),n}(n.doc,[...t]),{mapping:l}=a,c=function(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach(((e,i)=>{const o=[];if(e.ranges.length)e.forEach(((e,t)=>{o.push({from:e,to:t})}));else{const{from:e,to:t}=n[i];if(void 0===e||void 0===t)return;o.push({from:e,to:t})}o.forEach((({from:e,to:n})=>{const o=t.slice(i).map(e,-1),s=t.slice(i).map(n),a=t.invert().map(o,-1),l=t.invert().map(s);r.push({oldRange:{from:a,to:l},newRange:{from:o,to:s}})}))})),ew(r)}(a);return c.forEach((({oldRange:t,newRange:i})=>{tw(t.from,t.to,n.doc).filter((t=>t.mark.type===e.type)).forEach((t=>{const i=tw(l.map(t.from),l.map(t.to),r.doc).filter((t=>t.mark.type===e.type));if(!i.length)return;const o=i[0],a=n.doc.textBetween(t.from,t.to,void 0," "),c=r.doc.textBetween(o.from,o.to,void 0," "),u=Ak(a),d=Ak(c);u&&!d&&s.removeMark(o.from,o.to,e.type)}));const o=function(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,((e,t)=>{n(e)&&r.push({node:e,pos:t})})),r}(r.doc,i,(e=>e.isTextblock));let a,c;if(o.length>1?(a=o[0],c=r.doc.textBetween(a.pos,a.pos+a.node.nodeSize,void 0," ")):o.length&&r.doc.textBetween(i.from,i.to," "," ").endsWith(" ")&&(a=o[0],c=r.doc.textBetween(a.pos,i.to,void 0," ")),a&&c){const t=c.split(" ").filter((e=>""!==e));if(t.length<=0)return!1;const n=t[t.length-1],r=a.pos+c.lastIndexOf(n);if(!n)return!1;Nk(n).filter((e=>e.isLink)).filter((t=>!e.validate||e.validate(t.value))).map((e=>({...e,from:r+e.start+1,to:r+e.end+1}))).forEach((t=>{s.addMark(t.from,t.to,e.type.create({href:t.href}))}))}})),s.steps.length?s:void 0}})}const Tk=ww.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(Ck)},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},class:{default:this.options.HTMLAttributes.class}}},parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:e}){return["a",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{setLink:e=>({chain:t})=>t().setMark(this.name,e).setMeta("preventAutolink",!0).run(),toggleLink:e=>({chain:t})=>t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[xw({find:e=>Nk(e).filter((e=>!this.options.validate||this.options.validate(e.value))).filter((e=>e.isLink)).map((e=>({text:e.value,index:e.start,data:e}))),type:this.type,getAttributes:e=>{var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[];var t;return this.options.autolink&&e.push(Ok({type:this.type,validate:this.options.validate})),this.options.openOnClick&&e.push((t={type:this.type},new Em({key:new Dm("handleClickLink"),props:{handleClick:(e,n,r)=>{var i;const o=Xv(e.state,t.type.name);return!(!(null===(i=r.target)||void 0===i?void 0:i.closest("a"))||!o.href||(window.open(o.href,o.target),0))}}}))),this.options.linkOnPaste&&e.push(function(e){return new Em({key:new Dm("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{state:i}=t,{selection:o}=i,{empty:s}=o;if(s)return!1;let a="";r.content.forEach((e=>{a+=e.textContent}));const l=Nk(a).find((e=>e.isLink&&e.value===a));return!(!a||!l||(e.editor.commands.setMark(e.type,{href:l.href}),0))}}})}({editor:this.editor,type:this.type})),e}}),Ik=ww.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Lk=/^\s*>\s$/,Fk=_w.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[vw({find:Lk,type:this.type})]}}),zk=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,jk=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,Rk=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Bk=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Pk=ww.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],renderHTML({HTMLAttributes:e}){return["strong",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[bw({find:zk,type:this.type}),bw({find:Rk,type:this.type})]},addPasteRules(){return[xw({find:jk,type:this.type}),xw({find:Bk,type:this.type})]}}),Uk=/^\s*([-+*])\s$/,Hk=_w.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[vw({find:Uk,type:this.type})]}}),$k=/^```([a-z]+)?[\s\n]$/,Wk=/^~~~([a-z]+)?[\s\n]$/,Vk=_w.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,r=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter((e=>e.startsWith(n))).map((e=>e.replace(n,"")))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",pv(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes())},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!(!o||!s)&&e.chain().command((({tr:e})=>(e.delete(r.pos-2,r.pos),!0))).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type)return!1;if(!(i.parentOffset===i.parent.nodeSize-2))return!1;const s=i.after();if(void 0===s)return!1;return!r.nodeAt(s)&&e.commands.exitCode()}}},addInputRules(){return[yw({find:$k,type:this.type,getAttributes:e=>({language:e[1]})}),yw({find:Wk,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Em({key:new Dm("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=null==i?void 0:i.mode;if(!n||!o)return!1;const{tr:s}=e.state;return s.replaceSelectionWith(this.type.create({language:o})),s.setSelection(om.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,"\n")),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}});function qk(e={}){return new Em({view:t=>new Kk(t,e)})}class Kk{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map((t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))}destroy(){this.handlers.forEach((({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t)))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),i=n?t.bottom:t.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:t.left,right:t.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos);e={left:t.left-this.width/2,right:t.left+this.width/2,top:t.top,bottom:t.bottom}}let n,r,i=this.editorView.dom.offsetParent;if(this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!i||i==document.body&&"static"==getComputedStyle(i).position)n=-pageXOffset,r=-pageYOffset;else{let e=i.getBoundingClientRect();n=e.left-i.scrollLeft,r=e.top-i.scrollTop}this.element.style.left=e.left-n+"px",this.element.style.top=e.top-r+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,t):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&(e=Bf(this.editorView.state.doc,e,this.editorView.dragging.slice),null==e))return this.setCursor(null);this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const Gk=Av.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[qk(this.options)]}});class Yk extends tm{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return Yk.valid(n)?new Yk(n):tm.near(n)}content(){return uh.empty}eq(e){return e instanceof Yk&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new Yk(e.resolve(t.pos))}getBookmark(){return new Qk(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&Yk.valid(e))return e;let r=e.pos,i=null;for(let n=e.depth;;n--){let o=e.node(n);if(t>0?e.indexAfter(n)<o.childCount:e.index(n)>0){i=o.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(Yk.valid(s))return s}for(;;){let o=t>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!am.isSelectable(i)){e=e.doc.resolve(r+i.nodeSize*t),n=!1;continue e}break}i=o,r+=t;let s=e.doc.resolve(r);if(Yk.valid(s))return s}return null}}}Yk.prototype.visible=!1,Yk.findFrom=Yk.findGapCursorFrom,tm.jsonID("gapcursor",Yk);class Qk{constructor(e){this.pos=e}map(e){return new Qk(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Yk.valid(t)?new Yk(t):tm.near(t)}}const Jk=Gy({ArrowLeft:Zk("horiz",-1),ArrowRight:Zk("horiz",1),ArrowUp:Zk("vert",-1),ArrowDown:Zk("vert",1)});function Zk(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,i){let o=e.selection,s=t>0?o.$to:o.$from,a=o.empty;if(o instanceof om){if(!i.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=Yk.findGapCursorFrom(s,t,a);return!!l&&(r&&r(e.tr.setSelection(new Yk(l))),!0)}}function Xk(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Yk.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&am.isSelectable(e.state.doc.nodeAt(i.inside)))&&(e.dispatch(e.state.tr.setSelection(new Yk(r))),!0)}function eM(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof Yk))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=ih.empty;for(let e=r.length-1;e>=0;e--)i=ih.from(r[e].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new uh(i,0,0));return o.setSelection(om.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function tM(e){if(!(e.selection instanceof Yk))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",uy.create(e.doc,[ay.widget(e.selection.head,t,{key:"gapcursor"})])}const nM=Av.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Em({props:{decorations:tM,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&Yk.valid(n)?new Yk(n):null,handleClick:Xk,handleKeyDown:Jk,handleDOMEvents:{beforeinput:eM}}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=mv(lv(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),rM=_w.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",pv(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command((()=>{const{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:s}=r.extensionManager,a=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{if(t&&a&&o){const t=a.filter((e=>s.includes(e.type.name)));e.ensureMarks(t)}return!0})).run()}))])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),iM=_w.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((e=>({tag:`h${e}`,attrs:{level:e}})))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,pv(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce(((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})})),{})},addInputRules(){return this.options.levels.map((e=>yw({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}})))}});var oM=200,sM=function(){};sM.prototype.append=function(e){return e.length?(e=sM.from(e),!this.length&&e||e.length<oM&&this.leafAppend(e)||this.length<oM&&e.leafPrepend(this)||this.appendInner(e)):this},sM.prototype.prepend=function(e){return e.length?sM.from(e).append(this):this},sM.prototype.appendInner=function(e){return new lM(this,e)},sM.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?sM.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},sM.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},sM.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},sM.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},sM.from=function(e){return e instanceof sM?e:e&&e.length?new aM(e):sM.empty};var aM=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=oM)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=oM)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(sM);sM.empty=new aM([]);var lM=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;return!(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r))&&(!(n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;return!(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i))&&(!(n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(sM),cM=sM;const uM=500;class dM{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--){if(this.items.get(i-1).selection){--i;break}}t&&(n=this.remapping(i,this.items.length),r=n.maps.length);let o,s,a=e.tr,l=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(i,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new pM(e.map));let t,i=e.step.map(n.slice(r));i&&a.maybeStep(i).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new pM(t,void 0,void 0,l.length+c.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(r)):e.selection,s=new dM(this.items.slice(0,i).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:o}}addTransform(e,t,n,r){let i=[],o=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<e.steps.length;n++){let l,c=e.steps[n].invert(e.docs[n]),u=new pM(e.mapping.maps[n],c,t);(l=a&&a.merge(u))&&(u=l,n?i.pop():s=s.slice(0,s.length-1)),i.push(u),t&&(o++,t=void 0),r||(a=u)}let l=o-n.depth;return l>fM&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,l),o-=l),new dM(s.append(i),o)}remapping(e,t){let n=new _f;return this.items.forEach(((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new dM(this.items.append(e.map((e=>new pM(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let l=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(i.slice(a+1,r));c&&s++,n.push(new pM(l,o,c))}else n.push(new pM(l))}),r);let l=[];for(let e=t;e<o;e++)l.push(new pM(i.maps[e]));let c=this.items.slice(0,r).append(l).append(n),u=new dM(c,s);return u.emptyItemCount()>uM&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach(((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=o.selection&&o.selection.map(t.slice(n));a&&i++;let l,c=new pM(s.invert(),e,a),u=r.length-1;(l=r.length&&r[u].merge(c))?r[u]=l:r.push(c)}}else o.map&&n--}),this.items.length,0),new dM(cM.from(r.reverse()),i)}}dM.empty=new dM(cM.empty,0);class pM{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new pM(t.getMap().invert(),t,this.selection)}}}class hM{constructor(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r}}const fM=20;function mM(e){let t=[];return e.forEach(((e,n,r,i)=>t.push(r,i))),t}function gM(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function bM(e,t,n,r){let i=wM(t),o=_M.get(t).spec.config,s=(r?e.undone:e.done).popEvent(t,i);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),o,i),c=new hM(r?l:s.remaining,r?s.remaining:l,null,0);n(s.transform.setSelection(a).setMeta(_M,{redo:r,historyState:c}).scrollIntoView())}let yM=!1,vM=null;function wM(e){let t=e.plugins;if(vM!=t){yM=!1,vM=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){yM=!0;break}}return yM}const _M=new Dm("history"),xM=new Dm("closeHistory");function EM(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Em({key:_M,state:{init:()=>new hM(dM.empty,dM.empty,null,0),apply:(t,n,r)=>function(e,t,n,r){let i,o=n.getMeta(_M);if(o)return o.historyState;n.getMeta(xM)&&(e=new hM(e.done,e.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(_M))return s.getMeta(_M).redo?new hM(e.done.addTransform(n,void 0,r,wM(t)),e.undone,mM(n.mapping.maps[n.steps.length-1]),e.prevTime):new hM(e.done,e.undone.addTransform(n,void 0,r,wM(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new hM(e.done.rebased(n,i),e.undone.rebased(n,i),gM(e.prevRanges,n.mapping),e.prevTime):new hM(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),gM(e.prevRanges,n.mapping),e.prevTime);{let i=0==e.prevTime||!s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)})),n}(n,e.prevRanges)),o=s?gM(e.prevRanges,n.mapping):mM(n.mapping.maps[n.steps.length-1]);return new hM(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,wM(t)),dM.empty,o,n.time)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?kM:"historyRedo"==n?MM:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}const kM=(e,t)=>{let n=_M.getState(e);return!(!n||0==n.done.eventCount)&&(t&&bM(n,e,t,!1),!0)},MM=(e,t)=>{let n=_M.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&bM(n,e,t,!0),!0)},DM=Av.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>kM(e,t),redo:()=>({state:e,dispatch:t})=>MM(e,t)}),addProseMirrorPlugins(){return[EM(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),CM=_w.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",pv(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{var n;if(t){const{$to:t}=e.selection,r=t.end();if(t.nodeAfter)e.setSelection(om.create(e.doc,t.pos));else{const i=null===(n=t.parent.type.contentMatch.defaultType)||void 0===n?void 0:n.create();i&&(e.insert(r,i),e.setSelection(om.create(e.doc,r)))}e.scrollIntoView()}return!0})).run()}},addInputRules(){return[(e={find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type},new _v({find:e.find,handler:({state:t,range:n,match:r})=>{const i=mv(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from;let a=n.to;if(r[1]){let t=s+r[0].lastIndexOf(r[1]);t>a?t=a:a=t+r[1].length;const n=r[0][r[0].length-1];o.insertText(n,s+r[0].length-1),o.replaceWith(t,a,e.type.create(i))}else r[0]&&o.replaceWith(s,a,e.type.create(i))}}))];var e}}),SM=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,NM=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,AM=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,OM=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,TM=ww.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:e}){return["em",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[bw({find:SM,type:this.type}),bw({find:AM,type:this.type})]},addPasteRules(){return[xw({find:NM,type:this.type}),xw({find:OM,type:this.type})]}}),IM=_w.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",pv(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),LM=/^(\d+)\.\s$/,FM=_w.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return 1===t?["ol",pv(this.options.HTMLAttributes,n),0]:["ol",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[vw({find:LM,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}),zM=_w.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),jM=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,RM=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,BM=ww.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",pv(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[bw({find:jM,type:this.type})]},addPasteRules(){return[xw({find:RM,type:this.type})]}}),PM=_w.create({name:"text",group:"inline"}),UM=Av.create({name:"starterKit",addExtensions(){var e,t,n,r,i,o,s,a,l,c,u,d,p,h,f,m,g,b;const y=[];return!1!==this.options.blockquote&&y.push(Fk.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&y.push(Pk.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&y.push(Hk.configure(null===(n=this.options)||void 0===n?void 0:n.bulletList)),!1!==this.options.code&&y.push(rE.configure(null===(r=this.options)||void 0===r?void 0:r.code)),!1!==this.options.codeBlock&&y.push(Vk.configure(null===(i=this.options)||void 0===i?void 0:i.codeBlock)),!1!==this.options.document&&y.push(iE.configure(null===(o=this.options)||void 0===o?void 0:o.document)),!1!==this.options.dropcursor&&y.push(Gk.configure(null===(s=this.options)||void 0===s?void 0:s.dropcursor)),!1!==this.options.gapcursor&&y.push(nM.configure(null===(a=this.options)||void 0===a?void 0:a.gapcursor)),!1!==this.options.hardBreak&&y.push(rM.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&y.push(iM.configure(null===(c=this.options)||void 0===c?void 0:c.heading)),!1!==this.options.history&&y.push(DM.configure(null===(u=this.options)||void 0===u?void 0:u.history)),!1!==this.options.horizontalRule&&y.push(CM.configure(null===(d=this.options)||void 0===d?void 0:d.horizontalRule)),!1!==this.options.italic&&y.push(TM.configure(null===(p=this.options)||void 0===p?void 0:p.italic)),!1!==this.options.listItem&&y.push(IM.configure(null===(h=this.options)||void 0===h?void 0:h.listItem)),!1!==this.options.orderedList&&y.push(FM.configure(null===(f=this.options)||void 0===f?void 0:f.orderedList)),!1!==this.options.paragraph&&y.push(zM.configure(null===(m=this.options)||void 0===m?void 0:m.paragraph)),!1!==this.options.strike&&y.push(BM.configure(null===(g=this.options)||void 0===g?void 0:g.strike)),!1!==this.options.text&&y.push(PM.configure(null===(b=this.options)||void 0===b?void 0:b.text)),y}});var HM={exports:{}};function $M(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((function(t){var n=e[t];"object"!=typeof n||Object.isFrozen(n)||$M(n)})),e}HM.exports=$M,HM.exports.default=$M;class WM{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function VM(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function qM(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t];return t.forEach((function(e){for(const t in e)n[t]=e[t]})),n}const KM="</span>",GM=e=>!!e.scope||e.sublanguage&&e.language;class YM{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=VM(e)}openNode(e){if(!GM(e))return;let t="";t=e.sublanguage?`language-${e.language}`:((e,{prefix:t})=>{if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix}),this.span(t)}closeNode(e){GM(e)&&(this.buffer+=KM)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const QM=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class JM{constructor(){this.rootNode=QM(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=QM({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{JM._collapse(e)})))}}class ZM extends JM{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root;n.sublanguage=!0,n.language=t,this.add(n)}toHTML(){return new YM(this,this.options).value()}finalize(){return!0}}function XM(e){return e?"string"==typeof e?e:e.source:null}function eD(e){return rD("(?=",e,")")}function tD(e){return rD("(?:",e,")*")}function nD(e){return rD("(?:",e,")?")}function rD(...e){const t=e.map((e=>XM(e))).join("");return t}function iD(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e),n="("+(t.capture?"":"?:")+e.map((e=>XM(e))).join("|")+")";return n}function oD(e){return new RegExp(e.toString()+"|").exec("").length-1}const sD=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function aD(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n;let r=XM(e),i="";for(;r.length>0;){const e=sD.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],"("===e[0]&&n++)}return i})).map((e=>`(${e})`)).join(t)}const lD="[a-zA-Z]\\w*",cD="[a-zA-Z_]\\w*",uD="\\b\\d+(\\.\\d+)?",dD="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",pD="\\b(0b[01]+)",hD={begin:"\\\\[\\s\\S]",relevance:0},fD={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[hD]},mD={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[hD]},gD=function(e,t,n={}){const r=qM({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=iD("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:rD(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},bD=gD("//","$"),yD=gD("/\\*","\\*/"),vD=gD("#","$"),wD={scope:"number",begin:uD,relevance:0},_D={scope:"number",begin:dD,relevance:0},xD={scope:"number",begin:pD,relevance:0},ED={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[hD,{begin:/\[/,end:/\]/,relevance:0,contains:[hD]}]}]},kD={scope:"title",begin:lD,relevance:0},MD={scope:"title",begin:cD,relevance:0},DD={begin:"\\.\\s*"+cD,relevance:0};var CD=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:lD,UNDERSCORE_IDENT_RE:cD,NUMBER_RE:uD,C_NUMBER_RE:dD,BINARY_NUMBER_RE:pD,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=rD(t,/.*\b/,e.binary,/\b.*/)),qM({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:hD,APOS_STRING_MODE:fD,QUOTE_STRING_MODE:mD,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},COMMENT:gD,C_LINE_COMMENT_MODE:bD,C_BLOCK_COMMENT_MODE:yD,HASH_COMMENT_MODE:vD,NUMBER_MODE:wD,C_NUMBER_MODE:_D,BINARY_NUMBER_MODE:xD,REGEXP_MODE:ED,TITLE_MODE:kD,UNDERSCORE_TITLE_MODE:MD,METHOD_GUARD:DD,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}});function SD(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function ND(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function AD(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=SD,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function OD(e,t){Array.isArray(e.illegal)&&(e.illegal=iD(...e.illegal))}function TD(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function ID(e,t){void 0===e.relevance&&(e.relevance=1)}const LD=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t]})),e.keywords=n.keywords,e.begin=rD(n.beforeMatch,eD(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},FD=["of","and","for","in","not","or","if","then","parent","list","value"],zD="keyword";function jD(e,t,n=zD){const r=Object.create(null);return"string"==typeof e?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach((function(n){Object.assign(r,jD(e[n],t,n))})),r;function i(e,n){t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((function(t){const n=t.split("|");r[n[0]]=[e,RD(n[0],n[1])]}))}}function RD(e,t){return t?Number(t):function(e){return FD.includes(e.toLowerCase())}(e)?0:1}const BD={},PD=e=>{console.error(e)},UD=(e,...t)=>{console.log(`WARN: ${e}`,...t)},HD=(e,t)=>{BD[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),BD[`${e}/${t}`]=!0)},$D=new Error;function WD(e,t,{key:n}){let r=0;const i=e[n],o={},s={};for(let e=1;e<=t.length;e++)s[e+r]=i[e],o[e+r]=!0,r+=oD(t[e-1]);e[n]=s,e[n]._emit=o,e[n]._multi=!0}function VD(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw PD("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),$D;if("object"!=typeof e.beginScope||null===e.beginScope)throw PD("beginScope must be object"),$D;WD(e,e.begin,{key:"beginScope"}),e.begin=aD(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw PD("skip, excludeEnd, returnEnd not compatible with endScope: {}"),$D;if("object"!=typeof e.endScope||null===e.endScope)throw PD("endScope must be object"),$D;WD(e,e.end,{key:"endScope"}),e.end=aD(e.end,{joinWith:""})}}(e)}function qD(e){function t(t,n){return new RegExp(XM(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=oD(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=t(aD(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=qM(e.classNameAliases||{}),function n(i,o){const s=i;if(i.isCompiled)return s;[ND,TD,VD,LD].forEach((e=>e(i,o))),e.compilerExtensions.forEach((e=>e(i,o))),i.__beforeBegin=null,[AD,OD,ID].forEach((e=>e(i,o))),i.isCompiled=!0;let a=null;return"object"==typeof i.keywords&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),a=i.keywords.$pattern,delete i.keywords.$pattern),a=a||/\w+/,i.keywords&&(i.keywords=jD(i.keywords,e.case_insensitive)),s.keywordPatternRe=t(a,!0),o&&(i.begin||(i.begin=/\B|\b/),s.beginRe=t(s.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(s.endRe=t(s.end)),s.terminatorEnd=XM(s.end)||"",i.endsWithParent&&o.terminatorEnd&&(s.terminatorEnd+=(i.end?"|":"")+o.terminatorEnd)),i.illegal&&(s.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return qM(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(KD(e))return qM(e,{starts:e.starts?qM(e.starts):null});if(Object.isFrozen(e))return qM(e);return e}("self"===e?i:e)}))),i.contains.forEach((function(e){n(e,s)})),i.starts&&n(i.starts,o),s.matcher=function(e){const t=new r;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(s),s}(e)}function KD(e){return!!e&&(e.endsWithParent||KD(e.starts))}var GD="11.6.0";class YD extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const QD=VM,JD=qM,ZD=Symbol("nomatch"),XD=7;var eC=function(e){const t=Object.create(null),n=Object.create(null),r=[];let i=!0;const o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:ZM};function l(e){return a.noHighlightRe.test(e)}function c(e,t,n){let r="",i="";"object"==typeof t?(r=e,n=t.ignoreIllegals,i=t.language):(HD("10.7.0","highlight(lang, code, ...args) has been deprecated."),HD("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=e,r=t),void 0===n&&(n=!0);const o={code:r,language:i};y("before:highlight",o);const s=o.result?o.result:u(o.language,o.code,n);return s.code=o.code,y("after:highlight",s),s}function u(e,n,r,s){const l=Object.create(null);function c(){if(!k.keywords)return void D.addText(C);let e=0;k.keywordPatternRe.lastIndex=0;let t=k.keywordPatternRe.exec(C),n="";for(;t;){n+=C.substring(e,t.index);const i=_.case_insensitive?t[0].toLowerCase():t[0],o=(r=i,k.keywords[r]);if(o){const[e,r]=o;if(D.addText(n),n="",l[i]=(l[i]||0)+1,l[i]<=XD&&(S+=r),e.startsWith("_"))n+=t[0];else{const n=_.classNameAliases[e]||e;D.addKeyword(t[0],n)}}else n+=t[0];e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(C)}var r;n+=C.substring(e),D.addText(n)}function p(){null!=k.subLanguage?function(){if(""===C)return;let e=null;if("string"==typeof k.subLanguage){if(!t[k.subLanguage])return void D.addText(C);e=u(k.subLanguage,C,!0,M[k.subLanguage]),M[k.subLanguage]=e._top}else e=d(C,k.subLanguage.length?k.subLanguage:null);k.relevance>0&&(S+=e.relevance),D.addSublanguage(e._emitter,e.language)}():c(),C=""}function h(e,t){let n=1;const r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}const r=_.classNameAliases[e[n]]||e[n],i=t[n];r?D.addKeyword(i,r):(C=i,c(),C=""),n++}}function f(e,t){return e.scope&&"string"==typeof e.scope&&D.openNode(_.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(D.addKeyword(C,_.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),C=""):e.beginScope._multi&&(h(e.beginScope,t),C="")),k=Object.create(e,{parent:{value:k}}),k}function g(e,t,n){let r=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(e.endRe,n);if(r){if(e["on:end"]){const n=new WM(e);e["on:end"](t,n),n.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return g(e.parent,t,n)}function b(e){return 0===k.matcher.regexIndex?(C+=e[0],1):(O=!0,0)}function y(e){const t=e[0],r=n.substring(e.index),i=g(k,e,r);if(!i)return ZD;const o=k;k.endScope&&k.endScope._wrap?(p(),D.addKeyword(t,k.endScope._wrap)):k.endScope&&k.endScope._multi?(p(),h(k.endScope,e)):o.skip?C+=t:(o.returnEnd||o.excludeEnd||(C+=t),p(),o.excludeEnd&&(C=t));do{k.scope&&D.closeNode(),k.skip||k.subLanguage||(S+=k.relevance),k=k.parent}while(k!==i.parent);return i.starts&&f(i.starts,e),o.returnEnd?0:t.length}let v={};function w(t,o){const s=o&&o[0];if(C+=t,null==s)return p(),0;if("begin"===v.type&&"end"===o.type&&v.index===o.index&&""===s){if(C+=n.slice(o.index,o.index+1),!i){const t=new Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=v.rule,t}return 1}if(v=o,"begin"===o.type)return function(e){const t=e[0],n=e.rule,r=new WM(n),i=[n.__beforeBegin,n["on:begin"]];for(const n of i)if(n&&(n(e,r),r.isMatchIgnored))return b(t);return n.skip?C+=t:(n.excludeBegin&&(C+=t),p(),n.returnBegin||n.excludeBegin||(C=t)),f(n,e),n.returnBegin?0:t.length}(o);if("illegal"===o.type&&!r){const e=new Error('Illegal lexeme "'+s+'" for mode "'+(k.scope||"<unnamed>")+'"');throw e.mode=k,e}if("end"===o.type){const e=y(o);if(e!==ZD)return e}if("illegal"===o.type&&""===s)return 1;if(A>1e5&&A>3*o.index){throw new Error("potential infinite loop, way more iterations than matches")}return C+=s,s.length}const _=m(e);if(!_)throw PD(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const x=qD(_);let E="",k=s||x;const M={},D=new a.__emitter(a);!function(){const e=[];for(let t=k;t!==_;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach((e=>D.openNode(e)))}();let C="",S=0,N=0,A=0,O=!1;try{for(k.matcher.considerAll();;){A++,O?O=!1:k.matcher.considerAll(),k.matcher.lastIndex=N;const e=k.matcher.exec(n);if(!e)break;const t=w(n.substring(N,e.index),e);N=e.index+t}return w(n.substring(N)),D.closeAllNodes(),D.finalize(),E=D.toHTML(),{language:e,value:E,relevance:S,illegal:!1,_emitter:D,_top:k}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:QD(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:N,context:n.slice(N-100,N+100),mode:t.mode,resultSoFar:E},_emitter:D};if(i)return{language:e,value:QD(n),illegal:!1,relevance:0,errorRaised:t,_emitter:D,_top:k};throw t}}function d(e,n){n=n||a.languages||Object.keys(t);const r=function(e){const t={value:QD(e),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return t._emitter.addText(e),t}(e),i=n.filter(m).filter(b).map((t=>u(t,e,!1)));i.unshift(r);const o=i.sort(((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(m(e.language).supersetOf===t.language)return 1;if(m(t.language).supersetOf===e.language)return-1}return 0})),[l,c]=o,d=l;return d.secondBest=c,d}function p(e){let t=null;const r=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=a.languageDetectRe.exec(t);if(n){const t=m(n[1]);return t||(UD(o.replace("{}",n[1])),UD("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find((e=>l(e)||m(e)))}(e);if(l(r))return;if(y("before:highlightElement",{el:e,language:r}),e.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),a.throwUnescapedHTML)){throw new YD("One of your code blocks includes unescaped HTML.",e.innerHTML)}t=e;const i=t.textContent,s=r?c(i,{language:r,ignoreIllegals:!0}):d(i);e.innerHTML=s.value,function(e,t,r){const i=t&&n[t]||r;e.classList.add("hljs"),e.classList.add(`language-${i}`)}(e,r,s.language),e.result={language:s.language,re:s.relevance,relevance:s.relevance},s.secondBest&&(e.secondBest={language:s.secondBest.language,relevance:s.secondBest.relevance}),y("after:highlightElement",{el:e,result:s,text:i})}let h=!1;function f(){if("loading"===document.readyState)return void(h=!0);document.querySelectorAll(a.cssSelector).forEach(p)}function m(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function g(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{n[e.toLowerCase()]=t}))}function b(e){const t=m(e);return t&&!t.disableAutodetect}function y(e,t){const n=e;r.forEach((function(e){e[n]&&e[n](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){h&&f()}),!1),Object.assign(e,{highlight:c,highlightAuto:d,highlightAll:f,highlightElement:p,highlightBlock:function(e){return HD("10.7.0","highlightBlock will be removed entirely in v12.0"),HD("10.7.0","Please use highlightElement now."),p(e)},configure:function(e){a=JD(a,e)},initHighlighting:()=>{f(),HD("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){f(),HD("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,r){let o=null;try{o=r(e)}catch(e){if(PD("Language definition for '{}' could not be registered.".replace("{}",n)),!i)throw e;PD(e),o=s}o.name||(o.name=n),t[n]=o,o.rawDefinition=r.bind(null,e),o.aliases&&g(o.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:m,registerAliases:g,autoDetection:b,inherit:JD,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),r.push(e)}}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=GD,e.regex={concat:rD,lookahead:eD,either:iD,optional:nD,anyNumberOfTimes:tD};for(const e in CD)"object"==typeof CD[e]&&HM.exports(CD[e]);return Object.assign(e,CD),e}({}),tC=eC;eC.HighlightJS=eC,eC.default=eC;var nC=tC;function rC(e,t=[]){return e.map((e=>{const n=[...t,...e.properties?e.properties.className:[]];return e.children?rC(e.children,n):{text:e.value,classes:n}})).flat()}function iC(e){return e.value||e.children||[]}function oC({doc:e,name:t,lowlight:n,defaultLanguage:r}){const i=[];return Qv(e,(e=>e.type.name===t)).forEach((e=>{let t=e.pos+1;const o=e.node.attrs.language||r,s=n.listLanguages();var a;rC(o&&(s.includes(o)||(a=o,Boolean(nC.getLanguage(a))))?iC(n.highlight(o,e.node.textContent)):iC(n.highlightAuto(e.node.textContent))).forEach((e=>{const n=t+e.text.length;if(e.classes.length){const r=ay.inline(t,n,{class:e.classes.join(" ")});i.push(r)}t=n}))})),uy.create(e,i)}function sC({name:e,lowlight:t,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every((e=>"function"==typeof t[e])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new Em({key:new Dm("lowlight"),state:{init:(r,{doc:i})=>oC({doc:i,name:e,lowlight:t,defaultLanguage:n}),apply:(r,i,o,s)=>{const a=o.selection.$head.parent.type.name,l=s.selection.$head.parent.type.name,c=Qv(o.doc,(t=>t.type.name===e)),u=Qv(s.doc,(t=>t.type.name===e));return r.docChanged&&([a,l].includes(e)||u.length!==c.length||r.steps.some((e=>void 0!==e.from&&void 0!==e.to&&c.some((t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))))?oC({doc:r.doc,name:e,lowlight:t,defaultLanguage:n}):i.map(r.mapping,r.doc)}},props:{decorations:e=>r.getState(e)}});return r}const aC=Vk.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:{},defaultLanguage:null}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],sC({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});const lC=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],cC=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],uC=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],dC=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],pC=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();var hC="[0-9](_*[0-9])*",fC=`\\.(${hC})`,mC="[0-9a-fA-F](_*[0-9a-fA-F])*",gC={className:"number",variants:[{begin:`(\\b(${hC})((${fC})|\\.)?|(${fC}))`+`[eE][+-]?(${hC})[fFdD]?\\b`},{begin:`\\b(${hC})((${fC})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${fC})[fFdD]?\\b`},{begin:`\\b(${hC})[fFdD]\\b`},{begin:`\\b0[xX]((${mC})\\.?|(${mC})?\\.(${mC}))`+`[pP][+-]?(${hC})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${mC})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function bC(e,t,n){return-1===n?"":e.replace(t,(r=>bC(e,t,n-1)))}const yC="[A-Za-z$_][0-9A-Za-z$_]*",vC=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],wC=["true","false","null","undefined","NaN","Infinity"],_C=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],xC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],EC=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],kC=["arguments","this","super","console","window","document","localStorage","module","global"],MC=[].concat(EC,_C,xC);var DC="[0-9](_*[0-9])*",CC=`\\.(${DC})`,SC="[0-9a-fA-F](_*[0-9a-fA-F])*",NC={className:"number",variants:[{begin:`(\\b(${DC})((${CC})|\\.)?|(${CC}))`+`[eE][+-]?(${DC})[fFdD]?\\b`},{begin:`\\b(${DC})((${CC})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${CC})[fFdD]?\\b`},{begin:`\\b(${DC})[fFdD]\\b`},{begin:`\\b0[xX]((${SC})\\.?|(${SC})?\\.(${SC}))`+`[pP][+-]?(${DC})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${SC})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};const AC=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],OC=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],TC=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],IC=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],LC=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),FC=TC.concat(IC);const zC=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],jC=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],RC=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],BC=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],PC=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function UC(e){return e?"string"==typeof e?e:e.source:null}function HC(e){return $C("(?=",e,")")}function $C(...e){const t=e.map((e=>UC(e))).join("");return t}function WC(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e),n="("+(t.capture?"":"?:")+e.map((e=>UC(e))).join("|")+")";return n}const VC=e=>$C(/\b/,e,/\w$/.test(e)?/\b/:/\B/),qC=["Protocol","Type"].map(VC),KC=["init","self"].map(VC),GC=["Any","Self"],YC=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],QC=["false","nil","true"],JC=["assignment","associativity","higherThan","left","lowerThan","none","right"],ZC=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],XC=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],eS=WC(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),tS=WC(eS,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),nS=$C(eS,tS,"*"),rS=WC(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),iS=WC(rS,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),oS=$C(rS,iS,"*"),sS=$C(/[A-Z]/,iS,"*"),aS=["autoclosure",$C(/convention\(/,WC("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",$C(/objc\(/,oS,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],lS=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];const cS="[A-Za-z$_][0-9A-Za-z$_]*",uS=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],dS=["true","false","null","undefined","NaN","Infinity"],pS=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],hS=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],fS=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],mS=["arguments","this","super","console","window","document","localStorage","module","global"],gS=[].concat(fS,pS,hS);function bS(e){const t=e.regex,n=cS,r="<>",i="</>",o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,r=e.input[n];if("<"===r||","===r)return void t.ignoreMatch();let i;">"===r&&(((e,{after:t})=>{const n="</"+e[0].slice(1);return-1!==e.input.indexOf(n,t)})(e,{after:n})||t.ignoreMatch());(i=e.input.substring(n).match(/^\s+extends\s+/))&&0===i.index&&t.ignoreMatch()}},s={$pattern:cS,keyword:uS,literal:dS,built_in:gS,"variable.language":mS},a="[0-9](_?[0-9])*",l=`\\.(${a})`,c=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,u={className:"number",variants:[{begin:`(\\b(${c})((${l})|\\.)?|(${l}))`+`[eE][+-]?(${a})\\b`},{begin:`\\b(${c})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},p={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},f={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},m={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},g=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,f,u];d.contains=g.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(g)});const b=[].concat(m,d.contains),y=b.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(b)}]),v={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:y},w={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},_={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...pS,...hS]}},x={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[v],illegal:/%/};const E={match:t.concat(/\b/,(k=[...fS,"super"],t.concat("(?!",k.join("|"),")")),n,t.lookahead(/\(/)),className:"title.function",relevance:0};var k;const M={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},D={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},v]},C="(\\("+"[^()]*(\\("+"[^()]*(\\("+"[^()]*"+"\\)[^()]*)*"+"\\)[^()]*)*"+"\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",S={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[v]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:y,CLASS_REFERENCE:_},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,f,m,u,_,{className:"attr",begin:n+t.lookahead(":"),relevance:0},S,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r,end:i},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},x,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\("+"[^()]*(\\("+"[^()]*(\\("+"[^()]*"+"\\)[^()]*)*"+"\\)[^()]*)*"+"\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[v,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},M,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[v]},E,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},w,D,{match:/\$[(.]/}]}}var yS={exports:{}};function vS(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((function(t){var n=e[t];"object"!=typeof n||Object.isFrozen(n)||vS(n)})),e}yS.exports=vS,yS.exports.default=vS;class wS{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function _S(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function xS(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t];return t.forEach((function(e){for(const t in e)n[t]=e[t]})),n}const ES="</span>",kS=e=>!!e.scope||e.sublanguage&&e.language;class MS{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=_S(e)}openNode(e){if(!kS(e))return;let t="";t=e.sublanguage?`language-${e.language}`:((e,{prefix:t})=>{if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix}),this.span(t)}closeNode(e){kS(e)&&(this.buffer+=ES)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const DS=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class CS{constructor(){this.rootNode=DS(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=DS({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{CS._collapse(e)})))}}class SS extends CS{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root;n.sublanguage=!0,n.language=t,this.add(n)}toHTML(){return new MS(this,this.options).value()}finalize(){return!0}}function NS(e){return e?"string"==typeof e?e:e.source:null}function AS(e){return IS("(?=",e,")")}function OS(e){return IS("(?:",e,")*")}function TS(e){return IS("(?:",e,")?")}function IS(...e){const t=e.map((e=>NS(e))).join("");return t}function LS(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e),n="("+(t.capture?"":"?:")+e.map((e=>NS(e))).join("|")+")";return n}function FS(e){return new RegExp(e.toString()+"|").exec("").length-1}const zS=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function jS(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n;let r=NS(e),i="";for(;r.length>0;){const e=zS.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],"("===e[0]&&n++)}return i})).map((e=>`(${e})`)).join(t)}const RS="[a-zA-Z]\\w*",BS="[a-zA-Z_]\\w*",PS="\\b\\d+(\\.\\d+)?",US="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",HS="\\b(0b[01]+)",$S={begin:"\\\\[\\s\\S]",relevance:0},WS={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[$S]},VS={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[$S]},qS=function(e,t,n={}){const r=xS({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=LS("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:IS(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},KS=qS("//","$"),GS=qS("/\\*","\\*/"),YS=qS("#","$"),QS={scope:"number",begin:PS,relevance:0},JS={scope:"number",begin:US,relevance:0},ZS={scope:"number",begin:HS,relevance:0},XS={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[$S,{begin:/\[/,end:/\]/,relevance:0,contains:[$S]}]}]},eN={scope:"title",begin:RS,relevance:0},tN={scope:"title",begin:BS,relevance:0},nN={begin:"\\.\\s*"+BS,relevance:0};var rN=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:RS,UNDERSCORE_IDENT_RE:BS,NUMBER_RE:PS,C_NUMBER_RE:US,BINARY_NUMBER_RE:HS,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=IS(t,/.*\b/,e.binary,/\b.*/)),xS({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:$S,APOS_STRING_MODE:WS,QUOTE_STRING_MODE:VS,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},COMMENT:qS,C_LINE_COMMENT_MODE:KS,C_BLOCK_COMMENT_MODE:GS,HASH_COMMENT_MODE:YS,NUMBER_MODE:QS,C_NUMBER_MODE:JS,BINARY_NUMBER_MODE:ZS,REGEXP_MODE:XS,TITLE_MODE:eN,UNDERSCORE_TITLE_MODE:tN,METHOD_GUARD:nN,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}});function iN(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function oN(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function sN(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=iN,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function aN(e,t){Array.isArray(e.illegal)&&(e.illegal=LS(...e.illegal))}function lN(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function cN(e,t){void 0===e.relevance&&(e.relevance=1)}const uN=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t]})),e.keywords=n.keywords,e.begin=IS(n.beforeMatch,AS(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},dN=["of","and","for","in","not","or","if","then","parent","list","value"],pN="keyword";function hN(e,t,n=pN){const r=Object.create(null);return"string"==typeof e?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach((function(n){Object.assign(r,hN(e[n],t,n))})),r;function i(e,n){t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((function(t){const n=t.split("|");r[n[0]]=[e,fN(n[0],n[1])]}))}}function fN(e,t){return t?Number(t):function(e){return dN.includes(e.toLowerCase())}(e)?0:1}const mN={},gN=e=>{console.error(e)},bN=(e,...t)=>{console.log(`WARN: ${e}`,...t)},yN=(e,t)=>{mN[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),mN[`${e}/${t}`]=!0)},vN=new Error;function wN(e,t,{key:n}){let r=0;const i=e[n],o={},s={};for(let e=1;e<=t.length;e++)s[e+r]=i[e],o[e+r]=!0,r+=FS(t[e-1]);e[n]=s,e[n]._emit=o,e[n]._multi=!0}function _N(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw gN("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),vN;if("object"!=typeof e.beginScope||null===e.beginScope)throw gN("beginScope must be object"),vN;wN(e,e.begin,{key:"beginScope"}),e.begin=jS(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw gN("skip, excludeEnd, returnEnd not compatible with endScope: {}"),vN;if("object"!=typeof e.endScope||null===e.endScope)throw gN("endScope must be object"),vN;wN(e,e.end,{key:"endScope"}),e.end=jS(e.end,{joinWith:""})}}(e)}function xN(e){function t(t,n){return new RegExp(NS(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=FS(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=t(jS(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=xS(e.classNameAliases||{}),function n(i,o){const s=i;if(i.isCompiled)return s;[oN,lN,_N,uN].forEach((e=>e(i,o))),e.compilerExtensions.forEach((e=>e(i,o))),i.__beforeBegin=null,[sN,aN,cN].forEach((e=>e(i,o))),i.isCompiled=!0;let a=null;return"object"==typeof i.keywords&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),a=i.keywords.$pattern,delete i.keywords.$pattern),a=a||/\w+/,i.keywords&&(i.keywords=hN(i.keywords,e.case_insensitive)),s.keywordPatternRe=t(a,!0),o&&(i.begin||(i.begin=/\B|\b/),s.beginRe=t(s.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(s.endRe=t(s.end)),s.terminatorEnd=NS(s.end)||"",i.endsWithParent&&o.terminatorEnd&&(s.terminatorEnd+=(i.end?"|":"")+o.terminatorEnd)),i.illegal&&(s.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return xS(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(EN(e))return xS(e,{starts:e.starts?xS(e.starts):null});if(Object.isFrozen(e))return xS(e);return e}("self"===e?i:e)}))),i.contains.forEach((function(e){n(e,s)})),i.starts&&n(i.starts,o),s.matcher=function(e){const t=new r;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(s),s}(e)}function EN(e){return!!e&&(e.endsWithParent||EN(e.starts))}var kN="11.6.0";class MN extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const DN=_S,CN=xS,SN=Symbol("nomatch"),NN=7;var AN=function(e){const t=Object.create(null),n=Object.create(null),r=[];let i=!0;const o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:SS};function l(e){return a.noHighlightRe.test(e)}function c(e,t,n){let r="",i="";"object"==typeof t?(r=e,n=t.ignoreIllegals,i=t.language):(yN("10.7.0","highlight(lang, code, ...args) has been deprecated."),yN("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=e,r=t),void 0===n&&(n=!0);const o={code:r,language:i};y("before:highlight",o);const s=o.result?o.result:u(o.language,o.code,n);return s.code=o.code,y("after:highlight",s),s}function u(e,n,r,s){const l=Object.create(null);function c(){if(!k.keywords)return void D.addText(C);let e=0;k.keywordPatternRe.lastIndex=0;let t=k.keywordPatternRe.exec(C),n="";for(;t;){n+=C.substring(e,t.index);const i=_.case_insensitive?t[0].toLowerCase():t[0],o=(r=i,k.keywords[r]);if(o){const[e,r]=o;if(D.addText(n),n="",l[i]=(l[i]||0)+1,l[i]<=NN&&(S+=r),e.startsWith("_"))n+=t[0];else{const n=_.classNameAliases[e]||e;D.addKeyword(t[0],n)}}else n+=t[0];e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(C)}var r;n+=C.substring(e),D.addText(n)}function p(){null!=k.subLanguage?function(){if(""===C)return;let e=null;if("string"==typeof k.subLanguage){if(!t[k.subLanguage])return void D.addText(C);e=u(k.subLanguage,C,!0,M[k.subLanguage]),M[k.subLanguage]=e._top}else e=d(C,k.subLanguage.length?k.subLanguage:null);k.relevance>0&&(S+=e.relevance),D.addSublanguage(e._emitter,e.language)}():c(),C=""}function h(e,t){let n=1;const r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}const r=_.classNameAliases[e[n]]||e[n],i=t[n];r?D.addKeyword(i,r):(C=i,c(),C=""),n++}}function f(e,t){return e.scope&&"string"==typeof e.scope&&D.openNode(_.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(D.addKeyword(C,_.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),C=""):e.beginScope._multi&&(h(e.beginScope,t),C="")),k=Object.create(e,{parent:{value:k}}),k}function g(e,t,n){let r=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(e.endRe,n);if(r){if(e["on:end"]){const n=new wS(e);e["on:end"](t,n),n.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return g(e.parent,t,n)}function b(e){return 0===k.matcher.regexIndex?(C+=e[0],1):(O=!0,0)}function y(e){const t=e[0],r=n.substring(e.index),i=g(k,e,r);if(!i)return SN;const o=k;k.endScope&&k.endScope._wrap?(p(),D.addKeyword(t,k.endScope._wrap)):k.endScope&&k.endScope._multi?(p(),h(k.endScope,e)):o.skip?C+=t:(o.returnEnd||o.excludeEnd||(C+=t),p(),o.excludeEnd&&(C=t));do{k.scope&&D.closeNode(),k.skip||k.subLanguage||(S+=k.relevance),k=k.parent}while(k!==i.parent);return i.starts&&f(i.starts,e),o.returnEnd?0:t.length}let v={};function w(t,o){const s=o&&o[0];if(C+=t,null==s)return p(),0;if("begin"===v.type&&"end"===o.type&&v.index===o.index&&""===s){if(C+=n.slice(o.index,o.index+1),!i){const t=new Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=v.rule,t}return 1}if(v=o,"begin"===o.type)return function(e){const t=e[0],n=e.rule,r=new wS(n),i=[n.__beforeBegin,n["on:begin"]];for(const n of i)if(n&&(n(e,r),r.isMatchIgnored))return b(t);return n.skip?C+=t:(n.excludeBegin&&(C+=t),p(),n.returnBegin||n.excludeBegin||(C=t)),f(n,e),n.returnBegin?0:t.length}(o);if("illegal"===o.type&&!r){const e=new Error('Illegal lexeme "'+s+'" for mode "'+(k.scope||"<unnamed>")+'"');throw e.mode=k,e}if("end"===o.type){const e=y(o);if(e!==SN)return e}if("illegal"===o.type&&""===s)return 1;if(A>1e5&&A>3*o.index){throw new Error("potential infinite loop, way more iterations than matches")}return C+=s,s.length}const _=m(e);if(!_)throw gN(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const x=xN(_);let E="",k=s||x;const M={},D=new a.__emitter(a);!function(){const e=[];for(let t=k;t!==_;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach((e=>D.openNode(e)))}();let C="",S=0,N=0,A=0,O=!1;try{for(k.matcher.considerAll();;){A++,O?O=!1:k.matcher.considerAll(),k.matcher.lastIndex=N;const e=k.matcher.exec(n);if(!e)break;const t=w(n.substring(N,e.index),e);N=e.index+t}return w(n.substring(N)),D.closeAllNodes(),D.finalize(),E=D.toHTML(),{language:e,value:E,relevance:S,illegal:!1,_emitter:D,_top:k}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:DN(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:N,context:n.slice(N-100,N+100),mode:t.mode,resultSoFar:E},_emitter:D};if(i)return{language:e,value:DN(n),illegal:!1,relevance:0,errorRaised:t,_emitter:D,_top:k};throw t}}function d(e,n){n=n||a.languages||Object.keys(t);const r=function(e){const t={value:DN(e),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return t._emitter.addText(e),t}(e),i=n.filter(m).filter(b).map((t=>u(t,e,!1)));i.unshift(r);const o=i.sort(((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(m(e.language).supersetOf===t.language)return 1;if(m(t.language).supersetOf===e.language)return-1}return 0})),[l,c]=o,d=l;return d.secondBest=c,d}function p(e){let t=null;const r=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=a.languageDetectRe.exec(t);if(n){const t=m(n[1]);return t||(bN(o.replace("{}",n[1])),bN("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find((e=>l(e)||m(e)))}(e);if(l(r))return;if(y("before:highlightElement",{el:e,language:r}),e.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),a.throwUnescapedHTML)){throw new MN("One of your code blocks includes unescaped HTML.",e.innerHTML)}t=e;const i=t.textContent,s=r?c(i,{language:r,ignoreIllegals:!0}):d(i);e.innerHTML=s.value,function(e,t,r){const i=t&&n[t]||r;e.classList.add("hljs"),e.classList.add(`language-${i}`)}(e,r,s.language),e.result={language:s.language,re:s.relevance,relevance:s.relevance},s.secondBest&&(e.secondBest={language:s.secondBest.language,relevance:s.secondBest.relevance}),y("after:highlightElement",{el:e,result:s,text:i})}let h=!1;function f(){if("loading"===document.readyState)return void(h=!0);document.querySelectorAll(a.cssSelector).forEach(p)}function m(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function g(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{n[e.toLowerCase()]=t}))}function b(e){const t=m(e);return t&&!t.disableAutodetect}function y(e,t){const n=e;r.forEach((function(e){e[n]&&e[n](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){h&&f()}),!1),Object.assign(e,{highlight:c,highlightAuto:d,highlightAll:f,highlightElement:p,highlightBlock:function(e){return yN("10.7.0","highlightBlock will be removed entirely in v12.0"),yN("10.7.0","Please use highlightElement now."),p(e)},configure:function(e){a=CN(a,e)},initHighlighting:()=>{f(),yN("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){f(),yN("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,r){let o=null;try{o=r(e)}catch(e){if(gN("Language definition for '{}' could not be registered.".replace("{}",n)),!i)throw e;gN(e),o=s}o.name||(o.name=n),t[n]=o,o.rawDefinition=r.bind(null,e),o.aliases&&g(o.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:m,registerAliases:g,autoDetection:b,inherit:CN,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),r.push(e)}}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=kN,e.regex={concat:IS,lookahead:AS,either:LS,optional:TS,anyNumberOfTimes:OS};for(const e in rN)"object"==typeof rN[e]&&yS.exports(rN[e]);return Object.assign(e,rN),e}({}),ON=AN;AN.HighlightJS=AN,AN.default=AN;var TN={exports:{}};!function(e){!function(){var t;function n(e){for(var t,n,r,i,o=1,s=[].slice.call(arguments),a=0,l=e.length,c="",u=!1,d=!1,p=function(){return s[o++]},h=function(){for(var n="";/\d/.test(e[a]);)n+=e[a++],t=e[a];return n.length>0?parseInt(n):null};a<l;++a)if(t=e[a],u)switch(u=!1,"."==t?(d=!1,t=e[++a]):"0"==t&&"."==e[a+1]?(d=!0,t=e[a+=2]):d=!0,i=h(),t){case"b":c+=parseInt(p(),10).toString(2);break;case"c":c+="string"==typeof(n=p())||n instanceof String?n:String.fromCharCode(parseInt(n,10));break;case"d":c+=parseInt(p(),10);break;case"f":r=String(parseFloat(p()).toFixed(i||6)),c+=d?r:r.replace(/^0/,"");break;case"j":c+=JSON.stringify(p());break;case"o":c+="0"+parseInt(p(),10).toString(8);break;case"s":c+=p();break;case"x":c+="0x"+parseInt(p(),10).toString(16);break;case"X":c+="0x"+parseInt(p(),10).toString(16).toUpperCase();break;default:c+=t}else"%"===t?u=!0:c+=t;return c}(t=e.exports=n).format=n,t.vsprintf=function(e,t){return n.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(n.apply(null,arguments))})}()}(TN);var IN=TN.exports;const LN=Object.assign(FN(Error),{eval:FN(EvalError),range:FN(RangeError),reference:FN(ReferenceError),syntax:FN(SyntaxError),type:FN(TypeError),uri:FN(URIError)});function FN(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){const r=t?IN(t,...n):t;return new e(r)}}const zN={}.hasOwnProperty,jN="hljs-";function RN(e,t,n={}){let r=n.prefix;if("string"!=typeof e)throw LN("Expected `string` for name, got `%s`",e);if(!ON.getLanguage(e))throw LN("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw LN("Expected `string` for value, got `%s`",t);null==r&&(r=jN),ON.configure({__emitter:BN,classPrefix:r});const i=ON.highlight(t,{language:e,ignoreIllegals:!0});if(ON.configure({}),i.errorRaised)throw i.errorRaised;return i._emitter.root.data.language=i.language,i._emitter.root.data.relevance=i.relevance,i._emitter.root}class BN{constructor(e){this.options=e,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(e){if(""===e)return;const t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})}addKeyword(e,t){this.openNode(t),this.addText(e),this.closeNode()}addSublanguage(e,t){const n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:"element",tagName:"span",properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){const t=e.split(".").map(((e,t)=>t?e+"_".repeat(t):this.options.classPrefix+e)),n={type:"element",tagName:"span",properties:{className:t},children:[]};this.stack[this.stack.length-1].children.push(n),this.stack.push(n)}closeNode(){this.stack.pop()}closeAllNodes(){}finalize(){}toHTML(){return""}}const PN={highlight:RN,highlightAuto:function(e,t={}){const n=t.subset||ON.listLanguages();t.prefix;let r=-1,i={type:"root",data:{language:null,relevance:0},children:[]};if("string"!=typeof e)throw LN("Expected `string` for value, got `%s`",e);for(;++r<n.length;){const o=n[r];if(!ON.getLanguage(o))continue;const s=RN(o,e,t);s.data.relevance>i.data.relevance&&(i=s)}return i},registerLanguage:function(e,t){ON.registerLanguage(e,t)},registered:function(e){return Boolean(ON.getLanguage(e))},listLanguages:function(){return ON.listLanguages()},registerAlias:function(e,t){if("string"==typeof e)ON.registerAliases(t,{languageName:e});else{let t;for(t in e)zN.call(e,t)&&ON.registerAliases(e[t],{languageName:t})}}};PN.registerLanguage("arduino",(function(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line "+"pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+"\\s*\\(",p={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},h={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},f=[h,c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:p,contains:f.concat([{begin:/\(/,end:/\)/,keywords:p,contains:f.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:p,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:p,relevance:0},{begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[a,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:p,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(m,g,h,f,[c,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:p,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:p},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n})),PN.registerLanguage("bash",(function(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);const a={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},l=e.SHEBANG({binary:`(${["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"].join("|")})`,relevance:10}),c={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","for","while","in","do","done","case","esac","function"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[l,e.SHEBANG(),c,a,e.HASH_COMMENT_MODE,o,{match:/(\/[a-z._-]+)+/},s,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},n]}})),PN.registerLanguage("c",(function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line "+"pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+"\\s*\\(",p={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream "+"auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set "+"unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos "+"asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp "+"fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper "+"isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow "+"printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp "+"strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan "+"vfprintf vprintf vsprintf endl initializer_list unique_ptr"},h=[c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],f={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:p,contains:h.concat([{begin:/\(/,end:/\)/,keywords:p,contains:h.concat(["self"]),relevance:0}]),relevance:0},m={begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:p,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:p,relevance:0},{begin:d,returnBegin:!0,contains:[e.inherit(u,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:p,disableAutodetect:!0,illegal:"</",contains:[].concat(f,m,h,[c,{begin:e.IDENT_RE+"::",keywords:p},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:c,strings:a,keywords:p}}})),PN.registerLanguage("cpp",(function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line "+"pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+"\\s*\\(",p={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},h={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},f=[h,c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:p,contains:f.concat([{begin:/\(/,end:/\)/,keywords:p,contains:f.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:p,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:p,relevance:0},{begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[a,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:p,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(m,g,h,f,[c,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:p,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:p},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}})),PN.registerLanguage("csharp",(function(e){const t={keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},n=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),r={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},i={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},o=e.inherit(i,{illegal:/\n/}),s={className:"subst",begin:/\{/,end:/\}/,keywords:t},a=e.inherit(s,{illegal:/\n/}),l={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,a]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]},u=e.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},a]});s.contains=[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.C_BLOCK_COMMENT_MODE],a.contains=[u,l,o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const d={variants:[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},p={begin:"<",end:">",contains:[{beginKeywords:"in out"},n]},h=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",f={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:t,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},d,r,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},n,p,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,p,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+h+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:t,contains:[{beginKeywords:["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"].join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,p],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,relevance:0,contains:[d,r,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},f]}})),PN.registerLanguage("css",(function(e){const t=e.regex,n=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"("+"%|em|ex|ch|rem"+"|vw|vh|vmin|vmax"+"|cm|mm|in|pt|pc|px"+"|deg|grad|rad|turn"+"|s|ms"+"|Hz|kHz"+"|dpi|dpcm|dppx"+")?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(e),r=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+"[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+uC.join("|")+")"},{begin:":(:)?("+dC.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+pC.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...r,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...r,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:cC.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...r,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+lC.join("|")+")\\b"}]}})),PN.registerLanguage("diff",(function(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}})),PN.registerLanguage("go",(function(e){const t={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:t,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{begin:e.C_NUMBER_RE+"[i]",relevance:1},e.C_NUMBER_MODE]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}})),PN.registerLanguage("graphql",(function(e){const t=e.regex;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(/[_A-Za-z][_0-9A-Za-z]*/,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}})),PN.registerLanguage("ini",(function(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},o={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[r,o,i,s,n,"self"],relevance:0},l=t.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:t.concat(l,"(\\s*\\.\\s*",l,")*",t.lookahead(/\s*=\s*[^#\s]/)),className:"attr",starts:{end:/$/,contains:[r,a,o,i,s,n]}}]}})),PN.registerLanguage("java",(function(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+bC("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),i={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},o={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},s={className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:i,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:i,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,gC,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},gC,o]}})),PN.registerLanguage("javascript",(function(e){const t=e.regex,n=yC,r="<>",i="</>",o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,r=e.input[n];if("<"===r||","===r)return void t.ignoreMatch();let i;">"===r&&(((e,{after:t})=>{const n="</"+e[0].slice(1);return-1!==e.input.indexOf(n,t)})(e,{after:n})||t.ignoreMatch());(i=e.input.substring(n).match(/^\s+extends\s+/))&&0===i.index&&t.ignoreMatch()}},s={$pattern:yC,keyword:vC,literal:wC,built_in:MC,"variable.language":kC},a="[0-9](_?[0-9])*",l=`\\.(${a})`,c=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,u={className:"number",variants:[{begin:`(\\b(${c})((${l})|\\.)?|(${l}))`+`[eE][+-]?(${a})\\b`},{begin:`\\b(${c})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},p={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},f={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},m={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},g=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,f,u];d.contains=g.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(g)});const b=[].concat(m,d.contains),y=b.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(b)}]),v={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:y},w={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},_={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[..._C,...xC]}},x={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[v],illegal:/%/},E={match:t.concat(/\b/,(k=[...EC,"super"],t.concat("(?!",k.join("|"),")")),n,t.lookahead(/\(/)),className:"title.function",relevance:0};var k;const M={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},D={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},v]},C="(\\("+"[^()]*(\\("+"[^()]*(\\("+"[^()]*"+"\\)[^()]*)*"+"\\)[^()]*)*"+"\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",S={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[v]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:y,CLASS_REFERENCE:_},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,f,m,u,_,{className:"attr",begin:n+t.lookahead(":"),relevance:0},S,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r,end:i},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},x,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\("+"[^()]*(\\("+"[^()]*(\\("+"[^()]*"+"\\)[^()]*)*"+"\\)[^()]*)*"+"\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[v,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},M,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[v]},E,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},w,D,{match:/\$[(.]/}]}})),PN.registerLanguage("json",(function(e){const t=["true","false","null"],n={scope:"literal",beginKeywords:t.join(" ")};return{name:"JSON",keywords:{literal:t},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}})),PN.registerLanguage("kotlin",(function(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline "+"crossinline dynamic final enum if else do while for when throw try catch finally "+"import package is in fun override companion reified inline lateinit init "+"interface annotation data sealed internal infix operator out by constructor super "+"tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,i,r]}]};r.contains.push(o);const s={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},a={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},l=NC,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),u={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},d=u;return d.variants[1].contains=[u],u.variants[1].contains=[d],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n,s,a,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[u,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,s,a,o,e.C_NUMBER_MODE]},c]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},s,a]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},l]}})),PN.registerLanguage("less",(function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"("+"%|em|ex|ch|rem"+"|vw|vh|vmin|vmax"+"|cm|mm|in|pt|pc|px"+"|deg|grad|rad|turn"+"|s|ms"+"|Hz|kHz"+"|dpi|dpcm|dppx"+")?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(e),n=FC,r="[\\w-]+",i="("+r+"|@\\{"+r+"\\})",o=[],s=[],a=function(e){return{className:"string",begin:"~?"+e+".*?"+e}},l=function(e,t,n){return{className:e,begin:t,relevance:n}},c={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:OC.join(" ")},u={begin:"\\(",end:"\\)",contains:s,keywords:c,relevance:0};s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a("'"),a('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,u,l("variable","@@?"+r,10),l("variable","@\\{"+r+"\\}"),l("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const d=s.concat({begin:/\{/,end:/\}/,contains:o}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},h={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+LC.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},f={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:c,returnEnd:!0,contains:s,relevance:0}},m={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:d}},g={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,l("keyword","all\\b"),l("variable","@\\{"+r+"\\}"),{begin:"\\b("+AC.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,l("selector-tag",i,0),l("selector-id","#"+i),l("selector-class","\\."+i,0),l("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+TC.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+IC.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:d},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:r+":(:)?"+`(${n.join("|")})`,returnBegin:!0,contains:[g]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,m,b,h,g,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:o}})),PN.registerLanguage("lua",(function(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len "+"__gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert "+"collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring "+"module next pairs pcall print rawequal rawget rawset require select setfenv "+"setmetatable tonumber tostring type unpack xpcall arg self "+"coroutine resume yield status wrap create running debug getupvalue "+"debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv "+"io lines write close flush open output type read stderr stdin input stdout popen tmpfile "+"math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan "+"os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall "+"string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower "+"table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}})),PN.registerLanguage("makefile",(function(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort "+"word wordlist firstword lastword dir notdir suffix basename "+"addsuffix addprefix join wildcard realpath abspath error warning "+"shell origin flavor foreach if or and call eval file value"},contains:[t]},i={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},o={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif "+"include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,r,i,{className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},o]}})),PN.registerLanguage("markdown",(function(e){const t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},n={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},r={className:"strong",contains:[],variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},i={className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{begin:/_(?!_)/,end:/_/,relevance:0}]},o=e.inherit(r,{contains:[]}),s=e.inherit(i,{contains:[]});r.contains.push(s),i.contains.push(o);let a=[t,n];return[r,i,o,s].forEach((e=>{e.contains=e.contains.concat(a)})),a=a.concat(r,i),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:a},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:a}]}]},t,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},r,i,{className:"quote",begin:"^>\\s+",contains:a,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},n,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}})),PN.registerLanguage("objectivec",(function(e){const t=/[a-zA-Z@][a-zA-Z0-9_]*/,n={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},illegal:"</",contains:[{className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line "+"pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+n.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:n,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}})),PN.registerLanguage("perl",(function(e){const t=e.regex,n=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"].join(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},o={begin:/->\{/,end:/\}/},s={variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,`(?![A-Za-z])(?![@$%])`)},{begin:/[$%@][^\s\w{]/,relevance:0}]},a=[e.BACKSLASH_ESCAPE,i,s],l=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],c=(e,r,i="\\1")=>{const o="\\1"===i?i:t.concat(i,r);return t.concat(t.concat("(?:",e,")"),r,/(?:\\.|[^\\\/])*?/,o,/(?:\\.|[^\\\/])*?/,i,n)},u=(e,r,i)=>t.concat(t.concat("(?:",e,")"),r,/(?:\\.|[^\\\/])*?/,i,n),d=[s,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:a,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:c("s|tr|y",t.either(...l,{capture:!0}))},{begin:c("s|tr|y","\\(","\\)")},{begin:c("s|tr|y","\\[","\\]")},{begin:c("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:u("(?:m|qr)?",/\//,/\//)},{begin:u("m|qr",t.either(...l,{capture:!0}),/\1/)},{begin:u("m|qr",/\(/,/\)/)},{begin:u("m|qr",/\[/,/\]/)},{begin:u("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=d,o.contains=d,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:d}})),PN.registerLanguage("php",(function(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o={scope:"variable",match:"\\$+"+r},s={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},a=e.inherit(e.APOS_STRING_MODE,{illegal:null}),l="[ \t\n]",c={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(s)}),a,e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(s)})]},u={scope:"number",variants:[{begin:`\\b0[bB][01]+(?:_[01]+)*\\b`},{begin:`\\b0[oO][0-7]+(?:_[0-7]+)*\\b`},{begin:`\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b`},{begin:`(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?`}],relevance:0},d=["false","null","true"],p=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],h=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],f={keyword:p,literal:(e=>{const t=[];return e.forEach((e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())})),t})(d),built_in:h},m=e=>e.map((e=>e.replace(/\|\d+$/,""))),g={variants:[{match:[/new/,t.concat(l,"+"),t.concat("(?!",m(h).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},b=t.concat(r,"\\b(?!\\()"),y={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),b],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),b],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},v={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},w={relevance:0,begin:/\(/,end:/\)/,keywords:f,contains:[v,o,y,e.C_BLOCK_COMMENT_MODE,c,u,g]},_={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",m(p).join("\\b|"),"|",m(h).join("\\b|"),"\\b)"),r,t.concat(l,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[w]};w.contains.push(_);const x=[v,y,e.C_BLOCK_COMMENT_MODE,c,u,g];return{case_insensitive:!1,keywords:f,contains:[{begin:t.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:d,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:d,keyword:["new","array"]},contains:["self",...x]},...x,{scope:"meta",match:i}]},e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},o,_,y,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},g,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",o,y,e.C_BLOCK_COMMENT_MODE,c,u]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},c,u]}})),PN.registerLanguage("php-template",(function(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}})),PN.registerLanguage("plaintext",(function(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}})),PN.registerLanguage("python",(function(e){const t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},o={className:"meta",begin:/^(>>>|\.\.\.) /},s={className:"subst",begin:/\{/,end:/\}/,keywords:i,illegal:/#/},a={begin:/\{\{/,relevance:0},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o,a,s]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,s]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},c="[0-9](_?[0-9])*",u=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,d=`\\b|${r.join("|")}`,p={className:"number",relevance:0,variants:[{begin:`(\\b(${c})|(${u}))[eE][+-]?(${c})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${c})[jJ](?=${d})`}]},h={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},f={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:["self",o,p,l,e.HASH_COMMENT_MODE]}]};return s.contains=[l,p,o],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:i,illegal:/(<\/|->|\?)|=>/,contains:[o,p,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},l,h,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[f]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[p,f,l]}]}})),PN.registerLanguage("python-repl",(function(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}})),PN.registerLanguage("r",(function(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 "+"NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F "+"abs acos acosh all any anyNA Arg as.call as.character "+"as.complex as.double as.environment as.integer as.logical "+"as.null.default as.numeric as.raw asin asinh atan atanh attr "+"attributes baseenv browser c call ceiling class Conj cos cosh "+"cospi cummax cummin cumprod cumsum digamma dim dimnames "+"emptyenv exp expression floor forceAndCall gamma gc.time "+"globalenv Im interactive invisible is.array is.atomic is.call "+"is.character is.complex is.double is.environment is.expression "+"is.finite is.function is.infinite is.integer is.language "+"is.list is.logical is.matrix is.na is.name is.nan is.null "+"is.numeric is.object is.pairlist is.raw is.recursive is.single "+"is.symbol lazyLoadDBfetch length lgamma list log max min "+"missing Mod names nargs nzchar oldClass on.exit pos.to.env "+"proc.time prod quote range Re rep retracemem return round "+"seq_along seq_len seq.int sign signif sin sinh sinpi sqrt "+"standardGeneric substitute sum switch tan tanh tanpi tracemem "+"trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}})),PN.registerLanguage("ruby",(function(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__"],"variable.language":["self","super"],keyword:["alias","and","attr_accessor","attr_reader","attr_writer","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","include","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield"],built_in:["proc","lambda"],literal:["true","false","nil"]},s={className:"doctag",begin:"@[A-Za-z]+"},a={begin:"#<",end:">"},l=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^=begin","^=end",{contains:[s],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:o},u={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},d="[0-9](_?[0-9])*",p={className:"number",relevance:0,variants:[{begin:`\\b(${"[1-9](_?[0-9])*|0"})(\\.(${d}))?([eE][+-]?(${d})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},h={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},f=[u,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/class\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{relevance:0,match:[i,/\.new[ (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[h]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[u,{begin:n}],relevance:0},p,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])"+`(?![A-Za-z])(?![@$?'])`},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(a,l),relevance:0}].concat(a,l);c.contains=f,h.contains=f;const m=[{begin:/^\s*=>/,starts:{end:"$",contains:f}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:f}}];return l.unshift(a),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(m).concat(l).concat(f)}})),PN.registerLanguage("rust",(function(e){const t=e.regex,n={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let\b)/,e.IDENT_RE,t.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",i=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],o=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:o,keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:i},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+r},{begin:"\\b0o([0-7_]+)"+r},{begin:"\\b0x([A-Fa-f0-9_]+)"+r},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+r}],relevance:0},{begin:[/fn/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,e.UNDERSCORE_IDENT_RE,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:i,type:o}},{className:"punctuation",begin:"->"},n]}})),PN.registerLanguage("scss",(function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"("+"%|em|ex|ch|rem"+"|vw|vh|vmin|vmax"+"|cm|mm|in|pt|pc|px"+"|deg|grad|rad|turn"+"|s|ms"+"|Hz|kHz"+"|dpi|dpcm|dppx"+")?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(e),n=BC,r=RC,i="@[a-z-]+",o={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+zC.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+PC.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,o,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:jC.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}})),PN.registerLanguage("shell",(function(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}})),PN.registerLanguage("sql",(function(e){const t=e.regex,n=e.COMMENT("--","$"),r=["true","false","unknown"],i=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],o=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],s=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],a=o,l=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!o.includes(e))),c={begin:t.concat(/\b/,t.either(...a),/\s*\(/),relevance:0,keywords:{built_in:a}};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(e,{exceptions:t,when:n}={}){const r=n;return t=t||[],e.map((e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e))}(l,{when:e=>e.length<3}),literal:r,type:i,built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{begin:t.either(...s),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:l.concat(s),literal:r,type:i}},{className:"type",begin:t.either("double precision","large object","with timezone","without timezone")},c,{className:"variable",begin:/@[a-z0-9]+/},{className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}})),PN.registerLanguage("swift",(function(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,WC(...qC,...KC)],className:{2:"keyword"}},o={match:$C(/\./,WC(...YC)),relevance:0},s=YC.filter((e=>"string"==typeof e)).concat(["_|0"]),a={variants:[{className:"keyword",match:WC(...YC.filter((e=>"string"!=typeof e)).concat(GC).map(VC),...KC)}]},l={$pattern:WC(/\b\w+/,/#\w+/),keyword:s.concat(ZC),literal:QC},c=[i,o,a],u=[{match:$C(/\./,WC(...XC)),relevance:0},{className:"built_in",match:$C(/\b/,WC(...XC),/(?=\()/)}],d={match:/->/,relevance:0},p=[d,{className:"operator",relevance:0,variants:[{match:nS},{match:`\\.(\\.|${tS})+`}]}],h="([0-9]_*)+",f="([0-9a-fA-F]_*)+",m={className:"number",relevance:0,variants:[{match:`\\b(${h})(\\.(${h}))?`+`([eE][+-]?(${h}))?\\b`},{match:`\\b0x(${f})(\\.(${f}))?`+`([pP][+-]?(${h}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},g=(e="")=>({className:"subst",variants:[{match:$C(/\\/,e,/[0\\tnr"']/)},{match:$C(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),b=(e="")=>({className:"subst",match:$C(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),y=(e="")=>({className:"subst",label:"interpol",begin:$C(/\\/,e,/\(/),end:/\)/}),v=(e="")=>({begin:$C(e,/"""/),end:$C(/"""/,e),contains:[g(e),b(e),y(e)]}),w=(e="")=>({begin:$C(e,/"/),end:$C(/"/,e),contains:[g(e),y(e)]}),_={className:"string",variants:[v(),v("#"),v("##"),v("###"),w(),w("#"),w("##"),w("###")]},x={match:$C(/`/,oS,/`/)},E=[x,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${iS}+`}],k=[{match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:lS,contains:[...p,m,_]}]}},{className:"keyword",match:$C(/@/,WC(...aS))},{className:"meta",match:$C(/@/,oS)}],M={match:HC(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:$C(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,iS,"+")},{className:"type",match:sS,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:$C(/\s+&\s+/,HC(sS)),relevance:0}]},D={begin:/</,end:/>/,keywords:l,contains:[...r,...c,...k,d,M]};M.contains.push(D);const C={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{match:$C(oS,/\s*:/),keywords:"_|0",relevance:0},...r,...c,...u,...p,m,_,...E,...k,M]},S={begin:/</,end:/>/,contains:[...r,M]},N={begin:/\(/,end:/\)/,keywords:l,contains:[{begin:WC(HC($C(oS,/\s*:/)),HC($C(oS,/\s+/,oS,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:oS}]},...r,...c,...p,m,_,...k,M,C],endsParent:!0,illegal:/["']/},A={match:[/func/,/\s+/,WC(x.match,oS,nS)],className:{1:"keyword",3:"title.function"},contains:[S,N,t],illegal:[/\[/,/%/]},O={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[S,N,t],illegal:/\[|%/},T={match:[/operator/,/\s+/,nS],className:{1:"keyword",3:"title"}},I={begin:[/precedencegroup/,/\s+/,sS],className:{1:"keyword",3:"title"},contains:[M],keywords:[...JC,...QC],end:/}/};for(const e of _.variants){const t=e.contains.find((e=>"interpol"===e.label));t.keywords=l;const n=[...c,...u,...p,m,_,...E];t.contains=[...n,{begin:/\(/,end:/\)/,contains:["self",...n]}]}return{name:"Swift",keywords:l,contains:[...r,A,O,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:l,contains:[e.inherit(e.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c]},T,I,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...c,...u,...p,m,_,...E,...k,M,C]}})),PN.registerLanguage("typescript",(function(e){const t=bS(e),n=cS,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[t.exports.CLASS_REFERENCE]},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[t.exports.CLASS_REFERENCE]},s={$pattern:cS,keyword:uS.concat(["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"]),literal:dS,built_in:gS.concat(r),"variable.language":mS},a={className:"meta",begin:"@"+n},l=(e,t,n)=>{const r=e.contains.findIndex((e=>e.label===t));if(-1===r)throw new Error("can not find mode to replace");e.contains.splice(r,1,n)};Object.assign(t.keywords,s),t.exports.PARAMS_CONTAINS.push(a),t.contains=t.contains.concat([a,i,o]),l(t,"shebang",e.SHEBANG()),l(t,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/});const c=t.contains.find((e=>"func.def"===e.label));return c.relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx"]}),t})),PN.registerLanguage("vbnet",(function(e){const t=e.regex,n=/\d{1,2}\/\d{1,2}\/\d{4}/,r=/\d{4}-\d{1,2}-\d{1,2}/,i=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,s={className:"literal",variants:[{begin:t.concat(/# */,t.either(r,n),/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,i,/ *#/)},{begin:t.concat(/# */,t.either(r,n),/ +/,t.either(i,o),/ *#/)}]},a=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),l=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval "+"call case catch class compare const continue custom declare default delegate dim distinct do "+"each equals else elseif end enum erase error event exit explicit finally for friend from function "+"get global goto group handles if implements imports in inherits interface into iterator "+"join key let lib loop me mid module mustinherit mustoverride mybase myclass "+"namespace narrowing new next notinheritable notoverridable "+"of off on operator option optional order overloads overridable overrides "+"paramarray partial preserve private property protected public "+"raiseevent readonly redim removehandler resume return "+"select set shadows shared skip static step stop structure strict sub synclock "+"take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor "+"cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s,{className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{className:"label",begin:/^\w+:/},a,l,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[l]}]}})),PN.registerLanguage("wasm",(function(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);return t.contains.push("self"),{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"]},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},{className:"variable",begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},{className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}})),PN.registerLanguage("xml",(function(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(i,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),a=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,a,s,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,o,a,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}})),PN.registerLanguage("yaml",(function(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},i=e.inherit(r,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),o={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},s={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},a={begin:/\{/,end:/\}/,contains:[s],illegal:"\\n",relevance:0},l={begin:"\\[",end:"\\]",contains:[s],illegal:"\\n",relevance:0},c=[{className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},o,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},a,l,r],u=[...c];return u.pop(),u.push(i),s.contains=u,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:c}}));const UN=()=>r.createElement($x,{"data-cy":"neeto-editor-code-block"},r.createElement("pre",null,r.createElement(Hx,{as:"code"})));var HN=aC.extend({addNodeView:()=>new qx(UN)}).configure({lowlight:PN});const $N={underline:{},highlight:{},codeBlock:{},figCaption:{},embeds:{},link:{},emojiSuggestion:{},emojiPicker:{},customCommands:{},characterCount:{},focus:{mode:"shallowest"},starterKit:{document:!1,codeBlock:!1,code:!1},placeholder:{}};var WN=Av.create({name:"paste-unformatted",addCommands:()=>({pasteUnformatted:()=>async e=>{let{editor:t}=e;const n=await navigator.clipboard.readText();t.commands.insertContent(n)}})}),VN=_w.create({name:"external-video",addOptions:()=>({inline:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},title:{default:null},frameborder:{default:"0"},allow:{default:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"},allowfullscreen:{default:"allowfullscreen"}}),parseHTML:()=>[{tag:"iframe[src]"}],renderHTML(e){let{HTMLAttributes:t}=e;return["iframe",pv(this.options.HTMLAttributes,{...t,class:"video-wrapper"})]},addCommands(){return{setExternalVideo:e=>t=>{let{commands:n}=t;return n.insertContent({type:this.name,attrs:e})}}}});const qN=new Dm("suggestion");function KN({pluginKey:e=qN,editor:t,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:s="span",decorationClass:a="suggestion",command:l=(()=>null),items:c=(()=>[]),render:u=(()=>({})),allow:d=(()=>!0)}){let p;const h=null==u?void 0:u(),f=new Em({key:e,view(){return{update:async(e,n)=>{var r,i,o,s,a,u,d;const f=null===(r=this.key)||void 0===r?void 0:r.getState(n),m=null===(i=this.key)||void 0===i?void 0:i.getState(e.state),g=f.active&&m.active&&f.range.from!==m.range.from,b=!f.active&&m.active,y=f.active&&!m.active,v=b||g,w=!b&&!y&&f.query!==m.query&&!g,_=y||g;if(!v&&!w&&!_)return;const x=_&&!v?f:m,E=e.dom.querySelector(`[data-decoration-id="${x.decorationId}"]`);p={editor:t,range:x.range,query:x.query,text:x.text,items:[],command:e=>{l({editor:t,range:x.range,props:e})},decorationNode:E,clientRect:E?()=>{var n;const{decorationId:r}=null===(n=this.key)||void 0===n?void 0:n.getState(t.state),i=e.dom.querySelector(`[data-decoration-id="${r}"]`);return(null==i?void 0:i.getBoundingClientRect())||null}:null},v&&(null===(o=null==h?void 0:h.onBeforeStart)||void 0===o||o.call(h,p)),w&&(null===(s=null==h?void 0:h.onBeforeUpdate)||void 0===s||s.call(h,p)),(w||v)&&(p.items=await c({editor:t,query:x.query})),_&&(null===(a=null==h?void 0:h.onExit)||void 0===a||a.call(h,p)),w&&(null===(u=null==h?void 0:h.onUpdate)||void 0===u||u.call(h,p)),v&&(null===(d=null==h?void 0:h.onStart)||void 0===d||d.call(h,p))},destroy:()=>{var e;p&&(null===(e=null==h?void 0:h.onExit)||void 0===e||e.call(h,p))}}},state:{init:()=>({active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}),apply(e,s,a,l){const{isEditable:c}=t,{composing:u}=t.view,{selection:p}=e,{empty:h,from:f}=p,m={...s};if(m.composing=u,c&&(h||t.view.composing)){!(f<s.range.from||f>s.range.to)||u||s.composing||(m.active=!1);const e=function(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:s}=e,a=n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),l=new RegExp(`\\s${a}$`),c=o?"^":"",u=r?new RegExp(`${c}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${c}(?:^)?${a}[^\\s${a}]*`,"gm"),d=(null===(t=s.nodeBefore)||void 0===t?void 0:t.isText)&&s.nodeBefore.text;if(!d)return null;const p=s.pos-d.length,h=Array.from(d.matchAll(u)).pop();if(!h||void 0===h.input||void 0===h.index)return null;const f=h.input.slice(Math.max(0,h.index-1),h.index),m=new RegExp(`^[${null==i?void 0:i.join("")}\0]?$`).test(f);if(null!==i&&!m)return null;const g=p+h.index;let b=g+h[0].length;return r&&l.test(d.slice(b-1,b+1))&&(h[0]+=" ",b+=1),g<s.pos&&b>=s.pos?{range:{from:g,to:b},query:h[0].slice(n.length),text:h[0]}:null}({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:p.$from}),a=`id_${Math.floor(4294967295*Math.random())}`;e&&d({editor:t,state:l,range:e.range})?(m.active=!0,m.decorationId=s.decorationId?s.decorationId:a,m.range=e.range,m.query=e.query,m.text=e.text):m.active=!1}else m.active=!1;return m.active||(m.decorationId=null,m.range={from:0,to:0},m.query=null,m.text=null),m}},props:{handleKeyDown(e,t){var n;const{active:r,range:i}=f.getState(e.state);return r&&(null===(n=null==h?void 0:h.onKeyDown)||void 0===n?void 0:n.call(h,{view:e,event:t,range:i}))||!1},decorations(e){const{active:t,range:n,decorationId:r}=f.getState(e);return t?uy.create(e.doc,[ay.inline(n.from,n.to,{nodeName:s,class:a,"data-decoration-id":r})]):null}}});return f}function GN(e){return e&&e.__esModule?e.default:e}function YN(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var QN,JN,ZN,XN,eA,tA,nA={},rA=[],iA=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function oA(e,t){for(var n in t)e[n]=t[n];return e}function sA(e){var t=e.parentNode;t&&t.removeChild(e)}function aA(e,t,n){var r,i,o,s={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?QN.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return lA(e,s,r,i,null)}function lA(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++ZN:i};return null==i&&null!=JN.vnode&&JN.vnode(o),o}function cA(e){return e.children}function uA(e,t){this.props=e,this.context=t}function dA(e,t){if(null==t)return e.__?dA(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?dA(e):null}function pA(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return pA(e)}}function hA(e){(!e.__d&&(e.__d=!0)&&XN.push(e)&&!fA.__r++||tA!==JN.debounceRendering)&&((tA=JN.debounceRendering)||eA)(fA)}function fA(){for(var e;fA.__r=XN.length;)e=XN.sort((function(e,t){return e.__v.__b-t.__v.__b})),XN=[],e.some((function(e){var t,n,r,i,o,s;e.__d&&(o=(i=(t=e).__v).__e,(s=t.__P)&&(n=[],(r=oA({},i)).__v=i.__v+1,EA(s,i,r,t.__n,void 0!==s.ownerSVGElement,null!=i.__h?[o]:null,n,null==o?dA(i):o,i.__h),kA(n,i),i.__e!=o&&pA(i)))}))}function mA(e,t,n,r,i,o,s,a,l,c){var u,d,p,h,f,m,g,b=r&&r.__k||rA,y=b.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(h=n.__k[u]=null==(h=t[u])||"boolean"==typeof h?null:"string"==typeof h||"number"==typeof h||"bigint"==typeof h?lA(null,h,null,null,h):Array.isArray(h)?lA(cA,{children:h},null,null,null):h.__b>0?lA(h.type,h.props,h.key,null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(p=b[u])||p&&h.key==p.key&&h.type===p.type)b[u]=void 0;else for(d=0;d<y;d++){if((p=b[d])&&h.key==p.key&&h.type===p.type){b[d]=void 0;break}p=null}EA(e,h,p=p||nA,i,o,s,a,l,c),f=h.__e,(d=h.ref)&&p.ref!=d&&(g||(g=[]),p.ref&&g.push(p.ref,null,h),g.push(d,h.__c||f,h)),null!=f?(null==m&&(m=f),"function"==typeof h.type&&h.__k===p.__k?h.__d=l=gA(h,l,e):l=yA(e,h,p,b,f,l),"function"==typeof n.type&&(n.__d=l)):l&&p.__e==l&&l.parentNode!=e&&(l=dA(p))}for(n.__e=m,u=y;u--;)null!=b[u]&&("function"==typeof n.type&&null!=b[u].__e&&b[u].__e==n.__d&&(n.__d=dA(r,u+1)),DA(b[u],b[u]));if(g)for(u=0;u<g.length;u++)MA(g[u],g[++u],g[++u])}function gA(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?gA(r,t,n):yA(n,r,r,i,r.__e,t));return t}function bA(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){bA(e,t)})):t.push(e)),t}function yA(e,t,n,r,i,o){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<r.length;l+=2)if(a==i)break e;e.insertBefore(i,o),s=o}return void 0!==s?s:i.nextSibling}function vA(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||iA.test(t)?n:n+"px"}function wA(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||vA(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||vA(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?xA:_A,o):e.removeEventListener(t,o?xA:_A,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function _A(e){this.l[e.type+!1](JN.event?JN.event(e):e)}function xA(e){this.l[e.type+!0](JN.event?JN.event(e):e)}function EA(e,t,n,r,i,o,s,a,l){var c,u,d,p,h,f,m,g,b,y,v,w=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(c=JN.__b)&&c(t);try{e:if("function"==typeof w){if(g=t.props,b=(c=w.contextType)&&r[c.__c],y=c?b?b.props.value:c.__:r,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in w&&w.prototype.render?t.__c=u=new w(g,y):(t.__c=u=new uA(g,y),u.constructor=w,u.render=CA),b&&b.sub(u),u.props=g,u.state||(u.state={}),u.context=y,u.__n=r,d=u.__d=!0,u.__h=[]),null==u.__s&&(u.__s=u.state),null!=w.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=oA({},u.__s)),oA(u.__s,w.getDerivedStateFromProps(g,u.__s))),p=u.props,h=u.state,d)null==w.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==w.getDerivedStateFromProps&&g!==p&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,y),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,y)||t.__v===n.__v){u.props=g,u.state=u.__s,t.__v!==n.__v&&(u.__d=!1),u.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),u.__h.length&&s.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,y),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(p,h,f)}))}u.context=y,u.props=g,u.state=u.__s,(c=JN.__r)&&c(t),u.__d=!1,u.__v=t,u.__P=e,c=u.render(u.props,u.state,u.context),u.state=u.__s,null!=u.getChildContext&&(r=oA(oA({},r),u.getChildContext())),d||null==u.getSnapshotBeforeUpdate||(f=u.getSnapshotBeforeUpdate(p,h)),v=null!=c&&c.type===cA&&null==c.key?c.props.children:c,mA(e,Array.isArray(v)?v:[v],t,n,r,i,o,s,a,l),u.base=t.__e,t.__h=null,u.__h.length&&s.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,i,o,s,a){var l,c,u,d=n.props,p=t.props,h=t.type,f=0;if("svg"===h&&(i=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&"setAttribute"in l==!!h&&(h?l.localName===h:3===l.nodeType)){e=l,o[f]=null;break}if(null==e){if(null===h)return document.createTextNode(p);e=i?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,p.is&&p),o=null,a=!1}if(null===h)d===p||a&&e.data===p||(e.data=p);else{if(o=o&&QN.call(e.childNodes),c=(d=n.props||nA).dangerouslySetInnerHTML,u=p.dangerouslySetInnerHTML,!a){if(null!=o)for(d={},f=0;f<e.attributes.length;f++)d[e.attributes[f].name]=e.attributes[f].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||wA(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||wA(e,o,t[o],n[o],r)}(e,p,d,i,a),u)t.__k=[];else if(f=t.props.children,mA(e,Array.isArray(f)?f:[f],t,n,r,i&&"foreignObject"!==h,o,s,o?o[0]:n.__k&&dA(n,0),a),null!=o)for(f=o.length;f--;)null!=o[f]&&sA(o[f]);a||("value"in p&&void 0!==(f=p.value)&&(f!==d.value||f!==e.value||"progress"===h&&!f)&&wA(e,"value",f,d.value,!1),"checked"in p&&void 0!==(f=p.checked)&&f!==e.checked&&wA(e,"checked",f,d.checked,!1))}return e}(n.__e,t,n,r,i,o,s,l);(c=JN.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),JN.__e(e,t,n)}}function kA(e,t){JN.__c&&JN.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){JN.__e(e,t.__v)}}))}function MA(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){JN.__e(e,n)}}function DA(e,t,n){var r,i;if(JN.unmount&&JN.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||MA(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){JN.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&DA(r[i],t,"function"!=typeof e.type);n||null==e.__e||sA(e.__e),e.__e=e.__d=void 0}function CA(e,t,n){return this.constructor(e,n)}function SA(e,t,n){var r,i,o;JN.__&&JN.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],EA(t,e=(!r&&n||t).__k=aA(cA,null,[e]),i||nA,nA,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?QN.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),kA(o,e)}QN=rA.slice,JN={__e:function(e,t){for(var n,r,i;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),i=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),i=n.__d),i)return n.__E=n}catch(t){e=t}throw e}},ZN=0,uA.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=oA({},this.state),"function"==typeof e&&(e=e(oA({},n),this.props)),e&&oA(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),hA(this))},uA.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),hA(this))},uA.prototype.render=cA,XN=[],eA="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,fA.__r=0;var NA=0;function AA(e,t,n,r,i){var o,s,a={};for(s in t)"ref"==s?o=t[s]:a[s]=t[s];var l={type:e,props:a,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--NA,__source:r,__self:i};if("function"==typeof e&&(o=e.defaultProps))for(s in o)void 0===a[s]&&(a[s]=o[s]);return JN.vnode&&JN.vnode(l),l}var OA={set:function(e,t){try{window.localStorage[`emoji-mart.${e}`]=JSON.stringify(t)}catch(e){}},get:function(e){try{const t=window.localStorage[`emoji-mart.${e}`];if(t)return JSON.parse(t)}catch(e){}}};const TA=new Map,IA=[{v:14,emoji:"🫠"},{v:13.1,emoji:"😶‍🌫️"},{v:13,emoji:"🥸"},{v:12.1,emoji:"🧑‍🦰"},{v:12,emoji:"🥱"},{v:11,emoji:"🥰"},{v:5,emoji:"🤩"},{v:4,emoji:"👱‍♀️"},{v:3,emoji:"🤣"},{v:2,emoji:"👋🏻"},{v:1,emoji:"🙃"}];function LA(e){if(TA.has(e))return TA.get(e);const t=FA(e);return TA.set(e,t),t}const FA=(()=>{let e=null;try{navigator.userAgent.includes("jsdom")||(e=document.createElement("canvas").getContext("2d"))}catch{}if(!e)return()=>!1;const t=25,n=20,r=Math.floor(t/2);return e.font=r+"px Arial, Sans-Serif",e.textBaseline="top",e.canvas.width=2*n,e.canvas.height=t,r=>{e.clearRect(0,0,2*n,t),e.fillStyle="#FF0000",e.fillText(r,0,22),e.fillStyle="#0000FF",e.fillText(r,n,22);const i=e.getImageData(0,0,n,t).data,o=i.length;let s=0;for(;s<o&&!i[s+3];s+=4);if(s>=o)return!1;const a=n+s/4%n,l=Math.floor(s/4/n),c=e.getImageData(a,l,1,1).data;return i[s]===c[0]&&i[s+2]===c[2]&&!(e.measureText(r).width>=n)}})();var zA={latestVersion:function(){for(const{v:e,emoji:t}of IA)if(LA(t))return e},noCountryFlags:function(){return!LA("🇨🇦")}};const jA=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart"];let RA=null;var BA,PA={add:function(e){RA||(RA=OA.get("frequently")||{});const t=e.id||e;t&&(RA[t]||(RA[t]=0),RA[t]+=1,OA.set("last",t),OA.set("frequently",RA))},get:function({maxFrequentRows:e,perLine:t}){if(!e)return[];RA||(RA=OA.get("frequently"));let n=[];if(!RA){RA={};for(let e in jA.slice(0,t)){const r=jA[e];RA[r]=t-e,n.push(r)}return n}const r=e*t,i=OA.get("last");for(let e in RA)n.push(e);if(n.sort(((e,t)=>{const n=RA[t],r=RA[e];return n==r?e.localeCompare(t):n-r})),n.length>r){const e=n.slice(r);n=n.slice(0,r);for(let t of e)t!=i&&delete RA[t];i&&-1==n.indexOf(i)&&(delete RA[n[n.length-1]],n.splice(-1,1,i)),OA.set("frequently",RA)}return n}};BA=JSON.parse('{"search":"Search","search_no_results_1":"Oh no!","search_no_results_2":"That emoji couldn’t be found","pick":"Pick an emoji…","add_custom":"Add custom emoji","categories":{"activity":"Activity","custom":"Custom","flags":"Flags","foods":"Food & Drink","frequent":"Frequently used","nature":"Animals & Nature","objects":"Objects","people":"Smileys & People","places":"Travel & Places","search":"Search Results","symbols":"Symbols"},"skins":{"1":"Default","2":"Light","3":"Medium-Light","4":"Medium","5":"Medium-Dark","6":"Dark","choose":"Choose default skin tone"}}');var UA={autoFocus:{value:!1},emojiButtonColors:{value:null},emojiButtonRadius:{value:"100%"},emojiButtonSize:{value:36},emojiSize:{value:24},emojiVersion:{value:14,choices:[1,2,3,4,5,11,12,12.1,13,13.1,14]},icons:{value:"auto",choices:["auto","outline","solid"]},locale:{value:"en",choices:["en","ar","cs","de","es","fa","fi","fr","it","ja","nl","pl","pt","ru","uk","zh"]},maxFrequentRows:{value:4},navPosition:{value:"top",choices:["top","bottom","none"]},noCountryFlags:{value:!1},noResultsEmoji:{value:null},perLine:{value:9},previewEmoji:{value:null},previewPosition:{value:"bottom",choices:["top","bottom","none"]},searchPosition:{value:"sticky",choices:["sticky","static","none"]},set:{value:"native",choices:["native","apple","facebook","google","twitter"]},skin:{value:1,choices:[1,2,3,4,5,6]},skinTonePosition:{value:"preview",choices:["preview","search","none"]},theme:{value:"auto",choices:["auto","light","dark"]},categories:null,categoryIcons:null,custom:null,data:null,i18n:null,getImageURL:null,getSpritesheetURL:null,onAddCustomEmoji:null,onClickOutside:null,onEmojiSelect:null,stickySearch:{deprecated:!0,value:!0}};let HA=null,$A=null;const WA={};async function VA(e){if(WA[e])return WA[e];const t=await fetch(e),n=await t.json();return WA[e]=n,n}let qA=null,KA=null,GA=!1;function YA(e,{caller:t}={}){return qA||(qA=new Promise((e=>{KA=e}))),e?async function(e){GA=!0;let{emojiVersion:t,set:n,locale:r}=e;if(t||(t=UA.emojiVersion.value),n||(n=UA.set.value),r||(r=UA.locale.value),$A)$A.categories=$A.categories.filter((e=>!!!e.name));else{$A=("function"==typeof e.data?await e.data():e.data)||await VA(`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/sets/${t}/${n}.json`),$A.emoticons={},$A.natives={},$A.categories.unshift({id:"frequent",emojis:[]});for(const e in $A.aliases){const t=$A.aliases[e],n=$A.emojis[t];n&&(n.aliases||(n.aliases=[]),n.aliases.push(e))}}if(HA=("function"==typeof e.i18n?await e.i18n():e.i18n)||("en"==r?GN(BA):await VA(`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/i18n/${r}.json`)),e.custom)for(let t in e.custom){t=parseInt(t);const n=e.custom[t],r=e.custom[t-1];if(n.emojis&&n.emojis.length){n.id||(n.id=`custom_${t+1}`),n.name||(n.name=HA.categories.custom),r&&!n.icon&&(n.target=r.target||r),$A.categories.push(n);for(const e of n.emojis)$A.emojis[e.id]=e}}e.categories&&($A.categories=$A.categories.filter((t=>-1!=e.categories.indexOf(t.id))).sort(((t,n)=>e.categories.indexOf(t.id)-e.categories.indexOf(n.id))));let i=null,o=null;"native"==n&&(i=zA.latestVersion(),o=e.noCountryFlags||zA.noCountryFlags());let s=$A.categories.length,a=!1;for(;s--;){const t=$A.categories[s];if("frequent"==t.id){let{maxFrequentRows:n,perLine:r}=e;n||(n=UA.maxFrequentRows.value),r||(r=UA.perLine.value),t.emojis=PA.get({maxFrequentRows:n,perLine:r})}if(!t.emojis||!t.emojis.length){$A.categories.splice(s,1);continue}const{categoryIcons:n}=e;if(n){const e=n[t.id];e&&!t.icon&&(t.icon=e)}let r=t.emojis.length;for(;r--;){const e=t.emojis[r],n=e.id?e:$A.emojis[e],s=()=>{t.emojis.splice(r,1)};if(n)if(i&&n.version>i)s();else if(!o||"flags"!=t.id||eO.includes(n.id)){if(!n.search){if(a=!0,n.search=","+[[n.id,!1],[n.name,!0],[n.keywords,!1],[n.emoticons,!1]].map((([e,t])=>{if(e)return(Array.isArray(e)?e:[e]).map((e=>(t?e.split(/[-|_|\s]+/):[e]).map((e=>e.toLowerCase())))).flat()})).flat().filter((e=>e&&e.trim())).join(","),n.emoticons)for(const e of n.emoticons)$A.emoticons[e]||($A.emoticons[e]=n.id);let e=0;for(const t of n.skins){if(!t)continue;e++;const{native:r}=t;r&&($A.natives[r]=n.id,n.search+=`,${r}`);const i=1==e?"":`:skin-tone-${e}:`;t.shortcodes=`:${n.id}:${i}`}}}else s();else s()}}a&&XA.reset();KA()}(e):t&&!GA&&console.warn(`\`${t}\` requires data to be initialized first. Promise will be pending until \`init\` is called.`),qA}function QA(e,t,n){e||(e={});const r={};for(let i in t)r[i]=JA(i,e,t,n);return r}function JA(e,t,n,r){const i=n[e];let o=r&&r.getAttribute(e)||(null!=t[e]&&null!=t[e]?t[e]:null);return i?(null!=o&&i.value&&typeof i.value!=typeof o&&(o="boolean"==typeof i.value?"false"!=o:i.value.constructor(o)),i.transform&&o&&(o=i.transform(o)),(null==o||i.choices&&-1==i.choices.indexOf(o))&&(o=i.value),o):o}let ZA=null;var XA={search:async function(e,{maxResults:t,caller:n}={}){if(!e||!e.trim().length)return null;t||(t=90),await YA(null,{caller:n||"SearchIndex.search"});const r=e.toLowerCase().replace(/(\w)-/,"$1 ").split(/[\s|,]+/).filter(((e,t,n)=>e.trim()&&n.indexOf(e)==t));if(!r.length)return;let i,o,s=ZA||(ZA=Object.values($A.emojis));for(const e of r){if(!s.length)break;i=[],o={};for(const t of s){if(!t.search)continue;const n=t.search.indexOf(`,${e}`);-1!=n&&(i.push(t),o[t.id]||(o[t.id]=0),o[t.id]+=t.id==e?0:n+1)}s=i}return i.length<2||(i.sort(((e,t)=>{const n=o[e.id],r=o[t.id];return n==r?e.id.localeCompare(t.id):n-r})),i.length>t&&(i=i.slice(0,t))),i},get:function(e){return e.id?e:$A.emojis[e]||$A.emojis[$A.aliases[e]]||$A.emojis[$A.natives[e]]},reset:function(){ZA=null},SHORTCODES_REGEX:/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/};const eO=["checkered_flag","crossed_flags","pirate_flag","rainbow-flag","transgender_flag","triangular_flag_on_post","waving_black_flag","waving_white_flag"];var tO={categories:{activity:{outline:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:AA("path",{d:"M12 0C5.373 0 0 5.372 0 12c0 6.627 5.373 12 12 12 6.628 0 12-5.373 12-12 0-6.628-5.372-12-12-12m9.949 11H17.05c.224-2.527 1.232-4.773 1.968-6.113A9.966 9.966 0 0 1 21.949 11M13 11V2.051a9.945 9.945 0 0 1 4.432 1.564c-.858 1.491-2.156 4.22-2.392 7.385H13zm-2 0H8.961c-.238-3.165-1.536-5.894-2.393-7.385A9.95 9.95 0 0 1 11 2.051V11zm0 2v8.949a9.937 9.937 0 0 1-4.432-1.564c.857-1.492 2.155-4.221 2.393-7.385H11zm4.04 0c.236 3.164 1.534 5.893 2.392 7.385A9.92 9.92 0 0 1 13 21.949V13h2.04zM4.982 4.887C5.718 6.227 6.726 8.473 6.951 11h-4.9a9.977 9.977 0 0 1 2.931-6.113M2.051 13h4.9c-.226 2.527-1.233 4.771-1.969 6.113A9.972 9.972 0 0 1 2.051 13m16.967 6.113c-.735-1.342-1.744-3.586-1.968-6.113h4.899a9.961 9.961 0 0 1-2.931 6.113"})}),solid:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:AA("path",{d:"M16.17 337.5c0 44.98 7.565 83.54 13.98 107.9C35.22 464.3 50.46 496 174.9 496c9.566 0 19.59-.4707 29.84-1.271L17.33 307.3C16.53 317.6 16.17 327.7 16.17 337.5zM495.8 174.5c0-44.98-7.565-83.53-13.98-107.9c-4.688-17.54-18.34-31.23-36.04-35.95C435.5 27.91 392.9 16 337 16c-9.564 0-19.59 .4707-29.84 1.271l187.5 187.5C495.5 194.4 495.8 184.3 495.8 174.5zM26.77 248.8l236.3 236.3c142-36.1 203.9-150.4 222.2-221.1L248.9 26.87C106.9 62.96 45.07 177.2 26.77 248.8zM256 335.1c0 9.141-7.474 16-16 16c-4.094 0-8.188-1.564-11.31-4.689L164.7 283.3C161.6 280.2 160 276.1 160 271.1c0-8.529 6.865-16 16-16c4.095 0 8.189 1.562 11.31 4.688l64.01 64C254.4 327.8 256 331.9 256 335.1zM304 287.1c0 9.141-7.474 16-16 16c-4.094 0-8.188-1.564-11.31-4.689L212.7 235.3C209.6 232.2 208 228.1 208 223.1c0-9.141 7.473-16 16-16c4.094 0 8.188 1.562 11.31 4.688l64.01 64.01C302.5 279.8 304 283.9 304 287.1zM256 175.1c0-9.141 7.473-16 16-16c4.094 0 8.188 1.562 11.31 4.688l64.01 64.01c3.125 3.125 4.688 7.219 4.688 11.31c0 9.133-7.468 16-16 16c-4.094 0-8.189-1.562-11.31-4.688l-64.01-64.01C257.6 184.2 256 180.1 256 175.1z"})})},custom:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:AA("path",{d:"M417.1 368c-5.937 10.27-16.69 16-27.75 16c-5.422 0-10.92-1.375-15.97-4.281L256 311.4V448c0 17.67-14.33 32-31.1 32S192 465.7 192 448V311.4l-118.3 68.29C68.67 382.6 63.17 384 57.75 384c-11.06 0-21.81-5.734-27.75-16c-8.828-15.31-3.594-34.88 11.72-43.72L159.1 256L41.72 187.7C26.41 178.9 21.17 159.3 29.1 144C36.63 132.5 49.26 126.7 61.65 128.2C65.78 128.7 69.88 130.1 73.72 132.3L192 200.6V64c0-17.67 14.33-32 32-32S256 46.33 256 64v136.6l118.3-68.29c3.838-2.213 7.939-3.539 12.07-4.051C398.7 126.7 411.4 132.5 417.1 144c8.828 15.31 3.594 34.88-11.72 43.72L288 256l118.3 68.28C421.6 333.1 426.8 352.7 417.1 368z"})}),flags:{outline:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:AA("path",{d:"M0 0l6.084 24H8L1.916 0zM21 5h-4l-1-4H4l3 12h3l1 4h13L21 5zM6.563 3h7.875l2 8H8.563l-2-8zm8.832 10l-2.856 1.904L12.063 13h3.332zM19 13l-1.5-6h1.938l2 8H16l3-2z"})}),solid:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:AA("path",{d:"M64 496C64 504.8 56.75 512 48 512h-32C7.25 512 0 504.8 0 496V32c0-17.75 14.25-32 32-32s32 14.25 32 32V496zM476.3 0c-6.365 0-13.01 1.35-19.34 4.233c-45.69 20.86-79.56 27.94-107.8 27.94c-59.96 0-94.81-31.86-163.9-31.87C160.9 .3055 131.6 4.867 96 15.75v350.5c32-9.984 59.87-14.1 84.85-14.1c73.63 0 124.9 31.78 198.6 31.78c31.91 0 68.02-5.971 111.1-23.09C504.1 355.9 512 344.4 512 332.1V30.73C512 11.1 495.3 0 476.3 0z"})})},foods:{outline:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:AA("path",{d:"M17 4.978c-1.838 0-2.876.396-3.68.934.513-1.172 1.768-2.934 4.68-2.934a1 1 0 0 0 0-2c-2.921 0-4.629 1.365-5.547 2.512-.064.078-.119.162-.18.244C11.73 1.838 10.798.023 9.207.023 8.579.022 7.85.306 7 .978 5.027 2.54 5.329 3.902 6.492 4.999 3.609 5.222 0 7.352 0 12.969c0 4.582 4.961 11.009 9 11.009 1.975 0 2.371-.486 3-1 .629.514 1.025 1 3 1 4.039 0 9-6.418 9-11 0-5.953-4.055-8-7-8M8.242 2.546c.641-.508.943-.523.965-.523.426.169.975 1.405 1.357 3.055-1.527-.629-2.741-1.352-2.98-1.846.059-.112.241-.356.658-.686M15 21.978c-1.08 0-1.21-.109-1.559-.402l-.176-.146c-.367-.302-.816-.452-1.266-.452s-.898.15-1.266.452l-.176.146c-.347.292-.477.402-1.557.402-2.813 0-7-5.389-7-9.009 0-5.823 4.488-5.991 5-5.991 1.939 0 2.484.471 3.387 1.251l.323.276a1.995 1.995 0 0 0 2.58 0l.323-.276c.902-.78 1.447-1.251 3.387-1.251.512 0 5 .168 5 6 0 3.617-4.187 9-7 9"})}),solid:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:AA("path",{d:"M481.9 270.1C490.9 279.1 496 291.3 496 304C496 316.7 490.9 328.9 481.9 337.9C472.9 346.9 460.7 352 448 352H64C51.27 352 39.06 346.9 30.06 337.9C21.06 328.9 16 316.7 16 304C16 291.3 21.06 279.1 30.06 270.1C39.06 261.1 51.27 256 64 256H448C460.7 256 472.9 261.1 481.9 270.1zM475.3 388.7C478.3 391.7 480 395.8 480 400V416C480 432.1 473.3 449.3 461.3 461.3C449.3 473.3 432.1 480 416 480H96C79.03 480 62.75 473.3 50.75 461.3C38.74 449.3 32 432.1 32 416V400C32 395.8 33.69 391.7 36.69 388.7C39.69 385.7 43.76 384 48 384H464C468.2 384 472.3 385.7 475.3 388.7zM50.39 220.8C45.93 218.6 42.03 215.5 38.97 211.6C35.91 207.7 33.79 203.2 32.75 198.4C31.71 193.5 31.8 188.5 32.99 183.7C54.98 97.02 146.5 32 256 32C365.5 32 457 97.02 479 183.7C480.2 188.5 480.3 193.5 479.2 198.4C478.2 203.2 476.1 207.7 473 211.6C469.1 215.5 466.1 218.6 461.6 220.8C457.2 222.9 452.3 224 447.3 224H64.67C59.73 224 54.84 222.9 50.39 220.8zM372.7 116.7C369.7 119.7 368 123.8 368 128C368 131.2 368.9 134.3 370.7 136.9C372.5 139.5 374.1 141.6 377.9 142.8C380.8 143.1 384 144.3 387.1 143.7C390.2 143.1 393.1 141.6 395.3 139.3C397.6 137.1 399.1 134.2 399.7 131.1C400.3 128 399.1 124.8 398.8 121.9C397.6 118.1 395.5 116.5 392.9 114.7C390.3 112.9 387.2 111.1 384 111.1C379.8 111.1 375.7 113.7 372.7 116.7V116.7zM244.7 84.69C241.7 87.69 240 91.76 240 96C240 99.16 240.9 102.3 242.7 104.9C244.5 107.5 246.1 109.6 249.9 110.8C252.8 111.1 256 112.3 259.1 111.7C262.2 111.1 265.1 109.6 267.3 107.3C269.6 105.1 271.1 102.2 271.7 99.12C272.3 96.02 271.1 92.8 270.8 89.88C269.6 86.95 267.5 84.45 264.9 82.7C262.3 80.94 259.2 79.1 256 79.1C251.8 79.1 247.7 81.69 244.7 84.69V84.69zM116.7 116.7C113.7 119.7 112 123.8 112 128C112 131.2 112.9 134.3 114.7 136.9C116.5 139.5 118.1 141.6 121.9 142.8C124.8 143.1 128 144.3 131.1 143.7C134.2 143.1 137.1 141.6 139.3 139.3C141.6 137.1 143.1 134.2 143.7 131.1C144.3 128 143.1 124.8 142.8 121.9C141.6 118.1 139.5 116.5 136.9 114.7C134.3 112.9 131.2 111.1 128 111.1C123.8 111.1 119.7 113.7 116.7 116.7L116.7 116.7z"})})},frequent:{outline:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[AA("path",{d:"M13 4h-2l-.001 7H9v2h2v2h2v-2h4v-2h-4z"}),AA("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"})]}),solid:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:AA("path",{d:"M256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512zM232 256C232 264 236 271.5 242.7 275.1L338.7 339.1C349.7 347.3 364.6 344.3 371.1 333.3C379.3 322.3 376.3 307.4 365.3 300L280 243.2V120C280 106.7 269.3 96 255.1 96C242.7 96 231.1 106.7 231.1 120L232 256z"})})},nature:{outline:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[AA("path",{d:"M15.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 15.5 8M8.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 8.5 8"}),AA("path",{d:"M18.933 0h-.027c-.97 0-2.138.787-3.018 1.497-1.274-.374-2.612-.51-3.887-.51-1.285 0-2.616.133-3.874.517C7.245.79 6.069 0 5.093 0h-.027C3.352 0 .07 2.67.002 7.026c-.039 2.479.276 4.238 1.04 5.013.254.258.882.677 1.295.882.191 3.177.922 5.238 2.536 6.38.897.637 2.187.949 3.2 1.102C8.04 20.6 8 20.795 8 21c0 1.773 2.35 3 4 3 1.648 0 4-1.227 4-3 0-.201-.038-.393-.072-.586 2.573-.385 5.435-1.877 5.925-7.587.396-.22.887-.568 1.104-.788.763-.774 1.079-2.534 1.04-5.013C23.929 2.67 20.646 0 18.933 0M3.223 9.135c-.237.281-.837 1.155-.884 1.238-.15-.41-.368-1.349-.337-3.291.051-3.281 2.478-4.972 3.091-5.031.256.015.731.27 1.265.646-1.11 1.171-2.275 2.915-2.352 5.125-.133.546-.398.858-.783 1.313M12 22c-.901 0-1.954-.693-2-1 0-.654.475-1.236 1-1.602V20a1 1 0 1 0 2 0v-.602c.524.365 1 .947 1 1.602-.046.307-1.099 1-2 1m3-3.48v.02a4.752 4.752 0 0 0-1.262-1.02c1.092-.516 2.239-1.334 2.239-2.217 0-1.842-1.781-2.195-3.977-2.195-2.196 0-3.978.354-3.978 2.195 0 .883 1.148 1.701 2.238 2.217A4.8 4.8 0 0 0 9 18.539v-.025c-1-.076-2.182-.281-2.973-.842-1.301-.92-1.838-3.045-1.853-6.478l.023-.041c.496-.826 1.49-1.45 1.804-3.102 0-2.047 1.357-3.631 2.362-4.522C9.37 3.178 10.555 3 11.948 3c1.447 0 2.685.192 3.733.57 1 .9 2.316 2.465 2.316 4.48.313 1.651 1.307 2.275 1.803 3.102.035.058.068.117.102.178-.059 5.967-1.949 7.01-4.902 7.19m6.628-8.202c-.037-.065-.074-.13-.113-.195a7.587 7.587 0 0 0-.739-.987c-.385-.455-.648-.768-.782-1.313-.076-2.209-1.241-3.954-2.353-5.124.531-.376 1.004-.63 1.261-.647.636.071 3.044 1.764 3.096 5.031.027 1.81-.347 3.218-.37 3.235"})]}),solid:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:AA("path",{d:"M332.7 19.85C334.6 8.395 344.5 0 356.1 0C363.6 0 370.6 3.52 375.1 9.502L392 32H444.1C456.8 32 469.1 37.06 478.1 46.06L496 64H552C565.3 64 576 74.75 576 88V112C576 156.2 540.2 192 496 192H426.7L421.6 222.5L309.6 158.5L332.7 19.85zM448 64C439.2 64 432 71.16 432 80C432 88.84 439.2 96 448 96C456.8 96 464 88.84 464 80C464 71.16 456.8 64 448 64zM416 256.1V480C416 497.7 401.7 512 384 512H352C334.3 512 320 497.7 320 480V364.8C295.1 377.1 268.8 384 240 384C211.2 384 184 377.1 160 364.8V480C160 497.7 145.7 512 128 512H96C78.33 512 64 497.7 64 480V249.8C35.23 238.9 12.64 214.5 4.836 183.3L.9558 167.8C-3.331 150.6 7.094 133.2 24.24 128.1C41.38 124.7 58.76 135.1 63.05 152.2L66.93 167.8C70.49 182 83.29 191.1 97.97 191.1H303.8L416 256.1z"})})},objects:{outline:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[AA("path",{d:"M12 0a9 9 0 0 0-5 16.482V21s2.035 3 5 3 5-3 5-3v-4.518A9 9 0 0 0 12 0zm0 2c3.86 0 7 3.141 7 7s-3.14 7-7 7-7-3.141-7-7 3.14-7 7-7zM9 17.477c.94.332 1.946.523 3 .523s2.06-.19 3-.523v.834c-.91.436-1.925.689-3 .689a6.924 6.924 0 0 1-3-.69v-.833zm.236 3.07A8.854 8.854 0 0 0 12 21c.965 0 1.888-.167 2.758-.451C14.155 21.173 13.153 22 12 22c-1.102 0-2.117-.789-2.764-1.453z"}),AA("path",{d:"M14.745 12.449h-.004c-.852-.024-1.188-.858-1.577-1.824-.421-1.061-.703-1.561-1.182-1.566h-.009c-.481 0-.783.497-1.235 1.537-.436.982-.801 1.811-1.636 1.791l-.276-.043c-.565-.171-.853-.691-1.284-1.794-.125-.313-.202-.632-.27-.913-.051-.213-.127-.53-.195-.634C7.067 9.004 7.039 9 6.99 9A1 1 0 0 1 7 7h.01c1.662.017 2.015 1.373 2.198 2.134.486-.981 1.304-2.058 2.797-2.075 1.531.018 2.28 1.153 2.731 2.141l.002-.008C14.944 8.424 15.327 7 16.979 7h.032A1 1 0 1 1 17 9h-.011c-.149.076-.256.474-.319.709a6.484 6.484 0 0 1-.311.951c-.429.973-.79 1.789-1.614 1.789"})]}),solid:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",children:AA("path",{d:"M112.1 454.3c0 6.297 1.816 12.44 5.284 17.69l17.14 25.69c5.25 7.875 17.17 14.28 26.64 14.28h61.67c9.438 0 21.36-6.401 26.61-14.28l17.08-25.68c2.938-4.438 5.348-12.37 5.348-17.7L272 415.1h-160L112.1 454.3zM191.4 .0132C89.44 .3257 16 82.97 16 175.1c0 44.38 16.44 84.84 43.56 115.8c16.53 18.84 42.34 58.23 52.22 91.45c.0313 .25 .0938 .5166 .125 .7823h160.2c.0313-.2656 .0938-.5166 .125-.7823c9.875-33.22 35.69-72.61 52.22-91.45C351.6 260.8 368 220.4 368 175.1C368 78.61 288.9-.2837 191.4 .0132zM192 96.01c-44.13 0-80 35.89-80 79.1C112 184.8 104.8 192 96 192S80 184.8 80 176c0-61.76 50.25-111.1 112-111.1c8.844 0 16 7.159 16 16S200.8 96.01 192 96.01z"})})},people:{outline:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[AA("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"}),AA("path",{d:"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0"})]}),solid:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:AA("path",{d:"M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM256 432C332.1 432 396.2 382 415.2 314.1C419.1 300.4 407.8 288 393.6 288H118.4C104.2 288 92.92 300.4 96.76 314.1C115.8 382 179.9 432 256 432V432zM176.4 160C158.7 160 144.4 174.3 144.4 192C144.4 209.7 158.7 224 176.4 224C194 224 208.4 209.7 208.4 192C208.4 174.3 194 160 176.4 160zM336.4 224C354 224 368.4 209.7 368.4 192C368.4 174.3 354 160 336.4 160C318.7 160 304.4 174.3 304.4 192C304.4 209.7 318.7 224 336.4 224z"})})},places:{outline:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[AA("path",{d:"M6.5 12C5.122 12 4 13.121 4 14.5S5.122 17 6.5 17 9 15.879 9 14.5 7.878 12 6.5 12m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5M17.5 12c-1.378 0-2.5 1.121-2.5 2.5s1.122 2.5 2.5 2.5 2.5-1.121 2.5-2.5-1.122-2.5-2.5-2.5m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5"}),AA("path",{d:"M22.482 9.494l-1.039-.346L21.4 9h.6c.552 0 1-.439 1-.992 0-.006-.003-.008-.003-.008H23c0-1-.889-2-1.984-2h-.642l-.731-1.717C19.262 3.012 18.091 2 16.764 2H7.236C5.909 2 4.738 3.012 4.357 4.283L3.626 6h-.642C1.889 6 1 7 1 8h.003S1 8.002 1 8.008C1 8.561 1.448 9 2 9h.6l-.043.148-1.039.346a2.001 2.001 0 0 0-1.359 2.097l.751 7.508a1 1 0 0 0 .994.901H3v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h6v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h1.096a.999.999 0 0 0 .994-.901l.751-7.508a2.001 2.001 0 0 0-1.359-2.097M6.273 4.857C6.402 4.43 6.788 4 7.236 4h9.527c.448 0 .834.43.963.857L19.313 9H4.688l1.585-4.143zM7 21H5v-1h2v1zm12 0h-2v-1h2v1zm2.189-3H2.811l-.662-6.607L3 11h18l.852.393L21.189 18z"})]}),solid:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:AA("path",{d:"M39.61 196.8L74.8 96.29C88.27 57.78 124.6 32 165.4 32H346.6C387.4 32 423.7 57.78 437.2 96.29L472.4 196.8C495.6 206.4 512 229.3 512 256V448C512 465.7 497.7 480 480 480H448C430.3 480 416 465.7 416 448V400H96V448C96 465.7 81.67 480 64 480H32C14.33 480 0 465.7 0 448V256C0 229.3 16.36 206.4 39.61 196.8V196.8zM109.1 192H402.9L376.8 117.4C372.3 104.6 360.2 96 346.6 96H165.4C151.8 96 139.7 104.6 135.2 117.4L109.1 192zM96 256C78.33 256 64 270.3 64 288C64 305.7 78.33 320 96 320C113.7 320 128 305.7 128 288C128 270.3 113.7 256 96 256zM416 320C433.7 320 448 305.7 448 288C448 270.3 433.7 256 416 256C398.3 256 384 270.3 384 288C384 305.7 398.3 320 416 320z"})})},symbols:{outline:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:AA("path",{d:"M0 0h11v2H0zM4 11h3V6h4V4H0v2h4zM15.5 17c1.381 0 2.5-1.116 2.5-2.493s-1.119-2.493-2.5-2.493S13 13.13 13 14.507 14.119 17 15.5 17m0-2.986c.276 0 .5.222.5.493 0 .272-.224.493-.5.493s-.5-.221-.5-.493.224-.493.5-.493M21.5 19.014c-1.381 0-2.5 1.116-2.5 2.493S20.119 24 21.5 24s2.5-1.116 2.5-2.493-1.119-2.493-2.5-2.493m0 2.986a.497.497 0 0 1-.5-.493c0-.271.224-.493.5-.493s.5.222.5.493a.497.497 0 0 1-.5.493M22 13l-9 9 1.513 1.5 8.99-9.009zM17 11c2.209 0 4-1.119 4-2.5V2s.985-.161 1.498.949C23.01 4.055 23 6 23 6s1-1.119 1-3.135C24-.02 21 0 21 0h-2v6.347A5.853 5.853 0 0 0 17 6c-2.209 0-4 1.119-4 2.5s1.791 2.5 4 2.5M10.297 20.482l-1.475-1.585a47.54 47.54 0 0 1-1.442 1.129c-.307-.288-.989-1.016-2.045-2.183.902-.836 1.479-1.466 1.729-1.892s.376-.871.376-1.336c0-.592-.273-1.178-.818-1.759-.546-.581-1.329-.871-2.349-.871-1.008 0-1.79.293-2.344.879-.556.587-.832 1.181-.832 1.784 0 .813.419 1.748 1.256 2.805-.847.614-1.444 1.208-1.794 1.784a3.465 3.465 0 0 0-.523 1.833c0 .857.308 1.56.924 2.107.616.549 1.423.823 2.42.823 1.173 0 2.444-.379 3.813-1.137L8.235 24h2.819l-2.09-2.383 1.333-1.135zm-6.736-6.389a1.02 1.02 0 0 1 .73-.286c.31 0 .559.085.747.254a.849.849 0 0 1 .283.659c0 .518-.419 1.112-1.257 1.784-.536-.651-.805-1.231-.805-1.742a.901.901 0 0 1 .302-.669M3.74 22c-.427 0-.778-.116-1.057-.349-.279-.232-.418-.487-.418-.766 0-.594.509-1.288 1.527-2.083.968 1.134 1.717 1.946 2.248 2.438-.921.507-1.686.76-2.3.76"})}),solid:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:AA("path",{d:"M500.3 7.251C507.7 13.33 512 22.41 512 31.1V175.1C512 202.5 483.3 223.1 447.1 223.1C412.7 223.1 383.1 202.5 383.1 175.1C383.1 149.5 412.7 127.1 447.1 127.1V71.03L351.1 90.23V207.1C351.1 234.5 323.3 255.1 287.1 255.1C252.7 255.1 223.1 234.5 223.1 207.1C223.1 181.5 252.7 159.1 287.1 159.1V63.1C287.1 48.74 298.8 35.61 313.7 32.62L473.7 .6198C483.1-1.261 492.9 1.173 500.3 7.251H500.3zM74.66 303.1L86.5 286.2C92.43 277.3 102.4 271.1 113.1 271.1H174.9C185.6 271.1 195.6 277.3 201.5 286.2L213.3 303.1H239.1C266.5 303.1 287.1 325.5 287.1 351.1V463.1C287.1 490.5 266.5 511.1 239.1 511.1H47.1C21.49 511.1-.0019 490.5-.0019 463.1V351.1C-.0019 325.5 21.49 303.1 47.1 303.1H74.66zM143.1 359.1C117.5 359.1 95.1 381.5 95.1 407.1C95.1 434.5 117.5 455.1 143.1 455.1C170.5 455.1 191.1 434.5 191.1 407.1C191.1 381.5 170.5 359.1 143.1 359.1zM440.3 367.1H496C502.7 367.1 508.6 372.1 510.1 378.4C513.3 384.6 511.6 391.7 506.5 396L378.5 508C372.9 512.1 364.6 513.3 358.6 508.9C352.6 504.6 350.3 496.6 353.3 489.7L391.7 399.1H336C329.3 399.1 323.4 395.9 321 389.6C318.7 383.4 320.4 376.3 325.5 371.1L453.5 259.1C459.1 255 467.4 254.7 473.4 259.1C479.4 263.4 481.6 271.4 478.7 278.3L440.3 367.1zM116.7 219.1L19.85 119.2C-8.112 90.26-6.614 42.31 24.85 15.34C51.82-8.137 93.26-3.642 118.2 21.83L128.2 32.32L137.7 21.83C162.7-3.642 203.6-8.137 231.6 15.34C262.6 42.31 264.1 90.26 236.1 119.2L139.7 219.1C133.2 225.6 122.7 225.6 116.7 219.1H116.7z"})})}},search:{loupe:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:AA("path",{d:"M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"})}),delete:AA("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:AA("path",{d:"M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z"})})}};function nO(e){let{id:t,skin:n,emoji:r}=e;if(e.shortcodes){const r=e.shortcodes.match(XA.SHORTCODES_REGEX);r&&(t=r[1],r[2]&&(n=r[2]))}if(r||(r=XA.get(t||e.native)),!r)return e.fallback;const i=r.skins[n-1]||r.skins[0],o=i.src||("native"==e.set||e.spritesheet?void 0:"function"==typeof e.getImageURL?e.getImageURL(e.set,i.unified):`https://cdn.jsdelivr.net/npm/emoji-datasource-${e.set}@14.0.0/img/${e.set}/64/${i.unified}.png`),s="function"==typeof e.getSpritesheetURL?e.getSpritesheetURL(e.set):`https://cdn.jsdelivr.net/npm/emoji-datasource-${e.set}@14.0.0/img/${e.set}/sheets-256/64.png`;return AA("span",{class:"emoji-mart-emoji","data-emoji-set":e.set,children:o?AA("img",{style:{height:e.size||"1em",width:"auto",display:"inline-block",position:"relative",top:".1em"},alt:i.native||i.shortcodes,src:o}):"native"==e.set?AA("span",{style:{fontSize:e.size,fontFamily:'"EmojiMart", "Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "Android Emoji"'},children:i.native}):AA("span",{style:{display:"block",width:e.size,height:e.size,backgroundImage:`url(${s})`,backgroundSize:`${100*$A.sheet.cols}% ${100*$A.sheet.rows}%`,backgroundPosition:`${100/($A.sheet.cols-1)*i.x}% ${100/($A.sheet.rows-1)*i.y}%`}})})}const rO="undefined"!=typeof window?window.HTMLElement:Object;class iO extends rO{static get observedAttributes(){return Object.keys(this.Props)}update(e={}){for(let t in e)this.attributeChangedCallback(t,null,e[t])}attributeChangedCallback(e,t,n){if(!this.component)return;const r=JA(e,{[e]:n},this.constructor.Props,this);this.component.componentWillReceiveProps?this.component.componentWillReceiveProps({[e]:r}):(this.component.props[e]=r,this.component.forceUpdate())}constructor(e={}){if(super(),this.props=e,e.parent||e.ref){let t=null;const n=e.parent||(t=e.ref&&e.ref.current);t&&(t.innerHTML=""),n&&n.appendChild(this)}}}class oO extends iO{setShadow(){this.attachShadow({mode:"open"})}injectStyles(e){if(!e)return;const t=document.createElement("style");t.textContent=e,this.shadowRoot.insertBefore(t,this.shadowRoot.firstChild)}constructor(e,{styles:t}={}){super(e),this.setShadow(),this.injectStyles(t)}}var sO={fallback:"",id:"",native:"",shortcodes:"",size:{value:"",transform:e=>/\D/.test(e)?e:`${e}px`},set:UA.set,skin:UA.skin};class aO extends iO{async connectedCallback(){const e=QA(this.props,sO,this);e.element=this,e.ref=e=>{this.component=e},await YA(),SA(AA(nO,{...e}),this)}constructor(e){super(e)}}YN(aO,"Props",sO),"undefined"==typeof customElements||customElements.get("em-emoji")||customElements.define("em-emoji",aO);var lO,cO=[],uO=JN.__b,dO=JN.__r,pO=JN.diffed,hO=JN.__c,fO=JN.unmount;function mO(){var e;for(cO.sort((function(e,t){return e.__v.__b-t.__v.__b}));e=cO.pop();)if(e.__P)try{e.__H.__h.forEach(bO),e.__H.__h.forEach(yO),e.__H.__h=[]}catch(t){e.__H.__h=[],JN.__e(t,e.__v)}}JN.__b=function(e){uO&&uO(e)},JN.__r=function(e){dO&&dO(e);var t=e.__c.__H;t&&(t.__h.forEach(bO),t.__h.forEach(yO),t.__h=[])},JN.diffed=function(e){pO&&pO(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==cO.push(t)&&lO===JN.requestAnimationFrame||((lO=JN.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),gO&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);gO&&(t=requestAnimationFrame(n))})(mO))},JN.__c=function(e,t){t.some((function(e){try{e.__h.forEach(bO),e.__h=e.__h.filter((function(e){return!e.__||yO(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],JN.__e(n,e.__v)}})),hO&&hO(e,t)},JN.unmount=function(e){fO&&fO(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{bO(e)}catch(e){t=e}})),t&&JN.__e(t,n.__v))};var gO="function"==typeof requestAnimationFrame;function bO(e){var t=e.__c;"function"==typeof t&&(e.__c=void 0,t())}function yO(e){e.__c=e.__()}function vO(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function wO(e){this.props=e}(wO.prototype=new uA).isPureReactComponent=!0,wO.prototype.shouldComponentUpdate=function(e,t){return vO(this.props,e)||vO(this.state,t)};var _O=JN.__b;JN.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),_O&&_O(e)};var xO=JN.__e;JN.__e=function(e,t,n){if(e.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);xO(e,t,n)};var EO=JN.unmount;function kO(){this.__u=0,this.t=null,this.__b=null}function MO(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function DO(){this.u=null,this.o=null}JN.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),EO&&EO(e)},(kO.prototype=new uA).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var i=MO(r.__v),o=!1,s=function(){o||(o=!0,n.__R=null,i?i(a):a())};n.__R=s;var a=function(){if(!--r.__u){if(r.state.__e){var e=r.state.__e;r.__v.__k[0]=function e(t,n,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)})),t.__c&&t.__c.__P===n&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate()}},l=!0===t.__h;r.__u++||l||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(s,s)},kO.prototype.componentWillUnmount=function(){this.t=[]},kO.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=function(e,t){for(var n in t)e[n]=t[n];return e}({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)}))),t}(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__e&&aA(cA,null,e.fallback);return i&&(i.__h=null),[aA(cA,null,t.__e?null:e.children),i]};var CO=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};(DO.prototype=new uA).__e=function(e){var t=this,n=MO(t.__v),r=t.o.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),CO(t,e,r)):i()};n?n(o):o()}},DO.prototype.render=function(e){this.u=null,this.o=new Map;var t=bA(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},DO.prototype.componentDidUpdate=DO.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){CO(e,n,t)}))};var SO="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,NO=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,AO="undefined"!=typeof document,OO=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};uA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(uA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var TO=JN.event;function IO(){}function LO(){return this.cancelBubble}function FO(){return this.defaultPrevented}JN.event=function(e){return TO&&(e=TO(e)),e.persist=IO,e.isPropagationStopped=LO,e.isDefaultPrevented=FO,e.nativeEvent=e};var zO={configurable:!0,get:function(){return this.class}},jO=JN.vnode;JN.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){var i=-1===t.indexOf("-");for(var o in r={},n){var s=n[o];AO&&"children"===o&&"noscript"===t||"value"===o&&"defaultValue"in n&&null==s||("defaultValue"===o&&"value"in n&&null==n.value?o="value":"download"===o&&!0===s?s="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!OO(n.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(o)?o=o.toLowerCase():i&&NO.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===s&&(s=void 0),r[o]=s)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=bA(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=bA(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r,n.class!=n.className&&(zO.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",zO))}e.$$typeof=SO,jO&&jO(e)};var RO=JN.__r;JN.__r=function(e){RO&&RO(e),e.__c};const BO={light:"outline",dark:"solid"};class PO extends wO{renderIcon(e){const{icon:t}=e;if(t){if(t.svg)return AA("span",{class:"flex",dangerouslySetInnerHTML:{__html:t.svg}});if(t.src)return AA("img",{src:t.src})}const n=tO.categories[e.id]||tO.categories.custom;return n["auto"==this.props.icons?BO[this.props.theme]:this.props.icons]||n}render(){let e=null;return AA("nav",{id:"nav",class:"padding","data-position":this.props.position,children:AA("div",{class:"flex relative",children:[this.categories.map(((t,n)=>{const r=t.name||HA.categories[t.id],i=!this.props.unfocused&&t.id==this.state.categoryId;return i&&(e=n),AA("button",{"aria-label":r,"aria-selected":i||void 0,title:r,type:"button",class:"flex flex-grow flex-center",onMouseDown:e=>e.preventDefault(),onClick:()=>{this.props.onClick({category:t,i:n})},children:this.renderIcon(t)})})),AA("div",{class:"bar",style:{width:`${100/this.categories.length}%`,opacity:null==e?0:1,transform:`translateX(${100*e}%)`}})]})})}constructor(){super(),this.categories=$A.categories.filter((e=>!e.target)),this.state={categoryId:this.categories[0].id}}}class UO extends wO{shouldComponentUpdate(e){for(let t in e)if("children"!=t&&e[t]!=this.props[t])return!0;return!1}render(){return this.props.children}}const HO=10;class $O extends uA{getInitialState(e=this.props){return{skin:OA.get("skin")||e.skin,theme:this.initTheme(e.theme)}}componentWillMount(){this.observers=[],this.dir=HA.rtl?"rtl":"ltr",this.refs={menu:{current:null},navigation:{current:null},scroll:{current:null},search:{current:null},searchInput:{current:null},skinToneButton:{current:null},skinToneRadio:{current:null}},this.initGrid(),0==this.props.stickySearch&&"sticky"==this.props.searchPosition&&(console.warn("[EmojiMart] Deprecation warning: `stickySearch` has been renamed `searchPosition`."),this.props.searchPosition="static")}componentDidMount(){if(this.register(),this.shadowRoot=this.base.parentNode,this.props.autoFocus){const{searchInput:e}=this.refs;e.current&&e.current.focus()}}componentWillReceiveProps(e){this.nextState||(this.nextState={});for(const t in e)this.nextState[t]=e[t];clearTimeout(this.nextStateTimer),this.nextStateTimer=setTimeout((()=>{let e=!1;for(const t in this.nextState)this.props[t]=this.nextState[t],"custom"!==t&&"categories"!==t||(e=!0);delete this.nextState;const t=this.getInitialState();if(e)return this.reset(t);this.setState(t)}))}componentWillUnmount(){this.unregister()}async reset(e={}){await YA(this.props),this.initGrid(),this.unobserve(),this.setState(e,(()=>{this.observeCategories(),this.observeRows()}))}register(){document.addEventListener("click",this.handleClickOutside),this.observe()}unregister(){document.removeEventListener("click",this.handleClickOutside),this.unobserve()}observe(){this.observeCategories(),this.observeRows()}unobserve(){for(const e of this.observers)e.disconnect()}initGrid(){const{categories:e}=$A;this.refs.categories=new Map;const t=$A.categories.map((e=>e.id)).join(",");this.navKey&&this.navKey!=t&&this.refs.scroll.current&&(this.refs.scroll.current.scrollTop=0),this.navKey=t,this.grid=[],this.grid.setsize=0;const n=(e,t)=>{const n=[];n.__categoryId=t.id,n.__index=e.length,this.grid.push(n);const r=this.grid.length-1,i=r%HO?{}:{current:null};return i.index=r,i.posinset=this.grid.setsize+1,e.push(i),n};for(let t of e){const e=[];let r=n(e,t);for(let i of t.emojis)r.length==this.props.perLine&&(r=n(e,t)),this.grid.setsize+=1,r.push(i);this.refs.categories.set(t.id,{root:{current:null},rows:e})}}initTheme(e){if("auto"!=e)return e;if(!this.darkMedia){if(this.darkMedia=matchMedia("(prefers-color-scheme: dark)"),this.darkMedia.media.match(/^not/))return"light";this.darkMedia.addListener((()=>{"auto"==this.props.theme&&this.setState({theme:this.darkMedia.matches?"dark":"light"})}))}return this.darkMedia.matches?"dark":"light"}getEmojiByPos([e,t]){const n=this.state.searchResults||this.grid,r=n[e]&&n[e][t];if(r)return XA.get(r)}observeCategories(){const e=this.refs.navigation.current;if(!e)return;const t=new Map,n=t=>{t!=e.state.categoryId&&e.setState({categoryId:t})},r={root:this.refs.scroll.current,threshold:[0,1]},i=new IntersectionObserver((e=>{for(const n of e){const e=n.target.dataset.id;t.set(e,n.intersectionRatio)}const r=[...t],i=r[r.length-1];if(1==i[1])return n(i[0]);for(const[e,t]of r)if(t){n(e);break}}),r);for(const{root:e}of this.refs.categories.values())i.observe(e.current);this.observers.push(i)}observeRows(){const e={...this.state.visibleRows},t=new IntersectionObserver((t=>{for(const n of t){const t=parseInt(n.target.dataset.index);n.isIntersecting?e[t]=!0:delete e[t]}this.setState({visibleRows:e})}),{root:this.refs.scroll.current,rootMargin:`${this.props.emojiButtonSize*(HO+5)}px 0px ${this.props.emojiButtonSize*HO}px`});for(const{rows:e}of this.refs.categories.values())for(const n of e)n.current&&t.observe(n.current);this.observers.push(t)}preventDefault(e){e.preventDefault()}unfocusSearch(){const e=this.refs.searchInput.current;e&&e.blur()}navigate({e:e,input:t,left:n,right:r,up:i,down:o}){const s=this.state.searchResults||this.grid;if(!s.length)return;let[a,l]=this.state.pos;const c=(()=>{if(0==a&&0==l&&!e.repeat&&(n||i))return null;if(-1==a)return e.repeat||!r&&!o||t.selectionStart!=t.value.length?null:[0,0];if(n||r){let e=s[a];const t=n?-1:1;if(l+=t,!e[l]){if(a+=t,e=s[a],!e)return a=n?0:s.length-1,l=n?0:s[a].length-1,[a,l];l=n?e.length-1:0}return[a,l]}if(i||o){a+=i?-1:1;const e=s[a];return e?(e[l]||(l=e.length-1),[a,l]):(a=i?0:s.length-1,l=i?0:s[a].length-1,[a,l])}})();c?(e.preventDefault(),this.setState({pos:c,keyboard:!0},(()=>{this.scrollTo({row:c[0]})}))):this.state.pos[0]>-1&&this.setState({pos:[-1,-1]})}scrollTo({categoryId:e,row:t}){const n=this.state.searchResults||this.grid;if(!n.length)return;const r=this.refs.scroll.current,i=r.getBoundingClientRect();let o=0;if(t>=0&&(e=n[t].__categoryId),e){o=(this.refs[e]||this.refs.categories.get(e).root).current.getBoundingClientRect().top-(i.top-r.scrollTop)+1}if(t>=0)if(t){const e=o+n[t].__index*this.props.emojiButtonSize,s=e+this.props.emojiButtonSize+.88*this.props.emojiButtonSize;if(e<r.scrollTop)o=e;else{if(!(s>r.scrollTop+i.height))return;o=s-i.height}}else o=0;this.ignoreMouse(),r.scrollTop=o}ignoreMouse(){this.mouseIsIgnored=!0,clearTimeout(this.ignoreMouseTimer),this.ignoreMouseTimer=setTimeout((()=>{delete this.mouseIsIgnored}),100)}handleEmojiOver(e){this.mouseIsIgnored||this.state.showSkins||this.setState({pos:e||[-1,-1],keyboard:!1})}handleEmojiClick({emoji:e,pos:t}){if(this.props.onEmojiSelect&&(!e&&t&&(e=this.getEmojiByPos(t)),e)){const t=function(e,{skinIndex:t}={}){const n=e.skins[t]||(t=0,e.skins[t]),r={id:e.id,name:e.name,native:n.native,unified:n.unified,keywords:e.keywords,shortcodes:n.shortcodes||e.shortcodes};return e.skins.length>1&&(r.skin=t+1),n.src&&(r.src=n.src),e.aliases&&e.aliases.length&&(r.aliases=e.aliases),e.emoticons&&e.emoticons.length&&(r.emoticons=e.emoticons),r}(e,{skinIndex:this.state.skin-1});this.props.maxFrequentRows&&PA.add(t,this.props),this.props.onEmojiSelect(t)}}closeSkins(){this.state.showSkins&&(this.setState({showSkins:null,tempSkin:null}),this.base.removeEventListener("click",this.handleBaseClick),this.base.removeEventListener("keydown",this.handleBaseKeydown))}handleSkinMouseOver(e){this.setState({tempSkin:e})}handleSkinClick(e){this.ignoreMouse(),this.closeSkins(),this.setState({skin:e,tempSkin:null}),OA.set("skin",e)}renderNav(){return AA(PO,{ref:this.refs.navigation,icons:this.props.icons,theme:this.state.theme,unfocused:!!this.state.searchResults,position:this.props.navPosition,onClick:this.handleCategoryClick},this.navKey)}renderPreview(){const e=this.getEmojiByPos(this.state.pos),t=this.state.searchResults&&!this.state.searchResults.length;return AA("div",{id:"preview",class:"flex flex-middle",dir:this.dir,"data-position":this.props.previewPosition,children:[AA("div",{class:"flex flex-middle flex-grow",children:[AA("div",{class:"flex flex-auto flex-middle flex-center",style:{height:this.props.emojiButtonSize,fontSize:this.props.emojiButtonSize},children:AA(nO,{emoji:e,id:t?this.props.noResultsEmoji||"cry":this.props.previewEmoji||("top"==this.props.previewPosition?"point_down":"point_up"),set:this.props.set,size:this.props.emojiButtonSize,skin:this.state.tempSkin||this.state.skin,spritesheet:!0,getSpritesheetURL:this.props.getSpritesheetURL})}),AA("div",{class:`margin-${this.dir[0]}`,children:AA("div",e?{class:`padding-${this.dir[2]} align-${this.dir[0]}`,children:[AA("div",{class:"ellipsis",style:{fontSize:"1.1em"},children:e.name}),AA("div",{class:"ellipsis color-c",style:{fontSize:".9em"},children:e.skins[0].shortcodes})]}:t?{class:`padding-${this.dir[2]} align-${this.dir[0]}`,children:[AA("div",{class:"ellipsis",style:{fontSize:"1.1em"},children:HA.search_no_results_1}),AA("div",{class:"ellipsis color-c",style:{fontSize:".9em"},children:HA.search_no_results_2})]}:{class:"color-c",style:{fontSize:21},children:HA.pick})})]}),!e&&"preview"==this.props.skinTonePosition&&this.renderSkinToneButton()]})}renderEmojiButton(e,{pos:t,posinset:n,grid:r}){const i=this.props.emojiButtonSize,o=this.state.tempSkin||this.state.skin,s=(e.skins[o-1]||e.skins[0]).native,a=function(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every(((e,n)=>e==t[n]))}(this.state.pos,t),l=t.concat(e.id).join("");return AA(UO,{selected:a,skin:o,size:i,children:AA("button",{"aria-label":s,"aria-selected":a||void 0,"aria-posinset":n,"aria-setsize":r.setsize,"data-keyboard":this.state.keyboard,title:"none"==this.props.previewPosition?e.name:void 0,type:"button",class:"flex flex-center flex-middle",tabindex:"-1",onClick:()=>this.handleEmojiClick({emoji:e}),onMouseEnter:()=>this.handleEmojiOver(t),onMouseLeave:()=>this.handleEmojiOver(),style:{width:this.props.emojiButtonSize,height:this.props.emojiButtonSize,fontSize:this.props.emojiSize,lineHeight:0},children:[AA("div",{"aria-hidden":"true",class:"background",style:{borderRadius:this.props.emojiButtonRadius,backgroundColor:this.props.emojiButtonColors?this.props.emojiButtonColors[(n-1)%this.props.emojiButtonColors.length]:void 0}}),AA(nO,{emoji:e,set:this.props.set,size:this.props.emojiSize,skin:o,spritesheet:!0,getSpritesheetURL:this.props.getSpritesheetURL})]})},l)}renderSearch(){const e="none"==this.props.previewPosition||"search"==this.props.skinTonePosition;return AA("div",{children:[AA("div",{class:"spacer"}),AA("div",{class:"flex flex-middle",children:[e&&"rtl"==this.dir&&this.renderSkinToneButton(),AA("div",{class:"search relative flex-grow",children:[AA("input",{type:"search",ref:this.refs.searchInput,placeholder:HA.search,onClick:this.handleSearchClick,onInput:this.handleSearchInput,onKeyDown:this.handleSearchKeyDown,autoComplete:"off"}),AA("span",{class:"icon loupe flex",children:tO.search.loupe}),this.state.searchResults&&AA("button",{title:"Clear","aria-label":"Clear",type:"button",class:"icon delete flex",onClick:this.clearSearch,onMouseDown:this.preventDefault,children:tO.search.delete})]}),e&&"ltr"==this.dir&&this.renderSkinToneButton()]})]})}renderSearchResults(){const{searchResults:e}=this.state;return e?AA("div",{class:"category",ref:this.refs.search,children:[AA("div",{class:`sticky padding-small align-${this.dir[0]}`,children:HA.categories.search}),AA("div",{children:e.length?e.map(((t,n)=>AA("div",{class:"flex",children:t.map(((t,r)=>this.renderEmojiButton(t,{pos:[n,r],posinset:n*this.props.perLine+r+1,grid:e})))}))):AA("div",{class:`padding-small align-${this.dir[0]}`,children:this.props.onAddCustomEmoji&&AA("a",{onClick:this.props.onAddCustomEmoji,children:HA.add_custom})})})]}):null}renderCategories(){const{categories:e}=$A,t=!!this.state.searchResults;return AA("div",{style:{visibility:t?"hidden":void 0,display:t?"none":void 0},children:e.map((e=>{const{root:t,rows:n}=this.refs.categories.get(e.id);return AA("div",{"data-id":e.target?e.target.id:e.id,class:"category",ref:t,children:[AA("div",{class:`sticky padding-small align-${this.dir[0]}`,children:e.name||HA.categories[e.id]}),AA("div",{class:"relative",style:{height:n.length*this.props.emojiButtonSize},children:n.map(((t,n)=>{const r=t.index-t.index%HO,i=this.state.visibleRows[r],o="current"in t?t:void 0;if(!i&&!o)return null;const s=n*this.props.perLine,a=s+this.props.perLine,l=e.emojis.slice(s,a);return AA("div",{"data-index":t.index,ref:o,class:"flex row",style:{top:n*this.props.emojiButtonSize},children:i&&l.map(((e,n)=>{const r=XA.get(e);return this.renderEmojiButton(r,{pos:[t.index,n],posinset:t.posinset+n,grid:this.grid})}))},t.index)}))})]})}))})}renderSkinToneButton(){return"none"==this.props.skinTonePosition?null:AA("div",{class:"flex flex-auto flex-center flex-middle",style:{position:"relative",width:this.props.emojiButtonSize,height:this.props.emojiButtonSize},children:AA("button",{type:"button",ref:this.refs.skinToneButton,class:"skin-tone-button flex flex-auto flex-center flex-middle","aria-selected":this.state.showSkins?"":void 0,"aria-label":HA.skins.choose,title:HA.skins.choose,onClick:this.openSkins,style:{width:this.props.emojiSize,height:this.props.emojiSize},children:AA("span",{class:`skin-tone skin-tone-${this.state.skin}`})})})}renderLiveRegion(){const e=this.getEmojiByPos(this.state.pos);return AA("div",{"aria-live":"polite",class:"sr-only",children:e?e.name:""})}renderSkins(){const e=this.refs.skinToneButton.current.getBoundingClientRect(),t=this.base.getBoundingClientRect(),n={};return"ltr"==this.dir?n.right=t.right-e.right-3:n.left=e.left-t.left-3,"bottom"==this.props.previewPosition&&"preview"==this.props.skinTonePosition?n.bottom=t.bottom-e.top+6:(n.top=e.bottom-t.top+3,n.bottom="auto"),AA("div",{ref:this.refs.menu,role:"radiogroup",dir:this.dir,"aria-label":HA.skins.choose,class:"menu hidden","data-position":n.top?"top":"bottom",style:n,children:[...Array(6).keys()].map((e=>{const t=e+1,n=this.state.skin==t;return AA("div",{children:[AA("input",{type:"radio",name:"skin-tone",value:t,"aria-label":HA.skins[t],ref:n?this.refs.skinToneRadio:null,defaultChecked:n,onChange:()=>this.handleSkinMouseOver(t),onKeyDown:e=>{"Enter"!=e.code&&"Space"!=e.code&&"Tab"!=e.code||(e.preventDefault(),this.handleSkinClick(t))}}),AA("button",{"aria-hidden":"true",tabindex:"-1",onClick:()=>this.handleSkinClick(t),onMouseEnter:()=>this.handleSkinMouseOver(t),onMouseLeave:()=>this.handleSkinMouseOver(),class:"option flex flex-grow flex-middle",children:[AA("span",{class:`skin-tone skin-tone-${t}`}),AA("span",{class:"margin-small-lr",children:HA.skins[t]})]})]})}))})}render(){return AA("section",{id:"root",class:"flex flex-column",style:{width:this.props.perLine*this.props.emojiButtonSize+28},"data-emoji-set":this.props.set,"data-theme":this.state.theme,"data-menu":this.state.showSkins?"":void 0,children:["top"==this.props.previewPosition&&this.renderPreview(),"top"==this.props.navPosition&&this.renderNav(),"sticky"==this.props.searchPosition&&AA("div",{class:"padding-lr",children:this.renderSearch()}),AA("div",{ref:this.refs.scroll,class:"scroll flex-grow padding-lr",children:AA("div",{style:{width:this.props.perLine*this.props.emojiButtonSize},children:["static"==this.props.searchPosition&&this.renderSearch(),this.renderSearchResults(),this.renderCategories(),AA("div",{class:"spacer"})]})}),"bottom"==this.props.navPosition&&this.renderNav(),"bottom"==this.props.previewPosition&&this.renderPreview(),this.state.showSkins&&this.renderSkins(),this.renderLiveRegion()]})}constructor(e){super(),YN(this,"handleClickOutside",(e=>{const{element:t}=this.props;e.target!=t&&(this.state.showSkins&&this.closeSkins(),this.props.onClickOutside&&this.props.onClickOutside())})),YN(this,"handleBaseClick",(e=>{this.state.showSkins&&(e.target.closest(".menu")||(e.preventDefault(),e.stopImmediatePropagation(),this.closeSkins()))})),YN(this,"handleBaseKeydown",(e=>{this.state.showSkins&&"Escape"==e.key&&(e.preventDefault(),e.stopImmediatePropagation(),this.closeSkins())})),YN(this,"handleSearchClick",(()=>{this.getEmojiByPos(this.state.pos)&&this.setState({pos:[-1,-1]})})),YN(this,"handleSearchInput",(async()=>{const e=this.refs.searchInput.current;if(!e)return;const{value:t}=e,n=await XA.search(t),r=()=>{this.refs.scroll.current&&(this.refs.scroll.current.scrollTop=0)};if(!n)return this.setState({searchResults:n,pos:[-1,-1]},r);const i=e.selectionStart==e.value.length?[0,0]:[-1,-1],o=[];o.setsize=n.length;let s=null;for(let e of n)o.length&&s.length!=this.props.perLine||(s=[],s.__categoryId="search",s.__index=o.length,o.push(s)),s.push(e);this.ignoreMouse(),this.setState({searchResults:o,pos:i},r)})),YN(this,"handleSearchKeyDown",(e=>{const t=e.currentTarget;switch(e.stopImmediatePropagation(),e.key){case"ArrowLeft":this.navigate({e:e,input:t,left:!0});break;case"ArrowRight":this.navigate({e:e,input:t,right:!0});break;case"ArrowUp":this.navigate({e:e,input:t,up:!0});break;case"ArrowDown":this.navigate({e:e,input:t,down:!0});break;case"Enter":e.preventDefault(),this.handleEmojiClick({pos:this.state.pos});break;case"Escape":e.preventDefault(),this.state.searchResults?this.clearSearch():this.unfocusSearch()}})),YN(this,"clearSearch",(()=>{const e=this.refs.searchInput.current;e&&(e.value="",e.focus(),this.handleSearchInput())})),YN(this,"handleCategoryClick",(({category:e,i:t})=>{this.scrollTo(0==t?{row:-1}:{categoryId:e.id})})),YN(this,"openSkins",(e=>{const{currentTarget:t}=e,n=t.getBoundingClientRect();this.setState({showSkins:n},(async()=>{await async function(e=1){for(let t in[...Array(e).keys()])await new Promise(requestAnimationFrame)}(2);const e=this.refs.menu.current;e&&(e.classList.remove("hidden"),this.refs.skinToneRadio.current.focus(),this.base.addEventListener("click",this.handleBaseClick,!0),this.base.addEventListener("keydown",this.handleBaseKeydown,!0))}))})),this.state={pos:[-1,-1],visibleRows:{0:!0},...this.getInitialState(e)}}}class WO extends oO{async connectedCallback(){const e=QA(this.props,UA,this);e.element=this,e.ref=e=>{this.component=e},await YA(e),SA(AA($O,{...e}),this.shadowRoot)}disconnectedCallback(){this.component&&this.component.unregister()}constructor(e){super(e,{styles:GN(VO)})}}YN(WO,"Props",UA),"undefined"==typeof customElements||customElements.get("em-emoji-picker")||customElements.define("em-emoji-picker",WO);var VO={};VO=':host {\n display: flex;\n width: -webkit-min-content;\n width: -moz-min-content;\n width: min-content;\n height: 435px;\n min-height: 230px;\n border-radius: var(--border-radius);\n box-shadow: var(--shadow);\n --border-radius: 10px;\n --category-icon-size: 18px;\n --font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;\n --font-size: 15px;\n --shadow-color: 0deg 0% 0%;\n --shadow:\n 0.3px 0.5px 2.7px hsl(var(--shadow-color) / 0.14),\n 0.4px 0.8px 1px -3.2px hsl(var(--shadow-color) / 0.14),\n 1px 2px 2.5px -4.5px hsl(var(--shadow-color) / 0.14);\n}\n\n[data-theme=light] {\n --em-rgb-color: var(--rgb-color, 34, 36, 39);\n --em-rgb-accent: var(--rgb-accent, 34, 102, 237);\n --em-rgb-background: var(--rgb-background, 255, 255, 255);\n --em-rgb-input: var(--rgb-input, 255, 255, 255);\n --em-color-border: var(--color-border, rgba(0, 0, 0, .05));\n --em-color-border-over: var(--color-border-over, rgba(0, 0, 0, .1));\n}\n\n[data-theme=dark] {\n --em-rgb-color: var(--rgb-color, 222, 222, 221);\n --em-rgb-accent: var(--rgb-accent, 58, 130, 247);\n --em-rgb-background: var(--rgb-background, 21, 22, 23);\n --em-rgb-input: var(--rgb-input, 0, 0, 0);\n --em-color-border: var(--color-border, rgba(255, 255, 255, .1));\n --em-color-border-over: var(--color-border-over, rgba(255, 255, 255, .2));\n}\n\n#root {\n --color-a: rgb(var(--em-rgb-color));\n --color-b: rgba(var(--em-rgb-color), .65);\n --color-c: rgba(var(--em-rgb-color), .45);\n --padding: 12px;\n --padding-small: calc(var(--padding) / 2);\n --sidebar-width: 16px;\n --duration: 225ms;\n --duration-fast: 125ms;\n --duration-instant: 50ms;\n --easing: cubic-bezier(.4, .0, .2, 1);\n position: relative;\n width: 100%;\n text-align: left;\n border-radius: var(--border-radius);\n background-color: rgb(var(--em-rgb-background));\n}\n\n@media (prefers-reduced-motion) {\n #root {\n --duration: 0;\n --duration-fast: 0;\n --duration-instant: 0;\n }\n}\n\n#root[data-menu] button {\n cursor: auto;\n}\n\n#root[data-menu] .menu button {\n cursor: pointer;\n}\n\n:host, #root, input, button {\n color: rgb(var(--em-rgb-color));\n font-family: var(--font-family);\n font-size: var(--font-size);\n line-height: normal;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n*, *:before, *:after {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n min-width: 0;\n}\n\n.relative {\n position: relative;\n}\n\n.flex {\n display: flex;\n}\n\n.flex-auto {\n flex: 0 0 auto;\n}\n\n.flex-center {\n justify-content: center;\n}\n\n.flex-column {\n flex-direction: column;\n}\n\n.flex-grow {\n flex: 1 1 auto;\n}\n\n.flex-middle {\n align-items: center;\n}\n\n.flex-wrap {\n flex-wrap: wrap;\n}\n\n.padding {\n padding: var(--padding);\n}\n\n.padding-t {\n padding-top: var(--padding);\n}\n\n.padding-lr {\n padding-left: var(--padding);\n padding-right: var(--padding);\n}\n\n.padding-r {\n padding-right: var(--padding);\n}\n\n.padding-small {\n padding: var(--padding-small);\n}\n\n.padding-small-b {\n padding-bottom: var(--padding-small);\n}\n\n.padding-small-lr {\n padding-left: var(--padding-small);\n padding-right: var(--padding-small);\n}\n\n.margin {\n margin: var(--padding);\n}\n\n.margin-r {\n margin-right: var(--padding);\n}\n\n.margin-l {\n margin-left: var(--padding);\n}\n\n.margin-small-l {\n margin-left: var(--padding-small);\n}\n\n.margin-small-lr {\n margin-left: var(--padding-small);\n margin-right: var(--padding-small);\n}\n\n.align-l {\n text-align: left;\n}\n\n.align-r {\n text-align: right;\n}\n\n.color-a {\n color: var(--color-a);\n}\n\n.color-b {\n color: var(--color-b);\n}\n\n.color-c {\n color: var(--color-c);\n}\n\n.ellipsis {\n white-space: nowrap;\n max-width: 100%;\n width: auto;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.sr-only {\n position: absolute;\n left: -10000px;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n}\n\na {\n cursor: pointer;\n color: rgb(var(--em-rgb-accent));\n}\n\na:hover {\n text-decoration: underline;\n}\n\n.spacer {\n height: 10px;\n}\n\n.scroll {\n overflow: auto;\n overflow-x: hidden;\n padding-right: 0;\n}\n\n.scroll::-webkit-scrollbar {\n width: var(--sidebar-width);\n height: var(--sidebar-width);\n}\n\n.scroll::-webkit-scrollbar-track {\n border: 0;\n}\n\n.scroll::-webkit-scrollbar-button {\n width: 0;\n height: 0;\n display: none;\n}\n\n.scroll::-webkit-scrollbar-corner {\n background-color: transparent;\n}\n\n.scroll::-webkit-scrollbar-thumb {\n min-height: 20%;\n min-height: 65px;\n border: 4px solid rgb(var(--em-rgb-background));\n border-radius: 8px;\n}\n\n.scroll::-webkit-scrollbar-thumb:hover {\n background-color: var(--em-color-border-over) !important;\n}\n\n.scroll:hover::-webkit-scrollbar-thumb {\n background-color: var(--em-color-border);\n}\n\n.sticky {\n position: -webkit-sticky;\n position: sticky;\n z-index: 1;\n top: -1px;\n font-weight: 500;\n background-color: rgba(var(--em-rgb-background), 0.9);\n -webkit-backdrop-filter: blur(4px);\n backdrop-filter: blur(4px);\n}\n\n.search {\n z-index: 2;\n position: relative;\n}\n\n.search input, .search button {\n font-size: calc(var(--font-size) - 1px);\n}\n\n.search input[type=search] {\n display: block;\n border: 0;\n outline: 0;\n width: 100%;\n padding: 10px 2em 10px 2.2em;\n border-radius: 10px;\n background-color: var(--em-color-border);\n transition-duration: var(--duration);\n transition-property: background-color, box-shadow;\n transition-timing-function: var(--easing);\n}\n\n.search input[type=search]::-moz-placeholder {\n color: inherit;\n opacity: 0.6;\n}\n\n.search input[type=search]:-ms-input-placeholder {\n color: inherit;\n opacity: 0.6;\n}\n\n.search input[type=search]::placeholder {\n color: inherit;\n opacity: 0.6;\n}\n\n.search input[type=search], .search input[type=search]::-webkit-search-decoration, .search input[type=search]::-webkit-search-cancel-button, .search input[type=search]::-webkit-search-results-button, .search input[type=search]::-webkit-search-results-decoration {\n -webkit-appearance: none;\n appearance: none;\n}\n\n.search input[type=search]:focus {\n background-color: rgb(var(--em-rgb-input));\n box-shadow: inset 0 0 0 1px rgb(var(--em-rgb-accent)), 0 1px 3px rgba(65, 69, 73, 0.2);\n}\n\n.search .icon {\n z-index: 1;\n position: absolute;\n top: 50%;\n color: rgba(var(--em-rgb-color), 0.7);\n transform: translateY(-50%);\n}\n\n.search .loupe {\n left: 0.7em;\n pointer-events: none;\n}\n\n.search .delete {\n right: 0.7em;\n}\n\nsvg {\n fill: currentColor;\n width: 1em;\n height: 1em;\n}\n\nbutton {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n cursor: pointer;\n color: currentColor;\n border: 0;\n background-color: transparent;\n}\n\n#nav {\n z-index: 2;\n position: relative;\n padding-top: 12px;\n padding-bottom: 12px;\n padding-right: var(--sidebar-width);\n}\n\n#nav button {\n color: var(--color-b);\n transition: color var(--duration) var(--easing);\n}\n\n#nav button:hover {\n color: var(--color-a);\n}\n\n#nav svg, #nav img {\n width: var(--category-icon-size);\n height: var(--category-icon-size);\n}\n\n#nav .bar {\n position: absolute;\n bottom: -12px;\n left: 0;\n width: 100%;\n height: 3px;\n background-color: rgb(var(--em-rgb-accent));\n border-radius: 3px 3px 0 0;\n transition: transform var(--duration) var(--easing);\n}\n\n#nav button[aria-selected] {\n color: rgb(var(--em-rgb-accent));\n}\n\n#preview {\n z-index: 2;\n position: relative;\n padding: calc(var(--padding) + 4px) var(--padding);\n padding-right: var(--sidebar-width);\n}\n\n#nav:before, #preview:before {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n height: 2px;\n}\n\n#nav[data-position=top]:before, #preview[data-position=top]:before {\n top: 100%;\n background: linear-gradient(to bottom, var(--em-color-border), transparent);\n}\n\n#nav[data-position=bottom]:before, #preview[data-position=bottom]:before {\n bottom: 100%;\n background: linear-gradient(to top, var(--em-color-border), transparent);\n}\n\n.category button {\n position: relative;\n font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;\n}\n\n.category button > * {\n position: relative;\n}\n\n.category button .background {\n position: absolute;\n inset: 0;\n opacity: 0;\n background-color: var(--em-color-border);\n transition: opacity var(--duration-fast) var(--easing) var(--duration-instant);\n}\n\n.category button:hover .background {\n transition-duration: var(--duration-instant);\n transition-delay: 0ms;\n}\n\n.category button[aria-selected] .background {\n opacity: 1;\n}\n\n.category button[data-keyboard] .background {\n transition: none;\n}\n\n.row {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n}\n\n.skin-tone-button {\n border-radius: 100%;\n border: 1px solid transparent;\n}\n\n.skin-tone-button:hover {\n border-color: var(--em-color-border);\n}\n\n.skin-tone-button:active .skin-tone {\n transform: scale(0.85) !important;\n}\n\n.skin-tone-button .skin-tone {\n transition: transform var(--duration) var(--easing);\n}\n\n.skin-tone-button[aria-selected] {\n border-left-width: 0;\n border-right-width: 0;\n border-top-color: rgba(0, 0, 0, 0.05);\n border-bottom-color: transparent;\n background-color: var(--em-color-border);\n}\n\n.skin-tone-button[aria-selected] .skin-tone {\n transform: scale(0.9);\n}\n\n.menu {\n z-index: 2;\n position: absolute;\n white-space: nowrap;\n padding: 4px;\n border: 1px solid var(--em-color-border);\n background-color: rgba(var(--em-rgb-background), 0.9);\n -webkit-backdrop-filter: blur(4px);\n backdrop-filter: blur(4px);\n border-radius: 10px;\n box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.05);\n transition-property: opacity, transform;\n transition-duration: var(--duration);\n transition-timing-function: var(--easing);\n}\n\n.menu.hidden {\n opacity: 0;\n}\n\n.menu[data-position=bottom] {\n transform-origin: bottom right;\n}\n\n.menu[data-position=bottom].hidden {\n transform: scale(0.9) rotate(-3deg) translateY(5%);\n}\n\n.menu[data-position=top] {\n transform-origin: top right;\n}\n\n.menu[data-position=top].hidden {\n transform: scale(0.9) rotate(3deg) translateY(-5%);\n}\n\n.menu input[type=radio] {\n position: absolute;\n overflow: hidden;\n clip: rect(0 0 0 0);\n width: 1px;\n height: 1px;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.menu input[type=radio]:checked + .option {\n box-shadow: 0 0 0 2px rgb(var(--em-rgb-accent));\n}\n\n.option {\n width: 100%;\n padding: 4px 6px;\n border-radius: 6px;\n}\n\n.option:hover {\n color: #fff;\n background-color: rgb(var(--em-rgb-accent));\n}\n\n.skin-tone {\n position: relative;\n display: inline-block;\n width: 16px;\n height: 16px;\n border-radius: 100%;\n overflow: hidden;\n}\n\n.skin-tone:after {\n content: "";\n position: absolute;\n inset: 0;\n border-radius: 100%;\n border: 1px solid rgba(0, 0, 0, 0.8);\n mix-blend-mode: overlay;\n box-shadow: inset 0 -2px 3px #000, inset 0 1px 2px #fff;\n background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);\n}\n\n.skin-tone-1 {\n background-color: #ffc93a;\n}\n\n.skin-tone-2 {\n background-color: #ffdab7;\n}\n\n.skin-tone-3 {\n background-color: #e7b98f;\n}\n\n.skin-tone-4 {\n background-color: #c88c61;\n}\n\n.skin-tone-5 {\n background-color: #a46134;\n}\n\n.skin-tone-6 {\n background-color: #5d4437;\n}\n\n[data-emoji-set=twitter] .skin-tone:after {\n border-color: rgba(0, 0, 0, 0.5);\n box-shadow: none;\n}\n\n[data-emoji-set=twitter] .skin-tone-1 {\n background-color: #FADE72;\n}\n\n[data-emoji-set=twitter] .skin-tone-2 {\n background-color: #F3DFD0;\n}\n\n[data-emoji-set=twitter] .skin-tone-3 {\n background-color: #EED3A8;\n}\n\n[data-emoji-set=twitter] .skin-tone-4 {\n background-color: #CFAD8D;\n}\n\n[data-emoji-set=twitter] .skin-tone-5 {\n background-color: #A8805D;\n}\n\n[data-emoji-set=twitter] .skin-tone-6 {\n background-color: #765542;\n}\n\n[data-emoji-set=google] .skin-tone:after {\n box-shadow: inset 0 0 2px 2px rgba(0, 0, 0, 0.4);\n}\n\n[data-emoji-set=google] .skin-tone-1 {\n background-color: #F5C748;\n}\n\n[data-emoji-set=google] .skin-tone-2 {\n background-color: #F1D5AA;\n}\n\n[data-emoji-set=google] .skin-tone-3 {\n background-color: #D4B48D;\n}\n\n[data-emoji-set=google] .skin-tone-4 {\n background-color: #AA876B;\n}\n\n[data-emoji-set=google] .skin-tone-5 {\n background-color: #916544;\n}\n\n[data-emoji-set=google] .skin-tone-6 {\n background-color: #61493F;\n}\n\n[data-emoji-set=facebook] .skin-tone:after {\n border-color: rgba(0, 0, 0, 0.4);\n box-shadow: inset 0 -2px 3px #000, inset 0 1px 4px #fff;\n}\n\n[data-emoji-set=facebook] .skin-tone-1 {\n background-color: #F5C748;\n}\n\n[data-emoji-set=facebook] .skin-tone-2 {\n background-color: #F1D5AA;\n}\n\n[data-emoji-set=facebook] .skin-tone-3 {\n background-color: #D4B48D;\n}\n\n[data-emoji-set=facebook] .skin-tone-4 {\n background-color: #AA876B;\n}\n\n[data-emoji-set=facebook] .skin-tone-5 {\n background-color: #916544;\n}\n\n[data-emoji-set=facebook] .skin-tone-6 {\n background-color: #61493F;\n}\n';const qO=()=>oe.get("https://cdn.jsdelivr.net/npm/@emoji-mart/data");class KO extends r.Component{constructor(){super(...arguments),tu(this,"ref",r.createRef()),tu(this,"fetchEmojiData",(async()=>{try{const{data:e}=await qO();return e}catch{return{}}})),tu(this,"onKeyDown",(e=>{let{event:t}=e;return"Escape"===t.key&&(this.props.editor.chain().focus().deleteRange(this.props.range).run(),!0)})),tu(this,"handleSelect",(e=>{this.props.editor.chain().focus().deleteRange(this.props.range).setEmoji(e).run()}))}componentDidMount(){new WO({...this.props,onEmojiSelect:this.handleSelect,style:{maxWidth:"100%"},theme:"light",native:!0,previewPosition:"none",showSkinTones:!1,data:this.fetchEmojiData,ref:this.ref})}render(){return r.createElement("div",{"data-cy":"neeto-editor-emoji-picker",ref:this.ref})}}KO.defaultProps={editor:{},range:{}},KO.propTypes={editor:yl.exports.object.isRequired,range:yl.exports.object};const GO=new Dm("emoji-picker"),YO=_w.create({name:"emojiPicker",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:()=>({suggestion:{char:"::",startOfLine:!1,pluginKey:GO,items:()=>[],render:()=>{let e,t;return{onStart(n){e=new Wx(KO,{props:n,editor:n.editor}),t=Ox("body",{theme:"light",getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onKeyDown(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t)},onExit(){t[0].destroy(),e.destroy()}}}}}),addProseMirrorPlugins(){return[KN({editor:this.editor,...this.options.suggestion})]}});class QO extends r.Component{constructor(){super(...arguments),tu(this,"state",{isLoading:!1,selectedIndex:0,emojiSuggestions:[]}),tu(this,"fetchEmojiData",(async()=>{this.setState({isLoading:!0});try{const{data:e}=await qO();return this.setState({isLoading:!1}),e}catch{return this.setState({isLoading:!1}),{}}})),tu(this,"searchEmoji",(async()=>{if(this.props.query)return(await XA.search(this.props.query)).slice(0,5);return(await Promise.all(["+1","-1","smile","tada","heart"].map((e=>XA.search(e))))).map((e=>e[0]))})),tu(this,"searchEmojiAndSetState",(async()=>{const e=await this.searchEmoji();this.setState({emojiSuggestions:e})})),tu(this,"setEditorState",(async()=>{const e=await this.searchEmoji();this.props.editor.chain().focus().deleteRange(this.props.range).setEmoji(e[0]).run()})),tu(this,"onKeyDown",(e=>{let{event:t}=e;return"ArrowLeft"===t.key||"ArrowDown"===t.key?(this.setState((e=>{let{selectedIndex:t,emojiSuggestions:n}=e;return{selectedIndex:(t+n.length-1)%n.length}})),!0):"ArrowRight"===t.key||"ArrowUp"===t.key?(this.setState((e=>{let{selectedIndex:t,emojiSuggestions:n}=e;return{selectedIndex:(t+1)%n.length}})),!0):"Enter"===t.key?(this.selectItem(this.state.selectedIndex),!0):" "===t.key?(_e(this.props.query)?this.props.editor.chain().focus().insertContent(" ").run():this.setEditorState(),!0):"Escape"===t.key&&(this.props.editor.chain().focus().insertContent(" ").run(),!0)})),tu(this,"selectItem",(e=>{this.props.editor.chain().focus().deleteRange(this.props.range).setEmoji(this.state.emojiSuggestions[e]).run()}))}componentDidMount(){YA({data:this.fetchEmojiData,theme:"light",previewPosition:"none"}),this.searchEmojiAndSetState()}componentDidUpdate(e){this.props.query!==e.query&&this.searchEmojiAndSetState()}render(){return r.createElement("div",{className:"neeto-editor-emoji-suggestion"},this.state.isLoading&&r.createElement(w,null),!this.state.isLoading&&(this.state.emojiSuggestions.length>0?this.state.emojiSuggestions.map(((e,t)=>r.createElement("div",{"data-cy":`neeto-editor-emoji-suggestion-${e.id}`,key:e.id,className:qe("neeto-editor-emoji-suggestion__item",{"neeto-editor-emoji-suggestion__item--selected":t===this.state.selectedIndex}),onClick:()=>this.selectItem(t)},e.skins[0].native))):r.createElement("p",null,"No results")))}}const JO=new Dm("emoji-suggestion"),ZO=_w.create({name:"emojiSuggestion",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:()=>({HTMLAttributes:{class:"neeto-editor-emoji"},renderEmoji(e){let{node:t}=e;return t.attrs.label},suggestion:{}}),addAttributes:()=>({label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML:()=>[{tag:"span[data-emoji]"}],renderHTML(e){let{node:t,HTMLAttributes:n}=e;return["span",pv({"data-emoji":""},this.options.HTMLAttributes,n),this.options.renderEmoji({node:t})]},renderText(e){let{node:t}=e;return this.options.renderEmoji({node:t})},addCommands(){return{setEmoji:e=>t=>{var n;let{chain:r}=t;r().focus().insertContent([{type:this.name,attrs:{label:(null==e?void 0:e.native)||(null==e||null===(n=e.skins[0])||void 0===n?void 0:n.native)||""}},{type:"text",text:" "}]).run()}}},addProseMirrorPlugins(){return[KN({editor:this.editor,...this.options.suggestion})]}}),XO={char:":",startOfLine:!1,pluginKey:JO,command:e=>{let{editor:t,range:n,props:r}=e;t.chain().focus().deleteRange(n).setEmoji(r).run()},items:()=>[],render:()=>{let e,t;return{onStart(n){e=new Wx(QO,{props:n,editor:n.editor}),t=Ox("body",{theme:"light",getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start",zIndex:99999})},onUpdate(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t)},onExit(){t[0].destroy(),e.destroy()}}}};var eT,tT=ZO.configure({suggestion:XO}),nT=void 0&&(void 0).__extends||(eT=function(e,t){return eT=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},eT(e,t)},function(e,t){function n(){this.constructor=e}eT(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),rT=void 0&&(void 0).__assign||function(){return rT=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},rT.apply(this,arguments)},iT={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},oT={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},sT={width:"20px",height:"20px",position:"absolute"},aT={top:rT(rT({},iT),{top:"-5px"}),right:rT(rT({},oT),{left:void 0,right:"-5px"}),bottom:rT(rT({},iT),{top:void 0,bottom:"-5px"}),left:rT(rT({},oT),{left:"-5px"}),topRight:rT(rT({},sT),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:rT(rT({},sT),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:rT(rT({},sT),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:rT(rT({},sT),{left:"-10px",top:"-10px",cursor:"nw-resize"})},lT=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onMouseDown=function(e){t.props.onResizeStart(e,t.props.direction)},t.onTouchStart=function(e){t.props.onResizeStart(e,t.props.direction)},t}return nT(t,e),t.prototype.render=function(){return n.createElement("div",{className:this.props.className||"",style:rT(rT({position:"absolute",userSelect:"none"},aT[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(n.PureComponent),cT=void 0&&(void 0).__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),uT=void 0&&(void 0).__assign||function(){return uT=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},uT.apply(this,arguments)},dT={width:"auto",height:"auto"},pT=function(e,t,n){return Math.max(Math.min(e,n),t)},hT=function(e,t){return Math.round(e/t)*t},fT=function(e,t){return new RegExp(e,"i").test(t)},mT=function(e){return Boolean(e.touches&&e.touches.length)},gT=function(e,t,n){void 0===n&&(n=0);var r=t.reduce((function(n,r,i){return Math.abs(r-e)<Math.abs(t[n]-e)?i:n}),0),i=Math.abs(t[r]-e);return 0===n||i<n?t[r]:e},bT=function(e){return"auto"===(e=e.toString())||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:e+"px"},yT=function(e,t,n,r){if(e&&"string"==typeof e){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%"))return t*(Number(e.replace("%",""))/100);if(e.endsWith("vw"))return n*(Number(e.replace("vw",""))/100);if(e.endsWith("vh"))return r*(Number(e.replace("vh",""))/100)}return e},vT=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],wT="__resizable_base__",_T=function(e){function t(t){var n=e.call(this,t)||this;return n.ratio=1,n.resizable=null,n.parentLeft=0,n.parentTop=0,n.resizableLeft=0,n.resizableRight=0,n.resizableTop=0,n.resizableBottom=0,n.targetLeft=0,n.targetTop=0,n.appendBase=function(){if(!n.resizable||!n.window)return null;var e=n.parentNode;if(!e)return null;var t=n.window.document.createElement("div");return t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.transform="scale(0, 0)",t.style.left="0",t.style.flex="0 0 100%",t.classList?t.classList.add(wT):t.className+=wT,e.appendChild(t),t},n.removeBase=function(e){var t=n.parentNode;t&&t.removeChild(e)},n.ref=function(e){e&&(n.resizable=e)},n.state={isResizing:!1,width:void 0===(n.propsSize&&n.propsSize.width)?"auto":n.propsSize&&n.propsSize.width,height:void 0===(n.propsSize&&n.propsSize.height)?"auto":n.propsSize&&n.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},n.onResizeStart=n.onResizeStart.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.onMouseUp=n.onMouseUp.bind(n),n}return cT(t,e),Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||dT},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var e=0,t=0;if(this.resizable&&this.window){var n=this.resizable.offsetWidth,r=this.resizable.offsetHeight,i=this.resizable.style.position;"relative"!==i&&(this.resizable.style.position="relative"),e="auto"!==this.resizable.style.width?this.resizable.offsetWidth:n,t="auto"!==this.resizable.style.height?this.resizable.offsetHeight:r,this.resizable.style.position=i}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var e=this,t=this.props.size,n=function(t){if(void 0===e.state[t]||"auto"===e.state[t])return"auto";if(e.propsSize&&e.propsSize[t]&&e.propsSize[t].toString().endsWith("%")){if(e.state[t].toString().endsWith("%"))return e.state[t].toString();var n=e.getParentSize();return Number(e.state[t].toString().replace("px",""))/n[t]*100+"%"}return bT(e.state[t])};return{width:t&&void 0!==t.width&&!this.state.isResizing?bT(t.width):n("width"),height:t&&void 0!==t.height&&!this.state.isResizing?bT(t.height):n("height")}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,n=this.parentNode.style.flexWrap;"wrap"!==n&&(t=!0,this.parentNode.style.flexWrap="wrap"),e.style.position="relative",e.style.minWidth="100%",e.style.minHeight="100%";var r={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=n),this.removeBase(e),r},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(this.resizable&&this.window){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==e.flexBasis?e.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(e,t){var n=this.propsSize&&this.propsSize[t];return"auto"!==this.state[t]||this.state.original[t]!==e||void 0!==n&&"auto"!==n?e:"auto"},t.prototype.calculateNewMaxFromBoundary=function(e,t){var n,r,i=this.props.boundsByDirection,o=this.state.direction,s=i&&fT("left",o),a=i&&fT("top",o);if("parent"===this.props.bounds){var l=this.parentNode;l&&(n=s?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),r=a?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(n=s?this.resizableRight:this.window.innerWidth-this.resizableLeft,r=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(n=s?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),r=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return n&&Number.isFinite(n)&&(e=e&&e<n?e:n),r&&Number.isFinite(r)&&(t=t&&t<r?t:r),{maxWidth:e,maxHeight:t}},t.prototype.calculateNewSizeFromDirection=function(e,t){var n=this.props.scale||1,r=this.props.resizeRatio||1,i=this.state,o=i.direction,s=i.original,a=this.props,l=a.lockAspectRatio,c=a.lockAspectRatioExtraHeight,u=a.lockAspectRatioExtraWidth,d=s.width,p=s.height,h=c||0,f=u||0;return fT("right",o)&&(d=s.width+(e-s.x)*r/n,l&&(p=(d-f)/this.ratio+h)),fT("left",o)&&(d=s.width-(e-s.x)*r/n,l&&(p=(d-f)/this.ratio+h)),fT("bottom",o)&&(p=s.height+(t-s.y)*r/n,l&&(d=(p-h)*this.ratio+f)),fT("top",o)&&(p=s.height-(t-s.y)*r/n,l&&(d=(p-h)*this.ratio+f)),{newWidth:d,newHeight:p}},t.prototype.calculateNewSizeFromAspectRatio=function(e,t,n,r){var i=this.props,o=i.lockAspectRatio,s=i.lockAspectRatioExtraHeight,a=i.lockAspectRatioExtraWidth,l=void 0===r.width?10:r.width,c=void 0===n.width||n.width<0?e:n.width,u=void 0===r.height?10:r.height,d=void 0===n.height||n.height<0?t:n.height,p=s||0,h=a||0;if(o){var f=(u-p)*this.ratio+h,m=(d-p)*this.ratio+h,g=(l-h)/this.ratio+p,b=(c-h)/this.ratio+p,y=Math.max(l,f),v=Math.min(c,m),w=Math.max(u,g),_=Math.min(d,b);e=pT(e,y,v),t=pT(t,w,_)}else e=pT(e,l,c),t=pT(t,u,d);return{newWidth:e,newHeight:t}},t.prototype.setBoundingClientRect=function(){if("parent"===this.props.bounds){var e=this.parentNode;if(e){var t=e.getBoundingClientRect();this.parentLeft=t.left,this.parentTop=t.top}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var n=this.props.bounds.getBoundingClientRect();this.targetLeft=n.left,this.targetTop=n.top}if(this.resizable){var r=this.resizable.getBoundingClientRect(),i=r.left,o=r.top,s=r.right,a=r.bottom;this.resizableLeft=i,this.resizableRight=s,this.resizableTop=o,this.resizableBottom=a}},t.prototype.onResizeStart=function(e,t){if(this.resizable&&this.window){var n,r=0,i=0;if(e.nativeEvent&&function(e){return Boolean((e.clientX||0===e.clientX)&&(e.clientY||0===e.clientY))}(e.nativeEvent)?(r=e.nativeEvent.clientX,i=e.nativeEvent.clientY):e.nativeEvent&&mT(e.nativeEvent)&&(r=e.nativeEvent.touches[0].clientX,i=e.nativeEvent.touches[0].clientY),this.props.onResizeStart)if(this.resizable)if(!1===this.props.onResizeStart(e,t,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var o=this.window.getComputedStyle(this.resizable);if("auto"!==o.flexBasis){var s=this.parentNode;if(s){var a=this.window.getComputedStyle(s).flexDirection;this.flexDir=a.startsWith("row")?"row":"column",n=o.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:r,y:i,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:uT(uT({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||"auto"}),direction:t,flexBasis:n};this.setState(l)}},t.prototype.onMouseMove=function(e){var t=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&mT(e))try{e.preventDefault(),e.stopPropagation()}catch(e){}var n=this.props,r=n.maxWidth,i=n.maxHeight,o=n.minWidth,s=n.minHeight,a=mT(e)?e.touches[0].clientX:e.clientX,l=mT(e)?e.touches[0].clientY:e.clientY,c=this.state,u=c.direction,d=c.original,p=c.width,h=c.height,f=this.getParentSize(),m=function(e,t,n,r,i,o,s){return r=yT(r,e.width,t,n),i=yT(i,e.height,t,n),o=yT(o,e.width,t,n),s=yT(s,e.height,t,n),{maxWidth:void 0===r?void 0:Number(r),maxHeight:void 0===i?void 0:Number(i),minWidth:void 0===o?void 0:Number(o),minHeight:void 0===s?void 0:Number(s)}}(f,this.window.innerWidth,this.window.innerHeight,r,i,o,s);r=m.maxWidth,i=m.maxHeight,o=m.minWidth,s=m.minHeight;var g=this.calculateNewSizeFromDirection(a,l),b=g.newHeight,y=g.newWidth,v=this.calculateNewMaxFromBoundary(r,i);this.props.snap&&this.props.snap.x&&(y=gT(y,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(b=gT(b,this.props.snap.y,this.props.snapGap));var w=this.calculateNewSizeFromAspectRatio(y,b,{width:v.maxWidth,height:v.maxHeight},{width:o,height:s});if(y=w.newWidth,b=w.newHeight,this.props.grid){var _=hT(y,this.props.grid[0]),x=hT(b,this.props.grid[1]),E=this.props.snapGap||0;y=0===E||Math.abs(_-y)<=E?_:y,b=0===E||Math.abs(x-b)<=E?x:b}var k={width:y-d.width,height:b-d.height};if(p&&"string"==typeof p)if(p.endsWith("%"))y=y/f.width*100+"%";else if(p.endsWith("vw")){y=y/this.window.innerWidth*100+"vw"}else if(p.endsWith("vh")){y=y/this.window.innerHeight*100+"vh"}if(h&&"string"==typeof h)if(h.endsWith("%"))b=b/f.height*100+"%";else if(h.endsWith("vw")){b=b/this.window.innerWidth*100+"vw"}else if(h.endsWith("vh")){b=b/this.window.innerHeight*100+"vh"}var M={width:this.createSizeForCssProperty(y,"width"),height:this.createSizeForCssProperty(b,"height")};"row"===this.flexDir?M.flexBasis=M.width:"column"===this.flexDir&&(M.flexBasis=M.height),de((function(){t.setState(M)})),this.props.onResize&&this.props.onResize(e,u,this.resizable,k)}},t.prototype.onMouseUp=function(e){var t=this.state,n=t.isResizing,r=t.direction,i=t.original;if(n&&this.resizable){var o={width:this.size.width-i.width,height:this.size.height-i.height};this.props.onResizeStop&&this.props.onResizeStop(e,r,this.resizable,o),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:uT(uT({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(e){this.setState({width:e.width,height:e.height})},t.prototype.renderResizer=function(){var e=this,t=this.props,r=t.enable,i=t.handleStyles,o=t.handleClasses,s=t.handleWrapperStyle,a=t.handleWrapperClass,l=t.handleComponent;if(!r)return null;var c=Object.keys(r).map((function(t){return!1!==r[t]?n.createElement(lT,{key:t,direction:t,onResizeStart:e.onResizeStart,replaceStyles:i&&i[t],className:o&&o[t]},l&&l[t]?l[t]:null):null}));return n.createElement("div",{className:a,style:s},c)},t.prototype.render=function(){var e=this,t=Object.keys(this.props).reduce((function(t,n){return-1!==vT.indexOf(n)||(t[n]=e.props[n]),t}),{}),r=uT(uT(uT({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(r.flexBasis=this.state.flexBasis);var i=this.props.as||"div";return n.createElement(i,uT({ref:this.ref,style:r,className:this.props.className},t),this.state.isResizing&&n.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(n.PureComponent);const xT=e=>{let{align:t,updateAttributes:n,deleteNode:i}=e;const o=[{Icon:M,alignPos:"left",optionName:"Align left"},{Icon:D,alignPos:"center",optionName:"Align Center"},{Icon:C,alignPos:"right",optionName:"Align right"},{Icon:S,optionName:"Delete"}];return r.createElement(y,{buttonProps:{className:"neeto-editor__image-menu-btn"},buttonSize:"small",buttonStyle:"secondary",className:"neeto-editor__image-menu",icon:T,position:"top"},o.map((e=>{let{Icon:o,optionName:s,alignPos:a}=e;return r.createElement(g,{icon:o,key:s,style:a===t?"secondary":"text",tooltipProps:{content:ae(s),position:"top"},onClick:()=>(e=>e?n({align:e}):i())(a)})})))},ET=t=>{var n;let{node:i,editor:s,getPos:a,updateAttributes:l,deleteNode:c}=t;const u=o(null),{alt:d,src:p,figheight:h,figwidth:f,align:m}=i.attrs,{view:g}=s;let b=h,y=f;const v=u.current?null===(n=u.current.querySelector("figcaption>div"))||void 0===n?void 0:n.textContent:d;return r.createElement($x,{className:`neeto-editor__image-wrapper neeto-editor__image--${m}`},r.createElement("figure",{ref:u},r.createElement(xT,{align:m,deleteNode:c,updateAttributes:l}),r.createElement(_T,{lockAspectRatio:!0,className:"neeto-editor__image",size:{height:b,width:y},onResizeStop:(e,t,n)=>{b=n.offsetHeight,y=n.offsetWidth,g.dispatch(g.state.tr.setNodeMarkup(a(),void 0,{...i.attrs,figheight:b,figwidth:y,height:b,width:y})),s.commands.focus()}},r.createElement("img",Zd({},i.attrs,{alt:v,src:p}))),r.createElement(Hx,{as:"figcaption",className:qe({"is-empty":e(v)})})))},kT=_w.create({name:"image",addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",draggable:!0,isolating:!0,addAttributes:()=>({src:{default:null,parseHTML:e=>{var t;return null===(t=e.querySelector("img"))||void 0===t?void 0:t.getAttribute("src")}},alt:{default:"",parseHTML:e=>{var t;return null===(t=e.querySelector("img"))||void 0===t?void 0:t.getAttribute("alt")}},figheight:{default:288,parseHTML:e=>{var t;return null===(t=e.querySelector("img"))||void 0===t?void 0:t.getAttribute("figheight")}},figwidth:{default:"fit-content",parseHTML:e=>{var t;return null===(t=e.querySelector("img"))||void 0===t?void 0:t.getAttribute("figwidth")}},align:{default:"left",parseHTML:e=>{var t;return null===(t=e.querySelector("img"))||void 0===t?void 0:t.getAttribute("align")}}}),parseHTML:()=>[{tag:"figure",contentElement:"figcaption"}],renderHTML(e){let{node:t,HTMLAttributes:n}=e;const{align:r,src:i,figheight:o,figwidth:s}=t.attrs,a={class:"neeto-editor__image",style:`height:${o}px;width:${s}px;`};return["a",{href:i,target:"_blank",rel:"noopener noreferrer",class:`neeto-editor__image-wrapper neeto-editor__image--${r}`},["figure",this.options.HTMLAttributes,["div",a,["img",pv(n,{draggable:!1,contenteditable:!1})]],["figcaption",0]]]},addNodeView:()=>qx(ET),addCommands(){return{setFigure:e=>{let{caption:t,...n}=e;return e=>{let{chain:r}=e;return r().insertContent({type:this.name,attrs:n,content:t?[{type:"text",text:t}]:[]}).command((e=>{let{tr:t,commands:n}=e;const{doc:r,selection:i}=t,o=r.resolve(i.to).end();return n.setTextSelection(o)})).run()}}}}}),MT=async(e,t)=>{if(e.size<=Kc){const n=new $d({file:e,url:t}),{blobUrl:r}=await n.create();return r}const n=Kc/(1024*1024);return h.error(`Image size should be less than ${n} MB`),""};var DT=t=>{let{uploadEndpoint:n}=t;return kT.extend({addProseMirrorPlugins:()=>[new Em({props:{handleDOMEvents:{paste(t,r){var i,o;const{schema:s,selection:{$anchor:{pos:a}}}=t.state;if(!(null===(i=r.clipboardData)||void 0===i||null===(o=i.files)||void 0===o?void 0:o.length))return;const l=Array.from(r.clipboardData.files).filter((e=>/image/i.test(e.type)));e(l)||(r.preventDefault(),l.forEach((async e=>{const r=s.nodes.image.create({src:await MT(e,n)});if(r.attrs.src){const e=t.state.tr.insert(a,r);t.dispatch(e)}})))}}}})]})},CT=_w.create({name:"figcaption",selectable:!1,draggable:!1,parseHTML:()=>[{tag:"figcaption"}]});const ST=e=>{let{onSubmit:t,shortcuts:n}=e;return Av.create({name:"keyboard-shortcuts",addKeyboardShortcuts(){return{"Mod-Enter":()=>(null==t||t(this.editor.getHTML()),this.editor.commands.blur(),!0),...n}}})};var NT=e=>{let{onSubmit:t,shortcuts:n}=e;return ST({onSubmit:t,shortcuts:n})};const AT=new Dm("mention"),OT=_w.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderLabel({options:e,node:t}){var n;return`${e.suggestion.char}${null!==(n=t.attrs.label)&&void 0!==n?n:t.attrs.id}`},suggestion:{char:"@",pluginKey:AT,command:({editor:e,range:t,props:n})=>{var r,i;const o=e.view.state.selection.$to.nodeAfter;(null===(r=null==o?void 0:o.text)||void 0===r?void 0:r.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),null===(i=window.getSelection())||void 0===i||i.collapseToEnd()},allow:({state:e,range:t})=>{const n=e.doc.resolve(t.from),r=e.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(r)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:t}){return["span",pv({"data-type":this.name},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e})]},renderText({node:e}){return this.options.renderLabel({options:this.options,node:e})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command((({tr:e,state:t})=>{let n=!1;const{selection:r}=t,{empty:i,anchor:o}=r;return!!i&&(t.doc.nodesBetween(o-1,o,((t,r)=>{if(t.type.name===this.name)return n=!0,e.insertText(this.options.suggestion.char||"",r,r+t.nodeSize),!1})),n)}))}},addProseMirrorPlugins(){return[KN({editor:this.editor,...this.options.suggestion})]}}),TT=e=>{let{wrapperRef:t,index:n}=e;if(!t.current||n>=t.current.children.length)return;const r=8,i=t.current,o=i.children[n],s=o.clientHeight+r;let a=i.scrollTop;o.offsetTop+s>a+i.clientHeight?a=o.offsetTop-i.clientHeight+s:a>o.offsetTop&&(a=o.offsetTop-r),t.current.scrollTop=a};class IT extends r.Component{constructor(e){super(e),tu(this,"selectItem",(e=>{const{items:t,command:n}=this.props,r=t[e];r&&n({label:r.name,id:r.key})})),tu(this,"upHandler",(()=>{const{items:e}=this.props;this.setState((t=>{const{selectedIndex:n}=t;return{selectedIndex:(n+e.length-1)%e.length}}))})),tu(this,"downHandler",(()=>{const{items:e}=this.props;this.setState((t=>{const{selectedIndex:n}=t;return{selectedIndex:(n+1)%e.length}}))})),tu(this,"enterHandler",(()=>{const{selectedIndex:e}=this.state;this.selectItem(e)})),tu(this,"onKeyDown",(e=>{let{event:t}=e;const n={ArrowUp:this.upHandler,ArrowDown:this.downHandler,Enter:this.enterHandler};return!!Object.prototype.hasOwnProperty.call(n,t.key)&&(n[t.key](),!0)})),this.state={selectedIndex:0},this.mentionRef=r.createRef()}componentDidUpdate(e){const{items:t}=this.props;t!==e.items&&this.setState({selectedIndex:0}),TT({wrapperRef:this.mentionRef,index:this.state.selectedIndex})}render(){const{selectedIndex:t}=this.state,{items:n}=this.props;return e(n)?r.createElement("div",{className:"neeto-editor-mentions__wrapper"},r.createElement("p",{className:"neeto-editor-mentions__item"},"No Results")):r.createElement("div",{className:"neeto-editor-mentions__wrapper","data-cy":"neeto-editor-mention-list",ref:this.mentionRef},n.map(((e,n)=>{let{key:i,name:o,imageUrl:s}=e;return r.createElement("button",{"data-cy":`neeto-editor-mention-list-${o}`,key:i,type:"button",className:qe("neeto-editor-mentions__item",{active:n===t}),onClick:()=>this.selectItem(n)},r.createElement(_,{user:{name:o,imageUrl:s}}),r.createElement("p",null,o))})))}}function LT(e){return Array.isArray?Array.isArray(e):"[object Array]"===$T(e)}const FT=1/0;function zT(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-FT?"-0":t}(e)}function jT(e){return"string"==typeof e}function RT(e){return"number"==typeof e}function BT(e){return!0===e||!1===e||function(e){return PT(e)&&null!==e}(e)&&"[object Boolean]"==$T(e)}function PT(e){return"object"==typeof e}function UT(e){return null!=e}function HT(e){return!e.trim().length}function $T(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const WT="Extended search is not available",VT="Incorrect 'index' type",qT=Object.prototype.hasOwnProperty;class KT{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let n=GT(e);t+=n.weight,this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function GT(e){let t=null,n=null,r=null,i=1,o=null;if(jT(e)||LT(e))r=e,t=YT(e),n=QT(e);else{if(!qT.call(e,"name"))throw new Error((e=>`Missing ${e} property in key`)("name"));const s=e.name;if(r=s,qT.call(e,"weight")&&(i=e.weight,i<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(s));t=YT(s),n=QT(s),o=e.getFn}return{path:t,id:n,weight:i,src:r,getFn:o}}function YT(e){return LT(e)?e:e.split(".")}function QT(e){return LT(e)?e.join("."):e}const JT={useExtendedSearch:!1,getFn:function(e,t){let n=[],r=!1;const i=(e,t,o)=>{if(UT(e))if(t[o]){const s=e[t[o]];if(!UT(s))return;if(o===t.length-1&&(jT(s)||RT(s)||BT(s)))n.push(zT(s));else if(LT(s)){r=!0;for(let e=0,n=s.length;e<n;e+=1)i(s[e],t,o+1)}else t.length&&i(s,t,o+1)}else n.push(e)};return i(e,jT(t)?t.split("."):t,0),r?n:n[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var ZT={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...JT};const XT=/[^ ]+/g;class eI{constructor({getFn:e=ZT.getFn,fieldNormWeight:t=ZT.fieldNormWeight}={}){this.norm=function(e=1,t=3){const n=new Map,r=Math.pow(10,t);return{get(t){const i=t.match(XT).length;if(n.has(i))return n.get(i);const o=1/Math.pow(i,.5*e),s=parseFloat(Math.round(o*r)/r);return n.set(i,s),s},clear(){n.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach(((e,t)=>{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,jT(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const t=this.size();jT(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,n=this.size();t<n;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!UT(e)||HT(e))return;let n={v:e,i:t,n:this.norm.get(e)};this.records.push(n)}_addObject(e,t){let n={i:t,$:{}};this.keys.forEach(((t,r)=>{let i=t.getFn?t.getFn(e):this.getFn(e,t.path);if(UT(i))if(LT(i)){let e=[];const t=[{nestedArrIndex:-1,value:i}];for(;t.length;){const{nestedArrIndex:n,value:r}=t.pop();if(UT(r))if(jT(r)&&!HT(r)){let t={v:r,i:n,n:this.norm.get(r)};e.push(t)}else LT(r)&&r.forEach(((e,n)=>{t.push({nestedArrIndex:n,value:e})}))}n.$[r]=e}else if(jT(i)&&!HT(i)){let e={v:i,n:this.norm.get(i)};n.$[r]=e}})),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function tI(e,t,{getFn:n=ZT.getFn,fieldNormWeight:r=ZT.fieldNormWeight}={}){const i=new eI({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(GT)),i.setSources(t),i.create(),i}function nI(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:i=ZT.distance,ignoreLocation:o=ZT.ignoreLocation}={}){const s=t/e.length;if(o)return s;const a=Math.abs(r-n);return i?s+a/i:a?1:s}const rI=32;function iI(e,t,n,{location:r=ZT.location,distance:i=ZT.distance,threshold:o=ZT.threshold,findAllMatches:s=ZT.findAllMatches,minMatchCharLength:a=ZT.minMatchCharLength,includeMatches:l=ZT.includeMatches,ignoreLocation:c=ZT.ignoreLocation}={}){if(t.length>rI)throw new Error((e=>`Pattern length exceeds max of ${e}.`)(rI));const u=t.length,d=e.length,p=Math.max(0,Math.min(r,d));let h=o,f=p;const m=a>1||l,g=m?Array(d):[];let b;for(;(b=e.indexOf(t,f))>-1;){let e=nI(t,{currentLocation:b,expectedLocation:p,distance:i,ignoreLocation:c});if(h=Math.min(e,h),f=b+u,m){let e=0;for(;e<u;)g[b+e]=1,e+=1}}f=-1;let y=[],v=1,w=u+d;const _=1<<u-1;for(let r=0;r<u;r+=1){let o=0,a=w;for(;o<a;){nI(t,{errors:r,currentLocation:p+a,expectedLocation:p,distance:i,ignoreLocation:c})<=h?o=a:w=a,a=Math.floor((w-o)/2+o)}w=a;let l=Math.max(1,p-a+1),b=s?d:Math.min(p+a,d)+u,x=Array(b+2);x[b+1]=(1<<r)-1;for(let o=b;o>=l;o-=1){let s=o-1,a=n[e.charAt(s)];if(m&&(g[s]=+!!a),x[o]=(x[o+1]<<1|1)&a,r&&(x[o]|=(y[o+1]|y[o])<<1|1|y[o+1]),x[o]&_&&(v=nI(t,{errors:r,currentLocation:s,expectedLocation:p,distance:i,ignoreLocation:c}),v<=h)){if(h=v,f=s,f<=p)break;l=Math.max(1,2*p-f)}}if(nI(t,{errors:r+1,currentLocation:p,expectedLocation:p,distance:i,ignoreLocation:c})>h)break;y=x}const x={isMatch:f>=0,score:Math.max(.001,v)};if(m){const e=function(e=[],t=ZT.minMatchCharLength){let n=[],r=-1,i=-1,o=0;for(let s=e.length;o<s;o+=1){let s=e[o];s&&-1===r?r=o:s||-1===r||(i=o-1,i-r+1>=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}(g,a);e.length?l&&(x.indices=e):x.isMatch=!1}return x}function oI(e){let t={};for(let n=0,r=e.length;n<r;n+=1){const i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}class sI{constructor(e,{location:t=ZT.location,threshold:n=ZT.threshold,distance:r=ZT.distance,includeMatches:i=ZT.includeMatches,findAllMatches:o=ZT.findAllMatches,minMatchCharLength:s=ZT.minMatchCharLength,isCaseSensitive:a=ZT.isCaseSensitive,ignoreLocation:l=ZT.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:o,minMatchCharLength:s,isCaseSensitive:a,ignoreLocation:l},this.pattern=a?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const c=(e,t)=>{this.chunks.push({pattern:e,alphabet:oI(e),startIndex:t})},u=this.pattern.length;if(u>rI){let e=0;const t=u%rI,n=u-t;for(;e<n;)c(this.pattern.substr(e,rI),e),e+=rI;if(t){const e=u-rI;c(this.pattern.substr(e),e)}}else c(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,includeMatches:n}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let t={isMatch:!0,score:0};return n&&(t.indices=[[0,e.length-1]]),t}const{location:r,distance:i,threshold:o,findAllMatches:s,minMatchCharLength:a,ignoreLocation:l}=this.options;let c=[],u=0,d=!1;this.chunks.forEach((({pattern:t,alphabet:p,startIndex:h})=>{const{isMatch:f,score:m,indices:g}=iI(e,t,p,{location:r+h,distance:i,threshold:o,findAllMatches:s,minMatchCharLength:a,includeMatches:n,ignoreLocation:l});f&&(d=!0),u+=m,f&&g&&(c=[...c,...g])}));let p={isMatch:d,score:d?u/this.chunks.length:1};return d&&n&&(p.indices=c),p}}class aI{constructor(e){this.pattern=e}static isMultiMatch(e){return lI(e,this.multiRegex)}static isSingleMatch(e){return lI(e,this.singleRegex)}search(){}}function lI(e,t){const n=e.match(t);return n?n[1]:null}class cI extends aI{constructor(e,{location:t=ZT.location,threshold:n=ZT.threshold,distance:r=ZT.distance,includeMatches:i=ZT.includeMatches,findAllMatches:o=ZT.findAllMatches,minMatchCharLength:s=ZT.minMatchCharLength,isCaseSensitive:a=ZT.isCaseSensitive,ignoreLocation:l=ZT.ignoreLocation}={}){super(e),this._bitapSearch=new sI(e,{location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:o,minMatchCharLength:s,isCaseSensitive:a,ignoreLocation:l})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class uI extends aI{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,n=0;const r=[],i=this.pattern.length;for(;(t=e.indexOf(this.pattern,n))>-1;)n=t+i,r.push([t,n-1]);const o=!!r.length;return{isMatch:o,score:o?0:1,indices:r}}}const dI=[class extends aI{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},uI,class extends aI{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},class extends aI{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends aI{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends aI{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},class extends aI{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},cI],pI=dI.length,hI=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,fI="|";const mI=new Set([cI.type,uI.type]);class gI{constructor(e,{isCaseSensitive:t=ZT.isCaseSensitive,includeMatches:n=ZT.includeMatches,minMatchCharLength:r=ZT.minMatchCharLength,ignoreLocation:i=ZT.ignoreLocation,findAllMatches:o=ZT.findAllMatches,location:s=ZT.location,threshold:a=ZT.threshold,distance:l=ZT.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:n,minMatchCharLength:r,findAllMatches:o,ignoreLocation:i,location:s,threshold:a,distance:l},this.pattern=t?e:e.toLowerCase(),this.query=function(e,t={}){return e.split(fI).map((e=>{let n=e.trim().split(hI).filter((e=>e&&!!e.trim())),r=[];for(let e=0,i=n.length;e<i;e+=1){const i=n[e];let o=!1,s=-1;for(;!o&&++s<pI;){const e=dI[s];let n=e.isMultiMatch(i);n&&(r.push(new e(n,t)),o=!0)}if(!o)for(s=-1;++s<pI;){const e=dI[s];let n=e.isSingleMatch(i);if(n){r.push(new e(n,t));break}}}return r}))}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:r}=this.options;e=r?e:e.toLowerCase();let i=0,o=[],s=0;for(let r=0,a=t.length;r<a;r+=1){const a=t[r];o.length=0,i=0;for(let t=0,r=a.length;t<r;t+=1){const r=a[t],{isMatch:l,indices:c,score:u}=r.search(e);if(!l){s=0,i=0,o.length=0;break}if(i+=1,s+=u,n){const e=r.constructor.type;mI.has(e)?o=[...o,...c]:o.push(c)}}if(i){let e={isMatch:!0,score:s/i};return n&&(e.indices=o),e}}return{isMatch:!1,score:1}}}const bI=[];function yI(e,t){for(let n=0,r=bI.length;n<r;n+=1){let r=bI[n];if(r.condition(e,t))return new r(e,t)}return new sI(e,t)}const vI="$and",wI="$or",_I="$path",xI="$val",EI=e=>!(!e[vI]&&!e[wI]),kI=e=>({[vI]:Object.keys(e).map((t=>({[t]:e[t]})))});function MI(e,t,{auto:n=!0}={}){const r=e=>{let i=Object.keys(e);const o=(e=>!!e[_I])(e);if(!o&&i.length>1&&!EI(e))return r(kI(e));if((e=>!LT(e)&&PT(e)&&!EI(e))(e)){const r=o?e[_I]:i[0],s=o?e[xI]:e[r];if(!jT(s))throw new Error((e=>`Invalid value for key ${e}`)(r));const a={keyId:QT(r),pattern:s};return n&&(a.searcher=yI(s,t)),a}let s={children:[],operator:i[0]};return i.forEach((t=>{const n=e[t];LT(n)&&n.forEach((e=>{s.children.push(r(e))}))})),s};return EI(e)||(e=kI(e)),r(e)}function DI(e,t){const n=e.matches;t.matches=[],UT(n)&&n.forEach((e=>{if(!UT(e.indices)||!e.indices.length)return;const{indices:n,value:r}=e;let i={indices:n,value:r};e.key&&(i.key=e.key.src),e.idx>-1&&(i.refIndex=e.idx),t.matches.push(i)}))}function CI(e,t){t.score=e.score}class SI{constructor(e,t={},n){if(this.options={...ZT,...t},this.options.useExtendedSearch&&!1)throw new Error(WT);this._keyStore=new KT(this.options.keys),this.setCollection(e,n)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof eI))throw new Error(VT);this._myIndex=t||tI(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){UT(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=(()=>!1)){const t=[];for(let n=0,r=this._docs.length;n<r;n+=1){const i=this._docs[n];e(i,n)&&(this.removeAt(n),n-=1,r-=1,t.push(i))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){const{includeMatches:n,includeScore:r,shouldSort:i,sortFn:o,ignoreFieldNorm:s}=this.options;let a=jT(e)?jT(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return function(e,{ignoreFieldNorm:t=ZT.ignoreFieldNorm}){e.forEach((e=>{let n=1;e.matches.forEach((({key:e,norm:r,score:i})=>{const o=e?e.weight:null;n*=Math.pow(0===i&&o?Number.EPSILON:i,(o||1)*(t?1:r))})),e.score=n}))}(a,{ignoreFieldNorm:s}),i&&a.sort(o),RT(t)&&t>-1&&(a=a.slice(0,t)),function(e,t,{includeMatches:n=ZT.includeMatches,includeScore:r=ZT.includeScore}={}){const i=[];return n&&i.push(DI),r&&i.push(CI),e.map((e=>{const{idx:n}=e,r={item:t[n],refIndex:n};return i.length&&i.forEach((t=>{t(e,r)})),r}))}(a,this._docs,{includeMatches:n,includeScore:r})}_searchStringList(e){const t=yI(e,this.options),{records:n}=this._myIndex,r=[];return n.forEach((({v:e,i:n,n:i})=>{if(!UT(e))return;const{isMatch:o,score:s,indices:a}=t.searchIn(e);o&&r.push({item:e,idx:n,matches:[{score:s,value:e,norm:i,indices:a}]})})),r}_searchLogical(e){const t=MI(e,this.options),n=(e,t,r)=>{if(!e.children){const{keyId:n,searcher:i}=e,o=this._findMatches({key:this._keyStore.get(n),value:this._myIndex.getValueForItemAtKeyId(t,n),searcher:i});return o&&o.length?[{idx:r,item:t,matches:o}]:[]}const i=[];for(let o=0,s=e.children.length;o<s;o+=1){const s=e.children[o],a=n(s,t,r);if(a.length)i.push(...a);else if(e.operator===vI)return[]}return i},r=this._myIndex.records,i={},o=[];return r.forEach((({$:e,i:r})=>{if(UT(e)){let s=n(t,e,r);s.length&&(i[r]||(i[r]={idx:r,item:e,matches:[]},o.push(i[r])),s.forEach((({matches:e})=>{i[r].matches.push(...e)})))}})),o}_searchObjectList(e){const t=yI(e,this.options),{keys:n,records:r}=this._myIndex,i=[];return r.forEach((({$:e,i:r})=>{if(!UT(e))return;let o=[];n.forEach(((n,r)=>{o.push(...this._findMatches({key:n,value:e[r],searcher:t}))})),o.length&&i.push({idx:r,item:e,matches:o})})),i}_findMatches({key:e,value:t,searcher:n}){if(!UT(t))return[];let r=[];if(LT(t))t.forEach((({v:t,i:i,n:o})=>{if(!UT(t))return;const{isMatch:s,score:a,indices:l}=n.searchIn(t);s&&r.push({score:a,key:e,value:t,idx:i,norm:o,indices:l})}));else{const{v:i,n:o}=t,{isMatch:s,score:a,indices:l}=n.searchIn(i);s&&r.push({score:a,key:e,value:i,norm:o,indices:l})}return r}}SI.version="6.6.2",SI.createIndex=tI,SI.parseIndex=function(e,{getFn:t=ZT.getFn,fieldNormWeight:n=ZT.fieldNormWeight}={}){const{keys:r,records:i}=e,o=new eI({getFn:t,fieldNormWeight:n});return o.setKeys(r),o.setIndexRecords(i),o},SI.config=ZT,SI.parseQuery=MI,function(...e){bI.push(...e)}(gI);const NI=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.sort(((e,t)=>e.name.localeCompare(t.name)))},AI=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=NI(e);return e=>{let{query:n}=e;if(!n)return t.slice(0,10);const r=new SI(t,{keys:["name"],threshold:.25}).search(n).slice(0,10);return me("item",r)}},OI={render:()=>{let e,t;return{onStart:n=>{e=new Wx(IT,{props:n,editor:n.editor}),t=Ox("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){var r;return"Escape"===n.event.key?(t[0].hide(),!0):null===(r=e.ref)||void 0===r?void 0:r.onKeyDown(n)},onExit(){t[0].destroy(),e.destroy()}}}},TI=OT.extend({addCommands(){return{setMention:e=>{let{id:t,label:n}=e;return e=>{let{chain:r}=e;r().focus().insertContent([{type:this.name,attrs:{id:t,label:n}},{type:"text",text:" "}]).run()}}}}});var II=e=>{let{suggestion:t={},...n}=e;return TI.configure({...n,suggestion:{...OI,...t}})};const LI=Av.create({name:"placeholder",addOptions:()=>({excludeNodeTypes:["variable","codeBlock"],emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!1,includeChildren:!1}),addProseMirrorPlugins(){return[new Em({props:{decorations:e=>{let{doc:t,selection:n}=e;const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,o=[];return r?(t.descendants(((e,t)=>{const n=i>=t&&i<=t+e.nodeSize,r=!e.isLeaf&&!e.childCount,s=this.options.excludeNodeTypes.includes(e.type.name);if((n||!this.options.showOnlyCurrent)&&!s&&r){const n=[this.options.emptyNodeClass];this.editor.isEmpty&&n.push(this.options.emptyEditorClass);const r=ay.node(t,t+e.nodeSize,{class:n.join(" "),"data-placeholder":this.options.placeholder});o.push(r)}return this.options.includeChildren})),uy.create(t,o)):null}}})]}});var FI={exports:{}};
35
35
  /**
36
36
  * @license
37
37
  * Lodash <https://lodash.com/>