@paroicms/quill-editor-plugin 1.14.0 → 1.16.0

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 +1 @@
1
- import{className as ai,insert as Y,template as ee,createComponent as Tn,delegateEvents as xi,effect as An}from"https://esm.sh/solid-js@1.8.20/web";import{createMemo as oi,onMount as bc,createSignal as tt,createEffect as li,For as da,createRoot as Ec,onCleanup as yc}from"https://esm.sh/solid-js@1.8.20";var Co=typeof global=="object"&&global&&global.Object===Object&&global,_c=typeof self=="object"&&self&&self.Object===Object&&self,st=Co||_c||Function("return this")(),St=st.Symbol,Lo=Object.prototype,vc=Lo.hasOwnProperty,Nc=Lo.toString,jn=St?St.toStringTag:void 0;function Tc(n){var e=vc.call(n,jn),t=n[jn];try{n[jn]=void 0;var r=!0}catch{}var s=Nc.call(n);return r&&(e?n[jn]=t:delete n[jn]),s}var Ac=Object.prototype,wc=Ac.toString;function Sc(n){return wc.call(n)}var Oc="[object Null]",xc="[object Undefined]",ha=St?St.toStringTag:void 0;function In(n){return n==null?n===void 0?xc:Oc:ha&&ha in Object(n)?Tc(n):Sc(n)}function gt(n){return n!=null&&typeof n=="object"}var Gt=Array.isArray;function Ot(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function Io(n){return n}var Cc="[object AsyncFunction]",Lc="[object Function]",Ic="[object GeneratorFunction]",Rc="[object Proxy]";function Ci(n){if(!Ot(n))return!1;var e=In(n);return e==Lc||e==Ic||e==Cc||e==Rc}var Gs=st["__core-js_shared__"],fa=function(){var n=/[^.]+$/.exec(Gs&&Gs.keys&&Gs.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function kc(n){return!!fa&&fa in n}var Mc=Function.prototype,Dc=Mc.toString;function Vt(n){if(n!=null){try{return Dc.call(n)}catch{}try{return n+""}catch{}}return""}var Bc=/[\\^$.*+?()[\]{}|]/g,qc=/^\[object .+?Constructor\]$/,$c=Function.prototype,Pc=Object.prototype,Uc=$c.toString,Fc=Pc.hasOwnProperty,Hc=RegExp("^"+Uc.call(Fc).replace(Bc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function zc(n){if(!Ot(n)||kc(n))return!1;var e=Ci(n)?Hc:qc;return e.test(Vt(n))}function Kc(n,e){return n?.[e]}function Yt(n,e){var t=Kc(n,e);return zc(t)?t:void 0}var ci=Yt(st,"WeakMap"),ga=Object.create,Gc=function(){function n(){}return function(e){if(!Ot(e))return{};if(ga)return ga(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();function jc(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function Ro(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var Zc=800,Wc=16,Vc=Date.now;function Yc(n){var e=0,t=0;return function(){var r=Vc(),s=Wc-(r-t);if(t=r,s>0){if(++e>=Zc)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function Qc(n){return function(){return n}}var $r=function(){try{var n=Yt(Object,"defineProperty");return n({},"",{}),n}catch{}}(),Xc=$r?function(n,e){return $r(n,"toString",{configurable:!0,enumerable:!1,value:Qc(e),writable:!0})}:Io,Jc=Yc(Xc);function eu(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var tu=9007199254740991,nu=/^(?:0|[1-9]\d*)$/;function ko(n,e){var t=typeof n;return e=e??tu,!!e&&(t=="number"||t!="symbol"&&nu.test(n))&&n>-1&&n%1==0&&n<e}function Li(n,e,t){e=="__proto__"&&$r?$r(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function or(n,e){return n===e||n!==n&&e!==e}var ru=Object.prototype,su=ru.hasOwnProperty;function Mo(n,e,t){var r=n[e];(!(su.call(n,e)&&or(r,t))||t===void 0&&!(e in n))&&Li(n,e,t)}function lr(n,e,t,r){var s=!t;t||(t={});for(var i=-1,a=e.length;++i<a;){var o=e[i],c=void 0;c===void 0&&(c=n[o]),s?Li(t,o,c):Mo(t,o,c)}return t}var pa=Math.max;function iu(n,e,t){return e=pa(e===void 0?n.length-1:e,0),function(){for(var r=arguments,s=-1,i=pa(r.length-e,0),a=Array(i);++s<i;)a[s]=r[e+s];s=-1;for(var o=Array(e+1);++s<e;)o[s]=r[s];return o[e]=t(a),jc(n,this,o)}}function au(n,e){return Jc(iu(n,e,Io),n+"")}var ou=9007199254740991;function Do(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=ou}function Vr(n){return n!=null&&Do(n.length)&&!Ci(n)}function lu(n,e,t){if(!Ot(t))return!1;var r=typeof e;return(r=="number"?Vr(t)&&ko(e,t.length):r=="string"&&e in t)?or(t[e],n):!1}function cu(n){return au((function(e,t){var r=-1,s=t.length,i=s>1?t[s-1]:void 0,a=s>2?t[2]:void 0;for(i=n.length>3&&typeof i=="function"?(s--,i):void 0,a&&lu(t[0],t[1],a)&&(i=s<3?void 0:i,s=1),e=Object(e);++r<s;){var o=t[r];o&&n(e,o,r,i)}return e}))}var uu=Object.prototype;function Ii(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||uu;return n===t}function du(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var hu="[object Arguments]";function ma(n){return gt(n)&&In(n)==hu}var Bo=Object.prototype,fu=Bo.hasOwnProperty,gu=Bo.propertyIsEnumerable,ui=ma(function(){return arguments}())?ma:function(n){return gt(n)&&fu.call(n,"callee")&&!gu.call(n,"callee")};function pu(){return!1}var qo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ba=qo&&typeof module=="object"&&module&&!module.nodeType&&module,mu=ba&&ba.exports===qo,Ea=mu?st.Buffer:void 0,bu=Ea?Ea.isBuffer:void 0,Qn=bu||pu,Eu="[object Arguments]",yu="[object Array]",_u="[object Boolean]",vu="[object Date]",Nu="[object Error]",Tu="[object Function]",Au="[object Map]",wu="[object Number]",Su="[object Object]",Ou="[object RegExp]",xu="[object Set]",Cu="[object String]",Lu="[object WeakMap]",Iu="[object ArrayBuffer]",Ru="[object DataView]",ku="[object Float32Array]",Mu="[object Float64Array]",Du="[object Int8Array]",Bu="[object Int16Array]",qu="[object Int32Array]",$u="[object Uint8Array]",Pu="[object Uint8ClampedArray]",Uu="[object Uint16Array]",Fu="[object Uint32Array]",te={};te[ku]=te[Mu]=te[Du]=te[Bu]=te[qu]=te[$u]=te[Pu]=te[Uu]=te[Fu]=!0;te[Eu]=te[yu]=te[Iu]=te[_u]=te[Ru]=te[vu]=te[Nu]=te[Tu]=te[Au]=te[wu]=te[Su]=te[Ou]=te[xu]=te[Cu]=te[Lu]=!1;function Hu(n){return gt(n)&&Do(n.length)&&!!te[In(n)]}function Ri(n){return function(e){return n(e)}}var $o=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Vn=$o&&typeof module=="object"&&module&&!module.nodeType&&module,zu=Vn&&Vn.exports===$o,js=zu&&Co.process,xn=function(){try{var n=Vn&&Vn.require&&Vn.require("util").types;return n||js&&js.binding&&js.binding("util")}catch{}}(),ya=xn&&xn.isTypedArray,ki=ya?Ri(ya):Hu,Ku=Object.prototype,Gu=Ku.hasOwnProperty;function Po(n,e){var t=Gt(n),r=!t&&ui(n),s=!t&&!r&&Qn(n),i=!t&&!r&&!s&&ki(n),a=t||r||s||i,o=a?du(n.length,String):[],c=o.length;for(var u in n)(e||Gu.call(n,u))&&!(a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||ko(u,c)))&&o.push(u);return o}function Uo(n,e){return function(t){return n(e(t))}}var ju=Uo(Object.keys,Object),Zu=Object.prototype,Wu=Zu.hasOwnProperty;function Vu(n){if(!Ii(n))return ju(n);var e=[];for(var t in Object(n))Wu.call(n,t)&&t!="constructor"&&e.push(t);return e}function Mi(n){return Vr(n)?Po(n):Vu(n)}function Yu(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var Qu=Object.prototype,Xu=Qu.hasOwnProperty;function Ju(n){if(!Ot(n))return Yu(n);var e=Ii(n),t=[];for(var r in n)r=="constructor"&&(e||!Xu.call(n,r))||t.push(r);return t}function cr(n){return Vr(n)?Po(n,!0):Ju(n)}var Xn=Yt(Object,"create");function ed(){this.__data__=Xn?Xn(null):{},this.size=0}function td(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var nd="__lodash_hash_undefined__",rd=Object.prototype,sd=rd.hasOwnProperty;function id(n){var e=this.__data__;if(Xn){var t=e[n];return t===nd?void 0:t}return sd.call(e,n)?e[n]:void 0}var ad=Object.prototype,od=ad.hasOwnProperty;function ld(n){var e=this.__data__;return Xn?e[n]!==void 0:od.call(e,n)}var cd="__lodash_hash_undefined__";function ud(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Xn&&e===void 0?cd:e,this}function jt(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}jt.prototype.clear=ed;jt.prototype.delete=td;jt.prototype.get=id;jt.prototype.has=ld;jt.prototype.set=ud;function dd(){this.__data__=[],this.size=0}function Yr(n,e){for(var t=n.length;t--;)if(or(n[t][0],e))return t;return-1}var hd=Array.prototype,fd=hd.splice;function gd(n){var e=this.__data__,t=Yr(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():fd.call(e,t,1),--this.size,!0}function pd(n){var e=this.__data__,t=Yr(e,n);return t<0?void 0:e[t][1]}function md(n){return Yr(this.__data__,n)>-1}function bd(n,e){var t=this.__data__,r=Yr(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function mt(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}mt.prototype.clear=dd;mt.prototype.delete=gd;mt.prototype.get=pd;mt.prototype.has=md;mt.prototype.set=bd;var Jn=Yt(st,"Map");function Ed(){this.size=0,this.__data__={hash:new jt,map:new(Jn||mt),string:new jt}}function yd(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Qr(n,e){var t=n.__data__;return yd(e)?t[typeof e=="string"?"string":"hash"]:t.map}function _d(n){var e=Qr(this,n).delete(n);return this.size-=e?1:0,e}function vd(n){return Qr(this,n).get(n)}function Nd(n){return Qr(this,n).has(n)}function Td(n,e){var t=Qr(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function Qt(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Qt.prototype.clear=Ed;Qt.prototype.delete=_d;Qt.prototype.get=vd;Qt.prototype.has=Nd;Qt.prototype.set=Td;function Fo(n,e){for(var t=-1,r=e.length,s=n.length;++t<r;)n[s+t]=e[t];return n}var Di=Uo(Object.getPrototypeOf,Object),Ad="[object Object]",wd=Function.prototype,Sd=Object.prototype,Ho=wd.toString,Od=Sd.hasOwnProperty,xd=Ho.call(Object);function Cd(n){if(!gt(n)||In(n)!=Ad)return!1;var e=Di(n);if(e===null)return!0;var t=Od.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Ho.call(t)==xd}function Ld(){this.__data__=new mt,this.size=0}function Id(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function Rd(n){return this.__data__.get(n)}function kd(n){return this.__data__.has(n)}var Md=200;function Dd(n,e){var t=this.__data__;if(t instanceof mt){var r=t.__data__;if(!Jn||r.length<Md-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new Qt(r)}return t.set(n,e),this.size=t.size,this}function nt(n){var e=this.__data__=new mt(n);this.size=e.size}nt.prototype.clear=Ld;nt.prototype.delete=Id;nt.prototype.get=Rd;nt.prototype.has=kd;nt.prototype.set=Dd;function Bd(n,e){return n&&lr(e,Mi(e),n)}function qd(n,e){return n&&lr(e,cr(e),n)}var zo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,_a=zo&&typeof module=="object"&&module&&!module.nodeType&&module,$d=_a&&_a.exports===zo,va=$d?st.Buffer:void 0,Na=va?va.allocUnsafe:void 0;function Ko(n,e){if(e)return n.slice();var t=n.length,r=Na?Na(t):new n.constructor(t);return n.copy(r),r}function Pd(n,e){for(var t=-1,r=n==null?0:n.length,s=0,i=[];++t<r;){var a=n[t];e(a,t,n)&&(i[s++]=a)}return i}function Go(){return[]}var Ud=Object.prototype,Fd=Ud.propertyIsEnumerable,Ta=Object.getOwnPropertySymbols,Bi=Ta?function(n){return n==null?[]:(n=Object(n),Pd(Ta(n),(function(e){return Fd.call(n,e)})))}:Go;function Hd(n,e){return lr(n,Bi(n),e)}var zd=Object.getOwnPropertySymbols,jo=zd?function(n){for(var e=[];n;)Fo(e,Bi(n)),n=Di(n);return e}:Go;function Kd(n,e){return lr(n,jo(n),e)}function Zo(n,e,t){var r=e(n);return Gt(n)?r:Fo(r,t(n))}function di(n){return Zo(n,Mi,Bi)}function Gd(n){return Zo(n,cr,jo)}var hi=Yt(st,"DataView"),fi=Yt(st,"Promise"),gi=Yt(st,"Set"),Aa="[object Map]",jd="[object Object]",wa="[object Promise]",Sa="[object Set]",Oa="[object WeakMap]",xa="[object DataView]",Zd=Vt(hi),Wd=Vt(Jn),Vd=Vt(fi),Yd=Vt(gi),Qd=Vt(ci),ze=In;(hi&&ze(new hi(new ArrayBuffer(1)))!=xa||Jn&&ze(new Jn)!=Aa||fi&&ze(fi.resolve())!=wa||gi&&ze(new gi)!=Sa||ci&&ze(new ci)!=Oa)&&(ze=function(n){var e=In(n),t=e==jd?n.constructor:void 0,r=t?Vt(t):"";if(r)switch(r){case Zd:return xa;case Wd:return Aa;case Vd:return wa;case Yd:return Sa;case Qd:return Oa}return e});var Xd=Object.prototype,Jd=Xd.hasOwnProperty;function eh(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&Jd.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var Pr=st.Uint8Array;function qi(n){var e=new n.constructor(n.byteLength);return new Pr(e).set(new Pr(n)),e}function th(n,e){var t=e?qi(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var nh=/\w*$/;function rh(n){var e=new n.constructor(n.source,nh.exec(n));return e.lastIndex=n.lastIndex,e}var Ca=St?St.prototype:void 0,La=Ca?Ca.valueOf:void 0;function sh(n){return La?Object(La.call(n)):{}}function Wo(n,e){var t=e?qi(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var ih="[object Boolean]",ah="[object Date]",oh="[object Map]",lh="[object Number]",ch="[object RegExp]",uh="[object Set]",dh="[object String]",hh="[object Symbol]",fh="[object ArrayBuffer]",gh="[object DataView]",ph="[object Float32Array]",mh="[object Float64Array]",bh="[object Int8Array]",Eh="[object Int16Array]",yh="[object Int32Array]",_h="[object Uint8Array]",vh="[object Uint8ClampedArray]",Nh="[object Uint16Array]",Th="[object Uint32Array]";function Ah(n,e,t){var r=n.constructor;switch(e){case fh:return qi(n);case ih:case ah:return new r(+n);case gh:return th(n,t);case ph:case mh:case bh:case Eh:case yh:case _h:case vh:case Nh:case Th:return Wo(n,t);case oh:return new r;case lh:case dh:return new r(n);case ch:return rh(n);case uh:return new r;case hh:return sh(n)}}function Vo(n){return typeof n.constructor=="function"&&!Ii(n)?Gc(Di(n)):{}}var wh="[object Map]";function Sh(n){return gt(n)&&ze(n)==wh}var Ia=xn&&xn.isMap,Oh=Ia?Ri(Ia):Sh,xh="[object Set]";function Ch(n){return gt(n)&&ze(n)==xh}var Ra=xn&&xn.isSet,Lh=Ra?Ri(Ra):Ch,Ih=1,Rh=2,kh=4,Yo="[object Arguments]",Mh="[object Array]",Dh="[object Boolean]",Bh="[object Date]",qh="[object Error]",Qo="[object Function]",$h="[object GeneratorFunction]",Ph="[object Map]",Uh="[object Number]",Xo="[object Object]",Fh="[object RegExp]",Hh="[object Set]",zh="[object String]",Kh="[object Symbol]",Gh="[object WeakMap]",jh="[object ArrayBuffer]",Zh="[object DataView]",Wh="[object Float32Array]",Vh="[object Float64Array]",Yh="[object Int8Array]",Qh="[object Int16Array]",Xh="[object Int32Array]",Jh="[object Uint8Array]",ef="[object Uint8ClampedArray]",tf="[object Uint16Array]",nf="[object Uint32Array]",J={};J[Yo]=J[Mh]=J[jh]=J[Zh]=J[Dh]=J[Bh]=J[Wh]=J[Vh]=J[Yh]=J[Qh]=J[Xh]=J[Ph]=J[Uh]=J[Xo]=J[Fh]=J[Hh]=J[zh]=J[Kh]=J[Jh]=J[ef]=J[tf]=J[nf]=!0;J[qh]=J[Qo]=J[Gh]=!1;function qr(n,e,t,r,s,i){var a,o=e&Ih,c=e&Rh,u=e&kh;if(a!==void 0)return a;if(!Ot(n))return n;var h=Gt(n);if(h){if(a=eh(n),!o)return Ro(n,a)}else{var p=ze(n),f=p==Qo||p==$h;if(Qn(n))return Ko(n,o);if(p==Xo||p==Yo||f&&!s){if(a=c||f?{}:Vo(n),!o)return c?Kd(n,qd(a,n)):Hd(n,Bd(a,n))}else{if(!J[p])return s?n:{};a=Ah(n,p,o)}}i||(i=new nt);var g=i.get(n);if(g)return g;i.set(n,a),Lh(n)?n.forEach((function(y){a.add(qr(y,e,t,y,n,i))})):Oh(n)&&n.forEach((function(y,_){a.set(_,qr(y,e,t,_,n,i))}));var m=u?c?Gd:di:c?cr:Mi,E=h?void 0:m(n);return eu(E||n,(function(y,_){E&&(_=y,y=n[_]),Mo(a,_,qr(y,e,t,_,n,i))})),a}var rf=1,sf=4;function wn(n){return qr(n,rf|sf)}var af="__lodash_hash_undefined__";function of(n){return this.__data__.set(n,af),this}function lf(n){return this.__data__.has(n)}function Ur(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new Qt;++e<t;)this.add(n[e])}Ur.prototype.add=Ur.prototype.push=of;Ur.prototype.has=lf;function cf(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}function uf(n,e){return n.has(e)}var df=1,hf=2;function Jo(n,e,t,r,s,i){var a=t&df,o=n.length,c=e.length;if(o!=c&&!(a&&c>o))return!1;var u=i.get(n),h=i.get(e);if(u&&h)return u==e&&h==n;var p=-1,f=!0,g=t&hf?new Ur:void 0;for(i.set(n,e),i.set(e,n);++p<o;){var m=n[p],E=e[p];if(r)var y=a?r(E,m,p,e,n,i):r(m,E,p,n,e,i);if(y!==void 0){if(y)continue;f=!1;break}if(g){if(!cf(e,(function(_,A){if(!uf(g,A)&&(m===_||s(m,_,t,r,i)))return g.push(A)}))){f=!1;break}}else if(!(m===E||s(m,E,t,r,i))){f=!1;break}}return i.delete(n),i.delete(e),f}function ff(n){var e=-1,t=Array(n.size);return n.forEach((function(r,s){t[++e]=[s,r]})),t}function gf(n){var e=-1,t=Array(n.size);return n.forEach((function(r){t[++e]=r})),t}var pf=1,mf=2,bf="[object Boolean]",Ef="[object Date]",yf="[object Error]",_f="[object Map]",vf="[object Number]",Nf="[object RegExp]",Tf="[object Set]",Af="[object String]",wf="[object Symbol]",Sf="[object ArrayBuffer]",Of="[object DataView]",ka=St?St.prototype:void 0,Zs=ka?ka.valueOf:void 0;function xf(n,e,t,r,s,i,a){switch(t){case Of:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case Sf:return!(n.byteLength!=e.byteLength||!i(new Pr(n),new Pr(e)));case bf:case Ef:case vf:return or(+n,+e);case yf:return n.name==e.name&&n.message==e.message;case Nf:case Af:return n==e+"";case _f:var o=ff;case Tf:var c=r&pf;if(o||(o=gf),n.size!=e.size&&!c)return!1;var u=a.get(n);if(u)return u==e;r|=mf,a.set(n,e);var h=Jo(o(n),o(e),r,s,i,a);return a.delete(n),h;case wf:if(Zs)return Zs.call(n)==Zs.call(e)}return!1}var Cf=1,Lf=Object.prototype,If=Lf.hasOwnProperty;function Rf(n,e,t,r,s,i){var a=t&Cf,o=di(n),c=o.length,u=di(e),h=u.length;if(c!=h&&!a)return!1;for(var p=c;p--;){var f=o[p];if(!(a?f in e:If.call(e,f)))return!1}var g=i.get(n),m=i.get(e);if(g&&m)return g==e&&m==n;var E=!0;i.set(n,e),i.set(e,n);for(var y=a;++p<c;){f=o[p];var _=n[f],A=e[f];if(r)var w=a?r(A,_,f,e,n,i):r(_,A,f,n,e,i);if(!(w===void 0?_===A||s(_,A,t,r,i):w)){E=!1;break}y||(y=f=="constructor")}if(E&&!y){var v=n.constructor,S=e.constructor;v!=S&&"constructor"in n&&"constructor"in e&&!(typeof v=="function"&&v instanceof v&&typeof S=="function"&&S instanceof S)&&(E=!1)}return i.delete(n),i.delete(e),E}var kf=1,Ma="[object Arguments]",Da="[object Array]",xr="[object Object]",Mf=Object.prototype,Ba=Mf.hasOwnProperty;function Df(n,e,t,r,s,i){var a=Gt(n),o=Gt(e),c=a?Da:ze(n),u=o?Da:ze(e);c=c==Ma?xr:c,u=u==Ma?xr:u;var h=c==xr,p=u==xr,f=c==u;if(f&&Qn(n)){if(!Qn(e))return!1;a=!0,h=!1}if(f&&!h)return i||(i=new nt),a||ki(n)?Jo(n,e,t,r,s,i):xf(n,e,c,t,r,s,i);if(!(t&kf)){var g=h&&Ba.call(n,"__wrapped__"),m=p&&Ba.call(e,"__wrapped__");if(g||m){var E=g?n.value():n,y=m?e.value():e;return i||(i=new nt),s(E,y,t,r,i)}}return f?(i||(i=new nt),Rf(n,e,t,r,s,i)):!1}function el(n,e,t,r,s){return n===e?!0:n==null||e==null||!gt(n)&&!gt(e)?n!==n&&e!==e:Df(n,e,t,r,el,s)}function Bf(n){return function(e,t,r){for(var s=-1,i=Object(e),a=r(e),o=a.length;o--;){var c=a[++s];if(t(i[c],c,i)===!1)break}return e}}var qf=Bf();function pi(n,e,t){(t!==void 0&&!or(n[e],t)||t===void 0&&!(e in n))&&Li(n,e,t)}function $f(n){return gt(n)&&Vr(n)}function mi(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function Pf(n){return lr(n,cr(n))}function Uf(n,e,t,r,s,i,a){var o=mi(n,t),c=mi(e,t),u=a.get(c);if(u){pi(n,t,u);return}var h=i?i(o,c,t+"",n,e,a):void 0,p=h===void 0;if(p){var f=Gt(c),g=!f&&Qn(c),m=!f&&!g&&ki(c);h=c,f||g||m?Gt(o)?h=o:$f(o)?h=Ro(o):g?(p=!1,h=Ko(c,!0)):m?(p=!1,h=Wo(c,!0)):h=[]:Cd(c)||ui(c)?(h=o,ui(o)?h=Pf(o):(!Ot(o)||Ci(o))&&(h=Vo(c))):p=!1}p&&(a.set(c,h),s(h,c,r,i,a),a.delete(c)),pi(n,t,h)}function tl(n,e,t,r,s){n!==e&&qf(e,(function(i,a){if(s||(s=new nt),Ot(i))Uf(n,e,a,t,tl,r,s);else{var o=r?r(mi(n,a),i,a+"",n,e,s):void 0;o===void 0&&(o=i),pi(n,a,o)}}),cr)}function $i(n,e){return el(n,e)}var At=cu((function(n,e,t){tl(n,e,t)})),D=(n=>(n[n.TYPE=3]="TYPE",n[n.LEVEL=12]="LEVEL",n[n.ATTRIBUTE=13]="ATTRIBUTE",n[n.BLOT=14]="BLOT",n[n.INLINE=7]="INLINE",n[n.BLOCK=11]="BLOCK",n[n.BLOCK_BLOT=10]="BLOCK_BLOT",n[n.INLINE_BLOT=6]="INLINE_BLOT",n[n.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",n[n.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",n[n.ANY=15]="ANY",n))(D||{});class rt{constructor(e,t,r={}){this.attrName=e,this.keyName=t;const s=D.TYPE&D.ATTRIBUTE;this.scope=r.scope!=null?r.scope&D.LEVEL|s:D.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map((t=>t.name))}add(e,t){return this.canAdd(e,t)?(e.setAttribute(this.keyName,t),!0):!1}canAdd(e,t){return this.whitelist==null?!0:typeof t=="string"?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class Sn extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const nl=class bi{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let r=null;try{r=e.parentNode}catch{return null}return this.find(r,t)}return null}create(e,t,r){const s=this.query(t);if(s==null)throw new Sn(`Unable to create ${t} blot`);const i=s,a=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:i.create(r),o=new i(e,a,r);return bi.blots.set(o.domNode,o),o}find(e,t=!1){return bi.find(e,t)}query(e,t=D.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&D.LEVEL&D.BLOCK?r=this.types.block:e&D.LEVEL&D.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some((s=>(r=this.classes[s],!!r))),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&t&D.LEVEL&r.scope&&t&D.TYPE&r.scope?r:null}register(...e){return e.map((t=>{const r="blotName"in t,s="attrName"in t;if(!r&&!s)throw new Sn("Invalid definition");if(r&&t.blotName==="abstract")throw new Sn("Cannot register abstract class");const i=r?t.blotName:s?t.attrName:void 0;return this.types[i]=t,s?typeof t.keyName=="string"&&(this.attributes[t.keyName]=t):r&&(t.className&&(this.classes[t.className]=t),t.tagName&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map((a=>a.toUpperCase())):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach((a=>{(this.tags[a]==null||t.className==null)&&(this.tags[a]=t)})))),t}))}};nl.blots=new WeakMap;let Cn=nl;function qa(n,e){return(n.getAttribute("class")||"").split(/\s+/).filter((t=>t.indexOf(`${e}-`)===0))}class Ff extends rt{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map((t=>t.split("-").slice(0,-1).join("-")))}add(e,t){return this.canAdd(e,t)?(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0):!1}remove(e){qa(e,this.keyName).forEach((t=>{e.classList.remove(t)})),e.classList.length===0&&e.removeAttribute("class")}value(e){const t=(qa(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}}const We=Ff;function Ws(n){const e=n.split("-"),t=e.slice(1).map((r=>r[0].toUpperCase()+r.slice(1))).join("");return e[0]+t}class Hf extends rt{static keys(e){return(e.getAttribute("style")||"").split(";").map((t=>t.split(":")[0].trim()))}add(e,t){return this.canAdd(e,t)?(e.style[Ws(this.keyName)]=t,!0):!1}remove(e){e.style[Ws(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[Ws(this.keyName)];return this.canAdd(e,t)?t:""}}const xt=Hf;class zf{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=Cn.find(this.domNode);if(e==null)return;const t=rt.keys(this.domNode),r=We.keys(this.domNode),s=xt.keys(this.domNode);t.concat(r).concat(s).forEach((i=>{const a=e.scroll.query(i,D.ATTRIBUTE);a instanceof rt&&(this.attributes[a.attrName]=a)}))}copy(e){Object.keys(this.attributes).forEach((t=>{const r=this.attributes[t].value(this.domNode);e.format(t,r)}))}move(e){this.copy(e),Object.keys(this.attributes).forEach((t=>{this.attributes[t].remove(this.domNode)})),this.attributes={}}values(){return Object.keys(this.attributes).reduce(((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e)),{})}}const Xr=zf,rl=class{constructor(e,t){this.scroll=e,this.domNode=t,Cn.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new Sn("Blot definition missing tagName");let t,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?t=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?t=document.createElement(r):t=document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),Cn.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,r,s){const i=this.isolate(e,t);if(this.scroll.query(r,D.BLOT)!=null&&s)i.wrap(r,s);else if(this.scroll.query(r,D.ATTRIBUTE)!=null){const a=this.scroll.create(this.statics.scope);i.wrap(a),a.format(r,s)}}insertAt(e,t,r){const s=r==null?this.scroll.create("text",t):this.scroll.create(t,r),i=this.split(e);this.parent.insertBefore(s,i||void 0)}isolate(e,t){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(t),r}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){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(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,t){return e===0?this:this.next}update(e,t){}wrap(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new Sn(`Cannot wrap ${e}`);return r.appendChild(this),r}};rl.blotName="abstract";let sl=rl;const il=class extends sl{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};il.scope=D.INLINE_BLOT;let Kf=il;const Ne=Kf;class Gf{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let r=t();for(;r&&e>0;)e-=1,r=t();return r}contains(e){const t=this.iterator();let r=t();for(;r;){if(r===e)return!0;r=t()}return!1}indexOf(e){const t=this.iterator();let r=t(),s=0;for(;r;){if(r===e)return s;s+=1,r=t()}return-1}insertBefore(e,t){e!=null&&(this.remove(e),e.next=t,t!=null?(e.prev=t.prev,t.prev!=null&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,r=this.head;for(;r!=null;){if(r===e)return t;t+=r.length(),r=r.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const t=e;return e!=null&&(e=e.next),t}}find(e,t=!1){const r=this.iterator();let s=r();for(;s;){const i=s.length();if(e<i||t&&e===i&&(s.next==null||s.next.length()!==0))return[s,e];e-=i,s=r()}return[null,0]}forEach(e){const t=this.iterator();let r=t();for(;r;)e(r),r=t()}forEachAt(e,t,r){if(t<=0)return;const[s,i]=this.find(e);let a=e-i;const o=this.iterator(s);let c=o();for(;c&&a<e+t;){const u=c.length();e>a?r(c,e-a,Math.min(t,a+u-e)):r(c,0,Math.min(u,e+t-a)),a+=u,c=o()}}map(e){return this.reduce(((t,r)=>(t.push(e(r)),t)),[])}reduce(e,t){const r=this.iterator();let s=r();for(;s;)t=e(t,s),s=r();return t}}function $a(n,e){const t=e.find(n);if(t)return t;try{return e.create(n)}catch{const r=e.create(D.INLINE);return Array.from(n.childNodes).forEach((s=>{r.domNode.appendChild(s)})),n.parentNode&&n.parentNode.replaceChild(r.domNode,n),r.attach(),r}}const al=class _t extends sl{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach((e=>{e.attach()}))}attachUI(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,_t.uiClass&&this.uiNode.classList.add(_t.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new Gf,Array.from(this.domNode.childNodes).filter((e=>e!==this.uiNode)).reverse().forEach((e=>{try{const t=$a(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof Sn)return;throw t}}))}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,((r,s,i)=>{r.deleteAt(s,i)}))}descendant(e,t=0){const[r,s]=this.children.find(t);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,s]:r instanceof _t?r.descendant(e,s):[null,-1]}descendants(e,t=0,r=Number.MAX_VALUE){let s=[],i=r;return this.children.forEachAt(t,r,((a,o,c)=>{(e.blotName==null&&e(a)||e.blotName!=null&&a instanceof e)&&s.push(a),a instanceof _t&&(s=s.concat(a.descendants(e,o,i))),i-=c})),s}detach(){this.children.forEach((e=>{e.detach()})),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach((t=>{e||this.statics.allowedChildren.some((r=>t instanceof r))||(t.statics.scope===D.BLOCK_BLOT?(t.next!=null&&this.splitAfter(t),t.prev!=null&&this.splitAfter(t.prev),t.parent.unwrap(),e=!0):t instanceof _t?t.unwrap():t.remove())}))}formatAt(e,t,r,s){this.children.forEachAt(e,t,((i,a,o)=>{i.formatAt(a,o,r,s)}))}insertAt(e,t,r){const[s,i]=this.children.find(e);if(s)s.insertAt(i,t,r);else{const a=r==null?this.scroll.create("text",t):this.scroll.create(t,r);this.appendChild(a)}}insertBefore(e,t){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,t||null),e.parent=this,t!=null&&(r=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce(((e,t)=>e+t.length()),0)}moveChildren(e,t){this.children.forEach((r=>{e.insertBefore(r,t)}))}optimize(e){if(super.optimize(e),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 t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e,t=!1){const[r,s]=this.children.find(e,t),i=[[this,e]];return r instanceof _t?i.concat(r.path(s,t)):(r!=null&&i.push([r,s]),i)}removeChild(e){this.children.remove(e)}replaceWith(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return r instanceof _t&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),((s,i,a)=>{const o=s.split(i,t);o!=null&&r.appendChild(o)})),r}splitAfter(e){const t=this.clone();for(;e.next!=null;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){const r=[],s=[];e.forEach((i=>{i.target===this.domNode&&i.type==="childList"&&(r.push(...i.addedNodes),s.push(...i.removedNodes))})),s.forEach((i=>{if(i.parentNode!=null&&i.tagName!=="IFRAME"&&document.body.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const a=this.scroll.find(i);a!=null&&(a.domNode.parentNode==null||a.domNode.parentNode===this.domNode)&&a.detach()})),r.filter((i=>i.parentNode===this.domNode&&i!==this.uiNode)).sort(((i,a)=>i===a?0:i.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1)).forEach((i=>{let a=null;i.nextSibling!=null&&(a=this.scroll.find(i.nextSibling));const o=$a(i,this.scroll);(o.next!==a||o.next==null)&&(o.parent!=null&&o.parent.removeChild(this),this.insertBefore(o,a||void 0))})),this.enforceAllowedChildren()}};al.uiClass="";let jf=al;const je=jf;function Zf(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(n[t]!==e[t])return!1;return!0}const bn=class En extends je{static create(e){return super.create(e)}static formats(e,t){const r=t.query(En.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new Xr(this.domNode)}format(e,t){if(e===this.statics.blotName&&!t)this.children.forEach((r=>{r instanceof En||(r=r.wrap(En.blotName,!0)),this.attributes.copy(r)})),this.unwrap();else{const r=this.scroll.query(e,D.INLINE);if(r==null)return;r instanceof rt?this.attributes.attribute(r,t):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t)}}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,s){this.formats()[r]!=null||this.scroll.query(r,D.ATTRIBUTE)?this.isolate(e,t).format(r,s):super.formatAt(e,t,r,s)}optimize(e){super.optimize(e);const t=this.formats();if(Object.keys(t).length===0)return this.unwrap();const r=this.next;r instanceof En&&r.prev===this&&Zf(t,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some((r=>r.target===this.domNode&&r.type==="attributes"))&&this.attributes.build()}wrap(e,t){const r=super.wrap(e,t);return r instanceof En&&this.attributes.move(r),r}};bn.allowedChildren=[bn,Ne],bn.blotName="inline",bn.scope=D.INLINE_BLOT,bn.tagName="SPAN";let Wf=bn;const Pi=Wf,yn=class Ei extends je{static create(e){return super.create(e)}static formats(e,t){const r=t.query(Ei.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new Xr(this.domNode)}format(e,t){const r=this.scroll.query(e,D.BLOCK);r!=null&&(r instanceof rt?this.attributes.attribute(r,t):e===this.statics.blotName&&!t?this.replaceWith(Ei.blotName):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,s){this.scroll.query(r,D.BLOCK)!=null?this.format(r,s):super.formatAt(e,t,r,s)}insertAt(e,t,r){if(r==null||this.scroll.query(t,D.INLINE)!=null)super.insertAt(e,t,r);else{const s=this.split(e);if(s!=null){const i=this.scroll.create(t,r);s.parent.insertBefore(i,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some((r=>r.target===this.domNode&&r.type==="attributes"))&&this.attributes.build()}};yn.blotName="block",yn.scope=D.BLOCK_BLOT,yn.tagName="P",yn.allowedChildren=[Pi,yn,Ne];let Vf=yn;const er=Vf,yi=class extends je{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,r,s){super.formatAt(e,t,r,s),this.enforceAllowedChildren()}insertAt(e,t,r){super.insertAt(e,t,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};yi.blotName="container",yi.scope=D.BLOCK_BLOT;let Yf=yi;const Jr=Yf;class Qf extends Ne{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,r,s){e===0&&t===this.length()?this.format(r,s):super.formatAt(e,t,r,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const ke=Qf,Xf={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},Jf=100,_n=class extends je{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver((r=>{this.update(r)})),this.observer.observe(this.domNode,Xf),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const r=this.registry.find(e,t);return r?r.scroll===this?r:t?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,t=D.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),e===0&&t===this.length()?this.children.forEach((r=>{r.remove()})):super.deleteAt(e,t)}formatAt(e,t,r,s){this.update(),super.formatAt(e,t,r,s)}insertAt(e,t,r){this.update(),super.insertAt(e,t,r)}optimize(e=[],t={}){super.optimize(t);const r=t.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)e.push(s.pop());const i=(c,u=!0)=>{c==null||c===this||c.domNode.parentNode!=null&&(r.has(c.domNode)||r.set(c.domNode,[]),u&&i(c.parent))},a=c=>{r.has(c.domNode)&&(c instanceof je&&c.children.forEach(a),r.delete(c.domNode),c.optimize(t))};let o=e;for(let c=0;o.length>0;c+=1){if(c>=Jf)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach((u=>{const h=this.find(u.target,!0);h!=null&&(h.domNode===u.target&&(u.type==="childList"?(i(this.find(u.previousSibling,!1)),Array.from(u.addedNodes).forEach((p=>{const f=this.find(p,!1);i(f,!1),f instanceof je&&f.children.forEach((g=>{i(g,!1)}))}))):u.type==="attributes"&&i(h.prev)),i(h))})),this.children.forEach(a),o=Array.from(this.observer.takeRecords()),s=o.slice();s.length>0;)e.push(s.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map((s=>{const i=this.find(s.target,!0);return i==null?null:r.has(i.domNode)?(r.get(i.domNode).push(s),null):(r.set(i.domNode,[s]),i)})).forEach((s=>{s!=null&&s!==this&&r.has(s.domNode)&&s.update(r.get(s.domNode)||[],t)})),t.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),t),this.optimize(e,t)}};_n.blotName="scroll",_n.defaultChild=er,_n.allowedChildren=[er,Jr],_n.scope=D.BLOCK_BLOT,_n.tagName="DIV";let eg=_n;const Ui=eg,_i=class ol extends Ne{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,r){r==null?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,r)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof ol&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,t){e.some((r=>r.type==="characterData"&&r.target===this.domNode))&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};_i.blotName="text",_i.scope=D.INLINE_BLOT;let tg=_i;const Fr=tg,ng=Object.freeze(Object.defineProperty({__proto__:null,Attributor:rt,AttributorStore:Xr,BlockBlot:er,ClassAttributor:We,ContainerBlot:Jr,EmbedBlot:ke,InlineBlot:Pi,LeafBlot:Ne,ParentBlot:je,Registry:Cn,Scope:D,ScrollBlot:Ui,StyleAttributor:xt,TextBlot:Fr},Symbol.toStringTag,{value:"Module"}));var vt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fi(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var vi={exports:{}},Re=-1,Se=1,de=0;function tr(n,e,t,r,s){if(n===e)return n?[[de,n]]:[];if(t!=null){var i=dg(n,e,t);if(i)return i}var a=Hi(n,e),o=n.substring(0,a);n=n.substring(a),e=e.substring(a),a=es(n,e);var c=n.substring(n.length-a);n=n.substring(0,n.length-a),e=e.substring(0,e.length-a);var u=rg(n,e);return o&&u.unshift([de,o]),c&&u.push([de,c]),zi(u,s),r&&ag(u),u}function rg(n,e){var t;if(!n)return[[Se,e]];if(!e)return[[Re,n]];var r=n.length>e.length?n:e,s=n.length>e.length?e:n,i=r.indexOf(s);if(i!==-1)return t=[[Se,r.substring(0,i)],[de,s],[Se,r.substring(i+s.length)]],n.length>e.length&&(t[0][0]=t[2][0]=Re),t;if(s.length===1)return[[Re,n],[Se,e]];var a=ig(n,e);if(a){var o=a[0],c=a[1],u=a[2],h=a[3],p=a[4],f=tr(o,u),g=tr(c,h);return f.concat([[de,p]],g)}return sg(n,e)}function sg(n,e){for(var t=n.length,r=e.length,s=Math.ceil((t+r)/2),i=s,a=2*s,o=new Array(a),c=new Array(a),u=0;u<a;u++)o[u]=-1,c[u]=-1;o[i+1]=0,c[i+1]=0;for(var h=t-r,p=h%2!==0,f=0,g=0,m=0,E=0,y=0;y<s;y++){for(var _=-y+f;_<=y-g;_+=2){var A=i+_,w;_===-y||_!==y&&o[A-1]<o[A+1]?w=o[A+1]:w=o[A-1]+1;for(var v=w-_;w<t&&v<r&&n.charAt(w)===e.charAt(v);)w++,v++;if(o[A]=w,w>t)g+=2;else if(v>r)f+=2;else if(p){var S=i+h-_;if(S>=0&&S<a&&c[S]!==-1){var O=t-c[S];if(w>=O)return Pa(n,e,w,v)}}}for(var B=-y+m;B<=y-E;B+=2){var S=i+B,O;B===-y||B!==y&&c[S-1]<c[S+1]?O=c[S+1]:O=c[S-1]+1;for(var H=O-B;O<t&&H<r&&n.charAt(t-O-1)===e.charAt(r-H-1);)O++,H++;if(c[S]=O,O>t)E+=2;else if(H>r)m+=2;else if(!p){var A=i+h-B;if(A>=0&&A<a&&o[A]!==-1){var w=o[A],v=i+w-A;if(O=t-O,w>=O)return Pa(n,e,w,v)}}}}return[[Re,n],[Se,e]]}function Pa(n,e,t,r){var s=n.substring(0,t),i=e.substring(0,r),a=n.substring(t),o=e.substring(r),c=tr(s,i),u=tr(a,o);return c.concat(u)}function Hi(n,e){if(!n||!e||n.charAt(0)!==e.charAt(0))return 0;for(var t=0,r=Math.min(n.length,e.length),s=r,i=0;t<s;)n.substring(i,s)==e.substring(i,s)?(t=s,i=t):r=s,s=Math.floor((r-t)/2+t);return ll(n.charCodeAt(s-1))&&s--,s}function Ua(n,e){var t=n.length,r=e.length;if(t==0||r==0)return 0;t>r?n=n.substring(t-r):t<r&&(e=e.substring(0,t));var s=Math.min(t,r);if(n==e)return s;for(var i=0,a=1;;){var o=n.substring(s-a),c=e.indexOf(o);if(c==-1)return i;a+=c,(c==0||n.substring(s-a)==e.substring(0,a))&&(i=a,a++)}}function es(n,e){if(!n||!e||n.slice(-1)!==e.slice(-1))return 0;for(var t=0,r=Math.min(n.length,e.length),s=r,i=0;t<s;)n.substring(n.length-s,n.length-i)==e.substring(e.length-s,e.length-i)?(t=s,i=t):r=s,s=Math.floor((r-t)/2+t);return cl(n.charCodeAt(n.length-s))&&s--,s}function ig(n,e){var t=n.length>e.length?n:e,r=n.length>e.length?e:n;if(t.length<4||r.length*2<t.length)return null;function s(g,m,E){for(var y=g.substring(E,E+Math.floor(g.length/4)),_=-1,A="",w,v,S,O;(_=m.indexOf(y,_+1))!==-1;){var B=Hi(g.substring(E),m.substring(_)),H=es(g.substring(0,E),m.substring(0,_));A.length<H+B&&(A=m.substring(_-H,_)+m.substring(_,_+B),w=g.substring(0,E-H),v=g.substring(E+B),S=m.substring(0,_-H),O=m.substring(_+B))}return A.length*2>=g.length?[w,v,S,O,A]:null}var i=s(t,r,Math.ceil(t.length/4)),a=s(t,r,Math.ceil(t.length/2)),o;if(!i&&!a)return null;a?i?o=i[4].length>a[4].length?i:a:o=a:o=i;var c,u,h,p;n.length>e.length?(c=o[0],u=o[1],h=o[2],p=o[3]):(h=o[0],p=o[1],c=o[2],u=o[3]);var f=o[4];return[c,u,h,p,f]}function ag(n){for(var e=!1,t=[],r=0,s=null,i=0,a=0,o=0,c=0,u=0;i<n.length;)n[i][0]==de?(t[r++]=i,a=c,o=u,c=0,u=0,s=n[i][1]):(n[i][0]==Se?c+=n[i][1].length:u+=n[i][1].length,s&&s.length<=Math.max(a,o)&&s.length<=Math.max(c,u)&&(n.splice(t[r-1],0,[Re,s]),n[t[r-1]+1][0]=Se,r--,r--,i=r>0?t[r-1]:-1,a=0,o=0,c=0,u=0,s=null,e=!0)),i++;for(e&&zi(n),cg(n),i=1;i<n.length;){if(n[i-1][0]==Re&&n[i][0]==Se){var h=n[i-1][1],p=n[i][1],f=Ua(h,p),g=Ua(p,h);f>=g?(f>=h.length/2||f>=p.length/2)&&(n.splice(i,0,[de,p.substring(0,f)]),n[i-1][1]=h.substring(0,h.length-f),n[i+1][1]=p.substring(f),i++):(g>=h.length/2||g>=p.length/2)&&(n.splice(i,0,[de,h.substring(0,g)]),n[i-1][0]=Se,n[i-1][1]=p.substring(0,p.length-g),n[i+1][0]=Re,n[i+1][1]=h.substring(g),i++),i++}i++}}var Fa=/[^a-zA-Z0-9]/,Ha=/\s/,za=/[\r\n]/,og=/\n\r?\n$/,lg=/^\r?\n\r?\n/;function cg(n){function e(g,m){if(!g||!m)return 6;var E=g.charAt(g.length-1),y=m.charAt(0),_=E.match(Fa),A=y.match(Fa),w=_&&E.match(Ha),v=A&&y.match(Ha),S=w&&E.match(za),O=v&&y.match(za),B=S&&g.match(og),H=O&&m.match(lg);return B||H?5:S||O?4:_&&!w&&v?3:w||v?2:_||A?1:0}for(var t=1;t<n.length-1;){if(n[t-1][0]==de&&n[t+1][0]==de){var r=n[t-1][1],s=n[t][1],i=n[t+1][1],a=es(r,s);if(a){var o=s.substring(s.length-a);r=r.substring(0,r.length-a),s=o+s.substring(0,s.length-a),i=o+i}for(var c=r,u=s,h=i,p=e(r,s)+e(s,i);s.charAt(0)===i.charAt(0);){r+=s.charAt(0),s=s.substring(1)+i.charAt(0),i=i.substring(1);var f=e(r,s)+e(s,i);f>=p&&(p=f,c=r,u=s,h=i)}n[t-1][1]!=c&&(c?n[t-1][1]=c:(n.splice(t-1,1),t--),n[t][1]=u,h?n[t+1][1]=h:(n.splice(t+1,1),t--))}t++}}function zi(n,e){n.push([de,""]);for(var t=0,r=0,s=0,i="",a="",o;t<n.length;){if(t<n.length-1&&!n[t][1]){n.splice(t,1);continue}switch(n[t][0]){case Se:s++,a+=n[t][1],t++;break;case Re:r++,i+=n[t][1],t++;break;case de:var c=t-s-r-1;if(e){if(c>=0&&dl(n[c][1])){var u=n[c][1].slice(-1);if(n[c][1]=n[c][1].slice(0,-1),i=u+i,a=u+a,!n[c][1]){n.splice(c,1),t--;var h=c-1;n[h]&&n[h][0]===Se&&(s++,a=n[h][1]+a,h--),n[h]&&n[h][0]===Re&&(r++,i=n[h][1]+i,h--),c=h}}if(ul(n[t][1])){var u=n[t][1].charAt(0);n[t][1]=n[t][1].slice(1),i+=u,a+=u}}if(t<n.length-1&&!n[t][1]){n.splice(t,1);break}if(i.length>0||a.length>0){i.length>0&&a.length>0&&(o=Hi(a,i),o!==0&&(c>=0?n[c][1]+=a.substring(0,o):(n.splice(0,0,[de,a.substring(0,o)]),t++),a=a.substring(o),i=i.substring(o)),o=es(a,i),o!==0&&(n[t][1]=a.substring(a.length-o)+n[t][1],a=a.substring(0,a.length-o),i=i.substring(0,i.length-o)));var p=s+r;i.length===0&&a.length===0?(n.splice(t-p,p),t=t-p):i.length===0?(n.splice(t-p,p,[Se,a]),t=t-p+1):a.length===0?(n.splice(t-p,p,[Re,i]),t=t-p+1):(n.splice(t-p,p,[Re,i],[Se,a]),t=t-p+2)}t!==0&&n[t-1][0]===de?(n[t-1][1]+=n[t][1],n.splice(t,1)):t++,s=0,r=0,i="",a="";break}}n[n.length-1][1]===""&&n.pop();var f=!1;for(t=1;t<n.length-1;)n[t-1][0]===de&&n[t+1][0]===de&&(n[t][1].substring(n[t][1].length-n[t-1][1].length)===n[t-1][1]?(n[t][1]=n[t-1][1]+n[t][1].substring(0,n[t][1].length-n[t-1][1].length),n[t+1][1]=n[t-1][1]+n[t+1][1],n.splice(t-1,1),f=!0):n[t][1].substring(0,n[t+1][1].length)==n[t+1][1]&&(n[t-1][1]+=n[t+1][1],n[t][1]=n[t][1].substring(n[t+1][1].length)+n[t+1][1],n.splice(t+1,1),f=!0)),t++;f&&zi(n,e)}function ll(n){return n>=55296&&n<=56319}function cl(n){return n>=56320&&n<=57343}function ul(n){return cl(n.charCodeAt(0))}function dl(n){return ll(n.charCodeAt(n.length-1))}function ug(n){for(var e=[],t=0;t<n.length;t++)n[t][1].length>0&&e.push(n[t]);return e}function Vs(n,e,t,r){return dl(n)||ul(r)?null:ug([[de,n],[Re,e],[Se,t],[de,r]])}function dg(n,e,t){var r=typeof t=="number"?{index:t,length:0}:t.oldRange,s=typeof t=="number"?null:t.newRange,i=n.length,a=e.length;if(r.length===0&&(s===null||s.length===0)){var o=r.index,c=n.slice(0,o),u=n.slice(o),h=s?s.index:null;e:{var p=o+a-i;if(h!==null&&h!==p||p<0||p>a)break e;var f=e.slice(0,p),g=e.slice(p);if(g!==u)break e;var m=Math.min(o,p),E=c.slice(0,m),y=f.slice(0,m);if(E!==y)break e;var _=c.slice(m),A=f.slice(m);return Vs(E,_,A,u)}e:{if(h!==null&&h!==o)break e;var w=o,f=e.slice(0,w),g=e.slice(w);if(f!==c)break e;var v=Math.min(i-w,a-w),S=u.slice(u.length-v),O=g.slice(g.length-v);if(S!==O)break e;var _=u.slice(0,u.length-v),A=g.slice(0,g.length-v);return Vs(c,_,A,S)}}if(r.length>0&&s&&s.length===0)e:{var E=n.slice(0,r.index),S=n.slice(r.index+r.length),m=E.length,v=S.length;if(a<m+v)break e;var y=e.slice(0,m),O=e.slice(a-v);if(E!==y||S!==O)break e;var _=n.slice(m,i-v),A=e.slice(m,a-v);return Vs(E,_,A,S)}return null}function ts(n,e,t,r){return tr(n,e,t,r,!0)}ts.INSERT=Se;ts.DELETE=Re;ts.EQUAL=de;var hg=ts,Hr={exports:{}};Hr.exports;(function(n,e){var t=200,r="__lodash_hash_undefined__",s=9007199254740991,i="[object Arguments]",a="[object Array]",o="[object Boolean]",c="[object Date]",u="[object Error]",h="[object Function]",p="[object GeneratorFunction]",f="[object Map]",g="[object Number]",m="[object Object]",E="[object Promise]",y="[object RegExp]",_="[object Set]",A="[object String]",w="[object Symbol]",v="[object WeakMap]",S="[object ArrayBuffer]",O="[object DataView]",B="[object Float32Array]",H="[object Float64Array]",Q="[object Int8Array]",ne="[object Int16Array]",ge="[object Int32Array]",Te="[object Uint8Array]",le="[object Uint8ClampedArray]",ie="[object Uint16Array]",ce="[object Uint32Array]",Pe=/[\\^$.*+?()[\]{}|]/g,x=/\w*$/,C=/^\[object .+?Constructor\]$/,$=/^(?:0|[1-9]\d*)$/,I={};I[i]=I[a]=I[S]=I[O]=I[o]=I[c]=I[B]=I[H]=I[Q]=I[ne]=I[ge]=I[f]=I[g]=I[m]=I[y]=I[_]=I[A]=I[w]=I[Te]=I[le]=I[ie]=I[ce]=!0,I[u]=I[h]=I[v]=!1;var G=typeof vt=="object"&&vt&&vt.Object===Object&&vt,re=typeof self=="object"&&self&&self.Object===Object&&self,X=G||re||Function("return this")(),at=e&&!e.nodeType&&e,z=at&&!0&&n&&!n.nodeType&&n,Ae=z&&z.exports===at;function rn(l,d){return l.set(d[0],d[1]),l}function xe(l,d){return l.add(d),l}function Lt(l,d){for(var b=-1,T=l?l.length:0;++b<T&&d(l[b],b,l)!==!1;);return l}function sn(l,d){for(var b=-1,T=d.length,F=l.length;++b<T;)l[F+b]=d[b];return l}function It(l,d,b,T){for(var F=-1,q=l?l.length:0;++F<q;)b=d(b,l[F],F,l);return b}function Rt(l,d){for(var b=-1,T=Array(l);++b<l;)T[b]=d(b);return T}function an(l,d){return l?.[d]}function Ye(l){var d=!1;if(l!=null&&typeof l.toString!="function")try{d=!!(l+"")}catch{}return d}function kt(l){var d=-1,b=Array(l.size);return l.forEach((function(T,F){b[++d]=[F,T]})),b}function Ee(l,d){return function(b){return l(d(b))}}function on(l){var d=-1,b=Array(l.size);return l.forEach((function(T){b[++d]=T})),b}var Mt=Array.prototype,P=Function.prototype,ot=Object.prototype,se=X["__core-js_shared__"],W=function(){var l=/[^.]+$/.exec(se&&se.keys&&se.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}(),lt=P.toString,fe=ot.hasOwnProperty,Qe=ot.toString,Dt=RegExp("^"+lt.call(fe).replace(Pe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),L=Ae?X.Buffer:void 0,R=X.Symbol,U=X.Uint8Array,K=Ee(Object.getPrototypeOf,Object),ae=Object.create,Ce=ot.propertyIsEnumerable,kn=Mt.splice,Bt=Object.getOwnPropertySymbols,ln=L?L.isBuffer:void 0,gr=Ee(Object.keys,Object),cn=Fe(X,"DataView"),qt=Fe(X,"Map"),Ue=Fe(X,"Promise"),un=Fe(X,"Set"),Mn=Fe(X,"WeakMap"),$t=Fe(Object,"create"),Dn=we(cn),Pt=we(qt),Bn=we(Ue),qn=we(un),$n=we(Mn),Et=R?R.prototype:void 0,pr=Et?Et.valueOf:void 0;function ct(l){var d=-1,b=l?l.length:0;for(this.clear();++d<b;){var T=l[d];this.set(T[0],T[1])}}function ls(){this.__data__=$t?$t(null):{}}function cs(l){return this.has(l)&&delete this.__data__[l]}function us(l){var d=this.__data__;if($t){var b=d[l];return b===r?void 0:b}return fe.call(d,l)?d[l]:void 0}function mr(l){var d=this.__data__;return $t?d[l]!==void 0:fe.call(d,l)}function Pn(l,d){var b=this.__data__;return b[l]=$t&&d===void 0?r:d,this}ct.prototype.clear=ls,ct.prototype.delete=cs,ct.prototype.get=us,ct.prototype.has=mr,ct.prototype.set=Pn;function pe(l){var d=-1,b=l?l.length:0;for(this.clear();++d<b;){var T=l[d];this.set(T[0],T[1])}}function ds(){this.__data__=[]}function hs(l){var d=this.__data__,b=hn(d,l);if(b<0)return!1;var T=d.length-1;return b==T?d.pop():kn.call(d,b,1),!0}function fs(l){var d=this.__data__,b=hn(d,l);return b<0?void 0:d[b][1]}function gs(l){return hn(this.__data__,l)>-1}function ps(l,d){var b=this.__data__,T=hn(b,l);return T<0?b.push([l,d]):b[T][1]=d,this}pe.prototype.clear=ds,pe.prototype.delete=hs,pe.prototype.get=fs,pe.prototype.has=gs,pe.prototype.set=ps;function ye(l){var d=-1,b=l?l.length:0;for(this.clear();++d<b;){var T=l[d];this.set(T[0],T[1])}}function ms(){this.__data__={hash:new ct,map:new(qt||pe),string:new ct}}function bs(l){return Ft(this,l).delete(l)}function Es(l){return Ft(this,l).get(l)}function ys(l){return Ft(this,l).has(l)}function _s(l,d){return Ft(this,l).set(l,d),this}ye.prototype.clear=ms,ye.prototype.delete=bs,ye.prototype.get=Es,ye.prototype.has=ys,ye.prototype.set=_s;function Le(l){this.__data__=new pe(l)}function vs(){this.__data__=new pe}function Ns(l){return this.__data__.delete(l)}function Ts(l){return this.__data__.get(l)}function As(l){return this.__data__.has(l)}function ws(l,d){var b=this.__data__;if(b instanceof pe){var T=b.__data__;if(!qt||T.length<t-1)return T.push([l,d]),this;b=this.__data__=new ye(T)}return b.set(l,d),this}Le.prototype.clear=vs,Le.prototype.delete=Ns,Le.prototype.get=Ts,Le.prototype.has=As,Le.prototype.set=ws;function dn(l,d){var b=zn(l)||gn(l)?Rt(l.length,String):[],T=b.length,F=!!T;for(var q in l)fe.call(l,q)&&!(F&&(q=="length"||Ps(q,T)))&&b.push(q);return b}function br(l,d,b){var T=l[d];(!(fe.call(l,d)&&Nr(T,b))||b===void 0&&!(d in l))&&(l[d]=b)}function hn(l,d){for(var b=l.length;b--;)if(Nr(l[b][0],d))return b;return-1}function Xe(l,d){return l&&Hn(d,Gn(d),l)}function Un(l,d,b,T,F,q,Z){var j;if(T&&(j=q?T(l,F,q,Z):T(l)),j!==void 0)return j;if(!et(l))return l;var oe=zn(l);if(oe){if(j=qs(l),!d)return Ms(l,j)}else{var V=dt(l),_e=V==h||V==p;if(Tr(l))return fn(l,d);if(V==m||V==i||_e&&!q){if(Ye(l))return q?l:{};if(j=Je(_e?{}:l),!d)return Ds(l,Xe(j,l))}else{if(!I[V])return q?l:{};j=$s(l,V,Un,d)}}Z||(Z=new Le);var Ie=Z.get(l);if(Ie)return Ie;if(Z.set(l,j),!oe)var ue=b?Bs(l):Gn(l);return Lt(ue||l,(function(ve,me){ue&&(me=ve,ve=l[me]),br(j,me,Un(ve,d,b,T,me,l,Z))})),j}function Ss(l){return et(l)?ae(l):{}}function Os(l,d,b){var T=d(l);return zn(l)?T:sn(T,b(l))}function xs(l){return Qe.call(l)}function Cs(l){if(!et(l)||Fs(l))return!1;var d=Kn(l)||Ye(l)?Dt:C;return d.test(we(l))}function Ls(l){if(!_r(l))return gr(l);var d=[];for(var b in Object(l))fe.call(l,b)&&b!="constructor"&&d.push(b);return d}function fn(l,d){if(d)return l.slice();var b=new l.constructor(l.length);return l.copy(b),b}function Fn(l){var d=new l.constructor(l.byteLength);return new U(d).set(new U(l)),d}function Ut(l,d){var b=d?Fn(l.buffer):l.buffer;return new l.constructor(b,l.byteOffset,l.byteLength)}function Er(l,d,b){var T=d?b(kt(l),!0):kt(l);return It(T,rn,new l.constructor)}function yr(l){var d=new l.constructor(l.source,x.exec(l));return d.lastIndex=l.lastIndex,d}function Is(l,d,b){var T=d?b(on(l),!0):on(l);return It(T,xe,new l.constructor)}function Rs(l){return pr?Object(pr.call(l)):{}}function ks(l,d){var b=d?Fn(l.buffer):l.buffer;return new l.constructor(b,l.byteOffset,l.length)}function Ms(l,d){var b=-1,T=l.length;for(d||(d=Array(T));++b<T;)d[b]=l[b];return d}function Hn(l,d,b,T){b||(b={});for(var F=-1,q=d.length;++F<q;){var Z=d[F],j=void 0;br(b,Z,j===void 0?l[Z]:j)}return b}function Ds(l,d){return Hn(l,ut(l),d)}function Bs(l){return Os(l,Gn,ut)}function Ft(l,d){var b=l.__data__;return Us(d)?b[typeof d=="string"?"string":"hash"]:b.map}function Fe(l,d){var b=an(l,d);return Cs(b)?b:void 0}var ut=Bt?Ee(Bt,Object):zs,dt=xs;(cn&&dt(new cn(new ArrayBuffer(1)))!=O||qt&&dt(new qt)!=f||Ue&&dt(Ue.resolve())!=E||un&&dt(new un)!=_||Mn&&dt(new Mn)!=v)&&(dt=function(l){var d=Qe.call(l),b=d==m?l.constructor:void 0,T=b?we(b):void 0;if(T)switch(T){case Dn:return O;case Pt:return f;case Bn:return E;case qn:return _;case $n:return v}return d});function qs(l){var d=l.length,b=l.constructor(d);return d&&typeof l[0]=="string"&&fe.call(l,"index")&&(b.index=l.index,b.input=l.input),b}function Je(l){return typeof l.constructor=="function"&&!_r(l)?Ss(K(l)):{}}function $s(l,d,b,T){var F=l.constructor;switch(d){case S:return Fn(l);case o:case c:return new F(+l);case O:return Ut(l,T);case B:case H:case Q:case ne:case ge:case Te:case le:case ie:case ce:return ks(l,T);case f:return Er(l,T,b);case g:case A:return new F(l);case y:return yr(l);case _:return Is(l,T,b);case w:return Rs(l)}}function Ps(l,d){return d=d??s,!!d&&(typeof l=="number"||$.test(l))&&l>-1&&l%1==0&&l<d}function Us(l){var d=typeof l;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?l!=="__proto__":l===null}function Fs(l){return!!W&&W in l}function _r(l){var d=l&&l.constructor,b=typeof d=="function"&&d.prototype||ot;return l===b}function we(l){if(l!=null){try{return lt.call(l)}catch{}try{return l+""}catch{}}return""}function vr(l){return Un(l,!0,!0)}function Nr(l,d){return l===d||l!==l&&d!==d}function gn(l){return Hs(l)&&fe.call(l,"callee")&&(!Ce.call(l,"callee")||Qe.call(l)==i)}var zn=Array.isArray;function pn(l){return l!=null&&Ar(l.length)&&!Kn(l)}function Hs(l){return wr(l)&&pn(l)}var Tr=ln||Ks;function Kn(l){var d=et(l)?Qe.call(l):"";return d==h||d==p}function Ar(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=s}function et(l){var d=typeof l;return!!l&&(d=="object"||d=="function")}function wr(l){return!!l&&typeof l=="object"}function Gn(l){return pn(l)?dn(l):Ls(l)}function zs(){return[]}function Ks(){return!1}n.exports=vr})(Hr,Hr.exports);var hl=Hr.exports,zr={exports:{}};zr.exports;(function(n,e){var t=200,r="__lodash_hash_undefined__",s=1,i=2,a=9007199254740991,o="[object Arguments]",c="[object Array]",u="[object AsyncFunction]",h="[object Boolean]",p="[object Date]",f="[object Error]",g="[object Function]",m="[object GeneratorFunction]",E="[object Map]",y="[object Number]",_="[object Null]",A="[object Object]",w="[object Promise]",v="[object Proxy]",S="[object RegExp]",O="[object Set]",B="[object String]",H="[object Symbol]",Q="[object Undefined]",ne="[object WeakMap]",ge="[object ArrayBuffer]",Te="[object DataView]",le="[object Float32Array]",ie="[object Float64Array]",ce="[object Int8Array]",Pe="[object Int16Array]",x="[object Int32Array]",C="[object Uint8Array]",$="[object Uint8ClampedArray]",I="[object Uint16Array]",G="[object Uint32Array]",re=/[\\^$.*+?()[\]{}|]/g,X=/^\[object .+?Constructor\]$/,at=/^(?:0|[1-9]\d*)$/,z={};z[le]=z[ie]=z[ce]=z[Pe]=z[x]=z[C]=z[$]=z[I]=z[G]=!0,z[o]=z[c]=z[ge]=z[h]=z[Te]=z[p]=z[f]=z[g]=z[E]=z[y]=z[A]=z[S]=z[O]=z[B]=z[ne]=!1;var Ae=typeof vt=="object"&&vt&&vt.Object===Object&&vt,rn=typeof self=="object"&&self&&self.Object===Object&&self,xe=Ae||rn||Function("return this")(),Lt=e&&!e.nodeType&&e,sn=Lt&&!0&&n&&!n.nodeType&&n,It=sn&&sn.exports===Lt,Rt=It&&Ae.process,an=function(){try{return Rt&&Rt.binding&&Rt.binding("util")}catch{}}(),Ye=an&&an.isTypedArray;function kt(l,d){for(var b=-1,T=l==null?0:l.length,F=0,q=[];++b<T;){var Z=l[b];d(Z,b,l)&&(q[F++]=Z)}return q}function Ee(l,d){for(var b=-1,T=d.length,F=l.length;++b<T;)l[F+b]=d[b];return l}function on(l,d){for(var b=-1,T=l==null?0:l.length;++b<T;)if(d(l[b],b,l))return!0;return!1}function Mt(l,d){for(var b=-1,T=Array(l);++b<l;)T[b]=d(b);return T}function P(l){return function(d){return l(d)}}function ot(l,d){return l.has(d)}function se(l,d){return l?.[d]}function W(l){var d=-1,b=Array(l.size);return l.forEach((function(T,F){b[++d]=[F,T]})),b}function lt(l,d){return function(b){return l(d(b))}}function fe(l){var d=-1,b=Array(l.size);return l.forEach((function(T){b[++d]=T})),b}var Qe=Array.prototype,Dt=Function.prototype,L=Object.prototype,R=xe["__core-js_shared__"],U=Dt.toString,K=L.hasOwnProperty,ae=function(){var l=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}(),Ce=L.toString,kn=RegExp("^"+U.call(K).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bt=It?xe.Buffer:void 0,ln=xe.Symbol,gr=xe.Uint8Array,cn=L.propertyIsEnumerable,qt=Qe.splice,Ue=ln?ln.toStringTag:void 0,un=Object.getOwnPropertySymbols,Mn=Bt?Bt.isBuffer:void 0,$t=lt(Object.keys,Object),Dn=ut(xe,"DataView"),Pt=ut(xe,"Map"),Bn=ut(xe,"Promise"),qn=ut(xe,"Set"),$n=ut(xe,"WeakMap"),Et=ut(Object,"create"),pr=we(Dn),ct=we(Pt),ls=we(Bn),cs=we(qn),us=we($n),mr=ln?ln.prototype:void 0,Pn=mr?mr.valueOf:void 0;function pe(l){var d=-1,b=l==null?0:l.length;for(this.clear();++d<b;){var T=l[d];this.set(T[0],T[1])}}function ds(){this.__data__=Et?Et(null):{},this.size=0}function hs(l){var d=this.has(l)&&delete this.__data__[l];return this.size-=d?1:0,d}function fs(l){var d=this.__data__;if(Et){var b=d[l];return b===r?void 0:b}return K.call(d,l)?d[l]:void 0}function gs(l){var d=this.__data__;return Et?d[l]!==void 0:K.call(d,l)}function ps(l,d){var b=this.__data__;return this.size+=this.has(l)?0:1,b[l]=Et&&d===void 0?r:d,this}pe.prototype.clear=ds,pe.prototype.delete=hs,pe.prototype.get=fs,pe.prototype.has=gs,pe.prototype.set=ps;function ye(l){var d=-1,b=l==null?0:l.length;for(this.clear();++d<b;){var T=l[d];this.set(T[0],T[1])}}function ms(){this.__data__=[],this.size=0}function bs(l){var d=this.__data__,b=fn(d,l);if(b<0)return!1;var T=d.length-1;return b==T?d.pop():qt.call(d,b,1),--this.size,!0}function Es(l){var d=this.__data__,b=fn(d,l);return b<0?void 0:d[b][1]}function ys(l){return fn(this.__data__,l)>-1}function _s(l,d){var b=this.__data__,T=fn(b,l);return T<0?(++this.size,b.push([l,d])):b[T][1]=d,this}ye.prototype.clear=ms,ye.prototype.delete=bs,ye.prototype.get=Es,ye.prototype.has=ys,ye.prototype.set=_s;function Le(l){var d=-1,b=l==null?0:l.length;for(this.clear();++d<b;){var T=l[d];this.set(T[0],T[1])}}function vs(){this.size=0,this.__data__={hash:new pe,map:new(Pt||ye),string:new pe}}function Ns(l){var d=Fe(this,l).delete(l);return this.size-=d?1:0,d}function Ts(l){return Fe(this,l).get(l)}function As(l){return Fe(this,l).has(l)}function ws(l,d){var b=Fe(this,l),T=b.size;return b.set(l,d),this.size+=b.size==T?0:1,this}Le.prototype.clear=vs,Le.prototype.delete=Ns,Le.prototype.get=Ts,Le.prototype.has=As,Le.prototype.set=ws;function dn(l){var d=-1,b=l==null?0:l.length;for(this.__data__=new Le;++d<b;)this.add(l[d])}function br(l){return this.__data__.set(l,r),this}function hn(l){return this.__data__.has(l)}dn.prototype.add=dn.prototype.push=br,dn.prototype.has=hn;function Xe(l){var d=this.__data__=new ye(l);this.size=d.size}function Un(){this.__data__=new ye,this.size=0}function Ss(l){var d=this.__data__,b=d.delete(l);return this.size=d.size,b}function Os(l){return this.__data__.get(l)}function xs(l){return this.__data__.has(l)}function Cs(l,d){var b=this.__data__;if(b instanceof ye){var T=b.__data__;if(!Pt||T.length<t-1)return T.push([l,d]),this.size=++b.size,this;b=this.__data__=new Le(T)}return b.set(l,d),this.size=b.size,this}Xe.prototype.clear=Un,Xe.prototype.delete=Ss,Xe.prototype.get=Os,Xe.prototype.has=xs,Xe.prototype.set=Cs;function Ls(l,d){var b=gn(l),T=!b&&Nr(l),F=!b&&!T&&pn(l),q=!b&&!T&&!F&&wr(l),Z=b||T||F||q,j=Z?Mt(l.length,String):[],oe=j.length;for(var V in l)K.call(l,V)&&!(Z&&(V=="length"||F&&(V=="offset"||V=="parent")||q&&(V=="buffer"||V=="byteLength"||V=="byteOffset")||$s(V,oe)))&&j.push(V);return j}function fn(l,d){for(var b=l.length;b--;)if(vr(l[b][0],d))return b;return-1}function Fn(l,d,b){var T=d(l);return gn(l)?T:Ee(T,b(l))}function Ut(l){return l==null?l===void 0?Q:_:Ue&&Ue in Object(l)?dt(l):_r(l)}function Er(l){return et(l)&&Ut(l)==o}function yr(l,d,b,T,F){return l===d?!0:l==null||d==null||!et(l)&&!et(d)?l!==l&&d!==d:Is(l,d,b,T,yr,F)}function Is(l,d,b,T,F,q){var Z=gn(l),j=gn(d),oe=Z?c:Je(l),V=j?c:Je(d);oe=oe==o?A:oe,V=V==o?A:V;var _e=oe==A,Ie=V==A,ue=oe==V;if(ue&&pn(l)){if(!pn(d))return!1;Z=!0,_e=!1}if(ue&&!_e)return q||(q=new Xe),Z||wr(l)?Hn(l,d,b,T,F,q):Ds(l,d,oe,b,T,F,q);if(!(b&s)){var ve=_e&&K.call(l,"__wrapped__"),me=Ie&&K.call(d,"__wrapped__");if(ve||me){var yt=ve?l.value():l,ht=me?d.value():d;return q||(q=new Xe),F(yt,ht,b,T,q)}}return ue?(q||(q=new Xe),Bs(l,d,b,T,F,q)):!1}function Rs(l){if(!Ar(l)||Us(l))return!1;var d=Tr(l)?kn:X;return d.test(we(l))}function ks(l){return et(l)&&Kn(l.length)&&!!z[Ut(l)]}function Ms(l){if(!Fs(l))return $t(l);var d=[];for(var b in Object(l))K.call(l,b)&&b!="constructor"&&d.push(b);return d}function Hn(l,d,b,T,F,q){var Z=b&s,j=l.length,oe=d.length;if(j!=oe&&!(Z&&oe>j))return!1;var V=q.get(l);if(V&&q.get(d))return V==d;var _e=-1,Ie=!0,ue=b&i?new dn:void 0;for(q.set(l,d),q.set(d,l);++_e<j;){var ve=l[_e],me=d[_e];if(T)var yt=Z?T(me,ve,_e,d,l,q):T(ve,me,_e,l,d,q);if(yt!==void 0){if(yt)continue;Ie=!1;break}if(ue){if(!on(d,(function(ht,Ht){if(!ot(ue,Ht)&&(ve===ht||F(ve,ht,b,T,q)))return ue.push(Ht)}))){Ie=!1;break}}else if(!(ve===me||F(ve,me,b,T,q))){Ie=!1;break}}return q.delete(l),q.delete(d),Ie}function Ds(l,d,b,T,F,q,Z){switch(b){case Te:if(l.byteLength!=d.byteLength||l.byteOffset!=d.byteOffset)return!1;l=l.buffer,d=d.buffer;case ge:return!(l.byteLength!=d.byteLength||!q(new gr(l),new gr(d)));case h:case p:case y:return vr(+l,+d);case f:return l.name==d.name&&l.message==d.message;case S:case B:return l==d+"";case E:var j=W;case O:var oe=T&s;if(j||(j=fe),l.size!=d.size&&!oe)return!1;var V=Z.get(l);if(V)return V==d;T|=i,Z.set(l,d);var _e=Hn(j(l),j(d),T,F,q,Z);return Z.delete(l),_e;case H:if(Pn)return Pn.call(l)==Pn.call(d)}return!1}function Bs(l,d,b,T,F,q){var Z=b&s,j=Ft(l),oe=j.length,V=Ft(d),_e=V.length;if(oe!=_e&&!Z)return!1;for(var Ie=oe;Ie--;){var ue=j[Ie];if(!(Z?ue in d:K.call(d,ue)))return!1}var ve=q.get(l);if(ve&&q.get(d))return ve==d;var me=!0;q.set(l,d),q.set(d,l);for(var yt=Z;++Ie<oe;){ue=j[Ie];var ht=l[ue],Ht=d[ue];if(T)var ua=Z?T(Ht,ht,ue,d,l,q):T(ht,Ht,ue,l,d,q);if(!(ua===void 0?ht===Ht||F(ht,Ht,b,T,q):ua)){me=!1;break}yt||(yt=ue=="constructor")}if(me&&!yt){var Sr=l.constructor,Or=d.constructor;Sr!=Or&&"constructor"in l&&"constructor"in d&&!(typeof Sr=="function"&&Sr instanceof Sr&&typeof Or=="function"&&Or instanceof Or)&&(me=!1)}return q.delete(l),q.delete(d),me}function Ft(l){return Fn(l,Gn,qs)}function Fe(l,d){var b=l.__data__;return Ps(d)?b[typeof d=="string"?"string":"hash"]:b.map}function ut(l,d){var b=se(l,d);return Rs(b)?b:void 0}function dt(l){var d=K.call(l,Ue),b=l[Ue];try{l[Ue]=void 0;var T=!0}catch{}var F=Ce.call(l);return T&&(d?l[Ue]=b:delete l[Ue]),F}var qs=un?function(l){return l==null?[]:(l=Object(l),kt(un(l),(function(d){return cn.call(l,d)})))}:zs,Je=Ut;(Dn&&Je(new Dn(new ArrayBuffer(1)))!=Te||Pt&&Je(new Pt)!=E||Bn&&Je(Bn.resolve())!=w||qn&&Je(new qn)!=O||$n&&Je(new $n)!=ne)&&(Je=function(l){var d=Ut(l),b=d==A?l.constructor:void 0,T=b?we(b):"";if(T)switch(T){case pr:return Te;case ct:return E;case ls:return w;case cs:return O;case us:return ne}return d});function $s(l,d){return d=d??a,!!d&&(typeof l=="number"||at.test(l))&&l>-1&&l%1==0&&l<d}function Ps(l){var d=typeof l;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?l!=="__proto__":l===null}function Us(l){return!!ae&&ae in l}function Fs(l){var d=l&&l.constructor,b=typeof d=="function"&&d.prototype||L;return l===b}function _r(l){return Ce.call(l)}function we(l){if(l!=null){try{return U.call(l)}catch{}try{return l+""}catch{}}return""}function vr(l,d){return l===d||l!==l&&d!==d}var Nr=Er(function(){return arguments}())?Er:function(l){return et(l)&&K.call(l,"callee")&&!cn.call(l,"callee")},gn=Array.isArray;function zn(l){return l!=null&&Kn(l.length)&&!Tr(l)}var pn=Mn||Ks;function Hs(l,d){return yr(l,d)}function Tr(l){if(!Ar(l))return!1;var d=Ut(l);return d==g||d==m||d==u||d==v}function Kn(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=a}function Ar(l){var d=typeof l;return l!=null&&(d=="object"||d=="function")}function et(l){return l!=null&&typeof l=="object"}var wr=Ye?P(Ye):ks;function Gn(l){return zn(l)?Ls(l):Ms(l)}function zs(){return[]}function Ks(){return!1}n.exports=Hs})(zr,zr.exports);var fl=zr.exports,Ki={};Object.defineProperty(Ki,"__esModule",{value:!0});const fg=hl,gg=fl;var Ni;(function(n){function e(i={},a={},o=!1){typeof i!="object"&&(i={}),typeof a!="object"&&(a={});let c=fg(a);o||(c=Object.keys(c).reduce(((u,h)=>(c[h]!=null&&(u[h]=c[h]),u)),{}));for(const u in i)i[u]!==void 0&&a[u]===void 0&&(c[u]=i[u]);return Object.keys(c).length>0?c:void 0}n.compose=e;function t(i={},a={}){typeof i!="object"&&(i={}),typeof a!="object"&&(a={});const o=Object.keys(i).concat(Object.keys(a)).reduce(((c,u)=>(gg(i[u],a[u])||(c[u]=a[u]===void 0?null:a[u]),c)),{});return Object.keys(o).length>0?o:void 0}n.diff=t;function r(i={},a={}){i=i||{};const o=Object.keys(a).reduce(((c,u)=>(a[u]!==i[u]&&i[u]!==void 0&&(c[u]=a[u]),c)),{});return Object.keys(i).reduce(((c,u)=>(i[u]!==a[u]&&a[u]===void 0&&(c[u]=null),c)),o)}n.invert=r;function s(i,a,o=!1){if(typeof i!="object")return a;if(typeof a!="object")return;if(!o)return a;const c=Object.keys(a).reduce(((u,h)=>(i[h]===void 0&&(u[h]=a[h]),u)),{});return Object.keys(c).length>0?c:void 0}n.transform=s})(Ni||(Ni={}));Ki.default=Ni;var ns={};Object.defineProperty(ns,"__esModule",{value:!0});var Ti;(function(n){function e(t){return typeof t.delete=="number"?t.delete:typeof t.retain=="number"?t.retain:typeof t.retain=="object"&&t.retain!==null?1:typeof t.insert=="string"?t.insert.length:1}n.length=e})(Ti||(Ti={}));ns.default=Ti;var Gi={};Object.defineProperty(Gi,"__esModule",{value:!0});const Ka=ns;class pg{constructor(e){this.ops=e,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);const t=this.ops[this.index];if(t){const r=this.offset,s=Ka.default.length(t);if(e>=s-r?(e=s-r,this.index+=1,this.offset=0):this.offset+=e,typeof t.delete=="number")return{delete:e};{const i={};return t.attributes&&(i.attributes=t.attributes),typeof t.retain=="number"?i.retain=e:typeof t.retain=="object"&&t.retain!==null?i.retain=t.retain:typeof t.insert=="string"?i.insert=t.insert.substr(r,e):i.insert=t.insert,i}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?Ka.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const e=this.ops[this.index];return e?typeof e.delete=="number"?"delete":typeof e.retain=="number"||typeof e.retain=="object"&&e.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const e=this.offset,t=this.index,r=this.next(),s=this.ops.slice(this.index);return this.offset=e,this.index=t,[r].concat(s)}}else return[]}}Gi.default=pg;(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=hg,r=hl,s=fl,i=Ki;e.AttributeMap=i.default;const a=ns;e.Op=a.default;const o=Gi;e.OpIterator=o.default;const c="\0",u=(p,f)=>{if(typeof p!="object"||p===null)throw new Error(`cannot retain a ${typeof p}`);if(typeof f!="object"||f===null)throw new Error(`cannot retain a ${typeof f}`);const g=Object.keys(p)[0];if(!g||g!==Object.keys(f)[0])throw new Error(`embed types not matched: ${g} != ${Object.keys(f)[0]}`);return[g,p[g],f[g]]};class h{constructor(f){Array.isArray(f)?this.ops=f:f!=null&&Array.isArray(f.ops)?this.ops=f.ops:this.ops=[]}static registerEmbed(f,g){this.handlers[f]=g}static unregisterEmbed(f){delete this.handlers[f]}static getHandler(f){const g=this.handlers[f];if(!g)throw new Error(`no handlers for embed type "${f}"`);return g}insert(f,g){const m={};return typeof f=="string"&&f.length===0?this:(m.insert=f,g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(m.attributes=g),this.push(m))}delete(f){return f<=0?this:this.push({delete:f})}retain(f,g){if(typeof f=="number"&&f<=0)return this;const m={retain:f};return g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(m.attributes=g),this.push(m)}push(f){let g=this.ops.length,m=this.ops[g-1];if(f=r(f),typeof m=="object"){if(typeof f.delete=="number"&&typeof m.delete=="number")return this.ops[g-1]={delete:m.delete+f.delete},this;if(typeof m.delete=="number"&&f.insert!=null&&(g-=1,m=this.ops[g-1],typeof m!="object"))return this.ops.unshift(f),this;if(s(f.attributes,m.attributes)){if(typeof f.insert=="string"&&typeof m.insert=="string")return this.ops[g-1]={insert:m.insert+f.insert},typeof f.attributes=="object"&&(this.ops[g-1].attributes=f.attributes),this;if(typeof f.retain=="number"&&typeof m.retain=="number")return this.ops[g-1]={retain:m.retain+f.retain},typeof f.attributes=="object"&&(this.ops[g-1].attributes=f.attributes),this}}return g===this.ops.length?this.ops.push(f):this.ops.splice(g,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 g=[],m=[];return this.forEach((E=>{(f(E)?g:m).push(E)})),[g,m]}reduce(f,g){return this.ops.reduce(f,g)}changeLength(){return this.reduce(((f,g)=>g.insert?f+a.default.length(g):g.delete?f-g.delete:f),0)}length(){return this.reduce(((f,g)=>f+a.default.length(g)),0)}slice(f=0,g=1/0){const m=[],E=new o.default(this.ops);let y=0;for(;y<g&&E.hasNext();){let _;y<f?_=E.next(f-y):(_=E.next(g-y),m.push(_)),y+=a.default.length(_)}return new h(m)}compose(f){const g=new o.default(this.ops),m=new o.default(f.ops),E=[],y=m.peek();if(y!=null&&typeof y.retain=="number"&&y.attributes==null){let A=y.retain;for(;g.peekType()==="insert"&&g.peekLength()<=A;)A-=g.peekLength(),E.push(g.next());y.retain-A>0&&m.next(y.retain-A)}const _=new h(E);for(;g.hasNext()||m.hasNext();)if(m.peekType()==="insert")_.push(m.next());else if(g.peekType()==="delete")_.push(g.next());else{const A=Math.min(g.peekLength(),m.peekLength()),w=g.next(A),v=m.next(A);if(v.retain){const S={};if(typeof w.retain=="number")S.retain=typeof v.retain=="number"?A:v.retain;else if(typeof v.retain=="number")w.retain==null?S.insert=w.insert:S.retain=w.retain;else{const B=w.retain==null?"insert":"retain",[H,Q,ne]=u(w[B],v.retain),ge=h.getHandler(H);S[B]={[H]:ge.compose(Q,ne,B==="retain")}}const O=i.default.compose(w.attributes,v.attributes,typeof w.retain=="number");if(O&&(S.attributes=O),_.push(S),!m.hasNext()&&s(_.ops[_.ops.length-1],S)){const B=new h(g.rest());return _.concat(B).chop()}}else typeof v.delete=="number"&&(typeof w.retain=="number"||typeof w.retain=="object"&&w.retain!==null)&&_.push(v)}return _.chop()}concat(f){const g=new h(this.ops.slice());return f.ops.length>0&&(g.push(f.ops[0]),g.ops=g.ops.concat(f.ops.slice(1))),g}diff(f,g){if(this.ops===f.ops)return new h;const m=[this,f].map((w=>w.map((v=>{if(v.insert!=null)return typeof v.insert=="string"?v.insert:c;const S=w===f?"on":"with";throw new Error("diff() called "+S+" non-document")})).join(""))),E=new h,y=t(m[0],m[1],g,!0),_=new o.default(this.ops),A=new o.default(f.ops);return y.forEach((w=>{let v=w[1].length;for(;v>0;){let S=0;switch(w[0]){case t.INSERT:S=Math.min(A.peekLength(),v),E.push(A.next(S));break;case t.DELETE:S=Math.min(v,_.peekLength()),_.next(S),E.delete(S);break;case t.EQUAL:S=Math.min(_.peekLength(),A.peekLength(),v);const O=_.next(S),B=A.next(S);s(O.insert,B.insert)?E.retain(S,i.default.diff(O.attributes,B.attributes)):E.push(B).delete(S);break}v-=S}})),E.chop()}eachLine(f,g=`\n`){const m=new o.default(this.ops);let E=new h,y=0;for(;m.hasNext();){if(m.peekType()!=="insert")return;const _=m.peek(),A=a.default.length(_)-m.peekLength(),w=typeof _.insert=="string"?_.insert.indexOf(g,A)-A:-1;if(w<0)E.push(m.next());else if(w>0)E.push(m.next(w));else{if(f(E,m.next(1).attributes||{},y)===!1)return;y+=1,E=new h}}E.length()>0&&f(E,{},y)}invert(f){const g=new h;return this.reduce(((m,E)=>{if(E.insert)g.delete(a.default.length(E));else{if(typeof E.retain=="number"&&E.attributes==null)return g.retain(E.retain),m+E.retain;if(E.delete||typeof E.retain=="number"){const y=E.delete||E.retain;return f.slice(m,m+y).forEach((A=>{E.delete?g.push(A):E.retain&&E.attributes&&g.retain(a.default.length(A),i.default.invert(E.attributes,A.attributes))})),m+y}else if(typeof E.retain=="object"&&E.retain!==null){const y=f.slice(m,m+1),_=new o.default(y.ops).next(),[A,w,v]=u(E.retain,_.insert),S=h.getHandler(A);return g.retain({[A]:S.invert(w,v)},i.default.invert(E.attributes,_.attributes)),m+1}}return m}),0),g.chop()}transform(f,g=!1){if(g=!!g,typeof f=="number")return this.transformPosition(f,g);const m=f,E=new o.default(this.ops),y=new o.default(m.ops),_=new h;for(;E.hasNext()||y.hasNext();)if(E.peekType()==="insert"&&(g||y.peekType()!=="insert"))_.retain(a.default.length(E.next()));else if(y.peekType()==="insert")_.push(y.next());else{const A=Math.min(E.peekLength(),y.peekLength()),w=E.next(A),v=y.next(A);if(w.delete)continue;if(v.delete)_.push(v);else{const S=w.retain,O=v.retain;let B=typeof O=="object"&&O!==null?O:A;if(typeof S=="object"&&S!==null&&typeof O=="object"&&O!==null){const H=Object.keys(S)[0];if(H===Object.keys(O)[0]){const Q=h.getHandler(H);Q&&(B={[H]:Q.transform(S[H],O[H],g)})}}_.retain(B,i.default.transform(w.attributes,v.attributes,g))}}return _.chop()}transformPosition(f,g=!1){g=!!g;const m=new o.default(this.ops);let E=0;for(;m.hasNext()&&E<=f;){const y=m.peekLength(),_=m.peekType();if(m.next(),_==="delete"){f-=Math.min(y,f-E);continue}else _==="insert"&&(E<f||!g)&&(f+=y);E+=y}return f}}h.Op=a.default,h.OpIterator=o.default,h.AttributeMap=i.default,h.handlers={},e.default=h,n.exports=h,n.exports.default=h})(vi,vi.exports);var $e=vi.exports;const k=Fi($e);class Ve extends ke{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Ve.blotName="break";Ve.tagName="BR";let Ze=class extends Fr{};function rs(n){return n.replace(/[&<>"']/g,(e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e])))}let Ct=class zt extends Pi{static allowedChildren=[zt,Ve,ke,Ze];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(e,t){const r=zt.order.indexOf(e),s=zt.order.indexOf(t);return r>=0||s>=0?r-s:e===t?0:e<t?-1:1}formatAt(e,t,r,s){if(zt.compare(this.statics.blotName,r)<0&&this.scroll.query(r,D.BLOT)){const i=this.isolate(e,t);s&&i.wrap(r,s)}else super.formatAt(e,t,r,s)}optimize(e){if(super.optimize(e),this.parent instanceof zt&&zt.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}};const Ga=1;class be extends er{cache={};delta(){return this.cache.delta==null&&(this.cache.delta=gl(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,r,s){t<=0||(this.scroll.query(r,D.BLOCK)?e+t===this.length()&&this.format(r,s):super.formatAt(e,Math.min(t,this.length()-e-1),r,s),this.cache={})}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r),this.cache={};return}if(t.length===0)return;const s=t.split(`\n`),i=s.shift();i.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),i):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});let a=this;s.reduce(((o,c)=>(a=a.split(o,!0),a.insertAt(0,c),c.length)),e+i.length)}insertBefore(e,t){const{head:r}=this.children;super.insertBefore(e,t),r instanceof Ve&&r.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+Ga),this.cache.length}moveChildren(e,t){super.moveChildren(e,t),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 t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t&&(e===0||e>=this.length()-Ga)){const s=this.clone();return e===0?(this.parent.insertBefore(s,this),this):(this.parent.insertBefore(s,this.next),s)}const r=super.split(e,t);return this.cache={},r}}be.blotName="block";be.tagName="P";be.defaultChild=Ve;be.allowedChildren=[Ve,Ct,ke,Ze];let qe=class extends ke{attach(){super.attach(),this.attributes=new Xr(this.domNode)}delta(){return(new k).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const r=this.scroll.query(e,D.BLOCK_ATTRIBUTE);r!=null&&this.attributes.attribute(r,t)}formatAt(e,t,r,s){this.format(r,s)}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r);return}const s=t.split(`\n`),i=s.pop(),a=s.map((c=>{const u=this.scroll.create(be.blotName);return u.insertAt(0,c),u})),o=this.split(e);a.forEach((c=>{this.parent.insertBefore(c,o)})),i&&this.parent.insertBefore(this.scroll.create("text",i),o)}};qe.scope=D.BLOCK_BLOT;function gl(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.descendants(Ne).reduce(((t,r)=>r.length()===0?t:t.insert(r.value(),De(r,{},e))),new k).insert(`\n`,De(n))}function De(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return n==null||("formats"in n&&typeof n.formats=="function"&&(e={...e,...n.formats()},t&&delete e["code-token"]),n.parent==null||n.parent.statics.blotName==="scroll"||n.parent.statics.scope!==n.statics.scope)?e:De(n.parent,e,t)}class Ke extends ke{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\ufeff";static value(){}constructor(e,t,r){super(e,t),this.selection=r,this.textNode=document.createTextNode(Ke.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,t){if(this.savedLength!==0){super.format(e,t);return}let r=this,s=0;for(;r!=null&&r.statics.scope!==D.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=Ke.CONTENTS.length,r.optimize(),r.formatAt(s,Ke.CONTENTS.length,e,t),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}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 e=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof Ze?this.prev:null,r=t?t.length():0,s=this.next instanceof Ze?this.next:null,i=s?s.text:"",{textNode:a}=this,o=a.data.split(Ke.CONTENTS).join("");a.data=Ke.CONTENTS;let c;if(t)c=t,(o||s)&&(t.insertAt(t.length(),o+i),s&&s.remove());else if(s)c=s,s.insertAt(0,o);else{const u=document.createTextNode(o);c=this.scroll.create(u),this.parent.insertBefore(c,this)}if(this.remove(),e){const u=(f,g)=>t&&f===t.domNode?g:f===a?r+g-1:s&&f===s.domNode?r+o.length+g:null,h=u(e.start.node,e.start.offset),p=u(e.end.node,e.end.offset);if(h!==null&&p!==null)return{startNode:c.domNode,startOffset:h,endNode:c.domNode,endOffset:p}}return null}update(e,t){if(e.some((r=>r.type==="characterData"&&r.target===this.textNode))){const r=this.restore();r&&(t.range=r)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if(t.domNode.tagName==="A"){this.savedLength=Ke.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}}var pl={exports:{}};(function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(t=!1));function s(c,u,h){this.fn=c,this.context=u,this.once=h||!1}function i(c,u,h,p,f){if(typeof h!="function")throw new TypeError("The listener must be a function");var g=new s(h,p||c,f),m=t?t+u:u;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],g]:c._events[m].push(g):(c._events[m]=g,c._eventsCount++),c}function a(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],h,p;if(this._eventsCount===0)return u;for(p in h=this._events)e.call(h,p)&&u.push(t?p.slice(1):p);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(h)):u},o.prototype.listeners=function(u){var h=t?t+u:u,p=this._events[h];if(!p)return[];if(p.fn)return[p.fn];for(var f=0,g=p.length,m=new Array(g);f<g;f++)m[f]=p[f].fn;return m},o.prototype.listenerCount=function(u){var h=t?t+u:u,p=this._events[h];return p?p.fn?1:p.length:0},o.prototype.emit=function(u,h,p,f,g,m){var E=t?t+u:u;if(!this._events[E])return!1;var y=this._events[E],_=arguments.length,A,w;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),_){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,h),!0;case 3:return y.fn.call(y.context,h,p),!0;case 4:return y.fn.call(y.context,h,p,f),!0;case 5:return y.fn.call(y.context,h,p,f,g),!0;case 6:return y.fn.call(y.context,h,p,f,g,m),!0}for(w=1,A=new Array(_-1);w<_;w++)A[w-1]=arguments[w];y.fn.apply(y.context,A)}else{var v=y.length,S;for(w=0;w<v;w++)switch(y[w].once&&this.removeListener(u,y[w].fn,void 0,!0),_){case 1:y[w].fn.call(y[w].context);break;case 2:y[w].fn.call(y[w].context,h);break;case 3:y[w].fn.call(y[w].context,h,p);break;case 4:y[w].fn.call(y[w].context,h,p,f);break;default:if(!A)for(S=1,A=new Array(_-1);S<_;S++)A[S-1]=arguments[S];y[w].fn.apply(y[w].context,A)}}return!0},o.prototype.on=function(u,h,p){return i(this,u,h,p,!1)},o.prototype.once=function(u,h,p){return i(this,u,h,p,!0)},o.prototype.removeListener=function(u,h,p,f){var g=t?t+u:u;if(!this._events[g])return this;if(!h)return a(this,g),this;var m=this._events[g];if(m.fn)m.fn===h&&(!f||m.once)&&(!p||m.context===p)&&a(this,g);else{for(var E=0,y=[],_=m.length;E<_;E++)(m[E].fn!==h||f&&!m[E].once||p&&m[E].context!==p)&&y.push(m[E]);y.length?this._events[g]=y.length===1?y[0]:y:a(this,g)}return this},o.prototype.removeAllListeners=function(u){var h;return u?(h=t?t+u:u,this._events[h]&&a(this,h)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,n.exports=o})(pl);var mg=pl.exports;const bg=Fi(mg),Ai=new WeakMap,wi=["error","warn","log","info"];let Si="warn";function ml(n){if(Si&&wi.indexOf(n)<=wi.indexOf(Si)){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];console[n](...t)}}function bt(n){return wi.reduce(((e,t)=>(e[t]=ml.bind(console,t,n),e)),{})}bt.level=n=>{Si=n};ml.level=bt.level;const Ys=bt("quill:events"),Eg=["selectionchange","mousedown","mouseup","click"];Eg.forEach((n=>{document.addEventListener(n,(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach((s=>{const i=Ai.get(s);i&&i.emitter&&i.emitter.handleDOM(...t)}))}))}));class M extends bg{static 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"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",Ys.error)}emit(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Ys.log.call(Ys,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];(this.domListeners[e.type]||[]).forEach((i=>{let{node:a,handler:o}=i;(e.target===a||a.contains(e.target))&&o(e,...r)}))}listenDOM(e,t,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:r})}}const Qs=bt("quill:selection");class Zt{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}}class yg{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Zt(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,M.sources.USER),1)})),this.emitter.on(M.events.SCROLL_BEFORE_UPDATE,(()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(M.events.SCROLL_UPDATE,((s,i)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const a=i.some((o=>o.type==="characterData"||o.type==="childList"||o.type==="attributes"&&o.target===this.root));this.update(a?M.sources.SILENT:s)}catch{}}))})),this.emitter.on(M.events.SCROLL_OPTIMIZE,((r,s)=>{if(s.range){const{startNode:i,startOffset:a,endNode:o,endOffset:c}=s.range;this.setNativeRange(i,a,o,c),this.update(M.sources.SILENT)}})),this.update(M.sources.SILENT)}handleComposition(){this.emitter.on(M.events.COMPOSITION_BEFORE_START,(()=>{this.composing=!0})),this.emitter.on(M.events.COMPOSITION_END,(()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout((()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}),1)}}))}handleDragging(){this.emitter.listenDOM("mousedown",document.body,(()=>{this.mouseDown=!0})),this.emitter.listenDOM("mouseup",document.body,(()=>{this.mouseDown=!1,this.update(M.sources.USER)}))}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(e,D.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof Ne){const i=s.split(r.start.offset);s.parent.insertBefore(this.cursor,i)}else s.insertBefore(this.cursor,r.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.scroll.length();e=Math.min(e,r-1),t=Math.min(e+t,r-1)-e;let s,[i,a]=this.scroll.leaf(e);if(i==null)return null;if(t>0&&a===i.length()){const[h]=this.scroll.leaf(e+1);if(h){const[p]=this.scroll.line(e),[f]=this.scroll.line(e+1);p===f&&(i=h,a=0)}}[s,a]=i.position(a,!0);const o=document.createRange();if(t>0)return o.setStart(s,a),[i,a]=this.scroll.leaf(e+t),i==null?null:([s,a]=i.position(a,!0),o.setEnd(s,a),o.getBoundingClientRect());let c="left",u;if(s instanceof Text){if(!s.data.length)return null;a<s.data.length?(o.setStart(s,a),o.setEnd(s,a+1)):(o.setStart(s,a-1),o.setEnd(s,a),c="right"),u=o.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;u=i.domNode.getBoundingClientRect(),a>0&&(c="right")}return{bottom:u.top+u.height,height:u.height,left:u[c],right:u[c],top:u.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(t==null)return null;const r=this.normalizeNative(t);return Qs.info("getNativeRange",r),r}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();return t==null?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&Xs(this.root,document.activeElement)}normalizedToRange(e){const t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);const r=t.map((a=>{const[o,c]=a,u=this.scroll.find(o,!0),h=u.offset(this.scroll);return c===0?h:u instanceof Ne?h+u.index(o,c):h+u.length()})),s=Math.min(Math.max(...r),this.scroll.length()-1),i=Math.min(s,...r);return new Zt(i,s-i)}normalizeNative(e){if(!Xs(this.root,e.startContainer)||!e.collapsed&&!Xs(this.root,e.endContainer))return null;const t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach((r=>{let{node:s,offset:i}=r;for(;!(s instanceof Text)&&s.childNodes.length>0;)if(s.childNodes.length>i)s=s.childNodes[i],i=0;else if(s.childNodes.length===i)s=s.lastChild,s instanceof Text?i=s.data.length:s.childNodes.length>0?i=s.childNodes.length:i=s.childNodes.length+1;else break;r.node=s,r.offset=i})),t}rangeToNative(e){const t=this.scroll.length(),r=(s,i)=>{s=Math.min(t-1,s);const[a,o]=this.scroll.leaf(s);return a?a.position(o,i):[null,-1]};return[...r(e.index,!1),...r(e.index+e.length,!0)]}setNativeRange(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Qs.info("setNativeRange",e,t,r,s),e!=null&&(this.root.parentNode==null||e.parentNode==null||r.parentNode==null))return;const a=document.getSelection();if(a!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:o}=this.getNativeRange()||{};if(o==null||i||e!==o.startContainer||t!==o.startOffset||r!==o.endContainer||s!==o.endOffset){e instanceof Element&&e.tagName==="BR"&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),r instanceof Element&&r.tagName==="BR"&&(s=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const c=document.createRange();c.setStart(e,t),c.setEnd(r,s),a.removeAllRanges(),a.addRange(c)}}else a.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:M.sources.API;if(typeof t=="string"&&(r=t,t=!1),Qs.info("setRange",e),e!=null){const s=this.rangeToNative(e);this.setNativeRange(...s,t)}else this.setNativeRange(null);this.update(r)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:M.sources.USER;const t=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!$i(t,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const a=this.cursor.restore();a&&this.setNativeRange(a.startNode,a.startOffset,a.endNode,a.endOffset)}const i=[M.events.SELECTION_CHANGE,wn(this.lastRange),wn(t),e];this.emitter.emit(M.events.EDITOR_CHANGE,...i),e!==M.sources.SILENT&&this.emitter.emit(...i)}}}function Xs(n,e){try{e.parentNode}catch{return!1}return n.contains(e)}const _g=/^[ -~]*$/;class vg{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const r=ja(e),s=new k;return Tg(r.ops.slice()).reduce(((a,o)=>{const c=$e.Op.length(o);let u=o.attributes||{},h=!1,p=!1;if(o.insert!=null){if(s.retain(c),typeof o.insert=="string"){const m=o.insert;p=!m.endsWith(`\n`)&&(t<=a||!!this.scroll.descendant(qe,a)[0]),this.scroll.insertAt(a,m);const[E,y]=this.scroll.line(a);let _=At({},De(E));if(E instanceof be){const[A]=E.descendant(Ne,y);A&&(_=At(_,De(A)))}u=$e.AttributeMap.diff(_,u)||{}}else if(typeof o.insert=="object"){const m=Object.keys(o.insert)[0];if(m==null)return a;const E=this.scroll.query(m,D.INLINE)!=null;if(E)(t<=a||this.scroll.descendant(qe,a)[0])&&(p=!0);else if(a>0){const[y,_]=this.scroll.descendant(Ne,a-1);y instanceof Ze?y.value()[_]!==`\n`&&(h=!0):y instanceof ke&&y.statics.scope===D.INLINE_BLOT&&(h=!0)}if(this.scroll.insertAt(a,m,o.insert[m]),E){const[y]=this.scroll.descendant(Ne,a);if(y){const _=At({},De(y));u=$e.AttributeMap.diff(_,u)||{}}}}t+=c}else if(s.push(o),o.retain!==null&&typeof o.retain=="object"){const m=Object.keys(o.retain)[0];if(m==null)return a;this.scroll.updateEmbedAt(a,m,o.retain[m])}Object.keys(u).forEach((m=>{this.scroll.formatAt(a,c,m,u[m])}));const f=h?1:0,g=p?1:0;return t+=f+g,s.retain(f),s.delete(g),a+c+f+g}),0),s.reduce(((a,o)=>typeof o.delete=="number"?(this.scroll.deleteAt(a,o.delete),a):a+$e.Op.length(o)),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update((new k).retain(e).delete(t))}formatLine(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(r).forEach((i=>{this.scroll.lines(e,Math.max(t,1)).forEach((a=>{a.format(i,r[i])}))})),this.scroll.optimize();const s=(new k).retain(e).retain(t,wn(r));return this.update(s)}formatText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(r).forEach((i=>{this.scroll.formatAt(e,t,i,r[i])}));const s=(new k).retain(e).retain(t,wn(r));return this.update(s)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce(((e,t)=>e.concat(t.delta())),new k)}getFormat(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=[],s=[];t===0?this.scroll.path(e).forEach((o=>{const[c]=o;c instanceof be?r.push(c):c instanceof Ne&&s.push(c)})):(r=this.scroll.lines(e,t),s=this.scroll.descendants(Ne,e,t));const[i,a]=[r,s].map((o=>{const c=o.shift();if(c==null)return{};let u=De(c);for(;Object.keys(u).length>0;){const h=o.shift();if(h==null)return u;u=Ng(De(h),u)}return u}));return{...i,...a}}getHTML(e,t){const[r,s]=this.scroll.line(e);if(r){const i=r.length();return r.length()>=s+t&&!(s===0&&t===i)?nr(r,s,t,!0):nr(this.scroll,e,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter((r=>typeof r.insert=="string")).map((r=>r.insert)).join("")}insertContents(e,t){const r=ja(t),s=(new k).retain(e).concat(r);return this.scroll.insertContents(e,r),this.update(s)}insertEmbed(e,t,r){return this.scroll.insertAt(e,t,r),this.update((new k).retain(e).insert({[t]:r}))}insertText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,`\n`).replace(/\r/g,`\n`),this.scroll.insertAt(e,t),Object.keys(r).forEach((s=>{this.scroll.formatAt(e,t.length,s,r[s])})),this.update((new k).retain(e).insert(t,wn(r)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if(e?.statics.blotName!==be.blotName)return!1;const t=e;return t.children.length>1?!1:t.children.head instanceof Ve}removeFormat(e,t){const r=this.getText(e,t),[s,i]=this.scroll.line(e+t);let a=0,o=new k;s!=null&&(a=s.length()-i,o=s.delta().slice(i,i+a-1).insert(`\n`));const u=this.getContents(e,t+a).diff((new k).insert(r).concat(o)),h=(new k).retain(e).concat(u);return this.applyDelta(h)}update(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const s=this.delta;if(t.length===1&&t[0].type==="characterData"&&t[0].target.data.match(_g)&&this.scroll.find(t[0].target)){const i=this.scroll.find(t[0].target),a=De(i),o=i.offset(this.scroll),c=t[0].oldValue.replace(Ke.CONTENTS,""),u=(new k).insert(c),h=(new k).insert(i.value()),p=r&&{oldRange:Za(r.oldRange,-o),newRange:Za(r.newRange,-o)};e=(new k).retain(o).concat(u.diff(h,p)).reduce(((g,m)=>m.insert?g.insert(m.insert,a):g.push(m)),new k),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!$i(s.compose(e),this.delta))&&(e=s.diff(this.delta,r));return e}}function vn(n,e,t){if(n.length===0){const[g]=Js(t.pop());return e<=0?`</li></${g}>`:`</li></${g}>${vn([],e-1,t)}`}const[{child:r,offset:s,length:i,indent:a,type:o},...c]=n,[u,h]=Js(o);if(a>e)return t.push(o),a===e+1?`<${u}><li${h}>${nr(r,s,i)}${vn(c,a,t)}`:`<${u}><li>${vn(n,e+1,t)}`;const p=t[t.length-1];if(a===e&&o===p)return`</li><li${h}>${nr(r,s,i)}${vn(c,a,t)}`;const[f]=Js(t.pop());return`</li></${f}>${vn(n,e-1,t)}`}function nr(n,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in n&&typeof n.html=="function")return n.html(e,t);if(n instanceof Ze)return rs(n.value().slice(e,e+t));if(n instanceof je){if(n.statics.blotName==="list-container"){const u=[];return n.children.forEachAt(e,t,((h,p,f)=>{const g="formats"in h&&typeof h.formats=="function"?h.formats():{};u.push({child:h,offset:p,length:f,indent:g.indent||0,type:g.list})})),vn(u,-1,[])}const s=[];if(n.children.forEachAt(e,t,((u,h,p)=>{s.push(nr(u,h,p))})),r||n.statics.blotName==="list")return s.join("");const{outerHTML:i,innerHTML:a}=n.domNode,[o,c]=i.split(`>${a}<`);return o==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${c}`:`${o}>${s.join("")}<${c}`}return n.domNode instanceof Element?n.domNode.outerHTML:""}function Ng(n,e){return Object.keys(e).reduce(((t,r)=>{if(n[r]==null)return t;const s=e[r];return s===n[r]?t[r]=s:Array.isArray(s)?s.indexOf(n[r])<0?t[r]=s.concat([n[r]]):t[r]=s:t[r]=[s,n[r]],t}),{})}function Js(n){const e=n==="ordered"?"ol":"ul";switch(n){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function ja(n){return n.reduce(((e,t)=>{if(typeof t.insert=="string"){const r=t.insert.replace(/\r\n/g,`\n`).replace(/\r/g,`\n`);return e.insert(r,t.attributes)}return e.push(t)}),new k)}function Za(n,e){let{index:t,length:r}=n;return new Zt(t+e,r)}function Tg(n){const e=[];return n.forEach((t=>{typeof t.insert=="string"?t.insert.split(`\n`).forEach(((s,i)=>{i&&e.push({insert:`\n`,attributes:t.attributes}),s&&e.push({insert:s,attributes:t.attributes})})):e.push(t)})),e}class it{static DEFAULTS={};constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}}const Cr="\ufeff";class ji extends ke{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach((r=>{this.contentNode.appendChild(r)})),this.leftGuard=document.createTextNode(Cr),this.rightGuard=document.createTextNode(Cr),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t=null,r;const s=e.data.split(Cr).join("");if(e===this.leftGuard)if(this.prev instanceof Ze){const i=this.prev.length();this.prev.insertAt(i,s),t={startNode:this.prev.domNode,startOffset:i+s.length}}else r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this),t={startNode:r,startOffset:s.length};else e===this.rightGuard&&(this.next instanceof Ze?(this.next.insertAt(0,s),t={startNode:this.next.domNode,startOffset:s.length}):(r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this.next),t={startNode:r,startOffset:s.length}));return e.data=Cr,t}update(e,t){e.forEach((r=>{if(r.type==="characterData"&&(r.target===this.leftGuard||r.target===this.rightGuard)){const s=this.restore(r.target);s&&(t.range=s)}}))}}class Ag{isComposing=!1;constructor(e,t){this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",(e=>{this.isComposing||this.handleCompositionStart(e)})),this.scroll.domNode.addEventListener("compositionend",(e=>{this.isComposing&&queueMicrotask((()=>{this.handleCompositionEnd(e)}))}))}handleCompositionStart(e){const t=e.target instanceof Node?this.scroll.find(e.target,!0):null;t&&!(t instanceof ji)&&(this.emitter.emit(M.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(M.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(M.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(M.events.COMPOSITION_END,e),this.isComposing=!1}}class Rn{static DEFAULTS={modules:{}};static themes={default:Rn};modules={};constructor(e,t){this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach((e=>{this.modules[e]==null&&this.addModule(e)}))}addModule(e){const t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}}const wg=n=>n.parentElement||n.getRootNode().host||null,Sg=n=>{const e=n.getBoundingClientRect(),t="offsetWidth"in n&&Math.abs(e.width)/n.offsetWidth||1,r="offsetHeight"in n&&Math.abs(e.height)/n.offsetHeight||1;return{top:e.top,right:e.left+n.clientWidth*t,bottom:e.top+n.clientHeight*r,left:e.left}},Lr=n=>{const e=parseInt(n,10);return Number.isNaN(e)?0:e},Wa=(n,e,t,r,s,i)=>n<t&&e>r?0:n<t?-(t-n+s):e>r?e-n>r-t?n+s-t:e-r+i:0,Og=(n,e)=>{const t=n.ownerDocument;let r=e,s=n;for(;s;){const i=s===t.body,a=i?{top:0,right:window.visualViewport?.width??t.documentElement.clientWidth,bottom:window.visualViewport?.height??t.documentElement.clientHeight,left:0}:Sg(s),o=getComputedStyle(s),c=Wa(r.left,r.right,a.left,a.right,Lr(o.scrollPaddingLeft),Lr(o.scrollPaddingRight)),u=Wa(r.top,r.bottom,a.top,a.bottom,Lr(o.scrollPaddingTop),Lr(o.scrollPaddingBottom));if(c||u)if(i)t.defaultView?.scrollBy(c,u);else{const{scrollLeft:h,scrollTop:p}=s;u&&(s.scrollTop+=u),c&&(s.scrollLeft+=c);const f=s.scrollLeft-h,g=s.scrollTop-p;r={left:r.left-f,top:r.top-g,right:r.right-f,bottom:r.bottom-g}}s=i||o.position==="fixed"?null:wg(s)}},xg=100,Cg=["block","break","cursor","inline","scroll","text"],Lg=(n,e,t)=>{const r=new Cn;return Cg.forEach((s=>{const i=e.query(s);i&&r.register(i)})),n.forEach((s=>{let i=e.query(s);i||t.error(`Cannot register "${s}" specified in "formats" config. Are you sure it was registered?`);let a=0;for(;i;)if(r.register(i),i="blotName"in i?i.requiredContainer??null:null,a+=1,a>xg){t.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}})),r},On=bt("quill"),Ir=new Cn;je.uiClass="ql-ui";class N{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:Ir,theme:"default"};static events=M.events;static sources=M.sources;static version="2.0.2";static imports={delta:k,parchment:ng,"core/module":it,"core/theme":Rn};static debug(e){e===!0&&(e="log"),bt.level(e)}static find(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Ai.get(e)||Ir.find(e,t)}static import(e){return this.imports[e]==null&&On.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const e=arguments.length<=0?void 0:arguments[0],t=!!(!(arguments.length<=1)&&arguments[1]),r="attrName"in e?e.attrName:e.blotName;typeof r=="string"?this.register(`formats/${r}`,e,t):Object.keys(e).forEach((s=>{this.register(s,e[s],t)}))}else{const e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],r=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!r&&On.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&Ir.register(t),typeof t.register=="function"&&t.register(Ir)}}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=Ig(e,t),this.container=this.options.container,this.container==null){On.error("Invalid Quill container",e);return}this.options.debug&&N.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Ai.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new M;const s=Ui.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 vg(this.scroll),this.selection=new yg(this.scroll,this.emitter),this.composition=new Ag(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(M.events.EDITOR_CHANGE,(a=>{a===M.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())})),this.emitter.on(M.events.SCROLL_UPDATE,((a,o)=>{const c=this.selection.lastRange,[u]=this.selection.getRange(),h=c&&u?{oldRange:c,newRange:u}:void 0;He.call(this,(()=>this.editor.update(null,o,h)),a)})),this.emitter.on(M.events.SCROLL_EMBED_UPDATE,((a,o)=>{const c=this.selection.lastRange,[u]=this.selection.getRange(),h=c&&u?{oldRange:c,newRange:u}:void 0;He.call(this,(()=>{const p=(new k).retain(a.offset(this)).retain({[a.statics.blotName]:o});return this.editor.update(p,[],h)}),N.sources.USER)})),r){const a=this.clipboard.convert({html:`${r}<p><br></p>`,text:`\n`});this.setContents(a)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e=="string"){const r=e;e=document.createElement("div"),e.classList.add(r)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,r){return[e,t,,r]=ft(e,t,r),He.call(this,(()=>this.editor.deleteText(e,t)),r,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:M.sources.API;return He.call(this,(()=>{const s=this.getSelection(!0);let i=new k;if(s==null)return i;if(this.scroll.query(e,D.BLOCK))i=this.editor.formatLine(s.index,s.length,{[e]:t});else{if(s.length===0)return this.selection.format(e,t),i;i=this.editor.formatText(s.index,s.length,{[e]:t})}return this.setSelection(s,M.sources.SILENT),i}),r)}formatLine(e,t,r,s,i){let a;return[e,t,a,i]=ft(e,t,r,s,i),He.call(this,(()=>this.editor.formatLine(e,t,a)),i,e,0)}formatText(e,t,r,s,i){let a;return[e,t,a,i]=ft(e,t,r,s,i),He.call(this,(()=>this.editor.formatText(e,t,a)),i,e,0)}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=null;if(typeof e=="number"?r=this.selection.getBounds(e,t):r=this.selection.getBounds(e.index,e.length),!r)return null;const s=this.container.getBoundingClientRect();return{bottom:r.bottom-s.top,height:r.height,left:r.left-s.left,right:r.right-s.left,top:r.top-s.top,width:r.width}}getContents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e;return[e,t]=ft(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e=="number"?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e!="number"?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}getModule(e){return this.theme.modules[e]}getSelection(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=ft(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=ft(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:N.sources.API;return He.call(this,(()=>this.editor.insertEmbed(e,t,r)),s,e)}insertText(e,t,r,s,i){let a;return[e,,a,i]=ft(e,0,r,s,i),He.call(this,(()=>this.editor.insertText(e,t,a)),i,e,t.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(e,t,r){return[e,t,,r]=ft(e,t,r),He.call(this,(()=>this.editor.removeFormat(e,t)),r,e)}scrollRectIntoView(e){Og(this.root,e)}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 e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:M.sources.API;return He.call(this,(()=>{e=new k(e);const r=this.getLength(),s=this.editor.deleteText(0,r),i=this.editor.insertContents(0,e),a=this.editor.deleteText(this.getLength()-1,1);return s.compose(i).compose(a)}),t)}setSelection(e,t,r){e==null?this.selection.setRange(null,t||N.sources.API):([e,t,,r]=ft(e,t,r),this.selection.setRange(new Zt(Math.max(0,e),t),r),r!==M.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:M.sources.API;const r=(new k).insert(e);return this.setContents(r,t)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:M.sources.USER;const t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:M.sources.API;return He.call(this,(()=>(e=new k(e),this.editor.applyDelta(e))),t,!0)}}function Va(n){return typeof n=="string"?document.querySelector(n):n}function ei(n){return Object.entries(n??{}).reduce(((e,t)=>{let[r,s]=t;return{...e,[r]:s===!0?{}:s}}),{})}function Ya(n){return Object.fromEntries(Object.entries(n).filter((e=>e[1]!==void 0)))}function Ig(n,e){const t=Va(n);if(!t)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===N.DEFAULTS.theme?Rn:N.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:i,...a}=N.DEFAULTS,{modules:o,...c}=s.DEFAULTS;let u=ei(e.modules);u!=null&&u.toolbar&&u.toolbar.constructor!==Object&&(u={...u,toolbar:{container:u.toolbar}});const h=At({},ei(i),ei(o),u),p={...a,...Ya(c),...Ya(e)};let f=e.registry;return f?e.formats&&On.warn('Ignoring "formats" option because "registry" is specified'):f=e.formats?Lg(e.formats,p.registry,On):p.registry,{...p,registry:f,container:t,theme:s,modules:Object.entries(h).reduce(((g,m)=>{let[E,y]=m;if(!y)return g;const _=N.import(`modules/${E}`);return _==null?(On.error(`Cannot load ${E} module. Are you sure you registered it?`),g):{...g,[E]:At({},_.DEFAULTS||{},y)}}),{}),bounds:Va(p.bounds)}}function He(n,e,t,r){if(!this.isEnabled()&&e===M.sources.USER&&!this.allowReadOnlyEdits)return new k;let s=t==null?null:this.getSelection();const i=this.editor.delta,a=n();if(s!=null&&(t===!0&&(t=s.index),r==null?s=Qa(s,a,e):r!==0&&(s=Qa(s,t,r,e)),this.setSelection(s,M.sources.SILENT)),a.length()>0){const o=[M.events.TEXT_CHANGE,a,i,e];this.emitter.emit(M.events.EDITOR_CHANGE,...o),e!==M.sources.SILENT&&this.emitter.emit(...o)}return a}function ft(n,e,t,r,s){let i={};return typeof n.index=="number"&&typeof n.length=="number"?typeof e!="number"?(s=r,r=t,t=e,e=n.length,n=n.index):(e=n.length,n=n.index):typeof e!="number"&&(s=r,r=t,t=e,e=0),typeof t=="object"?(i=t,s=r):typeof t=="string"&&(r!=null?i[t]=r:s=t),s=s||M.sources.API,[n,e,i,s]}function Qa(n,e,t,r){const s=typeof t=="number"?t:0;if(n==null)return null;let i,a;return e&&typeof e.transformPosition=="function"?[i,a]=[n.index,n.index+n.length].map((o=>e.transformPosition(o,r!==M.sources.USER))):[i,a]=[n.index,n.index+n.length].map((o=>o<e||o===e&&r===M.sources.USER?o:s>=0?o+s:Math.max(e,o+s))),new Zt(i,a-i)}class Xt extends Jr{}function Xa(n){return n instanceof be||n instanceof qe}function Ja(n){return typeof n.updateContent=="function"}class Rg extends Ui{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=be;static allowedChildren=[be,qe,Xt];constructor(e,t,r){let{emitter:s}=r;super(e,t),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 e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(M.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(M.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(M.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[r,s]=this.line(e),[i]=this.line(e+t);if(super.deleteAt(e,t),i!=null&&r!==i&&s>0){if(r instanceof qe||i instanceof qe){this.optimize();return}const a=i.children.head instanceof Ve?null:i.children.head;r.moveChildren(i,a),r.remove()}this.optimize()}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,t,r,s){super.formatAt(e,t,r,s),this.optimize()}insertAt(e,t,r){if(e>=this.length())if(r==null||this.scroll.query(t,D.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),r==null&&t.endsWith(`\n`)?s.insertAt(0,t.slice(0,-1),r):s.insertAt(0,t,r)}else{const s=this.scroll.create(t,r);this.appendChild(s)}else super.insertAt(e,t,r);this.optimize()}insertBefore(e,t){if(e.statics.scope===D.INLINE_BLOT){const r=this.scroll.create(this.statics.defaultChild.blotName);r.appendChild(e),super.insertBefore(r,t)}else super.insertBefore(e,t)}insertContents(e,t){const r=this.deltaToRenderBlocks(t.concat((new k).insert(`\n`))),s=r.pop();if(s==null)return;this.batchStart();const i=r.shift();if(i){const c=i.type==="block"&&(i.delta.length()===0||!this.descendant(qe,e)[0]&&e<this.length()),u=i.type==="block"?i.delta:(new k).insert({[i.key]:i.value});ti(this,e,u);const h=i.type==="block"?1:0,p=e+u.length()+h;c&&this.insertAt(p-1,`\n`);const f=De(this.line(e)[0]),g=$e.AttributeMap.diff(f,i.attributes)||{};Object.keys(g).forEach((m=>{this.formatAt(p-1,1,m,g[m])})),e=p}let[a,o]=this.children.find(e);if(r.length&&(a&&(a=a.split(o),o=0),r.forEach((c=>{if(c.type==="block"){const u=this.createBlock(c.attributes,a||void 0);ti(u,0,c.delta)}else{const u=this.create(c.key,c.value);this.insertBefore(u,a||void 0),Object.keys(c.attributes).forEach((h=>{u.format(h,c.attributes[h])}))}}))),s.type==="block"&&s.delta.length()){const c=a?a.offset(a.scroll)+o:this.length();ti(this,c,s.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(e){const t=this.path(e).pop();if(!t)return[null,-1];const[r,s]=t;return r instanceof Ne?[r,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(Xa,e)}lines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const r=(s,i,a)=>{let o=[],c=a;return s.children.forEachAt(i,a,((u,h,p)=>{Xa(u)?o.push(u):u instanceof Jr&&(o=o.concat(r(u,h,c))),c-=p})),o};return r(this,e,t)}optimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(M.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch){Array.isArray(e)&&(this.batch=this.batch.concat(e));return}let t=M.sources.USER;typeof e=="string"&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter((r=>{let{target:s}=r;const i=this.find(s,!0);return i&&!Ja(i)})),e.length>0&&this.emitter.emit(M.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(M.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,r){const[s]=this.descendant((i=>i instanceof qe),e);s&&s.statics.blotName===t&&Ja(s)&&s.updateContent(r)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let r=new k;return e.forEach((s=>{const i=s?.insert;if(i)if(typeof i=="string"){const a=i.split(`\n`);a.slice(0,-1).forEach((c=>{r.insert(c,s.attributes),t.push({type:"block",delta:r,attributes:s.attributes??{}}),r=new k}));const o=a[a.length-1];o&&r.insert(o,s.attributes)}else{const a=Object.keys(i)[0];if(!a)return;this.query(a,D.INLINE)?r.push(s):(r.length()&&t.push({type:"block",delta:r,attributes:{}}),r=new k,t.push({type:"blockEmbed",key:a,value:i[a],attributes:s.attributes??{}}))}})),r.length()&&t.push({type:"block",delta:r,attributes:{}}),t}createBlock(e,t){let r;const s={};Object.entries(e).forEach((o=>{let[c,u]=o;this.query(c,D.BLOCK&D.BLOT)!=null?r=c:s[c]=u}));const i=this.create(r||this.statics.defaultChild.blotName,r?e[r]:void 0);this.insertBefore(i,t||void 0);const a=i.length();return Object.entries(s).forEach((o=>{let[c,u]=o;i.formatAt(0,a,c,u)})),i}}function ti(n,e,t){t.reduce(((r,s)=>{const i=$e.Op.length(s);let a=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const o=s.insert;n.insertAt(r,o);const[c]=n.descendant(Ne,r),u=De(c);a=$e.AttributeMap.diff(u,a)||{}}else if(typeof s.insert=="object"){const o=Object.keys(s.insert)[0];if(o==null)return r;if(n.insertAt(r,o,s.insert[o]),n.scroll.query(o,D.INLINE)!=null){const[u]=n.descendant(Ne,r),h=De(u);a=$e.AttributeMap.diff(h,a)||{}}}}return Object.keys(a).forEach((o=>{n.formatAt(r,i,o,a[o])})),r+i}),e)}const Zi={scope:D.BLOCK,whitelist:["right","center","justify"]},kg=new rt("align","align",Zi),bl=new We("align","ql-align",Zi),El=new xt("align","text-align",Zi);class yl extends xt{value(e){let t=super.value(e);return t.startsWith("rgb(")?(t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${t.split(",").map((s=>`00${parseInt(s,10).toString(16)}`.slice(-2))).join("")}`):t}}const Mg=new We("color","ql-color",{scope:D.INLINE}),Wi=new yl("color","color",{scope:D.INLINE}),Dg=new We("background","ql-bg",{scope:D.INLINE}),Vi=new yl("background","background-color",{scope:D.INLINE});class Jt extends Xt{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map((r=>r.length()<=1?"":r.domNode.innerText)).join(`\n`).slice(e,e+t)}html(e,t){return`<pre>\n${rs(this.code(e,t))}\n</pre>`}}class Oe extends be{static TAB=" ";static register(){N.register(Jt)}}class Yi extends Ct{}Yi.blotName="code";Yi.tagName="CODE";Oe.blotName="code-block";Oe.className="ql-code-block";Oe.tagName="DIV";Jt.blotName="code-block-container";Jt.className="ql-code-block-container";Jt.tagName="DIV";Jt.allowedChildren=[Oe];Oe.allowedChildren=[Ze,Ve,Ke];Oe.requiredContainer=Jt;const Qi={scope:D.BLOCK,whitelist:["rtl"]},_l=new rt("direction","dir",Qi),vl=new We("direction","ql-direction",Qi),Nl=new xt("direction","direction",Qi),Tl={scope:D.INLINE,whitelist:["serif","monospace"]},Al=new We("font","ql-font",Tl);class Bg extends xt{value(e){return super.value(e).replace(/["']/g,"")}}const wl=new Bg("font","font-family",Tl),Sl=new We("size","ql-size",{scope:D.INLINE,whitelist:["small","large","huge"]}),Ol=new xt("size","font-size",{scope:D.INLINE,whitelist:["10px","18px","32px"]}),qg=bt("quill:keyboard"),$g=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class ss extends it{static match(e,t){return["altKey","ctrlKey","metaKey","shiftKey"].some((r=>!!t[r]!==e[r]&&t[r]!==null))?!1:t.key===e.key||t.key===e.which}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach((r=>{this.options.bindings[r]&&this.addBinding(this.options.bindings[r])})),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},(()=>{})),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=Ug(e);if(s==null){qg.warn("Attempted to add invalid keyboard binding",s);return}typeof t=="function"&&(t={handler:t}),typeof r=="function"&&(r={handler:r}),(Array.isArray(s.key)?s.key:[s.key]).forEach((a=>{const o={...s,key:a,...t,...r};this.bindings[o.key]=this.bindings[o.key]||[],this.bindings[o.key].push(o)}))}listen(){this.quill.root.addEventListener("keydown",(e=>{if(e.defaultPrevented||e.isComposing||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const s=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter((_=>ss.match(e,_)));if(s.length===0)return;const i=N.find(e.target,!0);if(i&&i.scroll!==this.quill.scroll)return;const a=this.quill.getSelection();if(a==null||!this.quill.hasFocus())return;const[o,c]=this.quill.getLine(a.index),[u,h]=this.quill.getLeaf(a.index),[p,f]=a.length===0?[u,h]:this.quill.getLeaf(a.index+a.length),g=u instanceof Fr?u.value().slice(0,h):"",m=p instanceof Fr?p.value().slice(f):"",E={collapsed:a.length===0,empty:a.length===0&&o.length()<=1,format:this.quill.getFormat(a),line:o,offset:c,prefix:g,suffix:m,event:e};s.some((_=>{if(_.collapsed!=null&&_.collapsed!==E.collapsed||_.empty!=null&&_.empty!==E.empty||_.offset!=null&&_.offset!==E.offset)return!1;if(Array.isArray(_.format)){if(_.format.every((A=>E.format[A]==null)))return!1}else if(typeof _.format=="object"&&!Object.keys(_.format).every((A=>_.format[A]===!0?E.format[A]!=null:_.format[A]===!1?E.format[A]==null:$i(_.format[A],E.format[A]))))return!1;return _.prefix!=null&&!_.prefix.test(E.prefix)||_.suffix!=null&&!_.suffix.test(E.suffix)?!1:_.handler.call(this,a,E,_)!==!0}))&&e.preventDefault()}))}handleBackspace(e,t){const r=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let s={};const[i]=this.quill.getLine(e.index);let a=(new k).retain(e.index-r).delete(r);if(t.offset===0){const[o]=this.quill.getLine(e.index-1);if(o&&!(o.statics.blotName==="block"&&o.length()<=1)){const u=i.formats(),h=this.quill.getFormat(e.index-1,1);if(s=$e.AttributeMap.diff(u,h)||{},Object.keys(s).length>0){const p=(new k).retain(e.index+i.length()-2).retain(1,s);a=a.compose(p)}}}this.quill.updateContents(a,N.sources.USER),this.quill.focus()}handleDelete(e,t){const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-r)return;let s={};const[i]=this.quill.getLine(e.index);let a=(new k).retain(e.index).delete(r);if(t.offset>=i.length()-1){const[o]=this.quill.getLine(e.index+1);if(o){const c=i.formats(),u=this.quill.getFormat(e.index,1);s=$e.AttributeMap.diff(c,u)||{},Object.keys(s).length>0&&(a=a.retain(o.length()-1).retain(1,s))}}this.quill.updateContents(a,N.sources.USER),this.quill.focus()}handleDeleteRange(e){Xi({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const r=Object.keys(t.format).reduce(((i,a)=>(this.quill.scroll.query(a,D.BLOCK)&&!Array.isArray(t.format[a])&&(i[a]=t.format[a]),i)),{}),s=(new k).retain(e.index).delete(e.length).insert(`\n`,r);this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(e.index+1,N.sources.SILENT),this.quill.focus()}}const Pg={bindings:{bold:ni("bold"),italic:ni("italic"),underline:ni("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",N.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","-1",N.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(n,e){e.format.indent!=null?this.quill.format("indent","-1",N.sources.USER):e.format.list!=null&&this.quill.format("list",!1,N.sources.USER)}},"indent code-block":eo(!0),"outdent code-block":eo(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(n){this.quill.deleteText(n.index-1,1,N.sources.USER)}},tab:{key:"Tab",handler(n,e){if(e.format.table)return!0;this.quill.history.cutoff();const t=(new k).retain(n.index).delete(n.length).insert("\t");return this.quill.updateContents(t,N.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index+1,N.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,N.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(n,e){const t={list:!1};e.format.indent&&(t.indent=!1),this.quill.formatLine(n.index,n.length,t,N.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(n){const[e,t]=this.quill.getLine(n.index),r={...e.formats(),list:"checked"},s=(new k).retain(n.index).insert(`\n`,r).retain(e.length()-t-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(n.index+1,N.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(n,e){const[t,r]=this.quill.getLine(n.index),s=(new k).retain(n.index).insert(`\n`,e.format).retain(t.length()-r-1).retain(1,{header:null});this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(n.index+1,N.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(n){const e=this.quill.getModule("table");if(e){const[t,r,s,i]=e.getTable(n),a=Fg(t,r,s,i);if(a==null)return;let o=t.offset();if(a<0){const c=(new k).retain(o).insert(`\n`);this.quill.updateContents(c,N.sources.USER),this.quill.setSelection(n.index+1,n.length,N.sources.SILENT)}else if(a>0){o+=t.length();const c=(new k).retain(o).insert(`\n`);this.quill.updateContents(c,N.sources.USER),this.quill.setSelection(o,N.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(n,e){const{event:t,line:r}=e,s=r.offset(this.quill.scroll);t.shiftKey?this.quill.setSelection(s-1,N.sources.USER):this.quill.setSelection(s+r.length(),N.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(n,e){if(this.quill.scroll.query("list")==null)return!0;const{length:t}=e.prefix,[r,s]=this.quill.getLine(n.index);if(s>t)return!0;let i;switch(e.prefix.trim()){case"[]":case"[ ]":i="unchecked";break;case"[x]":i="checked";break;case"-":case"*":i="bullet";break;default:i="ordered"}this.quill.insertText(n.index," ",N.sources.USER),this.quill.history.cutoff();const a=(new k).retain(n.index-s).delete(t+1).retain(r.length()-2-s).retain(1,{list:i});return this.quill.updateContents(a,N.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index-t,N.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(n){const[e,t]=this.quill.getLine(n.index);let r=2,s=e;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,r-=1,r<=0){const i=(new k).retain(n.index+e.length()-t-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(i,N.sources.USER),this.quill.setSelection(n.index-1,N.sources.SILENT),!1}return!0}},"embed left":Rr("ArrowLeft",!1),"embed left shift":Rr("ArrowLeft",!0),"embed right":Rr("ArrowRight",!1),"embed right shift":Rr("ArrowRight",!0),"table down":to(!1),"table up":to(!0)}};ss.DEFAULTS=Pg;function eo(n){return{key:"Tab",shiftKey:!n,format:{"code-block":!0},handler(e,t){let{event:r}=t;const s=this.quill.scroll.query("code-block"),{TAB:i}=s;if(e.length===0&&!r.shiftKey){this.quill.insertText(e.index,i,N.sources.USER),this.quill.setSelection(e.index+i.length,N.sources.SILENT);return}const a=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:o,length:c}=e;a.forEach(((u,h)=>{n?(u.insertAt(0,i),h===0?o+=i.length:c+=i.length):u.domNode.textContent.startsWith(i)&&(u.deleteAt(0,i.length),h===0?o-=i.length:c-=i.length)})),this.quill.update(N.sources.USER),this.quill.setSelection(o,c,N.sources.SILENT)}}}function Rr(n,e){return{key:n,shiftKey:e,altKey:null,[n==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(r){let{index:s}=r;n==="ArrowRight"&&(s+=r.length+1);const[i]=this.quill.getLeaf(s);return i instanceof ke?(n==="ArrowLeft"?e?this.quill.setSelection(r.index-1,r.length+1,N.sources.USER):this.quill.setSelection(r.index-1,N.sources.USER):e?this.quill.setSelection(r.index,r.length+1,N.sources.USER):this.quill.setSelection(r.index+r.length+1,N.sources.USER),!1):!0}}}function ni(n){return{key:n[0],shortKey:!0,handler(e,t){this.quill.format(n,!t.format[n],N.sources.USER)}}}function to(n){return{key:n?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,t){const r=n?"prev":"next",s=t.line,i=s.parent[r];if(i!=null){if(i.statics.blotName==="table-row"){let a=i.children.head,o=s;for(;o.prev!=null;)o=o.prev,a=a.next;const c=a.offset(this.quill.scroll)+Math.min(t.offset,a.length()-1);this.quill.setSelection(c,0,N.sources.USER)}}else{const a=s.table()[r];a!=null&&(n?this.quill.setSelection(a.offset(this.quill.scroll)+a.length()-1,0,N.sources.USER):this.quill.setSelection(a.offset(this.quill.scroll),0,N.sources.USER))}return!1}}}function Ug(n){if(typeof n=="string"||typeof n=="number")n={key:n};else if(typeof n=="object")n=wn(n);else return null;return n.shortKey&&(n[$g]=n.shortKey,delete n.shortKey),n}function Xi(n){let{quill:e,range:t}=n;const r=e.getLines(t);let s={};if(r.length>1){const i=r[0].formats(),a=r[r.length-1].formats();s=$e.AttributeMap.diff(a,i)||{}}e.deleteText(t,N.sources.USER),Object.keys(s).length>0&&e.formatLine(t.index,1,s,N.sources.USER),e.setSelection(t.index,N.sources.SILENT)}function Fg(n,e,t,r){return e.prev==null&&e.next==null?t.prev==null&&t.next==null?r===0?-1:1:t.prev==null?-1:1:e.prev==null?-1:e.next==null?1:null}const Hg=/font-weight:\s*normal/,zg=["P","OL","UL"],no=n=>n&&zg.includes(n.tagName),Kg=n=>{Array.from(n.querySelectorAll("br")).filter((e=>no(e.previousElementSibling)&&no(e.nextElementSibling))).forEach((e=>{e.parentNode?.removeChild(e)}))},Gg=n=>{Array.from(n.querySelectorAll('b[style*="font-weight"]')).filter((e=>e.getAttribute("style")?.match(Hg))).forEach((e=>{const t=n.createDocumentFragment();t.append(...e.childNodes),e.parentNode?.replaceChild(t,e)}))};function jg(n){n.querySelector('[id^="docs-internal-guid-"]')&&(Gg(n),Kg(n))}const Zg=/\bmso-list:[^;]*ignore/i,Wg=/\bmso-list:[^;]*\bl(\d+)/i,Vg=/\bmso-list:[^;]*\blevel(\d+)/i,Yg=(n,e)=>{const t=n.getAttribute("style"),r=t?.match(Wg);if(!r)return null;const s=Number(r[1]),i=t?.match(Vg),a=i?Number(i[1]):1,o=new RegExp(`@list l${s}:level${a}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),c=e.match(o),u=c&&c[1]==="bullet"?"bullet":"ordered";return{id:s,indent:a,type:u,element:n}},Qg=n=>{const e=Array.from(n.querySelectorAll("[style*=mso-list]")),t=[],r=[];e.forEach((a=>{(a.getAttribute("style")||"").match(Zg)?t.push(a):r.push(a)})),t.forEach((a=>a.parentNode?.removeChild(a)));const s=n.documentElement.innerHTML,i=r.map((a=>Yg(a,s))).filter((a=>a));for(;i.length;){const a=[];let o=i.shift();for(;o;)a.push(o),o=i.length&&i[0]?.element===o.element.nextElementSibling&&i[0].id===o.id?i.shift():null;const c=document.createElement("ul");a.forEach((p=>{const f=document.createElement("li");f.setAttribute("data-list",p.type),p.indent>1&&f.setAttribute("class",`ql-indent-${p.indent-1}`),f.innerHTML=p.element.innerHTML,c.appendChild(f)}));const u=a[0]?.element,{parentNode:h}=u??{};u&&h?.replaceChild(c,u),a.slice(1).forEach((p=>{let{element:f}=p;h?.removeChild(f)}))}};function Xg(n){n.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&Qg(n)}const Jg=[Xg,jg],ep=n=>{n.documentElement&&Jg.forEach((e=>{e(n)}))},tp=bt("quill:clipboard"),np=[[Node.TEXT_NODE,pp],[Node.TEXT_NODE,so],["br",lp],[Node.ELEMENT_NODE,so],[Node.ELEMENT_NODE,op],[Node.ELEMENT_NODE,ap],[Node.ELEMENT_NODE,fp],["li",dp],["ol, ul",hp],["pre",cp],["tr",gp],["b",ri("bold")],["i",ri("italic")],["strike",ri("strike")],["style",up]],rp=[kg,_l].reduce(((n,e)=>(n[e.keyName]=e,n)),{}),ro=[El,Vi,Wi,Nl,wl,Ol].reduce(((n,e)=>(n[e.keyName]=e,n)),{});class sp extends it{static DEFAULTS={matchers:[]};constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",(r=>this.onCaptureCopy(r,!1))),this.quill.root.addEventListener("cut",(r=>this.onCaptureCopy(r,!0))),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],np.concat(this.options.matchers??[]).forEach((r=>{let[s,i]=r;this.addMatcher(s,i)}))}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:r}=e,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s[Oe.blotName])return(new k).insert(r||"",{[Oe.blotName]:s[Oe.blotName]});if(!t)return(new k).insert(r||"",s);const i=this.convertHTML(t);return ur(i,`\n`)&&(i.ops[i.ops.length-1].attributes==null||s.table)?i.compose((new k).retain(i.length()-1).delete(1)):i}normalizeHTML(e){ep(e)}convertHTML(e){const t=(new DOMParser).parseFromString(e,"text/html");this.normalizeHTML(t);const r=t.body,s=new WeakMap,[i,a]=this.prepareMatching(r,s);return Ji(this.quill.scroll,r,i,a,s)}dangerouslyPasteHTML(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:N.sources.API;if(typeof e=="string"){const s=this.convert({html:e,text:""});this.quill.setContents(s,t),this.quill.setSelection(0,N.sources.SILENT)}else{const s=this.convert({html:t,text:""});this.quill.updateContents((new k).retain(e).concat(s),r),this.quill.setSelection(e+s.length(),N.sources.SILENT)}}onCaptureCopy(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();const[r]=this.quill.selection.getRange();if(r==null)return;const{html:s,text:i}=this.onCopy(r,t);e.clipboardData?.setData("text/plain",i),e.clipboardData?.setData("text/html",s),t&&Xi({range:r,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter((t=>t[0]!=="#")).join(`\n`)}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(t==null)return;const r=e.clipboardData?.getData("text/html");let s=e.clipboardData?.getData("text/plain");if(!r&&!s){const a=e.clipboardData?.getData("text/uri-list");a&&(s=this.normalizeURIList(a))}const i=Array.from(e.clipboardData?.files||[]);if(!r&&i.length>0){this.quill.uploader.upload(t,i);return}if(r&&i.length>0){const a=(new DOMParser).parseFromString(r,"text/html");if(a.body.childElementCount===1&&a.body.firstElementChild?.tagName==="IMG"){this.quill.uploader.upload(t,i);return}}this.onPaste(t,{html:r,text:s})}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:r,html:s}=t;const i=this.quill.getFormat(e.index),a=this.convert({text:r,html:s},i);tp.log("onPaste",a,{text:r,html:s});const o=(new k).retain(e.index).delete(e.length).concat(a);this.quill.updateContents(o,N.sources.USER),this.quill.setSelection(o.length()-e.length,N.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const r=[],s=[];return this.matchers.forEach((i=>{const[a,o]=i;switch(a){case Node.TEXT_NODE:s.push(o);break;case Node.ELEMENT_NODE:r.push(o);break;default:Array.from(e.querySelectorAll(a)).forEach((c=>{t.has(c)?t.get(c)?.push(o):t.set(c,[o])}));break}})),[r,s]}}function en(n,e,t,r){return r.query(e)?n.reduce(((s,i)=>{if(!i.insert)return s;if(i.attributes&&i.attributes[e])return s.push(i);const a=t?{[e]:t}:{};return s.insert(i.insert,{...a,...i.attributes})}),new k):n}function ur(n,e){let t="";for(let r=n.ops.length-1;r>=0&&t.length<e.length;--r){const s=n.ops[r];if(typeof s.insert!="string")break;t=s.insert+t}return t.slice(-1*e.length)===e}function Nt(n,e){if(!(n instanceof Element))return!1;const t=e.query(n);return t&&t.prototype instanceof ke?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(n.tagName.toLowerCase())}function ip(n,e){return n.previousElementSibling&&n.nextElementSibling&&!Nt(n.previousElementSibling,e)&&!Nt(n.nextElementSibling,e)}const kr=new WeakMap;function xl(n){return n==null?!1:(kr.has(n)||(n.tagName==="PRE"?kr.set(n,!0):kr.set(n,xl(n.parentNode))),kr.get(n))}function Ji(n,e,t,r,s){return e.nodeType===e.TEXT_NODE?r.reduce(((i,a)=>a(e,i,n)),new k):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce(((i,a)=>{let o=Ji(n,a,t,r,s);return a.nodeType===e.ELEMENT_NODE&&(o=t.reduce(((c,u)=>u(a,c,n)),o),o=(s.get(a)||[]).reduce(((c,u)=>u(a,c,n)),o)),i.concat(o)}),new k):new k}function ri(n){return(e,t,r)=>en(t,n,!0,r)}function ap(n,e,t){const r=rt.keys(n),s=We.keys(n),i=xt.keys(n),a={};return r.concat(s).concat(i).forEach((o=>{let c=t.query(o,D.ATTRIBUTE);c!=null&&(a[c.attrName]=c.value(n),a[c.attrName])||(c=rp[o],c!=null&&(c.attrName===o||c.keyName===o)&&(a[c.attrName]=c.value(n)||void 0),c=ro[o],c!=null&&(c.attrName===o||c.keyName===o)&&(c=ro[o],a[c.attrName]=c.value(n)||void 0))})),Object.entries(a).reduce(((o,c)=>{let[u,h]=c;return en(o,u,h,t)}),e)}function op(n,e,t){const r=t.query(n);if(r==null)return e;if(r.prototype instanceof ke){const s={},i=r.value(n);if(i!=null)return s[r.blotName]=i,(new k).insert(s,r.formats(n,t))}else if(r.prototype instanceof er&&!ur(e,`\n`)&&e.insert(`\n`),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return en(e,r.blotName,r.formats(n,t),t);return e}function lp(n,e){return ur(e,`\n`)||e.insert(`\n`),e}function cp(n,e,t){const r=t.query("code-block"),s=r&&"formats"in r&&typeof r.formats=="function"?r.formats(n,t):!0;return en(e,"code-block",s,t)}function up(){return new k}function dp(n,e,t){const r=t.query(n);if(r==null||r.blotName!=="list"||!ur(e,`\n`))return e;let s=-1,i=n.parentNode;for(;i!=null;)["OL","UL"].includes(i.tagName)&&(s+=1),i=i.parentNode;return s<=0?e:e.reduce(((a,o)=>o.insert?o.attributes&&typeof o.attributes.indent=="number"?a.push(o):a.insert(o.insert,{indent:s,...o.attributes||{}}):a),new k)}function hp(n,e,t){const r=n;let s=r.tagName==="OL"?"ordered":"bullet";const i=r.getAttribute("data-checked");return i&&(s=i==="true"?"checked":"unchecked"),en(e,"list",s,t)}function so(n,e,t){if(!ur(e,`\n`)){if(Nt(n,t)&&(n.childNodes.length>0||n instanceof HTMLParagraphElement))return e.insert(`\n`);if(e.length()>0&&n.nextSibling){let r=n.nextSibling;for(;r!=null;){if(Nt(r,t))return e.insert(`\n`);const s=t.query(r);if(s&&s.prototype instanceof qe)return e.insert(`\n`);r=r.firstChild}}}return e}function fp(n,e,t){const r={},s=n.style||{};return s.fontStyle==="italic"&&(r.italic=!0),s.textDecoration==="underline"&&(r.underline=!0),s.textDecoration==="line-through"&&(r.strike=!0),(s.fontWeight?.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(r.bold=!0),e=Object.entries(r).reduce(((i,a)=>{let[o,c]=a;return en(i,o,c,t)}),e),parseFloat(s.textIndent||0)>0?(new k).insert("\t").concat(e):e}function gp(n,e,t){const r=n.parentElement?.tagName==="TABLE"?n.parentElement:n.parentElement?.parentElement;if(r!=null){const i=Array.from(r.querySelectorAll("tr")).indexOf(n)+1;return en(e,"table",i,t)}return e}function pp(n,e,t){let r=n.data;if(n.parentElement?.tagName==="O:P")return e.insert(r.trim());if(!xl(n)){if(r.trim().length===0&&r.includes(`\n`)&&!ip(n,t))return e;const s=(i,a)=>{const o=a.replace(/[^\u00a0]/g,"");return o.length<1&&i?" ":o};r=r.replace(/\r\n/g," ").replace(/\n/g," "),r=r.replace(/\s\s+/g,s.bind(s,!0)),(n.previousSibling==null&&n.parentElement!=null&&Nt(n.parentElement,t)||n.previousSibling instanceof Element&&Nt(n.previousSibling,t))&&(r=r.replace(/^\s+/,s.bind(s,!1))),(n.nextSibling==null&&n.parentElement!=null&&Nt(n.parentElement,t)||n.nextSibling instanceof Element&&Nt(n.nextSibling,t))&&(r=r.replace(/\s+$/,s.bind(s,!1)))}return e.insert(r)}class mp extends it{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(e,t){super(e,t),this.quill.on(N.events.EDITOR_CHANGE,((r,s,i,a)=>{r===N.events.SELECTION_CHANGE?s&&a!==N.sources.SILENT&&(this.currentRange=s):r===N.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||a===N.sources.USER?this.record(s,i):this.transform(s)),this.currentRange=Oi(this.currentRange,s))})),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",(r=>{r.inputType==="historyUndo"?(this.undo(),r.preventDefault()):r.inputType==="historyRedo"&&(this.redo(),r.preventDefault())}))}change(e,t){if(this.stack[e].length===0)return;const r=this.stack[e].pop();if(!r)return;const s=this.quill.getContents(),i=r.delta.invert(s);this.stack[t].push({delta:i,range:Oi(r.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(r.delta,N.sources.USER),this.ignoreChange=!1,this.restoreSelection(r)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(e.ops.length===0)return;this.stack.redo=[];let r=e.invert(t),s=this.currentRange;const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const a=this.stack.undo.pop();a&&(r=r.compose(a.delta),s=a.range)}else this.lastRecorded=i;r.length()!==0&&(this.stack.undo.push({delta:r,range:s}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){io(this.stack.undo,e),io(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,N.sources.USER);else{const t=Ep(this.quill.scroll,e.delta);this.quill.setSelection(t,N.sources.USER)}}}function io(n,e){let t=e;for(let r=n.length-1;r>=0;r-=1){const s=n[r];n[r]={delta:t.transform(s.delta,!0),range:s.range&&Oi(s.range,t)},t=s.delta.transform(t),n[r].delta.length()===0&&n.splice(r,1)}}function bp(n,e){const t=e.ops[e.ops.length-1];return t==null?!1:t.insert!=null?typeof t.insert=="string"&&t.insert.endsWith(`\n`):t.attributes!=null?Object.keys(t.attributes).some((r=>n.query(r,D.BLOCK)!=null)):!1}function Ep(n,e){const t=e.reduce(((s,i)=>s+(i.delete||0)),0);let r=e.length()-t;return bp(n,e)&&(r-=1),r}function Oi(n,e){if(!n)return n;const t=e.transformPosition(n.index),r=e.transformPosition(n.index+n.length);return{index:t,length:r-t}}class Cl extends it{constructor(e,t){super(e,t),e.root.addEventListener("drop",(r=>{r.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(r.clientX,r.clientY);s=document.createRange(),s.setStart(a.offsetNode,a.offset),s.setEnd(a.offsetNode,a.offset)}const i=s&&e.selection.normalizeNative(s);if(i){const a=e.selection.normalizedToRange(i);r.dataTransfer?.files&&this.upload(a,r.dataTransfer.files)}}))}upload(e,t){const r=[];Array.from(t).forEach((s=>{s&&this.options.mimetypes?.includes(s.type)&&r.push(s)})),r.length>0&&this.options.handler.call(this,e,r)}}Cl.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(n,e){if(!this.quill.scroll.query("image"))return;const t=e.map((r=>new Promise((s=>{const i=new FileReader;i.onload=()=>{s(i.result)},i.readAsDataURL(r)}))));Promise.all(t).then((r=>{const s=r.reduce(((i,a)=>i.insert({image:a})),(new k).retain(n.index).delete(n.length));this.quill.updateContents(s,M.sources.USER),this.quill.setSelection(n.index+r.length,M.sources.SILENT)}))}};const yp=["insertText","insertReplacementText"];class _p extends it{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",(r=>{this.handleBeforeInput(r)})),/Android/i.test(navigator.userAgent)||e.on(N.events.COMPOSITION_BEFORE_START,(()=>{this.handleCompositionStart()}))}deleteRange(e){Xi({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(e.length===0)return!1;if(t){const r=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents((new k).retain(e.index).insert(t,r),N.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,N.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!yp.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const r=vp(e);if(r==null)return;const s=this.quill.selection.normalizeNative(t),i=s?this.quill.selection.normalizedToRange(s):null;i&&this.replaceText(i,r)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function vp(n){return typeof n.data=="string"?n.data:n.dataTransfer?.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const Np=/Mac/i.test(navigator.platform),Tp=100,Ap=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||Np&&n.key==="a"&&n.ctrlKey===!0);class wp extends it{isListening=!1;selectionChangeDeadline=0;constructor(e,t){super(e,t),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,t){let{line:r,event:s}=t;if(!(r instanceof je)||!r.uiNode)return!0;const i=getComputedStyle(r.domNode).direction==="rtl";return i&&s.key!=="ArrowRight"||!i&&s.key!=="ArrowLeft"?!0:(this.quill.setSelection(e.index-1,e.length+(s.shiftKey?1:0),N.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",(e=>{!e.defaultPrevented&&Ap(e)&&this.ensureListeningToSelectionChange()}))}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+Tp,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 t=e.getRangeAt(0);if(t.collapsed!==!0||t.startOffset!==0)return;const r=this.quill.scroll.find(t.startContainer);if(!(r instanceof je)||!r.uiNode)return;const s=document.createRange();s.setStartAfter(r.uiNode),s.setEndAfter(r.uiNode),e.removeAllRanges(),e.addRange(s)}}N.register({"blots/block":be,"blots/block/embed":qe,"blots/break":Ve,"blots/container":Xt,"blots/cursor":Ke,"blots/embed":ji,"blots/inline":Ct,"blots/scroll":Rg,"blots/text":Ze,"modules/clipboard":sp,"modules/history":mp,"modules/keyboard":ss,"modules/uploader":Cl,"modules/input":_p,"modules/uiNode":wp});class Sp extends We{add(e,t){let r=0;if(t==="+1"||t==="-1"){const s=this.value(e)||0;r=t==="+1"?s+1:s-1}else typeof t=="number"&&(r=t);return r===0?(this.remove(e),!0):super.add(e,r.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}const Op=new Sp("indent","ql-indent",{scope:D.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class xp extends be{static blotName="blockquote";static tagName="blockquote"}class Cp extends be{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}}class dr extends Xt{}dr.blotName="list-container";dr.tagName="OL";class hr extends be{static create(e){const t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){N.register(dr)}constructor(e,t){super(e,t);const r=t.ownerDocument.createElement("span"),s=i=>{if(!e.isEnabled())return;const a=this.statics.formats(t,e);a==="checked"?(this.format("list","unchecked"),i.preventDefault()):a==="unchecked"&&(this.format("list","checked"),i.preventDefault())};r.addEventListener("mousedown",s),r.addEventListener("touchstart",s),this.attachUI(r)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}hr.blotName="list";hr.tagName="LI";dr.allowedChildren=[hr];hr.requiredContainer=dr;class ea extends Ct{static blotName="bold";static tagName=["STRONG","B"];static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}class Lp extends ea{static blotName="italic";static tagName=["EM","I"]}class Kr extends Ct{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(e){const t=super.create(e);return t.setAttribute("href",this.sanitize(e)),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t}static formats(e){return e.getAttribute("href")}static sanitize(e){return Ll(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e!==this.statics.blotName||!t?super.format(e,t):this.domNode.setAttribute("href",this.constructor.sanitize(t))}}function Ll(n,e){const t=document.createElement("a");t.href=n;const r=t.href.slice(0,t.href.indexOf(":"));return e.indexOf(r)>-1}class Ip extends Ct{static blotName="script";static tagName=["SUB","SUP"];static create(e){return e==="super"?document.createElement("sup"):e==="sub"?document.createElement("sub"):super.create(e)}static formats(e){if(e.tagName==="SUB")return"sub";if(e.tagName==="SUP")return"super"}}class Rp extends ea{static blotName="strike";static tagName=["S","STRIKE"]}class kp extends Ct{static blotName="underline";static tagName="U"}class Mp extends ji{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return typeof e=="string"&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`<span>${e}</span>`}}const ao=["alt","height","width"];let Dp=class extends ke{static blotName="image";static tagName="IMG";static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return ao.reduce(((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t)),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return Ll(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){ao.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}};const oo=["height","width"];class Bp extends qe{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(e){const t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return oo.reduce(((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t)),{})}static sanitize(e){return Kr.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){oo.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}}const Wn=new We("code-token","hljs",{scope:D.INLINE});class pt extends Ct{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(Oe.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,r){super(e,t,r),Wn.add(this.domNode,r)}format(e,t){e!==pt.blotName?super.format(e,t):t?Wn.add(this.domNode,t):(Wn.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),Wn.value(this.domNode)||this.unwrap()}}pt.blotName="code-token";pt.className="ql-token";class Be extends Oe{static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("data-language",e),t}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-language",t):super.format(e,t)}replaceWith(e,t){return this.formatAt(0,this.length(),pt.blotName,!1),super.replaceWith(e,t)}}class Yn extends Jt{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===Be.blotName&&(this.forceNext=!0,this.children.forEach((r=>{r.format(e,t)})))}formatAt(e,t,r,s){r===Be.blotName&&(this.forceNext=!0),super.formatAt(e,t,r,s)}highlight(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const s=`${Array.from(this.domNode.childNodes).filter((a=>a!==this.uiNode)).map((a=>a.textContent)).join(`\n`)}\n`,i=Be.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==s){if(s.trim().length>0||this.cachedText==null){const a=this.children.reduce(((c,u)=>c.concat(gl(u,!1))),new k),o=e(s,i);a.diff(o).reduce(((c,u)=>{let{retain:h,attributes:p}=u;return h?(p&&Object.keys(p).forEach((f=>{[Be.blotName,pt.blotName].includes(f)&&this.formatAt(c,h,f,p[f])})),c+h):c}),0)}this.cachedText=s,this.forceNext=!1}}html(e,t){const[r]=this.children.find(e);return`<pre data-language="${r?Be.formats(r.domNode):"plain"}">\n${rs(this.code(e,t))}\n</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=Be.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}Yn.allowedChildren=[Be];Be.requiredContainer=Yn;Be.allowedChildren=[pt,Ke,Ze,Ve];const qp=(n,e,t)=>{if(typeof n.versionString=="string"){const r=n.versionString.split(".")[0];if(parseInt(r,10)>=11)return n.highlight(t,{language:e}).value}return n.highlight(e,t).value};class Il extends it{static register(){N.register(pt,!0),N.register(Be,!0),N.register(Yn,!0)}constructor(e,t){if(super(e,t),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce(((r,s)=>{let{key:i}=s;return r[i]=!0,r}),{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(N.events.SCROLL_BLOT_MOUNT,(e=>{if(!(e instanceof Yn))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach((r=>{let{key:s,label:i}=r;const a=t.ownerDocument.createElement("option");a.textContent=i,a.setAttribute("value",s),t.appendChild(a)})),t.addEventListener("change",(()=>{e.format(Be.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)})),e.uiNode==null&&(e.attachUI(t),e.children.head&&(t.value=Be.formats(e.children.head.domNode)))}))}initTimer(){let e=null;this.quill.on(N.events.SCROLL_OPTIMIZE,(()=>{e&&clearTimeout(e),e=setTimeout((()=>{this.highlight(),e=null}),this.options.interval)}))}highlight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(N.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(Yn):[e]).forEach((i=>{i.highlight(this.highlightBlot,t)})),this.quill.update(N.sources.SILENT),r!=null&&this.quill.setSelection(r,N.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(t=this.languages[t]?t:"plain",t==="plain")return rs(e).split(`\n`).reduce(((s,i,a)=>(a!==0&&s.insert(`\n`,{[Oe.blotName]:t}),s.insert(i))),new k);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(Oe.className),r.innerHTML=qp(this.options.hljs,t,e),Ji(this.quill.scroll,r,[(s,i)=>{const a=Wn.value(s);return a?i.compose((new k).retain(i.length(),{[pt.blotName]:a})):i}],[(s,i)=>s.data.split(`\n`).reduce(((a,o,c)=>(c!==0&&a.insert(`\n`,{[Oe.blotName]:t}),a.insert(o))),i)],new WeakMap)}}Il.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"}]};class Ge extends be{static blotName="table";static tagName="TD";static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",ta()),t}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(e,t){e===Ge.blotName&&t?this.domNode.setAttribute("data-row",t):super.format(e,t)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}class Wt extends Xt{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const e=this.children.head.formats(),t=this.children.tail.formats(),r=this.next.children.head.formats(),s=this.next.children.tail.formats();return e.table===t.table&&e.table===r.table&&e.table===s.table}return!1}optimize(e){super.optimize(e),this.children.forEach((t=>{if(t.next==null)return;const r=t.formats(),s=t.next.formats();if(r.table!==s.table){const i=this.splitAfter(t);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}}class wt extends Xt{static blotName="table-body";static tagName="TBODY"}class Gr extends Xt{static blotName="table-container";static tagName="TABLE";balanceCells(){const e=this.descendants(Wt),t=e.reduce(((r,s)=>Math.max(s.children.length,r)),0);e.forEach((r=>{new Array(t-r.children.length).fill(0).forEach((()=>{let s;r.children.head!=null&&(s=Ge.formats(r.children.head.domNode));const i=this.scroll.create(Ge.blotName,s);r.appendChild(i),i.optimize()}))}))}cells(e){return this.rows().map((t=>t.children.at(e)))}deleteColumn(e){const[t]=this.descendant(wt);t==null||t.children.head==null||t.children.forEach((r=>{const s=r.children.at(e);s?.remove()}))}insertColumn(e){const[t]=this.descendant(wt);t==null||t.children.head==null||t.children.forEach((r=>{const s=r.children.at(e),i=Ge.formats(r.children.head.domNode),a=this.scroll.create(Ge.blotName,i);r.insertBefore(a,s)}))}insertRow(e){const[t]=this.descendant(wt);if(t==null||t.children.head==null)return;const r=ta(),s=this.scroll.create(Wt.blotName);t.children.head.children.forEach((()=>{const a=this.scroll.create(Ge.blotName,r);s.appendChild(a)}));const i=t.children.at(e);t.insertBefore(s,i)}rows(){const e=this.children.head;return e==null?[]:e.children.map((t=>t))}}Gr.allowedChildren=[wt];wt.requiredContainer=Gr;wt.allowedChildren=[Wt];Wt.requiredContainer=wt;Wt.allowedChildren=[Ge];Ge.requiredContainer=Wt;function ta(){return`row-${Math.random().toString(36).slice(2,6)}`}class $p extends it{static register(){N.register(Ge),N.register(Wt),N.register(wt),N.register(Gr)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Gr).forEach((e=>{e.balanceCells()}))}deleteColumn(){const[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update(N.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(N.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const t=e.offset();e.remove(),this.quill.update(N.sources.USER),this.quill.setSelection(t,N.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];const[t,r]=this.quill.getLine(e.index);if(t==null||t.statics.blotName!==Ge.blotName)return[null,null,null,-1];const s=t.parent;return[s.parent.parent,s,t,r]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[r,s,i]=this.getTable(t);if(i==null)return;const a=i.cellOffset();r.insertColumn(a+e),this.quill.update(N.sources.USER);let o=s.rowOffset();e===0&&(o+=1),this.quill.setSelection(t.index+o,t.length,N.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[r,s,i]=this.getTable(t);if(i==null)return;const a=s.rowOffset();r.insertRow(a+e),this.quill.update(N.sources.USER),e>0?this.quill.setSelection(t,N.sources.SILENT):this.quill.setSelection(t.index+s.children.length,t.length,N.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const r=this.quill.getSelection();if(r==null)return;const s=new Array(e).fill(0).reduce((i=>{const a=new Array(t).fill(`\n`).join("");return i.insert(a,{table:ta()})}),(new k).retain(r.index));this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(r.index,N.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(N.events.SCROLL_OPTIMIZE,(e=>{e.some((t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.quill.once(N.events.TEXT_CHANGE,((r,s,i)=>{i===N.sources.USER&&this.balanceTables()})),!0):!1))}))}}const lo=bt("quill:toolbar");class na extends it{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const r=document.createElement("div");r.setAttribute("role","toolbar"),Pp(r,this.options.container),e.container?.parentNode?.insertBefore(r,e.container),this.container=r}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){lo.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach((r=>{const s=this.options.handlers?.[r];s&&this.addHandler(r,s)})),Array.from(this.container.querySelectorAll("button, select")).forEach((r=>{this.attach(r)})),this.quill.on(N.events.EDITOR_CHANGE,(()=>{const[r]=this.quill.selection.getRange();this.update(r)}))}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find((s=>s.indexOf("ql-")===0));if(!t)return;if(t=t.slice(3),e.tagName==="BUTTON"&&e.setAttribute("type","button"),this.handlers[t]==null&&this.quill.scroll.query(t)==null){lo.warn("ignoring attaching to nonexistent format",t,e);return}const r=e.tagName==="SELECT"?"change":"click";e.addEventListener(r,(s=>{let i;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const o=e.options[e.selectedIndex];o.hasAttribute("selected")?i=!1:i=o.value||!1}else e.classList.contains("ql-active")?i=!1:i=e.value||!e.hasAttribute("value"),s.preventDefault();this.quill.focus();const[a]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,i);else if(this.quill.scroll.query(t).prototype instanceof ke){if(i=prompt(`Enter ${t}`),!i)return;this.quill.updateContents((new k).retain(a.index).delete(a.length).insert({[t]:i}),N.sources.USER)}else this.quill.format(t,i,N.sources.USER);this.update(a)})),this.controls.push([t,e])}update(e){const t=e==null?{}:this.quill.getFormat(e);this.controls.forEach((r=>{const[s,i]=r;if(i.tagName==="SELECT"){let a=null;if(e==null)a=null;else if(t[s]==null)a=i.querySelector("option[selected]");else if(!Array.isArray(t[s])){let o=t[s];typeof o=="string"&&(o=o.replace(/"/g,'\\"')),a=i.querySelector(`option[value="${o}"]`)}a==null?(i.value="",i.selectedIndex=-1):a.selected=!0}else if(e==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const a=t[s],o=a===i.getAttribute("value")||a!=null&&a.toString()===i.getAttribute("value")||a==null&&!i.getAttribute("value");i.classList.toggle("ql-active",o),i.setAttribute("aria-pressed",o.toString())}else{const a=t[s]!=null;i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}}))}}na.DEFAULTS={};function co(n,e,t){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${e}`),r.setAttribute("aria-pressed","false"),t!=null?(r.value=t,r.setAttribute("aria-label",`${e}: ${t}`)):r.setAttribute("aria-label",e),n.appendChild(r)}function Pp(n,e){Array.isArray(e[0])||(e=[e]),e.forEach((t=>{const r=document.createElement("span");r.classList.add("ql-formats"),t.forEach((s=>{if(typeof s=="string")co(r,s);else{const i=Object.keys(s)[0],a=s[i];Array.isArray(a)?Up(r,i,a):co(r,i,a)}})),n.appendChild(r)}))}function Up(n,e,t){const r=document.createElement("select");r.classList.add(`ql-${e}`),t.forEach((s=>{const i=document.createElement("option");s!==!1?i.setAttribute("value",String(s)):i.setAttribute("selected","selected"),r.appendChild(i)})),n.appendChild(r)}na.DEFAULTS={container:null,handlers:{clean(){const n=this.quill.getSelection();if(n!=null)if(n.length===0){const e=this.quill.getFormat();Object.keys(e).forEach((t=>{this.quill.scroll.query(t,D.INLINE)!=null&&this.quill.format(t,!1,N.sources.USER)}))}else this.quill.removeFormat(n.index,n.length,N.sources.USER)},direction(n){const{align:e}=this.quill.getFormat();n==="rtl"&&e==null?this.quill.format("align","right",N.sources.USER):!n&&e==="right"&&this.quill.format("align",!1,N.sources.USER),this.quill.format("direction",n,N.sources.USER)},indent(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e),r=parseInt(t.indent||0,10);if(n==="+1"||n==="-1"){let s=n==="+1"?1:-1;t.direction==="rtl"&&(s*=-1),this.quill.format("indent",r+s,N.sources.USER)}},link(n){n===!0&&(n=prompt("Enter link URL:")),this.quill.format("link",n,N.sources.USER)},list(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e);n==="check"?t.list==="checked"||t.list==="unchecked"?this.quill.format("list",!1,N.sources.USER):this.quill.format("list","unchecked",N.sources.USER):this.quill.format("list",n,N.sources.USER)}}};const Fp='<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>',Hp='<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>',zp='<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>',Kp='<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>',Gp='<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>',jp='<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>',Zp='<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>',Wp='<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>',uo='<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>',Vp='<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>',Yp='<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>',Qp='<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>',Xp='<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>',Jp='<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>',em='<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>',tm='<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>',nm='<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>',rm='<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>',sm='<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>',im='<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>',am='<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>',om='<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>',lm='<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>',cm='<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>',um='<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>',dm='<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>',hm='<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>',fm='<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>',gm='<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>',pm='<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>',mm='<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>',bm='<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>',Em='<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>',rr={align:{"":Fp,center:Hp,right:zp,justify:Kp},background:Gp,blockquote:jp,bold:Zp,clean:Wp,code:uo,"code-block":uo,color:Vp,direction:{"":Yp,rtl:Qp},formula:Xp,header:{1:Jp,2:em,3:tm,4:nm,5:rm,6:sm},italic:im,image:am,indent:{"+1":om,"-1":lm},link:cm,list:{bullet:um,check:dm,ordered:hm},script:{sub:fm,super:gm},strike:pm,table:mm,underline:bm,video:Em},ym='<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 ho=0;function fo(n,e){n.setAttribute(e,`${n.getAttribute(e)!=="true"}`)}class is{constructor(e){this.select=e,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",(t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault();break}})),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),fo(this.label,"aria-expanded"),fo(this.options,"aria-hidden")}buildItem(e){const t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");const r=e.getAttribute("value");return r&&t.setAttribute("data-value",r),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",(()=>{this.selectItem(t,!0)})),t.addEventListener("keydown",(s=>{switch(s.key){case"Enter":this.selectItem(t,!0),s.preventDefault();break;case"Escape":this.escape(),s.preventDefault();break}})),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=ym,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${ho}`,ho+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach((t=>{const r=this.buildItem(t);e.appendChild(r),t.selected===!0&&this.selectItem(r)})),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach((e=>{this.container.setAttribute(e.name,e.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(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.container.querySelector(".ql-selected");e!==r&&(r?.classList.remove("ql-selected"),e!=null&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const t=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class Rl extends is{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach((r=>{r.classList.add("ql-primary")}))}buildItem(e){const t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);const r=this.label.querySelector(".ql-color-label"),s=e&&e.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=s:r.style.fill=s)}}class kl extends is{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach((r=>{r.innerHTML=t[r.getAttribute("data-value")||""]})),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const r=e||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const _m=n=>{const{overflowY:e}=getComputedStyle(n,null);return e!=="visible"&&e!=="clip"};let Ml=class{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,_m(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(e){const t=e.left+e.width/2-this.root.offsetWidth/2,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let a=0;if(i.right>s.right&&(a=s.right-i.right,this.root.style.left=`${t+a}px`),i.left<s.left&&(a=s.left-i.left,this.root.style.left=`${t+a}px`),i.bottom>s.bottom){const o=i.bottom-i.top,c=e.bottom-e.top+o;this.root.style.top=`${r-c}px`,this.root.classList.add("ql-flip")}return a}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}};const vm=[!1,"center","right","justify"],Nm=["#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"],Tm=[!1,"serif","monospace"],Am=["1","2","3",!1],wm=["small",!1,"large","huge"];class fr extends Rn{constructor(e,t){super(e,t);const r=s=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(s.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach((i=>{i.container.contains(s.target)||i.close()}))};e.emitter.listenDOM("click",document.body,r)}addModule(e){const t=super.addModule(e);return e==="toolbar"&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach((r=>{(r.getAttribute("class")||"").split(/\s+/).forEach((i=>{if(i.startsWith("ql-")&&(i=i.slice(3),t[i]!=null))if(i==="direction")r.innerHTML=t[i][""]+t[i].rtl;else if(typeof t[i]=="string")r.innerHTML=t[i];else{const a=r.value||"";a!=null&&t[i][a]&&(r.innerHTML=t[i][a])}}))}))}buildPickers(e,t){this.pickers=Array.from(e).map((s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&Zn(s,vm),typeof t.align=="object"))return new kl(s,t.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&&Zn(s,Nm,i==="background"?"#ffffff":"#000000"),new Rl(s,t[i])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?Zn(s,Tm):s.classList.contains("ql-header")?Zn(s,Am):s.classList.contains("ql-size")&&Zn(s,wm)),new is(s)}));const r=()=>{this.pickers.forEach((s=>{s.update()}))};this.quill.on(M.events.EDITOR_CHANGE,r)}}fr.DEFAULTS=At({},Rn.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let n=this.container.querySelector("input.ql-image[type=file]");n==null&&(n=document.createElement("input"),n.setAttribute("type","file"),n.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),n.classList.add("ql-image"),n.addEventListener("change",(()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,n.files),n.value=""})),this.container.appendChild(n)),n.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class Dl extends Ml{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",(e=>{e.key==="Enter"?(this.save(),e.preventDefault()):e.key==="Escape"&&(this.cancel(),e.preventDefault())}))}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",t=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;t!=null?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,M.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,M.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=Sm(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(t!=null){const r=t.index+t.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),e,M.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",M.sources.USER),this.quill.setSelection(r+2,M.sources.USER)}break}}this.textbox.value="",this.hide()}}function Sm(n){let e=n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=n.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:n}function Zn(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach((r=>{const s=document.createElement("option");r===t?s.setAttribute("selected","selected"):s.setAttribute("value",String(r)),n.appendChild(s)}))}const Om=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class xm extends Dl{static 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("");constructor(e,t){super(e,t),this.quill.on(M.events.EDITOR_CHANGE,((r,s,i,a)=>{if(r===M.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&a===M.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const o=this.quill.getLines(s.index,s.length);if(o.length===1){const c=this.quill.getBounds(s);c!=null&&this.position(c)}else{const c=o[o.length-1],u=this.quill.getIndex(c),h=Math.min(c.length()-1,s.index+s.length-u),p=this.quill.getBounds(new Zt(u,h));p!=null&&this.position(p)}}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(M.events.SCROLL_OPTIMIZE,(()=>{setTimeout((()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(e!=null){const t=this.quill.getBounds(e);t!=null&&this.position(t)}}),1)}))}cancel(){this.show()}position(e){const t=super.position(e),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",t!==0&&(r.style.marginLeft=`${-1*t-r.offsetWidth/2}px`),t}}class Bl extends fr{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=Om),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new xm(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),rr),this.buildPickers(e.container.querySelectorAll("select"),rr))}}Bl.DEFAULTS=At({},fr.DEFAULTS,{modules:{toolbar:{handlers:{link(n){n?this.quill.theme.tooltip.edit():this.quill.format("link",!1,N.sources.USER)}}}}});const Cm=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Lm extends Dl{static 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("");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 t=this.linkRange;this.restoreFocus(),this.quill.formatText(t,"link",!1,M.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()})),this.quill.on(M.events.SELECTION_CHANGE,((e,t,r)=>{if(e!=null){if(e.length===0&&r===M.sources.USER){const[s,i]=this.quill.scroll.descendant(Kr,e.index);if(s!=null){this.linkRange=new Zt(e.index-i,s.length());const a=Kr.formats(s.domNode);this.preview.textContent=a,this.preview.setAttribute("href",a),this.show();const o=this.quill.getBounds(this.linkRange);o!=null&&this.position(o);return}}else delete this.linkRange;this.hide()}}))}show(){super.show(),this.root.removeAttribute("data-mode")}}class ql extends fr{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=Cm),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),rr),this.buildPickers(e.container.querySelectorAll("select"),rr),this.tooltip=new Lm(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},((t,r)=>{e.handlers.link.call(e,!r.format.link)})))}}ql.DEFAULTS=At({},fr.DEFAULTS,{modules:{toolbar:{handlers:{link(n){if(n){const e=this.quill.getSelection();if(e==null||e.length===0)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&t.indexOf("mailto:")!==0&&(t=`mailto:${t}`);const{tooltip:r}=this.quill.theme;r.edit("link",t)}else this.quill.format("link",!1,N.sources.USER)}}}}});N.register({"attributors/attribute/direction":_l,"attributors/class/align":bl,"attributors/class/background":Dg,"attributors/class/color":Mg,"attributors/class/direction":vl,"attributors/class/font":Al,"attributors/class/size":Sl,"attributors/style/align":El,"attributors/style/background":Vi,"attributors/style/color":Wi,"attributors/style/direction":Nl,"attributors/style/font":wl,"attributors/style/size":Ol},!0);N.register({"formats/align":bl,"formats/direction":vl,"formats/indent":Op,"formats/background":Vi,"formats/color":Wi,"formats/font":Al,"formats/size":Sl,"formats/blockquote":xp,"formats/code-block":Oe,"formats/header":Cp,"formats/list":hr,"formats/bold":ea,"formats/code":Yi,"formats/italic":Lp,"formats/link":Kr,"formats/script":Ip,"formats/strike":Rp,"formats/underline":kp,"formats/formula":Mp,"formats/image":Dp,"formats/video":Bp,"modules/syntax":Il,"modules/table":$p,"modules/toolbar":na,"themes/bubble":Bl,"themes/snow":ql,"ui/icons":rr,"ui/picker":is,"ui/icon-picker":kl,"ui/color-picker":Rl,"ui/tooltip":Ml},!0);var Me={generateFilename(){return btoa(String(Math.random()*1e6)+String(+new Date)).replace("=","")},urlIsImage(n,e=3e3){return this.validURL(n)?/\.(jpeg|jpg|gif|png|webp|tiff|bmp)$/.test(n)?Promise.resolve(!0):new Promise(((t,r)=>{let s;const i=new Image;i.onerror=i.onabort=()=>{clearTimeout(s),r(!1)},i.onload=()=>{clearTimeout(s),t(!0)},s=setTimeout((()=>{i.src="//!/an/invalid.jpg",r(!1)}),e),i.src=n})):Promise.reject(!1)},urlIsImageDataUrl(n){return/^data:image\/\w+;base64,/.test(n)},validURL(n){try{return!!new URL(n)}catch{return!1}},isRichText(n){let e=!1,t=!1;return Array.prototype.forEach.call(n,(r=>{r.kind==="string"&&r.type.match(/^text\/html$/i)&&(e=!0),r.kind==="file"&&r.type.match(/^image\/\w+$/i)&&(t=!0)})),e&&!t},resolveDataUrl(n,e){let t="";return typeof n=="string"?t=n:n instanceof ArrayBuffer&&(t=this.arrayBufferToBase64Url(n,e)),t},binaryStringToArrayBuffer(n){const e=n.length,t=new ArrayBuffer(e),r=new Uint8Array(t);let s=-1;for(;++s<e;)r[s]=n.charCodeAt(s);return t},arrayBufferToBase64Url(n,e){return`data:${e};base64,`+btoa(new Uint8Array(n).reduce(((t,r)=>t+String.fromCharCode(r)),""))},copyText(n,e=document.body){const t=document.createElement("textarea"),r=document.activeElement;t.value=n,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="12pt";const s=document.getSelection();let i=!1;s&&s.rangeCount>0&&(i=s.getRangeAt(0)),e.append(t),t.select(),t.selectionStart=0,t.selectionEnd=n.length;let a=!1;try{a=document.execCommand("copy")}catch{}return t.remove(),s&&i&&(s.removeAllRanges(),s.addRange(i)),r&&r.focus(),a},isType(n,e){return Object.prototype.toString.call(n)===`[object ${e}]`},isObject(n){return this.isType(n,"Object")}};class Im{constructor(e,t,r){this.dataUrl=e,this.type=t,this.name=r||""}}class sr extends Im{constructor(e,t,r){super(e,t,r),this.dataUrl=e,this.type=t,this.name=r||`${Me.generateFilename()}.${this.getSuffix()}`}minify(e){return new Promise(((t,r)=>{const s=e.maxWidth||800,i=e.maxHeight||800,a=e.quality||.8;if(!this.dataUrl)return r({message:"[error] QuillImageDropAndPaste: Fail to minify the image, dataUrl should not be empty."});const o=new Image;o.onload=()=>{const c=o.width,u=o.height;c>u?c>s&&(o.height=u*s/c,o.width=s):u>i&&(o.width=c*i/u,o.height=i);const h=document.createElement("canvas");h.width=o.width,h.height=o.height;const p=h.getContext("2d");if(p){p.drawImage(o,0,0,o.width,o.height);const f=this.type||"image/png",g=h.toDataURL(f,a);t(new sr(g,f,this.name))}else r({message:"[error] QuillImageDropAndPaste: Fail to minify the image, create canvas context failure."})},o.src=Me.resolveDataUrl(this.dataUrl,this.type)}))}toFile(e){return e=e||this.name,window.File?new File([this.toBlob()],e,{type:this.type}):(console.error("[error] QuillImageDropAndPaste: Your browser didnot support File API."),null)}toBlob(){const e=Me.resolveDataUrl(this.dataUrl,this.type).replace(/^[^,]+,/,""),t=Me.binaryStringToArrayBuffer(atob(e));return this.createBlob([t],{type:this.type})}createBlob(e,t){t||(t={}),typeof t=="string"&&(t={type:t});try{return new Blob(e,t)}catch(r){if(r.name!=="TypeError")throw r;const s="BlobBuilder"in window?window.BlobBuilder:"MSBlobBuilder"in window?window.MSBlobBuilder:"MozBlobBuilder"in window?window.MozBlobBuilder:window.WebKitBlobBuilder,i=new s;for(let a=0;a<e.length;a++)i.append(e[a]);return i.getBlob(t.type)}}getSuffix(){const e=this.type.match(/^image\/(\w+)$/);return e?e[1]:"png"}}class Rm{constructor(e,t){this.quill=e,this.option=t}}class as extends Rm{constructor(e,t){var r;super(e,t),typeof t.autoConvert!="boolean"&&(t.autoConvert=!0),t.enableNativeUploader!==!0&&Me.isObject(e.uploader)&&Me.isObject((r=e.uploader)===null||r===void 0?void 0:r.options)&&(e.uploader.options.handler=()=>{}),this.quill=e,this.option=t,this.handleDrop=this.handleDrop.bind(this),this.handlePaste=this.handlePaste.bind(this),this.insert=this.insert.bind(this),this.quill.root.addEventListener("drop",this.handleDrop,!1),this.quill.root.addEventListener("paste",this.handlePaste,!1)}handleDrop(e){if(e.dataTransfer&&e.dataTransfer.files&&e.dataTransfer.files.length){if(e.preventDefault(),document.caretRangeFromPoint){const t=document.getSelection(),r=document.caretRangeFromPoint(e.clientX,e.clientY);t&&r&&t.setBaseAndExtent(r.startContainer,r.startOffset,r.startContainer,r.startOffset)}this.readFiles(e.dataTransfer.files,((t,r="image/png",s)=>{typeof this.option.handler=="function"?this.option.handler.call(this,t,r,new sr(t,r,s)):this.insert.call(this,Me.resolveDataUrl(t,r),r)}),e)}}handlePaste(e){if(e.clipboardData&&e.clipboardData.items&&e.clipboardData.items.length){if(Me.isRichText(e.clipboardData.items))return;this.readFiles(e.clipboardData.items,((t,r="image/png")=>{typeof this.option.handler=="function"?this.option.handler.call(this,t,r,new sr(t,r)):this.insert(Me.resolveDataUrl(t,r),"image")}),e)}}readFiles(e,t,r){Array.prototype.forEach.call(e,(s=>{Me.isType(s,"DataTransferItem")?this.handleDataTransfer(s,t,r):s instanceof File&&this.handleDroppedFile(s,t,r)}))}handleDataTransfer(e,t,r){const s=this,{type:i}=e;if(i.match(/^image\/(gif|jpe?g|a?png|svg|webp|bmp)/i)){r.preventDefault();const a=new FileReader;a.onload=c=>{c.target&&c.target.result&&t(c.target.result,i)};const o=e.getAsFile?e.getAsFile():e;o instanceof Blob&&a.readAsDataURL(o)}else i.match(/^text\/plain$/i)&&e.getAsString((a=>{if(Me.urlIsImageDataUrl(a)){const o=a.match(/^data:(image\/\w+);base64,/),c=o?o[1]:"image/png",u=this.getIndex();t(a,c),this.quill.deleteText(u,a.length,"user"),this.quill.setSelection(u)}else this.option.autoConvert&&Me.urlIsImage(a).then((()=>{setTimeout((()=>{const o=this.getIndex();this.quill.deleteText(o-a.length,a.length,"user"),s.insert(a,"image",o-a.length)}))})).catch((()=>{}))}))}handleDroppedFile(e,t,r){const{type:s,name:i=""}=e;if(s.match(/^image\/(gif|jpe?g|a?png|svg|webp|bmp)/i)){r.preventDefault();const a=new FileReader;a.onload=o=>{o.target&&o.target.result&&t(o.target.result,s,i)},a.readAsDataURL(e)}}insert(e,t,r){r=r===void 0?this.getIndex():r;let s;t.startsWith("image")?(s=r+1,this.quill.insertEmbed(r,"image",e,"user")):t.startsWith("text")&&(s=r+e.length,this.quill.insertText(r,e,"user")),setTimeout((()=>{this.quill.setSelection(s)}))}getIndex(){let e=(this.quill.getSelection(!0)||{}).index;return(e===void 0||e<0)&&(e=this.quill.getLength()),e}}as.ImageData=sr;window.QuillImageDropAndPaste=as;"Quill"in window&&window.Quill.register("modules/imageDropAndPaste",as);var $l=n=>n!=null&&(n=Object.getPrototypeOf(n),n===Array.prototype||n===Object.prototype);function Pl(n,e,t){for(const[r,s]of Object.entries(e)){const i=`${t}.${r}`;n[i]=s,$l(s)&&Pl(n,s,i)}}function km(n){const e={...n};for(const[t,r]of Object.entries(n))$l(r)&&Pl(e,r,t);return e}var Mm=(n,e)=>{if(e)for(const[t,r]of Object.entries(e))n=n.replace(new RegExp(`{{\\s*${t}\\s*}}`,"g"),r);return n},Dm=n=>n;function Bm(n,e=Dm){return(t,...r)=>{t[0]==="."&&(t=t.slice(1));const s=n()?.[t];switch(typeof s){case"function":return s(...r);case"string":return e(s,r[0]);default:return s}}}const qm={insertHtmlSnippetMessage:"Insert a HTML Snippet",obfuscate:"Obfuscate"},$m="image",Pm="Validate",Um="Cancel",Fm="Remove",Hm="Done",zm="Image not inserted, place cursor in editor first",Km="HTML Snippet",Gm="Confirm Deletion",jm={content:"Are you sure you want to delete this HTML Snippet?"},Zm={variantLabel:"Size {{ n }}",sizes:"Sizes",imageProperties:"Image properties",left:"Left",right:"Right",center:"Center",alignment:"Alignment",options:"Options",enableZoom:"Enable zoom"},Wm={obfuscator:"Obfuscator",content:"Content:",asALink:"As a link",doNotObfuscate:"Do not obfuscate"},Vm={CustomToolbar:qm,image:$m,validate:Pm,delete:"Delete",cancel:Um,remove:Fm,done:Hm,editorFocusLost:zm,htmlSnippetLabel:Km,confirmDeletion:Gm,comfirmSnippetDeletionDialog:jm,makeImagePropertiesDialog:Zm,openObfuscatorDialog:Wm},Ym={insertHtmlSnippetMessage:"Insérer un extrait de code HTML",obfuscate:"Obfusquer"},Qm="image",Xm="Valider",Jm="Annuler",eb="Terminé",tb="L'image n'a pas été insérée, mettre d'abord le curseur dans l'éditeur",nb="Code HTML",rb="Confirmer la suppression",sb="Retirer",ib={content:"Voulez-vous vraiment supprimer ce code HTML ?"},ab={variantLabel:"Taille {{ n }}",sizes:"Tailles",imageProperties:"Propriétés de l'image",left:"À gauche",right:"À droite",center:"Centrer",alignment:"Alignement",options:"Options",enableZoom:"Activer le zoom"},ob={obfuscator:"Obfusqueur",content:"Contenu:",asALink:"En tant que lien",doNotObfuscate:"Ne pas obfusquer"},lb={CustomToolbar:Ym,image:Qm,validate:Xm,delete:"Supprimer",cancel:Jm,done:eb,editorFocusLost:tb,htmlSnippetLabel:nb,confirmDeletion:rb,remove:sb,comfirmSnippetDeletionDialog:ib,makeImagePropertiesDialog:ab,openObfuscatorDialog:ob},go={en:Vm,fr:lb};function tn(n){const e=oi((()=>{const r=n()in go?n():"en";return km(go[r])}));return{t:Bm(e,Mm)}}function Ul(n){return n instanceof Map?n.clear=n.delete=n.set=function(){throw new Error("map is read-only")}:n instanceof Set&&(n.add=n.clear=n.delete=function(){throw new Error("set is read-only")}),Object.freeze(n),Object.getOwnPropertyNames(n).forEach((e=>{const t=n[e],r=typeof t;(r==="object"||r==="function")&&!Object.isFrozen(t)&&Ul(t)})),n}class po{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Fl(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Tt(n,...e){const t=Object.create(null);for(const r in n)t[r]=n[r];return e.forEach((function(r){for(const s in r)t[s]=r[s]})),t}const cb="</span>",mo=n=>!!n.scope,ub=(n,{prefix:e})=>{if(n.startsWith("language:"))return n.replace("language:","language-");if(n.includes(".")){const t=n.split(".");return[`${e}${t.shift()}`,...t.map(((r,s)=>`${r}${"_".repeat(s+1)}`))].join(" ")}return`${e}${n}`};class db{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=Fl(e)}openNode(e){if(!mo(e))return;const t=ub(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){mo(e)&&(this.buffer+=cb)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const bo=(n={})=>{const e={children:[]};return Object.assign(e,n),e};class ra{constructor(){this.rootNode=bo(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=bo({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t=="string"?e.addText(t):t.children&&(e.openNode(t),t.children.forEach((r=>this._walk(e,r))),e.closeNode(t)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every((t=>typeof t=="string"))?e.children=[e.children.join("")]:e.children.forEach((t=>{ra._collapse(t)})))}}class hb extends ra{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const r=e.root;t&&(r.scope=`language:${t}`),this.add(r)}toHTML(){return new db(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ir(n){return n?typeof n=="string"?n:n.source:null}function Hl(n){return nn("(?=",n,")")}function fb(n){return nn("(?:",n,")*")}function gb(n){return nn("(?:",n,")?")}function nn(...n){return n.map((t=>ir(t))).join("")}function pb(n){const e=n[n.length-1];return typeof e=="object"&&e.constructor===Object?(n.splice(n.length-1,1),e):{}}function sa(...n){return"("+(pb(n).capture?"":"?:")+n.map((r=>ir(r))).join("|")+")"}function zl(n){return new RegExp(n.toString()+"|").exec("").length-1}function mb(n,e){const t=n&&n.exec(e);return t&&t.index===0}const bb=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ia(n,{joinWith:e}){let t=0;return n.map((r=>{t+=1;const s=t;let i=ir(r),a="";for(;i.length>0;){const o=bb.exec(i);if(!o){a+=i;break}a+=i.substring(0,o.index),i=i.substring(o.index+o[0].length),o[0][0]==="\\"&&o[1]?a+="\\"+String(Number(o[1])+s):(a+=o[0],o[0]==="("&&t++)}return a})).map((r=>`(${r})`)).join(e)}const Eb=/\b\B/,Kl="[a-zA-Z]\\w*",aa="[a-zA-Z_]\\w*",Gl="\\b\\d+(\\.\\d+)?",jl="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Zl="\\b(0b[01]+)",yb="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",_b=(n={})=>{const e=/^#![ ]*\//;return n.binary&&(n.begin=nn(e,/.*\b/,n.binary,/\b.*/)),Tt({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(t,r)=>{t.index!==0&&r.ignoreMatch()}},n)},ar={begin:"\\\\[\\s\\S]",relevance:0},vb={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ar]},Nb={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ar]},Tb={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},os=function(n,e,t={}){const r=Tt({scope:"comment",begin:n,end:e,contains:[]},t);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const s=sa("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:nn(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Ab=os("//","$"),wb=os("/\\*","\\*/"),Sb=os("#","$"),Ob={scope:"number",begin:Gl,relevance:0},xb={scope:"number",begin:jl,relevance:0},Cb={scope:"number",begin:Zl,relevance:0},Lb={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ar,{begin:/\[/,end:/\]/,relevance:0,contains:[ar]}]},Ib={scope:"title",begin:Kl,relevance:0},Rb={scope:"title",begin:aa,relevance:0},kb={begin:"\\.\\s*"+aa,relevance:0},Mb=function(n){return Object.assign(n,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})};var Mr=Object.freeze({__proto__:null,APOS_STRING_MODE:vb,BACKSLASH_ESCAPE:ar,BINARY_NUMBER_MODE:Cb,BINARY_NUMBER_RE:Zl,COMMENT:os,C_BLOCK_COMMENT_MODE:wb,C_LINE_COMMENT_MODE:Ab,C_NUMBER_MODE:xb,C_NUMBER_RE:jl,END_SAME_AS_BEGIN:Mb,HASH_COMMENT_MODE:Sb,IDENT_RE:Kl,MATCH_NOTHING_RE:Eb,METHOD_GUARD:kb,NUMBER_MODE:Ob,NUMBER_RE:Gl,PHRASAL_WORDS_MODE:Tb,QUOTE_STRING_MODE:Nb,REGEXP_MODE:Lb,RE_STARTERS_RE:yb,SHEBANG:_b,TITLE_MODE:Ib,UNDERSCORE_IDENT_RE:aa,UNDERSCORE_TITLE_MODE:Rb});function Db(n,e){n.input[n.index-1]==="."&&e.ignoreMatch()}function Bb(n,e){n.className!==void 0&&(n.scope=n.className,delete n.className)}function qb(n,e){e&&n.beginKeywords&&(n.begin="\\b("+n.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",n.__beforeBegin=Db,n.keywords=n.keywords||n.beginKeywords,delete n.beginKeywords,n.relevance===void 0&&(n.relevance=0))}function $b(n,e){Array.isArray(n.illegal)&&(n.illegal=sa(...n.illegal))}function Pb(n,e){if(n.match){if(n.begin||n.end)throw new Error("begin & end are not supported with match");n.begin=n.match,delete n.match}}function Ub(n,e){n.relevance===void 0&&(n.relevance=1)}const Fb=(n,e)=>{if(!n.beforeMatch)return;if(n.starts)throw new Error("beforeMatch cannot be used with starts");const t=Object.assign({},n);Object.keys(n).forEach((r=>{delete n[r]})),n.keywords=t.keywords,n.begin=nn(t.beforeMatch,Hl(t.begin)),n.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},n.relevance=0,delete t.beforeMatch},Hb=["of","and","for","in","not","or","if","then","parent","list","value"],zb="keyword";function Wl(n,e,t=zb){const r=Object.create(null);return typeof n=="string"?s(t,n.split(" ")):Array.isArray(n)?s(t,n):Object.keys(n).forEach((function(i){Object.assign(r,Wl(n[i],e,i))})),r;function s(i,a){e&&(a=a.map((o=>o.toLowerCase()))),a.forEach((function(o){const c=o.split("|");r[c[0]]=[i,Kb(c[0],c[1])]}))}}function Kb(n,e){return e?Number(e):Gb(n)?0:1}function Gb(n){return Hb.includes(n.toLowerCase())}const Eo={},Kt=n=>{console.error(n)},yo=(n,...e)=>{console.log(`WARN: ${n}`,...e)},mn=(n,e)=>{Eo[`${n}/${e}`]||(console.log(`Deprecated as of ${n}. ${e}`),Eo[`${n}/${e}`]=!0)},jr=new Error;function Vl(n,e,{key:t}){let r=0;const s=n[t],i={},a={};for(let o=1;o<=e.length;o++)a[o+r]=s[o],i[o+r]=!0,r+=zl(e[o-1]);n[t]=a,n[t]._emit=i,n[t]._multi=!0}function jb(n){if(Array.isArray(n.begin)){if(n.skip||n.excludeBegin||n.returnBegin)throw Kt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),jr;if(typeof n.beginScope!="object"||n.beginScope===null)throw Kt("beginScope must be object"),jr;Vl(n,n.begin,{key:"beginScope"}),n.begin=ia(n.begin,{joinWith:""})}}function Zb(n){if(Array.isArray(n.end)){if(n.skip||n.excludeEnd||n.returnEnd)throw Kt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),jr;if(typeof n.endScope!="object"||n.endScope===null)throw Kt("endScope must be object"),jr;Vl(n,n.end,{key:"endScope"}),n.end=ia(n.end,{joinWith:""})}}function Wb(n){n.scope&&typeof n.scope=="object"&&n.scope!==null&&(n.beginScope=n.scope,delete n.scope)}function Vb(n){Wb(n),typeof n.beginScope=="string"&&(n.beginScope={_wrap:n.beginScope}),typeof n.endScope=="string"&&(n.endScope={_wrap:n.endScope}),jb(n),Zb(n)}function Yb(n){function e(a,o){return new RegExp(ir(a),"m"+(n.case_insensitive?"i":"")+(n.unicodeRegex?"u":"")+(o?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(o,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,o]),this.matchAt+=zl(o)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const o=this.regexes.map((c=>c[1]));this.matcherRe=e(ia(o,{joinWith:"|"}),!0),this.lastIndex=0}exec(o){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(o);if(!c)return null;const u=c.findIndex(((p,f)=>f>0&&p!==void 0)),h=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,h)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(o){if(this.multiRegexes[o])return this.multiRegexes[o];const c=new t;return this.rules.slice(o).forEach((([u,h])=>c.addRule(u,h))),c.compile(),this.multiRegexes[o]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(o,c){this.rules.push([o,c]),c.type==="begin"&&this.count++}exec(o){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(o);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const h=this.getMatcher(0);h.lastIndex=this.lastIndex+1,u=h.exec(o)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function s(a){const o=new r;return a.contains.forEach((c=>o.addRule(c.begin,{rule:c,type:"begin"}))),a.terminatorEnd&&o.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&o.addRule(a.illegal,{type:"illegal"}),o}function i(a,o){const c=a;if(a.isCompiled)return c;[Bb,Pb,Vb,Fb].forEach((h=>h(a,o))),n.compilerExtensions.forEach((h=>h(a,o))),a.__beforeBegin=null,[qb,$b,Ub].forEach((h=>h(a,o))),a.isCompiled=!0;let u=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),u=a.keywords.$pattern,delete a.keywords.$pattern),u=u||/\w+/,a.keywords&&(a.keywords=Wl(a.keywords,n.case_insensitive)),c.keywordPatternRe=e(u,!0),o&&(a.begin||(a.begin=/\B|\b/),c.beginRe=e(c.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(c.endRe=e(c.end)),c.terminatorEnd=ir(c.end)||"",a.endsWithParent&&o.terminatorEnd&&(c.terminatorEnd+=(a.end?"|":"")+o.terminatorEnd)),a.illegal&&(c.illegalRe=e(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map((function(h){return Qb(h==="self"?a:h)}))),a.contains.forEach((function(h){i(h,c)})),a.starts&&i(a.starts,o),c.matcher=s(c),c}if(n.compilerExtensions||(n.compilerExtensions=[]),n.contains&&n.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return n.classNameAliases=Tt(n.classNameAliases||{}),i(n)}function Yl(n){return n?n.endsWithParent||Yl(n.starts):!1}function Qb(n){return n.variants&&!n.cachedVariants&&(n.cachedVariants=n.variants.map((function(e){return Tt(n,{variants:null},e)}))),n.cachedVariants?n.cachedVariants:Yl(n)?Tt(n,{starts:n.starts?Tt(n.starts):null}):Object.isFrozen(n)?Tt(n):n}var Xb="11.10.0";class Jb extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const si=Fl,_o=Tt,vo=Symbol("nomatch"),e1=7,Ql=function(n){const e=Object.create(null),t=Object.create(null),r=[];let s=!0;const i="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let o={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:hb};function c(x){return o.noHighlightRe.test(x)}function u(x){let C=x.className+" ";C+=x.parentNode?x.parentNode.className:"";const $=o.languageDetectRe.exec(C);if($){const I=Q($[1]);return I||(yo(i.replace("{}",$[1])),yo("Falling back to no-highlight mode for this block.",x)),I?$[1]:"no-highlight"}return C.split(/\s+/).find((I=>c(I)||Q(I)))}function h(x,C,$){let I="",G="";typeof C=="object"?(I=x,$=C.ignoreIllegals,G=C.language):(mn("10.7.0","highlight(lang, code, ...args) has been deprecated."),mn("10.7.0",`Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277`),G=x,I=C),$===void 0&&($=!0);const re={code:I,language:G};ce("before:highlight",re);const X=re.result?re.result:p(re.language,re.code,$);return X.code=re.code,ce("after:highlight",X),X}function p(x,C,$,I){const G=Object.create(null);function re(L,R){return L.keywords[R]}function X(){if(!P.keywords){se.addText(W);return}let L=0;P.keywordPatternRe.lastIndex=0;let R=P.keywordPatternRe.exec(W),U="";for(;R;){U+=W.substring(L,R.index);const K=Ee.case_insensitive?R[0].toLowerCase():R[0],ae=re(P,K);if(ae){const[Ce,kn]=ae;if(se.addText(U),U="",G[K]=(G[K]||0)+1,G[K]<=e1&&(lt+=kn),Ce.startsWith("_"))U+=R[0];else{const Bt=Ee.classNameAliases[Ce]||Ce;Ae(R[0],Bt)}}else U+=R[0];L=P.keywordPatternRe.lastIndex,R=P.keywordPatternRe.exec(W)}U+=W.substring(L),se.addText(U)}function at(){if(W==="")return;let L=null;if(typeof P.subLanguage=="string"){if(!e[P.subLanguage]){se.addText(W);return}L=p(P.subLanguage,W,!0,ot[P.subLanguage]),ot[P.subLanguage]=L._top}else L=g(W,P.subLanguage.length?P.subLanguage:null);P.relevance>0&&(lt+=L.relevance),se.__addSublanguage(L._emitter,L.language)}function z(){P.subLanguage!=null?at():X(),W=""}function Ae(L,R){L!==""&&(se.startScope(R),se.addText(L),se.endScope())}function rn(L,R){let U=1;const K=R.length-1;for(;U<=K;){if(!L._emit[U]){U++;continue}const ae=Ee.classNameAliases[L[U]]||L[U],Ce=R[U];ae?Ae(Ce,ae):(W=Ce,X(),W=""),U++}}function xe(L,R){return L.scope&&typeof L.scope=="string"&&se.openNode(Ee.classNameAliases[L.scope]||L.scope),L.beginScope&&(L.beginScope._wrap?(Ae(W,Ee.classNameAliases[L.beginScope._wrap]||L.beginScope._wrap),W=""):L.beginScope._multi&&(rn(L.beginScope,R),W="")),P=Object.create(L,{parent:{value:P}}),P}function Lt(L,R,U){let K=mb(L.endRe,U);if(K){if(L["on:end"]){const ae=new po(L);L["on:end"](R,ae),ae.isMatchIgnored&&(K=!1)}if(K){for(;L.endsParent&&L.parent;)L=L.parent;return L}}if(L.endsWithParent)return Lt(L.parent,R,U)}function sn(L){return P.matcher.regexIndex===0?(W+=L[0],1):(Dt=!0,0)}function It(L){const R=L[0],U=L.rule,K=new po(U),ae=[U.__beforeBegin,U["on:begin"]];for(const Ce of ae)if(Ce&&(Ce(L,K),K.isMatchIgnored))return sn(R);return U.skip?W+=R:(U.excludeBegin&&(W+=R),z(),!U.returnBegin&&!U.excludeBegin&&(W=R)),xe(U,L),U.returnBegin?0:R.length}function Rt(L){const R=L[0],U=C.substring(L.index),K=Lt(P,L,U);if(!K)return vo;const ae=P;P.endScope&&P.endScope._wrap?(z(),Ae(R,P.endScope._wrap)):P.endScope&&P.endScope._multi?(z(),rn(P.endScope,L)):ae.skip?W+=R:(ae.returnEnd||ae.excludeEnd||(W+=R),z(),ae.excludeEnd&&(W=R));do{P.scope&&se.closeNode(),!P.skip&&!P.subLanguage&&(lt+=P.relevance),P=P.parent}while(P!==K.parent);return K.starts&&xe(K.starts,L),ae.returnEnd?0:R.length}function an(){const L=[];for(let R=P;R!==Ee;R=R.parent)R.scope&&L.unshift(R.scope);L.forEach((R=>se.openNode(R)))}let Ye={};function kt(L,R){const U=R&&R[0];if(W+=L,U==null)return z(),0;if(Ye.type==="begin"&&R.type==="end"&&Ye.index===R.index&&U===""){if(W+=C.slice(R.index,R.index+1),!s){const K=new Error(`0 width match regex (${x})`);throw K.languageName=x,K.badRule=Ye.rule,K}return 1}if(Ye=R,R.type==="begin")return It(R);if(R.type==="illegal"&&!$){const K=new Error('Illegal lexeme "'+U+'" for mode "'+(P.scope||"<unnamed>")+'"');throw K.mode=P,K}else if(R.type==="end"){const K=Rt(R);if(K!==vo)return K}if(R.type==="illegal"&&U==="")return 1;if(Qe>1e5&&Qe>R.index*3)throw new Error("potential infinite loop, way more iterations than matches");return W+=U,U.length}const Ee=Q(x);if(!Ee)throw Kt(i.replace("{}",x)),new Error('Unknown language: "'+x+'"');const on=Yb(Ee);let Mt="",P=I||on;const ot={},se=new o.__emitter(o);an();let W="",lt=0,fe=0,Qe=0,Dt=!1;try{if(Ee.__emitTokens)Ee.__emitTokens(C,se);else{for(P.matcher.considerAll();;){Qe++,Dt?Dt=!1:P.matcher.considerAll(),P.matcher.lastIndex=fe;const L=P.matcher.exec(C);if(!L)break;const R=C.substring(fe,L.index),U=kt(R,L);fe=L.index+U}kt(C.substring(fe))}return se.finalize(),Mt=se.toHTML(),{language:x,value:Mt,relevance:lt,illegal:!1,_emitter:se,_top:P}}catch(L){if(L.message&&L.message.includes("Illegal"))return{language:x,value:si(C),illegal:!0,relevance:0,_illegalBy:{message:L.message,index:fe,context:C.slice(fe-100,fe+100),mode:L.mode,resultSoFar:Mt},_emitter:se};if(s)return{language:x,value:si(C),illegal:!1,relevance:0,errorRaised:L,_emitter:se,_top:P};throw L}}function f(x){const C={value:si(x),illegal:!1,relevance:0,_top:a,_emitter:new o.__emitter(o)};return C._emitter.addText(x),C}function g(x,C){C=C||o.languages||Object.keys(e);const $=f(x),I=C.filter(Q).filter(ge).map((z=>p(z,x,!1)));I.unshift($);const G=I.sort(((z,Ae)=>{if(z.relevance!==Ae.relevance)return Ae.relevance-z.relevance;if(z.language&&Ae.language){if(Q(z.language).supersetOf===Ae.language)return 1;if(Q(Ae.language).supersetOf===z.language)return-1}return 0})),[re,X]=G,at=re;return at.secondBest=X,at}function m(x,C,$){const I=C&&t[C]||$;x.classList.add("hljs"),x.classList.add(`language-${I}`)}function E(x){let C=null;const $=u(x);if(c($))return;if(ce("before:highlightElement",{el:x,language:$}),x.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",x);return}if(x.children.length>0&&(o.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(x)),o.throwUnescapedHTML))throw new Jb("One of your code blocks includes unescaped HTML.",x.innerHTML);C=x;const I=C.textContent,G=$?h(I,{language:$,ignoreIllegals:!0}):g(I);x.innerHTML=G.value,x.dataset.highlighted="yes",m(x,$,G.language),x.result={language:G.language,re:G.relevance,relevance:G.relevance},G.secondBest&&(x.secondBest={language:G.secondBest.language,relevance:G.secondBest.relevance}),ce("after:highlightElement",{el:x,result:G,text:I})}function y(x){o=_o(o,x)}const _=()=>{v(),mn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function A(){v(),mn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let w=!1;function v(){if(document.readyState==="loading"){w=!0;return}document.querySelectorAll(o.cssSelector).forEach(E)}function S(){w&&v()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",S,!1);function O(x,C){let $=null;try{$=C(n)}catch(I){if(Kt("Language definition for '{}' could not be registered.".replace("{}",x)),s)Kt(I);else throw I;$=a}$.name||($.name=x),e[x]=$,$.rawDefinition=C.bind(null,n),$.aliases&&ne($.aliases,{languageName:x})}function B(x){delete e[x];for(const C of Object.keys(t))t[C]===x&&delete t[C]}function H(){return Object.keys(e)}function Q(x){return x=(x||"").toLowerCase(),e[x]||e[t[x]]}function ne(x,{languageName:C}){typeof x=="string"&&(x=[x]),x.forEach(($=>{t[$.toLowerCase()]=C}))}function ge(x){const C=Q(x);return C&&!C.disableAutodetect}function Te(x){x["before:highlightBlock"]&&!x["before:highlightElement"]&&(x["before:highlightElement"]=C=>{x["before:highlightBlock"](Object.assign({block:C.el},C))}),x["after:highlightBlock"]&&!x["after:highlightElement"]&&(x["after:highlightElement"]=C=>{x["after:highlightBlock"](Object.assign({block:C.el},C))})}function le(x){Te(x),r.push(x)}function ie(x){const C=r.indexOf(x);C!==-1&&r.splice(C,1)}function ce(x,C){const $=x;r.forEach((function(I){I[$]&&I[$](C)}))}function Pe(x){return mn("10.7.0","highlightBlock will be removed entirely in v12.0"),mn("10.7.0","Please use highlightElement now."),E(x)}Object.assign(n,{highlight:h,highlightAuto:g,highlightAll:v,highlightElement:E,highlightBlock:Pe,configure:y,initHighlighting:_,initHighlightingOnLoad:A,registerLanguage:O,unregisterLanguage:B,listLanguages:H,getLanguage:Q,registerAliases:ne,autoDetection:ge,inherit:_o,addPlugin:le,removePlugin:ie}),n.debugMode=function(){s=!1},n.safeMode=function(){s=!0},n.versionString=Xb,n.regex={concat:nn,lookahead:Hl,either:sa,optional:gb,anyNumberOfTimes:fb};for(const x in Mr)typeof Mr[x]=="object"&&Ul(Mr[x]);return Object.assign(n,Mr),n},Ln=Ql({});Ln.newInstance=()=>Ql({});var t1=Ln;Ln.HighlightJS=Ln;Ln.default=Ln;const he=Fi(t1);function n1(n){const e=n.regex,t={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[n.BACKSLASH_ESCAPE]},i=n.inherit(n.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[n.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,t,s]};s.contains.push(o);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},h={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},n.NUMBER_MODE,t]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],g=n.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[n.inherit(n.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},E=["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],y=["true","false"],_={match:/(\/[a-z._-]+)+/},A=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],w=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],v=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],S=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:E,literal:y,built_in:[...A,...w,"set","shopt",...v,...S]},contains:[g,n.SHEBANG(),m,p,i,a,_,o,c,u,h,t]}}function r1(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",a="("+r+"|"+e.optional(s)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",o={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},h={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(s)+n.IDENT_RE,relevance:0},g=e.optional(s)+n.IDENT_RE+"\\s*\\(",y={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},_=[p,o,t,n.C_BLOCK_COMMENT_MODE,h,u],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:y,contains:_.concat([{begin:/\(/,end:/\)/,keywords:y,contains:_.concat(["self"]),relevance:0}]),relevance:0},w={begin:"("+a+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:y,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:y,relevance:0},{begin:g,returnBegin:!0,contains:[n.inherit(f,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,u,h,o,{begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,u,h,o]}]},o,t,n.C_BLOCK_COMMENT_MODE,p]};return{name:"C",aliases:["h"],keywords:y,disableAutodetect:!0,illegal:"</",contains:[].concat(A,w,_,[p,{begin:n.IDENT_RE+"::",keywords:y},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},n.TITLE_MODE]}]),exports:{preprocessor:p,strings:u,keywords:y}}}function s1(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+e.optional(s)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},h={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(s)+n.IDENT_RE,relevance:0},g=e.optional(s)+n.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],E=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],_=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],v={type:E,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},S={className:"function.dispatch",relevance:0,keywords:{_hint:_},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,n.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},O=[S,p,o,t,n.C_BLOCK_COMMENT_MODE,h,u],B={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:O.concat([{begin:/\(/,end:/\)/,keywords:v,contains:O.concat(["self"]),relevance:0}]),relevance:0},H={className:"function",begin:"("+a+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:v,relevance:0},{begin:g,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,h]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,u,h,o,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,u,h,o]}]},o,t,n.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:v,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(B,H,S,O,[p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:v,contains:["self",o]},{begin:n.IDENT_RE+"::",keywords:v},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function i1(n){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],t=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],s=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],i=["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:s.concat(i),built_in:e,literal:r},o=n.inherit(n.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},h={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=n.inherit(h,{illegal:/\n/}),f={className:"subst",begin:/\{/,end:/\}/,keywords:a},g=n.inherit(f,{illegal:/\n/}),m={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},n.BACKSLASH_ESCAPE,g]},E={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]},y=n.inherit(E,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},g]});f.contains=[E,m,h,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,c,n.C_BLOCK_COMMENT_MODE],g.contains=[y,m,p,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,c,n.inherit(n.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const _={variants:[u,E,m,h,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},A={begin:"<",end:">",contains:[{beginKeywords:"in out"},o]},w=n.IDENT_RE+"(<"+n.IDENT_RE+"(\\s*,\\s*"+n.IDENT_RE+")*>)?(\\[\\])?",v={begin:"@"+n.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[n.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:"</?",end:">"}]}]}),n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},_,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,A,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,A,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+w+"\\s+)+"+n.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:t.join(" "),relevance:0},{begin:n.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[n.TITLE_MODE,A],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[_,c,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},v]}}const a1=n=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:n.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),o1=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],l1=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],c1=[...o1,...l1],u1=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),d1=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),h1=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),f1=["accent-color","align-content","align-items","align-self","alignment-baseline","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-end-end-radius","border-end-start-radius","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","cx","cy","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","empty-cells","enable-background","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","flood-color","flood-opacity","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","kerning","justify-content","justify-items","justify-self","left","letter-spacing","lighting-color","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","marker","marker-end","marker-mid","marker-start","mask","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","scale","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","speak","speak-as","src","tab-size","table-layout","text-anchor","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-offset","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","vector-effect","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index"].sort().reverse();function g1(n){const e=n.regex,t=a1(n),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",i=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",o=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,r,t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+d1.join("|")+")"},{begin:":(:)?("+h1.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+f1.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...o,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...o,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:u1.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+c1.join("|")+")\\b"}]}}var Nn="[0-9](_*[0-9])*",Dr=`\\.(${Nn})`,Br="[0-9a-fA-F](_*[0-9a-fA-F])*",No={className:"number",variants:[{begin:`(\\b(${Nn})((${Dr})|\\.)?|(${Dr}))[eE][+-]?(${Nn})[fFdD]?\\b`},{begin:`\\b(${Nn})((${Dr})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Dr})[fFdD]?\\b`},{begin:`\\b(${Nn})[fFdD]\\b`},{begin:`\\b0[xX]((${Br})\\.?|(${Br})?\\.(${Br}))[pP][+-]?(${Nn})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Br})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Xl(n,e,t){return t===-1?"":n.replace(e,(r=>Xl(n,e,t-1)))}function p1(n){const e=n.regex,t="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=t+Xl("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+t,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},h={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[n.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[n.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[n.BACKSLASH_ESCAPE]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,t],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,t),/\s+/,t,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,t],className:{1:"keyword",3:"title.class"},contains:[h,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",n.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,No,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},No,u]}}const To="[A-Za-z$_][0-9A-Za-z$_]*",m1=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],b1=["true","false","null","undefined","NaN","Infinity"],Jl=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ec=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],tc=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],E1=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],y1=[].concat(tc,Jl,ec);function _1(n){const e=n.regex,t=(C,{after:$})=>{const I="</"+C[0].slice(1);return C.input.indexOf(I,$)!==-1},r=To,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(C,$)=>{const I=C[0].length+C.index,G=C.input[I];if(G==="<"||G===","){$.ignoreMatch();return}G===">"&&(t(C,{after:I})||$.ignoreMatch());let re;const X=C.input.substring(I);if(re=X.match(/^\s*=/)){$.ignoreMatch();return}if((re=X.match(/^\s+extends\s+/))&&re.index===0){$.ignoreMatch();return}}},o={$pattern:To,keyword:m1,literal:b1,built_in:y1,"variable.language":E1},c="[0-9](_?[0-9])*",u=`\\.(${c})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${h})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${h})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,f]},A={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},w=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,m,E,y,{match:/\$\d+/},p];f.contains=w.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(w)});const v=[].concat(A,f.contains),S=v.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(v)}]),O={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:S},B={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},H={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Jl,...ec]}},Q={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ne={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},ge={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Te(C){return e.concat("(?!",C.join("|"),")")}const le={match:e.concat(/\b/,Te([...tc,"super","import"].map((C=>`${C}\\s*\\(`))),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ce={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},Pe="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",x={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(Pe)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:H},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),Q,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,m,E,y,A,{match:/\$\d+/},p,H,{className:"attr",begin:r+e.lookahead(":"),relevance:0},x,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,n.REGEXP_MODE,{className:"function",begin:Pe,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},ne,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},le,ge,B,ce,{match:/\$[(.]/}]}}function v1(n){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},t={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[e,t,n.QUOTE_STRING_MODE,s,n.C_NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function N1(n){const e=n.regex,t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},s={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},o=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,o,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=n.inherit(u,{contains:[]}),f=n.inherit(h,{contains:[]});u.contains.push(f),h.contains.push(p);let g=[t,c];return[u,h,p,f].forEach((_=>{_.contains=_.contains.concat(g)})),g=g.concat(u,h),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:g},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:g}]}]},t,i,u,h,{className:"quote",begin:"^>\\s+",contains:g,end:"$"},s,r,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function T1(n){const e=n.regex,t=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,t),s=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,t),i={scope:"variable",match:"\\$+"+r},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},o={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=n.inherit(n.APOS_STRING_MODE,{illegal:null}),u=n.inherit(n.QUOTE_STRING_MODE,{illegal:null,contains:n.QUOTE_STRING_MODE.contains.concat(o)}),h={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:n.QUOTE_STRING_MODE.contains.concat(o),"on:begin":(le,ie)=>{ie.data._beginMatch=le[1]||le[2]},"on:end":(le,ie)=>{ie.data._beginMatch!==le[1]&&ie.ignoreMatch()}},p=n.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),f=`[ \t\n]`,g={scope:"string",variants:[u,c,h,p]},m={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},E=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],_=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],w={keyword:y,literal:(le=>{const ie=[];return le.forEach((ce=>{ie.push(ce),ce.toLowerCase()===ce?ie.push(ce.toUpperCase()):ie.push(ce.toLowerCase())})),ie})(E),built_in:_},v=le=>le.map((ie=>ie.replace(/\|\d+$/,""))),S={variants:[{match:[/new/,e.concat(f,"+"),e.concat("(?!",v(_).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},O=e.concat(r,"\\b(?!\\()"),B={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),O],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,e.concat(/::/,e.lookahead(/(?!class\b)/)),O],scope:{1:"title.class",3:"variable.constant"}},{match:[s,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},H={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},Q={relevance:0,begin:/\(/,end:/\)/,keywords:w,contains:[H,i,B,n.C_BLOCK_COMMENT_MODE,g,m,S]},ne={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",v(y).join("\\b|"),"|",v(_).join("\\b|"),"\\b)"),r,e.concat(f,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[Q]};Q.contains.push(ne);const ge=[H,B,n.C_BLOCK_COMMENT_MODE,g,m,S],Te={begin:e.concat(/#\[\s*/,s),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:E,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:E,keyword:["new","array"]},contains:["self",...ge]},...ge,{scope:"meta",match:s}]};return{case_insensitive:!1,keywords:w,contains:[Te,n.HASH_COMMENT_MODE,n.COMMENT("//","$"),n.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:n.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},i,ne,B,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},S,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},n.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:w,contains:["self",i,B,n.C_BLOCK_COMMENT_MODE,g,m]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},n.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[n.inherit(n.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},n.UNDERSCORE_TITLE_MODE]},g,m]}}function A1(n){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function w1(n){const e=n.regex,t=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},h={begin:/\{\{/,relevance:0},p={className:"string",contains:[n.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,c,h,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,c,h,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[n.BACKSLASH_ESCAPE,h,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,h,u]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",g=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,m=`\\b|${r.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${g}))[eE][+-]?(${f})[jJ]?(?=${m})`},{begin:`(${g})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${f})[jJ](?=${m})`}]},y={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},_={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",c,E,p,n.HASH_COMMENT_MODE]}]};return u.contains=[p,E,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[c,E,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,y,n.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[_]},{variants:[{match:[/\bclass/,/\s+/,t,/\s*/,/\(\s*/,t,/\s*\)/]},{match:[/\bclass/,/\s+/,t]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[E,_,p]}]}}function S1(n){const e=n.regex,t="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),s=e.concat(r,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[n.COMMENT("#","$",{contains:[o]}),n.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),n.COMMENT("^__END__",n.MATCH_NOTHING_RE)],h={className:"subst",begin:/#\{/,end:/\}/,keywords:a},p={className:"string",contains:[n.BACKSLASH_ESCAPE,h],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[n.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[n.BACKSLASH_ESCAPE,h]})]}]},f="[1-9](_?[0-9])*|0",g="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b(${f})(\\.(${g}))?([eE][+-]?(${g})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},E={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},O=[p,{variants:[{match:[/class\s+/,s,/\s+<\s+/,s]},{match:[/\b(class|module)\s+/,s]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,s],scope:{2:"title.class"},keywords:a},{relevance:0,match:[s,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[E]},{begin:n.IDENT_RE+"::"},{className:"symbol",begin:n.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:t}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+n.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[n.BACKSLASH_ESCAPE,h],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);h.contains=O,E.contains=O;const ne=[{begin:/^\s*=>/,starts:{end:"$",contains:O}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:O}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[n.SHEBANG({binary:"ruby"})].concat(ne).concat(u).concat(O)}}function O1(n){const e=n.regex,t=/(r#)?/,r=e.concat(t,n.UNDERSCORE_IDENT_RE),s=e.concat(t,n.IDENT_RE),i={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,s,e.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",o=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],h=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:n.IDENT_RE+"!?",type:h,keyword:o,literal:c,built_in:u},illegal:"</",contains:[n.C_LINE_COMMENT_MODE,n.COMMENT("/\\*","\\*/",{contains:["self"]}),n.inherit(n.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+a},{begin:"\\b0o([0-7_]+)"+a},{begin:"\\b0x([A-Fa-f0-9_]+)"+a},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+a}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:n.IDENT_RE+"::",keywords:{keyword:"Self",built_in:u,type:h}},{className:"punctuation",begin:"->"},i]}}function x1(n){const e=n.regex,t=n.COMMENT("--","$"),r={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},s={begin:/"/,end:/"/,contains:[{begin:/""/}]},i=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],h=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],p=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],g=h,m=[...u,...c].filter((w=>!h.includes(w))),E={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},y={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={begin:e.concat(/\b/,e.either(...g),/\s*\(/),relevance:0,keywords:{built_in:g}};function A(w,{exceptions:v,when:S}={}){const O=S;return v=v||[],w.map((B=>B.match(/\|\d+$/)||v.includes(B)?B:O(B)?`${B}|0`:B))}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(m,{when:w=>w.length<3}),literal:i,type:o,built_in:p},contains:[{begin:e.either(...f),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:m.concat(f),literal:i,type:o}},{className:"type",begin:e.either(...a)},_,E,r,s,n.C_NUMBER_MODE,n.C_BLOCK_COMMENT_MODE,t,y]}}const Zr="[A-Za-z$_][0-9A-Za-z$_]*",nc=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],rc=["true","false","null","undefined","NaN","Infinity"],sc=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ic=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ac=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],oc=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],lc=[].concat(ac,sc,ic);function C1(n){const e=n.regex,t=(C,{after:$})=>{const I="</"+C[0].slice(1);return C.input.indexOf(I,$)!==-1},r=Zr,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(C,$)=>{const I=C[0].length+C.index,G=C.input[I];if(G==="<"||G===","){$.ignoreMatch();return}G===">"&&(t(C,{after:I})||$.ignoreMatch());let re;const X=C.input.substring(I);if(re=X.match(/^\s*=/)){$.ignoreMatch();return}if((re=X.match(/^\s+extends\s+/))&&re.index===0){$.ignoreMatch();return}}},o={$pattern:Zr,keyword:nc,literal:rc,built_in:lc,"variable.language":oc},c="[0-9](_?[0-9])*",u=`\\.(${c})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${h})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${h})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,f]},A={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},w=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,m,E,y,{match:/\$\d+/},p];f.contains=w.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(w)});const v=[].concat(A,f.contains),S=v.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(v)}]),O={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:S},B={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},H={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...sc,...ic]}},Q={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ne={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},ge={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Te(C){return e.concat("(?!",C.join("|"),")")}const le={match:e.concat(/\b/,Te([...ac,"super","import"].map((C=>`${C}\\s*\\(`))),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ce={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},Pe="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",x={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(Pe)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:H},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),Q,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,m,E,y,A,{match:/\$\d+/},p,H,{className:"attr",begin:r+e.lookahead(":"),relevance:0},x,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,n.REGEXP_MODE,{className:"function",begin:Pe,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},ne,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},le,ge,B,ce,{match:/\$[(.]/}]}}function L1(n){const e=C1(n),t=Zr,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,n.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},i={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[e.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},o=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:Zr,keyword:nc.concat(o),literal:rc,built_in:lc.concat(r),"variable.language":oc},u={className:"meta",begin:"@"+t},h=(g,m,E)=>{const y=g.contains.findIndex((_=>_.label===m));if(y===-1)throw new Error("can not find mode to replace");g.contains.splice(y,1,E)};Object.assign(e.keywords,c),e.exports.PARAMS_CONTAINS.push(u);const p=e.contains.find((g=>g.className==="attr"));e.exports.PARAMS_CONTAINS.push([e.exports.CLASS_REFERENCE,p]),e.contains=e.contains.concat([u,s,i]),h(e,"shebang",n.SHEBANG()),h(e,"use_strict",a);const f=e.contains.find((g=>g.label==="func.def"));return f.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}function I1(n){const e=n.regex,t=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=n.inherit(i,{begin:/\(/,end:/\)/}),o=n.inherit(n.APOS_STRING_MODE,{className:"string"}),c=n.inherit(n.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[s]},{begin:/'/,end:/'/,contains:[s]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,c,o,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,a,c,o]}]}]},n.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(t,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:u}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function R1(n){const e="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/\w[\w :()\./-]*:(?=[ \t]|$)/},{begin:/"\w[\w :()\./-]*":(?=[ \t]|$)/},{begin:/'\w[\w :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[n.BACKSLASH_ESCAPE,s]},a=n.inherit(i,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),p={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},f={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},g={begin:/\{/,end:/\}/,contains:[f],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[f],illegal:"\\n",relevance:0},E=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type",begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t},{className:"meta",begin:"&"+n.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+n.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},n.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},p,{className:"number",begin:n.C_NUMBER_RE+"\\b",relevance:0},g,m,i],y=[...E];return y.pop(),y.push(a),f.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:E}}he.registerLanguage("bash",n1);he.registerLanguage("c",r1);he.registerLanguage("cpp",s1);he.registerLanguage("cs",i1);he.registerLanguage("css",g1);he.registerLanguage("java",p1);he.registerLanguage("javascript",_1);he.registerLanguage("json",v1);he.registerLanguage("markdown",N1);he.registerLanguage("plain",A1);he.registerLanguage("php",T1);he.registerLanguage("python",w1);he.registerLanguage("sql",x1);he.registerLanguage("typescript",L1);he.registerLanguage("ruby",S1);he.registerLanguage("rust",O1);he.registerLanguage("xml",I1);he.registerLanguage("yaml",R1);const k1=[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"c",label:"C"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"json",label:"JSON"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"sql",label:"SQL"},{key:"typescript",label:"TypeScript"},{key:"ruby",label:"Ruby"},{key:"rust",label:"Rust"},{key:"xml",label:"HTML/XML"},{key:"yaml",label:"YAML"}];var M1=ee("<button type=button><span class=QpTooltip-text>");function Ao({children:n,btnClass:e,tooltipText:t,btnText:r}){return(()=>{var s=M1(),i=s.firstChild;return ai(s,`QpTooltip ${e}`),Y(s,n,i),Y(s,r,i),Y(i,t),s})()}var D1=ee("<button type=button class=ql-code>"),B1=ee("<button type=button class=ql-code-block>"),q1=ee('<span class="pi pi-hashtag">'),$1=ee('<span class="pi pi-pencil">'),P1=ee('<div><select class=ql-header><option value=2></option><option value=3></option><option value=4></option><option value=""selected></option></select><button type=button class=ql-bold></button><button type=button class=ql-italic></button><button type=button class=ql-strike></button><button type=button class=ql-blockquote></button><button type=button class=ql-list value=ordered></button><button type=button class=ql-list value=bullet></button><button type=button class=ql-link></button><select class=ql-align><option value=""selected></option><option value=center></option><option value=right></option></select><select class=ql-size><option value=small></option><option value=""selected></option><option value=large></option><option value=huge></option></select><button type=button class=ql-clean>');function U1({language:n,configuration:e}){const{t:t}=tn(n),r=[D1(),(()=>{var s=B1();return s.style.setProperty("border","1px dotted #999"),s})()];return(()=>{var s=P1(),i=s.firstChild,a=i.nextSibling,o=a.nextSibling,c=o.nextSibling,u=c.nextSibling,h=u.nextSibling,p=h.nextSibling,f=p.nextSibling,g=f.nextSibling,m=g.nextSibling,E=m.nextSibling;return Y(s,(()=>e?.code&&r),g),Y(s,Tn(Ao,{btnClass:"ql-html-snippet",get tooltipText(){return t("CustomToolbar.insertHtmlSnippetMessage")},get children(){return q1()}}),E),Y(s,Tn(Ao,{btnClass:"ql-obfuscate",get tooltipText(){return t("CustomToolbar.obfuscate")},get children(){return $1()}}),E),s})()}var F1=ee("<div>"),H1=ee("<div class=QuillEditor>");function z1({onSetQuillInst:n,language:e,setValue:t,value:r,service:s,insertMedia:i}){const{t:a}=tn(e),o=s.configuration,u=s.fieldType.backOffice?.editorRows??26,h=U1({language:e,configuration:o}),p=F1();async function f(g,m){if(!s.uploadMedia)return;const E=m.toBlob(),y=new File([E],`${a("image")}-${(new Date).getTime()}.${g.split("/")[1]}`,{type:g}),_=await s.uploadMedia(y);_&&i(_)}return bc((()=>{N.register("modules/imageDropAndPaste",as,!0);const g=new N(p,{modules:{toolbar:h,syntax:o.code?{hljs:he,languages:k1,interval:1e3}:!1,imageDropAndPaste:{handler:(E,y,_)=>{f(y,_).catch(s.logger.error)}}},theme:"snow"});n(g),g.on("text-change",((E,y)=>{const _={delta:g.getContents(),html:g.getSemanticHTML()};t(_),s.onChange(_)}));const m=r();m&&g.setContents(m.delta??new k)})),(()=>{var g=H1();return`calc(${u}rem + 42px + 24px)`!=null?g.style.setProperty("height",`calc(${u}rem + 42px + 24px)`):g.style.removeProperty("height"),Y(g,h,null),Y(g,p,null),g})()}function Wr(n){return n.varName?` for '${n.varName}'`:""}function K1(n){return!isNaN(n)&&!isNaN(parseFloat(n))}function G1(n,e={}){if(n==null||n===""&&!e.allowEmpty)throw new Error(`Missing string value${Wr(e)}`);return typeof n=="string"?n:n.toString()}function j1(n,e={}){return n==null||n===""&&!e.allowEmpty?void 0:G1(n,e)}function Z1(n,e={}){if(typeof n=="number")return n;if(n==null)throw new Error(`Missing number value${Wr(e)}`);if(typeof n=="string"&&K1(n))return Number(n);throw new Error(`Cannot convert to number the value of type '${typeof n}'${Wr(e)}`)}function wo(n,e={}){return n==null?void 0:Z1(n,e)}function W1(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function V1(n,e={}){if(W1(n))return n;const t=n===null?"null":Array.isArray(n)?"array":typeof n;throw new Error(`invalid object value '${t}'${Wr(e)}`)}function So(n){if(n===void 0)return{};const e=V1(n);return{handle:j1(e.handle),delta:e.delta}}var Y1=ee('<textarea autofocus class="QpInput QpHtmlSnippetInput"rows=8 cols=80>'),cc=ee('<button class="QpBtn secondary"type=button>'),Q1=ee("<button class=QpBtn type=button>"),X1=ee('<button class="QpBtn danger outlined"type=button>'),J1=ee("<p>"),e0=ee('<button class="QpBtn danger"type=button>');function uc({createModalDialog:n,language:e,mode:t,html:r}){return new Promise((s=>{const{t:i}=tn(e),[a,o]=tt(r??""),c=()=>{s({action:"remove"}),u.hide()},u=n({content:(()=>{var h=Y1();return h.addEventListener("change",(p=>o(p.target.value))),An((()=>h.value=a())),h})(),footer:[t==="update"&&(()=>{var h=X1();return h.$$click=()=>{t0({deleteSnippet:c,closeDialog:()=>{s(void 0),u.hide()},language:e,createModalDialog:n})},Y(h,(()=>i("delete"))),h})(),(()=>{var h=cc();return h.$$click=()=>{s(void 0),u.hide()},Y(h,(()=>i("cancel"))),h})(),(()=>{var h=Q1();return h.$$click=()=>{s({action:t,values:{html:a()}}),u.hide()},Y(h,(()=>i("validate"))),h})()],header:i("htmlSnippetLabel")});u.show()}))}function t0({closeDialog:n,deleteSnippet:e,language:t,createModalDialog:r}){const{t:s}=tn(t),i=r({header:s("confirmDeletion"),content:(()=>{var a=J1();return Y(a,(()=>s("comfirmSnippetDeletionDialog.content"))),a})(),footer:[(()=>{var a=cc();return a.$$click=()=>{i.hide()},Y(a,(()=>s("cancel"))),a})(),(()=>{var a=e0();return a.$$click=()=>{i.hide(),e()},Y(a,(()=>s("validate"))),a})()]});i.show()}xi(["click"]);var n0=ee("<div class=QpSpinner>");function r0(){return n0()}var s0=ee('<button class="QpBtn outlined danger"type=button>'),i0=ee("<button class=QpBtn type=button>"),ii=ee("<h2 class=FieldLabel>"),Oo=ee("<div class=QpOption>"),a0=ee("<div><label><input type=checkbox name=enableZoom>"),o0=ee("<button type=button> <small class=ml-1>(<!>)"),l0=ee("<button type=button>");function c0({language:n,imageUid:e,themeConf:t,service:r,...s}){return new Promise((i=>{const{t:a}=tn(n),[o,c]=tt(!1),[u,h]=tt(),[p,f]=tt(),[g,m]=tt(s.zoom),E=oi((()=>t.fTextImages.map(((v,S)=>({size:v,label:a("makeImagePropertiesDialog.variantLabel",{n:S+1})})))),[t,n()]),y=oi((()=>[{align:"left",label:a("makeImagePropertiesDialog.left")},{align:"center",label:a("makeImagePropertiesDialog.center")},{align:"right",label:a("makeImagePropertiesDialog.right")}]),[n()]),_=async()=>{const v=u();if(!e||!v)throw new Error("missing a find variant name");c(!0);const{url:S,displayWidth:O,displayHeight:B}=await r.useImage(e,v.displaySize);c(!1),w.hide(),i({action:"update",values:{uid:e,src:S,align:p(),variant:v.displaySize,width:O,height:B,zoom:g()?void 0:"none"}})};li((()=>{s.align&&f(s.align)})),li((()=>{if(s.imageSize){const v=E().find((S=>S.size.displaySize===s.imageSize));v&&h(v.size)}}));let A=Tn(r0,{});o()||(A=[(()=>{var v=s0();return v.$$click=()=>{w.hide(),i({action:"remove"})},Y(v,(()=>a("remove"))),v})(),(()=>{var v=i0();return v.$$click=_,v.disabled=!e||p===void 0||u===void 0,Y(v,(()=>a("validate"))),v})()]);const w=r.createModalDialog({header:a("makeImagePropertiesDialog.imageProperties"),content:[(()=>{var v=ii();return Y(v,(()=>a("makeImagePropertiesDialog.sizes"))),v})(),(()=>{var v=Oo();return Y(v,Tn(da,{get each(){return E()},children:S=>(()=>{var O=o0(),B=O.firstChild,H=B.nextSibling,Q=H.firstChild,ne=Q.nextSibling;return ne.nextSibling,O.$$click=()=>h(S.size),O.disabled=!e,Y(O,(()=>S.label),B),Y(H,(()=>S.size.displaySize),ne),An((()=>ai(O,`QpBtn secondary ${S.size.displaySize!==u()?.displaySize?"outlined":""}`))),O})()})),v})(),(()=>{var v=ii();return Y(v,(()=>a("makeImagePropertiesDialog.alignment"))),v})(),(()=>{var v=Oo();return Y(v,Tn(da,{get each(){return y()},children:S=>(()=>{var O=l0();return O.$$click=()=>f(S.align),O.disabled=!e,Y(O,(()=>S.label)),An((()=>ai(O,`QpBtn secondary ${S.align!==p()?"outlined":""}`))),O})()})),v})(),(()=>{var v=ii();return Y(v,(()=>a("makeImagePropertiesDialog.options"))),v})(),(()=>{var v=a0(),S=v.firstChild,O=S.firstChild;return O.addEventListener("change",(()=>{m(!g())})),Y(S,(()=>a("makeImagePropertiesDialog.enableZoom")),null),An((()=>O.checked=g())),v})()],footer:A});w.show()}))}xi(["click"]);function dc(n){return u0(n)||oa(n)}function oa(n){return!!n.match(/^[a-zA-Z0-9. _-]+@[a-zA-Z0-9. -]+\.[a-zA-Z]{2,4}$/g)}function u0(n){return!!n.match(/^(\+|00)[1-9][0-9 \-\(\)\.]{7,32}$/)}function d0(n){return dc(n)?oa(n)?"mailto":"tel":"raw"}function hc(n){if(n==="raw")return"raw";if(n==="mailto")return"mailto";if(n==="tel")return"tel";throw new Error(`invalid link-type '${n}'`)}var h0=ee("<label class=ObfuscatorDialog-label><input type=text class=ml-2>"),f0=ee('<label class="ObfuscatorDialog-label mt-4"><input type=checkbox name=asALink class=mr-2>'),g0=ee('<button class="QpBtn danger outlined"type=button>'),p0=ee("<button class=QpBtn type=button>");function m0({createModalDialog:n,language:e,value:t}){return new Promise((r=>{const{t:s}=tn(e),[i,a]=tt(t.asALink),[o,c]=tt(t.content),u=p=>{c(p),dc(p)?a(!0):a(!1)},h=n({header:s("openObfuscatorDialog.obfuscator"),content:[(()=>{var p=h0(),f=p.firstChild;return Y(p,(()=>s("openObfuscatorDialog.content")),f),f.$$input=g=>u(g.currentTarget.value),An((()=>f.value=o())),p})(),(()=>{var p=f0(),f=p.firstChild;return f.addEventListener("change",(()=>a(!i()))),Y(p,(()=>s("openObfuscatorDialog.asALink")),null),An((()=>f.checked=i())),p})()],footer:[(()=>{var p=g0();return p.$$click=()=>{r({action:"remove"}),h.hide()},Y(p,(()=>s("openObfuscatorDialog.doNotObfuscate"))),p})(),(()=>{var p=p0();return p.$$click=()=>{r({action:"update",content:o(),asALink:i()?oa(o())?"mailto":"tel":"raw"}),h.hide()},Y(p,(()=>s("done"))),p})()]});h.show()}))}xi(["input","click"]);function b0(n,{label:e,url:t}){let r=e??t;const s=n.getSelection();s&&s.length!==0&&(r=n.getText(s.index,s.length),n.deleteText(s.index,s.length)),n.insertText(la(n)??0,r,"link",t)}function fc({editor:n,values:e,service:t,index:r,language:s}){const{t:i}=tn(s),a=r??la(n);if(a===void 0){t.showToast(i("editorFocusLost"),{severity:"warn"});return}n.insertEmbed(a,"img",e)}function E0(n){const e=la(n)??0,[t]=n.getLeaf(e);if(!t)throw new Error("editor.getLeaf() returns undefined");return t.domNode}function gc({values:n,editor:e,index:t}){if(n.html===void 0)throw new Error("html is undefined");e.insertEmbed(t,"html-snippet",n);const[r]=e.getLeaf(t+1);if(!r)throw new Error("missing last inserted element");return r.domNode}function la(n){const e=n.getSelection();if(e!==null)return e.index+e.length}function y0(n){const{uid:e}=n.dataset;if(e)return e;const t=n.getAttribute("src");if(!t)return;const{pathname:r}=new URL(t),s=r.split("/"),a=s[s.length-1].match(/^([0-9a-f-]{36})\-([0-9]+x[0-9]+)\.([0-9a-z]+$)/);if(!a)return;const[,o]=a;return o}function _0(n){const e=pc(n);return{imageSize:n.dataset.variant,align:e}}function pc(n){const e=n.classList;if(e.contains("center"))return"center";if(e.contains("left"))return"left";if(e.contains("right"))return"right"}function v0(n){if(n==="center")return"center";if(n==="left")return"left";if(n==="right")return"right"}async function N0({editor:n,htmlSnippetBtn:e,service:t,language:r}){const s=e.dataset.html,i=await uc({createModalDialog:t.createModalDialog,html:s,mode:"update",language:r});i&&ca({editor:n,element:e,data:i,insertElementHandler:gc,service:t,language:r})}async function mc({obfuscatorSpan:n,service:e,language:t,editor:r}){const s=n.innerText,i=n.dataset.asALink?hc(n.dataset.asALink):void 0,a=await m0({createModalDialog:e.createModalDialog,language:t,value:{content:s,asALink:i?i!=="raw":!1}});if(!a)return;const o=N.find(n);if(!o||o instanceof N)throw new Error("missing embed blot");const c=r.getIndex(o);a.action==="remove"&&(o.remove(),r.insertText(c,s)),a.action==="update"&&(o.remove(),r.insertText(c,a.content??"",{obfuscate:a.asALink??"raw"}))}async function T0({element:n,editor:e,themeConf:t,service:r,language:s}){const i=y0(n),{align:a,imageSize:o}=_0(n),c=await c0({imageSize:o,align:a,imageUid:i,themeConf:t,width:wo(n.getAttribute("width")),height:wo(n.getAttribute("height")),zoom:n.dataset.zoom!=="none",service:r,language:s});c&&ca({editor:e,element:n,data:c,insertElementHandler:fc,service:r,language:s})}function A0({quillEditor:n,service:e,language:t}){const{themeConf:r,useImage:s}=e;return{insertHtmlSnippetHandler:async c=>{if(!n)return;const u=E0(n);await S0({editorContent:u,quillEditor:n,service:e,language:t})},insertMedia:async c=>{if(!n)return;if(!O0(c)){b0(n,{label:c.originalName,url:c.url});return}const u=r.fTextImages[0],{displaySize:h}=u,p="center",{url:f,displayWidth:g,displayHeight:m}=await s(c.uid,h);fc({editor:n,values:{uid:c.uid,src:f,width:g,height:m,variant:h,align:p},service:e,language:t})},insertObfuscateBlotHandler:()=>{if(!n)return;const c=n.getSelection();!c||c.length===0||w0({userSelection:c,quillEditor:n,service:e,language:t})}}}async function w0({userSelection:n,quillEditor:e,language:t,service:r}){const s=e.getText(n.index,n.length),i=d0(s);e.formatText(n,"obfuscate",i);const a=e.root.querySelectorAll("span.ObfuscateBlot");if(a.length===0)throw new Error("missing element 'span' with class 'ObfuscateBlot'");for(const o of a)if(o.innerText===s){await mc({obfuscatorSpan:o,service:r,language:t,editor:e});break}}async function S0({editorContent:n,quillEditor:e,service:t,language:r}){const s=await uc({createModalDialog:t.createModalDialog,language:r,mode:"insert"});s&&ca({editor:e,element:n,data:s,insertElementHandler:gc,service:t,language:r})}function ca({editor:n,element:e,data:{values:t,action:r},insertElementHandler:s,service:i,language:a}){const o=N.find(e);if(!o||o instanceof N)throw new Error("missing embed blot");const c=n.getIndex(o),u=new k;if(!(c===void 0||c===-1)){if(r==="insert"){if(!t)return;s({editor:n,values:t,service:i,index:c,language:a})}else if(r==="update"){if(!t)return;s({editor:n,values:t,service:i,index:c,language:a}),u.retain(c+1),u.delete(1)}else r==="remove"&&(u.retain(c),u.delete(1));n.updateContents(u)}}function O0(n){return"width"in n&&"height"in n}const x0=N.import("blots/block/embed");function C0(){return class extends x0{static blotName="html-snippet";static tagName="BUTTON";static className="HtmlSnippet";static create(e){const t=super.create(e);return t.innerText="<HTML>",e.html&&t.setAttribute("data-html",e.html),t}static value(e){const{html:t}=e.dataset;return{html:t}}}}const L0=N.import("blots/block/embed"),xo=["alt","height","width"];function I0({publicSiteUrl:n}){return class extends L0{static blotName="img";static tagName="img";static create(s){const i=super.create(s);if(s.src&&i.setAttribute("src",e(s.src)),s.width&&i.setAttribute("width",String(s.width)),s.height&&i.setAttribute("height",String(s.height)),i.classList.add("Img"),s.align){const a=v0(s.align);a&&i.classList.add(a)}return s.zoom==="none"&&i.setAttribute("data-zoom","none"),s.uid&&(i.setAttribute("data-uid",s.uid),s.variant&&i.setAttribute("data-variant",s.variant??"")),i}static formats(s){return xo.reduce(((i,a)=>(s.hasAttribute(a)&&(i[a]=s.getAttribute(a)),i)),{})}static match(s){return/\.(jpe?g|gif|png|webp)$/.test(s)||/^data:image\/.+;base64/.test(s)}static value(s){const{uid:i,variant:a}=s.dataset,o=s.getAttribute("src")||void 0,c=s.getAttribute("width")||void 0,u=c===void 0?void 0:Number(c),h=s.getAttribute("height")||void 0,p=h===void 0?void 0:Number(h),f=pc(s),g=s.dataset.zoom==="none"?"none":void 0;return i?{uid:i,src:o?t(o):void 0,width:u,height:p,align:f,variant:a,zoom:g}:{src:o,width:u,height:p,align:f,zoom:g}}format(s,i){xo.indexOf(s)>-1?i?this.domNode.setAttribute(s,i):this.domNode.removeAttribute(s):super.format(s,i)}};function e(r){return r.startsWith("/")?`${n}${r}`:R0(r)}function t(r){return r.startsWith(n)?r.substring(n.length):r}}function R0(n){return k0(n,["http","https","data"])?n:"//:0"}function k0(n,e){const t=document.createElement("a");t.href=n;const r=t.href.slice(0,t.href.indexOf(":"));return e.indexOf(r)>-1}const M0=N.import("blots/inline");function D0(){return class extends M0{static blotName="obfuscate";static tagName="SPAN";static className="ObfuscateBlot";static create(e){const t=super.create();return t.setAttribute("data-as-a-link",e),t}static formats(e){const{asALink:t}=e.dataset;if(!t)throw new Error("No data attribute data-as-a-link");return hc(t)}}}function B0({publicSiteUrl:n}){N.register("formats/img",I0({publicSiteUrl:n}),!0),N.register("formats/html-snippet",C0(),!0),N.register("formats/obfuscate",D0(),!0)}const X0={create:$0,init:q0};function q0(n){const e=`${n.pluginBaseUrl}/style.css`,t=document.createElement("link");t.rel="stylesheet",t.href=e,document.head.appendChild(t)}function $0(n){if(n.fieldType.dataType!=="quillDelta")throw new Error(`data type '${n.fieldType.dataType}' is incompatible, should be 'quillDelta'`);return Ec((e=>{const[t,r]=tt(So(n.value)),[s,i]=tt(n.language),[a,o]=tt(),c=n.onChange;B0({publicSiteUrl:n.publicSiteUrl});let u;li((()=>{if(!a())return;const p=A0({quillEditor:a(),service:n,language:s});u=p.insertMedia;const f=a();if(!f)return;const g=f.getModule("toolbar");g.addHandler("html-snippet",p.insertHtmlSnippetHandler),g.addHandler("obfuscate",p.insertObfuscateBlotHandler);const m=f.root,E=y=>h(y,f,n.themeConf);m.addEventListener("click",E),yc((()=>m.removeEventListener("click",E)))}));const h=async(p,f,g)=>{const m=p.target;m.tagName==="IMG"&&await T0({editor:f,themeConf:g,service:n,element:m,language:s}),m.tagName==="BUTTON"&&m.classList.contains("HtmlSnippet")&&await N0({language:s,editor:f,service:n,htmlSnippetBtn:m}),m.tagName==="SPAN"&&m.classList.contains("ObfuscateBlot")&&await mc({language:s,editor:f,service:n,obfuscatorSpan:m})};return{element:Tn(z1,{language:s,onSetQuillInst:p=>{o(p)},value:t,setValue:p=>{r(p),c(p)},service:n,insertMedia:p=>u?.(p)}),setValue:p=>r(So(p)),setLanguage:i,getValue:t,dispose:e,insertMedia:p=>u?.(p)}}))}export{X0 as default};
1
+ import{delegateEvents as Xr,effect as wn,insert as G,template as W,createComponent as Nt,className as di}from"https://esm.sh/solid-js@1.8.20/web";import{createMemo as hi,createSignal as je,createEffect as fi,For as ga,onMount as Ac,createRoot as wc,onCleanup as Sc}from"https://esm.sh/solid-js@1.8.20";var Io=typeof global=="object"&&global&&global.Object===Object&&global,xc=typeof self=="object"&&self&&self.Object===Object&&self,st=Io||xc||Function("return this")(),Ot=st.Symbol,Ro=Object.prototype,Oc=Ro.hasOwnProperty,Lc=Ro.toString,Vn=Ot?Ot.toStringTag:void 0;function Cc(n){var e=Oc.call(n,Vn),t=n[Vn];try{n[Vn]=void 0;var r=!0}catch{}var s=Lc.call(n);return r&&(e?n[Vn]=t:delete n[Vn]),s}var Ic=Object.prototype,Rc=Ic.toString;function kc(n){return Rc.call(n)}var Mc="[object Null]",Dc="[object Undefined]",pa=Ot?Ot.toStringTag:void 0;function Rn(n){return n==null?n===void 0?Dc:Mc:pa&&pa in Object(n)?Cc(n):kc(n)}function pt(n){return n!=null&&typeof n=="object"}var Zt=Array.isArray;function Lt(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function ko(n){return n}var Bc="[object AsyncFunction]",$c="[object Function]",qc="[object GeneratorFunction]",Pc="[object Proxy]";function Mi(n){if(!Lt(n))return!1;var e=Rn(n);return e==$c||e==qc||e==Bc||e==Pc}var Ys=st["__core-js_shared__"],ma=function(){var n=/[^.]+$/.exec(Ys&&Ys.keys&&Ys.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function Uc(n){return!!ma&&ma in n}var Fc=Function.prototype,Hc=Fc.toString;function Xt(n){if(n!=null){try{return Hc.call(n)}catch{}try{return n+""}catch{}}return""}var zc=/[\\^$.*+?()[\]{}|]/g,Kc=/^\[object .+?Constructor\]$/,Gc=Function.prototype,jc=Object.prototype,Vc=Gc.toString,Zc=jc.hasOwnProperty,Wc=RegExp("^"+Vc.call(Zc).replace(zc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Yc(n){if(!Lt(n)||Uc(n))return!1;var e=Mi(n)?Wc:Kc;return e.test(Xt(n))}function Qc(n,e){return n?.[e]}function Jt(n,e){var t=Qc(n,e);return Yc(t)?t:void 0}var gi=Jt(st,"WeakMap"),ba=Object.create,Xc=function(){function n(){}return function(e){if(!Lt(e))return{};if(ba)return ba(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();function Jc(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function Mo(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var eu=800,tu=16,nu=Date.now;function ru(n){var e=0,t=0;return function(){var r=nu(),s=tu-(r-t);if(t=r,s>0){if(++e>=eu)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function su(n){return function(){return n}}var Fr=function(){try{var n=Jt(Object,"defineProperty");return n({},"",{}),n}catch{}}(),iu=Fr?function(n,e){return Fr(n,"toString",{configurable:!0,enumerable:!1,value:su(e),writable:!0})}:ko,au=ru(iu);function ou(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var lu=9007199254740991,cu=/^(?:0|[1-9]\d*)$/;function Do(n,e){var t=typeof n;return e=e??lu,!!e&&(t=="number"||t!="symbol"&&cu.test(n))&&n>-1&&n%1==0&&n<e}function Di(n,e,t){e=="__proto__"&&Fr?Fr(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function lr(n,e){return n===e||n!==n&&e!==e}var uu=Object.prototype,du=uu.hasOwnProperty;function Bo(n,e,t){var r=n[e];(!(du.call(n,e)&&lr(r,t))||t===void 0&&!(e in n))&&Di(n,e,t)}function cr(n,e,t,r){var s=!t;t||(t={});for(var i=-1,a=e.length;++i<a;){var o=e[i],c=void 0;c===void 0&&(c=n[o]),s?Di(t,o,c):Bo(t,o,c)}return t}var Ea=Math.max;function hu(n,e,t){return e=Ea(e===void 0?n.length-1:e,0),function(){for(var r=arguments,s=-1,i=Ea(r.length-e,0),a=Array(i);++s<i;)a[s]=r[e+s];s=-1;for(var o=Array(e+1);++s<e;)o[s]=r[s];return o[e]=t(a),Jc(n,this,o)}}function fu(n,e){return au(hu(n,e,ko),n+"")}var gu=9007199254740991;function $o(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=gu}function Jr(n){return n!=null&&$o(n.length)&&!Mi(n)}function pu(n,e,t){if(!Lt(t))return!1;var r=typeof e;return(r=="number"?Jr(t)&&Do(e,t.length):r=="string"&&e in t)?lr(t[e],n):!1}function mu(n){return fu((function(e,t){var r=-1,s=t.length,i=s>1?t[s-1]:void 0,a=s>2?t[2]:void 0;for(i=n.length>3&&typeof i=="function"?(s--,i):void 0,a&&pu(t[0],t[1],a)&&(i=s<3?void 0:i,s=1),e=Object(e);++r<s;){var o=t[r];o&&n(e,o,r,i)}return e}))}var bu=Object.prototype;function Bi(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||bu;return n===t}function Eu(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var yu="[object Arguments]";function ya(n){return pt(n)&&Rn(n)==yu}var qo=Object.prototype,_u=qo.hasOwnProperty,vu=qo.propertyIsEnumerable,pi=ya(function(){return arguments}())?ya:function(n){return pt(n)&&_u.call(n,"callee")&&!vu.call(n,"callee")};function Nu(){return!1}var Po=typeof exports=="object"&&exports&&!exports.nodeType&&exports,_a=Po&&typeof module=="object"&&module&&!module.nodeType&&module,Tu=_a&&_a.exports===Po,va=Tu?st.Buffer:void 0,Au=va?va.isBuffer:void 0,Xn=Au||Nu,wu="[object Arguments]",Su="[object Array]",xu="[object Boolean]",Ou="[object Date]",Lu="[object Error]",Cu="[object Function]",Iu="[object Map]",Ru="[object Number]",ku="[object Object]",Mu="[object RegExp]",Du="[object Set]",Bu="[object String]",$u="[object WeakMap]",qu="[object ArrayBuffer]",Pu="[object DataView]",Uu="[object Float32Array]",Fu="[object Float64Array]",Hu="[object Int8Array]",zu="[object Int16Array]",Ku="[object Int32Array]",Gu="[object Uint8Array]",ju="[object Uint8ClampedArray]",Vu="[object Uint16Array]",Zu="[object Uint32Array]",te={};te[Uu]=te[Fu]=te[Hu]=te[zu]=te[Ku]=te[Gu]=te[ju]=te[Vu]=te[Zu]=!0;te[wu]=te[Su]=te[qu]=te[xu]=te[Pu]=te[Ou]=te[Lu]=te[Cu]=te[Iu]=te[Ru]=te[ku]=te[Mu]=te[Du]=te[Bu]=te[$u]=!1;function Wu(n){return pt(n)&&$o(n.length)&&!!te[Rn(n)]}function $i(n){return function(e){return n(e)}}var Uo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Yn=Uo&&typeof module=="object"&&module&&!module.nodeType&&module,Yu=Yn&&Yn.exports===Uo,Qs=Yu&&Io.process,Ln=function(){try{var n=Yn&&Yn.require&&Yn.require("util").types;return n||Qs&&Qs.binding&&Qs.binding("util")}catch{}}(),Na=Ln&&Ln.isTypedArray,qi=Na?$i(Na):Wu,Qu=Object.prototype,Xu=Qu.hasOwnProperty;function Fo(n,e){var t=Zt(n),r=!t&&pi(n),s=!t&&!r&&Xn(n),i=!t&&!r&&!s&&qi(n),a=t||r||s||i,o=a?Eu(n.length,String):[],c=o.length;for(var u in n)(e||Xu.call(n,u))&&!(a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Do(u,c)))&&o.push(u);return o}function Ho(n,e){return function(t){return n(e(t))}}var Ju=Ho(Object.keys,Object),ed=Object.prototype,td=ed.hasOwnProperty;function nd(n){if(!Bi(n))return Ju(n);var e=[];for(var t in Object(n))td.call(n,t)&&t!="constructor"&&e.push(t);return e}function Pi(n){return Jr(n)?Fo(n):nd(n)}function rd(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var sd=Object.prototype,id=sd.hasOwnProperty;function ad(n){if(!Lt(n))return rd(n);var e=Bi(n),t=[];for(var r in n)r=="constructor"&&(e||!id.call(n,r))||t.push(r);return t}function ur(n){return Jr(n)?Fo(n,!0):ad(n)}var Jn=Jt(Object,"create");function od(){this.__data__=Jn?Jn(null):{},this.size=0}function ld(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var cd="__lodash_hash_undefined__",ud=Object.prototype,dd=ud.hasOwnProperty;function hd(n){var e=this.__data__;if(Jn){var t=e[n];return t===cd?void 0:t}return dd.call(e,n)?e[n]:void 0}var fd=Object.prototype,gd=fd.hasOwnProperty;function pd(n){var e=this.__data__;return Jn?e[n]!==void 0:gd.call(e,n)}var md="__lodash_hash_undefined__";function bd(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Jn&&e===void 0?md:e,this}function Wt(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Wt.prototype.clear=od;Wt.prototype.delete=ld;Wt.prototype.get=hd;Wt.prototype.has=pd;Wt.prototype.set=bd;function Ed(){this.__data__=[],this.size=0}function es(n,e){for(var t=n.length;t--;)if(lr(n[t][0],e))return t;return-1}var yd=Array.prototype,_d=yd.splice;function vd(n){var e=this.__data__,t=es(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():_d.call(e,t,1),--this.size,!0}function Nd(n){var e=this.__data__,t=es(e,n);return t<0?void 0:e[t][1]}function Td(n){return es(this.__data__,n)>-1}function Ad(n,e){var t=this.__data__,r=es(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function bt(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}bt.prototype.clear=Ed;bt.prototype.delete=vd;bt.prototype.get=Nd;bt.prototype.has=Td;bt.prototype.set=Ad;var er=Jt(st,"Map");function wd(){this.size=0,this.__data__={hash:new Wt,map:new(er||bt),string:new Wt}}function Sd(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function ts(n,e){var t=n.__data__;return Sd(e)?t[typeof e=="string"?"string":"hash"]:t.map}function xd(n){var e=ts(this,n).delete(n);return this.size-=e?1:0,e}function Od(n){return ts(this,n).get(n)}function Ld(n){return ts(this,n).has(n)}function Cd(n,e){var t=ts(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function en(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}en.prototype.clear=wd;en.prototype.delete=xd;en.prototype.get=Od;en.prototype.has=Ld;en.prototype.set=Cd;function zo(n,e){for(var t=-1,r=e.length,s=n.length;++t<r;)n[s+t]=e[t];return n}var Ui=Ho(Object.getPrototypeOf,Object),Id="[object Object]",Rd=Function.prototype,kd=Object.prototype,Ko=Rd.toString,Md=kd.hasOwnProperty,Dd=Ko.call(Object);function Bd(n){if(!pt(n)||Rn(n)!=Id)return!1;var e=Ui(n);if(e===null)return!0;var t=Md.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Ko.call(t)==Dd}function $d(){this.__data__=new bt,this.size=0}function qd(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function Pd(n){return this.__data__.get(n)}function Ud(n){return this.__data__.has(n)}var Fd=200;function Hd(n,e){var t=this.__data__;if(t instanceof bt){var r=t.__data__;if(!er||r.length<Fd-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new en(r)}return t.set(n,e),this.size=t.size,this}function nt(n){var e=this.__data__=new bt(n);this.size=e.size}nt.prototype.clear=$d;nt.prototype.delete=qd;nt.prototype.get=Pd;nt.prototype.has=Ud;nt.prototype.set=Hd;function zd(n,e){return n&&cr(e,Pi(e),n)}function Kd(n,e){return n&&cr(e,ur(e),n)}var Go=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ta=Go&&typeof module=="object"&&module&&!module.nodeType&&module,Gd=Ta&&Ta.exports===Go,Aa=Gd?st.Buffer:void 0,wa=Aa?Aa.allocUnsafe:void 0;function jo(n,e){if(e)return n.slice();var t=n.length,r=wa?wa(t):new n.constructor(t);return n.copy(r),r}function jd(n,e){for(var t=-1,r=n==null?0:n.length,s=0,i=[];++t<r;){var a=n[t];e(a,t,n)&&(i[s++]=a)}return i}function Vo(){return[]}var Vd=Object.prototype,Zd=Vd.propertyIsEnumerable,Sa=Object.getOwnPropertySymbols,Fi=Sa?function(n){return n==null?[]:(n=Object(n),jd(Sa(n),(function(e){return Zd.call(n,e)})))}:Vo;function Wd(n,e){return cr(n,Fi(n),e)}var Yd=Object.getOwnPropertySymbols,Zo=Yd?function(n){for(var e=[];n;)zo(e,Fi(n)),n=Ui(n);return e}:Vo;function Qd(n,e){return cr(n,Zo(n),e)}function Wo(n,e,t){var r=e(n);return Zt(n)?r:zo(r,t(n))}function mi(n){return Wo(n,Pi,Fi)}function Xd(n){return Wo(n,ur,Zo)}var bi=Jt(st,"DataView"),Ei=Jt(st,"Promise"),yi=Jt(st,"Set"),xa="[object Map]",Jd="[object Object]",Oa="[object Promise]",La="[object Set]",Ca="[object WeakMap]",Ia="[object DataView]",eh=Xt(bi),th=Xt(er),nh=Xt(Ei),rh=Xt(yi),sh=Xt(gi),ze=Rn;(bi&&ze(new bi(new ArrayBuffer(1)))!=Ia||er&&ze(new er)!=xa||Ei&&ze(Ei.resolve())!=Oa||yi&&ze(new yi)!=La||gi&&ze(new gi)!=Ca)&&(ze=function(n){var e=Rn(n),t=e==Jd?n.constructor:void 0,r=t?Xt(t):"";if(r)switch(r){case eh:return Ia;case th:return xa;case nh:return Oa;case rh:return La;case sh:return Ca}return e});var ih=Object.prototype,ah=ih.hasOwnProperty;function oh(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&ah.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var Hr=st.Uint8Array;function Hi(n){var e=new n.constructor(n.byteLength);return new Hr(e).set(new Hr(n)),e}function lh(n,e){var t=e?Hi(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var ch=/\w*$/;function uh(n){var e=new n.constructor(n.source,ch.exec(n));return e.lastIndex=n.lastIndex,e}var Ra=Ot?Ot.prototype:void 0,ka=Ra?Ra.valueOf:void 0;function dh(n){return ka?Object(ka.call(n)):{}}function Yo(n,e){var t=e?Hi(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var hh="[object Boolean]",fh="[object Date]",gh="[object Map]",ph="[object Number]",mh="[object RegExp]",bh="[object Set]",Eh="[object String]",yh="[object Symbol]",_h="[object ArrayBuffer]",vh="[object DataView]",Nh="[object Float32Array]",Th="[object Float64Array]",Ah="[object Int8Array]",wh="[object Int16Array]",Sh="[object Int32Array]",xh="[object Uint8Array]",Oh="[object Uint8ClampedArray]",Lh="[object Uint16Array]",Ch="[object Uint32Array]";function Ih(n,e,t){var r=n.constructor;switch(e){case _h:return Hi(n);case hh:case fh:return new r(+n);case vh:return lh(n,t);case Nh:case Th:case Ah:case wh:case Sh:case xh:case Oh:case Lh:case Ch:return Yo(n,t);case gh:return new r;case ph:case Eh:return new r(n);case mh:return uh(n);case bh:return new r;case yh:return dh(n)}}function Qo(n){return typeof n.constructor=="function"&&!Bi(n)?Xc(Ui(n)):{}}var Rh="[object Map]";function kh(n){return pt(n)&&ze(n)==Rh}var Ma=Ln&&Ln.isMap,Mh=Ma?$i(Ma):kh,Dh="[object Set]";function Bh(n){return pt(n)&&ze(n)==Dh}var Da=Ln&&Ln.isSet,$h=Da?$i(Da):Bh,qh=1,Ph=2,Uh=4,Xo="[object Arguments]",Fh="[object Array]",Hh="[object Boolean]",zh="[object Date]",Kh="[object Error]",Jo="[object Function]",Gh="[object GeneratorFunction]",jh="[object Map]",Vh="[object Number]",el="[object Object]",Zh="[object RegExp]",Wh="[object Set]",Yh="[object String]",Qh="[object Symbol]",Xh="[object WeakMap]",Jh="[object ArrayBuffer]",ef="[object DataView]",tf="[object Float32Array]",nf="[object Float64Array]",rf="[object Int8Array]",sf="[object Int16Array]",af="[object Int32Array]",of="[object Uint8Array]",lf="[object Uint8ClampedArray]",cf="[object Uint16Array]",uf="[object Uint32Array]",ee={};ee[Xo]=ee[Fh]=ee[Jh]=ee[ef]=ee[Hh]=ee[zh]=ee[tf]=ee[nf]=ee[rf]=ee[sf]=ee[af]=ee[jh]=ee[Vh]=ee[el]=ee[Zh]=ee[Wh]=ee[Yh]=ee[Qh]=ee[of]=ee[lf]=ee[cf]=ee[uf]=!0;ee[Kh]=ee[Jo]=ee[Xh]=!1;function Ur(n,e,t,r,s,i){var a,o=e&qh,c=e&Ph,u=e&Uh;if(a!==void 0)return a;if(!Lt(n))return n;var d=Zt(n);if(d){if(a=oh(n),!o)return Mo(n,a)}else{var g=ze(n),f=g==Jo||g==Gh;if(Xn(n))return jo(n,o);if(g==el||g==Xo||f&&!s){if(a=c||f?{}:Qo(n),!o)return c?Qd(n,Kd(a,n)):Wd(n,zd(a,n))}else{if(!ee[g])return s?n:{};a=Ih(n,g,o)}}i||(i=new nt);var p=i.get(n);if(p)return p;i.set(n,a),$h(n)?n.forEach((function(y){a.add(Ur(y,e,t,y,n,i))})):Mh(n)&&n.forEach((function(y,_){a.set(_,Ur(y,e,t,_,n,i))}));var m=u?c?Xd:mi:c?ur:Pi,E=d?void 0:m(n);return ou(E||n,(function(y,_){E&&(_=y,y=n[_]),Bo(a,_,Ur(y,e,t,_,n,i))})),a}var df=1,hf=4;function Sn(n){return Ur(n,df|hf)}var ff="__lodash_hash_undefined__";function gf(n){return this.__data__.set(n,ff),this}function pf(n){return this.__data__.has(n)}function zr(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new en;++e<t;)this.add(n[e])}zr.prototype.add=zr.prototype.push=gf;zr.prototype.has=pf;function mf(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}function bf(n,e){return n.has(e)}var Ef=1,yf=2;function tl(n,e,t,r,s,i){var a=t&Ef,o=n.length,c=e.length;if(o!=c&&!(a&&c>o))return!1;var u=i.get(n),d=i.get(e);if(u&&d)return u==e&&d==n;var g=-1,f=!0,p=t&yf?new zr:void 0;for(i.set(n,e),i.set(e,n);++g<o;){var m=n[g],E=e[g];if(r)var y=a?r(E,m,g,e,n,i):r(m,E,g,n,e,i);if(y!==void 0){if(y)continue;f=!1;break}if(p){if(!mf(e,(function(_,T){if(!bf(p,T)&&(m===_||s(m,_,t,r,i)))return p.push(T)}))){f=!1;break}}else if(!(m===E||s(m,E,t,r,i))){f=!1;break}}return i.delete(n),i.delete(e),f}function _f(n){var e=-1,t=Array(n.size);return n.forEach((function(r,s){t[++e]=[s,r]})),t}function vf(n){var e=-1,t=Array(n.size);return n.forEach((function(r){t[++e]=r})),t}var Nf=1,Tf=2,Af="[object Boolean]",wf="[object Date]",Sf="[object Error]",xf="[object Map]",Of="[object Number]",Lf="[object RegExp]",Cf="[object Set]",If="[object String]",Rf="[object Symbol]",kf="[object ArrayBuffer]",Mf="[object DataView]",Ba=Ot?Ot.prototype:void 0,Xs=Ba?Ba.valueOf:void 0;function Df(n,e,t,r,s,i,a){switch(t){case Mf:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case kf:return!(n.byteLength!=e.byteLength||!i(new Hr(n),new Hr(e)));case Af:case wf:case Of:return lr(+n,+e);case Sf:return n.name==e.name&&n.message==e.message;case Lf:case If:return n==e+"";case xf:var o=_f;case Cf:var c=r&Nf;if(o||(o=vf),n.size!=e.size&&!c)return!1;var u=a.get(n);if(u)return u==e;r|=Tf,a.set(n,e);var d=tl(o(n),o(e),r,s,i,a);return a.delete(n),d;case Rf:if(Xs)return Xs.call(n)==Xs.call(e)}return!1}var Bf=1,$f=Object.prototype,qf=$f.hasOwnProperty;function Pf(n,e,t,r,s,i){var a=t&Bf,o=mi(n),c=o.length,u=mi(e),d=u.length;if(c!=d&&!a)return!1;for(var g=c;g--;){var f=o[g];if(!(a?f in e:qf.call(e,f)))return!1}var p=i.get(n),m=i.get(e);if(p&&m)return p==e&&m==n;var E=!0;i.set(n,e),i.set(e,n);for(var y=a;++g<c;){f=o[g];var _=n[f],T=e[f];if(r)var v=a?r(T,_,f,e,n,i):r(_,T,f,n,e,i);if(!(v===void 0?_===T||s(_,T,t,r,i):v)){E=!1;break}y||(y=f=="constructor")}if(E&&!y){var w=n.constructor,S=e.constructor;w!=S&&"constructor"in n&&"constructor"in e&&!(typeof w=="function"&&w instanceof w&&typeof S=="function"&&S instanceof S)&&(E=!1)}return i.delete(n),i.delete(e),E}var Uf=1,$a="[object Arguments]",qa="[object Array]",Cr="[object Object]",Ff=Object.prototype,Pa=Ff.hasOwnProperty;function Hf(n,e,t,r,s,i){var a=Zt(n),o=Zt(e),c=a?qa:ze(n),u=o?qa:ze(e);c=c==$a?Cr:c,u=u==$a?Cr:u;var d=c==Cr,g=u==Cr,f=c==u;if(f&&Xn(n)){if(!Xn(e))return!1;a=!0,d=!1}if(f&&!d)return i||(i=new nt),a||qi(n)?tl(n,e,t,r,s,i):Df(n,e,c,t,r,s,i);if(!(t&Uf)){var p=d&&Pa.call(n,"__wrapped__"),m=g&&Pa.call(e,"__wrapped__");if(p||m){var E=p?n.value():n,y=m?e.value():e;return i||(i=new nt),s(E,y,t,r,i)}}return f?(i||(i=new nt),Pf(n,e,t,r,s,i)):!1}function nl(n,e,t,r,s){return n===e?!0:n==null||e==null||!pt(n)&&!pt(e)?n!==n&&e!==e:Hf(n,e,t,r,nl,s)}function zf(n){return function(e,t,r){for(var s=-1,i=Object(e),a=r(e),o=a.length;o--;){var c=a[++s];if(t(i[c],c,i)===!1)break}return e}}var Kf=zf();function _i(n,e,t){(t!==void 0&&!lr(n[e],t)||t===void 0&&!(e in n))&&Di(n,e,t)}function Gf(n){return pt(n)&&Jr(n)}function vi(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function jf(n){return cr(n,ur(n))}function Vf(n,e,t,r,s,i,a){var o=vi(n,t),c=vi(e,t),u=a.get(c);if(u){_i(n,t,u);return}var d=i?i(o,c,t+"",n,e,a):void 0,g=d===void 0;if(g){var f=Zt(c),p=!f&&Xn(c),m=!f&&!p&&qi(c);d=c,f||p||m?Zt(o)?d=o:Gf(o)?d=Mo(o):p?(g=!1,d=jo(c,!0)):m?(g=!1,d=Yo(c,!0)):d=[]:Bd(c)||pi(c)?(d=o,pi(o)?d=jf(o):(!Lt(o)||Mi(o))&&(d=Qo(c))):g=!1}g&&(a.set(c,d),s(d,c,r,i,a),a.delete(c)),_i(n,t,d)}function rl(n,e,t,r,s){n!==e&&Kf(e,(function(i,a){if(s||(s=new nt),Lt(i))Vf(n,e,a,t,rl,r,s);else{var o=r?r(vi(n,a),i,a+"",n,e,s):void 0;o===void 0&&(o=i),_i(n,a,o)}}),ur)}function zi(n,e){return nl(n,e)}var St=mu((function(n,e,t){rl(n,e,t)})),D=(n=>(n[n.TYPE=3]="TYPE",n[n.LEVEL=12]="LEVEL",n[n.ATTRIBUTE=13]="ATTRIBUTE",n[n.BLOT=14]="BLOT",n[n.INLINE=7]="INLINE",n[n.BLOCK=11]="BLOCK",n[n.BLOCK_BLOT=10]="BLOCK_BLOT",n[n.INLINE_BLOT=6]="INLINE_BLOT",n[n.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",n[n.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",n[n.ANY=15]="ANY",n))(D||{});class rt{constructor(e,t,r={}){this.attrName=e,this.keyName=t;const s=D.TYPE&D.ATTRIBUTE;this.scope=r.scope!=null?r.scope&D.LEVEL|s:D.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map((t=>t.name))}add(e,t){return this.canAdd(e,t)?(e.setAttribute(this.keyName,t),!0):!1}canAdd(e,t){return this.whitelist==null?!0:typeof t=="string"?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class xn extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const sl=class Ni{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let r=null;try{r=e.parentNode}catch{return null}return this.find(r,t)}return null}create(e,t,r){const s=this.query(t);if(s==null)throw new xn(`Unable to create ${t} blot`);const i=s,a=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:i.create(r),o=new i(e,a,r);return Ni.blots.set(o.domNode,o),o}find(e,t=!1){return Ni.find(e,t)}query(e,t=D.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&D.LEVEL&D.BLOCK?r=this.types.block:e&D.LEVEL&D.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some((s=>(r=this.classes[s],!!r))),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&t&D.LEVEL&r.scope&&t&D.TYPE&r.scope?r:null}register(...e){return e.map((t=>{const r="blotName"in t,s="attrName"in t;if(!r&&!s)throw new xn("Invalid definition");if(r&&t.blotName==="abstract")throw new xn("Cannot register abstract class");const i=r?t.blotName:s?t.attrName:void 0;return this.types[i]=t,s?typeof t.keyName=="string"&&(this.attributes[t.keyName]=t):r&&(t.className&&(this.classes[t.className]=t),t.tagName&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map((a=>a.toUpperCase())):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach((a=>{(this.tags[a]==null||t.className==null)&&(this.tags[a]=t)})))),t}))}};sl.blots=new WeakMap;let Cn=sl;function Ua(n,e){return(n.getAttribute("class")||"").split(/\s+/).filter((t=>t.indexOf(`${e}-`)===0))}class Zf extends rt{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map((t=>t.split("-").slice(0,-1).join("-")))}add(e,t){return this.canAdd(e,t)?(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0):!1}remove(e){Ua(e,this.keyName).forEach((t=>{e.classList.remove(t)})),e.classList.length===0&&e.removeAttribute("class")}value(e){const t=(Ua(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}}const We=Zf;function Js(n){const e=n.split("-"),t=e.slice(1).map((r=>r[0].toUpperCase()+r.slice(1))).join("");return e[0]+t}class Wf extends rt{static keys(e){return(e.getAttribute("style")||"").split(";").map((t=>t.split(":")[0].trim()))}add(e,t){return this.canAdd(e,t)?(e.style[Js(this.keyName)]=t,!0):!1}remove(e){e.style[Js(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[Js(this.keyName)];return this.canAdd(e,t)?t:""}}const Ct=Wf;class Yf{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=Cn.find(this.domNode);if(e==null)return;const t=rt.keys(this.domNode),r=We.keys(this.domNode),s=Ct.keys(this.domNode);t.concat(r).concat(s).forEach((i=>{const a=e.scroll.query(i,D.ATTRIBUTE);a instanceof rt&&(this.attributes[a.attrName]=a)}))}copy(e){Object.keys(this.attributes).forEach((t=>{const r=this.attributes[t].value(this.domNode);e.format(t,r)}))}move(e){this.copy(e),Object.keys(this.attributes).forEach((t=>{this.attributes[t].remove(this.domNode)})),this.attributes={}}values(){return Object.keys(this.attributes).reduce(((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e)),{})}}const ns=Yf,il=class{constructor(e,t){this.scroll=e,this.domNode=t,Cn.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new xn("Blot definition missing tagName");let t,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?t=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?t=document.createElement(r):t=document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),Cn.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,r,s){const i=this.isolate(e,t);if(this.scroll.query(r,D.BLOT)!=null&&s)i.wrap(r,s);else if(this.scroll.query(r,D.ATTRIBUTE)!=null){const a=this.scroll.create(this.statics.scope);i.wrap(a),a.format(r,s)}}insertAt(e,t,r){const s=r==null?this.scroll.create("text",t):this.scroll.create(t,r),i=this.split(e);this.parent.insertBefore(s,i||void 0)}isolate(e,t){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(t),r}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){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(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,t){return e===0?this:this.next}update(e,t){}wrap(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new xn(`Cannot wrap ${e}`);return r.appendChild(this),r}};il.blotName="abstract";let al=il;const ol=class extends al{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};ol.scope=D.INLINE_BLOT;let Qf=ol;const Ne=Qf;class Xf{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let r=t();for(;r&&e>0;)e-=1,r=t();return r}contains(e){const t=this.iterator();let r=t();for(;r;){if(r===e)return!0;r=t()}return!1}indexOf(e){const t=this.iterator();let r=t(),s=0;for(;r;){if(r===e)return s;s+=1,r=t()}return-1}insertBefore(e,t){e!=null&&(this.remove(e),e.next=t,t!=null?(e.prev=t.prev,t.prev!=null&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,r=this.head;for(;r!=null;){if(r===e)return t;t+=r.length(),r=r.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const t=e;return e!=null&&(e=e.next),t}}find(e,t=!1){const r=this.iterator();let s=r();for(;s;){const i=s.length();if(e<i||t&&e===i&&(s.next==null||s.next.length()!==0))return[s,e];e-=i,s=r()}return[null,0]}forEach(e){const t=this.iterator();let r=t();for(;r;)e(r),r=t()}forEachAt(e,t,r){if(t<=0)return;const[s,i]=this.find(e);let a=e-i;const o=this.iterator(s);let c=o();for(;c&&a<e+t;){const u=c.length();e>a?r(c,e-a,Math.min(t,a+u-e)):r(c,0,Math.min(u,e+t-a)),a+=u,c=o()}}map(e){return this.reduce(((t,r)=>(t.push(e(r)),t)),[])}reduce(e,t){const r=this.iterator();let s=r();for(;s;)t=e(t,s),s=r();return t}}function Fa(n,e){const t=e.find(n);if(t)return t;try{return e.create(n)}catch{const r=e.create(D.INLINE);return Array.from(n.childNodes).forEach((s=>{r.domNode.appendChild(s)})),n.parentNode&&n.parentNode.replaceChild(r.domNode,n),r.attach(),r}}const ll=class vt extends al{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach((e=>{e.attach()}))}attachUI(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,vt.uiClass&&this.uiNode.classList.add(vt.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new Xf,Array.from(this.domNode.childNodes).filter((e=>e!==this.uiNode)).reverse().forEach((e=>{try{const t=Fa(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof xn)return;throw t}}))}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,((r,s,i)=>{r.deleteAt(s,i)}))}descendant(e,t=0){const[r,s]=this.children.find(t);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,s]:r instanceof vt?r.descendant(e,s):[null,-1]}descendants(e,t=0,r=Number.MAX_VALUE){let s=[],i=r;return this.children.forEachAt(t,r,((a,o,c)=>{(e.blotName==null&&e(a)||e.blotName!=null&&a instanceof e)&&s.push(a),a instanceof vt&&(s=s.concat(a.descendants(e,o,i))),i-=c})),s}detach(){this.children.forEach((e=>{e.detach()})),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach((t=>{e||this.statics.allowedChildren.some((r=>t instanceof r))||(t.statics.scope===D.BLOCK_BLOT?(t.next!=null&&this.splitAfter(t),t.prev!=null&&this.splitAfter(t.prev),t.parent.unwrap(),e=!0):t instanceof vt?t.unwrap():t.remove())}))}formatAt(e,t,r,s){this.children.forEachAt(e,t,((i,a,o)=>{i.formatAt(a,o,r,s)}))}insertAt(e,t,r){const[s,i]=this.children.find(e);if(s)s.insertAt(i,t,r);else{const a=r==null?this.scroll.create("text",t):this.scroll.create(t,r);this.appendChild(a)}}insertBefore(e,t){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,t||null),e.parent=this,t!=null&&(r=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce(((e,t)=>e+t.length()),0)}moveChildren(e,t){this.children.forEach((r=>{e.insertBefore(r,t)}))}optimize(e){if(super.optimize(e),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 t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e,t=!1){const[r,s]=this.children.find(e,t),i=[[this,e]];return r instanceof vt?i.concat(r.path(s,t)):(r!=null&&i.push([r,s]),i)}removeChild(e){this.children.remove(e)}replaceWith(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return r instanceof vt&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),((s,i,a)=>{const o=s.split(i,t);o!=null&&r.appendChild(o)})),r}splitAfter(e){const t=this.clone();for(;e.next!=null;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){const r=[],s=[];e.forEach((i=>{i.target===this.domNode&&i.type==="childList"&&(r.push(...i.addedNodes),s.push(...i.removedNodes))})),s.forEach((i=>{if(i.parentNode!=null&&i.tagName!=="IFRAME"&&document.body.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const a=this.scroll.find(i);a!=null&&(a.domNode.parentNode==null||a.domNode.parentNode===this.domNode)&&a.detach()})),r.filter((i=>i.parentNode===this.domNode&&i!==this.uiNode)).sort(((i,a)=>i===a?0:i.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1)).forEach((i=>{let a=null;i.nextSibling!=null&&(a=this.scroll.find(i.nextSibling));const o=Fa(i,this.scroll);(o.next!==a||o.next==null)&&(o.parent!=null&&o.parent.removeChild(this),this.insertBefore(o,a||void 0))})),this.enforceAllowedChildren()}};ll.uiClass="";let Jf=ll;const Ve=Jf;function eg(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(n[t]!==e[t])return!1;return!0}const yn=class _n extends Ve{static create(e){return super.create(e)}static formats(e,t){const r=t.query(_n.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new ns(this.domNode)}format(e,t){if(e===this.statics.blotName&&!t)this.children.forEach((r=>{r instanceof _n||(r=r.wrap(_n.blotName,!0)),this.attributes.copy(r)})),this.unwrap();else{const r=this.scroll.query(e,D.INLINE);if(r==null)return;r instanceof rt?this.attributes.attribute(r,t):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t)}}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,s){this.formats()[r]!=null||this.scroll.query(r,D.ATTRIBUTE)?this.isolate(e,t).format(r,s):super.formatAt(e,t,r,s)}optimize(e){super.optimize(e);const t=this.formats();if(Object.keys(t).length===0)return this.unwrap();const r=this.next;r instanceof _n&&r.prev===this&&eg(t,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some((r=>r.target===this.domNode&&r.type==="attributes"))&&this.attributes.build()}wrap(e,t){const r=super.wrap(e,t);return r instanceof _n&&this.attributes.move(r),r}};yn.allowedChildren=[yn,Ne],yn.blotName="inline",yn.scope=D.INLINE_BLOT,yn.tagName="SPAN";let tg=yn;const Ki=tg,vn=class Ti extends Ve{static create(e){return super.create(e)}static formats(e,t){const r=t.query(Ti.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new ns(this.domNode)}format(e,t){const r=this.scroll.query(e,D.BLOCK);r!=null&&(r instanceof rt?this.attributes.attribute(r,t):e===this.statics.blotName&&!t?this.replaceWith(Ti.blotName):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,s){this.scroll.query(r,D.BLOCK)!=null?this.format(r,s):super.formatAt(e,t,r,s)}insertAt(e,t,r){if(r==null||this.scroll.query(t,D.INLINE)!=null)super.insertAt(e,t,r);else{const s=this.split(e);if(s!=null){const i=this.scroll.create(t,r);s.parent.insertBefore(i,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some((r=>r.target===this.domNode&&r.type==="attributes"))&&this.attributes.build()}};vn.blotName="block",vn.scope=D.BLOCK_BLOT,vn.tagName="P",vn.allowedChildren=[Ki,vn,Ne];let ng=vn;const tr=ng,Ai=class extends Ve{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,r,s){super.formatAt(e,t,r,s),this.enforceAllowedChildren()}insertAt(e,t,r){super.insertAt(e,t,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Ai.blotName="container",Ai.scope=D.BLOCK_BLOT;let rg=Ai;const rs=rg;class sg extends Ne{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,r,s){e===0&&t===this.length()?this.format(r,s):super.formatAt(e,t,r,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const ke=sg,ig={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},ag=100,Nn=class extends Ve{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver((r=>{this.update(r)})),this.observer.observe(this.domNode,ig),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const r=this.registry.find(e,t);return r?r.scroll===this?r:t?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,t=D.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),e===0&&t===this.length()?this.children.forEach((r=>{r.remove()})):super.deleteAt(e,t)}formatAt(e,t,r,s){this.update(),super.formatAt(e,t,r,s)}insertAt(e,t,r){this.update(),super.insertAt(e,t,r)}optimize(e=[],t={}){super.optimize(t);const r=t.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)e.push(s.pop());const i=(c,u=!0)=>{c==null||c===this||c.domNode.parentNode!=null&&(r.has(c.domNode)||r.set(c.domNode,[]),u&&i(c.parent))},a=c=>{r.has(c.domNode)&&(c instanceof Ve&&c.children.forEach(a),r.delete(c.domNode),c.optimize(t))};let o=e;for(let c=0;o.length>0;c+=1){if(c>=ag)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach((u=>{const d=this.find(u.target,!0);d!=null&&(d.domNode===u.target&&(u.type==="childList"?(i(this.find(u.previousSibling,!1)),Array.from(u.addedNodes).forEach((g=>{const f=this.find(g,!1);i(f,!1),f instanceof Ve&&f.children.forEach((p=>{i(p,!1)}))}))):u.type==="attributes"&&i(d.prev)),i(d))})),this.children.forEach(a),o=Array.from(this.observer.takeRecords()),s=o.slice();s.length>0;)e.push(s.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map((s=>{const i=this.find(s.target,!0);return i==null?null:r.has(i.domNode)?(r.get(i.domNode).push(s),null):(r.set(i.domNode,[s]),i)})).forEach((s=>{s!=null&&s!==this&&r.has(s.domNode)&&s.update(r.get(s.domNode)||[],t)})),t.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),t),this.optimize(e,t)}};Nn.blotName="scroll",Nn.defaultChild=tr,Nn.allowedChildren=[tr,rs],Nn.scope=D.BLOCK_BLOT,Nn.tagName="DIV";let og=Nn;const Gi=og,wi=class cl extends Ne{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,r){r==null?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,r)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof cl&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,t){e.some((r=>r.type==="characterData"&&r.target===this.domNode))&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};wi.blotName="text",wi.scope=D.INLINE_BLOT;let lg=wi;const Kr=lg,cg=Object.freeze(Object.defineProperty({__proto__:null,Attributor:rt,AttributorStore:ns,BlockBlot:tr,ClassAttributor:We,ContainerBlot:rs,EmbedBlot:ke,InlineBlot:Ki,LeafBlot:Ne,ParentBlot:Ve,Registry:Cn,Scope:D,ScrollBlot:Gi,StyleAttributor:Ct,TextBlot:Kr},Symbol.toStringTag,{value:"Module"}));var Tt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ji(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Si={exports:{}},Re=-1,Se=1,de=0;function nr(n,e,t,r,s){if(n===e)return n?[[de,n]]:[];if(t!=null){var i=Eg(n,e,t);if(i)return i}var a=Vi(n,e),o=n.substring(0,a);n=n.substring(a),e=e.substring(a),a=ss(n,e);var c=n.substring(n.length-a);n=n.substring(0,n.length-a),e=e.substring(0,e.length-a);var u=ug(n,e);return o&&u.unshift([de,o]),c&&u.push([de,c]),Zi(u,s),r&&fg(u),u}function ug(n,e){var t;if(!n)return[[Se,e]];if(!e)return[[Re,n]];var r=n.length>e.length?n:e,s=n.length>e.length?e:n,i=r.indexOf(s);if(i!==-1)return t=[[Se,r.substring(0,i)],[de,s],[Se,r.substring(i+s.length)]],n.length>e.length&&(t[0][0]=t[2][0]=Re),t;if(s.length===1)return[[Re,n],[Se,e]];var a=hg(n,e);if(a){var o=a[0],c=a[1],u=a[2],d=a[3],g=a[4],f=nr(o,u),p=nr(c,d);return f.concat([[de,g]],p)}return dg(n,e)}function dg(n,e){for(var t=n.length,r=e.length,s=Math.ceil((t+r)/2),i=s,a=2*s,o=new Array(a),c=new Array(a),u=0;u<a;u++)o[u]=-1,c[u]=-1;o[i+1]=0,c[i+1]=0;for(var d=t-r,g=d%2!==0,f=0,p=0,m=0,E=0,y=0;y<s;y++){for(var _=-y+f;_<=y-p;_+=2){var T=i+_,v;_===-y||_!==y&&o[T-1]<o[T+1]?v=o[T+1]:v=o[T-1]+1;for(var w=v-_;v<t&&w<r&&n.charAt(v)===e.charAt(w);)v++,w++;if(o[T]=v,v>t)p+=2;else if(w>r)f+=2;else if(g){var S=i+d-_;if(S>=0&&S<a&&c[S]!==-1){var L=t-c[S];if(v>=L)return Ha(n,e,v,w)}}}for(var B=-y+m;B<=y-E;B+=2){var S=i+B,L;B===-y||B!==y&&c[S-1]<c[S+1]?L=c[S+1]:L=c[S-1]+1;for(var K=L-B;L<t&&K<r&&n.charAt(t-L-1)===e.charAt(r-K-1);)L++,K++;if(c[S]=L,L>t)E+=2;else if(K>r)m+=2;else if(!g){var T=i+d-B;if(T>=0&&T<a&&o[T]!==-1){var v=o[T],w=i+v-T;if(L=t-L,v>=L)return Ha(n,e,v,w)}}}}return[[Re,n],[Se,e]]}function Ha(n,e,t,r){var s=n.substring(0,t),i=e.substring(0,r),a=n.substring(t),o=e.substring(r),c=nr(s,i),u=nr(a,o);return c.concat(u)}function Vi(n,e){if(!n||!e||n.charAt(0)!==e.charAt(0))return 0;for(var t=0,r=Math.min(n.length,e.length),s=r,i=0;t<s;)n.substring(i,s)==e.substring(i,s)?(t=s,i=t):r=s,s=Math.floor((r-t)/2+t);return ul(n.charCodeAt(s-1))&&s--,s}function za(n,e){var t=n.length,r=e.length;if(t==0||r==0)return 0;t>r?n=n.substring(t-r):t<r&&(e=e.substring(0,t));var s=Math.min(t,r);if(n==e)return s;for(var i=0,a=1;;){var o=n.substring(s-a),c=e.indexOf(o);if(c==-1)return i;a+=c,(c==0||n.substring(s-a)==e.substring(0,a))&&(i=a,a++)}}function ss(n,e){if(!n||!e||n.slice(-1)!==e.slice(-1))return 0;for(var t=0,r=Math.min(n.length,e.length),s=r,i=0;t<s;)n.substring(n.length-s,n.length-i)==e.substring(e.length-s,e.length-i)?(t=s,i=t):r=s,s=Math.floor((r-t)/2+t);return dl(n.charCodeAt(n.length-s))&&s--,s}function hg(n,e){var t=n.length>e.length?n:e,r=n.length>e.length?e:n;if(t.length<4||r.length*2<t.length)return null;function s(p,m,E){for(var y=p.substring(E,E+Math.floor(p.length/4)),_=-1,T="",v,w,S,L;(_=m.indexOf(y,_+1))!==-1;){var B=Vi(p.substring(E),m.substring(_)),K=ss(p.substring(0,E),m.substring(0,_));T.length<K+B&&(T=m.substring(_-K,_)+m.substring(_,_+B),v=p.substring(0,E-K),w=p.substring(E+B),S=m.substring(0,_-K),L=m.substring(_+B))}return T.length*2>=p.length?[v,w,S,L,T]:null}var i=s(t,r,Math.ceil(t.length/4)),a=s(t,r,Math.ceil(t.length/2)),o;if(!i&&!a)return null;a?i?o=i[4].length>a[4].length?i:a:o=a:o=i;var c,u,d,g;n.length>e.length?(c=o[0],u=o[1],d=o[2],g=o[3]):(d=o[0],g=o[1],c=o[2],u=o[3]);var f=o[4];return[c,u,d,g,f]}function fg(n){for(var e=!1,t=[],r=0,s=null,i=0,a=0,o=0,c=0,u=0;i<n.length;)n[i][0]==de?(t[r++]=i,a=c,o=u,c=0,u=0,s=n[i][1]):(n[i][0]==Se?c+=n[i][1].length:u+=n[i][1].length,s&&s.length<=Math.max(a,o)&&s.length<=Math.max(c,u)&&(n.splice(t[r-1],0,[Re,s]),n[t[r-1]+1][0]=Se,r--,r--,i=r>0?t[r-1]:-1,a=0,o=0,c=0,u=0,s=null,e=!0)),i++;for(e&&Zi(n),mg(n),i=1;i<n.length;){if(n[i-1][0]==Re&&n[i][0]==Se){var d=n[i-1][1],g=n[i][1],f=za(d,g),p=za(g,d);f>=p?(f>=d.length/2||f>=g.length/2)&&(n.splice(i,0,[de,g.substring(0,f)]),n[i-1][1]=d.substring(0,d.length-f),n[i+1][1]=g.substring(f),i++):(p>=d.length/2||p>=g.length/2)&&(n.splice(i,0,[de,d.substring(0,p)]),n[i-1][0]=Se,n[i-1][1]=g.substring(0,g.length-p),n[i+1][0]=Re,n[i+1][1]=d.substring(p),i++),i++}i++}}var Ka=/[^a-zA-Z0-9]/,Ga=/\s/,ja=/[\r\n]/,gg=/\n\r?\n$/,pg=/^\r?\n\r?\n/;function mg(n){function e(p,m){if(!p||!m)return 6;var E=p.charAt(p.length-1),y=m.charAt(0),_=E.match(Ka),T=y.match(Ka),v=_&&E.match(Ga),w=T&&y.match(Ga),S=v&&E.match(ja),L=w&&y.match(ja),B=S&&p.match(gg),K=L&&m.match(pg);return B||K?5:S||L?4:_&&!v&&w?3:v||w?2:_||T?1:0}for(var t=1;t<n.length-1;){if(n[t-1][0]==de&&n[t+1][0]==de){var r=n[t-1][1],s=n[t][1],i=n[t+1][1],a=ss(r,s);if(a){var o=s.substring(s.length-a);r=r.substring(0,r.length-a),s=o+s.substring(0,s.length-a),i=o+i}for(var c=r,u=s,d=i,g=e(r,s)+e(s,i);s.charAt(0)===i.charAt(0);){r+=s.charAt(0),s=s.substring(1)+i.charAt(0),i=i.substring(1);var f=e(r,s)+e(s,i);f>=g&&(g=f,c=r,u=s,d=i)}n[t-1][1]!=c&&(c?n[t-1][1]=c:(n.splice(t-1,1),t--),n[t][1]=u,d?n[t+1][1]=d:(n.splice(t+1,1),t--))}t++}}function Zi(n,e){n.push([de,""]);for(var t=0,r=0,s=0,i="",a="",o;t<n.length;){if(t<n.length-1&&!n[t][1]){n.splice(t,1);continue}switch(n[t][0]){case Se:s++,a+=n[t][1],t++;break;case Re:r++,i+=n[t][1],t++;break;case de:var c=t-s-r-1;if(e){if(c>=0&&fl(n[c][1])){var u=n[c][1].slice(-1);if(n[c][1]=n[c][1].slice(0,-1),i=u+i,a=u+a,!n[c][1]){n.splice(c,1),t--;var d=c-1;n[d]&&n[d][0]===Se&&(s++,a=n[d][1]+a,d--),n[d]&&n[d][0]===Re&&(r++,i=n[d][1]+i,d--),c=d}}if(hl(n[t][1])){var u=n[t][1].charAt(0);n[t][1]=n[t][1].slice(1),i+=u,a+=u}}if(t<n.length-1&&!n[t][1]){n.splice(t,1);break}if(i.length>0||a.length>0){i.length>0&&a.length>0&&(o=Vi(a,i),o!==0&&(c>=0?n[c][1]+=a.substring(0,o):(n.splice(0,0,[de,a.substring(0,o)]),t++),a=a.substring(o),i=i.substring(o)),o=ss(a,i),o!==0&&(n[t][1]=a.substring(a.length-o)+n[t][1],a=a.substring(0,a.length-o),i=i.substring(0,i.length-o)));var g=s+r;i.length===0&&a.length===0?(n.splice(t-g,g),t=t-g):i.length===0?(n.splice(t-g,g,[Se,a]),t=t-g+1):a.length===0?(n.splice(t-g,g,[Re,i]),t=t-g+1):(n.splice(t-g,g,[Re,i],[Se,a]),t=t-g+2)}t!==0&&n[t-1][0]===de?(n[t-1][1]+=n[t][1],n.splice(t,1)):t++,s=0,r=0,i="",a="";break}}n[n.length-1][1]===""&&n.pop();var f=!1;for(t=1;t<n.length-1;)n[t-1][0]===de&&n[t+1][0]===de&&(n[t][1].substring(n[t][1].length-n[t-1][1].length)===n[t-1][1]?(n[t][1]=n[t-1][1]+n[t][1].substring(0,n[t][1].length-n[t-1][1].length),n[t+1][1]=n[t-1][1]+n[t+1][1],n.splice(t-1,1),f=!0):n[t][1].substring(0,n[t+1][1].length)==n[t+1][1]&&(n[t-1][1]+=n[t+1][1],n[t][1]=n[t][1].substring(n[t+1][1].length)+n[t+1][1],n.splice(t+1,1),f=!0)),t++;f&&Zi(n,e)}function ul(n){return n>=55296&&n<=56319}function dl(n){return n>=56320&&n<=57343}function hl(n){return dl(n.charCodeAt(0))}function fl(n){return ul(n.charCodeAt(n.length-1))}function bg(n){for(var e=[],t=0;t<n.length;t++)n[t][1].length>0&&e.push(n[t]);return e}function ei(n,e,t,r){return fl(n)||hl(r)?null:bg([[de,n],[Re,e],[Se,t],[de,r]])}function Eg(n,e,t){var r=typeof t=="number"?{index:t,length:0}:t.oldRange,s=typeof t=="number"?null:t.newRange,i=n.length,a=e.length;if(r.length===0&&(s===null||s.length===0)){var o=r.index,c=n.slice(0,o),u=n.slice(o),d=s?s.index:null;e:{var g=o+a-i;if(d!==null&&d!==g||g<0||g>a)break e;var f=e.slice(0,g),p=e.slice(g);if(p!==u)break e;var m=Math.min(o,g),E=c.slice(0,m),y=f.slice(0,m);if(E!==y)break e;var _=c.slice(m),T=f.slice(m);return ei(E,_,T,u)}e:{if(d!==null&&d!==o)break e;var v=o,f=e.slice(0,v),p=e.slice(v);if(f!==c)break e;var w=Math.min(i-v,a-v),S=u.slice(u.length-w),L=p.slice(p.length-w);if(S!==L)break e;var _=u.slice(0,u.length-w),T=p.slice(0,p.length-w);return ei(c,_,T,S)}}if(r.length>0&&s&&s.length===0)e:{var E=n.slice(0,r.index),S=n.slice(r.index+r.length),m=E.length,w=S.length;if(a<m+w)break e;var y=e.slice(0,m),L=e.slice(a-w);if(E!==y||S!==L)break e;var _=n.slice(m,i-w),T=e.slice(m,a-w);return ei(E,_,T,S)}return null}function is(n,e,t,r){return nr(n,e,t,r,!0)}is.INSERT=Se;is.DELETE=Re;is.EQUAL=de;var yg=is,Gr={exports:{}};Gr.exports;(function(n,e){var t=200,r="__lodash_hash_undefined__",s=9007199254740991,i="[object Arguments]",a="[object Array]",o="[object Boolean]",c="[object Date]",u="[object Error]",d="[object Function]",g="[object GeneratorFunction]",f="[object Map]",p="[object Number]",m="[object Object]",E="[object Promise]",y="[object RegExp]",_="[object Set]",T="[object String]",v="[object Symbol]",w="[object WeakMap]",S="[object ArrayBuffer]",L="[object DataView]",B="[object Float32Array]",K="[object Float64Array]",X="[object Int8Array]",ae="[object Int16Array]",ge="[object Int32Array]",Te="[object Uint8Array]",le="[object Uint8ClampedArray]",se="[object Uint16Array]",ce="[object Uint32Array]",Pe=/[\\^$.*+?()[\]{}|]/g,x=/\w*$/,O=/^\[object .+?Constructor\]$/,q=/^(?:0|[1-9]\d*)$/,I={};I[i]=I[a]=I[S]=I[L]=I[o]=I[c]=I[B]=I[K]=I[X]=I[ae]=I[ge]=I[f]=I[p]=I[m]=I[y]=I[_]=I[T]=I[v]=I[Te]=I[le]=I[se]=I[ce]=!0,I[u]=I[d]=I[w]=!1;var j=typeof Tt=="object"&&Tt&&Tt.Object===Object&&Tt,ne=typeof self=="object"&&self&&self.Object===Object&&self,J=j||ne||Function("return this")(),at=e&&!e.nodeType&&e,H=at&&!0&&n&&!n.nodeType&&n,Ae=H&&H.exports===at;function an(l,h){return l.set(h[0],h[1]),l}function Oe(l,h){return l.add(h),l}function kt(l,h){for(var b=-1,A=l?l.length:0;++b<A&&h(l[b],b,l)!==!1;);return l}function on(l,h){for(var b=-1,A=h.length,F=l.length;++b<A;)l[F+b]=h[b];return l}function Mt(l,h,b,A){for(var F=-1,$=l?l.length:0;++F<$;)b=h(b,l[F],F,l);return b}function Dt(l,h){for(var b=-1,A=Array(l);++b<l;)A[b]=h(b);return A}function ln(l,h){return l?.[h]}function Qe(l){var h=!1;if(l!=null&&typeof l.toString!="function")try{h=!!(l+"")}catch{}return h}function Bt(l){var h=-1,b=Array(l.size);return l.forEach((function(A,F){b[++h]=[F,A]})),b}function Ee(l,h){return function(b){return l(h(b))}}function cn(l){var h=-1,b=Array(l.size);return l.forEach((function(A){b[++h]=A})),b}var $t=Array.prototype,P=Function.prototype,ot=Object.prototype,re=J["__core-js_shared__"],Y=function(){var l=/[^.]+$/.exec(re&&re.keys&&re.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}(),lt=P.toString,fe=ot.hasOwnProperty,Xe=ot.toString,qt=RegExp("^"+lt.call(fe).replace(Pe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=Ae?J.Buffer:void 0,R=J.Symbol,U=J.Uint8Array,z=Ee(Object.getPrototypeOf,Object),ie=Object.create,Le=ot.propertyIsEnumerable,Mn=$t.splice,Pt=Object.getOwnPropertySymbols,un=C?C.isBuffer:void 0,mr=Ee(Object.keys,Object),dn=Fe(J,"DataView"),Ut=Fe(J,"Map"),Ue=Fe(J,"Promise"),hn=Fe(J,"Set"),Dn=Fe(J,"WeakMap"),Ft=Fe(Object,"create"),Bn=we(dn),Ht=we(Ut),$n=we(Ue),qn=we(hn),Pn=we(Dn),yt=R?R.prototype:void 0,br=yt?yt.valueOf:void 0;function ct(l){var h=-1,b=l?l.length:0;for(this.clear();++h<b;){var A=l[h];this.set(A[0],A[1])}}function fs(){this.__data__=Ft?Ft(null):{}}function gs(l){return this.has(l)&&delete this.__data__[l]}function ps(l){var h=this.__data__;if(Ft){var b=h[l];return b===r?void 0:b}return fe.call(h,l)?h[l]:void 0}function Er(l){var h=this.__data__;return Ft?h[l]!==void 0:fe.call(h,l)}function Un(l,h){var b=this.__data__;return b[l]=Ft&&h===void 0?r:h,this}ct.prototype.clear=fs,ct.prototype.delete=gs,ct.prototype.get=ps,ct.prototype.has=Er,ct.prototype.set=Un;function pe(l){var h=-1,b=l?l.length:0;for(this.clear();++h<b;){var A=l[h];this.set(A[0],A[1])}}function ms(){this.__data__=[]}function bs(l){var h=this.__data__,b=gn(h,l);if(b<0)return!1;var A=h.length-1;return b==A?h.pop():Mn.call(h,b,1),!0}function Es(l){var h=this.__data__,b=gn(h,l);return b<0?void 0:h[b][1]}function ys(l){return gn(this.__data__,l)>-1}function _s(l,h){var b=this.__data__,A=gn(b,l);return A<0?b.push([l,h]):b[A][1]=h,this}pe.prototype.clear=ms,pe.prototype.delete=bs,pe.prototype.get=Es,pe.prototype.has=ys,pe.prototype.set=_s;function ye(l){var h=-1,b=l?l.length:0;for(this.clear();++h<b;){var A=l[h];this.set(A[0],A[1])}}function vs(){this.__data__={hash:new ct,map:new(Ut||pe),string:new ct}}function Ns(l){return Kt(this,l).delete(l)}function Ts(l){return Kt(this,l).get(l)}function As(l){return Kt(this,l).has(l)}function ws(l,h){return Kt(this,l).set(l,h),this}ye.prototype.clear=vs,ye.prototype.delete=Ns,ye.prototype.get=Ts,ye.prototype.has=As,ye.prototype.set=ws;function Ce(l){this.__data__=new pe(l)}function Ss(){this.__data__=new pe}function xs(l){return this.__data__.delete(l)}function Os(l){return this.__data__.get(l)}function Ls(l){return this.__data__.has(l)}function Cs(l,h){var b=this.__data__;if(b instanceof pe){var A=b.__data__;if(!Ut||A.length<t-1)return A.push([l,h]),this;b=this.__data__=new ye(A)}return b.set(l,h),this}Ce.prototype.clear=Ss,Ce.prototype.delete=xs,Ce.prototype.get=Os,Ce.prototype.has=Ls,Ce.prototype.set=Cs;function fn(l,h){var b=Kn(l)||mn(l)?Dt(l.length,String):[],A=b.length,F=!!A;for(var $ in l)fe.call(l,$)&&!(F&&($=="length"||Ks($,A)))&&b.push($);return b}function yr(l,h,b){var A=l[h];(!(fe.call(l,h)&&Ar(A,b))||b===void 0&&!(h in l))&&(l[h]=b)}function gn(l,h){for(var b=l.length;b--;)if(Ar(l[b][0],h))return b;return-1}function Je(l,h){return l&&zn(h,jn(h),l)}function Fn(l,h,b,A,F,$,Z){var V;if(A&&(V=$?A(l,F,$,Z):A(l)),V!==void 0)return V;if(!tt(l))return l;var oe=Kn(l);if(oe){if(V=Hs(l),!h)return Ps(l,V)}else{var Q=dt(l),_e=Q==d||Q==g;if(wr(l))return pn(l,h);if(Q==m||Q==i||_e&&!$){if(Qe(l))return $?l:{};if(V=et(_e?{}:l),!h)return Us(l,Je(V,l))}else{if(!I[Q])return $?l:{};V=zs(l,Q,Fn,h)}}Z||(Z=new Ce);var Ie=Z.get(l);if(Ie)return Ie;if(Z.set(l,V),!oe)var ue=b?Fs(l):jn(l);return kt(ue||l,(function(ve,me){ue&&(me=ve,ve=l[me]),yr(V,me,Fn(ve,h,b,A,me,l,Z))})),V}function Is(l){return tt(l)?ie(l):{}}function Rs(l,h,b){var A=h(l);return Kn(l)?A:on(A,b(l))}function ks(l){return Xe.call(l)}function Ms(l){if(!tt(l)||js(l))return!1;var h=Gn(l)||Qe(l)?qt:O;return h.test(we(l))}function Ds(l){if(!Nr(l))return mr(l);var h=[];for(var b in Object(l))fe.call(l,b)&&b!="constructor"&&h.push(b);return h}function pn(l,h){if(h)return l.slice();var b=new l.constructor(l.length);return l.copy(b),b}function Hn(l){var h=new l.constructor(l.byteLength);return new U(h).set(new U(l)),h}function zt(l,h){var b=h?Hn(l.buffer):l.buffer;return new l.constructor(b,l.byteOffset,l.byteLength)}function _r(l,h,b){var A=h?b(Bt(l),!0):Bt(l);return Mt(A,an,new l.constructor)}function vr(l){var h=new l.constructor(l.source,x.exec(l));return h.lastIndex=l.lastIndex,h}function Bs(l,h,b){var A=h?b(cn(l),!0):cn(l);return Mt(A,Oe,new l.constructor)}function $s(l){return br?Object(br.call(l)):{}}function qs(l,h){var b=h?Hn(l.buffer):l.buffer;return new l.constructor(b,l.byteOffset,l.length)}function Ps(l,h){var b=-1,A=l.length;for(h||(h=Array(A));++b<A;)h[b]=l[b];return h}function zn(l,h,b,A){b||(b={});for(var F=-1,$=h.length;++F<$;){var Z=h[F],V=void 0;yr(b,Z,V===void 0?l[Z]:V)}return b}function Us(l,h){return zn(l,ut(l),h)}function Fs(l){return Rs(l,jn,ut)}function Kt(l,h){var b=l.__data__;return Gs(h)?b[typeof h=="string"?"string":"hash"]:b.map}function Fe(l,h){var b=ln(l,h);return Ms(b)?b:void 0}var ut=Pt?Ee(Pt,Object):Zs,dt=ks;(dn&&dt(new dn(new ArrayBuffer(1)))!=L||Ut&&dt(new Ut)!=f||Ue&&dt(Ue.resolve())!=E||hn&&dt(new hn)!=_||Dn&&dt(new Dn)!=w)&&(dt=function(l){var h=Xe.call(l),b=h==m?l.constructor:void 0,A=b?we(b):void 0;if(A)switch(A){case Bn:return L;case Ht:return f;case $n:return E;case qn:return _;case Pn:return w}return h});function Hs(l){var h=l.length,b=l.constructor(h);return h&&typeof l[0]=="string"&&fe.call(l,"index")&&(b.index=l.index,b.input=l.input),b}function et(l){return typeof l.constructor=="function"&&!Nr(l)?Is(z(l)):{}}function zs(l,h,b,A){var F=l.constructor;switch(h){case S:return Hn(l);case o:case c:return new F(+l);case L:return zt(l,A);case B:case K:case X:case ae:case ge:case Te:case le:case se:case ce:return qs(l,A);case f:return _r(l,A,b);case p:case T:return new F(l);case y:return vr(l);case _:return Bs(l,A,b);case v:return $s(l)}}function Ks(l,h){return h=h??s,!!h&&(typeof l=="number"||q.test(l))&&l>-1&&l%1==0&&l<h}function Gs(l){var h=typeof l;return h=="string"||h=="number"||h=="symbol"||h=="boolean"?l!=="__proto__":l===null}function js(l){return!!Y&&Y in l}function Nr(l){var h=l&&l.constructor,b=typeof h=="function"&&h.prototype||ot;return l===b}function we(l){if(l!=null){try{return lt.call(l)}catch{}try{return l+""}catch{}}return""}function Tr(l){return Fn(l,!0,!0)}function Ar(l,h){return l===h||l!==l&&h!==h}function mn(l){return Vs(l)&&fe.call(l,"callee")&&(!Le.call(l,"callee")||Xe.call(l)==i)}var Kn=Array.isArray;function bn(l){return l!=null&&Sr(l.length)&&!Gn(l)}function Vs(l){return xr(l)&&bn(l)}var wr=un||Ws;function Gn(l){var h=tt(l)?Xe.call(l):"";return h==d||h==g}function Sr(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=s}function tt(l){var h=typeof l;return!!l&&(h=="object"||h=="function")}function xr(l){return!!l&&typeof l=="object"}function jn(l){return bn(l)?fn(l):Ds(l)}function Zs(){return[]}function Ws(){return!1}n.exports=Tr})(Gr,Gr.exports);var gl=Gr.exports,jr={exports:{}};jr.exports;(function(n,e){var t=200,r="__lodash_hash_undefined__",s=1,i=2,a=9007199254740991,o="[object Arguments]",c="[object Array]",u="[object AsyncFunction]",d="[object Boolean]",g="[object Date]",f="[object Error]",p="[object Function]",m="[object GeneratorFunction]",E="[object Map]",y="[object Number]",_="[object Null]",T="[object Object]",v="[object Promise]",w="[object Proxy]",S="[object RegExp]",L="[object Set]",B="[object String]",K="[object Symbol]",X="[object Undefined]",ae="[object WeakMap]",ge="[object ArrayBuffer]",Te="[object DataView]",le="[object Float32Array]",se="[object Float64Array]",ce="[object Int8Array]",Pe="[object Int16Array]",x="[object Int32Array]",O="[object Uint8Array]",q="[object Uint8ClampedArray]",I="[object Uint16Array]",j="[object Uint32Array]",ne=/[\\^$.*+?()[\]{}|]/g,J=/^\[object .+?Constructor\]$/,at=/^(?:0|[1-9]\d*)$/,H={};H[le]=H[se]=H[ce]=H[Pe]=H[x]=H[O]=H[q]=H[I]=H[j]=!0,H[o]=H[c]=H[ge]=H[d]=H[Te]=H[g]=H[f]=H[p]=H[E]=H[y]=H[T]=H[S]=H[L]=H[B]=H[ae]=!1;var Ae=typeof Tt=="object"&&Tt&&Tt.Object===Object&&Tt,an=typeof self=="object"&&self&&self.Object===Object&&self,Oe=Ae||an||Function("return this")(),kt=e&&!e.nodeType&&e,on=kt&&!0&&n&&!n.nodeType&&n,Mt=on&&on.exports===kt,Dt=Mt&&Ae.process,ln=function(){try{return Dt&&Dt.binding&&Dt.binding("util")}catch{}}(),Qe=ln&&ln.isTypedArray;function Bt(l,h){for(var b=-1,A=l==null?0:l.length,F=0,$=[];++b<A;){var Z=l[b];h(Z,b,l)&&($[F++]=Z)}return $}function Ee(l,h){for(var b=-1,A=h.length,F=l.length;++b<A;)l[F+b]=h[b];return l}function cn(l,h){for(var b=-1,A=l==null?0:l.length;++b<A;)if(h(l[b],b,l))return!0;return!1}function $t(l,h){for(var b=-1,A=Array(l);++b<l;)A[b]=h(b);return A}function P(l){return function(h){return l(h)}}function ot(l,h){return l.has(h)}function re(l,h){return l?.[h]}function Y(l){var h=-1,b=Array(l.size);return l.forEach((function(A,F){b[++h]=[F,A]})),b}function lt(l,h){return function(b){return l(h(b))}}function fe(l){var h=-1,b=Array(l.size);return l.forEach((function(A){b[++h]=A})),b}var Xe=Array.prototype,qt=Function.prototype,C=Object.prototype,R=Oe["__core-js_shared__"],U=qt.toString,z=C.hasOwnProperty,ie=function(){var l=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}(),Le=C.toString,Mn=RegExp("^"+U.call(z).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pt=Mt?Oe.Buffer:void 0,un=Oe.Symbol,mr=Oe.Uint8Array,dn=C.propertyIsEnumerable,Ut=Xe.splice,Ue=un?un.toStringTag:void 0,hn=Object.getOwnPropertySymbols,Dn=Pt?Pt.isBuffer:void 0,Ft=lt(Object.keys,Object),Bn=ut(Oe,"DataView"),Ht=ut(Oe,"Map"),$n=ut(Oe,"Promise"),qn=ut(Oe,"Set"),Pn=ut(Oe,"WeakMap"),yt=ut(Object,"create"),br=we(Bn),ct=we(Ht),fs=we($n),gs=we(qn),ps=we(Pn),Er=un?un.prototype:void 0,Un=Er?Er.valueOf:void 0;function pe(l){var h=-1,b=l==null?0:l.length;for(this.clear();++h<b;){var A=l[h];this.set(A[0],A[1])}}function ms(){this.__data__=yt?yt(null):{},this.size=0}function bs(l){var h=this.has(l)&&delete this.__data__[l];return this.size-=h?1:0,h}function Es(l){var h=this.__data__;if(yt){var b=h[l];return b===r?void 0:b}return z.call(h,l)?h[l]:void 0}function ys(l){var h=this.__data__;return yt?h[l]!==void 0:z.call(h,l)}function _s(l,h){var b=this.__data__;return this.size+=this.has(l)?0:1,b[l]=yt&&h===void 0?r:h,this}pe.prototype.clear=ms,pe.prototype.delete=bs,pe.prototype.get=Es,pe.prototype.has=ys,pe.prototype.set=_s;function ye(l){var h=-1,b=l==null?0:l.length;for(this.clear();++h<b;){var A=l[h];this.set(A[0],A[1])}}function vs(){this.__data__=[],this.size=0}function Ns(l){var h=this.__data__,b=pn(h,l);if(b<0)return!1;var A=h.length-1;return b==A?h.pop():Ut.call(h,b,1),--this.size,!0}function Ts(l){var h=this.__data__,b=pn(h,l);return b<0?void 0:h[b][1]}function As(l){return pn(this.__data__,l)>-1}function ws(l,h){var b=this.__data__,A=pn(b,l);return A<0?(++this.size,b.push([l,h])):b[A][1]=h,this}ye.prototype.clear=vs,ye.prototype.delete=Ns,ye.prototype.get=Ts,ye.prototype.has=As,ye.prototype.set=ws;function Ce(l){var h=-1,b=l==null?0:l.length;for(this.clear();++h<b;){var A=l[h];this.set(A[0],A[1])}}function Ss(){this.size=0,this.__data__={hash:new pe,map:new(Ht||ye),string:new pe}}function xs(l){var h=Fe(this,l).delete(l);return this.size-=h?1:0,h}function Os(l){return Fe(this,l).get(l)}function Ls(l){return Fe(this,l).has(l)}function Cs(l,h){var b=Fe(this,l),A=b.size;return b.set(l,h),this.size+=b.size==A?0:1,this}Ce.prototype.clear=Ss,Ce.prototype.delete=xs,Ce.prototype.get=Os,Ce.prototype.has=Ls,Ce.prototype.set=Cs;function fn(l){var h=-1,b=l==null?0:l.length;for(this.__data__=new Ce;++h<b;)this.add(l[h])}function yr(l){return this.__data__.set(l,r),this}function gn(l){return this.__data__.has(l)}fn.prototype.add=fn.prototype.push=yr,fn.prototype.has=gn;function Je(l){var h=this.__data__=new ye(l);this.size=h.size}function Fn(){this.__data__=new ye,this.size=0}function Is(l){var h=this.__data__,b=h.delete(l);return this.size=h.size,b}function Rs(l){return this.__data__.get(l)}function ks(l){return this.__data__.has(l)}function Ms(l,h){var b=this.__data__;if(b instanceof ye){var A=b.__data__;if(!Ht||A.length<t-1)return A.push([l,h]),this.size=++b.size,this;b=this.__data__=new Ce(A)}return b.set(l,h),this.size=b.size,this}Je.prototype.clear=Fn,Je.prototype.delete=Is,Je.prototype.get=Rs,Je.prototype.has=ks,Je.prototype.set=Ms;function Ds(l,h){var b=mn(l),A=!b&&Ar(l),F=!b&&!A&&bn(l),$=!b&&!A&&!F&&xr(l),Z=b||A||F||$,V=Z?$t(l.length,String):[],oe=V.length;for(var Q in l)z.call(l,Q)&&!(Z&&(Q=="length"||F&&(Q=="offset"||Q=="parent")||$&&(Q=="buffer"||Q=="byteLength"||Q=="byteOffset")||zs(Q,oe)))&&V.push(Q);return V}function pn(l,h){for(var b=l.length;b--;)if(Tr(l[b][0],h))return b;return-1}function Hn(l,h,b){var A=h(l);return mn(l)?A:Ee(A,b(l))}function zt(l){return l==null?l===void 0?X:_:Ue&&Ue in Object(l)?dt(l):Nr(l)}function _r(l){return tt(l)&&zt(l)==o}function vr(l,h,b,A,F){return l===h?!0:l==null||h==null||!tt(l)&&!tt(h)?l!==l&&h!==h:Bs(l,h,b,A,vr,F)}function Bs(l,h,b,A,F,$){var Z=mn(l),V=mn(h),oe=Z?c:et(l),Q=V?c:et(h);oe=oe==o?T:oe,Q=Q==o?T:Q;var _e=oe==T,Ie=Q==T,ue=oe==Q;if(ue&&bn(l)){if(!bn(h))return!1;Z=!0,_e=!1}if(ue&&!_e)return $||($=new Je),Z||xr(l)?zn(l,h,b,A,F,$):Us(l,h,oe,b,A,F,$);if(!(b&s)){var ve=_e&&z.call(l,"__wrapped__"),me=Ie&&z.call(h,"__wrapped__");if(ve||me){var _t=ve?l.value():l,ht=me?h.value():h;return $||($=new Je),F(_t,ht,b,A,$)}}return ue?($||($=new Je),Fs(l,h,b,A,F,$)):!1}function $s(l){if(!Sr(l)||Gs(l))return!1;var h=wr(l)?Mn:J;return h.test(we(l))}function qs(l){return tt(l)&&Gn(l.length)&&!!H[zt(l)]}function Ps(l){if(!js(l))return Ft(l);var h=[];for(var b in Object(l))z.call(l,b)&&b!="constructor"&&h.push(b);return h}function zn(l,h,b,A,F,$){var Z=b&s,V=l.length,oe=h.length;if(V!=oe&&!(Z&&oe>V))return!1;var Q=$.get(l);if(Q&&$.get(h))return Q==h;var _e=-1,Ie=!0,ue=b&i?new fn:void 0;for($.set(l,h),$.set(h,l);++_e<V;){var ve=l[_e],me=h[_e];if(A)var _t=Z?A(me,ve,_e,h,l,$):A(ve,me,_e,l,h,$);if(_t!==void 0){if(_t)continue;Ie=!1;break}if(ue){if(!cn(h,(function(ht,Gt){if(!ot(ue,Gt)&&(ve===ht||F(ve,ht,b,A,$)))return ue.push(Gt)}))){Ie=!1;break}}else if(!(ve===me||F(ve,me,b,A,$))){Ie=!1;break}}return $.delete(l),$.delete(h),Ie}function Us(l,h,b,A,F,$,Z){switch(b){case Te:if(l.byteLength!=h.byteLength||l.byteOffset!=h.byteOffset)return!1;l=l.buffer,h=h.buffer;case ge:return!(l.byteLength!=h.byteLength||!$(new mr(l),new mr(h)));case d:case g:case y:return Tr(+l,+h);case f:return l.name==h.name&&l.message==h.message;case S:case B:return l==h+"";case E:var V=Y;case L:var oe=A&s;if(V||(V=fe),l.size!=h.size&&!oe)return!1;var Q=Z.get(l);if(Q)return Q==h;A|=i,Z.set(l,h);var _e=zn(V(l),V(h),A,F,$,Z);return Z.delete(l),_e;case K:if(Un)return Un.call(l)==Un.call(h)}return!1}function Fs(l,h,b,A,F,$){var Z=b&s,V=Kt(l),oe=V.length,Q=Kt(h),_e=Q.length;if(oe!=_e&&!Z)return!1;for(var Ie=oe;Ie--;){var ue=V[Ie];if(!(Z?ue in h:z.call(h,ue)))return!1}var ve=$.get(l);if(ve&&$.get(h))return ve==h;var me=!0;$.set(l,h),$.set(h,l);for(var _t=Z;++Ie<oe;){ue=V[Ie];var ht=l[ue],Gt=h[ue];if(A)var fa=Z?A(Gt,ht,ue,h,l,$):A(ht,Gt,ue,l,h,$);if(!(fa===void 0?ht===Gt||F(ht,Gt,b,A,$):fa)){me=!1;break}_t||(_t=ue=="constructor")}if(me&&!_t){var Or=l.constructor,Lr=h.constructor;Or!=Lr&&"constructor"in l&&"constructor"in h&&!(typeof Or=="function"&&Or instanceof Or&&typeof Lr=="function"&&Lr instanceof Lr)&&(me=!1)}return $.delete(l),$.delete(h),me}function Kt(l){return Hn(l,jn,Hs)}function Fe(l,h){var b=l.__data__;return Ks(h)?b[typeof h=="string"?"string":"hash"]:b.map}function ut(l,h){var b=re(l,h);return $s(b)?b:void 0}function dt(l){var h=z.call(l,Ue),b=l[Ue];try{l[Ue]=void 0;var A=!0}catch{}var F=Le.call(l);return A&&(h?l[Ue]=b:delete l[Ue]),F}var Hs=hn?function(l){return l==null?[]:(l=Object(l),Bt(hn(l),(function(h){return dn.call(l,h)})))}:Zs,et=zt;(Bn&&et(new Bn(new ArrayBuffer(1)))!=Te||Ht&&et(new Ht)!=E||$n&&et($n.resolve())!=v||qn&&et(new qn)!=L||Pn&&et(new Pn)!=ae)&&(et=function(l){var h=zt(l),b=h==T?l.constructor:void 0,A=b?we(b):"";if(A)switch(A){case br:return Te;case ct:return E;case fs:return v;case gs:return L;case ps:return ae}return h});function zs(l,h){return h=h??a,!!h&&(typeof l=="number"||at.test(l))&&l>-1&&l%1==0&&l<h}function Ks(l){var h=typeof l;return h=="string"||h=="number"||h=="symbol"||h=="boolean"?l!=="__proto__":l===null}function Gs(l){return!!ie&&ie in l}function js(l){var h=l&&l.constructor,b=typeof h=="function"&&h.prototype||C;return l===b}function Nr(l){return Le.call(l)}function we(l){if(l!=null){try{return U.call(l)}catch{}try{return l+""}catch{}}return""}function Tr(l,h){return l===h||l!==l&&h!==h}var Ar=_r(function(){return arguments}())?_r:function(l){return tt(l)&&z.call(l,"callee")&&!dn.call(l,"callee")},mn=Array.isArray;function Kn(l){return l!=null&&Gn(l.length)&&!wr(l)}var bn=Dn||Ws;function Vs(l,h){return vr(l,h)}function wr(l){if(!Sr(l))return!1;var h=zt(l);return h==p||h==m||h==u||h==w}function Gn(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=a}function Sr(l){var h=typeof l;return l!=null&&(h=="object"||h=="function")}function tt(l){return l!=null&&typeof l=="object"}var xr=Qe?P(Qe):qs;function jn(l){return Kn(l)?Ds(l):Ps(l)}function Zs(){return[]}function Ws(){return!1}n.exports=Vs})(jr,jr.exports);var pl=jr.exports,Wi={};Object.defineProperty(Wi,"__esModule",{value:!0});const _g=gl,vg=pl;var xi;(function(n){function e(i={},a={},o=!1){typeof i!="object"&&(i={}),typeof a!="object"&&(a={});let c=_g(a);o||(c=Object.keys(c).reduce(((u,d)=>(c[d]!=null&&(u[d]=c[d]),u)),{}));for(const u in i)i[u]!==void 0&&a[u]===void 0&&(c[u]=i[u]);return Object.keys(c).length>0?c:void 0}n.compose=e;function t(i={},a={}){typeof i!="object"&&(i={}),typeof a!="object"&&(a={});const o=Object.keys(i).concat(Object.keys(a)).reduce(((c,u)=>(vg(i[u],a[u])||(c[u]=a[u]===void 0?null:a[u]),c)),{});return Object.keys(o).length>0?o:void 0}n.diff=t;function r(i={},a={}){i=i||{};const o=Object.keys(a).reduce(((c,u)=>(a[u]!==i[u]&&i[u]!==void 0&&(c[u]=a[u]),c)),{});return Object.keys(i).reduce(((c,u)=>(i[u]!==a[u]&&a[u]===void 0&&(c[u]=null),c)),o)}n.invert=r;function s(i,a,o=!1){if(typeof i!="object")return a;if(typeof a!="object")return;if(!o)return a;const c=Object.keys(a).reduce(((u,d)=>(i[d]===void 0&&(u[d]=a[d]),u)),{});return Object.keys(c).length>0?c:void 0}n.transform=s})(xi||(xi={}));Wi.default=xi;var as={};Object.defineProperty(as,"__esModule",{value:!0});var Oi;(function(n){function e(t){return typeof t.delete=="number"?t.delete:typeof t.retain=="number"?t.retain:typeof t.retain=="object"&&t.retain!==null?1:typeof t.insert=="string"?t.insert.length:1}n.length=e})(Oi||(Oi={}));as.default=Oi;var Yi={};Object.defineProperty(Yi,"__esModule",{value:!0});const Va=as;class Ng{constructor(e){this.ops=e,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);const t=this.ops[this.index];if(t){const r=this.offset,s=Va.default.length(t);if(e>=s-r?(e=s-r,this.index+=1,this.offset=0):this.offset+=e,typeof t.delete=="number")return{delete:e};{const i={};return t.attributes&&(i.attributes=t.attributes),typeof t.retain=="number"?i.retain=e:typeof t.retain=="object"&&t.retain!==null?i.retain=t.retain:typeof t.insert=="string"?i.insert=t.insert.substr(r,e):i.insert=t.insert,i}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?Va.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const e=this.ops[this.index];return e?typeof e.delete=="number"?"delete":typeof e.retain=="number"||typeof e.retain=="object"&&e.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const e=this.offset,t=this.index,r=this.next(),s=this.ops.slice(this.index);return this.offset=e,this.index=t,[r].concat(s)}}else return[]}}Yi.default=Ng;(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=yg,r=gl,s=pl,i=Wi;e.AttributeMap=i.default;const a=as;e.Op=a.default;const o=Yi;e.OpIterator=o.default;const c="\0",u=(g,f)=>{if(typeof g!="object"||g===null)throw new Error(`cannot retain a ${typeof g}`);if(typeof f!="object"||f===null)throw new Error(`cannot retain a ${typeof f}`);const p=Object.keys(g)[0];if(!p||p!==Object.keys(f)[0])throw new Error(`embed types not matched: ${p} != ${Object.keys(f)[0]}`);return[p,g[p],f[p]]};class d{constructor(f){Array.isArray(f)?this.ops=f:f!=null&&Array.isArray(f.ops)?this.ops=f.ops:this.ops=[]}static registerEmbed(f,p){this.handlers[f]=p}static unregisterEmbed(f){delete this.handlers[f]}static getHandler(f){const p=this.handlers[f];if(!p)throw new Error(`no handlers for embed type "${f}"`);return p}insert(f,p){const m={};return typeof f=="string"&&f.length===0?this:(m.insert=f,p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(m.attributes=p),this.push(m))}delete(f){return f<=0?this:this.push({delete:f})}retain(f,p){if(typeof f=="number"&&f<=0)return this;const m={retain:f};return p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(m.attributes=p),this.push(m)}push(f){let p=this.ops.length,m=this.ops[p-1];if(f=r(f),typeof m=="object"){if(typeof f.delete=="number"&&typeof m.delete=="number")return this.ops[p-1]={delete:m.delete+f.delete},this;if(typeof m.delete=="number"&&f.insert!=null&&(p-=1,m=this.ops[p-1],typeof m!="object"))return this.ops.unshift(f),this;if(s(f.attributes,m.attributes)){if(typeof f.insert=="string"&&typeof m.insert=="string")return this.ops[p-1]={insert:m.insert+f.insert},typeof f.attributes=="object"&&(this.ops[p-1].attributes=f.attributes),this;if(typeof f.retain=="number"&&typeof m.retain=="number")return this.ops[p-1]={retain:m.retain+f.retain},typeof f.attributes=="object"&&(this.ops[p-1].attributes=f.attributes),this}}return p===this.ops.length?this.ops.push(f):this.ops.splice(p,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 p=[],m=[];return this.forEach((E=>{(f(E)?p:m).push(E)})),[p,m]}reduce(f,p){return this.ops.reduce(f,p)}changeLength(){return this.reduce(((f,p)=>p.insert?f+a.default.length(p):p.delete?f-p.delete:f),0)}length(){return this.reduce(((f,p)=>f+a.default.length(p)),0)}slice(f=0,p=1/0){const m=[],E=new o.default(this.ops);let y=0;for(;y<p&&E.hasNext();){let _;y<f?_=E.next(f-y):(_=E.next(p-y),m.push(_)),y+=a.default.length(_)}return new d(m)}compose(f){const p=new o.default(this.ops),m=new o.default(f.ops),E=[],y=m.peek();if(y!=null&&typeof y.retain=="number"&&y.attributes==null){let T=y.retain;for(;p.peekType()==="insert"&&p.peekLength()<=T;)T-=p.peekLength(),E.push(p.next());y.retain-T>0&&m.next(y.retain-T)}const _=new d(E);for(;p.hasNext()||m.hasNext();)if(m.peekType()==="insert")_.push(m.next());else if(p.peekType()==="delete")_.push(p.next());else{const T=Math.min(p.peekLength(),m.peekLength()),v=p.next(T),w=m.next(T);if(w.retain){const S={};if(typeof v.retain=="number")S.retain=typeof w.retain=="number"?T:w.retain;else if(typeof w.retain=="number")v.retain==null?S.insert=v.insert:S.retain=v.retain;else{const B=v.retain==null?"insert":"retain",[K,X,ae]=u(v[B],w.retain),ge=d.getHandler(K);S[B]={[K]:ge.compose(X,ae,B==="retain")}}const L=i.default.compose(v.attributes,w.attributes,typeof v.retain=="number");if(L&&(S.attributes=L),_.push(S),!m.hasNext()&&s(_.ops[_.ops.length-1],S)){const B=new d(p.rest());return _.concat(B).chop()}}else typeof w.delete=="number"&&(typeof v.retain=="number"||typeof v.retain=="object"&&v.retain!==null)&&_.push(w)}return _.chop()}concat(f){const p=new d(this.ops.slice());return f.ops.length>0&&(p.push(f.ops[0]),p.ops=p.ops.concat(f.ops.slice(1))),p}diff(f,p){if(this.ops===f.ops)return new d;const m=[this,f].map((v=>v.map((w=>{if(w.insert!=null)return typeof w.insert=="string"?w.insert:c;const S=v===f?"on":"with";throw new Error("diff() called "+S+" non-document")})).join(""))),E=new d,y=t(m[0],m[1],p,!0),_=new o.default(this.ops),T=new o.default(f.ops);return y.forEach((v=>{let w=v[1].length;for(;w>0;){let S=0;switch(v[0]){case t.INSERT:S=Math.min(T.peekLength(),w),E.push(T.next(S));break;case t.DELETE:S=Math.min(w,_.peekLength()),_.next(S),E.delete(S);break;case t.EQUAL:S=Math.min(_.peekLength(),T.peekLength(),w);const L=_.next(S),B=T.next(S);s(L.insert,B.insert)?E.retain(S,i.default.diff(L.attributes,B.attributes)):E.push(B).delete(S);break}w-=S}})),E.chop()}eachLine(f,p=`\n`){const m=new o.default(this.ops);let E=new d,y=0;for(;m.hasNext();){if(m.peekType()!=="insert")return;const _=m.peek(),T=a.default.length(_)-m.peekLength(),v=typeof _.insert=="string"?_.insert.indexOf(p,T)-T:-1;if(v<0)E.push(m.next());else if(v>0)E.push(m.next(v));else{if(f(E,m.next(1).attributes||{},y)===!1)return;y+=1,E=new d}}E.length()>0&&f(E,{},y)}invert(f){const p=new d;return this.reduce(((m,E)=>{if(E.insert)p.delete(a.default.length(E));else{if(typeof E.retain=="number"&&E.attributes==null)return p.retain(E.retain),m+E.retain;if(E.delete||typeof E.retain=="number"){const y=E.delete||E.retain;return f.slice(m,m+y).forEach((T=>{E.delete?p.push(T):E.retain&&E.attributes&&p.retain(a.default.length(T),i.default.invert(E.attributes,T.attributes))})),m+y}else if(typeof E.retain=="object"&&E.retain!==null){const y=f.slice(m,m+1),_=new o.default(y.ops).next(),[T,v,w]=u(E.retain,_.insert),S=d.getHandler(T);return p.retain({[T]:S.invert(v,w)},i.default.invert(E.attributes,_.attributes)),m+1}}return m}),0),p.chop()}transform(f,p=!1){if(p=!!p,typeof f=="number")return this.transformPosition(f,p);const m=f,E=new o.default(this.ops),y=new o.default(m.ops),_=new d;for(;E.hasNext()||y.hasNext();)if(E.peekType()==="insert"&&(p||y.peekType()!=="insert"))_.retain(a.default.length(E.next()));else if(y.peekType()==="insert")_.push(y.next());else{const T=Math.min(E.peekLength(),y.peekLength()),v=E.next(T),w=y.next(T);if(v.delete)continue;if(w.delete)_.push(w);else{const S=v.retain,L=w.retain;let B=typeof L=="object"&&L!==null?L:T;if(typeof S=="object"&&S!==null&&typeof L=="object"&&L!==null){const K=Object.keys(S)[0];if(K===Object.keys(L)[0]){const X=d.getHandler(K);X&&(B={[K]:X.transform(S[K],L[K],p)})}}_.retain(B,i.default.transform(v.attributes,w.attributes,p))}}return _.chop()}transformPosition(f,p=!1){p=!!p;const m=new o.default(this.ops);let E=0;for(;m.hasNext()&&E<=f;){const y=m.peekLength(),_=m.peekType();if(m.next(),_==="delete"){f-=Math.min(y,f-E);continue}else _==="insert"&&(E<f||!p)&&(f+=y);E+=y}return f}}d.Op=a.default,d.OpIterator=o.default,d.AttributeMap=i.default,d.handlers={},e.default=d,n.exports=d,n.exports.default=d})(Si,Si.exports);var qe=Si.exports;const k=ji(qe);class Ye extends ke{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Ye.blotName="break";Ye.tagName="BR";let Ze=class extends Kr{};function os(n){return n.replace(/[&<>"']/g,(e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e])))}let It=class jt extends Ki{static allowedChildren=[jt,Ye,ke,Ze];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(e,t){const r=jt.order.indexOf(e),s=jt.order.indexOf(t);return r>=0||s>=0?r-s:e===t?0:e<t?-1:1}formatAt(e,t,r,s){if(jt.compare(this.statics.blotName,r)<0&&this.scroll.query(r,D.BLOT)){const i=this.isolate(e,t);s&&i.wrap(r,s)}else super.formatAt(e,t,r,s)}optimize(e){if(super.optimize(e),this.parent instanceof jt&&jt.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}};const Za=1;class be extends tr{cache={};delta(){return this.cache.delta==null&&(this.cache.delta=ml(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,r,s){t<=0||(this.scroll.query(r,D.BLOCK)?e+t===this.length()&&this.format(r,s):super.formatAt(e,Math.min(t,this.length()-e-1),r,s),this.cache={})}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r),this.cache={};return}if(t.length===0)return;const s=t.split(`\n`),i=s.shift();i.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),i):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});let a=this;s.reduce(((o,c)=>(a=a.split(o,!0),a.insertAt(0,c),c.length)),e+i.length)}insertBefore(e,t){const{head:r}=this.children;super.insertBefore(e,t),r instanceof Ye&&r.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+Za),this.cache.length}moveChildren(e,t){super.moveChildren(e,t),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 t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t&&(e===0||e>=this.length()-Za)){const s=this.clone();return e===0?(this.parent.insertBefore(s,this),this):(this.parent.insertBefore(s,this.next),s)}const r=super.split(e,t);return this.cache={},r}}be.blotName="block";be.tagName="P";be.defaultChild=Ye;be.allowedChildren=[Ye,It,ke,Ze];let $e=class extends ke{attach(){super.attach(),this.attributes=new ns(this.domNode)}delta(){return(new k).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const r=this.scroll.query(e,D.BLOCK_ATTRIBUTE);r!=null&&this.attributes.attribute(r,t)}formatAt(e,t,r,s){this.format(r,s)}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r);return}const s=t.split(`\n`),i=s.pop(),a=s.map((c=>{const u=this.scroll.create(be.blotName);return u.insertAt(0,c),u})),o=this.split(e);a.forEach((c=>{this.parent.insertBefore(c,o)})),i&&this.parent.insertBefore(this.scroll.create("text",i),o)}};$e.scope=D.BLOCK_BLOT;function ml(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.descendants(Ne).reduce(((t,r)=>r.length()===0?t:t.insert(r.value(),De(r,{},e))),new k).insert(`\n`,De(n))}function De(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return n==null||("formats"in n&&typeof n.formats=="function"&&(e={...e,...n.formats()},t&&delete e["code-token"]),n.parent==null||n.parent.statics.blotName==="scroll"||n.parent.statics.scope!==n.statics.scope)?e:De(n.parent,e,t)}class Ke extends ke{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\ufeff";static value(){}constructor(e,t,r){super(e,t),this.selection=r,this.textNode=document.createTextNode(Ke.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,t){if(this.savedLength!==0){super.format(e,t);return}let r=this,s=0;for(;r!=null&&r.statics.scope!==D.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=Ke.CONTENTS.length,r.optimize(),r.formatAt(s,Ke.CONTENTS.length,e,t),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}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 e=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof Ze?this.prev:null,r=t?t.length():0,s=this.next instanceof Ze?this.next:null,i=s?s.text:"",{textNode:a}=this,o=a.data.split(Ke.CONTENTS).join("");a.data=Ke.CONTENTS;let c;if(t)c=t,(o||s)&&(t.insertAt(t.length(),o+i),s&&s.remove());else if(s)c=s,s.insertAt(0,o);else{const u=document.createTextNode(o);c=this.scroll.create(u),this.parent.insertBefore(c,this)}if(this.remove(),e){const u=(f,p)=>t&&f===t.domNode?p:f===a?r+p-1:s&&f===s.domNode?r+o.length+p:null,d=u(e.start.node,e.start.offset),g=u(e.end.node,e.end.offset);if(d!==null&&g!==null)return{startNode:c.domNode,startOffset:d,endNode:c.domNode,endOffset:g}}return null}update(e,t){if(e.some((r=>r.type==="characterData"&&r.target===this.textNode))){const r=this.restore();r&&(t.range=r)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if(t.domNode.tagName==="A"){this.savedLength=Ke.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}}var bl={exports:{}};(function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(t=!1));function s(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function i(c,u,d,g,f){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new s(d,g||c,f),m=t?t+u:u;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],p]:c._events[m].push(p):(c._events[m]=p,c._eventsCount++),c}function a(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],d,g;if(this._eventsCount===0)return u;for(g in d=this._events)e.call(d,g)&&u.push(t?g.slice(1):g);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},o.prototype.listeners=function(u){var d=t?t+u:u,g=this._events[d];if(!g)return[];if(g.fn)return[g.fn];for(var f=0,p=g.length,m=new Array(p);f<p;f++)m[f]=g[f].fn;return m},o.prototype.listenerCount=function(u){var d=t?t+u:u,g=this._events[d];return g?g.fn?1:g.length:0},o.prototype.emit=function(u,d,g,f,p,m){var E=t?t+u:u;if(!this._events[E])return!1;var y=this._events[E],_=arguments.length,T,v;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),_){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,d),!0;case 3:return y.fn.call(y.context,d,g),!0;case 4:return y.fn.call(y.context,d,g,f),!0;case 5:return y.fn.call(y.context,d,g,f,p),!0;case 6:return y.fn.call(y.context,d,g,f,p,m),!0}for(v=1,T=new Array(_-1);v<_;v++)T[v-1]=arguments[v];y.fn.apply(y.context,T)}else{var w=y.length,S;for(v=0;v<w;v++)switch(y[v].once&&this.removeListener(u,y[v].fn,void 0,!0),_){case 1:y[v].fn.call(y[v].context);break;case 2:y[v].fn.call(y[v].context,d);break;case 3:y[v].fn.call(y[v].context,d,g);break;case 4:y[v].fn.call(y[v].context,d,g,f);break;default:if(!T)for(S=1,T=new Array(_-1);S<_;S++)T[S-1]=arguments[S];y[v].fn.apply(y[v].context,T)}}return!0},o.prototype.on=function(u,d,g){return i(this,u,d,g,!1)},o.prototype.once=function(u,d,g){return i(this,u,d,g,!0)},o.prototype.removeListener=function(u,d,g,f){var p=t?t+u:u;if(!this._events[p])return this;if(!d)return a(this,p),this;var m=this._events[p];if(m.fn)m.fn===d&&(!f||m.once)&&(!g||m.context===g)&&a(this,p);else{for(var E=0,y=[],_=m.length;E<_;E++)(m[E].fn!==d||f&&!m[E].once||g&&m[E].context!==g)&&y.push(m[E]);y.length?this._events[p]=y.length===1?y[0]:y:a(this,p)}return this},o.prototype.removeAllListeners=function(u){var d;return u?(d=t?t+u:u,this._events[d]&&a(this,d)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,n.exports=o})(bl);var Tg=bl.exports;const Ag=ji(Tg),Li=new WeakMap,Ci=["error","warn","log","info"];let Ii="warn";function El(n){if(Ii&&Ci.indexOf(n)<=Ci.indexOf(Ii)){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];console[n](...t)}}function Et(n){return Ci.reduce(((e,t)=>(e[t]=El.bind(console,t,n),e)),{})}Et.level=n=>{Ii=n};El.level=Et.level;const ti=Et("quill:events"),wg=["selectionchange","mousedown","mouseup","click"];wg.forEach((n=>{document.addEventListener(n,(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach((s=>{const i=Li.get(s);i&&i.emitter&&i.emitter.handleDOM(...t)}))}))}));class M extends Ag{static 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"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",ti.error)}emit(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return ti.log.call(ti,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];(this.domListeners[e.type]||[]).forEach((i=>{let{node:a,handler:o}=i;(e.target===a||a.contains(e.target))&&o(e,...r)}))}listenDOM(e,t,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:r})}}const ni=Et("quill:selection");class Yt{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}}class Sg{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Yt(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,M.sources.USER),1)})),this.emitter.on(M.events.SCROLL_BEFORE_UPDATE,(()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(M.events.SCROLL_UPDATE,((s,i)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const a=i.some((o=>o.type==="characterData"||o.type==="childList"||o.type==="attributes"&&o.target===this.root));this.update(a?M.sources.SILENT:s)}catch{}}))})),this.emitter.on(M.events.SCROLL_OPTIMIZE,((r,s)=>{if(s.range){const{startNode:i,startOffset:a,endNode:o,endOffset:c}=s.range;this.setNativeRange(i,a,o,c),this.update(M.sources.SILENT)}})),this.update(M.sources.SILENT)}handleComposition(){this.emitter.on(M.events.COMPOSITION_BEFORE_START,(()=>{this.composing=!0})),this.emitter.on(M.events.COMPOSITION_END,(()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout((()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}),1)}}))}handleDragging(){this.emitter.listenDOM("mousedown",document.body,(()=>{this.mouseDown=!0})),this.emitter.listenDOM("mouseup",document.body,(()=>{this.mouseDown=!1,this.update(M.sources.USER)}))}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(e,D.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof Ne){const i=s.split(r.start.offset);s.parent.insertBefore(this.cursor,i)}else s.insertBefore(this.cursor,r.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.scroll.length();e=Math.min(e,r-1),t=Math.min(e+t,r-1)-e;let s,[i,a]=this.scroll.leaf(e);if(i==null)return null;if(t>0&&a===i.length()){const[d]=this.scroll.leaf(e+1);if(d){const[g]=this.scroll.line(e),[f]=this.scroll.line(e+1);g===f&&(i=d,a=0)}}[s,a]=i.position(a,!0);const o=document.createRange();if(t>0)return o.setStart(s,a),[i,a]=this.scroll.leaf(e+t),i==null?null:([s,a]=i.position(a,!0),o.setEnd(s,a),o.getBoundingClientRect());let c="left",u;if(s instanceof Text){if(!s.data.length)return null;a<s.data.length?(o.setStart(s,a),o.setEnd(s,a+1)):(o.setStart(s,a-1),o.setEnd(s,a),c="right"),u=o.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;u=i.domNode.getBoundingClientRect(),a>0&&(c="right")}return{bottom:u.top+u.height,height:u.height,left:u[c],right:u[c],top:u.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(t==null)return null;const r=this.normalizeNative(t);return ni.info("getNativeRange",r),r}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();return t==null?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&ri(this.root,document.activeElement)}normalizedToRange(e){const t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);const r=t.map((a=>{const[o,c]=a,u=this.scroll.find(o,!0),d=u.offset(this.scroll);return c===0?d:u instanceof Ne?d+u.index(o,c):d+u.length()})),s=Math.min(Math.max(...r),this.scroll.length()-1),i=Math.min(s,...r);return new Yt(i,s-i)}normalizeNative(e){if(!ri(this.root,e.startContainer)||!e.collapsed&&!ri(this.root,e.endContainer))return null;const t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach((r=>{let{node:s,offset:i}=r;for(;!(s instanceof Text)&&s.childNodes.length>0;)if(s.childNodes.length>i)s=s.childNodes[i],i=0;else if(s.childNodes.length===i)s=s.lastChild,s instanceof Text?i=s.data.length:s.childNodes.length>0?i=s.childNodes.length:i=s.childNodes.length+1;else break;r.node=s,r.offset=i})),t}rangeToNative(e){const t=this.scroll.length(),r=(s,i)=>{s=Math.min(t-1,s);const[a,o]=this.scroll.leaf(s);return a?a.position(o,i):[null,-1]};return[...r(e.index,!1),...r(e.index+e.length,!0)]}setNativeRange(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(ni.info("setNativeRange",e,t,r,s),e!=null&&(this.root.parentNode==null||e.parentNode==null||r.parentNode==null))return;const a=document.getSelection();if(a!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:o}=this.getNativeRange()||{};if(o==null||i||e!==o.startContainer||t!==o.startOffset||r!==o.endContainer||s!==o.endOffset){e instanceof Element&&e.tagName==="BR"&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),r instanceof Element&&r.tagName==="BR"&&(s=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const c=document.createRange();c.setStart(e,t),c.setEnd(r,s),a.removeAllRanges(),a.addRange(c)}}else a.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:M.sources.API;if(typeof t=="string"&&(r=t,t=!1),ni.info("setRange",e),e!=null){const s=this.rangeToNative(e);this.setNativeRange(...s,t)}else this.setNativeRange(null);this.update(r)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:M.sources.USER;const t=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!zi(t,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const a=this.cursor.restore();a&&this.setNativeRange(a.startNode,a.startOffset,a.endNode,a.endOffset)}const i=[M.events.SELECTION_CHANGE,Sn(this.lastRange),Sn(t),e];this.emitter.emit(M.events.EDITOR_CHANGE,...i),e!==M.sources.SILENT&&this.emitter.emit(...i)}}}function ri(n,e){try{e.parentNode}catch{return!1}return n.contains(e)}const xg=/^[ -~]*$/;class Og{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const r=Wa(e),s=new k;return Cg(r.ops.slice()).reduce(((a,o)=>{const c=qe.Op.length(o);let u=o.attributes||{},d=!1,g=!1;if(o.insert!=null){if(s.retain(c),typeof o.insert=="string"){const m=o.insert;g=!m.endsWith(`\n`)&&(t<=a||!!this.scroll.descendant($e,a)[0]),this.scroll.insertAt(a,m);const[E,y]=this.scroll.line(a);let _=St({},De(E));if(E instanceof be){const[T]=E.descendant(Ne,y);T&&(_=St(_,De(T)))}u=qe.AttributeMap.diff(_,u)||{}}else if(typeof o.insert=="object"){const m=Object.keys(o.insert)[0];if(m==null)return a;const E=this.scroll.query(m,D.INLINE)!=null;if(E)(t<=a||this.scroll.descendant($e,a)[0])&&(g=!0);else if(a>0){const[y,_]=this.scroll.descendant(Ne,a-1);y instanceof Ze?y.value()[_]!==`\n`&&(d=!0):y instanceof ke&&y.statics.scope===D.INLINE_BLOT&&(d=!0)}if(this.scroll.insertAt(a,m,o.insert[m]),E){const[y]=this.scroll.descendant(Ne,a);if(y){const _=St({},De(y));u=qe.AttributeMap.diff(_,u)||{}}}}t+=c}else if(s.push(o),o.retain!==null&&typeof o.retain=="object"){const m=Object.keys(o.retain)[0];if(m==null)return a;this.scroll.updateEmbedAt(a,m,o.retain[m])}Object.keys(u).forEach((m=>{this.scroll.formatAt(a,c,m,u[m])}));const f=d?1:0,p=g?1:0;return t+=f+p,s.retain(f),s.delete(p),a+c+f+p}),0),s.reduce(((a,o)=>typeof o.delete=="number"?(this.scroll.deleteAt(a,o.delete),a):a+qe.Op.length(o)),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update((new k).retain(e).delete(t))}formatLine(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(r).forEach((i=>{this.scroll.lines(e,Math.max(t,1)).forEach((a=>{a.format(i,r[i])}))})),this.scroll.optimize();const s=(new k).retain(e).retain(t,Sn(r));return this.update(s)}formatText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(r).forEach((i=>{this.scroll.formatAt(e,t,i,r[i])}));const s=(new k).retain(e).retain(t,Sn(r));return this.update(s)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce(((e,t)=>e.concat(t.delta())),new k)}getFormat(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=[],s=[];t===0?this.scroll.path(e).forEach((o=>{const[c]=o;c instanceof be?r.push(c):c instanceof Ne&&s.push(c)})):(r=this.scroll.lines(e,t),s=this.scroll.descendants(Ne,e,t));const[i,a]=[r,s].map((o=>{const c=o.shift();if(c==null)return{};let u=De(c);for(;Object.keys(u).length>0;){const d=o.shift();if(d==null)return u;u=Lg(De(d),u)}return u}));return{...i,...a}}getHTML(e,t){const[r,s]=this.scroll.line(e);if(r){const i=r.length();return r.length()>=s+t&&!(s===0&&t===i)?rr(r,s,t,!0):rr(this.scroll,e,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter((r=>typeof r.insert=="string")).map((r=>r.insert)).join("")}insertContents(e,t){const r=Wa(t),s=(new k).retain(e).concat(r);return this.scroll.insertContents(e,r),this.update(s)}insertEmbed(e,t,r){return this.scroll.insertAt(e,t,r),this.update((new k).retain(e).insert({[t]:r}))}insertText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,`\n`).replace(/\r/g,`\n`),this.scroll.insertAt(e,t),Object.keys(r).forEach((s=>{this.scroll.formatAt(e,t.length,s,r[s])})),this.update((new k).retain(e).insert(t,Sn(r)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if(e?.statics.blotName!==be.blotName)return!1;const t=e;return t.children.length>1?!1:t.children.head instanceof Ye}removeFormat(e,t){const r=this.getText(e,t),[s,i]=this.scroll.line(e+t);let a=0,o=new k;s!=null&&(a=s.length()-i,o=s.delta().slice(i,i+a-1).insert(`\n`));const u=this.getContents(e,t+a).diff((new k).insert(r).concat(o)),d=(new k).retain(e).concat(u);return this.applyDelta(d)}update(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const s=this.delta;if(t.length===1&&t[0].type==="characterData"&&t[0].target.data.match(xg)&&this.scroll.find(t[0].target)){const i=this.scroll.find(t[0].target),a=De(i),o=i.offset(this.scroll),c=t[0].oldValue.replace(Ke.CONTENTS,""),u=(new k).insert(c),d=(new k).insert(i.value()),g=r&&{oldRange:Ya(r.oldRange,-o),newRange:Ya(r.newRange,-o)};e=(new k).retain(o).concat(u.diff(d,g)).reduce(((p,m)=>m.insert?p.insert(m.insert,a):p.push(m)),new k),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!zi(s.compose(e),this.delta))&&(e=s.diff(this.delta,r));return e}}function Tn(n,e,t){if(n.length===0){const[p]=si(t.pop());return e<=0?`</li></${p}>`:`</li></${p}>${Tn([],e-1,t)}`}const[{child:r,offset:s,length:i,indent:a,type:o},...c]=n,[u,d]=si(o);if(a>e)return t.push(o),a===e+1?`<${u}><li${d}>${rr(r,s,i)}${Tn(c,a,t)}`:`<${u}><li>${Tn(n,e+1,t)}`;const g=t[t.length-1];if(a===e&&o===g)return`</li><li${d}>${rr(r,s,i)}${Tn(c,a,t)}`;const[f]=si(t.pop());return`</li></${f}>${Tn(n,e-1,t)}`}function rr(n,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in n&&typeof n.html=="function")return n.html(e,t);if(n instanceof Ze)return os(n.value().slice(e,e+t));if(n instanceof Ve){if(n.statics.blotName==="list-container"){const u=[];return n.children.forEachAt(e,t,((d,g,f)=>{const p="formats"in d&&typeof d.formats=="function"?d.formats():{};u.push({child:d,offset:g,length:f,indent:p.indent||0,type:p.list})})),Tn(u,-1,[])}const s=[];if(n.children.forEachAt(e,t,((u,d,g)=>{s.push(rr(u,d,g))})),r||n.statics.blotName==="list")return s.join("");const{outerHTML:i,innerHTML:a}=n.domNode,[o,c]=i.split(`>${a}<`);return o==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${c}`:`${o}>${s.join("")}<${c}`}return n.domNode instanceof Element?n.domNode.outerHTML:""}function Lg(n,e){return Object.keys(e).reduce(((t,r)=>{if(n[r]==null)return t;const s=e[r];return s===n[r]?t[r]=s:Array.isArray(s)?s.indexOf(n[r])<0?t[r]=s.concat([n[r]]):t[r]=s:t[r]=[s,n[r]],t}),{})}function si(n){const e=n==="ordered"?"ol":"ul";switch(n){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function Wa(n){return n.reduce(((e,t)=>{if(typeof t.insert=="string"){const r=t.insert.replace(/\r\n/g,`\n`).replace(/\r/g,`\n`);return e.insert(r,t.attributes)}return e.push(t)}),new k)}function Ya(n,e){let{index:t,length:r}=n;return new Yt(t+e,r)}function Cg(n){const e=[];return n.forEach((t=>{typeof t.insert=="string"?t.insert.split(`\n`).forEach(((s,i)=>{i&&e.push({insert:`\n`,attributes:t.attributes}),s&&e.push({insert:s,attributes:t.attributes})})):e.push(t)})),e}class it{static DEFAULTS={};constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}}const Ir="\ufeff";class Qi extends ke{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach((r=>{this.contentNode.appendChild(r)})),this.leftGuard=document.createTextNode(Ir),this.rightGuard=document.createTextNode(Ir),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t=null,r;const s=e.data.split(Ir).join("");if(e===this.leftGuard)if(this.prev instanceof Ze){const i=this.prev.length();this.prev.insertAt(i,s),t={startNode:this.prev.domNode,startOffset:i+s.length}}else r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this),t={startNode:r,startOffset:s.length};else e===this.rightGuard&&(this.next instanceof Ze?(this.next.insertAt(0,s),t={startNode:this.next.domNode,startOffset:s.length}):(r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this.next),t={startNode:r,startOffset:s.length}));return e.data=Ir,t}update(e,t){e.forEach((r=>{if(r.type==="characterData"&&(r.target===this.leftGuard||r.target===this.rightGuard)){const s=this.restore(r.target);s&&(t.range=s)}}))}}class Ig{isComposing=!1;constructor(e,t){this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",(e=>{this.isComposing||this.handleCompositionStart(e)})),this.scroll.domNode.addEventListener("compositionend",(e=>{this.isComposing&&queueMicrotask((()=>{this.handleCompositionEnd(e)}))}))}handleCompositionStart(e){const t=e.target instanceof Node?this.scroll.find(e.target,!0):null;t&&!(t instanceof Qi)&&(this.emitter.emit(M.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(M.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(M.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(M.events.COMPOSITION_END,e),this.isComposing=!1}}class kn{static DEFAULTS={modules:{}};static themes={default:kn};modules={};constructor(e,t){this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach((e=>{this.modules[e]==null&&this.addModule(e)}))}addModule(e){const t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}}const Rg=n=>n.parentElement||n.getRootNode().host||null,kg=n=>{const e=n.getBoundingClientRect(),t="offsetWidth"in n&&Math.abs(e.width)/n.offsetWidth||1,r="offsetHeight"in n&&Math.abs(e.height)/n.offsetHeight||1;return{top:e.top,right:e.left+n.clientWidth*t,bottom:e.top+n.clientHeight*r,left:e.left}},Rr=n=>{const e=parseInt(n,10);return Number.isNaN(e)?0:e},Qa=(n,e,t,r,s,i)=>n<t&&e>r?0:n<t?-(t-n+s):e>r?e-n>r-t?n+s-t:e-r+i:0,Mg=(n,e)=>{const t=n.ownerDocument;let r=e,s=n;for(;s;){const i=s===t.body,a=i?{top:0,right:window.visualViewport?.width??t.documentElement.clientWidth,bottom:window.visualViewport?.height??t.documentElement.clientHeight,left:0}:kg(s),o=getComputedStyle(s),c=Qa(r.left,r.right,a.left,a.right,Rr(o.scrollPaddingLeft),Rr(o.scrollPaddingRight)),u=Qa(r.top,r.bottom,a.top,a.bottom,Rr(o.scrollPaddingTop),Rr(o.scrollPaddingBottom));if(c||u)if(i)t.defaultView?.scrollBy(c,u);else{const{scrollLeft:d,scrollTop:g}=s;u&&(s.scrollTop+=u),c&&(s.scrollLeft+=c);const f=s.scrollLeft-d,p=s.scrollTop-g;r={left:r.left-f,top:r.top-p,right:r.right-f,bottom:r.bottom-p}}s=i||o.position==="fixed"?null:Rg(s)}},Dg=100,Bg=["block","break","cursor","inline","scroll","text"],$g=(n,e,t)=>{const r=new Cn;return Bg.forEach((s=>{const i=e.query(s);i&&r.register(i)})),n.forEach((s=>{let i=e.query(s);i||t.error(`Cannot register "${s}" specified in "formats" config. Are you sure it was registered?`);let a=0;for(;i;)if(r.register(i),i="blotName"in i?i.requiredContainer??null:null,a+=1,a>Dg){t.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}})),r},On=Et("quill"),kr=new Cn;Ve.uiClass="ql-ui";class N{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:kr,theme:"default"};static events=M.events;static sources=M.sources;static version="2.0.2";static imports={delta:k,parchment:cg,"core/module":it,"core/theme":kn};static debug(e){e===!0&&(e="log"),Et.level(e)}static find(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Li.get(e)||kr.find(e,t)}static import(e){return this.imports[e]==null&&On.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const e=arguments.length<=0?void 0:arguments[0],t=!!(!(arguments.length<=1)&&arguments[1]),r="attrName"in e?e.attrName:e.blotName;typeof r=="string"?this.register(`formats/${r}`,e,t):Object.keys(e).forEach((s=>{this.register(s,e[s],t)}))}else{const e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],r=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!r&&On.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&kr.register(t),typeof t.register=="function"&&t.register(kr)}}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=qg(e,t),this.container=this.options.container,this.container==null){On.error("Invalid Quill container",e);return}this.options.debug&&N.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Li.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new M;const s=Gi.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 Og(this.scroll),this.selection=new Sg(this.scroll,this.emitter),this.composition=new Ig(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(M.events.EDITOR_CHANGE,(a=>{a===M.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())})),this.emitter.on(M.events.SCROLL_UPDATE,((a,o)=>{const c=this.selection.lastRange,[u]=this.selection.getRange(),d=c&&u?{oldRange:c,newRange:u}:void 0;He.call(this,(()=>this.editor.update(null,o,d)),a)})),this.emitter.on(M.events.SCROLL_EMBED_UPDATE,((a,o)=>{const c=this.selection.lastRange,[u]=this.selection.getRange(),d=c&&u?{oldRange:c,newRange:u}:void 0;He.call(this,(()=>{const g=(new k).retain(a.offset(this)).retain({[a.statics.blotName]:o});return this.editor.update(g,[],d)}),N.sources.USER)})),r){const a=this.clipboard.convert({html:`${r}<p><br></p>`,text:`\n`});this.setContents(a)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e=="string"){const r=e;e=document.createElement("div"),e.classList.add(r)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,r){return[e,t,,r]=ft(e,t,r),He.call(this,(()=>this.editor.deleteText(e,t)),r,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:M.sources.API;return He.call(this,(()=>{const s=this.getSelection(!0);let i=new k;if(s==null)return i;if(this.scroll.query(e,D.BLOCK))i=this.editor.formatLine(s.index,s.length,{[e]:t});else{if(s.length===0)return this.selection.format(e,t),i;i=this.editor.formatText(s.index,s.length,{[e]:t})}return this.setSelection(s,M.sources.SILENT),i}),r)}formatLine(e,t,r,s,i){let a;return[e,t,a,i]=ft(e,t,r,s,i),He.call(this,(()=>this.editor.formatLine(e,t,a)),i,e,0)}formatText(e,t,r,s,i){let a;return[e,t,a,i]=ft(e,t,r,s,i),He.call(this,(()=>this.editor.formatText(e,t,a)),i,e,0)}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=null;if(typeof e=="number"?r=this.selection.getBounds(e,t):r=this.selection.getBounds(e.index,e.length),!r)return null;const s=this.container.getBoundingClientRect();return{bottom:r.bottom-s.top,height:r.height,left:r.left-s.left,right:r.right-s.left,top:r.top-s.top,width:r.width}}getContents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e;return[e,t]=ft(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e=="number"?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e!="number"?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}getModule(e){return this.theme.modules[e]}getSelection(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=ft(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=ft(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:N.sources.API;return He.call(this,(()=>this.editor.insertEmbed(e,t,r)),s,e)}insertText(e,t,r,s,i){let a;return[e,,a,i]=ft(e,0,r,s,i),He.call(this,(()=>this.editor.insertText(e,t,a)),i,e,t.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(e,t,r){return[e,t,,r]=ft(e,t,r),He.call(this,(()=>this.editor.removeFormat(e,t)),r,e)}scrollRectIntoView(e){Mg(this.root,e)}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 e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:M.sources.API;return He.call(this,(()=>{e=new k(e);const r=this.getLength(),s=this.editor.deleteText(0,r),i=this.editor.insertContents(0,e),a=this.editor.deleteText(this.getLength()-1,1);return s.compose(i).compose(a)}),t)}setSelection(e,t,r){e==null?this.selection.setRange(null,t||N.sources.API):([e,t,,r]=ft(e,t,r),this.selection.setRange(new Yt(Math.max(0,e),t),r),r!==M.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:M.sources.API;const r=(new k).insert(e);return this.setContents(r,t)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:M.sources.USER;const t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:M.sources.API;return He.call(this,(()=>(e=new k(e),this.editor.applyDelta(e))),t,!0)}}function Xa(n){return typeof n=="string"?document.querySelector(n):n}function ii(n){return Object.entries(n??{}).reduce(((e,t)=>{let[r,s]=t;return{...e,[r]:s===!0?{}:s}}),{})}function Ja(n){return Object.fromEntries(Object.entries(n).filter((e=>e[1]!==void 0)))}function qg(n,e){const t=Xa(n);if(!t)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===N.DEFAULTS.theme?kn:N.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:i,...a}=N.DEFAULTS,{modules:o,...c}=s.DEFAULTS;let u=ii(e.modules);u!=null&&u.toolbar&&u.toolbar.constructor!==Object&&(u={...u,toolbar:{container:u.toolbar}});const d=St({},ii(i),ii(o),u),g={...a,...Ja(c),...Ja(e)};let f=e.registry;return f?e.formats&&On.warn('Ignoring "formats" option because "registry" is specified'):f=e.formats?$g(e.formats,g.registry,On):g.registry,{...g,registry:f,container:t,theme:s,modules:Object.entries(d).reduce(((p,m)=>{let[E,y]=m;if(!y)return p;const _=N.import(`modules/${E}`);return _==null?(On.error(`Cannot load ${E} module. Are you sure you registered it?`),p):{...p,[E]:St({},_.DEFAULTS||{},y)}}),{}),bounds:Xa(g.bounds)}}function He(n,e,t,r){if(!this.isEnabled()&&e===M.sources.USER&&!this.allowReadOnlyEdits)return new k;let s=t==null?null:this.getSelection();const i=this.editor.delta,a=n();if(s!=null&&(t===!0&&(t=s.index),r==null?s=eo(s,a,e):r!==0&&(s=eo(s,t,r,e)),this.setSelection(s,M.sources.SILENT)),a.length()>0){const o=[M.events.TEXT_CHANGE,a,i,e];this.emitter.emit(M.events.EDITOR_CHANGE,...o),e!==M.sources.SILENT&&this.emitter.emit(...o)}return a}function ft(n,e,t,r,s){let i={};return typeof n.index=="number"&&typeof n.length=="number"?typeof e!="number"?(s=r,r=t,t=e,e=n.length,n=n.index):(e=n.length,n=n.index):typeof e!="number"&&(s=r,r=t,t=e,e=0),typeof t=="object"?(i=t,s=r):typeof t=="string"&&(r!=null?i[t]=r:s=t),s=s||M.sources.API,[n,e,i,s]}function eo(n,e,t,r){const s=typeof t=="number"?t:0;if(n==null)return null;let i,a;return e&&typeof e.transformPosition=="function"?[i,a]=[n.index,n.index+n.length].map((o=>e.transformPosition(o,r!==M.sources.USER))):[i,a]=[n.index,n.index+n.length].map((o=>o<e||o===e&&r===M.sources.USER?o:s>=0?o+s:Math.max(e,o+s))),new Yt(i,a-i)}class tn extends rs{}function to(n){return n instanceof be||n instanceof $e}function no(n){return typeof n.updateContent=="function"}class Pg extends Gi{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=be;static allowedChildren=[be,$e,tn];constructor(e,t,r){let{emitter:s}=r;super(e,t),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 e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(M.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(M.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(M.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[r,s]=this.line(e),[i]=this.line(e+t);if(super.deleteAt(e,t),i!=null&&r!==i&&s>0){if(r instanceof $e||i instanceof $e){this.optimize();return}const a=i.children.head instanceof Ye?null:i.children.head;r.moveChildren(i,a),r.remove()}this.optimize()}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,t,r,s){super.formatAt(e,t,r,s),this.optimize()}insertAt(e,t,r){if(e>=this.length())if(r==null||this.scroll.query(t,D.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),r==null&&t.endsWith(`\n`)?s.insertAt(0,t.slice(0,-1),r):s.insertAt(0,t,r)}else{const s=this.scroll.create(t,r);this.appendChild(s)}else super.insertAt(e,t,r);this.optimize()}insertBefore(e,t){if(e.statics.scope===D.INLINE_BLOT){const r=this.scroll.create(this.statics.defaultChild.blotName);r.appendChild(e),super.insertBefore(r,t)}else super.insertBefore(e,t)}insertContents(e,t){const r=this.deltaToRenderBlocks(t.concat((new k).insert(`\n`))),s=r.pop();if(s==null)return;this.batchStart();const i=r.shift();if(i){const c=i.type==="block"&&(i.delta.length()===0||!this.descendant($e,e)[0]&&e<this.length()),u=i.type==="block"?i.delta:(new k).insert({[i.key]:i.value});ai(this,e,u);const d=i.type==="block"?1:0,g=e+u.length()+d;c&&this.insertAt(g-1,`\n`);const f=De(this.line(e)[0]),p=qe.AttributeMap.diff(f,i.attributes)||{};Object.keys(p).forEach((m=>{this.formatAt(g-1,1,m,p[m])})),e=g}let[a,o]=this.children.find(e);if(r.length&&(a&&(a=a.split(o),o=0),r.forEach((c=>{if(c.type==="block"){const u=this.createBlock(c.attributes,a||void 0);ai(u,0,c.delta)}else{const u=this.create(c.key,c.value);this.insertBefore(u,a||void 0),Object.keys(c.attributes).forEach((d=>{u.format(d,c.attributes[d])}))}}))),s.type==="block"&&s.delta.length()){const c=a?a.offset(a.scroll)+o:this.length();ai(this,c,s.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(e){const t=this.path(e).pop();if(!t)return[null,-1];const[r,s]=t;return r instanceof Ne?[r,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(to,e)}lines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const r=(s,i,a)=>{let o=[],c=a;return s.children.forEachAt(i,a,((u,d,g)=>{to(u)?o.push(u):u instanceof rs&&(o=o.concat(r(u,d,c))),c-=g})),o};return r(this,e,t)}optimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(M.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch){Array.isArray(e)&&(this.batch=this.batch.concat(e));return}let t=M.sources.USER;typeof e=="string"&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter((r=>{let{target:s}=r;const i=this.find(s,!0);return i&&!no(i)})),e.length>0&&this.emitter.emit(M.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(M.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,r){const[s]=this.descendant((i=>i instanceof $e),e);s&&s.statics.blotName===t&&no(s)&&s.updateContent(r)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let r=new k;return e.forEach((s=>{const i=s?.insert;if(i)if(typeof i=="string"){const a=i.split(`\n`);a.slice(0,-1).forEach((c=>{r.insert(c,s.attributes),t.push({type:"block",delta:r,attributes:s.attributes??{}}),r=new k}));const o=a[a.length-1];o&&r.insert(o,s.attributes)}else{const a=Object.keys(i)[0];if(!a)return;this.query(a,D.INLINE)?r.push(s):(r.length()&&t.push({type:"block",delta:r,attributes:{}}),r=new k,t.push({type:"blockEmbed",key:a,value:i[a],attributes:s.attributes??{}}))}})),r.length()&&t.push({type:"block",delta:r,attributes:{}}),t}createBlock(e,t){let r;const s={};Object.entries(e).forEach((o=>{let[c,u]=o;this.query(c,D.BLOCK&D.BLOT)!=null?r=c:s[c]=u}));const i=this.create(r||this.statics.defaultChild.blotName,r?e[r]:void 0);this.insertBefore(i,t||void 0);const a=i.length();return Object.entries(s).forEach((o=>{let[c,u]=o;i.formatAt(0,a,c,u)})),i}}function ai(n,e,t){t.reduce(((r,s)=>{const i=qe.Op.length(s);let a=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const o=s.insert;n.insertAt(r,o);const[c]=n.descendant(Ne,r),u=De(c);a=qe.AttributeMap.diff(u,a)||{}}else if(typeof s.insert=="object"){const o=Object.keys(s.insert)[0];if(o==null)return r;if(n.insertAt(r,o,s.insert[o]),n.scroll.query(o,D.INLINE)!=null){const[u]=n.descendant(Ne,r),d=De(u);a=qe.AttributeMap.diff(d,a)||{}}}}return Object.keys(a).forEach((o=>{n.formatAt(r,i,o,a[o])})),r+i}),e)}const Xi={scope:D.BLOCK,whitelist:["right","center","justify"]},Ug=new rt("align","align",Xi),yl=new We("align","ql-align",Xi),_l=new Ct("align","text-align",Xi);class vl extends Ct{value(e){let t=super.value(e);return t.startsWith("rgb(")?(t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${t.split(",").map((s=>`00${parseInt(s,10).toString(16)}`.slice(-2))).join("")}`):t}}const Fg=new We("color","ql-color",{scope:D.INLINE}),Ji=new vl("color","color",{scope:D.INLINE}),Hg=new We("background","ql-bg",{scope:D.INLINE}),ea=new vl("background","background-color",{scope:D.INLINE});class nn extends tn{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map((r=>r.length()<=1?"":r.domNode.innerText)).join(`\n`).slice(e,e+t)}html(e,t){return`<pre>\n${os(this.code(e,t))}\n</pre>`}}class xe extends be{static TAB=" ";static register(){N.register(nn)}}class ta extends It{}ta.blotName="code";ta.tagName="CODE";xe.blotName="code-block";xe.className="ql-code-block";xe.tagName="DIV";nn.blotName="code-block-container";nn.className="ql-code-block-container";nn.tagName="DIV";nn.allowedChildren=[xe];xe.allowedChildren=[Ze,Ye,Ke];xe.requiredContainer=nn;const na={scope:D.BLOCK,whitelist:["rtl"]},Nl=new rt("direction","dir",na),Tl=new We("direction","ql-direction",na),Al=new Ct("direction","direction",na),wl={scope:D.INLINE,whitelist:["serif","monospace"]},Sl=new We("font","ql-font",wl);class zg extends Ct{value(e){return super.value(e).replace(/["']/g,"")}}const xl=new zg("font","font-family",wl),Ol=new We("size","ql-size",{scope:D.INLINE,whitelist:["small","large","huge"]}),Ll=new Ct("size","font-size",{scope:D.INLINE,whitelist:["10px","18px","32px"]}),Kg=Et("quill:keyboard"),Gg=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class ls extends it{static match(e,t){return["altKey","ctrlKey","metaKey","shiftKey"].some((r=>!!t[r]!==e[r]&&t[r]!==null))?!1:t.key===e.key||t.key===e.which}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach((r=>{this.options.bindings[r]&&this.addBinding(this.options.bindings[r])})),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},(()=>{})),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=Vg(e);if(s==null){Kg.warn("Attempted to add invalid keyboard binding",s);return}typeof t=="function"&&(t={handler:t}),typeof r=="function"&&(r={handler:r}),(Array.isArray(s.key)?s.key:[s.key]).forEach((a=>{const o={...s,key:a,...t,...r};this.bindings[o.key]=this.bindings[o.key]||[],this.bindings[o.key].push(o)}))}listen(){this.quill.root.addEventListener("keydown",(e=>{if(e.defaultPrevented||e.isComposing||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const s=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter((_=>ls.match(e,_)));if(s.length===0)return;const i=N.find(e.target,!0);if(i&&i.scroll!==this.quill.scroll)return;const a=this.quill.getSelection();if(a==null||!this.quill.hasFocus())return;const[o,c]=this.quill.getLine(a.index),[u,d]=this.quill.getLeaf(a.index),[g,f]=a.length===0?[u,d]:this.quill.getLeaf(a.index+a.length),p=u instanceof Kr?u.value().slice(0,d):"",m=g instanceof Kr?g.value().slice(f):"",E={collapsed:a.length===0,empty:a.length===0&&o.length()<=1,format:this.quill.getFormat(a),line:o,offset:c,prefix:p,suffix:m,event:e};s.some((_=>{if(_.collapsed!=null&&_.collapsed!==E.collapsed||_.empty!=null&&_.empty!==E.empty||_.offset!=null&&_.offset!==E.offset)return!1;if(Array.isArray(_.format)){if(_.format.every((T=>E.format[T]==null)))return!1}else if(typeof _.format=="object"&&!Object.keys(_.format).every((T=>_.format[T]===!0?E.format[T]!=null:_.format[T]===!1?E.format[T]==null:zi(_.format[T],E.format[T]))))return!1;return _.prefix!=null&&!_.prefix.test(E.prefix)||_.suffix!=null&&!_.suffix.test(E.suffix)?!1:_.handler.call(this,a,E,_)!==!0}))&&e.preventDefault()}))}handleBackspace(e,t){const r=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let s={};const[i]=this.quill.getLine(e.index);let a=(new k).retain(e.index-r).delete(r);if(t.offset===0){const[o]=this.quill.getLine(e.index-1);if(o&&!(o.statics.blotName==="block"&&o.length()<=1)){const u=i.formats(),d=this.quill.getFormat(e.index-1,1);if(s=qe.AttributeMap.diff(u,d)||{},Object.keys(s).length>0){const g=(new k).retain(e.index+i.length()-2).retain(1,s);a=a.compose(g)}}}this.quill.updateContents(a,N.sources.USER),this.quill.focus()}handleDelete(e,t){const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-r)return;let s={};const[i]=this.quill.getLine(e.index);let a=(new k).retain(e.index).delete(r);if(t.offset>=i.length()-1){const[o]=this.quill.getLine(e.index+1);if(o){const c=i.formats(),u=this.quill.getFormat(e.index,1);s=qe.AttributeMap.diff(c,u)||{},Object.keys(s).length>0&&(a=a.retain(o.length()-1).retain(1,s))}}this.quill.updateContents(a,N.sources.USER),this.quill.focus()}handleDeleteRange(e){ra({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const r=Object.keys(t.format).reduce(((i,a)=>(this.quill.scroll.query(a,D.BLOCK)&&!Array.isArray(t.format[a])&&(i[a]=t.format[a]),i)),{}),s=(new k).retain(e.index).delete(e.length).insert(`\n`,r);this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(e.index+1,N.sources.SILENT),this.quill.focus()}}const jg={bindings:{bold:oi("bold"),italic:oi("italic"),underline:oi("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",N.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","-1",N.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(n,e){e.format.indent!=null?this.quill.format("indent","-1",N.sources.USER):e.format.list!=null&&this.quill.format("list",!1,N.sources.USER)}},"indent code-block":ro(!0),"outdent code-block":ro(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(n){this.quill.deleteText(n.index-1,1,N.sources.USER)}},tab:{key:"Tab",handler(n,e){if(e.format.table)return!0;this.quill.history.cutoff();const t=(new k).retain(n.index).delete(n.length).insert("\t");return this.quill.updateContents(t,N.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index+1,N.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,N.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(n,e){const t={list:!1};e.format.indent&&(t.indent=!1),this.quill.formatLine(n.index,n.length,t,N.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(n){const[e,t]=this.quill.getLine(n.index),r={...e.formats(),list:"checked"},s=(new k).retain(n.index).insert(`\n`,r).retain(e.length()-t-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(n.index+1,N.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(n,e){const[t,r]=this.quill.getLine(n.index),s=(new k).retain(n.index).insert(`\n`,e.format).retain(t.length()-r-1).retain(1,{header:null});this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(n.index+1,N.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(n){const e=this.quill.getModule("table");if(e){const[t,r,s,i]=e.getTable(n),a=Zg(t,r,s,i);if(a==null)return;let o=t.offset();if(a<0){const c=(new k).retain(o).insert(`\n`);this.quill.updateContents(c,N.sources.USER),this.quill.setSelection(n.index+1,n.length,N.sources.SILENT)}else if(a>0){o+=t.length();const c=(new k).retain(o).insert(`\n`);this.quill.updateContents(c,N.sources.USER),this.quill.setSelection(o,N.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(n,e){const{event:t,line:r}=e,s=r.offset(this.quill.scroll);t.shiftKey?this.quill.setSelection(s-1,N.sources.USER):this.quill.setSelection(s+r.length(),N.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(n,e){if(this.quill.scroll.query("list")==null)return!0;const{length:t}=e.prefix,[r,s]=this.quill.getLine(n.index);if(s>t)return!0;let i;switch(e.prefix.trim()){case"[]":case"[ ]":i="unchecked";break;case"[x]":i="checked";break;case"-":case"*":i="bullet";break;default:i="ordered"}this.quill.insertText(n.index," ",N.sources.USER),this.quill.history.cutoff();const a=(new k).retain(n.index-s).delete(t+1).retain(r.length()-2-s).retain(1,{list:i});return this.quill.updateContents(a,N.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index-t,N.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(n){const[e,t]=this.quill.getLine(n.index);let r=2,s=e;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,r-=1,r<=0){const i=(new k).retain(n.index+e.length()-t-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(i,N.sources.USER),this.quill.setSelection(n.index-1,N.sources.SILENT),!1}return!0}},"embed left":Mr("ArrowLeft",!1),"embed left shift":Mr("ArrowLeft",!0),"embed right":Mr("ArrowRight",!1),"embed right shift":Mr("ArrowRight",!0),"table down":so(!1),"table up":so(!0)}};ls.DEFAULTS=jg;function ro(n){return{key:"Tab",shiftKey:!n,format:{"code-block":!0},handler(e,t){let{event:r}=t;const s=this.quill.scroll.query("code-block"),{TAB:i}=s;if(e.length===0&&!r.shiftKey){this.quill.insertText(e.index,i,N.sources.USER),this.quill.setSelection(e.index+i.length,N.sources.SILENT);return}const a=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:o,length:c}=e;a.forEach(((u,d)=>{n?(u.insertAt(0,i),d===0?o+=i.length:c+=i.length):u.domNode.textContent.startsWith(i)&&(u.deleteAt(0,i.length),d===0?o-=i.length:c-=i.length)})),this.quill.update(N.sources.USER),this.quill.setSelection(o,c,N.sources.SILENT)}}}function Mr(n,e){return{key:n,shiftKey:e,altKey:null,[n==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(r){let{index:s}=r;n==="ArrowRight"&&(s+=r.length+1);const[i]=this.quill.getLeaf(s);return i instanceof ke?(n==="ArrowLeft"?e?this.quill.setSelection(r.index-1,r.length+1,N.sources.USER):this.quill.setSelection(r.index-1,N.sources.USER):e?this.quill.setSelection(r.index,r.length+1,N.sources.USER):this.quill.setSelection(r.index+r.length+1,N.sources.USER),!1):!0}}}function oi(n){return{key:n[0],shortKey:!0,handler(e,t){this.quill.format(n,!t.format[n],N.sources.USER)}}}function so(n){return{key:n?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,t){const r=n?"prev":"next",s=t.line,i=s.parent[r];if(i!=null){if(i.statics.blotName==="table-row"){let a=i.children.head,o=s;for(;o.prev!=null;)o=o.prev,a=a.next;const c=a.offset(this.quill.scroll)+Math.min(t.offset,a.length()-1);this.quill.setSelection(c,0,N.sources.USER)}}else{const a=s.table()[r];a!=null&&(n?this.quill.setSelection(a.offset(this.quill.scroll)+a.length()-1,0,N.sources.USER):this.quill.setSelection(a.offset(this.quill.scroll),0,N.sources.USER))}return!1}}}function Vg(n){if(typeof n=="string"||typeof n=="number")n={key:n};else if(typeof n=="object")n=Sn(n);else return null;return n.shortKey&&(n[Gg]=n.shortKey,delete n.shortKey),n}function ra(n){let{quill:e,range:t}=n;const r=e.getLines(t);let s={};if(r.length>1){const i=r[0].formats(),a=r[r.length-1].formats();s=qe.AttributeMap.diff(a,i)||{}}e.deleteText(t,N.sources.USER),Object.keys(s).length>0&&e.formatLine(t.index,1,s,N.sources.USER),e.setSelection(t.index,N.sources.SILENT)}function Zg(n,e,t,r){return e.prev==null&&e.next==null?t.prev==null&&t.next==null?r===0?-1:1:t.prev==null?-1:1:e.prev==null?-1:e.next==null?1:null}const Wg=/font-weight:\s*normal/,Yg=["P","OL","UL"],io=n=>n&&Yg.includes(n.tagName),Qg=n=>{Array.from(n.querySelectorAll("br")).filter((e=>io(e.previousElementSibling)&&io(e.nextElementSibling))).forEach((e=>{e.parentNode?.removeChild(e)}))},Xg=n=>{Array.from(n.querySelectorAll('b[style*="font-weight"]')).filter((e=>e.getAttribute("style")?.match(Wg))).forEach((e=>{const t=n.createDocumentFragment();t.append(...e.childNodes),e.parentNode?.replaceChild(t,e)}))};function Jg(n){n.querySelector('[id^="docs-internal-guid-"]')&&(Xg(n),Qg(n))}const ep=/\bmso-list:[^;]*ignore/i,tp=/\bmso-list:[^;]*\bl(\d+)/i,np=/\bmso-list:[^;]*\blevel(\d+)/i,rp=(n,e)=>{const t=n.getAttribute("style"),r=t?.match(tp);if(!r)return null;const s=Number(r[1]),i=t?.match(np),a=i?Number(i[1]):1,o=new RegExp(`@list l${s}:level${a}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),c=e.match(o),u=c&&c[1]==="bullet"?"bullet":"ordered";return{id:s,indent:a,type:u,element:n}},sp=n=>{const e=Array.from(n.querySelectorAll("[style*=mso-list]")),t=[],r=[];e.forEach((a=>{(a.getAttribute("style")||"").match(ep)?t.push(a):r.push(a)})),t.forEach((a=>a.parentNode?.removeChild(a)));const s=n.documentElement.innerHTML,i=r.map((a=>rp(a,s))).filter((a=>a));for(;i.length;){const a=[];let o=i.shift();for(;o;)a.push(o),o=i.length&&i[0]?.element===o.element.nextElementSibling&&i[0].id===o.id?i.shift():null;const c=document.createElement("ul");a.forEach((g=>{const f=document.createElement("li");f.setAttribute("data-list",g.type),g.indent>1&&f.setAttribute("class",`ql-indent-${g.indent-1}`),f.innerHTML=g.element.innerHTML,c.appendChild(f)}));const u=a[0]?.element,{parentNode:d}=u??{};u&&d?.replaceChild(c,u),a.slice(1).forEach((g=>{let{element:f}=g;d?.removeChild(f)}))}};function ip(n){n.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&sp(n)}const ap=[ip,Jg],op=n=>{n.documentElement&&ap.forEach((e=>{e(n)}))},lp=Et("quill:clipboard"),cp=[[Node.TEXT_NODE,Np],[Node.TEXT_NODE,oo],["br",pp],[Node.ELEMENT_NODE,oo],[Node.ELEMENT_NODE,gp],[Node.ELEMENT_NODE,fp],[Node.ELEMENT_NODE,_p],["li",Ep],["ol, ul",yp],["pre",mp],["tr",vp],["b",li("bold")],["i",li("italic")],["strike",li("strike")],["style",bp]],up=[Ug,Nl].reduce(((n,e)=>(n[e.keyName]=e,n)),{}),ao=[_l,ea,Ji,Al,xl,Ll].reduce(((n,e)=>(n[e.keyName]=e,n)),{});class dp extends it{static DEFAULTS={matchers:[]};constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",(r=>this.onCaptureCopy(r,!1))),this.quill.root.addEventListener("cut",(r=>this.onCaptureCopy(r,!0))),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],cp.concat(this.options.matchers??[]).forEach((r=>{let[s,i]=r;this.addMatcher(s,i)}))}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:r}=e,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s[xe.blotName])return(new k).insert(r||"",{[xe.blotName]:s[xe.blotName]});if(!t)return(new k).insert(r||"",s);const i=this.convertHTML(t);return dr(i,`\n`)&&(i.ops[i.ops.length-1].attributes==null||s.table)?i.compose((new k).retain(i.length()-1).delete(1)):i}normalizeHTML(e){op(e)}convertHTML(e){const t=(new DOMParser).parseFromString(e,"text/html");this.normalizeHTML(t);const r=t.body,s=new WeakMap,[i,a]=this.prepareMatching(r,s);return sa(this.quill.scroll,r,i,a,s)}dangerouslyPasteHTML(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:N.sources.API;if(typeof e=="string"){const s=this.convert({html:e,text:""});this.quill.setContents(s,t),this.quill.setSelection(0,N.sources.SILENT)}else{const s=this.convert({html:t,text:""});this.quill.updateContents((new k).retain(e).concat(s),r),this.quill.setSelection(e+s.length(),N.sources.SILENT)}}onCaptureCopy(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();const[r]=this.quill.selection.getRange();if(r==null)return;const{html:s,text:i}=this.onCopy(r,t);e.clipboardData?.setData("text/plain",i),e.clipboardData?.setData("text/html",s),t&&ra({range:r,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter((t=>t[0]!=="#")).join(`\n`)}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(t==null)return;const r=e.clipboardData?.getData("text/html");let s=e.clipboardData?.getData("text/plain");if(!r&&!s){const a=e.clipboardData?.getData("text/uri-list");a&&(s=this.normalizeURIList(a))}const i=Array.from(e.clipboardData?.files||[]);if(!r&&i.length>0){this.quill.uploader.upload(t,i);return}if(r&&i.length>0){const a=(new DOMParser).parseFromString(r,"text/html");if(a.body.childElementCount===1&&a.body.firstElementChild?.tagName==="IMG"){this.quill.uploader.upload(t,i);return}}this.onPaste(t,{html:r,text:s})}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:r,html:s}=t;const i=this.quill.getFormat(e.index),a=this.convert({text:r,html:s},i);lp.log("onPaste",a,{text:r,html:s});const o=(new k).retain(e.index).delete(e.length).concat(a);this.quill.updateContents(o,N.sources.USER),this.quill.setSelection(o.length()-e.length,N.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const r=[],s=[];return this.matchers.forEach((i=>{const[a,o]=i;switch(a){case Node.TEXT_NODE:s.push(o);break;case Node.ELEMENT_NODE:r.push(o);break;default:Array.from(e.querySelectorAll(a)).forEach((c=>{t.has(c)?t.get(c)?.push(o):t.set(c,[o])}));break}})),[r,s]}}function rn(n,e,t,r){return r.query(e)?n.reduce(((s,i)=>{if(!i.insert)return s;if(i.attributes&&i.attributes[e])return s.push(i);const a=t?{[e]:t}:{};return s.insert(i.insert,{...a,...i.attributes})}),new k):n}function dr(n,e){let t="";for(let r=n.ops.length-1;r>=0&&t.length<e.length;--r){const s=n.ops[r];if(typeof s.insert!="string")break;t=s.insert+t}return t.slice(-1*e.length)===e}function At(n,e){if(!(n instanceof Element))return!1;const t=e.query(n);return t&&t.prototype instanceof ke?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(n.tagName.toLowerCase())}function hp(n,e){return n.previousElementSibling&&n.nextElementSibling&&!At(n.previousElementSibling,e)&&!At(n.nextElementSibling,e)}const Dr=new WeakMap;function Cl(n){return n==null?!1:(Dr.has(n)||(n.tagName==="PRE"?Dr.set(n,!0):Dr.set(n,Cl(n.parentNode))),Dr.get(n))}function sa(n,e,t,r,s){return e.nodeType===e.TEXT_NODE?r.reduce(((i,a)=>a(e,i,n)),new k):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce(((i,a)=>{let o=sa(n,a,t,r,s);return a.nodeType===e.ELEMENT_NODE&&(o=t.reduce(((c,u)=>u(a,c,n)),o),o=(s.get(a)||[]).reduce(((c,u)=>u(a,c,n)),o)),i.concat(o)}),new k):new k}function li(n){return(e,t,r)=>rn(t,n,!0,r)}function fp(n,e,t){const r=rt.keys(n),s=We.keys(n),i=Ct.keys(n),a={};return r.concat(s).concat(i).forEach((o=>{let c=t.query(o,D.ATTRIBUTE);c!=null&&(a[c.attrName]=c.value(n),a[c.attrName])||(c=up[o],c!=null&&(c.attrName===o||c.keyName===o)&&(a[c.attrName]=c.value(n)||void 0),c=ao[o],c!=null&&(c.attrName===o||c.keyName===o)&&(c=ao[o],a[c.attrName]=c.value(n)||void 0))})),Object.entries(a).reduce(((o,c)=>{let[u,d]=c;return rn(o,u,d,t)}),e)}function gp(n,e,t){const r=t.query(n);if(r==null)return e;if(r.prototype instanceof ke){const s={},i=r.value(n);if(i!=null)return s[r.blotName]=i,(new k).insert(s,r.formats(n,t))}else if(r.prototype instanceof tr&&!dr(e,`\n`)&&e.insert(`\n`),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return rn(e,r.blotName,r.formats(n,t),t);return e}function pp(n,e){return dr(e,`\n`)||e.insert(`\n`),e}function mp(n,e,t){const r=t.query("code-block"),s=r&&"formats"in r&&typeof r.formats=="function"?r.formats(n,t):!0;return rn(e,"code-block",s,t)}function bp(){return new k}function Ep(n,e,t){const r=t.query(n);if(r==null||r.blotName!=="list"||!dr(e,`\n`))return e;let s=-1,i=n.parentNode;for(;i!=null;)["OL","UL"].includes(i.tagName)&&(s+=1),i=i.parentNode;return s<=0?e:e.reduce(((a,o)=>o.insert?o.attributes&&typeof o.attributes.indent=="number"?a.push(o):a.insert(o.insert,{indent:s,...o.attributes||{}}):a),new k)}function yp(n,e,t){const r=n;let s=r.tagName==="OL"?"ordered":"bullet";const i=r.getAttribute("data-checked");return i&&(s=i==="true"?"checked":"unchecked"),rn(e,"list",s,t)}function oo(n,e,t){if(!dr(e,`\n`)){if(At(n,t)&&(n.childNodes.length>0||n instanceof HTMLParagraphElement))return e.insert(`\n`);if(e.length()>0&&n.nextSibling){let r=n.nextSibling;for(;r!=null;){if(At(r,t))return e.insert(`\n`);const s=t.query(r);if(s&&s.prototype instanceof $e)return e.insert(`\n`);r=r.firstChild}}}return e}function _p(n,e,t){const r={},s=n.style||{};return s.fontStyle==="italic"&&(r.italic=!0),s.textDecoration==="underline"&&(r.underline=!0),s.textDecoration==="line-through"&&(r.strike=!0),(s.fontWeight?.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(r.bold=!0),e=Object.entries(r).reduce(((i,a)=>{let[o,c]=a;return rn(i,o,c,t)}),e),parseFloat(s.textIndent||0)>0?(new k).insert("\t").concat(e):e}function vp(n,e,t){const r=n.parentElement?.tagName==="TABLE"?n.parentElement:n.parentElement?.parentElement;if(r!=null){const i=Array.from(r.querySelectorAll("tr")).indexOf(n)+1;return rn(e,"table",i,t)}return e}function Np(n,e,t){let r=n.data;if(n.parentElement?.tagName==="O:P")return e.insert(r.trim());if(!Cl(n)){if(r.trim().length===0&&r.includes(`\n`)&&!hp(n,t))return e;const s=(i,a)=>{const o=a.replace(/[^\u00a0]/g,"");return o.length<1&&i?" ":o};r=r.replace(/\r\n/g," ").replace(/\n/g," "),r=r.replace(/\s\s+/g,s.bind(s,!0)),(n.previousSibling==null&&n.parentElement!=null&&At(n.parentElement,t)||n.previousSibling instanceof Element&&At(n.previousSibling,t))&&(r=r.replace(/^\s+/,s.bind(s,!1))),(n.nextSibling==null&&n.parentElement!=null&&At(n.parentElement,t)||n.nextSibling instanceof Element&&At(n.nextSibling,t))&&(r=r.replace(/\s+$/,s.bind(s,!1)))}return e.insert(r)}class Tp extends it{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(e,t){super(e,t),this.quill.on(N.events.EDITOR_CHANGE,((r,s,i,a)=>{r===N.events.SELECTION_CHANGE?s&&a!==N.sources.SILENT&&(this.currentRange=s):r===N.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||a===N.sources.USER?this.record(s,i):this.transform(s)),this.currentRange=Ri(this.currentRange,s))})),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",(r=>{r.inputType==="historyUndo"?(this.undo(),r.preventDefault()):r.inputType==="historyRedo"&&(this.redo(),r.preventDefault())}))}change(e,t){if(this.stack[e].length===0)return;const r=this.stack[e].pop();if(!r)return;const s=this.quill.getContents(),i=r.delta.invert(s);this.stack[t].push({delta:i,range:Ri(r.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(r.delta,N.sources.USER),this.ignoreChange=!1,this.restoreSelection(r)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(e.ops.length===0)return;this.stack.redo=[];let r=e.invert(t),s=this.currentRange;const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const a=this.stack.undo.pop();a&&(r=r.compose(a.delta),s=a.range)}else this.lastRecorded=i;r.length()!==0&&(this.stack.undo.push({delta:r,range:s}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){lo(this.stack.undo,e),lo(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,N.sources.USER);else{const t=wp(this.quill.scroll,e.delta);this.quill.setSelection(t,N.sources.USER)}}}function lo(n,e){let t=e;for(let r=n.length-1;r>=0;r-=1){const s=n[r];n[r]={delta:t.transform(s.delta,!0),range:s.range&&Ri(s.range,t)},t=s.delta.transform(t),n[r].delta.length()===0&&n.splice(r,1)}}function Ap(n,e){const t=e.ops[e.ops.length-1];return t==null?!1:t.insert!=null?typeof t.insert=="string"&&t.insert.endsWith(`\n`):t.attributes!=null?Object.keys(t.attributes).some((r=>n.query(r,D.BLOCK)!=null)):!1}function wp(n,e){const t=e.reduce(((s,i)=>s+(i.delete||0)),0);let r=e.length()-t;return Ap(n,e)&&(r-=1),r}function Ri(n,e){if(!n)return n;const t=e.transformPosition(n.index),r=e.transformPosition(n.index+n.length);return{index:t,length:r-t}}class Il extends it{constructor(e,t){super(e,t),e.root.addEventListener("drop",(r=>{r.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(r.clientX,r.clientY);s=document.createRange(),s.setStart(a.offsetNode,a.offset),s.setEnd(a.offsetNode,a.offset)}const i=s&&e.selection.normalizeNative(s);if(i){const a=e.selection.normalizedToRange(i);r.dataTransfer?.files&&this.upload(a,r.dataTransfer.files)}}))}upload(e,t){const r=[];Array.from(t).forEach((s=>{s&&this.options.mimetypes?.includes(s.type)&&r.push(s)})),r.length>0&&this.options.handler.call(this,e,r)}}Il.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(n,e){if(!this.quill.scroll.query("image"))return;const t=e.map((r=>new Promise((s=>{const i=new FileReader;i.onload=()=>{s(i.result)},i.readAsDataURL(r)}))));Promise.all(t).then((r=>{const s=r.reduce(((i,a)=>i.insert({image:a})),(new k).retain(n.index).delete(n.length));this.quill.updateContents(s,M.sources.USER),this.quill.setSelection(n.index+r.length,M.sources.SILENT)}))}};const Sp=["insertText","insertReplacementText"];class xp extends it{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",(r=>{this.handleBeforeInput(r)})),/Android/i.test(navigator.userAgent)||e.on(N.events.COMPOSITION_BEFORE_START,(()=>{this.handleCompositionStart()}))}deleteRange(e){ra({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(e.length===0)return!1;if(t){const r=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents((new k).retain(e.index).insert(t,r),N.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,N.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!Sp.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const r=Op(e);if(r==null)return;const s=this.quill.selection.normalizeNative(t),i=s?this.quill.selection.normalizedToRange(s):null;i&&this.replaceText(i,r)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function Op(n){return typeof n.data=="string"?n.data:n.dataTransfer?.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const Lp=/Mac/i.test(navigator.platform),Cp=100,Ip=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||Lp&&n.key==="a"&&n.ctrlKey===!0);class Rp extends it{isListening=!1;selectionChangeDeadline=0;constructor(e,t){super(e,t),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,t){let{line:r,event:s}=t;if(!(r instanceof Ve)||!r.uiNode)return!0;const i=getComputedStyle(r.domNode).direction==="rtl";return i&&s.key!=="ArrowRight"||!i&&s.key!=="ArrowLeft"?!0:(this.quill.setSelection(e.index-1,e.length+(s.shiftKey?1:0),N.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",(e=>{!e.defaultPrevented&&Ip(e)&&this.ensureListeningToSelectionChange()}))}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+Cp,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 t=e.getRangeAt(0);if(t.collapsed!==!0||t.startOffset!==0)return;const r=this.quill.scroll.find(t.startContainer);if(!(r instanceof Ve)||!r.uiNode)return;const s=document.createRange();s.setStartAfter(r.uiNode),s.setEndAfter(r.uiNode),e.removeAllRanges(),e.addRange(s)}}N.register({"blots/block":be,"blots/block/embed":$e,"blots/break":Ye,"blots/container":tn,"blots/cursor":Ke,"blots/embed":Qi,"blots/inline":It,"blots/scroll":Pg,"blots/text":Ze,"modules/clipboard":dp,"modules/history":Tp,"modules/keyboard":ls,"modules/uploader":Il,"modules/input":xp,"modules/uiNode":Rp});class kp extends We{add(e,t){let r=0;if(t==="+1"||t==="-1"){const s=this.value(e)||0;r=t==="+1"?s+1:s-1}else typeof t=="number"&&(r=t);return r===0?(this.remove(e),!0):super.add(e,r.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}const Mp=new kp("indent","ql-indent",{scope:D.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Dp extends be{static blotName="blockquote";static tagName="blockquote"}class Bp extends be{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}}class hr extends tn{}hr.blotName="list-container";hr.tagName="OL";class fr extends be{static create(e){const t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){N.register(hr)}constructor(e,t){super(e,t);const r=t.ownerDocument.createElement("span"),s=i=>{if(!e.isEnabled())return;const a=this.statics.formats(t,e);a==="checked"?(this.format("list","unchecked"),i.preventDefault()):a==="unchecked"&&(this.format("list","checked"),i.preventDefault())};r.addEventListener("mousedown",s),r.addEventListener("touchstart",s),this.attachUI(r)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}fr.blotName="list";fr.tagName="LI";hr.allowedChildren=[fr];fr.requiredContainer=hr;class ia extends It{static blotName="bold";static tagName=["STRONG","B"];static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}class $p extends ia{static blotName="italic";static tagName=["EM","I"]}class Vr extends It{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(e){const t=super.create(e);return t.setAttribute("href",this.sanitize(e)),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t}static formats(e){return e.getAttribute("href")}static sanitize(e){return Rl(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e!==this.statics.blotName||!t?super.format(e,t):this.domNode.setAttribute("href",this.constructor.sanitize(t))}}function Rl(n,e){const t=document.createElement("a");t.href=n;const r=t.href.slice(0,t.href.indexOf(":"));return e.indexOf(r)>-1}class qp extends It{static blotName="script";static tagName=["SUB","SUP"];static create(e){return e==="super"?document.createElement("sup"):e==="sub"?document.createElement("sub"):super.create(e)}static formats(e){if(e.tagName==="SUB")return"sub";if(e.tagName==="SUP")return"super"}}class Pp extends ia{static blotName="strike";static tagName=["S","STRIKE"]}class Up extends It{static blotName="underline";static tagName="U"}class Fp extends Qi{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return typeof e=="string"&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`<span>${e}</span>`}}const co=["alt","height","width"];let Hp=class extends ke{static blotName="image";static tagName="IMG";static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return co.reduce(((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t)),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return Rl(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){co.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}};const uo=["height","width"];class zp extends $e{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(e){const t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return uo.reduce(((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t)),{})}static sanitize(e){return Vr.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){uo.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}}const Wn=new We("code-token","hljs",{scope:D.INLINE});class mt extends It{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(xe.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,r){super(e,t,r),Wn.add(this.domNode,r)}format(e,t){e!==mt.blotName?super.format(e,t):t?Wn.add(this.domNode,t):(Wn.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),Wn.value(this.domNode)||this.unwrap()}}mt.blotName="code-token";mt.className="ql-token";class Be extends xe{static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("data-language",e),t}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-language",t):super.format(e,t)}replaceWith(e,t){return this.formatAt(0,this.length(),mt.blotName,!1),super.replaceWith(e,t)}}class Qn extends nn{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===Be.blotName&&(this.forceNext=!0,this.children.forEach((r=>{r.format(e,t)})))}formatAt(e,t,r,s){r===Be.blotName&&(this.forceNext=!0),super.formatAt(e,t,r,s)}highlight(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const s=`${Array.from(this.domNode.childNodes).filter((a=>a!==this.uiNode)).map((a=>a.textContent)).join(`\n`)}\n`,i=Be.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==s){if(s.trim().length>0||this.cachedText==null){const a=this.children.reduce(((c,u)=>c.concat(ml(u,!1))),new k),o=e(s,i);a.diff(o).reduce(((c,u)=>{let{retain:d,attributes:g}=u;return d?(g&&Object.keys(g).forEach((f=>{[Be.blotName,mt.blotName].includes(f)&&this.formatAt(c,d,f,g[f])})),c+d):c}),0)}this.cachedText=s,this.forceNext=!1}}html(e,t){const[r]=this.children.find(e);return`<pre data-language="${r?Be.formats(r.domNode):"plain"}">\n${os(this.code(e,t))}\n</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=Be.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}Qn.allowedChildren=[Be];Be.requiredContainer=Qn;Be.allowedChildren=[mt,Ke,Ze,Ye];const Kp=(n,e,t)=>{if(typeof n.versionString=="string"){const r=n.versionString.split(".")[0];if(parseInt(r,10)>=11)return n.highlight(t,{language:e}).value}return n.highlight(e,t).value};class kl extends it{static register(){N.register(mt,!0),N.register(Be,!0),N.register(Qn,!0)}constructor(e,t){if(super(e,t),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce(((r,s)=>{let{key:i}=s;return r[i]=!0,r}),{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(N.events.SCROLL_BLOT_MOUNT,(e=>{if(!(e instanceof Qn))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach((r=>{let{key:s,label:i}=r;const a=t.ownerDocument.createElement("option");a.textContent=i,a.setAttribute("value",s),t.appendChild(a)})),t.addEventListener("change",(()=>{e.format(Be.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)})),e.uiNode==null&&(e.attachUI(t),e.children.head&&(t.value=Be.formats(e.children.head.domNode)))}))}initTimer(){let e=null;this.quill.on(N.events.SCROLL_OPTIMIZE,(()=>{e&&clearTimeout(e),e=setTimeout((()=>{this.highlight(),e=null}),this.options.interval)}))}highlight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(N.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(Qn):[e]).forEach((i=>{i.highlight(this.highlightBlot,t)})),this.quill.update(N.sources.SILENT),r!=null&&this.quill.setSelection(r,N.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(t=this.languages[t]?t:"plain",t==="plain")return os(e).split(`\n`).reduce(((s,i,a)=>(a!==0&&s.insert(`\n`,{[xe.blotName]:t}),s.insert(i))),new k);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(xe.className),r.innerHTML=Kp(this.options.hljs,t,e),sa(this.quill.scroll,r,[(s,i)=>{const a=Wn.value(s);return a?i.compose((new k).retain(i.length(),{[mt.blotName]:a})):i}],[(s,i)=>s.data.split(`\n`).reduce(((a,o,c)=>(c!==0&&a.insert(`\n`,{[xe.blotName]:t}),a.insert(o))),i)],new WeakMap)}}kl.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"}]};class Ge extends be{static blotName="table";static tagName="TD";static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",aa()),t}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(e,t){e===Ge.blotName&&t?this.domNode.setAttribute("data-row",t):super.format(e,t)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}class Qt extends tn{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const e=this.children.head.formats(),t=this.children.tail.formats(),r=this.next.children.head.formats(),s=this.next.children.tail.formats();return e.table===t.table&&e.table===r.table&&e.table===s.table}return!1}optimize(e){super.optimize(e),this.children.forEach((t=>{if(t.next==null)return;const r=t.formats(),s=t.next.formats();if(r.table!==s.table){const i=this.splitAfter(t);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}}class xt extends tn{static blotName="table-body";static tagName="TBODY"}class Zr extends tn{static blotName="table-container";static tagName="TABLE";balanceCells(){const e=this.descendants(Qt),t=e.reduce(((r,s)=>Math.max(s.children.length,r)),0);e.forEach((r=>{new Array(t-r.children.length).fill(0).forEach((()=>{let s;r.children.head!=null&&(s=Ge.formats(r.children.head.domNode));const i=this.scroll.create(Ge.blotName,s);r.appendChild(i),i.optimize()}))}))}cells(e){return this.rows().map((t=>t.children.at(e)))}deleteColumn(e){const[t]=this.descendant(xt);t==null||t.children.head==null||t.children.forEach((r=>{const s=r.children.at(e);s?.remove()}))}insertColumn(e){const[t]=this.descendant(xt);t==null||t.children.head==null||t.children.forEach((r=>{const s=r.children.at(e),i=Ge.formats(r.children.head.domNode),a=this.scroll.create(Ge.blotName,i);r.insertBefore(a,s)}))}insertRow(e){const[t]=this.descendant(xt);if(t==null||t.children.head==null)return;const r=aa(),s=this.scroll.create(Qt.blotName);t.children.head.children.forEach((()=>{const a=this.scroll.create(Ge.blotName,r);s.appendChild(a)}));const i=t.children.at(e);t.insertBefore(s,i)}rows(){const e=this.children.head;return e==null?[]:e.children.map((t=>t))}}Zr.allowedChildren=[xt];xt.requiredContainer=Zr;xt.allowedChildren=[Qt];Qt.requiredContainer=xt;Qt.allowedChildren=[Ge];Ge.requiredContainer=Qt;function aa(){return`row-${Math.random().toString(36).slice(2,6)}`}class Gp extends it{static register(){N.register(Ge),N.register(Qt),N.register(xt),N.register(Zr)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Zr).forEach((e=>{e.balanceCells()}))}deleteColumn(){const[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update(N.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(N.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const t=e.offset();e.remove(),this.quill.update(N.sources.USER),this.quill.setSelection(t,N.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];const[t,r]=this.quill.getLine(e.index);if(t==null||t.statics.blotName!==Ge.blotName)return[null,null,null,-1];const s=t.parent;return[s.parent.parent,s,t,r]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[r,s,i]=this.getTable(t);if(i==null)return;const a=i.cellOffset();r.insertColumn(a+e),this.quill.update(N.sources.USER);let o=s.rowOffset();e===0&&(o+=1),this.quill.setSelection(t.index+o,t.length,N.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[r,s,i]=this.getTable(t);if(i==null)return;const a=s.rowOffset();r.insertRow(a+e),this.quill.update(N.sources.USER),e>0?this.quill.setSelection(t,N.sources.SILENT):this.quill.setSelection(t.index+s.children.length,t.length,N.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const r=this.quill.getSelection();if(r==null)return;const s=new Array(e).fill(0).reduce((i=>{const a=new Array(t).fill(`\n`).join("");return i.insert(a,{table:aa()})}),(new k).retain(r.index));this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(r.index,N.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(N.events.SCROLL_OPTIMIZE,(e=>{e.some((t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.quill.once(N.events.TEXT_CHANGE,((r,s,i)=>{i===N.sources.USER&&this.balanceTables()})),!0):!1))}))}}const ho=Et("quill:toolbar");class oa extends it{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const r=document.createElement("div");r.setAttribute("role","toolbar"),jp(r,this.options.container),e.container?.parentNode?.insertBefore(r,e.container),this.container=r}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){ho.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach((r=>{const s=this.options.handlers?.[r];s&&this.addHandler(r,s)})),Array.from(this.container.querySelectorAll("button, select")).forEach((r=>{this.attach(r)})),this.quill.on(N.events.EDITOR_CHANGE,(()=>{const[r]=this.quill.selection.getRange();this.update(r)}))}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find((s=>s.indexOf("ql-")===0));if(!t)return;if(t=t.slice(3),e.tagName==="BUTTON"&&e.setAttribute("type","button"),this.handlers[t]==null&&this.quill.scroll.query(t)==null){ho.warn("ignoring attaching to nonexistent format",t,e);return}const r=e.tagName==="SELECT"?"change":"click";e.addEventListener(r,(s=>{let i;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const o=e.options[e.selectedIndex];o.hasAttribute("selected")?i=!1:i=o.value||!1}else e.classList.contains("ql-active")?i=!1:i=e.value||!e.hasAttribute("value"),s.preventDefault();this.quill.focus();const[a]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,i);else if(this.quill.scroll.query(t).prototype instanceof ke){if(i=prompt(`Enter ${t}`),!i)return;this.quill.updateContents((new k).retain(a.index).delete(a.length).insert({[t]:i}),N.sources.USER)}else this.quill.format(t,i,N.sources.USER);this.update(a)})),this.controls.push([t,e])}update(e){const t=e==null?{}:this.quill.getFormat(e);this.controls.forEach((r=>{const[s,i]=r;if(i.tagName==="SELECT"){let a=null;if(e==null)a=null;else if(t[s]==null)a=i.querySelector("option[selected]");else if(!Array.isArray(t[s])){let o=t[s];typeof o=="string"&&(o=o.replace(/"/g,'\\"')),a=i.querySelector(`option[value="${o}"]`)}a==null?(i.value="",i.selectedIndex=-1):a.selected=!0}else if(e==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const a=t[s],o=a===i.getAttribute("value")||a!=null&&a.toString()===i.getAttribute("value")||a==null&&!i.getAttribute("value");i.classList.toggle("ql-active",o),i.setAttribute("aria-pressed",o.toString())}else{const a=t[s]!=null;i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}}))}}oa.DEFAULTS={};function fo(n,e,t){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${e}`),r.setAttribute("aria-pressed","false"),t!=null?(r.value=t,r.setAttribute("aria-label",`${e}: ${t}`)):r.setAttribute("aria-label",e),n.appendChild(r)}function jp(n,e){Array.isArray(e[0])||(e=[e]),e.forEach((t=>{const r=document.createElement("span");r.classList.add("ql-formats"),t.forEach((s=>{if(typeof s=="string")fo(r,s);else{const i=Object.keys(s)[0],a=s[i];Array.isArray(a)?Vp(r,i,a):fo(r,i,a)}})),n.appendChild(r)}))}function Vp(n,e,t){const r=document.createElement("select");r.classList.add(`ql-${e}`),t.forEach((s=>{const i=document.createElement("option");s!==!1?i.setAttribute("value",String(s)):i.setAttribute("selected","selected"),r.appendChild(i)})),n.appendChild(r)}oa.DEFAULTS={container:null,handlers:{clean(){const n=this.quill.getSelection();if(n!=null)if(n.length===0){const e=this.quill.getFormat();Object.keys(e).forEach((t=>{this.quill.scroll.query(t,D.INLINE)!=null&&this.quill.format(t,!1,N.sources.USER)}))}else this.quill.removeFormat(n.index,n.length,N.sources.USER)},direction(n){const{align:e}=this.quill.getFormat();n==="rtl"&&e==null?this.quill.format("align","right",N.sources.USER):!n&&e==="right"&&this.quill.format("align",!1,N.sources.USER),this.quill.format("direction",n,N.sources.USER)},indent(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e),r=parseInt(t.indent||0,10);if(n==="+1"||n==="-1"){let s=n==="+1"?1:-1;t.direction==="rtl"&&(s*=-1),this.quill.format("indent",r+s,N.sources.USER)}},link(n){n===!0&&(n=prompt("Enter link URL:")),this.quill.format("link",n,N.sources.USER)},list(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e);n==="check"?t.list==="checked"||t.list==="unchecked"?this.quill.format("list",!1,N.sources.USER):this.quill.format("list","unchecked",N.sources.USER):this.quill.format("list",n,N.sources.USER)}}};const Zp='<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>',Wp='<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>',Yp='<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>',Qp='<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>',Xp='<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>',Jp='<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>',em='<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>',tm='<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>',go='<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>',nm='<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>',rm='<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>',sm='<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>',im='<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>',am='<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>',om='<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>',lm='<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>',cm='<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>',um='<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>',dm='<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>',hm='<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>',fm='<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>',gm='<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>',pm='<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>',mm='<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>',bm='<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>',Em='<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>',ym='<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>',_m='<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>',vm='<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>',Nm='<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>',Tm='<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>',Am='<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>',wm='<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>',sr={align:{"":Zp,center:Wp,right:Yp,justify:Qp},background:Xp,blockquote:Jp,bold:em,clean:tm,code:go,"code-block":go,color:nm,direction:{"":rm,rtl:sm},formula:im,header:{1:am,2:om,3:lm,4:cm,5:um,6:dm},italic:hm,image:fm,indent:{"+1":gm,"-1":pm},link:mm,list:{bullet:bm,check:Em,ordered:ym},script:{sub:_m,super:vm},strike:Nm,table:Tm,underline:Am,video:wm},Sm='<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 po=0;function mo(n,e){n.setAttribute(e,`${n.getAttribute(e)!=="true"}`)}class cs{constructor(e){this.select=e,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",(t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault();break}})),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),mo(this.label,"aria-expanded"),mo(this.options,"aria-hidden")}buildItem(e){const t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");const r=e.getAttribute("value");return r&&t.setAttribute("data-value",r),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",(()=>{this.selectItem(t,!0)})),t.addEventListener("keydown",(s=>{switch(s.key){case"Enter":this.selectItem(t,!0),s.preventDefault();break;case"Escape":this.escape(),s.preventDefault();break}})),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=Sm,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${po}`,po+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach((t=>{const r=this.buildItem(t);e.appendChild(r),t.selected===!0&&this.selectItem(r)})),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach((e=>{this.container.setAttribute(e.name,e.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(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.container.querySelector(".ql-selected");e!==r&&(r?.classList.remove("ql-selected"),e!=null&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const t=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class Ml extends cs{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach((r=>{r.classList.add("ql-primary")}))}buildItem(e){const t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);const r=this.label.querySelector(".ql-color-label"),s=e&&e.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=s:r.style.fill=s)}}class Dl extends cs{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach((r=>{r.innerHTML=t[r.getAttribute("data-value")||""]})),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const r=e||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const xm=n=>{const{overflowY:e}=getComputedStyle(n,null);return e!=="visible"&&e!=="clip"};let Bl=class{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,xm(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(e){const t=e.left+e.width/2-this.root.offsetWidth/2,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let a=0;if(i.right>s.right&&(a=s.right-i.right,this.root.style.left=`${t+a}px`),i.left<s.left&&(a=s.left-i.left,this.root.style.left=`${t+a}px`),i.bottom>s.bottom){const o=i.bottom-i.top,c=e.bottom-e.top+o;this.root.style.top=`${r-c}px`,this.root.classList.add("ql-flip")}return a}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}};const Om=[!1,"center","right","justify"],Lm=["#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"],Cm=[!1,"serif","monospace"],Im=["1","2","3",!1],Rm=["small",!1,"large","huge"];class gr extends kn{constructor(e,t){super(e,t);const r=s=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(s.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach((i=>{i.container.contains(s.target)||i.close()}))};e.emitter.listenDOM("click",document.body,r)}addModule(e){const t=super.addModule(e);return e==="toolbar"&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach((r=>{(r.getAttribute("class")||"").split(/\s+/).forEach((i=>{if(i.startsWith("ql-")&&(i=i.slice(3),t[i]!=null))if(i==="direction")r.innerHTML=t[i][""]+t[i].rtl;else if(typeof t[i]=="string")r.innerHTML=t[i];else{const a=r.value||"";a!=null&&t[i][a]&&(r.innerHTML=t[i][a])}}))}))}buildPickers(e,t){this.pickers=Array.from(e).map((s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&Zn(s,Om),typeof t.align=="object"))return new Dl(s,t.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&&Zn(s,Lm,i==="background"?"#ffffff":"#000000"),new Ml(s,t[i])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?Zn(s,Cm):s.classList.contains("ql-header")?Zn(s,Im):s.classList.contains("ql-size")&&Zn(s,Rm)),new cs(s)}));const r=()=>{this.pickers.forEach((s=>{s.update()}))};this.quill.on(M.events.EDITOR_CHANGE,r)}}gr.DEFAULTS=St({},kn.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let n=this.container.querySelector("input.ql-image[type=file]");n==null&&(n=document.createElement("input"),n.setAttribute("type","file"),n.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),n.classList.add("ql-image"),n.addEventListener("change",(()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,n.files),n.value=""})),this.container.appendChild(n)),n.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class $l extends Bl{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",(e=>{e.key==="Enter"?(this.save(),e.preventDefault()):e.key==="Escape"&&(this.cancel(),e.preventDefault())}))}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",t=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;t!=null?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,M.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,M.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=km(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(t!=null){const r=t.index+t.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),e,M.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",M.sources.USER),this.quill.setSelection(r+2,M.sources.USER)}break}}this.textbox.value="",this.hide()}}function km(n){let e=n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=n.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:n}function Zn(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach((r=>{const s=document.createElement("option");r===t?s.setAttribute("selected","selected"):s.setAttribute("value",String(r)),n.appendChild(s)}))}const Mm=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Dm extends $l{static 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("");constructor(e,t){super(e,t),this.quill.on(M.events.EDITOR_CHANGE,((r,s,i,a)=>{if(r===M.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&a===M.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const o=this.quill.getLines(s.index,s.length);if(o.length===1){const c=this.quill.getBounds(s);c!=null&&this.position(c)}else{const c=o[o.length-1],u=this.quill.getIndex(c),d=Math.min(c.length()-1,s.index+s.length-u),g=this.quill.getBounds(new Yt(u,d));g!=null&&this.position(g)}}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(M.events.SCROLL_OPTIMIZE,(()=>{setTimeout((()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(e!=null){const t=this.quill.getBounds(e);t!=null&&this.position(t)}}),1)}))}cancel(){this.show()}position(e){const t=super.position(e),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",t!==0&&(r.style.marginLeft=`${-1*t-r.offsetWidth/2}px`),t}}class ql extends gr{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=Mm),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new Dm(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),sr),this.buildPickers(e.container.querySelectorAll("select"),sr))}}ql.DEFAULTS=St({},gr.DEFAULTS,{modules:{toolbar:{handlers:{link(n){n?this.quill.theme.tooltip.edit():this.quill.format("link",!1,N.sources.USER)}}}}});const Bm=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class $m extends $l{static 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("");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 t=this.linkRange;this.restoreFocus(),this.quill.formatText(t,"link",!1,M.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()})),this.quill.on(M.events.SELECTION_CHANGE,((e,t,r)=>{if(e!=null){if(e.length===0&&r===M.sources.USER){const[s,i]=this.quill.scroll.descendant(Vr,e.index);if(s!=null){this.linkRange=new Yt(e.index-i,s.length());const a=Vr.formats(s.domNode);this.preview.textContent=a,this.preview.setAttribute("href",a),this.show();const o=this.quill.getBounds(this.linkRange);o!=null&&this.position(o);return}}else delete this.linkRange;this.hide()}}))}show(){super.show(),this.root.removeAttribute("data-mode")}}class Pl extends gr{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=Bm),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),sr),this.buildPickers(e.container.querySelectorAll("select"),sr),this.tooltip=new $m(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},((t,r)=>{e.handlers.link.call(e,!r.format.link)})))}}Pl.DEFAULTS=St({},gr.DEFAULTS,{modules:{toolbar:{handlers:{link(n){if(n){const e=this.quill.getSelection();if(e==null||e.length===0)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&t.indexOf("mailto:")!==0&&(t=`mailto:${t}`);const{tooltip:r}=this.quill.theme;r.edit("link",t)}else this.quill.format("link",!1,N.sources.USER)}}}}});N.register({"attributors/attribute/direction":Nl,"attributors/class/align":yl,"attributors/class/background":Hg,"attributors/class/color":Fg,"attributors/class/direction":Tl,"attributors/class/font":Sl,"attributors/class/size":Ol,"attributors/style/align":_l,"attributors/style/background":ea,"attributors/style/color":Ji,"attributors/style/direction":Al,"attributors/style/font":xl,"attributors/style/size":Ll},!0);N.register({"formats/align":yl,"formats/direction":Tl,"formats/indent":Mp,"formats/background":ea,"formats/color":Ji,"formats/font":Sl,"formats/size":Ol,"formats/blockquote":Dp,"formats/code-block":xe,"formats/header":Bp,"formats/list":fr,"formats/bold":ia,"formats/code":ta,"formats/italic":$p,"formats/link":Vr,"formats/script":qp,"formats/strike":Pp,"formats/underline":Up,"formats/formula":Fp,"formats/image":Hp,"formats/video":zp,"modules/syntax":kl,"modules/table":Gp,"modules/toolbar":oa,"themes/bubble":ql,"themes/snow":Pl,"ui/icons":sr,"ui/picker":cs,"ui/icon-picker":Dl,"ui/color-picker":Ml,"ui/tooltip":Bl},!0);var Me={generateFilename(){return btoa(String(Math.random()*1e6)+String(+new Date)).replace("=","")},urlIsImage(n,e=3e3){return this.validURL(n)?/\.(jpeg|jpg|gif|png|webp|tiff|bmp)$/.test(n)?Promise.resolve(!0):new Promise(((t,r)=>{let s;const i=new Image;i.onerror=i.onabort=()=>{clearTimeout(s),r(!1)},i.onload=()=>{clearTimeout(s),t(!0)},s=setTimeout((()=>{i.src="//!/an/invalid.jpg",r(!1)}),e),i.src=n})):Promise.reject(!1)},urlIsImageDataUrl(n){return/^data:image\/\w+;base64,/.test(n)},validURL(n){try{return!!new URL(n)}catch{return!1}},isRichText(n){let e=!1,t=!1;return Array.prototype.forEach.call(n,(r=>{r.kind==="string"&&r.type.match(/^text\/html$/i)&&(e=!0),r.kind==="file"&&r.type.match(/^image\/\w+$/i)&&(t=!0)})),e&&!t},resolveDataUrl(n,e){let t="";return typeof n=="string"?t=n:n instanceof ArrayBuffer&&(t=this.arrayBufferToBase64Url(n,e)),t},binaryStringToArrayBuffer(n){const e=n.length,t=new ArrayBuffer(e),r=new Uint8Array(t);let s=-1;for(;++s<e;)r[s]=n.charCodeAt(s);return t},arrayBufferToBase64Url(n,e){return`data:${e};base64,`+btoa(new Uint8Array(n).reduce(((t,r)=>t+String.fromCharCode(r)),""))},copyText(n,e=document.body){const t=document.createElement("textarea"),r=document.activeElement;t.value=n,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="12pt";const s=document.getSelection();let i=!1;s&&s.rangeCount>0&&(i=s.getRangeAt(0)),e.append(t),t.select(),t.selectionStart=0,t.selectionEnd=n.length;let a=!1;try{a=document.execCommand("copy")}catch{}return t.remove(),s&&i&&(s.removeAllRanges(),s.addRange(i)),r&&r.focus(),a},isType(n,e){return Object.prototype.toString.call(n)===`[object ${e}]`},isObject(n){return this.isType(n,"Object")}};class qm{constructor(e,t,r){this.dataUrl=e,this.type=t,this.name=r||""}}class ir extends qm{constructor(e,t,r){super(e,t,r),this.dataUrl=e,this.type=t,this.name=r||`${Me.generateFilename()}.${this.getSuffix()}`}minify(e){return new Promise(((t,r)=>{const s=e.maxWidth||800,i=e.maxHeight||800,a=e.quality||.8;if(!this.dataUrl)return r({message:"[error] QuillImageDropAndPaste: Fail to minify the image, dataUrl should not be empty."});const o=new Image;o.onload=()=>{const c=o.width,u=o.height;c>u?c>s&&(o.height=u*s/c,o.width=s):u>i&&(o.width=c*i/u,o.height=i);const d=document.createElement("canvas");d.width=o.width,d.height=o.height;const g=d.getContext("2d");if(g){g.drawImage(o,0,0,o.width,o.height);const f=this.type||"image/png",p=d.toDataURL(f,a);t(new ir(p,f,this.name))}else r({message:"[error] QuillImageDropAndPaste: Fail to minify the image, create canvas context failure."})},o.src=Me.resolveDataUrl(this.dataUrl,this.type)}))}toFile(e){return e=e||this.name,window.File?new File([this.toBlob()],e,{type:this.type}):(console.error("[error] QuillImageDropAndPaste: Your browser didnot support File API."),null)}toBlob(){const e=Me.resolveDataUrl(this.dataUrl,this.type).replace(/^[^,]+,/,""),t=Me.binaryStringToArrayBuffer(atob(e));return this.createBlob([t],{type:this.type})}createBlob(e,t){t||(t={}),typeof t=="string"&&(t={type:t});try{return new Blob(e,t)}catch(r){if(r.name!=="TypeError")throw r;const s="BlobBuilder"in window?window.BlobBuilder:"MSBlobBuilder"in window?window.MSBlobBuilder:"MozBlobBuilder"in window?window.MozBlobBuilder:window.WebKitBlobBuilder,i=new s;for(let a=0;a<e.length;a++)i.append(e[a]);return i.getBlob(t.type)}}getSuffix(){const e=this.type.match(/^image\/(\w+)$/);return e?e[1]:"png"}}class Pm{constructor(e,t){this.quill=e,this.option=t}}class us extends Pm{constructor(e,t){var r;super(e,t),typeof t.autoConvert!="boolean"&&(t.autoConvert=!0),t.enableNativeUploader!==!0&&Me.isObject(e.uploader)&&Me.isObject((r=e.uploader)===null||r===void 0?void 0:r.options)&&(e.uploader.options.handler=()=>{}),this.quill=e,this.option=t,this.handleDrop=this.handleDrop.bind(this),this.handlePaste=this.handlePaste.bind(this),this.insert=this.insert.bind(this),this.quill.root.addEventListener("drop",this.handleDrop,!1),this.quill.root.addEventListener("paste",this.handlePaste,!1)}handleDrop(e){if(e.dataTransfer&&e.dataTransfer.files&&e.dataTransfer.files.length){if(e.preventDefault(),document.caretRangeFromPoint){const t=document.getSelection(),r=document.caretRangeFromPoint(e.clientX,e.clientY);t&&r&&t.setBaseAndExtent(r.startContainer,r.startOffset,r.startContainer,r.startOffset)}this.readFiles(e.dataTransfer.files,((t,r="image/png",s)=>{typeof this.option.handler=="function"?this.option.handler.call(this,t,r,new ir(t,r,s)):this.insert.call(this,Me.resolveDataUrl(t,r),r)}),e)}}handlePaste(e){if(e.clipboardData&&e.clipboardData.items&&e.clipboardData.items.length){if(Me.isRichText(e.clipboardData.items))return;this.readFiles(e.clipboardData.items,((t,r="image/png")=>{typeof this.option.handler=="function"?this.option.handler.call(this,t,r,new ir(t,r)):this.insert(Me.resolveDataUrl(t,r),"image")}),e)}}readFiles(e,t,r){Array.prototype.forEach.call(e,(s=>{Me.isType(s,"DataTransferItem")?this.handleDataTransfer(s,t,r):s instanceof File&&this.handleDroppedFile(s,t,r)}))}handleDataTransfer(e,t,r){const s=this,{type:i}=e;if(i.match(/^image\/(gif|jpe?g|a?png|svg|webp|bmp)/i)){r.preventDefault();const a=new FileReader;a.onload=c=>{c.target&&c.target.result&&t(c.target.result,i)};const o=e.getAsFile?e.getAsFile():e;o instanceof Blob&&a.readAsDataURL(o)}else i.match(/^text\/plain$/i)&&e.getAsString((a=>{if(Me.urlIsImageDataUrl(a)){const o=a.match(/^data:(image\/\w+);base64,/),c=o?o[1]:"image/png",u=this.getIndex();t(a,c),this.quill.deleteText(u,a.length,"user"),this.quill.setSelection(u)}else this.option.autoConvert&&Me.urlIsImage(a).then((()=>{setTimeout((()=>{const o=this.getIndex();this.quill.deleteText(o-a.length,a.length,"user"),s.insert(a,"image",o-a.length)}))})).catch((()=>{}))}))}handleDroppedFile(e,t,r){const{type:s,name:i=""}=e;if(s.match(/^image\/(gif|jpe?g|a?png|svg|webp|bmp)/i)){r.preventDefault();const a=new FileReader;a.onload=o=>{o.target&&o.target.result&&t(o.target.result,s,i)},a.readAsDataURL(e)}}insert(e,t,r){r=r===void 0?this.getIndex():r;let s;t.startsWith("image")?(s=r+1,this.quill.insertEmbed(r,"image",e,"user")):t.startsWith("text")&&(s=r+e.length,this.quill.insertText(r,e,"user")),setTimeout((()=>{this.quill.setSelection(s)}))}getIndex(){let e=(this.quill.getSelection(!0)||{}).index;return(e===void 0||e<0)&&(e=this.quill.getLength()),e}}us.ImageData=ir;window.QuillImageDropAndPaste=us;"Quill"in window&&window.Quill.register("modules/imageDropAndPaste",us);function Wr(n){return n.varName?` for '${n.varName}'`:""}function Um(n){return!isNaN(n)&&!isNaN(parseFloat(n))}function Fm(n,e={}){if(n==null||n===""&&!e.allowEmpty)throw new Error(`Missing string value${Wr(e)}`);return typeof n=="string"?n:n.toString()}function Hm(n,e={}){return n==null||n===""&&!e.allowEmpty?void 0:Fm(n,e)}function zm(n,e={}){if(typeof n=="number")return n;if(n==null)throw new Error(`Missing number value${Wr(e)}`);if(typeof n=="string"&&Um(n))return Number(n);throw new Error(`Cannot convert to number the value of type '${typeof n}'${Wr(e)}`)}function bo(n,e={}){return n==null?void 0:zm(n,e)}function Km(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function Gm(n,e={}){if(Km(n))return n;const t=n===null?"null":Array.isArray(n)?"array":typeof n;throw new Error(`invalid object value '${t}'${Wr(e)}`)}var Ul=n=>n!=null&&(n=Object.getPrototypeOf(n),n===Array.prototype||n===Object.prototype);function Fl(n,e,t){for(const[r,s]of Object.entries(e)){const i=`${t}.${r}`;n[i]=s,Ul(s)&&Fl(n,s,i)}}function jm(n){const e={...n};for(const[t,r]of Object.entries(n))Ul(r)&&Fl(e,r,t);return e}var Vm=(n,e)=>{if(e)for(const[t,r]of Object.entries(e))n=n.replace(new RegExp(`{{\\s*${t}\\s*}}`,"g"),r);return n},Zm=n=>n;function Wm(n,e=Zm){return(t,...r)=>{t[0]==="."&&(t=t.slice(1));const s=n()?.[t];switch(typeof s){case"function":return s(...r);case"string":return e(s,r[0]);default:return s}}}const Ym={insertHtmlSnippetMessage:"Insert a HTML Snippet",obfuscate:"Obfuscate"},Qm="image",Xm="Validate",Jm="Cancel",eb="Remove",tb="Done",nb="Image not inserted, place cursor in editor first",rb="HTML Snippet",sb="Confirm Deletion",ib={content:"Are you sure you want to delete this HTML Snippet?"},ab={variantLabel:"Size {{ n }}",sizes:"Sizes",imageProperties:"Image properties",left:"Left",right:"Right",center:"Center",alignment:"Alignment",options:"Options",enableZoom:"Enable zoom"},ob={obfuscator:"Obfuscator",content:"Content:",asALink:"As a link",doNotObfuscate:"Do not obfuscate"},lb={insertVideo:"Insert a Video",dialog:{title:"Set a video"}},cb={insertLink:"Insert an internal link"},ub={CustomToolbar:Ym,image:Qm,validate:Xm,delete:"Delete",cancel:Jm,remove:eb,done:tb,editorFocusLost:nb,htmlSnippetLabel:rb,confirmDeletion:sb,comfirmSnippetDeletionDialog:ib,makeImagePropertiesDialog:ab,openObfuscatorDialog:ob,videoPlugin:lb,internalLinkPlugin:cb},db={insertHtmlSnippetMessage:"Insérer un extrait de code HTML",obfuscate:"Obfusquer"},hb="image",fb="Valider",gb="Annuler",pb="Terminé",mb="L'image n'a pas été insérée, mettre d'abord le curseur dans l'éditeur",bb="Code HTML",Eb="Confirmer la suppression",yb="Retirer",_b={content:"Voulez-vous vraiment supprimer ce code HTML ?"},vb={variantLabel:"Taille {{ n }}",sizes:"Tailles",imageProperties:"Propriétés de l'image",left:"À gauche",right:"À droite",center:"Centrer",alignment:"Alignement",options:"Options",enableZoom:"Activer le zoom"},Nb={obfuscator:"Obfusqueur",content:"Contenu:",asALink:"En tant que lien",doNotObfuscate:"Ne pas obfusquer"},Tb={insertVideo:"Insérer une vidéo",dialog:{title:"Définir une vidéo"}},Ab={insertLink:"Insérer un lien interne"},wb={CustomToolbar:db,image:hb,validate:fb,delete:"Supprimer",cancel:gb,done:pb,editorFocusLost:mb,htmlSnippetLabel:bb,confirmDeletion:Eb,remove:yb,comfirmSnippetDeletionDialog:_b,makeImagePropertiesDialog:vb,openObfuscatorDialog:Nb,videoPlugin:Tb,internalLinkPlugin:Ab},Eo={en:ub,fr:wb};function Rt(n){const e=hi((()=>{const r=n()in Eo?n():"en";return jm(Eo[r])}));return{t:Wm(e,Vm)}}var Sb=W('<textarea autofocus class="QpInput QpHtmlSnippetInput"rows=8 cols=80>'),Hl=W('<button class="QpBtn secondary"type=button>'),xb=W("<button class=QpBtn type=button>"),Ob=W('<button class="QpBtn danger outlined"type=button>'),Lb=W("<p>"),Cb=W('<button class="QpBtn danger"type=button>');async function zl({service:n,language:e,mode:t,html:r}){const{t:s}=Rt(e),[i,a]=je(r??""),o=()=>{c.close({action:"remove"})},c=n.createModalDialog({content:(()=>{var u=Sb();return u.addEventListener("change",(d=>a(d.target.value))),wn((()=>u.value=i())),u})(),footer:[t==="update"&&(()=>{var u=Ob();return u.$$click=()=>{Ib({deleteSnippet:o,closeDialog:()=>{c.close()},language:e,service:n})},G(u,(()=>s("delete"))),u})(),(()=>{var u=Hl();return u.$$click=()=>c.close(),G(u,(()=>s("cancel"))),u})(),(()=>{var u=xb();return u.$$click=()=>c.close({action:t,values:{html:i()}}),G(u,(()=>s("validate"))),u})()],header:s("htmlSnippetLabel")});return await c.open()}function Ib({closeDialog:n,deleteSnippet:e,language:t,service:r}){const{t:s}=Rt(t),i=r.createModalDialog({header:s("confirmDeletion"),content:(()=>{var a=Lb();return G(a,(()=>s("comfirmSnippetDeletionDialog.content"))),a})(),footer:[(()=>{var a=Hl();return a.$$click=()=>{i.hide()},G(a,(()=>s("cancel"))),a})(),(()=>{var a=Cb();return a.$$click=()=>{i.hide(),e()},G(a,(()=>s("validate"))),a})()]});i.show()}Xr(["click"]);var Rb=W("<div class=QpSpinner>");function kb(){return Rb()}var Mb=W('<button class="QpBtn outlined danger"type=button>'),Db=W("<button class=QpBtn type=button>"),ci=W("<h2 class=FieldLabel>"),yo=W("<div class=QpOption>"),Bb=W("<div><label><input type=checkbox name=enableZoom>"),$b=W("<button type=button> <small class=ml-1>(<!>)"),qb=W("<button type=button>");async function Pb({language:n,imageUid:e,themeConf:t,service:r,...s}){const{t:i}=Rt(n),[a,o]=je(!1),[c,u]=je(),[d,g]=je(),[f,p]=je(s.zoom),m=hi((()=>t.fTextImages.map(((v,w)=>({size:v,label:i("makeImagePropertiesDialog.variantLabel",{n:w+1})})))),[t,n()]),E=hi((()=>[{align:"left",label:i("makeImagePropertiesDialog.left")},{align:"center",label:i("makeImagePropertiesDialog.center")},{align:"right",label:i("makeImagePropertiesDialog.right")}]),[n()]),y=async()=>{const v=c();if(!e||!v)throw new Error("missing a find variant name");o(!0);const{url:w,displayWidth:S,displayHeight:L}=await r.useImage(e,v.displaySize);o(!1),T.close({action:"update",values:{uid:e,src:w,align:d(),variant:v.displaySize,width:S,height:L,zoom:f()?void 0:"none"}})};fi((()=>{s.align&&g(s.align)})),fi((()=>{if(s.imageSize){const v=m().find((w=>w.size.displaySize===s.imageSize));v&&u(v.size)}}));let _=Nt(kb,{});a()||(_=[(()=>{var v=Mb();return v.$$click=()=>{T.close({action:"remove"})},G(v,(()=>i("remove"))),v})(),(()=>{var v=Db();return v.$$click=y,v.disabled=!e||d===void 0||c===void 0,G(v,(()=>i("validate"))),v})()]);const T=r.createModalDialog({header:i("makeImagePropertiesDialog.imageProperties"),content:[(()=>{var v=ci();return G(v,(()=>i("makeImagePropertiesDialog.sizes"))),v})(),(()=>{var v=yo();return G(v,Nt(ga,{get each(){return m()},children:w=>(()=>{var S=$b(),L=S.firstChild,B=L.nextSibling,K=B.firstChild,X=K.nextSibling;return X.nextSibling,S.$$click=()=>u(w.size),S.disabled=!e,G(S,(()=>w.label),L),G(B,(()=>w.size.displaySize),X),wn((()=>di(S,`QpBtn secondary ${w.size.displaySize!==c()?.displaySize?"outlined":""}`))),S})()})),v})(),(()=>{var v=ci();return G(v,(()=>i("makeImagePropertiesDialog.alignment"))),v})(),(()=>{var v=yo();return G(v,Nt(ga,{get each(){return E()},children:w=>(()=>{var S=qb();return S.$$click=()=>g(w.align),S.disabled=!e,G(S,(()=>w.label)),wn((()=>di(S,`QpBtn secondary ${w.align!==d()?"outlined":""}`))),S})()})),v})(),(()=>{var v=ci();return G(v,(()=>i("makeImagePropertiesDialog.options"))),v})(),(()=>{var v=Bb(),w=v.firstChild,S=w.firstChild;return S.addEventListener("change",(()=>{p(!f())})),G(w,(()=>i("makeImagePropertiesDialog.enableZoom")),null),wn((()=>S.checked=f())),v})()],footer:_});return await T.open()}Xr(["click"]);async function Kl({language:n,value:e,internalLinkPluginHook:t}){if(!t)return;const r=await t.openDialog(e??"",{getLanguage:n});if(e&&r)return r.documentId?{action:"update",value:r.documentId}:{action:"remove"};if(!e&&r?.documentId)return{action:"insert",value:r.documentId}}function Gl(n){return Ub(n)||la(n)}function la(n){return!!n.match(/^[a-zA-Z0-9. _-]+@[a-zA-Z0-9. -]+\.[a-zA-Z]{2,4}$/g)}function Ub(n){return!!n.match(/^(\+|00)[1-9][0-9 \-\(\)\.]{7,32}$/)}function Fb(n){return Gl(n)?la(n)?"mailto":"tel":"raw"}function jl(n){if(n==="raw")return"raw";if(n==="mailto")return"mailto";if(n==="tel")return"tel";throw new Error(`invalid link-type '${n}'`)}var Hb=W("<label class=ObfuscatorDialog-label><input type=text class=ml-2>"),zb=W('<label class="ObfuscatorDialog-label mt-4"><input type=checkbox name=asALink class=mr-2>'),Kb=W('<button class="QpBtn danger outlined"type=button>'),Gb=W("<button class=QpBtn type=button>");async function jb({service:n,language:e,value:t}){const{t:r}=Rt(e),[s,i]=je(t.asALink),[a,o]=je(t.content),c=d=>{o(d),Gl(d)?i(!0):i(!1)},u=n.createModalDialog({header:r("openObfuscatorDialog.obfuscator"),content:[(()=>{var d=Hb(),g=d.firstChild;return G(d,(()=>r("openObfuscatorDialog.content")),g),g.$$input=f=>c(f.currentTarget.value),wn((()=>g.value=a())),d})(),(()=>{var d=zb(),g=d.firstChild;return g.addEventListener("change",(()=>i(!s()))),G(d,(()=>r("openObfuscatorDialog.asALink")),null),wn((()=>g.checked=s())),d})()],footer:[(()=>{var d=Kb();return d.$$click=()=>u.close({action:"remove"}),G(d,(()=>r("openObfuscatorDialog.doNotObfuscate"))),d})(),(()=>{var d=Gb();return d.$$click=()=>u.close({action:"update",content:a(),asALink:s()?la(a())?"mailto":"tel":"raw"}),G(d,(()=>r("done"))),d})()]});return await u.open()}Xr(["input","click"]);var Vb=W('<button class="QpBtn outlined danger"type=button>'),Zb=W('<button class="QpBtn secondary"type=button>'),Wb=W("<button class=QpBtn type=button>");async function Vl({service:n,language:e,mode:t,value:r,videoPluginHook:s}){if(!s)return;const{t:i}=Rt(e),[a,o]=je(r??""),{dispose:c,element:u}=s.createComponent(r??"",{onChange(g){o(g)},getLanguage:e}),d=n.createModalDialog({content:u,footer:[(()=>{var g=Vb();return g.$$click=()=>{d.close({action:"remove"}),c()},G(g,(()=>i("remove"))),g})(),(()=>{var g=Zb();return g.$$click=()=>{d.close(),c()},G(g,(()=>i("cancel"))),g})(),(()=>{var g=Wb();return g.$$click=()=>{d.close({action:t,value:a()??""}),c()},G(g,(()=>i("validate"))),g})()],header:i("videoPlugin.dialog.title")});return await d.open()}Xr(["click"]);function Yb(n,{label:e,url:t}){let r=e??t;const s=n.getSelection();s&&s.length!==0&&(r=n.getText(s.index,s.length),n.deleteText(s.index,s.length)),n.insertText(ds(n)??0,r,"link",t)}function Zl({editor:n,values:e,service:t,index:r,language:s}){const{t:i}=Rt(s),a=r??ds(n);if(a===void 0){t.showToast(i("editorFocusLost"),{severity:"warn"});return}n.insertEmbed(a,"img",e)}function ki(n){const e=ds(n)??0,[t]=n.getLeaf(e);if(!t)throw new Error("editor.getLeaf() returns undefined");return t.domNode}function Wl({values:n,editor:e,index:t}){if(n.html===void 0)throw new Error("html is undefined");e.insertEmbed(t,"html-snippet",n);const[r]=e.getLeaf(t+1);if(!r)throw new Error("missing last inserted element");return r.domNode}function Yl({values:n,editor:e,index:t}){e.insertText(t,n,"internal-link-plugin",n)}function Ql({values:n,editor:e,index:t}){e.insertEmbed(t,"video-plugin",n);const[r]=e.getLeaf(t+1);if(!r)throw new Error("missing last inserted element");return r.domNode}function ds(n){const e=n.getSelection();if(e!==null)return e.index+e.length}function Qb(n){const{uid:e}=n.dataset;if(e)return e;const t=n.getAttribute("src");if(!t)return;const{pathname:r}=new URL(t),s=r.split("/"),a=s[s.length-1].match(/^([0-9a-f-]{36})\-([0-9]+x[0-9]+)\.([0-9a-z]+$)/);if(!a)return;const[,o]=a;return o}function Xb(n){const e=Xl(n);return{imageSize:n.dataset.variant,align:e}}function Xl(n){const e=n.classList;if(e.contains("center"))return"center";if(e.contains("left"))return"left";if(e.contains("right"))return"right"}function Jb(n){if(n==="center")return"center";if(n==="left")return"left";if(n==="right")return"right"}async function e1({editor:n,htmlSnippetBtn:e,service:t,language:r}){const s=e.dataset.html,i=await zl({service:t,html:s,mode:"update",language:r});i&&pr({editor:n,element:e,data:i,insertElementHandler:Wl,service:t,language:r})}async function t1({editor:n,internalLinkElement:e,language:t,service:r,internalLinkPluginHook:s}){const i=e.dataset.documentId,a=await Kl({language:t,value:i,internalLinkPluginHook:s});if(!a)return;const o=N.find(e);if(!o||o instanceof N)throw new Error("missing link blot");if(a.action==="update"){if(!a.value)return;const c=n.getIndex(o);o.deleteAt(0,o.length()),Yl({values:a.value,editor:n,index:c})}else a.action==="remove"&&o.deleteAt(0,o.length())}async function n1({editor:n,videoElement:e,language:t,service:r,videoPluginHook:s}){const i=e.dataset.videoId,a=await Vl({service:r,language:t,mode:"update",value:i,videoPluginHook:s});a&&pr({editor:n,element:e,data:{action:a.action,values:a.value},insertElementHandler:Ql,service:r,language:t})}async function Jl({obfuscatorSpan:n,service:e,language:t,editor:r}){const s=n.innerText,i=n.dataset.asALink?jl(n.dataset.asALink):void 0,a=await jb({service:e,language:t,value:{content:s,asALink:i?i!=="raw":!1}});if(!a)return;const o=N.find(n);if(!o||o instanceof N)throw new Error("missing embed blot");const c=r.getIndex(o);a.action==="remove"&&(o.remove(),r.insertText(c,s)),a.action==="update"&&(o.remove(),r.insertText(c,a.content??"",{obfuscate:a.asALink??"raw"}))}async function r1({element:n,editor:e,themeConf:t,service:r,language:s}){const i=Qb(n),{align:a,imageSize:o}=Xb(n),c=await Pb({imageSize:o,align:a,imageUid:i,themeConf:t,width:bo(n.getAttribute("width")),height:bo(n.getAttribute("height")),zoom:n.dataset.zoom!=="none",service:r,language:s});c&&pr({editor:e,element:n,data:c,insertElementHandler:Zl,service:r,language:s})}function s1({quillEditor:n,service:e,language:t,videoPluginHook:r,internalLinkPluginHook:s}){const{themeConf:i,useImage:a}=e;return{insertHtmlSnippetHandler:async f=>{if(!n)return;const p=ki(n);await a1({editorContent:p,quillEditor:n,service:e,language:t})},insertMedia:async f=>{if(!n)return;if(!l1(f)){Yb(n,{label:f.originalName,url:f.url});return}const p=i.fTextImages[0],{displaySize:m}=p,E="center",{url:y,displayWidth:_,displayHeight:T}=await a(f.uid,m);Zl({editor:n,values:{uid:f.uid,src:y,width:_,height:T,variant:m,align:E},service:e,language:t})},insertObfuscateBlotHandler:()=>{if(!n)return;const f=n.getSelection();!f||f.length===0||i1({userSelection:f,quillEditor:n,service:e,language:t})},insertVideoHandler:async()=>{if(!n)return;const f=ki(n);await ec({editorContent:f,quillEditor:n,service:e,language:t,videoPluginHook:r})},insertInternalLinkHandler:async()=>{if(!n)return;const f=ds(n);f!==void 0&&await o1({quillEditor:n,service:e,language:t,internalLinkPluginHook:s,index:f})}}}async function i1({userSelection:n,quillEditor:e,language:t,service:r}){const s=e.getText(n.index,n.length),i=Fb(s);e.formatText(n,"obfuscate",i);const a=e.root.querySelectorAll("span.ObfuscateBlot");if(a.length===0)throw new Error("missing element 'span' with class 'ObfuscateBlot'");for(const o of a)if(o.innerText===s){await Jl({obfuscatorSpan:o,service:r,language:t,editor:e});break}}async function a1({editorContent:n,quillEditor:e,service:t,language:r}){const s=await zl({service:t,language:r,mode:"insert"});s&&pr({editor:e,element:n,data:s,insertElementHandler:Wl,service:t,language:r})}async function ec({editorContent:n,quillEditor:e,service:t,language:r,videoPluginHook:s,value:i}){const a=await Vl({service:t,language:r,mode:i?"update":"insert",value:i,videoPluginHook:s});!a||a.action==="remove"||pr({editor:e,element:n,data:{action:a.action,values:a.value,updateOptions:{textToReplaceLength:i?.length}},insertElementHandler:Ql,service:t,language:r})}async function o1({quillEditor:n,service:e,language:t,internalLinkPluginHook:r,value:s,index:i}){const a=await Kl({language:t,value:s,internalLinkPluginHook:r});!a||a.action==="remove"||!a.value||Yl({editor:n,values:a.value,index:i})}function pr({editor:n,element:e,data:{values:t,action:r,updateOptions:s},insertElementHandler:i,service:a,language:o}){const c=N.find(e);if(!c||c instanceof N)throw new Error("missing embed blot");const u=n.getIndex(c),d=new k;if(!(u===void 0||u===-1)){if(r==="insert"){if(!t)return;i({editor:n,values:t,service:a,index:u,language:o})}else if(r==="update"){if(!t)return;i({editor:n,values:t,service:a,index:u,language:o}),d.retain(u+1),d.delete(s?.textToReplaceLength??1)}else r==="remove"&&(d.retain(u),d.delete(1));n.updateContents(d)}}function l1(n){return"width"in n&&"height"in n}function tc(n){return n instanceof Map?n.clear=n.delete=n.set=function(){throw new Error("map is read-only")}:n instanceof Set&&(n.add=n.clear=n.delete=function(){throw new Error("set is read-only")}),Object.freeze(n),Object.getOwnPropertyNames(n).forEach((e=>{const t=n[e],r=typeof t;(r==="object"||r==="function")&&!Object.isFrozen(t)&&tc(t)})),n}class _o{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function nc(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function wt(n,...e){const t=Object.create(null);for(const r in n)t[r]=n[r];return e.forEach((function(r){for(const s in r)t[s]=r[s]})),t}const c1="</span>",vo=n=>!!n.scope,u1=(n,{prefix:e})=>{if(n.startsWith("language:"))return n.replace("language:","language-");if(n.includes(".")){const t=n.split(".");return[`${e}${t.shift()}`,...t.map(((r,s)=>`${r}${"_".repeat(s+1)}`))].join(" ")}return`${e}${n}`};class d1{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=nc(e)}openNode(e){if(!vo(e))return;const t=u1(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){vo(e)&&(this.buffer+=c1)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const No=(n={})=>{const e={children:[]};return Object.assign(e,n),e};class ca{constructor(){this.rootNode=No(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=No({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t=="string"?e.addText(t):t.children&&(e.openNode(t),t.children.forEach((r=>this._walk(e,r))),e.closeNode(t)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every((t=>typeof t=="string"))?e.children=[e.children.join("")]:e.children.forEach((t=>{ca._collapse(t)})))}}class h1 extends ca{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const r=e.root;t&&(r.scope=`language:${t}`),this.add(r)}toHTML(){return new d1(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ar(n){return n?typeof n=="string"?n:n.source:null}function rc(n){return sn("(?=",n,")")}function f1(n){return sn("(?:",n,")*")}function g1(n){return sn("(?:",n,")?")}function sn(...n){return n.map((t=>ar(t))).join("")}function p1(n){const e=n[n.length-1];return typeof e=="object"&&e.constructor===Object?(n.splice(n.length-1,1),e):{}}function ua(...n){return"("+(p1(n).capture?"":"?:")+n.map((r=>ar(r))).join("|")+")"}function sc(n){return new RegExp(n.toString()+"|").exec("").length-1}function m1(n,e){const t=n&&n.exec(e);return t&&t.index===0}const b1=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function da(n,{joinWith:e}){let t=0;return n.map((r=>{t+=1;const s=t;let i=ar(r),a="";for(;i.length>0;){const o=b1.exec(i);if(!o){a+=i;break}a+=i.substring(0,o.index),i=i.substring(o.index+o[0].length),o[0][0]==="\\"&&o[1]?a+="\\"+String(Number(o[1])+s):(a+=o[0],o[0]==="("&&t++)}return a})).map((r=>`(${r})`)).join(e)}const E1=/\b\B/,ic="[a-zA-Z]\\w*",ha="[a-zA-Z_]\\w*",ac="\\b\\d+(\\.\\d+)?",oc="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",lc="\\b(0b[01]+)",y1="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",_1=(n={})=>{const e=/^#![ ]*\//;return n.binary&&(n.begin=sn(e,/.*\b/,n.binary,/\b.*/)),wt({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(t,r)=>{t.index!==0&&r.ignoreMatch()}},n)},or={begin:"\\\\[\\s\\S]",relevance:0},v1={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[or]},N1={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[or]},T1={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},hs=function(n,e,t={}){const r=wt({scope:"comment",begin:n,end:e,contains:[]},t);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const s=ua("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:sn(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},A1=hs("//","$"),w1=hs("/\\*","\\*/"),S1=hs("#","$"),x1={scope:"number",begin:ac,relevance:0},O1={scope:"number",begin:oc,relevance:0},L1={scope:"number",begin:lc,relevance:0},C1={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[or,{begin:/\[/,end:/\]/,relevance:0,contains:[or]}]},I1={scope:"title",begin:ic,relevance:0},R1={scope:"title",begin:ha,relevance:0},k1={begin:"\\.\\s*"+ha,relevance:0},M1=function(n){return Object.assign(n,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})};var Br=Object.freeze({__proto__:null,APOS_STRING_MODE:v1,BACKSLASH_ESCAPE:or,BINARY_NUMBER_MODE:L1,BINARY_NUMBER_RE:lc,COMMENT:hs,C_BLOCK_COMMENT_MODE:w1,C_LINE_COMMENT_MODE:A1,C_NUMBER_MODE:O1,C_NUMBER_RE:oc,END_SAME_AS_BEGIN:M1,HASH_COMMENT_MODE:S1,IDENT_RE:ic,MATCH_NOTHING_RE:E1,METHOD_GUARD:k1,NUMBER_MODE:x1,NUMBER_RE:ac,PHRASAL_WORDS_MODE:T1,QUOTE_STRING_MODE:N1,REGEXP_MODE:C1,RE_STARTERS_RE:y1,SHEBANG:_1,TITLE_MODE:I1,UNDERSCORE_IDENT_RE:ha,UNDERSCORE_TITLE_MODE:R1});function D1(n,e){n.input[n.index-1]==="."&&e.ignoreMatch()}function B1(n,e){n.className!==void 0&&(n.scope=n.className,delete n.className)}function $1(n,e){e&&n.beginKeywords&&(n.begin="\\b("+n.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",n.__beforeBegin=D1,n.keywords=n.keywords||n.beginKeywords,delete n.beginKeywords,n.relevance===void 0&&(n.relevance=0))}function q1(n,e){Array.isArray(n.illegal)&&(n.illegal=ua(...n.illegal))}function P1(n,e){if(n.match){if(n.begin||n.end)throw new Error("begin & end are not supported with match");n.begin=n.match,delete n.match}}function U1(n,e){n.relevance===void 0&&(n.relevance=1)}const F1=(n,e)=>{if(!n.beforeMatch)return;if(n.starts)throw new Error("beforeMatch cannot be used with starts");const t=Object.assign({},n);Object.keys(n).forEach((r=>{delete n[r]})),n.keywords=t.keywords,n.begin=sn(t.beforeMatch,rc(t.begin)),n.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},n.relevance=0,delete t.beforeMatch},H1=["of","and","for","in","not","or","if","then","parent","list","value"],z1="keyword";function cc(n,e,t=z1){const r=Object.create(null);return typeof n=="string"?s(t,n.split(" ")):Array.isArray(n)?s(t,n):Object.keys(n).forEach((function(i){Object.assign(r,cc(n[i],e,i))})),r;function s(i,a){e&&(a=a.map((o=>o.toLowerCase()))),a.forEach((function(o){const c=o.split("|");r[c[0]]=[i,K1(c[0],c[1])]}))}}function K1(n,e){return e?Number(e):G1(n)?0:1}function G1(n){return H1.includes(n.toLowerCase())}const To={},Vt=n=>{console.error(n)},Ao=(n,...e)=>{console.log(`WARN: ${n}`,...e)},En=(n,e)=>{To[`${n}/${e}`]||(console.log(`Deprecated as of ${n}. ${e}`),To[`${n}/${e}`]=!0)},Yr=new Error;function uc(n,e,{key:t}){let r=0;const s=n[t],i={},a={};for(let o=1;o<=e.length;o++)a[o+r]=s[o],i[o+r]=!0,r+=sc(e[o-1]);n[t]=a,n[t]._emit=i,n[t]._multi=!0}function j1(n){if(Array.isArray(n.begin)){if(n.skip||n.excludeBegin||n.returnBegin)throw Vt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Yr;if(typeof n.beginScope!="object"||n.beginScope===null)throw Vt("beginScope must be object"),Yr;uc(n,n.begin,{key:"beginScope"}),n.begin=da(n.begin,{joinWith:""})}}function V1(n){if(Array.isArray(n.end)){if(n.skip||n.excludeEnd||n.returnEnd)throw Vt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Yr;if(typeof n.endScope!="object"||n.endScope===null)throw Vt("endScope must be object"),Yr;uc(n,n.end,{key:"endScope"}),n.end=da(n.end,{joinWith:""})}}function Z1(n){n.scope&&typeof n.scope=="object"&&n.scope!==null&&(n.beginScope=n.scope,delete n.scope)}function W1(n){Z1(n),typeof n.beginScope=="string"&&(n.beginScope={_wrap:n.beginScope}),typeof n.endScope=="string"&&(n.endScope={_wrap:n.endScope}),j1(n),V1(n)}function Y1(n){function e(a,o){return new RegExp(ar(a),"m"+(n.case_insensitive?"i":"")+(n.unicodeRegex?"u":"")+(o?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(o,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,o]),this.matchAt+=sc(o)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const o=this.regexes.map((c=>c[1]));this.matcherRe=e(da(o,{joinWith:"|"}),!0),this.lastIndex=0}exec(o){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(o);if(!c)return null;const u=c.findIndex(((g,f)=>f>0&&g!==void 0)),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(o){if(this.multiRegexes[o])return this.multiRegexes[o];const c=new t;return this.rules.slice(o).forEach((([u,d])=>c.addRule(u,d))),c.compile(),this.multiRegexes[o]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(o,c){this.rules.push([o,c]),c.type==="begin"&&this.count++}exec(o){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(o);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(o)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function s(a){const o=new r;return a.contains.forEach((c=>o.addRule(c.begin,{rule:c,type:"begin"}))),a.terminatorEnd&&o.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&o.addRule(a.illegal,{type:"illegal"}),o}function i(a,o){const c=a;if(a.isCompiled)return c;[B1,P1,W1,F1].forEach((d=>d(a,o))),n.compilerExtensions.forEach((d=>d(a,o))),a.__beforeBegin=null,[$1,q1,U1].forEach((d=>d(a,o))),a.isCompiled=!0;let u=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),u=a.keywords.$pattern,delete a.keywords.$pattern),u=u||/\w+/,a.keywords&&(a.keywords=cc(a.keywords,n.case_insensitive)),c.keywordPatternRe=e(u,!0),o&&(a.begin||(a.begin=/\B|\b/),c.beginRe=e(c.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(c.endRe=e(c.end)),c.terminatorEnd=ar(c.end)||"",a.endsWithParent&&o.terminatorEnd&&(c.terminatorEnd+=(a.end?"|":"")+o.terminatorEnd)),a.illegal&&(c.illegalRe=e(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map((function(d){return Q1(d==="self"?a:d)}))),a.contains.forEach((function(d){i(d,c)})),a.starts&&i(a.starts,o),c.matcher=s(c),c}if(n.compilerExtensions||(n.compilerExtensions=[]),n.contains&&n.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return n.classNameAliases=wt(n.classNameAliases||{}),i(n)}function dc(n){return n?n.endsWithParent||dc(n.starts):!1}function Q1(n){return n.variants&&!n.cachedVariants&&(n.cachedVariants=n.variants.map((function(e){return wt(n,{variants:null},e)}))),n.cachedVariants?n.cachedVariants:dc(n)?wt(n,{starts:n.starts?wt(n.starts):null}):Object.isFrozen(n)?wt(n):n}var X1="11.10.0";class J1 extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const ui=nc,wo=wt,So=Symbol("nomatch"),e0=7,hc=function(n){const e=Object.create(null),t=Object.create(null),r=[];let s=!0;const i="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let o={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:h1};function c(x){return o.noHighlightRe.test(x)}function u(x){let O=x.className+" ";O+=x.parentNode?x.parentNode.className:"";const q=o.languageDetectRe.exec(O);if(q){const I=X(q[1]);return I||(Ao(i.replace("{}",q[1])),Ao("Falling back to no-highlight mode for this block.",x)),I?q[1]:"no-highlight"}return O.split(/\s+/).find((I=>c(I)||X(I)))}function d(x,O,q){let I="",j="";typeof O=="object"?(I=x,q=O.ignoreIllegals,j=O.language):(En("10.7.0","highlight(lang, code, ...args) has been deprecated."),En("10.7.0",`Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277`),j=x,I=O),q===void 0&&(q=!0);const ne={code:I,language:j};ce("before:highlight",ne);const J=ne.result?ne.result:g(ne.language,ne.code,q);return J.code=ne.code,ce("after:highlight",J),J}function g(x,O,q,I){const j=Object.create(null);function ne(C,R){return C.keywords[R]}function J(){if(!P.keywords){re.addText(Y);return}let C=0;P.keywordPatternRe.lastIndex=0;let R=P.keywordPatternRe.exec(Y),U="";for(;R;){U+=Y.substring(C,R.index);const z=Ee.case_insensitive?R[0].toLowerCase():R[0],ie=ne(P,z);if(ie){const[Le,Mn]=ie;if(re.addText(U),U="",j[z]=(j[z]||0)+1,j[z]<=e0&&(lt+=Mn),Le.startsWith("_"))U+=R[0];else{const Pt=Ee.classNameAliases[Le]||Le;Ae(R[0],Pt)}}else U+=R[0];C=P.keywordPatternRe.lastIndex,R=P.keywordPatternRe.exec(Y)}U+=Y.substring(C),re.addText(U)}function at(){if(Y==="")return;let C=null;if(typeof P.subLanguage=="string"){if(!e[P.subLanguage]){re.addText(Y);return}C=g(P.subLanguage,Y,!0,ot[P.subLanguage]),ot[P.subLanguage]=C._top}else C=p(Y,P.subLanguage.length?P.subLanguage:null);P.relevance>0&&(lt+=C.relevance),re.__addSublanguage(C._emitter,C.language)}function H(){P.subLanguage!=null?at():J(),Y=""}function Ae(C,R){C!==""&&(re.startScope(R),re.addText(C),re.endScope())}function an(C,R){let U=1;const z=R.length-1;for(;U<=z;){if(!C._emit[U]){U++;continue}const ie=Ee.classNameAliases[C[U]]||C[U],Le=R[U];ie?Ae(Le,ie):(Y=Le,J(),Y=""),U++}}function Oe(C,R){return C.scope&&typeof C.scope=="string"&&re.openNode(Ee.classNameAliases[C.scope]||C.scope),C.beginScope&&(C.beginScope._wrap?(Ae(Y,Ee.classNameAliases[C.beginScope._wrap]||C.beginScope._wrap),Y=""):C.beginScope._multi&&(an(C.beginScope,R),Y="")),P=Object.create(C,{parent:{value:P}}),P}function kt(C,R,U){let z=m1(C.endRe,U);if(z){if(C["on:end"]){const ie=new _o(C);C["on:end"](R,ie),ie.isMatchIgnored&&(z=!1)}if(z){for(;C.endsParent&&C.parent;)C=C.parent;return C}}if(C.endsWithParent)return kt(C.parent,R,U)}function on(C){return P.matcher.regexIndex===0?(Y+=C[0],1):(qt=!0,0)}function Mt(C){const R=C[0],U=C.rule,z=new _o(U),ie=[U.__beforeBegin,U["on:begin"]];for(const Le of ie)if(Le&&(Le(C,z),z.isMatchIgnored))return on(R);return U.skip?Y+=R:(U.excludeBegin&&(Y+=R),H(),!U.returnBegin&&!U.excludeBegin&&(Y=R)),Oe(U,C),U.returnBegin?0:R.length}function Dt(C){const R=C[0],U=O.substring(C.index),z=kt(P,C,U);if(!z)return So;const ie=P;P.endScope&&P.endScope._wrap?(H(),Ae(R,P.endScope._wrap)):P.endScope&&P.endScope._multi?(H(),an(P.endScope,C)):ie.skip?Y+=R:(ie.returnEnd||ie.excludeEnd||(Y+=R),H(),ie.excludeEnd&&(Y=R));do{P.scope&&re.closeNode(),!P.skip&&!P.subLanguage&&(lt+=P.relevance),P=P.parent}while(P!==z.parent);return z.starts&&Oe(z.starts,C),ie.returnEnd?0:R.length}function ln(){const C=[];for(let R=P;R!==Ee;R=R.parent)R.scope&&C.unshift(R.scope);C.forEach((R=>re.openNode(R)))}let Qe={};function Bt(C,R){const U=R&&R[0];if(Y+=C,U==null)return H(),0;if(Qe.type==="begin"&&R.type==="end"&&Qe.index===R.index&&U===""){if(Y+=O.slice(R.index,R.index+1),!s){const z=new Error(`0 width match regex (${x})`);throw z.languageName=x,z.badRule=Qe.rule,z}return 1}if(Qe=R,R.type==="begin")return Mt(R);if(R.type==="illegal"&&!q){const z=new Error('Illegal lexeme "'+U+'" for mode "'+(P.scope||"<unnamed>")+'"');throw z.mode=P,z}else if(R.type==="end"){const z=Dt(R);if(z!==So)return z}if(R.type==="illegal"&&U==="")return 1;if(Xe>1e5&&Xe>R.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Y+=U,U.length}const Ee=X(x);if(!Ee)throw Vt(i.replace("{}",x)),new Error('Unknown language: "'+x+'"');const cn=Y1(Ee);let $t="",P=I||cn;const ot={},re=new o.__emitter(o);ln();let Y="",lt=0,fe=0,Xe=0,qt=!1;try{if(Ee.__emitTokens)Ee.__emitTokens(O,re);else{for(P.matcher.considerAll();;){Xe++,qt?qt=!1:P.matcher.considerAll(),P.matcher.lastIndex=fe;const C=P.matcher.exec(O);if(!C)break;const R=O.substring(fe,C.index),U=Bt(R,C);fe=C.index+U}Bt(O.substring(fe))}return re.finalize(),$t=re.toHTML(),{language:x,value:$t,relevance:lt,illegal:!1,_emitter:re,_top:P}}catch(C){if(C.message&&C.message.includes("Illegal"))return{language:x,value:ui(O),illegal:!0,relevance:0,_illegalBy:{message:C.message,index:fe,context:O.slice(fe-100,fe+100),mode:C.mode,resultSoFar:$t},_emitter:re};if(s)return{language:x,value:ui(O),illegal:!1,relevance:0,errorRaised:C,_emitter:re,_top:P};throw C}}function f(x){const O={value:ui(x),illegal:!1,relevance:0,_top:a,_emitter:new o.__emitter(o)};return O._emitter.addText(x),O}function p(x,O){O=O||o.languages||Object.keys(e);const q=f(x),I=O.filter(X).filter(ge).map((H=>g(H,x,!1)));I.unshift(q);const j=I.sort(((H,Ae)=>{if(H.relevance!==Ae.relevance)return Ae.relevance-H.relevance;if(H.language&&Ae.language){if(X(H.language).supersetOf===Ae.language)return 1;if(X(Ae.language).supersetOf===H.language)return-1}return 0})),[ne,J]=j,at=ne;return at.secondBest=J,at}function m(x,O,q){const I=O&&t[O]||q;x.classList.add("hljs"),x.classList.add(`language-${I}`)}function E(x){let O=null;const q=u(x);if(c(q))return;if(ce("before:highlightElement",{el:x,language:q}),x.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",x);return}if(x.children.length>0&&(o.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(x)),o.throwUnescapedHTML))throw new J1("One of your code blocks includes unescaped HTML.",x.innerHTML);O=x;const I=O.textContent,j=q?d(I,{language:q,ignoreIllegals:!0}):p(I);x.innerHTML=j.value,x.dataset.highlighted="yes",m(x,q,j.language),x.result={language:j.language,re:j.relevance,relevance:j.relevance},j.secondBest&&(x.secondBest={language:j.secondBest.language,relevance:j.secondBest.relevance}),ce("after:highlightElement",{el:x,result:j,text:I})}function y(x){o=wo(o,x)}const _=()=>{w(),En("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function T(){w(),En("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let v=!1;function w(){if(document.readyState==="loading"){v=!0;return}document.querySelectorAll(o.cssSelector).forEach(E)}function S(){v&&w()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",S,!1);function L(x,O){let q=null;try{q=O(n)}catch(I){if(Vt("Language definition for '{}' could not be registered.".replace("{}",x)),s)Vt(I);else throw I;q=a}q.name||(q.name=x),e[x]=q,q.rawDefinition=O.bind(null,n),q.aliases&&ae(q.aliases,{languageName:x})}function B(x){delete e[x];for(const O of Object.keys(t))t[O]===x&&delete t[O]}function K(){return Object.keys(e)}function X(x){return x=(x||"").toLowerCase(),e[x]||e[t[x]]}function ae(x,{languageName:O}){typeof x=="string"&&(x=[x]),x.forEach((q=>{t[q.toLowerCase()]=O}))}function ge(x){const O=X(x);return O&&!O.disableAutodetect}function Te(x){x["before:highlightBlock"]&&!x["before:highlightElement"]&&(x["before:highlightElement"]=O=>{x["before:highlightBlock"](Object.assign({block:O.el},O))}),x["after:highlightBlock"]&&!x["after:highlightElement"]&&(x["after:highlightElement"]=O=>{x["after:highlightBlock"](Object.assign({block:O.el},O))})}function le(x){Te(x),r.push(x)}function se(x){const O=r.indexOf(x);O!==-1&&r.splice(O,1)}function ce(x,O){const q=x;r.forEach((function(I){I[q]&&I[q](O)}))}function Pe(x){return En("10.7.0","highlightBlock will be removed entirely in v12.0"),En("10.7.0","Please use highlightElement now."),E(x)}Object.assign(n,{highlight:d,highlightAuto:p,highlightAll:w,highlightElement:E,highlightBlock:Pe,configure:y,initHighlighting:_,initHighlightingOnLoad:T,registerLanguage:L,unregisterLanguage:B,listLanguages:K,getLanguage:X,registerAliases:ae,autoDetection:ge,inherit:wo,addPlugin:le,removePlugin:se}),n.debugMode=function(){s=!1},n.safeMode=function(){s=!0},n.versionString=X1,n.regex={concat:sn,lookahead:rc,either:ua,optional:g1,anyNumberOfTimes:f1};for(const x in Br)typeof Br[x]=="object"&&tc(Br[x]);return Object.assign(n,Br),n},In=hc({});In.newInstance=()=>hc({});var t0=In;In.HighlightJS=In;In.default=In;const he=ji(t0);function n0(n){const e=n.regex,t={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[n.BACKSLASH_ESCAPE]},i=n.inherit(n.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[n.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,t,s]};s.contains.push(o);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},g={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},n.NUMBER_MODE,t]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=n.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[n.inherit(n.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},E=["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],y=["true","false"],_={match:/(\/[a-z._-]+)+/},T=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],v=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],w=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],S=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:E,literal:y,built_in:[...T,...v,"set","shopt",...w,...S]},contains:[p,n.SHEBANG(),m,g,i,a,_,o,c,u,d,t]}}function r0(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",a="("+r+"|"+e.optional(s)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",o={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(s)+n.IDENT_RE,relevance:0},p=e.optional(s)+n.IDENT_RE+"\\s*\\(",y={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},_=[g,o,t,n.C_BLOCK_COMMENT_MODE,d,u],T={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:y,contains:_.concat([{begin:/\(/,end:/\)/,keywords:y,contains:_.concat(["self"]),relevance:0}]),relevance:0},v={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:y,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:y,relevance:0},{begin:p,returnBegin:!0,contains:[n.inherit(f,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,u,d,o,{begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,u,d,o]}]},o,t,n.C_BLOCK_COMMENT_MODE,g]};return{name:"C",aliases:["h"],keywords:y,disableAutodetect:!0,illegal:"</",contains:[].concat(T,v,_,[g,{begin:n.IDENT_RE+"::",keywords:y},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},n.TITLE_MODE]}]),exports:{preprocessor:g,strings:u,keywords:y}}}function s0(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+e.optional(s)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(s)+n.IDENT_RE,relevance:0},p=e.optional(s)+n.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],E=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],_=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],w={type:E,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},S={className:"function.dispatch",relevance:0,keywords:{_hint:_},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,n.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},L=[S,g,o,t,n.C_BLOCK_COMMENT_MODE,d,u],B={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:L.concat([{begin:/\(/,end:/\)/,keywords:w,contains:L.concat(["self"]),relevance:0}]),relevance:0},K={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,u,d,o,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,u,d,o]}]},o,t,n.C_BLOCK_COMMENT_MODE,g]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:w,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(B,K,S,L,[g,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:w,contains:["self",o]},{begin:n.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function i0(n){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],t=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],s=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],i=["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:s.concat(i),built_in:e,literal:r},o=n.inherit(n.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},g=n.inherit(d,{illegal:/\n/}),f={className:"subst",begin:/\{/,end:/\}/,keywords:a},p=n.inherit(f,{illegal:/\n/}),m={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},n.BACKSLASH_ESCAPE,p]},E={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]},y=n.inherit(E,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});f.contains=[E,m,d,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,c,n.C_BLOCK_COMMENT_MODE],p.contains=[y,m,g,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,c,n.inherit(n.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const _={variants:[u,E,m,d,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},T={begin:"<",end:">",contains:[{beginKeywords:"in out"},o]},v=n.IDENT_RE+"(<"+n.IDENT_RE+"(\\s*,\\s*"+n.IDENT_RE+")*>)?(\\[\\])?",w={begin:"@"+n.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[n.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:"</?",end:">"}]}]}),n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},_,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,T,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,T,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+v+"\\s+)+"+n.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:t.join(" "),relevance:0},{begin:n.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[n.TITLE_MODE,T],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[_,c,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},w]}}const a0=n=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:n.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),o0=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],l0=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],c0=[...o0,...l0],u0=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),d0=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),h0=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),f0=["accent-color","align-content","align-items","align-self","alignment-baseline","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-end-end-radius","border-end-start-radius","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","cx","cy","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","empty-cells","enable-background","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","flood-color","flood-opacity","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","kerning","justify-content","justify-items","justify-self","left","letter-spacing","lighting-color","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","marker","marker-end","marker-mid","marker-start","mask","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","scale","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","speak","speak-as","src","tab-size","table-layout","text-anchor","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-offset","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","vector-effect","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index"].sort().reverse();function g0(n){const e=n.regex,t=a0(n),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",i=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",o=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,r,t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+d0.join("|")+")"},{begin:":(:)?("+h0.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+f0.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...o,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...o,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:u0.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+c0.join("|")+")\\b"}]}}var An="[0-9](_*[0-9])*",$r=`\\.(${An})`,qr="[0-9a-fA-F](_*[0-9a-fA-F])*",xo={className:"number",variants:[{begin:`(\\b(${An})((${$r})|\\.)?|(${$r}))[eE][+-]?(${An})[fFdD]?\\b`},{begin:`\\b(${An})((${$r})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${$r})[fFdD]?\\b`},{begin:`\\b(${An})[fFdD]\\b`},{begin:`\\b0[xX]((${qr})\\.?|(${qr})?\\.(${qr}))[pP][+-]?(${An})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${qr})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function fc(n,e,t){return t===-1?"":n.replace(e,(r=>fc(n,e,t-1)))}function p0(n){const e=n.regex,t="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=t+fc("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+t,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[n.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[n.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[n.BACKSLASH_ESCAPE]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,t],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,t),/\s+/,t,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,t],className:{1:"keyword",3:"title.class"},contains:[d,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",n.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,xo,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},xo,u]}}const Oo="[A-Za-z$_][0-9A-Za-z$_]*",m0=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],b0=["true","false","null","undefined","NaN","Infinity"],gc=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],pc=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],mc=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],E0=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],y0=[].concat(mc,gc,pc);function _0(n){const e=n.regex,t=(O,{after:q})=>{const I="</"+O[0].slice(1);return O.input.indexOf(I,q)!==-1},r=Oo,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,q)=>{const I=O[0].length+O.index,j=O.input[I];if(j==="<"||j===","){q.ignoreMatch();return}j===">"&&(t(O,{after:I})||q.ignoreMatch());let ne;const J=O.input.substring(I);if(ne=J.match(/^\s*=/)){q.ignoreMatch();return}if((ne=J.match(/^\s+extends\s+/))&&ne.index===0){q.ignoreMatch();return}}},o={$pattern:Oo,keyword:m0,literal:b0,built_in:y0,"variable.language":E0},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,f]},T={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},v=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,p,m,E,y,{match:/\$\d+/},g];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(v)});const w=[].concat(T,f.contains),S=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(w)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:S},B={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},K={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...gc,...pc]}},X={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ae={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},ge={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Te(O){return e.concat("(?!",O.join("|"),")")}const le={match:e.concat(/\b/,Te([...mc,"super","import"].map((O=>`${O}\\s*\\(`))),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},se={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ce={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},Pe="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",x={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(Pe)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),X,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,p,m,E,y,T,{match:/\$\d+/},g,K,{className:"attr",begin:r+e.lookahead(":"),relevance:0},x,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[T,n.REGEXP_MODE,{className:"function",begin:Pe,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},ae,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},se,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},le,ge,B,ce,{match:/\$[(.]/}]}}function v0(n){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},t={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[e,t,n.QUOTE_STRING_MODE,s,n.C_NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function N0(n){const e=n.regex,t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},s={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},o=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,o,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},g=n.inherit(u,{contains:[]}),f=n.inherit(d,{contains:[]});u.contains.push(f),d.contains.push(g);let p=[t,c];return[u,d,g,f].forEach((_=>{_.contains=_.contains.concat(p)})),p=p.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},t,i,u,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},s,r,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function T0(n){const e=n.regex,t=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,t),s=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,t),i={scope:"variable",match:"\\$+"+r},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},o={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=n.inherit(n.APOS_STRING_MODE,{illegal:null}),u=n.inherit(n.QUOTE_STRING_MODE,{illegal:null,contains:n.QUOTE_STRING_MODE.contains.concat(o)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:n.QUOTE_STRING_MODE.contains.concat(o),"on:begin":(le,se)=>{se.data._beginMatch=le[1]||le[2]},"on:end":(le,se)=>{se.data._beginMatch!==le[1]&&se.ignoreMatch()}},g=n.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),f=`[ \t\n]`,p={scope:"string",variants:[u,c,d,g]},m={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},E=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],_=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],v={keyword:y,literal:(le=>{const se=[];return le.forEach((ce=>{se.push(ce),ce.toLowerCase()===ce?se.push(ce.toUpperCase()):se.push(ce.toLowerCase())})),se})(E),built_in:_},w=le=>le.map((se=>se.replace(/\|\d+$/,""))),S={variants:[{match:[/new/,e.concat(f,"+"),e.concat("(?!",w(_).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},L=e.concat(r,"\\b(?!\\()"),B={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),L],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,e.concat(/::/,e.lookahead(/(?!class\b)/)),L],scope:{1:"title.class",3:"variable.constant"}},{match:[s,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},K={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},X={relevance:0,begin:/\(/,end:/\)/,keywords:v,contains:[K,i,B,n.C_BLOCK_COMMENT_MODE,p,m,S]},ae={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",w(y).join("\\b|"),"|",w(_).join("\\b|"),"\\b)"),r,e.concat(f,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[X]};X.contains.push(ae);const ge=[K,B,n.C_BLOCK_COMMENT_MODE,p,m,S],Te={begin:e.concat(/#\[\s*/,s),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:E,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:E,keyword:["new","array"]},contains:["self",...ge]},...ge,{scope:"meta",match:s}]};return{case_insensitive:!1,keywords:v,contains:[Te,n.HASH_COMMENT_MODE,n.COMMENT("//","$"),n.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:n.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},i,ae,B,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},S,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},n.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:v,contains:["self",i,B,n.C_BLOCK_COMMENT_MODE,p,m]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},n.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[n.inherit(n.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},n.UNDERSCORE_TITLE_MODE]},p,m]}}function A0(n){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function w0(n){const e=n.regex,t=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},d={begin:/\{\{/,relevance:0},g={className:"string",contains:[n.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,c,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[n.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,d,u]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",p=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,m=`\\b|${r.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${p}))[eE][+-]?(${f})[jJ]?(?=${m})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${f})[jJ](?=${m})`}]},y={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},_={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",c,E,g,n.HASH_COMMENT_MODE]}]};return u.contains=[g,E,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[c,E,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,y,n.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[_]},{variants:[{match:[/\bclass/,/\s+/,t,/\s*/,/\(\s*/,t,/\s*\)/]},{match:[/\bclass/,/\s+/,t]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[E,_,g]}]}}function S0(n){const e=n.regex,t="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),s=e.concat(r,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[n.COMMENT("#","$",{contains:[o]}),n.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),n.COMMENT("^__END__",n.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:a},g={className:"string",contains:[n.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[n.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[n.BACKSLASH_ESCAPE,d]})]}]},f="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b(${f})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},E={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},L=[g,{variants:[{match:[/class\s+/,s,/\s+<\s+/,s]},{match:[/\b(class|module)\s+/,s]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,s],scope:{2:"title.class"},keywords:a},{relevance:0,match:[s,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[E]},{begin:n.IDENT_RE+"::"},{className:"symbol",begin:n.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[g,{begin:t}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+n.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[n.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);d.contains=L,E.contains=L;const ae=[{begin:/^\s*=>/,starts:{end:"$",contains:L}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:L}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[n.SHEBANG({binary:"ruby"})].concat(ae).concat(u).concat(L)}}function x0(n){const e=n.regex,t=/(r#)?/,r=e.concat(t,n.UNDERSCORE_IDENT_RE),s=e.concat(t,n.IDENT_RE),i={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,s,e.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",o=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:n.IDENT_RE+"!?",type:d,keyword:o,literal:c,built_in:u},illegal:"</",contains:[n.C_LINE_COMMENT_MODE,n.COMMENT("/\\*","\\*/",{contains:["self"]}),n.inherit(n.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+a},{begin:"\\b0o([0-7_]+)"+a},{begin:"\\b0x([A-Fa-f0-9_]+)"+a},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+a}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:n.IDENT_RE+"::",keywords:{keyword:"Self",built_in:u,type:d}},{className:"punctuation",begin:"->"},i]}}function O0(n){const e=n.regex,t=n.COMMENT("--","$"),r={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},s={begin:/"/,end:/"/,contains:[{begin:/""/}]},i=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],g=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=d,m=[...u,...c].filter((v=>!d.includes(v))),E={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},y={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={begin:e.concat(/\b/,e.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function T(v,{exceptions:w,when:S}={}){const L=S;return w=w||[],v.map((B=>B.match(/\|\d+$/)||w.includes(B)?B:L(B)?`${B}|0`:B))}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:T(m,{when:v=>v.length<3}),literal:i,type:o,built_in:g},contains:[{begin:e.either(...f),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:m.concat(f),literal:i,type:o}},{className:"type",begin:e.either(...a)},_,E,r,s,n.C_NUMBER_MODE,n.C_BLOCK_COMMENT_MODE,t,y]}}const Qr="[A-Za-z$_][0-9A-Za-z$_]*",bc=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Ec=["true","false","null","undefined","NaN","Infinity"],yc=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],_c=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],vc=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Nc=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Tc=[].concat(vc,yc,_c);function L0(n){const e=n.regex,t=(O,{after:q})=>{const I="</"+O[0].slice(1);return O.input.indexOf(I,q)!==-1},r=Qr,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,q)=>{const I=O[0].length+O.index,j=O.input[I];if(j==="<"||j===","){q.ignoreMatch();return}j===">"&&(t(O,{after:I})||q.ignoreMatch());let ne;const J=O.input.substring(I);if(ne=J.match(/^\s*=/)){q.ignoreMatch();return}if((ne=J.match(/^\s+extends\s+/))&&ne.index===0){q.ignoreMatch();return}}},o={$pattern:Qr,keyword:bc,literal:Ec,built_in:Tc,"variable.language":Nc},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,f]},T={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},v=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,p,m,E,y,{match:/\$\d+/},g];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(v)});const w=[].concat(T,f.contains),S=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(w)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:S},B={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},K={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...yc,..._c]}},X={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ae={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},ge={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Te(O){return e.concat("(?!",O.join("|"),")")}const le={match:e.concat(/\b/,Te([...vc,"super","import"].map((O=>`${O}\\s*\\(`))),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},se={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ce={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},Pe="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",x={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(Pe)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),X,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,p,m,E,y,T,{match:/\$\d+/},g,K,{className:"attr",begin:r+e.lookahead(":"),relevance:0},x,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[T,n.REGEXP_MODE,{className:"function",begin:Pe,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},ae,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},se,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},le,ge,B,ce,{match:/\$[(.]/}]}}function C0(n){const e=L0(n),t=Qr,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,n.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},i={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[e.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},o=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:Qr,keyword:bc.concat(o),literal:Ec,built_in:Tc.concat(r),"variable.language":Nc},u={className:"meta",begin:"@"+t},d=(p,m,E)=>{const y=p.contains.findIndex((_=>_.label===m));if(y===-1)throw new Error("can not find mode to replace");p.contains.splice(y,1,E)};Object.assign(e.keywords,c),e.exports.PARAMS_CONTAINS.push(u);const g=e.contains.find((p=>p.className==="attr"));e.exports.PARAMS_CONTAINS.push([e.exports.CLASS_REFERENCE,g]),e.contains=e.contains.concat([u,s,i]),d(e,"shebang",n.SHEBANG()),d(e,"use_strict",a);const f=e.contains.find((p=>p.label==="func.def"));return f.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}function I0(n){const e=n.regex,t=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=n.inherit(i,{begin:/\(/,end:/\)/}),o=n.inherit(n.APOS_STRING_MODE,{className:"string"}),c=n.inherit(n.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[s]},{begin:/'/,end:/'/,contains:[s]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,c,o,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,a,c,o]}]}]},n.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(t,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:u}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function R0(n){const e="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/\w[\w :()\./-]*:(?=[ \t]|$)/},{begin:/"\w[\w :()\./-]*":(?=[ \t]|$)/},{begin:/'\w[\w :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[n.BACKSLASH_ESCAPE,s]},a=n.inherit(i,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),g={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},f={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},p={begin:/\{/,end:/\}/,contains:[f],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[f],illegal:"\\n",relevance:0},E=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type",begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t},{className:"meta",begin:"&"+n.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+n.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},n.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},g,{className:"number",begin:n.C_NUMBER_RE+"\\b",relevance:0},p,m,i],y=[...E];return y.pop(),y.push(a),f.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:E}}he.registerLanguage("bash",n0);he.registerLanguage("c",r0);he.registerLanguage("cpp",s0);he.registerLanguage("cs",i0);he.registerLanguage("css",g0);he.registerLanguage("java",p0);he.registerLanguage("javascript",_0);he.registerLanguage("json",v0);he.registerLanguage("markdown",N0);he.registerLanguage("plain",A0);he.registerLanguage("php",T0);he.registerLanguage("python",w0);he.registerLanguage("sql",O0);he.registerLanguage("typescript",C0);he.registerLanguage("ruby",S0);he.registerLanguage("rust",x0);he.registerLanguage("xml",I0);he.registerLanguage("yaml",R0);const k0=[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"c",label:"C"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"json",label:"JSON"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"sql",label:"SQL"},{key:"typescript",label:"TypeScript"},{key:"ruby",label:"Ruby"},{key:"rust",label:"Rust"},{key:"xml",label:"HTML/XML"},{key:"yaml",label:"YAML"}];var M0=W("<button type=button><span class=QpTooltip-text>");function Pr({children:n,btnClass:e,tooltipText:t,btnText:r}){return(()=>{var s=M0(),i=s.firstChild;return di(s,`QpTooltip ${e}`),G(s,n,i),G(s,r,i),G(i,t),s})()}var D0=W("<button type=button class=ql-code>"),B0=W("<button type=button class=ql-code-block>"),$0=W('<span class="pi pi-hashtag">'),q0=W('<span class="pi pi-pencil">'),P0=W('<div><select class=ql-header><option value=2></option><option value=3></option><option value=4></option><option value=""selected></option></select><button type=button class=ql-bold></button><button type=button class=ql-italic></button><button type=button class=ql-strike></button><button type=button class=ql-blockquote></button><button type=button class=ql-list value=ordered></button><button type=button class=ql-list value=bullet></button><button type=button class=ql-link></button><select class=ql-align><option value=""selected></option><option value=center></option><option value=right></option></select><select class=ql-size><option value=small></option><option value=""selected></option><option value=large></option><option value=huge></option></select><button type=button class=ql-clean>'),U0=W('<span class="pi pi-youtube">'),F0=W('<span class="pi pi-link">');function H0({language:n,configuration:e,videoPluginHook:t,internalLinkPluginHook:r}){const{t:s}=Rt(n),i=[D0(),(()=>{var a=B0();return a.style.setProperty("border","1px dotted #999"),a})()];return(()=>{var a=P0(),o=a.firstChild,c=o.nextSibling,u=c.nextSibling,d=u.nextSibling,g=d.nextSibling,f=g.nextSibling,p=f.nextSibling,m=p.nextSibling,E=m.nextSibling,y=E.nextSibling,_=y.nextSibling;return G(a,(()=>e?.code&&i),E),G(a,Nt(Pr,{btnClass:"ql-html-snippet",get tooltipText(){return s("CustomToolbar.insertHtmlSnippetMessage")},get children(){return $0()}}),_),G(a,Nt(Pr,{btnClass:"ql-obfuscate",get tooltipText(){return s("CustomToolbar.obfuscate")},get children(){return q0()}}),_),G(a,t&&Nt(Pr,{btnClass:"ql-video-plugin",get tooltipText(){return s("videoPlugin.insertVideo")},get children(){return U0()}}),_),G(a,r&&Nt(Pr,{btnClass:"ql-internal-link-plugin",get tooltipText(){return s("internalLinkPlugin.insertLink")},get children(){return F0()}}),_),a})()}var z0=W("<div>"),K0=W("<div class=QuillEditor>");function G0({onSetQuillInst:n,language:e,setValue:t,value:r,service:s,insertMedia:i,videoPluginHook:a,internalLinkPluginHook:o}){const{t:c}=Rt(e),u=s.configuration,g=s.fieldType.backOffice?.editorRows??26,f=H0({language:e,configuration:u,videoPluginHook:a,internalLinkPluginHook:o}),p=z0();async function m(E,y){if(!s.uploadMedia)return;const _=y.toBlob(),T=new File([_],`${c("image")}-${(new Date).getTime()}.${E.split("/")[1]}`,{type:E}),v=await s.uploadMedia(T);v&&i(v)}return Ac((()=>{N.register("modules/imageDropAndPaste",us,!0);const E=new N(p,{modules:{toolbar:f,syntax:u.code?{hljs:he,languages:k0,interval:1e3}:!1,imageDropAndPaste:{handler:(_,T,v)=>{m(T,v).catch(s.logger.error)}}},theme:"snow"});E.on("text-change",((_,T,v)=>{v==="user"&&_.ops.forEach((async w=>{if(w.insert&&typeof w.insert=="string"){const S=w.insert;if(!a?.recognizeUrl(S))return;const B=ki(E);await ec({editorContent:B,quillEditor:E,service:s,language:e,videoPluginHook:a,value:S})}}))})),n(E),E.on("text-change",((_,T)=>{const v={delta:E.getContents(),html:E.getSemanticHTML()};t(v),s.onChange(v)}));const y=r();y&&E.setContents(y.delta??new k)})),(()=>{var E=K0();return`calc(${g}rem + 42px + 24px)`!=null?E.style.setProperty("height",`calc(${g}rem + 42px + 24px)`):E.style.removeProperty("height"),G(E,f,null),G(E,p,null),E})()}function Lo(n){if(n===void 0)return{};const e=Gm(n);return{handle:Hm(e.handle),delta:e.delta}}function j0(){const n={videoPlugin:void 0,internalLinkPlugin:void 0};return{get videoPlugin(){return n.videoPlugin},get internalLinkPlugin(){return n.internalLinkPlugin},service:{registerVideoPlugin(e){if(n.videoPlugin)throw new Error("Video plugin already registered");n.videoPlugin=e},registerInternalLinkPlugin(e){if(n.internalLinkPlugin)throw new Error("Internal link plugin already registered");n.internalLinkPlugin=e}}}}const V0=N.import("blots/block/embed");function Z0(){return class extends V0{static blotName="html-snippet";static tagName="BUTTON";static className="HtmlSnippet";static create(e){const t=super.create(e);return t.innerText="<HTML>",e.html&&t.setAttribute("data-html",e.html),t}static value(e){const{html:t}=e.dataset;return{html:t}}}}const W0=N.import("blots/block/embed"),Co=["alt","height","width"];function Y0({publicSiteUrl:n}){return class extends W0{static blotName="img";static tagName="img";static create(s){const i=super.create(s);if(s.src&&i.setAttribute("src",e(s.src)),s.width&&i.setAttribute("width",String(s.width)),s.height&&i.setAttribute("height",String(s.height)),i.classList.add("Img"),s.align){const a=Jb(s.align);a&&i.classList.add(a)}return s.zoom==="none"&&i.setAttribute("data-zoom","none"),s.uid&&(i.setAttribute("data-uid",s.uid),s.variant&&i.setAttribute("data-variant",s.variant??"")),i}static formats(s){return Co.reduce(((i,a)=>(s.hasAttribute(a)&&(i[a]=s.getAttribute(a)),i)),{})}static match(s){return/\.(jpe?g|gif|png|webp)$/.test(s)||/^data:image\/.+;base64/.test(s)}static value(s){const{uid:i,variant:a}=s.dataset,o=s.getAttribute("src")||void 0,c=s.getAttribute("width")||void 0,u=c===void 0?void 0:Number(c),d=s.getAttribute("height")||void 0,g=d===void 0?void 0:Number(d),f=Xl(s),p=s.dataset.zoom==="none"?"none":void 0;return i?{uid:i,src:o?t(o):void 0,width:u,height:g,align:f,variant:a,zoom:p}:{src:o,width:u,height:g,align:f,zoom:p}}format(s,i){Co.indexOf(s)>-1?i?this.domNode.setAttribute(s,i):this.domNode.removeAttribute(s):super.format(s,i)}};function e(r){return r.startsWith("/")?`${n}${r}`:Q0(r)}function t(r){return r.startsWith(n)?r.substring(n.length):r}}function Q0(n){return X0(n,["http","https","data"])?n:"//:0"}function X0(n,e){const t=document.createElement("a");t.href=n;const r=t.href.slice(0,t.href.indexOf(":"));return e.indexOf(r)>-1}N.import("blots/block/embed");const J0=N.import("blots/inline");function eE(n){return class extends J0{static blotName="internal-link-plugin";static tagName="SPAN";static className="InternalLinkPlugin";static create(t){const r=super.create(t);return n?.getDocumentTitle(t).then((s=>{r.innerHTML=`${s}`})),t&&r.setAttribute("data-document-id",t),r.setAttribute("contenteditable","false"),r}static formats(t){const{documentId:r}=t.dataset;return r}}}const tE=N.import("blots/inline");function nE(){return class extends tE{static blotName="obfuscate";static tagName="SPAN";static className="ObfuscateBlot";static create(e){const t=super.create();return t.setAttribute("data-as-a-link",e),t}static formats(e){const{asALink:t}=e.dataset;if(!t)throw new Error("No data attribute data-as-a-link");return jl(t)}}}const rE=N.import("blots/block/embed");function sE(n){return class extends rE{static blotName="video-plugin";static tagName="DIV";static className="VideoPlugin";static create(t){const r=super.create(t),s=n?.getThumbnailUrl(t);return r.style.backgroundImage=`url(${s})`,r.classList.add("VideoPlugin"),r.innerHTML='<span class="pi pi-youtube VideoPlugin-playButton"></span>',t&&r.setAttribute("data-video-id",t),r.querySelector("span")?.addEventListener("click",(()=>{r.dispatchEvent(new CustomEvent("click",{bubbles:!0}))})),r}static value(t){const{videoId:r}=t.dataset;return r}}}function iE({publicSiteUrl:n,videoPluginHook:e,internalLinkPluginHook:t}){N.register("formats/img",Y0({publicSiteUrl:n}),!0),N.register("formats/html-snippet",Z0(),!0),N.register("formats/obfuscate",nE(),!0),N.register("formats/video-plugin",sE(e),!0),N.register("formats/internal-link-plugin",eE(t),!0)}const TE={create:oE,init:aE},gt=j0();function aE(n){const e=`${n.pluginBaseUrl}/style.css`,t=document.createElement("link");t.rel="stylesheet",t.href=e,document.head.appendChild(t),n.registerHook("htmlEditorServiceProvider",(()=>gt.service))}function oE(n){if(n.fieldType.dataType!=="quillDelta")throw new Error(`data type '${n.fieldType.dataType}' is incompatible, should be 'quillDelta'`);return wc((e=>{const[t,r]=je(Lo(n.value)),[s,i]=je(n.language),[a,o]=je(),c=n.onChange;iE({publicSiteUrl:n.publicSiteUrl,videoPluginHook:gt.videoPlugin,internalLinkPluginHook:gt.internalLinkPlugin});let u;fi((()=>{if(!a())return;const g=s1({quillEditor:a(),service:n,language:s,videoPluginHook:gt.videoPlugin,internalLinkPluginHook:gt.internalLinkPlugin});u=g.insertMedia;const f=a();if(!f)return;const p=f.getModule("toolbar");p.addHandler("html-snippet",g.insertHtmlSnippetHandler),p.addHandler("obfuscate",g.insertObfuscateBlotHandler),p.addHandler("video-plugin",g.insertVideoHandler),p.addHandler("internal-link-plugin",g.insertInternalLinkHandler);const m=f.root,E=y=>d(y,f,n.themeConf);m.addEventListener("click",E),Sc((()=>m.removeEventListener("click",E)))}));const d=async(g,f,p)=>{const m=g.target;m.tagName==="IMG"&&await r1({editor:f,themeConf:p,service:n,element:m,language:s}),m.tagName==="BUTTON"&&m.classList.contains("HtmlSnippet")&&await e1({language:s,editor:f,service:n,htmlSnippetBtn:m}),m.tagName==="SPAN"&&m.classList.contains("ObfuscateBlot")&&await Jl({language:s,editor:f,service:n,obfuscatorSpan:m}),m.tagName==="DIV"&&m.classList.contains("VideoPlugin")&&await n1({editor:f,videoElement:m,language:s,service:n,videoPluginHook:gt.videoPlugin}),m.tagName==="SPAN"&&m.classList.contains("InternalLinkPlugin")&&await t1({editor:f,internalLinkElement:m,language:s,service:n,internalLinkPluginHook:gt.internalLinkPlugin})};return{element:Nt(G0,{language:s,onSetQuillInst:g=>{o(g)},value:t,setValue:g=>{r(g),c(g)},service:n,get videoPluginHook(){return gt.videoPlugin},get internalLinkPluginHook(){return gt.internalLinkPlugin},insertMedia:g=>u?.(g)}),setValue:g=>r(Lo(g)),setLanguage:i,getValue:t,dispose:e,insertMedia:g=>u?.(g)}}))}export{TE as default};