@testver/testver 1.2.1 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,32 +1,32 @@
1
- var Ho=Object.defineProperty;var zo=(r,t,e)=>t in r?Ho(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var q=(r,t,e)=>zo(r,typeof t!="symbol"?t+"":t,e);import{c as pe,g as Bl,R as Oe,r as qi,j as Ss}from"./index-BEZeU6oA.js";var Ml=typeof global=="object"&&global&&global.Object===Object&&global,Ko=typeof self=="object"&&self&&self.Object===Object&&self,te=Ml||Ko||Function("return this")(),ve=te.Symbol,Dl=Object.prototype,Go=Dl.hasOwnProperty,Vo=Dl.toString,_n=ve?ve.toStringTag:void 0;function Wo(r){var t=Go.call(r,_n),e=r[_n];try{r[_n]=void 0;var n=!0}catch{}var s=Vo.call(r);return n&&(t?r[_n]=e:delete r[_n]),s}var Zo=Object.prototype,Xo=Zo.toString;function Yo(r){return Xo.call(r)}var Qo="[object Null]",Jo="[object Undefined]",Ci=ve?ve.toStringTag:void 0;function hn(r){return r==null?r===void 0?Jo:Qo:Ci&&Ci in Object(r)?Wo(r):Yo(r)}function le(r){return r!=null&&typeof r=="object"}var qe=Array.isArray;function Ee(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}function jl(r){return r}var ta="[object AsyncFunction]",ea="[object Function]",na="[object GeneratorFunction]",ra="[object Proxy]";function hi(r){if(!Ee(r))return!1;var t=hn(r);return t==ea||t==na||t==ta||t==ra}var _s=te["__core-js_shared__"],Ii=(function(){var r=/[^.]+$/.exec(_s&&_s.keys&&_s.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function sa(r){return!!Ii&&Ii in r}var ia=Function.prototype,la=ia.toString;function Re(r){if(r!=null){try{return la.call(r)}catch{}try{return r+""}catch{}}return""}var oa=/[\\^$.*+?()[\]{}|]/g,aa=/^\[object .+?Constructor\]$/,ca=Function.prototype,ua=Object.prototype,ha=ca.toString,fa=ua.hasOwnProperty,da=RegExp("^"+ha.call(fa).replace(oa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ga(r){if(!Ee(r)||sa(r))return!1;var t=hi(r)?da:aa;return t.test(Re(r))}function pa(r,t){return r==null?void 0:r[t]}function ke(r,t){var e=pa(r,t);return ga(e)?e:void 0}var Fs=ke(te,"WeakMap"),Ri=Object.create,ma=(function(){function r(){}return function(t){if(!Ee(t))return{};if(Ri)return Ri(t);r.prototype=t;var e=new r;return r.prototype=void 0,e}})();function ba(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2])}return r.apply(t,e)}function ya(r,t){var e=-1,n=r.length;for(t||(t=Array(n));++e<n;)t[e]=r[e];return t}var va=800,Ea=16,Aa=Date.now;function Na(r){var t=0,e=0;return function(){var n=Aa(),s=Ea-(n-e);if(e=n,s>0){if(++t>=va)return arguments[0]}else t=0;return r.apply(void 0,arguments)}}function wa(r){return function(){return r}}var Sr=(function(){try{var r=ke(Object,"defineProperty");return r({},"",{}),r}catch{}})(),Ta=Sr?function(r,t){return Sr(r,"toString",{configurable:!0,enumerable:!1,value:wa(t),writable:!0})}:jl,xa=Na(Ta);function La(r,t){for(var e=-1,n=r==null?0:r.length;++e<n&&t(r[e],e,r)!==!1;);return r}var Sa=9007199254740991,_a=/^(?:0|[1-9]\d*)$/;function Pl(r,t){var e=typeof r;return t=t??Sa,!!t&&(e=="number"||e!="symbol"&&_a.test(r))&&r>-1&&r%1==0&&r<t}function fi(r,t,e){t=="__proto__"&&Sr?Sr(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e}function zn(r,t){return r===t||r!==r&&t!==t}var Oa=Object.prototype,qa=Oa.hasOwnProperty;function $l(r,t,e){var n=r[t];(!(qa.call(r,t)&&zn(n,e))||e===void 0&&!(t in r))&&fi(r,t,e)}function Ca(r,t,e,n){var s=!e;e||(e={});for(var i=-1,o=t.length;++i<o;){var a=t[i],u=void 0;u===void 0&&(u=r[a]),s?fi(e,a,u):$l(e,a,u)}return e}var ki=Math.max;function Ia(r,t,e){return t=ki(t===void 0?r.length-1:t,0),function(){for(var n=arguments,s=-1,i=ki(n.length-t,0),o=Array(i);++s<i;)o[s]=n[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=n[s];return a[t]=e(o),ba(r,this,a)}}function Ra(r,t){return xa(Ia(r,t,jl),r+"")}var ka=9007199254740991;function Ul(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=ka}function Cr(r){return r!=null&&Ul(r.length)&&!hi(r)}function Ba(r,t,e){if(!Ee(e))return!1;var n=typeof t;return(n=="number"?Cr(e)&&Pl(t,e.length):n=="string"&&t in e)?zn(e[t],r):!1}function Ma(r){return Ra(function(t,e){var n=-1,s=e.length,i=s>1?e[s-1]:void 0,o=s>2?e[2]:void 0;for(i=r.length>3&&typeof i=="function"?(s--,i):void 0,o&&Ba(e[0],e[1],o)&&(i=s<3?void 0:i,s=1),t=Object(t);++n<s;){var a=e[n];a&&r(t,a,n,i)}return t})}var Da=Object.prototype;function di(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||Da;return r===e}function ja(r,t){for(var e=-1,n=Array(r);++e<r;)n[e]=t(e);return n}var Pa="[object Arguments]";function Bi(r){return le(r)&&hn(r)==Pa}var Fl=Object.prototype,$a=Fl.hasOwnProperty,Ua=Fl.propertyIsEnumerable,Hs=Bi((function(){return arguments})())?Bi:function(r){return le(r)&&$a.call(r,"callee")&&!Ua.call(r,"callee")};function Fa(){return!1}var Hl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mi=Hl&&typeof module=="object"&&module&&!module.nodeType&&module,Ha=Mi&&Mi.exports===Hl,Di=Ha?te.Buffer:void 0,za=Di?Di.isBuffer:void 0,Dn=za||Fa,Ka="[object Arguments]",Ga="[object Array]",Va="[object Boolean]",Wa="[object Date]",Za="[object Error]",Xa="[object Function]",Ya="[object Map]",Qa="[object Number]",Ja="[object Object]",tc="[object RegExp]",ec="[object Set]",nc="[object String]",rc="[object WeakMap]",sc="[object ArrayBuffer]",ic="[object DataView]",lc="[object Float32Array]",oc="[object Float64Array]",ac="[object Int8Array]",cc="[object Int16Array]",uc="[object Int32Array]",hc="[object Uint8Array]",fc="[object Uint8ClampedArray]",dc="[object Uint16Array]",gc="[object Uint32Array]",lt={};lt[lc]=lt[oc]=lt[ac]=lt[cc]=lt[uc]=lt[hc]=lt[fc]=lt[dc]=lt[gc]=!0;lt[Ka]=lt[Ga]=lt[sc]=lt[Va]=lt[ic]=lt[Wa]=lt[Za]=lt[Xa]=lt[Ya]=lt[Qa]=lt[Ja]=lt[tc]=lt[ec]=lt[nc]=lt[rc]=!1;function pc(r){return le(r)&&Ul(r.length)&&!!lt[hn(r)]}function gi(r){return function(t){return r(t)}}var zl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Rn=zl&&typeof module=="object"&&module&&!module.nodeType&&module,mc=Rn&&Rn.exports===zl,Os=mc&&Ml.process,ln=(function(){try{var r=Rn&&Rn.require&&Rn.require("util").types;return r||Os&&Os.binding&&Os.binding("util")}catch{}})(),ji=ln&&ln.isTypedArray,pi=ji?gi(ji):pc,bc=Object.prototype,yc=bc.hasOwnProperty;function Kl(r,t){var e=qe(r),n=!e&&Hs(r),s=!e&&!n&&Dn(r),i=!e&&!n&&!s&&pi(r),o=e||n||s||i,a=o?ja(r.length,String):[],u=a.length;for(var h in r)(t||yc.call(r,h))&&!(o&&(h=="length"||s&&(h=="offset"||h=="parent")||i&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||Pl(h,u)))&&a.push(h);return a}function Gl(r,t){return function(e){return r(t(e))}}var vc=Gl(Object.keys,Object),Ec=Object.prototype,Ac=Ec.hasOwnProperty;function Nc(r){if(!di(r))return vc(r);var t=[];for(var e in Object(r))Ac.call(r,e)&&e!="constructor"&&t.push(e);return t}function wc(r){return Cr(r)?Kl(r):Nc(r)}function Tc(r){var t=[];if(r!=null)for(var e in Object(r))t.push(e);return t}var xc=Object.prototype,Lc=xc.hasOwnProperty;function Sc(r){if(!Ee(r))return Tc(r);var t=di(r),e=[];for(var n in r)n=="constructor"&&(t||!Lc.call(r,n))||e.push(n);return e}function Vl(r){return Cr(r)?Kl(r,!0):Sc(r)}var jn=ke(Object,"create");function _c(){this.__data__=jn?jn(null):{},this.size=0}function Oc(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}var qc="__lodash_hash_undefined__",Cc=Object.prototype,Ic=Cc.hasOwnProperty;function Rc(r){var t=this.__data__;if(jn){var e=t[r];return e===qc?void 0:e}return Ic.call(t,r)?t[r]:void 0}var kc=Object.prototype,Bc=kc.hasOwnProperty;function Mc(r){var t=this.__data__;return jn?t[r]!==void 0:Bc.call(t,r)}var Dc="__lodash_hash_undefined__";function jc(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=jn&&t===void 0?Dc:t,this}function Ce(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}Ce.prototype.clear=_c;Ce.prototype.delete=Oc;Ce.prototype.get=Rc;Ce.prototype.has=Mc;Ce.prototype.set=jc;function Pc(){this.__data__=[],this.size=0}function Ir(r,t){for(var e=r.length;e--;)if(zn(r[e][0],t))return e;return-1}var $c=Array.prototype,Uc=$c.splice;function Fc(r){var t=this.__data__,e=Ir(t,r);if(e<0)return!1;var n=t.length-1;return e==n?t.pop():Uc.call(t,e,1),--this.size,!0}function Hc(r){var t=this.__data__,e=Ir(t,r);return e<0?void 0:t[e][1]}function zc(r){return Ir(this.__data__,r)>-1}function Kc(r,t){var e=this.__data__,n=Ir(e,r);return n<0?(++this.size,e.push([r,t])):e[n][1]=t,this}function ce(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}ce.prototype.clear=Pc;ce.prototype.delete=Fc;ce.prototype.get=Hc;ce.prototype.has=zc;ce.prototype.set=Kc;var Pn=ke(te,"Map");function Gc(){this.size=0,this.__data__={hash:new Ce,map:new(Pn||ce),string:new Ce}}function Vc(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}function Rr(r,t){var e=r.__data__;return Vc(t)?e[typeof t=="string"?"string":"hash"]:e.map}function Wc(r){var t=Rr(this,r).delete(r);return this.size-=t?1:0,t}function Zc(r){return Rr(this,r).get(r)}function Xc(r){return Rr(this,r).has(r)}function Yc(r,t){var e=Rr(this,r),n=e.size;return e.set(r,t),this.size+=e.size==n?0:1,this}function Be(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}Be.prototype.clear=Gc;Be.prototype.delete=Wc;Be.prototype.get=Zc;Be.prototype.has=Xc;Be.prototype.set=Yc;function Qc(r,t){for(var e=-1,n=t.length,s=r.length;++e<n;)r[s+e]=t[e];return r}var Wl=Gl(Object.getPrototypeOf,Object),Jc="[object Object]",tu=Function.prototype,eu=Object.prototype,Zl=tu.toString,nu=eu.hasOwnProperty,ru=Zl.call(Object);function su(r){if(!le(r)||hn(r)!=Jc)return!1;var t=Wl(r);if(t===null)return!0;var e=nu.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&Zl.call(e)==ru}function iu(){this.__data__=new ce,this.size=0}function lu(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e}function ou(r){return this.__data__.get(r)}function au(r){return this.__data__.has(r)}var cu=200;function uu(r,t){var e=this.__data__;if(e instanceof ce){var n=e.__data__;if(!Pn||n.length<cu-1)return n.push([r,t]),this.size=++e.size,this;e=this.__data__=new Be(n)}return e.set(r,t),this.size=e.size,this}function Xt(r){var t=this.__data__=new ce(r);this.size=t.size}Xt.prototype.clear=iu;Xt.prototype.delete=lu;Xt.prototype.get=ou;Xt.prototype.has=au;Xt.prototype.set=uu;var Xl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Pi=Xl&&typeof module=="object"&&module&&!module.nodeType&&module,hu=Pi&&Pi.exports===Xl,$i=hu?te.Buffer:void 0,Ui=$i?$i.allocUnsafe:void 0;function Yl(r,t){if(t)return r.slice();var e=r.length,n=Ui?Ui(e):new r.constructor(e);return r.copy(n),n}function fu(r,t){for(var e=-1,n=r==null?0:r.length,s=0,i=[];++e<n;){var o=r[e];t(o,e,r)&&(i[s++]=o)}return i}function du(){return[]}var gu=Object.prototype,pu=gu.propertyIsEnumerable,Fi=Object.getOwnPropertySymbols,mu=Fi?function(r){return r==null?[]:(r=Object(r),fu(Fi(r),function(t){return pu.call(r,t)}))}:du;function bu(r,t,e){var n=t(r);return qe(r)?n:Qc(n,e(r))}function zs(r){return bu(r,wc,mu)}var Ks=ke(te,"DataView"),Gs=ke(te,"Promise"),Vs=ke(te,"Set"),Hi="[object Map]",yu="[object Object]",zi="[object Promise]",Ki="[object Set]",Gi="[object WeakMap]",Vi="[object DataView]",vu=Re(Ks),Eu=Re(Pn),Au=Re(Gs),Nu=Re(Vs),wu=Re(Fs),jt=hn;(Ks&&jt(new Ks(new ArrayBuffer(1)))!=Vi||Pn&&jt(new Pn)!=Hi||Gs&&jt(Gs.resolve())!=zi||Vs&&jt(new Vs)!=Ki||Fs&&jt(new Fs)!=Gi)&&(jt=function(r){var t=hn(r),e=t==yu?r.constructor:void 0,n=e?Re(e):"";if(n)switch(n){case vu:return Vi;case Eu:return Hi;case Au:return zi;case Nu:return Ki;case wu:return Gi}return t});var Tu=Object.prototype,xu=Tu.hasOwnProperty;function Lu(r){var t=r.length,e=new r.constructor(t);return t&&typeof r[0]=="string"&&xu.call(r,"index")&&(e.index=r.index,e.input=r.input),e}var _r=te.Uint8Array;function mi(r){var t=new r.constructor(r.byteLength);return new _r(t).set(new _r(r)),t}function Su(r,t){var e=mi(r.buffer);return new r.constructor(e,r.byteOffset,r.byteLength)}var _u=/\w*$/;function Ou(r){var t=new r.constructor(r.source,_u.exec(r));return t.lastIndex=r.lastIndex,t}var Wi=ve?ve.prototype:void 0,Zi=Wi?Wi.valueOf:void 0;function qu(r){return Zi?Object(Zi.call(r)):{}}function Ql(r,t){var e=t?mi(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length)}var Cu="[object Boolean]",Iu="[object Date]",Ru="[object Map]",ku="[object Number]",Bu="[object RegExp]",Mu="[object Set]",Du="[object String]",ju="[object Symbol]",Pu="[object ArrayBuffer]",$u="[object DataView]",Uu="[object Float32Array]",Fu="[object Float64Array]",Hu="[object Int8Array]",zu="[object Int16Array]",Ku="[object Int32Array]",Gu="[object Uint8Array]",Vu="[object Uint8ClampedArray]",Wu="[object Uint16Array]",Zu="[object Uint32Array]";function Xu(r,t,e){var n=r.constructor;switch(t){case Pu:return mi(r);case Cu:case Iu:return new n(+r);case $u:return Su(r);case Uu:case Fu:case Hu:case zu:case Ku:case Gu:case Vu:case Wu:case Zu:return Ql(r,e);case Ru:return new n;case ku:case Du:return new n(r);case Bu:return Ou(r);case Mu:return new n;case ju:return qu(r)}}function Jl(r){return typeof r.constructor=="function"&&!di(r)?ma(Wl(r)):{}}var Yu="[object Map]";function Qu(r){return le(r)&&jt(r)==Yu}var Xi=ln&&ln.isMap,Ju=Xi?gi(Xi):Qu,th="[object Set]";function eh(r){return le(r)&&jt(r)==th}var Yi=ln&&ln.isSet,nh=Yi?gi(Yi):eh,rh=1,to="[object Arguments]",sh="[object Array]",ih="[object Boolean]",lh="[object Date]",oh="[object Error]",eo="[object Function]",ah="[object GeneratorFunction]",ch="[object Map]",uh="[object Number]",no="[object Object]",hh="[object RegExp]",fh="[object Set]",dh="[object String]",gh="[object Symbol]",ph="[object WeakMap]",mh="[object ArrayBuffer]",bh="[object DataView]",yh="[object Float32Array]",vh="[object Float64Array]",Eh="[object Int8Array]",Ah="[object Int16Array]",Nh="[object Int32Array]",wh="[object Uint8Array]",Th="[object Uint8ClampedArray]",xh="[object Uint16Array]",Lh="[object Uint32Array]",st={};st[to]=st[sh]=st[mh]=st[bh]=st[ih]=st[lh]=st[yh]=st[vh]=st[Eh]=st[Ah]=st[Nh]=st[ch]=st[uh]=st[no]=st[hh]=st[fh]=st[dh]=st[gh]=st[wh]=st[Th]=st[xh]=st[Lh]=!0;st[oh]=st[eo]=st[ph]=!1;function Tr(r,t,e,n,s,i){var o,a=t&rh;if(o!==void 0)return o;if(!Ee(r))return r;var u=qe(r);if(u)o=Lu(r);else{var h=jt(r),p=h==eo||h==ah;if(Dn(r))return Yl(r,a);if(h==no||h==to||p&&!s)o=p?{}:Jl(r);else{if(!st[h])return s?r:{};o=Xu(r,h,a)}}i||(i=new Xt);var v=i.get(r);if(v)return v;i.set(r,o),nh(r)?r.forEach(function(y){o.add(Tr(y,t,e,y,r,i))}):Ju(r)&&r.forEach(function(y,A){o.set(A,Tr(y,t,e,A,r,i))});var f=zs,m=u?void 0:f(r);return La(m||r,function(y,A){m&&(A=y,y=r[A]),$l(o,A,Tr(y,t,e,A,r,i))}),o}var Sh=1,_h=4;function nn(r){return Tr(r,Sh|_h)}var Oh="__lodash_hash_undefined__";function qh(r){return this.__data__.set(r,Oh),this}function Ch(r){return this.__data__.has(r)}function Or(r){var t=-1,e=r==null?0:r.length;for(this.__data__=new Be;++t<e;)this.add(r[t])}Or.prototype.add=Or.prototype.push=qh;Or.prototype.has=Ch;function Ih(r,t){for(var e=-1,n=r==null?0:r.length;++e<n;)if(t(r[e],e,r))return!0;return!1}function Rh(r,t){return r.has(t)}var kh=1,Bh=2;function ro(r,t,e,n,s,i){var o=e&kh,a=r.length,u=t.length;if(a!=u&&!(o&&u>a))return!1;var h=i.get(r),p=i.get(t);if(h&&p)return h==t&&p==r;var v=-1,f=!0,m=e&Bh?new Or:void 0;for(i.set(r,t),i.set(t,r);++v<a;){var y=r[v],A=t[v];if(n)var w=o?n(A,y,v,t,r,i):n(y,A,v,r,t,i);if(w!==void 0){if(w)continue;f=!1;break}if(m){if(!Ih(t,function(x,C){if(!Rh(m,C)&&(y===x||s(y,x,e,n,i)))return m.push(C)})){f=!1;break}}else if(!(y===A||s(y,A,e,n,i))){f=!1;break}}return i.delete(r),i.delete(t),f}function Mh(r){var t=-1,e=Array(r.size);return r.forEach(function(n,s){e[++t]=[s,n]}),e}function Dh(r){var t=-1,e=Array(r.size);return r.forEach(function(n){e[++t]=n}),e}var jh=1,Ph=2,$h="[object Boolean]",Uh="[object Date]",Fh="[object Error]",Hh="[object Map]",zh="[object Number]",Kh="[object RegExp]",Gh="[object Set]",Vh="[object String]",Wh="[object Symbol]",Zh="[object ArrayBuffer]",Xh="[object DataView]",Qi=ve?ve.prototype:void 0,qs=Qi?Qi.valueOf:void 0;function Yh(r,t,e,n,s,i,o){switch(e){case Xh:if(r.byteLength!=t.byteLength||r.byteOffset!=t.byteOffset)return!1;r=r.buffer,t=t.buffer;case Zh:return!(r.byteLength!=t.byteLength||!i(new _r(r),new _r(t)));case $h:case Uh:case zh:return zn(+r,+t);case Fh:return r.name==t.name&&r.message==t.message;case Kh:case Vh:return r==t+"";case Hh:var a=Mh;case Gh:var u=n&jh;if(a||(a=Dh),r.size!=t.size&&!u)return!1;var h=o.get(r);if(h)return h==t;n|=Ph,o.set(r,t);var p=ro(a(r),a(t),n,s,i,o);return o.delete(r),p;case Wh:if(qs)return qs.call(r)==qs.call(t)}return!1}var Qh=1,Jh=Object.prototype,tf=Jh.hasOwnProperty;function ef(r,t,e,n,s,i){var o=e&Qh,a=zs(r),u=a.length,h=zs(t),p=h.length;if(u!=p&&!o)return!1;for(var v=u;v--;){var f=a[v];if(!(o?f in t:tf.call(t,f)))return!1}var m=i.get(r),y=i.get(t);if(m&&y)return m==t&&y==r;var A=!0;i.set(r,t),i.set(t,r);for(var w=o;++v<u;){f=a[v];var x=r[f],C=t[f];if(n)var M=o?n(C,x,f,t,r,i):n(x,C,f,r,t,i);if(!(M===void 0?x===C||s(x,C,e,n,i):M)){A=!1;break}w||(w=f=="constructor")}if(A&&!w){var z=r.constructor,U=t.constructor;z!=U&&"constructor"in r&&"constructor"in t&&!(typeof z=="function"&&z instanceof z&&typeof U=="function"&&U instanceof U)&&(A=!1)}return i.delete(r),i.delete(t),A}var nf=1,Ji="[object Arguments]",tl="[object Array]",gr="[object Object]",rf=Object.prototype,el=rf.hasOwnProperty;function sf(r,t,e,n,s,i){var o=qe(r),a=qe(t),u=o?tl:jt(r),h=a?tl:jt(t);u=u==Ji?gr:u,h=h==Ji?gr:h;var p=u==gr,v=h==gr,f=u==h;if(f&&Dn(r)){if(!Dn(t))return!1;o=!0,p=!1}if(f&&!p)return i||(i=new Xt),o||pi(r)?ro(r,t,e,n,s,i):Yh(r,t,u,e,n,s,i);if(!(e&nf)){var m=p&&el.call(r,"__wrapped__"),y=v&&el.call(t,"__wrapped__");if(m||y){var A=m?r.value():r,w=y?t.value():t;return i||(i=new Xt),s(A,w,e,n,i)}}return f?(i||(i=new Xt),ef(r,t,e,n,s,i)):!1}function so(r,t,e,n,s){return r===t?!0:r==null||t==null||!le(r)&&!le(t)?r!==r&&t!==t:sf(r,t,e,n,so,s)}function lf(r){return function(t,e,n){for(var s=-1,i=Object(t),o=n(t),a=o.length;a--;){var u=o[++s];if(e(i[u],u,i)===!1)break}return t}}var of=lf();function Ws(r,t,e){(e!==void 0&&!zn(r[t],e)||e===void 0&&!(t in r))&&fi(r,t,e)}function af(r){return le(r)&&Cr(r)}function Zs(r,t){if(!(t==="constructor"&&typeof r[t]=="function")&&t!="__proto__")return r[t]}function cf(r){return Ca(r,Vl(r))}function uf(r,t,e,n,s,i,o){var a=Zs(r,e),u=Zs(t,e),h=o.get(u);if(h){Ws(r,e,h);return}var p=i?i(a,u,e+"",r,t,o):void 0,v=p===void 0;if(v){var f=qe(u),m=!f&&Dn(u),y=!f&&!m&&pi(u);p=u,f||m||y?qe(a)?p=a:af(a)?p=ya(a):m?(v=!1,p=Yl(u,!0)):y?(v=!1,p=Ql(u,!0)):p=[]:su(u)||Hs(u)?(p=a,Hs(a)?p=cf(a):(!Ee(a)||hi(a))&&(p=Jl(u))):v=!1}v&&(o.set(u,p),s(p,u,n,i,o),o.delete(u)),Ws(r,e,p)}function io(r,t,e,n,s){r!==t&&of(t,function(i,o){if(s||(s=new Xt),Ee(i))uf(r,t,o,e,io,n,s);else{var a=n?n(Zs(r,o),i,o+"",r,t,s):void 0;a===void 0&&(a=i),Ws(r,o,a)}},Vl)}function ge(r,t){return so(r,t)}var ye=Ma(function(r,t,e){io(r,t,e)}),D=(r=>(r[r.TYPE=3]="TYPE",r[r.LEVEL=12]="LEVEL",r[r.ATTRIBUTE=13]="ATTRIBUTE",r[r.BLOT=14]="BLOT",r[r.INLINE=7]="INLINE",r[r.BLOCK=11]="BLOCK",r[r.BLOCK_BLOT=10]="BLOCK_BLOT",r[r.INLINE_BLOT=6]="INLINE_BLOT",r[r.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",r[r.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",r[r.ANY=15]="ANY",r))(D||{});class Qt{constructor(t,e,n={}){this.attrName=t,this.keyName=e;const s=D.TYPE&D.ATTRIBUTE;this.scope=n.scope!=null?n.scope&D.LEVEL|s:D.ATTRIBUTE,n.whitelist!=null&&(this.whitelist=n.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 rn extends Error{constructor(t){t="[Parchment] "+t,super(t),this.message=t,this.name=this.constructor.name}}const lo=class Xs{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 n=null;try{n=t.parentNode}catch{return null}return this.find(n,e)}return null}create(t,e,n){const s=this.query(e);if(s==null)throw new rn(`Unable to create ${e} blot`);const i=s,o=e instanceof Node||e.nodeType===Node.TEXT_NODE?e:i.create(n),a=new i(t,o,n);return Xs.blots.set(a.domNode,a),a}find(t,e=!1){return Xs.find(t,e)}query(t,e=D.ANY){let n;return typeof t=="string"?n=this.types[t]||this.attributes[t]:t instanceof Text||t.nodeType===Node.TEXT_NODE?n=this.types.text:typeof t=="number"?t&D.LEVEL&D.BLOCK?n=this.types.block:t&D.LEVEL&D.INLINE&&(n=this.types.inline):t instanceof Element&&((t.getAttribute("class")||"").split(/\s+/).some(s=>(n=this.classes[s],!!n)),n=n||this.tags[t.tagName]),n==null?null:"scope"in n&&e&D.LEVEL&n.scope&&e&D.TYPE&n.scope?n:null}register(...t){return t.map(e=>{const n="blotName"in e,s="attrName"in e;if(!n&&!s)throw new rn("Invalid definition");if(n&&e.blotName==="abstract")throw new rn("Cannot register abstract class");const i=n?e.blotName:s?e.attrName:void 0;return this.types[i]=e,s?typeof e.keyName=="string"&&(this.attributes[e.keyName]=e):n&&(e.className&&(this.classes[e.className]=e),e.tagName&&(Array.isArray(e.tagName)?e.tagName=e.tagName.map(o=>o.toUpperCase()):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach(o=>{(this.tags[o]==null||e.className==null)&&(this.tags[o]=e)}))),e})}};lo.blots=new WeakMap;let on=lo;function nl(r,t){return(r.getAttribute("class")||"").split(/\s+/).filter(e=>e.indexOf(`${t}-`)===0)}class hf extends Qt{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){nl(t,this.keyName).forEach(e=>{t.classList.remove(e)}),t.classList.length===0&&t.removeAttribute("class")}value(t){const e=(nl(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""}}const Ft=hf;function Cs(r){const t=r.split("-"),e=t.slice(1).map(n=>n[0].toUpperCase()+n.slice(1)).join("");return t[0]+e}class ff extends Qt{static keys(t){return(t.getAttribute("style")||"").split(";").map(e=>e.split(":")[0].trim())}add(t,e){return this.canAdd(t,e)?(t.style[Cs(this.keyName)]=e,!0):!1}remove(t){t.style[Cs(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const e=t.style[Cs(this.keyName)];return this.canAdd(t,e)?e:""}}const Ae=ff;class df{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=on.find(this.domNode);if(t==null)return;const e=Qt.keys(this.domNode),n=Ft.keys(this.domNode),s=Ae.keys(this.domNode);e.concat(n).concat(s).forEach(i=>{const o=t.scroll.query(i,D.ATTRIBUTE);o instanceof Qt&&(this.attributes[o.attrName]=o)})}copy(t){Object.keys(this.attributes).forEach(e=>{const n=this.attributes[e].value(this.domNode);t.format(e,n)})}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 kr=df,oo=class{constructor(t,e){this.scroll=t,this.domNode=e,on.blots.set(e,this),this.prev=null,this.next=null}static create(t){if(this.tagName==null)throw new rn("Blot definition missing tagName");let e,n;return Array.isArray(this.tagName)?(typeof t=="string"?(n=t.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):typeof t=="number"&&(n=t),typeof n=="number"?e=document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?e=document.createElement(n):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),on.blots.delete(this.domNode)}deleteAt(t,e){this.isolate(t,e).remove()}formatAt(t,e,n,s){const i=this.isolate(t,e);if(this.scroll.query(n,D.BLOT)!=null&&s)i.wrap(n,s);else if(this.scroll.query(n,D.ATTRIBUTE)!=null){const o=this.scroll.create(this.statics.scope);i.wrap(o),o.format(n,s)}}insertAt(t,e,n){const s=n==null?this.scroll.create("text",e):this.scroll.create(e,n),i=this.split(t);this.parent.insertBefore(s,i||void 0)}isolate(t,e){const n=this.split(t);if(n==null)throw new Error("Attempt to isolate at end");return n.split(e),n}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 n=typeof t=="string"?this.scroll.create(t,e):t;return this.parent!=null&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(t,e){return t===0?this:this.next}update(t,e){}wrap(t,e){const n=typeof t=="string"?this.scroll.create(t,e):t;if(this.parent!=null&&this.parent.insertBefore(n,this.next||void 0),typeof n.appendChild!="function")throw new rn(`Cannot wrap ${t}`);return n.appendChild(this),n}};oo.blotName="abstract";let ao=oo;const co=class extends ao{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 n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return t>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};co.scope=D.INLINE_BLOT;let gf=co;const Et=gf;class pf{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 n=e();for(;n&&t>0;)t-=1,n=e();return n}contains(t){const e=this.iterator();let n=e();for(;n;){if(n===t)return!0;n=e()}return!1}indexOf(t){const e=this.iterator();let n=e(),s=0;for(;n;){if(n===t)return s;s+=1,n=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,n=this.head;for(;n!=null;){if(n===t)return e;e+=n.length(),n=n.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 n=this.iterator();let s=n();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=n()}return[null,0]}forEach(t){const e=this.iterator();let n=e();for(;n;)t(n),n=e()}forEachAt(t,e,n){if(e<=0)return;const[s,i]=this.find(t);let o=t-i;const a=this.iterator(s);let u=a();for(;u&&o<t+e;){const h=u.length();t>o?n(u,t-o,Math.min(e,o+h-t)):n(u,0,Math.min(h,t+e-o)),o+=h,u=a()}}map(t){return this.reduce((e,n)=>(e.push(t(n)),e),[])}reduce(t,e){const n=this.iterator();let s=n();for(;s;)e=t(e,s),s=n();return e}}function rl(r,t){const e=t.find(r);if(e)return e;try{return t.create(r)}catch{const n=t.create(D.INLINE);return Array.from(r.childNodes).forEach(s=>{n.domNode.appendChild(s)}),r.parentNode&&r.parentNode.replaceChild(n.domNode,r),n.attach(),n}}const uo=class de extends ao{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,de.uiClass&&this.uiNode.classList.add(de.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new pf,Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode).reverse().forEach(t=>{try{const e=rl(t,this.scroll);this.insertBefore(e,this.children.head||void 0)}catch(e){if(e instanceof rn)return;throw e}})}deleteAt(t,e){if(t===0&&e===this.length())return this.remove();this.children.forEachAt(t,e,(n,s,i)=>{n.deleteAt(s,i)})}descendant(t,e=0){const[n,s]=this.children.find(e);return t.blotName==null&&t(n)||t.blotName!=null&&n instanceof t?[n,s]:n instanceof de?n.descendant(t,s):[null,-1]}descendants(t,e=0,n=Number.MAX_VALUE){let s=[],i=n;return this.children.forEachAt(e,n,(o,a,u)=>{(t.blotName==null&&t(o)||t.blotName!=null&&o instanceof t)&&s.push(o),o instanceof de&&(s=s.concat(o.descendants(t,a,i))),i-=u}),s}detach(){this.children.forEach(t=>{t.detach()}),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach(e=>{t||this.statics.allowedChildren.some(n=>e instanceof n)||(e.statics.scope===D.BLOCK_BLOT?(e.next!=null&&this.splitAfter(e),e.prev!=null&&this.splitAfter(e.prev),e.parent.unwrap(),t=!0):e instanceof de?e.unwrap():e.remove())})}formatAt(t,e,n,s){this.children.forEachAt(t,e,(i,o,a)=>{i.formatAt(o,a,n,s)})}insertAt(t,e,n){const[s,i]=this.children.find(t);if(s)s.insertAt(i,e,n);else{const o=n==null?this.scroll.create("text",e):this.scroll.create(e,n);this.appendChild(o)}}insertBefore(t,e){t.parent!=null&&t.parent.children.remove(t);let n=null;this.children.insertBefore(t,e||null),t.parent=this,e!=null&&(n=e.domNode),(this.domNode.parentNode!==t.domNode||this.domNode.nextSibling!==n)&&this.domNode.insertBefore(t.domNode,n),t.attach()}length(){return this.children.reduce((t,e)=>t+e.length(),0)}moveChildren(t,e){this.children.forEach(n=>{t.insertBefore(n,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[n,s]=this.children.find(t,e),i=[[this,t]];return n instanceof de?i.concat(n.path(s,e)):(n!=null&&i.push([n,s]),i)}removeChild(t){this.children.remove(t)}replaceWith(t,e){const n=typeof t=="string"?this.scroll.create(t,e):t;return n instanceof de&&this.moveChildren(n),super.replaceWith(n)}split(t,e=!1){if(!e){if(t===0)return this;if(t===this.length())return this.next}const n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(t,this.length(),(s,i,o)=>{const a=s.split(i,e);a!=null&&n.appendChild(a)}),n}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 n=[],s=[];t.forEach(i=>{i.target===this.domNode&&i.type==="childList"&&(n.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 o=this.scroll.find(i);o!=null&&(o.domNode.parentNode==null||o.domNode.parentNode===this.domNode)&&o.detach()}),n.filter(i=>i.parentNode===this.domNode&&i!==this.uiNode).sort((i,o)=>i===o?0:i.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(i=>{let o=null;i.nextSibling!=null&&(o=this.scroll.find(i.nextSibling));const a=rl(i,this.scroll);(a.next!==o||a.next==null)&&(a.parent!=null&&a.parent.removeChild(this),this.insertBefore(a,o||void 0))}),this.enforceAllowedChildren()}};uo.uiClass="";let mf=uo;const $t=mf;function bf(r,t){if(Object.keys(r).length!==Object.keys(t).length)return!1;for(const e in r)if(r[e]!==t[e])return!1;return!0}const Xe=class Ye extends $t{static create(t){return super.create(t)}static formats(t,e){const n=e.query(Ye.blotName);if(!(n!=null&&t.tagName===n.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 kr(this.domNode)}format(t,e){if(t===this.statics.blotName&&!e)this.children.forEach(n=>{n instanceof Ye||(n=n.wrap(Ye.blotName,!0)),this.attributes.copy(n)}),this.unwrap();else{const n=this.scroll.query(t,D.INLINE);if(n==null)return;n instanceof Qt?this.attributes.attribute(n,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,n,s){this.formats()[n]!=null||this.scroll.query(n,D.ATTRIBUTE)?this.isolate(t,e).format(n,s):super.formatAt(t,e,n,s)}optimize(t){super.optimize(t);const e=this.formats();if(Object.keys(e).length===0)return this.unwrap();const n=this.next;n instanceof Ye&&n.prev===this&&bf(e,n.formats())&&(n.moveChildren(this),n.remove())}replaceWith(t,e){const n=super.replaceWith(t,e);return this.attributes.copy(n),n}update(t,e){super.update(t,e),t.some(n=>n.target===this.domNode&&n.type==="attributes")&&this.attributes.build()}wrap(t,e){const n=super.wrap(t,e);return n instanceof Ye&&this.attributes.move(n),n}};Xe.allowedChildren=[Xe,Et],Xe.blotName="inline",Xe.scope=D.INLINE_BLOT,Xe.tagName="SPAN";let yf=Xe;const bi=yf,Qe=class Ys extends $t{static create(t){return super.create(t)}static formats(t,e){const n=e.query(Ys.blotName);if(!(n!=null&&t.tagName===n.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 kr(this.domNode)}format(t,e){const n=this.scroll.query(t,D.BLOCK);n!=null&&(n instanceof Qt?this.attributes.attribute(n,e):t===this.statics.blotName&&!e?this.replaceWith(Ys.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,n,s){this.scroll.query(n,D.BLOCK)!=null?this.format(n,s):super.formatAt(t,e,n,s)}insertAt(t,e,n){if(n==null||this.scroll.query(e,D.INLINE)!=null)super.insertAt(t,e,n);else{const s=this.split(t);if(s!=null){const i=this.scroll.create(e,n);s.parent.insertBefore(i,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(t,e){const n=super.replaceWith(t,e);return this.attributes.copy(n),n}update(t,e){super.update(t,e),t.some(n=>n.target===this.domNode&&n.type==="attributes")&&this.attributes.build()}};Qe.blotName="block",Qe.scope=D.BLOCK_BLOT,Qe.tagName="P",Qe.allowedChildren=[bi,Qe,Et];let vf=Qe;const $n=vf,Qs=class extends $t{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(t,e){super.deleteAt(t,e),this.enforceAllowedChildren()}formatAt(t,e,n,s){super.formatAt(t,e,n,s),this.enforceAllowedChildren()}insertAt(t,e,n){super.insertAt(t,e,n),this.enforceAllowedChildren()}optimize(t){super.optimize(t),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Qs.blotName="container",Qs.scope=D.BLOCK_BLOT;let Ef=Qs;const Br=Ef;class Af extends Et{static formats(t,e){}format(t,e){super.formatAt(0,this.length(),t,e)}formatAt(t,e,n,s){t===0&&e===this.length()?this.format(n,s):super.formatAt(t,e,n,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Lt=Af,Nf={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},wf=100,Je=class extends $t{constructor(t,e){super(null,e),this.registry=t,this.scroll=this,this.build(),this.observer=new MutationObserver(n=>{this.update(n)}),this.observer.observe(this.domNode,Nf),this.attach()}create(t,e){return this.registry.create(this,t,e)}find(t,e=!1){const n=this.registry.find(t,e);return n?n.scroll===this?n:e?this.find(n.scroll.domNode.parentNode,!0):null:null}query(t,e=D.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(n=>{n.remove()}):super.deleteAt(t,e)}formatAt(t,e,n,s){this.update(),super.formatAt(t,e,n,s)}insertAt(t,e,n){this.update(),super.insertAt(t,e,n)}optimize(t=[],e={}){super.optimize(e);const n=e.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)t.push(s.pop());const i=(u,h=!0)=>{u==null||u===this||u.domNode.parentNode!=null&&(n.has(u.domNode)||n.set(u.domNode,[]),h&&i(u.parent))},o=u=>{n.has(u.domNode)&&(u instanceof $t&&u.children.forEach(o),n.delete(u.domNode),u.optimize(e))};let a=t;for(let u=0;a.length>0;u+=1){if(u>=wf)throw new Error("[Parchment] Maximum optimize iterations reached");for(a.forEach(h=>{const p=this.find(h.target,!0);p!=null&&(p.domNode===h.target&&(h.type==="childList"?(i(this.find(h.previousSibling,!1)),Array.from(h.addedNodes).forEach(v=>{const f=this.find(v,!1);i(f,!1),f instanceof $t&&f.children.forEach(m=>{i(m,!1)})})):h.type==="attributes"&&i(p.prev)),i(p))}),this.children.forEach(o),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 n=new WeakMap;t.map(s=>{const i=this.find(s.target,!0);return i==null?null:n.has(i.domNode)?(n.get(i.domNode).push(s),null):(n.set(i.domNode,[s]),i)}).forEach(s=>{s!=null&&s!==this&&n.has(s.domNode)&&s.update(n.get(s.domNode)||[],e)}),e.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),e),this.optimize(t,e)}};Je.blotName="scroll",Je.defaultChild=$n,Je.allowedChildren=[$n,Br],Je.scope=D.BLOCK_BLOT,Je.tagName="DIV";let Tf=Je;const yi=Tf,Js=class ho extends Et{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,n){n==null?(this.text=this.text.slice(0,t)+e+this.text.slice(t),this.domNode.data=this.text):super.insertAt(t,e,n)}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 ho&&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 n=this.scroll.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next||void 0),this.text=this.statics.value(this.domNode),n}update(t,e){t.some(n=>n.type==="characterData"&&n.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Js.blotName="text",Js.scope=D.INLINE_BLOT;let xf=Js;const qr=xf,Lf=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Qt,AttributorStore:kr,BlockBlot:$n,ClassAttributor:Ft,ContainerBlot:Br,EmbedBlot:Lt,InlineBlot:bi,LeafBlot:Et,ParentBlot:$t,Registry:on,Scope:D,ScrollBlot:yi,StyleAttributor:Ae,TextBlot:qr},Symbol.toStringTag,{value:"Module"}));var pr={exports:{}},Is,sl;function Sf(){if(sl)return Is;sl=1;var r=-1,t=1,e=0;function n(g,L,b,O,S){if(g===L)return g?[[e,g]]:[];if(b!=null){var T=Rt(g,L,b);if(T)return T}var _=a(g,L),k=g.substring(0,_);g=g.substring(_),L=L.substring(_),_=h(g,L);var j=g.substring(g.length-_);g=g.substring(0,g.length-_),L=L.substring(0,L.length-_);var I=s(g,L);return k&&I.unshift([e,k]),j&&I.push([e,j]),C(I,S),O&&v(I),I}function s(g,L){var b;if(!g)return[[t,L]];if(!L)return[[r,g]];var O=g.length>L.length?g:L,S=g.length>L.length?L:g,T=O.indexOf(S);if(T!==-1)return b=[[t,O.substring(0,T)],[e,S],[t,O.substring(T+S.length)]],g.length>L.length&&(b[0][0]=b[2][0]=r),b;if(S.length===1)return[[r,g],[t,L]];var _=p(g,L);if(_){var k=_[0],j=_[1],I=_[2],K=_[3],F=_[4],V=n(k,I),W=n(j,K);return V.concat([[e,F]],W)}return i(g,L)}function i(g,L){for(var b=g.length,O=L.length,S=Math.ceil((b+O)/2),T=S,_=2*S,k=new Array(_),j=new Array(_),I=0;I<_;I++)k[I]=-1,j[I]=-1;k[T+1]=0,j[T+1]=0;for(var K=b-O,F=K%2!==0,V=0,W=0,$=0,it=0,ot=0;ot<S;ot++){for(var G=-ot+V;G<=ot-W;G+=2){var Q=T+G,Y;G===-ot||G!==ot&&k[Q-1]<k[Q+1]?Y=k[Q+1]:Y=k[Q-1]+1;for(var J=Y-G;Y<b&&J<O&&g.charAt(Y)===L.charAt(J);)Y++,J++;if(k[Q]=Y,Y>b)W+=2;else if(J>O)V+=2;else if(F){var et=T+K-G;if(et>=0&&et<_&&j[et]!==-1){var nt=b-j[et];if(Y>=nt)return o(g,L,Y,J)}}}for(var ct=-ot+$;ct<=ot-it;ct+=2){var et=T+ct,nt;ct===-ot||ct!==ot&&j[et-1]<j[et+1]?nt=j[et+1]:nt=j[et-1]+1;for(var mt=nt-ct;nt<b&&mt<O&&g.charAt(b-nt-1)===L.charAt(O-mt-1);)nt++,mt++;if(j[et]=nt,nt>b)it+=2;else if(mt>O)$+=2;else if(!F){var Q=T+K-ct;if(Q>=0&&Q<_&&k[Q]!==-1){var Y=k[Q],J=T+Y-Q;if(nt=b-nt,Y>=nt)return o(g,L,Y,J)}}}}return[[r,g],[t,L]]}function o(g,L,b,O){var S=g.substring(0,b),T=L.substring(0,O),_=g.substring(b),k=L.substring(O),j=n(S,T),I=n(_,k);return j.concat(I)}function a(g,L){if(!g||!L||g.charAt(0)!==L.charAt(0))return 0;for(var b=0,O=Math.min(g.length,L.length),S=O,T=0;b<S;)g.substring(T,S)==L.substring(T,S)?(b=S,T=b):O=S,S=Math.floor((O-b)/2+b);return M(g.charCodeAt(S-1))&&S--,S}function u(g,L){var b=g.length,O=L.length;if(b==0||O==0)return 0;b>O?g=g.substring(b-O):b<O&&(L=L.substring(0,b));var S=Math.min(b,O);if(g==L)return S;for(var T=0,_=1;;){var k=g.substring(S-_),j=L.indexOf(k);if(j==-1)return T;_+=j,(j==0||g.substring(S-_)==L.substring(0,_))&&(T=_,_++)}}function h(g,L){if(!g||!L||g.slice(-1)!==L.slice(-1))return 0;for(var b=0,O=Math.min(g.length,L.length),S=O,T=0;b<S;)g.substring(g.length-S,g.length-T)==L.substring(L.length-S,L.length-T)?(b=S,T=b):O=S,S=Math.floor((O-b)/2+b);return z(g.charCodeAt(g.length-S))&&S--,S}function p(g,L){var b=g.length>L.length?g:L,O=g.length>L.length?L:g;if(b.length<4||O.length*2<b.length)return null;function S(W,$,it){for(var ot=W.substring(it,it+Math.floor(W.length/4)),G=-1,Q="",Y,J,et,nt;(G=$.indexOf(ot,G+1))!==-1;){var ct=a(W.substring(it),$.substring(G)),mt=h(W.substring(0,it),$.substring(0,G));Q.length<mt+ct&&(Q=$.substring(G-mt,G)+$.substring(G,G+ct),Y=W.substring(0,it-mt),J=W.substring(it+ct),et=$.substring(0,G-mt),nt=$.substring(G+ct))}return Q.length*2>=W.length?[Y,J,et,nt,Q]:null}var T=S(b,O,Math.ceil(b.length/4)),_=S(b,O,Math.ceil(b.length/2)),k;if(!T&&!_)return null;_?T?k=T[4].length>_[4].length?T:_:k=_:k=T;var j,I,K,F;g.length>L.length?(j=k[0],I=k[1],K=k[2],F=k[3]):(K=k[0],F=k[1],j=k[2],I=k[3]);var V=k[4];return[j,I,K,F,V]}function v(g){for(var L=!1,b=[],O=0,S=null,T=0,_=0,k=0,j=0,I=0;T<g.length;)g[T][0]==e?(b[O++]=T,_=j,k=I,j=0,I=0,S=g[T][1]):(g[T][0]==t?j+=g[T][1].length:I+=g[T][1].length,S&&S.length<=Math.max(_,k)&&S.length<=Math.max(j,I)&&(g.splice(b[O-1],0,[r,S]),g[b[O-1]+1][0]=t,O--,O--,T=O>0?b[O-1]:-1,_=0,k=0,j=0,I=0,S=null,L=!0)),T++;for(L&&C(g),x(g),T=1;T<g.length;){if(g[T-1][0]==r&&g[T][0]==t){var K=g[T-1][1],F=g[T][1],V=u(K,F),W=u(F,K);V>=W?(V>=K.length/2||V>=F.length/2)&&(g.splice(T,0,[e,F.substring(0,V)]),g[T-1][1]=K.substring(0,K.length-V),g[T+1][1]=F.substring(V),T++):(W>=K.length/2||W>=F.length/2)&&(g.splice(T,0,[e,K.substring(0,W)]),g[T-1][0]=t,g[T-1][1]=F.substring(0,F.length-W),g[T+1][0]=r,g[T+1][1]=K.substring(W),T++),T++}T++}}var f=/[^a-zA-Z0-9]/,m=/\s/,y=/[\r\n]/,A=/\n\r?\n$/,w=/^\r?\n\r?\n/;function x(g){function L(W,$){if(!W||!$)return 6;var it=W.charAt(W.length-1),ot=$.charAt(0),G=it.match(f),Q=ot.match(f),Y=G&&it.match(m),J=Q&&ot.match(m),et=Y&&it.match(y),nt=J&&ot.match(y),ct=et&&W.match(A),mt=nt&&$.match(w);return ct||mt?5:et||nt?4:G&&!Y&&J?3:Y||J?2:G||Q?1:0}for(var b=1;b<g.length-1;){if(g[b-1][0]==e&&g[b+1][0]==e){var O=g[b-1][1],S=g[b][1],T=g[b+1][1],_=h(O,S);if(_){var k=S.substring(S.length-_);O=O.substring(0,O.length-_),S=k+S.substring(0,S.length-_),T=k+T}for(var j=O,I=S,K=T,F=L(O,S)+L(S,T);S.charAt(0)===T.charAt(0);){O+=S.charAt(0),S=S.substring(1)+T.charAt(0),T=T.substring(1);var V=L(O,S)+L(S,T);V>=F&&(F=V,j=O,I=S,K=T)}g[b-1][1]!=j&&(j?g[b-1][1]=j:(g.splice(b-1,1),b--),g[b][1]=I,K?g[b+1][1]=K:(g.splice(b+1,1),b--))}b++}}function C(g,L){g.push([e,""]);for(var b=0,O=0,S=0,T="",_="",k;b<g.length;){if(b<g.length-1&&!g[b][1]){g.splice(b,1);continue}switch(g[b][0]){case t:S++,_+=g[b][1],b++;break;case r:O++,T+=g[b][1],b++;break;case e:var j=b-S-O-1;if(L){if(j>=0&&rt(g[j][1])){var I=g[j][1].slice(-1);if(g[j][1]=g[j][1].slice(0,-1),T=I+T,_=I+_,!g[j][1]){g.splice(j,1),b--;var K=j-1;g[K]&&g[K][0]===t&&(S++,_=g[K][1]+_,K--),g[K]&&g[K][0]===r&&(O++,T=g[K][1]+T,K--),j=K}}if(U(g[b][1])){var I=g[b][1].charAt(0);g[b][1]=g[b][1].slice(1),T+=I,_+=I}}if(b<g.length-1&&!g[b][1]){g.splice(b,1);break}if(T.length>0||_.length>0){T.length>0&&_.length>0&&(k=a(_,T),k!==0&&(j>=0?g[j][1]+=_.substring(0,k):(g.splice(0,0,[e,_.substring(0,k)]),b++),_=_.substring(k),T=T.substring(k)),k=h(_,T),k!==0&&(g[b][1]=_.substring(_.length-k)+g[b][1],_=_.substring(0,_.length-k),T=T.substring(0,T.length-k)));var F=S+O;T.length===0&&_.length===0?(g.splice(b-F,F),b=b-F):T.length===0?(g.splice(b-F,F,[t,_]),b=b-F+1):_.length===0?(g.splice(b-F,F,[r,T]),b=b-F+1):(g.splice(b-F,F,[r,T],[t,_]),b=b-F+2)}b!==0&&g[b-1][0]===e?(g[b-1][1]+=g[b][1],g.splice(b,1)):b++,S=0,O=0,T="",_="";break}}g[g.length-1][1]===""&&g.pop();var V=!1;for(b=1;b<g.length-1;)g[b-1][0]===e&&g[b+1][0]===e&&(g[b][1].substring(g[b][1].length-g[b-1][1].length)===g[b-1][1]?(g[b][1]=g[b-1][1]+g[b][1].substring(0,g[b][1].length-g[b-1][1].length),g[b+1][1]=g[b-1][1]+g[b+1][1],g.splice(b-1,1),V=!0):g[b][1].substring(0,g[b+1][1].length)==g[b+1][1]&&(g[b-1][1]+=g[b+1][1],g[b][1]=g[b][1].substring(g[b+1][1].length)+g[b+1][1],g.splice(b+1,1),V=!0)),b++;V&&C(g,L)}function M(g){return g>=55296&&g<=56319}function z(g){return g>=56320&&g<=57343}function U(g){return z(g.charCodeAt(0))}function rt(g){return M(g.charCodeAt(g.length-1))}function at(g){for(var L=[],b=0;b<g.length;b++)g[b][1].length>0&&L.push(g[b]);return L}function ft(g,L,b,O){return rt(g)||U(O)?null:at([[e,g],[r,L],[t,b],[e,O]])}function Rt(g,L,b){var O=typeof b=="number"?{index:b,length:0}:b.oldRange,S=typeof b=="number"?null:b.newRange,T=g.length,_=L.length;if(O.length===0&&(S===null||S.length===0)){var k=O.index,j=g.slice(0,k),I=g.slice(k),K=S?S.index:null;t:{var F=k+_-T;if(K!==null&&K!==F||F<0||F>_)break t;var V=L.slice(0,F),W=L.slice(F);if(W!==I)break t;var $=Math.min(k,F),it=j.slice(0,$),ot=V.slice(0,$);if(it!==ot)break t;var G=j.slice($),Q=V.slice($);return ft(it,G,Q,I)}t:{if(K!==null&&K!==k)break t;var Y=k,V=L.slice(0,Y),W=L.slice(Y);if(V!==j)break t;var J=Math.min(T-Y,_-Y),et=I.slice(I.length-J),nt=W.slice(W.length-J);if(et!==nt)break t;var G=I.slice(0,I.length-J),Q=W.slice(0,W.length-J);return ft(j,G,Q,et)}}if(O.length>0&&S&&S.length===0)t:{var it=g.slice(0,O.index),et=g.slice(O.index+O.length),$=it.length,J=et.length;if(_<$+J)break t;var ot=L.slice(0,$),nt=L.slice(_-J);if(it!==ot||et!==nt)break t;var G=g.slice($,T-J),Q=L.slice($,_-J);return ft(it,G,Q,et)}return null}function xt(g,L,b,O){return n(g,L,b,O,!0)}return xt.INSERT=t,xt.DELETE=r,xt.EQUAL=e,Is=xt,Is}var qn={exports:{}};qn.exports;var il;function fo(){return il||(il=1,(function(r,t){var e=200,n="__lodash_hash_undefined__",s=9007199254740991,i="[object Arguments]",o="[object Array]",a="[object Boolean]",u="[object Date]",h="[object Error]",p="[object Function]",v="[object GeneratorFunction]",f="[object Map]",m="[object Number]",y="[object Object]",A="[object Promise]",w="[object RegExp]",x="[object Set]",C="[object String]",M="[object Symbol]",z="[object WeakMap]",U="[object ArrayBuffer]",rt="[object DataView]",at="[object Float32Array]",ft="[object Float64Array]",Rt="[object Int8Array]",xt="[object Int16Array]",g="[object Int32Array]",L="[object Uint8Array]",b="[object Uint8ClampedArray]",O="[object Uint16Array]",S="[object Uint32Array]",T=/[\\^$.*+?()[\]{}|]/g,_=/\w*$/,k=/^\[object .+?Constructor\]$/,j=/^(?:0|[1-9]\d*)$/,I={};I[i]=I[o]=I[U]=I[rt]=I[a]=I[u]=I[at]=I[ft]=I[Rt]=I[xt]=I[g]=I[f]=I[m]=I[y]=I[w]=I[x]=I[C]=I[M]=I[L]=I[b]=I[O]=I[S]=!0,I[h]=I[p]=I[z]=!1;var K=typeof pe=="object"&&pe&&pe.Object===Object&&pe,F=typeof self=="object"&&self&&self.Object===Object&&self,V=K||F||Function("return this")(),W=t&&!t.nodeType&&t,$=W&&!0&&r&&!r.nodeType&&r,it=$&&$.exports===W;function ot(l,c){return l.set(c[0],c[1]),l}function G(l,c){return l.add(c),l}function Q(l,c){for(var d=-1,E=l?l.length:0;++d<E&&c(l[d],d,l)!==!1;);return l}function Y(l,c){for(var d=-1,E=c.length,H=l.length;++d<E;)l[H+d]=c[d];return l}function J(l,c,d,E){for(var H=-1,P=l?l.length:0;++H<P;)d=c(d,l[H],H,l);return d}function et(l,c){for(var d=-1,E=Array(l);++d<l;)E[d]=c(d);return E}function nt(l,c){return l==null?void 0:l[c]}function ct(l){var c=!1;if(l!=null&&typeof l.toString!="function")try{c=!!(l+"")}catch{}return c}function mt(l){var c=-1,d=Array(l.size);return l.forEach(function(E,H){d[++c]=[H,E]}),d}function fn(l,c){return function(d){return l(c(d))}}function Zn(l){var c=-1,d=Array(l.size);return l.forEach(function(E){d[++c]=E}),d}var $r=Array.prototype,Ur=Function.prototype,Pe=Object.prototype,dn=V["__core-js_shared__"],Xn=(function(){var l=/[^.]+$/.exec(dn&&dn.keys&&dn.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""})(),Yn=Ur.toString,Kt=Pe.hasOwnProperty,$e=Pe.toString,Fr=RegExp("^"+Yn.call(Kt).replace(T,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ne=it?V.Buffer:void 0,Ue=V.Symbol,gn=V.Uint8Array,St=fn(Object.getPrototypeOf,Object),Qn=Object.create,Jn=Pe.propertyIsEnumerable,Hr=$r.splice,pn=Object.getOwnPropertySymbols,Fe=Ne?Ne.isBuffer:void 0,tr=fn(Object.keys,Object),He=Bt(V,"DataView"),we=Bt(V,"Map"),kt=Bt(V,"Promise"),ze=Bt(V,"Set"),mn=Bt(V,"WeakMap"),Te=Bt(Object,"create"),bn=Nt(He),xe=Nt(we),yn=Nt(kt),vn=Nt(ze),En=Nt(mn),he=Ue?Ue.prototype:void 0,er=he?he.valueOf:void 0;function ee(l){var c=-1,d=l?l.length:0;for(this.clear();++c<d;){var E=l[c];this.set(E[0],E[1])}}function zr(){this.__data__=Te?Te(null):{}}function Kr(l){return this.has(l)&&delete this.__data__[l]}function Gr(l){var c=this.__data__;if(Te){var d=c[l];return d===n?void 0:d}return Kt.call(c,l)?c[l]:void 0}function nr(l){var c=this.__data__;return Te?c[l]!==void 0:Kt.call(c,l)}function An(l,c){var d=this.__data__;return d[l]=Te&&c===void 0?n:c,this}ee.prototype.clear=zr,ee.prototype.delete=Kr,ee.prototype.get=Gr,ee.prototype.has=nr,ee.prototype.set=An;function dt(l){var c=-1,d=l?l.length:0;for(this.clear();++c<d;){var E=l[c];this.set(E[0],E[1])}}function Vr(){this.__data__=[]}function Wr(l){var c=this.__data__,d=Ge(c,l);if(d<0)return!1;var E=c.length-1;return d==E?c.pop():Hr.call(c,d,1),!0}function Zr(l){var c=this.__data__,d=Ge(c,l);return d<0?void 0:c[d][1]}function Xr(l){return Ge(this.__data__,l)>-1}function Yr(l,c){var d=this.__data__,E=Ge(d,l);return E<0?d.push([l,c]):d[E][1]=c,this}dt.prototype.clear=Vr,dt.prototype.delete=Wr,dt.prototype.get=Zr,dt.prototype.has=Xr,dt.prototype.set=Yr;function bt(l){var c=-1,d=l?l.length:0;for(this.clear();++c<d;){var E=l[c];this.set(E[0],E[1])}}function Qr(){this.__data__={hash:new ee,map:new(we||dt),string:new ee}}function Jr(l){return Se(this,l).delete(l)}function ts(l){return Se(this,l).get(l)}function es(l){return Se(this,l).has(l)}function ns(l,c){return Se(this,l).set(l,c),this}bt.prototype.clear=Qr,bt.prototype.delete=Jr,bt.prototype.get=ts,bt.prototype.has=es,bt.prototype.set=ns;function wt(l){this.__data__=new dt(l)}function rs(){this.__data__=new dt}function ss(l){return this.__data__.delete(l)}function is(l){return this.__data__.get(l)}function ls(l){return this.__data__.has(l)}function os(l,c){var d=this.__data__;if(d instanceof dt){var E=d.__data__;if(!we||E.length<e-1)return E.push([l,c]),this;d=this.__data__=new bt(E)}return d.set(l,c),this}wt.prototype.clear=rs,wt.prototype.delete=ss,wt.prototype.get=is,wt.prototype.has=ls,wt.prototype.set=os;function Ke(l,c){var d=xn(l)||We(l)?et(l.length,String):[],E=d.length,H=!!E;for(var P in l)Kt.call(l,P)&&!(H&&(P=="length"||As(P,E)))&&d.push(P);return d}function rr(l,c,d){var E=l[c];(!(Kt.call(l,c)&&ar(E,d))||d===void 0&&!(c in l))&&(l[c]=d)}function Ge(l,c){for(var d=l.length;d--;)if(ar(l[d][0],c))return d;return-1}function Gt(l,c){return l&&Tn(c,Sn(c),l)}function Nn(l,c,d,E,H,P,X){var Z;if(E&&(Z=P?E(l,H,P,X):E(l)),Z!==void 0)return Z;if(!Wt(l))return l;var ut=xn(l);if(ut){if(Z=vs(l),!c)return ms(l,Z)}else{var tt=re(l),yt=tt==p||tt==v;if(cr(l))return Ve(l,c);if(tt==y||tt==i||yt&&!P){if(ct(l))return P?l:{};if(Z=Vt(yt?{}:l),!c)return bs(l,Gt(Z,l))}else{if(!I[tt])return P?l:{};Z=Es(l,tt,Nn,c)}}X||(X=new wt);var Tt=X.get(l);if(Tt)return Tt;if(X.set(l,Z),!ut)var ht=d?ys(l):Sn(l);return Q(ht||l,function(vt,gt){ht&&(gt=vt,vt=l[gt]),rr(Z,gt,Nn(vt,c,d,E,gt,l,X))}),Z}function as(l){return Wt(l)?Qn(l):{}}function cs(l,c,d){var E=c(l);return xn(l)?E:Y(E,d(l))}function us(l){return $e.call(l)}function hs(l){if(!Wt(l)||ws(l))return!1;var c=Ln(l)||ct(l)?Fr:k;return c.test(Nt(l))}function fs(l){if(!lr(l))return tr(l);var c=[];for(var d in Object(l))Kt.call(l,d)&&d!="constructor"&&c.push(d);return c}function Ve(l,c){if(c)return l.slice();var d=new l.constructor(l.length);return l.copy(d),d}function wn(l){var c=new l.constructor(l.byteLength);return new gn(c).set(new gn(l)),c}function Le(l,c){var d=c?wn(l.buffer):l.buffer;return new l.constructor(d,l.byteOffset,l.byteLength)}function sr(l,c,d){var E=c?d(mt(l),!0):mt(l);return J(E,ot,new l.constructor)}function ir(l){var c=new l.constructor(l.source,_.exec(l));return c.lastIndex=l.lastIndex,c}function ds(l,c,d){var E=c?d(Zn(l),!0):Zn(l);return J(E,G,new l.constructor)}function gs(l){return er?Object(er.call(l)):{}}function ps(l,c){var d=c?wn(l.buffer):l.buffer;return new l.constructor(d,l.byteOffset,l.length)}function ms(l,c){var d=-1,E=l.length;for(c||(c=Array(E));++d<E;)c[d]=l[d];return c}function Tn(l,c,d,E){d||(d={});for(var H=-1,P=c.length;++H<P;){var X=c[H],Z=void 0;rr(d,X,Z===void 0?l[X]:Z)}return d}function bs(l,c){return Tn(l,ne(l),c)}function ys(l){return cs(l,Sn,ne)}function Se(l,c){var d=l.__data__;return Ns(c)?d[typeof c=="string"?"string":"hash"]:d.map}function Bt(l,c){var d=nt(l,c);return hs(d)?d:void 0}var ne=pn?fn(pn,Object):xs,re=us;(He&&re(new He(new ArrayBuffer(1)))!=rt||we&&re(new we)!=f||kt&&re(kt.resolve())!=A||ze&&re(new ze)!=x||mn&&re(new mn)!=z)&&(re=function(l){var c=$e.call(l),d=c==y?l.constructor:void 0,E=d?Nt(d):void 0;if(E)switch(E){case bn:return rt;case xe:return f;case yn:return A;case vn:return x;case En:return z}return c});function vs(l){var c=l.length,d=l.constructor(c);return c&&typeof l[0]=="string"&&Kt.call(l,"index")&&(d.index=l.index,d.input=l.input),d}function Vt(l){return typeof l.constructor=="function"&&!lr(l)?as(St(l)):{}}function Es(l,c,d,E){var H=l.constructor;switch(c){case U:return wn(l);case a:case u:return new H(+l);case rt:return Le(l,E);case at:case ft:case Rt:case xt:case g:case L:case b:case O:case S:return ps(l,E);case f:return sr(l,E,d);case m:case C:return new H(l);case w:return ir(l);case x:return ds(l,E,d);case M:return gs(l)}}function As(l,c){return c=c??s,!!c&&(typeof l=="number"||j.test(l))&&l>-1&&l%1==0&&l<c}function Ns(l){var c=typeof l;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?l!=="__proto__":l===null}function ws(l){return!!Xn&&Xn in l}function lr(l){var c=l&&l.constructor,d=typeof c=="function"&&c.prototype||Pe;return l===d}function Nt(l){if(l!=null){try{return Yn.call(l)}catch{}try{return l+""}catch{}}return""}function or(l){return Nn(l,!0,!0)}function ar(l,c){return l===c||l!==l&&c!==c}function We(l){return Ts(l)&&Kt.call(l,"callee")&&(!Jn.call(l,"callee")||$e.call(l)==i)}var xn=Array.isArray;function Ze(l){return l!=null&&ur(l.length)&&!Ln(l)}function Ts(l){return hr(l)&&Ze(l)}var cr=Fe||Ls;function Ln(l){var c=Wt(l)?$e.call(l):"";return c==p||c==v}function ur(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=s}function Wt(l){var c=typeof l;return!!l&&(c=="object"||c=="function")}function hr(l){return!!l&&typeof l=="object"}function Sn(l){return Ze(l)?Ke(l):fs(l)}function xs(){return[]}function Ls(){return!1}r.exports=or})(qn,qn.exports)),qn.exports}var Cn={exports:{}};Cn.exports;var ll;function go(){return ll||(ll=1,(function(r,t){var e=200,n="__lodash_hash_undefined__",s=1,i=2,o=9007199254740991,a="[object Arguments]",u="[object Array]",h="[object AsyncFunction]",p="[object Boolean]",v="[object Date]",f="[object Error]",m="[object Function]",y="[object GeneratorFunction]",A="[object Map]",w="[object Number]",x="[object Null]",C="[object Object]",M="[object Promise]",z="[object Proxy]",U="[object RegExp]",rt="[object Set]",at="[object String]",ft="[object Symbol]",Rt="[object Undefined]",xt="[object WeakMap]",g="[object ArrayBuffer]",L="[object DataView]",b="[object Float32Array]",O="[object Float64Array]",S="[object Int8Array]",T="[object Int16Array]",_="[object Int32Array]",k="[object Uint8Array]",j="[object Uint8ClampedArray]",I="[object Uint16Array]",K="[object Uint32Array]",F=/[\\^$.*+?()[\]{}|]/g,V=/^\[object .+?Constructor\]$/,W=/^(?:0|[1-9]\d*)$/,$={};$[b]=$[O]=$[S]=$[T]=$[_]=$[k]=$[j]=$[I]=$[K]=!0,$[a]=$[u]=$[g]=$[p]=$[L]=$[v]=$[f]=$[m]=$[A]=$[w]=$[C]=$[U]=$[rt]=$[at]=$[xt]=!1;var it=typeof pe=="object"&&pe&&pe.Object===Object&&pe,ot=typeof self=="object"&&self&&self.Object===Object&&self,G=it||ot||Function("return this")(),Q=t&&!t.nodeType&&t,Y=Q&&!0&&r&&!r.nodeType&&r,J=Y&&Y.exports===Q,et=J&&it.process,nt=(function(){try{return et&&et.binding&&et.binding("util")}catch{}})(),ct=nt&&nt.isTypedArray;function mt(l,c){for(var d=-1,E=l==null?0:l.length,H=0,P=[];++d<E;){var X=l[d];c(X,d,l)&&(P[H++]=X)}return P}function fn(l,c){for(var d=-1,E=c.length,H=l.length;++d<E;)l[H+d]=c[d];return l}function Zn(l,c){for(var d=-1,E=l==null?0:l.length;++d<E;)if(c(l[d],d,l))return!0;return!1}function $r(l,c){for(var d=-1,E=Array(l);++d<l;)E[d]=c(d);return E}function Ur(l){return function(c){return l(c)}}function Pe(l,c){return l.has(c)}function dn(l,c){return l==null?void 0:l[c]}function Xn(l){var c=-1,d=Array(l.size);return l.forEach(function(E,H){d[++c]=[H,E]}),d}function Yn(l,c){return function(d){return l(c(d))}}function Kt(l){var c=-1,d=Array(l.size);return l.forEach(function(E){d[++c]=E}),d}var $e=Array.prototype,Fr=Function.prototype,Ne=Object.prototype,Ue=G["__core-js_shared__"],gn=Fr.toString,St=Ne.hasOwnProperty,Qn=(function(){var l=/[^.]+$/.exec(Ue&&Ue.keys&&Ue.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""})(),Jn=Ne.toString,Hr=RegExp("^"+gn.call(St).replace(F,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pn=J?G.Buffer:void 0,Fe=G.Symbol,tr=G.Uint8Array,He=Ne.propertyIsEnumerable,we=$e.splice,kt=Fe?Fe.toStringTag:void 0,ze=Object.getOwnPropertySymbols,mn=pn?pn.isBuffer:void 0,Te=Yn(Object.keys,Object),bn=ne(G,"DataView"),xe=ne(G,"Map"),yn=ne(G,"Promise"),vn=ne(G,"Set"),En=ne(G,"WeakMap"),he=ne(Object,"create"),er=Nt(bn),ee=Nt(xe),zr=Nt(yn),Kr=Nt(vn),Gr=Nt(En),nr=Fe?Fe.prototype:void 0,An=nr?nr.valueOf:void 0;function dt(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var E=l[c];this.set(E[0],E[1])}}function Vr(){this.__data__=he?he(null):{},this.size=0}function Wr(l){var c=this.has(l)&&delete this.__data__[l];return this.size-=c?1:0,c}function Zr(l){var c=this.__data__;if(he){var d=c[l];return d===n?void 0:d}return St.call(c,l)?c[l]:void 0}function Xr(l){var c=this.__data__;return he?c[l]!==void 0:St.call(c,l)}function Yr(l,c){var d=this.__data__;return this.size+=this.has(l)?0:1,d[l]=he&&c===void 0?n:c,this}dt.prototype.clear=Vr,dt.prototype.delete=Wr,dt.prototype.get=Zr,dt.prototype.has=Xr,dt.prototype.set=Yr;function bt(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var E=l[c];this.set(E[0],E[1])}}function Qr(){this.__data__=[],this.size=0}function Jr(l){var c=this.__data__,d=Ve(c,l);if(d<0)return!1;var E=c.length-1;return d==E?c.pop():we.call(c,d,1),--this.size,!0}function ts(l){var c=this.__data__,d=Ve(c,l);return d<0?void 0:c[d][1]}function es(l){return Ve(this.__data__,l)>-1}function ns(l,c){var d=this.__data__,E=Ve(d,l);return E<0?(++this.size,d.push([l,c])):d[E][1]=c,this}bt.prototype.clear=Qr,bt.prototype.delete=Jr,bt.prototype.get=ts,bt.prototype.has=es,bt.prototype.set=ns;function wt(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var E=l[c];this.set(E[0],E[1])}}function rs(){this.size=0,this.__data__={hash:new dt,map:new(xe||bt),string:new dt}}function ss(l){var c=Bt(this,l).delete(l);return this.size-=c?1:0,c}function is(l){return Bt(this,l).get(l)}function ls(l){return Bt(this,l).has(l)}function os(l,c){var d=Bt(this,l),E=d.size;return d.set(l,c),this.size+=d.size==E?0:1,this}wt.prototype.clear=rs,wt.prototype.delete=ss,wt.prototype.get=is,wt.prototype.has=ls,wt.prototype.set=os;function Ke(l){var c=-1,d=l==null?0:l.length;for(this.__data__=new wt;++c<d;)this.add(l[c])}function rr(l){return this.__data__.set(l,n),this}function Ge(l){return this.__data__.has(l)}Ke.prototype.add=Ke.prototype.push=rr,Ke.prototype.has=Ge;function Gt(l){var c=this.__data__=new bt(l);this.size=c.size}function Nn(){this.__data__=new bt,this.size=0}function as(l){var c=this.__data__,d=c.delete(l);return this.size=c.size,d}function cs(l){return this.__data__.get(l)}function us(l){return this.__data__.has(l)}function hs(l,c){var d=this.__data__;if(d instanceof bt){var E=d.__data__;if(!xe||E.length<e-1)return E.push([l,c]),this.size=++d.size,this;d=this.__data__=new wt(E)}return d.set(l,c),this.size=d.size,this}Gt.prototype.clear=Nn,Gt.prototype.delete=as,Gt.prototype.get=cs,Gt.prototype.has=us,Gt.prototype.set=hs;function fs(l,c){var d=We(l),E=!d&&ar(l),H=!d&&!E&&Ze(l),P=!d&&!E&&!H&&hr(l),X=d||E||H||P,Z=X?$r(l.length,String):[],ut=Z.length;for(var tt in l)St.call(l,tt)&&!(X&&(tt=="length"||H&&(tt=="offset"||tt=="parent")||P&&(tt=="buffer"||tt=="byteLength"||tt=="byteOffset")||Es(tt,ut)))&&Z.push(tt);return Z}function Ve(l,c){for(var d=l.length;d--;)if(or(l[d][0],c))return d;return-1}function wn(l,c,d){var E=c(l);return We(l)?E:fn(E,d(l))}function Le(l){return l==null?l===void 0?Rt:x:kt&&kt in Object(l)?re(l):lr(l)}function sr(l){return Wt(l)&&Le(l)==a}function ir(l,c,d,E,H){return l===c?!0:l==null||c==null||!Wt(l)&&!Wt(c)?l!==l&&c!==c:ds(l,c,d,E,ir,H)}function ds(l,c,d,E,H,P){var X=We(l),Z=We(c),ut=X?u:Vt(l),tt=Z?u:Vt(c);ut=ut==a?C:ut,tt=tt==a?C:tt;var yt=ut==C,Tt=tt==C,ht=ut==tt;if(ht&&Ze(l)){if(!Ze(c))return!1;X=!0,yt=!1}if(ht&&!yt)return P||(P=new Gt),X||hr(l)?Tn(l,c,d,E,H,P):bs(l,c,ut,d,E,H,P);if(!(d&s)){var vt=yt&&St.call(l,"__wrapped__"),gt=Tt&&St.call(c,"__wrapped__");if(vt||gt){var fe=vt?l.value():l,se=gt?c.value():c;return P||(P=new Gt),H(fe,se,d,E,P)}}return ht?(P||(P=new Gt),ys(l,c,d,E,H,P)):!1}function gs(l){if(!ur(l)||Ns(l))return!1;var c=cr(l)?Hr:V;return c.test(Nt(l))}function ps(l){return Wt(l)&&Ln(l.length)&&!!$[Le(l)]}function ms(l){if(!ws(l))return Te(l);var c=[];for(var d in Object(l))St.call(l,d)&&d!="constructor"&&c.push(d);return c}function Tn(l,c,d,E,H,P){var X=d&s,Z=l.length,ut=c.length;if(Z!=ut&&!(X&&ut>Z))return!1;var tt=P.get(l);if(tt&&P.get(c))return tt==c;var yt=-1,Tt=!0,ht=d&i?new Ke:void 0;for(P.set(l,c),P.set(c,l);++yt<Z;){var vt=l[yt],gt=c[yt];if(E)var fe=X?E(gt,vt,yt,c,l,P):E(vt,gt,yt,l,c,P);if(fe!==void 0){if(fe)continue;Tt=!1;break}if(ht){if(!Zn(c,function(se,_e){if(!Pe(ht,_e)&&(vt===se||H(vt,se,d,E,P)))return ht.push(_e)})){Tt=!1;break}}else if(!(vt===gt||H(vt,gt,d,E,P))){Tt=!1;break}}return P.delete(l),P.delete(c),Tt}function bs(l,c,d,E,H,P,X){switch(d){case L:if(l.byteLength!=c.byteLength||l.byteOffset!=c.byteOffset)return!1;l=l.buffer,c=c.buffer;case g:return!(l.byteLength!=c.byteLength||!P(new tr(l),new tr(c)));case p:case v:case w:return or(+l,+c);case f:return l.name==c.name&&l.message==c.message;case U:case at:return l==c+"";case A:var Z=Xn;case rt:var ut=E&s;if(Z||(Z=Kt),l.size!=c.size&&!ut)return!1;var tt=X.get(l);if(tt)return tt==c;E|=i,X.set(l,c);var yt=Tn(Z(l),Z(c),E,H,P,X);return X.delete(l),yt;case ft:if(An)return An.call(l)==An.call(c)}return!1}function ys(l,c,d,E,H,P){var X=d&s,Z=Se(l),ut=Z.length,tt=Se(c),yt=tt.length;if(ut!=yt&&!X)return!1;for(var Tt=ut;Tt--;){var ht=Z[Tt];if(!(X?ht in c:St.call(c,ht)))return!1}var vt=P.get(l);if(vt&&P.get(c))return vt==c;var gt=!0;P.set(l,c),P.set(c,l);for(var fe=X;++Tt<ut;){ht=Z[Tt];var se=l[ht],_e=c[ht];if(E)var Oi=X?E(_e,se,ht,c,l,P):E(se,_e,ht,l,c,P);if(!(Oi===void 0?se===_e||H(se,_e,d,E,P):Oi)){gt=!1;break}fe||(fe=ht=="constructor")}if(gt&&!fe){var fr=l.constructor,dr=c.constructor;fr!=dr&&"constructor"in l&&"constructor"in c&&!(typeof fr=="function"&&fr instanceof fr&&typeof dr=="function"&&dr instanceof dr)&&(gt=!1)}return P.delete(l),P.delete(c),gt}function Se(l){return wn(l,Sn,vs)}function Bt(l,c){var d=l.__data__;return As(c)?d[typeof c=="string"?"string":"hash"]:d.map}function ne(l,c){var d=dn(l,c);return gs(d)?d:void 0}function re(l){var c=St.call(l,kt),d=l[kt];try{l[kt]=void 0;var E=!0}catch{}var H=Jn.call(l);return E&&(c?l[kt]=d:delete l[kt]),H}var vs=ze?function(l){return l==null?[]:(l=Object(l),mt(ze(l),function(c){return He.call(l,c)}))}:xs,Vt=Le;(bn&&Vt(new bn(new ArrayBuffer(1)))!=L||xe&&Vt(new xe)!=A||yn&&Vt(yn.resolve())!=M||vn&&Vt(new vn)!=rt||En&&Vt(new En)!=xt)&&(Vt=function(l){var c=Le(l),d=c==C?l.constructor:void 0,E=d?Nt(d):"";if(E)switch(E){case er:return L;case ee:return A;case zr:return M;case Kr:return rt;case Gr:return xt}return c});function Es(l,c){return c=c??o,!!c&&(typeof l=="number"||W.test(l))&&l>-1&&l%1==0&&l<c}function As(l){var c=typeof l;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?l!=="__proto__":l===null}function Ns(l){return!!Qn&&Qn in l}function ws(l){var c=l&&l.constructor,d=typeof c=="function"&&c.prototype||Ne;return l===d}function lr(l){return Jn.call(l)}function Nt(l){if(l!=null){try{return gn.call(l)}catch{}try{return l+""}catch{}}return""}function or(l,c){return l===c||l!==l&&c!==c}var ar=sr((function(){return arguments})())?sr:function(l){return Wt(l)&&St.call(l,"callee")&&!He.call(l,"callee")},We=Array.isArray;function xn(l){return l!=null&&Ln(l.length)&&!cr(l)}var Ze=mn||Ls;function Ts(l,c){return ir(l,c)}function cr(l){if(!ur(l))return!1;var c=Le(l);return c==m||c==y||c==h||c==z}function Ln(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=o}function ur(l){var c=typeof l;return l!=null&&(c=="object"||c=="function")}function Wt(l){return l!=null&&typeof l=="object"}var hr=ct?Ur(ct):ps;function Sn(l){return xn(l)?fs(l):ms(l)}function xs(){return[]}function Ls(){return!1}r.exports=Ts})(Cn,Cn.exports)),Cn.exports}var mr={},ol;function _f(){if(ol)return mr;ol=1,Object.defineProperty(mr,"__esModule",{value:!0});const r=fo(),t=go();var e;return(function(n){function s(u={},h={},p=!1){typeof u!="object"&&(u={}),typeof h!="object"&&(h={});let v=r(h);p||(v=Object.keys(v).reduce((f,m)=>(v[m]!=null&&(f[m]=v[m]),f),{}));for(const f in u)u[f]!==void 0&&h[f]===void 0&&(v[f]=u[f]);return Object.keys(v).length>0?v:void 0}n.compose=s;function i(u={},h={}){typeof u!="object"&&(u={}),typeof h!="object"&&(h={});const p=Object.keys(u).concat(Object.keys(h)).reduce((v,f)=>(t(u[f],h[f])||(v[f]=h[f]===void 0?null:h[f]),v),{});return Object.keys(p).length>0?p:void 0}n.diff=i;function o(u={},h={}){u=u||{};const p=Object.keys(h).reduce((v,f)=>(h[f]!==u[f]&&u[f]!==void 0&&(v[f]=h[f]),v),{});return Object.keys(u).reduce((v,f)=>(u[f]!==h[f]&&h[f]===void 0&&(v[f]=null),v),p)}n.invert=o;function a(u,h,p=!1){if(typeof u!="object")return h;if(typeof h!="object")return;if(!p)return h;const v=Object.keys(h).reduce((f,m)=>(u[m]===void 0&&(f[m]=h[m]),f),{});return Object.keys(v).length>0?v:void 0}n.transform=a})(e||(e={})),mr.default=e,mr}var br={},al;function po(){if(al)return br;al=1,Object.defineProperty(br,"__esModule",{value:!0});var r;return(function(t){function e(n){return typeof n.delete=="number"?n.delete:typeof n.retain=="number"?n.retain:typeof n.retain=="object"&&n.retain!==null?1:typeof n.insert=="string"?n.insert.length:1}t.length=e})(r||(r={})),br.default=r,br}var yr={},cl;function Of(){if(cl)return yr;cl=1,Object.defineProperty(yr,"__esModule",{value:!0});const r=po();class t{constructor(n){this.ops=n,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(n){n||(n=1/0);const s=this.ops[this.index];if(s){const i=this.offset,o=r.default.length(s);if(n>=o-i?(n=o-i,this.index+=1,this.offset=0):this.offset+=n,typeof s.delete=="number")return{delete:n};{const a={};return s.attributes&&(a.attributes=s.attributes),typeof s.retain=="number"?a.retain=n:typeof s.retain=="object"&&s.retain!==null?a.retain=s.retain:typeof s.insert=="string"?a.insert=s.insert.substr(i,n):a.insert=s.insert,a}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?r.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const n=this.ops[this.index];return n?typeof n.delete=="number"?"delete":typeof n.retain=="number"||typeof n.retain=="object"&&n.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const n=this.offset,s=this.index,i=this.next(),o=this.ops.slice(this.index);return this.offset=n,this.index=s,[i].concat(o)}}else return[]}}return yr.default=t,yr}var ul;function qf(){return ul||(ul=1,(function(r,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const e=Sf(),n=fo(),s=go(),i=_f();t.AttributeMap=i.default;const o=po();t.Op=o.default;const a=Of();t.OpIterator=a.default;const u="\0",h=(v,f)=>{if(typeof v!="object"||v===null)throw new Error(`cannot retain a ${typeof v}`);if(typeof f!="object"||f===null)throw new Error(`cannot retain a ${typeof f}`);const m=Object.keys(v)[0];if(!m||m!==Object.keys(f)[0])throw new Error(`embed types not matched: ${m} != ${Object.keys(f)[0]}`);return[m,v[m],f[m]]};class p{constructor(f){Array.isArray(f)?this.ops=f:f!=null&&Array.isArray(f.ops)?this.ops=f.ops:this.ops=[]}static registerEmbed(f,m){this.handlers[f]=m}static unregisterEmbed(f){delete this.handlers[f]}static getHandler(f){const m=this.handlers[f];if(!m)throw new Error(`no handlers for embed type "${f}"`);return m}insert(f,m){const y={};return typeof f=="string"&&f.length===0?this:(y.insert=f,m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(y.attributes=m),this.push(y))}delete(f){return f<=0?this:this.push({delete:f})}retain(f,m){if(typeof f=="number"&&f<=0)return this;const y={retain:f};return m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(y.attributes=m),this.push(y)}push(f){let m=this.ops.length,y=this.ops[m-1];if(f=n(f),typeof y=="object"){if(typeof f.delete=="number"&&typeof y.delete=="number")return this.ops[m-1]={delete:y.delete+f.delete},this;if(typeof y.delete=="number"&&f.insert!=null&&(m-=1,y=this.ops[m-1],typeof y!="object"))return this.ops.unshift(f),this;if(s(f.attributes,y.attributes)){if(typeof f.insert=="string"&&typeof y.insert=="string")return this.ops[m-1]={insert:y.insert+f.insert},typeof f.attributes=="object"&&(this.ops[m-1].attributes=f.attributes),this;if(typeof f.retain=="number"&&typeof y.retain=="number")return this.ops[m-1]={retain:y.retain+f.retain},typeof f.attributes=="object"&&(this.ops[m-1].attributes=f.attributes),this}}return m===this.ops.length?this.ops.push(f):this.ops.splice(m,0,f),this}chop(){const f=this.ops[this.ops.length-1];return f&&typeof f.retain=="number"&&!f.attributes&&this.ops.pop(),this}filter(f){return this.ops.filter(f)}forEach(f){this.ops.forEach(f)}map(f){return this.ops.map(f)}partition(f){const m=[],y=[];return this.forEach(A=>{(f(A)?m:y).push(A)}),[m,y]}reduce(f,m){return this.ops.reduce(f,m)}changeLength(){return this.reduce((f,m)=>m.insert?f+o.default.length(m):m.delete?f-m.delete:f,0)}length(){return this.reduce((f,m)=>f+o.default.length(m),0)}slice(f=0,m=1/0){const y=[],A=new a.default(this.ops);let w=0;for(;w<m&&A.hasNext();){let x;w<f?x=A.next(f-w):(x=A.next(m-w),y.push(x)),w+=o.default.length(x)}return new p(y)}compose(f){const m=new a.default(this.ops),y=new a.default(f.ops),A=[],w=y.peek();if(w!=null&&typeof w.retain=="number"&&w.attributes==null){let C=w.retain;for(;m.peekType()==="insert"&&m.peekLength()<=C;)C-=m.peekLength(),A.push(m.next());w.retain-C>0&&y.next(w.retain-C)}const x=new p(A);for(;m.hasNext()||y.hasNext();)if(y.peekType()==="insert")x.push(y.next());else if(m.peekType()==="delete")x.push(m.next());else{const C=Math.min(m.peekLength(),y.peekLength()),M=m.next(C),z=y.next(C);if(z.retain){const U={};if(typeof M.retain=="number")U.retain=typeof z.retain=="number"?C:z.retain;else if(typeof z.retain=="number")M.retain==null?U.insert=M.insert:U.retain=M.retain;else{const at=M.retain==null?"insert":"retain",[ft,Rt,xt]=h(M[at],z.retain),g=p.getHandler(ft);U[at]={[ft]:g.compose(Rt,xt,at==="retain")}}const rt=i.default.compose(M.attributes,z.attributes,typeof M.retain=="number");if(rt&&(U.attributes=rt),x.push(U),!y.hasNext()&&s(x.ops[x.ops.length-1],U)){const at=new p(m.rest());return x.concat(at).chop()}}else typeof z.delete=="number"&&(typeof M.retain=="number"||typeof M.retain=="object"&&M.retain!==null)&&x.push(z)}return x.chop()}concat(f){const m=new p(this.ops.slice());return f.ops.length>0&&(m.push(f.ops[0]),m.ops=m.ops.concat(f.ops.slice(1))),m}diff(f,m){if(this.ops===f.ops)return new p;const y=[this,f].map(M=>M.map(z=>{if(z.insert!=null)return typeof z.insert=="string"?z.insert:u;const U=M===f?"on":"with";throw new Error("diff() called "+U+" non-document")}).join("")),A=new p,w=e(y[0],y[1],m,!0),x=new a.default(this.ops),C=new a.default(f.ops);return w.forEach(M=>{let z=M[1].length;for(;z>0;){let U=0;switch(M[0]){case e.INSERT:U=Math.min(C.peekLength(),z),A.push(C.next(U));break;case e.DELETE:U=Math.min(z,x.peekLength()),x.next(U),A.delete(U);break;case e.EQUAL:U=Math.min(x.peekLength(),C.peekLength(),z);const rt=x.next(U),at=C.next(U);s(rt.insert,at.insert)?A.retain(U,i.default.diff(rt.attributes,at.attributes)):A.push(at).delete(U);break}z-=U}}),A.chop()}eachLine(f,m=`
2
- `){const y=new a.default(this.ops);let A=new p,w=0;for(;y.hasNext();){if(y.peekType()!=="insert")return;const x=y.peek(),C=o.default.length(x)-y.peekLength(),M=typeof x.insert=="string"?x.insert.indexOf(m,C)-C:-1;if(M<0)A.push(y.next());else if(M>0)A.push(y.next(M));else{if(f(A,y.next(1).attributes||{},w)===!1)return;w+=1,A=new p}}A.length()>0&&f(A,{},w)}invert(f){const m=new p;return this.reduce((y,A)=>{if(A.insert)m.delete(o.default.length(A));else{if(typeof A.retain=="number"&&A.attributes==null)return m.retain(A.retain),y+A.retain;if(A.delete||typeof A.retain=="number"){const w=A.delete||A.retain;return f.slice(y,y+w).forEach(C=>{A.delete?m.push(C):A.retain&&A.attributes&&m.retain(o.default.length(C),i.default.invert(A.attributes,C.attributes))}),y+w}else if(typeof A.retain=="object"&&A.retain!==null){const w=f.slice(y,y+1),x=new a.default(w.ops).next(),[C,M,z]=h(A.retain,x.insert),U=p.getHandler(C);return m.retain({[C]:U.invert(M,z)},i.default.invert(A.attributes,x.attributes)),y+1}}return y},0),m.chop()}transform(f,m=!1){if(m=!!m,typeof f=="number")return this.transformPosition(f,m);const y=f,A=new a.default(this.ops),w=new a.default(y.ops),x=new p;for(;A.hasNext()||w.hasNext();)if(A.peekType()==="insert"&&(m||w.peekType()!=="insert"))x.retain(o.default.length(A.next()));else if(w.peekType()==="insert")x.push(w.next());else{const C=Math.min(A.peekLength(),w.peekLength()),M=A.next(C),z=w.next(C);if(M.delete)continue;if(z.delete)x.push(z);else{const U=M.retain,rt=z.retain;let at=typeof rt=="object"&&rt!==null?rt:C;if(typeof U=="object"&&U!==null&&typeof rt=="object"&&rt!==null){const ft=Object.keys(U)[0];if(ft===Object.keys(rt)[0]){const Rt=p.getHandler(ft);Rt&&(at={[ft]:Rt.transform(U[ft],rt[ft],m)})}}x.retain(at,i.default.transform(M.attributes,z.attributes,m))}}return x.chop()}transformPosition(f,m=!1){m=!!m;const y=new a.default(this.ops);let A=0;for(;y.hasNext()&&A<=f;){const w=y.peekLength(),x=y.peekType();if(y.next(),x==="delete"){f-=Math.min(w,f-A);continue}else x==="insert"&&(A<f||!m)&&(f+=w);A+=w}return f}}p.Op=o.default,p.OpIterator=a.default,p.AttributeMap=i.default,p.handlers={},t.default=p,r.exports=p,r.exports.default=p})(pr,pr.exports)),pr.exports}var It=qf();const B=Bl(It);class Ht extends Lt{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Ht.blotName="break";Ht.tagName="BR";let Ut=class extends qr{};const Cf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Mr(r){return r.replace(/[&<>"']/g,t=>Cf[t])}const Zt=class Zt extends bi{static compare(t,e){const n=Zt.order.indexOf(t),s=Zt.order.indexOf(e);return n>=0||s>=0?n-s:t===e?0:t<e?-1:1}formatAt(t,e,n,s){if(Zt.compare(this.statics.blotName,n)<0&&this.scroll.query(n,D.BLOT)){const i=this.isolate(t,e);s&&i.wrap(n,s)}else super.formatAt(t,e,n,s)}optimize(t){if(super.optimize(t),this.parent instanceof Zt&&Zt.compare(this.statics.blotName,this.parent.statics.blotName)>0){const e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}};q(Zt,"allowedChildren",[Zt,Ht,Lt,Ut]),q(Zt,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let Jt=Zt;const hl=1;class pt extends $n{constructor(){super(...arguments);q(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=mo(this)),this.cache.delta}deleteAt(e,n){super.deleteAt(e,n),this.cache={}}formatAt(e,n,s,i){n<=0||(this.scroll.query(s,D.BLOCK)?e+n===this.length()&&this.format(s,i):super.formatAt(e,Math.min(n,this.length()-e-1),s,i),this.cache={})}insertAt(e,n,s){if(s!=null){super.insertAt(e,n,s),this.cache={};return}if(n.length===0)return;const i=n.split(`
1
+ var Ho=Object.defineProperty;var zo=(r,t,e)=>t in r?Ho(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var q=(r,t,e)=>zo(r,typeof t!="symbol"?t+"":t,e);import{c as pe,g as Bl,R as Oe,r as qi,j as Ss}from"./index-BBCLwDZq.js";var Ml=typeof global=="object"&&global&&global.Object===Object&&global,Ko=typeof self=="object"&&self&&self.Object===Object&&self,te=Ml||Ko||Function("return this")(),ve=te.Symbol,Dl=Object.prototype,Go=Dl.hasOwnProperty,Vo=Dl.toString,_n=ve?ve.toStringTag:void 0;function Wo(r){var t=Go.call(r,_n),e=r[_n];try{r[_n]=void 0;var n=!0}catch{}var s=Vo.call(r);return n&&(t?r[_n]=e:delete r[_n]),s}var Zo=Object.prototype,Xo=Zo.toString;function Yo(r){return Xo.call(r)}var Qo="[object Null]",Jo="[object Undefined]",Ci=ve?ve.toStringTag:void 0;function hn(r){return r==null?r===void 0?Jo:Qo:Ci&&Ci in Object(r)?Wo(r):Yo(r)}function le(r){return r!=null&&typeof r=="object"}var qe=Array.isArray;function Ee(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}function jl(r){return r}var ta="[object AsyncFunction]",ea="[object Function]",na="[object GeneratorFunction]",ra="[object Proxy]";function hi(r){if(!Ee(r))return!1;var t=hn(r);return t==ea||t==na||t==ta||t==ra}var _s=te["__core-js_shared__"],Ii=(function(){var r=/[^.]+$/.exec(_s&&_s.keys&&_s.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function sa(r){return!!Ii&&Ii in r}var ia=Function.prototype,la=ia.toString;function Re(r){if(r!=null){try{return la.call(r)}catch{}try{return r+""}catch{}}return""}var oa=/[\\^$.*+?()[\]{}|]/g,aa=/^\[object .+?Constructor\]$/,ca=Function.prototype,ua=Object.prototype,ha=ca.toString,fa=ua.hasOwnProperty,da=RegExp("^"+ha.call(fa).replace(oa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ga(r){if(!Ee(r)||sa(r))return!1;var t=hi(r)?da:aa;return t.test(Re(r))}function pa(r,t){return r==null?void 0:r[t]}function ke(r,t){var e=pa(r,t);return ga(e)?e:void 0}var Fs=ke(te,"WeakMap"),Ri=Object.create,ma=(function(){function r(){}return function(t){if(!Ee(t))return{};if(Ri)return Ri(t);r.prototype=t;var e=new r;return r.prototype=void 0,e}})();function ba(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2])}return r.apply(t,e)}function ya(r,t){var e=-1,n=r.length;for(t||(t=Array(n));++e<n;)t[e]=r[e];return t}var va=800,Ea=16,Aa=Date.now;function Na(r){var t=0,e=0;return function(){var n=Aa(),s=Ea-(n-e);if(e=n,s>0){if(++t>=va)return arguments[0]}else t=0;return r.apply(void 0,arguments)}}function wa(r){return function(){return r}}var Sr=(function(){try{var r=ke(Object,"defineProperty");return r({},"",{}),r}catch{}})(),Ta=Sr?function(r,t){return Sr(r,"toString",{configurable:!0,enumerable:!1,value:wa(t),writable:!0})}:jl,xa=Na(Ta);function La(r,t){for(var e=-1,n=r==null?0:r.length;++e<n&&t(r[e],e,r)!==!1;);return r}var Sa=9007199254740991,_a=/^(?:0|[1-9]\d*)$/;function $l(r,t){var e=typeof r;return t=t??Sa,!!t&&(e=="number"||e!="symbol"&&_a.test(r))&&r>-1&&r%1==0&&r<t}function fi(r,t,e){t=="__proto__"&&Sr?Sr(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e}function zn(r,t){return r===t||r!==r&&t!==t}var Oa=Object.prototype,qa=Oa.hasOwnProperty;function Pl(r,t,e){var n=r[t];(!(qa.call(r,t)&&zn(n,e))||e===void 0&&!(t in r))&&fi(r,t,e)}function Ca(r,t,e,n){var s=!e;e||(e={});for(var i=-1,o=t.length;++i<o;){var a=t[i],u=void 0;u===void 0&&(u=r[a]),s?fi(e,a,u):Pl(e,a,u)}return e}var ki=Math.max;function Ia(r,t,e){return t=ki(t===void 0?r.length-1:t,0),function(){for(var n=arguments,s=-1,i=ki(n.length-t,0),o=Array(i);++s<i;)o[s]=n[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=n[s];return a[t]=e(o),ba(r,this,a)}}function Ra(r,t){return xa(Ia(r,t,jl),r+"")}var ka=9007199254740991;function Ul(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=ka}function Cr(r){return r!=null&&Ul(r.length)&&!hi(r)}function Ba(r,t,e){if(!Ee(e))return!1;var n=typeof t;return(n=="number"?Cr(e)&&$l(t,e.length):n=="string"&&t in e)?zn(e[t],r):!1}function Ma(r){return Ra(function(t,e){var n=-1,s=e.length,i=s>1?e[s-1]:void 0,o=s>2?e[2]:void 0;for(i=r.length>3&&typeof i=="function"?(s--,i):void 0,o&&Ba(e[0],e[1],o)&&(i=s<3?void 0:i,s=1),t=Object(t);++n<s;){var a=e[n];a&&r(t,a,n,i)}return t})}var Da=Object.prototype;function di(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||Da;return r===e}function ja(r,t){for(var e=-1,n=Array(r);++e<r;)n[e]=t(e);return n}var $a="[object Arguments]";function Bi(r){return le(r)&&hn(r)==$a}var Fl=Object.prototype,Pa=Fl.hasOwnProperty,Ua=Fl.propertyIsEnumerable,Hs=Bi((function(){return arguments})())?Bi:function(r){return le(r)&&Pa.call(r,"callee")&&!Ua.call(r,"callee")};function Fa(){return!1}var Hl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mi=Hl&&typeof module=="object"&&module&&!module.nodeType&&module,Ha=Mi&&Mi.exports===Hl,Di=Ha?te.Buffer:void 0,za=Di?Di.isBuffer:void 0,Dn=za||Fa,Ka="[object Arguments]",Ga="[object Array]",Va="[object Boolean]",Wa="[object Date]",Za="[object Error]",Xa="[object Function]",Ya="[object Map]",Qa="[object Number]",Ja="[object Object]",tc="[object RegExp]",ec="[object Set]",nc="[object String]",rc="[object WeakMap]",sc="[object ArrayBuffer]",ic="[object DataView]",lc="[object Float32Array]",oc="[object Float64Array]",ac="[object Int8Array]",cc="[object Int16Array]",uc="[object Int32Array]",hc="[object Uint8Array]",fc="[object Uint8ClampedArray]",dc="[object Uint16Array]",gc="[object Uint32Array]",lt={};lt[lc]=lt[oc]=lt[ac]=lt[cc]=lt[uc]=lt[hc]=lt[fc]=lt[dc]=lt[gc]=!0;lt[Ka]=lt[Ga]=lt[sc]=lt[Va]=lt[ic]=lt[Wa]=lt[Za]=lt[Xa]=lt[Ya]=lt[Qa]=lt[Ja]=lt[tc]=lt[ec]=lt[nc]=lt[rc]=!1;function pc(r){return le(r)&&Ul(r.length)&&!!lt[hn(r)]}function gi(r){return function(t){return r(t)}}var zl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Rn=zl&&typeof module=="object"&&module&&!module.nodeType&&module,mc=Rn&&Rn.exports===zl,Os=mc&&Ml.process,ln=(function(){try{var r=Rn&&Rn.require&&Rn.require("util").types;return r||Os&&Os.binding&&Os.binding("util")}catch{}})(),ji=ln&&ln.isTypedArray,pi=ji?gi(ji):pc,bc=Object.prototype,yc=bc.hasOwnProperty;function Kl(r,t){var e=qe(r),n=!e&&Hs(r),s=!e&&!n&&Dn(r),i=!e&&!n&&!s&&pi(r),o=e||n||s||i,a=o?ja(r.length,String):[],u=a.length;for(var h in r)(t||yc.call(r,h))&&!(o&&(h=="length"||s&&(h=="offset"||h=="parent")||i&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||$l(h,u)))&&a.push(h);return a}function Gl(r,t){return function(e){return r(t(e))}}var vc=Gl(Object.keys,Object),Ec=Object.prototype,Ac=Ec.hasOwnProperty;function Nc(r){if(!di(r))return vc(r);var t=[];for(var e in Object(r))Ac.call(r,e)&&e!="constructor"&&t.push(e);return t}function wc(r){return Cr(r)?Kl(r):Nc(r)}function Tc(r){var t=[];if(r!=null)for(var e in Object(r))t.push(e);return t}var xc=Object.prototype,Lc=xc.hasOwnProperty;function Sc(r){if(!Ee(r))return Tc(r);var t=di(r),e=[];for(var n in r)n=="constructor"&&(t||!Lc.call(r,n))||e.push(n);return e}function Vl(r){return Cr(r)?Kl(r,!0):Sc(r)}var jn=ke(Object,"create");function _c(){this.__data__=jn?jn(null):{},this.size=0}function Oc(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}var qc="__lodash_hash_undefined__",Cc=Object.prototype,Ic=Cc.hasOwnProperty;function Rc(r){var t=this.__data__;if(jn){var e=t[r];return e===qc?void 0:e}return Ic.call(t,r)?t[r]:void 0}var kc=Object.prototype,Bc=kc.hasOwnProperty;function Mc(r){var t=this.__data__;return jn?t[r]!==void 0:Bc.call(t,r)}var Dc="__lodash_hash_undefined__";function jc(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=jn&&t===void 0?Dc:t,this}function Ce(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}Ce.prototype.clear=_c;Ce.prototype.delete=Oc;Ce.prototype.get=Rc;Ce.prototype.has=Mc;Ce.prototype.set=jc;function $c(){this.__data__=[],this.size=0}function Ir(r,t){for(var e=r.length;e--;)if(zn(r[e][0],t))return e;return-1}var Pc=Array.prototype,Uc=Pc.splice;function Fc(r){var t=this.__data__,e=Ir(t,r);if(e<0)return!1;var n=t.length-1;return e==n?t.pop():Uc.call(t,e,1),--this.size,!0}function Hc(r){var t=this.__data__,e=Ir(t,r);return e<0?void 0:t[e][1]}function zc(r){return Ir(this.__data__,r)>-1}function Kc(r,t){var e=this.__data__,n=Ir(e,r);return n<0?(++this.size,e.push([r,t])):e[n][1]=t,this}function ce(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}ce.prototype.clear=$c;ce.prototype.delete=Fc;ce.prototype.get=Hc;ce.prototype.has=zc;ce.prototype.set=Kc;var $n=ke(te,"Map");function Gc(){this.size=0,this.__data__={hash:new Ce,map:new($n||ce),string:new Ce}}function Vc(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}function Rr(r,t){var e=r.__data__;return Vc(t)?e[typeof t=="string"?"string":"hash"]:e.map}function Wc(r){var t=Rr(this,r).delete(r);return this.size-=t?1:0,t}function Zc(r){return Rr(this,r).get(r)}function Xc(r){return Rr(this,r).has(r)}function Yc(r,t){var e=Rr(this,r),n=e.size;return e.set(r,t),this.size+=e.size==n?0:1,this}function Be(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}Be.prototype.clear=Gc;Be.prototype.delete=Wc;Be.prototype.get=Zc;Be.prototype.has=Xc;Be.prototype.set=Yc;function Qc(r,t){for(var e=-1,n=t.length,s=r.length;++e<n;)r[s+e]=t[e];return r}var Wl=Gl(Object.getPrototypeOf,Object),Jc="[object Object]",tu=Function.prototype,eu=Object.prototype,Zl=tu.toString,nu=eu.hasOwnProperty,ru=Zl.call(Object);function su(r){if(!le(r)||hn(r)!=Jc)return!1;var t=Wl(r);if(t===null)return!0;var e=nu.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&Zl.call(e)==ru}function iu(){this.__data__=new ce,this.size=0}function lu(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e}function ou(r){return this.__data__.get(r)}function au(r){return this.__data__.has(r)}var cu=200;function uu(r,t){var e=this.__data__;if(e instanceof ce){var n=e.__data__;if(!$n||n.length<cu-1)return n.push([r,t]),this.size=++e.size,this;e=this.__data__=new Be(n)}return e.set(r,t),this.size=e.size,this}function Xt(r){var t=this.__data__=new ce(r);this.size=t.size}Xt.prototype.clear=iu;Xt.prototype.delete=lu;Xt.prototype.get=ou;Xt.prototype.has=au;Xt.prototype.set=uu;var Xl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$i=Xl&&typeof module=="object"&&module&&!module.nodeType&&module,hu=$i&&$i.exports===Xl,Pi=hu?te.Buffer:void 0,Ui=Pi?Pi.allocUnsafe:void 0;function Yl(r,t){if(t)return r.slice();var e=r.length,n=Ui?Ui(e):new r.constructor(e);return r.copy(n),n}function fu(r,t){for(var e=-1,n=r==null?0:r.length,s=0,i=[];++e<n;){var o=r[e];t(o,e,r)&&(i[s++]=o)}return i}function du(){return[]}var gu=Object.prototype,pu=gu.propertyIsEnumerable,Fi=Object.getOwnPropertySymbols,mu=Fi?function(r){return r==null?[]:(r=Object(r),fu(Fi(r),function(t){return pu.call(r,t)}))}:du;function bu(r,t,e){var n=t(r);return qe(r)?n:Qc(n,e(r))}function zs(r){return bu(r,wc,mu)}var Ks=ke(te,"DataView"),Gs=ke(te,"Promise"),Vs=ke(te,"Set"),Hi="[object Map]",yu="[object Object]",zi="[object Promise]",Ki="[object Set]",Gi="[object WeakMap]",Vi="[object DataView]",vu=Re(Ks),Eu=Re($n),Au=Re(Gs),Nu=Re(Vs),wu=Re(Fs),jt=hn;(Ks&&jt(new Ks(new ArrayBuffer(1)))!=Vi||$n&&jt(new $n)!=Hi||Gs&&jt(Gs.resolve())!=zi||Vs&&jt(new Vs)!=Ki||Fs&&jt(new Fs)!=Gi)&&(jt=function(r){var t=hn(r),e=t==yu?r.constructor:void 0,n=e?Re(e):"";if(n)switch(n){case vu:return Vi;case Eu:return Hi;case Au:return zi;case Nu:return Ki;case wu:return Gi}return t});var Tu=Object.prototype,xu=Tu.hasOwnProperty;function Lu(r){var t=r.length,e=new r.constructor(t);return t&&typeof r[0]=="string"&&xu.call(r,"index")&&(e.index=r.index,e.input=r.input),e}var _r=te.Uint8Array;function mi(r){var t=new r.constructor(r.byteLength);return new _r(t).set(new _r(r)),t}function Su(r,t){var e=mi(r.buffer);return new r.constructor(e,r.byteOffset,r.byteLength)}var _u=/\w*$/;function Ou(r){var t=new r.constructor(r.source,_u.exec(r));return t.lastIndex=r.lastIndex,t}var Wi=ve?ve.prototype:void 0,Zi=Wi?Wi.valueOf:void 0;function qu(r){return Zi?Object(Zi.call(r)):{}}function Ql(r,t){var e=t?mi(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length)}var Cu="[object Boolean]",Iu="[object Date]",Ru="[object Map]",ku="[object Number]",Bu="[object RegExp]",Mu="[object Set]",Du="[object String]",ju="[object Symbol]",$u="[object ArrayBuffer]",Pu="[object DataView]",Uu="[object Float32Array]",Fu="[object Float64Array]",Hu="[object Int8Array]",zu="[object Int16Array]",Ku="[object Int32Array]",Gu="[object Uint8Array]",Vu="[object Uint8ClampedArray]",Wu="[object Uint16Array]",Zu="[object Uint32Array]";function Xu(r,t,e){var n=r.constructor;switch(t){case $u:return mi(r);case Cu:case Iu:return new n(+r);case Pu:return Su(r);case Uu:case Fu:case Hu:case zu:case Ku:case Gu:case Vu:case Wu:case Zu:return Ql(r,e);case Ru:return new n;case ku:case Du:return new n(r);case Bu:return Ou(r);case Mu:return new n;case ju:return qu(r)}}function Jl(r){return typeof r.constructor=="function"&&!di(r)?ma(Wl(r)):{}}var Yu="[object Map]";function Qu(r){return le(r)&&jt(r)==Yu}var Xi=ln&&ln.isMap,Ju=Xi?gi(Xi):Qu,th="[object Set]";function eh(r){return le(r)&&jt(r)==th}var Yi=ln&&ln.isSet,nh=Yi?gi(Yi):eh,rh=1,to="[object Arguments]",sh="[object Array]",ih="[object Boolean]",lh="[object Date]",oh="[object Error]",eo="[object Function]",ah="[object GeneratorFunction]",ch="[object Map]",uh="[object Number]",no="[object Object]",hh="[object RegExp]",fh="[object Set]",dh="[object String]",gh="[object Symbol]",ph="[object WeakMap]",mh="[object ArrayBuffer]",bh="[object DataView]",yh="[object Float32Array]",vh="[object Float64Array]",Eh="[object Int8Array]",Ah="[object Int16Array]",Nh="[object Int32Array]",wh="[object Uint8Array]",Th="[object Uint8ClampedArray]",xh="[object Uint16Array]",Lh="[object Uint32Array]",st={};st[to]=st[sh]=st[mh]=st[bh]=st[ih]=st[lh]=st[yh]=st[vh]=st[Eh]=st[Ah]=st[Nh]=st[ch]=st[uh]=st[no]=st[hh]=st[fh]=st[dh]=st[gh]=st[wh]=st[Th]=st[xh]=st[Lh]=!0;st[oh]=st[eo]=st[ph]=!1;function Tr(r,t,e,n,s,i){var o,a=t&rh;if(o!==void 0)return o;if(!Ee(r))return r;var u=qe(r);if(u)o=Lu(r);else{var h=jt(r),p=h==eo||h==ah;if(Dn(r))return Yl(r,a);if(h==no||h==to||p&&!s)o=p?{}:Jl(r);else{if(!st[h])return s?r:{};o=Xu(r,h,a)}}i||(i=new Xt);var v=i.get(r);if(v)return v;i.set(r,o),nh(r)?r.forEach(function(y){o.add(Tr(y,t,e,y,r,i))}):Ju(r)&&r.forEach(function(y,A){o.set(A,Tr(y,t,e,A,r,i))});var f=zs,m=u?void 0:f(r);return La(m||r,function(y,A){m&&(A=y,y=r[A]),Pl(o,A,Tr(y,t,e,A,r,i))}),o}var Sh=1,_h=4;function nn(r){return Tr(r,Sh|_h)}var Oh="__lodash_hash_undefined__";function qh(r){return this.__data__.set(r,Oh),this}function Ch(r){return this.__data__.has(r)}function Or(r){var t=-1,e=r==null?0:r.length;for(this.__data__=new Be;++t<e;)this.add(r[t])}Or.prototype.add=Or.prototype.push=qh;Or.prototype.has=Ch;function Ih(r,t){for(var e=-1,n=r==null?0:r.length;++e<n;)if(t(r[e],e,r))return!0;return!1}function Rh(r,t){return r.has(t)}var kh=1,Bh=2;function ro(r,t,e,n,s,i){var o=e&kh,a=r.length,u=t.length;if(a!=u&&!(o&&u>a))return!1;var h=i.get(r),p=i.get(t);if(h&&p)return h==t&&p==r;var v=-1,f=!0,m=e&Bh?new Or:void 0;for(i.set(r,t),i.set(t,r);++v<a;){var y=r[v],A=t[v];if(n)var w=o?n(A,y,v,t,r,i):n(y,A,v,r,t,i);if(w!==void 0){if(w)continue;f=!1;break}if(m){if(!Ih(t,function(x,C){if(!Rh(m,C)&&(y===x||s(y,x,e,n,i)))return m.push(C)})){f=!1;break}}else if(!(y===A||s(y,A,e,n,i))){f=!1;break}}return i.delete(r),i.delete(t),f}function Mh(r){var t=-1,e=Array(r.size);return r.forEach(function(n,s){e[++t]=[s,n]}),e}function Dh(r){var t=-1,e=Array(r.size);return r.forEach(function(n){e[++t]=n}),e}var jh=1,$h=2,Ph="[object Boolean]",Uh="[object Date]",Fh="[object Error]",Hh="[object Map]",zh="[object Number]",Kh="[object RegExp]",Gh="[object Set]",Vh="[object String]",Wh="[object Symbol]",Zh="[object ArrayBuffer]",Xh="[object DataView]",Qi=ve?ve.prototype:void 0,qs=Qi?Qi.valueOf:void 0;function Yh(r,t,e,n,s,i,o){switch(e){case Xh:if(r.byteLength!=t.byteLength||r.byteOffset!=t.byteOffset)return!1;r=r.buffer,t=t.buffer;case Zh:return!(r.byteLength!=t.byteLength||!i(new _r(r),new _r(t)));case Ph:case Uh:case zh:return zn(+r,+t);case Fh:return r.name==t.name&&r.message==t.message;case Kh:case Vh:return r==t+"";case Hh:var a=Mh;case Gh:var u=n&jh;if(a||(a=Dh),r.size!=t.size&&!u)return!1;var h=o.get(r);if(h)return h==t;n|=$h,o.set(r,t);var p=ro(a(r),a(t),n,s,i,o);return o.delete(r),p;case Wh:if(qs)return qs.call(r)==qs.call(t)}return!1}var Qh=1,Jh=Object.prototype,tf=Jh.hasOwnProperty;function ef(r,t,e,n,s,i){var o=e&Qh,a=zs(r),u=a.length,h=zs(t),p=h.length;if(u!=p&&!o)return!1;for(var v=u;v--;){var f=a[v];if(!(o?f in t:tf.call(t,f)))return!1}var m=i.get(r),y=i.get(t);if(m&&y)return m==t&&y==r;var A=!0;i.set(r,t),i.set(t,r);for(var w=o;++v<u;){f=a[v];var x=r[f],C=t[f];if(n)var M=o?n(C,x,f,t,r,i):n(x,C,f,r,t,i);if(!(M===void 0?x===C||s(x,C,e,n,i):M)){A=!1;break}w||(w=f=="constructor")}if(A&&!w){var z=r.constructor,U=t.constructor;z!=U&&"constructor"in r&&"constructor"in t&&!(typeof z=="function"&&z instanceof z&&typeof U=="function"&&U instanceof U)&&(A=!1)}return i.delete(r),i.delete(t),A}var nf=1,Ji="[object Arguments]",tl="[object Array]",gr="[object Object]",rf=Object.prototype,el=rf.hasOwnProperty;function sf(r,t,e,n,s,i){var o=qe(r),a=qe(t),u=o?tl:jt(r),h=a?tl:jt(t);u=u==Ji?gr:u,h=h==Ji?gr:h;var p=u==gr,v=h==gr,f=u==h;if(f&&Dn(r)){if(!Dn(t))return!1;o=!0,p=!1}if(f&&!p)return i||(i=new Xt),o||pi(r)?ro(r,t,e,n,s,i):Yh(r,t,u,e,n,s,i);if(!(e&nf)){var m=p&&el.call(r,"__wrapped__"),y=v&&el.call(t,"__wrapped__");if(m||y){var A=m?r.value():r,w=y?t.value():t;return i||(i=new Xt),s(A,w,e,n,i)}}return f?(i||(i=new Xt),ef(r,t,e,n,s,i)):!1}function so(r,t,e,n,s){return r===t?!0:r==null||t==null||!le(r)&&!le(t)?r!==r&&t!==t:sf(r,t,e,n,so,s)}function lf(r){return function(t,e,n){for(var s=-1,i=Object(t),o=n(t),a=o.length;a--;){var u=o[++s];if(e(i[u],u,i)===!1)break}return t}}var of=lf();function Ws(r,t,e){(e!==void 0&&!zn(r[t],e)||e===void 0&&!(t in r))&&fi(r,t,e)}function af(r){return le(r)&&Cr(r)}function Zs(r,t){if(!(t==="constructor"&&typeof r[t]=="function")&&t!="__proto__")return r[t]}function cf(r){return Ca(r,Vl(r))}function uf(r,t,e,n,s,i,o){var a=Zs(r,e),u=Zs(t,e),h=o.get(u);if(h){Ws(r,e,h);return}var p=i?i(a,u,e+"",r,t,o):void 0,v=p===void 0;if(v){var f=qe(u),m=!f&&Dn(u),y=!f&&!m&&pi(u);p=u,f||m||y?qe(a)?p=a:af(a)?p=ya(a):m?(v=!1,p=Yl(u,!0)):y?(v=!1,p=Ql(u,!0)):p=[]:su(u)||Hs(u)?(p=a,Hs(a)?p=cf(a):(!Ee(a)||hi(a))&&(p=Jl(u))):v=!1}v&&(o.set(u,p),s(p,u,n,i,o),o.delete(u)),Ws(r,e,p)}function io(r,t,e,n,s){r!==t&&of(t,function(i,o){if(s||(s=new Xt),Ee(i))uf(r,t,o,e,io,n,s);else{var a=n?n(Zs(r,o),i,o+"",r,t,s):void 0;a===void 0&&(a=i),Ws(r,o,a)}},Vl)}function ge(r,t){return so(r,t)}var ye=Ma(function(r,t,e){io(r,t,e)}),D=(r=>(r[r.TYPE=3]="TYPE",r[r.LEVEL=12]="LEVEL",r[r.ATTRIBUTE=13]="ATTRIBUTE",r[r.BLOT=14]="BLOT",r[r.INLINE=7]="INLINE",r[r.BLOCK=11]="BLOCK",r[r.BLOCK_BLOT=10]="BLOCK_BLOT",r[r.INLINE_BLOT=6]="INLINE_BLOT",r[r.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",r[r.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",r[r.ANY=15]="ANY",r))(D||{});class Qt{constructor(t,e,n={}){this.attrName=t,this.keyName=e;const s=D.TYPE&D.ATTRIBUTE;this.scope=n.scope!=null?n.scope&D.LEVEL|s:D.ATTRIBUTE,n.whitelist!=null&&(this.whitelist=n.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 rn extends Error{constructor(t){t="[Parchment] "+t,super(t),this.message=t,this.name=this.constructor.name}}const lo=class Xs{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 n=null;try{n=t.parentNode}catch{return null}return this.find(n,e)}return null}create(t,e,n){const s=this.query(e);if(s==null)throw new rn(`Unable to create ${e} blot`);const i=s,o=e instanceof Node||e.nodeType===Node.TEXT_NODE?e:i.create(n),a=new i(t,o,n);return Xs.blots.set(a.domNode,a),a}find(t,e=!1){return Xs.find(t,e)}query(t,e=D.ANY){let n;return typeof t=="string"?n=this.types[t]||this.attributes[t]:t instanceof Text||t.nodeType===Node.TEXT_NODE?n=this.types.text:typeof t=="number"?t&D.LEVEL&D.BLOCK?n=this.types.block:t&D.LEVEL&D.INLINE&&(n=this.types.inline):t instanceof Element&&((t.getAttribute("class")||"").split(/\s+/).some(s=>(n=this.classes[s],!!n)),n=n||this.tags[t.tagName]),n==null?null:"scope"in n&&e&D.LEVEL&n.scope&&e&D.TYPE&n.scope?n:null}register(...t){return t.map(e=>{const n="blotName"in e,s="attrName"in e;if(!n&&!s)throw new rn("Invalid definition");if(n&&e.blotName==="abstract")throw new rn("Cannot register abstract class");const i=n?e.blotName:s?e.attrName:void 0;return this.types[i]=e,s?typeof e.keyName=="string"&&(this.attributes[e.keyName]=e):n&&(e.className&&(this.classes[e.className]=e),e.tagName&&(Array.isArray(e.tagName)?e.tagName=e.tagName.map(o=>o.toUpperCase()):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach(o=>{(this.tags[o]==null||e.className==null)&&(this.tags[o]=e)}))),e})}};lo.blots=new WeakMap;let on=lo;function nl(r,t){return(r.getAttribute("class")||"").split(/\s+/).filter(e=>e.indexOf(`${t}-`)===0)}class hf extends Qt{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){nl(t,this.keyName).forEach(e=>{t.classList.remove(e)}),t.classList.length===0&&t.removeAttribute("class")}value(t){const e=(nl(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""}}const Ft=hf;function Cs(r){const t=r.split("-"),e=t.slice(1).map(n=>n[0].toUpperCase()+n.slice(1)).join("");return t[0]+e}class ff extends Qt{static keys(t){return(t.getAttribute("style")||"").split(";").map(e=>e.split(":")[0].trim())}add(t,e){return this.canAdd(t,e)?(t.style[Cs(this.keyName)]=e,!0):!1}remove(t){t.style[Cs(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const e=t.style[Cs(this.keyName)];return this.canAdd(t,e)?e:""}}const Ae=ff;class df{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=on.find(this.domNode);if(t==null)return;const e=Qt.keys(this.domNode),n=Ft.keys(this.domNode),s=Ae.keys(this.domNode);e.concat(n).concat(s).forEach(i=>{const o=t.scroll.query(i,D.ATTRIBUTE);o instanceof Qt&&(this.attributes[o.attrName]=o)})}copy(t){Object.keys(this.attributes).forEach(e=>{const n=this.attributes[e].value(this.domNode);t.format(e,n)})}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 kr=df,oo=class{constructor(t,e){this.scroll=t,this.domNode=e,on.blots.set(e,this),this.prev=null,this.next=null}static create(t){if(this.tagName==null)throw new rn("Blot definition missing tagName");let e,n;return Array.isArray(this.tagName)?(typeof t=="string"?(n=t.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):typeof t=="number"&&(n=t),typeof n=="number"?e=document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?e=document.createElement(n):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),on.blots.delete(this.domNode)}deleteAt(t,e){this.isolate(t,e).remove()}formatAt(t,e,n,s){const i=this.isolate(t,e);if(this.scroll.query(n,D.BLOT)!=null&&s)i.wrap(n,s);else if(this.scroll.query(n,D.ATTRIBUTE)!=null){const o=this.scroll.create(this.statics.scope);i.wrap(o),o.format(n,s)}}insertAt(t,e,n){const s=n==null?this.scroll.create("text",e):this.scroll.create(e,n),i=this.split(t);this.parent.insertBefore(s,i||void 0)}isolate(t,e){const n=this.split(t);if(n==null)throw new Error("Attempt to isolate at end");return n.split(e),n}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 n=typeof t=="string"?this.scroll.create(t,e):t;return this.parent!=null&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(t,e){return t===0?this:this.next}update(t,e){}wrap(t,e){const n=typeof t=="string"?this.scroll.create(t,e):t;if(this.parent!=null&&this.parent.insertBefore(n,this.next||void 0),typeof n.appendChild!="function")throw new rn(`Cannot wrap ${t}`);return n.appendChild(this),n}};oo.blotName="abstract";let ao=oo;const co=class extends ao{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 n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return t>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};co.scope=D.INLINE_BLOT;let gf=co;const Et=gf;class pf{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 n=e();for(;n&&t>0;)t-=1,n=e();return n}contains(t){const e=this.iterator();let n=e();for(;n;){if(n===t)return!0;n=e()}return!1}indexOf(t){const e=this.iterator();let n=e(),s=0;for(;n;){if(n===t)return s;s+=1,n=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,n=this.head;for(;n!=null;){if(n===t)return e;e+=n.length(),n=n.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 n=this.iterator();let s=n();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=n()}return[null,0]}forEach(t){const e=this.iterator();let n=e();for(;n;)t(n),n=e()}forEachAt(t,e,n){if(e<=0)return;const[s,i]=this.find(t);let o=t-i;const a=this.iterator(s);let u=a();for(;u&&o<t+e;){const h=u.length();t>o?n(u,t-o,Math.min(e,o+h-t)):n(u,0,Math.min(h,t+e-o)),o+=h,u=a()}}map(t){return this.reduce((e,n)=>(e.push(t(n)),e),[])}reduce(t,e){const n=this.iterator();let s=n();for(;s;)e=t(e,s),s=n();return e}}function rl(r,t){const e=t.find(r);if(e)return e;try{return t.create(r)}catch{const n=t.create(D.INLINE);return Array.from(r.childNodes).forEach(s=>{n.domNode.appendChild(s)}),r.parentNode&&r.parentNode.replaceChild(n.domNode,r),n.attach(),n}}const uo=class de extends ao{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,de.uiClass&&this.uiNode.classList.add(de.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new pf,Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode).reverse().forEach(t=>{try{const e=rl(t,this.scroll);this.insertBefore(e,this.children.head||void 0)}catch(e){if(e instanceof rn)return;throw e}})}deleteAt(t,e){if(t===0&&e===this.length())return this.remove();this.children.forEachAt(t,e,(n,s,i)=>{n.deleteAt(s,i)})}descendant(t,e=0){const[n,s]=this.children.find(e);return t.blotName==null&&t(n)||t.blotName!=null&&n instanceof t?[n,s]:n instanceof de?n.descendant(t,s):[null,-1]}descendants(t,e=0,n=Number.MAX_VALUE){let s=[],i=n;return this.children.forEachAt(e,n,(o,a,u)=>{(t.blotName==null&&t(o)||t.blotName!=null&&o instanceof t)&&s.push(o),o instanceof de&&(s=s.concat(o.descendants(t,a,i))),i-=u}),s}detach(){this.children.forEach(t=>{t.detach()}),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach(e=>{t||this.statics.allowedChildren.some(n=>e instanceof n)||(e.statics.scope===D.BLOCK_BLOT?(e.next!=null&&this.splitAfter(e),e.prev!=null&&this.splitAfter(e.prev),e.parent.unwrap(),t=!0):e instanceof de?e.unwrap():e.remove())})}formatAt(t,e,n,s){this.children.forEachAt(t,e,(i,o,a)=>{i.formatAt(o,a,n,s)})}insertAt(t,e,n){const[s,i]=this.children.find(t);if(s)s.insertAt(i,e,n);else{const o=n==null?this.scroll.create("text",e):this.scroll.create(e,n);this.appendChild(o)}}insertBefore(t,e){t.parent!=null&&t.parent.children.remove(t);let n=null;this.children.insertBefore(t,e||null),t.parent=this,e!=null&&(n=e.domNode),(this.domNode.parentNode!==t.domNode||this.domNode.nextSibling!==n)&&this.domNode.insertBefore(t.domNode,n),t.attach()}length(){return this.children.reduce((t,e)=>t+e.length(),0)}moveChildren(t,e){this.children.forEach(n=>{t.insertBefore(n,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[n,s]=this.children.find(t,e),i=[[this,t]];return n instanceof de?i.concat(n.path(s,e)):(n!=null&&i.push([n,s]),i)}removeChild(t){this.children.remove(t)}replaceWith(t,e){const n=typeof t=="string"?this.scroll.create(t,e):t;return n instanceof de&&this.moveChildren(n),super.replaceWith(n)}split(t,e=!1){if(!e){if(t===0)return this;if(t===this.length())return this.next}const n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(t,this.length(),(s,i,o)=>{const a=s.split(i,e);a!=null&&n.appendChild(a)}),n}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 n=[],s=[];t.forEach(i=>{i.target===this.domNode&&i.type==="childList"&&(n.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 o=this.scroll.find(i);o!=null&&(o.domNode.parentNode==null||o.domNode.parentNode===this.domNode)&&o.detach()}),n.filter(i=>i.parentNode===this.domNode&&i!==this.uiNode).sort((i,o)=>i===o?0:i.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(i=>{let o=null;i.nextSibling!=null&&(o=this.scroll.find(i.nextSibling));const a=rl(i,this.scroll);(a.next!==o||a.next==null)&&(a.parent!=null&&a.parent.removeChild(this),this.insertBefore(a,o||void 0))}),this.enforceAllowedChildren()}};uo.uiClass="";let mf=uo;const Pt=mf;function bf(r,t){if(Object.keys(r).length!==Object.keys(t).length)return!1;for(const e in r)if(r[e]!==t[e])return!1;return!0}const Xe=class Ye extends Pt{static create(t){return super.create(t)}static formats(t,e){const n=e.query(Ye.blotName);if(!(n!=null&&t.tagName===n.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 kr(this.domNode)}format(t,e){if(t===this.statics.blotName&&!e)this.children.forEach(n=>{n instanceof Ye||(n=n.wrap(Ye.blotName,!0)),this.attributes.copy(n)}),this.unwrap();else{const n=this.scroll.query(t,D.INLINE);if(n==null)return;n instanceof Qt?this.attributes.attribute(n,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,n,s){this.formats()[n]!=null||this.scroll.query(n,D.ATTRIBUTE)?this.isolate(t,e).format(n,s):super.formatAt(t,e,n,s)}optimize(t){super.optimize(t);const e=this.formats();if(Object.keys(e).length===0)return this.unwrap();const n=this.next;n instanceof Ye&&n.prev===this&&bf(e,n.formats())&&(n.moveChildren(this),n.remove())}replaceWith(t,e){const n=super.replaceWith(t,e);return this.attributes.copy(n),n}update(t,e){super.update(t,e),t.some(n=>n.target===this.domNode&&n.type==="attributes")&&this.attributes.build()}wrap(t,e){const n=super.wrap(t,e);return n instanceof Ye&&this.attributes.move(n),n}};Xe.allowedChildren=[Xe,Et],Xe.blotName="inline",Xe.scope=D.INLINE_BLOT,Xe.tagName="SPAN";let yf=Xe;const bi=yf,Qe=class Ys extends Pt{static create(t){return super.create(t)}static formats(t,e){const n=e.query(Ys.blotName);if(!(n!=null&&t.tagName===n.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 kr(this.domNode)}format(t,e){const n=this.scroll.query(t,D.BLOCK);n!=null&&(n instanceof Qt?this.attributes.attribute(n,e):t===this.statics.blotName&&!e?this.replaceWith(Ys.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,n,s){this.scroll.query(n,D.BLOCK)!=null?this.format(n,s):super.formatAt(t,e,n,s)}insertAt(t,e,n){if(n==null||this.scroll.query(e,D.INLINE)!=null)super.insertAt(t,e,n);else{const s=this.split(t);if(s!=null){const i=this.scroll.create(e,n);s.parent.insertBefore(i,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(t,e){const n=super.replaceWith(t,e);return this.attributes.copy(n),n}update(t,e){super.update(t,e),t.some(n=>n.target===this.domNode&&n.type==="attributes")&&this.attributes.build()}};Qe.blotName="block",Qe.scope=D.BLOCK_BLOT,Qe.tagName="P",Qe.allowedChildren=[bi,Qe,Et];let vf=Qe;const Pn=vf,Qs=class extends Pt{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(t,e){super.deleteAt(t,e),this.enforceAllowedChildren()}formatAt(t,e,n,s){super.formatAt(t,e,n,s),this.enforceAllowedChildren()}insertAt(t,e,n){super.insertAt(t,e,n),this.enforceAllowedChildren()}optimize(t){super.optimize(t),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Qs.blotName="container",Qs.scope=D.BLOCK_BLOT;let Ef=Qs;const Br=Ef;class Af extends Et{static formats(t,e){}format(t,e){super.formatAt(0,this.length(),t,e)}formatAt(t,e,n,s){t===0&&e===this.length()?this.format(n,s):super.formatAt(t,e,n,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Lt=Af,Nf={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},wf=100,Je=class extends Pt{constructor(t,e){super(null,e),this.registry=t,this.scroll=this,this.build(),this.observer=new MutationObserver(n=>{this.update(n)}),this.observer.observe(this.domNode,Nf),this.attach()}create(t,e){return this.registry.create(this,t,e)}find(t,e=!1){const n=this.registry.find(t,e);return n?n.scroll===this?n:e?this.find(n.scroll.domNode.parentNode,!0):null:null}query(t,e=D.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(n=>{n.remove()}):super.deleteAt(t,e)}formatAt(t,e,n,s){this.update(),super.formatAt(t,e,n,s)}insertAt(t,e,n){this.update(),super.insertAt(t,e,n)}optimize(t=[],e={}){super.optimize(e);const n=e.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)t.push(s.pop());const i=(u,h=!0)=>{u==null||u===this||u.domNode.parentNode!=null&&(n.has(u.domNode)||n.set(u.domNode,[]),h&&i(u.parent))},o=u=>{n.has(u.domNode)&&(u instanceof Pt&&u.children.forEach(o),n.delete(u.domNode),u.optimize(e))};let a=t;for(let u=0;a.length>0;u+=1){if(u>=wf)throw new Error("[Parchment] Maximum optimize iterations reached");for(a.forEach(h=>{const p=this.find(h.target,!0);p!=null&&(p.domNode===h.target&&(h.type==="childList"?(i(this.find(h.previousSibling,!1)),Array.from(h.addedNodes).forEach(v=>{const f=this.find(v,!1);i(f,!1),f instanceof Pt&&f.children.forEach(m=>{i(m,!1)})})):h.type==="attributes"&&i(p.prev)),i(p))}),this.children.forEach(o),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 n=new WeakMap;t.map(s=>{const i=this.find(s.target,!0);return i==null?null:n.has(i.domNode)?(n.get(i.domNode).push(s),null):(n.set(i.domNode,[s]),i)}).forEach(s=>{s!=null&&s!==this&&n.has(s.domNode)&&s.update(n.get(s.domNode)||[],e)}),e.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),e),this.optimize(t,e)}};Je.blotName="scroll",Je.defaultChild=Pn,Je.allowedChildren=[Pn,Br],Je.scope=D.BLOCK_BLOT,Je.tagName="DIV";let Tf=Je;const yi=Tf,Js=class ho extends Et{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,n){n==null?(this.text=this.text.slice(0,t)+e+this.text.slice(t),this.domNode.data=this.text):super.insertAt(t,e,n)}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 ho&&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 n=this.scroll.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next||void 0),this.text=this.statics.value(this.domNode),n}update(t,e){t.some(n=>n.type==="characterData"&&n.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Js.blotName="text",Js.scope=D.INLINE_BLOT;let xf=Js;const qr=xf,Lf=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Qt,AttributorStore:kr,BlockBlot:Pn,ClassAttributor:Ft,ContainerBlot:Br,EmbedBlot:Lt,InlineBlot:bi,LeafBlot:Et,ParentBlot:Pt,Registry:on,Scope:D,ScrollBlot:yi,StyleAttributor:Ae,TextBlot:qr},Symbol.toStringTag,{value:"Module"}));var pr={exports:{}},Is,sl;function Sf(){if(sl)return Is;sl=1;var r=-1,t=1,e=0;function n(g,L,b,O,S){if(g===L)return g?[[e,g]]:[];if(b!=null){var T=Rt(g,L,b);if(T)return T}var _=a(g,L),k=g.substring(0,_);g=g.substring(_),L=L.substring(_),_=h(g,L);var j=g.substring(g.length-_);g=g.substring(0,g.length-_),L=L.substring(0,L.length-_);var I=s(g,L);return k&&I.unshift([e,k]),j&&I.push([e,j]),C(I,S),O&&v(I),I}function s(g,L){var b;if(!g)return[[t,L]];if(!L)return[[r,g]];var O=g.length>L.length?g:L,S=g.length>L.length?L:g,T=O.indexOf(S);if(T!==-1)return b=[[t,O.substring(0,T)],[e,S],[t,O.substring(T+S.length)]],g.length>L.length&&(b[0][0]=b[2][0]=r),b;if(S.length===1)return[[r,g],[t,L]];var _=p(g,L);if(_){var k=_[0],j=_[1],I=_[2],K=_[3],F=_[4],V=n(k,I),W=n(j,K);return V.concat([[e,F]],W)}return i(g,L)}function i(g,L){for(var b=g.length,O=L.length,S=Math.ceil((b+O)/2),T=S,_=2*S,k=new Array(_),j=new Array(_),I=0;I<_;I++)k[I]=-1,j[I]=-1;k[T+1]=0,j[T+1]=0;for(var K=b-O,F=K%2!==0,V=0,W=0,P=0,it=0,ot=0;ot<S;ot++){for(var G=-ot+V;G<=ot-W;G+=2){var Q=T+G,Y;G===-ot||G!==ot&&k[Q-1]<k[Q+1]?Y=k[Q+1]:Y=k[Q-1]+1;for(var J=Y-G;Y<b&&J<O&&g.charAt(Y)===L.charAt(J);)Y++,J++;if(k[Q]=Y,Y>b)W+=2;else if(J>O)V+=2;else if(F){var et=T+K-G;if(et>=0&&et<_&&j[et]!==-1){var nt=b-j[et];if(Y>=nt)return o(g,L,Y,J)}}}for(var ct=-ot+P;ct<=ot-it;ct+=2){var et=T+ct,nt;ct===-ot||ct!==ot&&j[et-1]<j[et+1]?nt=j[et+1]:nt=j[et-1]+1;for(var mt=nt-ct;nt<b&&mt<O&&g.charAt(b-nt-1)===L.charAt(O-mt-1);)nt++,mt++;if(j[et]=nt,nt>b)it+=2;else if(mt>O)P+=2;else if(!F){var Q=T+K-ct;if(Q>=0&&Q<_&&k[Q]!==-1){var Y=k[Q],J=T+Y-Q;if(nt=b-nt,Y>=nt)return o(g,L,Y,J)}}}}return[[r,g],[t,L]]}function o(g,L,b,O){var S=g.substring(0,b),T=L.substring(0,O),_=g.substring(b),k=L.substring(O),j=n(S,T),I=n(_,k);return j.concat(I)}function a(g,L){if(!g||!L||g.charAt(0)!==L.charAt(0))return 0;for(var b=0,O=Math.min(g.length,L.length),S=O,T=0;b<S;)g.substring(T,S)==L.substring(T,S)?(b=S,T=b):O=S,S=Math.floor((O-b)/2+b);return M(g.charCodeAt(S-1))&&S--,S}function u(g,L){var b=g.length,O=L.length;if(b==0||O==0)return 0;b>O?g=g.substring(b-O):b<O&&(L=L.substring(0,b));var S=Math.min(b,O);if(g==L)return S;for(var T=0,_=1;;){var k=g.substring(S-_),j=L.indexOf(k);if(j==-1)return T;_+=j,(j==0||g.substring(S-_)==L.substring(0,_))&&(T=_,_++)}}function h(g,L){if(!g||!L||g.slice(-1)!==L.slice(-1))return 0;for(var b=0,O=Math.min(g.length,L.length),S=O,T=0;b<S;)g.substring(g.length-S,g.length-T)==L.substring(L.length-S,L.length-T)?(b=S,T=b):O=S,S=Math.floor((O-b)/2+b);return z(g.charCodeAt(g.length-S))&&S--,S}function p(g,L){var b=g.length>L.length?g:L,O=g.length>L.length?L:g;if(b.length<4||O.length*2<b.length)return null;function S(W,P,it){for(var ot=W.substring(it,it+Math.floor(W.length/4)),G=-1,Q="",Y,J,et,nt;(G=P.indexOf(ot,G+1))!==-1;){var ct=a(W.substring(it),P.substring(G)),mt=h(W.substring(0,it),P.substring(0,G));Q.length<mt+ct&&(Q=P.substring(G-mt,G)+P.substring(G,G+ct),Y=W.substring(0,it-mt),J=W.substring(it+ct),et=P.substring(0,G-mt),nt=P.substring(G+ct))}return Q.length*2>=W.length?[Y,J,et,nt,Q]:null}var T=S(b,O,Math.ceil(b.length/4)),_=S(b,O,Math.ceil(b.length/2)),k;if(!T&&!_)return null;_?T?k=T[4].length>_[4].length?T:_:k=_:k=T;var j,I,K,F;g.length>L.length?(j=k[0],I=k[1],K=k[2],F=k[3]):(K=k[0],F=k[1],j=k[2],I=k[3]);var V=k[4];return[j,I,K,F,V]}function v(g){for(var L=!1,b=[],O=0,S=null,T=0,_=0,k=0,j=0,I=0;T<g.length;)g[T][0]==e?(b[O++]=T,_=j,k=I,j=0,I=0,S=g[T][1]):(g[T][0]==t?j+=g[T][1].length:I+=g[T][1].length,S&&S.length<=Math.max(_,k)&&S.length<=Math.max(j,I)&&(g.splice(b[O-1],0,[r,S]),g[b[O-1]+1][0]=t,O--,O--,T=O>0?b[O-1]:-1,_=0,k=0,j=0,I=0,S=null,L=!0)),T++;for(L&&C(g),x(g),T=1;T<g.length;){if(g[T-1][0]==r&&g[T][0]==t){var K=g[T-1][1],F=g[T][1],V=u(K,F),W=u(F,K);V>=W?(V>=K.length/2||V>=F.length/2)&&(g.splice(T,0,[e,F.substring(0,V)]),g[T-1][1]=K.substring(0,K.length-V),g[T+1][1]=F.substring(V),T++):(W>=K.length/2||W>=F.length/2)&&(g.splice(T,0,[e,K.substring(0,W)]),g[T-1][0]=t,g[T-1][1]=F.substring(0,F.length-W),g[T+1][0]=r,g[T+1][1]=K.substring(W),T++),T++}T++}}var f=/[^a-zA-Z0-9]/,m=/\s/,y=/[\r\n]/,A=/\n\r?\n$/,w=/^\r?\n\r?\n/;function x(g){function L(W,P){if(!W||!P)return 6;var it=W.charAt(W.length-1),ot=P.charAt(0),G=it.match(f),Q=ot.match(f),Y=G&&it.match(m),J=Q&&ot.match(m),et=Y&&it.match(y),nt=J&&ot.match(y),ct=et&&W.match(A),mt=nt&&P.match(w);return ct||mt?5:et||nt?4:G&&!Y&&J?3:Y||J?2:G||Q?1:0}for(var b=1;b<g.length-1;){if(g[b-1][0]==e&&g[b+1][0]==e){var O=g[b-1][1],S=g[b][1],T=g[b+1][1],_=h(O,S);if(_){var k=S.substring(S.length-_);O=O.substring(0,O.length-_),S=k+S.substring(0,S.length-_),T=k+T}for(var j=O,I=S,K=T,F=L(O,S)+L(S,T);S.charAt(0)===T.charAt(0);){O+=S.charAt(0),S=S.substring(1)+T.charAt(0),T=T.substring(1);var V=L(O,S)+L(S,T);V>=F&&(F=V,j=O,I=S,K=T)}g[b-1][1]!=j&&(j?g[b-1][1]=j:(g.splice(b-1,1),b--),g[b][1]=I,K?g[b+1][1]=K:(g.splice(b+1,1),b--))}b++}}function C(g,L){g.push([e,""]);for(var b=0,O=0,S=0,T="",_="",k;b<g.length;){if(b<g.length-1&&!g[b][1]){g.splice(b,1);continue}switch(g[b][0]){case t:S++,_+=g[b][1],b++;break;case r:O++,T+=g[b][1],b++;break;case e:var j=b-S-O-1;if(L){if(j>=0&&rt(g[j][1])){var I=g[j][1].slice(-1);if(g[j][1]=g[j][1].slice(0,-1),T=I+T,_=I+_,!g[j][1]){g.splice(j,1),b--;var K=j-1;g[K]&&g[K][0]===t&&(S++,_=g[K][1]+_,K--),g[K]&&g[K][0]===r&&(O++,T=g[K][1]+T,K--),j=K}}if(U(g[b][1])){var I=g[b][1].charAt(0);g[b][1]=g[b][1].slice(1),T+=I,_+=I}}if(b<g.length-1&&!g[b][1]){g.splice(b,1);break}if(T.length>0||_.length>0){T.length>0&&_.length>0&&(k=a(_,T),k!==0&&(j>=0?g[j][1]+=_.substring(0,k):(g.splice(0,0,[e,_.substring(0,k)]),b++),_=_.substring(k),T=T.substring(k)),k=h(_,T),k!==0&&(g[b][1]=_.substring(_.length-k)+g[b][1],_=_.substring(0,_.length-k),T=T.substring(0,T.length-k)));var F=S+O;T.length===0&&_.length===0?(g.splice(b-F,F),b=b-F):T.length===0?(g.splice(b-F,F,[t,_]),b=b-F+1):_.length===0?(g.splice(b-F,F,[r,T]),b=b-F+1):(g.splice(b-F,F,[r,T],[t,_]),b=b-F+2)}b!==0&&g[b-1][0]===e?(g[b-1][1]+=g[b][1],g.splice(b,1)):b++,S=0,O=0,T="",_="";break}}g[g.length-1][1]===""&&g.pop();var V=!1;for(b=1;b<g.length-1;)g[b-1][0]===e&&g[b+1][0]===e&&(g[b][1].substring(g[b][1].length-g[b-1][1].length)===g[b-1][1]?(g[b][1]=g[b-1][1]+g[b][1].substring(0,g[b][1].length-g[b-1][1].length),g[b+1][1]=g[b-1][1]+g[b+1][1],g.splice(b-1,1),V=!0):g[b][1].substring(0,g[b+1][1].length)==g[b+1][1]&&(g[b-1][1]+=g[b+1][1],g[b][1]=g[b][1].substring(g[b+1][1].length)+g[b+1][1],g.splice(b+1,1),V=!0)),b++;V&&C(g,L)}function M(g){return g>=55296&&g<=56319}function z(g){return g>=56320&&g<=57343}function U(g){return z(g.charCodeAt(0))}function rt(g){return M(g.charCodeAt(g.length-1))}function at(g){for(var L=[],b=0;b<g.length;b++)g[b][1].length>0&&L.push(g[b]);return L}function ft(g,L,b,O){return rt(g)||U(O)?null:at([[e,g],[r,L],[t,b],[e,O]])}function Rt(g,L,b){var O=typeof b=="number"?{index:b,length:0}:b.oldRange,S=typeof b=="number"?null:b.newRange,T=g.length,_=L.length;if(O.length===0&&(S===null||S.length===0)){var k=O.index,j=g.slice(0,k),I=g.slice(k),K=S?S.index:null;t:{var F=k+_-T;if(K!==null&&K!==F||F<0||F>_)break t;var V=L.slice(0,F),W=L.slice(F);if(W!==I)break t;var P=Math.min(k,F),it=j.slice(0,P),ot=V.slice(0,P);if(it!==ot)break t;var G=j.slice(P),Q=V.slice(P);return ft(it,G,Q,I)}t:{if(K!==null&&K!==k)break t;var Y=k,V=L.slice(0,Y),W=L.slice(Y);if(V!==j)break t;var J=Math.min(T-Y,_-Y),et=I.slice(I.length-J),nt=W.slice(W.length-J);if(et!==nt)break t;var G=I.slice(0,I.length-J),Q=W.slice(0,W.length-J);return ft(j,G,Q,et)}}if(O.length>0&&S&&S.length===0)t:{var it=g.slice(0,O.index),et=g.slice(O.index+O.length),P=it.length,J=et.length;if(_<P+J)break t;var ot=L.slice(0,P),nt=L.slice(_-J);if(it!==ot||et!==nt)break t;var G=g.slice(P,T-J),Q=L.slice(P,_-J);return ft(it,G,Q,et)}return null}function xt(g,L,b,O){return n(g,L,b,O,!0)}return xt.INSERT=t,xt.DELETE=r,xt.EQUAL=e,Is=xt,Is}var qn={exports:{}};qn.exports;var il;function fo(){return il||(il=1,(function(r,t){var e=200,n="__lodash_hash_undefined__",s=9007199254740991,i="[object Arguments]",o="[object Array]",a="[object Boolean]",u="[object Date]",h="[object Error]",p="[object Function]",v="[object GeneratorFunction]",f="[object Map]",m="[object Number]",y="[object Object]",A="[object Promise]",w="[object RegExp]",x="[object Set]",C="[object String]",M="[object Symbol]",z="[object WeakMap]",U="[object ArrayBuffer]",rt="[object DataView]",at="[object Float32Array]",ft="[object Float64Array]",Rt="[object Int8Array]",xt="[object Int16Array]",g="[object Int32Array]",L="[object Uint8Array]",b="[object Uint8ClampedArray]",O="[object Uint16Array]",S="[object Uint32Array]",T=/[\\^$.*+?()[\]{}|]/g,_=/\w*$/,k=/^\[object .+?Constructor\]$/,j=/^(?:0|[1-9]\d*)$/,I={};I[i]=I[o]=I[U]=I[rt]=I[a]=I[u]=I[at]=I[ft]=I[Rt]=I[xt]=I[g]=I[f]=I[m]=I[y]=I[w]=I[x]=I[C]=I[M]=I[L]=I[b]=I[O]=I[S]=!0,I[h]=I[p]=I[z]=!1;var K=typeof pe=="object"&&pe&&pe.Object===Object&&pe,F=typeof self=="object"&&self&&self.Object===Object&&self,V=K||F||Function("return this")(),W=t&&!t.nodeType&&t,P=W&&!0&&r&&!r.nodeType&&r,it=P&&P.exports===W;function ot(l,c){return l.set(c[0],c[1]),l}function G(l,c){return l.add(c),l}function Q(l,c){for(var d=-1,E=l?l.length:0;++d<E&&c(l[d],d,l)!==!1;);return l}function Y(l,c){for(var d=-1,E=c.length,H=l.length;++d<E;)l[H+d]=c[d];return l}function J(l,c,d,E){for(var H=-1,$=l?l.length:0;++H<$;)d=c(d,l[H],H,l);return d}function et(l,c){for(var d=-1,E=Array(l);++d<l;)E[d]=c(d);return E}function nt(l,c){return l==null?void 0:l[c]}function ct(l){var c=!1;if(l!=null&&typeof l.toString!="function")try{c=!!(l+"")}catch{}return c}function mt(l){var c=-1,d=Array(l.size);return l.forEach(function(E,H){d[++c]=[H,E]}),d}function fn(l,c){return function(d){return l(c(d))}}function Zn(l){var c=-1,d=Array(l.size);return l.forEach(function(E){d[++c]=E}),d}var Pr=Array.prototype,Ur=Function.prototype,$e=Object.prototype,dn=V["__core-js_shared__"],Xn=(function(){var l=/[^.]+$/.exec(dn&&dn.keys&&dn.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""})(),Yn=Ur.toString,Kt=$e.hasOwnProperty,Pe=$e.toString,Fr=RegExp("^"+Yn.call(Kt).replace(T,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ne=it?V.Buffer:void 0,Ue=V.Symbol,gn=V.Uint8Array,St=fn(Object.getPrototypeOf,Object),Qn=Object.create,Jn=$e.propertyIsEnumerable,Hr=Pr.splice,pn=Object.getOwnPropertySymbols,Fe=Ne?Ne.isBuffer:void 0,tr=fn(Object.keys,Object),He=Bt(V,"DataView"),we=Bt(V,"Map"),kt=Bt(V,"Promise"),ze=Bt(V,"Set"),mn=Bt(V,"WeakMap"),Te=Bt(Object,"create"),bn=Nt(He),xe=Nt(we),yn=Nt(kt),vn=Nt(ze),En=Nt(mn),he=Ue?Ue.prototype:void 0,er=he?he.valueOf:void 0;function ee(l){var c=-1,d=l?l.length:0;for(this.clear();++c<d;){var E=l[c];this.set(E[0],E[1])}}function zr(){this.__data__=Te?Te(null):{}}function Kr(l){return this.has(l)&&delete this.__data__[l]}function Gr(l){var c=this.__data__;if(Te){var d=c[l];return d===n?void 0:d}return Kt.call(c,l)?c[l]:void 0}function nr(l){var c=this.__data__;return Te?c[l]!==void 0:Kt.call(c,l)}function An(l,c){var d=this.__data__;return d[l]=Te&&c===void 0?n:c,this}ee.prototype.clear=zr,ee.prototype.delete=Kr,ee.prototype.get=Gr,ee.prototype.has=nr,ee.prototype.set=An;function dt(l){var c=-1,d=l?l.length:0;for(this.clear();++c<d;){var E=l[c];this.set(E[0],E[1])}}function Vr(){this.__data__=[]}function Wr(l){var c=this.__data__,d=Ge(c,l);if(d<0)return!1;var E=c.length-1;return d==E?c.pop():Hr.call(c,d,1),!0}function Zr(l){var c=this.__data__,d=Ge(c,l);return d<0?void 0:c[d][1]}function Xr(l){return Ge(this.__data__,l)>-1}function Yr(l,c){var d=this.__data__,E=Ge(d,l);return E<0?d.push([l,c]):d[E][1]=c,this}dt.prototype.clear=Vr,dt.prototype.delete=Wr,dt.prototype.get=Zr,dt.prototype.has=Xr,dt.prototype.set=Yr;function bt(l){var c=-1,d=l?l.length:0;for(this.clear();++c<d;){var E=l[c];this.set(E[0],E[1])}}function Qr(){this.__data__={hash:new ee,map:new(we||dt),string:new ee}}function Jr(l){return Se(this,l).delete(l)}function ts(l){return Se(this,l).get(l)}function es(l){return Se(this,l).has(l)}function ns(l,c){return Se(this,l).set(l,c),this}bt.prototype.clear=Qr,bt.prototype.delete=Jr,bt.prototype.get=ts,bt.prototype.has=es,bt.prototype.set=ns;function wt(l){this.__data__=new dt(l)}function rs(){this.__data__=new dt}function ss(l){return this.__data__.delete(l)}function is(l){return this.__data__.get(l)}function ls(l){return this.__data__.has(l)}function os(l,c){var d=this.__data__;if(d instanceof dt){var E=d.__data__;if(!we||E.length<e-1)return E.push([l,c]),this;d=this.__data__=new bt(E)}return d.set(l,c),this}wt.prototype.clear=rs,wt.prototype.delete=ss,wt.prototype.get=is,wt.prototype.has=ls,wt.prototype.set=os;function Ke(l,c){var d=xn(l)||We(l)?et(l.length,String):[],E=d.length,H=!!E;for(var $ in l)Kt.call(l,$)&&!(H&&($=="length"||As($,E)))&&d.push($);return d}function rr(l,c,d){var E=l[c];(!(Kt.call(l,c)&&ar(E,d))||d===void 0&&!(c in l))&&(l[c]=d)}function Ge(l,c){for(var d=l.length;d--;)if(ar(l[d][0],c))return d;return-1}function Gt(l,c){return l&&Tn(c,Sn(c),l)}function Nn(l,c,d,E,H,$,X){var Z;if(E&&(Z=$?E(l,H,$,X):E(l)),Z!==void 0)return Z;if(!Wt(l))return l;var ut=xn(l);if(ut){if(Z=vs(l),!c)return ms(l,Z)}else{var tt=re(l),yt=tt==p||tt==v;if(cr(l))return Ve(l,c);if(tt==y||tt==i||yt&&!$){if(ct(l))return $?l:{};if(Z=Vt(yt?{}:l),!c)return bs(l,Gt(Z,l))}else{if(!I[tt])return $?l:{};Z=Es(l,tt,Nn,c)}}X||(X=new wt);var Tt=X.get(l);if(Tt)return Tt;if(X.set(l,Z),!ut)var ht=d?ys(l):Sn(l);return Q(ht||l,function(vt,gt){ht&&(gt=vt,vt=l[gt]),rr(Z,gt,Nn(vt,c,d,E,gt,l,X))}),Z}function as(l){return Wt(l)?Qn(l):{}}function cs(l,c,d){var E=c(l);return xn(l)?E:Y(E,d(l))}function us(l){return Pe.call(l)}function hs(l){if(!Wt(l)||ws(l))return!1;var c=Ln(l)||ct(l)?Fr:k;return c.test(Nt(l))}function fs(l){if(!lr(l))return tr(l);var c=[];for(var d in Object(l))Kt.call(l,d)&&d!="constructor"&&c.push(d);return c}function Ve(l,c){if(c)return l.slice();var d=new l.constructor(l.length);return l.copy(d),d}function wn(l){var c=new l.constructor(l.byteLength);return new gn(c).set(new gn(l)),c}function Le(l,c){var d=c?wn(l.buffer):l.buffer;return new l.constructor(d,l.byteOffset,l.byteLength)}function sr(l,c,d){var E=c?d(mt(l),!0):mt(l);return J(E,ot,new l.constructor)}function ir(l){var c=new l.constructor(l.source,_.exec(l));return c.lastIndex=l.lastIndex,c}function ds(l,c,d){var E=c?d(Zn(l),!0):Zn(l);return J(E,G,new l.constructor)}function gs(l){return er?Object(er.call(l)):{}}function ps(l,c){var d=c?wn(l.buffer):l.buffer;return new l.constructor(d,l.byteOffset,l.length)}function ms(l,c){var d=-1,E=l.length;for(c||(c=Array(E));++d<E;)c[d]=l[d];return c}function Tn(l,c,d,E){d||(d={});for(var H=-1,$=c.length;++H<$;){var X=c[H],Z=void 0;rr(d,X,Z===void 0?l[X]:Z)}return d}function bs(l,c){return Tn(l,ne(l),c)}function ys(l){return cs(l,Sn,ne)}function Se(l,c){var d=l.__data__;return Ns(c)?d[typeof c=="string"?"string":"hash"]:d.map}function Bt(l,c){var d=nt(l,c);return hs(d)?d:void 0}var ne=pn?fn(pn,Object):xs,re=us;(He&&re(new He(new ArrayBuffer(1)))!=rt||we&&re(new we)!=f||kt&&re(kt.resolve())!=A||ze&&re(new ze)!=x||mn&&re(new mn)!=z)&&(re=function(l){var c=Pe.call(l),d=c==y?l.constructor:void 0,E=d?Nt(d):void 0;if(E)switch(E){case bn:return rt;case xe:return f;case yn:return A;case vn:return x;case En:return z}return c});function vs(l){var c=l.length,d=l.constructor(c);return c&&typeof l[0]=="string"&&Kt.call(l,"index")&&(d.index=l.index,d.input=l.input),d}function Vt(l){return typeof l.constructor=="function"&&!lr(l)?as(St(l)):{}}function Es(l,c,d,E){var H=l.constructor;switch(c){case U:return wn(l);case a:case u:return new H(+l);case rt:return Le(l,E);case at:case ft:case Rt:case xt:case g:case L:case b:case O:case S:return ps(l,E);case f:return sr(l,E,d);case m:case C:return new H(l);case w:return ir(l);case x:return ds(l,E,d);case M:return gs(l)}}function As(l,c){return c=c??s,!!c&&(typeof l=="number"||j.test(l))&&l>-1&&l%1==0&&l<c}function Ns(l){var c=typeof l;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?l!=="__proto__":l===null}function ws(l){return!!Xn&&Xn in l}function lr(l){var c=l&&l.constructor,d=typeof c=="function"&&c.prototype||$e;return l===d}function Nt(l){if(l!=null){try{return Yn.call(l)}catch{}try{return l+""}catch{}}return""}function or(l){return Nn(l,!0,!0)}function ar(l,c){return l===c||l!==l&&c!==c}function We(l){return Ts(l)&&Kt.call(l,"callee")&&(!Jn.call(l,"callee")||Pe.call(l)==i)}var xn=Array.isArray;function Ze(l){return l!=null&&ur(l.length)&&!Ln(l)}function Ts(l){return hr(l)&&Ze(l)}var cr=Fe||Ls;function Ln(l){var c=Wt(l)?Pe.call(l):"";return c==p||c==v}function ur(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=s}function Wt(l){var c=typeof l;return!!l&&(c=="object"||c=="function")}function hr(l){return!!l&&typeof l=="object"}function Sn(l){return Ze(l)?Ke(l):fs(l)}function xs(){return[]}function Ls(){return!1}r.exports=or})(qn,qn.exports)),qn.exports}var Cn={exports:{}};Cn.exports;var ll;function go(){return ll||(ll=1,(function(r,t){var e=200,n="__lodash_hash_undefined__",s=1,i=2,o=9007199254740991,a="[object Arguments]",u="[object Array]",h="[object AsyncFunction]",p="[object Boolean]",v="[object Date]",f="[object Error]",m="[object Function]",y="[object GeneratorFunction]",A="[object Map]",w="[object Number]",x="[object Null]",C="[object Object]",M="[object Promise]",z="[object Proxy]",U="[object RegExp]",rt="[object Set]",at="[object String]",ft="[object Symbol]",Rt="[object Undefined]",xt="[object WeakMap]",g="[object ArrayBuffer]",L="[object DataView]",b="[object Float32Array]",O="[object Float64Array]",S="[object Int8Array]",T="[object Int16Array]",_="[object Int32Array]",k="[object Uint8Array]",j="[object Uint8ClampedArray]",I="[object Uint16Array]",K="[object Uint32Array]",F=/[\\^$.*+?()[\]{}|]/g,V=/^\[object .+?Constructor\]$/,W=/^(?:0|[1-9]\d*)$/,P={};P[b]=P[O]=P[S]=P[T]=P[_]=P[k]=P[j]=P[I]=P[K]=!0,P[a]=P[u]=P[g]=P[p]=P[L]=P[v]=P[f]=P[m]=P[A]=P[w]=P[C]=P[U]=P[rt]=P[at]=P[xt]=!1;var it=typeof pe=="object"&&pe&&pe.Object===Object&&pe,ot=typeof self=="object"&&self&&self.Object===Object&&self,G=it||ot||Function("return this")(),Q=t&&!t.nodeType&&t,Y=Q&&!0&&r&&!r.nodeType&&r,J=Y&&Y.exports===Q,et=J&&it.process,nt=(function(){try{return et&&et.binding&&et.binding("util")}catch{}})(),ct=nt&&nt.isTypedArray;function mt(l,c){for(var d=-1,E=l==null?0:l.length,H=0,$=[];++d<E;){var X=l[d];c(X,d,l)&&($[H++]=X)}return $}function fn(l,c){for(var d=-1,E=c.length,H=l.length;++d<E;)l[H+d]=c[d];return l}function Zn(l,c){for(var d=-1,E=l==null?0:l.length;++d<E;)if(c(l[d],d,l))return!0;return!1}function Pr(l,c){for(var d=-1,E=Array(l);++d<l;)E[d]=c(d);return E}function Ur(l){return function(c){return l(c)}}function $e(l,c){return l.has(c)}function dn(l,c){return l==null?void 0:l[c]}function Xn(l){var c=-1,d=Array(l.size);return l.forEach(function(E,H){d[++c]=[H,E]}),d}function Yn(l,c){return function(d){return l(c(d))}}function Kt(l){var c=-1,d=Array(l.size);return l.forEach(function(E){d[++c]=E}),d}var Pe=Array.prototype,Fr=Function.prototype,Ne=Object.prototype,Ue=G["__core-js_shared__"],gn=Fr.toString,St=Ne.hasOwnProperty,Qn=(function(){var l=/[^.]+$/.exec(Ue&&Ue.keys&&Ue.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""})(),Jn=Ne.toString,Hr=RegExp("^"+gn.call(St).replace(F,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pn=J?G.Buffer:void 0,Fe=G.Symbol,tr=G.Uint8Array,He=Ne.propertyIsEnumerable,we=Pe.splice,kt=Fe?Fe.toStringTag:void 0,ze=Object.getOwnPropertySymbols,mn=pn?pn.isBuffer:void 0,Te=Yn(Object.keys,Object),bn=ne(G,"DataView"),xe=ne(G,"Map"),yn=ne(G,"Promise"),vn=ne(G,"Set"),En=ne(G,"WeakMap"),he=ne(Object,"create"),er=Nt(bn),ee=Nt(xe),zr=Nt(yn),Kr=Nt(vn),Gr=Nt(En),nr=Fe?Fe.prototype:void 0,An=nr?nr.valueOf:void 0;function dt(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var E=l[c];this.set(E[0],E[1])}}function Vr(){this.__data__=he?he(null):{},this.size=0}function Wr(l){var c=this.has(l)&&delete this.__data__[l];return this.size-=c?1:0,c}function Zr(l){var c=this.__data__;if(he){var d=c[l];return d===n?void 0:d}return St.call(c,l)?c[l]:void 0}function Xr(l){var c=this.__data__;return he?c[l]!==void 0:St.call(c,l)}function Yr(l,c){var d=this.__data__;return this.size+=this.has(l)?0:1,d[l]=he&&c===void 0?n:c,this}dt.prototype.clear=Vr,dt.prototype.delete=Wr,dt.prototype.get=Zr,dt.prototype.has=Xr,dt.prototype.set=Yr;function bt(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var E=l[c];this.set(E[0],E[1])}}function Qr(){this.__data__=[],this.size=0}function Jr(l){var c=this.__data__,d=Ve(c,l);if(d<0)return!1;var E=c.length-1;return d==E?c.pop():we.call(c,d,1),--this.size,!0}function ts(l){var c=this.__data__,d=Ve(c,l);return d<0?void 0:c[d][1]}function es(l){return Ve(this.__data__,l)>-1}function ns(l,c){var d=this.__data__,E=Ve(d,l);return E<0?(++this.size,d.push([l,c])):d[E][1]=c,this}bt.prototype.clear=Qr,bt.prototype.delete=Jr,bt.prototype.get=ts,bt.prototype.has=es,bt.prototype.set=ns;function wt(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var E=l[c];this.set(E[0],E[1])}}function rs(){this.size=0,this.__data__={hash:new dt,map:new(xe||bt),string:new dt}}function ss(l){var c=Bt(this,l).delete(l);return this.size-=c?1:0,c}function is(l){return Bt(this,l).get(l)}function ls(l){return Bt(this,l).has(l)}function os(l,c){var d=Bt(this,l),E=d.size;return d.set(l,c),this.size+=d.size==E?0:1,this}wt.prototype.clear=rs,wt.prototype.delete=ss,wt.prototype.get=is,wt.prototype.has=ls,wt.prototype.set=os;function Ke(l){var c=-1,d=l==null?0:l.length;for(this.__data__=new wt;++c<d;)this.add(l[c])}function rr(l){return this.__data__.set(l,n),this}function Ge(l){return this.__data__.has(l)}Ke.prototype.add=Ke.prototype.push=rr,Ke.prototype.has=Ge;function Gt(l){var c=this.__data__=new bt(l);this.size=c.size}function Nn(){this.__data__=new bt,this.size=0}function as(l){var c=this.__data__,d=c.delete(l);return this.size=c.size,d}function cs(l){return this.__data__.get(l)}function us(l){return this.__data__.has(l)}function hs(l,c){var d=this.__data__;if(d instanceof bt){var E=d.__data__;if(!xe||E.length<e-1)return E.push([l,c]),this.size=++d.size,this;d=this.__data__=new wt(E)}return d.set(l,c),this.size=d.size,this}Gt.prototype.clear=Nn,Gt.prototype.delete=as,Gt.prototype.get=cs,Gt.prototype.has=us,Gt.prototype.set=hs;function fs(l,c){var d=We(l),E=!d&&ar(l),H=!d&&!E&&Ze(l),$=!d&&!E&&!H&&hr(l),X=d||E||H||$,Z=X?Pr(l.length,String):[],ut=Z.length;for(var tt in l)St.call(l,tt)&&!(X&&(tt=="length"||H&&(tt=="offset"||tt=="parent")||$&&(tt=="buffer"||tt=="byteLength"||tt=="byteOffset")||Es(tt,ut)))&&Z.push(tt);return Z}function Ve(l,c){for(var d=l.length;d--;)if(or(l[d][0],c))return d;return-1}function wn(l,c,d){var E=c(l);return We(l)?E:fn(E,d(l))}function Le(l){return l==null?l===void 0?Rt:x:kt&&kt in Object(l)?re(l):lr(l)}function sr(l){return Wt(l)&&Le(l)==a}function ir(l,c,d,E,H){return l===c?!0:l==null||c==null||!Wt(l)&&!Wt(c)?l!==l&&c!==c:ds(l,c,d,E,ir,H)}function ds(l,c,d,E,H,$){var X=We(l),Z=We(c),ut=X?u:Vt(l),tt=Z?u:Vt(c);ut=ut==a?C:ut,tt=tt==a?C:tt;var yt=ut==C,Tt=tt==C,ht=ut==tt;if(ht&&Ze(l)){if(!Ze(c))return!1;X=!0,yt=!1}if(ht&&!yt)return $||($=new Gt),X||hr(l)?Tn(l,c,d,E,H,$):bs(l,c,ut,d,E,H,$);if(!(d&s)){var vt=yt&&St.call(l,"__wrapped__"),gt=Tt&&St.call(c,"__wrapped__");if(vt||gt){var fe=vt?l.value():l,se=gt?c.value():c;return $||($=new Gt),H(fe,se,d,E,$)}}return ht?($||($=new Gt),ys(l,c,d,E,H,$)):!1}function gs(l){if(!ur(l)||Ns(l))return!1;var c=cr(l)?Hr:V;return c.test(Nt(l))}function ps(l){return Wt(l)&&Ln(l.length)&&!!P[Le(l)]}function ms(l){if(!ws(l))return Te(l);var c=[];for(var d in Object(l))St.call(l,d)&&d!="constructor"&&c.push(d);return c}function Tn(l,c,d,E,H,$){var X=d&s,Z=l.length,ut=c.length;if(Z!=ut&&!(X&&ut>Z))return!1;var tt=$.get(l);if(tt&&$.get(c))return tt==c;var yt=-1,Tt=!0,ht=d&i?new Ke:void 0;for($.set(l,c),$.set(c,l);++yt<Z;){var vt=l[yt],gt=c[yt];if(E)var fe=X?E(gt,vt,yt,c,l,$):E(vt,gt,yt,l,c,$);if(fe!==void 0){if(fe)continue;Tt=!1;break}if(ht){if(!Zn(c,function(se,_e){if(!$e(ht,_e)&&(vt===se||H(vt,se,d,E,$)))return ht.push(_e)})){Tt=!1;break}}else if(!(vt===gt||H(vt,gt,d,E,$))){Tt=!1;break}}return $.delete(l),$.delete(c),Tt}function bs(l,c,d,E,H,$,X){switch(d){case L:if(l.byteLength!=c.byteLength||l.byteOffset!=c.byteOffset)return!1;l=l.buffer,c=c.buffer;case g:return!(l.byteLength!=c.byteLength||!$(new tr(l),new tr(c)));case p:case v:case w:return or(+l,+c);case f:return l.name==c.name&&l.message==c.message;case U:case at:return l==c+"";case A:var Z=Xn;case rt:var ut=E&s;if(Z||(Z=Kt),l.size!=c.size&&!ut)return!1;var tt=X.get(l);if(tt)return tt==c;E|=i,X.set(l,c);var yt=Tn(Z(l),Z(c),E,H,$,X);return X.delete(l),yt;case ft:if(An)return An.call(l)==An.call(c)}return!1}function ys(l,c,d,E,H,$){var X=d&s,Z=Se(l),ut=Z.length,tt=Se(c),yt=tt.length;if(ut!=yt&&!X)return!1;for(var Tt=ut;Tt--;){var ht=Z[Tt];if(!(X?ht in c:St.call(c,ht)))return!1}var vt=$.get(l);if(vt&&$.get(c))return vt==c;var gt=!0;$.set(l,c),$.set(c,l);for(var fe=X;++Tt<ut;){ht=Z[Tt];var se=l[ht],_e=c[ht];if(E)var Oi=X?E(_e,se,ht,c,l,$):E(se,_e,ht,l,c,$);if(!(Oi===void 0?se===_e||H(se,_e,d,E,$):Oi)){gt=!1;break}fe||(fe=ht=="constructor")}if(gt&&!fe){var fr=l.constructor,dr=c.constructor;fr!=dr&&"constructor"in l&&"constructor"in c&&!(typeof fr=="function"&&fr instanceof fr&&typeof dr=="function"&&dr instanceof dr)&&(gt=!1)}return $.delete(l),$.delete(c),gt}function Se(l){return wn(l,Sn,vs)}function Bt(l,c){var d=l.__data__;return As(c)?d[typeof c=="string"?"string":"hash"]:d.map}function ne(l,c){var d=dn(l,c);return gs(d)?d:void 0}function re(l){var c=St.call(l,kt),d=l[kt];try{l[kt]=void 0;var E=!0}catch{}var H=Jn.call(l);return E&&(c?l[kt]=d:delete l[kt]),H}var vs=ze?function(l){return l==null?[]:(l=Object(l),mt(ze(l),function(c){return He.call(l,c)}))}:xs,Vt=Le;(bn&&Vt(new bn(new ArrayBuffer(1)))!=L||xe&&Vt(new xe)!=A||yn&&Vt(yn.resolve())!=M||vn&&Vt(new vn)!=rt||En&&Vt(new En)!=xt)&&(Vt=function(l){var c=Le(l),d=c==C?l.constructor:void 0,E=d?Nt(d):"";if(E)switch(E){case er:return L;case ee:return A;case zr:return M;case Kr:return rt;case Gr:return xt}return c});function Es(l,c){return c=c??o,!!c&&(typeof l=="number"||W.test(l))&&l>-1&&l%1==0&&l<c}function As(l){var c=typeof l;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?l!=="__proto__":l===null}function Ns(l){return!!Qn&&Qn in l}function ws(l){var c=l&&l.constructor,d=typeof c=="function"&&c.prototype||Ne;return l===d}function lr(l){return Jn.call(l)}function Nt(l){if(l!=null){try{return gn.call(l)}catch{}try{return l+""}catch{}}return""}function or(l,c){return l===c||l!==l&&c!==c}var ar=sr((function(){return arguments})())?sr:function(l){return Wt(l)&&St.call(l,"callee")&&!He.call(l,"callee")},We=Array.isArray;function xn(l){return l!=null&&Ln(l.length)&&!cr(l)}var Ze=mn||Ls;function Ts(l,c){return ir(l,c)}function cr(l){if(!ur(l))return!1;var c=Le(l);return c==m||c==y||c==h||c==z}function Ln(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=o}function ur(l){var c=typeof l;return l!=null&&(c=="object"||c=="function")}function Wt(l){return l!=null&&typeof l=="object"}var hr=ct?Ur(ct):ps;function Sn(l){return xn(l)?fs(l):ms(l)}function xs(){return[]}function Ls(){return!1}r.exports=Ts})(Cn,Cn.exports)),Cn.exports}var mr={},ol;function _f(){if(ol)return mr;ol=1,Object.defineProperty(mr,"__esModule",{value:!0});const r=fo(),t=go();var e;return(function(n){function s(u={},h={},p=!1){typeof u!="object"&&(u={}),typeof h!="object"&&(h={});let v=r(h);p||(v=Object.keys(v).reduce((f,m)=>(v[m]!=null&&(f[m]=v[m]),f),{}));for(const f in u)u[f]!==void 0&&h[f]===void 0&&(v[f]=u[f]);return Object.keys(v).length>0?v:void 0}n.compose=s;function i(u={},h={}){typeof u!="object"&&(u={}),typeof h!="object"&&(h={});const p=Object.keys(u).concat(Object.keys(h)).reduce((v,f)=>(t(u[f],h[f])||(v[f]=h[f]===void 0?null:h[f]),v),{});return Object.keys(p).length>0?p:void 0}n.diff=i;function o(u={},h={}){u=u||{};const p=Object.keys(h).reduce((v,f)=>(h[f]!==u[f]&&u[f]!==void 0&&(v[f]=h[f]),v),{});return Object.keys(u).reduce((v,f)=>(u[f]!==h[f]&&h[f]===void 0&&(v[f]=null),v),p)}n.invert=o;function a(u,h,p=!1){if(typeof u!="object")return h;if(typeof h!="object")return;if(!p)return h;const v=Object.keys(h).reduce((f,m)=>(u[m]===void 0&&(f[m]=h[m]),f),{});return Object.keys(v).length>0?v:void 0}n.transform=a})(e||(e={})),mr.default=e,mr}var br={},al;function po(){if(al)return br;al=1,Object.defineProperty(br,"__esModule",{value:!0});var r;return(function(t){function e(n){return typeof n.delete=="number"?n.delete:typeof n.retain=="number"?n.retain:typeof n.retain=="object"&&n.retain!==null?1:typeof n.insert=="string"?n.insert.length:1}t.length=e})(r||(r={})),br.default=r,br}var yr={},cl;function Of(){if(cl)return yr;cl=1,Object.defineProperty(yr,"__esModule",{value:!0});const r=po();class t{constructor(n){this.ops=n,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(n){n||(n=1/0);const s=this.ops[this.index];if(s){const i=this.offset,o=r.default.length(s);if(n>=o-i?(n=o-i,this.index+=1,this.offset=0):this.offset+=n,typeof s.delete=="number")return{delete:n};{const a={};return s.attributes&&(a.attributes=s.attributes),typeof s.retain=="number"?a.retain=n:typeof s.retain=="object"&&s.retain!==null?a.retain=s.retain:typeof s.insert=="string"?a.insert=s.insert.substr(i,n):a.insert=s.insert,a}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?r.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const n=this.ops[this.index];return n?typeof n.delete=="number"?"delete":typeof n.retain=="number"||typeof n.retain=="object"&&n.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const n=this.offset,s=this.index,i=this.next(),o=this.ops.slice(this.index);return this.offset=n,this.index=s,[i].concat(o)}}else return[]}}return yr.default=t,yr}var ul;function qf(){return ul||(ul=1,(function(r,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const e=Sf(),n=fo(),s=go(),i=_f();t.AttributeMap=i.default;const o=po();t.Op=o.default;const a=Of();t.OpIterator=a.default;const u="\0",h=(v,f)=>{if(typeof v!="object"||v===null)throw new Error(`cannot retain a ${typeof v}`);if(typeof f!="object"||f===null)throw new Error(`cannot retain a ${typeof f}`);const m=Object.keys(v)[0];if(!m||m!==Object.keys(f)[0])throw new Error(`embed types not matched: ${m} != ${Object.keys(f)[0]}`);return[m,v[m],f[m]]};class p{constructor(f){Array.isArray(f)?this.ops=f:f!=null&&Array.isArray(f.ops)?this.ops=f.ops:this.ops=[]}static registerEmbed(f,m){this.handlers[f]=m}static unregisterEmbed(f){delete this.handlers[f]}static getHandler(f){const m=this.handlers[f];if(!m)throw new Error(`no handlers for embed type "${f}"`);return m}insert(f,m){const y={};return typeof f=="string"&&f.length===0?this:(y.insert=f,m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(y.attributes=m),this.push(y))}delete(f){return f<=0?this:this.push({delete:f})}retain(f,m){if(typeof f=="number"&&f<=0)return this;const y={retain:f};return m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(y.attributes=m),this.push(y)}push(f){let m=this.ops.length,y=this.ops[m-1];if(f=n(f),typeof y=="object"){if(typeof f.delete=="number"&&typeof y.delete=="number")return this.ops[m-1]={delete:y.delete+f.delete},this;if(typeof y.delete=="number"&&f.insert!=null&&(m-=1,y=this.ops[m-1],typeof y!="object"))return this.ops.unshift(f),this;if(s(f.attributes,y.attributes)){if(typeof f.insert=="string"&&typeof y.insert=="string")return this.ops[m-1]={insert:y.insert+f.insert},typeof f.attributes=="object"&&(this.ops[m-1].attributes=f.attributes),this;if(typeof f.retain=="number"&&typeof y.retain=="number")return this.ops[m-1]={retain:y.retain+f.retain},typeof f.attributes=="object"&&(this.ops[m-1].attributes=f.attributes),this}}return m===this.ops.length?this.ops.push(f):this.ops.splice(m,0,f),this}chop(){const f=this.ops[this.ops.length-1];return f&&typeof f.retain=="number"&&!f.attributes&&this.ops.pop(),this}filter(f){return this.ops.filter(f)}forEach(f){this.ops.forEach(f)}map(f){return this.ops.map(f)}partition(f){const m=[],y=[];return this.forEach(A=>{(f(A)?m:y).push(A)}),[m,y]}reduce(f,m){return this.ops.reduce(f,m)}changeLength(){return this.reduce((f,m)=>m.insert?f+o.default.length(m):m.delete?f-m.delete:f,0)}length(){return this.reduce((f,m)=>f+o.default.length(m),0)}slice(f=0,m=1/0){const y=[],A=new a.default(this.ops);let w=0;for(;w<m&&A.hasNext();){let x;w<f?x=A.next(f-w):(x=A.next(m-w),y.push(x)),w+=o.default.length(x)}return new p(y)}compose(f){const m=new a.default(this.ops),y=new a.default(f.ops),A=[],w=y.peek();if(w!=null&&typeof w.retain=="number"&&w.attributes==null){let C=w.retain;for(;m.peekType()==="insert"&&m.peekLength()<=C;)C-=m.peekLength(),A.push(m.next());w.retain-C>0&&y.next(w.retain-C)}const x=new p(A);for(;m.hasNext()||y.hasNext();)if(y.peekType()==="insert")x.push(y.next());else if(m.peekType()==="delete")x.push(m.next());else{const C=Math.min(m.peekLength(),y.peekLength()),M=m.next(C),z=y.next(C);if(z.retain){const U={};if(typeof M.retain=="number")U.retain=typeof z.retain=="number"?C:z.retain;else if(typeof z.retain=="number")M.retain==null?U.insert=M.insert:U.retain=M.retain;else{const at=M.retain==null?"insert":"retain",[ft,Rt,xt]=h(M[at],z.retain),g=p.getHandler(ft);U[at]={[ft]:g.compose(Rt,xt,at==="retain")}}const rt=i.default.compose(M.attributes,z.attributes,typeof M.retain=="number");if(rt&&(U.attributes=rt),x.push(U),!y.hasNext()&&s(x.ops[x.ops.length-1],U)){const at=new p(m.rest());return x.concat(at).chop()}}else typeof z.delete=="number"&&(typeof M.retain=="number"||typeof M.retain=="object"&&M.retain!==null)&&x.push(z)}return x.chop()}concat(f){const m=new p(this.ops.slice());return f.ops.length>0&&(m.push(f.ops[0]),m.ops=m.ops.concat(f.ops.slice(1))),m}diff(f,m){if(this.ops===f.ops)return new p;const y=[this,f].map(M=>M.map(z=>{if(z.insert!=null)return typeof z.insert=="string"?z.insert:u;const U=M===f?"on":"with";throw new Error("diff() called "+U+" non-document")}).join("")),A=new p,w=e(y[0],y[1],m,!0),x=new a.default(this.ops),C=new a.default(f.ops);return w.forEach(M=>{let z=M[1].length;for(;z>0;){let U=0;switch(M[0]){case e.INSERT:U=Math.min(C.peekLength(),z),A.push(C.next(U));break;case e.DELETE:U=Math.min(z,x.peekLength()),x.next(U),A.delete(U);break;case e.EQUAL:U=Math.min(x.peekLength(),C.peekLength(),z);const rt=x.next(U),at=C.next(U);s(rt.insert,at.insert)?A.retain(U,i.default.diff(rt.attributes,at.attributes)):A.push(at).delete(U);break}z-=U}}),A.chop()}eachLine(f,m=`
2
+ `){const y=new a.default(this.ops);let A=new p,w=0;for(;y.hasNext();){if(y.peekType()!=="insert")return;const x=y.peek(),C=o.default.length(x)-y.peekLength(),M=typeof x.insert=="string"?x.insert.indexOf(m,C)-C:-1;if(M<0)A.push(y.next());else if(M>0)A.push(y.next(M));else{if(f(A,y.next(1).attributes||{},w)===!1)return;w+=1,A=new p}}A.length()>0&&f(A,{},w)}invert(f){const m=new p;return this.reduce((y,A)=>{if(A.insert)m.delete(o.default.length(A));else{if(typeof A.retain=="number"&&A.attributes==null)return m.retain(A.retain),y+A.retain;if(A.delete||typeof A.retain=="number"){const w=A.delete||A.retain;return f.slice(y,y+w).forEach(C=>{A.delete?m.push(C):A.retain&&A.attributes&&m.retain(o.default.length(C),i.default.invert(A.attributes,C.attributes))}),y+w}else if(typeof A.retain=="object"&&A.retain!==null){const w=f.slice(y,y+1),x=new a.default(w.ops).next(),[C,M,z]=h(A.retain,x.insert),U=p.getHandler(C);return m.retain({[C]:U.invert(M,z)},i.default.invert(A.attributes,x.attributes)),y+1}}return y},0),m.chop()}transform(f,m=!1){if(m=!!m,typeof f=="number")return this.transformPosition(f,m);const y=f,A=new a.default(this.ops),w=new a.default(y.ops),x=new p;for(;A.hasNext()||w.hasNext();)if(A.peekType()==="insert"&&(m||w.peekType()!=="insert"))x.retain(o.default.length(A.next()));else if(w.peekType()==="insert")x.push(w.next());else{const C=Math.min(A.peekLength(),w.peekLength()),M=A.next(C),z=w.next(C);if(M.delete)continue;if(z.delete)x.push(z);else{const U=M.retain,rt=z.retain;let at=typeof rt=="object"&&rt!==null?rt:C;if(typeof U=="object"&&U!==null&&typeof rt=="object"&&rt!==null){const ft=Object.keys(U)[0];if(ft===Object.keys(rt)[0]){const Rt=p.getHandler(ft);Rt&&(at={[ft]:Rt.transform(U[ft],rt[ft],m)})}}x.retain(at,i.default.transform(M.attributes,z.attributes,m))}}return x.chop()}transformPosition(f,m=!1){m=!!m;const y=new a.default(this.ops);let A=0;for(;y.hasNext()&&A<=f;){const w=y.peekLength(),x=y.peekType();if(y.next(),x==="delete"){f-=Math.min(w,f-A);continue}else x==="insert"&&(A<f||!m)&&(f+=w);A+=w}return f}}p.Op=o.default,p.OpIterator=a.default,p.AttributeMap=i.default,p.handlers={},t.default=p,r.exports=p,r.exports.default=p})(pr,pr.exports)),pr.exports}var It=qf();const B=Bl(It);class Ht extends Lt{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Ht.blotName="break";Ht.tagName="BR";let Ut=class extends qr{};const Cf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Mr(r){return r.replace(/[&<>"']/g,t=>Cf[t])}const Zt=class Zt extends bi{static compare(t,e){const n=Zt.order.indexOf(t),s=Zt.order.indexOf(e);return n>=0||s>=0?n-s:t===e?0:t<e?-1:1}formatAt(t,e,n,s){if(Zt.compare(this.statics.blotName,n)<0&&this.scroll.query(n,D.BLOT)){const i=this.isolate(t,e);s&&i.wrap(n,s)}else super.formatAt(t,e,n,s)}optimize(t){if(super.optimize(t),this.parent instanceof Zt&&Zt.compare(this.statics.blotName,this.parent.statics.blotName)>0){const e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}};q(Zt,"allowedChildren",[Zt,Ht,Lt,Ut]),q(Zt,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let Jt=Zt;const hl=1;class pt extends Pn{constructor(){super(...arguments);q(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=mo(this)),this.cache.delta}deleteAt(e,n){super.deleteAt(e,n),this.cache={}}formatAt(e,n,s,i){n<=0||(this.scroll.query(s,D.BLOCK)?e+n===this.length()&&this.format(s,i):super.formatAt(e,Math.min(n,this.length()-e-1),s,i),this.cache={})}insertAt(e,n,s){if(s!=null){super.insertAt(e,n,s),this.cache={};return}if(n.length===0)return;const i=n.split(`
3
3
  `),o=i.shift();o.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),o):this.children.tail.insertAt(this.children.tail.length(),o),this.cache={});let a=this;i.reduce((u,h)=>(a=a.split(u,!0),a.insertAt(0,h),h.length),e+o.length)}insertBefore(e,n){const{head:s}=this.children;super.insertBefore(e,n),s instanceof Ht&&s.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+hl),this.cache.length}moveChildren(e,n){super.moveChildren(e,n),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 n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(n&&(e===0||e>=this.length()-hl)){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,n);return this.cache={},s}}pt.blotName="block";pt.tagName="P";pt.defaultChild=Ht;pt.allowedChildren=[Ht,Jt,Lt,Ut];class Ct extends Lt{attach(){super.attach(),this.attributes=new kr(this.domNode)}delta(){return new B().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(t,e){const n=this.scroll.query(t,D.BLOCK_ATTRIBUTE);n!=null&&this.attributes.attribute(n,e)}formatAt(t,e,n,s){this.format(n,s)}insertAt(t,e,n){if(n!=null){super.insertAt(t,e,n);return}const s=e.split(`
4
4
  `),i=s.pop(),o=s.map(u=>{const h=this.scroll.create(pt.blotName);return h.insertAt(0,u),h}),a=this.split(t);o.forEach(u=>{this.parent.insertBefore(u,a)}),i&&this.parent.insertBefore(this.scroll.create("text",i),a)}}Ct.scope=D.BLOCK_BLOT;function mo(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return r.descendants(Et).reduce((e,n)=>n.length()===0?e:e.insert(n.value(),Ot(n,{},t)),new B).insert(`
5
- `,Ot(r))}function Ot(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return r==null||("formats"in r&&typeof r.formats=="function"&&(t={...t,...r.formats()},e&&delete t["code-token"]),r.parent==null||r.parent.statics.blotName==="scroll"||r.parent.statics.scope!==r.statics.scope)?t:Ot(r.parent,t,e)}const _t=class _t extends Lt{static value(){}constructor(t,e,n){super(t,e),this.selection=n,this.textNode=document.createTextNode(_t.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 n=this,s=0;for(;n!=null&&n.statics.scope!==D.BLOCK_BLOT;)s+=n.offset(n.parent),n=n.parent;n!=null&&(this.savedLength=_t.CONTENTS.length,n.optimize(),n.formatAt(s,_t.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 Ut?this.prev:null,n=e?e.length():0,s=this.next instanceof Ut?this.next:null,i=s?s.text:"",{textNode:o}=this,a=o.data.split(_t.CONTENTS).join("");o.data=_t.CONTENTS;let u;if(e)u=e,(a||s)&&(e.insertAt(e.length(),a+i),s&&s.remove());else if(s)u=s,s.insertAt(0,a);else{const h=document.createTextNode(a);u=this.scroll.create(h),this.parent.insertBefore(u,this)}if(this.remove(),t){const h=(f,m)=>e&&f===e.domNode?m:f===o?n+m-1:s&&f===s.domNode?n+a.length+m:null,p=h(t.start.node,t.start.offset),v=h(t.end.node,t.end.offset);if(p!==null&&v!==null)return{startNode:u.domNode,startOffset:p,endNode:u.domNode,endOffset:v}}return null}update(t,e){if(t.some(n=>n.type==="characterData"&&n.target===this.textNode)){const n=this.restore();n&&(e.range=n)}}optimize(t){super.optimize(t);let{parent:e}=this;for(;e;){if(e.domNode.tagName==="A"){this.savedLength=_t.CONTENTS.length,e.isolate(this.offset(e),this.length()).unwrap(),this.savedLength=0;break}e=e.parent}}value(){return""}};q(_t,"blotName","cursor"),q(_t,"className","ql-cursor"),q(_t,"tagName","span"),q(_t,"CONTENTS","\uFEFF");let an=_t;var Rs={exports:{}},fl;function If(){return fl||(fl=1,(function(r){var t=Object.prototype.hasOwnProperty,e="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(e=!1));function s(u,h,p){this.fn=u,this.context=h,this.once=p||!1}function i(u,h,p,v,f){if(typeof p!="function")throw new TypeError("The listener must be a function");var m=new s(p,v||u,f),y=e?e+h:h;return u._events[y]?u._events[y].fn?u._events[y]=[u._events[y],m]:u._events[y].push(m):(u._events[y]=m,u._eventsCount++),u}function o(u,h){--u._eventsCount===0?u._events=new n:delete u._events[h]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var h=[],p,v;if(this._eventsCount===0)return h;for(v in p=this._events)t.call(p,v)&&h.push(e?v.slice(1):v);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(p)):h},a.prototype.listeners=function(h){var p=e?e+h:h,v=this._events[p];if(!v)return[];if(v.fn)return[v.fn];for(var f=0,m=v.length,y=new Array(m);f<m;f++)y[f]=v[f].fn;return y},a.prototype.listenerCount=function(h){var p=e?e+h:h,v=this._events[p];return v?v.fn?1:v.length:0},a.prototype.emit=function(h,p,v,f,m,y){var A=e?e+h:h;if(!this._events[A])return!1;var w=this._events[A],x=arguments.length,C,M;if(w.fn){switch(w.once&&this.removeListener(h,w.fn,void 0,!0),x){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,p),!0;case 3:return w.fn.call(w.context,p,v),!0;case 4:return w.fn.call(w.context,p,v,f),!0;case 5:return w.fn.call(w.context,p,v,f,m),!0;case 6:return w.fn.call(w.context,p,v,f,m,y),!0}for(M=1,C=new Array(x-1);M<x;M++)C[M-1]=arguments[M];w.fn.apply(w.context,C)}else{var z=w.length,U;for(M=0;M<z;M++)switch(w[M].once&&this.removeListener(h,w[M].fn,void 0,!0),x){case 1:w[M].fn.call(w[M].context);break;case 2:w[M].fn.call(w[M].context,p);break;case 3:w[M].fn.call(w[M].context,p,v);break;case 4:w[M].fn.call(w[M].context,p,v,f);break;default:if(!C)for(U=1,C=new Array(x-1);U<x;U++)C[U-1]=arguments[U];w[M].fn.apply(w[M].context,C)}}return!0},a.prototype.on=function(h,p,v){return i(this,h,p,v,!1)},a.prototype.once=function(h,p,v){return i(this,h,p,v,!0)},a.prototype.removeListener=function(h,p,v,f){var m=e?e+h:h;if(!this._events[m])return this;if(!p)return o(this,m),this;var y=this._events[m];if(y.fn)y.fn===p&&(!f||y.once)&&(!v||y.context===v)&&o(this,m);else{for(var A=0,w=[],x=y.length;A<x;A++)(y[A].fn!==p||f&&!y[A].once||v&&y[A].context!==v)&&w.push(y[A]);w.length?this._events[m]=w.length===1?w[0]:w:o(this,m)}return this},a.prototype.removeAllListeners=function(h){var p;return h?(p=e?e+h:h,this._events[p]&&o(this,p)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=e,a.EventEmitter=a,r.exports=a})(Rs)),Rs.exports}var Rf=If();const kf=Bl(Rf),ti=new WeakMap,ei=["error","warn","log","info"];let ni="warn";function bo(r){if(ni&&ei.indexOf(r)<=ei.indexOf(ni)){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];console[r](...e)}}function ue(r){return ei.reduce((t,e)=>(t[e]=bo.bind(console,e,r),t),{})}ue.level=r=>{ni=r};bo.level=ue.level;const ks=ue("quill:events"),Bf=["selectionchange","mousedown","mouseup","click"];Bf.forEach(r=>{document.addEventListener(r,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];Array.from(document.querySelectorAll(".ql-container")).forEach(s=>{const i=ti.get(s);i&&i.emitter&&i.emitter.handleDOM(...e)})})});class R extends kf{constructor(){super(),this.domListeners={},this.on("error",ks.error)}emit(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return ks.log.call(ks,...e),super.emit(...e)}handleDOM(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),s=1;s<e;s++)n[s-1]=arguments[s];(this.domListeners[t.type]||[]).forEach(i=>{let{node:o,handler:a}=i;(t.target===o||o.contains(t.target))&&a(t,...n)})}listenDOM(t,e,n){this.domListeners[t]||(this.domListeners[t]=[]),this.domListeners[t].push({node:e,handler:n})}}q(R,"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"}),q(R,"sources",{API:"api",SILENT:"silent",USER:"user"});const Bs=ue("quill:selection");class Ie{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=t,this.length=e}}class Mf{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 Ie(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,R.sources.USER),1)}),this.emitter.on(R.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const n=this.getNativeRange();n!=null&&n.start.node!==this.cursor.textNode&&this.emitter.once(R.events.SCROLL_UPDATE,(s,i)=>{try{this.root.contains(n.start.node)&&this.root.contains(n.end.node)&&this.setNativeRange(n.start.node,n.start.offset,n.end.node,n.end.offset);const o=i.some(a=>a.type==="characterData"||a.type==="childList"||a.type==="attributes"&&a.target===this.root);this.update(o?R.sources.SILENT:s)}catch{}})}),this.emitter.on(R.events.SCROLL_OPTIMIZE,(n,s)=>{if(s.range){const{startNode:i,startOffset:o,endNode:a,endOffset:u}=s.range;this.setNativeRange(i,o,a,u),this.update(R.sources.SILENT)}}),this.update(R.sources.SILENT)}handleComposition(){this.emitter.on(R.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(R.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(R.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(t,e){this.scroll.update();const n=this.getNativeRange();if(!(n==null||!n.native.collapsed||this.scroll.query(t,D.BLOCK))){if(n.start.node!==this.cursor.textNode){const s=this.scroll.find(n.start.node,!1);if(s==null)return;if(s instanceof Et){const i=s.split(n.start.offset);s.parent.insertBefore(this.cursor,i)}else s.insertBefore(this.cursor,n.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 n=this.scroll.length();t=Math.min(t,n-1),e=Math.min(t+e,n-1)-t;let s,[i,o]=this.scroll.leaf(t);if(i==null)return null;if(e>0&&o===i.length()){const[p]=this.scroll.leaf(t+1);if(p){const[v]=this.scroll.line(t),[f]=this.scroll.line(t+1);v===f&&(i=p,o=0)}}[s,o]=i.position(o,!0);const a=document.createRange();if(e>0)return a.setStart(s,o),[i,o]=this.scroll.leaf(t+e),i==null?null:([s,o]=i.position(o,!0),a.setEnd(s,o),a.getBoundingClientRect());let u="left",h;if(s instanceof Text){if(!s.data.length)return null;o<s.data.length?(a.setStart(s,o),a.setEnd(s,o+1)):(a.setStart(s,o-1),a.setEnd(s,o),u="right"),h=a.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;h=i.domNode.getBoundingClientRect(),o>0&&(u="right")}return{bottom:h.top+h.height,height:h.height,left:h[u],right:h[u],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 n=this.normalizeNative(e);return Bs.info("getNativeRange",n),n}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&&Ms(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 n=e.map(o=>{const[a,u]=o,h=this.scroll.find(a,!0),p=h.offset(this.scroll);return u===0?p:h instanceof Et?p+h.index(a,u):p+h.length()}),s=Math.min(Math.max(...n),this.scroll.length()-1),i=Math.min(s,...n);return new Ie(i,s-i)}normalizeNative(t){if(!Ms(this.root,t.startContainer)||!t.collapsed&&!Ms(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(n=>{let{node:s,offset:i}=n;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;n.node=s,n.offset=i}),e}rangeToNative(t){const e=this.scroll.length(),n=(s,i)=>{s=Math.min(e-1,s);const[o,a]=this.scroll.leaf(s);return o?o.position(a,i):[null,-1]};return[...n(t.index,!1),...n(t.index+t.length,!0)]}setNativeRange(t,e){let n=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(Bs.info("setNativeRange",t,e,n,s),t!=null&&(this.root.parentNode==null||t.parentNode==null||n.parentNode==null))return;const o=document.getSelection();if(o!=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||n!==a.endContainer||s!==a.endOffset){t instanceof Element&&t.tagName==="BR"&&(e=Array.from(t.parentNode.childNodes).indexOf(t),t=t.parentNode),n instanceof Element&&n.tagName==="BR"&&(s=Array.from(n.parentNode.childNodes).indexOf(n),n=n.parentNode);const u=document.createRange();u.setStart(t,e),u.setEnd(n,s),o.removeAllRanges(),o.addRange(u)}}else o.removeAllRanges(),this.root.blur()}setRange(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:R.sources.API;if(typeof e=="string"&&(n=e,e=!1),Bs.info("setRange",t),t!=null){const s=this.rangeToNative(t);this.setNativeRange(...s,e)}else this.setNativeRange(null);this.update(n)}update(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:R.sources.USER;const e=this.lastRange,[n,s]=this.getRange();if(this.lastRange=n,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!ge(e,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const o=this.cursor.restore();o&&this.setNativeRange(o.startNode,o.startOffset,o.endNode,o.endOffset)}const i=[R.events.SELECTION_CHANGE,nn(this.lastRange),nn(e),t];this.emitter.emit(R.events.EDITOR_CHANGE,...i),t!==R.sources.SILENT&&this.emitter.emit(...i)}}}function Ms(r,t){try{t.parentNode}catch{return!1}return r.contains(t)}const Df=/^[ -~]*$/;class jf{constructor(t){this.scroll=t,this.delta=this.getDelta()}applyDelta(t){this.scroll.update();let e=this.scroll.length();this.scroll.batchStart();const n=dl(t),s=new B;return $f(n.ops.slice()).reduce((o,a)=>{const u=It.Op.length(a);let h=a.attributes||{},p=!1,v=!1;if(a.insert!=null){if(s.retain(u),typeof a.insert=="string"){const y=a.insert;v=!y.endsWith(`
5
+ `,Ot(r))}function Ot(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return r==null||("formats"in r&&typeof r.formats=="function"&&(t={...t,...r.formats()},e&&delete t["code-token"]),r.parent==null||r.parent.statics.blotName==="scroll"||r.parent.statics.scope!==r.statics.scope)?t:Ot(r.parent,t,e)}const _t=class _t extends Lt{static value(){}constructor(t,e,n){super(t,e),this.selection=n,this.textNode=document.createTextNode(_t.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 n=this,s=0;for(;n!=null&&n.statics.scope!==D.BLOCK_BLOT;)s+=n.offset(n.parent),n=n.parent;n!=null&&(this.savedLength=_t.CONTENTS.length,n.optimize(),n.formatAt(s,_t.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 Ut?this.prev:null,n=e?e.length():0,s=this.next instanceof Ut?this.next:null,i=s?s.text:"",{textNode:o}=this,a=o.data.split(_t.CONTENTS).join("");o.data=_t.CONTENTS;let u;if(e)u=e,(a||s)&&(e.insertAt(e.length(),a+i),s&&s.remove());else if(s)u=s,s.insertAt(0,a);else{const h=document.createTextNode(a);u=this.scroll.create(h),this.parent.insertBefore(u,this)}if(this.remove(),t){const h=(f,m)=>e&&f===e.domNode?m:f===o?n+m-1:s&&f===s.domNode?n+a.length+m:null,p=h(t.start.node,t.start.offset),v=h(t.end.node,t.end.offset);if(p!==null&&v!==null)return{startNode:u.domNode,startOffset:p,endNode:u.domNode,endOffset:v}}return null}update(t,e){if(t.some(n=>n.type==="characterData"&&n.target===this.textNode)){const n=this.restore();n&&(e.range=n)}}optimize(t){super.optimize(t);let{parent:e}=this;for(;e;){if(e.domNode.tagName==="A"){this.savedLength=_t.CONTENTS.length,e.isolate(this.offset(e),this.length()).unwrap(),this.savedLength=0;break}e=e.parent}}value(){return""}};q(_t,"blotName","cursor"),q(_t,"className","ql-cursor"),q(_t,"tagName","span"),q(_t,"CONTENTS","\uFEFF");let an=_t;var Rs={exports:{}},fl;function If(){return fl||(fl=1,(function(r){var t=Object.prototype.hasOwnProperty,e="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(e=!1));function s(u,h,p){this.fn=u,this.context=h,this.once=p||!1}function i(u,h,p,v,f){if(typeof p!="function")throw new TypeError("The listener must be a function");var m=new s(p,v||u,f),y=e?e+h:h;return u._events[y]?u._events[y].fn?u._events[y]=[u._events[y],m]:u._events[y].push(m):(u._events[y]=m,u._eventsCount++),u}function o(u,h){--u._eventsCount===0?u._events=new n:delete u._events[h]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var h=[],p,v;if(this._eventsCount===0)return h;for(v in p=this._events)t.call(p,v)&&h.push(e?v.slice(1):v);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(p)):h},a.prototype.listeners=function(h){var p=e?e+h:h,v=this._events[p];if(!v)return[];if(v.fn)return[v.fn];for(var f=0,m=v.length,y=new Array(m);f<m;f++)y[f]=v[f].fn;return y},a.prototype.listenerCount=function(h){var p=e?e+h:h,v=this._events[p];return v?v.fn?1:v.length:0},a.prototype.emit=function(h,p,v,f,m,y){var A=e?e+h:h;if(!this._events[A])return!1;var w=this._events[A],x=arguments.length,C,M;if(w.fn){switch(w.once&&this.removeListener(h,w.fn,void 0,!0),x){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,p),!0;case 3:return w.fn.call(w.context,p,v),!0;case 4:return w.fn.call(w.context,p,v,f),!0;case 5:return w.fn.call(w.context,p,v,f,m),!0;case 6:return w.fn.call(w.context,p,v,f,m,y),!0}for(M=1,C=new Array(x-1);M<x;M++)C[M-1]=arguments[M];w.fn.apply(w.context,C)}else{var z=w.length,U;for(M=0;M<z;M++)switch(w[M].once&&this.removeListener(h,w[M].fn,void 0,!0),x){case 1:w[M].fn.call(w[M].context);break;case 2:w[M].fn.call(w[M].context,p);break;case 3:w[M].fn.call(w[M].context,p,v);break;case 4:w[M].fn.call(w[M].context,p,v,f);break;default:if(!C)for(U=1,C=new Array(x-1);U<x;U++)C[U-1]=arguments[U];w[M].fn.apply(w[M].context,C)}}return!0},a.prototype.on=function(h,p,v){return i(this,h,p,v,!1)},a.prototype.once=function(h,p,v){return i(this,h,p,v,!0)},a.prototype.removeListener=function(h,p,v,f){var m=e?e+h:h;if(!this._events[m])return this;if(!p)return o(this,m),this;var y=this._events[m];if(y.fn)y.fn===p&&(!f||y.once)&&(!v||y.context===v)&&o(this,m);else{for(var A=0,w=[],x=y.length;A<x;A++)(y[A].fn!==p||f&&!y[A].once||v&&y[A].context!==v)&&w.push(y[A]);w.length?this._events[m]=w.length===1?w[0]:w:o(this,m)}return this},a.prototype.removeAllListeners=function(h){var p;return h?(p=e?e+h:h,this._events[p]&&o(this,p)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=e,a.EventEmitter=a,r.exports=a})(Rs)),Rs.exports}var Rf=If();const kf=Bl(Rf),ti=new WeakMap,ei=["error","warn","log","info"];let ni="warn";function bo(r){if(ni&&ei.indexOf(r)<=ei.indexOf(ni)){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];console[r](...e)}}function ue(r){return ei.reduce((t,e)=>(t[e]=bo.bind(console,e,r),t),{})}ue.level=r=>{ni=r};bo.level=ue.level;const ks=ue("quill:events"),Bf=["selectionchange","mousedown","mouseup","click"];Bf.forEach(r=>{document.addEventListener(r,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];Array.from(document.querySelectorAll(".ql-container")).forEach(s=>{const i=ti.get(s);i&&i.emitter&&i.emitter.handleDOM(...e)})})});class R extends kf{constructor(){super(),this.domListeners={},this.on("error",ks.error)}emit(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return ks.log.call(ks,...e),super.emit(...e)}handleDOM(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),s=1;s<e;s++)n[s-1]=arguments[s];(this.domListeners[t.type]||[]).forEach(i=>{let{node:o,handler:a}=i;(t.target===o||o.contains(t.target))&&a(t,...n)})}listenDOM(t,e,n){this.domListeners[t]||(this.domListeners[t]=[]),this.domListeners[t].push({node:e,handler:n})}}q(R,"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"}),q(R,"sources",{API:"api",SILENT:"silent",USER:"user"});const Bs=ue("quill:selection");class Ie{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=t,this.length=e}}class Mf{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 Ie(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,R.sources.USER),1)}),this.emitter.on(R.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const n=this.getNativeRange();n!=null&&n.start.node!==this.cursor.textNode&&this.emitter.once(R.events.SCROLL_UPDATE,(s,i)=>{try{this.root.contains(n.start.node)&&this.root.contains(n.end.node)&&this.setNativeRange(n.start.node,n.start.offset,n.end.node,n.end.offset);const o=i.some(a=>a.type==="characterData"||a.type==="childList"||a.type==="attributes"&&a.target===this.root);this.update(o?R.sources.SILENT:s)}catch{}})}),this.emitter.on(R.events.SCROLL_OPTIMIZE,(n,s)=>{if(s.range){const{startNode:i,startOffset:o,endNode:a,endOffset:u}=s.range;this.setNativeRange(i,o,a,u),this.update(R.sources.SILENT)}}),this.update(R.sources.SILENT)}handleComposition(){this.emitter.on(R.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(R.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(R.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(t,e){this.scroll.update();const n=this.getNativeRange();if(!(n==null||!n.native.collapsed||this.scroll.query(t,D.BLOCK))){if(n.start.node!==this.cursor.textNode){const s=this.scroll.find(n.start.node,!1);if(s==null)return;if(s instanceof Et){const i=s.split(n.start.offset);s.parent.insertBefore(this.cursor,i)}else s.insertBefore(this.cursor,n.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 n=this.scroll.length();t=Math.min(t,n-1),e=Math.min(t+e,n-1)-t;let s,[i,o]=this.scroll.leaf(t);if(i==null)return null;if(e>0&&o===i.length()){const[p]=this.scroll.leaf(t+1);if(p){const[v]=this.scroll.line(t),[f]=this.scroll.line(t+1);v===f&&(i=p,o=0)}}[s,o]=i.position(o,!0);const a=document.createRange();if(e>0)return a.setStart(s,o),[i,o]=this.scroll.leaf(t+e),i==null?null:([s,o]=i.position(o,!0),a.setEnd(s,o),a.getBoundingClientRect());let u="left",h;if(s instanceof Text){if(!s.data.length)return null;o<s.data.length?(a.setStart(s,o),a.setEnd(s,o+1)):(a.setStart(s,o-1),a.setEnd(s,o),u="right"),h=a.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;h=i.domNode.getBoundingClientRect(),o>0&&(u="right")}return{bottom:h.top+h.height,height:h.height,left:h[u],right:h[u],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 n=this.normalizeNative(e);return Bs.info("getNativeRange",n),n}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&&Ms(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 n=e.map(o=>{const[a,u]=o,h=this.scroll.find(a,!0),p=h.offset(this.scroll);return u===0?p:h instanceof Et?p+h.index(a,u):p+h.length()}),s=Math.min(Math.max(...n),this.scroll.length()-1),i=Math.min(s,...n);return new Ie(i,s-i)}normalizeNative(t){if(!Ms(this.root,t.startContainer)||!t.collapsed&&!Ms(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(n=>{let{node:s,offset:i}=n;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;n.node=s,n.offset=i}),e}rangeToNative(t){const e=this.scroll.length(),n=(s,i)=>{s=Math.min(e-1,s);const[o,a]=this.scroll.leaf(s);return o?o.position(a,i):[null,-1]};return[...n(t.index,!1),...n(t.index+t.length,!0)]}setNativeRange(t,e){let n=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(Bs.info("setNativeRange",t,e,n,s),t!=null&&(this.root.parentNode==null||t.parentNode==null||n.parentNode==null))return;const o=document.getSelection();if(o!=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||n!==a.endContainer||s!==a.endOffset){t instanceof Element&&t.tagName==="BR"&&(e=Array.from(t.parentNode.childNodes).indexOf(t),t=t.parentNode),n instanceof Element&&n.tagName==="BR"&&(s=Array.from(n.parentNode.childNodes).indexOf(n),n=n.parentNode);const u=document.createRange();u.setStart(t,e),u.setEnd(n,s),o.removeAllRanges(),o.addRange(u)}}else o.removeAllRanges(),this.root.blur()}setRange(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:R.sources.API;if(typeof e=="string"&&(n=e,e=!1),Bs.info("setRange",t),t!=null){const s=this.rangeToNative(t);this.setNativeRange(...s,e)}else this.setNativeRange(null);this.update(n)}update(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:R.sources.USER;const e=this.lastRange,[n,s]=this.getRange();if(this.lastRange=n,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!ge(e,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const o=this.cursor.restore();o&&this.setNativeRange(o.startNode,o.startOffset,o.endNode,o.endOffset)}const i=[R.events.SELECTION_CHANGE,nn(this.lastRange),nn(e),t];this.emitter.emit(R.events.EDITOR_CHANGE,...i),t!==R.sources.SILENT&&this.emitter.emit(...i)}}}function Ms(r,t){try{t.parentNode}catch{return!1}return r.contains(t)}const Df=/^[ -~]*$/;class jf{constructor(t){this.scroll=t,this.delta=this.getDelta()}applyDelta(t){this.scroll.update();let e=this.scroll.length();this.scroll.batchStart();const n=dl(t),s=new B;return Pf(n.ops.slice()).reduce((o,a)=>{const u=It.Op.length(a);let h=a.attributes||{},p=!1,v=!1;if(a.insert!=null){if(s.retain(u),typeof a.insert=="string"){const y=a.insert;v=!y.endsWith(`
6
6
  `)&&(e<=o||!!this.scroll.descendant(Ct,o)[0]),this.scroll.insertAt(o,y);const[A,w]=this.scroll.line(o);let x=ye({},Ot(A));if(A instanceof pt){const[C]=A.descendant(Et,w);C&&(x=ye(x,Ot(C)))}h=It.AttributeMap.diff(x,h)||{}}else if(typeof a.insert=="object"){const y=Object.keys(a.insert)[0];if(y==null)return o;const A=this.scroll.query(y,D.INLINE)!=null;if(A)(e<=o||this.scroll.descendant(Ct,o)[0])&&(v=!0);else if(o>0){const[w,x]=this.scroll.descendant(Et,o-1);w instanceof Ut?w.value()[x]!==`
7
- `&&(p=!0):w instanceof Lt&&w.statics.scope===D.INLINE_BLOT&&(p=!0)}if(this.scroll.insertAt(o,y,a.insert[y]),A){const[w]=this.scroll.descendant(Et,o);if(w){const x=ye({},Ot(w));h=It.AttributeMap.diff(x,h)||{}}}}e+=u}else if(s.push(a),a.retain!==null&&typeof a.retain=="object"){const y=Object.keys(a.retain)[0];if(y==null)return o;this.scroll.updateEmbedAt(o,y,a.retain[y])}Object.keys(h).forEach(y=>{this.scroll.formatAt(o,u,y,h[y])});const f=p?1:0,m=v?1:0;return e+=f+m,s.retain(f),s.delete(m),o+u+f+m},0),s.reduce((o,a)=>typeof a.delete=="number"?(this.scroll.deleteAt(o,a.delete),o):o+It.Op.length(a),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(t,e){return this.scroll.deleteAt(t,e),this.update(new B().retain(t).delete(e))}formatLine(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(n).forEach(i=>{this.scroll.lines(t,Math.max(e,1)).forEach(o=>{o.format(i,n[i])})}),this.scroll.optimize();const s=new B().retain(t).retain(e,nn(n));return this.update(s)}formatText(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(n).forEach(i=>{this.scroll.formatAt(t,e,i,n[i])});const s=new B().retain(t).retain(e,nn(n));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 B)}getFormat(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=[],s=[];e===0?this.scroll.path(t).forEach(a=>{const[u]=a;u instanceof pt?n.push(u):u instanceof Et&&s.push(u)}):(n=this.scroll.lines(t,e),s=this.scroll.descendants(Et,t,e));const[i,o]=[n,s].map(a=>{const u=a.shift();if(u==null)return{};let h=Ot(u);for(;Object.keys(h).length>0;){const p=a.shift();if(p==null)return h;h=Pf(Ot(p),h)}return h});return{...i,...o}}getHTML(t,e){const[n,s]=this.scroll.line(t);if(n){const i=n.length();return n.length()>=s+e&&!(s===0&&e===i)?Un(n,s,e,!0):Un(this.scroll,t,e,!0)}return""}getText(t,e){return this.getContents(t,e).filter(n=>typeof n.insert=="string").map(n=>n.insert).join("")}insertContents(t,e){const n=dl(e),s=new B().retain(t).concat(n);return this.scroll.insertContents(t,n),this.update(s)}insertEmbed(t,e,n){return this.scroll.insertAt(t,e,n),this.update(new B().retain(t).insert({[e]:n}))}insertText(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e=e.replace(/\r\n/g,`
7
+ `&&(p=!0):w instanceof Lt&&w.statics.scope===D.INLINE_BLOT&&(p=!0)}if(this.scroll.insertAt(o,y,a.insert[y]),A){const[w]=this.scroll.descendant(Et,o);if(w){const x=ye({},Ot(w));h=It.AttributeMap.diff(x,h)||{}}}}e+=u}else if(s.push(a),a.retain!==null&&typeof a.retain=="object"){const y=Object.keys(a.retain)[0];if(y==null)return o;this.scroll.updateEmbedAt(o,y,a.retain[y])}Object.keys(h).forEach(y=>{this.scroll.formatAt(o,u,y,h[y])});const f=p?1:0,m=v?1:0;return e+=f+m,s.retain(f),s.delete(m),o+u+f+m},0),s.reduce((o,a)=>typeof a.delete=="number"?(this.scroll.deleteAt(o,a.delete),o):o+It.Op.length(a),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(t,e){return this.scroll.deleteAt(t,e),this.update(new B().retain(t).delete(e))}formatLine(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(n).forEach(i=>{this.scroll.lines(t,Math.max(e,1)).forEach(o=>{o.format(i,n[i])})}),this.scroll.optimize();const s=new B().retain(t).retain(e,nn(n));return this.update(s)}formatText(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(n).forEach(i=>{this.scroll.formatAt(t,e,i,n[i])});const s=new B().retain(t).retain(e,nn(n));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 B)}getFormat(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=[],s=[];e===0?this.scroll.path(t).forEach(a=>{const[u]=a;u instanceof pt?n.push(u):u instanceof Et&&s.push(u)}):(n=this.scroll.lines(t,e),s=this.scroll.descendants(Et,t,e));const[i,o]=[n,s].map(a=>{const u=a.shift();if(u==null)return{};let h=Ot(u);for(;Object.keys(h).length>0;){const p=a.shift();if(p==null)return h;h=$f(Ot(p),h)}return h});return{...i,...o}}getHTML(t,e){const[n,s]=this.scroll.line(t);if(n){const i=n.length();return n.length()>=s+e&&!(s===0&&e===i)?Un(n,s,e,!0):Un(this.scroll,t,e,!0)}return""}getText(t,e){return this.getContents(t,e).filter(n=>typeof n.insert=="string").map(n=>n.insert).join("")}insertContents(t,e){const n=dl(e),s=new B().retain(t).concat(n);return this.scroll.insertContents(t,n),this.update(s)}insertEmbed(t,e,n){return this.scroll.insertAt(t,e,n),this.update(new B().retain(t).insert({[e]:n}))}insertText(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e=e.replace(/\r\n/g,`
8
8
  `).replace(/\r/g,`
9
9
  `),this.scroll.insertAt(t,e),Object.keys(n).forEach(s=>{this.scroll.formatAt(t,e.length,s,n[s])}),this.update(new B().retain(t).insert(e,nn(n)))}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==null?void 0:t.statics.blotName)!==pt.blotName)return!1;const e=t;return e.children.length>1?!1:e.children.head instanceof Ht}removeFormat(t,e){const n=this.getText(t,e),[s,i]=this.scroll.line(t+e);let o=0,a=new B;s!=null&&(o=s.length()-i,a=s.delta().slice(i,i+o-1).insert(`
10
- `));const h=this.getContents(t,e+o).diff(new B().insert(n).concat(a)),p=new B().retain(t).concat(h);return this.applyDelta(p)}update(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=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(Df)&&this.scroll.find(e[0].target)){const i=this.scroll.find(e[0].target),o=Ot(i),a=i.offset(this.scroll),u=e[0].oldValue.replace(an.CONTENTS,""),h=new B().insert(u),p=new B().insert(i.value()),v=n&&{oldRange:gl(n.oldRange,-a),newRange:gl(n.newRange,-a)};t=new B().retain(a).concat(h.diff(p,v)).reduce((m,y)=>y.insert?m.insert(y.insert,o):m.push(y),new B),this.delta=s.compose(t)}else this.delta=this.getDelta(),(!t||!ge(s.compose(t),this.delta))&&(t=s.diff(this.delta,n));return t}}function tn(r,t,e){if(r.length===0){const[m]=Ds(e.pop());return t<=0?`</li></${m}>`:`</li></${m}>${tn([],t-1,e)}`}const[{child:n,offset:s,length:i,indent:o,type:a},...u]=r,[h,p]=Ds(a);if(o>t)return e.push(a),o===t+1?`<${h}><li${p}>${Un(n,s,i)}${tn(u,o,e)}`:`<${h}><li>${tn(r,t+1,e)}`;const v=e[e.length-1];if(o===t&&a===v)return`</li><li${p}>${Un(n,s,i)}${tn(u,o,e)}`;const[f]=Ds(e.pop());return`</li></${f}>${tn(r,t-1,e)}`}function Un(r,t,e){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in r&&typeof r.html=="function")return r.html(t,e);if(r instanceof Ut)return Mr(r.value().slice(t,t+e)).replaceAll(" ","&nbsp;");if(r instanceof $t){if(r.statics.blotName==="list-container"){const h=[];return r.children.forEachAt(t,e,(p,v,f)=>{const m="formats"in p&&typeof p.formats=="function"?p.formats():{};h.push({child:p,offset:v,length:f,indent:m.indent||0,type:m.list})}),tn(h,-1,[])}const s=[];if(r.children.forEachAt(t,e,(h,p,v)=>{s.push(Un(h,p,v))}),n||r.statics.blotName==="list")return s.join("");const{outerHTML:i,innerHTML:o}=r.domNode,[a,u]=i.split(`>${o}<`);return a==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${u}`:`${a}>${s.join("")}<${u}`}return r.domNode instanceof Element?r.domNode.outerHTML:""}function Pf(r,t){return Object.keys(t).reduce((e,n)=>{if(r[n]==null)return e;const s=t[n];return s===r[n]?e[n]=s:Array.isArray(s)?s.indexOf(r[n])<0?e[n]=s.concat([r[n]]):e[n]=s:e[n]=[s,r[n]],e},{})}function Ds(r){const t=r==="ordered"?"ol":"ul";switch(r){case"checked":return[t,' data-list="checked"'];case"unchecked":return[t,' data-list="unchecked"'];default:return[t,""]}}function dl(r){return r.reduce((t,e)=>{if(typeof e.insert=="string"){const n=e.insert.replace(/\r\n/g,`
10
+ `));const h=this.getContents(t,e+o).diff(new B().insert(n).concat(a)),p=new B().retain(t).concat(h);return this.applyDelta(p)}update(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=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(Df)&&this.scroll.find(e[0].target)){const i=this.scroll.find(e[0].target),o=Ot(i),a=i.offset(this.scroll),u=e[0].oldValue.replace(an.CONTENTS,""),h=new B().insert(u),p=new B().insert(i.value()),v=n&&{oldRange:gl(n.oldRange,-a),newRange:gl(n.newRange,-a)};t=new B().retain(a).concat(h.diff(p,v)).reduce((m,y)=>y.insert?m.insert(y.insert,o):m.push(y),new B),this.delta=s.compose(t)}else this.delta=this.getDelta(),(!t||!ge(s.compose(t),this.delta))&&(t=s.diff(this.delta,n));return t}}function tn(r,t,e){if(r.length===0){const[m]=Ds(e.pop());return t<=0?`</li></${m}>`:`</li></${m}>${tn([],t-1,e)}`}const[{child:n,offset:s,length:i,indent:o,type:a},...u]=r,[h,p]=Ds(a);if(o>t)return e.push(a),o===t+1?`<${h}><li${p}>${Un(n,s,i)}${tn(u,o,e)}`:`<${h}><li>${tn(r,t+1,e)}`;const v=e[e.length-1];if(o===t&&a===v)return`</li><li${p}>${Un(n,s,i)}${tn(u,o,e)}`;const[f]=Ds(e.pop());return`</li></${f}>${tn(r,t-1,e)}`}function Un(r,t,e){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in r&&typeof r.html=="function")return r.html(t,e);if(r instanceof Ut)return Mr(r.value().slice(t,t+e)).replaceAll(" ","&nbsp;");if(r instanceof Pt){if(r.statics.blotName==="list-container"){const h=[];return r.children.forEachAt(t,e,(p,v,f)=>{const m="formats"in p&&typeof p.formats=="function"?p.formats():{};h.push({child:p,offset:v,length:f,indent:m.indent||0,type:m.list})}),tn(h,-1,[])}const s=[];if(r.children.forEachAt(t,e,(h,p,v)=>{s.push(Un(h,p,v))}),n||r.statics.blotName==="list")return s.join("");const{outerHTML:i,innerHTML:o}=r.domNode,[a,u]=i.split(`>${o}<`);return a==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${u}`:`${a}>${s.join("")}<${u}`}return r.domNode instanceof Element?r.domNode.outerHTML:""}function $f(r,t){return Object.keys(t).reduce((e,n)=>{if(r[n]==null)return e;const s=t[n];return s===r[n]?e[n]=s:Array.isArray(s)?s.indexOf(r[n])<0?e[n]=s.concat([r[n]]):e[n]=s:e[n]=[s,r[n]],e},{})}function Ds(r){const t=r==="ordered"?"ol":"ul";switch(r){case"checked":return[t,' data-list="checked"'];case"unchecked":return[t,' data-list="unchecked"'];default:return[t,""]}}function dl(r){return r.reduce((t,e)=>{if(typeof e.insert=="string"){const n=e.insert.replace(/\r\n/g,`
11
11
  `).replace(/\r/g,`
12
- `);return t.insert(n,e.attributes)}return t.push(e)},new B)}function gl(r,t){let{index:e,length:n}=r;return new Ie(e+t,n)}function $f(r){const t=[];return r.forEach(e=>{typeof e.insert=="string"?e.insert.split(`
12
+ `);return t.insert(n,e.attributes)}return t.push(e)},new B)}function gl(r,t){let{index:e,length:n}=r;return new Ie(e+t,n)}function Pf(r){const t=[];return r.forEach(e=>{typeof e.insert=="string"?e.insert.split(`
13
13
  `).forEach((s,i)=>{i&&t.push({insert:`
14
- `,attributes:e.attributes}),s&&t.push({insert:s,attributes:e.attributes})}):t.push(e)}),t}class zt{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=t,this.options=e}}q(zt,"DEFAULTS",{});const vr="\uFEFF";class vi extends Lt{constructor(t,e){super(t,e),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(n=>{this.contentNode.appendChild(n)}),this.leftGuard=document.createTextNode(vr),this.rightGuard=document.createTextNode(vr),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,n;const s=t.data.split(vr).join("");if(t===this.leftGuard)if(this.prev instanceof Ut){const i=this.prev.length();this.prev.insertAt(i,s),e={startNode:this.prev.domNode,startOffset:i+s.length}}else n=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(n),this),e={startNode:n,startOffset:s.length};else t===this.rightGuard&&(this.next instanceof Ut?(this.next.insertAt(0,s),e={startNode:this.next.domNode,startOffset:s.length}):(n=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(n),this.next),e={startNode:n,startOffset:s.length}));return t.data=vr,e}update(t,e){t.forEach(n=>{if(n.type==="characterData"&&(n.target===this.leftGuard||n.target===this.rightGuard)){const s=this.restore(n.target);s&&(e.range=s)}})}}class Uf{constructor(t,e){q(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 vi)&&(this.emitter.emit(R.events.COMPOSITION_BEFORE_START,t),this.scroll.batchStart(),this.emitter.emit(R.events.COMPOSITION_START,t),this.isComposing=!0)}handleCompositionEnd(t){this.emitter.emit(R.events.COMPOSITION_BEFORE_END,t),this.scroll.batchEnd(),this.emitter.emit(R.events.COMPOSITION_END,t),this.isComposing=!1}}const Bn=class Bn{constructor(t,e){q(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]}};q(Bn,"DEFAULTS",{modules:{}}),q(Bn,"themes",{default:Bn});let cn=Bn;const Ff=r=>r.parentElement||r.getRootNode().host||null,Hf=r=>{const t=r.getBoundingClientRect(),e="offsetWidth"in r&&Math.abs(t.width)/r.offsetWidth||1,n="offsetHeight"in r&&Math.abs(t.height)/r.offsetHeight||1;return{top:t.top,right:t.left+r.clientWidth*e,bottom:t.top+r.clientHeight*n,left:t.left}},Er=r=>{const t=parseInt(r,10);return Number.isNaN(t)?0:t},pl=(r,t,e,n,s,i)=>r<e&&t>n?0:r<e?-(e-r+s):t>n?t-r>n-e?r+s-e:t-n+i:0,zf=(r,t)=>{var i,o,a;const e=r.ownerDocument;let n=t,s=r;for(;s;){const u=s===e.body,h=u?{top:0,right:((i=window.visualViewport)==null?void 0:i.width)??e.documentElement.clientWidth,bottom:((o=window.visualViewport)==null?void 0:o.height)??e.documentElement.clientHeight,left:0}:Hf(s),p=getComputedStyle(s),v=pl(n.left,n.right,h.left,h.right,Er(p.scrollPaddingLeft),Er(p.scrollPaddingRight)),f=pl(n.top,n.bottom,h.top,h.bottom,Er(p.scrollPaddingTop),Er(p.scrollPaddingBottom));if(v||f)if(u)(a=e.defaultView)==null||a.scrollBy(v,f);else{const{scrollLeft:m,scrollTop:y}=s;f&&(s.scrollTop+=f),v&&(s.scrollLeft+=v);const A=s.scrollLeft-m,w=s.scrollTop-y;n={left:n.left-A,top:n.top-w,right:n.right-A,bottom:n.bottom-w}}s=u||p.position==="fixed"?null:Ff(s)}},Kf=100,Gf=["block","break","cursor","inline","scroll","text"],Vf=(r,t,e)=>{const n=new on;return Gf.forEach(s=>{const i=t.query(s);i&&n.register(i)}),r.forEach(s=>{let i=t.query(s);i||e.error(`Cannot register "${s}" specified in "formats" config. Are you sure it was registered?`);let o=0;for(;i;)if(n.register(i),i="blotName"in i?i.requiredContainer??null:null,o+=1,o>Kf){e.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),n},sn=ue("quill"),Ar=new on;$t.uiClass="ql-ui";const Dt=class Dt{static debug(t){t===!0&&(t="log"),ue.level(t)}static find(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return ti.get(t)||Ar.find(t,e)}static import(t){return this.imports[t]==null&&sn.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]),n="attrName"in t?t.attrName:t.blotName;typeof n=="string"?this.register(`formats/${n}`,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],n=!!(!(arguments.length<=2)&&arguments[2]);this.imports[t]!=null&&!n&&sn.warn(`Overwriting ${t} with`,e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&e&&typeof e!="boolean"&&e.blotName!=="abstract"&&Ar.register(e),typeof e.register=="function"&&e.register(Ar)}}constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=Wf(t,e),this.container=this.options.container,this.container==null){sn.error("Invalid Quill container",t);return}this.options.debug&&Dt.debug(this.options.debug);const n=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",ti.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new R;const s=yi.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 jf(this.scroll),this.selection=new Mf(this.scroll,this.emitter),this.composition=new Uf(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(R.events.EDITOR_CHANGE,o=>{o===R.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(R.events.SCROLL_UPDATE,(o,a)=>{const u=this.selection.lastRange,[h]=this.selection.getRange(),p=u&&h?{oldRange:u,newRange:h}:void 0;Mt.call(this,()=>this.editor.update(null,a,p),o)}),this.emitter.on(R.events.SCROLL_EMBED_UPDATE,(o,a)=>{const u=this.selection.lastRange,[h]=this.selection.getRange(),p=u&&h?{oldRange:u,newRange:h}:void 0;Mt.call(this,()=>{const v=new B().retain(o.offset(this)).retain({[o.statics.blotName]:a});return this.editor.update(v,[],p)},Dt.sources.USER)}),n){const o=this.clipboard.convert({html:`${n}<p><br></p>`,text:`
14
+ `,attributes:e.attributes}),s&&t.push({insert:s,attributes:e.attributes})}):t.push(e)}),t}class zt{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=t,this.options=e}}q(zt,"DEFAULTS",{});const vr="\uFEFF";class vi extends Lt{constructor(t,e){super(t,e),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(n=>{this.contentNode.appendChild(n)}),this.leftGuard=document.createTextNode(vr),this.rightGuard=document.createTextNode(vr),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,n;const s=t.data.split(vr).join("");if(t===this.leftGuard)if(this.prev instanceof Ut){const i=this.prev.length();this.prev.insertAt(i,s),e={startNode:this.prev.domNode,startOffset:i+s.length}}else n=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(n),this),e={startNode:n,startOffset:s.length};else t===this.rightGuard&&(this.next instanceof Ut?(this.next.insertAt(0,s),e={startNode:this.next.domNode,startOffset:s.length}):(n=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(n),this.next),e={startNode:n,startOffset:s.length}));return t.data=vr,e}update(t,e){t.forEach(n=>{if(n.type==="characterData"&&(n.target===this.leftGuard||n.target===this.rightGuard)){const s=this.restore(n.target);s&&(e.range=s)}})}}class Uf{constructor(t,e){q(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 vi)&&(this.emitter.emit(R.events.COMPOSITION_BEFORE_START,t),this.scroll.batchStart(),this.emitter.emit(R.events.COMPOSITION_START,t),this.isComposing=!0)}handleCompositionEnd(t){this.emitter.emit(R.events.COMPOSITION_BEFORE_END,t),this.scroll.batchEnd(),this.emitter.emit(R.events.COMPOSITION_END,t),this.isComposing=!1}}const Bn=class Bn{constructor(t,e){q(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]}};q(Bn,"DEFAULTS",{modules:{}}),q(Bn,"themes",{default:Bn});let cn=Bn;const Ff=r=>r.parentElement||r.getRootNode().host||null,Hf=r=>{const t=r.getBoundingClientRect(),e="offsetWidth"in r&&Math.abs(t.width)/r.offsetWidth||1,n="offsetHeight"in r&&Math.abs(t.height)/r.offsetHeight||1;return{top:t.top,right:t.left+r.clientWidth*e,bottom:t.top+r.clientHeight*n,left:t.left}},Er=r=>{const t=parseInt(r,10);return Number.isNaN(t)?0:t},pl=(r,t,e,n,s,i)=>r<e&&t>n?0:r<e?-(e-r+s):t>n?t-r>n-e?r+s-e:t-n+i:0,zf=(r,t)=>{var i,o,a;const e=r.ownerDocument;let n=t,s=r;for(;s;){const u=s===e.body,h=u?{top:0,right:((i=window.visualViewport)==null?void 0:i.width)??e.documentElement.clientWidth,bottom:((o=window.visualViewport)==null?void 0:o.height)??e.documentElement.clientHeight,left:0}:Hf(s),p=getComputedStyle(s),v=pl(n.left,n.right,h.left,h.right,Er(p.scrollPaddingLeft),Er(p.scrollPaddingRight)),f=pl(n.top,n.bottom,h.top,h.bottom,Er(p.scrollPaddingTop),Er(p.scrollPaddingBottom));if(v||f)if(u)(a=e.defaultView)==null||a.scrollBy(v,f);else{const{scrollLeft:m,scrollTop:y}=s;f&&(s.scrollTop+=f),v&&(s.scrollLeft+=v);const A=s.scrollLeft-m,w=s.scrollTop-y;n={left:n.left-A,top:n.top-w,right:n.right-A,bottom:n.bottom-w}}s=u||p.position==="fixed"?null:Ff(s)}},Kf=100,Gf=["block","break","cursor","inline","scroll","text"],Vf=(r,t,e)=>{const n=new on;return Gf.forEach(s=>{const i=t.query(s);i&&n.register(i)}),r.forEach(s=>{let i=t.query(s);i||e.error(`Cannot register "${s}" specified in "formats" config. Are you sure it was registered?`);let o=0;for(;i;)if(n.register(i),i="blotName"in i?i.requiredContainer??null:null,o+=1,o>Kf){e.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),n},sn=ue("quill"),Ar=new on;Pt.uiClass="ql-ui";const Dt=class Dt{static debug(t){t===!0&&(t="log"),ue.level(t)}static find(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return ti.get(t)||Ar.find(t,e)}static import(t){return this.imports[t]==null&&sn.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]),n="attrName"in t?t.attrName:t.blotName;typeof n=="string"?this.register(`formats/${n}`,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],n=!!(!(arguments.length<=2)&&arguments[2]);this.imports[t]!=null&&!n&&sn.warn(`Overwriting ${t} with`,e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&e&&typeof e!="boolean"&&e.blotName!=="abstract"&&Ar.register(e),typeof e.register=="function"&&e.register(Ar)}}constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=Wf(t,e),this.container=this.options.container,this.container==null){sn.error("Invalid Quill container",t);return}this.options.debug&&Dt.debug(this.options.debug);const n=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",ti.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new R;const s=yi.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 jf(this.scroll),this.selection=new Mf(this.scroll,this.emitter),this.composition=new Uf(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(R.events.EDITOR_CHANGE,o=>{o===R.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(R.events.SCROLL_UPDATE,(o,a)=>{const u=this.selection.lastRange,[h]=this.selection.getRange(),p=u&&h?{oldRange:u,newRange:h}:void 0;Mt.call(this,()=>this.editor.update(null,a,p),o)}),this.emitter.on(R.events.SCROLL_EMBED_UPDATE,(o,a)=>{const u=this.selection.lastRange,[h]=this.selection.getRange(),p=u&&h?{oldRange:u,newRange:h}:void 0;Mt.call(this,()=>{const v=new B().retain(o.offset(this)).retain({[o.statics.blotName]:a});return this.editor.update(v,[],p)},Dt.sources.USER)}),n){const o=this.clipboard.convert({html:`${n}<p><br></p>`,text:`
15
15
  `});this.setContents(o)}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 n=t;t=document.createElement("div"),t.classList.add(n)}return this.container.insertBefore(t,e),t}blur(){this.selection.setRange(null)}deleteText(t,e,n){return[t,e,,n]=ie(t,e,n),Mt.call(this,()=>this.editor.deleteText(t,e),n,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 n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:R.sources.API;return Mt.call(this,()=>{const s=this.getSelection(!0);let i=new B;if(s==null)return i;if(this.scroll.query(t,D.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,R.sources.SILENT),i},n)}formatLine(t,e,n,s,i){let o;return[t,e,o,i]=ie(t,e,n,s,i),Mt.call(this,()=>this.editor.formatLine(t,e,o),i,t,0)}formatText(t,e,n,s,i){let o;return[t,e,o,i]=ie(t,e,n,s,i),Mt.call(this,()=>this.editor.formatText(t,e,o),i,t,0)}getBounds(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=null;if(typeof t=="number"?n=this.selection.getBounds(t,e):n=this.selection.getBounds(t.index,t.length),!n)return null;const s=this.container.getBoundingClientRect();return{bottom:n.bottom-s.top,height:n.height,left:n.left-s.left,right:n.right-s.left,top:n.top-s.top,width:n.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]=ie(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]=ie(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]=ie(t,e),this.editor.getText(t,e)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,e,n){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Dt.sources.API;return Mt.call(this,()=>this.editor.insertEmbed(t,e,n),s,t)}insertText(t,e,n,s,i){let o;return[t,,o,i]=ie(t,0,n,s,i),Mt.call(this,()=>this.editor.insertText(t,e,o),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,n){return[t,e,,n]=ie(t,e,n),Mt.call(this,()=>this.editor.removeFormat(t,e),n,t)}scrollRectIntoView(t){zf(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]:R.sources.API;return Mt.call(this,()=>{t=new B(t);const n=this.getLength(),s=this.editor.deleteText(0,n),i=this.editor.insertContents(0,t),o=this.editor.deleteText(this.getLength()-1,1);return s.compose(i).compose(o)},e)}setSelection(t,e,n){t==null?this.selection.setRange(null,e||Dt.sources.API):([t,e,,n]=ie(t,e,n),this.selection.setRange(new Ie(Math.max(0,t),e),n),n!==R.sources.SILENT&&this.scrollSelectionIntoView())}setText(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:R.sources.API;const n=new B().insert(t);return this.setContents(n,e)}update(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:R.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]:R.sources.API;return Mt.call(this,()=>(t=new B(t),this.editor.applyDelta(t)),e,!0)}};q(Dt,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:Ar,theme:"default"}),q(Dt,"events",R.events),q(Dt,"sources",R.sources),q(Dt,"version","2.0.3"),q(Dt,"imports",{delta:B,parchment:Lf,"core/module":zt,"core/theme":cn});let N=Dt;function ml(r){return typeof r=="string"?document.querySelector(r):r}function js(r){return Object.entries(r??{}).reduce((t,e)=>{let[n,s]=e;return{...t,[n]:s===!0?{}:s}},{})}function bl(r){return Object.fromEntries(Object.entries(r).filter(t=>t[1]!==void 0))}function Wf(r,t){const e=ml(r);if(!e)throw new Error("Invalid Quill container");const s=!t.theme||t.theme===N.DEFAULTS.theme?cn:N.import(`themes/${t.theme}`);if(!s)throw new Error(`Invalid theme ${t.theme}. Did you register it?`);const{modules:i,...o}=N.DEFAULTS,{modules:a,...u}=s.DEFAULTS;let h=js(t.modules);h!=null&&h.toolbar&&h.toolbar.constructor!==Object&&(h={...h,toolbar:{container:h.toolbar}});const p=ye({},js(i),js(a),h),v={...o,...bl(u),...bl(t)};let f=t.registry;return f?t.formats&&sn.warn('Ignoring "formats" option because "registry" is specified'):f=t.formats?Vf(t.formats,v.registry,sn):v.registry,{...v,registry:f,container:e,theme:s,modules:Object.entries(p).reduce((m,y)=>{let[A,w]=y;if(!w)return m;const x=N.import(`modules/${A}`);return x==null?(sn.error(`Cannot load ${A} module. Are you sure you registered it?`),m):{...m,[A]:ye({},x.DEFAULTS||{},w)}},{}),bounds:ml(v.bounds)}}function Mt(r,t,e,n){if(!this.isEnabled()&&t===R.sources.USER&&!this.allowReadOnlyEdits)return new B;let s=e==null?null:this.getSelection();const i=this.editor.delta,o=r();if(s!=null&&(e===!0&&(e=s.index),n==null?s=yl(s,o,t):n!==0&&(s=yl(s,e,n,t)),this.setSelection(s,R.sources.SILENT)),o.length()>0){const a=[R.events.TEXT_CHANGE,o,i,t];this.emitter.emit(R.events.EDITOR_CHANGE,...a),t!==R.sources.SILENT&&this.emitter.emit(...a)}return o}function ie(r,t,e,n,s){let i={};return typeof r.index=="number"&&typeof r.length=="number"?typeof t!="number"?(s=n,n=e,e=t,t=r.length,r=r.index):(t=r.length,r=r.index):typeof t!="number"&&(s=n,n=e,e=t,t=0),typeof e=="object"?(i=e,s=n):typeof e=="string"&&(n!=null?i[e]=n:s=e),s=s||R.sources.API,[r,t,i,s]}function yl(r,t,e,n){const s=typeof e=="number"?e:0;if(r==null)return null;let i,o;return t&&typeof t.transformPosition=="function"?[i,o]=[r.index,r.index+r.length].map(a=>t.transformPosition(a,n!==R.sources.USER)):[i,o]=[r.index,r.index+r.length].map(a=>a<t||a===t&&n===R.sources.USER?a:s>=0?a+s:Math.max(t,a+s)),new Ie(i,o-i)}class Me extends Br{}function vl(r){return r instanceof pt||r instanceof Ct}function El(r){return typeof r.updateContent=="function"}class en extends yi{constructor(t,e,n){let{emitter:s}=n;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(R.events.SCROLL_BLOT_MOUNT,t)}emitUnmount(t){this.emitter.emit(R.events.SCROLL_BLOT_UNMOUNT,t)}emitEmbedUpdate(t,e){this.emitter.emit(R.events.SCROLL_EMBED_UPDATE,t,e)}deleteAt(t,e){const[n,s]=this.line(t),[i]=this.line(t+e);if(super.deleteAt(t,e),i!=null&&n!==i&&s>0){if(n instanceof Ct||i instanceof Ct){this.optimize();return}const o=i.children.head instanceof Ht?null:i.children.head;n.moveChildren(i,o),n.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,n,s){super.formatAt(t,e,n,s),this.optimize()}insertAt(t,e,n){if(t>=this.length())if(n==null||this.scroll.query(e,D.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),n==null&&e.endsWith(`
16
16
  `)?s.insertAt(0,e.slice(0,-1),n):s.insertAt(0,e,n)}else{const s=this.scroll.create(e,n);this.appendChild(s)}else super.insertAt(t,e,n);this.optimize()}insertBefore(t,e){if(t.statics.scope===D.INLINE_BLOT){const n=this.scroll.create(this.statics.defaultChild.blotName);n.appendChild(t),super.insertBefore(n,e)}else super.insertBefore(t,e)}insertContents(t,e){const n=this.deltaToRenderBlocks(e.concat(new B().insert(`
17
- `))),s=n.pop();if(s==null)return;this.batchStart();const i=n.shift();if(i){const u=i.type==="block"&&(i.delta.length()===0||!this.descendant(Ct,t)[0]&&t<this.length()),h=i.type==="block"?i.delta:new B().insert({[i.key]:i.value});Ps(this,t,h);const p=i.type==="block"?1:0,v=t+h.length()+p;u&&this.insertAt(v-1,`
18
- `);const f=Ot(this.line(t)[0]),m=It.AttributeMap.diff(f,i.attributes)||{};Object.keys(m).forEach(y=>{this.formatAt(v-1,1,y,m[y])}),t=v}let[o,a]=this.children.find(t);if(n.length&&(o&&(o=o.split(a),a=0),n.forEach(u=>{if(u.type==="block"){const h=this.createBlock(u.attributes,o||void 0);Ps(h,0,u.delta)}else{const h=this.create(u.key,u.value);this.insertBefore(h,o||void 0),Object.keys(u.attributes).forEach(p=>{h.format(p,u.attributes[p])})}})),s.type==="block"&&s.delta.length()){const u=o?o.offset(o.scroll)+a:this.length();Ps(this,u,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[n,s]=e;return n instanceof Et?[n,s]:[null,-1]}line(t){return t===this.length()?this.line(t-1):this.descendant(vl,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 n=(s,i,o)=>{let a=[],u=o;return s.children.forEachAt(i,o,(h,p,v)=>{vl(h)?a.push(h):h instanceof Br&&(a=a.concat(n(h,p,u))),u-=v}),a};return n(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(R.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=R.sources.USER;typeof t=="string"&&(e=t),Array.isArray(t)||(t=this.observer.takeRecords()),t=t.filter(n=>{let{target:s}=n;const i=this.find(s,!0);return i&&!El(i)}),t.length>0&&this.emitter.emit(R.events.SCROLL_BEFORE_UPDATE,e,t),super.update(t.concat([])),t.length>0&&this.emitter.emit(R.events.SCROLL_UPDATE,e,t)}updateEmbedAt(t,e,n){const[s]=this.descendant(i=>i instanceof Ct,t);s&&s.statics.blotName===e&&El(s)&&s.updateContent(n)}handleDragStart(t){t.preventDefault()}deltaToRenderBlocks(t){const e=[];let n=new B;return t.forEach(s=>{const i=s==null?void 0:s.insert;if(i)if(typeof i=="string"){const o=i.split(`
19
- `);o.slice(0,-1).forEach(u=>{n.insert(u,s.attributes),e.push({type:"block",delta:n,attributes:s.attributes??{}}),n=new B});const a=o[o.length-1];a&&n.insert(a,s.attributes)}else{const o=Object.keys(i)[0];if(!o)return;this.query(o,D.INLINE)?n.push(s):(n.length()&&e.push({type:"block",delta:n,attributes:{}}),n=new B,e.push({type:"blockEmbed",key:o,value:i[o],attributes:s.attributes??{}}))}}),n.length()&&e.push({type:"block",delta:n,attributes:{}}),e}createBlock(t,e){let n;const s={};Object.entries(t).forEach(a=>{let[u,h]=a;this.query(u,D.BLOCK&D.BLOT)!=null?n=u:s[u]=h});const i=this.create(n||this.statics.defaultChild.blotName,n?t[n]:void 0);this.insertBefore(i,e||void 0);const o=i.length();return Object.entries(s).forEach(a=>{let[u,h]=a;i.formatAt(0,o,u,h)}),i}}q(en,"blotName","scroll"),q(en,"className","ql-editor"),q(en,"tagName","DIV"),q(en,"defaultChild",pt),q(en,"allowedChildren",[pt,Ct,Me]);function Ps(r,t,e){e.reduce((n,s)=>{const i=It.Op.length(s);let o=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const a=s.insert;r.insertAt(n,a);const[u]=r.descendant(Et,n),h=Ot(u);o=It.AttributeMap.diff(h,o)||{}}else if(typeof s.insert=="object"){const a=Object.keys(s.insert)[0];if(a==null)return n;if(r.insertAt(n,a,s.insert[a]),r.scroll.query(a,D.INLINE)!=null){const[h]=r.descendant(Et,n),p=Ot(h);o=It.AttributeMap.diff(p,o)||{}}}}return Object.keys(o).forEach(a=>{r.formatAt(n,i,a,o[a])}),n+i},t)}const Ei={scope:D.BLOCK,whitelist:["right","center","justify"]},Zf=new Qt("align","align",Ei),yo=new Ft("align","ql-align",Ei),vo=new Ae("align","text-align",Ei);class Eo extends Ae{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 Xf=new Ft("color","ql-color",{scope:D.INLINE}),Ai=new Eo("color","color",{scope:D.INLINE}),Yf=new Ft("background","ql-bg",{scope:D.INLINE}),Ni=new Eo("background","background-color",{scope:D.INLINE});class De extends Me{static create(t){const e=super.create(t);return e.setAttribute("spellcheck","false"),e}code(t,e){return this.children.map(n=>n.length()<=1?"":n.domNode.innerText).join(`
17
+ `))),s=n.pop();if(s==null)return;this.batchStart();const i=n.shift();if(i){const u=i.type==="block"&&(i.delta.length()===0||!this.descendant(Ct,t)[0]&&t<this.length()),h=i.type==="block"?i.delta:new B().insert({[i.key]:i.value});$s(this,t,h);const p=i.type==="block"?1:0,v=t+h.length()+p;u&&this.insertAt(v-1,`
18
+ `);const f=Ot(this.line(t)[0]),m=It.AttributeMap.diff(f,i.attributes)||{};Object.keys(m).forEach(y=>{this.formatAt(v-1,1,y,m[y])}),t=v}let[o,a]=this.children.find(t);if(n.length&&(o&&(o=o.split(a),a=0),n.forEach(u=>{if(u.type==="block"){const h=this.createBlock(u.attributes,o||void 0);$s(h,0,u.delta)}else{const h=this.create(u.key,u.value);this.insertBefore(h,o||void 0),Object.keys(u.attributes).forEach(p=>{h.format(p,u.attributes[p])})}})),s.type==="block"&&s.delta.length()){const u=o?o.offset(o.scroll)+a:this.length();$s(this,u,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[n,s]=e;return n instanceof Et?[n,s]:[null,-1]}line(t){return t===this.length()?this.line(t-1):this.descendant(vl,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 n=(s,i,o)=>{let a=[],u=o;return s.children.forEachAt(i,o,(h,p,v)=>{vl(h)?a.push(h):h instanceof Br&&(a=a.concat(n(h,p,u))),u-=v}),a};return n(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(R.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=R.sources.USER;typeof t=="string"&&(e=t),Array.isArray(t)||(t=this.observer.takeRecords()),t=t.filter(n=>{let{target:s}=n;const i=this.find(s,!0);return i&&!El(i)}),t.length>0&&this.emitter.emit(R.events.SCROLL_BEFORE_UPDATE,e,t),super.update(t.concat([])),t.length>0&&this.emitter.emit(R.events.SCROLL_UPDATE,e,t)}updateEmbedAt(t,e,n){const[s]=this.descendant(i=>i instanceof Ct,t);s&&s.statics.blotName===e&&El(s)&&s.updateContent(n)}handleDragStart(t){t.preventDefault()}deltaToRenderBlocks(t){const e=[];let n=new B;return t.forEach(s=>{const i=s==null?void 0:s.insert;if(i)if(typeof i=="string"){const o=i.split(`
19
+ `);o.slice(0,-1).forEach(u=>{n.insert(u,s.attributes),e.push({type:"block",delta:n,attributes:s.attributes??{}}),n=new B});const a=o[o.length-1];a&&n.insert(a,s.attributes)}else{const o=Object.keys(i)[0];if(!o)return;this.query(o,D.INLINE)?n.push(s):(n.length()&&e.push({type:"block",delta:n,attributes:{}}),n=new B,e.push({type:"blockEmbed",key:o,value:i[o],attributes:s.attributes??{}}))}}),n.length()&&e.push({type:"block",delta:n,attributes:{}}),e}createBlock(t,e){let n;const s={};Object.entries(t).forEach(a=>{let[u,h]=a;this.query(u,D.BLOCK&D.BLOT)!=null?n=u:s[u]=h});const i=this.create(n||this.statics.defaultChild.blotName,n?t[n]:void 0);this.insertBefore(i,e||void 0);const o=i.length();return Object.entries(s).forEach(a=>{let[u,h]=a;i.formatAt(0,o,u,h)}),i}}q(en,"blotName","scroll"),q(en,"className","ql-editor"),q(en,"tagName","DIV"),q(en,"defaultChild",pt),q(en,"allowedChildren",[pt,Ct,Me]);function $s(r,t,e){e.reduce((n,s)=>{const i=It.Op.length(s);let o=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const a=s.insert;r.insertAt(n,a);const[u]=r.descendant(Et,n),h=Ot(u);o=It.AttributeMap.diff(h,o)||{}}else if(typeof s.insert=="object"){const a=Object.keys(s.insert)[0];if(a==null)return n;if(r.insertAt(n,a,s.insert[a]),r.scroll.query(a,D.INLINE)!=null){const[h]=r.descendant(Et,n),p=Ot(h);o=It.AttributeMap.diff(p,o)||{}}}}return Object.keys(o).forEach(a=>{r.formatAt(n,i,a,o[a])}),n+i},t)}const Ei={scope:D.BLOCK,whitelist:["right","center","justify"]},Zf=new Qt("align","align",Ei),yo=new Ft("align","ql-align",Ei),vo=new Ae("align","text-align",Ei);class Eo extends Ae{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 Xf=new Ft("color","ql-color",{scope:D.INLINE}),Ai=new Eo("color","color",{scope:D.INLINE}),Yf=new Ft("background","ql-bg",{scope:D.INLINE}),Ni=new Eo("background","background-color",{scope:D.INLINE});class De extends Me{static create(t){const e=super.create(t);return e.setAttribute("spellcheck","false"),e}code(t,e){return this.children.map(n=>n.length()<=1?"":n.domNode.innerText).join(`
20
20
  `).slice(t,t+e)}html(t,e){return`<pre>
21
21
  ${Mr(this.code(t,e))}
22
22
  </pre>`}}class At extends pt{static register(){N.register(De)}}q(At,"TAB"," ");class wi extends Jt{}wi.blotName="code";wi.tagName="CODE";At.blotName="code-block";At.className="ql-code-block";At.tagName="DIV";De.blotName="code-block-container";De.className="ql-code-block-container";De.tagName="DIV";De.allowedChildren=[At];At.allowedChildren=[Ut,Ht,an];At.requiredContainer=De;const Ti={scope:D.BLOCK,whitelist:["rtl"]},Ao=new Qt("direction","dir",Ti),No=new Ft("direction","ql-direction",Ti),wo=new Ae("direction","direction",Ti),To={scope:D.INLINE,whitelist:["serif","monospace"]},xo=new Ft("font","ql-font",To);class Qf extends Ae{value(t){return super.value(t).replace(/["']/g,"")}}const Lo=new Qf("font","font-family",To),So=new Ft("size","ql-size",{scope:D.INLINE,whitelist:["small","large","huge"]}),_o=new Ae("size","font-size",{scope:D.INLINE,whitelist:["10px","18px","32px"]}),Jf=ue("quill:keyboard"),td=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Dr extends zt{static match(t,e){return["altKey","ctrlKey","metaKey","shiftKey"].some(n=>!!e[n]!==t[n]&&e[n]!==null)?!1:e.key===t.key||e.key===t.which}constructor(t,e){super(t,e),this.bindings={},Object.keys(this.options.bindings).forEach(n=>{this.options.bindings[n]&&this.addBinding(this.options.bindings[n])}),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]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=nd(t);if(s==null){Jf.warn("Attempted to add invalid keyboard binding",s);return}typeof e=="function"&&(e={handler:e}),typeof n=="function"&&(n={handler:n}),(Array.isArray(s.key)?s.key:[s.key]).forEach(o=>{const a={...s,key:o,...e,...n};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(x=>Dr.match(t,x));if(s.length===0)return;const i=N.find(t.target,!0);if(i&&i.scroll!==this.quill.scroll)return;const o=this.quill.getSelection();if(o==null||!this.quill.hasFocus())return;const[a,u]=this.quill.getLine(o.index),[h,p]=this.quill.getLeaf(o.index),[v,f]=o.length===0?[h,p]:this.quill.getLeaf(o.index+o.length),m=h instanceof qr?h.value().slice(0,p):"",y=v instanceof qr?v.value().slice(f):"",A={collapsed:o.length===0,empty:o.length===0&&a.length()<=1,format:this.quill.getFormat(o),line:a,offset:u,prefix:m,suffix:y,event:t};s.some(x=>{if(x.collapsed!=null&&x.collapsed!==A.collapsed||x.empty!=null&&x.empty!==A.empty||x.offset!=null&&x.offset!==A.offset)return!1;if(Array.isArray(x.format)){if(x.format.every(C=>A.format[C]==null))return!1}else if(typeof x.format=="object"&&!Object.keys(x.format).every(C=>x.format[C]===!0?A.format[C]!=null:x.format[C]===!1?A.format[C]==null:ge(x.format[C],A.format[C])))return!1;return x.prefix!=null&&!x.prefix.test(A.prefix)||x.suffix!=null&&!x.suffix.test(A.suffix)?!1:x.handler.call(this,o,A,x)!==!0})&&t.preventDefault()})}handleBackspace(t,e){const n=/[\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 o=new B().retain(t.index-n).delete(n);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(),p=this.quill.getFormat(t.index-1,1);if(s=It.AttributeMap.diff(h,p)||{},Object.keys(s).length>0){const v=new B().retain(t.index+i.length()-2).retain(1,s);o=o.compose(v)}}}this.quill.updateContents(o,N.sources.USER),this.quill.focus()}handleDelete(t,e){const n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(t.index>=this.quill.getLength()-n)return;let s={};const[i]=this.quill.getLine(t.index);let o=new B().retain(t.index).delete(n);if(e.offset>=i.length()-1){const[a]=this.quill.getLine(t.index+1);if(a){const u=i.formats(),h=this.quill.getFormat(t.index,1);s=It.AttributeMap.diff(u,h)||{},Object.keys(s).length>0&&(o=o.retain(a.length()-1).retain(1,s))}}this.quill.updateContents(o,N.sources.USER),this.quill.focus()}handleDeleteRange(t){xi({range:t,quill:this.quill}),this.quill.focus()}handleEnter(t,e){const n=Object.keys(e.format).reduce((i,o)=>(this.quill.scroll.query(o,D.BLOCK)&&!Array.isArray(e.format[o])&&(i[o]=e.format[o]),i),{}),s=new B().retain(t.index).delete(t.length).insert(`
23
- `,n);this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(t.index+1,N.sources.SILENT),this.quill.focus()}}const ed={bindings:{bold:$s("bold"),italic:$s("italic"),underline:$s("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(r,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(r,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(r,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":Al(!0),"outdent code-block":Al(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(r){this.quill.deleteText(r.index-1,1,N.sources.USER)}},tab:{key:"Tab",handler(r,t){if(t.format.table)return!0;this.quill.history.cutoff();const e=new B().retain(r.index).delete(r.length).insert(" ");return this.quill.updateContents(e,N.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(r.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(r,t){const e={list:!1};t.format.indent&&(e.indent=!1),this.quill.formatLine(r.index,r.length,e,N.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(r){const[t,e]=this.quill.getLine(r.index),n={...t.formats(),list:"checked"},s=new B().retain(r.index).insert(`
23
+ `,n);this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(t.index+1,N.sources.SILENT),this.quill.focus()}}const ed={bindings:{bold:Ps("bold"),italic:Ps("italic"),underline:Ps("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(r,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(r,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(r,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":Al(!0),"outdent code-block":Al(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(r){this.quill.deleteText(r.index-1,1,N.sources.USER)}},tab:{key:"Tab",handler(r,t){if(t.format.table)return!0;this.quill.history.cutoff();const e=new B().retain(r.index).delete(r.length).insert(" ");return this.quill.updateContents(e,N.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(r.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(r,t){const e={list:!1};t.format.indent&&(e.indent=!1),this.quill.formatLine(r.index,r.length,e,N.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(r){const[t,e]=this.quill.getLine(r.index),n={...t.formats(),list:"checked"},s=new B().retain(r.index).insert(`
24
24
  `,n).retain(t.length()-e-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(r.index+1,N.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(r,t){const[e,n]=this.quill.getLine(r.index),s=new B().retain(r.index).insert(`
25
25
  `,t.format).retain(e.length()-n-1).retain(1,{header:null});this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(r.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(r){const t=this.quill.getModule("table");if(t){const[e,n,s,i]=t.getTable(r),o=rd(e,n,s,i);if(o==null)return;let a=e.offset();if(o<0){const u=new B().retain(a).insert(`
26
26
  `);this.quill.updateContents(u,N.sources.USER),this.quill.setSelection(r.index+1,r.length,N.sources.SILENT)}else if(o>0){a+=e.length();const u=new B().retain(a).insert(`
27
- `);this.quill.updateContents(u,N.sources.USER),this.quill.setSelection(a,N.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(r,t){const{event:e,line:n}=t,s=n.offset(this.quill.scroll);e.shiftKey?this.quill.setSelection(s-1,N.sources.USER):this.quill.setSelection(s+n.length(),N.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(r,t){if(this.quill.scroll.query("list")==null)return!0;const{length:e}=t.prefix,[n,s]=this.quill.getLine(r.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(r.index," ",N.sources.USER),this.quill.history.cutoff();const o=new B().retain(r.index-s).delete(e+1).retain(n.length()-2-s).retain(1,{list:i});return this.quill.updateContents(o,N.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(r.index-e,N.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(r){const[t,e]=this.quill.getLine(r.index);let n=2,s=t;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,n-=1,n<=0){const i=new B().retain(r.index+t.length()-e-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(i,N.sources.USER),this.quill.setSelection(r.index-1,N.sources.SILENT),!1}return!0}},"embed left":Nr("ArrowLeft",!1),"embed left shift":Nr("ArrowLeft",!0),"embed right":Nr("ArrowRight",!1),"embed right shift":Nr("ArrowRight",!0),"table down":Nl(!1),"table up":Nl(!0)}};Dr.DEFAULTS=ed;function Al(r){return{key:"Tab",shiftKey:!r,format:{"code-block":!0},handler(t,e){let{event:n}=e;const s=this.quill.scroll.query("code-block"),{TAB:i}=s;if(t.length===0&&!n.shiftKey){this.quill.insertText(t.index,i,N.sources.USER),this.quill.setSelection(t.index+i.length,N.sources.SILENT);return}const o=t.length===0?this.quill.getLines(t.index,1):this.quill.getLines(t);let{index:a,length:u}=t;o.forEach((h,p)=>{r?(h.insertAt(0,i),p===0?a+=i.length:u+=i.length):h.domNode.textContent.startsWith(i)&&(h.deleteAt(0,i.length),p===0?a-=i.length:u-=i.length)}),this.quill.update(N.sources.USER),this.quill.setSelection(a,u,N.sources.SILENT)}}}function Nr(r,t){return{key:r,shiftKey:t,altKey:null,[r==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(n){let{index:s}=n;r==="ArrowRight"&&(s+=n.length+1);const[i]=this.quill.getLeaf(s);return i instanceof Lt?(r==="ArrowLeft"?t?this.quill.setSelection(n.index-1,n.length+1,N.sources.USER):this.quill.setSelection(n.index-1,N.sources.USER):t?this.quill.setSelection(n.index,n.length+1,N.sources.USER):this.quill.setSelection(n.index+n.length+1,N.sources.USER),!1):!0}}}function $s(r){return{key:r[0],shortKey:!0,handler(t,e){this.quill.format(r,!e.format[r],N.sources.USER)}}}function Nl(r){return{key:r?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(t,e){const n=r?"prev":"next",s=e.line,i=s.parent[n];if(i!=null){if(i.statics.blotName==="table-row"){let o=i.children.head,a=s;for(;a.prev!=null;)a=a.prev,o=o.next;const u=o.offset(this.quill.scroll)+Math.min(e.offset,o.length()-1);this.quill.setSelection(u,0,N.sources.USER)}}else{const o=s.table()[n];o!=null&&(r?this.quill.setSelection(o.offset(this.quill.scroll)+o.length()-1,0,N.sources.USER):this.quill.setSelection(o.offset(this.quill.scroll),0,N.sources.USER))}return!1}}}function nd(r){if(typeof r=="string"||typeof r=="number")r={key:r};else if(typeof r=="object")r=nn(r);else return null;return r.shortKey&&(r[td]=r.shortKey,delete r.shortKey),r}function xi(r){let{quill:t,range:e}=r;const n=t.getLines(e);let s={};if(n.length>1){const i=n[0].formats(),o=n[n.length-1].formats();s=It.AttributeMap.diff(o,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 rd(r,t,e,n){return t.prev==null&&t.next==null?e.prev==null&&e.next==null?n===0?-1:1:e.prev==null?-1:1:t.prev==null?-1:t.next==null?1:null}const sd=/font-weight:\s*normal/,id=["P","OL","UL"],wl=r=>r&&id.includes(r.tagName),ld=r=>{Array.from(r.querySelectorAll("br")).filter(t=>wl(t.previousElementSibling)&&wl(t.nextElementSibling)).forEach(t=>{var e;(e=t.parentNode)==null||e.removeChild(t)})},od=r=>{Array.from(r.querySelectorAll('b[style*="font-weight"]')).filter(t=>{var e;return(e=t.getAttribute("style"))==null?void 0:e.match(sd)}).forEach(t=>{var n;const e=r.createDocumentFragment();e.append(...t.childNodes),(n=t.parentNode)==null||n.replaceChild(e,t)})};function ad(r){r.querySelector('[id^="docs-internal-guid-"]')&&(od(r),ld(r))}const cd=/\bmso-list:[^;]*ignore/i,ud=/\bmso-list:[^;]*\bl(\d+)/i,hd=/\bmso-list:[^;]*\blevel(\d+)/i,fd=(r,t)=>{const e=r.getAttribute("style"),n=e==null?void 0:e.match(ud);if(!n)return null;const s=Number(n[1]),i=e==null?void 0:e.match(hd),o=i?Number(i[1]):1,a=new RegExp(`@list l${s}:level${o}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),u=t.match(a),h=u&&u[1]==="bullet"?"bullet":"ordered";return{id:s,indent:o,type:h,element:r}},dd=r=>{var o,a;const t=Array.from(r.querySelectorAll("[style*=mso-list]")),e=[],n=[];t.forEach(u=>{(u.getAttribute("style")||"").match(cd)?e.push(u):n.push(u)}),e.forEach(u=>{var h;return(h=u.parentNode)==null?void 0:h.removeChild(u)});const s=r.documentElement.innerHTML,i=n.map(u=>fd(u,s)).filter(u=>u);for(;i.length;){const u=[];let h=i.shift();for(;h;)u.push(h),h=i.length&&((o=i[0])==null?void 0:o.element)===h.element.nextElementSibling&&i[0].id===h.id?i.shift():null;const p=document.createElement("ul");u.forEach(m=>{const y=document.createElement("li");y.setAttribute("data-list",m.type),m.indent>1&&y.setAttribute("class",`ql-indent-${m.indent-1}`),y.innerHTML=m.element.innerHTML,p.appendChild(y)});const v=(a=u[0])==null?void 0:a.element,{parentNode:f}=v??{};v&&(f==null||f.replaceChild(p,v)),u.slice(1).forEach(m=>{let{element:y}=m;f==null||f.removeChild(y)})}};function gd(r){r.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&dd(r)}const pd=[gd,ad],md=r=>{r.documentElement&&pd.forEach(t=>{t(r)})},bd=ue("quill:clipboard"),yd=[[Node.TEXT_NODE,qd],[Node.TEXT_NODE,xl],["br",wd],[Node.ELEMENT_NODE,xl],[Node.ELEMENT_NODE,Nd],[Node.ELEMENT_NODE,Ad],[Node.ELEMENT_NODE,_d],["li",Ld],["ol, ul",Sd],["pre",Td],["tr",Od],["b",Us("bold")],["i",Us("italic")],["strike",Us("strike")],["style",xd]],vd=[Zf,Ao].reduce((r,t)=>(r[t.keyName]=t,r),{}),Tl=[vo,Ni,Ai,wo,Lo,_o].reduce((r,t)=>(r[t.keyName]=t,r),{});class Oo extends zt{constructor(t,e){super(t,e),this.quill.root.addEventListener("copy",n=>this.onCaptureCopy(n,!1)),this.quill.root.addEventListener("cut",n=>this.onCaptureCopy(n,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],yd.concat(this.options.matchers??[]).forEach(n=>{let[s,i]=n;this.addMatcher(s,i)})}addMatcher(t,e){this.matchers.push([t,e])}convert(t){let{html:e,text:n}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s[At.blotName])return new B().insert(n||"",{[At.blotName]:s[At.blotName]});if(!e)return new B().insert(n||"",s);const i=this.convertHTML(e);return Kn(i,`
27
+ `);this.quill.updateContents(u,N.sources.USER),this.quill.setSelection(a,N.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(r,t){const{event:e,line:n}=t,s=n.offset(this.quill.scroll);e.shiftKey?this.quill.setSelection(s-1,N.sources.USER):this.quill.setSelection(s+n.length(),N.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(r,t){if(this.quill.scroll.query("list")==null)return!0;const{length:e}=t.prefix,[n,s]=this.quill.getLine(r.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(r.index," ",N.sources.USER),this.quill.history.cutoff();const o=new B().retain(r.index-s).delete(e+1).retain(n.length()-2-s).retain(1,{list:i});return this.quill.updateContents(o,N.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(r.index-e,N.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(r){const[t,e]=this.quill.getLine(r.index);let n=2,s=t;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,n-=1,n<=0){const i=new B().retain(r.index+t.length()-e-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(i,N.sources.USER),this.quill.setSelection(r.index-1,N.sources.SILENT),!1}return!0}},"embed left":Nr("ArrowLeft",!1),"embed left shift":Nr("ArrowLeft",!0),"embed right":Nr("ArrowRight",!1),"embed right shift":Nr("ArrowRight",!0),"table down":Nl(!1),"table up":Nl(!0)}};Dr.DEFAULTS=ed;function Al(r){return{key:"Tab",shiftKey:!r,format:{"code-block":!0},handler(t,e){let{event:n}=e;const s=this.quill.scroll.query("code-block"),{TAB:i}=s;if(t.length===0&&!n.shiftKey){this.quill.insertText(t.index,i,N.sources.USER),this.quill.setSelection(t.index+i.length,N.sources.SILENT);return}const o=t.length===0?this.quill.getLines(t.index,1):this.quill.getLines(t);let{index:a,length:u}=t;o.forEach((h,p)=>{r?(h.insertAt(0,i),p===0?a+=i.length:u+=i.length):h.domNode.textContent.startsWith(i)&&(h.deleteAt(0,i.length),p===0?a-=i.length:u-=i.length)}),this.quill.update(N.sources.USER),this.quill.setSelection(a,u,N.sources.SILENT)}}}function Nr(r,t){return{key:r,shiftKey:t,altKey:null,[r==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(n){let{index:s}=n;r==="ArrowRight"&&(s+=n.length+1);const[i]=this.quill.getLeaf(s);return i instanceof Lt?(r==="ArrowLeft"?t?this.quill.setSelection(n.index-1,n.length+1,N.sources.USER):this.quill.setSelection(n.index-1,N.sources.USER):t?this.quill.setSelection(n.index,n.length+1,N.sources.USER):this.quill.setSelection(n.index+n.length+1,N.sources.USER),!1):!0}}}function Ps(r){return{key:r[0],shortKey:!0,handler(t,e){this.quill.format(r,!e.format[r],N.sources.USER)}}}function Nl(r){return{key:r?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(t,e){const n=r?"prev":"next",s=e.line,i=s.parent[n];if(i!=null){if(i.statics.blotName==="table-row"){let o=i.children.head,a=s;for(;a.prev!=null;)a=a.prev,o=o.next;const u=o.offset(this.quill.scroll)+Math.min(e.offset,o.length()-1);this.quill.setSelection(u,0,N.sources.USER)}}else{const o=s.table()[n];o!=null&&(r?this.quill.setSelection(o.offset(this.quill.scroll)+o.length()-1,0,N.sources.USER):this.quill.setSelection(o.offset(this.quill.scroll),0,N.sources.USER))}return!1}}}function nd(r){if(typeof r=="string"||typeof r=="number")r={key:r};else if(typeof r=="object")r=nn(r);else return null;return r.shortKey&&(r[td]=r.shortKey,delete r.shortKey),r}function xi(r){let{quill:t,range:e}=r;const n=t.getLines(e);let s={};if(n.length>1){const i=n[0].formats(),o=n[n.length-1].formats();s=It.AttributeMap.diff(o,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 rd(r,t,e,n){return t.prev==null&&t.next==null?e.prev==null&&e.next==null?n===0?-1:1:e.prev==null?-1:1:t.prev==null?-1:t.next==null?1:null}const sd=/font-weight:\s*normal/,id=["P","OL","UL"],wl=r=>r&&id.includes(r.tagName),ld=r=>{Array.from(r.querySelectorAll("br")).filter(t=>wl(t.previousElementSibling)&&wl(t.nextElementSibling)).forEach(t=>{var e;(e=t.parentNode)==null||e.removeChild(t)})},od=r=>{Array.from(r.querySelectorAll('b[style*="font-weight"]')).filter(t=>{var e;return(e=t.getAttribute("style"))==null?void 0:e.match(sd)}).forEach(t=>{var n;const e=r.createDocumentFragment();e.append(...t.childNodes),(n=t.parentNode)==null||n.replaceChild(e,t)})};function ad(r){r.querySelector('[id^="docs-internal-guid-"]')&&(od(r),ld(r))}const cd=/\bmso-list:[^;]*ignore/i,ud=/\bmso-list:[^;]*\bl(\d+)/i,hd=/\bmso-list:[^;]*\blevel(\d+)/i,fd=(r,t)=>{const e=r.getAttribute("style"),n=e==null?void 0:e.match(ud);if(!n)return null;const s=Number(n[1]),i=e==null?void 0:e.match(hd),o=i?Number(i[1]):1,a=new RegExp(`@list l${s}:level${o}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),u=t.match(a),h=u&&u[1]==="bullet"?"bullet":"ordered";return{id:s,indent:o,type:h,element:r}},dd=r=>{var o,a;const t=Array.from(r.querySelectorAll("[style*=mso-list]")),e=[],n=[];t.forEach(u=>{(u.getAttribute("style")||"").match(cd)?e.push(u):n.push(u)}),e.forEach(u=>{var h;return(h=u.parentNode)==null?void 0:h.removeChild(u)});const s=r.documentElement.innerHTML,i=n.map(u=>fd(u,s)).filter(u=>u);for(;i.length;){const u=[];let h=i.shift();for(;h;)u.push(h),h=i.length&&((o=i[0])==null?void 0:o.element)===h.element.nextElementSibling&&i[0].id===h.id?i.shift():null;const p=document.createElement("ul");u.forEach(m=>{const y=document.createElement("li");y.setAttribute("data-list",m.type),m.indent>1&&y.setAttribute("class",`ql-indent-${m.indent-1}`),y.innerHTML=m.element.innerHTML,p.appendChild(y)});const v=(a=u[0])==null?void 0:a.element,{parentNode:f}=v??{};v&&(f==null||f.replaceChild(p,v)),u.slice(1).forEach(m=>{let{element:y}=m;f==null||f.removeChild(y)})}};function gd(r){r.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&dd(r)}const pd=[gd,ad],md=r=>{r.documentElement&&pd.forEach(t=>{t(r)})},bd=ue("quill:clipboard"),yd=[[Node.TEXT_NODE,qd],[Node.TEXT_NODE,xl],["br",wd],[Node.ELEMENT_NODE,xl],[Node.ELEMENT_NODE,Nd],[Node.ELEMENT_NODE,Ad],[Node.ELEMENT_NODE,_d],["li",Ld],["ol, ul",Sd],["pre",Td],["tr",Od],["b",Us("bold")],["i",Us("italic")],["strike",Us("strike")],["style",xd]],vd=[Zf,Ao].reduce((r,t)=>(r[t.keyName]=t,r),{}),Tl=[vo,Ni,Ai,wo,Lo,_o].reduce((r,t)=>(r[t.keyName]=t,r),{});class Oo extends zt{constructor(t,e){super(t,e),this.quill.root.addEventListener("copy",n=>this.onCaptureCopy(n,!1)),this.quill.root.addEventListener("cut",n=>this.onCaptureCopy(n,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],yd.concat(this.options.matchers??[]).forEach(n=>{let[s,i]=n;this.addMatcher(s,i)})}addMatcher(t,e){this.matchers.push([t,e])}convert(t){let{html:e,text:n}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s[At.blotName])return new B().insert(n||"",{[At.blotName]:s[At.blotName]});if(!e)return new B().insert(n||"",s);const i=this.convertHTML(e);return Kn(i,`
28
28
  `)&&(i.ops[i.ops.length-1].attributes==null||s.table)?i.compose(new B().retain(i.length()-1).delete(1)):i}normalizeHTML(t){md(t)}convertHTML(t){const e=new DOMParser().parseFromString(t,"text/html");this.normalizeHTML(e);const n=e.body,s=new WeakMap,[i,o]=this.prepareMatching(n,s);return Li(this.quill.scroll,n,i,o,s)}dangerouslyPasteHTML(t,e){let n=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 B().retain(t).concat(s),n),this.quill.setSelection(t+s.length(),N.sources.SILENT)}}onCaptureCopy(t){var o,a;let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t.defaultPrevented)return;t.preventDefault();const[n]=this.quill.selection.getRange();if(n==null)return;const{html:s,text:i}=this.onCopy(n,e);(o=t.clipboardData)==null||o.setData("text/plain",i),(a=t.clipboardData)==null||a.setData("text/html",s),e&&xi({range:n,quill:this.quill})}normalizeURIList(t){return t.split(/\r?\n/).filter(e=>e[0]!=="#").join(`
29
- `)}onCapturePaste(t){var o,a,u,h,p;if(t.defaultPrevented||!this.quill.isEnabled())return;t.preventDefault();const e=this.quill.getSelection(!0);if(e==null)return;const n=(o=t.clipboardData)==null?void 0:o.getData("text/html");let s=(a=t.clipboardData)==null?void 0:a.getData("text/plain");if(!n&&!s){const v=(u=t.clipboardData)==null?void 0:u.getData("text/uri-list");v&&(s=this.normalizeURIList(v))}const i=Array.from(((h=t.clipboardData)==null?void 0:h.files)||[]);if(!n&&i.length>0){this.quill.uploader.upload(e,i);return}if(n&&i.length>0){const v=new DOMParser().parseFromString(n,"text/html");if(v.body.childElementCount===1&&((p=v.body.firstElementChild)==null?void 0:p.tagName)==="IMG"){this.quill.uploader.upload(e,i);return}}this.onPaste(e,{html:n,text:s})}onCopy(t){const e=this.quill.getText(t);return{html:this.quill.getSemanticHTML(t),text:e}}onPaste(t,e){let{text:n,html:s}=e;const i=this.quill.getFormat(t.index),o=this.convert({text:n,html:s},i);bd.log("onPaste",o,{text:n,html:s});const a=new B().retain(t.index).delete(t.length).concat(o);this.quill.updateContents(a,N.sources.USER),this.quill.setSelection(a.length()-t.length,N.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(t,e){const n=[],s=[];return this.matchers.forEach(i=>{const[o,a]=i;switch(o){case Node.TEXT_NODE:s.push(a);break;case Node.ELEMENT_NODE:n.push(a);break;default:Array.from(t.querySelectorAll(o)).forEach(u=>{if(e.has(u)){const h=e.get(u);h==null||h.push(a)}else e.set(u,[a])});break}}),[n,s]}}q(Oo,"DEFAULTS",{matchers:[]});function je(r,t,e,n){return n.query(t)?r.reduce((s,i)=>{if(!i.insert)return s;if(i.attributes&&i.attributes[t])return s.push(i);const o=e?{[t]:e}:{};return s.insert(i.insert,{...o,...i.attributes})},new B):r}function Kn(r,t){let e="";for(let n=r.ops.length-1;n>=0&&e.length<t.length;--n){const s=r.ops[n];if(typeof s.insert!="string")break;e=s.insert+e}return e.slice(-1*t.length)===t}function me(r,t){if(!(r instanceof Element))return!1;const e=t.query(r);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(r.tagName.toLowerCase())}function Ed(r,t){return r.previousElementSibling&&r.nextElementSibling&&!me(r.previousElementSibling,t)&&!me(r.nextElementSibling,t)}const wr=new WeakMap;function qo(r){return r==null?!1:(wr.has(r)||(r.tagName==="PRE"?wr.set(r,!0):wr.set(r,qo(r.parentNode))),wr.get(r))}function Li(r,t,e,n,s){return t.nodeType===t.TEXT_NODE?n.reduce((i,o)=>o(t,i,r),new B):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce((i,o)=>{let a=Li(r,o,e,n,s);return o.nodeType===t.ELEMENT_NODE&&(a=e.reduce((u,h)=>h(o,u,r),a),a=(s.get(o)||[]).reduce((u,h)=>h(o,u,r),a)),i.concat(a)},new B):new B}function Us(r){return(t,e,n)=>je(e,r,!0,n)}function Ad(r,t,e){const n=Qt.keys(r),s=Ft.keys(r),i=Ae.keys(r),o={};return n.concat(s).concat(i).forEach(a=>{let u=e.query(a,D.ATTRIBUTE);u!=null&&(o[u.attrName]=u.value(r),o[u.attrName])||(u=vd[a],u!=null&&(u.attrName===a||u.keyName===a)&&(o[u.attrName]=u.value(r)||void 0),u=Tl[a],u!=null&&(u.attrName===a||u.keyName===a)&&(u=Tl[a],o[u.attrName]=u.value(r)||void 0))}),Object.entries(o).reduce((a,u)=>{let[h,p]=u;return je(a,h,p,e)},t)}function Nd(r,t,e){const n=e.query(r);if(n==null)return t;if(n.prototype instanceof Lt){const s={},i=n.value(r);if(i!=null)return s[n.blotName]=i,new B().insert(s,n.formats(r,e))}else if(n.prototype instanceof $n&&!Kn(t,`
29
+ `)}onCapturePaste(t){var o,a,u,h,p;if(t.defaultPrevented||!this.quill.isEnabled())return;t.preventDefault();const e=this.quill.getSelection(!0);if(e==null)return;const n=(o=t.clipboardData)==null?void 0:o.getData("text/html");let s=(a=t.clipboardData)==null?void 0:a.getData("text/plain");if(!n&&!s){const v=(u=t.clipboardData)==null?void 0:u.getData("text/uri-list");v&&(s=this.normalizeURIList(v))}const i=Array.from(((h=t.clipboardData)==null?void 0:h.files)||[]);if(!n&&i.length>0){this.quill.uploader.upload(e,i);return}if(n&&i.length>0){const v=new DOMParser().parseFromString(n,"text/html");if(v.body.childElementCount===1&&((p=v.body.firstElementChild)==null?void 0:p.tagName)==="IMG"){this.quill.uploader.upload(e,i);return}}this.onPaste(e,{html:n,text:s})}onCopy(t){const e=this.quill.getText(t);return{html:this.quill.getSemanticHTML(t),text:e}}onPaste(t,e){let{text:n,html:s}=e;const i=this.quill.getFormat(t.index),o=this.convert({text:n,html:s},i);bd.log("onPaste",o,{text:n,html:s});const a=new B().retain(t.index).delete(t.length).concat(o);this.quill.updateContents(a,N.sources.USER),this.quill.setSelection(a.length()-t.length,N.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(t,e){const n=[],s=[];return this.matchers.forEach(i=>{const[o,a]=i;switch(o){case Node.TEXT_NODE:s.push(a);break;case Node.ELEMENT_NODE:n.push(a);break;default:Array.from(t.querySelectorAll(o)).forEach(u=>{if(e.has(u)){const h=e.get(u);h==null||h.push(a)}else e.set(u,[a])});break}}),[n,s]}}q(Oo,"DEFAULTS",{matchers:[]});function je(r,t,e,n){return n.query(t)?r.reduce((s,i)=>{if(!i.insert)return s;if(i.attributes&&i.attributes[t])return s.push(i);const o=e?{[t]:e}:{};return s.insert(i.insert,{...o,...i.attributes})},new B):r}function Kn(r,t){let e="";for(let n=r.ops.length-1;n>=0&&e.length<t.length;--n){const s=r.ops[n];if(typeof s.insert!="string")break;e=s.insert+e}return e.slice(-1*t.length)===t}function me(r,t){if(!(r instanceof Element))return!1;const e=t.query(r);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(r.tagName.toLowerCase())}function Ed(r,t){return r.previousElementSibling&&r.nextElementSibling&&!me(r.previousElementSibling,t)&&!me(r.nextElementSibling,t)}const wr=new WeakMap;function qo(r){return r==null?!1:(wr.has(r)||(r.tagName==="PRE"?wr.set(r,!0):wr.set(r,qo(r.parentNode))),wr.get(r))}function Li(r,t,e,n,s){return t.nodeType===t.TEXT_NODE?n.reduce((i,o)=>o(t,i,r),new B):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce((i,o)=>{let a=Li(r,o,e,n,s);return o.nodeType===t.ELEMENT_NODE&&(a=e.reduce((u,h)=>h(o,u,r),a),a=(s.get(o)||[]).reduce((u,h)=>h(o,u,r),a)),i.concat(a)},new B):new B}function Us(r){return(t,e,n)=>je(e,r,!0,n)}function Ad(r,t,e){const n=Qt.keys(r),s=Ft.keys(r),i=Ae.keys(r),o={};return n.concat(s).concat(i).forEach(a=>{let u=e.query(a,D.ATTRIBUTE);u!=null&&(o[u.attrName]=u.value(r),o[u.attrName])||(u=vd[a],u!=null&&(u.attrName===a||u.keyName===a)&&(o[u.attrName]=u.value(r)||void 0),u=Tl[a],u!=null&&(u.attrName===a||u.keyName===a)&&(u=Tl[a],o[u.attrName]=u.value(r)||void 0))}),Object.entries(o).reduce((a,u)=>{let[h,p]=u;return je(a,h,p,e)},t)}function Nd(r,t,e){const n=e.query(r);if(n==null)return t;if(n.prototype instanceof Lt){const s={},i=n.value(r);if(i!=null)return s[n.blotName]=i,new B().insert(s,n.formats(r,e))}else if(n.prototype instanceof Pn&&!Kn(t,`
30
30
  `)&&t.insert(`
31
31
  `),"blotName"in n&&"formats"in n&&typeof n.formats=="function")return je(t,n.blotName,n.formats(r,e),e);return t}function wd(r,t){return Kn(t,`
32
32
  `)||t.insert(`
@@ -37,7 +37,7 @@ ${Mr(this.code(t,e))}
37
37
  `);const s=e.query(n);if(s&&s.prototype instanceof Ct)return t.insert(`
38
38
  `);n=n.firstChild}}}return t}function _d(r,t,e){var i;const n={},s=r.style||{};return s.fontStyle==="italic"&&(n.italic=!0),s.textDecoration==="underline"&&(n.underline=!0),s.textDecoration==="line-through"&&(n.strike=!0),((i=s.fontWeight)!=null&&i.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(n.bold=!0),t=Object.entries(n).reduce((o,a)=>{let[u,h]=a;return je(o,u,h,e)},t),parseFloat(s.textIndent||0)>0?new B().insert(" ").concat(t):t}function Od(r,t,e){var s,i;const n=((s=r.parentElement)==null?void 0:s.tagName)==="TABLE"?r.parentElement:(i=r.parentElement)==null?void 0:i.parentElement;if(n!=null){const a=Array.from(n.querySelectorAll("tr")).indexOf(r)+1;return je(t,"table",a,e)}return t}function qd(r,t,e){var s;let n=r.data;if(((s=r.parentElement)==null?void 0:s.tagName)==="O:P")return t.insert(n.trim());if(!qo(r)){if(n.trim().length===0&&n.includes(`
39
39
  `)&&!Ed(r,e))return t;n=n.replace(/[^\S\u00a0]/g," "),n=n.replace(/ {2,}/g," "),(r.previousSibling==null&&r.parentElement!=null&&me(r.parentElement,e)||r.previousSibling instanceof Element&&me(r.previousSibling,e))&&(n=n.replace(/^ /,"")),(r.nextSibling==null&&r.parentElement!=null&&me(r.parentElement,e)||r.nextSibling instanceof Element&&me(r.nextSibling,e))&&(n=n.replace(/ $/,"")),n=n.replaceAll(" "," ")}return t.insert(n)}class Co extends zt{constructor(e,n){super(e,n);q(this,"lastRecorded",0);q(this,"ignoreChange",!1);q(this,"stack",{undo:[],redo:[]});q(this,"currentRange",null);this.quill.on(N.events.EDITOR_CHANGE,(s,i,o,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,o):this.transform(i)),this.currentRange=ri(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,n){if(this.stack[e].length===0)return;const s=this.stack[e].pop();if(!s)return;const i=this.quill.getContents(),o=s.delta.invert(i);this.stack[n].push({delta:o,range:ri(s.range,o)}),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,n){if(e.ops.length===0)return;this.stack.redo=[];let s=e.invert(n),i=this.currentRange;const o=Date.now();if(this.lastRecorded+this.options.delay>o&&this.stack.undo.length>0){const a=this.stack.undo.pop();a&&(s=s.compose(a.delta),i=a.range)}else this.lastRecorded=o;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){Ll(this.stack.undo,e),Ll(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,N.sources.USER);else{const n=Id(this.quill.scroll,e.delta);this.quill.setSelection(n,N.sources.USER)}}}q(Co,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function Ll(r,t){let e=t;for(let n=r.length-1;n>=0;n-=1){const s=r[n];r[n]={delta:e.transform(s.delta,!0),range:s.range&&ri(s.range,e)},e=s.delta.transform(e),r[n].delta.length()===0&&r.splice(n,1)}}function Cd(r,t){const e=t.ops[t.ops.length-1];return e==null?!1:e.insert!=null?typeof e.insert=="string"&&e.insert.endsWith(`
40
- `):e.attributes!=null?Object.keys(e.attributes).some(n=>r.query(n,D.BLOCK)!=null):!1}function Id(r,t){const e=t.reduce((s,i)=>s+(i.delete||0),0);let n=t.length()-e;return Cd(r,t)&&(n-=1),n}function ri(r,t){if(!r)return r;const e=t.transformPosition(r.index),n=t.transformPosition(r.index+r.length);return{index:e,length:n-e}}class Io extends zt{constructor(t,e){super(t,e),t.root.addEventListener("drop",n=>{var o;n.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(n.clientX,n.clientY);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(n.clientX,n.clientY);s=document.createRange(),s.setStart(a.offsetNode,a.offset),s.setEnd(a.offsetNode,a.offset)}const i=s&&t.selection.normalizeNative(s);if(i){const a=t.selection.normalizedToRange(i);(o=n.dataTransfer)!=null&&o.files&&this.upload(a,n.dataTransfer.files)}})}upload(t,e){const n=[];Array.from(e).forEach(s=>{var i;s&&((i=this.options.mimetypes)!=null&&i.includes(s.type))&&n.push(s)}),n.length>0&&this.options.handler.call(this,t,n)}}Io.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(r,t){if(!this.quill.scroll.query("image"))return;const e=t.map(n=>new Promise(s=>{const i=new FileReader;i.onload=()=>{s(i.result)},i.readAsDataURL(n)}));Promise.all(e).then(n=>{const s=n.reduce((i,o)=>i.insert({image:o}),new B().retain(r.index).delete(r.length));this.quill.updateContents(s,R.sources.USER),this.quill.setSelection(r.index+n.length,R.sources.SILENT)})}};const Rd=["insertText","insertReplacementText"];class kd extends zt{constructor(t,e){super(t,e),t.root.addEventListener("beforeinput",n=>{this.handleBeforeInput(n)}),/Android/i.test(navigator.userAgent)||t.on(N.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(t){xi({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 n=this.quill.getFormat(t.index,1);this.deleteRange(t),this.quill.updateContents(new B().retain(t.index).insert(e,n),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||!Rd.includes(t.inputType))return;const e=t.getTargetRanges?t.getTargetRanges()[0]:null;if(!e||e.collapsed===!0)return;const n=Bd(t);if(n==null)return;const s=this.quill.selection.normalizeNative(e),i=s?this.quill.selection.normalizedToRange(s):null;i&&this.replaceText(i,n)&&t.preventDefault()}handleCompositionStart(){const t=this.quill.getSelection();t&&this.replaceText(t)}}function Bd(r){var t;return typeof r.data=="string"?r.data:(t=r.dataTransfer)!=null&&t.types.includes("text/plain")?r.dataTransfer.getData("text/plain"):null}const Md=/Mac/i.test(navigator.platform),Dd=100,jd=r=>!!(r.key==="ArrowLeft"||r.key==="ArrowRight"||r.key==="ArrowUp"||r.key==="ArrowDown"||r.key==="Home"||Md&&r.key==="a"&&r.ctrlKey===!0);class Pd extends zt{constructor(e,n){super(e,n);q(this,"isListening",!1);q(this,"selectionChangeDeadline",0);this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,n){let{line:s,event:i}=n;if(!(s instanceof $t)||!s.uiNode)return!0;const o=getComputedStyle(s.domNode).direction==="rtl";return o&&i.key!=="ArrowRight"||!o&&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&&jd(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+Dd,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 n=e.getRangeAt(0);if(n.collapsed!==!0||n.startOffset!==0)return;const s=this.quill.scroll.find(n.startContainer);if(!(s instanceof $t)||!s.uiNode)return;const i=document.createRange();i.setStartAfter(s.uiNode),i.setEndAfter(s.uiNode),e.removeAllRanges(),e.addRange(i)}}N.register({"blots/block":pt,"blots/block/embed":Ct,"blots/break":Ht,"blots/container":Me,"blots/cursor":an,"blots/embed":vi,"blots/inline":Jt,"blots/scroll":en,"blots/text":Ut,"modules/clipboard":Oo,"modules/history":Co,"modules/keyboard":Dr,"modules/uploader":Io,"modules/input":kd,"modules/uiNode":Pd});class $d extends Ft{add(t,e){let n=0;if(e==="+1"||e==="-1"){const s=this.value(t)||0;n=e==="+1"?s+1:s-1}else typeof e=="number"&&(n=e);return n===0?(this.remove(t),!0):super.add(t,n.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 Ud=new $d("indent","ql-indent",{scope:D.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class si extends pt{}q(si,"blotName","blockquote"),q(si,"tagName","blockquote");class ii extends pt{static formats(t){return this.tagName.indexOf(t.tagName)+1}}q(ii,"blotName","header"),q(ii,"tagName",["H1","H2","H3","H4","H5","H6"]);class Gn extends Me{}Gn.blotName="list-container";Gn.tagName="OL";class Vn extends pt{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(Gn)}constructor(t,e){super(t,e);const n=e.ownerDocument.createElement("span"),s=i=>{if(!t.isEnabled())return;const o=this.statics.formats(e,t);o==="checked"?(this.format("list","unchecked"),i.preventDefault()):o==="unchecked"&&(this.format("list","checked"),i.preventDefault())};n.addEventListener("mousedown",s),n.addEventListener("touchstart",s),this.attachUI(n)}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-list",e):super.format(t,e)}}Vn.blotName="list";Vn.tagName="LI";Gn.allowedChildren=[Vn];Vn.requiredContainer=Gn;class Fn extends Jt{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)}}q(Fn,"blotName","bold"),q(Fn,"tagName",["STRONG","B"]);class li extends Fn{}q(li,"blotName","italic"),q(li,"tagName",["EM","I"]);class be extends Jt{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 Ro(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))}}q(be,"blotName","link"),q(be,"tagName","A"),q(be,"SANITIZED_URL","about:blank"),q(be,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function Ro(r,t){const e=document.createElement("a");e.href=r;const n=e.href.slice(0,e.href.indexOf(":"));return t.indexOf(n)>-1}class oi extends Jt{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"}}q(oi,"blotName","script"),q(oi,"tagName",["SUB","SUP"]);class ai extends Fn{}q(ai,"blotName","strike"),q(ai,"tagName",["S","STRIKE"]);class ci extends Jt{}q(ci,"blotName","underline"),q(ci,"tagName","U");class xr extends vi{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>`}}q(xr,"blotName","formula"),q(xr,"className","ql-formula"),q(xr,"tagName","SPAN");const Sl=["alt","height","width"];class ui 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 Sl.reduce((e,n)=>(t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e),{})}static match(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}static sanitize(t){return Ro(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,e){Sl.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}}q(ui,"blotName","image"),q(ui,"tagName","IMG");const _l=["height","width"];class Lr extends Ct{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 _l.reduce((e,n)=>(t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e),{})}static sanitize(t){return be.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,e){_l.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>`}}q(Lr,"blotName","video"),q(Lr,"className","ql-video"),q(Lr,"tagName","IFRAME");const In=new Ft("code-token","hljs",{scope:D.INLINE});class oe extends Jt{static formats(t,e){for(;t!=null&&t!==e.domNode;){if(t.classList&&t.classList.contains(At.className))return super.formats(t,e);t=t.parentNode}}constructor(t,e,n){super(t,e,n),In.add(this.domNode,n)}format(t,e){t!==oe.blotName?super.format(t,e):e?In.add(this.domNode,e):(In.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),In.value(this.domNode)||this.unwrap()}}oe.blotName="code-token";oe.className="ql-token";class qt extends At{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(),oe.blotName,!1),super.replaceWith(t,e)}}class kn extends De{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(t,e){t===qt.blotName&&(this.forceNext=!0,this.children.forEach(n=>{n.format(t,e)}))}formatAt(t,e,n,s){n===qt.blotName&&(this.forceNext=!0),super.formatAt(t,e,n,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(o=>o!==this.uiNode).map(o=>o.textContent).join(`
40
+ `):e.attributes!=null?Object.keys(e.attributes).some(n=>r.query(n,D.BLOCK)!=null):!1}function Id(r,t){const e=t.reduce((s,i)=>s+(i.delete||0),0);let n=t.length()-e;return Cd(r,t)&&(n-=1),n}function ri(r,t){if(!r)return r;const e=t.transformPosition(r.index),n=t.transformPosition(r.index+r.length);return{index:e,length:n-e}}class Io extends zt{constructor(t,e){super(t,e),t.root.addEventListener("drop",n=>{var o;n.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(n.clientX,n.clientY);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(n.clientX,n.clientY);s=document.createRange(),s.setStart(a.offsetNode,a.offset),s.setEnd(a.offsetNode,a.offset)}const i=s&&t.selection.normalizeNative(s);if(i){const a=t.selection.normalizedToRange(i);(o=n.dataTransfer)!=null&&o.files&&this.upload(a,n.dataTransfer.files)}})}upload(t,e){const n=[];Array.from(e).forEach(s=>{var i;s&&((i=this.options.mimetypes)!=null&&i.includes(s.type))&&n.push(s)}),n.length>0&&this.options.handler.call(this,t,n)}}Io.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(r,t){if(!this.quill.scroll.query("image"))return;const e=t.map(n=>new Promise(s=>{const i=new FileReader;i.onload=()=>{s(i.result)},i.readAsDataURL(n)}));Promise.all(e).then(n=>{const s=n.reduce((i,o)=>i.insert({image:o}),new B().retain(r.index).delete(r.length));this.quill.updateContents(s,R.sources.USER),this.quill.setSelection(r.index+n.length,R.sources.SILENT)})}};const Rd=["insertText","insertReplacementText"];class kd extends zt{constructor(t,e){super(t,e),t.root.addEventListener("beforeinput",n=>{this.handleBeforeInput(n)}),/Android/i.test(navigator.userAgent)||t.on(N.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(t){xi({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 n=this.quill.getFormat(t.index,1);this.deleteRange(t),this.quill.updateContents(new B().retain(t.index).insert(e,n),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||!Rd.includes(t.inputType))return;const e=t.getTargetRanges?t.getTargetRanges()[0]:null;if(!e||e.collapsed===!0)return;const n=Bd(t);if(n==null)return;const s=this.quill.selection.normalizeNative(e),i=s?this.quill.selection.normalizedToRange(s):null;i&&this.replaceText(i,n)&&t.preventDefault()}handleCompositionStart(){const t=this.quill.getSelection();t&&this.replaceText(t)}}function Bd(r){var t;return typeof r.data=="string"?r.data:(t=r.dataTransfer)!=null&&t.types.includes("text/plain")?r.dataTransfer.getData("text/plain"):null}const Md=/Mac/i.test(navigator.platform),Dd=100,jd=r=>!!(r.key==="ArrowLeft"||r.key==="ArrowRight"||r.key==="ArrowUp"||r.key==="ArrowDown"||r.key==="Home"||Md&&r.key==="a"&&r.ctrlKey===!0);class $d extends zt{constructor(e,n){super(e,n);q(this,"isListening",!1);q(this,"selectionChangeDeadline",0);this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,n){let{line:s,event:i}=n;if(!(s instanceof Pt)||!s.uiNode)return!0;const o=getComputedStyle(s.domNode).direction==="rtl";return o&&i.key!=="ArrowRight"||!o&&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&&jd(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+Dd,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 n=e.getRangeAt(0);if(n.collapsed!==!0||n.startOffset!==0)return;const s=this.quill.scroll.find(n.startContainer);if(!(s instanceof Pt)||!s.uiNode)return;const i=document.createRange();i.setStartAfter(s.uiNode),i.setEndAfter(s.uiNode),e.removeAllRanges(),e.addRange(i)}}N.register({"blots/block":pt,"blots/block/embed":Ct,"blots/break":Ht,"blots/container":Me,"blots/cursor":an,"blots/embed":vi,"blots/inline":Jt,"blots/scroll":en,"blots/text":Ut,"modules/clipboard":Oo,"modules/history":Co,"modules/keyboard":Dr,"modules/uploader":Io,"modules/input":kd,"modules/uiNode":$d});class Pd extends Ft{add(t,e){let n=0;if(e==="+1"||e==="-1"){const s=this.value(t)||0;n=e==="+1"?s+1:s-1}else typeof e=="number"&&(n=e);return n===0?(this.remove(t),!0):super.add(t,n.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 Ud=new Pd("indent","ql-indent",{scope:D.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class si extends pt{}q(si,"blotName","blockquote"),q(si,"tagName","blockquote");class ii extends pt{static formats(t){return this.tagName.indexOf(t.tagName)+1}}q(ii,"blotName","header"),q(ii,"tagName",["H1","H2","H3","H4","H5","H6"]);class Gn extends Me{}Gn.blotName="list-container";Gn.tagName="OL";class Vn extends pt{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(Gn)}constructor(t,e){super(t,e);const n=e.ownerDocument.createElement("span"),s=i=>{if(!t.isEnabled())return;const o=this.statics.formats(e,t);o==="checked"?(this.format("list","unchecked"),i.preventDefault()):o==="unchecked"&&(this.format("list","checked"),i.preventDefault())};n.addEventListener("mousedown",s),n.addEventListener("touchstart",s),this.attachUI(n)}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-list",e):super.format(t,e)}}Vn.blotName="list";Vn.tagName="LI";Gn.allowedChildren=[Vn];Vn.requiredContainer=Gn;class Fn extends Jt{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)}}q(Fn,"blotName","bold"),q(Fn,"tagName",["STRONG","B"]);class li extends Fn{}q(li,"blotName","italic"),q(li,"tagName",["EM","I"]);class be extends Jt{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 Ro(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))}}q(be,"blotName","link"),q(be,"tagName","A"),q(be,"SANITIZED_URL","about:blank"),q(be,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function Ro(r,t){const e=document.createElement("a");e.href=r;const n=e.href.slice(0,e.href.indexOf(":"));return t.indexOf(n)>-1}class oi extends Jt{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"}}q(oi,"blotName","script"),q(oi,"tagName",["SUB","SUP"]);class ai extends Fn{}q(ai,"blotName","strike"),q(ai,"tagName",["S","STRIKE"]);class ci extends Jt{}q(ci,"blotName","underline"),q(ci,"tagName","U");class xr extends vi{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>`}}q(xr,"blotName","formula"),q(xr,"className","ql-formula"),q(xr,"tagName","SPAN");const Sl=["alt","height","width"];class ui 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 Sl.reduce((e,n)=>(t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e),{})}static match(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}static sanitize(t){return Ro(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,e){Sl.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}}q(ui,"blotName","image"),q(ui,"tagName","IMG");const _l=["height","width"];class Lr extends Ct{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 _l.reduce((e,n)=>(t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e),{})}static sanitize(t){return be.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,e){_l.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>`}}q(Lr,"blotName","video"),q(Lr,"className","ql-video"),q(Lr,"tagName","IFRAME");const In=new Ft("code-token","hljs",{scope:D.INLINE});class oe extends Jt{static formats(t,e){for(;t!=null&&t!==e.domNode;){if(t.classList&&t.classList.contains(At.className))return super.formats(t,e);t=t.parentNode}}constructor(t,e,n){super(t,e,n),In.add(this.domNode,n)}format(t,e){t!==oe.blotName?super.format(t,e):e?In.add(this.domNode,e):(In.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),In.value(this.domNode)||this.unwrap()}}oe.blotName="code-token";oe.className="ql-token";class qt extends At{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(),oe.blotName,!1),super.replaceWith(t,e)}}class kn extends De{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(t,e){t===qt.blotName&&(this.forceNext=!0,this.children.forEach(n=>{n.format(t,e)}))}formatAt(t,e,n,s){n===qt.blotName&&(this.forceNext=!0),super.formatAt(t,e,n,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(o=>o!==this.uiNode).map(o=>o.textContent).join(`
41
41
  `)}
42
42
  `,i=qt.formats(this.children.head.domNode);if(e||this.forceNext||this.cachedText!==s){if(s.trim().length>0||this.cachedText==null){const o=this.children.reduce((u,h)=>u.concat(mo(h,!1)),new B),a=t(s,i);o.diff(a).reduce((u,h)=>{let{retain:p,attributes:v}=h;return p?(v&&Object.keys(v).forEach(f=>{[qt.blotName,oe.blotName].includes(f)&&this.formatAt(u,p,f,v[f])}),u+p):u},0)}this.cachedText=s,this.forceNext=!1}}html(t,e){const[n]=this.children.find(t);return`<pre data-language="${n?qt.formats(n.domNode):"plain"}">
43
43
  ${Mr(this.code(t,e))}
@@ -45,5 +45,5 @@ ${Mr(this.code(t,e))}
45
45
  `).reduce((s,i,o)=>(o!==0&&s.insert(`
46
46
  `,{[At.blotName]:e}),s.insert(i)),new B);const n=this.quill.root.ownerDocument.createElement("div");return n.classList.add(At.className),n.innerHTML=Fd(this.options.hljs,e,t),Li(this.quill.scroll,n,[(s,i)=>{const o=In.value(s);return o?i.compose(new B().retain(i.length(),{[oe.blotName]:o})):i}],[(s,i)=>s.data.split(`
47
47
  `).reduce((o,a,u)=>(u!==0&&o.insert(`
48
- `,{[At.blotName]:e}),o.insert(a)),i)],new WeakMap)}}ko.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 Mn=class Mn extends pt{static create(t){const e=super.create();return t?e.setAttribute("data-row",t):e.setAttribute("data-row",Si()),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===Mn.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()}};q(Mn,"blotName","table"),q(Mn,"tagName","TD");let Pt=Mn;class ae extends Me{checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const t=this.children.head.formats(),e=this.children.tail.formats(),n=this.next.children.head.formats(),s=this.next.children.tail.formats();return t.table===e.table&&t.table===n.table&&t.table===s.table}return!1}optimize(t){super.optimize(t),this.children.forEach(e=>{if(e.next==null)return;const n=e.formats(),s=e.next.formats();if(n.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}}q(ae,"blotName","table-row"),q(ae,"tagName","TR");class Yt extends Me{}q(Yt,"blotName","table-body"),q(Yt,"tagName","TBODY");class un extends Me{balanceCells(){const t=this.descendants(ae),e=t.reduce((n,s)=>Math.max(s.children.length,n),0);t.forEach(n=>{new Array(e-n.children.length).fill(0).forEach(()=>{let s;n.children.head!=null&&(s=Pt.formats(n.children.head.domNode));const i=this.scroll.create(Pt.blotName,s);n.appendChild(i),i.optimize()})})}cells(t){return this.rows().map(e=>e.children.at(t))}deleteColumn(t){const[e]=this.descendant(Yt);e==null||e.children.head==null||e.children.forEach(n=>{const s=n.children.at(t);s!=null&&s.remove()})}insertColumn(t){const[e]=this.descendant(Yt);e==null||e.children.head==null||e.children.forEach(n=>{const s=n.children.at(t),i=Pt.formats(n.children.head.domNode),o=this.scroll.create(Pt.blotName,i);n.insertBefore(o,s)})}insertRow(t){const[e]=this.descendant(Yt);if(e==null||e.children.head==null)return;const n=Si(),s=this.scroll.create(ae.blotName);e.children.head.children.forEach(()=>{const o=this.scroll.create(Pt.blotName,n);s.appendChild(o)});const i=e.children.at(t);e.insertBefore(s,i)}rows(){const t=this.children.head;return t==null?[]:t.children.map(e=>e)}}q(un,"blotName","table-container"),q(un,"tagName","TABLE");un.allowedChildren=[Yt];Yt.requiredContainer=un;Yt.allowedChildren=[ae];ae.requiredContainer=Yt;ae.allowedChildren=[Pt];Pt.requiredContainer=ae;function Si(){return`row-${Math.random().toString(36).slice(2,6)}`}class Hd extends zt{static register(){N.register(Pt),N.register(ae),N.register(Yt),N.register(un)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(un).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,n]=this.quill.getLine(t.index);if(e==null||e.statics.blotName!==Pt.blotName)return[null,null,null,-1];const s=e.parent;return[s.parent.parent,s,e,n]}insertColumn(t){const e=this.quill.getSelection();if(!e)return;const[n,s,i]=this.getTable(e);if(i==null)return;const o=i.cellOffset();n.insertColumn(o+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[n,s,i]=this.getTable(e);if(i==null)return;const o=s.rowOffset();n.insertRow(o+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 n=this.quill.getSelection();if(n==null)return;const s=new Array(t).fill(0).reduce(i=>{const o=new Array(e).fill(`
49
- `).join("");return i.insert(o,{table:Si()})},new B().retain(n.index));this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(n.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,(n,s,i)=>{i===N.sources.USER&&this.balanceTables()}),!0):!1)})}}const Ol=ue("quill:toolbar");class _i extends zt{constructor(t,e){var n,s;if(super(t,e),Array.isArray(this.options.container)){const i=document.createElement("div");i.setAttribute("role","toolbar"),zd(i,this.options.container),(s=(n=t.container)==null?void 0:n.parentNode)==null||s.insertBefore(i,t.container),this.container=i}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){Ol.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(i=>{var a;const o=(a=this.options.handlers)==null?void 0:a[i];o&&this.addHandler(i,o)}),Array.from(this.container.querySelectorAll("button, select")).forEach(i=>{this.attach(i)}),this.quill.on(N.events.EDITOR_CHANGE,()=>{const[i]=this.quill.selection.getRange();this.update(i)})}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){Ol.warn("ignoring attaching to nonexistent format",e,t);return}const n=t.tagName==="SELECT"?"change":"click";t.addEventListener(n,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[o]=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 B().retain(o.index).delete(o.length).insert({[e]:i}),N.sources.USER)}else this.quill.format(e,i,N.sources.USER);this.update(o)}),this.controls.push([e,t])}update(t){const e=t==null?{}:this.quill.getFormat(t);this.controls.forEach(n=>{const[s,i]=n;if(i.tagName==="SELECT"){let o=null;if(t==null)o=null;else if(e[s]==null)o=i.querySelector("option[selected]");else if(!Array.isArray(e[s])){let a=e[s];typeof a=="string"&&(a=a.replace(/"/g,'\\"')),o=i.querySelector(`option[value="${a}"]`)}o==null?(i.value="",i.selectedIndex=-1):o.selected=!0}else if(t==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const o=e[s],a=o===i.getAttribute("value")||o!=null&&o.toString()===i.getAttribute("value")||o==null&&!i.getAttribute("value");i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}else{const o=e[s]!=null;i.classList.toggle("ql-active",o),i.setAttribute("aria-pressed",o.toString())}})}}_i.DEFAULTS={};function ql(r,t,e){const n=document.createElement("button");n.setAttribute("type","button"),n.classList.add(`ql-${t}`),n.setAttribute("aria-pressed","false"),e!=null?(n.value=e,n.setAttribute("aria-label",`${t}: ${e}`)):n.setAttribute("aria-label",t),r.appendChild(n)}function zd(r,t){Array.isArray(t[0])||(t=[t]),t.forEach(e=>{const n=document.createElement("span");n.classList.add("ql-formats"),e.forEach(s=>{if(typeof s=="string")ql(n,s);else{const i=Object.keys(s)[0],o=s[i];Array.isArray(o)?Kd(n,i,o):ql(n,i,o)}}),r.appendChild(n)})}function Kd(r,t,e){const n=document.createElement("select");n.classList.add(`ql-${t}`),e.forEach(s=>{const i=document.createElement("option");s!==!1?i.setAttribute("value",String(s)):i.setAttribute("selected","selected"),n.appendChild(i)}),r.appendChild(n)}_i.DEFAULTS={container:null,handlers:{clean(){const r=this.quill.getSelection();if(r!=null)if(r.length===0){const t=this.quill.getFormat();Object.keys(t).forEach(e=>{this.quill.scroll.query(e,D.INLINE)!=null&&this.quill.format(e,!1,N.sources.USER)})}else this.quill.removeFormat(r.index,r.length,N.sources.USER)},direction(r){const{align:t}=this.quill.getFormat();r==="rtl"&&t==null?this.quill.format("align","right",N.sources.USER):!r&&t==="right"&&this.quill.format("align",!1,N.sources.USER),this.quill.format("direction",r,N.sources.USER)},indent(r){const t=this.quill.getSelection(),e=this.quill.getFormat(t),n=parseInt(e.indent||0,10);if(r==="+1"||r==="-1"){let s=r==="+1"?1:-1;e.direction==="rtl"&&(s*=-1),this.quill.format("indent",n+s,N.sources.USER)}},link(r){r===!0&&(r=prompt("Enter link URL:")),this.quill.format("link",r,N.sources.USER)},list(r){const t=this.quill.getSelection(),e=this.quill.getFormat(t);r==="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",r,N.sources.USER)}}};const Gd='<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>',Vd='<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>',Wd='<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>',Zd='<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>',Xd='<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>',Yd='<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>',Qd='<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>',Jd='<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>',Cl='<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>',tg='<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>',eg='<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>',ng='<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>',rg='<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>',sg='<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>',ig='<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>',lg='<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>',ag='<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>',cg='<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>',ug='<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>',hg='<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>',fg='<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>',dg='<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>',gg='<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>',pg='<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>',mg='<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>',bg='<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>',yg='<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>',vg='<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>',Eg='<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>',Ag='<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>',Ng='<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>',wg='<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>',Hn={align:{"":Gd,center:Vd,right:Wd,justify:Zd},background:Xd,blockquote:Yd,bold:Qd,clean:Jd,code:Cl,"code-block":Cl,color:tg,direction:{"":eg,rtl:ng},formula:rg,header:{1:sg,2:ig,3:lg,4:og,5:ag,6:cg},italic:ug,image:hg,indent:{"+1":fg,"-1":dg},link:gg,list:{bullet:pg,check:mg,ordered:bg},script:{sub:yg,super:vg},strike:Eg,table:Ag,underline:Ng,video:wg},Tg='<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 Il=0;function Rl(r,t){r.setAttribute(t,`${r.getAttribute(t)!=="true"}`)}class jr{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"),Rl(this.label,"aria-expanded"),Rl(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 n=t.getAttribute("value");return n&&e.setAttribute("data-value",n),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=Tg,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-${Il}`,Il+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,Array.from(this.select.options).forEach(e=>{const n=this.buildItem(e);t.appendChild(n),e.selected===!0&&this.selectItem(n)}),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 n=this.container.querySelector(".ql-selected");t!==n&&(n!=null&&n.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 n=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(n)}else this.selectItem(null);const e=t!=null&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",e)}}class Bo extends jr{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(n=>{n.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 n=this.label.querySelector(".ql-color-label"),s=t&&t.getAttribute("data-value")||"";n&&(n.tagName==="line"?n.style.stroke=s:n.style.fill=s)}}class Mo extends jr{constructor(t,e){super(t),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(n=>{n.innerHTML=e[n.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(t,e){super.selectItem(t,e);const n=t||this.defaultItem;if(n!=null){if(this.label.innerHTML===n.innerHTML)return;this.label.innerHTML=n.innerHTML}}}const xg=r=>{const{overflowY:t}=getComputedStyle(r,null);return t!=="visible"&&t!=="clip"};class Do{constructor(t,e){this.quill=t,this.boundsContainer=e||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,xg(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,n=t.bottom+this.quill.root.scrollTop;this.root.style.left=`${e}px`,this.root.style.top=`${n}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let o=0;if(i.right>s.right&&(o=s.right-i.right,this.root.style.left=`${e+o}px`),i.left<s.left&&(o=s.left-i.left,this.root.style.left=`${e+o}px`),i.bottom>s.bottom){const a=i.bottom-i.top,u=t.bottom-t.top+a;this.root.style.top=`${n-u}px`,this.root.classList.add("ql-flip")}return o}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const Lg=[!1,"center","right","justify"],Sg=["#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"],_g=[!1,"serif","monospace"],Og=["1","2","3",!1],qg=["small",!1,"large","huge"];class Wn extends cn{constructor(t,e){super(t,e);const n=s=>{if(!document.body.contains(t.root)){document.body.removeEventListener("click",n);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,n)}addModule(t){const e=super.addModule(t);return t==="toolbar"&&this.extendToolbar(e),e}buildButtons(t,e){Array.from(t).forEach(n=>{(n.getAttribute("class")||"").split(/\s+/).forEach(i=>{if(i.startsWith("ql-")&&(i=i.slice(3),e[i]!=null))if(i==="direction")n.innerHTML=e[i][""]+e[i].rtl;else if(typeof e[i]=="string")n.innerHTML=e[i];else{const o=n.value||"";o!=null&&e[i][o]&&(n.innerHTML=e[i][o])}})})}buildPickers(t,e){this.pickers=Array.from(t).map(s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&On(s,Lg),typeof e.align=="object"))return new Mo(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&&On(s,Sg,i==="background"?"#ffffff":"#000000"),new Bo(s,e[i])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?On(s,_g):s.classList.contains("ql-header")?On(s,Og):s.classList.contains("ql-size")&&On(s,qg)),new jr(s)});const n=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(R.events.EDITOR_CHANGE,n)}}Wn.DEFAULTS=ye({},cn.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let r=this.container.querySelector("input.ql-image[type=file]");r==null&&(r=document.createElement("input"),r.setAttribute("type","file"),r.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),r.classList.add("ql-image"),r.addEventListener("change",()=>{const t=this.quill.getSelection(!0);this.quill.uploader.upload(t,r.files),r.value=""}),this.container.appendChild(r)),r.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class jo extends Do{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 n=this.quill.getBounds(this.quill.selection.savedRange);n!=null&&this.position(n),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,R.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,R.sources.USER)),this.quill.root.scrollTop=e;break}case"video":t=Cg(t);case"formula":{if(!t)break;const e=this.quill.getSelection(!0);if(e!=null){const n=e.index+e.length;this.quill.insertEmbed(n,this.root.getAttribute("data-mode"),t,R.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(n+1," ",R.sources.USER),this.quill.setSelection(n+2,R.sources.USER)}break}}this.textbox.value="",this.hide()}}function Cg(r){let t=r.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||r.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return t?`${t[1]||"https"}://www.youtube.com/embed/${t[2]}?showinfo=0`:(t=r.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${t[1]||"https"}://player.vimeo.com/video/${t[2]}/`:r}function On(r,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t.forEach(n=>{const s=document.createElement("option");n===e?s.setAttribute("selected","selected"):s.setAttribute("value",String(n)),r.appendChild(s)})}const Ig=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Po extends jo{constructor(t,e){super(t,e),this.quill.on(R.events.EDITOR_CHANGE,(n,s,i,o)=>{if(n===R.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&o===R.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 u=this.quill.getBounds(s);u!=null&&this.position(u)}else{const u=a[a.length-1],h=this.quill.getIndex(u),p=Math.min(u.length()-1,s.index+s.length-h),v=this.quill.getBounds(new Ie(h,p));v!=null&&this.position(v)}}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(R.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),n=this.root.querySelector(".ql-tooltip-arrow");return n.style.marginLeft="",e!==0&&(n.style.marginLeft=`${-1*e-n.offsetWidth/2}px`),e}}q(Po,"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 $o extends Wn{constructor(t,e){e.modules.toolbar!=null&&e.modules.toolbar.container==null&&(e.modules.toolbar.container=Ig),super(t,e),this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new Po(this.quill,this.options.bounds),t.container!=null&&(this.tooltip.root.appendChild(t.container),this.buildButtons(t.container.querySelectorAll("button"),Hn),this.buildPickers(t.container.querySelectorAll("select"),Hn))}}$o.DEFAULTS=ye({},Wn.DEFAULTS,{modules:{toolbar:{handlers:{link(r){r?this.quill.theme.tooltip.edit():this.quill.format("link",!1,N.sources.USER)}}}}});const Rg=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Uo extends jo{constructor(){super(...arguments);q(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 n=this.linkRange;this.restoreFocus(),this.quill.formatText(n,"link",!1,R.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()}),this.quill.on(R.events.SELECTION_CHANGE,(e,n,s)=>{if(e!=null){if(e.length===0&&s===R.sources.USER){const[i,o]=this.quill.scroll.descendant(be,e.index);if(i!=null){this.linkRange=new Ie(e.index-o,i.length());const a=be.formats(i.domNode);this.preview.textContent=a,this.preview.setAttribute("href",a),this.show();const u=this.quill.getBounds(this.linkRange);u!=null&&this.position(u);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}q(Uo,"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 Fo extends Wn{constructor(t,e){e.modules.toolbar!=null&&e.modules.toolbar.container==null&&(e.modules.toolbar.container=Rg),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"),Hn),this.buildPickers(t.container.querySelectorAll("select"),Hn),this.tooltip=new Uo(this.quill,this.options.bounds),t.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(e,n)=>{t.handlers.link.call(t,!n.format.link)}))}}Fo.DEFAULTS=ye({},Wn.DEFAULTS,{modules:{toolbar:{handlers:{link(r){if(r){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:n}=this.quill.theme;n.edit("link",e)}else this.quill.format("link",!1,N.sources.USER)}}}}});N.register({"attributors/attribute/direction":Ao,"attributors/class/align":yo,"attributors/class/background":Yf,"attributors/class/color":Xf,"attributors/class/direction":No,"attributors/class/font":xo,"attributors/class/size":So,"attributors/style/align":vo,"attributors/style/background":Ni,"attributors/style/color":Ai,"attributors/style/direction":wo,"attributors/style/font":Lo,"attributors/style/size":_o},!0);N.register({"formats/align":yo,"formats/direction":No,"formats/indent":Ud,"formats/background":Ni,"formats/color":Ai,"formats/font":xo,"formats/size":So,"formats/blockquote":si,"formats/code-block":At,"formats/header":ii,"formats/list":Vn,"formats/bold":Fn,"formats/code":wi,"formats/italic":li,"formats/link":be,"formats/script":oi,"formats/strike":ai,"formats/underline":ci,"formats/formula":xr,"formats/image":ui,"formats/video":Lr,"modules/syntax":ko,"modules/table":Hd,"modules/toolbar":_i,"themes/bubble":$o,"themes/snow":Fo,"ui/icons":Hn,"ui/picker":jr,"ui/icon-picker":Mo,"ui/color-picker":Bo,"ui/tooltip":Do},!0);var Pr=class extends Oe.Component{constructor(r){super(r),this.editingAreaRef=qi.createRef(),this.containerRef=qi.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,n,s,i)=>{var o,a;e==="text-change"?(o=this.onEditorChangeText)==null||o.call(this,this.props.useSemanticHTML!==!1?this.editor.getSemanticHTML():this.editor.root.innerHTML,n,i,this.unprivilegedEditor):e==="selection-change"&&((a=this.onEditorChangeSelection)==null||a.call(this,n,i,this.unprivilegedEditor))};const t=this.isControlled()?r.value:r.defaultValue;this.value=t??""}validateProps(r){if(Oe.Children.count(r.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(Oe.Children.count(r.children)){const t=Oe.Children.only(r.children);if((t==null?void 0:t.type)==="textarea")throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.")}if(this.lastDeltaChangeSet&&r.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(r,t){if(this.validateProps(r),!this.editor||this.state.generation!==t.generation)return!0;if("value"in r){const e=this.getEditorContents(),n=r.value??"";this.isEqualValue(n,e)||this.setEditorContents(this.editor,n)}return r.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,r.readOnly),[...this.cleanProps,...this.dirtyProps].some(e=>!ge(r[e],this.props[e]))}shouldComponentRegenerate(r){return this.dirtyProps.some(t=>!ge(r[t],this.props[t]))}componentDidMount(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())}componentWillUnmount(){this.destroyEditor()}componentDidUpdate(r,t){if(this.editor&&this.shouldComponentRegenerate(r)){const e=this.editor.getContents(),n=this.editor.getSelection();this.regenerationSnapshot={delta:e,selection:n},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.editor&&r.placeholder!==this.props.placeholder&&(this.editor.root.dataset.placeholder=this.props.placeholder||""),this.state.generation!==t.generation){const{delta:e,selection:n}=this.regenerationSnapshot;delete this.regenerationSnapshot,this.instantiateEditor();const s=this.editor;s.setContents(e),kl(()=>this.setEditorSelection(s,n))}}instantiateEditor(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())}destroyEditor(){var e,n;if(!this.editor)return;this.unhookEditor(this.editor);const r=(e=this.props.modules)==null?void 0:e.toolbar;if(!(typeof r=="object"&&r&&"container"in r&&typeof r.container=="string"||typeof r=="string")){const s=(n=this.containerRef.current)==null?void 0:n.querySelector(".ql-toolbar");s&&s.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(r,t){const e=new N(r,t);return t.tabIndex!=null&&this.setEditorTabIndex(e,t.tabIndex),this.hookEditor(e),e}hookEditor(r){this.unprivilegedEditor=this.makeUnprivilegedEditor(r),r.on("editor-change",this.onEditorChange)}unhookEditor(r){r.off("editor-change",this.onEditorChange)}getEditorContents(){return this.value}getEditorSelection(){return this.selection}isDelta(r){return r&&r.ops}isEqualValue(r,t){return this.isDelta(r)&&this.isDelta(t)?ge(r.ops,t.ops):ge(r,t)}setEditorContents(r,t){this.value=t;const e=this.getEditorSelection();typeof t=="string"?r.setContents(r.clipboard.convert({html:t})):r.setContents(t),kl(()=>this.setEditorSelection(r,e))}setEditorSelection(r,t){if(this.selection=t,t){const e=r.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)),r.setSelection(t)}}setEditorTabIndex(r,t){var e;(e=r==null?void 0:r.scroll)!=null&&e.domNode&&(r.scroll.domNode.tabIndex=t)}setEditorReadOnly(r,t){t?r.disable():r.enable()}makeUnprivilegedEditor(r){const t=r;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 r=this.editingAreaRef.current;if(!r)throw new Error("Cannot find element for editing area");if(r.nodeType===3)throw new Error("Editing area cannot be a text node");return r}renderEditingArea(){const{children:r,preserveWhitespace:t}=this.props,{generation:e}=this.state;return Oe.Children.count(r)?Oe.cloneElement(Oe.Children.only(r),{key:e,ref:this.editingAreaRef}):t?Ss.jsx("pre",{ref:this.editingAreaRef},e):Ss.jsx("div",{ref:this.editingAreaRef},e)}render(){return Ss.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(r,t,e,n){var i,o;if(!this.editor)return;const s=this.isDelta(this.value)?n.getContents():this.props.useSemanticHTML!==!1?n.getSemanticHTML():n.getHTML();s!==this.getEditorContents()&&(this.lastDeltaChangeSet=t,this.value=s,(o=(i=this.props).onChange)==null||o.call(i,r,t,e,n))}onEditorChangeSelection(r,t,e){var o,a,u,h,p,v;if(!this.editor)return;const n=this.getEditorSelection(),s=!n&&r,i=n&&!r;ge(r,n)||(this.selection=r,(a=(o=this.props).onChangeSelection)==null||a.call(o,r,t,e),s?(h=(u=this.props).onFocus)==null||h.call(u,r,t,e):i&&((v=(p=this.props).onBlur)==null||v.call(p,n,t,e)))}focus(){this.editor&&this.editor.focus()}blur(){this.editor&&(this.selection=null,this.editor.blur())}};Pr.displayName="React Quill";Pr.Quill=N;Pr.defaultProps={theme:"snow",modules:{},readOnly:!1};function kl(r){Promise.resolve().then(r)}var Ug=Pr;export{N as Quill,Ug as default};
48
+ `,{[At.blotName]:e}),o.insert(a)),i)],new WeakMap)}}ko.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 Mn=class Mn extends pt{static create(t){const e=super.create();return t?e.setAttribute("data-row",t):e.setAttribute("data-row",Si()),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===Mn.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()}};q(Mn,"blotName","table"),q(Mn,"tagName","TD");let $t=Mn;class ae extends Me{checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const t=this.children.head.formats(),e=this.children.tail.formats(),n=this.next.children.head.formats(),s=this.next.children.tail.formats();return t.table===e.table&&t.table===n.table&&t.table===s.table}return!1}optimize(t){super.optimize(t),this.children.forEach(e=>{if(e.next==null)return;const n=e.formats(),s=e.next.formats();if(n.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}}q(ae,"blotName","table-row"),q(ae,"tagName","TR");class Yt extends Me{}q(Yt,"blotName","table-body"),q(Yt,"tagName","TBODY");class un extends Me{balanceCells(){const t=this.descendants(ae),e=t.reduce((n,s)=>Math.max(s.children.length,n),0);t.forEach(n=>{new Array(e-n.children.length).fill(0).forEach(()=>{let s;n.children.head!=null&&(s=$t.formats(n.children.head.domNode));const i=this.scroll.create($t.blotName,s);n.appendChild(i),i.optimize()})})}cells(t){return this.rows().map(e=>e.children.at(t))}deleteColumn(t){const[e]=this.descendant(Yt);e==null||e.children.head==null||e.children.forEach(n=>{const s=n.children.at(t);s!=null&&s.remove()})}insertColumn(t){const[e]=this.descendant(Yt);e==null||e.children.head==null||e.children.forEach(n=>{const s=n.children.at(t),i=$t.formats(n.children.head.domNode),o=this.scroll.create($t.blotName,i);n.insertBefore(o,s)})}insertRow(t){const[e]=this.descendant(Yt);if(e==null||e.children.head==null)return;const n=Si(),s=this.scroll.create(ae.blotName);e.children.head.children.forEach(()=>{const o=this.scroll.create($t.blotName,n);s.appendChild(o)});const i=e.children.at(t);e.insertBefore(s,i)}rows(){const t=this.children.head;return t==null?[]:t.children.map(e=>e)}}q(un,"blotName","table-container"),q(un,"tagName","TABLE");un.allowedChildren=[Yt];Yt.requiredContainer=un;Yt.allowedChildren=[ae];ae.requiredContainer=Yt;ae.allowedChildren=[$t];$t.requiredContainer=ae;function Si(){return`row-${Math.random().toString(36).slice(2,6)}`}class Hd extends zt{static register(){N.register($t),N.register(ae),N.register(Yt),N.register(un)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(un).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,n]=this.quill.getLine(t.index);if(e==null||e.statics.blotName!==$t.blotName)return[null,null,null,-1];const s=e.parent;return[s.parent.parent,s,e,n]}insertColumn(t){const e=this.quill.getSelection();if(!e)return;const[n,s,i]=this.getTable(e);if(i==null)return;const o=i.cellOffset();n.insertColumn(o+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[n,s,i]=this.getTable(e);if(i==null)return;const o=s.rowOffset();n.insertRow(o+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 n=this.quill.getSelection();if(n==null)return;const s=new Array(t).fill(0).reduce(i=>{const o=new Array(e).fill(`
49
+ `).join("");return i.insert(o,{table:Si()})},new B().retain(n.index));this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(n.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,(n,s,i)=>{i===N.sources.USER&&this.balanceTables()}),!0):!1)})}}const Ol=ue("quill:toolbar");class _i extends zt{constructor(t,e){var n,s;if(super(t,e),Array.isArray(this.options.container)){const i=document.createElement("div");i.setAttribute("role","toolbar"),zd(i,this.options.container),(s=(n=t.container)==null?void 0:n.parentNode)==null||s.insertBefore(i,t.container),this.container=i}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){Ol.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(i=>{var a;const o=(a=this.options.handlers)==null?void 0:a[i];o&&this.addHandler(i,o)}),Array.from(this.container.querySelectorAll("button, select")).forEach(i=>{this.attach(i)}),this.quill.on(N.events.EDITOR_CHANGE,()=>{const[i]=this.quill.selection.getRange();this.update(i)})}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){Ol.warn("ignoring attaching to nonexistent format",e,t);return}const n=t.tagName==="SELECT"?"change":"click";t.addEventListener(n,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[o]=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 B().retain(o.index).delete(o.length).insert({[e]:i}),N.sources.USER)}else this.quill.format(e,i,N.sources.USER);this.update(o)}),this.controls.push([e,t])}update(t){const e=t==null?{}:this.quill.getFormat(t);this.controls.forEach(n=>{const[s,i]=n;if(i.tagName==="SELECT"){let o=null;if(t==null)o=null;else if(e[s]==null)o=i.querySelector("option[selected]");else if(!Array.isArray(e[s])){let a=e[s];typeof a=="string"&&(a=a.replace(/"/g,'\\"')),o=i.querySelector(`option[value="${a}"]`)}o==null?(i.value="",i.selectedIndex=-1):o.selected=!0}else if(t==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const o=e[s],a=o===i.getAttribute("value")||o!=null&&o.toString()===i.getAttribute("value")||o==null&&!i.getAttribute("value");i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}else{const o=e[s]!=null;i.classList.toggle("ql-active",o),i.setAttribute("aria-pressed",o.toString())}})}}_i.DEFAULTS={};function ql(r,t,e){const n=document.createElement("button");n.setAttribute("type","button"),n.classList.add(`ql-${t}`),n.setAttribute("aria-pressed","false"),e!=null?(n.value=e,n.setAttribute("aria-label",`${t}: ${e}`)):n.setAttribute("aria-label",t),r.appendChild(n)}function zd(r,t){Array.isArray(t[0])||(t=[t]),t.forEach(e=>{const n=document.createElement("span");n.classList.add("ql-formats"),e.forEach(s=>{if(typeof s=="string")ql(n,s);else{const i=Object.keys(s)[0],o=s[i];Array.isArray(o)?Kd(n,i,o):ql(n,i,o)}}),r.appendChild(n)})}function Kd(r,t,e){const n=document.createElement("select");n.classList.add(`ql-${t}`),e.forEach(s=>{const i=document.createElement("option");s!==!1?i.setAttribute("value",String(s)):i.setAttribute("selected","selected"),n.appendChild(i)}),r.appendChild(n)}_i.DEFAULTS={container:null,handlers:{clean(){const r=this.quill.getSelection();if(r!=null)if(r.length===0){const t=this.quill.getFormat();Object.keys(t).forEach(e=>{this.quill.scroll.query(e,D.INLINE)!=null&&this.quill.format(e,!1,N.sources.USER)})}else this.quill.removeFormat(r.index,r.length,N.sources.USER)},direction(r){const{align:t}=this.quill.getFormat();r==="rtl"&&t==null?this.quill.format("align","right",N.sources.USER):!r&&t==="right"&&this.quill.format("align",!1,N.sources.USER),this.quill.format("direction",r,N.sources.USER)},indent(r){const t=this.quill.getSelection(),e=this.quill.getFormat(t),n=parseInt(e.indent||0,10);if(r==="+1"||r==="-1"){let s=r==="+1"?1:-1;e.direction==="rtl"&&(s*=-1),this.quill.format("indent",n+s,N.sources.USER)}},link(r){r===!0&&(r=prompt("Enter link URL:")),this.quill.format("link",r,N.sources.USER)},list(r){const t=this.quill.getSelection(),e=this.quill.getFormat(t);r==="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",r,N.sources.USER)}}};const Gd='<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>',Vd='<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>',Wd='<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>',Zd='<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>',Xd='<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>',Yd='<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>',Qd='<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>',Jd='<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>',Cl='<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>',tg='<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>',eg='<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>',ng='<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>',rg='<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>',sg='<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>',ig='<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>',lg='<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>',ag='<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>',cg='<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>',ug='<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>',hg='<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>',fg='<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>',dg='<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>',gg='<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>',pg='<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>',mg='<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>',bg='<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>',yg='<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>',vg='<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>',Eg='<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>',Ag='<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>',Ng='<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>',wg='<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>',Hn={align:{"":Gd,center:Vd,right:Wd,justify:Zd},background:Xd,blockquote:Yd,bold:Qd,clean:Jd,code:Cl,"code-block":Cl,color:tg,direction:{"":eg,rtl:ng},formula:rg,header:{1:sg,2:ig,3:lg,4:og,5:ag,6:cg},italic:ug,image:hg,indent:{"+1":fg,"-1":dg},link:gg,list:{bullet:pg,check:mg,ordered:bg},script:{sub:yg,super:vg},strike:Eg,table:Ag,underline:Ng,video:wg},Tg='<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 Il=0;function Rl(r,t){r.setAttribute(t,`${r.getAttribute(t)!=="true"}`)}class jr{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"),Rl(this.label,"aria-expanded"),Rl(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 n=t.getAttribute("value");return n&&e.setAttribute("data-value",n),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=Tg,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-${Il}`,Il+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,Array.from(this.select.options).forEach(e=>{const n=this.buildItem(e);t.appendChild(n),e.selected===!0&&this.selectItem(n)}),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 n=this.container.querySelector(".ql-selected");t!==n&&(n!=null&&n.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 n=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(n)}else this.selectItem(null);const e=t!=null&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",e)}}class Bo extends jr{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(n=>{n.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 n=this.label.querySelector(".ql-color-label"),s=t&&t.getAttribute("data-value")||"";n&&(n.tagName==="line"?n.style.stroke=s:n.style.fill=s)}}class Mo extends jr{constructor(t,e){super(t),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(n=>{n.innerHTML=e[n.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(t,e){super.selectItem(t,e);const n=t||this.defaultItem;if(n!=null){if(this.label.innerHTML===n.innerHTML)return;this.label.innerHTML=n.innerHTML}}}const xg=r=>{const{overflowY:t}=getComputedStyle(r,null);return t!=="visible"&&t!=="clip"};class Do{constructor(t,e){this.quill=t,this.boundsContainer=e||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,xg(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,n=t.bottom+this.quill.root.scrollTop;this.root.style.left=`${e}px`,this.root.style.top=`${n}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let o=0;if(i.right>s.right&&(o=s.right-i.right,this.root.style.left=`${e+o}px`),i.left<s.left&&(o=s.left-i.left,this.root.style.left=`${e+o}px`),i.bottom>s.bottom){const a=i.bottom-i.top,u=t.bottom-t.top+a;this.root.style.top=`${n-u}px`,this.root.classList.add("ql-flip")}return o}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const Lg=[!1,"center","right","justify"],Sg=["#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"],_g=[!1,"serif","monospace"],Og=["1","2","3",!1],qg=["small",!1,"large","huge"];class Wn extends cn{constructor(t,e){super(t,e);const n=s=>{if(!document.body.contains(t.root)){document.body.removeEventListener("click",n);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,n)}addModule(t){const e=super.addModule(t);return t==="toolbar"&&this.extendToolbar(e),e}buildButtons(t,e){Array.from(t).forEach(n=>{(n.getAttribute("class")||"").split(/\s+/).forEach(i=>{if(i.startsWith("ql-")&&(i=i.slice(3),e[i]!=null))if(i==="direction")n.innerHTML=e[i][""]+e[i].rtl;else if(typeof e[i]=="string")n.innerHTML=e[i];else{const o=n.value||"";o!=null&&e[i][o]&&(n.innerHTML=e[i][o])}})})}buildPickers(t,e){this.pickers=Array.from(t).map(s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&On(s,Lg),typeof e.align=="object"))return new Mo(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&&On(s,Sg,i==="background"?"#ffffff":"#000000"),new Bo(s,e[i])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?On(s,_g):s.classList.contains("ql-header")?On(s,Og):s.classList.contains("ql-size")&&On(s,qg)),new jr(s)});const n=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(R.events.EDITOR_CHANGE,n)}}Wn.DEFAULTS=ye({},cn.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let r=this.container.querySelector("input.ql-image[type=file]");r==null&&(r=document.createElement("input"),r.setAttribute("type","file"),r.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),r.classList.add("ql-image"),r.addEventListener("change",()=>{const t=this.quill.getSelection(!0);this.quill.uploader.upload(t,r.files),r.value=""}),this.container.appendChild(r)),r.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class jo extends Do{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 n=this.quill.getBounds(this.quill.selection.savedRange);n!=null&&this.position(n),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,R.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,R.sources.USER)),this.quill.root.scrollTop=e;break}case"video":t=Cg(t);case"formula":{if(!t)break;const e=this.quill.getSelection(!0);if(e!=null){const n=e.index+e.length;this.quill.insertEmbed(n,this.root.getAttribute("data-mode"),t,R.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(n+1," ",R.sources.USER),this.quill.setSelection(n+2,R.sources.USER)}break}}this.textbox.value="",this.hide()}}function Cg(r){let t=r.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||r.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return t?`${t[1]||"https"}://www.youtube.com/embed/${t[2]}?showinfo=0`:(t=r.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${t[1]||"https"}://player.vimeo.com/video/${t[2]}/`:r}function On(r,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t.forEach(n=>{const s=document.createElement("option");n===e?s.setAttribute("selected","selected"):s.setAttribute("value",String(n)),r.appendChild(s)})}const Ig=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class $o extends jo{constructor(t,e){super(t,e),this.quill.on(R.events.EDITOR_CHANGE,(n,s,i,o)=>{if(n===R.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&o===R.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 u=this.quill.getBounds(s);u!=null&&this.position(u)}else{const u=a[a.length-1],h=this.quill.getIndex(u),p=Math.min(u.length()-1,s.index+s.length-h),v=this.quill.getBounds(new Ie(h,p));v!=null&&this.position(v)}}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(R.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),n=this.root.querySelector(".ql-tooltip-arrow");return n.style.marginLeft="",e!==0&&(n.style.marginLeft=`${-1*e-n.offsetWidth/2}px`),e}}q($o,"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 Po extends Wn{constructor(t,e){e.modules.toolbar!=null&&e.modules.toolbar.container==null&&(e.modules.toolbar.container=Ig),super(t,e),this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new $o(this.quill,this.options.bounds),t.container!=null&&(this.tooltip.root.appendChild(t.container),this.buildButtons(t.container.querySelectorAll("button"),Hn),this.buildPickers(t.container.querySelectorAll("select"),Hn))}}Po.DEFAULTS=ye({},Wn.DEFAULTS,{modules:{toolbar:{handlers:{link(r){r?this.quill.theme.tooltip.edit():this.quill.format("link",!1,N.sources.USER)}}}}});const Rg=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Uo extends jo{constructor(){super(...arguments);q(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 n=this.linkRange;this.restoreFocus(),this.quill.formatText(n,"link",!1,R.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()}),this.quill.on(R.events.SELECTION_CHANGE,(e,n,s)=>{if(e!=null){if(e.length===0&&s===R.sources.USER){const[i,o]=this.quill.scroll.descendant(be,e.index);if(i!=null){this.linkRange=new Ie(e.index-o,i.length());const a=be.formats(i.domNode);this.preview.textContent=a,this.preview.setAttribute("href",a),this.show();const u=this.quill.getBounds(this.linkRange);u!=null&&this.position(u);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}q(Uo,"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 Fo extends Wn{constructor(t,e){e.modules.toolbar!=null&&e.modules.toolbar.container==null&&(e.modules.toolbar.container=Rg),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"),Hn),this.buildPickers(t.container.querySelectorAll("select"),Hn),this.tooltip=new Uo(this.quill,this.options.bounds),t.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(e,n)=>{t.handlers.link.call(t,!n.format.link)}))}}Fo.DEFAULTS=ye({},Wn.DEFAULTS,{modules:{toolbar:{handlers:{link(r){if(r){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:n}=this.quill.theme;n.edit("link",e)}else this.quill.format("link",!1,N.sources.USER)}}}}});N.register({"attributors/attribute/direction":Ao,"attributors/class/align":yo,"attributors/class/background":Yf,"attributors/class/color":Xf,"attributors/class/direction":No,"attributors/class/font":xo,"attributors/class/size":So,"attributors/style/align":vo,"attributors/style/background":Ni,"attributors/style/color":Ai,"attributors/style/direction":wo,"attributors/style/font":Lo,"attributors/style/size":_o},!0);N.register({"formats/align":yo,"formats/direction":No,"formats/indent":Ud,"formats/background":Ni,"formats/color":Ai,"formats/font":xo,"formats/size":So,"formats/blockquote":si,"formats/code-block":At,"formats/header":ii,"formats/list":Vn,"formats/bold":Fn,"formats/code":wi,"formats/italic":li,"formats/link":be,"formats/script":oi,"formats/strike":ai,"formats/underline":ci,"formats/formula":xr,"formats/image":ui,"formats/video":Lr,"modules/syntax":ko,"modules/table":Hd,"modules/toolbar":_i,"themes/bubble":Po,"themes/snow":Fo,"ui/icons":Hn,"ui/picker":jr,"ui/icon-picker":Mo,"ui/color-picker":Bo,"ui/tooltip":Do},!0);var $r=class extends Oe.Component{constructor(r){super(r),this.editingAreaRef=qi.createRef(),this.containerRef=qi.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,n,s,i)=>{var o,a;e==="text-change"?(o=this.onEditorChangeText)==null||o.call(this,this.props.useSemanticHTML!==!1?this.editor.getSemanticHTML():this.editor.root.innerHTML,n,i,this.unprivilegedEditor):e==="selection-change"&&((a=this.onEditorChangeSelection)==null||a.call(this,n,i,this.unprivilegedEditor))};const t=this.isControlled()?r.value:r.defaultValue;this.value=t??""}validateProps(r){if(Oe.Children.count(r.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(Oe.Children.count(r.children)){const t=Oe.Children.only(r.children);if((t==null?void 0:t.type)==="textarea")throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.")}if(this.lastDeltaChangeSet&&r.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(r,t){if(this.validateProps(r),!this.editor||this.state.generation!==t.generation)return!0;if("value"in r){const e=this.getEditorContents(),n=r.value??"";this.isEqualValue(n,e)||this.setEditorContents(this.editor,n)}return r.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,r.readOnly),[...this.cleanProps,...this.dirtyProps].some(e=>!ge(r[e],this.props[e]))}shouldComponentRegenerate(r){return this.dirtyProps.some(t=>!ge(r[t],this.props[t]))}componentDidMount(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())}componentWillUnmount(){this.destroyEditor()}componentDidUpdate(r,t){if(this.editor&&this.shouldComponentRegenerate(r)){const e=this.editor.getContents(),n=this.editor.getSelection();this.regenerationSnapshot={delta:e,selection:n},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.editor&&r.placeholder!==this.props.placeholder&&(this.editor.root.dataset.placeholder=this.props.placeholder||""),this.state.generation!==t.generation){const{delta:e,selection:n}=this.regenerationSnapshot;delete this.regenerationSnapshot,this.instantiateEditor();const s=this.editor;s.setContents(e),kl(()=>this.setEditorSelection(s,n))}}instantiateEditor(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())}destroyEditor(){var e,n;if(!this.editor)return;this.unhookEditor(this.editor);const r=(e=this.props.modules)==null?void 0:e.toolbar;if(!(typeof r=="object"&&r&&"container"in r&&typeof r.container=="string"||typeof r=="string")){const s=(n=this.containerRef.current)==null?void 0:n.querySelector(".ql-toolbar");s&&s.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(r,t){const e=new N(r,t);return t.tabIndex!=null&&this.setEditorTabIndex(e,t.tabIndex),this.hookEditor(e),e}hookEditor(r){this.unprivilegedEditor=this.makeUnprivilegedEditor(r),r.on("editor-change",this.onEditorChange)}unhookEditor(r){r.off("editor-change",this.onEditorChange)}getEditorContents(){return this.value}getEditorSelection(){return this.selection}isDelta(r){return r&&r.ops}isEqualValue(r,t){return this.isDelta(r)&&this.isDelta(t)?ge(r.ops,t.ops):ge(r,t)}setEditorContents(r,t){this.value=t;const e=this.getEditorSelection();typeof t=="string"?r.setContents(r.clipboard.convert({html:t})):r.setContents(t),kl(()=>this.setEditorSelection(r,e))}setEditorSelection(r,t){if(this.selection=t,t){const e=r.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)),r.setSelection(t)}}setEditorTabIndex(r,t){var e;(e=r==null?void 0:r.scroll)!=null&&e.domNode&&(r.scroll.domNode.tabIndex=t)}setEditorReadOnly(r,t){t?r.disable():r.enable()}makeUnprivilegedEditor(r){const t=r;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 r=this.editingAreaRef.current;if(!r)throw new Error("Cannot find element for editing area");if(r.nodeType===3)throw new Error("Editing area cannot be a text node");return r}renderEditingArea(){const{children:r,preserveWhitespace:t}=this.props,{generation:e}=this.state;return Oe.Children.count(r)?Oe.cloneElement(Oe.Children.only(r),{key:e,ref:this.editingAreaRef}):t?Ss.jsx("pre",{ref:this.editingAreaRef},e):Ss.jsx("div",{ref:this.editingAreaRef},e)}render(){return Ss.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(r,t,e,n){var i,o;if(!this.editor)return;const s=this.isDelta(this.value)?n.getContents():this.props.useSemanticHTML!==!1?n.getSemanticHTML():n.getHTML();s!==this.getEditorContents()&&(this.lastDeltaChangeSet=t,this.value=s,(o=(i=this.props).onChange)==null||o.call(i,r,t,e,n))}onEditorChangeSelection(r,t,e){var o,a,u,h,p,v;if(!this.editor)return;const n=this.getEditorSelection(),s=!n&&r,i=n&&!r;ge(r,n)||(this.selection=r,(a=(o=this.props).onChangeSelection)==null||a.call(o,r,t,e),s?(h=(u=this.props).onFocus)==null||h.call(u,r,t,e):i&&((v=(p=this.props).onBlur)==null||v.call(p,n,t,e)))}focus(){this.editor&&this.editor.focus()}blur(){this.editor&&(this.selection=null,this.editor.blur())}};$r.displayName="React Quill";$r.Quill=N;$r.defaultProps={theme:"snow",modules:{},readOnly:!1};function kl(r){Promise.resolve().then(r)}var Ug=$r;export{N as Quill,Ug as default};