Files
app/dist/assets/RichEditor-Bfur5pi6.js
2026-03-13 09:19:40 +01:00

50 lines
206 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var ra=Object.defineProperty;var sa=(n,t,e)=>t in n?ra(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var x=(n,t,e)=>sa(n,typeof t!="symbol"?t+"":t,e);import{j as En}from"./vendor-animation-0s3FMHwK.js";import{j as Yt,k as zl,c as de,r as Ue}from"./vendor-react-BVs3cwbi.js";var Kl=typeof global=="object"&&global&&global.Object===Object&&global,ia=typeof self=="object"&&self&&self.Object===Object&&self,kt=Kl||ia||Function("return this")(),ee=kt.Symbol,Gl=Object.prototype,la=Gl.hasOwnProperty,oa=Gl.toString,bn=ee?ee.toStringTag:void 0;function aa(n){var t=la.call(n,bn),e=n[bn];try{n[bn]=void 0;var r=!0}catch{}var s=oa.call(n);return r&&(t?n[bn]=e:delete n[bn]),s}var ca=Object.prototype,ua=ca.toString;function ha(n){return ua.call(n)}var fa="[object Null]",da="[object Undefined]",Ui=ee?ee.toStringTag:void 0;function Xe(n){return n==null?n===void 0?da:fa:Ui&&Ui in Object(n)?aa(n):ha(n)}function Ut(n){return n!=null&&typeof n=="object"}var pe=Array.isArray;function ne(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}function Vl(n){return n}var ga="[object AsyncFunction]",pa="[object Function]",ma="[object GeneratorFunction]",ba="[object Proxy]";function yi(n){if(!ne(n))return!1;var t=Xe(n);return t==pa||t==ma||t==ga||t==ba}var Rs=kt["__core-js_shared__"],Fi=function(){var n=/[^.]+$/.exec(Rs&&Rs.keys&&Rs.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function ya(n){return!!Fi&&Fi in n}var va=Function.prototype,Ea=va.toString;function ye(n){if(n!=null){try{return Ea.call(n)}catch{}try{return n+""}catch{}}return""}var Aa=/[\\^$.*+?()[\]{}|]/g,Na=/^\[object .+?Constructor\]$/,wa=Function.prototype,Ta=Object.prototype,xa=wa.toString,La=Ta.hasOwnProperty,Sa=RegExp("^"+xa.call(La).replace(Aa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function _a(n){if(!ne(n)||ya(n))return!1;var t=yi(n)?Sa:Na;return t.test(ye(n))}function Oa(n,t){return n?.[t]}function ve(n,t){var e=Oa(n,t);return _a(e)?e:void 0}var Gs=ve(kt,"WeakMap"),Hi=Object.create,Ca=function(){function n(){}return function(t){if(!ne(t))return{};if(Hi)return Hi(t);n.prototype=t;var e=new n;return n.prototype=void 0,e}}();function qa(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function Ia(n,t){var e=-1,r=n.length;for(t||(t=Array(r));++e<r;)t[e]=n[e];return t}var Ra=800,ka=16,Ba=Date.now;function Ma(n){var t=0,e=0;return function(){var r=Ba(),s=ka-(r-e);if(e=r,s>0){if(++t>=Ra)return arguments[0]}else t=0;return n.apply(void 0,arguments)}}function Da(n){return function(){return n}}var Ar=function(){try{var n=ve(Object,"defineProperty");return n({},"",{}),n}catch{}}(),ja=Ar?function(n,t){return Ar(n,"toString",{configurable:!0,enumerable:!1,value:Da(t),writable:!0})}:Vl,Pa=Ma(ja);function $a(n,t){for(var e=-1,r=n==null?0:n.length;++e<r&&t(n[e],e,n)!==!1;);return n}var Ua=9007199254740991,Fa=/^(?:0|[1-9]\d*)$/;function Wl(n,t){var e=typeof n;return t=t??Ua,!!t&&(e=="number"||e!="symbol"&&Fa.test(n))&&n>-1&&n%1==0&&n<t}function vi(n,t,e){t=="__proto__"&&Ar?Ar(n,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):n[t]=e}function Rn(n,t){return n===t||n!==n&&t!==t}var Ha=Object.prototype,za=Ha.hasOwnProperty;function Zl(n,t,e){var r=n[t];(!(za.call(n,t)&&Rn(r,e))||e===void 0&&!(t in n))&&vi(n,t,e)}function Ka(n,t,e,r){var s=!e;e||(e={});for(var i=-1,l=t.length;++i<l;){var a=t[i],c=void 0;c===void 0&&(c=n[a]),s?vi(e,a,c):Zl(e,a,c)}return e}var zi=Math.max;function Ga(n,t,e){return t=zi(t===void 0?n.length-1:t,0),function(){for(var r=arguments,s=-1,i=zi(r.length-t,0),l=Array(i);++s<i;)l[s]=r[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=r[s];return a[t]=e(l),qa(n,this,a)}}function Va(n,t){return Pa(Ga(n,t,Vl),n+"")}var Wa=9007199254740991;function Xl(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Wa}function Sr(n){return n!=null&&Xl(n.length)&&!yi(n)}function Za(n,t,e){if(!ne(e))return!1;var r=typeof t;return(r=="number"?Sr(e)&&Wl(t,e.length):r=="string"&&t in e)?Rn(e[t],n):!1}function Xa(n){return Va(function(t,e){var r=-1,s=e.length,i=s>1?e[s-1]:void 0,l=s>2?e[2]:void 0;for(i=n.length>3&&typeof i=="function"?(s--,i):void 0,l&&Za(e[0],e[1],l)&&(i=s<3?void 0:i,s=1),t=Object(t);++r<s;){var a=e[r];a&&n(t,a,r,i)}return t})}var Ya=Object.prototype;function Ei(n){var t=n&&n.constructor,e=typeof t=="function"&&t.prototype||Ya;return n===e}function Qa(n,t){for(var e=-1,r=Array(n);++e<n;)r[e]=t(e);return r}var Ja="[object Arguments]";function Ki(n){return Ut(n)&&Xe(n)==Ja}var Yl=Object.prototype,tc=Yl.hasOwnProperty,ec=Yl.propertyIsEnumerable,Vs=Ki(function(){return arguments}())?Ki:function(n){return Ut(n)&&tc.call(n,"callee")&&!ec.call(n,"callee")};function nc(){return!1}var Ql=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Gi=Ql&&typeof module=="object"&&module&&!module.nodeType&&module,rc=Gi&&Gi.exports===Ql,Vi=rc?kt.Buffer:void 0,sc=Vi?Vi.isBuffer:void 0,xn=sc||nc,ic="[object Arguments]",lc="[object Array]",oc="[object Boolean]",ac="[object Date]",cc="[object Error]",uc="[object Function]",hc="[object Map]",fc="[object Number]",dc="[object Object]",gc="[object RegExp]",pc="[object Set]",mc="[object String]",bc="[object WeakMap]",yc="[object ArrayBuffer]",vc="[object DataView]",Ec="[object Float32Array]",Ac="[object Float64Array]",Nc="[object Int8Array]",wc="[object Int16Array]",Tc="[object Int32Array]",xc="[object Uint8Array]",Lc="[object Uint8ClampedArray]",Sc="[object Uint16Array]",_c="[object Uint32Array]",F={};F[Ec]=F[Ac]=F[Nc]=F[wc]=F[Tc]=F[xc]=F[Lc]=F[Sc]=F[_c]=!0;F[ic]=F[lc]=F[yc]=F[oc]=F[vc]=F[ac]=F[cc]=F[uc]=F[hc]=F[fc]=F[dc]=F[gc]=F[pc]=F[mc]=F[bc]=!1;function Oc(n){return Ut(n)&&Xl(n.length)&&!!F[Xe(n)]}function Ai(n){return function(t){return n(t)}}var Jl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,An=Jl&&typeof module=="object"&&module&&!module.nodeType&&module,Cc=An&&An.exports===Jl,ks=Cc&&Kl.process,Ke=function(){try{var n=An&&An.require&&An.require("util").types;return n||ks&&ks.binding&&ks.binding("util")}catch{}}(),Wi=Ke&&Ke.isTypedArray,Ni=Wi?Ai(Wi):Oc,qc=Object.prototype,Ic=qc.hasOwnProperty;function to(n,t){var e=pe(n),r=!e&&Vs(n),s=!e&&!r&&xn(n),i=!e&&!r&&!s&&Ni(n),l=e||r||s||i,a=l?Qa(n.length,String):[],c=a.length;for(var h in n)(t||Ic.call(n,h))&&!(l&&(h=="length"||s&&(h=="offset"||h=="parent")||i&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||Wl(h,c)))&&a.push(h);return a}function eo(n,t){return function(e){return n(t(e))}}var Rc=eo(Object.keys,Object),kc=Object.prototype,Bc=kc.hasOwnProperty;function Mc(n){if(!Ei(n))return Rc(n);var t=[];for(var e in Object(n))Bc.call(n,e)&&e!="constructor"&&t.push(e);return t}function Dc(n){return Sr(n)?to(n):Mc(n)}function jc(n){var t=[];if(n!=null)for(var e in Object(n))t.push(e);return t}var Pc=Object.prototype,$c=Pc.hasOwnProperty;function Uc(n){if(!ne(n))return jc(n);var t=Ei(n),e=[];for(var r in n)r=="constructor"&&(t||!$c.call(n,r))||e.push(r);return e}function no(n){return Sr(n)?to(n,!0):Uc(n)}var Ln=ve(Object,"create");function Fc(){this.__data__=Ln?Ln(null):{},this.size=0}function Hc(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t}var zc="__lodash_hash_undefined__",Kc=Object.prototype,Gc=Kc.hasOwnProperty;function Vc(n){var t=this.__data__;if(Ln){var e=t[n];return e===zc?void 0:e}return Gc.call(t,n)?t[n]:void 0}var Wc=Object.prototype,Zc=Wc.hasOwnProperty;function Xc(n){var t=this.__data__;return Ln?t[n]!==void 0:Zc.call(t,n)}var Yc="__lodash_hash_undefined__";function Qc(n,t){var e=this.__data__;return this.size+=this.has(n)?0:1,e[n]=Ln&&t===void 0?Yc:t,this}function me(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}me.prototype.clear=Fc;me.prototype.delete=Hc;me.prototype.get=Vc;me.prototype.has=Xc;me.prototype.set=Qc;function Jc(){this.__data__=[],this.size=0}function _r(n,t){for(var e=n.length;e--;)if(Rn(n[e][0],t))return e;return-1}var tu=Array.prototype,eu=tu.splice;function nu(n){var t=this.__data__,e=_r(t,n);if(e<0)return!1;var r=t.length-1;return e==r?t.pop():eu.call(t,e,1),--this.size,!0}function ru(n){var t=this.__data__,e=_r(t,n);return e<0?void 0:t[e][1]}function su(n){return _r(this.__data__,n)>-1}function iu(n,t){var e=this.__data__,r=_r(e,n);return r<0?(++this.size,e.push([n,t])):e[r][1]=t,this}function zt(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}zt.prototype.clear=Jc;zt.prototype.delete=nu;zt.prototype.get=ru;zt.prototype.has=su;zt.prototype.set=iu;var Sn=ve(kt,"Map");function lu(){this.size=0,this.__data__={hash:new me,map:new(Sn||zt),string:new me}}function ou(n){var t=typeof n;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?n!=="__proto__":n===null}function Or(n,t){var e=n.__data__;return ou(t)?e[typeof t=="string"?"string":"hash"]:e.map}function au(n){var t=Or(this,n).delete(n);return this.size-=t?1:0,t}function cu(n){return Or(this,n).get(n)}function uu(n){return Or(this,n).has(n)}function hu(n,t){var e=Or(this,n),r=e.size;return e.set(n,t),this.size+=e.size==r?0:1,this}function Ee(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}Ee.prototype.clear=lu;Ee.prototype.delete=au;Ee.prototype.get=cu;Ee.prototype.has=uu;Ee.prototype.set=hu;function fu(n,t){for(var e=-1,r=t.length,s=n.length;++e<r;)n[s+e]=t[e];return n}var ro=eo(Object.getPrototypeOf,Object),du="[object Object]",gu=Function.prototype,pu=Object.prototype,so=gu.toString,mu=pu.hasOwnProperty,bu=so.call(Object);function yu(n){if(!Ut(n)||Xe(n)!=du)return!1;var t=ro(n);if(t===null)return!0;var e=mu.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&so.call(e)==bu}function vu(){this.__data__=new zt,this.size=0}function Eu(n){var t=this.__data__,e=t.delete(n);return this.size=t.size,e}function Au(n){return this.__data__.get(n)}function Nu(n){return this.__data__.has(n)}var wu=200;function Tu(n,t){var e=this.__data__;if(e instanceof zt){var r=e.__data__;if(!Sn||r.length<wu-1)return r.push([n,t]),this.size=++e.size,this;e=this.__data__=new Ee(r)}return e.set(n,t),this.size=e.size,this}function Ct(n){var t=this.__data__=new zt(n);this.size=t.size}Ct.prototype.clear=vu;Ct.prototype.delete=Eu;Ct.prototype.get=Au;Ct.prototype.has=Nu;Ct.prototype.set=Tu;var io=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Zi=io&&typeof module=="object"&&module&&!module.nodeType&&module,xu=Zi&&Zi.exports===io,Xi=xu?kt.Buffer:void 0,Yi=Xi?Xi.allocUnsafe:void 0;function lo(n,t){if(t)return n.slice();var e=n.length,r=Yi?Yi(e):new n.constructor(e);return n.copy(r),r}function Lu(n,t){for(var e=-1,r=n==null?0:n.length,s=0,i=[];++e<r;){var l=n[e];t(l,e,n)&&(i[s++]=l)}return i}function Su(){return[]}var _u=Object.prototype,Ou=_u.propertyIsEnumerable,Qi=Object.getOwnPropertySymbols,Cu=Qi?function(n){return n==null?[]:(n=Object(n),Lu(Qi(n),function(t){return Ou.call(n,t)}))}:Su;function qu(n,t,e){var r=t(n);return pe(n)?r:fu(r,e(n))}function Ws(n){return qu(n,Dc,Cu)}var Zs=ve(kt,"DataView"),Xs=ve(kt,"Promise"),Ys=ve(kt,"Set"),Ji="[object Map]",Iu="[object Object]",tl="[object Promise]",el="[object Set]",nl="[object WeakMap]",rl="[object DataView]",Ru=ye(Zs),ku=ye(Sn),Bu=ye(Xs),Mu=ye(Ys),Du=ye(Gs),yt=Xe;(Zs&&yt(new Zs(new ArrayBuffer(1)))!=rl||Sn&&yt(new Sn)!=Ji||Xs&&yt(Xs.resolve())!=tl||Ys&&yt(new Ys)!=el||Gs&&yt(new Gs)!=nl)&&(yt=function(n){var t=Xe(n),e=t==Iu?n.constructor:void 0,r=e?ye(e):"";if(r)switch(r){case Ru:return rl;case ku:return Ji;case Bu:return tl;case Mu:return el;case Du:return nl}return t});var ju=Object.prototype,Pu=ju.hasOwnProperty;function $u(n){var t=n.length,e=new n.constructor(t);return t&&typeof n[0]=="string"&&Pu.call(n,"index")&&(e.index=n.index,e.input=n.input),e}var Nr=kt.Uint8Array;function wi(n){var t=new n.constructor(n.byteLength);return new Nr(t).set(new Nr(n)),t}function Uu(n,t){var e=wi(n.buffer);return new n.constructor(e,n.byteOffset,n.byteLength)}var Fu=/\w*$/;function Hu(n){var t=new n.constructor(n.source,Fu.exec(n));return t.lastIndex=n.lastIndex,t}var sl=ee?ee.prototype:void 0,il=sl?sl.valueOf:void 0;function zu(n){return il?Object(il.call(n)):{}}function oo(n,t){var e=t?wi(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}var Ku="[object Boolean]",Gu="[object Date]",Vu="[object Map]",Wu="[object Number]",Zu="[object RegExp]",Xu="[object Set]",Yu="[object String]",Qu="[object Symbol]",Ju="[object ArrayBuffer]",th="[object DataView]",eh="[object Float32Array]",nh="[object Float64Array]",rh="[object Int8Array]",sh="[object Int16Array]",ih="[object Int32Array]",lh="[object Uint8Array]",oh="[object Uint8ClampedArray]",ah="[object Uint16Array]",ch="[object Uint32Array]";function uh(n,t,e){var r=n.constructor;switch(t){case Ju:return wi(n);case Ku:case Gu:return new r(+n);case th:return Uu(n);case eh:case nh:case rh:case sh:case ih:case lh:case oh:case ah:case ch:return oo(n,e);case Vu:return new r;case Wu:case Yu:return new r(n);case Zu:return Hu(n);case Xu:return new r;case Qu:return zu(n)}}function ao(n){return typeof n.constructor=="function"&&!Ei(n)?Ca(ro(n)):{}}var hh="[object Map]";function fh(n){return Ut(n)&&yt(n)==hh}var ll=Ke&&Ke.isMap,dh=ll?Ai(ll):fh,gh="[object Set]";function ph(n){return Ut(n)&&yt(n)==gh}var ol=Ke&&Ke.isSet,mh=ol?Ai(ol):ph,bh=1,co="[object Arguments]",yh="[object Array]",vh="[object Boolean]",Eh="[object Date]",Ah="[object Error]",uo="[object Function]",Nh="[object GeneratorFunction]",wh="[object Map]",Th="[object Number]",ho="[object Object]",xh="[object RegExp]",Lh="[object Set]",Sh="[object String]",_h="[object Symbol]",Oh="[object WeakMap]",Ch="[object ArrayBuffer]",qh="[object DataView]",Ih="[object Float32Array]",Rh="[object Float64Array]",kh="[object Int8Array]",Bh="[object Int16Array]",Mh="[object Int32Array]",Dh="[object Uint8Array]",jh="[object Uint8ClampedArray]",Ph="[object Uint16Array]",$h="[object Uint32Array]",$={};$[co]=$[yh]=$[Ch]=$[qh]=$[vh]=$[Eh]=$[Ih]=$[Rh]=$[kh]=$[Bh]=$[Mh]=$[wh]=$[Th]=$[ho]=$[xh]=$[Lh]=$[Sh]=$[_h]=$[Dh]=$[jh]=$[Ph]=$[$h]=!0;$[Ah]=$[uo]=$[Oh]=!1;function yr(n,t,e,r,s,i){var l,a=t&bh;if(l!==void 0)return l;if(!ne(n))return n;var c=pe(n);if(c)l=$u(n);else{var h=yt(n),f=h==uo||h==Nh;if(xn(n))return lo(n,a);if(h==ho||h==co||f&&!s)l=f?{}:ao(n);else{if(!$[h])return s?n:{};l=uh(n,h,a)}}i||(i=new Ct);var b=i.get(n);if(b)return b;i.set(n,l),mh(n)?n.forEach(function(m){l.add(yr(m,t,e,m,n,i))}):dh(n)&&n.forEach(function(m,y){l.set(y,yr(m,t,e,y,n,i))});var g=Ws,p=c?void 0:g(n);return $a(p||n,function(m,y){p&&(y=m,m=n[y]),Zl(l,y,yr(m,t,e,y,n,i))}),l}var Uh=1,Fh=4;function Fe(n){return yr(n,Uh|Fh)}var Hh="__lodash_hash_undefined__";function zh(n){return this.__data__.set(n,Hh),this}function Kh(n){return this.__data__.has(n)}function wr(n){var t=-1,e=n==null?0:n.length;for(this.__data__=new Ee;++t<e;)this.add(n[t])}wr.prototype.add=wr.prototype.push=zh;wr.prototype.has=Kh;function Gh(n,t){for(var e=-1,r=n==null?0:n.length;++e<r;)if(t(n[e],e,n))return!0;return!1}function Vh(n,t){return n.has(t)}var Wh=1,Zh=2;function fo(n,t,e,r,s,i){var l=e&Wh,a=n.length,c=t.length;if(a!=c&&!(l&&c>a))return!1;var h=i.get(n),f=i.get(t);if(h&&f)return h==t&&f==n;var b=-1,g=!0,p=e&Zh?new wr:void 0;for(i.set(n,t),i.set(t,n);++b<a;){var m=n[b],y=t[b];if(r)var E=l?r(y,m,b,t,n,i):r(m,y,b,n,t,i);if(E!==void 0){if(E)continue;g=!1;break}if(p){if(!Gh(t,function(A,w){if(!Vh(p,w)&&(m===A||s(m,A,e,r,i)))return p.push(w)})){g=!1;break}}else if(!(m===y||s(m,y,e,r,i))){g=!1;break}}return i.delete(n),i.delete(t),g}function Xh(n){var t=-1,e=Array(n.size);return n.forEach(function(r,s){e[++t]=[s,r]}),e}function Yh(n){var t=-1,e=Array(n.size);return n.forEach(function(r){e[++t]=r}),e}var Qh=1,Jh=2,tf="[object Boolean]",ef="[object Date]",nf="[object Error]",rf="[object Map]",sf="[object Number]",lf="[object RegExp]",of="[object Set]",af="[object String]",cf="[object Symbol]",uf="[object ArrayBuffer]",hf="[object DataView]",al=ee?ee.prototype:void 0,Bs=al?al.valueOf:void 0;function ff(n,t,e,r,s,i,l){switch(e){case hf:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return!1;n=n.buffer,t=t.buffer;case uf:return!(n.byteLength!=t.byteLength||!i(new Nr(n),new Nr(t)));case tf:case ef:case sf:return Rn(+n,+t);case nf:return n.name==t.name&&n.message==t.message;case lf:case af:return n==t+"";case rf:var a=Xh;case of:var c=r&Qh;if(a||(a=Yh),n.size!=t.size&&!c)return!1;var h=l.get(n);if(h)return h==t;r|=Jh,l.set(n,t);var f=fo(a(n),a(t),r,s,i,l);return l.delete(n),f;case cf:if(Bs)return Bs.call(n)==Bs.call(t)}return!1}var df=1,gf=Object.prototype,pf=gf.hasOwnProperty;function mf(n,t,e,r,s,i){var l=e&df,a=Ws(n),c=a.length,h=Ws(t),f=h.length;if(c!=f&&!l)return!1;for(var b=c;b--;){var g=a[b];if(!(l?g in t:pf.call(t,g)))return!1}var p=i.get(n),m=i.get(t);if(p&&m)return p==t&&m==n;var y=!0;i.set(n,t),i.set(t,n);for(var E=l;++b<c;){g=a[b];var A=n[g],w=t[g];if(r)var T=l?r(w,A,g,t,n,i):r(A,w,g,n,t,i);if(!(T===void 0?A===w||s(A,w,e,r,i):T)){y=!1;break}E||(E=g=="constructor")}if(y&&!E){var _=n.constructor,L=t.constructor;_!=L&&"constructor"in n&&"constructor"in t&&!(typeof _=="function"&&_ instanceof _&&typeof L=="function"&&L instanceof L)&&(y=!1)}return i.delete(n),i.delete(t),y}var bf=1,cl="[object Arguments]",ul="[object Array]",fr="[object Object]",yf=Object.prototype,hl=yf.hasOwnProperty;function vf(n,t,e,r,s,i){var l=pe(n),a=pe(t),c=l?ul:yt(n),h=a?ul:yt(t);c=c==cl?fr:c,h=h==cl?fr:h;var f=c==fr,b=h==fr,g=c==h;if(g&&xn(n)){if(!xn(t))return!1;l=!0,f=!1}if(g&&!f)return i||(i=new Ct),l||Ni(n)?fo(n,t,e,r,s,i):ff(n,t,c,e,r,s,i);if(!(e&bf)){var p=f&&hl.call(n,"__wrapped__"),m=b&&hl.call(t,"__wrapped__");if(p||m){var y=p?n.value():n,E=m?t.value():t;return i||(i=new Ct),s(y,E,e,r,i)}}return g?(i||(i=new Ct),mf(n,t,e,r,s,i)):!1}function go(n,t,e,r,s){return n===t?!0:n==null||t==null||!Ut(n)&&!Ut(t)?n!==n&&t!==t:vf(n,t,e,r,go,s)}function Ef(n){return function(t,e,r){for(var s=-1,i=Object(t),l=r(t),a=l.length;a--;){var c=l[++s];if(e(i[c],c,i)===!1)break}return t}}var Af=Ef();function Qs(n,t,e){(e!==void 0&&!Rn(n[t],e)||e===void 0&&!(t in n))&&vi(n,t,e)}function Nf(n){return Ut(n)&&Sr(n)}function Js(n,t){if(!(t==="constructor"&&typeof n[t]=="function")&&t!="__proto__")return n[t]}function wf(n){return Ka(n,no(n))}function Tf(n,t,e,r,s,i,l){var a=Js(n,e),c=Js(t,e),h=l.get(c);if(h){Qs(n,e,h);return}var f=i?i(a,c,e+"",n,t,l):void 0,b=f===void 0;if(b){var g=pe(c),p=!g&&xn(c),m=!g&&!p&&Ni(c);f=c,g||p||m?pe(a)?f=a:Nf(a)?f=Ia(a):p?(b=!1,f=lo(c,!0)):m?(b=!1,f=oo(c,!0)):f=[]:yu(c)||Vs(c)?(f=a,Vs(a)?f=wf(a):(!ne(a)||yi(a))&&(f=ao(c))):b=!1}b&&(l.set(c,f),s(f,c,r,i,l),l.delete(c)),Qs(n,e,f)}function po(n,t,e,r,s){n!==t&&Af(t,function(i,l){if(s||(s=new Ct),ne(i))Tf(n,t,l,e,po,r,s);else{var a=r?r(Js(n,l),i,l+"",n,t,s):void 0;a===void 0&&(a=i),Qs(n,l,a)}},no)}function Xt(n,t){return go(n,t)}var te=Xa(function(n,t,e){po(n,t,e)}),C=(n=>(n[n.TYPE=3]="TYPE",n[n.LEVEL=12]="LEVEL",n[n.ATTRIBUTE=13]="ATTRIBUTE",n[n.BLOT=14]="BLOT",n[n.INLINE=7]="INLINE",n[n.BLOCK=11]="BLOCK",n[n.BLOCK_BLOT=10]="BLOCK_BLOT",n[n.INLINE_BLOT=6]="INLINE_BLOT",n[n.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",n[n.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",n[n.ANY=15]="ANY",n))(C||{});class It{constructor(t,e,r={}){this.attrName=t,this.keyName=e;const s=C.TYPE&C.ATTRIBUTE;this.scope=r.scope!=null?r.scope&C.LEVEL|s:C.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(t){return Array.from(t.attributes).map(e=>e.name)}add(t,e){return this.canAdd(t,e)?(t.setAttribute(this.keyName,e),!0):!1}canAdd(t,e){return this.whitelist==null?!0:typeof e=="string"?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1}remove(t){t.removeAttribute(this.keyName)}value(t){const e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""}}class He extends Error{constructor(t){t="[Parchment] "+t,super(t),this.message=t,this.name=this.constructor.name}}const mo=class ti{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(t,e=!1){if(t==null)return null;if(this.blots.has(t))return this.blots.get(t)||null;if(e){let r=null;try{r=t.parentNode}catch{return null}return this.find(r,e)}return null}create(t,e,r){const s=this.query(e);if(s==null)throw new He(`Unable to create ${e} blot`);const i=s,l=e instanceof Node||e.nodeType===Node.TEXT_NODE?e:i.create(r),a=new i(t,l,r);return ti.blots.set(a.domNode,a),a}find(t,e=!1){return ti.find(t,e)}query(t,e=C.ANY){let r;return typeof t=="string"?r=this.types[t]||this.attributes[t]:t instanceof Text||t.nodeType===Node.TEXT_NODE?r=this.types.text:typeof t=="number"?t&C.LEVEL&C.BLOCK?r=this.types.block:t&C.LEVEL&C.INLINE&&(r=this.types.inline):t instanceof Element&&((t.getAttribute("class")||"").split(/\s+/).some(s=>(r=this.classes[s],!!r)),r=r||this.tags[t.tagName]),r==null?null:"scope"in r&&e&C.LEVEL&r.scope&&e&C.TYPE&r.scope?r:null}register(...t){return t.map(e=>{const r="blotName"in e,s="attrName"in e;if(!r&&!s)throw new He("Invalid definition");if(r&&e.blotName==="abstract")throw new He("Cannot register abstract class");const i=r?e.blotName:s?e.attrName:void 0;return this.types[i]=e,s?typeof e.keyName=="string"&&(this.attributes[e.keyName]=e):r&&(e.className&&(this.classes[e.className]=e),e.tagName&&(Array.isArray(e.tagName)?e.tagName=e.tagName.map(l=>l.toUpperCase()):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach(l=>{(this.tags[l]==null||e.className==null)&&(this.tags[l]=e)}))),e})}};mo.blots=new WeakMap;let Ge=mo;function fl(n,t){return(n.getAttribute("class")||"").split(/\s+/).filter(e=>e.indexOf(`${t}-`)===0)}class xf extends It{static keys(t){return(t.getAttribute("class")||"").split(/\s+/).map(e=>e.split("-").slice(0,-1).join("-"))}add(t,e){return this.canAdd(t,e)?(this.remove(t),t.classList.add(`${this.keyName}-${e}`),!0):!1}remove(t){fl(t,this.keyName).forEach(e=>{t.classList.remove(e)}),t.classList.length===0&&t.removeAttribute("class")}value(t){const e=(fl(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""}}const Nt=xf;function Ms(n){const t=n.split("-"),e=t.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return t[0]+e}class Lf extends It{static keys(t){return(t.getAttribute("style")||"").split(";").map(e=>e.split(":")[0].trim())}add(t,e){return this.canAdd(t,e)?(t.style[Ms(this.keyName)]=e,!0):!1}remove(t){t.style[Ms(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const e=t.style[Ms(this.keyName)];return this.canAdd(t,e)?e:""}}const re=Lf;class Sf{constructor(t){this.attributes={},this.domNode=t,this.build()}attribute(t,e){e?t.add(this.domNode,e)&&(t.value(this.domNode)!=null?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])}build(){this.attributes={};const t=Ge.find(this.domNode);if(t==null)return;const e=It.keys(this.domNode),r=Nt.keys(this.domNode),s=re.keys(this.domNode);e.concat(r).concat(s).forEach(i=>{const l=t.scroll.query(i,C.ATTRIBUTE);l instanceof It&&(this.attributes[l.attrName]=l)})}copy(t){Object.keys(this.attributes).forEach(e=>{const r=this.attributes[e].value(this.domNode);t.format(e,r)})}move(t){this.copy(t),Object.keys(this.attributes).forEach(e=>{this.attributes[e].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((t,e)=>(t[e]=this.attributes[e].value(this.domNode),t),{})}}const Cr=Sf,bo=class{constructor(t,e){this.scroll=t,this.domNode=e,Ge.blots.set(e,this),this.prev=null,this.next=null}static create(t){if(this.tagName==null)throw new He("Blot definition missing tagName");let e,r;return Array.isArray(this.tagName)?(typeof t=="string"?(r=t.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof t=="number"&&(r=t),typeof r=="number"?e=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?e=document.createElement(r):e=document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e}get statics(){return this.constructor}attach(){}clone(){const t=this.domNode.cloneNode(!1);return this.scroll.create(t)}detach(){this.parent!=null&&this.parent.removeChild(this),Ge.blots.delete(this.domNode)}deleteAt(t,e){this.isolate(t,e).remove()}formatAt(t,e,r,s){const i=this.isolate(t,e);if(this.scroll.query(r,C.BLOT)!=null&&s)i.wrap(r,s);else if(this.scroll.query(r,C.ATTRIBUTE)!=null){const l=this.scroll.create(this.statics.scope);i.wrap(l),l.format(r,s)}}insertAt(t,e,r){const s=r==null?this.scroll.create("text",e):this.scroll.create(e,r),i=this.split(t);this.parent.insertBefore(s,i||void 0)}isolate(t,e){const r=this.split(t);if(r==null)throw new Error("Attempt to isolate at end");return r.split(e),r}length(){return 1}offset(t=this.parent){return this.parent==null||this===t?0:this.parent.children.offset(this)+this.parent.offset(t)}optimize(t){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(t,e){const r=typeof t=="string"?this.scroll.create(t,e):t;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(t,e){return t===0?this:this.next}update(t,e){}wrap(t,e){const r=typeof t=="string"?this.scroll.create(t,e):t;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new He(`Cannot wrap ${t}`);return r.appendChild(this),r}};bo.blotName="abstract";let yo=bo;const vo=class extends yo{static value(t){return!0}index(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1}position(t,e){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return t>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};vo.scope=C.INLINE_BLOT;let _f=vo;const Q=_f;class Of{constructor(){this.head=null,this.tail=null,this.length=0}append(...t){if(this.insertBefore(t[0],null),t.length>1){const e=t.slice(1);this.append(...e)}}at(t){const e=this.iterator();let r=e();for(;r&&t>0;)t-=1,r=e();return r}contains(t){const e=this.iterator();let r=e();for(;r;){if(r===t)return!0;r=e()}return!1}indexOf(t){const e=this.iterator();let r=e(),s=0;for(;r;){if(r===t)return s;s+=1,r=e()}return-1}insertBefore(t,e){t!=null&&(this.remove(t),t.next=e,e!=null?(t.prev=e.prev,e.prev!=null&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):this.tail!=null?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)}offset(t){let e=0,r=this.head;for(;r!=null;){if(r===t)return e;e+=r.length(),r=r.next}return-1}remove(t){this.contains(t)&&(t.prev!=null&&(t.prev.next=t.next),t.next!=null&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)}iterator(t=this.head){return()=>{const e=t;return t!=null&&(t=t.next),e}}find(t,e=!1){const r=this.iterator();let s=r();for(;s;){const i=s.length();if(t<i||e&&t===i&&(s.next==null||s.next.length()!==0))return[s,t];t-=i,s=r()}return[null,0]}forEach(t){const e=this.iterator();let r=e();for(;r;)t(r),r=e()}forEachAt(t,e,r){if(e<=0)return;const[s,i]=this.find(t);let l=t-i;const a=this.iterator(s);let c=a();for(;c&&l<t+e;){const h=c.length();t>l?r(c,t-l,Math.min(e,l+h-t)):r(c,0,Math.min(h,t+e-l)),l+=h,c=a()}}map(t){return this.reduce((e,r)=>(e.push(t(r)),e),[])}reduce(t,e){const r=this.iterator();let s=r();for(;s;)e=t(e,s),s=r();return e}}function dl(n,t){const e=t.find(n);if(e)return e;try{return t.create(n)}catch{const r=t.create(C.INLINE);return Array.from(n.childNodes).forEach(s=>{r.domNode.appendChild(s)}),n.parentNode&&n.parentNode.replaceChild(r.domNode,n),r.attach(),r}}const Eo=class Zt extends yo{constructor(t,e){super(t,e),this.uiNode=null,this.build()}appendChild(t){this.insertBefore(t)}attach(){super.attach(),this.children.forEach(t=>{t.attach()})}attachUI(t){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=t,Zt.uiClass&&this.uiNode.classList.add(Zt.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new Of,Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode).reverse().forEach(t=>{try{const e=dl(t,this.scroll);this.insertBefore(e,this.children.head||void 0)}catch(e){if(e instanceof He)return;throw e}})}deleteAt(t,e){if(t===0&&e===this.length())return this.remove();this.children.forEachAt(t,e,(r,s,i)=>{r.deleteAt(s,i)})}descendant(t,e=0){const[r,s]=this.children.find(e);return t.blotName==null&&t(r)||t.blotName!=null&&r instanceof t?[r,s]:r instanceof Zt?r.descendant(t,s):[null,-1]}descendants(t,e=0,r=Number.MAX_VALUE){let s=[],i=r;return this.children.forEachAt(e,r,(l,a,c)=>{(t.blotName==null&&t(l)||t.blotName!=null&&l instanceof t)&&s.push(l),l instanceof Zt&&(s=s.concat(l.descendants(t,a,i))),i-=c}),s}detach(){this.children.forEach(t=>{t.detach()}),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach(e=>{t||this.statics.allowedChildren.some(r=>e instanceof r)||(e.statics.scope===C.BLOCK_BLOT?(e.next!=null&&this.splitAfter(e),e.prev!=null&&this.splitAfter(e.prev),e.parent.unwrap(),t=!0):e instanceof Zt?e.unwrap():e.remove())})}formatAt(t,e,r,s){this.children.forEachAt(t,e,(i,l,a)=>{i.formatAt(l,a,r,s)})}insertAt(t,e,r){const[s,i]=this.children.find(t);if(s)s.insertAt(i,e,r);else{const l=r==null?this.scroll.create("text",e):this.scroll.create(e,r);this.appendChild(l)}}insertBefore(t,e){t.parent!=null&&t.parent.children.remove(t);let r=null;this.children.insertBefore(t,e||null),t.parent=this,e!=null&&(r=e.domNode),(this.domNode.parentNode!==t.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(t.domNode,r),t.attach()}length(){return this.children.reduce((t,e)=>t+e.length(),0)}moveChildren(t,e){this.children.forEach(r=>{t.insertBefore(r,e)})}optimize(t){if(super.optimize(t),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove()}path(t,e=!1){const[r,s]=this.children.find(t,e),i=[[this,t]];return r instanceof Zt?i.concat(r.path(s,e)):(r!=null&&i.push([r,s]),i)}removeChild(t){this.children.remove(t)}replaceWith(t,e){const r=typeof t=="string"?this.scroll.create(t,e):t;return r instanceof Zt&&this.moveChildren(r),super.replaceWith(r)}split(t,e=!1){if(!e){if(t===0)return this;if(t===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(t,this.length(),(s,i,l)=>{const a=s.split(i,e);a!=null&&r.appendChild(a)}),r}splitAfter(t){const e=this.clone();for(;t.next!=null;)e.appendChild(t.next);return this.parent&&this.parent.insertBefore(e,this.next||void 0),e}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(t,e){const r=[],s=[];t.forEach(i=>{i.target===this.domNode&&i.type==="childList"&&(r.push(...i.addedNodes),s.push(...i.removedNodes))}),s.forEach(i=>{if(i.parentNode!=null&&i.tagName!=="IFRAME"&&document.body.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const l=this.scroll.find(i);l!=null&&(l.domNode.parentNode==null||l.domNode.parentNode===this.domNode)&&l.detach()}),r.filter(i=>i.parentNode===this.domNode&&i!==this.uiNode).sort((i,l)=>i===l?0:i.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(i=>{let l=null;i.nextSibling!=null&&(l=this.scroll.find(i.nextSibling));const a=dl(i,this.scroll);(a.next!==l||a.next==null)&&(a.parent!=null&&a.parent.removeChild(this),this.insertBefore(a,l||void 0))}),this.enforceAllowedChildren()}};Eo.uiClass="";let Cf=Eo;const Et=Cf;function qf(n,t){if(Object.keys(n).length!==Object.keys(t).length)return!1;for(const e in n)if(n[e]!==t[e])return!1;return!0}const Be=class Me extends Et{static create(t){return super.create(t)}static formats(t,e){const r=e.query(Me.blotName);if(!(r!=null&&t.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new Cr(this.domNode)}format(t,e){if(t===this.statics.blotName&&!e)this.children.forEach(r=>{r instanceof Me||(r=r.wrap(Me.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(t,C.INLINE);if(r==null)return;r instanceof It?this.attributes.attribute(r,e):e&&(t!==this.statics.blotName||this.formats()[t]!==e)&&this.replaceWith(t,e)}}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return e!=null&&(t[this.statics.blotName]=e),t}formatAt(t,e,r,s){this.formats()[r]!=null||this.scroll.query(r,C.ATTRIBUTE)?this.isolate(t,e).format(r,s):super.formatAt(t,e,r,s)}optimize(t){super.optimize(t);const e=this.formats();if(Object.keys(e).length===0)return this.unwrap();const r=this.next;r instanceof Me&&r.prev===this&&qf(e,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(t,e){const r=super.replaceWith(t,e);return this.attributes.copy(r),r}update(t,e){super.update(t,e),t.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(t,e){const r=super.wrap(t,e);return r instanceof Me&&this.attributes.move(r),r}};Be.allowedChildren=[Be,Q],Be.blotName="inline",Be.scope=C.INLINE_BLOT,Be.tagName="SPAN";let If=Be;const Ti=If,De=class ei extends Et{static create(t){return super.create(t)}static formats(t,e){const r=e.query(ei.blotName);if(!(r!=null&&t.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new Cr(this.domNode)}format(t,e){const r=this.scroll.query(t,C.BLOCK);r!=null&&(r instanceof It?this.attributes.attribute(r,e):t===this.statics.blotName&&!e?this.replaceWith(ei.blotName):e&&(t!==this.statics.blotName||this.formats()[t]!==e)&&this.replaceWith(t,e))}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return e!=null&&(t[this.statics.blotName]=e),t}formatAt(t,e,r,s){this.scroll.query(r,C.BLOCK)!=null?this.format(r,s):super.formatAt(t,e,r,s)}insertAt(t,e,r){if(r==null||this.scroll.query(e,C.INLINE)!=null)super.insertAt(t,e,r);else{const s=this.split(t);if(s!=null){const i=this.scroll.create(e,r);s.parent.insertBefore(i,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(t,e){const r=super.replaceWith(t,e);return this.attributes.copy(r),r}update(t,e){super.update(t,e),t.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};De.blotName="block",De.scope=C.BLOCK_BLOT,De.tagName="P",De.allowedChildren=[Ti,De,Q];let Rf=De;const _n=Rf,ni=class extends Et{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(t,e){super.deleteAt(t,e),this.enforceAllowedChildren()}formatAt(t,e,r,s){super.formatAt(t,e,r,s),this.enforceAllowedChildren()}insertAt(t,e,r){super.insertAt(t,e,r),this.enforceAllowedChildren()}optimize(t){super.optimize(t),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};ni.blotName="container",ni.scope=C.BLOCK_BLOT;let kf=ni;const qr=kf;class Bf extends Q{static formats(t,e){}format(t,e){super.formatAt(0,this.length(),t,e)}formatAt(t,e,r,s){t===0&&e===this.length()?this.format(r,s):super.formatAt(t,e,r,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const lt=Bf,Mf={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},Df=100,je=class extends Et{constructor(t,e){super(null,e),this.registry=t,this.scroll=this,this.build(),this.observer=new MutationObserver(r=>{this.update(r)}),this.observer.observe(this.domNode,Mf),this.attach()}create(t,e){return this.registry.create(this,t,e)}find(t,e=!1){const r=this.registry.find(t,e);return r?r.scroll===this?r:e?this.find(r.scroll.domNode.parentNode,!0):null:null}query(t,e=C.ANY){return this.registry.query(t,e)}register(...t){return this.registry.register(...t)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(t,e){this.update(),t===0&&e===this.length()?this.children.forEach(r=>{r.remove()}):super.deleteAt(t,e)}formatAt(t,e,r,s){this.update(),super.formatAt(t,e,r,s)}insertAt(t,e,r){this.update(),super.insertAt(t,e,r)}optimize(t=[],e={}){super.optimize(e);const r=e.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)t.push(s.pop());const i=(c,h=!0)=>{c==null||c===this||c.domNode.parentNode!=null&&(r.has(c.domNode)||r.set(c.domNode,[]),h&&i(c.parent))},l=c=>{r.has(c.domNode)&&(c instanceof Et&&c.children.forEach(l),r.delete(c.domNode),c.optimize(e))};let a=t;for(let c=0;a.length>0;c+=1){if(c>=Df)throw new Error("[Parchment] Maximum optimize iterations reached");for(a.forEach(h=>{const f=this.find(h.target,!0);f!=null&&(f.domNode===h.target&&(h.type==="childList"?(i(this.find(h.previousSibling,!1)),Array.from(h.addedNodes).forEach(b=>{const g=this.find(b,!1);i(g,!1),g instanceof Et&&g.children.forEach(p=>{i(p,!1)})})):h.type==="attributes"&&i(f.prev)),i(f))}),this.children.forEach(l),a=Array.from(this.observer.takeRecords()),s=a.slice();s.length>0;)t.push(s.pop())}}update(t,e={}){t=t||this.observer.takeRecords();const r=new WeakMap;t.map(s=>{const i=this.find(s.target,!0);return i==null?null:r.has(i.domNode)?(r.get(i.domNode).push(s),null):(r.set(i.domNode,[s]),i)}).forEach(s=>{s!=null&&s!==this&&r.has(s.domNode)&&s.update(r.get(s.domNode)||[],e)}),e.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),e),this.optimize(t,e)}};je.blotName="scroll",je.defaultChild=_n,je.allowedChildren=[_n,qr],je.scope=C.BLOCK_BLOT,je.tagName="DIV";let jf=je;const xi=jf,ri=class Ao extends Q{static create(t){return document.createTextNode(t)}static value(t){return t.data}constructor(t,e){super(t,e),this.text=this.statics.value(this.domNode)}deleteAt(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)}index(t,e){return this.domNode===t?e:-1}insertAt(t,e,r){r==null?(this.text=this.text.slice(0,t)+e+this.text.slice(t),this.domNode.data=this.text):super.insertAt(t,e,r)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof Ao&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(t,e=!1){return[this.domNode,t]}split(t,e=!1){if(!e){if(t===0)return this;if(t===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(t));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(t,e){t.some(r=>r.type==="characterData"&&r.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};ri.blotName="text",ri.scope=C.INLINE_BLOT;let Pf=ri;const Tr=Pf,$f=Object.freeze(Object.defineProperty({__proto__:null,Attributor:It,AttributorStore:Cr,BlockBlot:_n,ClassAttributor:Nt,ContainerBlot:qr,EmbedBlot:lt,InlineBlot:Ti,LeafBlot:Q,ParentBlot:Et,Registry:Ge,Scope:C,ScrollBlot:xi,StyleAttributor:re,TextBlot:Tr},Symbol.toStringTag,{value:"Module"}));var si={exports:{}},it=-1,et=1,K=0;function On(n,t,e,r,s){if(n===t)return n?[[K,n]]:[];if(e!=null){var i=Zf(n,t,e);if(i)return i}var l=Li(n,t),a=n.substring(0,l);n=n.substring(l),t=t.substring(l),l=Ir(n,t);var c=n.substring(n.length-l);n=n.substring(0,n.length-l),t=t.substring(0,t.length-l);var h=Uf(n,t);return a&&h.unshift([K,a]),c&&h.push([K,c]),Si(h,s),r&&zf(h),h}function Uf(n,t){var e;if(!n)return[[et,t]];if(!t)return[[it,n]];var r=n.length>t.length?n:t,s=n.length>t.length?t:n,i=r.indexOf(s);if(i!==-1)return e=[[et,r.substring(0,i)],[K,s],[et,r.substring(i+s.length)]],n.length>t.length&&(e[0][0]=e[2][0]=it),e;if(s.length===1)return[[it,n],[et,t]];var l=Hf(n,t);if(l){var a=l[0],c=l[1],h=l[2],f=l[3],b=l[4],g=On(a,h),p=On(c,f);return g.concat([[K,b]],p)}return Ff(n,t)}function Ff(n,t){for(var e=n.length,r=t.length,s=Math.ceil((e+r)/2),i=s,l=2*s,a=new Array(l),c=new Array(l),h=0;h<l;h++)a[h]=-1,c[h]=-1;a[i+1]=0,c[i+1]=0;for(var f=e-r,b=f%2!==0,g=0,p=0,m=0,y=0,E=0;E<s;E++){for(var A=-E+g;A<=E-p;A+=2){var w=i+A,T;A===-E||A!==E&&a[w-1]<a[w+1]?T=a[w+1]:T=a[w-1]+1;for(var _=T-A;T<e&&_<r&&n.charAt(T)===t.charAt(_);)T++,_++;if(a[w]=T,T>e)p+=2;else if(_>r)g+=2;else if(b){var L=i+f-A;if(L>=0&&L<l&&c[L]!==-1){var I=e-c[L];if(T>=I)return gl(n,t,T,_)}}}for(var k=-E+m;k<=E-y;k+=2){var L=i+k,I;k===-E||k!==E&&c[L-1]<c[L+1]?I=c[L+1]:I=c[L-1]+1;for(var U=I-k;I<e&&U<r&&n.charAt(e-I-1)===t.charAt(r-U-1);)I++,U++;if(c[L]=I,I>e)y+=2;else if(U>r)m+=2;else if(!b){var w=i+f-k;if(w>=0&&w<l&&a[w]!==-1){var T=a[w],_=i+T-w;if(I=e-I,T>=I)return gl(n,t,T,_)}}}}return[[it,n],[et,t]]}function gl(n,t,e,r){var s=n.substring(0,e),i=t.substring(0,r),l=n.substring(e),a=t.substring(r),c=On(s,i),h=On(l,a);return c.concat(h)}function Li(n,t){if(!n||!t||n.charAt(0)!==t.charAt(0))return 0;for(var e=0,r=Math.min(n.length,t.length),s=r,i=0;e<s;)n.substring(i,s)==t.substring(i,s)?(e=s,i=e):r=s,s=Math.floor((r-e)/2+e);return No(n.charCodeAt(s-1))&&s--,s}function pl(n,t){var e=n.length,r=t.length;if(e==0||r==0)return 0;e>r?n=n.substring(e-r):e<r&&(t=t.substring(0,e));var s=Math.min(e,r);if(n==t)return s;for(var i=0,l=1;;){var a=n.substring(s-l),c=t.indexOf(a);if(c==-1)return i;l+=c,(c==0||n.substring(s-l)==t.substring(0,l))&&(i=l,l++)}}function Ir(n,t){if(!n||!t||n.slice(-1)!==t.slice(-1))return 0;for(var e=0,r=Math.min(n.length,t.length),s=r,i=0;e<s;)n.substring(n.length-s,n.length-i)==t.substring(t.length-s,t.length-i)?(e=s,i=e):r=s,s=Math.floor((r-e)/2+e);return wo(n.charCodeAt(n.length-s))&&s--,s}function Hf(n,t){var e=n.length>t.length?n:t,r=n.length>t.length?t:n;if(e.length<4||r.length*2<e.length)return null;function s(p,m,y){for(var E=p.substring(y,y+Math.floor(p.length/4)),A=-1,w="",T,_,L,I;(A=m.indexOf(E,A+1))!==-1;){var k=Li(p.substring(y),m.substring(A)),U=Ir(p.substring(0,y),m.substring(0,A));w.length<U+k&&(w=m.substring(A-U,A)+m.substring(A,A+k),T=p.substring(0,y-U),_=p.substring(y+k),L=m.substring(0,A-U),I=m.substring(A+k))}return w.length*2>=p.length?[T,_,L,I,w]:null}var i=s(e,r,Math.ceil(e.length/4)),l=s(e,r,Math.ceil(e.length/2)),a;if(!i&&!l)return null;l?i?a=i[4].length>l[4].length?i:l:a=l:a=i;var c,h,f,b;n.length>t.length?(c=a[0],h=a[1],f=a[2],b=a[3]):(f=a[0],b=a[1],c=a[2],h=a[3]);var g=a[4];return[c,h,f,b,g]}function zf(n){for(var t=!1,e=[],r=0,s=null,i=0,l=0,a=0,c=0,h=0;i<n.length;)n[i][0]==K?(e[r++]=i,l=c,a=h,c=0,h=0,s=n[i][1]):(n[i][0]==et?c+=n[i][1].length:h+=n[i][1].length,s&&s.length<=Math.max(l,a)&&s.length<=Math.max(c,h)&&(n.splice(e[r-1],0,[it,s]),n[e[r-1]+1][0]=et,r--,r--,i=r>0?e[r-1]:-1,l=0,a=0,c=0,h=0,s=null,t=!0)),i++;for(t&&Si(n),Vf(n),i=1;i<n.length;){if(n[i-1][0]==it&&n[i][0]==et){var f=n[i-1][1],b=n[i][1],g=pl(f,b),p=pl(b,f);g>=p?(g>=f.length/2||g>=b.length/2)&&(n.splice(i,0,[K,b.substring(0,g)]),n[i-1][1]=f.substring(0,f.length-g),n[i+1][1]=b.substring(g),i++):(p>=f.length/2||p>=b.length/2)&&(n.splice(i,0,[K,f.substring(0,p)]),n[i-1][0]=et,n[i-1][1]=b.substring(0,b.length-p),n[i+1][0]=it,n[i+1][1]=f.substring(p),i++),i++}i++}}var ml=/[^a-zA-Z0-9]/,bl=/\s/,yl=/[\r\n]/,Kf=/\n\r?\n$/,Gf=/^\r?\n\r?\n/;function Vf(n){function t(p,m){if(!p||!m)return 6;var y=p.charAt(p.length-1),E=m.charAt(0),A=y.match(ml),w=E.match(ml),T=A&&y.match(bl),_=w&&E.match(bl),L=T&&y.match(yl),I=_&&E.match(yl),k=L&&p.match(Kf),U=I&&m.match(Gf);return k||U?5:L||I?4:A&&!T&&_?3:T||_?2:A||w?1:0}for(var e=1;e<n.length-1;){if(n[e-1][0]==K&&n[e+1][0]==K){var r=n[e-1][1],s=n[e][1],i=n[e+1][1],l=Ir(r,s);if(l){var a=s.substring(s.length-l);r=r.substring(0,r.length-l),s=a+s.substring(0,s.length-l),i=a+i}for(var c=r,h=s,f=i,b=t(r,s)+t(s,i);s.charAt(0)===i.charAt(0);){r+=s.charAt(0),s=s.substring(1)+i.charAt(0),i=i.substring(1);var g=t(r,s)+t(s,i);g>=b&&(b=g,c=r,h=s,f=i)}n[e-1][1]!=c&&(c?n[e-1][1]=c:(n.splice(e-1,1),e--),n[e][1]=h,f?n[e+1][1]=f:(n.splice(e+1,1),e--))}e++}}function Si(n,t){n.push([K,""]);for(var e=0,r=0,s=0,i="",l="",a;e<n.length;){if(e<n.length-1&&!n[e][1]){n.splice(e,1);continue}switch(n[e][0]){case et:s++,l+=n[e][1],e++;break;case it:r++,i+=n[e][1],e++;break;case K:var c=e-s-r-1;if(t){if(c>=0&&xo(n[c][1])){var h=n[c][1].slice(-1);if(n[c][1]=n[c][1].slice(0,-1),i=h+i,l=h+l,!n[c][1]){n.splice(c,1),e--;var f=c-1;n[f]&&n[f][0]===et&&(s++,l=n[f][1]+l,f--),n[f]&&n[f][0]===it&&(r++,i=n[f][1]+i,f--),c=f}}if(To(n[e][1])){var h=n[e][1].charAt(0);n[e][1]=n[e][1].slice(1),i+=h,l+=h}}if(e<n.length-1&&!n[e][1]){n.splice(e,1);break}if(i.length>0||l.length>0){i.length>0&&l.length>0&&(a=Li(l,i),a!==0&&(c>=0?n[c][1]+=l.substring(0,a):(n.splice(0,0,[K,l.substring(0,a)]),e++),l=l.substring(a),i=i.substring(a)),a=Ir(l,i),a!==0&&(n[e][1]=l.substring(l.length-a)+n[e][1],l=l.substring(0,l.length-a),i=i.substring(0,i.length-a)));var b=s+r;i.length===0&&l.length===0?(n.splice(e-b,b),e=e-b):i.length===0?(n.splice(e-b,b,[et,l]),e=e-b+1):l.length===0?(n.splice(e-b,b,[it,i]),e=e-b+1):(n.splice(e-b,b,[it,i],[et,l]),e=e-b+2)}e!==0&&n[e-1][0]===K?(n[e-1][1]+=n[e][1],n.splice(e,1)):e++,s=0,r=0,i="",l="";break}}n[n.length-1][1]===""&&n.pop();var g=!1;for(e=1;e<n.length-1;)n[e-1][0]===K&&n[e+1][0]===K&&(n[e][1].substring(n[e][1].length-n[e-1][1].length)===n[e-1][1]?(n[e][1]=n[e-1][1]+n[e][1].substring(0,n[e][1].length-n[e-1][1].length),n[e+1][1]=n[e-1][1]+n[e+1][1],n.splice(e-1,1),g=!0):n[e][1].substring(0,n[e+1][1].length)==n[e+1][1]&&(n[e-1][1]+=n[e+1][1],n[e][1]=n[e][1].substring(n[e+1][1].length)+n[e+1][1],n.splice(e+1,1),g=!0)),e++;g&&Si(n,t)}function No(n){return n>=55296&&n<=56319}function wo(n){return n>=56320&&n<=57343}function To(n){return wo(n.charCodeAt(0))}function xo(n){return No(n.charCodeAt(n.length-1))}function Wf(n){for(var t=[],e=0;e<n.length;e++)n[e][1].length>0&&t.push(n[e]);return t}function Ds(n,t,e,r){return xo(n)||To(r)?null:Wf([[K,n],[it,t],[et,e],[K,r]])}function Zf(n,t,e){var r=typeof e=="number"?{index:e,length:0}:e.oldRange,s=typeof e=="number"?null:e.newRange,i=n.length,l=t.length;if(r.length===0&&(s===null||s.length===0)){var a=r.index,c=n.slice(0,a),h=n.slice(a),f=s?s.index:null;t:{var b=a+l-i;if(f!==null&&f!==b||b<0||b>l)break t;var g=t.slice(0,b),p=t.slice(b);if(p!==h)break t;var m=Math.min(a,b),y=c.slice(0,m),E=g.slice(0,m);if(y!==E)break t;var A=c.slice(m),w=g.slice(m);return Ds(y,A,w,h)}t:{if(f!==null&&f!==a)break t;var T=a,g=t.slice(0,T),p=t.slice(T);if(g!==c)break t;var _=Math.min(i-T,l-T),L=h.slice(h.length-_),I=p.slice(p.length-_);if(L!==I)break t;var A=h.slice(0,h.length-_),w=p.slice(0,p.length-_);return Ds(c,A,w,L)}}if(r.length>0&&s&&s.length===0)t:{var y=n.slice(0,r.index),L=n.slice(r.index+r.length),m=y.length,_=L.length;if(l<m+_)break t;var E=t.slice(0,m),I=t.slice(l-_);if(y!==E||L!==I)break t;var A=n.slice(m,i-_),w=t.slice(m,l-_);return Ds(y,A,w,L)}return null}function Rr(n,t,e,r){return On(n,t,e,r,!0)}Rr.INSERT=et;Rr.DELETE=it;Rr.EQUAL=K;var Xf=Rr,xr={exports:{}};xr.exports;(function(n,t){var e=200,r="__lodash_hash_undefined__",s=9007199254740991,i="[object Arguments]",l="[object Array]",a="[object Boolean]",c="[object Date]",h="[object Error]",f="[object Function]",b="[object GeneratorFunction]",g="[object Map]",p="[object Number]",m="[object Object]",y="[object Promise]",E="[object RegExp]",A="[object Set]",w="[object String]",T="[object Symbol]",_="[object WeakMap]",L="[object ArrayBuffer]",I="[object DataView]",k="[object Float32Array]",U="[object Float64Array]",Bt="[object Int8Array]",Gt="[object Int16Array]",se="[object Int32Array]",ie="[object Uint8Array]",jn="[object Uint8ClampedArray]",Pn="[object Uint16Array]",$n="[object Uint32Array]",Pr=/[\\^$.*+?()[\]{}|]/g,$r=/\w*$/,Ur=/^\[object .+?Constructor\]$/,Fr=/^(?:0|[1-9]\d*)$/,j={};j[i]=j[l]=j[L]=j[I]=j[a]=j[c]=j[k]=j[U]=j[Bt]=j[Gt]=j[se]=j[g]=j[p]=j[m]=j[E]=j[A]=j[w]=j[T]=j[ie]=j[jn]=j[Pn]=j[$n]=!0,j[h]=j[f]=j[_]=!1;var Hr=typeof Yt=="object"&&Yt&&Yt.Object===Object&&Yt,zr=typeof self=="object"&&self&&self.Object===Object&&self,dt=Hr||zr||Function("return this")(),Un=t&&!t.nodeType&&t,P=Un&&!0&&n&&!n.nodeType&&n,Fn=P&&P.exports===Un;function Kr(o,u){return o.set(u[0],u[1]),o}function gt(o,u){return o.add(u),o}function Hn(o,u){for(var d=-1,v=o?o.length:0;++d<v&&u(o[d],d,o)!==!1;);return o}function zn(o,u){for(var d=-1,v=u.length,R=o.length;++d<v;)o[R+d]=u[d];return o}function Ye(o,u,d,v){for(var R=-1,q=o?o.length:0;++R<q;)d=u(d,o[R],R,o);return d}function Qe(o,u){for(var d=-1,v=Array(o);++d<o;)v[d]=u(d);return v}function Kn(o,u){return o?.[u]}function Je(o){var u=!1;if(o!=null&&typeof o.toString!="function")try{u=!!(o+"")}catch{}return u}function Gn(o){var u=-1,d=Array(o.size);return o.forEach(function(v,R){d[++u]=[R,v]}),d}function tn(o,u){return function(d){return o(u(d))}}function Vn(o){var u=-1,d=Array(o.size);return o.forEach(function(v){d[++u]=v}),d}var Gr=Array.prototype,Vr=Function.prototype,Te=Object.prototype,en=dt["__core-js_shared__"],Wn=function(){var o=/[^.]+$/.exec(en&&en.keys&&en.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Zn=Vr.toString,xt=Te.hasOwnProperty,xe=Te.toString,Wr=RegExp("^"+Zn.call(xt).replace(Pr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),le=Fn?dt.Buffer:void 0,Le=dt.Symbol,nn=dt.Uint8Array,ot=tn(Object.getPrototypeOf,Object),Xn=Object.create,Yn=Te.propertyIsEnumerable,Zr=Gr.splice,rn=Object.getOwnPropertySymbols,Se=le?le.isBuffer:void 0,Qn=tn(Object.keys,Object),_e=mt(dt,"DataView"),oe=mt(dt,"Map"),pt=mt(dt,"Promise"),Oe=mt(dt,"Set"),sn=mt(dt,"WeakMap"),ae=mt(Object,"create"),ln=tt(_e),ce=tt(oe),on=tt(pt),an=tt(Oe),cn=tt(sn),Vt=Le?Le.prototype:void 0,Jn=Vt?Vt.valueOf:void 0;function Mt(o){var u=-1,d=o?o.length:0;for(this.clear();++u<d;){var v=o[u];this.set(v[0],v[1])}}function Xr(){this.__data__=ae?ae(null):{}}function Yr(o){return this.has(o)&&delete this.__data__[o]}function Qr(o){var u=this.__data__;if(ae){var d=u[o];return d===r?void 0:d}return xt.call(u,o)?u[o]:void 0}function tr(o){var u=this.__data__;return ae?u[o]!==void 0:xt.call(u,o)}function un(o,u){var d=this.__data__;return d[o]=ae&&u===void 0?r:u,this}Mt.prototype.clear=Xr,Mt.prototype.delete=Yr,Mt.prototype.get=Qr,Mt.prototype.has=tr,Mt.prototype.set=un;function G(o){var u=-1,d=o?o.length:0;for(this.clear();++u<d;){var v=o[u];this.set(v[0],v[1])}}function Jr(){this.__data__=[]}function ts(o){var u=this.__data__,d=qe(u,o);if(d<0)return!1;var v=u.length-1;return d==v?u.pop():Zr.call(u,d,1),!0}function es(o){var u=this.__data__,d=qe(u,o);return d<0?void 0:u[d][1]}function ns(o){return qe(this.__data__,o)>-1}function rs(o,u){var d=this.__data__,v=qe(d,o);return v<0?d.push([o,u]):d[v][1]=u,this}G.prototype.clear=Jr,G.prototype.delete=ts,G.prototype.get=es,G.prototype.has=ns,G.prototype.set=rs;function Z(o){var u=-1,d=o?o.length:0;for(this.clear();++u<d;){var v=o[u];this.set(v[0],v[1])}}function ss(){this.__data__={hash:new Mt,map:new(oe||G),string:new Mt}}function is(o){return he(this,o).delete(o)}function ls(o){return he(this,o).get(o)}function os(o){return he(this,o).has(o)}function as(o,u){return he(this,o).set(o,u),this}Z.prototype.clear=ss,Z.prototype.delete=is,Z.prototype.get=ls,Z.prototype.has=os,Z.prototype.set=as;function nt(o){this.__data__=new G(o)}function cs(){this.__data__=new G}function us(o){return this.__data__.delete(o)}function hs(o){return this.__data__.get(o)}function fs(o){return this.__data__.has(o)}function ds(o,u){var d=this.__data__;if(d instanceof G){var v=d.__data__;if(!oe||v.length<e-1)return v.push([o,u]),this;d=this.__data__=new Z(v)}return d.set(o,u),this}nt.prototype.clear=cs,nt.prototype.delete=us,nt.prototype.get=hs,nt.prototype.has=fs,nt.prototype.set=ds;function Ce(o,u){var d=gn(o)||Re(o)?Qe(o.length,String):[],v=d.length,R=!!v;for(var q in o)xt.call(o,q)&&!(R&&(q=="length"||Ss(q,v)))&&d.push(q);return d}function er(o,u,d){var v=o[u];(!(xt.call(o,u)&&lr(v,d))||d===void 0&&!(u in o))&&(o[u]=d)}function qe(o,u){for(var d=o.length;d--;)if(lr(o[d][0],u))return d;return-1}function Lt(o,u){return o&&dn(u,mn(u),o)}function hn(o,u,d,v,R,q,M){var B;if(v&&(B=q?v(o,R,q,M):v(o)),B!==void 0)return B;if(!_t(o))return o;var H=gn(o);if(H){if(B=xs(o),!u)return Ns(o,B)}else{var D=jt(o),X=D==f||D==b;if(or(o))return Ie(o,u);if(D==m||D==i||X&&!q){if(Je(o))return q?o:{};if(B=St(X?{}:o),!u)return ws(o,Lt(B,o))}else{if(!j[D])return q?o:{};B=Ls(o,D,hn,u)}}M||(M=new nt);var rt=M.get(o);if(rt)return rt;if(M.set(o,B),!H)var z=d?Ts(o):mn(o);return Hn(z||o,function(Y,V){z&&(V=Y,Y=o[V]),er(B,V,hn(Y,u,d,v,V,o,M))}),B}function gs(o){return _t(o)?Xn(o):{}}function ps(o,u,d){var v=u(o);return gn(o)?v:zn(v,d(o))}function ms(o){return xe.call(o)}function bs(o){if(!_t(o)||Os(o))return!1;var u=pn(o)||Je(o)?Wr:Ur;return u.test(tt(o))}function ys(o){if(!sr(o))return Qn(o);var u=[];for(var d in Object(o))xt.call(o,d)&&d!="constructor"&&u.push(d);return u}function Ie(o,u){if(u)return o.slice();var d=new o.constructor(o.length);return o.copy(d),d}function fn(o){var u=new o.constructor(o.byteLength);return new nn(u).set(new nn(o)),u}function ue(o,u){var d=u?fn(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.byteLength)}function nr(o,u,d){var v=u?d(Gn(o),!0):Gn(o);return Ye(v,Kr,new o.constructor)}function rr(o){var u=new o.constructor(o.source,$r.exec(o));return u.lastIndex=o.lastIndex,u}function vs(o,u,d){var v=u?d(Vn(o),!0):Vn(o);return Ye(v,gt,new o.constructor)}function Es(o){return Jn?Object(Jn.call(o)):{}}function As(o,u){var d=u?fn(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.length)}function Ns(o,u){var d=-1,v=o.length;for(u||(u=Array(v));++d<v;)u[d]=o[d];return u}function dn(o,u,d,v){d||(d={});for(var R=-1,q=u.length;++R<q;){var M=u[R],B=void 0;er(d,M,B===void 0?o[M]:B)}return d}function ws(o,u){return dn(o,Dt(o),u)}function Ts(o){return ps(o,mn,Dt)}function he(o,u){var d=o.__data__;return _s(u)?d[typeof u=="string"?"string":"hash"]:d.map}function mt(o,u){var d=Kn(o,u);return bs(d)?d:void 0}var Dt=rn?tn(rn,Object):qs,jt=ms;(_e&&jt(new _e(new ArrayBuffer(1)))!=I||oe&&jt(new oe)!=g||pt&&jt(pt.resolve())!=y||Oe&&jt(new Oe)!=A||sn&&jt(new sn)!=_)&&(jt=function(o){var u=xe.call(o),d=u==m?o.constructor:void 0,v=d?tt(d):void 0;if(v)switch(v){case ln:return I;case ce:return g;case on:return y;case an:return A;case cn:return _}return u});function xs(o){var u=o.length,d=o.constructor(u);return u&&typeof o[0]=="string"&&xt.call(o,"index")&&(d.index=o.index,d.input=o.input),d}function St(o){return typeof o.constructor=="function"&&!sr(o)?gs(ot(o)):{}}function Ls(o,u,d,v){var R=o.constructor;switch(u){case L:return fn(o);case a:case c:return new R(+o);case I:return ue(o,v);case k:case U:case Bt:case Gt:case se:case ie:case jn:case Pn:case $n:return As(o,v);case g:return nr(o,v,d);case p:case w:return new R(o);case E:return rr(o);case A:return vs(o,v,d);case T:return Es(o)}}function Ss(o,u){return u=u??s,!!u&&(typeof o=="number"||Fr.test(o))&&o>-1&&o%1==0&&o<u}function _s(o){var u=typeof o;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?o!=="__proto__":o===null}function Os(o){return!!Wn&&Wn in o}function sr(o){var u=o&&o.constructor,d=typeof u=="function"&&u.prototype||Te;return o===d}function tt(o){if(o!=null){try{return Zn.call(o)}catch{}try{return o+""}catch{}}return""}function ir(o){return hn(o,!0,!0)}function lr(o,u){return o===u||o!==o&&u!==u}function Re(o){return Cs(o)&&xt.call(o,"callee")&&(!Yn.call(o,"callee")||xe.call(o)==i)}var gn=Array.isArray;function ke(o){return o!=null&&ar(o.length)&&!pn(o)}function Cs(o){return cr(o)&&ke(o)}var or=Se||Is;function pn(o){var u=_t(o)?xe.call(o):"";return u==f||u==b}function ar(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=s}function _t(o){var u=typeof o;return!!o&&(u=="object"||u=="function")}function cr(o){return!!o&&typeof o=="object"}function mn(o){return ke(o)?Ce(o):ys(o)}function qs(){return[]}function Is(){return!1}n.exports=ir})(xr,xr.exports);var Lo=xr.exports,Lr={exports:{}};Lr.exports;(function(n,t){var e=200,r="__lodash_hash_undefined__",s=1,i=2,l=9007199254740991,a="[object Arguments]",c="[object Array]",h="[object AsyncFunction]",f="[object Boolean]",b="[object Date]",g="[object Error]",p="[object Function]",m="[object GeneratorFunction]",y="[object Map]",E="[object Number]",A="[object Null]",w="[object Object]",T="[object Promise]",_="[object Proxy]",L="[object RegExp]",I="[object Set]",k="[object String]",U="[object Symbol]",Bt="[object Undefined]",Gt="[object WeakMap]",se="[object ArrayBuffer]",ie="[object DataView]",jn="[object Float32Array]",Pn="[object Float64Array]",$n="[object Int8Array]",Pr="[object Int16Array]",$r="[object Int32Array]",Ur="[object Uint8Array]",Fr="[object Uint8ClampedArray]",j="[object Uint16Array]",Hr="[object Uint32Array]",zr=/[\\^$.*+?()[\]{}|]/g,dt=/^\[object .+?Constructor\]$/,Un=/^(?:0|[1-9]\d*)$/,P={};P[jn]=P[Pn]=P[$n]=P[Pr]=P[$r]=P[Ur]=P[Fr]=P[j]=P[Hr]=!0,P[a]=P[c]=P[se]=P[f]=P[ie]=P[b]=P[g]=P[p]=P[y]=P[E]=P[w]=P[L]=P[I]=P[k]=P[Gt]=!1;var Fn=typeof Yt=="object"&&Yt&&Yt.Object===Object&&Yt,Kr=typeof self=="object"&&self&&self.Object===Object&&self,gt=Fn||Kr||Function("return this")(),Hn=t&&!t.nodeType&&t,zn=Hn&&!0&&n&&!n.nodeType&&n,Ye=zn&&zn.exports===Hn,Qe=Ye&&Fn.process,Kn=function(){try{return Qe&&Qe.binding&&Qe.binding("util")}catch{}}(),Je=Kn&&Kn.isTypedArray;function Gn(o,u){for(var d=-1,v=o==null?0:o.length,R=0,q=[];++d<v;){var M=o[d];u(M,d,o)&&(q[R++]=M)}return q}function tn(o,u){for(var d=-1,v=u.length,R=o.length;++d<v;)o[R+d]=u[d];return o}function Vn(o,u){for(var d=-1,v=o==null?0:o.length;++d<v;)if(u(o[d],d,o))return!0;return!1}function Gr(o,u){for(var d=-1,v=Array(o);++d<o;)v[d]=u(d);return v}function Vr(o){return function(u){return o(u)}}function Te(o,u){return o.has(u)}function en(o,u){return o?.[u]}function Wn(o){var u=-1,d=Array(o.size);return o.forEach(function(v,R){d[++u]=[R,v]}),d}function Zn(o,u){return function(d){return o(u(d))}}function xt(o){var u=-1,d=Array(o.size);return o.forEach(function(v){d[++u]=v}),d}var xe=Array.prototype,Wr=Function.prototype,le=Object.prototype,Le=gt["__core-js_shared__"],nn=Wr.toString,ot=le.hasOwnProperty,Xn=function(){var o=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Yn=le.toString,Zr=RegExp("^"+nn.call(ot).replace(zr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rn=Ye?gt.Buffer:void 0,Se=gt.Symbol,Qn=gt.Uint8Array,_e=le.propertyIsEnumerable,oe=xe.splice,pt=Se?Se.toStringTag:void 0,Oe=Object.getOwnPropertySymbols,sn=rn?rn.isBuffer:void 0,ae=Zn(Object.keys,Object),ln=Dt(gt,"DataView"),ce=Dt(gt,"Map"),on=Dt(gt,"Promise"),an=Dt(gt,"Set"),cn=Dt(gt,"WeakMap"),Vt=Dt(Object,"create"),Jn=tt(ln),Mt=tt(ce),Xr=tt(on),Yr=tt(an),Qr=tt(cn),tr=Se?Se.prototype:void 0,un=tr?tr.valueOf:void 0;function G(o){var u=-1,d=o==null?0:o.length;for(this.clear();++u<d;){var v=o[u];this.set(v[0],v[1])}}function Jr(){this.__data__=Vt?Vt(null):{},this.size=0}function ts(o){var u=this.has(o)&&delete this.__data__[o];return this.size-=u?1:0,u}function es(o){var u=this.__data__;if(Vt){var d=u[o];return d===r?void 0:d}return ot.call(u,o)?u[o]:void 0}function ns(o){var u=this.__data__;return Vt?u[o]!==void 0:ot.call(u,o)}function rs(o,u){var d=this.__data__;return this.size+=this.has(o)?0:1,d[o]=Vt&&u===void 0?r:u,this}G.prototype.clear=Jr,G.prototype.delete=ts,G.prototype.get=es,G.prototype.has=ns,G.prototype.set=rs;function Z(o){var u=-1,d=o==null?0:o.length;for(this.clear();++u<d;){var v=o[u];this.set(v[0],v[1])}}function ss(){this.__data__=[],this.size=0}function is(o){var u=this.__data__,d=Ie(u,o);if(d<0)return!1;var v=u.length-1;return d==v?u.pop():oe.call(u,d,1),--this.size,!0}function ls(o){var u=this.__data__,d=Ie(u,o);return d<0?void 0:u[d][1]}function os(o){return Ie(this.__data__,o)>-1}function as(o,u){var d=this.__data__,v=Ie(d,o);return v<0?(++this.size,d.push([o,u])):d[v][1]=u,this}Z.prototype.clear=ss,Z.prototype.delete=is,Z.prototype.get=ls,Z.prototype.has=os,Z.prototype.set=as;function nt(o){var u=-1,d=o==null?0:o.length;for(this.clear();++u<d;){var v=o[u];this.set(v[0],v[1])}}function cs(){this.size=0,this.__data__={hash:new G,map:new(ce||Z),string:new G}}function us(o){var u=mt(this,o).delete(o);return this.size-=u?1:0,u}function hs(o){return mt(this,o).get(o)}function fs(o){return mt(this,o).has(o)}function ds(o,u){var d=mt(this,o),v=d.size;return d.set(o,u),this.size+=d.size==v?0:1,this}nt.prototype.clear=cs,nt.prototype.delete=us,nt.prototype.get=hs,nt.prototype.has=fs,nt.prototype.set=ds;function Ce(o){var u=-1,d=o==null?0:o.length;for(this.__data__=new nt;++u<d;)this.add(o[u])}function er(o){return this.__data__.set(o,r),this}function qe(o){return this.__data__.has(o)}Ce.prototype.add=Ce.prototype.push=er,Ce.prototype.has=qe;function Lt(o){var u=this.__data__=new Z(o);this.size=u.size}function hn(){this.__data__=new Z,this.size=0}function gs(o){var u=this.__data__,d=u.delete(o);return this.size=u.size,d}function ps(o){return this.__data__.get(o)}function ms(o){return this.__data__.has(o)}function bs(o,u){var d=this.__data__;if(d instanceof Z){var v=d.__data__;if(!ce||v.length<e-1)return v.push([o,u]),this.size=++d.size,this;d=this.__data__=new nt(v)}return d.set(o,u),this.size=d.size,this}Lt.prototype.clear=hn,Lt.prototype.delete=gs,Lt.prototype.get=ps,Lt.prototype.has=ms,Lt.prototype.set=bs;function ys(o,u){var d=Re(o),v=!d&&lr(o),R=!d&&!v&&ke(o),q=!d&&!v&&!R&&cr(o),M=d||v||R||q,B=M?Gr(o.length,String):[],H=B.length;for(var D in o)ot.call(o,D)&&!(M&&(D=="length"||R&&(D=="offset"||D=="parent")||q&&(D=="buffer"||D=="byteLength"||D=="byteOffset")||Ls(D,H)))&&B.push(D);return B}function Ie(o,u){for(var d=o.length;d--;)if(ir(o[d][0],u))return d;return-1}function fn(o,u,d){var v=u(o);return Re(o)?v:tn(v,d(o))}function ue(o){return o==null?o===void 0?Bt:A:pt&&pt in Object(o)?jt(o):sr(o)}function nr(o){return _t(o)&&ue(o)==a}function rr(o,u,d,v,R){return o===u?!0:o==null||u==null||!_t(o)&&!_t(u)?o!==o&&u!==u:vs(o,u,d,v,rr,R)}function vs(o,u,d,v,R,q){var M=Re(o),B=Re(u),H=M?c:St(o),D=B?c:St(u);H=H==a?w:H,D=D==a?w:D;var X=H==w,rt=D==w,z=H==D;if(z&&ke(o)){if(!ke(u))return!1;M=!0,X=!1}if(z&&!X)return q||(q=new Lt),M||cr(o)?dn(o,u,d,v,R,q):ws(o,u,H,d,v,R,q);if(!(d&s)){var Y=X&&ot.call(o,"__wrapped__"),V=rt&&ot.call(u,"__wrapped__");if(Y||V){var Wt=Y?o.value():o,Pt=V?u.value():u;return q||(q=new Lt),R(Wt,Pt,d,v,q)}}return z?(q||(q=new Lt),Ts(o,u,d,v,R,q)):!1}function Es(o){if(!ar(o)||_s(o))return!1;var u=or(o)?Zr:dt;return u.test(tt(o))}function As(o){return _t(o)&&pn(o.length)&&!!P[ue(o)]}function Ns(o){if(!Os(o))return ae(o);var u=[];for(var d in Object(o))ot.call(o,d)&&d!="constructor"&&u.push(d);return u}function dn(o,u,d,v,R,q){var M=d&s,B=o.length,H=u.length;if(B!=H&&!(M&&H>B))return!1;var D=q.get(o);if(D&&q.get(u))return D==u;var X=-1,rt=!0,z=d&i?new Ce:void 0;for(q.set(o,u),q.set(u,o);++X<B;){var Y=o[X],V=u[X];if(v)var Wt=M?v(V,Y,X,u,o,q):v(Y,V,X,o,u,q);if(Wt!==void 0){if(Wt)continue;rt=!1;break}if(z){if(!Vn(u,function(Pt,fe){if(!Te(z,fe)&&(Y===Pt||R(Y,Pt,d,v,q)))return z.push(fe)})){rt=!1;break}}else if(!(Y===V||R(Y,V,d,v,q))){rt=!1;break}}return q.delete(o),q.delete(u),rt}function ws(o,u,d,v,R,q,M){switch(d){case ie:if(o.byteLength!=u.byteLength||o.byteOffset!=u.byteOffset)return!1;o=o.buffer,u=u.buffer;case se:return!(o.byteLength!=u.byteLength||!q(new Qn(o),new Qn(u)));case f:case b:case E:return ir(+o,+u);case g:return o.name==u.name&&o.message==u.message;case L:case k:return o==u+"";case y:var B=Wn;case I:var H=v&s;if(B||(B=xt),o.size!=u.size&&!H)return!1;var D=M.get(o);if(D)return D==u;v|=i,M.set(o,u);var X=dn(B(o),B(u),v,R,q,M);return M.delete(o),X;case U:if(un)return un.call(o)==un.call(u)}return!1}function Ts(o,u,d,v,R,q){var M=d&s,B=he(o),H=B.length,D=he(u),X=D.length;if(H!=X&&!M)return!1;for(var rt=H;rt--;){var z=B[rt];if(!(M?z in u:ot.call(u,z)))return!1}var Y=q.get(o);if(Y&&q.get(u))return Y==u;var V=!0;q.set(o,u),q.set(u,o);for(var Wt=M;++rt<H;){z=B[rt];var Pt=o[z],fe=u[z];if(v)var $i=M?v(fe,Pt,z,u,o,q):v(Pt,fe,z,o,u,q);if(!($i===void 0?Pt===fe||R(Pt,fe,d,v,q):$i)){V=!1;break}Wt||(Wt=z=="constructor")}if(V&&!Wt){var ur=o.constructor,hr=u.constructor;ur!=hr&&"constructor"in o&&"constructor"in u&&!(typeof ur=="function"&&ur instanceof ur&&typeof hr=="function"&&hr instanceof hr)&&(V=!1)}return q.delete(o),q.delete(u),V}function he(o){return fn(o,mn,xs)}function mt(o,u){var d=o.__data__;return Ss(u)?d[typeof u=="string"?"string":"hash"]:d.map}function Dt(o,u){var d=en(o,u);return Es(d)?d:void 0}function jt(o){var u=ot.call(o,pt),d=o[pt];try{o[pt]=void 0;var v=!0}catch{}var R=Yn.call(o);return v&&(u?o[pt]=d:delete o[pt]),R}var xs=Oe?function(o){return o==null?[]:(o=Object(o),Gn(Oe(o),function(u){return _e.call(o,u)}))}:qs,St=ue;(ln&&St(new ln(new ArrayBuffer(1)))!=ie||ce&&St(new ce)!=y||on&&St(on.resolve())!=T||an&&St(new an)!=I||cn&&St(new cn)!=Gt)&&(St=function(o){var u=ue(o),d=u==w?o.constructor:void 0,v=d?tt(d):"";if(v)switch(v){case Jn:return ie;case Mt:return y;case Xr:return T;case Yr:return I;case Qr:return Gt}return u});function Ls(o,u){return u=u??l,!!u&&(typeof o=="number"||Un.test(o))&&o>-1&&o%1==0&&o<u}function Ss(o){var u=typeof o;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?o!=="__proto__":o===null}function _s(o){return!!Xn&&Xn in o}function Os(o){var u=o&&o.constructor,d=typeof u=="function"&&u.prototype||le;return o===d}function sr(o){return Yn.call(o)}function tt(o){if(o!=null){try{return nn.call(o)}catch{}try{return o+""}catch{}}return""}function ir(o,u){return o===u||o!==o&&u!==u}var lr=nr(function(){return arguments}())?nr:function(o){return _t(o)&&ot.call(o,"callee")&&!_e.call(o,"callee")},Re=Array.isArray;function gn(o){return o!=null&&pn(o.length)&&!or(o)}var ke=sn||Is;function Cs(o,u){return rr(o,u)}function or(o){if(!ar(o))return!1;var u=ue(o);return u==p||u==m||u==h||u==_}function pn(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=l}function ar(o){var u=typeof o;return o!=null&&(u=="object"||u=="function")}function _t(o){return o!=null&&typeof o=="object"}var cr=Je?Vr(Je):As;function mn(o){return gn(o)?ys(o):Ns(o)}function qs(){return[]}function Is(){return!1}n.exports=Cs})(Lr,Lr.exports);var So=Lr.exports,_i={};Object.defineProperty(_i,"__esModule",{value:!0});const Yf=Lo,Qf=So;var ii;(function(n){function t(i={},l={},a=!1){typeof i!="object"&&(i={}),typeof l!="object"&&(l={});let c=Yf(l);a||(c=Object.keys(c).reduce((h,f)=>(c[f]!=null&&(h[f]=c[f]),h),{}));for(const h in i)i[h]!==void 0&&l[h]===void 0&&(c[h]=i[h]);return Object.keys(c).length>0?c:void 0}n.compose=t;function e(i={},l={}){typeof i!="object"&&(i={}),typeof l!="object"&&(l={});const a=Object.keys(i).concat(Object.keys(l)).reduce((c,h)=>(Qf(i[h],l[h])||(c[h]=l[h]===void 0?null:l[h]),c),{});return Object.keys(a).length>0?a:void 0}n.diff=e;function r(i={},l={}){i=i||{};const a=Object.keys(l).reduce((c,h)=>(l[h]!==i[h]&&i[h]!==void 0&&(c[h]=l[h]),c),{});return Object.keys(i).reduce((c,h)=>(i[h]!==l[h]&&l[h]===void 0&&(c[h]=null),c),a)}n.invert=r;function s(i,l,a=!1){if(typeof i!="object")return l;if(typeof l!="object")return;if(!a)return l;const c=Object.keys(l).reduce((h,f)=>(i[f]===void 0&&(h[f]=l[f]),h),{});return Object.keys(c).length>0?c:void 0}n.transform=s})(ii||(ii={}));_i.default=ii;var kr={};Object.defineProperty(kr,"__esModule",{value:!0});var li;(function(n){function t(e){return typeof e.delete=="number"?e.delete:typeof e.retain=="number"?e.retain:typeof e.retain=="object"&&e.retain!==null?1:typeof e.insert=="string"?e.insert.length:1}n.length=t})(li||(li={}));kr.default=li;var Oi={};Object.defineProperty(Oi,"__esModule",{value:!0});const vl=kr;class Jf{constructor(t){this.ops=t,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(t){t||(t=1/0);const e=this.ops[this.index];if(e){const r=this.offset,s=vl.default.length(e);if(t>=s-r?(t=s-r,this.index+=1,this.offset=0):this.offset+=t,typeof e.delete=="number")return{delete:t};{const i={};return e.attributes&&(i.attributes=e.attributes),typeof e.retain=="number"?i.retain=t:typeof e.retain=="object"&&e.retain!==null?i.retain=e.retain:typeof e.insert=="string"?i.insert=e.insert.substr(r,t):i.insert=e.insert,i}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?vl.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const t=this.ops[this.index];return t?typeof t.delete=="number"?"delete":typeof t.retain=="number"||typeof t.retain=="object"&&t.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const t=this.offset,e=this.index,r=this.next(),s=this.ops.slice(this.index);return this.offset=t,this.index=e,[r].concat(s)}}else return[]}}Oi.default=Jf;(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const e=Xf,r=Lo,s=So,i=_i;t.AttributeMap=i.default;const l=kr;t.Op=l.default;const a=Oi;t.OpIterator=a.default;const c="\0",h=(b,g)=>{if(typeof b!="object"||b===null)throw new Error(`cannot retain a ${typeof b}`);if(typeof g!="object"||g===null)throw new Error(`cannot retain a ${typeof g}`);const p=Object.keys(b)[0];if(!p||p!==Object.keys(g)[0])throw new Error(`embed types not matched: ${p} != ${Object.keys(g)[0]}`);return[p,b[p],g[p]]};class f{constructor(g){Array.isArray(g)?this.ops=g:g!=null&&Array.isArray(g.ops)?this.ops=g.ops:this.ops=[]}static registerEmbed(g,p){this.handlers[g]=p}static unregisterEmbed(g){delete this.handlers[g]}static getHandler(g){const p=this.handlers[g];if(!p)throw new Error(`no handlers for embed type "${g}"`);return p}insert(g,p){const m={};return typeof g=="string"&&g.length===0?this:(m.insert=g,p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(m.attributes=p),this.push(m))}delete(g){return g<=0?this:this.push({delete:g})}retain(g,p){if(typeof g=="number"&&g<=0)return this;const m={retain:g};return p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(m.attributes=p),this.push(m)}push(g){let p=this.ops.length,m=this.ops[p-1];if(g=r(g),typeof m=="object"){if(typeof g.delete=="number"&&typeof m.delete=="number")return this.ops[p-1]={delete:m.delete+g.delete},this;if(typeof m.delete=="number"&&g.insert!=null&&(p-=1,m=this.ops[p-1],typeof m!="object"))return this.ops.unshift(g),this;if(s(g.attributes,m.attributes)){if(typeof g.insert=="string"&&typeof m.insert=="string")return this.ops[p-1]={insert:m.insert+g.insert},typeof g.attributes=="object"&&(this.ops[p-1].attributes=g.attributes),this;if(typeof g.retain=="number"&&typeof m.retain=="number")return this.ops[p-1]={retain:m.retain+g.retain},typeof g.attributes=="object"&&(this.ops[p-1].attributes=g.attributes),this}}return p===this.ops.length?this.ops.push(g):this.ops.splice(p,0,g),this}chop(){const g=this.ops[this.ops.length-1];return g&&typeof g.retain=="number"&&!g.attributes&&this.ops.pop(),this}filter(g){return this.ops.filter(g)}forEach(g){this.ops.forEach(g)}map(g){return this.ops.map(g)}partition(g){const p=[],m=[];return this.forEach(y=>{(g(y)?p:m).push(y)}),[p,m]}reduce(g,p){return this.ops.reduce(g,p)}changeLength(){return this.reduce((g,p)=>p.insert?g+l.default.length(p):p.delete?g-p.delete:g,0)}length(){return this.reduce((g,p)=>g+l.default.length(p),0)}slice(g=0,p=1/0){const m=[],y=new a.default(this.ops);let E=0;for(;E<p&&y.hasNext();){let A;E<g?A=y.next(g-E):(A=y.next(p-E),m.push(A)),E+=l.default.length(A)}return new f(m)}compose(g){const p=new a.default(this.ops),m=new a.default(g.ops),y=[],E=m.peek();if(E!=null&&typeof E.retain=="number"&&E.attributes==null){let w=E.retain;for(;p.peekType()==="insert"&&p.peekLength()<=w;)w-=p.peekLength(),y.push(p.next());E.retain-w>0&&m.next(E.retain-w)}const A=new f(y);for(;p.hasNext()||m.hasNext();)if(m.peekType()==="insert")A.push(m.next());else if(p.peekType()==="delete")A.push(p.next());else{const w=Math.min(p.peekLength(),m.peekLength()),T=p.next(w),_=m.next(w);if(_.retain){const L={};if(typeof T.retain=="number")L.retain=typeof _.retain=="number"?w:_.retain;else if(typeof _.retain=="number")T.retain==null?L.insert=T.insert:L.retain=T.retain;else{const k=T.retain==null?"insert":"retain",[U,Bt,Gt]=h(T[k],_.retain),se=f.getHandler(U);L[k]={[U]:se.compose(Bt,Gt,k==="retain")}}const I=i.default.compose(T.attributes,_.attributes,typeof T.retain=="number");if(I&&(L.attributes=I),A.push(L),!m.hasNext()&&s(A.ops[A.ops.length-1],L)){const k=new f(p.rest());return A.concat(k).chop()}}else typeof _.delete=="number"&&(typeof T.retain=="number"||typeof T.retain=="object"&&T.retain!==null)&&A.push(_)}return A.chop()}concat(g){const p=new f(this.ops.slice());return g.ops.length>0&&(p.push(g.ops[0]),p.ops=p.ops.concat(g.ops.slice(1))),p}diff(g,p){if(this.ops===g.ops)return new f;const m=[this,g].map(T=>T.map(_=>{if(_.insert!=null)return typeof _.insert=="string"?_.insert:c;const L=T===g?"on":"with";throw new Error("diff() called "+L+" non-document")}).join("")),y=new f,E=e(m[0],m[1],p,!0),A=new a.default(this.ops),w=new a.default(g.ops);return E.forEach(T=>{let _=T[1].length;for(;_>0;){let L=0;switch(T[0]){case e.INSERT:L=Math.min(w.peekLength(),_),y.push(w.next(L));break;case e.DELETE:L=Math.min(_,A.peekLength()),A.next(L),y.delete(L);break;case e.EQUAL:L=Math.min(A.peekLength(),w.peekLength(),_);const I=A.next(L),k=w.next(L);s(I.insert,k.insert)?y.retain(L,i.default.diff(I.attributes,k.attributes)):y.push(k).delete(L);break}_-=L}}),y.chop()}eachLine(g,p=`
`){const m=new a.default(this.ops);let y=new f,E=0;for(;m.hasNext();){if(m.peekType()!=="insert")return;const A=m.peek(),w=l.default.length(A)-m.peekLength(),T=typeof A.insert=="string"?A.insert.indexOf(p,w)-w:-1;if(T<0)y.push(m.next());else if(T>0)y.push(m.next(T));else{if(g(y,m.next(1).attributes||{},E)===!1)return;E+=1,y=new f}}y.length()>0&&g(y,{},E)}invert(g){const p=new f;return this.reduce((m,y)=>{if(y.insert)p.delete(l.default.length(y));else{if(typeof y.retain=="number"&&y.attributes==null)return p.retain(y.retain),m+y.retain;if(y.delete||typeof y.retain=="number"){const E=y.delete||y.retain;return g.slice(m,m+E).forEach(w=>{y.delete?p.push(w):y.retain&&y.attributes&&p.retain(l.default.length(w),i.default.invert(y.attributes,w.attributes))}),m+E}else if(typeof y.retain=="object"&&y.retain!==null){const E=g.slice(m,m+1),A=new a.default(E.ops).next(),[w,T,_]=h(y.retain,A.insert),L=f.getHandler(w);return p.retain({[w]:L.invert(T,_)},i.default.invert(y.attributes,A.attributes)),m+1}}return m},0),p.chop()}transform(g,p=!1){if(p=!!p,typeof g=="number")return this.transformPosition(g,p);const m=g,y=new a.default(this.ops),E=new a.default(m.ops),A=new f;for(;y.hasNext()||E.hasNext();)if(y.peekType()==="insert"&&(p||E.peekType()!=="insert"))A.retain(l.default.length(y.next()));else if(E.peekType()==="insert")A.push(E.next());else{const w=Math.min(y.peekLength(),E.peekLength()),T=y.next(w),_=E.next(w);if(T.delete)continue;if(_.delete)A.push(_);else{const L=T.retain,I=_.retain;let k=typeof I=="object"&&I!==null?I:w;if(typeof L=="object"&&L!==null&&typeof I=="object"&&I!==null){const U=Object.keys(L)[0];if(U===Object.keys(I)[0]){const Bt=f.getHandler(U);Bt&&(k={[U]:Bt.transform(L[U],I[U],p)})}}A.retain(k,i.default.transform(T.attributes,_.attributes,p))}}return A.chop()}transformPosition(g,p=!1){p=!!p;const m=new a.default(this.ops);let y=0;for(;m.hasNext()&&y<=g;){const E=m.peekLength(),A=m.peekType();if(m.next(),A==="delete"){g-=Math.min(E,g-y);continue}else A==="insert"&&(y<g||!p)&&(g+=E);y+=E}return g}}f.Op=l.default,f.OpIterator=a.default,f.AttributeMap=i.default,f.handlers={},t.default=f,n.exports=f,n.exports.default=f})(si,si.exports);var ft=si.exports;const O=zl(ft);class wt extends lt{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}wt.blotName="break";wt.tagName="BR";let At=class extends Tr{};const td={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Br(n){return n.replace(/[&<>"']/g,t=>td[t])}const Ot=class Ot extends Ti{static compare(t,e){const r=Ot.order.indexOf(t),s=Ot.order.indexOf(e);return r>=0||s>=0?r-s:t===e?0:t<e?-1:1}formatAt(t,e,r,s){if(Ot.compare(this.statics.blotName,r)<0&&this.scroll.query(r,C.BLOT)){const i=this.isolate(t,e);s&&i.wrap(r,s)}else super.formatAt(t,e,r,s)}optimize(t){if(super.optimize(t),this.parent instanceof Ot&&Ot.compare(this.statics.blotName,this.parent.statics.blotName)>0){const e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}};x(Ot,"allowedChildren",[Ot,wt,lt,At]),x(Ot,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let Rt=Ot;const El=1;class W extends _n{constructor(){super(...arguments);x(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=_o(this)),this.cache.delta}deleteAt(e,r){super.deleteAt(e,r),this.cache={}}formatAt(e,r,s,i){r<=0||(this.scroll.query(s,C.BLOCK)?e+r===this.length()&&this.format(s,i):super.formatAt(e,Math.min(r,this.length()-e-1),s,i),this.cache={})}insertAt(e,r,s){if(s!=null){super.insertAt(e,r,s),this.cache={};return}if(r.length===0)return;const i=r.split(`
`),l=i.shift();l.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),l):this.children.tail.insertAt(this.children.tail.length(),l),this.cache={});let a=this;i.reduce((c,h)=>(a=a.split(c,!0),a.insertAt(0,h),h.length),e+l.length)}insertBefore(e,r){const{head:s}=this.children;super.insertBefore(e,r),s instanceof wt&&s.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+El),this.cache.length}moveChildren(e,r){super.moveChildren(e,r),this.cache={}}optimize(e){super.optimize(e),this.cache={}}path(e){return super.path(e,!0)}removeChild(e){super.removeChild(e),this.cache={}}split(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(r&&(e===0||e>=this.length()-El)){const i=this.clone();return e===0?(this.parent.insertBefore(i,this),this):(this.parent.insertBefore(i,this.next),i)}const s=super.split(e,r);return this.cache={},s}}W.blotName="block";W.tagName="P";W.defaultChild=wt;W.allowedChildren=[wt,Rt,lt,At];class ht extends lt{attach(){super.attach(),this.attributes=new Cr(this.domNode)}delta(){return new O().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(t,e){const r=this.scroll.query(t,C.BLOCK_ATTRIBUTE);r!=null&&this.attributes.attribute(r,e)}formatAt(t,e,r,s){this.format(r,s)}insertAt(t,e,r){if(r!=null){super.insertAt(t,e,r);return}const s=e.split(`
`),i=s.pop(),l=s.map(c=>{const h=this.scroll.create(W.blotName);return h.insertAt(0,c),h}),a=this.split(t);l.forEach(c=>{this.parent.insertBefore(c,a)}),i&&this.parent.insertBefore(this.scroll.create("text",i),a)}}ht.scope=C.BLOCK_BLOT;function _o(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.descendants(Q).reduce((e,r)=>r.length()===0?e:e.insert(r.value(),ct(r,{},t)),new O).insert(`
`,ct(n))}function ct(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return n==null||("formats"in n&&typeof n.formats=="function"&&(t={...t,...n.formats()},e&&delete t["code-token"]),n.parent==null||n.parent.statics.blotName==="scroll"||n.parent.statics.scope!==n.statics.scope)?t:ct(n.parent,t,e)}const at=class at extends lt{static value(){}constructor(t,e,r){super(t,e),this.selection=r,this.textNode=document.createTextNode(at.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(t,e){if(this.savedLength!==0){super.format(t,e);return}let r=this,s=0;for(;r!=null&&r.statics.scope!==C.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=at.CONTENTS.length,r.optimize(),r.formatAt(s,at.CONTENTS.length,t,e),this.savedLength=0)}index(t,e){return t===this.textNode?0:super.index(t,e)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const t=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const e=this.prev instanceof At?this.prev:null,r=e?e.length():0,s=this.next instanceof At?this.next:null,i=s?s.text:"",{textNode:l}=this,a=l.data.split(at.CONTENTS).join("");l.data=at.CONTENTS;let c;if(e)c=e,(a||s)&&(e.insertAt(e.length(),a+i),s&&s.remove());else if(s)c=s,s.insertAt(0,a);else{const h=document.createTextNode(a);c=this.scroll.create(h),this.parent.insertBefore(c,this)}if(this.remove(),t){const h=(g,p)=>e&&g===e.domNode?p:g===l?r+p-1:s&&g===s.domNode?r+a.length+p:null,f=h(t.start.node,t.start.offset),b=h(t.end.node,t.end.offset);if(f!==null&&b!==null)return{startNode:c.domNode,startOffset:f,endNode:c.domNode,endOffset:b}}return null}update(t,e){if(t.some(r=>r.type==="characterData"&&r.target===this.textNode)){const r=this.restore();r&&(e.range=r)}}optimize(t){super.optimize(t);let{parent:e}=this;for(;e;){if(e.domNode.tagName==="A"){this.savedLength=at.CONTENTS.length,e.isolate(this.offset(e),this.length()).unwrap(),this.savedLength=0;break}e=e.parent}}value(){return""}};x(at,"blotName","cursor"),x(at,"className","ql-cursor"),x(at,"tagName","span"),x(at,"CONTENTS","\uFEFF");let Ve=at;var Oo={exports:{}};(function(n){var t=Object.prototype.hasOwnProperty,e="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(e=!1));function s(c,h,f){this.fn=c,this.context=h,this.once=f||!1}function i(c,h,f,b,g){if(typeof f!="function")throw new TypeError("The listener must be a function");var p=new s(f,b||c,g),m=e?e+h:h;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],p]:c._events[m].push(p):(c._events[m]=p,c._eventsCount++),c}function l(c,h){--c._eventsCount===0?c._events=new r:delete c._events[h]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var h=[],f,b;if(this._eventsCount===0)return h;for(b in f=this._events)t.call(f,b)&&h.push(e?b.slice(1):b);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(f)):h},a.prototype.listeners=function(h){var f=e?e+h:h,b=this._events[f];if(!b)return[];if(b.fn)return[b.fn];for(var g=0,p=b.length,m=new Array(p);g<p;g++)m[g]=b[g].fn;return m},a.prototype.listenerCount=function(h){var f=e?e+h:h,b=this._events[f];return b?b.fn?1:b.length:0},a.prototype.emit=function(h,f,b,g,p,m){var y=e?e+h:h;if(!this._events[y])return!1;var E=this._events[y],A=arguments.length,w,T;if(E.fn){switch(E.once&&this.removeListener(h,E.fn,void 0,!0),A){case 1:return E.fn.call(E.context),!0;case 2:return E.fn.call(E.context,f),!0;case 3:return E.fn.call(E.context,f,b),!0;case 4:return E.fn.call(E.context,f,b,g),!0;case 5:return E.fn.call(E.context,f,b,g,p),!0;case 6:return E.fn.call(E.context,f,b,g,p,m),!0}for(T=1,w=new Array(A-1);T<A;T++)w[T-1]=arguments[T];E.fn.apply(E.context,w)}else{var _=E.length,L;for(T=0;T<_;T++)switch(E[T].once&&this.removeListener(h,E[T].fn,void 0,!0),A){case 1:E[T].fn.call(E[T].context);break;case 2:E[T].fn.call(E[T].context,f);break;case 3:E[T].fn.call(E[T].context,f,b);break;case 4:E[T].fn.call(E[T].context,f,b,g);break;default:if(!w)for(L=1,w=new Array(A-1);L<A;L++)w[L-1]=arguments[L];E[T].fn.apply(E[T].context,w)}}return!0},a.prototype.on=function(h,f,b){return i(this,h,f,b,!1)},a.prototype.once=function(h,f,b){return i(this,h,f,b,!0)},a.prototype.removeListener=function(h,f,b,g){var p=e?e+h:h;if(!this._events[p])return this;if(!f)return l(this,p),this;var m=this._events[p];if(m.fn)m.fn===f&&(!g||m.once)&&(!b||m.context===b)&&l(this,p);else{for(var y=0,E=[],A=m.length;y<A;y++)(m[y].fn!==f||g&&!m[y].once||b&&m[y].context!==b)&&E.push(m[y]);E.length?this._events[p]=E.length===1?E[0]:E:l(this,p)}return this},a.prototype.removeAllListeners=function(h){var f;return h?(f=e?e+h:h,this._events[f]&&l(this,f)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=e,a.EventEmitter=a,n.exports=a})(Oo);var ed=Oo.exports;const nd=zl(ed),oi=new WeakMap,ai=["error","warn","log","info"];let ci="warn";function Co(n){if(ci&&ai.indexOf(n)<=ai.indexOf(ci)){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];console[n](...e)}}function Kt(n){return ai.reduce((t,e)=>(t[e]=Co.bind(console,e,n),t),{})}Kt.level=n=>{ci=n};Co.level=Kt.level;const js=Kt("quill:events"),rd=["selectionchange","mousedown","mouseup","click"];rd.forEach(n=>{document.addEventListener(n,function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach(s=>{const i=oi.get(s);i&&i.emitter&&i.emitter.handleDOM(...e)})})});class S extends nd{constructor(){super(),this.domListeners={},this.on("error",js.error)}emit(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return js.log.call(js,...e),super.emit(...e)}handleDOM(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),s=1;s<e;s++)r[s-1]=arguments[s];(this.domListeners[t.type]||[]).forEach(i=>{let{node:l,handler:a}=i;(t.target===l||l.contains(t.target))&&a(t,...r)})}listenDOM(t,e,r){this.domListeners[t]||(this.domListeners[t]=[]),this.domListeners[t].push({node:e,handler:r})}}x(S,"events",{EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"}),x(S,"sources",{API:"api",SILENT:"silent",USER:"user"});const Ps=Kt("quill:selection");class be{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=t,this.length=e}}class sd{constructor(t,e){this.emitter=e,this.scroll=t,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new be(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,S.sources.USER),1)}),this.emitter.on(S.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(S.events.SCROLL_UPDATE,(s,i)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const l=i.some(a=>a.type==="characterData"||a.type==="childList"||a.type==="attributes"&&a.target===this.root);this.update(l?S.sources.SILENT:s)}catch{}})}),this.emitter.on(S.events.SCROLL_OPTIMIZE,(r,s)=>{if(s.range){const{startNode:i,startOffset:l,endNode:a,endOffset:c}=s.range;this.setNativeRange(i,l,a,c),this.update(S.sources.SILENT)}}),this.update(S.sources.SILENT)}handleComposition(){this.emitter.on(S.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(S.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const t=this.cursor.restore();if(!t)return;setTimeout(()=>{this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(S.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(t,e){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(t,C.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof Q){const i=s.split(r.start.offset);s.parent.insertBefore(this.cursor,i)}else s.insertBefore(this.cursor,r.start.node);this.cursor.attach()}this.cursor.format(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.scroll.length();t=Math.min(t,r-1),e=Math.min(t+e,r-1)-t;let s,[i,l]=this.scroll.leaf(t);if(i==null)return null;if(e>0&&l===i.length()){const[f]=this.scroll.leaf(t+1);if(f){const[b]=this.scroll.line(t),[g]=this.scroll.line(t+1);b===g&&(i=f,l=0)}}[s,l]=i.position(l,!0);const a=document.createRange();if(e>0)return a.setStart(s,l),[i,l]=this.scroll.leaf(t+e),i==null?null:([s,l]=i.position(l,!0),a.setEnd(s,l),a.getBoundingClientRect());let c="left",h;if(s instanceof Text){if(!s.data.length)return null;l<s.data.length?(a.setStart(s,l),a.setEnd(s,l+1)):(a.setStart(s,l-1),a.setEnd(s,l),c="right"),h=a.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;h=i.domNode.getBoundingClientRect(),l>0&&(c="right")}return{bottom:h.top+h.height,height:h.height,left:h[c],right:h[c],top:h.top,width:0}}getNativeRange(){const t=document.getSelection();if(t==null||t.rangeCount<=0)return null;const e=t.getRangeAt(0);if(e==null)return null;const r=this.normalizeNative(e);return Ps.info("getNativeRange",r),r}getRange(){const t=this.scroll.domNode;if("isConnected"in t&&!t.isConnected)return[null,null];const e=this.getNativeRange();return e==null?[null,null]:[this.normalizedToRange(e),e]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&$s(this.root,document.activeElement)}normalizedToRange(t){const e=[[t.start.node,t.start.offset]];t.native.collapsed||e.push([t.end.node,t.end.offset]);const r=e.map(l=>{const[a,c]=l,h=this.scroll.find(a,!0),f=h.offset(this.scroll);return c===0?f:h instanceof Q?f+h.index(a,c):f+h.length()}),s=Math.min(Math.max(...r),this.scroll.length()-1),i=Math.min(s,...r);return new be(i,s-i)}normalizeNative(t){if(!$s(this.root,t.startContainer)||!t.collapsed&&!$s(this.root,t.endContainer))return null;const e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.end].forEach(r=>{let{node:s,offset:i}=r;for(;!(s instanceof Text)&&s.childNodes.length>0;)if(s.childNodes.length>i)s=s.childNodes[i],i=0;else if(s.childNodes.length===i)s=s.lastChild,s instanceof Text?i=s.data.length:s.childNodes.length>0?i=s.childNodes.length:i=s.childNodes.length+1;else break;r.node=s,r.offset=i}),e}rangeToNative(t){const e=this.scroll.length(),r=(s,i)=>{s=Math.min(e-1,s);const[l,a]=this.scroll.leaf(s);return l?l.position(a,i):[null,-1]};return[...r(t.index,!1),...r(t.index+t.length,!0)]}setNativeRange(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Ps.info("setNativeRange",t,e,r,s),t!=null&&(this.root.parentNode==null||t.parentNode==null||r.parentNode==null))return;const l=document.getSelection();if(l!=null)if(t!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:a}=this.getNativeRange()||{};if(a==null||i||t!==a.startContainer||e!==a.startOffset||r!==a.endContainer||s!==a.endOffset){t instanceof Element&&t.tagName==="BR"&&(e=Array.from(t.parentNode.childNodes).indexOf(t),t=t.parentNode),r instanceof Element&&r.tagName==="BR"&&(s=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const c=document.createRange();c.setStart(t,e),c.setEnd(r,s),l.removeAllRanges(),l.addRange(c)}}else l.removeAllRanges(),this.root.blur()}setRange(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:S.sources.API;if(typeof e=="string"&&(r=e,e=!1),Ps.info("setRange",t),t!=null){const s=this.rangeToNative(t);this.setNativeRange(...s,e)}else this.setNativeRange(null);this.update(r)}update(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:S.sources.USER;const e=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!Xt(e,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const l=this.cursor.restore();l&&this.setNativeRange(l.startNode,l.startOffset,l.endNode,l.endOffset)}const i=[S.events.SELECTION_CHANGE,Fe(this.lastRange),Fe(e),t];this.emitter.emit(S.events.EDITOR_CHANGE,...i),t!==S.sources.SILENT&&this.emitter.emit(...i)}}}function $s(n,t){try{t.parentNode}catch{return!1}return n.contains(t)}const id=/^[ -~]*$/;class ld{constructor(t){this.scroll=t,this.delta=this.getDelta()}applyDelta(t){this.scroll.update();let e=this.scroll.length();this.scroll.batchStart();const r=Al(t),s=new O;return ad(r.ops.slice()).reduce((l,a)=>{const c=ft.Op.length(a);let h=a.attributes||{},f=!1,b=!1;if(a.insert!=null){if(s.retain(c),typeof a.insert=="string"){const m=a.insert;b=!m.endsWith(`
`)&&(e<=l||!!this.scroll.descendant(ht,l)[0]),this.scroll.insertAt(l,m);const[y,E]=this.scroll.line(l);let A=te({},ct(y));if(y instanceof W){const[w]=y.descendant(Q,E);w&&(A=te(A,ct(w)))}h=ft.AttributeMap.diff(A,h)||{}}else if(typeof a.insert=="object"){const m=Object.keys(a.insert)[0];if(m==null)return l;const y=this.scroll.query(m,C.INLINE)!=null;if(y)(e<=l||this.scroll.descendant(ht,l)[0])&&(b=!0);else if(l>0){const[E,A]=this.scroll.descendant(Q,l-1);E instanceof At?E.value()[A]!==`
`&&(f=!0):E instanceof lt&&E.statics.scope===C.INLINE_BLOT&&(f=!0)}if(this.scroll.insertAt(l,m,a.insert[m]),y){const[E]=this.scroll.descendant(Q,l);if(E){const A=te({},ct(E));h=ft.AttributeMap.diff(A,h)||{}}}}e+=c}else if(s.push(a),a.retain!==null&&typeof a.retain=="object"){const m=Object.keys(a.retain)[0];if(m==null)return l;this.scroll.updateEmbedAt(l,m,a.retain[m])}Object.keys(h).forEach(m=>{this.scroll.formatAt(l,c,m,h[m])});const g=f?1:0,p=b?1:0;return e+=g+p,s.retain(g),s.delete(p),l+c+g+p},0),s.reduce((l,a)=>typeof a.delete=="number"?(this.scroll.deleteAt(l,a.delete),l):l+ft.Op.length(a),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(t,e){return this.scroll.deleteAt(t,e),this.update(new O().retain(t).delete(e))}formatLine(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(r).forEach(i=>{this.scroll.lines(t,Math.max(e,1)).forEach(l=>{l.format(i,r[i])})}),this.scroll.optimize();const s=new O().retain(t).retain(e,Fe(r));return this.update(s)}formatText(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(r).forEach(i=>{this.scroll.formatAt(t,e,i,r[i])});const s=new O().retain(t).retain(e,Fe(r));return this.update(s)}getContents(t,e){return this.delta.slice(t,t+e)}getDelta(){return this.scroll.lines().reduce((t,e)=>t.concat(e.delta()),new O)}getFormat(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=[],s=[];e===0?this.scroll.path(t).forEach(a=>{const[c]=a;c instanceof W?r.push(c):c instanceof Q&&s.push(c)}):(r=this.scroll.lines(t,e),s=this.scroll.descendants(Q,t,e));const[i,l]=[r,s].map(a=>{const c=a.shift();if(c==null)return{};let h=ct(c);for(;Object.keys(h).length>0;){const f=a.shift();if(f==null)return h;h=od(ct(f),h)}return h});return{...i,...l}}getHTML(t,e){const[r,s]=this.scroll.line(t);if(r){const i=r.length();return r.length()>=s+e&&!(s===0&&e===i)?Cn(r,s,e,!0):Cn(this.scroll,t,e,!0)}return""}getText(t,e){return this.getContents(t,e).filter(r=>typeof r.insert=="string").map(r=>r.insert).join("")}insertContents(t,e){const r=Al(e),s=new O().retain(t).concat(r);return this.scroll.insertContents(t,r),this.update(s)}insertEmbed(t,e,r){return this.scroll.insertAt(t,e,r),this.update(new O().retain(t).insert({[e]:r}))}insertText(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e=e.replace(/\r\n/g,`
`).replace(/\r/g,`
`),this.scroll.insertAt(t,e),Object.keys(r).forEach(s=>{this.scroll.formatAt(t,e.length,s,r[s])}),this.update(new O().retain(t).insert(e,Fe(r)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const t=this.scroll.children.head;if(t?.statics.blotName!==W.blotName)return!1;const e=t;return e.children.length>1?!1:e.children.head instanceof wt}removeFormat(t,e){const r=this.getText(t,e),[s,i]=this.scroll.line(t+e);let l=0,a=new O;s!=null&&(l=s.length()-i,a=s.delta().slice(i,i+l-1).insert(`
`));const h=this.getContents(t,e+l).diff(new O().insert(r).concat(a)),f=new O().retain(t).concat(h);return this.applyDelta(f)}update(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const s=this.delta;if(e.length===1&&e[0].type==="characterData"&&e[0].target.data.match(id)&&this.scroll.find(e[0].target)){const i=this.scroll.find(e[0].target),l=ct(i),a=i.offset(this.scroll),c=e[0].oldValue.replace(Ve.CONTENTS,""),h=new O().insert(c),f=new O().insert(i.value()),b=r&&{oldRange:Nl(r.oldRange,-a),newRange:Nl(r.newRange,-a)};t=new O().retain(a).concat(h.diff(f,b)).reduce((p,m)=>m.insert?p.insert(m.insert,l):p.push(m),new O),this.delta=s.compose(t)}else this.delta=this.getDelta(),(!t||!Xt(s.compose(t),this.delta))&&(t=s.diff(this.delta,r));return t}}function Pe(n,t,e){if(n.length===0){const[p]=Us(e.pop());return t<=0?`</li></${p}>`:`</li></${p}>${Pe([],t-1,e)}`}const[{child:r,offset:s,length:i,indent:l,type:a},...c]=n,[h,f]=Us(a);if(l>t)return e.push(a),l===t+1?`<${h}><li${f}>${Cn(r,s,i)}${Pe(c,l,e)}`:`<${h}><li>${Pe(n,t+1,e)}`;const b=e[e.length-1];if(l===t&&a===b)return`</li><li${f}>${Cn(r,s,i)}${Pe(c,l,e)}`;const[g]=Us(e.pop());return`</li></${g}>${Pe(n,t-1,e)}`}function Cn(n,t,e){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in n&&typeof n.html=="function")return n.html(t,e);if(n instanceof At)return Br(n.value().slice(t,t+e)).replaceAll(" ","&nbsp;");if(n instanceof Et){if(n.statics.blotName==="list-container"){const h=[];return n.children.forEachAt(t,e,(f,b,g)=>{const p="formats"in f&&typeof f.formats=="function"?f.formats():{};h.push({child:f,offset:b,length:g,indent:p.indent||0,type:p.list})}),Pe(h,-1,[])}const s=[];if(n.children.forEachAt(t,e,(h,f,b)=>{s.push(Cn(h,f,b))}),r||n.statics.blotName==="list")return s.join("");const{outerHTML:i,innerHTML:l}=n.domNode,[a,c]=i.split(`>${l}<`);return a==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${c}`:`${a}>${s.join("")}<${c}`}return n.domNode instanceof Element?n.domNode.outerHTML:""}function od(n,t){return Object.keys(t).reduce((e,r)=>{if(n[r]==null)return e;const s=t[r];return s===n[r]?e[r]=s:Array.isArray(s)?s.indexOf(n[r])<0?e[r]=s.concat([n[r]]):e[r]=s:e[r]=[s,n[r]],e},{})}function Us(n){const t=n==="ordered"?"ol":"ul";switch(n){case"checked":return[t,' data-list="checked"'];case"unchecked":return[t,' data-list="unchecked"'];default:return[t,""]}}function Al(n){return n.reduce((t,e)=>{if(typeof e.insert=="string"){const r=e.insert.replace(/\r\n/g,`
`).replace(/\r/g,`
`);return t.insert(r,e.attributes)}return t.push(e)},new O)}function Nl(n,t){let{index:e,length:r}=n;return new be(e+t,r)}function ad(n){const t=[];return n.forEach(e=>{typeof e.insert=="string"?e.insert.split(`
`).forEach((s,i)=>{i&&t.push({insert:`
`,attributes:e.attributes}),s&&t.push({insert:s,attributes:e.attributes})}):t.push(e)}),t}class Tt{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=t,this.options=e}}x(Tt,"DEFAULTS",{});const dr="\uFEFF";class Ci extends lt{constructor(t,e){super(t,e),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(r=>{this.contentNode.appendChild(r)}),this.leftGuard=document.createTextNode(dr),this.rightGuard=document.createTextNode(dr),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(t,e){return t===this.leftGuard?0:t===this.rightGuard?1:super.index(t,e)}restore(t){let e=null,r;const s=t.data.split(dr).join("");if(t===this.leftGuard)if(this.prev instanceof At){const i=this.prev.length();this.prev.insertAt(i,s),e={startNode:this.prev.domNode,startOffset:i+s.length}}else r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this),e={startNode:r,startOffset:s.length};else t===this.rightGuard&&(this.next instanceof At?(this.next.insertAt(0,s),e={startNode:this.next.domNode,startOffset:s.length}):(r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this.next),e={startNode:r,startOffset:s.length}));return t.data=dr,e}update(t,e){t.forEach(r=>{if(r.type==="characterData"&&(r.target===this.leftGuard||r.target===this.rightGuard)){const s=this.restore(r.target);s&&(e.range=s)}})}}class cd{constructor(t,e){x(this,"isComposing",!1);this.scroll=t,this.emitter=e,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",t=>{this.isComposing||this.handleCompositionStart(t)}),this.scroll.domNode.addEventListener("compositionend",t=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(t)})})}handleCompositionStart(t){const e=t.target instanceof Node?this.scroll.find(t.target,!0):null;e&&!(e instanceof Ci)&&(this.emitter.emit(S.events.COMPOSITION_BEFORE_START,t),this.scroll.batchStart(),this.emitter.emit(S.events.COMPOSITION_START,t),this.isComposing=!0)}handleCompositionEnd(t){this.emitter.emit(S.events.COMPOSITION_BEFORE_END,t),this.scroll.batchEnd(),this.emitter.emit(S.events.COMPOSITION_END,t),this.isComposing=!1}}const wn=class wn{constructor(t,e){x(this,"modules",{});this.quill=t,this.options=e}init(){Object.keys(this.options.modules).forEach(t=>{this.modules[t]==null&&this.addModule(t)})}addModule(t){const e=this.quill.constructor.import(`modules/${t}`);return this.modules[t]=new e(this.quill,this.options.modules[t]||{}),this.modules[t]}};x(wn,"DEFAULTS",{modules:{}}),x(wn,"themes",{default:wn});let We=wn;const ud=n=>n.parentElement||n.getRootNode().host||null,hd=n=>{const t=n.getBoundingClientRect(),e="offsetWidth"in n&&Math.abs(t.width)/n.offsetWidth||1,r="offsetHeight"in n&&Math.abs(t.height)/n.offsetHeight||1;return{top:t.top,right:t.left+n.clientWidth*e,bottom:t.top+n.clientHeight*r,left:t.left}},gr=n=>{const t=parseInt(n,10);return Number.isNaN(t)?0:t},wl=(n,t,e,r,s,i)=>n<e&&t>r?0:n<e?-(e-n+s):t>r?t-n>r-e?n+s-e:t-r+i:0,fd=(n,t)=>{const e=n.ownerDocument;let r=t,s=n;for(;s;){const i=s===e.body,l=i?{top:0,right:window.visualViewport?.width??e.documentElement.clientWidth,bottom:window.visualViewport?.height??e.documentElement.clientHeight,left:0}:hd(s),a=getComputedStyle(s),c=wl(r.left,r.right,l.left,l.right,gr(a.scrollPaddingLeft),gr(a.scrollPaddingRight)),h=wl(r.top,r.bottom,l.top,l.bottom,gr(a.scrollPaddingTop),gr(a.scrollPaddingBottom));if(c||h)if(i)e.defaultView?.scrollBy(c,h);else{const{scrollLeft:f,scrollTop:b}=s;h&&(s.scrollTop+=h),c&&(s.scrollLeft+=c);const g=s.scrollLeft-f,p=s.scrollTop-b;r={left:r.left-g,top:r.top-p,right:r.right-g,bottom:r.bottom-p}}s=i||a.position==="fixed"?null:ud(s)}},dd=100,gd=["block","break","cursor","inline","scroll","text"],pd=(n,t,e)=>{const r=new Ge;return gd.forEach(s=>{const i=t.query(s);i&&r.register(i)}),n.forEach(s=>{let i=t.query(s);i||e.error(`Cannot register "${s}" specified in "formats" config. Are you sure it was registered?`);let l=0;for(;i;)if(r.register(i),i="blotName"in i?i.requiredContainer??null:null,l+=1,l>dd){e.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),r},ze=Kt("quill"),pr=new Ge;Et.uiClass="ql-ui";var st;let N=(st=class{static debug(t){t===!0&&(t="log"),Kt.level(t)}static find(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return oi.get(t)||pr.find(t,e)}static import(t){return this.imports[t]==null&&ze.error(`Cannot import ${t}. Are you sure it was registered?`),this.imports[t]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const t=arguments.length<=0?void 0:arguments[0],e=!!(!(arguments.length<=1)&&arguments[1]),r="attrName"in t?t.attrName:t.blotName;typeof r=="string"?this.register(`formats/${r}`,t,e):Object.keys(t).forEach(s=>{this.register(s,t[s],e)})}else{const t=arguments.length<=0?void 0:arguments[0],e=arguments.length<=1?void 0:arguments[1],r=!!(!(arguments.length<=2)&&arguments[2]);this.imports[t]!=null&&!r&&ze.warn(`Overwriting ${t} with`,e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&e&&typeof e!="boolean"&&e.blotName!=="abstract"&&pr.register(e),typeof e.register=="function"&&e.register(pr)}}constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=md(t,e),this.container=this.options.container,this.container==null){ze.error("Invalid Quill container",t);return}this.options.debug&&st.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",oi.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new S;const s=xi.blotName,i=this.options.registry.query(s);if(!i||!("blotName"in i))throw new Error(`Cannot initialize Quill without "${s}" blot`);if(this.scroll=new i(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new ld(this.scroll),this.selection=new sd(this.scroll,this.emitter),this.composition=new cd(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(S.events.EDITOR_CHANGE,l=>{l===S.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(S.events.SCROLL_UPDATE,(l,a)=>{const c=this.selection.lastRange,[h]=this.selection.getRange(),f=c&&h?{oldRange:c,newRange:h}:void 0;bt.call(this,()=>this.editor.update(null,a,f),l)}),this.emitter.on(S.events.SCROLL_EMBED_UPDATE,(l,a)=>{const c=this.selection.lastRange,[h]=this.selection.getRange(),f=c&&h?{oldRange:c,newRange:h}:void 0;bt.call(this,()=>{const b=new O().retain(l.offset(this)).retain({[l.statics.blotName]:a});return this.editor.update(b,[],f)},st.sources.USER)}),r){const l=this.clipboard.convert({html:`${r}<p><br></p>`,text:`
`});this.setContents(l)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof t=="string"){const r=t;t=document.createElement("div"),t.classList.add(r)}return this.container.insertBefore(t,e),t}blur(){this.selection.setRange(null)}deleteText(t,e,r){return[t,e,,r]=$t(t,e,r),bt.call(this,()=>this.editor.deleteText(t,e),r,t,-1*e)}disable(){this.enable(!1)}editReadOnly(t){this.allowReadOnlyEdits=!0;const e=t();return this.allowReadOnlyEdits=!1,e}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}focus(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),t.preventScroll||this.scrollSelectionIntoView()}format(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:S.sources.API;return bt.call(this,()=>{const s=this.getSelection(!0);let i=new O;if(s==null)return i;if(this.scroll.query(t,C.BLOCK))i=this.editor.formatLine(s.index,s.length,{[t]:e});else{if(s.length===0)return this.selection.format(t,e),i;i=this.editor.formatText(s.index,s.length,{[t]:e})}return this.setSelection(s,S.sources.SILENT),i},r)}formatLine(t,e,r,s,i){let l;return[t,e,l,i]=$t(t,e,r,s,i),bt.call(this,()=>this.editor.formatLine(t,e,l),i,t,0)}formatText(t,e,r,s,i){let l;return[t,e,l,i]=$t(t,e,r,s,i),bt.call(this,()=>this.editor.formatText(t,e,l),i,t,0)}getBounds(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=null;if(typeof t=="number"?r=this.selection.getBounds(t,e):r=this.selection.getBounds(t.index,t.length),!r)return null;const s=this.container.getBoundingClientRect();return{bottom:r.bottom-s.top,height:r.height,left:r.left-s.left,right:r.right-s.left,top:r.top-s.top,width:r.width}}getContents(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-t;return[t,e]=$t(t,e),this.editor.getContents(t,e)}getFormat(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof t=="number"?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}getIndex(t){return t.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(t){return this.scroll.leaf(t)}getLine(t){return this.scroll.line(t)}getLines(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof t!="number"?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}getModule(t){return this.theme.modules[t]}getSelection(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return typeof t=="number"&&(e=e??this.getLength()-t),[t,e]=$t(t,e),this.editor.getHTML(t,e)}getText(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return typeof t=="number"&&(e=e??this.getLength()-t),[t,e]=$t(t,e),this.editor.getText(t,e)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,e,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:st.sources.API;return bt.call(this,()=>this.editor.insertEmbed(t,e,r),s,t)}insertText(t,e,r,s,i){let l;return[t,,l,i]=$t(t,0,r,s,i),bt.call(this,()=>this.editor.insertText(t,e,l),i,t,e.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(t,e,r){return[t,e,,r]=$t(t,e,r),bt.call(this,()=>this.editor.removeFormat(t,e),r,t)}scrollRectIntoView(t){fd(this.root,t)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const t=this.selection.lastRange,e=t&&this.selection.getBounds(t.index,t.length);e&&this.scrollRectIntoView(e)}setContents(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S.sources.API;return bt.call(this,()=>{t=new O(t);const r=this.getLength(),s=this.editor.deleteText(0,r),i=this.editor.insertContents(0,t),l=this.editor.deleteText(this.getLength()-1,1);return s.compose(i).compose(l)},e)}setSelection(t,e,r){t==null?this.selection.setRange(null,e||st.sources.API):([t,e,,r]=$t(t,e,r),this.selection.setRange(new be(Math.max(0,t),e),r),r!==S.sources.SILENT&&this.scrollSelectionIntoView())}setText(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S.sources.API;const r=new O().insert(t);return this.setContents(r,e)}update(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:S.sources.USER;const e=this.scroll.update(t);return this.selection.update(t),e}updateContents(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S.sources.API;return bt.call(this,()=>(t=new O(t),this.editor.applyDelta(t)),e,!0)}},x(st,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:pr,theme:"default"}),x(st,"events",S.events),x(st,"sources",S.sources),x(st,"version","2.0.3"),x(st,"imports",{delta:O,parchment:$f,"core/module":Tt,"core/theme":We}),st);function Tl(n){return typeof n=="string"?document.querySelector(n):n}function Fs(n){return Object.entries(n??{}).reduce((t,e)=>{let[r,s]=e;return{...t,[r]:s===!0?{}:s}},{})}function xl(n){return Object.fromEntries(Object.entries(n).filter(t=>t[1]!==void 0))}function md(n,t){const e=Tl(n);if(!e)throw new Error("Invalid Quill container");const s=!t.theme||t.theme===N.DEFAULTS.theme?We:N.import(`themes/${t.theme}`);if(!s)throw new Error(`Invalid theme ${t.theme}. Did you register it?`);const{modules:i,...l}=N.DEFAULTS,{modules:a,...c}=s.DEFAULTS;let h=Fs(t.modules);h!=null&&h.toolbar&&h.toolbar.constructor!==Object&&(h={...h,toolbar:{container:h.toolbar}});const f=te({},Fs(i),Fs(a),h),b={...l,...xl(c),...xl(t)};let g=t.registry;return g?t.formats&&ze.warn('Ignoring "formats" option because "registry" is specified'):g=t.formats?pd(t.formats,b.registry,ze):b.registry,{...b,registry:g,container:e,theme:s,modules:Object.entries(f).reduce((p,m)=>{let[y,E]=m;if(!E)return p;const A=N.import(`modules/${y}`);return A==null?(ze.error(`Cannot load ${y} module. Are you sure you registered it?`),p):{...p,[y]:te({},A.DEFAULTS||{},E)}},{}),bounds:Tl(b.bounds)}}function bt(n,t,e,r){if(!this.isEnabled()&&t===S.sources.USER&&!this.allowReadOnlyEdits)return new O;let s=e==null?null:this.getSelection();const i=this.editor.delta,l=n();if(s!=null&&(e===!0&&(e=s.index),r==null?s=Ll(s,l,t):r!==0&&(s=Ll(s,e,r,t)),this.setSelection(s,S.sources.SILENT)),l.length()>0){const a=[S.events.TEXT_CHANGE,l,i,t];this.emitter.emit(S.events.EDITOR_CHANGE,...a),t!==S.sources.SILENT&&this.emitter.emit(...a)}return l}function $t(n,t,e,r,s){let i={};return typeof n.index=="number"&&typeof n.length=="number"?typeof t!="number"?(s=r,r=e,e=t,t=n.length,n=n.index):(t=n.length,n=n.index):typeof t!="number"&&(s=r,r=e,e=t,t=0),typeof e=="object"?(i=e,s=r):typeof e=="string"&&(r!=null?i[e]=r:s=e),s=s||S.sources.API,[n,t,i,s]}function Ll(n,t,e,r){const s=typeof e=="number"?e:0;if(n==null)return null;let i,l;return t&&typeof t.transformPosition=="function"?[i,l]=[n.index,n.index+n.length].map(a=>t.transformPosition(a,r!==S.sources.USER)):[i,l]=[n.index,n.index+n.length].map(a=>a<t||a===t&&r===S.sources.USER?a:s>=0?a+s:Math.max(t,a+s)),new be(i,l-i)}class Ae extends qr{}function Sl(n){return n instanceof W||n instanceof ht}function _l(n){return typeof n.updateContent=="function"}class $e extends xi{constructor(t,e,r){let{emitter:s}=r;super(t,e),this.emitter=s,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",i=>this.handleDragStart(i))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const t=this.batch;this.batch=!1,this.update(t)}emitMount(t){this.emitter.emit(S.events.SCROLL_BLOT_MOUNT,t)}emitUnmount(t){this.emitter.emit(S.events.SCROLL_BLOT_UNMOUNT,t)}emitEmbedUpdate(t,e){this.emitter.emit(S.events.SCROLL_EMBED_UPDATE,t,e)}deleteAt(t,e){const[r,s]=this.line(t),[i]=this.line(t+e);if(super.deleteAt(t,e),i!=null&&r!==i&&s>0){if(r instanceof ht||i instanceof ht){this.optimize();return}const l=i.children.head instanceof wt?null:i.children.head;r.moveChildren(i,l),r.remove()}this.optimize()}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",t?"true":"false")}formatAt(t,e,r,s){super.formatAt(t,e,r,s),this.optimize()}insertAt(t,e,r){if(t>=this.length())if(r==null||this.scroll.query(e,C.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),r==null&&e.endsWith(`
`)?s.insertAt(0,e.slice(0,-1),r):s.insertAt(0,e,r)}else{const s=this.scroll.create(e,r);this.appendChild(s)}else super.insertAt(t,e,r);this.optimize()}insertBefore(t,e){if(t.statics.scope===C.INLINE_BLOT){const r=this.scroll.create(this.statics.defaultChild.blotName);r.appendChild(t),super.insertBefore(r,e)}else super.insertBefore(t,e)}insertContents(t,e){const r=this.deltaToRenderBlocks(e.concat(new O().insert(`
`))),s=r.pop();if(s==null)return;this.batchStart();const i=r.shift();if(i){const c=i.type==="block"&&(i.delta.length()===0||!this.descendant(ht,t)[0]&&t<this.length()),h=i.type==="block"?i.delta:new O().insert({[i.key]:i.value});Hs(this,t,h);const f=i.type==="block"?1:0,b=t+h.length()+f;c&&this.insertAt(b-1,`
`);const g=ct(this.line(t)[0]),p=ft.AttributeMap.diff(g,i.attributes)||{};Object.keys(p).forEach(m=>{this.formatAt(b-1,1,m,p[m])}),t=b}let[l,a]=this.children.find(t);if(r.length&&(l&&(l=l.split(a),a=0),r.forEach(c=>{if(c.type==="block"){const h=this.createBlock(c.attributes,l||void 0);Hs(h,0,c.delta)}else{const h=this.create(c.key,c.value);this.insertBefore(h,l||void 0),Object.keys(c.attributes).forEach(f=>{h.format(f,c.attributes[f])})}})),s.type==="block"&&s.delta.length()){const c=l?l.offset(l.scroll)+a:this.length();Hs(this,c,s.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(t){const e=this.path(t).pop();if(!e)return[null,-1];const[r,s]=e;return r instanceof Q?[r,s]:[null,-1]}line(t){return t===this.length()?this.line(t-1):this.descendant(Sl,t)}lines(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const r=(s,i,l)=>{let a=[],c=l;return s.children.forEachAt(i,l,(h,f,b)=>{Sl(h)?a.push(h):h instanceof qr&&(a=a.concat(r(h,f,c))),c-=b}),a};return r(this,t,e)}optimize(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(t,e),t.length>0&&this.emitter.emit(S.events.SCROLL_OPTIMIZE,t,e))}path(t){return super.path(t).slice(1)}remove(){}update(t){if(this.batch){Array.isArray(t)&&(this.batch=this.batch.concat(t));return}let e=S.sources.USER;typeof t=="string"&&(e=t),Array.isArray(t)||(t=this.observer.takeRecords()),t=t.filter(r=>{let{target:s}=r;const i=this.find(s,!0);return i&&!_l(i)}),t.length>0&&this.emitter.emit(S.events.SCROLL_BEFORE_UPDATE,e,t),super.update(t.concat([])),t.length>0&&this.emitter.emit(S.events.SCROLL_UPDATE,e,t)}updateEmbedAt(t,e,r){const[s]=this.descendant(i=>i instanceof ht,t);s&&s.statics.blotName===e&&_l(s)&&s.updateContent(r)}handleDragStart(t){t.preventDefault()}deltaToRenderBlocks(t){const e=[];let r=new O;return t.forEach(s=>{const i=s?.insert;if(i)if(typeof i=="string"){const l=i.split(`
`);l.slice(0,-1).forEach(c=>{r.insert(c,s.attributes),e.push({type:"block",delta:r,attributes:s.attributes??{}}),r=new O});const a=l[l.length-1];a&&r.insert(a,s.attributes)}else{const l=Object.keys(i)[0];if(!l)return;this.query(l,C.INLINE)?r.push(s):(r.length()&&e.push({type:"block",delta:r,attributes:{}}),r=new O,e.push({type:"blockEmbed",key:l,value:i[l],attributes:s.attributes??{}}))}}),r.length()&&e.push({type:"block",delta:r,attributes:{}}),e}createBlock(t,e){let r;const s={};Object.entries(t).forEach(a=>{let[c,h]=a;this.query(c,C.BLOCK&C.BLOT)!=null?r=c:s[c]=h});const i=this.create(r||this.statics.defaultChild.blotName,r?t[r]:void 0);this.insertBefore(i,e||void 0);const l=i.length();return Object.entries(s).forEach(a=>{let[c,h]=a;i.formatAt(0,l,c,h)}),i}}x($e,"blotName","scroll"),x($e,"className","ql-editor"),x($e,"tagName","DIV"),x($e,"defaultChild",W),x($e,"allowedChildren",[W,ht,Ae]);function Hs(n,t,e){e.reduce((r,s)=>{const i=ft.Op.length(s);let l=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const a=s.insert;n.insertAt(r,a);const[c]=n.descendant(Q,r),h=ct(c);l=ft.AttributeMap.diff(h,l)||{}}else if(typeof s.insert=="object"){const a=Object.keys(s.insert)[0];if(a==null)return r;if(n.insertAt(r,a,s.insert[a]),n.scroll.query(a,C.INLINE)!=null){const[h]=n.descendant(Q,r),f=ct(h);l=ft.AttributeMap.diff(f,l)||{}}}}return Object.keys(l).forEach(a=>{n.formatAt(r,i,a,l[a])}),r+i},t)}const qi={scope:C.BLOCK,whitelist:["right","center","justify"]},bd=new It("align","align",qi),qo=new Nt("align","ql-align",qi),Io=new re("align","text-align",qi);class Ro extends re{value(t){let e=super.value(t);return e.startsWith("rgb(")?(e=e.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${e.split(",").map(s=>`00${parseInt(s,10).toString(16)}`.slice(-2)).join("")}`):e}}const yd=new Nt("color","ql-color",{scope:C.INLINE}),Ii=new Ro("color","color",{scope:C.INLINE}),vd=new Nt("background","ql-bg",{scope:C.INLINE}),Ri=new Ro("background","background-color",{scope:C.INLINE});class Ne extends Ae{static create(t){const e=super.create(t);return e.setAttribute("spellcheck","false"),e}code(t,e){return this.children.map(r=>r.length()<=1?"":r.domNode.innerText).join(`
`).slice(t,t+e)}html(t,e){return`<pre>
${Br(this.code(t,e))}
</pre>`}}class J extends W{static register(){N.register(Ne)}}x(J,"TAB"," ");class ki extends Rt{}ki.blotName="code";ki.tagName="CODE";J.blotName="code-block";J.className="ql-code-block";J.tagName="DIV";Ne.blotName="code-block-container";Ne.className="ql-code-block-container";Ne.tagName="DIV";Ne.allowedChildren=[J];J.allowedChildren=[At,wt,Ve];J.requiredContainer=Ne;const Bi={scope:C.BLOCK,whitelist:["rtl"]},ko=new It("direction","dir",Bi),Bo=new Nt("direction","ql-direction",Bi),Mo=new re("direction","direction",Bi),Do={scope:C.INLINE,whitelist:["serif","monospace"]},jo=new Nt("font","ql-font",Do);class Ed extends re{value(t){return super.value(t).replace(/["']/g,"")}}const Po=new Ed("font","font-family",Do),$o=new Nt("size","ql-size",{scope:C.INLINE,whitelist:["small","large","huge"]}),Uo=new re("size","font-size",{scope:C.INLINE,whitelist:["10px","18px","32px"]}),Ad=Kt("quill:keyboard"),Nd=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Mr extends Tt{static match(t,e){return["altKey","ctrlKey","metaKey","shiftKey"].some(r=>!!e[r]!==t[r]&&e[r]!==null)?!1:e.key===t.key||e.key===t.which}constructor(t,e){super(t,e),this.bindings={},Object.keys(this.options.bindings).forEach(r=>{this.options.bindings[r]&&this.addBinding(this.options.bindings[r])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=Td(t);if(s==null){Ad.warn("Attempted to add invalid keyboard binding",s);return}typeof e=="function"&&(e={handler:e}),typeof r=="function"&&(r={handler:r}),(Array.isArray(s.key)?s.key:[s.key]).forEach(l=>{const a={...s,key:l,...e,...r};this.bindings[a.key]=this.bindings[a.key]||[],this.bindings[a.key].push(a)})}listen(){this.quill.root.addEventListener("keydown",t=>{if(t.defaultPrevented||t.isComposing||t.keyCode===229&&(t.key==="Enter"||t.key==="Backspace"))return;const s=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]).filter(A=>Mr.match(t,A));if(s.length===0)return;const i=N.find(t.target,!0);if(i&&i.scroll!==this.quill.scroll)return;const l=this.quill.getSelection();if(l==null||!this.quill.hasFocus())return;const[a,c]=this.quill.getLine(l.index),[h,f]=this.quill.getLeaf(l.index),[b,g]=l.length===0?[h,f]:this.quill.getLeaf(l.index+l.length),p=h instanceof Tr?h.value().slice(0,f):"",m=b instanceof Tr?b.value().slice(g):"",y={collapsed:l.length===0,empty:l.length===0&&a.length()<=1,format:this.quill.getFormat(l),line:a,offset:c,prefix:p,suffix:m,event:t};s.some(A=>{if(A.collapsed!=null&&A.collapsed!==y.collapsed||A.empty!=null&&A.empty!==y.empty||A.offset!=null&&A.offset!==y.offset)return!1;if(Array.isArray(A.format)){if(A.format.every(w=>y.format[w]==null))return!1}else if(typeof A.format=="object"&&!Object.keys(A.format).every(w=>A.format[w]===!0?y.format[w]!=null:A.format[w]===!1?y.format[w]==null:Xt(A.format[w],y.format[w])))return!1;return A.prefix!=null&&!A.prefix.test(y.prefix)||A.suffix!=null&&!A.suffix.test(y.suffix)?!1:A.handler.call(this,l,y,A)!==!0})&&t.preventDefault()})}handleBackspace(t,e){const r=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;if(t.index===0||this.quill.getLength()<=1)return;let s={};const[i]=this.quill.getLine(t.index);let l=new O().retain(t.index-r).delete(r);if(e.offset===0){const[a]=this.quill.getLine(t.index-1);if(a&&!(a.statics.blotName==="block"&&a.length()<=1)){const h=i.formats(),f=this.quill.getFormat(t.index-1,1);if(s=ft.AttributeMap.diff(h,f)||{},Object.keys(s).length>0){const b=new O().retain(t.index+i.length()-2).retain(1,s);l=l.compose(b)}}}this.quill.updateContents(l,N.sources.USER),this.quill.focus()}handleDelete(t,e){const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(t.index>=this.quill.getLength()-r)return;let s={};const[i]=this.quill.getLine(t.index);let l=new O().retain(t.index).delete(r);if(e.offset>=i.length()-1){const[a]=this.quill.getLine(t.index+1);if(a){const c=i.formats(),h=this.quill.getFormat(t.index,1);s=ft.AttributeMap.diff(c,h)||{},Object.keys(s).length>0&&(l=l.retain(a.length()-1).retain(1,s))}}this.quill.updateContents(l,N.sources.USER),this.quill.focus()}handleDeleteRange(t){Mi({range:t,quill:this.quill}),this.quill.focus()}handleEnter(t,e){const r=Object.keys(e.format).reduce((i,l)=>(this.quill.scroll.query(l,C.BLOCK)&&!Array.isArray(e.format[l])&&(i[l]=e.format[l]),i),{}),s=new O().retain(t.index).delete(t.length).insert(`
`,r);this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(t.index+1,N.sources.SILENT),this.quill.focus()}}const wd={bindings:{bold:zs("bold"),italic:zs("italic"),underline:zs("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(n,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","+1",N.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(n,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","-1",N.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(n,t){t.format.indent!=null?this.quill.format("indent","-1",N.sources.USER):t.format.list!=null&&this.quill.format("list",!1,N.sources.USER)}},"indent code-block":Ol(!0),"outdent code-block":Ol(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(n){this.quill.deleteText(n.index-1,1,N.sources.USER)}},tab:{key:"Tab",handler(n,t){if(t.format.table)return!0;this.quill.history.cutoff();const e=new O().retain(n.index).delete(n.length).insert(" ");return this.quill.updateContents(e,N.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index+1,N.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,N.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(n,t){const e={list:!1};t.format.indent&&(e.indent=!1),this.quill.formatLine(n.index,n.length,e,N.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(n){const[t,e]=this.quill.getLine(n.index),r={...t.formats(),list:"checked"},s=new O().retain(n.index).insert(`
`,r).retain(t.length()-e-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(n.index+1,N.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(n,t){const[e,r]=this.quill.getLine(n.index),s=new O().retain(n.index).insert(`
`,t.format).retain(e.length()-r-1).retain(1,{header:null});this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(n.index+1,N.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(n){const t=this.quill.getModule("table");if(t){const[e,r,s,i]=t.getTable(n),l=xd(e,r,s,i);if(l==null)return;let a=e.offset();if(l<0){const c=new O().retain(a).insert(`
`);this.quill.updateContents(c,N.sources.USER),this.quill.setSelection(n.index+1,n.length,N.sources.SILENT)}else if(l>0){a+=e.length();const c=new O().retain(a).insert(`
`);this.quill.updateContents(c,N.sources.USER),this.quill.setSelection(a,N.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(n,t){const{event:e,line:r}=t,s=r.offset(this.quill.scroll);e.shiftKey?this.quill.setSelection(s-1,N.sources.USER):this.quill.setSelection(s+r.length(),N.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(n,t){if(this.quill.scroll.query("list")==null)return!0;const{length:e}=t.prefix,[r,s]=this.quill.getLine(n.index);if(s>e)return!0;let i;switch(t.prefix.trim()){case"[]":case"[ ]":i="unchecked";break;case"[x]":i="checked";break;case"-":case"*":i="bullet";break;default:i="ordered"}this.quill.insertText(n.index," ",N.sources.USER),this.quill.history.cutoff();const l=new O().retain(n.index-s).delete(e+1).retain(r.length()-2-s).retain(1,{list:i});return this.quill.updateContents(l,N.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index-e,N.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(n){const[t,e]=this.quill.getLine(n.index);let r=2,s=t;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,r-=1,r<=0){const i=new O().retain(n.index+t.length()-e-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(i,N.sources.USER),this.quill.setSelection(n.index-1,N.sources.SILENT),!1}return!0}},"embed left":mr("ArrowLeft",!1),"embed left shift":mr("ArrowLeft",!0),"embed right":mr("ArrowRight",!1),"embed right shift":mr("ArrowRight",!0),"table down":Cl(!1),"table up":Cl(!0)}};Mr.DEFAULTS=wd;function Ol(n){return{key:"Tab",shiftKey:!n,format:{"code-block":!0},handler(t,e){let{event:r}=e;const s=this.quill.scroll.query("code-block"),{TAB:i}=s;if(t.length===0&&!r.shiftKey){this.quill.insertText(t.index,i,N.sources.USER),this.quill.setSelection(t.index+i.length,N.sources.SILENT);return}const l=t.length===0?this.quill.getLines(t.index,1):this.quill.getLines(t);let{index:a,length:c}=t;l.forEach((h,f)=>{n?(h.insertAt(0,i),f===0?a+=i.length:c+=i.length):h.domNode.textContent.startsWith(i)&&(h.deleteAt(0,i.length),f===0?a-=i.length:c-=i.length)}),this.quill.update(N.sources.USER),this.quill.setSelection(a,c,N.sources.SILENT)}}}function mr(n,t){return{key:n,shiftKey:t,altKey:null,[n==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(r){let{index:s}=r;n==="ArrowRight"&&(s+=r.length+1);const[i]=this.quill.getLeaf(s);return i instanceof lt?(n==="ArrowLeft"?t?this.quill.setSelection(r.index-1,r.length+1,N.sources.USER):this.quill.setSelection(r.index-1,N.sources.USER):t?this.quill.setSelection(r.index,r.length+1,N.sources.USER):this.quill.setSelection(r.index+r.length+1,N.sources.USER),!1):!0}}}function zs(n){return{key:n[0],shortKey:!0,handler(t,e){this.quill.format(n,!e.format[n],N.sources.USER)}}}function Cl(n){return{key:n?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(t,e){const r=n?"prev":"next",s=e.line,i=s.parent[r];if(i!=null){if(i.statics.blotName==="table-row"){let l=i.children.head,a=s;for(;a.prev!=null;)a=a.prev,l=l.next;const c=l.offset(this.quill.scroll)+Math.min(e.offset,l.length()-1);this.quill.setSelection(c,0,N.sources.USER)}}else{const l=s.table()[r];l!=null&&(n?this.quill.setSelection(l.offset(this.quill.scroll)+l.length()-1,0,N.sources.USER):this.quill.setSelection(l.offset(this.quill.scroll),0,N.sources.USER))}return!1}}}function Td(n){if(typeof n=="string"||typeof n=="number")n={key:n};else if(typeof n=="object")n=Fe(n);else return null;return n.shortKey&&(n[Nd]=n.shortKey,delete n.shortKey),n}function Mi(n){let{quill:t,range:e}=n;const r=t.getLines(e);let s={};if(r.length>1){const i=r[0].formats(),l=r[r.length-1].formats();s=ft.AttributeMap.diff(l,i)||{}}t.deleteText(e,N.sources.USER),Object.keys(s).length>0&&t.formatLine(e.index,1,s,N.sources.USER),t.setSelection(e.index,N.sources.SILENT)}function xd(n,t,e,r){return t.prev==null&&t.next==null?e.prev==null&&e.next==null?r===0?-1:1:e.prev==null?-1:1:t.prev==null?-1:t.next==null?1:null}const Ld=/font-weight:\s*normal/,Sd=["P","OL","UL"],ql=n=>n&&Sd.includes(n.tagName),_d=n=>{Array.from(n.querySelectorAll("br")).filter(t=>ql(t.previousElementSibling)&&ql(t.nextElementSibling)).forEach(t=>{t.parentNode?.removeChild(t)})},Od=n=>{Array.from(n.querySelectorAll('b[style*="font-weight"]')).filter(t=>t.getAttribute("style")?.match(Ld)).forEach(t=>{const e=n.createDocumentFragment();e.append(...t.childNodes),t.parentNode?.replaceChild(e,t)})};function Cd(n){n.querySelector('[id^="docs-internal-guid-"]')&&(Od(n),_d(n))}const qd=/\bmso-list:[^;]*ignore/i,Id=/\bmso-list:[^;]*\bl(\d+)/i,Rd=/\bmso-list:[^;]*\blevel(\d+)/i,kd=(n,t)=>{const e=n.getAttribute("style"),r=e?.match(Id);if(!r)return null;const s=Number(r[1]),i=e?.match(Rd),l=i?Number(i[1]):1,a=new RegExp(`@list l${s}:level${l}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),c=t.match(a),h=c&&c[1]==="bullet"?"bullet":"ordered";return{id:s,indent:l,type:h,element:n}},Bd=n=>{const t=Array.from(n.querySelectorAll("[style*=mso-list]")),e=[],r=[];t.forEach(l=>{(l.getAttribute("style")||"").match(qd)?e.push(l):r.push(l)}),e.forEach(l=>l.parentNode?.removeChild(l));const s=n.documentElement.innerHTML,i=r.map(l=>kd(l,s)).filter(l=>l);for(;i.length;){const l=[];let a=i.shift();for(;a;)l.push(a),a=i.length&&i[0]?.element===a.element.nextElementSibling&&i[0].id===a.id?i.shift():null;const c=document.createElement("ul");l.forEach(b=>{const g=document.createElement("li");g.setAttribute("data-list",b.type),b.indent>1&&g.setAttribute("class",`ql-indent-${b.indent-1}`),g.innerHTML=b.element.innerHTML,c.appendChild(g)});const h=l[0]?.element,{parentNode:f}=h??{};h&&f?.replaceChild(c,h),l.slice(1).forEach(b=>{let{element:g}=b;f?.removeChild(g)})}};function Md(n){n.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&Bd(n)}const Dd=[Md,Cd],jd=n=>{n.documentElement&&Dd.forEach(t=>{t(n)})},Pd=Kt("quill:clipboard"),$d=[[Node.TEXT_NODE,Qd],[Node.TEXT_NODE,Rl],["br",Kd],[Node.ELEMENT_NODE,Rl],[Node.ELEMENT_NODE,zd],[Node.ELEMENT_NODE,Hd],[Node.ELEMENT_NODE,Xd],["li",Wd],["ol, ul",Zd],["pre",Gd],["tr",Yd],["b",Ks("bold")],["i",Ks("italic")],["strike",Ks("strike")],["style",Vd]],Ud=[bd,ko].reduce((n,t)=>(n[t.keyName]=t,n),{}),Il=[Io,Ri,Ii,Mo,Po,Uo].reduce((n,t)=>(n[t.keyName]=t,n),{});class Fo extends Tt{constructor(t,e){super(t,e),this.quill.root.addEventListener("copy",r=>this.onCaptureCopy(r,!1)),this.quill.root.addEventListener("cut",r=>this.onCaptureCopy(r,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],$d.concat(this.options.matchers??[]).forEach(r=>{let[s,i]=r;this.addMatcher(s,i)})}addMatcher(t,e){this.matchers.push([t,e])}convert(t){let{html:e,text:r}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s[J.blotName])return new O().insert(r||"",{[J.blotName]:s[J.blotName]});if(!e)return new O().insert(r||"",s);const i=this.convertHTML(e);return kn(i,`
`)&&(i.ops[i.ops.length-1].attributes==null||s.table)?i.compose(new O().retain(i.length()-1).delete(1)):i}normalizeHTML(t){jd(t)}convertHTML(t){const e=new DOMParser().parseFromString(t,"text/html");this.normalizeHTML(e);const r=e.body,s=new WeakMap,[i,l]=this.prepareMatching(r,s);return Di(this.quill.scroll,r,i,l,s)}dangerouslyPasteHTML(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:N.sources.API;if(typeof t=="string"){const s=this.convert({html:t,text:""});this.quill.setContents(s,e),this.quill.setSelection(0,N.sources.SILENT)}else{const s=this.convert({html:e,text:""});this.quill.updateContents(new O().retain(t).concat(s),r),this.quill.setSelection(t+s.length(),N.sources.SILENT)}}onCaptureCopy(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t.defaultPrevented)return;t.preventDefault();const[r]=this.quill.selection.getRange();if(r==null)return;const{html:s,text:i}=this.onCopy(r,e);t.clipboardData?.setData("text/plain",i),t.clipboardData?.setData("text/html",s),e&&Mi({range:r,quill:this.quill})}normalizeURIList(t){return t.split(/\r?\n/).filter(e=>e[0]!=="#").join(`
`)}onCapturePaste(t){if(t.defaultPrevented||!this.quill.isEnabled())return;t.preventDefault();const e=this.quill.getSelection(!0);if(e==null)return;const r=t.clipboardData?.getData("text/html");let s=t.clipboardData?.getData("text/plain");if(!r&&!s){const l=t.clipboardData?.getData("text/uri-list");l&&(s=this.normalizeURIList(l))}const i=Array.from(t.clipboardData?.files||[]);if(!r&&i.length>0){this.quill.uploader.upload(e,i);return}if(r&&i.length>0){const l=new DOMParser().parseFromString(r,"text/html");if(l.body.childElementCount===1&&l.body.firstElementChild?.tagName==="IMG"){this.quill.uploader.upload(e,i);return}}this.onPaste(e,{html:r,text:s})}onCopy(t){const e=this.quill.getText(t);return{html:this.quill.getSemanticHTML(t),text:e}}onPaste(t,e){let{text:r,html:s}=e;const i=this.quill.getFormat(t.index),l=this.convert({text:r,html:s},i);Pd.log("onPaste",l,{text:r,html:s});const a=new O().retain(t.index).delete(t.length).concat(l);this.quill.updateContents(a,N.sources.USER),this.quill.setSelection(a.length()-t.length,N.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(t,e){const r=[],s=[];return this.matchers.forEach(i=>{const[l,a]=i;switch(l){case Node.TEXT_NODE:s.push(a);break;case Node.ELEMENT_NODE:r.push(a);break;default:Array.from(t.querySelectorAll(l)).forEach(c=>{e.has(c)?e.get(c)?.push(a):e.set(c,[a])});break}}),[r,s]}}x(Fo,"DEFAULTS",{matchers:[]});function we(n,t,e,r){return r.query(t)?n.reduce((s,i)=>{if(!i.insert)return s;if(i.attributes&&i.attributes[t])return s.push(i);const l=e?{[t]:e}:{};return s.insert(i.insert,{...l,...i.attributes})},new O):n}function kn(n,t){let e="";for(let r=n.ops.length-1;r>=0&&e.length<t.length;--r){const s=n.ops[r];if(typeof s.insert!="string")break;e=s.insert+e}return e.slice(-1*t.length)===t}function Qt(n,t){if(!(n instanceof Element))return!1;const e=t.query(n);return e&&e.prototype instanceof lt?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(n.tagName.toLowerCase())}function Fd(n,t){return n.previousElementSibling&&n.nextElementSibling&&!Qt(n.previousElementSibling,t)&&!Qt(n.nextElementSibling,t)}const br=new WeakMap;function Ho(n){return n==null?!1:(br.has(n)||(n.tagName==="PRE"?br.set(n,!0):br.set(n,Ho(n.parentNode))),br.get(n))}function Di(n,t,e,r,s){return t.nodeType===t.TEXT_NODE?r.reduce((i,l)=>l(t,i,n),new O):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce((i,l)=>{let a=Di(n,l,e,r,s);return l.nodeType===t.ELEMENT_NODE&&(a=e.reduce((c,h)=>h(l,c,n),a),a=(s.get(l)||[]).reduce((c,h)=>h(l,c,n),a)),i.concat(a)},new O):new O}function Ks(n){return(t,e,r)=>we(e,n,!0,r)}function Hd(n,t,e){const r=It.keys(n),s=Nt.keys(n),i=re.keys(n),l={};return r.concat(s).concat(i).forEach(a=>{let c=e.query(a,C.ATTRIBUTE);c!=null&&(l[c.attrName]=c.value(n),l[c.attrName])||(c=Ud[a],c!=null&&(c.attrName===a||c.keyName===a)&&(l[c.attrName]=c.value(n)||void 0),c=Il[a],c!=null&&(c.attrName===a||c.keyName===a)&&(c=Il[a],l[c.attrName]=c.value(n)||void 0))}),Object.entries(l).reduce((a,c)=>{let[h,f]=c;return we(a,h,f,e)},t)}function zd(n,t,e){const r=e.query(n);if(r==null)return t;if(r.prototype instanceof lt){const s={},i=r.value(n);if(i!=null)return s[r.blotName]=i,new O().insert(s,r.formats(n,e))}else if(r.prototype instanceof _n&&!kn(t,`
`)&&t.insert(`
`),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return we(t,r.blotName,r.formats(n,e),e);return t}function Kd(n,t){return kn(t,`
`)||t.insert(`
`),t}function Gd(n,t,e){const r=e.query("code-block"),s=r&&"formats"in r&&typeof r.formats=="function"?r.formats(n,e):!0;return we(t,"code-block",s,e)}function Vd(){return new O}function Wd(n,t,e){const r=e.query(n);if(r==null||r.blotName!=="list"||!kn(t,`
`))return t;let s=-1,i=n.parentNode;for(;i!=null;)["OL","UL"].includes(i.tagName)&&(s+=1),i=i.parentNode;return s<=0?t:t.reduce((l,a)=>a.insert?a.attributes&&typeof a.attributes.indent=="number"?l.push(a):l.insert(a.insert,{indent:s,...a.attributes||{}}):l,new O)}function Zd(n,t,e){const r=n;let s=r.tagName==="OL"?"ordered":"bullet";const i=r.getAttribute("data-checked");return i&&(s=i==="true"?"checked":"unchecked"),we(t,"list",s,e)}function Rl(n,t,e){if(!kn(t,`
`)){if(Qt(n,e)&&(n.childNodes.length>0||n instanceof HTMLParagraphElement))return t.insert(`
`);if(t.length()>0&&n.nextSibling){let r=n.nextSibling;for(;r!=null;){if(Qt(r,e))return t.insert(`
`);const s=e.query(r);if(s&&s.prototype instanceof ht)return t.insert(`
`);r=r.firstChild}}}return t}function Xd(n,t,e){const r={},s=n.style||{};return s.fontStyle==="italic"&&(r.italic=!0),s.textDecoration==="underline"&&(r.underline=!0),s.textDecoration==="line-through"&&(r.strike=!0),(s.fontWeight?.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(r.bold=!0),t=Object.entries(r).reduce((i,l)=>{let[a,c]=l;return we(i,a,c,e)},t),parseFloat(s.textIndent||0)>0?new O().insert(" ").concat(t):t}function Yd(n,t,e){const r=n.parentElement?.tagName==="TABLE"?n.parentElement:n.parentElement?.parentElement;if(r!=null){const i=Array.from(r.querySelectorAll("tr")).indexOf(n)+1;return we(t,"table",i,e)}return t}function Qd(n,t,e){let r=n.data;if(n.parentElement?.tagName==="O:P")return t.insert(r.trim());if(!Ho(n)){if(r.trim().length===0&&r.includes(`
`)&&!Fd(n,e))return t;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(n.previousSibling==null&&n.parentElement!=null&&Qt(n.parentElement,e)||n.previousSibling instanceof Element&&Qt(n.previousSibling,e))&&(r=r.replace(/^ /,"")),(n.nextSibling==null&&n.parentElement!=null&&Qt(n.parentElement,e)||n.nextSibling instanceof Element&&Qt(n.nextSibling,e))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return t.insert(r)}class zo extends Tt{constructor(e,r){super(e,r);x(this,"lastRecorded",0);x(this,"ignoreChange",!1);x(this,"stack",{undo:[],redo:[]});x(this,"currentRange",null);this.quill.on(N.events.EDITOR_CHANGE,(s,i,l,a)=>{s===N.events.SELECTION_CHANGE?i&&a!==N.sources.SILENT&&(this.currentRange=i):s===N.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||a===N.sources.USER?this.record(i,l):this.transform(i)),this.currentRange=ui(this.currentRange,i))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",s=>{s.inputType==="historyUndo"?(this.undo(),s.preventDefault()):s.inputType==="historyRedo"&&(this.redo(),s.preventDefault())})}change(e,r){if(this.stack[e].length===0)return;const s=this.stack[e].pop();if(!s)return;const i=this.quill.getContents(),l=s.delta.invert(i);this.stack[r].push({delta:l,range:ui(s.range,l)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(s.delta,N.sources.USER),this.ignoreChange=!1,this.restoreSelection(s)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,r){if(e.ops.length===0)return;this.stack.redo=[];let s=e.invert(r),i=this.currentRange;const l=Date.now();if(this.lastRecorded+this.options.delay>l&&this.stack.undo.length>0){const a=this.stack.undo.pop();a&&(s=s.compose(a.delta),i=a.range)}else this.lastRecorded=l;s.length()!==0&&(this.stack.undo.push({delta:s,range:i}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){kl(this.stack.undo,e),kl(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,N.sources.USER);else{const r=tg(this.quill.scroll,e.delta);this.quill.setSelection(r,N.sources.USER)}}}x(zo,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function kl(n,t){let e=t;for(let r=n.length-1;r>=0;r-=1){const s=n[r];n[r]={delta:e.transform(s.delta,!0),range:s.range&&ui(s.range,e)},e=s.delta.transform(e),n[r].delta.length()===0&&n.splice(r,1)}}function Jd(n,t){const e=t.ops[t.ops.length-1];return e==null?!1:e.insert!=null?typeof e.insert=="string"&&e.insert.endsWith(`
`):e.attributes!=null?Object.keys(e.attributes).some(r=>n.query(r,C.BLOCK)!=null):!1}function tg(n,t){const e=t.reduce((s,i)=>s+(i.delete||0),0);let r=t.length()-e;return Jd(n,t)&&(r-=1),r}function ui(n,t){if(!n)return n;const e=t.transformPosition(n.index),r=t.transformPosition(n.index+n.length);return{index:e,length:r-e}}class Ko extends Tt{constructor(t,e){super(t,e),t.root.addEventListener("drop",r=>{r.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const l=document.caretPositionFromPoint(r.clientX,r.clientY);s=document.createRange(),s.setStart(l.offsetNode,l.offset),s.setEnd(l.offsetNode,l.offset)}const i=s&&t.selection.normalizeNative(s);if(i){const l=t.selection.normalizedToRange(i);r.dataTransfer?.files&&this.upload(l,r.dataTransfer.files)}})}upload(t,e){const r=[];Array.from(e).forEach(s=>{s&&this.options.mimetypes?.includes(s.type)&&r.push(s)}),r.length>0&&this.options.handler.call(this,t,r)}}Ko.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(n,t){if(!this.quill.scroll.query("image"))return;const e=t.map(r=>new Promise(s=>{const i=new FileReader;i.onload=()=>{s(i.result)},i.readAsDataURL(r)}));Promise.all(e).then(r=>{const s=r.reduce((i,l)=>i.insert({image:l}),new O().retain(n.index).delete(n.length));this.quill.updateContents(s,S.sources.USER),this.quill.setSelection(n.index+r.length,S.sources.SILENT)})}};const eg=["insertText","insertReplacementText"];class ng extends Tt{constructor(t,e){super(t,e),t.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||t.on(N.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(t){Mi({range:t,quill:this.quill})}replaceText(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(t.length===0)return!1;if(e){const r=this.quill.getFormat(t.index,1);this.deleteRange(t),this.quill.updateContents(new O().retain(t.index).insert(e,r),N.sources.USER)}else this.deleteRange(t);return this.quill.setSelection(t.index+e.length,0,N.sources.SILENT),!0}handleBeforeInput(t){if(this.quill.composition.isComposing||t.defaultPrevented||!eg.includes(t.inputType))return;const e=t.getTargetRanges?t.getTargetRanges()[0]:null;if(!e||e.collapsed===!0)return;const r=rg(t);if(r==null)return;const s=this.quill.selection.normalizeNative(e),i=s?this.quill.selection.normalizedToRange(s):null;i&&this.replaceText(i,r)&&t.preventDefault()}handleCompositionStart(){const t=this.quill.getSelection();t&&this.replaceText(t)}}function rg(n){return typeof n.data=="string"?n.data:n.dataTransfer?.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const sg=/Mac/i.test(navigator.platform),ig=100,lg=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||sg&&n.key==="a"&&n.ctrlKey===!0);class og extends Tt{constructor(e,r){super(e,r);x(this,"isListening",!1);x(this,"selectionChangeDeadline",0);this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,r){let{line:s,event:i}=r;if(!(s instanceof Et)||!s.uiNode)return!0;const l=getComputedStyle(s.domNode).direction==="rtl";return l&&i.key!=="ArrowRight"||!l&&i.key!=="ArrowLeft"?!0:(this.quill.setSelection(e.index-1,e.length+(i.shiftKey?1:0),N.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",e=>{!e.defaultPrevented&&lg(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+ig,this.isListening)return;this.isListening=!0;const e=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",e,{once:!0})}handleSelectionChange(){const e=document.getSelection();if(!e)return;const r=e.getRangeAt(0);if(r.collapsed!==!0||r.startOffset!==0)return;const s=this.quill.scroll.find(r.startContainer);if(!(s instanceof Et)||!s.uiNode)return;const i=document.createRange();i.setStartAfter(s.uiNode),i.setEndAfter(s.uiNode),e.removeAllRanges(),e.addRange(i)}}N.register({"blots/block":W,"blots/block/embed":ht,"blots/break":wt,"blots/container":Ae,"blots/cursor":Ve,"blots/embed":Ci,"blots/inline":Rt,"blots/scroll":$e,"blots/text":At,"modules/clipboard":Fo,"modules/history":zo,"modules/keyboard":Mr,"modules/uploader":Ko,"modules/input":ng,"modules/uiNode":og});class ag extends Nt{add(t,e){let r=0;if(e==="+1"||e==="-1"){const s=this.value(t)||0;r=e==="+1"?s+1:s-1}else typeof e=="number"&&(r=e);return r===0?(this.remove(t),!0):super.add(t,r.toString())}canAdd(t,e){return super.canAdd(t,e)||super.canAdd(t,parseInt(e,10))}value(t){return parseInt(super.value(t),10)||void 0}}const cg=new ag("indent","ql-indent",{scope:C.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class hi extends W{}x(hi,"blotName","blockquote"),x(hi,"tagName","blockquote");class fi extends W{static formats(t){return this.tagName.indexOf(t.tagName)+1}}x(fi,"blotName","header"),x(fi,"tagName",["H1","H2","H3","H4","H5","H6"]);class Bn extends Ae{}Bn.blotName="list-container";Bn.tagName="OL";class Mn extends W{static create(t){const e=super.create();return e.setAttribute("data-list",t),e}static formats(t){return t.getAttribute("data-list")||void 0}static register(){N.register(Bn)}constructor(t,e){super(t,e);const r=e.ownerDocument.createElement("span"),s=i=>{if(!t.isEnabled())return;const l=this.statics.formats(e,t);l==="checked"?(this.format("list","unchecked"),i.preventDefault()):l==="unchecked"&&(this.format("list","checked"),i.preventDefault())};r.addEventListener("mousedown",s),r.addEventListener("touchstart",s),this.attachUI(r)}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-list",e):super.format(t,e)}}Mn.blotName="list";Mn.tagName="LI";Bn.allowedChildren=[Mn];Mn.requiredContainer=Bn;class qn extends Rt{static create(){return super.create()}static formats(){return!0}optimize(t){super.optimize(t),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}x(qn,"blotName","bold"),x(qn,"tagName",["STRONG","B"]);class di extends qn{}x(di,"blotName","italic"),x(di,"tagName",["EM","I"]);class Jt extends Rt{static create(t){const e=super.create(t);return e.setAttribute("href",this.sanitize(t)),e.setAttribute("rel","noopener noreferrer"),e.setAttribute("target","_blank"),e}static formats(t){return t.getAttribute("href")}static sanitize(t){return Go(t,this.PROTOCOL_WHITELIST)?t:this.SANITIZED_URL}format(t,e){t!==this.statics.blotName||!e?super.format(t,e):this.domNode.setAttribute("href",this.constructor.sanitize(e))}}x(Jt,"blotName","link"),x(Jt,"tagName","A"),x(Jt,"SANITIZED_URL","about:blank"),x(Jt,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function Go(n,t){const e=document.createElement("a");e.href=n;const r=e.href.slice(0,e.href.indexOf(":"));return t.indexOf(r)>-1}class gi extends Rt{static create(t){return t==="super"?document.createElement("sup"):t==="sub"?document.createElement("sub"):super.create(t)}static formats(t){if(t.tagName==="SUB")return"sub";if(t.tagName==="SUP")return"super"}}x(gi,"blotName","script"),x(gi,"tagName",["SUB","SUP"]);class pi extends qn{}x(pi,"blotName","strike"),x(pi,"tagName",["S","STRIKE"]);class mi extends Rt{}x(mi,"blotName","underline"),x(mi,"tagName","U");class vr extends Ci{static create(t){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const e=super.create(t);return typeof t=="string"&&(window.katex.render(t,e,{throwOnError:!1,errorColor:"#f00"}),e.setAttribute("data-value",t)),e}static value(t){return t.getAttribute("data-value")}html(){const{formula:t}=this.value();return`<span>${t}</span>`}}x(vr,"blotName","formula"),x(vr,"className","ql-formula"),x(vr,"tagName","SPAN");const Bl=["alt","height","width"];class bi extends lt{static create(t){const e=super.create(t);return typeof t=="string"&&e.setAttribute("src",this.sanitize(t)),e}static formats(t){return Bl.reduce((e,r)=>(t.hasAttribute(r)&&(e[r]=t.getAttribute(r)),e),{})}static match(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}static sanitize(t){return Go(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,e){Bl.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}}x(bi,"blotName","image"),x(bi,"tagName","IMG");const Ml=["height","width"];class Er extends ht{static create(t){const e=super.create(t);return e.setAttribute("frameborder","0"),e.setAttribute("allowfullscreen","true"),e.setAttribute("src",this.sanitize(t)),e}static formats(t){return Ml.reduce((e,r)=>(t.hasAttribute(r)&&(e[r]=t.getAttribute(r)),e),{})}static sanitize(t){return Jt.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,e){Ml.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}html(){const{video:t}=this.value();return`<a href="${t}">${t}</a>`}}x(Er,"blotName","video"),x(Er,"className","ql-video"),x(Er,"tagName","IFRAME");const vn=new Nt("code-token","hljs",{scope:C.INLINE});class Ft extends Rt{static formats(t,e){for(;t!=null&&t!==e.domNode;){if(t.classList&&t.classList.contains(J.className))return super.formats(t,e);t=t.parentNode}}constructor(t,e,r){super(t,e,r),vn.add(this.domNode,r)}format(t,e){t!==Ft.blotName?super.format(t,e):e?vn.add(this.domNode,e):(vn.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),vn.value(this.domNode)||this.unwrap()}}Ft.blotName="code-token";Ft.className="ql-token";class ut extends J{static create(t){const e=super.create(t);return typeof t=="string"&&e.setAttribute("data-language",t),e}static formats(t){return t.getAttribute("data-language")||"plain"}static register(){}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-language",e):super.format(t,e)}replaceWith(t,e){return this.formatAt(0,this.length(),Ft.blotName,!1),super.replaceWith(t,e)}}class Nn extends Ne{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(t,e){t===ut.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(t,e)}))}formatAt(t,e,r,s){r===ut.blotName&&(this.forceNext=!0),super.formatAt(t,e,r,s)}highlight(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const s=`${Array.from(this.domNode.childNodes).filter(l=>l!==this.uiNode).map(l=>l.textContent).join(`
`)}
`,i=ut.formats(this.children.head.domNode);if(e||this.forceNext||this.cachedText!==s){if(s.trim().length>0||this.cachedText==null){const l=this.children.reduce((c,h)=>c.concat(_o(h,!1)),new O),a=t(s,i);l.diff(a).reduce((c,h)=>{let{retain:f,attributes:b}=h;return f?(b&&Object.keys(b).forEach(g=>{[ut.blotName,Ft.blotName].includes(g)&&this.formatAt(c,f,g,b[g])}),c+f):c},0)}this.cachedText=s,this.forceNext=!1}}html(t,e){const[r]=this.children.find(t);return`<pre data-language="${r?ut.formats(r.domNode):"plain"}">
${Br(this.code(t,e))}
</pre>`}optimize(t){if(super.optimize(t),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const e=ut.formats(this.children.head.domNode);e!==this.uiNode.value&&(this.uiNode.value=e)}}}Nn.allowedChildren=[ut];ut.requiredContainer=Nn;ut.allowedChildren=[Ft,Ve,At,wt];const ug=(n,t,e)=>{if(typeof n.versionString=="string"){const r=n.versionString.split(".")[0];if(parseInt(r,10)>=11)return n.highlight(e,{language:t}).value}return n.highlight(t,e).value};class Vo extends Tt{static register(){N.register(Ft,!0),N.register(ut,!0),N.register(Nn,!0)}constructor(t,e){if(super(t,e),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((r,s)=>{let{key:i}=s;return r[i]=!0,r},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(N.events.SCROLL_BLOT_MOUNT,t=>{if(!(t instanceof Nn))return;const e=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(r=>{let{key:s,label:i}=r;const l=e.ownerDocument.createElement("option");l.textContent=i,l.setAttribute("value",s),e.appendChild(l)}),e.addEventListener("change",()=>{t.format(ut.blotName,e.value),this.quill.root.focus(),this.highlight(t,!0)}),t.uiNode==null&&(t.attachUI(e),t.children.head&&(e.value=ut.formats(t.children.head.domNode)))})}initTimer(){let t=null;this.quill.on(N.events.SCROLL_OPTIMIZE,()=>{t&&clearTimeout(t),t=setTimeout(()=>{this.highlight(),t=null},this.options.interval)})}highlight(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(N.sources.USER);const r=this.quill.getSelection();(t==null?this.quill.scroll.descendants(Nn):[t]).forEach(i=>{i.highlight(this.highlightBlot,e)}),this.quill.update(N.sources.SILENT),r!=null&&this.quill.setSelection(r,N.sources.SILENT)}highlightBlot(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(e=this.languages[e]?e:"plain",e==="plain")return Br(t).split(`
`).reduce((s,i,l)=>(l!==0&&s.insert(`
`,{[J.blotName]:e}),s.insert(i)),new O);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(J.className),r.innerHTML=ug(this.options.hljs,e,t),Di(this.quill.scroll,r,[(s,i)=>{const l=vn.value(s);return l?i.compose(new O().retain(i.length(),{[Ft.blotName]:l})):i}],[(s,i)=>s.data.split(`
`).reduce((l,a,c)=>(c!==0&&l.insert(`
`,{[J.blotName]:e}),l.insert(a)),i)],new WeakMap)}}Vo.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};const Tn=class Tn extends W{static create(t){const e=super.create();return t?e.setAttribute("data-row",t):e.setAttribute("data-row",ji()),e}static formats(t){if(t.hasAttribute("data-row"))return t.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(t,e){t===Tn.blotName&&e?this.domNode.setAttribute("data-row",e):super.format(t,e)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}};x(Tn,"blotName","table"),x(Tn,"tagName","TD");let vt=Tn;class Ht extends Ae{checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const t=this.children.head.formats(),e=this.children.tail.formats(),r=this.next.children.head.formats(),s=this.next.children.tail.formats();return t.table===e.table&&t.table===r.table&&t.table===s.table}return!1}optimize(t){super.optimize(t),this.children.forEach(e=>{if(e.next==null)return;const r=e.formats(),s=e.next.formats();if(r.table!==s.table){const i=this.splitAfter(e);i&&i.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}x(Ht,"blotName","table-row"),x(Ht,"tagName","TR");class qt extends Ae{}x(qt,"blotName","table-body"),x(qt,"tagName","TBODY");class Ze extends Ae{balanceCells(){const t=this.descendants(Ht),e=t.reduce((r,s)=>Math.max(s.children.length,r),0);t.forEach(r=>{new Array(e-r.children.length).fill(0).forEach(()=>{let s;r.children.head!=null&&(s=vt.formats(r.children.head.domNode));const i=this.scroll.create(vt.blotName,s);r.appendChild(i),i.optimize()})})}cells(t){return this.rows().map(e=>e.children.at(t))}deleteColumn(t){const[e]=this.descendant(qt);e==null||e.children.head==null||e.children.forEach(r=>{const s=r.children.at(t);s?.remove()})}insertColumn(t){const[e]=this.descendant(qt);e==null||e.children.head==null||e.children.forEach(r=>{const s=r.children.at(t),i=vt.formats(r.children.head.domNode),l=this.scroll.create(vt.blotName,i);r.insertBefore(l,s)})}insertRow(t){const[e]=this.descendant(qt);if(e==null||e.children.head==null)return;const r=ji(),s=this.scroll.create(Ht.blotName);e.children.head.children.forEach(()=>{const l=this.scroll.create(vt.blotName,r);s.appendChild(l)});const i=e.children.at(t);e.insertBefore(s,i)}rows(){const t=this.children.head;return t==null?[]:t.children.map(e=>e)}}x(Ze,"blotName","table-container"),x(Ze,"tagName","TABLE");Ze.allowedChildren=[qt];qt.requiredContainer=Ze;qt.allowedChildren=[Ht];Ht.requiredContainer=qt;Ht.allowedChildren=[vt];vt.requiredContainer=Ht;function ji(){return`row-${Math.random().toString(36).slice(2,6)}`}class hg extends Tt{static register(){N.register(vt),N.register(Ht),N.register(qt),N.register(Ze)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Ze).forEach(t=>{t.balanceCells()})}deleteColumn(){const[t,,e]=this.getTable();e!=null&&(t.deleteColumn(e.cellOffset()),this.quill.update(N.sources.USER))}deleteRow(){const[,t]=this.getTable();t!=null&&(t.remove(),this.quill.update(N.sources.USER))}deleteTable(){const[t]=this.getTable();if(t==null)return;const e=t.offset();t.remove(),this.quill.update(N.sources.USER),this.quill.setSelection(e,N.sources.SILENT)}getTable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(t==null)return[null,null,null,-1];const[e,r]=this.quill.getLine(t.index);if(e==null||e.statics.blotName!==vt.blotName)return[null,null,null,-1];const s=e.parent;return[s.parent.parent,s,e,r]}insertColumn(t){const e=this.quill.getSelection();if(!e)return;const[r,s,i]=this.getTable(e);if(i==null)return;const l=i.cellOffset();r.insertColumn(l+t),this.quill.update(N.sources.USER);let a=s.rowOffset();t===0&&(a+=1),this.quill.setSelection(e.index+a,e.length,N.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(t){const e=this.quill.getSelection();if(!e)return;const[r,s,i]=this.getTable(e);if(i==null)return;const l=s.rowOffset();r.insertRow(l+t),this.quill.update(N.sources.USER),t>0?this.quill.setSelection(e,N.sources.SILENT):this.quill.setSelection(e.index+s.children.length,e.length,N.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(t,e){const r=this.quill.getSelection();if(r==null)return;const s=new Array(t).fill(0).reduce(i=>{const l=new Array(e).fill(`
`).join("");return i.insert(l,{table:ji()})},new O().retain(r.index));this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(r.index,N.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(N.events.SCROLL_OPTIMIZE,t=>{t.some(e=>["TD","TR","TBODY","TABLE"].includes(e.target.tagName)?(this.quill.once(N.events.TEXT_CHANGE,(r,s,i)=>{i===N.sources.USER&&this.balanceTables()}),!0):!1)})}}const Dl=Kt("quill:toolbar");class Pi extends Tt{constructor(t,e){if(super(t,e),Array.isArray(this.options.container)){const r=document.createElement("div");r.setAttribute("role","toolbar"),fg(r,this.options.container),t.container?.parentNode?.insertBefore(r,t.container),this.container=r}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){Dl.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(r=>{const s=this.options.handlers?.[r];s&&this.addHandler(r,s)}),Array.from(this.container.querySelectorAll("button, select")).forEach(r=>{this.attach(r)}),this.quill.on(N.events.EDITOR_CHANGE,()=>{const[r]=this.quill.selection.getRange();this.update(r)})}addHandler(t,e){this.handlers[t]=e}attach(t){let e=Array.from(t.classList).find(s=>s.indexOf("ql-")===0);if(!e)return;if(e=e.slice(3),t.tagName==="BUTTON"&&t.setAttribute("type","button"),this.handlers[e]==null&&this.quill.scroll.query(e)==null){Dl.warn("ignoring attaching to nonexistent format",e,t);return}const r=t.tagName==="SELECT"?"change":"click";t.addEventListener(r,s=>{let i;if(t.tagName==="SELECT"){if(t.selectedIndex<0)return;const a=t.options[t.selectedIndex];a.hasAttribute("selected")?i=!1:i=a.value||!1}else t.classList.contains("ql-active")?i=!1:i=t.value||!t.hasAttribute("value"),s.preventDefault();this.quill.focus();const[l]=this.quill.selection.getRange();if(this.handlers[e]!=null)this.handlers[e].call(this,i);else if(this.quill.scroll.query(e).prototype instanceof lt){if(i=prompt(`Enter ${e}`),!i)return;this.quill.updateContents(new O().retain(l.index).delete(l.length).insert({[e]:i}),N.sources.USER)}else this.quill.format(e,i,N.sources.USER);this.update(l)}),this.controls.push([e,t])}update(t){const e=t==null?{}:this.quill.getFormat(t);this.controls.forEach(r=>{const[s,i]=r;if(i.tagName==="SELECT"){let l=null;if(t==null)l=null;else if(e[s]==null)l=i.querySelector("option[selected]");else if(!Array.isArray(e[s])){let a=e[s];typeof a=="string"&&(a=a.replace(/"/g,'\\"')),l=i.querySelector(`option[value="${a}"]`)}l==null?(i.value="",i.selectedIndex=-1):l.selected=!0}else if(t==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const l=e[s],a=l===i.getAttribute("value")||l!=null&&l.toString()===i.getAttribute("value")||l==null&&!i.getAttribute("value");i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}else{const l=e[s]!=null;i.classList.toggle("ql-active",l),i.setAttribute("aria-pressed",l.toString())}})}}Pi.DEFAULTS={};function jl(n,t,e){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${t}`),r.setAttribute("aria-pressed","false"),e!=null?(r.value=e,r.setAttribute("aria-label",`${t}: ${e}`)):r.setAttribute("aria-label",t),n.appendChild(r)}function fg(n,t){Array.isArray(t[0])||(t=[t]),t.forEach(e=>{const r=document.createElement("span");r.classList.add("ql-formats"),e.forEach(s=>{if(typeof s=="string")jl(r,s);else{const i=Object.keys(s)[0],l=s[i];Array.isArray(l)?dg(r,i,l):jl(r,i,l)}}),n.appendChild(r)})}function dg(n,t,e){const r=document.createElement("select");r.classList.add(`ql-${t}`),e.forEach(s=>{const i=document.createElement("option");s!==!1?i.setAttribute("value",String(s)):i.setAttribute("selected","selected"),r.appendChild(i)}),n.appendChild(r)}Pi.DEFAULTS={container:null,handlers:{clean(){const n=this.quill.getSelection();if(n!=null)if(n.length===0){const t=this.quill.getFormat();Object.keys(t).forEach(e=>{this.quill.scroll.query(e,C.INLINE)!=null&&this.quill.format(e,!1,N.sources.USER)})}else this.quill.removeFormat(n.index,n.length,N.sources.USER)},direction(n){const{align:t}=this.quill.getFormat();n==="rtl"&&t==null?this.quill.format("align","right",N.sources.USER):!n&&t==="right"&&this.quill.format("align",!1,N.sources.USER),this.quill.format("direction",n,N.sources.USER)},indent(n){const t=this.quill.getSelection(),e=this.quill.getFormat(t),r=parseInt(e.indent||0,10);if(n==="+1"||n==="-1"){let s=n==="+1"?1:-1;e.direction==="rtl"&&(s*=-1),this.quill.format("indent",r+s,N.sources.USER)}},link(n){n===!0&&(n=prompt("Enter link URL:")),this.quill.format("link",n,N.sources.USER)},list(n){const t=this.quill.getSelection(),e=this.quill.getFormat(t);n==="check"?e.list==="checked"||e.list==="unchecked"?this.quill.format("list",!1,N.sources.USER):this.quill.format("list","unchecked",N.sources.USER):this.quill.format("list",n,N.sources.USER)}}};const gg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',pg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',mg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',bg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',yg='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',vg='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',Eg='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',Ag='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',Pl='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',Ng='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',wg='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',Tg='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',xg='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',Lg='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',Sg='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',_g='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',Og='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',Cg='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',qg='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',Ig='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',Rg='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',kg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',Bg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',Mg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',Dg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',jg='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',Pg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',$g='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',Ug='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',Fg='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',Hg='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',zg='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',Kg='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',In={align:{"":gg,center:pg,right:mg,justify:bg},background:yg,blockquote:vg,bold:Eg,clean:Ag,code:Pl,"code-block":Pl,color:Ng,direction:{"":wg,rtl:Tg},formula:xg,header:{1:Lg,2:Sg,3:_g,4:Og,5:Cg,6:qg},italic:Ig,image:Rg,indent:{"+1":kg,"-1":Bg},link:Mg,list:{bullet:Dg,check:jg,ordered:Pg},script:{sub:$g,super:Ug},strike:Fg,table:Hg,underline:zg,video:Kg},Gg='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let $l=0;function Ul(n,t){n.setAttribute(t,`${n.getAttribute(t)!=="true"}`)}class Dr{constructor(t){this.select=t,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",e=>{switch(e.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),e.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),Ul(this.label,"aria-expanded"),Ul(this.options,"aria-hidden")}buildItem(t){const e=document.createElement("span");e.tabIndex="0",e.setAttribute("role","button"),e.classList.add("ql-picker-item");const r=t.getAttribute("value");return r&&e.setAttribute("data-value",r),t.textContent&&e.setAttribute("data-label",t.textContent),e.addEventListener("click",()=>{this.selectItem(e,!0)}),e.addEventListener("keydown",s=>{switch(s.key){case"Enter":this.selectItem(e,!0),s.preventDefault();break;case"Escape":this.escape(),s.preventDefault();break}}),e}buildLabel(){const t=document.createElement("span");return t.classList.add("ql-picker-label"),t.innerHTML=Gg,t.tabIndex="0",t.setAttribute("role","button"),t.setAttribute("aria-expanded","false"),this.container.appendChild(t),t}buildOptions(){const t=document.createElement("span");t.classList.add("ql-picker-options"),t.setAttribute("aria-hidden","true"),t.tabIndex="-1",t.id=`ql-picker-options-${$l}`,$l+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,Array.from(this.select.options).forEach(e=>{const r=this.buildItem(e);t.appendChild(r),e.selected===!0&&this.selectItem(r)}),this.container.appendChild(t)}buildPicker(){Array.from(this.select.attributes).forEach(t=>{this.container.setAttribute(t.name,t.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.container.querySelector(".ql-selected");t!==r&&(r?.classList.remove("ql-selected"),t!=null&&(t.classList.add("ql-selected"),this.select.selectedIndex=Array.from(t.parentNode.children).indexOf(t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),e&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let t;if(this.select.selectedIndex>-1){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const e=t!=null&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",e)}}class Wo extends Dr{constructor(t,e){super(t),this.label.innerHTML=e,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(r=>{r.classList.add("ql-primary")})}buildItem(t){const e=super.buildItem(t);return e.style.backgroundColor=t.getAttribute("value")||"",e}selectItem(t,e){super.selectItem(t,e);const r=this.label.querySelector(".ql-color-label"),s=t&&t.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=s:r.style.fill=s)}}class Zo extends Dr{constructor(t,e){super(t),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(r=>{r.innerHTML=e[r.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(t,e){super.selectItem(t,e);const r=t||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const Vg=n=>{const{overflowY:t}=getComputedStyle(n,null);return t!=="visible"&&t!=="clip"};class Xo{constructor(t,e){this.quill=t,this.boundsContainer=e||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,Vg(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(t){const e=t.left+t.width/2-this.root.offsetWidth/2,r=t.bottom+this.quill.root.scrollTop;this.root.style.left=`${e}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let l=0;if(i.right>s.right&&(l=s.right-i.right,this.root.style.left=`${e+l}px`),i.left<s.left&&(l=s.left-i.left,this.root.style.left=`${e+l}px`),i.bottom>s.bottom){const a=i.bottom-i.top,c=t.bottom-t.top+a;this.root.style.top=`${r-c}px`,this.root.classList.add("ql-flip")}return l}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const Wg=[!1,"center","right","justify"],Zg=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],Xg=[!1,"serif","monospace"],Yg=["1","2","3",!1],Qg=["small",!1,"large","huge"];class Dn extends We{constructor(t,e){super(t,e);const r=s=>{if(!document.body.contains(t.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(s.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(i=>{i.container.contains(s.target)||i.close()})};t.emitter.listenDOM("click",document.body,r)}addModule(t){const e=super.addModule(t);return t==="toolbar"&&this.extendToolbar(e),e}buildButtons(t,e){Array.from(t).forEach(r=>{(r.getAttribute("class")||"").split(/\s+/).forEach(i=>{if(i.startsWith("ql-")&&(i=i.slice(3),e[i]!=null))if(i==="direction")r.innerHTML=e[i][""]+e[i].rtl;else if(typeof e[i]=="string")r.innerHTML=e[i];else{const l=r.value||"";l!=null&&e[i][l]&&(r.innerHTML=e[i][l])}})})}buildPickers(t,e){this.pickers=Array.from(t).map(s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&yn(s,Wg),typeof e.align=="object"))return new Zo(s,e.align);if(s.classList.contains("ql-background")||s.classList.contains("ql-color")){const i=s.classList.contains("ql-background")?"background":"color";return s.querySelector("option")==null&&yn(s,Zg,i==="background"?"#ffffff":"#000000"),new Wo(s,e[i])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?yn(s,Xg):s.classList.contains("ql-header")?yn(s,Yg):s.classList.contains("ql-size")&&yn(s,Qg)),new Dr(s)});const r=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(S.events.EDITOR_CHANGE,r)}}Dn.DEFAULTS=te({},We.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let n=this.container.querySelector("input.ql-image[type=file]");n==null&&(n=document.createElement("input"),n.setAttribute("type","file"),n.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),n.classList.add("ql-image"),n.addEventListener("change",()=>{const t=this.quill.getSelection(!0);this.quill.uploader.upload(t,n.files),n.value=""}),this.container.appendChild(n)),n.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class Yo extends Xo{constructor(t,e){super(t,e),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",t=>{t.key==="Enter"?(this.save(),t.preventDefault()):t.key==="Escape"&&(this.cancel(),t.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;e!=null?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${t}`)||""),this.root.setAttribute("data-mode",t)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:t}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:e}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,S.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,S.sources.USER)),this.quill.root.scrollTop=e;break}case"video":t=Jg(t);case"formula":{if(!t)break;const e=this.quill.getSelection(!0);if(e!=null){const r=e.index+e.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),t,S.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",S.sources.USER),this.quill.setSelection(r+2,S.sources.USER)}break}}this.textbox.value="",this.hide()}}function Jg(n){let t=n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return t?`${t[1]||"https"}://www.youtube.com/embed/${t[2]}?showinfo=0`:(t=n.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${t[1]||"https"}://player.vimeo.com/video/${t[2]}/`:n}function yn(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t.forEach(r=>{const s=document.createElement("option");r===e?s.setAttribute("selected","selected"):s.setAttribute("value",String(r)),n.appendChild(s)})}const tp=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Qo extends Yo{constructor(t,e){super(t,e),this.quill.on(S.events.EDITOR_CHANGE,(r,s,i,l)=>{if(r===S.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&l===S.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const a=this.quill.getLines(s.index,s.length);if(a.length===1){const c=this.quill.getBounds(s);c!=null&&this.position(c)}else{const c=a[a.length-1],h=this.quill.getIndex(c),f=Math.min(c.length()-1,s.index+s.length-h),b=this.quill.getBounds(new be(h,f));b!=null&&this.position(b)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(S.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const t=this.quill.getSelection();if(t!=null){const e=this.quill.getBounds(t);e!=null&&this.position(e)}},1)})}cancel(){this.show()}position(t){const e=super.position(t),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",e!==0&&(r.style.marginLeft=`${-1*e-r.offsetWidth/2}px`),e}}x(Qo,"TEMPLATE",['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""));class Jo extends Dn{constructor(t,e){e.modules.toolbar!=null&&e.modules.toolbar.container==null&&(e.modules.toolbar.container=tp),super(t,e),this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new Qo(this.quill,this.options.bounds),t.container!=null&&(this.tooltip.root.appendChild(t.container),this.buildButtons(t.container.querySelectorAll("button"),In),this.buildPickers(t.container.querySelectorAll("select"),In))}}Jo.DEFAULTS=te({},Dn.DEFAULTS,{modules:{toolbar:{handlers:{link(n){n?this.quill.theme.tooltip.edit():this.quill.format("link",!1,N.sources.USER)}}}}});const ep=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class ta extends Yo{constructor(){super(...arguments);x(this,"preview",this.root.querySelector("a.ql-preview"))}listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",e=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),e.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",e=>{if(this.linkRange!=null){const r=this.linkRange;this.restoreFocus(),this.quill.formatText(r,"link",!1,S.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()}),this.quill.on(S.events.SELECTION_CHANGE,(e,r,s)=>{if(e!=null){if(e.length===0&&s===S.sources.USER){const[i,l]=this.quill.scroll.descendant(Jt,e.index);if(i!=null){this.linkRange=new be(e.index-l,i.length());const a=Jt.formats(i.domNode);this.preview.textContent=a,this.preview.setAttribute("href",a),this.show();const c=this.quill.getBounds(this.linkRange);c!=null&&this.position(c);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}x(ta,"TEMPLATE",['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""));class ea extends Dn{constructor(t,e){e.modules.toolbar!=null&&e.modules.toolbar.container==null&&(e.modules.toolbar.container=ep),super(t,e),this.quill.container.classList.add("ql-snow")}extendToolbar(t){t.container!=null&&(t.container.classList.add("ql-snow"),this.buildButtons(t.container.querySelectorAll("button"),In),this.buildPickers(t.container.querySelectorAll("select"),In),this.tooltip=new ta(this.quill,this.options.bounds),t.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(e,r)=>{t.handlers.link.call(t,!r.format.link)}))}}ea.DEFAULTS=te({},Dn.DEFAULTS,{modules:{toolbar:{handlers:{link(n){if(n){const t=this.quill.getSelection();if(t==null||t.length===0)return;let e=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(e)&&e.indexOf("mailto:")!==0&&(e=`mailto:${e}`);const{tooltip:r}=this.quill.theme;r.edit("link",e)}else this.quill.format("link",!1,N.sources.USER)}}}}});N.register({"attributors/attribute/direction":ko,"attributors/class/align":qo,"attributors/class/background":vd,"attributors/class/color":yd,"attributors/class/direction":Bo,"attributors/class/font":jo,"attributors/class/size":$o,"attributors/style/align":Io,"attributors/style/background":Ri,"attributors/style/color":Ii,"attributors/style/direction":Mo,"attributors/style/font":Po,"attributors/style/size":Uo},!0);N.register({"formats/align":qo,"formats/direction":Bo,"formats/indent":cg,"formats/background":Ri,"formats/color":Ii,"formats/font":jo,"formats/size":$o,"formats/blockquote":hi,"formats/code-block":J,"formats/header":fi,"formats/list":Mn,"formats/bold":qn,"formats/code":ki,"formats/italic":di,"formats/link":Jt,"formats/script":gi,"formats/strike":pi,"formats/underline":mi,"formats/formula":vr,"formats/image":bi,"formats/video":Er,"modules/syntax":Vo,"modules/table":hg,"modules/toolbar":Pi,"themes/bubble":Jo,"themes/snow":ea,"ui/icons":In,"ui/picker":Dr,"ui/icon-picker":Zo,"ui/color-picker":Wo,"ui/tooltip":Xo},!0);var jr=class extends de.Component{constructor(n){super(n),this.editingAreaRef=Ue.createRef(),this.containerRef=Ue.createRef(),this.dirtyProps=["modules","formats","bounds","theme","children"],this.cleanProps=["id","className","style","placeholder","tabIndex","onChange","onChangeSelection","onFocus","onBlur","onKeyPress","onKeyDown","onKeyUp","useSemanticHTML"],this.state={generation:0},this.selection=null,this.onEditorChange=(e,r,s,i)=>{e==="text-change"?this.onEditorChangeText?.(this.props.useSemanticHTML!==!1?this.editor.getSemanticHTML():this.editor.root.innerHTML,r,i,this.unprivilegedEditor):e==="selection-change"&&this.onEditorChangeSelection?.(r,i,this.unprivilegedEditor)};const t=this.isControlled()?n.value:n.defaultValue;this.value=t??""}validateProps(n){if(de.Children.count(n.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(de.Children.count(n.children)&&de.Children.only(n.children)?.type==="textarea")throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.");if(this.lastDeltaChangeSet&&n.value===this.lastDeltaChangeSet)throw new Error("You are passing the `delta` object from the `onChange` event back as `value`. You most probably want `editor.getContents()` instead. See: https://github.com/zenoamaro/react-quill#using-deltas")}shouldComponentUpdate(n,t){if(this.validateProps(n),!this.editor||this.state.generation!==t.generation)return!0;if("value"in n){const e=this.getEditorContents(),r=n.value??"";this.isEqualValue(r,e)||this.setEditorContents(this.editor,r)}return n.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,n.readOnly),[...this.cleanProps,...this.dirtyProps].some(e=>!Xt(n[e],this.props[e]))}shouldComponentRegenerate(n){return this.dirtyProps.some(t=>!Xt(n[t],this.props[t]))}componentDidMount(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())}componentWillUnmount(){this.destroyEditor()}componentDidUpdate(n,t){if(this.editor&&this.shouldComponentRegenerate(n)){const e=this.editor.getContents(),r=this.editor.getSelection();this.regenerationSnapshot={delta:e,selection:r},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.editor&&n.placeholder!==this.props.placeholder&&(this.editor.root.dataset.placeholder=this.props.placeholder||""),this.state.generation!==t.generation){const{delta:e,selection:r}=this.regenerationSnapshot;delete this.regenerationSnapshot,this.instantiateEditor();const s=this.editor;s.setContents(e),Fl(()=>this.setEditorSelection(s,r))}}instantiateEditor(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())}destroyEditor(){if(!this.editor)return;this.unhookEditor(this.editor);const n=this.props.modules?.toolbar;if(!(typeof n=="object"&&n&&"container"in n&&typeof n.container=="string"||typeof n=="string")){const e=this.containerRef.current?.querySelector(".ql-toolbar");e&&e.remove()}delete this.editor}isControlled(){return"value"in this.props}getEditorConfig(){return{bounds:this.props.bounds,formats:this.props.formats,modules:this.props.modules,placeholder:this.props.placeholder,readOnly:this.props.readOnly,tabIndex:this.props.tabIndex,theme:this.props.theme}}getEditor(){if(!this.editor)throw new Error("Accessing non-instantiated editor");return this.editor}createEditor(n,t){const e=new N(n,t);return t.tabIndex!=null&&this.setEditorTabIndex(e,t.tabIndex),this.hookEditor(e),e}hookEditor(n){this.unprivilegedEditor=this.makeUnprivilegedEditor(n),n.on("editor-change",this.onEditorChange)}unhookEditor(n){n.off("editor-change",this.onEditorChange)}getEditorContents(){return this.value}getEditorSelection(){return this.selection}isDelta(n){return n&&n.ops}isEqualValue(n,t){return this.isDelta(n)&&this.isDelta(t)?Xt(n.ops,t.ops):Xt(n,t)}setEditorContents(n,t){this.value=t;const e=this.getEditorSelection();typeof t=="string"?n.setContents(n.clipboard.convert({html:t})):n.setContents(t),Fl(()=>this.setEditorSelection(n,e))}setEditorSelection(n,t){if(this.selection=t,t){const e=n.getLength();t.index=Math.max(0,Math.min(t.index,e-1)),t.length=Math.max(0,Math.min(t.length,e-1-t.index)),n.setSelection(t)}}setEditorTabIndex(n,t){n?.scroll?.domNode&&(n.scroll.domNode.tabIndex=t)}setEditorReadOnly(n,t){t?n.disable():n.enable()}makeUnprivilegedEditor(n){const t=n;return{getHTML:()=>t.root.innerHTML,getSemanticHTML:t.getSemanticHTML.bind(t),getLength:t.getLength.bind(t),getText:t.getText.bind(t),getContents:t.getContents.bind(t),getSelection:t.getSelection.bind(t),getBounds:t.getBounds.bind(t)}}getEditingArea(){const n=this.editingAreaRef.current;if(!n)throw new Error("Cannot find element for editing area");if(n.nodeType===3)throw new Error("Editing area cannot be a text node");return n}renderEditingArea(){const{children:n,preserveWhitespace:t}=this.props,{generation:e}=this.state;return de.Children.count(n)?de.cloneElement(de.Children.only(n),{key:e,ref:this.editingAreaRef}):t?En.jsx("pre",{ref:this.editingAreaRef},e):En.jsx("div",{ref:this.editingAreaRef},e)}render(){return En.jsx("div",{ref:this.containerRef,id:this.props.id,style:this.props.style,className:`quill ${this.props.className??""}`,onKeyPress:this.props.onKeyPress,onKeyDown:this.props.onKeyDown,onKeyUp:this.props.onKeyUp,children:this.renderEditingArea()},this.state.generation)}onEditorChangeText(n,t,e,r){if(!this.editor)return;const s=this.isDelta(this.value)?r.getContents():this.props.useSemanticHTML!==!1?r.getSemanticHTML():r.getHTML();s!==this.getEditorContents()&&(this.lastDeltaChangeSet=t,this.value=s,this.props.onChange?.(n,t,e,r))}onEditorChangeSelection(n,t,e){if(!this.editor)return;const r=this.getEditorSelection(),s=!r&&n,i=r&&!n;Xt(n,r)||(this.selection=n,this.props.onChangeSelection?.(n,t,e),s?this.props.onFocus?.(n,t,e):i&&this.props.onBlur?.(r,t,e))}focus(){this.editor&&this.editor.focus()}blur(){this.editor&&(this.selection=null,this.editor.blur())}};jr.displayName="React Quill";jr.Quill=N;jr.defaultProps={theme:"snow",modules:{},readOnly:!1};function Fl(n){Promise.resolve().then(n)}var na=jr;const ge=na.Quill;if(!ge.__bohaRegistered){const n=ge.import("attributors/class/font");n.whitelist=["arial","tahoma","verdana","georgia","times-new-roman","courier-new","trebuchet-ms","impact","comic-sans-ms","lucida-console","palatino-linotype","garamond"],ge.register(n,!0);const t=ge.import("attributors/style/size");t.whitelist=["8px","9px","10px","11px","12px","14px","16px","18px","20px","24px","28px","32px","36px","48px"],ge.register(t,!0),ge.__bohaRegistered=!0}const np=ge.import("attributors/class/font"),rp=["8px","9px","10px","11px","12px","14px","16px","18px","20px","24px","28px","32px","36px","48px"],Hl=["#000000","#1a1a1a","#333333","#555555","#777777","#999999","#bbbbbb","#dddddd","#ffffff","#de3a3a","#e57373","#c62828","#1565c0","#42a5f5","#0d47a1","#2e7d32","#66bb6a","#1b5e20","#f57f17","#ffca28","#e65100","#6a1b9a","#ab47bc","#4a148c","#00695c","#26a69a","#004d40","#37474f","#78909c","#263238"],sp=[[{font:np.whitelist}],[{size:rp}],["bold","italic","underline","strike"],[{color:Hl},{background:Hl}],[{list:"ordered"},{list:"bullet"}],[{indent:"-1"},{indent:"+1"}],[{align:[]}],["link"],["clean"]],ip=["font","size","bold","italic","underline","strike","color","background","list","indent","align","link"];function gp({value:n,onChange:t,placeholder:e="Obsah...",minHeight:r="120px"}){const s=Ue.useRef(null),i=Ue.useRef(n),l=Ue.useMemo(()=>({toolbar:sp,clipboard:{matchVisual:!1},keyboard:{bindings:{tab:{key:9,handler(c){const h=this.quill,[f]=h.getLine(c.index);return f&&f.statics&&f.statics.blotName==="list-item"?(h.format("indent","+1","user"),!1):(h.insertText(c.index," ","user"),h.setSelection(c.index+4,"silent"),!1)}},shiftTab:{key:9,shiftKey:!0,handler(c){const h=this.quill,[f]=h.getLine(c.index);return f&&f.statics&&f.statics.blotName==="list-item"?(h.format("indent","-1","user"),!1):!0}}}}}),[]),a=Ue.useCallback((c,h,f)=>{f==="user"&&c!==i.current&&(i.current=c,t(c))},[t]);return En.jsx("div",{className:"rich-editor",style:{"--re-min-height":r},children:En.jsx(na,{ref:s,theme:"snow",value:n||"",onChange:a,modules:l,formats:ip,placeholder:e,bounds:".rich-editor"})})}export{gp as default};