@paroicms/quill-editor-plugin 1.32.0 → 1.32.2
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{delegateEvents as Ns,template as be,insert as he,effect as cn,createComponent as Mt,className as Qs}from"https://esm.sh/solid-js@1.9.5/web";import{createMemo as Xs,createSignal as lt,createEffect as fs,For as Pi,Show as Ui,onMount as Ll,createRoot as Cl,onCleanup as Il}from"https://esm.sh/solid-js@1.9.5";function Ja(n){return typeof n=="object"&&n!==null&&"j"in n}function Fi(n){return n.varName?` for '${n.varName}'`:""}function Rl(n){return!isNaN(n)&&!isNaN(parseFloat(n))}function kl(n,e={}){if(typeof n=="number")return n;if(n==null)throw new Error(`Missing number value${Fi(e)}`);if(typeof n=="string"&&Rl(n))return Number(n);throw new Error(`Cannot convert to number the value of type '${typeof n}'${Fi(e)}`)}function Hi(n,e={}){return n==null?void 0:kl(n,e)}var eo=typeof global=="object"&&global&&global.Object===Object&&global,Ml=typeof self=="object"&&self&&self.Object===Object&&self,qt=eo||Ml||Function("return this")(),gn=qt.Symbol,to=Object.prototype,Dl=to.hasOwnProperty,Bl=to.toString,Cr=gn?gn.toStringTag:void 0;function ql(n){var e=Dl.call(n,Cr),t=n[Cr];try{n[Cr]=void 0;var r=!0}catch{}var s=Bl.call(n);return r&&(e?n[Cr]=t:delete n[Cr]),s}var $l=Object.prototype,Pl=$l.toString;function Ul(n){return Pl.call(n)}var Fl="[object Null]",Hl="[object Undefined]",zi=gn?gn.toStringTag:void 0;function dr(n){return n==null?n===void 0?Hl:Fl:zi&&zi in Object(n)?ql(n):Ul(n)}function Vt(n){return n!=null&&typeof n=="object"}var Rn=Array.isArray;function pn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function no(n){return n}var zl="[object AsyncFunction]",jl="[object Function]",Kl="[object GeneratorFunction]",Gl="[object Proxy]";function mi(n){if(!pn(n))return!1;var e=dr(n);return e==jl||e==Kl||e==zl||e==Gl}var Ds=qt["__core-js_shared__"],ji=function(){var n=/[^.]+$/.exec(Ds&&Ds.keys&&Ds.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function Vl(n){return!!ji&&ji in n}var Wl=Function.prototype,Zl=Wl.toString;function Bn(n){if(n!=null){try{return Zl.call(n)}catch{}try{return n+""}catch{}}return""}var Yl=/[\\^$.*+?()[\]{}|]/g,Ql=/^\[object .+?Constructor\]$/,Xl=Function.prototype,Jl=Object.prototype,ec=Xl.toString,tc=Jl.hasOwnProperty,nc=RegExp("^"+ec.call(tc).replace(Yl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function rc(n){if(!pn(n)||Vl(n))return!1;var e=mi(n)?nc:Ql;return e.test(Bn(n))}function sc(n,e){return n?.[e]}function qn(n,e){var t=sc(n,e);return rc(t)?t:void 0}var Js=qn(qt,"WeakMap"),Ki=Object.create,ic=function(){function n(){}return function(e){if(!pn(e))return{};if(Ki)return Ki(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();function ac(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 oc(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var lc=800,cc=16,uc=Date.now;function dc(n){var e=0,t=0;return function(){var r=uc(),s=cc-(r-t);if(t=r,s>0){if(++e>=lc)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function hc(n){return function(){return n}}var ps=function(){try{var n=qn(Object,"defineProperty");return n({},"",{}),n}catch{}}(),fc=ps?function(n,e){return ps(n,"toString",{configurable:!0,enumerable:!1,value:hc(e),writable:!0})}:no,gc=dc(fc);function pc(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var mc=9007199254740991,bc=/^(?:0|[1-9]\d*)$/;function ro(n,e){var t=typeof n;return e=e??mc,!!e&&(t=="number"||t!="symbol"&&bc.test(n))&&n>-1&&n%1==0&&n<e}function bi(n,e,t){e=="__proto__"&&ps?ps(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function jr(n,e){return n===e||n!==n&&e!==e}var Ec=Object.prototype,yc=Ec.hasOwnProperty;function so(n,e,t){var r=n[e];(!(yc.call(n,e)&&jr(r,t))||t===void 0&&!(e in n))&&bi(n,e,t)}function _c(n,e,t,r){var s=!t;t||(t={});for(var i=-1,a=e.length;++i<a;){var l=e[i],c=void 0;c===void 0&&(c=n[l]),s?bi(t,l,c):so(t,l,c)}return t}var Gi=Math.max;function vc(n,e,t){return e=Gi(e===void 0?n.length-1:e,0),function(){for(var r=arguments,s=-1,i=Gi(r.length-e,0),a=Array(i);++s<i;)a[s]=r[e+s];s=-1;for(var l=Array(e+1);++s<e;)l[s]=r[s];return l[e]=t(a),ac(n,this,l)}}function Nc(n,e){return gc(vc(n,e,no),n+"")}var Tc=9007199254740991;function io(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Tc}function Ts(n){return n!=null&&io(n.length)&&!mi(n)}function Ac(n,e,t){if(!pn(t))return!1;var r=typeof e;return(r=="number"?Ts(t)&&ro(e,t.length):r=="string"&&e in t)?jr(t[e],n):!1}function wc(n){return Nc((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&&Ac(t[0],t[1],a)&&(i=s<3?void 0:i,s=1),e=Object(e);++r<s;){var l=t[r];l&&n(e,l,r,i)}return e}))}var Sc=Object.prototype;function Ei(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||Sc;return n===t}function xc(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var Oc="[object Arguments]";function Vi(n){return Vt(n)&&dr(n)==Oc}var ao=Object.prototype,Lc=ao.hasOwnProperty,Cc=ao.propertyIsEnumerable,ei=Vi(function(){return arguments}())?Vi:function(n){return Vt(n)&&Lc.call(n,"callee")&&!Cc.call(n,"callee")};function Ic(){return!1}var oo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Wi=oo&&typeof module=="object"&&module&&!module.nodeType&&module,Rc=Wi&&Wi.exports===oo,Zi=Rc?qt.Buffer:void 0,kc=Zi?Zi.isBuffer:void 0,qr=kc||Ic,Mc="[object Arguments]",Dc="[object Array]",Bc="[object Boolean]",qc="[object Date]",$c="[object Error]",Pc="[object Function]",Uc="[object Map]",Fc="[object Number]",Hc="[object Object]",zc="[object RegExp]",jc="[object Set]",Kc="[object String]",Gc="[object WeakMap]",Vc="[object ArrayBuffer]",Wc="[object DataView]",Zc="[object Float32Array]",Yc="[object Float64Array]",Qc="[object Int8Array]",Xc="[object Int16Array]",Jc="[object Int32Array]",eu="[object Uint8Array]",tu="[object Uint8ClampedArray]",nu="[object Uint16Array]",ru="[object Uint32Array]",ke={};ke[Zc]=ke[Yc]=ke[Qc]=ke[Xc]=ke[Jc]=ke[eu]=ke[tu]=ke[nu]=ke[ru]=!0;ke[Mc]=ke[Dc]=ke[Vc]=ke[Bc]=ke[Wc]=ke[qc]=ke[$c]=ke[Pc]=ke[Uc]=ke[Fc]=ke[Hc]=ke[zc]=ke[jc]=ke[Kc]=ke[Gc]=!1;function su(n){return Vt(n)&&io(n.length)&&!!ke[dr(n)]}function yi(n){return function(e){return n(e)}}var lo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Dr=lo&&typeof module=="object"&&module&&!module.nodeType&&module,iu=Dr&&Dr.exports===lo,Bs=iu&&eo.process,cr=function(){try{var n=Dr&&Dr.require&&Dr.require("util").types;return n||Bs&&Bs.binding&&Bs.binding("util")}catch{}}(),Yi=cr&&cr.isTypedArray,_i=Yi?yi(Yi):su,au=Object.prototype,ou=au.hasOwnProperty;function co(n,e){var t=Rn(n),r=!t&&ei(n),s=!t&&!r&&qr(n),i=!t&&!r&&!s&&_i(n),a=t||r||s||i,l=a?xc(n.length,String):[],c=l.length;for(var u in n)(e||ou.call(n,u))&&!(a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||ro(u,c)))&&l.push(u);return l}function uo(n,e){return function(t){return n(e(t))}}var lu=uo(Object.keys,Object),cu=Object.prototype,uu=cu.hasOwnProperty;function du(n){if(!Ei(n))return lu(n);var e=[];for(var t in Object(n))uu.call(n,t)&&t!="constructor"&&e.push(t);return e}function hu(n){return Ts(n)?co(n):du(n)}function fu(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var gu=Object.prototype,pu=gu.hasOwnProperty;function mu(n){if(!pn(n))return fu(n);var e=Ei(n),t=[];for(var r in n)r=="constructor"&&(e||!pu.call(n,r))||t.push(r);return t}function ho(n){return Ts(n)?co(n,!0):mu(n)}var $r=qn(Object,"create");function bu(){this.__data__=$r?$r(null):{},this.size=0}function Eu(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var yu="__lodash_hash_undefined__",_u=Object.prototype,vu=_u.hasOwnProperty;function Nu(n){var e=this.__data__;if($r){var t=e[n];return t===yu?void 0:t}return vu.call(e,n)?e[n]:void 0}var Tu=Object.prototype,Au=Tu.hasOwnProperty;function wu(n){var e=this.__data__;return $r?e[n]!==void 0:Au.call(e,n)}var Su="__lodash_hash_undefined__";function xu(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=$r&&e===void 0?Su:e,this}function kn(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])}}kn.prototype.clear=bu;kn.prototype.delete=Eu;kn.prototype.get=Nu;kn.prototype.has=wu;kn.prototype.set=xu;function Ou(){this.__data__=[],this.size=0}function As(n,e){for(var t=n.length;t--;)if(jr(n[t][0],e))return t;return-1}var Lu=Array.prototype,Cu=Lu.splice;function Iu(n){var e=this.__data__,t=As(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():Cu.call(e,t,1),--this.size,!0}function Ru(n){var e=this.__data__,t=As(e,n);return t<0?void 0:e[t][1]}function ku(n){return As(this.__data__,n)>-1}function Mu(n,e){var t=this.__data__,r=As(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function Zt(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])}}Zt.prototype.clear=Ou;Zt.prototype.delete=Iu;Zt.prototype.get=Ru;Zt.prototype.has=ku;Zt.prototype.set=Mu;var Pr=qn(qt,"Map");function Du(){this.size=0,this.__data__={hash:new kn,map:new(Pr||Zt),string:new kn}}function Bu(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function ws(n,e){var t=n.__data__;return Bu(e)?t[typeof e=="string"?"string":"hash"]:t.map}function qu(n){var e=ws(this,n).delete(n);return this.size-=e?1:0,e}function $u(n){return ws(this,n).get(n)}function Pu(n){return ws(this,n).has(n)}function Uu(n,e){var t=ws(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function $n(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])}}$n.prototype.clear=Du;$n.prototype.delete=qu;$n.prototype.get=$u;$n.prototype.has=Pu;$n.prototype.set=Uu;function Fu(n,e){for(var t=-1,r=e.length,s=n.length;++t<r;)n[s+t]=e[t];return n}var fo=uo(Object.getPrototypeOf,Object),Hu="[object Object]",zu=Function.prototype,ju=Object.prototype,go=zu.toString,Ku=ju.hasOwnProperty,Gu=go.call(Object);function Vu(n){if(!Vt(n)||dr(n)!=Hu)return!1;var e=fo(n);if(e===null)return!0;var t=Ku.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&go.call(t)==Gu}function Wu(){this.__data__=new Zt,this.size=0}function Zu(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function Yu(n){return this.__data__.get(n)}function Qu(n){return this.__data__.has(n)}var Xu=200;function Ju(n,e){var t=this.__data__;if(t instanceof Zt){var r=t.__data__;if(!Pr||r.length<Xu-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new $n(r)}return t.set(n,e),this.size=t.size,this}function Dt(n){var e=this.__data__=new Zt(n);this.size=e.size}Dt.prototype.clear=Wu;Dt.prototype.delete=Zu;Dt.prototype.get=Yu;Dt.prototype.has=Qu;Dt.prototype.set=Ju;var po=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Qi=po&&typeof module=="object"&&module&&!module.nodeType&&module,ed=Qi&&Qi.exports===po,Xi=ed?qt.Buffer:void 0,Ji=Xi?Xi.allocUnsafe:void 0;function mo(n,e){if(e)return n.slice();var t=n.length,r=Ji?Ji(t):new n.constructor(t);return n.copy(r),r}function td(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 nd(){return[]}var rd=Object.prototype,sd=rd.propertyIsEnumerable,ea=Object.getOwnPropertySymbols,id=ea?function(n){return n==null?[]:(n=Object(n),td(ea(n),(function(e){return sd.call(n,e)})))}:nd;function ad(n,e,t){var r=e(n);return Rn(n)?r:Fu(r,t(n))}function ti(n){return ad(n,hu,id)}var ni=qn(qt,"DataView"),ri=qn(qt,"Promise"),si=qn(qt,"Set"),ta="[object Map]",od="[object Object]",na="[object Promise]",ra="[object Set]",sa="[object WeakMap]",ia="[object DataView]",ld=Bn(ni),cd=Bn(Pr),ud=Bn(ri),dd=Bn(si),hd=Bn(Js),At=dr;(ni&&At(new ni(new ArrayBuffer(1)))!=ia||Pr&&At(new Pr)!=ta||ri&&At(ri.resolve())!=na||si&&At(new si)!=ra||Js&&At(new Js)!=sa)&&(At=function(n){var e=dr(n),t=e==od?n.constructor:void 0,r=t?Bn(t):"";if(r)switch(r){case ld:return ia;case cd:return ta;case ud:return na;case dd:return ra;case hd:return sa}return e});var fd=Object.prototype,gd=fd.hasOwnProperty;function pd(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&gd.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var ms=qt.Uint8Array;function vi(n){var e=new n.constructor(n.byteLength);return new ms(e).set(new ms(n)),e}function md(n,e){var t=vi(n.buffer);return new n.constructor(t,n.byteOffset,n.byteLength)}var bd=/\w*$/;function Ed(n){var e=new n.constructor(n.source,bd.exec(n));return e.lastIndex=n.lastIndex,e}var aa=gn?gn.prototype:void 0,oa=aa?aa.valueOf:void 0;function yd(n){return oa?Object(oa.call(n)):{}}function bo(n,e){var t=e?vi(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var _d="[object Boolean]",vd="[object Date]",Nd="[object Map]",Td="[object Number]",Ad="[object RegExp]",wd="[object Set]",Sd="[object String]",xd="[object Symbol]",Od="[object ArrayBuffer]",Ld="[object DataView]",Cd="[object Float32Array]",Id="[object Float64Array]",Rd="[object Int8Array]",kd="[object Int16Array]",Md="[object Int32Array]",Dd="[object Uint8Array]",Bd="[object Uint8ClampedArray]",qd="[object Uint16Array]",$d="[object Uint32Array]";function Pd(n,e,t){var r=n.constructor;switch(e){case Od:return vi(n);case _d:case vd:return new r(+n);case Ld:return md(n);case Cd:case Id:case Rd:case kd:case Md:case Dd:case Bd:case qd:case $d:return bo(n,t);case Nd:return new r;case Td:case Sd:return new r(n);case Ad:return Ed(n);case wd:return new r;case xd:return yd(n)}}function Eo(n){return typeof n.constructor=="function"&&!Ei(n)?ic(fo(n)):{}}var Ud="[object Map]";function Fd(n){return Vt(n)&&At(n)==Ud}var la=cr&&cr.isMap,Hd=la?yi(la):Fd,zd="[object Set]";function jd(n){return Vt(n)&&At(n)==zd}var ca=cr&&cr.isSet,Kd=ca?yi(ca):jd,Gd=1,yo="[object Arguments]",Vd="[object Array]",Wd="[object Boolean]",Zd="[object Date]",Yd="[object Error]",_o="[object Function]",Qd="[object GeneratorFunction]",Xd="[object Map]",Jd="[object Number]",vo="[object Object]",eh="[object RegExp]",th="[object Set]",nh="[object String]",rh="[object Symbol]",sh="[object WeakMap]",ih="[object ArrayBuffer]",ah="[object DataView]",oh="[object Float32Array]",lh="[object Float64Array]",ch="[object Int8Array]",uh="[object Int16Array]",dh="[object Int32Array]",hh="[object Uint8Array]",fh="[object Uint8ClampedArray]",gh="[object Uint16Array]",ph="[object Uint32Array]",Ie={};Ie[yo]=Ie[Vd]=Ie[ih]=Ie[ah]=Ie[Wd]=Ie[Zd]=Ie[oh]=Ie[lh]=Ie[ch]=Ie[uh]=Ie[dh]=Ie[Xd]=Ie[Jd]=Ie[vo]=Ie[eh]=Ie[th]=Ie[nh]=Ie[rh]=Ie[hh]=Ie[fh]=Ie[gh]=Ie[ph]=!0;Ie[Yd]=Ie[_o]=Ie[sh]=!1;function gs(n,e,t,r,s,i){var a,l=e&Gd;if(a!==void 0)return a;if(!pn(n))return n;var c=Rn(n);if(c)a=pd(n);else{var u=At(n),f=u==_o||u==Qd;if(qr(n))return mo(n,l);if(u==vo||u==yo||f&&!s)a=f?{}:Eo(n);else{if(!Ie[u])return s?n:{};a=Pd(n,u,l)}}i||(i=new Dt);var p=i.get(n);if(p)return p;i.set(n,a),Kd(n)?n.forEach((function(_){a.add(gs(_,e,t,_,n,i))})):Hd(n)&&n.forEach((function(_,y){a.set(y,gs(_,e,t,y,n,i))}));var h=ti,g=c?void 0:h(n);return pc(g||n,(function(_,y){g&&(y=_,_=n[y]),so(a,y,gs(_,e,t,y,n,i))})),a}var mh=1,bh=4;function ar(n){return gs(n,mh|bh)}var Eh="__lodash_hash_undefined__";function yh(n){return this.__data__.set(n,Eh),this}function _h(n){return this.__data__.has(n)}function bs(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new $n;++e<t;)this.add(n[e])}bs.prototype.add=bs.prototype.push=yh;bs.prototype.has=_h;function vh(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 Nh(n,e){return n.has(e)}var Th=1,Ah=2;function No(n,e,t,r,s,i){var a=t&Th,l=n.length,c=e.length;if(l!=c&&!(a&&c>l))return!1;var u=i.get(n),f=i.get(e);if(u&&f)return u==e&&f==n;var p=-1,h=!0,g=t&Ah?new bs:void 0;for(i.set(n,e),i.set(e,n);++p<l;){var _=n[p],y=e[p];if(r)var N=a?r(y,_,p,e,n,i):r(_,y,p,n,e,i);if(N!==void 0){if(N)continue;h=!1;break}if(g){if(!vh(e,(function(T,L){if(!Nh(g,L)&&(_===T||s(_,T,t,r,i)))return g.push(L)}))){h=!1;break}}else if(!(_===y||s(_,y,t,r,i))){h=!1;break}}return i.delete(n),i.delete(e),h}function wh(n){var e=-1,t=Array(n.size);return n.forEach((function(r,s){t[++e]=[s,r]})),t}function Sh(n){var e=-1,t=Array(n.size);return n.forEach((function(r){t[++e]=r})),t}var xh=1,Oh=2,Lh="[object Boolean]",Ch="[object Date]",Ih="[object Error]",Rh="[object Map]",kh="[object Number]",Mh="[object RegExp]",Dh="[object Set]",Bh="[object String]",qh="[object Symbol]",$h="[object ArrayBuffer]",Ph="[object DataView]",ua=gn?gn.prototype:void 0,qs=ua?ua.valueOf:void 0;function Uh(n,e,t,r,s,i,a){switch(t){case Ph:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case $h:return!(n.byteLength!=e.byteLength||!i(new ms(n),new ms(e)));case Lh:case Ch:case kh:return jr(+n,+e);case Ih:return n.name==e.name&&n.message==e.message;case Mh:case Bh:return n==e+"";case Rh:var l=wh;case Dh:var c=r&xh;if(l||(l=Sh),n.size!=e.size&&!c)return!1;var u=a.get(n);if(u)return u==e;r|=Oh,a.set(n,e);var f=No(l(n),l(e),r,s,i,a);return a.delete(n),f;case qh:if(qs)return qs.call(n)==qs.call(e)}return!1}var Fh=1,Hh=Object.prototype,zh=Hh.hasOwnProperty;function jh(n,e,t,r,s,i){var a=t&Fh,l=ti(n),c=l.length,u=ti(e),f=u.length;if(c!=f&&!a)return!1;for(var p=c;p--;){var h=l[p];if(!(a?h in e:zh.call(e,h)))return!1}var g=i.get(n),_=i.get(e);if(g&&_)return g==e&&_==n;var y=!0;i.set(n,e),i.set(e,n);for(var N=a;++p<c;){h=l[p];var T=n[h],L=e[h];if(r)var R=a?r(L,T,h,e,n,i):r(T,L,h,n,e,i);if(!(R===void 0?T===L||s(T,L,t,r,i):R)){y=!1;break}N||(N=h=="constructor")}if(y&&!N){var F=n.constructor,P=e.constructor;F!=P&&"constructor"in n&&"constructor"in e&&!(typeof F=="function"&&F instanceof F&&typeof P=="function"&&P instanceof P)&&(y=!1)}return i.delete(n),i.delete(e),y}var Kh=1,da="[object Arguments]",ha="[object Array]",es="[object Object]",Gh=Object.prototype,fa=Gh.hasOwnProperty;function Vh(n,e,t,r,s,i){var a=Rn(n),l=Rn(e),c=a?ha:At(n),u=l?ha:At(e);c=c==da?es:c,u=u==da?es:u;var f=c==es,p=u==es,h=c==u;if(h&&qr(n)){if(!qr(e))return!1;a=!0,f=!1}if(h&&!f)return i||(i=new Dt),a||_i(n)?No(n,e,t,r,s,i):Uh(n,e,c,t,r,s,i);if(!(t&Kh)){var g=f&&fa.call(n,"__wrapped__"),_=p&&fa.call(e,"__wrapped__");if(g||_){var y=g?n.value():n,N=_?e.value():e;return i||(i=new Dt),s(y,N,t,r,i)}}return h?(i||(i=new Dt),jh(n,e,t,r,s,i)):!1}function To(n,e,t,r,s){return n===e?!0:n==null||e==null||!Vt(n)&&!Vt(e)?n!==n&&e!==e:Vh(n,e,t,r,To,s)}function Wh(n){return function(e,t,r){for(var s=-1,i=Object(e),a=r(e),l=a.length;l--;){var c=a[++s];if(t(i[c],c,i)===!1)break}return e}}var Zh=Wh();function ii(n,e,t){(t!==void 0&&!jr(n[e],t)||t===void 0&&!(e in n))&&bi(n,e,t)}function Yh(n){return Vt(n)&&Ts(n)}function ai(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function Qh(n){return _c(n,ho(n))}function Xh(n,e,t,r,s,i,a){var l=ai(n,t),c=ai(e,t),u=a.get(c);if(u){ii(n,t,u);return}var f=i?i(l,c,t+"",n,e,a):void 0,p=f===void 0;if(p){var h=Rn(c),g=!h&&qr(c),_=!h&&!g&&_i(c);f=c,h||g||_?Rn(l)?f=l:Yh(l)?f=oc(l):g?(p=!1,f=mo(c,!0)):_?(p=!1,f=bo(c,!0)):f=[]:Vu(c)||ei(c)?(f=l,ei(l)?f=Qh(l):(!pn(l)||mi(l))&&(f=Eo(c))):p=!1}p&&(a.set(c,f),s(f,c,r,i,a),a.delete(c)),ii(n,t,f)}function Ao(n,e,t,r,s){n!==e&&Zh(e,(function(i,a){if(s||(s=new Dt),pn(i))Xh(n,e,a,t,Ao,r,s);else{var l=r?r(ai(n,a),i,a+"",n,e,s):void 0;l===void 0&&(l=i),ii(n,a,l)}}),ho)}function Ni(n,e){return To(n,e)}var hn=wc((function(n,e,t){Ao(n,e,t)})),Z=(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))(Z||{});class Bt{constructor(e,t,r={}){this.attrName=e,this.keyName=t;const s=Z.TYPE&Z.ATTRIBUTE;this.scope=r.scope!=null?r.scope&Z.LEVEL|s:Z.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 or extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const wo=class oi{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 or(`Unable to create ${t} blot`);const i=s,a=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:i.create(r),l=new i(e,a,r);return oi.blots.set(l.domNode,l),l}find(e,t=!1){return oi.find(e,t)}query(e,t=Z.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&Z.LEVEL&Z.BLOCK?r=this.types.block:e&Z.LEVEL&Z.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&Z.LEVEL&r.scope&&t&Z.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 or("Invalid definition");if(r&&t.blotName==="abstract")throw new or("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}))}};wo.blots=new WeakMap;let ur=wo;function ga(n,e){return(n.getAttribute("class")||"").split(/\s+/).filter((t=>t.indexOf(`${e}-`)===0))}class Jh extends Bt{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){ga(e,this.keyName).forEach((t=>{e.classList.remove(t)})),e.classList.length===0&&e.removeAttribute("class")}value(e){const t=(ga(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}}const Lt=Jh;function $s(n){const e=n.split("-"),t=e.slice(1).map((r=>r[0].toUpperCase()+r.slice(1))).join("");return e[0]+t}class ef extends Bt{static keys(e){return(e.getAttribute("style")||"").split(";").map((t=>t.split(":")[0].trim()))}add(e,t){return this.canAdd(e,t)?(e.style[$s(this.keyName)]=t,!0):!1}remove(e){e.style[$s(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[$s(this.keyName)];return this.canAdd(e,t)?t:""}}const mn=ef;class tf{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=ur.find(this.domNode);if(e==null)return;const t=Bt.keys(this.domNode),r=Lt.keys(this.domNode),s=mn.keys(this.domNode);t.concat(r).concat(s).forEach((i=>{const a=e.scroll.query(i,Z.ATTRIBUTE);a instanceof Bt&&(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 Ss=tf,So=class{constructor(e,t){this.scroll=e,this.domNode=t,ur.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new or("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),ur.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,Z.BLOT)!=null&&s)i.wrap(r,s);else if(this.scroll.query(r,Z.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 or(`Cannot wrap ${e}`);return r.appendChild(this),r}};So.blotName="abstract";let xo=So;const Oo=class extends xo{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}}};Oo.scope=Z.INLINE_BLOT;let nf=Oo;const et=nf;class rf{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 l=this.iterator(s);let c=l();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=l()}}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 pa(n,e){const t=e.find(n);if(t)return t;try{return e.create(n)}catch{const r=e.create(Z.INLINE);return Array.from(n.childNodes).forEach((s=>{r.domNode.appendChild(s)})),n.parentNode&&n.parentNode.replaceChild(r.domNode,n),r.attach(),r}}const Lo=class ln extends xo{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,ln.uiClass&&this.uiNode.classList.add(ln.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new rf,Array.from(this.domNode.childNodes).filter((e=>e!==this.uiNode)).reverse().forEach((e=>{try{const t=pa(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof or)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 ln?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,l,c)=>{(e.blotName==null&&e(a)||e.blotName!=null&&a instanceof e)&&s.push(a),a instanceof ln&&(s=s.concat(a.descendants(e,l,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===Z.BLOCK_BLOT?(t.next!=null&&this.splitAfter(t),t.prev!=null&&this.splitAfter(t.prev),t.parent.unwrap(),e=!0):t instanceof ln?t.unwrap():t.remove())}))}formatAt(e,t,r,s){this.children.forEachAt(e,t,((i,a,l)=>{i.formatAt(a,l,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 ln?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 ln&&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 l=s.split(i,t);l!=null&&r.appendChild(l)})),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 l=pa(i,this.scroll);(l.next!==a||l.next==null)&&(l.parent!=null&&l.parent.removeChild(this),this.insertBefore(l,a||void 0))})),this.enforceAllowedChildren()}};Lo.uiClass="";let sf=Lo;const xt=sf;function af(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 er=class tr extends xt{static create(e){return super.create(e)}static formats(e,t){const r=t.query(tr.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 Ss(this.domNode)}format(e,t){if(e===this.statics.blotName&&!t)this.children.forEach((r=>{r instanceof tr||(r=r.wrap(tr.blotName,!0)),this.attributes.copy(r)})),this.unwrap();else{const r=this.scroll.query(e,Z.INLINE);if(r==null)return;r instanceof Bt?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,Z.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 tr&&r.prev===this&&af(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 tr&&this.attributes.move(r),r}};er.allowedChildren=[er,et],er.blotName="inline",er.scope=Z.INLINE_BLOT,er.tagName="SPAN";let of=er;const Ti=of,nr=class li extends xt{static create(e){return super.create(e)}static formats(e,t){const r=t.query(li.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 Ss(this.domNode)}format(e,t){const r=this.scroll.query(e,Z.BLOCK);r!=null&&(r instanceof Bt?this.attributes.attribute(r,t):e===this.statics.blotName&&!t?this.replaceWith(li.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,Z.BLOCK)!=null?this.format(r,s):super.formatAt(e,t,r,s)}insertAt(e,t,r){if(r==null||this.scroll.query(t,Z.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()}};nr.blotName="block",nr.scope=Z.BLOCK_BLOT,nr.tagName="P",nr.allowedChildren=[Ti,nr,et];let lf=nr;const Ur=lf,ci=class extends xt{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())}};ci.blotName="container",ci.scope=Z.BLOCK_BLOT;let cf=ci;const xs=cf;class uf extends et{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 ct=uf,df={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},hf=100,rr=class extends xt{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,df),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=Z.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 xt&&c.children.forEach(a),r.delete(c.domNode),c.optimize(t))};let l=e;for(let c=0;l.length>0;c+=1){if(c>=hf)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach((u=>{const f=this.find(u.target,!0);f!=null&&(f.domNode===u.target&&(u.type==="childList"?(i(this.find(u.previousSibling,!1)),Array.from(u.addedNodes).forEach((p=>{const h=this.find(p,!1);i(h,!1),h instanceof xt&&h.children.forEach((g=>{i(g,!1)}))}))):u.type==="attributes"&&i(f.prev)),i(f))})),this.children.forEach(a),l=Array.from(this.observer.takeRecords()),s=l.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)}};rr.blotName="scroll",rr.defaultChild=Ur,rr.allowedChildren=[Ur,xs],rr.scope=Z.BLOCK_BLOT,rr.tagName="DIV";let ff=rr;const Ai=ff,ui=class Co extends et{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 Co&&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}};ui.blotName="text",ui.scope=Z.INLINE_BLOT;let gf=ui;const Es=gf,pf=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Bt,AttributorStore:Ss,BlockBlot:Ur,ClassAttributor:Lt,ContainerBlot:xs,EmbedBlot:ct,InlineBlot:Ti,LeafBlot:et,ParentBlot:xt,Registry:ur,Scope:Z,ScrollBlot:Ai,StyleAttributor:mn,TextBlot:Es},Symbol.toStringTag,{value:"Module"}));var un=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wi(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ts={exports:{}},Ps,ma;function mf(){if(ma)return Ps;ma=1;var n=-1,e=1,t=0;function r(b,x,v,C,k){if(b===x)return b?[[t,b]]:[];if(v!=null){var O=ce(b,x,v);if(O)return O}var B=l(b,x),M=b.substring(0,B);b=b.substring(B),x=x.substring(B),B=u(b,x);var H=b.substring(b.length-B);b=b.substring(0,b.length-B),x=x.substring(0,x.length-B);var q=s(b,x);return M&&q.unshift([t,M]),H&&q.push([t,H]),L(q,k),C&&p(q),q}function s(b,x){var v;if(!b)return[[e,x]];if(!x)return[[n,b]];var C=b.length>x.length?b:x,k=b.length>x.length?x:b,O=C.indexOf(k);if(O!==-1)return v=[[e,C.substring(0,O)],[t,k],[e,C.substring(O+k.length)]],b.length>x.length&&(v[0][0]=v[2][0]=n),v;if(k.length===1)return[[n,b],[e,x]];var B=f(b,x);if(B){var M=B[0],H=B[1],q=B[2],te=B[3],J=B[4],ie=r(M,q),de=r(H,te);return ie.concat([[t,J]],de)}return i(b,x)}function i(b,x){for(var v=b.length,C=x.length,k=Math.ceil((v+C)/2),O=k,B=2*k,M=new Array(B),H=new Array(B),q=0;q<B;q++)M[q]=-1,H[q]=-1;M[O+1]=0,H[O+1]=0;for(var te=v-C,J=te%2!==0,ie=0,de=0,X=0,Oe=0,Le=0;Le<k;Le++){for(var le=-Le+ie;le<=Le-de;le+=2){var _e=O+le,fe;le===-Le||le!==Le&&M[_e-1]<M[_e+1]?fe=M[_e+1]:fe=M[_e-1]+1;for(var Ee=fe-le;fe<v&&Ee<C&&b.charAt(fe)===x.charAt(Ee);)fe++,Ee++;if(M[_e]=fe,fe>v)de+=2;else if(Ee>C)ie+=2;else if(J){var ve=O+te-le;if(ve>=0&&ve<B&&H[ve]!==-1){var Ne=v-H[ve];if(fe>=Ne)return a(b,x,fe,Ee)}}}for(var De=-Le+X;De<=Le-Oe;De+=2){var ve=O+De,Ne;De===-Le||De!==Le&&H[ve-1]<H[ve+1]?Ne=H[ve+1]:Ne=H[ve-1]+1;for(var ze=Ne-De;Ne<v&&ze<C&&b.charAt(v-Ne-1)===x.charAt(C-ze-1);)Ne++,ze++;if(H[ve]=Ne,Ne>v)Oe+=2;else if(ze>C)X+=2;else if(!J){var _e=O+te-De;if(_e>=0&&_e<B&&M[_e]!==-1){var fe=M[_e],Ee=O+fe-_e;if(Ne=v-Ne,fe>=Ne)return a(b,x,fe,Ee)}}}}return[[n,b],[e,x]]}function a(b,x,v,C){var k=b.substring(0,v),O=x.substring(0,C),B=b.substring(v),M=x.substring(C),H=r(k,O),q=r(B,M);return H.concat(q)}function l(b,x){if(!b||!x||b.charAt(0)!==x.charAt(0))return 0;for(var v=0,C=Math.min(b.length,x.length),k=C,O=0;v<k;)b.substring(O,k)==x.substring(O,k)?(v=k,O=v):C=k,k=Math.floor((C-v)/2+v);return R(b.charCodeAt(k-1))&&k--,k}function c(b,x){var v=b.length,C=x.length;if(v==0||C==0)return 0;v>C?b=b.substring(v-C):v<C&&(x=x.substring(0,v));var k=Math.min(v,C);if(b==x)return k;for(var O=0,B=1;;){var M=b.substring(k-B),H=x.indexOf(M);if(H==-1)return O;B+=H,(H==0||b.substring(k-B)==x.substring(0,B))&&(O=B,B++)}}function u(b,x){if(!b||!x||b.slice(-1)!==x.slice(-1))return 0;for(var v=0,C=Math.min(b.length,x.length),k=C,O=0;v<k;)b.substring(b.length-k,b.length-O)==x.substring(x.length-k,x.length-O)?(v=k,O=v):C=k,k=Math.floor((C-v)/2+v);return F(b.charCodeAt(b.length-k))&&k--,k}function f(b,x){var v=b.length>x.length?b:x,C=b.length>x.length?x:b;if(v.length<4||C.length*2<v.length)return null;function k(de,X,Oe){for(var Le=de.substring(Oe,Oe+Math.floor(de.length/4)),le=-1,_e="",fe,Ee,ve,Ne;(le=X.indexOf(Le,le+1))!==-1;){var De=l(de.substring(Oe),X.substring(le)),ze=u(de.substring(0,Oe),X.substring(0,le));_e.length<ze+De&&(_e=X.substring(le-ze,le)+X.substring(le,le+De),fe=de.substring(0,Oe-ze),Ee=de.substring(Oe+De),ve=X.substring(0,le-ze),Ne=X.substring(le+De))}return _e.length*2>=de.length?[fe,Ee,ve,Ne,_e]:null}var O=k(v,C,Math.ceil(v.length/4)),B=k(v,C,Math.ceil(v.length/2)),M;if(!O&&!B)return null;B?O?M=O[4].length>B[4].length?O:B:M=B:M=O;var H,q,te,J;b.length>x.length?(H=M[0],q=M[1],te=M[2],J=M[3]):(te=M[0],J=M[1],H=M[2],q=M[3]);var ie=M[4];return[H,q,te,J,ie]}function p(b){for(var x=!1,v=[],C=0,k=null,O=0,B=0,M=0,H=0,q=0;O<b.length;)b[O][0]==t?(v[C++]=O,B=H,M=q,H=0,q=0,k=b[O][1]):(b[O][0]==e?H+=b[O][1].length:q+=b[O][1].length,k&&k.length<=Math.max(B,M)&&k.length<=Math.max(H,q)&&(b.splice(v[C-1],0,[n,k]),b[v[C-1]+1][0]=e,C--,C--,O=C>0?v[C-1]:-1,B=0,M=0,H=0,q=0,k=null,x=!0)),O++;for(x&&L(b),T(b),O=1;O<b.length;){if(b[O-1][0]==n&&b[O][0]==e){var te=b[O-1][1],J=b[O][1],ie=c(te,J),de=c(J,te);ie>=de?(ie>=te.length/2||ie>=J.length/2)&&(b.splice(O,0,[t,J.substring(0,ie)]),b[O-1][1]=te.substring(0,te.length-ie),b[O+1][1]=J.substring(ie),O++):(de>=te.length/2||de>=J.length/2)&&(b.splice(O,0,[t,te.substring(0,de)]),b[O-1][0]=e,b[O-1][1]=J.substring(0,J.length-de),b[O+1][0]=n,b[O+1][1]=te.substring(de),O++),O++}O++}}var h=/[^a-zA-Z0-9]/,g=/\s/,_=/[\r\n]/,y=/\n\r?\n$/,N=/^\r?\n\r?\n/;function T(b){function x(de,X){if(!de||!X)return 6;var Oe=de.charAt(de.length-1),Le=X.charAt(0),le=Oe.match(h),_e=Le.match(h),fe=le&&Oe.match(g),Ee=_e&&Le.match(g),ve=fe&&Oe.match(_),Ne=Ee&&Le.match(_),De=ve&&de.match(y),ze=Ne&&X.match(N);return De||ze?5:ve||Ne?4:le&&!fe&&Ee?3:fe||Ee?2:le||_e?1:0}for(var v=1;v<b.length-1;){if(b[v-1][0]==t&&b[v+1][0]==t){var C=b[v-1][1],k=b[v][1],O=b[v+1][1],B=u(C,k);if(B){var M=k.substring(k.length-B);C=C.substring(0,C.length-B),k=M+k.substring(0,k.length-B),O=M+O}for(var H=C,q=k,te=O,J=x(C,k)+x(k,O);k.charAt(0)===O.charAt(0);){C+=k.charAt(0),k=k.substring(1)+O.charAt(0),O=O.substring(1);var ie=x(C,k)+x(k,O);ie>=J&&(J=ie,H=C,q=k,te=O)}b[v-1][1]!=H&&(H?b[v-1][1]=H:(b.splice(v-1,1),v--),b[v][1]=q,te?b[v+1][1]=te:(b.splice(v+1,1),v--))}v++}}function L(b,x){b.push([t,""]);for(var v=0,C=0,k=0,O="",B="",M;v<b.length;){if(v<b.length-1&&!b[v][1]){b.splice(v,1);continue}switch(b[v][0]){case e:k++,B+=b[v][1],v++;break;case n:C++,O+=b[v][1],v++;break;case t:var H=v-k-C-1;if(x){if(H>=0&&V(b[H][1])){var q=b[H][1].slice(-1);if(b[H][1]=b[H][1].slice(0,-1),O=q+O,B=q+B,!b[H][1]){b.splice(H,1),v--;var te=H-1;b[te]&&b[te][0]===e&&(k++,B=b[te][1]+B,te--),b[te]&&b[te][0]===n&&(C++,O=b[te][1]+O,te--),H=te}}if(P(b[v][1])){var q=b[v][1].charAt(0);b[v][1]=b[v][1].slice(1),O+=q,B+=q}}if(v<b.length-1&&!b[v][1]){b.splice(v,1);break}if(O.length>0||B.length>0){O.length>0&&B.length>0&&(M=l(B,O),M!==0&&(H>=0?b[H][1]+=B.substring(0,M):(b.splice(0,0,[t,B.substring(0,M)]),v++),B=B.substring(M),O=O.substring(M)),M=u(B,O),M!==0&&(b[v][1]=B.substring(B.length-M)+b[v][1],B=B.substring(0,B.length-M),O=O.substring(0,O.length-M)));var J=k+C;O.length===0&&B.length===0?(b.splice(v-J,J),v=v-J):O.length===0?(b.splice(v-J,J,[e,B]),v=v-J+1):B.length===0?(b.splice(v-J,J,[n,O]),v=v-J+1):(b.splice(v-J,J,[n,O],[e,B]),v=v-J+2)}v!==0&&b[v-1][0]===t?(b[v-1][1]+=b[v][1],b.splice(v,1)):v++,k=0,C=0,O="",B="";break}}b[b.length-1][1]===""&&b.pop();var ie=!1;for(v=1;v<b.length-1;)b[v-1][0]===t&&b[v+1][0]===t&&(b[v][1].substring(b[v][1].length-b[v-1][1].length)===b[v-1][1]?(b[v][1]=b[v-1][1]+b[v][1].substring(0,b[v][1].length-b[v-1][1].length),b[v+1][1]=b[v-1][1]+b[v+1][1],b.splice(v-1,1),ie=!0):b[v][1].substring(0,b[v+1][1].length)==b[v+1][1]&&(b[v-1][1]+=b[v+1][1],b[v][1]=b[v][1].substring(b[v+1][1].length)+b[v+1][1],b.splice(v+1,1),ie=!0)),v++;ie&&L(b,x)}function R(b){return b>=55296&&b<=56319}function F(b){return b>=56320&&b<=57343}function P(b){return F(b.charCodeAt(0))}function V(b){return R(b.charCodeAt(b.length-1))}function U(b){for(var x=[],v=0;v<b.length;v++)b[v][1].length>0&&x.push(b[v]);return x}function ee(b,x,v,C){return V(b)||P(C)?null:U([[t,b],[n,x],[e,v],[t,C]])}function ce(b,x,v){var C=typeof v=="number"?{index:v,length:0}:v.oldRange,k=typeof v=="number"?null:v.newRange,O=b.length,B=x.length;if(C.length===0&&(k===null||k.length===0)){var M=C.index,H=b.slice(0,M),q=b.slice(M),te=k?k.index:null;e:{var J=M+B-O;if(te!==null&&te!==J||J<0||J>B)break e;var ie=x.slice(0,J),de=x.slice(J);if(de!==q)break e;var X=Math.min(M,J),Oe=H.slice(0,X),Le=ie.slice(0,X);if(Oe!==Le)break e;var le=H.slice(X),_e=ie.slice(X);return ee(Oe,le,_e,q)}e:{if(te!==null&&te!==M)break e;var fe=M,ie=x.slice(0,fe),de=x.slice(fe);if(ie!==H)break e;var Ee=Math.min(O-fe,B-fe),ve=q.slice(q.length-Ee),Ne=de.slice(de.length-Ee);if(ve!==Ne)break e;var le=q.slice(0,q.length-Ee),_e=de.slice(0,de.length-Ee);return ee(H,le,_e,ve)}}if(C.length>0&&k&&k.length===0)e:{var Oe=b.slice(0,C.index),ve=b.slice(C.index+C.length),X=Oe.length,Ee=ve.length;if(B<X+Ee)break e;var Le=x.slice(0,X),Ne=x.slice(B-Ee);if(Oe!==Le||ve!==Ne)break e;var le=b.slice(X,O-Ee),_e=x.slice(X,B-Ee);return ee(Oe,le,_e,ve)}return null}function pe(b,x,v,C){return r(b,x,v,C,!0)}return pe.INSERT=e,pe.DELETE=n,pe.EQUAL=t,Ps=pe,Ps}var Rr={exports:{}};Rr.exports;var ba;function Io(){return ba||(ba=1,function(n,e){var t=200,r="__lodash_hash_undefined__",s=9007199254740991,i="[object Arguments]",a="[object Array]",l="[object Boolean]",c="[object Date]",u="[object Error]",f="[object Function]",p="[object GeneratorFunction]",h="[object Map]",g="[object Number]",_="[object Object]",y="[object Promise]",N="[object RegExp]",T="[object Set]",L="[object String]",R="[object Symbol]",F="[object WeakMap]",P="[object ArrayBuffer]",V="[object DataView]",U="[object Float32Array]",ee="[object Float64Array]",ce="[object Int8Array]",pe="[object Int16Array]",b="[object Int32Array]",x="[object Uint8Array]",v="[object Uint8ClampedArray]",C="[object Uint16Array]",k="[object Uint32Array]",O=/[\\^$.*+?()[\]{}|]/g,B=/\w*$/,M=/^\[object .+?Constructor\]$/,H=/^(?:0|[1-9]\d*)$/,q={};q[i]=q[a]=q[P]=q[V]=q[l]=q[c]=q[U]=q[ee]=q[ce]=q[pe]=q[b]=q[h]=q[g]=q[_]=q[N]=q[T]=q[L]=q[R]=q[x]=q[v]=q[C]=q[k]=!0,q[u]=q[f]=q[F]=!1;var te=typeof un=="object"&&un&&un.Object===Object&&un,J=typeof self=="object"&&self&&self.Object===Object&&self,ie=te||J||Function("return this")(),de=e&&!e.nodeType&&e,X=de&&!0&&n&&!n.nodeType&&n,Oe=X&&X.exports===de;function Le(o,d){return o.set(d[0],d[1]),o}function le(o,d){return o.add(d),o}function _e(o,d){for(var E=-1,w=o?o.length:0;++E<w&&d(o[E],E,o)!==!1;);return o}function fe(o,d){for(var E=-1,w=d.length,oe=o.length;++E<w;)o[oe+E]=d[E];return o}function Ee(o,d,E,w){for(var oe=-1,Q=o?o.length:0;++oe<Q;)E=d(E,o[oe],oe,o);return E}function ve(o,d){for(var E=-1,w=Array(o);++E<o;)w[E]=d(E);return w}function Ne(o,d){return o?.[d]}function De(o){var d=!1;if(o!=null&&typeof o.toString!="function")try{d=!!(o+"")}catch{}return d}function ze(o){var d=-1,E=Array(o.size);return o.forEach((function(w,oe){E[++d]=[oe,w]})),E}function yn(o,d){return function(E){return o(d(E))}}function Hn(o){var d=-1,E=Array(o.size);return o.forEach((function(w){E[++d]=w})),E}var fr=Array.prototype,gr=Function.prototype,Pt=Object.prototype,_n=ie["__core-js_shared__"],zn=function(){var o=/[^.]+$/.exec(_n&&_n.keys&&_n.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),vn=gr.toString,je=Pt.hasOwnProperty,Ut=Pt.toString,It=RegExp("^"+vn.call(je).replace(O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ut=Oe?ie.Buffer:void 0,Ft=ie.Symbol,Nn=ie.Uint8Array,rt=yn(Object.getPrototypeOf,Object),jn=Object.create,Kn=Pt.propertyIsEnumerable,pr=fr.splice,Qt=Object.getOwnPropertySymbols,Xt=ut?ut.isBuffer:void 0,Gn=yn(Object.keys,Object),Jt=at(ie,"DataView"),yt=at(ie,"Map"),st=at(ie,"Promise"),Ht=at(ie,"Set"),Tn=at(ie,"WeakMap"),Rt=at(Object,"create"),dt=D(Jt),m=D(yt),S=D(st),$=D(Ht),re=D(Tn),Te=Ft?Ft.prototype:void 0,Ce=Te?Te.valueOf:void 0;function z(o){var d=-1,E=o?o.length:0;for(this.clear();++d<E;){var w=o[d];this.set(w[0],w[1])}}function j(){this.__data__=Rt?Rt(null):{}}function se(o){return this.has(o)&&delete this.__data__[o]}function Be(o){var d=this.__data__;if(Rt){var E=d[o];return E===r?void 0:E}return je.call(d,o)?d[o]:void 0}function Re(o){var d=this.__data__;return Rt?d[o]!==void 0:je.call(d,o)}function _t(o,d){var E=this.__data__;return E[o]=Rt&&d===void 0?r:d,this}z.prototype.clear=j,z.prototype.delete=se,z.prototype.get=Be,z.prototype.has=Re,z.prototype.set=_t;function $e(o){var d=-1,E=o?o.length:0;for(this.clear();++d<E;){var w=o[d];this.set(w[0],w[1])}}function An(){this.__data__=[]}function mr(o){var d=this.__data__,E=nn(d,o);if(E<0)return!1;var w=d.length-1;return E==w?d.pop():pr.call(d,E,1),!0}function wn(o){var d=this.__data__,E=nn(d,o);return E<0?void 0:d[E][1]}function br(o){return nn(this.__data__,o)>-1}function Er(o,d){var E=this.__data__,w=nn(E,o);return w<0?E.push([o,d]):E[w][1]=d,this}$e.prototype.clear=An,$e.prototype.delete=mr,$e.prototype.get=wn,$e.prototype.has=br,$e.prototype.set=Er;function Ke(o){var d=-1,E=o?o.length:0;for(this.clear();++d<E;){var w=o[d];this.set(w[0],w[1])}}function Vn(){this.__data__={hash:new z,map:new(yt||$e),string:new z}}function en(o){return Ve(this,o).delete(o)}function yr(o){return Ve(this,o).get(o)}function _r(o){return Ve(this,o).has(o)}function vr(o,d){return Ve(this,o).set(o,d),this}Ke.prototype.clear=Vn,Ke.prototype.delete=en,Ke.prototype.get=yr,Ke.prototype.has=_r,Ke.prototype.set=vr;function Ye(o){this.__data__=new $e(o)}function ht(){this.__data__=new $e}function Wn(o){return this.__data__.delete(o)}function Zn(o){return this.__data__.get(o)}function Nr(o){return this.__data__.has(o)}function Tr(o,d){var E=this.__data__;if(E instanceof $e){var w=E.__data__;if(!yt||w.length<t-1)return w.push([o,d]),this;E=this.__data__=new Ke(w)}return E.set(o,d),this}Ye.prototype.clear=ht,Ye.prototype.delete=Wn,Ye.prototype.get=Zn,Ye.prototype.has=Nr,Ye.prototype.set=Tr;function tn(o,d){var E=qe(o)||ge(o)?ve(o.length,String):[],w=E.length,oe=!!w;for(var Q in o)je.call(o,Q)&&!(oe&&(Q=="length"||sn(Q,w)))&&E.push(Q);return E}function zt(o,d,E){var w=o[d];(!(je.call(o,d)&&ae(w,E))||E===void 0&&!(d in o))&&(o[d]=E)}function nn(o,d){for(var E=o.length;E--;)if(ae(o[E][0],d))return E;return-1}function I(o,d){return o&&On(d,Lr(d),o)}function Y(o,d,E,w,oe,Q,ye){var me;if(w&&(me=Q?w(o,oe,Q,ye):w(o)),me!==void 0)return me;if(!kt(o))return o;var Pe=qe(o);if(Pe){if(me=Xn(o),!d)return Sr(o,me)}else{var we=ne(o),Xe=we==f||we==p;if(Jn(o))return vt(o,d);if(we==_||we==i||Xe&&!Q){if(De(o))return Q?o:{};if(me=xe(Xe?{}:o),!d)return rn(o,I(me,o))}else{if(!q[we])return Q?o:{};me=Se(o,we,Y,d)}}ye||(ye=new Ye);var it=ye.get(o);if(it)return it;if(ye.set(o,me),!Pe)var Fe=E?Qn(o):Lr(o);return _e(Fe||o,(function(Je,We){Fe&&(We=Je,Je=o[We]),zt(me,We,Y(Je,d,E,w,We,o,ye))})),me}function ue(o){return kt(o)?jn(o):{}}function Ae(o,d,E){var w=d(o);return qe(o)?w:fe(w,E(o))}function Me(o){return Ut.call(o)}function tt(o){if(!kt(o)||Ln(o))return!1;var d=Or(o)||De(o)?It:M;return d.test(D(o))}function ft(o){if(!an(o))return Gn(o);var d=[];for(var E in Object(o))je.call(o,E)&&E!="constructor"&&d.push(E);return d}function vt(o,d){if(d)return o.slice();var E=new o.constructor(o.length);return o.copy(E),E}function Ue(o){var d=new o.constructor(o.byteLength);return new Nn(d).set(new Nn(o)),d}function Ge(o,d){var E=d?Ue(o.buffer):o.buffer;return new o.constructor(E,o.byteOffset,o.byteLength)}function Sn(o,d,E){var w=d?E(ze(o),!0):ze(o);return Ee(w,Le,new o.constructor)}function xn(o){var d=new o.constructor(o.source,B.exec(o));return d.lastIndex=o.lastIndex,d}function Yn(o,d,E){var w=d?E(Hn(o),!0):Hn(o);return Ee(w,le,new o.constructor)}function Ar(o){return Ce?Object(Ce.call(o)):{}}function wr(o,d){var E=d?Ue(o.buffer):o.buffer;return new o.constructor(E,o.byteOffset,o.length)}function Sr(o,d){var E=-1,w=o.length;for(d||(d=Array(w));++E<w;)d[E]=o[E];return d}function On(o,d,E,w){E||(E={});for(var oe=-1,Q=d.length;++oe<Q;){var ye=d[oe],me=void 0;zt(E,ye,me===void 0?o[ye]:me)}return E}function rn(o,d){return On(o,ot(o),d)}function Qn(o){return Ae(o,Lr,ot)}function Ve(o,d){var E=o.__data__;return Nt(d)?E[typeof d=="string"?"string":"hash"]:E.map}function at(o,d){var E=Ne(o,d);return tt(E)?E:void 0}var ot=Qt?yn(Qt,Object):ks,ne=Me;(Jt&&ne(new Jt(new ArrayBuffer(1)))!=V||yt&&ne(new yt)!=h||st&&ne(st.resolve())!=y||Ht&&ne(new Ht)!=T||Tn&&ne(new Tn)!=F)&&(ne=function(o){var d=Ut.call(o),E=d==_?o.constructor:void 0,w=E?D(E):void 0;if(w)switch(w){case dt:return V;case m:return h;case S:return y;case $:return T;case re:return F}return d});function Xn(o){var d=o.length,E=o.constructor(d);return d&&typeof o[0]=="string"&&je.call(o,"index")&&(E.index=o.index,E.input=o.input),E}function xe(o){return typeof o.constructor=="function"&&!an(o)?ue(rt(o)):{}}function Se(o,d,E,w){var oe=o.constructor;switch(d){case P:return Ue(o);case l:case c:return new oe(+o);case V:return Ge(o,w);case U:case ee:case ce:case pe:case b:case x:case v:case C:case k:return wr(o,w);case h:return Sn(o,w,E);case g:case L:return new oe(o);case N:return xn(o);case T:return Yn(o,w,E);case R:return Ar(o)}}function sn(o,d){return d=d??s,!!d&&(typeof o=="number"||H.test(o))&&o>-1&&o%1==0&&o<d}function Nt(o){var d=typeof o;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?o!=="__proto__":o===null}function Ln(o){return!!zn&&zn in o}function an(o){var d=o&&o.constructor,E=typeof d=="function"&&d.prototype||Pt;return o===E}function D(o){if(o!=null){try{return vn.call(o)}catch{}try{return o+""}catch{}}return""}function W(o){return Y(o,!0,!0)}function ae(o,d){return o===d||o!==o&&d!==d}function ge(o){return xr(o)&&je.call(o,"callee")&&(!Kn.call(o,"callee")||Ut.call(o)==i)}var qe=Array.isArray;function Qe(o){return o!=null&&Yr(o.length)&&!Or(o)}function xr(o){return Qr(o)&&Qe(o)}var Jn=Xt||Ms;function Or(o){var d=kt(o)?Ut.call(o):"";return d==f||d==p}function Yr(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=s}function kt(o){var d=typeof o;return!!o&&(d=="object"||d=="function")}function Qr(o){return!!o&&typeof o=="object"}function Lr(o){return Qe(o)?tn(o):ft(o)}function ks(){return[]}function Ms(){return!1}n.exports=W}(Rr,Rr.exports)),Rr.exports}var kr={exports:{}};kr.exports;var Ea;function Ro(){return Ea||(Ea=1,function(n,e){var t=200,r="__lodash_hash_undefined__",s=1,i=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object AsyncFunction]",f="[object Boolean]",p="[object Date]",h="[object Error]",g="[object Function]",_="[object GeneratorFunction]",y="[object Map]",N="[object Number]",T="[object Null]",L="[object Object]",R="[object Promise]",F="[object Proxy]",P="[object RegExp]",V="[object Set]",U="[object String]",ee="[object Symbol]",ce="[object Undefined]",pe="[object WeakMap]",b="[object ArrayBuffer]",x="[object DataView]",v="[object Float32Array]",C="[object Float64Array]",k="[object Int8Array]",O="[object Int16Array]",B="[object Int32Array]",M="[object Uint8Array]",H="[object Uint8ClampedArray]",q="[object Uint16Array]",te="[object Uint32Array]",J=/[\\^$.*+?()[\]{}|]/g,ie=/^\[object .+?Constructor\]$/,de=/^(?:0|[1-9]\d*)$/,X={};X[v]=X[C]=X[k]=X[O]=X[B]=X[M]=X[H]=X[q]=X[te]=!0,X[l]=X[c]=X[b]=X[f]=X[x]=X[p]=X[h]=X[g]=X[y]=X[N]=X[L]=X[P]=X[V]=X[U]=X[pe]=!1;var Oe=typeof un=="object"&&un&&un.Object===Object&&un,Le=typeof self=="object"&&self&&self.Object===Object&&self,le=Oe||Le||Function("return this")(),_e=e&&!e.nodeType&&e,fe=_e&&!0&&n&&!n.nodeType&&n,Ee=fe&&fe.exports===_e,ve=Ee&&Oe.process,Ne=function(){try{return ve&&ve.binding&&ve.binding("util")}catch{}}(),De=Ne&&Ne.isTypedArray;function ze(o,d){for(var E=-1,w=o==null?0:o.length,oe=0,Q=[];++E<w;){var ye=o[E];d(ye,E,o)&&(Q[oe++]=ye)}return Q}function yn(o,d){for(var E=-1,w=d.length,oe=o.length;++E<w;)o[oe+E]=d[E];return o}function Hn(o,d){for(var E=-1,w=o==null?0:o.length;++E<w;)if(d(o[E],E,o))return!0;return!1}function fr(o,d){for(var E=-1,w=Array(o);++E<o;)w[E]=d(E);return w}function gr(o){return function(d){return o(d)}}function Pt(o,d){return o.has(d)}function _n(o,d){return o?.[d]}function zn(o){var d=-1,E=Array(o.size);return o.forEach((function(w,oe){E[++d]=[oe,w]})),E}function vn(o,d){return function(E){return o(d(E))}}function je(o){var d=-1,E=Array(o.size);return o.forEach((function(w){E[++d]=w})),E}var Ut=Array.prototype,It=Function.prototype,ut=Object.prototype,Ft=le["__core-js_shared__"],Nn=It.toString,rt=ut.hasOwnProperty,jn=function(){var o=/[^.]+$/.exec(Ft&&Ft.keys&&Ft.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Kn=ut.toString,pr=RegExp("^"+Nn.call(rt).replace(J,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qt=Ee?le.Buffer:void 0,Xt=le.Symbol,Gn=le.Uint8Array,Jt=ut.propertyIsEnumerable,yt=Ut.splice,st=Xt?Xt.toStringTag:void 0,Ht=Object.getOwnPropertySymbols,Tn=Qt?Qt.isBuffer:void 0,Rt=vn(Object.keys,Object),dt=ot(le,"DataView"),m=ot(le,"Map"),S=ot(le,"Promise"),$=ot(le,"Set"),re=ot(le,"WeakMap"),Te=ot(Object,"create"),Ce=D(dt),z=D(m),j=D(S),se=D($),Be=D(re),Re=Xt?Xt.prototype:void 0,_t=Re?Re.valueOf:void 0;function $e(o){var d=-1,E=o==null?0:o.length;for(this.clear();++d<E;){var w=o[d];this.set(w[0],w[1])}}function An(){this.__data__=Te?Te(null):{},this.size=0}function mr(o){var d=this.has(o)&&delete this.__data__[o];return this.size-=d?1:0,d}function wn(o){var d=this.__data__;if(Te){var E=d[o];return E===r?void 0:E}return rt.call(d,o)?d[o]:void 0}function br(o){var d=this.__data__;return Te?d[o]!==void 0:rt.call(d,o)}function Er(o,d){var E=this.__data__;return this.size+=this.has(o)?0:1,E[o]=Te&&d===void 0?r:d,this}$e.prototype.clear=An,$e.prototype.delete=mr,$e.prototype.get=wn,$e.prototype.has=br,$e.prototype.set=Er;function Ke(o){var d=-1,E=o==null?0:o.length;for(this.clear();++d<E;){var w=o[d];this.set(w[0],w[1])}}function Vn(){this.__data__=[],this.size=0}function en(o){var d=this.__data__,E=vt(d,o);if(E<0)return!1;var w=d.length-1;return E==w?d.pop():yt.call(d,E,1),--this.size,!0}function yr(o){var d=this.__data__,E=vt(d,o);return E<0?void 0:d[E][1]}function _r(o){return vt(this.__data__,o)>-1}function vr(o,d){var E=this.__data__,w=vt(E,o);return w<0?(++this.size,E.push([o,d])):E[w][1]=d,this}Ke.prototype.clear=Vn,Ke.prototype.delete=en,Ke.prototype.get=yr,Ke.prototype.has=_r,Ke.prototype.set=vr;function Ye(o){var d=-1,E=o==null?0:o.length;for(this.clear();++d<E;){var w=o[d];this.set(w[0],w[1])}}function ht(){this.size=0,this.__data__={hash:new $e,map:new(m||Ke),string:new $e}}function Wn(o){var d=at(this,o).delete(o);return this.size-=d?1:0,d}function Zn(o){return at(this,o).get(o)}function Nr(o){return at(this,o).has(o)}function Tr(o,d){var E=at(this,o),w=E.size;return E.set(o,d),this.size+=E.size==w?0:1,this}Ye.prototype.clear=ht,Ye.prototype.delete=Wn,Ye.prototype.get=Zn,Ye.prototype.has=Nr,Ye.prototype.set=Tr;function tn(o){var d=-1,E=o==null?0:o.length;for(this.__data__=new Ye;++d<E;)this.add(o[d])}function zt(o){return this.__data__.set(o,r),this}function nn(o){return this.__data__.has(o)}tn.prototype.add=tn.prototype.push=zt,tn.prototype.has=nn;function I(o){var d=this.__data__=new Ke(o);this.size=d.size}function Y(){this.__data__=new Ke,this.size=0}function ue(o){var d=this.__data__,E=d.delete(o);return this.size=d.size,E}function Ae(o){return this.__data__.get(o)}function Me(o){return this.__data__.has(o)}function tt(o,d){var E=this.__data__;if(E instanceof Ke){var w=E.__data__;if(!m||w.length<t-1)return w.push([o,d]),this.size=++E.size,this;E=this.__data__=new Ye(w)}return E.set(o,d),this.size=E.size,this}I.prototype.clear=Y,I.prototype.delete=ue,I.prototype.get=Ae,I.prototype.has=Me,I.prototype.set=tt;function ft(o,d){var E=ge(o),w=!E&&ae(o),oe=!E&&!w&&Qe(o),Q=!E&&!w&&!oe&&Qr(o),ye=E||w||oe||Q,me=ye?fr(o.length,String):[],Pe=me.length;for(var we in o)rt.call(o,we)&&!(ye&&(we=="length"||oe&&(we=="offset"||we=="parent")||Q&&(we=="buffer"||we=="byteLength"||we=="byteOffset")||Se(we,Pe)))&&me.push(we);return me}function vt(o,d){for(var E=o.length;E--;)if(W(o[E][0],d))return E;return-1}function Ue(o,d,E){var w=d(o);return ge(o)?w:yn(w,E(o))}function Ge(o){return o==null?o===void 0?ce:T:st&&st in Object(o)?ne(o):an(o)}function Sn(o){return kt(o)&&Ge(o)==l}function xn(o,d,E,w,oe){return o===d?!0:o==null||d==null||!kt(o)&&!kt(d)?o!==o&&d!==d:Yn(o,d,E,w,xn,oe)}function Yn(o,d,E,w,oe,Q){var ye=ge(o),me=ge(d),Pe=ye?c:xe(o),we=me?c:xe(d);Pe=Pe==l?L:Pe,we=we==l?L:we;var Xe=Pe==L,it=we==L,Fe=Pe==we;if(Fe&&Qe(o)){if(!Qe(d))return!1;ye=!0,Xe=!1}if(Fe&&!Xe)return Q||(Q=new I),ye||Qr(o)?On(o,d,E,w,oe,Q):rn(o,d,Pe,E,w,oe,Q);if(!(E&s)){var Je=Xe&&rt.call(o,"__wrapped__"),We=it&&rt.call(d,"__wrapped__");if(Je||We){var on=Je?o.value():o,jt=We?d.value():d;return Q||(Q=new I),oe(on,jt,E,w,Q)}}return Fe?(Q||(Q=new I),Qn(o,d,E,w,oe,Q)):!1}function Ar(o){if(!Yr(o)||Nt(o))return!1;var d=Jn(o)?pr:ie;return d.test(D(o))}function wr(o){return kt(o)&&Or(o.length)&&!!X[Ge(o)]}function Sr(o){if(!Ln(o))return Rt(o);var d=[];for(var E in Object(o))rt.call(o,E)&&E!="constructor"&&d.push(E);return d}function On(o,d,E,w,oe,Q){var ye=E&s,me=o.length,Pe=d.length;if(me!=Pe&&!(ye&&Pe>me))return!1;var we=Q.get(o);if(we&&Q.get(d))return we==d;var Xe=-1,it=!0,Fe=E&i?new tn:void 0;for(Q.set(o,d),Q.set(d,o);++Xe<me;){var Je=o[Xe],We=d[Xe];if(w)var on=ye?w(We,Je,Xe,d,o,Q):w(Je,We,Xe,o,d,Q);if(on!==void 0){if(on)continue;it=!1;break}if(Fe){if(!Hn(d,(function(jt,Cn){if(!Pt(Fe,Cn)&&(Je===jt||oe(Je,jt,E,w,Q)))return Fe.push(Cn)}))){it=!1;break}}else if(!(Je===We||oe(Je,We,E,w,Q))){it=!1;break}}return Q.delete(o),Q.delete(d),it}function rn(o,d,E,w,oe,Q,ye){switch(E){case x:if(o.byteLength!=d.byteLength||o.byteOffset!=d.byteOffset)return!1;o=o.buffer,d=d.buffer;case b:return!(o.byteLength!=d.byteLength||!Q(new Gn(o),new Gn(d)));case f:case p:case N:return W(+o,+d);case h:return o.name==d.name&&o.message==d.message;case P:case U:return o==d+"";case y:var me=zn;case V:var Pe=w&s;if(me||(me=je),o.size!=d.size&&!Pe)return!1;var we=ye.get(o);if(we)return we==d;w|=i,ye.set(o,d);var Xe=On(me(o),me(d),w,oe,Q,ye);return ye.delete(o),Xe;case ee:if(_t)return _t.call(o)==_t.call(d)}return!1}function Qn(o,d,E,w,oe,Q){var ye=E&s,me=Ve(o),Pe=me.length,we=Ve(d),Xe=we.length;if(Pe!=Xe&&!ye)return!1;for(var it=Pe;it--;){var Fe=me[it];if(!(ye?Fe in d:rt.call(d,Fe)))return!1}var Je=Q.get(o);if(Je&&Q.get(d))return Je==d;var We=!0;Q.set(o,d),Q.set(d,o);for(var on=ye;++it<Pe;){Fe=me[it];var jt=o[Fe],Cn=d[Fe];if(w)var $i=ye?w(Cn,jt,Fe,d,o,Q):w(jt,Cn,Fe,o,d,Q);if(!($i===void 0?jt===Cn||oe(jt,Cn,E,w,Q):$i)){We=!1;break}on||(on=Fe=="constructor")}if(We&&!on){var Xr=o.constructor,Jr=d.constructor;Xr!=Jr&&"constructor"in o&&"constructor"in d&&!(typeof Xr=="function"&&Xr instanceof Xr&&typeof Jr=="function"&&Jr instanceof Jr)&&(We=!1)}return Q.delete(o),Q.delete(d),We}function Ve(o){return Ue(o,Lr,Xn)}function at(o,d){var E=o.__data__;return sn(d)?E[typeof d=="string"?"string":"hash"]:E.map}function ot(o,d){var E=_n(o,d);return Ar(E)?E:void 0}function ne(o){var d=rt.call(o,st),E=o[st];try{o[st]=void 0;var w=!0}catch{}var oe=Kn.call(o);return w&&(d?o[st]=E:delete o[st]),oe}var Xn=Ht?function(o){return o==null?[]:(o=Object(o),ze(Ht(o),(function(d){return Jt.call(o,d)})))}:ks,xe=Ge;(dt&&xe(new dt(new ArrayBuffer(1)))!=x||m&&xe(new m)!=y||S&&xe(S.resolve())!=R||$&&xe(new $)!=V||re&&xe(new re)!=pe)&&(xe=function(o){var d=Ge(o),E=d==L?o.constructor:void 0,w=E?D(E):"";if(w)switch(w){case Ce:return x;case z:return y;case j:return R;case se:return V;case Be:return pe}return d});function Se(o,d){return d=d??a,!!d&&(typeof o=="number"||de.test(o))&&o>-1&&o%1==0&&o<d}function sn(o){var d=typeof o;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?o!=="__proto__":o===null}function Nt(o){return!!jn&&jn in o}function Ln(o){var d=o&&o.constructor,E=typeof d=="function"&&d.prototype||ut;return o===E}function an(o){return Kn.call(o)}function D(o){if(o!=null){try{return Nn.call(o)}catch{}try{return o+""}catch{}}return""}function W(o,d){return o===d||o!==o&&d!==d}var ae=Sn(function(){return arguments}())?Sn:function(o){return kt(o)&&rt.call(o,"callee")&&!Jt.call(o,"callee")},ge=Array.isArray;function qe(o){return o!=null&&Or(o.length)&&!Jn(o)}var Qe=Tn||Ms;function xr(o,d){return xn(o,d)}function Jn(o){if(!Yr(o))return!1;var d=Ge(o);return d==g||d==_||d==u||d==F}function Or(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=a}function Yr(o){var d=typeof o;return o!=null&&(d=="object"||d=="function")}function kt(o){return o!=null&&typeof o=="object"}var Qr=De?gr(De):wr;function Lr(o){return qe(o)?ft(o):Sr(o)}function ks(){return[]}function Ms(){return!1}n.exports=xr}(kr,kr.exports)),kr.exports}var ns={},ya;function bf(){if(ya)return ns;ya=1,Object.defineProperty(ns,"__esModule",{value:!0});const n=Io(),e=Ro();var t;return function(r){function s(c={},u={},f=!1){typeof c!="object"&&(c={}),typeof u!="object"&&(u={});let p=n(u);f||(p=Object.keys(p).reduce(((h,g)=>(p[g]!=null&&(h[g]=p[g]),h)),{}));for(const h in c)c[h]!==void 0&&u[h]===void 0&&(p[h]=c[h]);return Object.keys(p).length>0?p:void 0}r.compose=s;function i(c={},u={}){typeof c!="object"&&(c={}),typeof u!="object"&&(u={});const f=Object.keys(c).concat(Object.keys(u)).reduce(((p,h)=>(e(c[h],u[h])||(p[h]=u[h]===void 0?null:u[h]),p)),{});return Object.keys(f).length>0?f:void 0}r.diff=i;function a(c={},u={}){c=c||{};const f=Object.keys(u).reduce(((p,h)=>(u[h]!==c[h]&&c[h]!==void 0&&(p[h]=u[h]),p)),{});return Object.keys(c).reduce(((p,h)=>(c[h]!==u[h]&&u[h]===void 0&&(p[h]=null),p)),f)}r.invert=a;function l(c,u,f=!1){if(typeof c!="object")return u;if(typeof u!="object")return;if(!f)return u;const p=Object.keys(u).reduce(((h,g)=>(c[g]===void 0&&(h[g]=u[g]),h)),{});return Object.keys(p).length>0?p:void 0}r.transform=l}(t||(t={})),ns.default=t,ns}var rs={},_a;function ko(){if(_a)return rs;_a=1,Object.defineProperty(rs,"__esModule",{value:!0});var n;return function(e){function t(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}e.length=t}(n||(n={})),rs.default=n,rs}var ss={},va;function Ef(){if(va)return ss;va=1,Object.defineProperty(ss,"__esModule",{value:!0});const n=ko();class e{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const s=this.ops[this.index];if(s){const i=this.offset,a=n.default.length(s);if(r>=a-i?(r=a-i,this.index+=1,this.offset=0):this.offset+=r,typeof s.delete=="number")return{delete:r};{const l={};return s.attributes&&(l.attributes=s.attributes),typeof s.retain=="number"?l.retain=r:typeof s.retain=="object"&&s.retain!==null?l.retain=s.retain:typeof s.insert=="string"?l.insert=s.insert.substr(i,r):l.insert=s.insert,l}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?n.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,s=this.index,i=this.next(),a=this.ops.slice(this.index);return this.offset=r,this.index=s,[i].concat(a)}}else return[]}}return ss.default=e,ss}var Na;function yf(){return Na||(Na=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=mf(),r=Io(),s=Ro(),i=bf();e.AttributeMap=i.default;const a=ko();e.Op=a.default;const l=Ef();e.OpIterator=l.default;const c="\0",u=(p,h)=>{if(typeof p!="object"||p===null)throw new Error(`cannot retain a ${typeof p}`);if(typeof h!="object"||h===null)throw new Error(`cannot retain a ${typeof h}`);const g=Object.keys(p)[0];if(!g||g!==Object.keys(h)[0])throw new Error(`embed types not matched: ${g} != ${Object.keys(h)[0]}`);return[g,p[g],h[g]]};class f{constructor(h){Array.isArray(h)?this.ops=h:h!=null&&Array.isArray(h.ops)?this.ops=h.ops:this.ops=[]}static registerEmbed(h,g){this.handlers[h]=g}static unregisterEmbed(h){delete this.handlers[h]}static getHandler(h){const g=this.handlers[h];if(!g)throw new Error(`no handlers for embed type "${h}"`);return g}insert(h,g){const _={};return typeof h=="string"&&h.length===0?this:(_.insert=h,g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(_.attributes=g),this.push(_))}delete(h){return h<=0?this:this.push({delete:h})}retain(h,g){if(typeof h=="number"&&h<=0)return this;const _={retain:h};return g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(_.attributes=g),this.push(_)}push(h){let g=this.ops.length,_=this.ops[g-1];if(h=r(h),typeof _=="object"){if(typeof h.delete=="number"&&typeof _.delete=="number")return this.ops[g-1]={delete:_.delete+h.delete},this;if(typeof _.delete=="number"&&h.insert!=null&&(g-=1,_=this.ops[g-1],typeof _!="object"))return this.ops.unshift(h),this;if(s(h.attributes,_.attributes)){if(typeof h.insert=="string"&&typeof _.insert=="string")return this.ops[g-1]={insert:_.insert+h.insert},typeof h.attributes=="object"&&(this.ops[g-1].attributes=h.attributes),this;if(typeof h.retain=="number"&&typeof _.retain=="number")return this.ops[g-1]={retain:_.retain+h.retain},typeof h.attributes=="object"&&(this.ops[g-1].attributes=h.attributes),this}}return g===this.ops.length?this.ops.push(h):this.ops.splice(g,0,h),this}chop(){const h=this.ops[this.ops.length-1];return h&&typeof h.retain=="number"&&!h.attributes&&this.ops.pop(),this}filter(h){return this.ops.filter(h)}forEach(h){this.ops.forEach(h)}map(h){return this.ops.map(h)}partition(h){const g=[],_=[];return this.forEach((y=>{(h(y)?g:_).push(y)})),[g,_]}reduce(h,g){return this.ops.reduce(h,g)}changeLength(){return this.reduce(((h,g)=>g.insert?h+a.default.length(g):g.delete?h-g.delete:h),0)}length(){return this.reduce(((h,g)=>h+a.default.length(g)),0)}slice(h=0,g=1/0){const _=[],y=new l.default(this.ops);let N=0;for(;N<g&&y.hasNext();){let T;N<h?T=y.next(h-N):(T=y.next(g-N),_.push(T)),N+=a.default.length(T)}return new f(_)}compose(h){const g=new l.default(this.ops),_=new l.default(h.ops),y=[],N=_.peek();if(N!=null&&typeof N.retain=="number"&&N.attributes==null){let L=N.retain;for(;g.peekType()==="insert"&&g.peekLength()<=L;)L-=g.peekLength(),y.push(g.next());N.retain-L>0&&_.next(N.retain-L)}const T=new f(y);for(;g.hasNext()||_.hasNext();)if(_.peekType()==="insert")T.push(_.next());else if(g.peekType()==="delete")T.push(g.next());else{const L=Math.min(g.peekLength(),_.peekLength()),R=g.next(L),F=_.next(L);if(F.retain){const P={};if(typeof R.retain=="number")P.retain=typeof F.retain=="number"?L:F.retain;else if(typeof F.retain=="number")R.retain==null?P.insert=R.insert:P.retain=R.retain;else{const U=R.retain==null?"insert":"retain",[ee,ce,pe]=u(R[U],F.retain),b=f.getHandler(ee);P[U]={[ee]:b.compose(ce,pe,U==="retain")}}const V=i.default.compose(R.attributes,F.attributes,typeof R.retain=="number");if(V&&(P.attributes=V),T.push(P),!_.hasNext()&&s(T.ops[T.ops.length-1],P)){const U=new f(g.rest());return T.concat(U).chop()}}else typeof F.delete=="number"&&(typeof R.retain=="number"||typeof R.retain=="object"&&R.retain!==null)&&T.push(F)}return T.chop()}concat(h){const g=new f(this.ops.slice());return h.ops.length>0&&(g.push(h.ops[0]),g.ops=g.ops.concat(h.ops.slice(1))),g}diff(h,g){if(this.ops===h.ops)return new f;const _=[this,h].map((R=>R.map((F=>{if(F.insert!=null)return typeof F.insert=="string"?F.insert:c;const P=R===h?"on":"with";throw new Error("diff() called "+P+" non-document")})).join(""))),y=new f,N=t(_[0],_[1],g,!0),T=new l.default(this.ops),L=new l.default(h.ops);return N.forEach((R=>{let F=R[1].length;for(;F>0;){let P=0;switch(R[0]){case t.INSERT:P=Math.min(L.peekLength(),F),y.push(L.next(P));break;case t.DELETE:P=Math.min(F,T.peekLength()),T.next(P),y.delete(P);break;case t.EQUAL:P=Math.min(T.peekLength(),L.peekLength(),F);const V=T.next(P),U=L.next(P);s(V.insert,U.insert)?y.retain(P,i.default.diff(V.attributes,U.attributes)):y.push(U).delete(P);break}F-=P}})),y.chop()}eachLine(h,g=`\n`){const _=new l.default(this.ops);let y=new f,N=0;for(;_.hasNext();){if(_.peekType()!=="insert")return;const T=_.peek(),L=a.default.length(T)-_.peekLength(),R=typeof T.insert=="string"?T.insert.indexOf(g,L)-L:-1;if(R<0)y.push(_.next());else if(R>0)y.push(_.next(R));else{if(h(y,_.next(1).attributes||{},N)===!1)return;N+=1,y=new f}}y.length()>0&&h(y,{},N)}invert(h){const g=new f;return this.reduce(((_,y)=>{if(y.insert)g.delete(a.default.length(y));else{if(typeof y.retain=="number"&&y.attributes==null)return g.retain(y.retain),_+y.retain;if(y.delete||typeof y.retain=="number"){const N=y.delete||y.retain;return h.slice(_,_+N).forEach((L=>{y.delete?g.push(L):y.retain&&y.attributes&&g.retain(a.default.length(L),i.default.invert(y.attributes,L.attributes))})),_+N}else if(typeof y.retain=="object"&&y.retain!==null){const N=h.slice(_,_+1),T=new l.default(N.ops).next(),[L,R,F]=u(y.retain,T.insert),P=f.getHandler(L);return g.retain({[L]:P.invert(R,F)},i.default.invert(y.attributes,T.attributes)),_+1}}return _}),0),g.chop()}transform(h,g=!1){if(g=!!g,typeof h=="number")return this.transformPosition(h,g);const _=h,y=new l.default(this.ops),N=new l.default(_.ops),T=new f;for(;y.hasNext()||N.hasNext();)if(y.peekType()==="insert"&&(g||N.peekType()!=="insert"))T.retain(a.default.length(y.next()));else if(N.peekType()==="insert")T.push(N.next());else{const L=Math.min(y.peekLength(),N.peekLength()),R=y.next(L),F=N.next(L);if(R.delete)continue;if(F.delete)T.push(F);else{const P=R.retain,V=F.retain;let U=typeof V=="object"&&V!==null?V:L;if(typeof P=="object"&&P!==null&&typeof V=="object"&&V!==null){const ee=Object.keys(P)[0];if(ee===Object.keys(V)[0]){const ce=f.getHandler(ee);ce&&(U={[ee]:ce.transform(P[ee],V[ee],g)})}}T.retain(U,i.default.transform(R.attributes,F.attributes,g))}}return T.chop()}transformPosition(h,g=!1){g=!!g;const _=new l.default(this.ops);let y=0;for(;_.hasNext()&&y<=h;){const N=_.peekLength(),T=_.peekType();if(_.next(),T==="delete"){h-=Math.min(N,h-y);continue}else T==="insert"&&(y<h||!g)&&(h+=N);y+=N}return h}}f.Op=a.default,f.OpIterator=l.default,f.AttributeMap=i.default,f.handlers={},e.default=f,n.exports=f,n.exports.default=f}(ts,ts.exports)),ts.exports}var Et=yf();const K=wi(Et);class Ct extends ct{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Ct.blotName="break";Ct.tagName="BR";let Ot=class extends Es{};const _f={"&":"&","<":"<",">":">",'"':""","'":"'"};function Os(n){return n.replace(/[&<>"']/g,(e=>_f[e]))}let bn=class In extends Ti{static allowedChildren=[In,Ct,ct,Ot];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(e,t){const r=In.order.indexOf(e),s=In.order.indexOf(t);return r>=0||s>=0?r-s:e===t?0:e<t?-1:1}formatAt(e,t,r,s){if(In.compare(this.statics.blotName,r)<0&&this.scroll.query(r,Z.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 In&&In.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 Ta=1;class Ze extends Ur{cache={};delta(){return this.cache.delta==null&&(this.cache.delta=Mo(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,r,s){t<=0||(this.scroll.query(r,Z.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(((l,c)=>(a=a.split(l,!0),a.insertAt(0,c),c.length)),e+i.length)}insertBefore(e,t){const{head:r}=this.children;super.insertBefore(e,t),r instanceof Ct&&r.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+Ta),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()-Ta)){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}}Ze.blotName="block";Ze.tagName="P";Ze.defaultChild=Ct;Ze.allowedChildren=[Ct,bn,ct,Ot];let bt=class extends ct{attach(){super.attach(),this.attributes=new Ss(this.domNode)}delta(){return(new K).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const r=this.scroll.query(e,Z.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(Ze.blotName);return u.insertAt(0,c),u})),l=this.split(e);a.forEach((c=>{this.parent.insertBefore(c,l)})),i&&this.parent.insertBefore(this.scroll.create("text",i),l)}};bt.scope=Z.BLOCK_BLOT;function Mo(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.descendants(et).reduce(((t,r)=>r.length()===0?t:t.insert(r.value(),pt(r,{},e))),new K).insert(`\n`,pt(n))}function pt(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:pt(n.parent,e,t)}class wt extends ct{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(wt.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!==Z.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=wt.CONTENTS.length,r.optimize(),r.formatAt(s,wt.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 Ot?this.prev:null,r=t?t.length():0,s=this.next instanceof Ot?this.next:null,i=s?s.text:"",{textNode:a}=this,l=a.data.split(wt.CONTENTS).join("");a.data=wt.CONTENTS;let c;if(t)c=t,(l||s)&&(t.insertAt(t.length(),l+i),s&&s.remove());else if(s)c=s,s.insertAt(0,l);else{const u=document.createTextNode(l);c=this.scroll.create(u),this.parent.insertBefore(c,this)}if(this.remove(),e){const u=(h,g)=>t&&h===t.domNode?g:h===a?r+g-1:s&&h===s.domNode?r+l.length+g:null,f=u(e.start.node,e.start.offset),p=u(e.end.node,e.end.offset);if(f!==null&&p!==null)return{startNode:c.domNode,startOffset:f,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=wt.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}}var Us={exports:{}},Aa;function vf(){return Aa||(Aa=1,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,f){this.fn=c,this.context=u,this.once=f||!1}function i(c,u,f,p,h){if(typeof f!="function")throw new TypeError("The listener must be a function");var g=new s(f,p||c,h),_=t?t+u:u;return c._events[_]?c._events[_].fn?c._events[_]=[c._events[_],g]:c._events[_].push(g):(c._events[_]=g,c._eventsCount++),c}function a(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],f,p;if(this._eventsCount===0)return u;for(p in f=this._events)e.call(f,p)&&u.push(t?p.slice(1):p);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=t?t+u:u,p=this._events[f];if(!p)return[];if(p.fn)return[p.fn];for(var h=0,g=p.length,_=new Array(g);h<g;h++)_[h]=p[h].fn;return _},l.prototype.listenerCount=function(u){var f=t?t+u:u,p=this._events[f];return p?p.fn?1:p.length:0},l.prototype.emit=function(u,f,p,h,g,_){var y=t?t+u:u;if(!this._events[y])return!1;var N=this._events[y],T=arguments.length,L,R;if(N.fn){switch(N.once&&this.removeListener(u,N.fn,void 0,!0),T){case 1:return N.fn.call(N.context),!0;case 2:return N.fn.call(N.context,f),!0;case 3:return N.fn.call(N.context,f,p),!0;case 4:return N.fn.call(N.context,f,p,h),!0;case 5:return N.fn.call(N.context,f,p,h,g),!0;case 6:return N.fn.call(N.context,f,p,h,g,_),!0}for(R=1,L=new Array(T-1);R<T;R++)L[R-1]=arguments[R];N.fn.apply(N.context,L)}else{var F=N.length,P;for(R=0;R<F;R++)switch(N[R].once&&this.removeListener(u,N[R].fn,void 0,!0),T){case 1:N[R].fn.call(N[R].context);break;case 2:N[R].fn.call(N[R].context,f);break;case 3:N[R].fn.call(N[R].context,f,p);break;case 4:N[R].fn.call(N[R].context,f,p,h);break;default:if(!L)for(P=1,L=new Array(T-1);P<T;P++)L[P-1]=arguments[P];N[R].fn.apply(N[R].context,L)}}return!0},l.prototype.on=function(u,f,p){return i(this,u,f,p,!1)},l.prototype.once=function(u,f,p){return i(this,u,f,p,!0)},l.prototype.removeListener=function(u,f,p,h){var g=t?t+u:u;if(!this._events[g])return this;if(!f)return a(this,g),this;var _=this._events[g];if(_.fn)_.fn===f&&(!h||_.once)&&(!p||_.context===p)&&a(this,g);else{for(var y=0,N=[],T=_.length;y<T;y++)(_[y].fn!==f||h&&!_[y].once||p&&_[y].context!==p)&&N.push(_[y]);N.length?this._events[g]=N.length===1?N[0]:N:a(this,g)}return this},l.prototype.removeAllListeners=function(u){var f;return u?(f=t?t+u:u,this._events[f]&&a(this,f)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=t,l.EventEmitter=l,n.exports=l}(Us)),Us.exports}var Nf=vf();const Tf=wi(Nf),di=new WeakMap,hi=["error","warn","log","info"];let fi="warn";function Do(n){if(fi&&hi.indexOf(n)<=hi.indexOf(fi)){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 Yt(n){return hi.reduce(((e,t)=>(e[t]=Do.bind(console,t,n),e)),{})}Yt.level=n=>{fi=n};Do.level=Yt.level;const Fs=Yt("quill:events"),Af=["selectionchange","mousedown","mouseup","click"];Af.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=di.get(s);i&&i.emitter&&i.emitter.handleDOM(...t)}))}))}));class G extends Tf{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",Fs.error)}emit(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Fs.log.call(Fs,...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:l}=i;(e.target===a||a.contains(e.target))&&l(e,...r)}))}listenDOM(e,t,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:r})}}const Hs=Yt("quill:selection");class Mn{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}}class wf{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 Mn(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,G.sources.USER),1)})),this.emitter.on(G.events.SCROLL_BEFORE_UPDATE,(()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(G.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((l=>l.type==="characterData"||l.type==="childList"||l.type==="attributes"&&l.target===this.root));this.update(a?G.sources.SILENT:s)}catch{}}))})),this.emitter.on(G.events.SCROLL_OPTIMIZE,((r,s)=>{if(s.range){const{startNode:i,startOffset:a,endNode:l,endOffset:c}=s.range;this.setNativeRange(i,a,l,c),this.update(G.sources.SILENT)}})),this.update(G.sources.SILENT)}handleComposition(){this.emitter.on(G.events.COMPOSITION_BEFORE_START,(()=>{this.composing=!0})),this.emitter.on(G.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(G.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,Z.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof et){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[f]=this.scroll.leaf(e+1);if(f){const[p]=this.scroll.line(e),[h]=this.scroll.line(e+1);p===h&&(i=f,a=0)}}[s,a]=i.position(a,!0);const l=document.createRange();if(t>0)return l.setStart(s,a),[i,a]=this.scroll.leaf(e+t),i==null?null:([s,a]=i.position(a,!0),l.setEnd(s,a),l.getBoundingClientRect());let c="left",u;if(s instanceof Text){if(!s.data.length)return null;a<s.data.length?(l.setStart(s,a),l.setEnd(s,a+1)):(l.setStart(s,a-1),l.setEnd(s,a),c="right"),u=l.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 Hs.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&&zs(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[l,c]=a,u=this.scroll.find(l,!0),f=u.offset(this.scroll);return c===0?f:u instanceof et?f+u.index(l,c):f+u.length()})),s=Math.min(Math.max(...r),this.scroll.length()-1),i=Math.min(s,...r);return new Mn(i,s-i)}normalizeNative(e){if(!zs(this.root,e.startContainer)||!e.collapsed&&!zs(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,l]=this.scroll.leaf(s);return a?a.position(l,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(Hs.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:l}=this.getNativeRange()||{};if(l==null||i||e!==l.startContainer||t!==l.startOffset||r!==l.endContainer||s!==l.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]:G.sources.API;if(typeof t=="string"&&(r=t,t=!1),Hs.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]:G.sources.USER;const t=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!Ni(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=[G.events.SELECTION_CHANGE,ar(this.lastRange),ar(t),e];this.emitter.emit(G.events.EDITOR_CHANGE,...i),e!==G.sources.SILENT&&this.emitter.emit(...i)}}}function zs(n,e){try{e.parentNode}catch{return!1}return n.contains(e)}const Sf=/^[ -~]*$/;class xf{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 Lf(r.ops.slice()).reduce(((a,l)=>{const c=Et.Op.length(l);let u=l.attributes||{},f=!1,p=!1;if(l.insert!=null){if(s.retain(c),typeof l.insert=="string"){const _=l.insert;p=!_.endsWith(`\n`)&&(t<=a||!!this.scroll.descendant(bt,a)[0]),this.scroll.insertAt(a,_);const[y,N]=this.scroll.line(a);let T=hn({},pt(y));if(y instanceof Ze){const[L]=y.descendant(et,N);L&&(T=hn(T,pt(L)))}u=Et.AttributeMap.diff(T,u)||{}}else if(typeof l.insert=="object"){const _=Object.keys(l.insert)[0];if(_==null)return a;const y=this.scroll.query(_,Z.INLINE)!=null;if(y)(t<=a||this.scroll.descendant(bt,a)[0])&&(p=!0);else if(a>0){const[N,T]=this.scroll.descendant(et,a-1);N instanceof Ot?N.value()[T]!==`\n`&&(f=!0):N instanceof ct&&N.statics.scope===Z.INLINE_BLOT&&(f=!0)}if(this.scroll.insertAt(a,_,l.insert[_]),y){const[N]=this.scroll.descendant(et,a);if(N){const T=hn({},pt(N));u=Et.AttributeMap.diff(T,u)||{}}}}t+=c}else if(s.push(l),l.retain!==null&&typeof l.retain=="object"){const _=Object.keys(l.retain)[0];if(_==null)return a;this.scroll.updateEmbedAt(a,_,l.retain[_])}Object.keys(u).forEach((_=>{this.scroll.formatAt(a,c,_,u[_])}));const h=f?1:0,g=p?1:0;return t+=h+g,s.retain(h),s.delete(g),a+c+h+g}),0),s.reduce(((a,l)=>typeof l.delete=="number"?(this.scroll.deleteAt(a,l.delete),a):a+Et.Op.length(l)),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,ar(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,ar(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((l=>{const[c]=l;c instanceof Ze?r.push(c):c instanceof et&&s.push(c)})):(r=this.scroll.lines(e,t),s=this.scroll.descendants(et,e,t));const[i,a]=[r,s].map((l=>{const c=l.shift();if(c==null)return{};let u=pt(c);for(;Object.keys(u).length>0;){const f=l.shift();if(f==null)return u;u=Of(pt(f),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)?Fr(r,s,t,!0):Fr(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,ar(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!==Ze.blotName)return!1;const t=e;return t.children.length>1?!1:t.children.head instanceof Ct}removeFormat(e,t){const r=this.getText(e,t),[s,i]=this.scroll.line(e+t);let a=0,l=new K;s!=null&&(a=s.length()-i,l=s.delta().slice(i,i+a-1).insert(`\n`));const u=this.getContents(e,t+a).diff((new K).insert(r).concat(l)),f=(new K).retain(e).concat(u);return this.applyDelta(f)}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(Sf)&&this.scroll.find(t[0].target)){const i=this.scroll.find(t[0].target),a=pt(i),l=i.offset(this.scroll),c=t[0].oldValue.replace(wt.CONTENTS,""),u=(new K).insert(c),f=(new K).insert(i.value()),p=r&&{oldRange:Sa(r.oldRange,-l),newRange:Sa(r.newRange,-l)};e=(new K).retain(l).concat(u.diff(f,p)).reduce(((g,_)=>_.insert?g.insert(_.insert,a):g.push(_)),new K),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!Ni(s.compose(e),this.delta))&&(e=s.diff(this.delta,r));return e}}function sr(n,e,t){if(n.length===0){const[g]=js(t.pop());return e<=0?`</li></${g}>`:`</li></${g}>${sr([],e-1,t)}`}const[{child:r,offset:s,length:i,indent:a,type:l},...c]=n,[u,f]=js(l);if(a>e)return t.push(l),a===e+1?`<${u}><li${f}>${Fr(r,s,i)}${sr(c,a,t)}`:`<${u}><li>${sr(n,e+1,t)}`;const p=t[t.length-1];if(a===e&&l===p)return`</li><li${f}>${Fr(r,s,i)}${sr(c,a,t)}`;const[h]=js(t.pop());return`</li></${h}>${sr(n,e-1,t)}`}function Fr(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 Ot)return Os(n.value().slice(e,e+t)).replaceAll(" "," ");if(n instanceof xt){if(n.statics.blotName==="list-container"){const u=[];return n.children.forEachAt(e,t,((f,p,h)=>{const g="formats"in f&&typeof f.formats=="function"?f.formats():{};u.push({child:f,offset:p,length:h,indent:g.indent||0,type:g.list})})),sr(u,-1,[])}const s=[];if(n.children.forEachAt(e,t,((u,f,p)=>{s.push(Fr(u,f,p))})),r||n.statics.blotName==="list")return s.join("");const{outerHTML:i,innerHTML:a}=n.domNode,[l,c]=i.split(`>${a}<`);return l==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${c}`:`${l}>${s.join("")}<${c}`}return n.domNode instanceof Element?n.domNode.outerHTML:""}function Of(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 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 Sa(n,e){let{index:t,length:r}=n;return new Mn(t+e,r)}function Lf(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 $t{static DEFAULTS={};constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}}const is="\ufeff";class Si extends ct{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(is),this.rightGuard=document.createTextNode(is),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(is).join("");if(e===this.leftGuard)if(this.prev instanceof Ot){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 Ot?(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=is,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 Cf{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 Si)&&(this.emitter.emit(G.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(G.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(G.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(G.events.COMPOSITION_END,e),this.isComposing=!1}}class hr{static DEFAULTS={modules:{}};static themes={default:hr};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 If=n=>n.parentElement||n.getRootNode().host||null,Rf=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}},as=n=>{const e=parseInt(n,10);return Number.isNaN(e)?0:e},xa=(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,kf=(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}:Rf(s),l=getComputedStyle(s),c=xa(r.left,r.right,a.left,a.right,as(l.scrollPaddingLeft),as(l.scrollPaddingRight)),u=xa(r.top,r.bottom,a.top,a.bottom,as(l.scrollPaddingTop),as(l.scrollPaddingBottom));if(c||u)if(i)t.defaultView?.scrollBy(c,u);else{const{scrollLeft:f,scrollTop:p}=s;u&&(s.scrollTop+=u),c&&(s.scrollLeft+=c);const h=s.scrollLeft-f,g=s.scrollTop-p;r={left:r.left-h,top:r.top-g,right:r.right-h,bottom:r.bottom-g}}s=i||l.position==="fixed"?null:If(s)}},Mf=100,Df=["block","break","cursor","inline","scroll","text"],Bf=(n,e,t)=>{const r=new ur;return Df.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>Mf){t.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}})),r},lr=Yt("quill"),os=new ur;xt.uiClass="ql-ui";class A{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:os,theme:"default"};static events=G.events;static sources=G.sources;static version="2.0.3";static imports={delta:K,parchment:pf,"core/module":$t,"core/theme":hr};static debug(e){e===!0&&(e="log"),Yt.level(e)}static find(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return di.get(e)||os.find(e,t)}static import(e){return this.imports[e]==null&&lr.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&&lr.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&os.register(t),typeof t.register=="function"&&t.register(os)}}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=qf(e,t),this.container=this.options.container,this.container==null){lr.error("Invalid Quill container",e);return}this.options.debug&&A.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",di.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new G;const s=Ai.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 xf(this.scroll),this.selection=new wf(this.scroll,this.emitter),this.composition=new Cf(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(G.events.EDITOR_CHANGE,(a=>{a===G.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())})),this.emitter.on(G.events.SCROLL_UPDATE,((a,l)=>{const c=this.selection.lastRange,[u]=this.selection.getRange(),f=c&&u?{oldRange:c,newRange:u}:void 0;Tt.call(this,(()=>this.editor.update(null,l,f)),a)})),this.emitter.on(G.events.SCROLL_EMBED_UPDATE,((a,l)=>{const c=this.selection.lastRange,[u]=this.selection.getRange(),f=c&&u?{oldRange:c,newRange:u}:void 0;Tt.call(this,(()=>{const p=(new K).retain(a.offset(this)).retain({[a.statics.blotName]:l});return this.editor.update(p,[],f)}),A.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]=Kt(e,t,r),Tt.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]:G.sources.API;return Tt.call(this,(()=>{const s=this.getSelection(!0);let i=new K;if(s==null)return i;if(this.scroll.query(e,Z.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,G.sources.SILENT),i}),r)}formatLine(e,t,r,s,i){let a;return[e,t,a,i]=Kt(e,t,r,s,i),Tt.call(this,(()=>this.editor.formatLine(e,t,a)),i,e,0)}formatText(e,t,r,s,i){let a;return[e,t,a,i]=Kt(e,t,r,s,i),Tt.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]=Kt(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]=Kt(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]=Kt(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]:A.sources.API;return Tt.call(this,(()=>this.editor.insertEmbed(e,t,r)),s,e)}insertText(e,t,r,s,i){let a;return[e,,a,i]=Kt(e,0,r,s,i),Tt.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]=Kt(e,t,r),Tt.call(this,(()=>this.editor.removeFormat(e,t)),r,e)}scrollRectIntoView(e){kf(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]:G.sources.API;return Tt.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||A.sources.API):([e,t,,r]=Kt(e,t,r),this.selection.setRange(new Mn(Math.max(0,e),t),r),r!==G.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:G.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]:G.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]:G.sources.API;return Tt.call(this,(()=>(e=new K(e),this.editor.applyDelta(e))),t,!0)}}function Oa(n){return typeof n=="string"?document.querySelector(n):n}function Ks(n){return Object.entries(n??{}).reduce(((e,t)=>{let[r,s]=t;return{...e,[r]:s===!0?{}:s}}),{})}function La(n){return Object.fromEntries(Object.entries(n).filter((e=>e[1]!==void 0)))}function qf(n,e){const t=Oa(n);if(!t)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===A.DEFAULTS.theme?hr:A.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:i,...a}=A.DEFAULTS,{modules:l,...c}=s.DEFAULTS;let u=Ks(e.modules);u!=null&&u.toolbar&&u.toolbar.constructor!==Object&&(u={...u,toolbar:{container:u.toolbar}});const f=hn({},Ks(i),Ks(l),u),p={...a,...La(c),...La(e)};let h=e.registry;return h?e.formats&&lr.warn('Ignoring "formats" option because "registry" is specified'):h=e.formats?Bf(e.formats,p.registry,lr):p.registry,{...p,registry:h,container:t,theme:s,modules:Object.entries(f).reduce(((g,_)=>{let[y,N]=_;if(!N)return g;const T=A.import(`modules/${y}`);return T==null?(lr.error(`Cannot load ${y} module. Are you sure you registered it?`),g):{...g,[y]:hn({},T.DEFAULTS||{},N)}}),{}),bounds:Oa(p.bounds)}}function Tt(n,e,t,r){if(!this.isEnabled()&&e===G.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=Ca(s,a,e):r!==0&&(s=Ca(s,t,r,e)),this.setSelection(s,G.sources.SILENT)),a.length()>0){const l=[G.events.TEXT_CHANGE,a,i,e];this.emitter.emit(G.events.EDITOR_CHANGE,...l),e!==G.sources.SILENT&&this.emitter.emit(...l)}return a}function Kt(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||G.sources.API,[n,e,i,s]}function Ca(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((l=>e.transformPosition(l,r!==G.sources.USER))):[i,a]=[n.index,n.index+n.length].map((l=>l<e||l===e&&r===G.sources.USER?l:s>=0?l+s:Math.max(e,l+s))),new Mn(i,a-i)}class Pn extends xs{}function Ia(n){return n instanceof Ze||n instanceof bt}function Ra(n){return typeof n.updateContent=="function"}class $f extends Ai{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=Ze;static allowedChildren=[Ze,bt,Pn];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(G.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(G.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(G.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 bt||i instanceof bt){this.optimize();return}const a=i.children.head instanceof Ct?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,Z.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===Z.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(bt,e)[0]&&e<this.length()),u=i.type==="block"?i.delta:(new K).insert({[i.key]:i.value});Gs(this,e,u);const f=i.type==="block"?1:0,p=e+u.length()+f;c&&this.insertAt(p-1,`\n`);const h=pt(this.line(e)[0]),g=Et.AttributeMap.diff(h,i.attributes)||{};Object.keys(g).forEach((_=>{this.formatAt(p-1,1,_,g[_])})),e=p}let[a,l]=this.children.find(e);if(r.length&&(a&&(a=a.split(l),l=0),r.forEach((c=>{if(c.type==="block"){const u=this.createBlock(c.attributes,a||void 0);Gs(u,0,c.delta)}else{const u=this.create(c.key,c.value);this.insertBefore(u,a||void 0),Object.keys(c.attributes).forEach((f=>{u.format(f,c.attributes[f])}))}}))),s.type==="block"&&s.delta.length()){const c=a?a.offset(a.scroll)+l:this.length();Gs(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 et?[r,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(Ia,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 l=[],c=a;return s.children.forEachAt(i,a,((u,f,p)=>{Ia(u)?l.push(u):u instanceof xs&&(l=l.concat(r(u,f,c))),c-=p})),l};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(G.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=G.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&&!Ra(i)})),e.length>0&&this.emitter.emit(G.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(G.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,r){const[s]=this.descendant((i=>i instanceof bt),e);s&&s.statics.blotName===t&&Ra(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 l=a[a.length-1];l&&r.insert(l,s.attributes)}else{const a=Object.keys(i)[0];if(!a)return;this.query(a,Z.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((l=>{let[c,u]=l;this.query(c,Z.BLOCK&Z.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((l=>{let[c,u]=l;i.formatAt(0,a,c,u)})),i}}function Gs(n,e,t){t.reduce(((r,s)=>{const i=Et.Op.length(s);let a=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const l=s.insert;n.insertAt(r,l);const[c]=n.descendant(et,r),u=pt(c);a=Et.AttributeMap.diff(u,a)||{}}else if(typeof s.insert=="object"){const l=Object.keys(s.insert)[0];if(l==null)return r;if(n.insertAt(r,l,s.insert[l]),n.scroll.query(l,Z.INLINE)!=null){const[u]=n.descendant(et,r),f=pt(u);a=Et.AttributeMap.diff(f,a)||{}}}}return Object.keys(a).forEach((l=>{n.formatAt(r,i,l,a[l])})),r+i}),e)}const xi={scope:Z.BLOCK,whitelist:["right","center","justify"]},Pf=new Bt("align","align",xi),Bo=new Lt("align","ql-align",xi),qo=new mn("align","text-align",xi);class $o extends mn{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 Uf=new Lt("color","ql-color",{scope:Z.INLINE}),Oi=new $o("color","color",{scope:Z.INLINE}),Ff=new Lt("background","ql-bg",{scope:Z.INLINE}),Li=new $o("background","background-color",{scope:Z.INLINE});class Un extends Pn{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 nt extends Ze{static TAB=" ";static register(){A.register(Un)}}class Ci extends bn{}Ci.blotName="code";Ci.tagName="CODE";nt.blotName="code-block";nt.className="ql-code-block";nt.tagName="DIV";Un.blotName="code-block-container";Un.className="ql-code-block-container";Un.tagName="DIV";Un.allowedChildren=[nt];nt.allowedChildren=[Ot,Ct,wt];nt.requiredContainer=Un;const Ii={scope:Z.BLOCK,whitelist:["rtl"]},Po=new Bt("direction","dir",Ii),Uo=new Lt("direction","ql-direction",Ii),Fo=new mn("direction","direction",Ii),Ho={scope:Z.INLINE,whitelist:["serif","monospace"]},zo=new Lt("font","ql-font",Ho);class Hf extends mn{value(e){return super.value(e).replace(/["']/g,"")}}const jo=new Hf("font","font-family",Ho),Ko=new Lt("size","ql-size",{scope:Z.INLINE,whitelist:["small","large","huge"]}),Go=new mn("size","font-size",{scope:Z.INLINE,whitelist:["10px","18px","32px"]}),zf=Yt("quill:keyboard"),jf=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Ls extends $t{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=Gf(e);if(s==null){zf.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 l={...s,key:a,...t,...r};this.bindings[l.key]=this.bindings[l.key]||[],this.bindings[l.key].push(l)}))}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((T=>Ls.match(e,T)));if(s.length===0)return;const i=A.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[l,c]=this.quill.getLine(a.index),[u,f]=this.quill.getLeaf(a.index),[p,h]=a.length===0?[u,f]:this.quill.getLeaf(a.index+a.length),g=u instanceof Es?u.value().slice(0,f):"",_=p instanceof Es?p.value().slice(h):"",y={collapsed:a.length===0,empty:a.length===0&&l.length()<=1,format:this.quill.getFormat(a),line:l,offset:c,prefix:g,suffix:_,event:e};s.some((T=>{if(T.collapsed!=null&&T.collapsed!==y.collapsed||T.empty!=null&&T.empty!==y.empty||T.offset!=null&&T.offset!==y.offset)return!1;if(Array.isArray(T.format)){if(T.format.every((L=>y.format[L]==null)))return!1}else if(typeof T.format=="object"&&!Object.keys(T.format).every((L=>T.format[L]===!0?y.format[L]!=null:T.format[L]===!1?y.format[L]==null:Ni(T.format[L],y.format[L]))))return!1;return T.prefix!=null&&!T.prefix.test(y.prefix)||T.suffix!=null&&!T.suffix.test(y.suffix)?!1:T.handler.call(this,a,y,T)!==!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[l]=this.quill.getLine(e.index-1);if(l&&!(l.statics.blotName==="block"&&l.length()<=1)){const u=i.formats(),f=this.quill.getFormat(e.index-1,1);if(s=Et.AttributeMap.diff(u,f)||{},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,A.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[l]=this.quill.getLine(e.index+1);if(l){const c=i.formats(),u=this.quill.getFormat(e.index,1);s=Et.AttributeMap.diff(c,u)||{},Object.keys(s).length>0&&(a=a.retain(l.length()-1).retain(1,s))}}this.quill.updateContents(a,A.sources.USER),this.quill.focus()}handleDeleteRange(e){Ri({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,Z.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,A.sources.USER),this.quill.setSelection(e.index+1,A.sources.SILENT),this.quill.focus()}}const Kf={bindings:{bold:Vs("bold"),italic:Vs("italic"),underline:Vs("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",A.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",A.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",A.sources.USER):e.format.list!=null&&this.quill.format("list",!1,A.sources.USER)}},"indent code-block":ka(!0),"outdent code-block":ka(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(n){this.quill.deleteText(n.index-1,1,A.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,A.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index+1,A.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,A.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,A.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,A.sources.USER),this.quill.setSelection(n.index+1,A.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,A.sources.USER),this.quill.setSelection(n.index+1,A.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=Vf(t,r,s,i);if(a==null)return;let l=t.offset();if(a<0){const c=(new K).retain(l).insert(`\n`);this.quill.updateContents(c,A.sources.USER),this.quill.setSelection(n.index+1,n.length,A.sources.SILENT)}else if(a>0){l+=t.length();const c=(new K).retain(l).insert(`\n`);this.quill.updateContents(c,A.sources.USER),this.quill.setSelection(l,A.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,A.sources.USER):this.quill.setSelection(s+r.length(),A.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," ",A.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,A.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index-t,A.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,A.sources.USER),this.quill.setSelection(n.index-1,A.sources.SILENT),!1}return!0}},"embed left":ls("ArrowLeft",!1),"embed left shift":ls("ArrowLeft",!0),"embed right":ls("ArrowRight",!1),"embed right shift":ls("ArrowRight",!0),"table down":Ma(!1),"table up":Ma(!0)}};Ls.DEFAULTS=Kf;function ka(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,A.sources.USER),this.quill.setSelection(e.index+i.length,A.sources.SILENT);return}const a=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:l,length:c}=e;a.forEach(((u,f)=>{n?(u.insertAt(0,i),f===0?l+=i.length:c+=i.length):u.domNode.textContent.startsWith(i)&&(u.deleteAt(0,i.length),f===0?l-=i.length:c-=i.length)})),this.quill.update(A.sources.USER),this.quill.setSelection(l,c,A.sources.SILENT)}}}function ls(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 ct?(n==="ArrowLeft"?e?this.quill.setSelection(r.index-1,r.length+1,A.sources.USER):this.quill.setSelection(r.index-1,A.sources.USER):e?this.quill.setSelection(r.index,r.length+1,A.sources.USER):this.quill.setSelection(r.index+r.length+1,A.sources.USER),!1):!0}}}function Vs(n){return{key:n[0],shortKey:!0,handler(e,t){this.quill.format(n,!t.format[n],A.sources.USER)}}}function Ma(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,l=s;for(;l.prev!=null;)l=l.prev,a=a.next;const c=a.offset(this.quill.scroll)+Math.min(t.offset,a.length()-1);this.quill.setSelection(c,0,A.sources.USER)}}else{const a=s.table()[r];a!=null&&(n?this.quill.setSelection(a.offset(this.quill.scroll)+a.length()-1,0,A.sources.USER):this.quill.setSelection(a.offset(this.quill.scroll),0,A.sources.USER))}return!1}}}function Gf(n){if(typeof n=="string"||typeof n=="number")n={key:n};else if(typeof n=="object")n=ar(n);else return null;return n.shortKey&&(n[jf]=n.shortKey,delete n.shortKey),n}function Ri(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=Et.AttributeMap.diff(a,i)||{}}e.deleteText(t,A.sources.USER),Object.keys(s).length>0&&e.formatLine(t.index,1,s,A.sources.USER),e.setSelection(t.index,A.sources.SILENT)}function Vf(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 Wf=/font-weight:\s*normal/,Zf=["P","OL","UL"],Da=n=>n&&Zf.includes(n.tagName),Yf=n=>{Array.from(n.querySelectorAll("br")).filter((e=>Da(e.previousElementSibling)&&Da(e.nextElementSibling))).forEach((e=>{e.parentNode?.removeChild(e)}))},Qf=n=>{Array.from(n.querySelectorAll('b[style*="font-weight"]')).filter((e=>e.getAttribute("style")?.match(Wf))).forEach((e=>{const t=n.createDocumentFragment();t.append(...e.childNodes),e.parentNode?.replaceChild(t,e)}))};function Xf(n){n.querySelector('[id^="docs-internal-guid-"]')&&(Qf(n),Yf(n))}const Jf=/\bmso-list:[^;]*ignore/i,eg=/\bmso-list:[^;]*\bl(\d+)/i,tg=/\bmso-list:[^;]*\blevel(\d+)/i,ng=(n,e)=>{const t=n.getAttribute("style"),r=t?.match(eg);if(!r)return null;const s=Number(r[1]),i=t?.match(tg),a=i?Number(i[1]):1,l=new RegExp(`@list l${s}:level${a}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),c=e.match(l),u=c&&c[1]==="bullet"?"bullet":"ordered";return{id:s,indent:a,type:u,element:n}},rg=n=>{const e=Array.from(n.querySelectorAll("[style*=mso-list]")),t=[],r=[];e.forEach((a=>{(a.getAttribute("style")||"").match(Jf)?t.push(a):r.push(a)})),t.forEach((a=>a.parentNode?.removeChild(a)));const s=n.documentElement.innerHTML,i=r.map((a=>ng(a,s))).filter((a=>a));for(;i.length;){const a=[];let l=i.shift();for(;l;)a.push(l),l=i.length&&i[0]?.element===l.element.nextElementSibling&&i[0].id===l.id?i.shift():null;const c=document.createElement("ul");a.forEach((p=>{const h=document.createElement("li");h.setAttribute("data-list",p.type),p.indent>1&&h.setAttribute("class",`ql-indent-${p.indent-1}`),h.innerHTML=p.element.innerHTML,c.appendChild(h)}));const u=a[0]?.element,{parentNode:f}=u??{};u&&f?.replaceChild(c,u),a.slice(1).forEach((p=>{let{element:h}=p;f?.removeChild(h)}))}};function sg(n){n.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&rg(n)}const ig=[sg,Xf],ag=n=>{n.documentElement&&ig.forEach((e=>{e(n)}))},og=Yt("quill:clipboard"),lg=[[Node.TEXT_NODE,vg],[Node.TEXT_NODE,qa],["br",gg],[Node.ELEMENT_NODE,qa],[Node.ELEMENT_NODE,fg],[Node.ELEMENT_NODE,hg],[Node.ELEMENT_NODE,yg],["li",bg],["ol, ul",Eg],["pre",pg],["tr",_g],["b",Ws("bold")],["i",Ws("italic")],["strike",Ws("strike")],["style",mg]],cg=[Pf,Po].reduce(((n,e)=>(n[e.keyName]=e,n)),{}),Ba=[qo,Li,Oi,Fo,jo,Go].reduce(((n,e)=>(n[e.keyName]=e,n)),{});class ug extends $t{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=[],lg.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[nt.blotName])return(new K).insert(r||"",{[nt.blotName]:s[nt.blotName]});if(!t)return(new K).insert(r||"",s);const i=this.convertHTML(t);return Kr(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){ag(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 ki(this.quill.scroll,r,i,a,s)}dangerouslyPasteHTML(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:A.sources.API;if(typeof e=="string"){const s=this.convert({html:e,text:""});this.quill.setContents(s,t),this.quill.setSelection(0,A.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(),A.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&&Ri({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);og.log("onPaste",a,{text:r,html:s});const l=(new K).retain(e.index).delete(e.length).concat(a);this.quill.updateContents(l,A.sources.USER),this.quill.setSelection(l.length()-e.length,A.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const r=[],s=[];return this.matchers.forEach((i=>{const[a,l]=i;switch(a){case Node.TEXT_NODE:s.push(l);break;case Node.ELEMENT_NODE:r.push(l);break;default:Array.from(e.querySelectorAll(a)).forEach((c=>{t.has(c)?t.get(c)?.push(l):t.set(c,[l])}));break}})),[r,s]}}function Fn(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 Kr(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 dn(n,e){if(!(n instanceof Element))return!1;const t=e.query(n);return t&&t.prototype instanceof ct?!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 dg(n,e){return n.previousElementSibling&&n.nextElementSibling&&!dn(n.previousElementSibling,e)&&!dn(n.nextElementSibling,e)}const cs=new WeakMap;function Vo(n){return n==null?!1:(cs.has(n)||(n.tagName==="PRE"?cs.set(n,!0):cs.set(n,Vo(n.parentNode))),cs.get(n))}function ki(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 l=ki(n,a,t,r,s);return a.nodeType===e.ELEMENT_NODE&&(l=t.reduce(((c,u)=>u(a,c,n)),l),l=(s.get(a)||[]).reduce(((c,u)=>u(a,c,n)),l)),i.concat(l)}),new K):new K}function Ws(n){return(e,t,r)=>Fn(t,n,!0,r)}function hg(n,e,t){const r=Bt.keys(n),s=Lt.keys(n),i=mn.keys(n),a={};return r.concat(s).concat(i).forEach((l=>{let c=t.query(l,Z.ATTRIBUTE);c!=null&&(a[c.attrName]=c.value(n),a[c.attrName])||(c=cg[l],c!=null&&(c.attrName===l||c.keyName===l)&&(a[c.attrName]=c.value(n)||void 0),c=Ba[l],c!=null&&(c.attrName===l||c.keyName===l)&&(c=Ba[l],a[c.attrName]=c.value(n)||void 0))})),Object.entries(a).reduce(((l,c)=>{let[u,f]=c;return Fn(l,u,f,t)}),e)}function fg(n,e,t){const r=t.query(n);if(r==null)return e;if(r.prototype instanceof ct){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 Ur&&!Kr(e,`\n`)&&e.insert(`\n`),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return Fn(e,r.blotName,r.formats(n,t),t);return e}function gg(n,e){return Kr(e,`\n`)||e.insert(`\n`),e}function pg(n,e,t){const r=t.query("code-block"),s=r&&"formats"in r&&typeof r.formats=="function"?r.formats(n,t):!0;return Fn(e,"code-block",s,t)}function mg(){return new K}function bg(n,e,t){const r=t.query(n);if(r==null||r.blotName!=="list"||!Kr(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,l)=>l.insert?l.attributes&&typeof l.attributes.indent=="number"?a.push(l):a.insert(l.insert,{indent:s,...l.attributes||{}}):a),new K)}function Eg(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"),Fn(e,"list",s,t)}function qa(n,e,t){if(!Kr(e,`\n`)){if(dn(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(dn(r,t))return e.insert(`\n`);const s=t.query(r);if(s&&s.prototype instanceof bt)return e.insert(`\n`);r=r.firstChild}}}return e}function yg(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[l,c]=a;return Fn(i,l,c,t)}),e),parseFloat(s.textIndent||0)>0?(new K).insert("\t").concat(e):e}function _g(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 Fn(e,"table",i,t)}return e}function vg(n,e,t){let r=n.data;if(n.parentElement?.tagName==="O:P")return e.insert(r.trim());if(!Vo(n)){if(r.trim().length===0&&r.includes(`\n`)&&!dg(n,t))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(n.previousSibling==null&&n.parentElement!=null&&dn(n.parentElement,t)||n.previousSibling instanceof Element&&dn(n.previousSibling,t))&&(r=r.replace(/^ /,"")),(n.nextSibling==null&&n.parentElement!=null&&dn(n.parentElement,t)||n.nextSibling instanceof Element&&dn(n.nextSibling,t))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class Ng extends $t{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(A.events.EDITOR_CHANGE,((r,s,i,a)=>{r===A.events.SELECTION_CHANGE?s&&a!==A.sources.SILENT&&(this.currentRange=s):r===A.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||a===A.sources.USER?this.record(s,i):this.transform(s)),this.currentRange=gi(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:gi(r.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(r.delta,A.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){$a(this.stack.undo,e),$a(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,A.sources.USER);else{const t=Ag(this.quill.scroll,e.delta);this.quill.setSelection(t,A.sources.USER)}}}function $a(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&&gi(s.range,t)},t=s.delta.transform(t),n[r].delta.length()===0&&n.splice(r,1)}}function Tg(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,Z.BLOCK)!=null)):!1}function Ag(n,e){const t=e.reduce(((s,i)=>s+(i.delete||0)),0);let r=e.length()-t;return Tg(n,e)&&(r-=1),r}function gi(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 Wo extends $t{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)}}Wo.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,G.sources.USER),this.quill.setSelection(n.index+r.length,G.sources.SILENT)}))}};const wg=["insertText","insertReplacementText"];class Sg extends $t{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",(r=>{this.handleBeforeInput(r)})),/Android/i.test(navigator.userAgent)||e.on(A.events.COMPOSITION_BEFORE_START,(()=>{this.handleCompositionStart()}))}deleteRange(e){Ri({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),A.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,A.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!wg.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const r=xg(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 xg(n){return typeof n.data=="string"?n.data:n.dataTransfer?.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const Og=/Mac/i.test(navigator.platform),Lg=100,Cg=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||Og&&n.key==="a"&&n.ctrlKey===!0);class Ig extends $t{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 xt)||!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),A.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",(e=>{!e.defaultPrevented&&Cg(e)&&this.ensureListeningToSelectionChange()}))}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+Lg,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 xt)||!r.uiNode)return;const s=document.createRange();s.setStartAfter(r.uiNode),s.setEndAfter(r.uiNode),e.removeAllRanges(),e.addRange(s)}}A.register({"blots/block":Ze,"blots/block/embed":bt,"blots/break":Ct,"blots/container":Pn,"blots/cursor":wt,"blots/embed":Si,"blots/inline":bn,"blots/scroll":$f,"blots/text":Ot,"modules/clipboard":ug,"modules/history":Ng,"modules/keyboard":Ls,"modules/uploader":Wo,"modules/input":Sg,"modules/uiNode":Ig});class Rg extends Lt{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 kg=new Rg("indent","ql-indent",{scope:Z.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Mg extends Ze{static blotName="blockquote";static tagName="blockquote"}class Dg extends Ze{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}}class Gr extends Pn{}Gr.blotName="list-container";Gr.tagName="OL";class Vr extends Ze{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(){A.register(Gr)}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)}}Vr.blotName="list";Vr.tagName="LI";Gr.allowedChildren=[Vr];Vr.requiredContainer=Gr;class Mi extends bn{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 Bg extends Mi{static blotName="italic";static tagName=["EM","I"]}class ys extends bn{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 Zo(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 Zo(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 qg extends bn{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 $g extends Mi{static blotName="strike";static tagName=["S","STRIKE"]}class Pg extends bn{static blotName="underline";static tagName="U"}class Ug extends Si{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 Pa=["alt","height","width"];let Fg=class extends ct{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 Pa.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 Zo(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){Pa.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}};const Ua=["height","width"];class Hg extends bt{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 Ua.reduce(((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t)),{})}static sanitize(e){return ys.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){Ua.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 Mr=new Lt("code-token","hljs",{scope:Z.INLINE});class Wt extends bn{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(nt.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,r){super(e,t,r),Mr.add(this.domNode,r)}format(e,t){e!==Wt.blotName?super.format(e,t):t?Mr.add(this.domNode,t):(Mr.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),Mr.value(this.domNode)||this.unwrap()}}Wt.blotName="code-token";Wt.className="ql-token";class mt extends nt{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(),Wt.blotName,!1),super.replaceWith(e,t)}}class Br extends Un{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===mt.blotName&&(this.forceNext=!0,this.children.forEach((r=>{r.format(e,t)})))}formatAt(e,t,r,s){r===mt.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=mt.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(Mo(u,!1))),new K),l=e(s,i);a.diff(l).reduce(((c,u)=>{let{retain:f,attributes:p}=u;return f?(p&&Object.keys(p).forEach((h=>{[mt.blotName,Wt.blotName].includes(h)&&this.formatAt(c,f,h,p[h])})),c+f):c}),0)}this.cachedText=s,this.forceNext=!1}}html(e,t){const[r]=this.children.find(e);return`<pre data-language="${r?mt.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=mt.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}Br.allowedChildren=[mt];mt.requiredContainer=Br;mt.allowedChildren=[Wt,wt,Ot,Ct];const zg=(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 Yo extends $t{static register(){A.register(Wt,!0),A.register(mt,!0),A.register(Br,!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(A.events.SCROLL_BLOT_MOUNT,(e=>{if(!(e instanceof Br))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(mt.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)})),e.uiNode==null&&(e.attachUI(t),e.children.head&&(t.value=mt.formats(e.children.head.domNode)))}))}initTimer(){let e=null;this.quill.on(A.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(A.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(Br):[e]).forEach((i=>{i.highlight(this.highlightBlot,t)})),this.quill.update(A.sources.SILENT),r!=null&&this.quill.setSelection(r,A.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`,{[nt.blotName]:t}),s.insert(i))),new K);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(nt.className),r.innerHTML=zg(this.options.hljs,t,e),ki(this.quill.scroll,r,[(s,i)=>{const a=Mr.value(s);return a?i.compose((new K).retain(i.length(),{[Wt.blotName]:a})):i}],[(s,i)=>s.data.split(`\n`).reduce(((a,l,c)=>(c!==0&&a.insert(`\n`,{[nt.blotName]:t}),a.insert(l))),i)],new WeakMap)}}Yo.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 St extends Ze{static blotName="table";static tagName="TD";static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",Di()),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===St.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 Dn extends Pn{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 fn extends Pn{static blotName="table-body";static tagName="TBODY"}class _s extends Pn{static blotName="table-container";static tagName="TABLE";balanceCells(){const e=this.descendants(Dn),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=St.formats(r.children.head.domNode));const i=this.scroll.create(St.blotName,s);r.appendChild(i),i.optimize()}))}))}cells(e){return this.rows().map((t=>t.children.at(e)))}deleteColumn(e){const[t]=this.descendant(fn);t==null||t.children.head==null||t.children.forEach((r=>{const s=r.children.at(e);s?.remove()}))}insertColumn(e){const[t]=this.descendant(fn);t==null||t.children.head==null||t.children.forEach((r=>{const s=r.children.at(e),i=St.formats(r.children.head.domNode),a=this.scroll.create(St.blotName,i);r.insertBefore(a,s)}))}insertRow(e){const[t]=this.descendant(fn);if(t==null||t.children.head==null)return;const r=Di(),s=this.scroll.create(Dn.blotName);t.children.head.children.forEach((()=>{const a=this.scroll.create(St.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))}}_s.allowedChildren=[fn];fn.requiredContainer=_s;fn.allowedChildren=[Dn];Dn.requiredContainer=fn;Dn.allowedChildren=[St];St.requiredContainer=Dn;function Di(){return`row-${Math.random().toString(36).slice(2,6)}`}class jg extends $t{static register(){A.register(St),A.register(Dn),A.register(fn),A.register(_s)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(_s).forEach((e=>{e.balanceCells()}))}deleteColumn(){const[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update(A.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(A.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const t=e.offset();e.remove(),this.quill.update(A.sources.USER),this.quill.setSelection(t,A.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!==St.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(A.sources.USER);let l=s.rowOffset();e===0&&(l+=1),this.quill.setSelection(t.index+l,t.length,A.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(A.sources.USER),e>0?this.quill.setSelection(t,A.sources.SILENT):this.quill.setSelection(t.index+s.children.length,t.length,A.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:Di()})}),(new K).retain(r.index));this.quill.updateContents(s,A.sources.USER),this.quill.setSelection(r.index,A.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(A.events.SCROLL_OPTIMIZE,(e=>{e.some((t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.quill.once(A.events.TEXT_CHANGE,((r,s,i)=>{i===A.sources.USER&&this.balanceTables()})),!0):!1))}))}}const Fa=Yt("quill:toolbar");class Bi extends $t{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const r=document.createElement("div");r.setAttribute("role","toolbar"),Kg(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)){Fa.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(A.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){Fa.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 l=e.options[e.selectedIndex];l.hasAttribute("selected")?i=!1:i=l.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 ct){if(i=prompt(`Enter ${t}`),!i)return;this.quill.updateContents((new K).retain(a.index).delete(a.length).insert({[t]:i}),A.sources.USER)}else this.quill.format(t,i,A.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 l=t[s];typeof l=="string"&&(l=l.replace(/"/g,'\\"')),a=i.querySelector(`option[value="${l}"]`)}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],l=a===i.getAttribute("value")||a!=null&&a.toString()===i.getAttribute("value")||a==null&&!i.getAttribute("value");i.classList.toggle("ql-active",l),i.setAttribute("aria-pressed",l.toString())}else{const a=t[s]!=null;i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}}))}}Bi.DEFAULTS={};function Ha(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 Kg(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")Ha(r,s);else{const i=Object.keys(s)[0],a=s[i];Array.isArray(a)?Gg(r,i,a):Ha(r,i,a)}})),n.appendChild(r)}))}function Gg(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)}Bi.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,Z.INLINE)!=null&&this.quill.format(t,!1,A.sources.USER)}))}else this.quill.removeFormat(n.index,n.length,A.sources.USER)},direction(n){const{align:e}=this.quill.getFormat();n==="rtl"&&e==null?this.quill.format("align","right",A.sources.USER):!n&&e==="right"&&this.quill.format("align",!1,A.sources.USER),this.quill.format("direction",n,A.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,A.sources.USER)}},link(n){n===!0&&(n=prompt("Enter link URL:")),this.quill.format("link",n,A.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,A.sources.USER):this.quill.format("list","unchecked",A.sources.USER):this.quill.format("list",n,A.sources.USER)}}};const Vg='<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>',Wg='<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>',Zg='<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>',Yg='<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>',Qg='<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>',Xg='<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>',Jg='<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>',ep='<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>',za='<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>',tp='<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>',np='<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>',rp='<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>',sp='<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>',ip='<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>',ap='<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>',op='<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>',lp='<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>',cp='<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>',up='<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>',dp='<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>',hp='<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>',fp='<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>',gp='<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>',pp='<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>',mp='<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>',bp='<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>',Ep='<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>',yp='<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>',_p='<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>',vp='<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>',Np='<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>',Tp='<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>',Ap='<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>',Hr={align:{"":Vg,center:Wg,right:Zg,justify:Yg},background:Qg,blockquote:Xg,bold:Jg,clean:ep,code:za,"code-block":za,color:tp,direction:{"":np,rtl:rp},formula:sp,header:{1:ip,2:ap,3:op,4:lp,5:cp,6:up},italic:dp,image:hp,indent:{"+1":fp,"-1":gp},link:pp,list:{bullet:mp,check:bp,ordered:Ep},script:{sub:yp,super:_p},strike:vp,table:Np,underline:Tp,video:Ap},wp='<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 ja=0;function Ka(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"),Ka(this.label,"aria-expanded"),Ka(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=wp,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-${ja}`,ja+=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 Qo 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 Xo 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 Sp=n=>{const{overflowY:e}=getComputedStyle(n,null);return e!=="visible"&&e!=="clip"};let Jo=class{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,Sp(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 l=i.bottom-i.top,c=e.bottom-e.top+l;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 xp=[!1,"center","right","justify"],Op=["#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"],Lp=[!1,"serif","monospace"],Cp=["1","2","3",!1],Ip=["small",!1,"large","huge"];class Wr extends hr{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&&Ir(s,xp),typeof t.align=="object"))return new Xo(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&&Ir(s,Op,i==="background"?"#ffffff":"#000000"),new Qo(s,t[i])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?Ir(s,Lp):s.classList.contains("ql-header")?Ir(s,Cp):s.classList.contains("ql-size")&&Ir(s,Ip)),new Cs(s)}));const r=()=>{this.pickers.forEach((s=>{s.update()}))};this.quill.on(G.events.EDITOR_CHANGE,r)}}Wr.DEFAULTS=hn({},hr.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 el extends Jo{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,G.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,G.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=Rp(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,G.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",G.sources.USER),this.quill.setSelection(r+2,G.sources.USER)}break}}this.textbox.value="",this.hide()}}function Rp(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 Ir(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 kp=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Mp extends el{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(G.events.EDITOR_CHANGE,((r,s,i,a)=>{if(r===G.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&a===G.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const l=this.quill.getLines(s.index,s.length);if(l.length===1){const c=this.quill.getBounds(s);c!=null&&this.position(c)}else{const c=l[l.length-1],u=this.quill.getIndex(c),f=Math.min(c.length()-1,s.index+s.length-u),p=this.quill.getBounds(new Mn(u,f));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(G.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 tl extends Wr{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=kp),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new Mp(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),Hr),this.buildPickers(e.container.querySelectorAll("select"),Hr))}}tl.DEFAULTS=hn({},Wr.DEFAULTS,{modules:{toolbar:{handlers:{link(n){n?this.quill.theme.tooltip.edit():this.quill.format("link",!1,A.sources.USER)}}}}});const Dp=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Bp extends el{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,G.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()})),this.quill.on(G.events.SELECTION_CHANGE,((e,t,r)=>{if(e!=null){if(e.length===0&&r===G.sources.USER){const[s,i]=this.quill.scroll.descendant(ys,e.index);if(s!=null){this.linkRange=new Mn(e.index-i,s.length());const a=ys.formats(s.domNode);this.preview.textContent=a,this.preview.setAttribute("href",a),this.show();const l=this.quill.getBounds(this.linkRange);l!=null&&this.position(l);return}}else delete this.linkRange;this.hide()}}))}show(){super.show(),this.root.removeAttribute("data-mode")}}class nl extends Wr{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=Dp),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"),Hr),this.buildPickers(e.container.querySelectorAll("select"),Hr),this.tooltip=new Bp(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)})))}}nl.DEFAULTS=hn({},Wr.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,A.sources.USER)}}}}});A.register({"attributors/attribute/direction":Po,"attributors/class/align":Bo,"attributors/class/background":Ff,"attributors/class/color":Uf,"attributors/class/direction":Uo,"attributors/class/font":zo,"attributors/class/size":Ko,"attributors/style/align":qo,"attributors/style/background":Li,"attributors/style/color":Oi,"attributors/style/direction":Fo,"attributors/style/font":jo,"attributors/style/size":Go},!0);A.register({"formats/align":Bo,"formats/direction":Uo,"formats/indent":kg,"formats/background":Li,"formats/color":Oi,"formats/font":zo,"formats/size":Ko,"formats/blockquote":Mg,"formats/code-block":nt,"formats/header":Dg,"formats/list":Vr,"formats/bold":Mi,"formats/code":Ci,"formats/italic":Bg,"formats/link":ys,"formats/script":qg,"formats/strike":$g,"formats/underline":Pg,"formats/formula":Ug,"formats/image":Fg,"formats/video":Hg,"modules/syntax":Yo,"modules/table":jg,"modules/toolbar":Bi,"themes/bubble":tl,"themes/snow":nl,"ui/icons":Hr,"ui/picker":Cs,"ui/icon-picker":Xo,"ui/color-picker":Qo,"ui/tooltip":Jo},!0);var gt={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 qp{constructor(e,t,r){this.dataUrl=e,this.type=t,this.name=r||""}}class zr extends qp{constructor(e,t,r){super(e,t,r),this.dataUrl=e,this.type=t,this.name=r||`${gt.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 l=new Image;l.onload=()=>{const c=l.width,u=l.height;c>u?c>s&&(l.height=u*s/c,l.width=s):u>i&&(l.width=c*i/u,l.height=i);const f=document.createElement("canvas");f.width=l.width,f.height=l.height;const p=f.getContext("2d");if(p){p.drawImage(l,0,0,l.width,l.height);const h=this.type||"image/png",g=f.toDataURL(h,a);t(new zr(g,h,this.name))}else r({message:"[error] QuillImageDropAndPaste: Fail to minify the image, create canvas context failure."})},l.src=gt.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=gt.resolveDataUrl(this.dataUrl,this.type).replace(/^[^,]+,/,""),t=gt.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 $p{constructor(e,t){this.quill=e,this.option=t}}class Is extends $p{constructor(e,t){var r;super(e,t),typeof t.autoConvert!="boolean"&&(t.autoConvert=!0),t.enableNativeUploader!==!0&>.isObject(e.uploader)&>.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 zr(t,r,s)):this.insert.call(this,gt.resolveDataUrl(t,r),r)}),e)}}handlePaste(e){if(e.clipboardData&&e.clipboardData.items&&e.clipboardData.items.length){if(gt.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 zr(t,r)):this.insert(gt.resolveDataUrl(t,r),"image")}),e)}}readFiles(e,t,r){Array.prototype.forEach.call(e,(s=>{gt.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 l=e.getAsFile?e.getAsFile():e;l instanceof Blob&&a.readAsDataURL(l)}else i.match(/^text\/plain$/i)&&e.getAsString((a=>{if(gt.urlIsImageDataUrl(a)){const l=a.match(/^data:(image\/\w+);base64,/),c=l?l[1]:"image/png",u=this.getIndex();t(a,c),this.quill.deleteText(u,a.length,"user"),this.quill.setSelection(u)}else this.option.autoConvert&>.urlIsImage(a).then((()=>{setTimeout((()=>{const l=this.getIndex();this.quill.deleteText(l-a.length,a.length,"user"),s.insert(a,"image",l-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=l=>{l.target&&l.target.result&&t(l.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}}Is.ImageData=zr;window.QuillImageDropAndPaste=Is;"Quill"in window&&window.Quill.register("modules/imageDropAndPaste",Is);const rl=n=>n!=null&&(n=Object.getPrototypeOf(n),n===Array.prototype||n===Object.prototype);function sl(n,e,t){for(const[r,s]of Object.entries(e)){const i=`${t}.${r}`;n[i]=s,rl(s)&&sl(n,s,i)}}function Pp(n){const e={...n};for(const[t,r]of Object.entries(n))rl(r)&&sl(e,r,t);return e}const Up=(n,e)=>{if(e)for(const[t,r]of Object.entries(e))n=n.replace(new RegExp(`{{\\s*${t}\\s*}}`,"g"),r);return n},Fp=n=>n;function Hp(n,e=Fp){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 zp={insertHtmlSnippetMessage:"Insert a HTML Snippet",obfuscate:"Obfuscate"},jp="image",Kp="Validate",Gp="Cancel",Vp="Remove",Wp="Done",Zp="Image not inserted, place cursor in editor first",Yp="HTML Snippet",Qp="Confirm Deletion",Xp={content:"Are you sure you want to delete this HTML Snippet?"},Jp={variantLabel:"Size {{ n }}",sizes:"Sizes",imageProperties:"Image properties",left:"Left",right:"Right",center:"Center",alignment:"Alignment",options:"Options",enableZoom:"Enable zoom",link:"Link"},em={obfuscator:"Obfuscator",content:"Content:",asALink:"As a link",doNotObfuscate:"Do not obfuscate"},tm={insertVideo:"Insert a Video",dialog:{title:"Set a video"}},nm={insertLink:"Insert an internal link"},rm={CustomToolbar:zp,image:jp,validate:Kp,delete:"Delete",cancel:Gp,remove:Vp,done:Wp,editorFocusLost:Zp,htmlSnippetLabel:Yp,confirmDeletion:Qp,comfirmSnippetDeletionDialog:Xp,makeImagePropertiesDialog:Jp,openObfuscatorDialog:em,videoPlugin:tm,internalLinkPlugin:nm},sm={insertHtmlSnippetMessage:"Insérer un extrait de code HTML",obfuscate:"Obfusquer"},im="image",am="Valider",om="Annuler",lm="Terminé",cm="L'image n'a pas été insérée, mettre d'abord le curseur dans l'éditeur",um="Code HTML",dm="Confirmer la suppression",hm="Retirer",fm={content:"Voulez-vous vraiment supprimer ce code HTML ?"},gm={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",link:"Lien"},pm={obfuscator:"Obfusqueur",content:"Contenu:",asALink:"En tant que lien",doNotObfuscate:"Ne pas obfusquer"},mm={insertVideo:"Insérer une vidéo",dialog:{title:"Définir une vidéo"}},bm={insertLink:"Insérer un lien interne"},Em={CustomToolbar:sm,image:im,validate:am,delete:"Supprimer",cancel:om,done:lm,editorFocusLost:cm,htmlSnippetLabel:um,confirmDeletion:dm,remove:hm,comfirmSnippetDeletionDialog:fm,makeImagePropertiesDialog:gm,openObfuscatorDialog:pm,videoPlugin:mm,internalLinkPlugin:bm},Ga={en:rm,fr:Em};function En(n){const e=Xs((()=>{const r=n()in Ga?n():"en";return Pp(Ga[r])}));return{t:Hp(e,Up)}}var ym=be('<textarea autofocus class="QpInput QpHtmlSnippetInput"rows=8 cols=80>'),il=be('<button class="QpBtn secondary"type=button>'),_m=be("<button class=QpBtn type=button>"),vm=be('<button class="QpBtn danger outlined"type=button>'),Nm=be("<p>"),Tm=be('<button class="QpBtn danger"type=button>');async function al({service:n,language:e,mode:t,html:r}){const{t:s}=En(e),[i,a]=lt(r??""),l=()=>{c.close({action:"remove"})},c=n.createModalDialog({content:(()=>{var u=ym();return u.addEventListener("change",(f=>a(f.target.value))),cn((()=>u.value=i())),u})(),footer:[t==="update"&&(()=>{var u=vm();return u.$$click=()=>{Am({deleteSnippet:l,closeDialog:()=>{c.close()},language:e,service:n})},he(u,(()=>s("delete"))),u})(),(()=>{var u=il();return u.$$click=()=>c.close(),he(u,(()=>s("cancel"))),u})(),(()=>{var u=_m();return u.$$click=()=>c.close({action:t,values:{html:i()}}),he(u,(()=>s("validate"))),u})()],header:s("htmlSnippetLabel")});return await c.open()}function Am({closeDialog:n,deleteSnippet:e,language:t,service:r}){const{t:s}=En(t),i=r.createModalDialog({header:s("confirmDeletion"),content:(()=>{var a=Nm();return he(a,(()=>s("comfirmSnippetDeletionDialog.content"))),a})(),footer:[(()=>{var a=il();return a.$$click=()=>{i.hide()},he(a,(()=>s("cancel"))),a})(),(()=>{var a=Tm();return a.$$click=()=>{i.hide(),e()},he(a,(()=>s("validate"))),a})()]});i.show()}Ns(["click"]);var wm=be("<div class=QpSpinner>");function Sm(){return wm()}var xm=be('<button class="QpBtn outlined danger"type=button>'),Om=be("<button class=QpBtn type=button>"),Zs=be("<h2 class=FieldLabel>"),Va=be("<div class=QpOption>"),Lm=be("<input class=QpOption-input type=text>"),Cm=be("<label><input type=checkbox name=enableZoom>"),Im=be("<div><div class=QpOption><label class><input type=checkbox name=enableLinkOnImage></label></div><div class=QpOption>"),Rm=be("<button type=button> <small class=ml-1>(<!>)"),km=be("<button type=button>");async function Mm({language:n,imageUid:e,themeConf:t,service:r,...s}){const{t:i}=En(n),[a,l]=lt(!1),[c,u]=lt(),[f,p]=lt(),[h,g]=lt(s.zoom),[_,y]=lt(!!s.href),[N,T]=lt(s.href??""),L=Xs((()=>t.fTextImages.map(((U,ee)=>({size:U,label:i("makeImagePropertiesDialog.variantLabel",{n:ee+1})})))),[t,n()]),R=Xs((()=>[{align:"left",label:i("makeImagePropertiesDialog.left")},{align:"center",label:i("makeImagePropertiesDialog.center")},{align:"right",label:i("makeImagePropertiesDialog.right")}]),[n()]),F=async()=>{const U=c();if(!e||!U)throw new Error("missing a find variant name");l(!0);const{url:ee,displayWidth:ce,displayHeight:pe}=await r.useImage(e,U.displaySize);l(!1),V.close({action:"update",values:{uid:e,src:ee,align:f(),variant:U.displaySize,width:ce,height:pe,zoom:h()?void 0:"none",href:_()&&N().trim()||void 0}})};fs((()=>{s.align&&p(s.align)})),fs((()=>{if(s.imageSize){const U=L().find((ee=>ee.size.displaySize===s.imageSize));U&&u(U.size)}})),fs((()=>{_()&&g(!_())}));let P=Mt(Sm,{});a()||(P=[(()=>{var U=xm();return U.$$click=()=>{V.close({action:"remove"})},he(U,(()=>i("remove"))),U})(),(()=>{var U=Om();return U.$$click=F,U.disabled=!e||f===void 0||c===void 0,he(U,(()=>i("validate"))),U})()]);const V=r.createModalDialog({header:i("makeImagePropertiesDialog.imageProperties"),content:[(()=>{var U=Zs();return he(U,(()=>i("makeImagePropertiesDialog.sizes"))),U})(),(()=>{var U=Va();return he(U,Mt(Pi,{get each(){return L()},children:ee=>(()=>{var ce=Rm(),pe=ce.firstChild,b=pe.nextSibling,x=b.firstChild,v=x.nextSibling;return v.nextSibling,ce.$$click=()=>u(ee.size),ce.disabled=!e,he(ce,(()=>ee.label),pe),he(b,(()=>ee.size.displaySize),v),cn((()=>Qs(ce,`QpBtn secondary ${ee.size.displaySize!==c()?.displaySize?"outlined":""}`))),ce})()})),U})(),(()=>{var U=Zs();return he(U,(()=>i("makeImagePropertiesDialog.alignment"))),U})(),(()=>{var U=Va();return he(U,Mt(Pi,{get each(){return R()},children:ee=>(()=>{var ce=km();return ce.$$click=()=>p(ee.align),ce.disabled=!e,he(ce,(()=>ee.label)),cn((()=>Qs(ce,`QpBtn secondary ${ee.align!==f()?"outlined":""}`))),ce})()})),U})(),(()=>{var U=Zs();return he(U,(()=>i("makeImagePropertiesDialog.options"))),U})(),(()=>{var U=Im(),ee=U.firstChild,ce=ee.firstChild,pe=ce.firstChild,b=ee.nextSibling;return pe.addEventListener("change",(()=>{y(!_())})),he(ce,(()=>i("makeImagePropertiesDialog.link")),null),he(ce,Mt(Ui,{get when(){return _()},get children(){var x=Lm();return x.addEventListener("change",(v=>{T(v.currentTarget.value)})),cn((()=>x.value=N())),x}}),null),he(b,Mt(Ui,{get when(){return!_()},get children(){var x=Cm(),v=x.firstChild;return v.addEventListener("change",(()=>{g(!h())})),he(x,(()=>i("makeImagePropertiesDialog.enableZoom")),null),cn((()=>v.checked=h())),x}})),cn((()=>pe.checked=_())),U})()],footer:P});return await V.open()}Ns(["click"]);async function ol({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 ll(n){return Dm(n)||qi(n)}function qi(n){return!!n.match(/^[a-zA-Z0-9. _-]+@[a-zA-Z0-9. -]+\.[a-zA-Z]{2,4}$/g)}function Dm(n){return!!n.match(/^(\+|00)[1-9][0-9 \-\(\)\.]{7,32}$/)}function Bm(n){return ll(n)?qi(n)?"mailto":"tel":"raw"}function cl(n){if(n==="raw")return"raw";if(n==="mailto")return"mailto";if(n==="tel")return"tel";throw new Error(`invalid link-type '${n}'`)}var qm=be("<label class=ObfuscatorDialog-label><input type=text class=ml-2>"),$m=be('<label class="ObfuscatorDialog-label mt-4"><input type=checkbox name=asALink class=mr-2>'),Pm=be('<button class="QpBtn danger outlined"type=button>'),Um=be("<button class=QpBtn type=button>");async function Fm({service:n,language:e,value:t}){const{t:r}=En(e),[s,i]=lt(t.asALink),[a,l]=lt(t.content),c=f=>{l(f),ll(f)?i(!0):i(!1)},u=n.createModalDialog({header:r("openObfuscatorDialog.obfuscator"),content:[(()=>{var f=qm(),p=f.firstChild;return he(f,(()=>r("openObfuscatorDialog.content")),p),p.$$input=h=>c(h.currentTarget.value),cn((()=>p.value=a())),f})(),(()=>{var f=$m(),p=f.firstChild;return p.addEventListener("change",(()=>i(!s()))),he(f,(()=>r("openObfuscatorDialog.asALink")),null),cn((()=>p.checked=s())),f})()],footer:[(()=>{var f=Pm();return f.$$click=()=>u.close({action:"remove"}),he(f,(()=>r("openObfuscatorDialog.doNotObfuscate"))),f})(),(()=>{var f=Um();return f.$$click=()=>u.close({action:"update",content:a(),asALink:s()?qi(a())?"mailto":"tel":"raw"}),he(f,(()=>r("done"))),f})()]});return await u.open()}Ns(["input","click"]);var Hm=be('<button class="QpBtn outlined danger"type=button>'),zm=be('<button class="QpBtn secondary"type=button>'),jm=be("<button class=QpBtn type=button>");async function ul({service:n,language:e,mode:t,value:r,videoPluginHook:s}){if(!s)return;const{t:i}=En(e),[a,l]=lt(r??""),{dispose:c,element:u}=s.createComponent(r??"",{onChange(p){l(p)},getLanguage:e}),f=n.createModalDialog({content:u,footer:[(()=>{var p=Hm();return p.$$click=()=>{f.close({action:"remove"}),c()},he(p,(()=>i("remove"))),p})(),(()=>{var p=zm();return p.$$click=()=>{f.close(),c()},he(p,(()=>i("cancel"))),p})(),(()=>{var p=jm();return p.$$click=()=>{f.close({action:t,value:a()??""}),c()},he(p,(()=>i("validate"))),p})()],header:i("videoPlugin.dialog.title")});return await f.open()}Ns(["click"]);function Km(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(Rs(n)??0,r,"link",t)}function dl({editor:n,values:e,service:t,index:r,language:s}){const{t:i}=En(s),a=r??Rs(n);if(a===void 0){t.showToast(i("editorFocusLost"),{severity:"warn"});return}n.insertEmbed(a,"img",e)}function pi(n){const e=Rs(n)??0,[t]=n.getLeaf(e);if(!t)throw new Error("editor.getLeaf() returns undefined");return t.domNode}function hl({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 fl({values:n,editor:e,index:t}){e.insertText(t,n,"internal-link-plugin",n)}function gl({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 Rs(n){const e=n.getSelection();if(e!==null)return e.index+e.length}function Gm(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[,l]=a;return l}function Vm(n){const e=pl(n);return{imageSize:n.dataset.variant,align:e}}function pl(n){const e=n.classList;if(e.contains("center"))return"center";if(e.contains("left"))return"left";if(e.contains("right"))return"right"}function Wm(n){if(n==="center")return"center";if(n==="left")return"left";if(n==="right")return"right"}async function Zm({editor:n,htmlSnippetBtn:e,service:t,language:r}){const s=e.dataset.html,i=await al({service:t,html:s,mode:"update",language:r});i&&Zr({editor:n,element:e,data:i,insertElementHandler:hl,service:t,language:r})}async function Ym({editor:n,internalLinkElement:e,language:t,service:r,internalLinkPluginHook:s}){const i=e.dataset.documentId,a=await ol({language:t,value:i,internalLinkPluginHook:s});if(!a)return;const l=A.find(e);if(!l||l instanceof A)throw new Error("missing link blot");if(a.action==="update"){if(!a.value)return;const c=n.getIndex(l);l.deleteAt(0,l.length()),fl({values:a.value,editor:n,index:c})}else a.action==="remove"&&l.deleteAt(0,l.length())}async function Qm({editor:n,videoElement:e,language:t,service:r,videoPluginHook:s}){const i=e.dataset.videoId,a=await ul({service:r,language:t,mode:"update",value:i,videoPluginHook:s});a&&Zr({editor:n,element:e,data:{action:a.action,values:a.value},insertElementHandler:gl,service:r,language:t})}async function ml({obfuscatorSpan:n,service:e,language:t,editor:r}){const s=n.innerText,i=n.dataset.asALink?cl(n.dataset.asALink):void 0,a=await Fm({service:e,language:t,value:{content:s,asALink:i?i!=="raw":!1}});if(!a)return;const l=A.find(n);if(!l||l instanceof A)throw new Error("missing embed blot");const c=r.getIndex(l);a.action==="remove"&&(l.remove(),r.insertText(c,s)),a.action==="update"&&(l.remove(),r.insertText(c,a.content??"",{obfuscate:a.asALink??"raw"}))}async function Xm({element:n,editor:e,themeConf:t,service:r,language:s}){if(!n.querySelector("img"))return;const a=Gm(n),{align:l,imageSize:c}=Vm(n),u=await Mm({imageSize:c,align:l,imageUid:a,themeConf:t,width:Hi(n.getAttribute("width")),height:Hi(n.getAttribute("height")),zoom:n.dataset.zoom!=="none",href:n.dataset.href,service:r,language:s});u&&Zr({editor:e,element:n,data:u,insertElementHandler:dl,service:r,language:s})}function Jm({quillEditor:n,service:e,language:t,videoPluginHook:r,internalLinkPluginHook:s}){const{themeConf:i,useImage:a}=e;return{insertHtmlSnippetHandler:async h=>{if(!n)return;const g=pi(n);await tb({editorContent:g,quillEditor:n,service:e,language:t})},insertMedia:async h=>{if(!n)return;if(!rb(h)){Km(n,{label:h.originalName,url:h.url});return}const g=i.fTextImages[0],{displaySize:_}=g,y="center",{url:N,displayWidth:T,displayHeight:L}=await a(h.uid,_);dl({editor:n,values:{uid:h.uid,src:N,width:T,height:L,variant:_,align:y},service:e,language:t})},insertObfuscateBlotHandler:()=>{if(!n)return;const h=n.getSelection();!h||h.length===0||eb({userSelection:h,quillEditor:n,service:e,language:t})},insertVideoHandler:async()=>{if(!n)return;const h=pi(n);await bl({editorContent:h,quillEditor:n,service:e,language:t,videoPluginHook:r})},insertInternalLinkHandler:async()=>{if(!n)return;const h=Rs(n);h!==void 0&&await nb({quillEditor:n,service:e,language:t,internalLinkPluginHook:s,index:h})}}}async function eb({userSelection:n,quillEditor:e,language:t,service:r}){const s=e.getText(n.index,n.length),i=Bm(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 l of a)if(l.innerText===s){await ml({obfuscatorSpan:l,service:r,language:t,editor:e});break}}async function tb({editorContent:n,quillEditor:e,service:t,language:r}){const s=await al({service:t,language:r,mode:"insert"});s&&Zr({editor:e,element:n,data:s,insertElementHandler:hl,service:t,language:r})}async function bl({editorContent:n,quillEditor:e,service:t,language:r,videoPluginHook:s,value:i}){const a=await ul({service:t,language:r,mode:i?"update":"insert",value:i,videoPluginHook:s});!a||a.action==="remove"||Zr({editor:e,element:n,data:{action:a.action,values:a.value,updateOptions:{textToReplaceLength:i?.length}},insertElementHandler:gl,service:t,language:r})}async function nb({quillEditor:n,service:e,language:t,internalLinkPluginHook:r,value:s,index:i}){const a=await ol({language:t,value:s,internalLinkPluginHook:r});!a||a.action==="remove"||!a.value||fl({editor:n,values:a.value,index:i})}function Zr({editor:n,element:e,data:{values:t,action:r,updateOptions:s},insertElementHandler:i,service:a,language:l}){const c=A.find(e);if(!c||c instanceof A)throw new Error("missing embed blot");const u=n.getIndex(c),f=new K;if(!(u===void 0||u===-1)){if(r==="insert"){if(!t)return;i({editor:n,values:t,service:a,index:u,language:l})}else if(r==="update"){if(!t)return;i({editor:n,values:t,service:a,index:u,language:l}),f.retain(u+1),f.delete(s?.textToReplaceLength??1)}else r==="remove"&&(f.retain(u),f.delete(1));n.updateContents(f)}}function rb(n){return"width"in n&&"height"in n}var Ys,Wa;function sb(){if(Wa)return Ys;Wa=1;function n(m){return m instanceof Map?m.clear=m.delete=m.set=function(){throw new Error("map is read-only")}:m instanceof Set&&(m.add=m.clear=m.delete=function(){throw new Error("set is read-only")}),Object.freeze(m),Object.getOwnPropertyNames(m).forEach((S=>{const $=m[S],re=typeof $;(re==="object"||re==="function")&&!Object.isFrozen($)&&n($)})),m}class e{constructor(S){S.data===void 0&&(S.data={}),this.data=S.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function t(m){return m.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(m,...S){const $=Object.create(null);for(const re in m)$[re]=m[re];return S.forEach((function(re){for(const Te in re)$[Te]=re[Te]})),$}const s="</span>",i=m=>!!m.scope,a=(m,{prefix:S})=>{if(m.startsWith("language:"))return m.replace("language:","language-");if(m.includes(".")){const $=m.split(".");return[`${S}${$.shift()}`,...$.map(((re,Te)=>`${re}${"_".repeat(Te+1)}`))].join(" ")}return`${S}${m}`};class l{constructor(S,$){this.buffer="",this.classPrefix=$.classPrefix,S.walk(this)}addText(S){this.buffer+=t(S)}openNode(S){if(!i(S))return;const $=a(S.scope,{prefix:this.classPrefix});this.span($)}closeNode(S){i(S)&&(this.buffer+=s)}value(){return this.buffer}span(S){this.buffer+=`<span class="${S}">`}}const c=(m={})=>{const S={children:[]};return Object.assign(S,m),S};class u{constructor(){this.rootNode=c(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(S){this.top.children.push(S)}openNode(S){const $=c({scope:S});this.add($),this.stack.push($)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(S){return this.constructor._walk(S,this.rootNode)}static _walk(S,$){return typeof $=="string"?S.addText($):$.children&&(S.openNode($),$.children.forEach((re=>this._walk(S,re))),S.closeNode($)),S}static _collapse(S){typeof S!="string"&&S.children&&(S.children.every(($=>typeof $=="string"))?S.children=[S.children.join("")]:S.children.forEach(($=>{u._collapse($)})))}}class f extends u{constructor(S){super(),this.options=S}addText(S){S!==""&&this.add(S)}startScope(S){this.openNode(S)}endScope(){this.closeNode()}__addSublanguage(S,$){const re=S.root;$&&(re.scope=`language:${$}`),this.add(re)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(m){return m?typeof m=="string"?m:m.source:null}function h(m){return y("(?=",m,")")}function g(m){return y("(?:",m,")*")}function _(m){return y("(?:",m,")?")}function y(...m){return m.map(($=>p($))).join("")}function N(m){const S=m[m.length-1];return typeof S=="object"&&S.constructor===Object?(m.splice(m.length-1,1),S):{}}function T(...m){return"("+(N(m).capture?"":"?:")+m.map((re=>p(re))).join("|")+")"}function L(m){return new RegExp(m.toString()+"|").exec("").length-1}function R(m,S){const $=m&&m.exec(S);return $&&$.index===0}const F=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function P(m,{joinWith:S}){let $=0;return m.map((re=>{$+=1;const Te=$;let Ce=p(re),z="";for(;Ce.length>0;){const j=F.exec(Ce);if(!j){z+=Ce;break}z+=Ce.substring(0,j.index),Ce=Ce.substring(j.index+j[0].length),j[0][0]==="\\"&&j[1]?z+="\\"+String(Number(j[1])+Te):(z+=j[0],j[0]==="("&&$++)}return z})).map((re=>`(${re})`)).join(S)}const V=/\b\B/,U="[a-zA-Z]\\w*",ee="[a-zA-Z_]\\w*",ce="\\b\\d+(\\.\\d+)?",pe="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",b="\\b(0b[01]+)",x="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",v=(m={})=>{const S=/^#![ ]*\//;return m.binary&&(m.begin=y(S,/.*\b/,m.binary,/\b.*/)),r({scope:"meta",begin:S,end:/$/,relevance:0,"on:begin":($,re)=>{$.index!==0&&re.ignoreMatch()}},m)},C={begin:"\\\\[\\s\\S]",relevance:0},k={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[C]},O={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[C]},B={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/},M=function(m,S,$={}){const re=r({scope:"comment",begin:m,end:S,contains:[]},$);re.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 Te=T("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 re.contains.push({begin:y(/[ ]+/,"(",Te,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),re},H=M("//","$"),q=M("/\\*","\\*/"),te=M("#","$"),J={scope:"number",begin:ce,relevance:0},ie={scope:"number",begin:pe,relevance:0},de={scope:"number",begin:b,relevance:0},X={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[C,{begin:/\[/,end:/\]/,relevance:0,contains:[C]}]},Oe={scope:"title",begin:U,relevance:0},Le={scope:"title",begin:ee,relevance:0},le={begin:"\\.\\s*"+ee,relevance:0};var fe=Object.freeze({__proto__:null,APOS_STRING_MODE:k,BACKSLASH_ESCAPE:C,BINARY_NUMBER_MODE:de,BINARY_NUMBER_RE:b,COMMENT:M,C_BLOCK_COMMENT_MODE:q,C_LINE_COMMENT_MODE:H,C_NUMBER_MODE:ie,C_NUMBER_RE:pe,END_SAME_AS_BEGIN:function(m){return Object.assign(m,{"on:begin":(S,$)=>{$.data._beginMatch=S[1]},"on:end":(S,$)=>{$.data._beginMatch!==S[1]&&$.ignoreMatch()}})},HASH_COMMENT_MODE:te,IDENT_RE:U,MATCH_NOTHING_RE:V,METHOD_GUARD:le,NUMBER_MODE:J,NUMBER_RE:ce,PHRASAL_WORDS_MODE:B,QUOTE_STRING_MODE:O,REGEXP_MODE:X,RE_STARTERS_RE:x,SHEBANG:v,TITLE_MODE:Oe,UNDERSCORE_IDENT_RE:ee,UNDERSCORE_TITLE_MODE:Le});function Ee(m,S){m.input[m.index-1]==="."&&S.ignoreMatch()}function ve(m,S){m.className!==void 0&&(m.scope=m.className,delete m.className)}function Ne(m,S){S&&m.beginKeywords&&(m.begin="\\b("+m.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",m.__beforeBegin=Ee,m.keywords=m.keywords||m.beginKeywords,delete m.beginKeywords,m.relevance===void 0&&(m.relevance=0))}function De(m,S){Array.isArray(m.illegal)&&(m.illegal=T(...m.illegal))}function ze(m,S){if(m.match){if(m.begin||m.end)throw new Error("begin & end are not supported with match");m.begin=m.match,delete m.match}}function yn(m,S){m.relevance===void 0&&(m.relevance=1)}const Hn=(m,S)=>{if(!m.beforeMatch)return;if(m.starts)throw new Error("beforeMatch cannot be used with starts");const $=Object.assign({},m);Object.keys(m).forEach((re=>{delete m[re]})),m.keywords=$.keywords,m.begin=y($.beforeMatch,h($.begin)),m.starts={relevance:0,contains:[Object.assign($,{endsParent:!0})]},m.relevance=0,delete $.beforeMatch},fr=["of","and","for","in","not","or","if","then","parent","list","value"],gr="keyword";function Pt(m,S,$=gr){const re=Object.create(null);return typeof m=="string"?Te($,m.split(" ")):Array.isArray(m)?Te($,m):Object.keys(m).forEach((function(Ce){Object.assign(re,Pt(m[Ce],S,Ce))})),re;function Te(Ce,z){S&&(z=z.map((j=>j.toLowerCase()))),z.forEach((function(j){const se=j.split("|");re[se[0]]=[Ce,_n(se[0],se[1])]}))}}function _n(m,S){return S?Number(S):zn(m)?0:1}function zn(m){return fr.includes(m.toLowerCase())}const vn={},je=m=>{console.error(m)},Ut=(m,...S)=>{console.log(`WARN: ${m}`,...S)},It=(m,S)=>{vn[`${m}/${S}`]||(console.log(`Deprecated as of ${m}. ${S}`),vn[`${m}/${S}`]=!0)},ut=new Error;function Ft(m,S,{key:$}){let re=0;const Te=m[$],Ce={},z={};for(let j=1;j<=S.length;j++)z[j+re]=Te[j],Ce[j+re]=!0,re+=L(S[j-1]);m[$]=z,m[$]._emit=Ce,m[$]._multi=!0}function Nn(m){if(Array.isArray(m.begin)){if(m.skip||m.excludeBegin||m.returnBegin)throw je("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ut;if(typeof m.beginScope!="object"||m.beginScope===null)throw je("beginScope must be object"),ut;Ft(m,m.begin,{key:"beginScope"}),m.begin=P(m.begin,{joinWith:""})}}function rt(m){if(Array.isArray(m.end)){if(m.skip||m.excludeEnd||m.returnEnd)throw je("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ut;if(typeof m.endScope!="object"||m.endScope===null)throw je("endScope must be object"),ut;Ft(m,m.end,{key:"endScope"}),m.end=P(m.end,{joinWith:""})}}function jn(m){m.scope&&typeof m.scope=="object"&&m.scope!==null&&(m.beginScope=m.scope,delete m.scope)}function Kn(m){jn(m),typeof m.beginScope=="string"&&(m.beginScope={_wrap:m.beginScope}),typeof m.endScope=="string"&&(m.endScope={_wrap:m.endScope}),Nn(m),rt(m)}function pr(m){function S(z,j){return new RegExp(p(z),"m"+(m.case_insensitive?"i":"")+(m.unicodeRegex?"u":"")+(j?"g":""))}class ${constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(j,se){se.position=this.position++,this.matchIndexes[this.matchAt]=se,this.regexes.push([se,j]),this.matchAt+=L(j)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const j=this.regexes.map((se=>se[1]));this.matcherRe=S(P(j,{joinWith:"|"}),!0),this.lastIndex=0}exec(j){this.matcherRe.lastIndex=this.lastIndex;const se=this.matcherRe.exec(j);if(!se)return null;const Be=se.findIndex(((_t,$e)=>$e>0&&_t!==void 0)),Re=this.matchIndexes[Be];return se.splice(0,Be),Object.assign(se,Re)}}class re{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(j){if(this.multiRegexes[j])return this.multiRegexes[j];const se=new $;return this.rules.slice(j).forEach((([Be,Re])=>se.addRule(Be,Re))),se.compile(),this.multiRegexes[j]=se,se}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(j,se){this.rules.push([j,se]),se.type==="begin"&&this.count++}exec(j){const se=this.getMatcher(this.regexIndex);se.lastIndex=this.lastIndex;let Be=se.exec(j);if(this.resumingScanAtSamePosition()&&!(Be&&Be.index===this.lastIndex)){const Re=this.getMatcher(0);Re.lastIndex=this.lastIndex+1,Be=Re.exec(j)}return Be&&(this.regexIndex+=Be.position+1,this.regexIndex===this.count&&this.considerAll()),Be}}function Te(z){const j=new re;return z.contains.forEach((se=>j.addRule(se.begin,{rule:se,type:"begin"}))),z.terminatorEnd&&j.addRule(z.terminatorEnd,{type:"end"}),z.illegal&&j.addRule(z.illegal,{type:"illegal"}),j}function Ce(z,j){const se=z;if(z.isCompiled)return se;[ve,ze,Kn,Hn].forEach((Re=>Re(z,j))),m.compilerExtensions.forEach((Re=>Re(z,j))),z.__beforeBegin=null,[Ne,De,yn].forEach((Re=>Re(z,j))),z.isCompiled=!0;let Be=null;return typeof z.keywords=="object"&&z.keywords.$pattern&&(z.keywords=Object.assign({},z.keywords),Be=z.keywords.$pattern,delete z.keywords.$pattern),Be=Be||/\w+/,z.keywords&&(z.keywords=Pt(z.keywords,m.case_insensitive)),se.keywordPatternRe=S(Be,!0),j&&(z.begin||(z.begin=/\B|\b/),se.beginRe=S(se.begin),!z.end&&!z.endsWithParent&&(z.end=/\B|\b/),z.end&&(se.endRe=S(se.end)),se.terminatorEnd=p(se.end)||"",z.endsWithParent&&j.terminatorEnd&&(se.terminatorEnd+=(z.end?"|":"")+j.terminatorEnd)),z.illegal&&(se.illegalRe=S(z.illegal)),z.contains||(z.contains=[]),z.contains=[].concat(...z.contains.map((function(Re){return Xt(Re==="self"?z:Re)}))),z.contains.forEach((function(Re){Ce(Re,se)})),z.starts&&Ce(z.starts,j),se.matcher=Te(se),se}if(m.compilerExtensions||(m.compilerExtensions=[]),m.contains&&m.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return m.classNameAliases=r(m.classNameAliases||{}),Ce(m)}function Qt(m){return m?m.endsWithParent||Qt(m.starts):!1}function Xt(m){return m.variants&&!m.cachedVariants&&(m.cachedVariants=m.variants.map((function(S){return r(m,{variants:null},S)}))),m.cachedVariants?m.cachedVariants:Qt(m)?r(m,{starts:m.starts?r(m.starts):null}):Object.isFrozen(m)?r(m):m}var Gn="11.10.0";class Jt extends Error{constructor(S,$){super(S),this.name="HTMLInjectionError",this.html=$}}const yt=t,st=r,Ht=Symbol("nomatch"),Tn=7,Rt=function(m){const S=Object.create(null),$=Object.create(null),re=[];let Te=!0;const Ce="Could not find the language '{}', did you forget to load/include a language module?",z={disableAutodetect:!0,name:"Plain text",contains:[]};let j={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:f};function se(I){return j.noHighlightRe.test(I)}function Be(I){let Y=I.className+" ";Y+=I.parentNode?I.parentNode.className:"";const ue=j.languageDetectRe.exec(Y);if(ue){const Ae=ht(ue[1]);return Ae||(Ut(Ce.replace("{}",ue[1])),Ut("Falling back to no-highlight mode for this block.",I)),Ae?ue[1]:"no-highlight"}return Y.split(/\s+/).find((Ae=>se(Ae)||ht(Ae)))}function Re(I,Y,ue){let Ae="",Me="";typeof Y=="object"?(Ae=I,ue=Y.ignoreIllegals,Me=Y.language):(It("10.7.0","highlight(lang, code, ...args) has been deprecated."),It("10.7.0",`Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277`),Me=I,Ae=Y),ue===void 0&&(ue=!0);const tt={code:Ae,language:Me};zt("before:highlight",tt);const ft=tt.result?tt.result:_t(tt.language,tt.code,ue);return ft.code=tt.code,zt("after:highlight",ft),ft}function _t(I,Y,ue,Ae){const Me=Object.create(null);function tt(D,W){return D.keywords[W]}function ft(){if(!ne.keywords){xe.addText(Se);return}let D=0;ne.keywordPatternRe.lastIndex=0;let W=ne.keywordPatternRe.exec(Se),ae="";for(;W;){ae+=Se.substring(D,W.index);const ge=Ve.case_insensitive?W[0].toLowerCase():W[0],qe=tt(ne,ge);if(qe){const[Qe,xr]=qe;if(xe.addText(ae),ae="",Me[ge]=(Me[ge]||0)+1,Me[ge]<=Tn&&(sn+=xr),Qe.startsWith("_"))ae+=W[0];else{const Jn=Ve.classNameAliases[Qe]||Qe;Ge(W[0],Jn)}}else ae+=W[0];D=ne.keywordPatternRe.lastIndex,W=ne.keywordPatternRe.exec(Se)}ae+=Se.substring(D),xe.addText(ae)}function vt(){if(Se==="")return;let D=null;if(typeof ne.subLanguage=="string"){if(!S[ne.subLanguage]){xe.addText(Se);return}D=_t(ne.subLanguage,Se,!0,Xn[ne.subLanguage]),Xn[ne.subLanguage]=D._top}else D=An(Se,ne.subLanguage.length?ne.subLanguage:null);ne.relevance>0&&(sn+=D.relevance),xe.__addSublanguage(D._emitter,D.language)}function Ue(){ne.subLanguage!=null?vt():ft(),Se=""}function Ge(D,W){D!==""&&(xe.startScope(W),xe.addText(D),xe.endScope())}function Sn(D,W){let ae=1;const ge=W.length-1;for(;ae<=ge;){if(!D._emit[ae]){ae++;continue}const qe=Ve.classNameAliases[D[ae]]||D[ae],Qe=W[ae];qe?Ge(Qe,qe):(Se=Qe,ft(),Se=""),ae++}}function xn(D,W){return D.scope&&typeof D.scope=="string"&&xe.openNode(Ve.classNameAliases[D.scope]||D.scope),D.beginScope&&(D.beginScope._wrap?(Ge(Se,Ve.classNameAliases[D.beginScope._wrap]||D.beginScope._wrap),Se=""):D.beginScope._multi&&(Sn(D.beginScope,W),Se="")),ne=Object.create(D,{parent:{value:ne}}),ne}function Yn(D,W,ae){let ge=R(D.endRe,ae);if(ge){if(D["on:end"]){const qe=new e(D);D["on:end"](W,qe),qe.isMatchIgnored&&(ge=!1)}if(ge){for(;D.endsParent&&D.parent;)D=D.parent;return D}}if(D.endsWithParent)return Yn(D.parent,W,ae)}function Ar(D){return ne.matcher.regexIndex===0?(Se+=D[0],1):(an=!0,0)}function wr(D){const W=D[0],ae=D.rule,ge=new e(ae),qe=[ae.__beforeBegin,ae["on:begin"]];for(const Qe of qe)if(Qe&&(Qe(D,ge),ge.isMatchIgnored))return Ar(W);return ae.skip?Se+=W:(ae.excludeBegin&&(Se+=W),Ue(),!ae.returnBegin&&!ae.excludeBegin&&(Se=W)),xn(ae,D),ae.returnBegin?0:W.length}function Sr(D){const W=D[0],ae=Y.substring(D.index),ge=Yn(ne,D,ae);if(!ge)return Ht;const qe=ne;ne.endScope&&ne.endScope._wrap?(Ue(),Ge(W,ne.endScope._wrap)):ne.endScope&&ne.endScope._multi?(Ue(),Sn(ne.endScope,D)):qe.skip?Se+=W:(qe.returnEnd||qe.excludeEnd||(Se+=W),Ue(),qe.excludeEnd&&(Se=W));do{ne.scope&&xe.closeNode(),!ne.skip&&!ne.subLanguage&&(sn+=ne.relevance),ne=ne.parent}while(ne!==ge.parent);return ge.starts&&xn(ge.starts,D),qe.returnEnd?0:W.length}function On(){const D=[];for(let W=ne;W!==Ve;W=W.parent)W.scope&&D.unshift(W.scope);D.forEach((W=>xe.openNode(W)))}let rn={};function Qn(D,W){const ae=W&&W[0];if(Se+=D,ae==null)return Ue(),0;if(rn.type==="begin"&&W.type==="end"&&rn.index===W.index&&ae===""){if(Se+=Y.slice(W.index,W.index+1),!Te){const ge=new Error(`0 width match regex (${I})`);throw ge.languageName=I,ge.badRule=rn.rule,ge}return 1}if(rn=W,W.type==="begin")return wr(W);if(W.type==="illegal"&&!ue){const ge=new Error('Illegal lexeme "'+ae+'" for mode "'+(ne.scope||"<unnamed>")+'"');throw ge.mode=ne,ge}else if(W.type==="end"){const ge=Sr(W);if(ge!==Ht)return ge}if(W.type==="illegal"&&ae==="")return 1;if(Ln>1e5&&Ln>W.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Se+=ae,ae.length}const Ve=ht(I);if(!Ve)throw je(Ce.replace("{}",I)),new Error('Unknown language: "'+I+'"');const at=pr(Ve);let ot="",ne=Ae||at;const Xn={},xe=new j.__emitter(j);On();let Se="",sn=0,Nt=0,Ln=0,an=!1;try{if(Ve.__emitTokens)Ve.__emitTokens(Y,xe);else{for(ne.matcher.considerAll();;){Ln++,an?an=!1:ne.matcher.considerAll(),ne.matcher.lastIndex=Nt;const D=ne.matcher.exec(Y);if(!D)break;const W=Y.substring(Nt,D.index),ae=Qn(W,D);Nt=D.index+ae}Qn(Y.substring(Nt))}return xe.finalize(),ot=xe.toHTML(),{language:I,value:ot,relevance:sn,illegal:!1,_emitter:xe,_top:ne}}catch(D){if(D.message&&D.message.includes("Illegal"))return{language:I,value:yt(Y),illegal:!0,relevance:0,_illegalBy:{message:D.message,index:Nt,context:Y.slice(Nt-100,Nt+100),mode:D.mode,resultSoFar:ot},_emitter:xe};if(Te)return{language:I,value:yt(Y),illegal:!1,relevance:0,errorRaised:D,_emitter:xe,_top:ne};throw D}}function $e(I){const Y={value:yt(I),illegal:!1,relevance:0,_top:z,_emitter:new j.__emitter(j)};return Y._emitter.addText(I),Y}function An(I,Y){Y=Y||j.languages||Object.keys(S);const ue=$e(I),Ae=Y.filter(ht).filter(Zn).map((Ue=>_t(Ue,I,!1)));Ae.unshift(ue);const Me=Ae.sort(((Ue,Ge)=>{if(Ue.relevance!==Ge.relevance)return Ge.relevance-Ue.relevance;if(Ue.language&&Ge.language){if(ht(Ue.language).supersetOf===Ge.language)return 1;if(ht(Ge.language).supersetOf===Ue.language)return-1}return 0})),[tt,ft]=Me,vt=tt;return vt.secondBest=ft,vt}function mr(I,Y,ue){const Ae=Y&&$[Y]||ue;I.classList.add("hljs"),I.classList.add(`language-${Ae}`)}function wn(I){let Y=null;const ue=Be(I);if(se(ue))return;if(zt("before:highlightElement",{el:I,language:ue}),I.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",I);return}if(I.children.length>0&&(j.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(I)),j.throwUnescapedHTML))throw new Jt("One of your code blocks includes unescaped HTML.",I.innerHTML);Y=I;const Ae=Y.textContent,Me=ue?Re(Ae,{language:ue,ignoreIllegals:!0}):An(Ae);I.innerHTML=Me.value,I.dataset.highlighted="yes",mr(I,ue,Me.language),I.result={language:Me.language,re:Me.relevance,relevance:Me.relevance},Me.secondBest&&(I.secondBest={language:Me.secondBest.language,relevance:Me.secondBest.relevance}),zt("after:highlightElement",{el:I,result:Me,text:Ae})}function br(I){j=st(j,I)}const Er=()=>{en(),It("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ke(){en(),It("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Vn=!1;function en(){if(document.readyState==="loading"){Vn=!0;return}document.querySelectorAll(j.cssSelector).forEach(wn)}function yr(){Vn&&en()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",yr,!1);function _r(I,Y){let ue=null;try{ue=Y(m)}catch(Ae){if(je("Language definition for '{}' could not be registered.".replace("{}",I)),Te)je(Ae);else throw Ae;ue=z}ue.name||(ue.name=I),S[I]=ue,ue.rawDefinition=Y.bind(null,m),ue.aliases&&Wn(ue.aliases,{languageName:I})}function vr(I){delete S[I];for(const Y of Object.keys($))$[Y]===I&&delete $[Y]}function Ye(){return Object.keys(S)}function ht(I){return I=(I||"").toLowerCase(),S[I]||S[$[I]]}function Wn(I,{languageName:Y}){typeof I=="string"&&(I=[I]),I.forEach((ue=>{$[ue.toLowerCase()]=Y}))}function Zn(I){const Y=ht(I);return Y&&!Y.disableAutodetect}function Nr(I){I["before:highlightBlock"]&&!I["before:highlightElement"]&&(I["before:highlightElement"]=Y=>{I["before:highlightBlock"](Object.assign({block:Y.el},Y))}),I["after:highlightBlock"]&&!I["after:highlightElement"]&&(I["after:highlightElement"]=Y=>{I["after:highlightBlock"](Object.assign({block:Y.el},Y))})}function Tr(I){Nr(I),re.push(I)}function tn(I){const Y=re.indexOf(I);Y!==-1&&re.splice(Y,1)}function zt(I,Y){const ue=I;re.forEach((function(Ae){Ae[ue]&&Ae[ue](Y)}))}function nn(I){return It("10.7.0","highlightBlock will be removed entirely in v12.0"),It("10.7.0","Please use highlightElement now."),wn(I)}Object.assign(m,{highlight:Re,highlightAuto:An,highlightAll:en,highlightElement:wn,highlightBlock:nn,configure:br,initHighlighting:Er,initHighlightingOnLoad:Ke,registerLanguage:_r,unregisterLanguage:vr,listLanguages:Ye,getLanguage:ht,registerAliases:Wn,autoDetection:Zn,inherit:st,addPlugin:Tr,removePlugin:tn}),m.debugMode=function(){Te=!1},m.safeMode=function(){Te=!0},m.versionString=Gn,m.regex={concat:y,lookahead:h,either:T,optional:_,anyNumberOfTimes:g};for(const I in fe)typeof fe[I]=="object"&&n(fe[I]);return Object.assign(m,fe),m},dt=Rt({});return dt.newInstance=()=>Rt({}),Ys=dt,dt.HighlightJS=dt,dt.default=dt,Ys}var ib=sb();const He=wi(ib);function ab(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"})]}},l={className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,t,s]};s.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},f={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},n.NUMBER_MODE,t]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],g=n.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),_={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[n.inherit(n.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},y=["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],N=["true","false"],T={match:/(\/[a-z._-]+)+/},L=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],R=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],F=["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"],P=["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:y,literal:N,built_in:[...L,...R,"set","shopt",...F,...P]},contains:[g,n.SHEBANG(),_,p,i,a,T,l,c,u,f,t]}}function ob(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("<[^<>]+>")+")",l={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})"/})]},f={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]},h={className:"title",begin:e.optional(s)+n.IDENT_RE,relevance:0},g=e.optional(s)+n.IDENT_RE+"\\s*\\(",N={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"},T=[p,l,t,n.C_BLOCK_COMMENT_MODE,f,u],L={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:N,contains:T.concat([{begin:/\(/,end:/\)/,keywords:N,contains:T.concat(["self"]),relevance:0}]),relevance:0},R={begin:"("+a+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:N,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:N,relevance:0},{begin:g,returnBegin:!0,contains:[n.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,u,f,l,{begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,u,f,l]}]},l,t,n.C_BLOCK_COMMENT_MODE,p]};return{name:"C",aliases:["h"],keywords:N,disableAutodetect:!0,illegal:"</",contains:[].concat(L,R,T,[p,{begin:n.IDENT_RE+"::",keywords:N},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},n.TITLE_MODE]}]),exports:{preprocessor:p,strings:u,keywords:N}}}function lb(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("<[^<>]+>")+")",l={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})"/})]},f={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]},h={className:"title",begin:e.optional(s)+n.IDENT_RE,relevance:0},g=e.optional(s)+n.IDENT_RE+"\\s*\\(",_=["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"],y=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],N=["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"],T=["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"],F={type:y,keyword:_,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:N},P={className:"function.dispatch",relevance:0,keywords:{_hint:T},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,n.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},V=[P,p,l,t,n.C_BLOCK_COMMENT_MODE,f,u],U={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:F,contains:V.concat([{begin:/\(/,end:/\)/,keywords:F,contains:V.concat(["self"]),relevance:0}]),relevance:0},ee={className:"function",begin:"("+a+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:F,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:F,relevance:0},{begin:g,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:F,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,u,f,l,{begin:/\(/,end:/\)/,keywords:F,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,u,f,l]}]},l,t,n.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:F,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(U,ee,P,V,[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:F,contains:["self",l]},{begin:n.IDENT_RE+"::",keywords:F},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function cb(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},l=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},f={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=n.inherit(f,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:a},g=n.inherit(h,{illegal:/\n/}),_={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},n.BACKSLASH_ESCAPE,g]},y={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},N=n.inherit(y,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},g]});h.contains=[y,_,f,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,c,n.C_BLOCK_COMMENT_MODE],g.contains=[N,_,p,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,c,n.inherit(n.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const T={variants:[u,y,_,f,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},L={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},R=n.IDENT_RE+"(<"+n.IDENT_RE+"(\\s*,\\s*"+n.IDENT_RE+")*>)?(\\[\\])?",F={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"}},T,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,L,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,L,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:"("+R+"\\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,L],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[T,c,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},F]}}const ub=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_-]*/}}),db=["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"],hb=["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"],fb=[...db,...hb],gb=["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(),pb=["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(),mb=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),bb=["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 Eb(n){const e=n.regex,t=ub(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_-]*",l=[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:":("+pb.join("|")+")"},{begin:":(:)?("+mb.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+bb.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{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:gb.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+fb.join("|")+")\\b"}]}}var ir="[0-9](_*[0-9])*",us=`\\.(${ir})`,ds="[0-9a-fA-F](_*[0-9a-fA-F])*",Za={className:"number",variants:[{begin:`(\\b(${ir})((${us})|\\.)?|(${us}))[eE][+-]?(${ir})[fFdD]?\\b`},{begin:`\\b(${ir})((${us})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${us})[fFdD]?\\b`},{begin:`\\b(${ir})[fFdD]\\b`},{begin:`\\b0[xX]((${ds})\\.?|(${ds})?\\.(${ds}))[pP][+-]?(${ir})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${ds})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function El(n,e,t){return t===-1?"":n.replace(e,(r=>El(n,e,t-1)))}function yb(n){const e=n.regex,t="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=t+El("(?:<"+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"]}]},f={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:[f,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,Za,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},Za,u]}}const Ya="[A-Za-z$_][0-9A-Za-z$_]*",_b=["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"],vb=["true","false","null","undefined","NaN","Infinity"],yl=["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"],_l=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],vl=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Nb=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Tb=[].concat(vl,yl,_l);function Ab(n){const e=n.regex,t=(M,{after:H})=>{const q="</"+M[0].slice(1);return M.input.indexOf(q,H)!==-1},r=Ya,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,H)=>{const q=M[0].length+M.index,te=M.input[q];if(te==="<"||te===","){H.ignoreMatch();return}te===">"&&(t(M,{after:q})||H.ignoreMatch());let J;const ie=M.input.substring(q);if(J=ie.match(/^\s*=/)){H.ignoreMatch();return}if((J=ie.match(/^\s+extends\s+/))&&J.index===0){H.ignoreMatch();return}}},l={$pattern:Ya,keyword:_b,literal:vb,built_in:Tb,"variable.language":Nb},c="[0-9](_?[0-9])*",u=`\\.(${c})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${f})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${f})\\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},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"css"}},y={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,h]},L={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]},R=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,_,y,N,{match:/\$\d+/},p];h.contains=R.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(R)});const F=[].concat(L,h.contains),P=F.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(F)}]),V={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:P},U={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"}}]},ee={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:{_:[...yl,..._l]}},ce={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},pe={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[V],illegal:/%/},b={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function x(M){return e.concat("(?!",M.join("|"),")")}const v={match:e.concat(/\b/,x([...vl,"super","import"].map((M=>`${M}\\s*\\(`))),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},C={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},k={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},V]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",B={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[V]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),ce,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,_,y,N,L,{match:/\$\d+/},p,ee,{className:"attr",begin:r+e.lookahead(":"),relevance:0},B,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[L,n.REGEXP_MODE,{className:"function",begin:O,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:l,contains:P}]}]},{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"]}]}]},pe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[V,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},C,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[V]},v,b,U,k,{match:/\$[(.]/}]}}function wb(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 Sb(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}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),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}/}]},f={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=n.inherit(u,{contains:[]}),h=n.inherit(f,{contains:[]});u.contains.push(h),f.contains.push(p);let g=[t,c];return[u,f,p,h].forEach((T=>{T.contains=T.contains.concat(g)})),g=g.concat(u,f),{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,f,{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 xb(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:/\?>/}]},l={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(l)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:n.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(v,C)=>{C.data._beginMatch=v[1]||v[2]},"on:end":(v,C)=>{C.data._beginMatch!==v[1]&&C.ignoreMatch()}},p=n.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),h=`[ \t\n]`,g={scope:"string",variants:[u,c,f,p]},_={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},y=["false","null","true"],N=["__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"],T=["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"],R={keyword:N,literal:(v=>{const C=[];return v.forEach((k=>{C.push(k),k.toLowerCase()===k?C.push(k.toUpperCase()):C.push(k.toLowerCase())})),C})(y),built_in:T},F=v=>v.map((C=>C.replace(/\|\d+$/,""))),P={variants:[{match:[/new/,e.concat(h,"+"),e.concat("(?!",F(T).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},V=e.concat(r,"\\b(?!\\()"),U={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),V],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,e.concat(/::/,e.lookahead(/(?!class\b)/)),V],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"}}]},ee={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},ce={relevance:0,begin:/\(/,end:/\)/,keywords:R,contains:[ee,i,U,n.C_BLOCK_COMMENT_MODE,g,_,P]},pe={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",F(N).join("\\b|"),"|",F(T).join("\\b|"),"\\b)"),r,e.concat(h,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[ce]};ce.contains.push(pe);const b=[ee,U,n.C_BLOCK_COMMENT_MODE,g,_,P],x={begin:e.concat(/#\[\s*/,s),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:y,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:y,keyword:["new","array"]},contains:["self",...b]},...b,{scope:"meta",match:s}]};return{case_insensitive:!1,keywords:R,contains:[x,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,pe,U,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},P,{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:R,contains:["self",i,U,n.C_BLOCK_COMMENT_MODE,g,_]}]},{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,_]}}function Ob(n){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Lb(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"],l={$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:l,illegal:/#/},f={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,f,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,c,f,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,f,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,f,u]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",g=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,_=`\\b|${r.join("|")}`,y={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${g}))[eE][+-]?(${h})[jJ]?(?=${_})`},{begin:`(${g})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${_})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${_})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${_})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${_})`},{begin:`\\b(${h})[jJ](?=${_})`}]},N={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},T={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,y,p,n.HASH_COMMENT_MODE]}]};return u.contains=[p,y,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,y,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,N,n.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[T]},{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:[y,T,p]}]}}function Cb(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"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[n.COMMENT("#","$",{contains:[l]}),n.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),n.COMMENT("^__END__",n.MATCH_NOTHING_RE)],f={className:"subst",begin:/#\{/,end:/\}/,keywords:a},p={className:"string",contains:[n.BACKSLASH_ESCAPE,f],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,f]})]}]},h="[1-9](_?[0-9])*|0",g="[0-9](_?[0-9])*",_={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${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"}]},y={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},V=[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:[y]},{begin:n.IDENT_RE+"::"},{className:"symbol",begin:n.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:t}],relevance:0},_,{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,f],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);f.contains=V,y.contains=V;const pe=[{begin:/^\s*=>/,starts:{end:"$",contains:V}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:V}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[n.SHEBANG({binary:"ruby"})].concat(pe).concat(u).concat(V)}}function Ib(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))?",l=["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!"],f=["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:f,keyword:l,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:f}},{className:"punctuation",begin:"->"},i]}}function Rb(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"],l=["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"],f=["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"],h=["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=f,_=[...u,...c].filter((R=>!f.includes(R))),y={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},N={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},T={begin:e.concat(/\b/,e.either(...g),/\s*\(/),relevance:0,keywords:{built_in:g}};function L(R,{exceptions:F,when:P}={}){const V=P;return F=F||[],R.map((U=>U.match(/\|\d+$/)||F.includes(U)?U:V(U)?`${U}|0`:U))}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:L(_,{when:R=>R.length<3}),literal:i,type:l,built_in:p},contains:[{begin:e.either(...h),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:_.concat(h),literal:i,type:l}},{className:"type",begin:e.either(...a)},T,y,r,s,n.C_NUMBER_MODE,n.C_BLOCK_COMMENT_MODE,t,N]}}const vs="[A-Za-z$_][0-9A-Za-z$_]*",Nl=["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"],Tl=["true","false","null","undefined","NaN","Infinity"],Al=["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"],wl=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Sl=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],xl=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ol=[].concat(Sl,Al,wl);function kb(n){const e=n.regex,t=(M,{after:H})=>{const q="</"+M[0].slice(1);return M.input.indexOf(q,H)!==-1},r=vs,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,H)=>{const q=M[0].length+M.index,te=M.input[q];if(te==="<"||te===","){H.ignoreMatch();return}te===">"&&(t(M,{after:q})||H.ignoreMatch());let J;const ie=M.input.substring(q);if(J=ie.match(/^\s*=/)){H.ignoreMatch();return}if((J=ie.match(/^\s+extends\s+/))&&J.index===0){H.ignoreMatch();return}}},l={$pattern:vs,keyword:Nl,literal:Tl,built_in:Ol,"variable.language":xl},c="[0-9](_?[0-9])*",u=`\\.(${c})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${f})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${f})\\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},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"css"}},y={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,h]},L={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]},R=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,_,y,N,{match:/\$\d+/},p];h.contains=R.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(R)});const F=[].concat(L,h.contains),P=F.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(F)}]),V={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:P},U={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"}}]},ee={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:{_:[...Al,...wl]}},ce={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},pe={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[V],illegal:/%/},b={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function x(M){return e.concat("(?!",M.join("|"),")")}const v={match:e.concat(/\b/,x([...Sl,"super","import"].map((M=>`${M}\\s*\\(`))),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},C={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},k={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},V]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",B={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[V]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),ce,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,_,y,N,L,{match:/\$\d+/},p,ee,{className:"attr",begin:r+e.lookahead(":"),relevance:0},B,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[L,n.REGEXP_MODE,{className:"function",begin:O,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:l,contains:P}]}]},{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"]}]}]},pe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[V,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},C,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[V]},v,b,U,k,{match:/\$[(.]/}]}}function Mb(n){const e=kb(n),t=vs,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['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:vs,keyword:Nl.concat(l),literal:Tl,built_in:Ol.concat(r),"variable.language":xl},u={className:"meta",begin:"@"+t},f=(g,_,y)=>{const N=g.contains.findIndex((T=>T.label===_));if(N===-1)throw new Error("can not find mode to replace");g.contains.splice(N,1,y)};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]),f(e,"shebang",n.SHEBANG()),f(e,"use_strict",a);const h=e.contains.find((g=>g.label==="func.def"));return h.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}function Db(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:/\)/}),l=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,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,a,c,l]}]}]},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 Bb(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"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},g={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},_={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},y=[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,_,i],N=[...y];return N.pop(),N.push(a),h.contains=N,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:y}}He.registerLanguage("bash",ab);He.registerLanguage("c",ob);He.registerLanguage("cpp",lb);He.registerLanguage("cs",cb);He.registerLanguage("css",Eb);He.registerLanguage("java",yb);He.registerLanguage("javascript",Ab);He.registerLanguage("json",wb);He.registerLanguage("markdown",Sb);He.registerLanguage("plain",Ob);He.registerLanguage("php",xb);He.registerLanguage("python",Lb);He.registerLanguage("sql",Rb);He.registerLanguage("typescript",Mb);He.registerLanguage("ruby",Cb);He.registerLanguage("rust",Ib);He.registerLanguage("xml",Db);He.registerLanguage("yaml",Bb);const qb=[{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 $b=be("<button type=button><span class=QpTooltip-text>");function hs({children:n,btnClass:e,tooltipText:t,btnText:r}){return(()=>{var s=$b(),i=s.firstChild;return Qs(s,`QpTooltip ${e}`),he(s,n,i),he(s,r,i),he(i,t),s})()}var Pb=be("<button type=button class=ql-code>"),Ub=be("<button type=button class=ql-code-block>"),Fb=be('<span class="pi pi-hashtag">'),Hb=be('<span class="pi pi-pencil">'),zb=be("<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>"),jb=be('<span class="pi pi-youtube">'),Kb=be('<span class="pi pi-link">');function Gb({language:n,configuration:e,videoPluginHook:t,internalLinkPluginHook:r}){const{t:s}=En(n),i=[Pb(),(()=>{var a=Ub();return a.style.setProperty("border","1px dotted #999"),a})()];return(()=>{var a=zb(),l=a.firstChild,c=l.nextSibling,u=c.nextSibling,f=u.nextSibling,p=f.nextSibling,h=p.nextSibling,g=h.nextSibling,_=g.nextSibling,y=_.nextSibling,N=y.nextSibling,T=N.nextSibling;return he(a,(()=>e?.code&&i),y),he(a,Mt(hs,{btnClass:"ql-html-snippet",get tooltipText(){return s("CustomToolbar.insertHtmlSnippetMessage")},get children(){return Fb()}}),T),he(a,Mt(hs,{btnClass:"ql-obfuscate",get tooltipText(){return s("CustomToolbar.obfuscate")},get children(){return Hb()}}),T),he(a,t&&Mt(hs,{btnClass:"ql-video-plugin",get tooltipText(){return s("videoPlugin.insertVideo")},get children(){return jb()}}),T),he(a,r&&Mt(hs,{btnClass:"ql-internal-link-plugin",get tooltipText(){return s("internalLinkPlugin.insertLink")},get children(){return Kb()}}),T),a})()}var Vb=be("<div>"),Wb=be("<div class=QuillEditor>");function Zb({onSetQuillInst:n,language:e,setValue:t,value:r,service:s,insertMedia:i,videoPluginHook:a,internalLinkPluginHook:l}){const{t:c}=En(e),u=s.configuration,p=s.fieldType.backOffice?.editorRows??26,h=Gb({language:e,configuration:u,videoPluginHook:a,internalLinkPluginHook:l}),g=(()=>{var y=Vb();return`calc(${p}rem + 24px)`!=null?y.style.setProperty("height",`calc(${p}rem + 24px)`):y.style.removeProperty("height"),y})();async function _(y,N){if(!s.uploadMedia)return;const T=N.toBlob(),L=new File([T],`${c("image")}-${(new Date).getTime()}.${y.split("/")[1]}`,{type:y}),R=await s.uploadMedia(L);R&&i(R)}return Ll((()=>{A.register("modules/imageDropAndPaste",Is,!0);const y=new A(g,{modules:{toolbar:h,syntax:u.code?{hljs:He,languages:qb,interval:1e3}:!1,imageDropAndPaste:{handler:(T,L,R)=>{_(L,R).catch(s.logger.error)}}},theme:"snow"});y.on("text-change",((T,L,R)=>{if(R!=="user")return;T.ops.forEach((async P=>{if(P.insert&&typeof P.insert=="string"){const V=P.insert;if(!a?.recognizeUrl(V))return;const ee=pi(y);await bl({editorContent:ee,quillEditor:y,service:s,language:e,videoPluginHook:a,value:V})}}));const F={delta:y.getContents(),html:y.getSemanticHTML()};R==="user"&&t(F.delta)})),n(y);const N=r();y.setContents(N??new K),y.history.clear()})),(()=>{var y=Wb();return he(y,h,null),he(y,g,null),y})()}function Yb(){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 Qb=A.import("blots/block/embed");function Xb(){return class extends Qb{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 Jb=A.import("blots/block/embed"),Qa=["alt","height","width"];function e1({publicSiteUrl:n}){return class extends Jb{static blotName="img";static tagName="figure";static create(s){const i=super.create(s);i.classList.add("Img"),i.setAttribute("contenteditable","false");const a=document.createElement("img");if(s.src&&a.setAttribute("src",e(s.src)),s.width&&a.setAttribute("width",String(s.width)),s.height&&a.setAttribute("height",String(s.height)),a.classList.add("Img-image"),s.align){const l=Wm(s.align);l&&i.classList.add(l)}return s.zoom==="none"?i.setAttribute("data-zoom","none"):i.classList.add("zoomable"),s.href&&(i.setAttribute("data-href",s.href),i.classList.add("asLink")),s.uid&&(i.setAttribute("data-uid",s.uid),s.variant&&i.setAttribute("data-variant",s.variant??"")),i.appendChild(a),i}static formats(s){return Qa.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 i=s.querySelector(".Img-image");if(!i)throw new Error("missing img node");const{uid:a,variant:l}=s.dataset;if(!a)throw new Error("missing uid");const c=i.getAttribute("src")||void 0,u=i.getAttribute("width")||void 0,f=u===void 0?void 0:Number(u),p=i.getAttribute("height")||void 0,h=p===void 0?void 0:Number(p),g=pl(s),_=s.dataset.zoom==="none"?"none":void 0,y=s.dataset.href?s.dataset.href:void 0;return{uid:a,src:c?t(c):void 0,width:f,height:h,align:g,variant:l,zoom:_,href:y}}format(s,i){Qa.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}`:t1(r)}function t(r){return r.startsWith(n)?r.substring(n.length):r}}function t1(n){return n1(n,["http","https","data"])?n:"//:0"}function n1(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 r1=A.import("blots/inline");function s1(n){return class extends r1{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 i1=A.import("blots/inline");function a1(){return class extends i1{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 cl(t)}}}const o1=A.import("blots/block/embed");function l1(n){return class extends o1{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 c1({publicSiteUrl:n,videoPluginHook:e,internalLinkPluginHook:t}){A.register("formats/img",e1({publicSiteUrl:n}),!0),A.register("formats/html-snippet",Xb(),!0),A.register("formats/obfuscate",a1(),!0),A.register("formats/video-plugin",l1(e),!0),A.register("formats/internal-link-plugin",s1(t),!0)}const O1={create:d1,init:u1},Gt=Yb();function u1(n){const e=`${n.pluginBaseUrl}/bo-plugin.css`,t=document.createElement("link");t.rel="stylesheet",t.href=e,document.head.appendChild(t),n.registerHook("htmlEditorServiceProvider",(()=>Gt.service))}function d1(n){const{fieldType:e}=n;if(e.dataType!=="json")throw new Error(`field type '${e.name}' is incompatible with Quill plugin, needs data type 'json'`);if(n.initialValue!==void 0&&!Ja(n.initialValue))throw new Error(`field type '${e.name}' is incompatible, should be a json, got '${typeof n.initialValue}'`);const t=Xa(n.initialValue);return Cl((r=>{const[s,i]=lt(t),[a,l]=lt(n.language),[c,u]=lt();c1({publicSiteUrl:n.publicSiteUrl,videoPluginHook:Gt.videoPlugin,internalLinkPluginHook:Gt.internalLinkPlugin});let f;fs((()=>{if(!c())return;const h=Jm({quillEditor:c(),service:n,language:a,videoPluginHook:Gt.videoPlugin,internalLinkPluginHook:Gt.internalLinkPlugin});f=h.insertMedia;const g=c();if(!g)return;const _=g.getModule("toolbar");_.addHandler("html-snippet",h.insertHtmlSnippetHandler),_.addHandler("obfuscate",h.insertObfuscateBlotHandler),_.addHandler("video-plugin",h.insertVideoHandler),_.addHandler("internal-link-plugin",h.insertInternalLinkHandler);const y=g.root,N=T=>p(T,g,n.themeConf);y.addEventListener("click",N),Il((()=>y.removeEventListener("click",N)))}));const p=async(h,g,_)=>{const y=h.target;y.classList.contains("Img-image")&&(h.stopPropagation(),y.closest(".Img").click()),y.tagName==="FIGURE"&&await Xm({editor:g,themeConf:_,service:n,element:y,language:a}),y.tagName==="BUTTON"&&y.classList.contains("HtmlSnippet")&&await Zm({language:a,editor:g,service:n,htmlSnippetBtn:y}),y.tagName==="SPAN"&&y.classList.contains("ObfuscateBlot")&&await ml({language:a,editor:g,service:n,obfuscatorSpan:y}),y.tagName==="DIV"&&y.classList.contains("VideoPlugin")&&await Qm({editor:g,videoElement:y,language:a,service:n,videoPluginHook:Gt.videoPlugin}),y.tagName==="SPAN"&&y.classList.contains("InternalLinkPlugin")&&await Ym({editor:g,internalLinkElement:y,language:a,service:n,internalLinkPluginHook:Gt.internalLinkPlugin})};return{element:Mt(Zb,{language:a,onSetQuillInst:h=>{u(h)},value:s,setValue:h=>{const g=s();i(h),h1(h,g)||n.setModifiedValue({j:h})},service:n,get videoPluginHook(){return Gt.videoPlugin},get internalLinkPluginHook(){return Gt.internalLinkPlugin},insertMedia:h=>f?.(h)}),setValue:h=>i(Xa(h)),setLanguage:l,getValue:()=>({j:s}),dispose:r,insertMedia:h=>f?.(h)}}))}function h1(n,e){return!n||!e?n===e:JSON.stringify(n)===JSON.stringify(e)}function Xa(n){if(n!==void 0)return Ja(n)&&typeof n.j=="object"&&n.j!==null?n.j:void 0}export{O1 as default};
|
|
1
|
+
import{createMemo as Qs,createSignal as gt,createEffect as Ms,For as Pi,Show as Ui,createRoot as Ll,onCleanup as Cl}from"https://esm.sh/solid-js@1.9.5";import{delegateEvents as vs,template as be,insert as he,effect as cn,createComponent as Gt,className as Xs}from"https://esm.sh/solid-js@1.9.5/web";function Ja(n){return typeof n=="object"&&n!==null&&"j"in n}function Fi(n){return n.varName?` for '${n.varName}'`:""}function Il(n){return!isNaN(n)&&!isNaN(parseFloat(n))}function Rl(n,e={}){if(typeof n=="number")return n;if(n==null)throw new Error(`Missing number value${Fi(e)}`);if(typeof n=="string"&&Il(n))return Number(n);throw new Error(`Cannot convert to number the value of type '${typeof n}'${Fi(e)}`)}function Hi(n,e={}){return n==null?void 0:Rl(n,e)}var eo=typeof global=="object"&&global&&global.Object===Object&&global,kl=typeof self=="object"&&self&&self.Object===Object&&self,Bt=eo||kl||Function("return this")(),gn=Bt.Symbol,to=Object.prototype,Ml=to.hasOwnProperty,Dl=to.toString,Cr=gn?gn.toStringTag:void 0;function Bl(n){var e=Ml.call(n,Cr),t=n[Cr];try{n[Cr]=void 0;var r=!0}catch{}var s=Dl.call(n);return r&&(e?n[Cr]=t:delete n[Cr]),s}var ql=Object.prototype,$l=ql.toString;function Pl(n){return $l.call(n)}var Ul="[object Null]",Fl="[object Undefined]",zi=gn?gn.toStringTag:void 0;function dr(n){return n==null?n===void 0?Fl:Ul:zi&&zi in Object(n)?Bl(n):Pl(n)}function Vt(n){return n!=null&&typeof n=="object"}var Rn=Array.isArray;function pn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function no(n){return n}var Hl="[object AsyncFunction]",zl="[object Function]",jl="[object GeneratorFunction]",Kl="[object Proxy]";function mi(n){if(!pn(n))return!1;var e=dr(n);return e==zl||e==jl||e==Hl||e==Kl}var Ds=Bt["__core-js_shared__"],ji=function(){var n=/[^.]+$/.exec(Ds&&Ds.keys&&Ds.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function Gl(n){return!!ji&&ji in n}var Vl=Function.prototype,Wl=Vl.toString;function Bn(n){if(n!=null){try{return Wl.call(n)}catch{}try{return n+""}catch{}}return""}var Zl=/[\\^$.*+?()[\]{}|]/g,Yl=/^\[object .+?Constructor\]$/,Ql=Function.prototype,Xl=Object.prototype,Jl=Ql.toString,ec=Xl.hasOwnProperty,tc=RegExp("^"+Jl.call(ec).replace(Zl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nc(n){if(!pn(n)||Gl(n))return!1;var e=mi(n)?tc:Yl;return e.test(Bn(n))}function rc(n,e){return n?.[e]}function qn(n,e){var t=rc(n,e);return nc(t)?t:void 0}var Js=qn(Bt,"WeakMap"),Ki=Object.create,sc=function(){function n(){}return function(e){if(!pn(e))return{};if(Ki)return Ki(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();function ic(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 ac(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var oc=800,lc=16,cc=Date.now;function uc(n){var e=0,t=0;return function(){var r=cc(),s=lc-(r-t);if(t=r,s>0){if(++e>=oc)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function dc(n){return function(){return n}}var gs=function(){try{var n=qn(Object,"defineProperty");return n({},"",{}),n}catch{}}(),hc=gs?function(n,e){return gs(n,"toString",{configurable:!0,enumerable:!1,value:dc(e),writable:!0})}:no,fc=uc(hc);function gc(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var pc=9007199254740991,mc=/^(?:0|[1-9]\d*)$/;function ro(n,e){var t=typeof n;return e=e??pc,!!e&&(t=="number"||t!="symbol"&&mc.test(n))&&n>-1&&n%1==0&&n<e}function bi(n,e,t){e=="__proto__"&&gs?gs(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function jr(n,e){return n===e||n!==n&&e!==e}var bc=Object.prototype,Ec=bc.hasOwnProperty;function so(n,e,t){var r=n[e];(!(Ec.call(n,e)&&jr(r,t))||t===void 0&&!(e in n))&&bi(n,e,t)}function yc(n,e,t,r){var s=!t;t||(t={});for(var i=-1,a=e.length;++i<a;){var l=e[i],c=void 0;c===void 0&&(c=n[l]),s?bi(t,l,c):so(t,l,c)}return t}var Gi=Math.max;function _c(n,e,t){return e=Gi(e===void 0?n.length-1:e,0),function(){for(var r=arguments,s=-1,i=Gi(r.length-e,0),a=Array(i);++s<i;)a[s]=r[e+s];s=-1;for(var l=Array(e+1);++s<e;)l[s]=r[s];return l[e]=t(a),ic(n,this,l)}}function vc(n,e){return fc(_c(n,e,no),n+"")}var Nc=9007199254740991;function io(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Nc}function Ns(n){return n!=null&&io(n.length)&&!mi(n)}function Tc(n,e,t){if(!pn(t))return!1;var r=typeof e;return(r=="number"?Ns(t)&&ro(e,t.length):r=="string"&&e in t)?jr(t[e],n):!1}function Ac(n){return vc((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&&Tc(t[0],t[1],a)&&(i=s<3?void 0:i,s=1),e=Object(e);++r<s;){var l=t[r];l&&n(e,l,r,i)}return e}))}var wc=Object.prototype;function Ei(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||wc;return n===t}function Sc(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var xc="[object Arguments]";function Vi(n){return Vt(n)&&dr(n)==xc}var ao=Object.prototype,Oc=ao.hasOwnProperty,Lc=ao.propertyIsEnumerable,ei=Vi(function(){return arguments}())?Vi:function(n){return Vt(n)&&Oc.call(n,"callee")&&!Lc.call(n,"callee")};function Cc(){return!1}var oo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Wi=oo&&typeof module=="object"&&module&&!module.nodeType&&module,Ic=Wi&&Wi.exports===oo,Zi=Ic?Bt.Buffer:void 0,Rc=Zi?Zi.isBuffer:void 0,qr=Rc||Cc,kc="[object Arguments]",Mc="[object Array]",Dc="[object Boolean]",Bc="[object Date]",qc="[object Error]",$c="[object Function]",Pc="[object Map]",Uc="[object Number]",Fc="[object Object]",Hc="[object RegExp]",zc="[object Set]",jc="[object String]",Kc="[object WeakMap]",Gc="[object ArrayBuffer]",Vc="[object DataView]",Wc="[object Float32Array]",Zc="[object Float64Array]",Yc="[object Int8Array]",Qc="[object Int16Array]",Xc="[object Int32Array]",Jc="[object Uint8Array]",eu="[object Uint8ClampedArray]",tu="[object Uint16Array]",nu="[object Uint32Array]",ke={};ke[Wc]=ke[Zc]=ke[Yc]=ke[Qc]=ke[Xc]=ke[Jc]=ke[eu]=ke[tu]=ke[nu]=!0;ke[kc]=ke[Mc]=ke[Gc]=ke[Dc]=ke[Vc]=ke[Bc]=ke[qc]=ke[$c]=ke[Pc]=ke[Uc]=ke[Fc]=ke[Hc]=ke[zc]=ke[jc]=ke[Kc]=!1;function ru(n){return Vt(n)&&io(n.length)&&!!ke[dr(n)]}function yi(n){return function(e){return n(e)}}var lo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Dr=lo&&typeof module=="object"&&module&&!module.nodeType&&module,su=Dr&&Dr.exports===lo,Bs=su&&eo.process,cr=function(){try{var n=Dr&&Dr.require&&Dr.require("util").types;return n||Bs&&Bs.binding&&Bs.binding("util")}catch{}}(),Yi=cr&&cr.isTypedArray,_i=Yi?yi(Yi):ru,iu=Object.prototype,au=iu.hasOwnProperty;function co(n,e){var t=Rn(n),r=!t&&ei(n),s=!t&&!r&&qr(n),i=!t&&!r&&!s&&_i(n),a=t||r||s||i,l=a?Sc(n.length,String):[],c=l.length;for(var u in n)(e||au.call(n,u))&&!(a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||ro(u,c)))&&l.push(u);return l}function uo(n,e){return function(t){return n(e(t))}}var ou=uo(Object.keys,Object),lu=Object.prototype,cu=lu.hasOwnProperty;function uu(n){if(!Ei(n))return ou(n);var e=[];for(var t in Object(n))cu.call(n,t)&&t!="constructor"&&e.push(t);return e}function du(n){return Ns(n)?co(n):uu(n)}function hu(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var fu=Object.prototype,gu=fu.hasOwnProperty;function pu(n){if(!pn(n))return hu(n);var e=Ei(n),t=[];for(var r in n)r=="constructor"&&(e||!gu.call(n,r))||t.push(r);return t}function ho(n){return Ns(n)?co(n,!0):pu(n)}var $r=qn(Object,"create");function mu(){this.__data__=$r?$r(null):{},this.size=0}function bu(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var Eu="__lodash_hash_undefined__",yu=Object.prototype,_u=yu.hasOwnProperty;function vu(n){var e=this.__data__;if($r){var t=e[n];return t===Eu?void 0:t}return _u.call(e,n)?e[n]:void 0}var Nu=Object.prototype,Tu=Nu.hasOwnProperty;function Au(n){var e=this.__data__;return $r?e[n]!==void 0:Tu.call(e,n)}var wu="__lodash_hash_undefined__";function Su(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=$r&&e===void 0?wu:e,this}function kn(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])}}kn.prototype.clear=mu;kn.prototype.delete=bu;kn.prototype.get=vu;kn.prototype.has=Au;kn.prototype.set=Su;function xu(){this.__data__=[],this.size=0}function Ts(n,e){for(var t=n.length;t--;)if(jr(n[t][0],e))return t;return-1}var Ou=Array.prototype,Lu=Ou.splice;function Cu(n){var e=this.__data__,t=Ts(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():Lu.call(e,t,1),--this.size,!0}function Iu(n){var e=this.__data__,t=Ts(e,n);return t<0?void 0:e[t][1]}function Ru(n){return Ts(this.__data__,n)>-1}function ku(n,e){var t=this.__data__,r=Ts(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function Zt(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])}}Zt.prototype.clear=xu;Zt.prototype.delete=Cu;Zt.prototype.get=Iu;Zt.prototype.has=Ru;Zt.prototype.set=ku;var Pr=qn(Bt,"Map");function Mu(){this.size=0,this.__data__={hash:new kn,map:new(Pr||Zt),string:new kn}}function Du(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function As(n,e){var t=n.__data__;return Du(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Bu(n){var e=As(this,n).delete(n);return this.size-=e?1:0,e}function qu(n){return As(this,n).get(n)}function $u(n){return As(this,n).has(n)}function Pu(n,e){var t=As(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function $n(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])}}$n.prototype.clear=Mu;$n.prototype.delete=Bu;$n.prototype.get=qu;$n.prototype.has=$u;$n.prototype.set=Pu;function Uu(n,e){for(var t=-1,r=e.length,s=n.length;++t<r;)n[s+t]=e[t];return n}var fo=uo(Object.getPrototypeOf,Object),Fu="[object Object]",Hu=Function.prototype,zu=Object.prototype,go=Hu.toString,ju=zu.hasOwnProperty,Ku=go.call(Object);function Gu(n){if(!Vt(n)||dr(n)!=Fu)return!1;var e=fo(n);if(e===null)return!0;var t=ju.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&go.call(t)==Ku}function Vu(){this.__data__=new Zt,this.size=0}function Wu(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function Zu(n){return this.__data__.get(n)}function Yu(n){return this.__data__.has(n)}var Qu=200;function Xu(n,e){var t=this.__data__;if(t instanceof Zt){var r=t.__data__;if(!Pr||r.length<Qu-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new $n(r)}return t.set(n,e),this.size=t.size,this}function Mt(n){var e=this.__data__=new Zt(n);this.size=e.size}Mt.prototype.clear=Vu;Mt.prototype.delete=Wu;Mt.prototype.get=Zu;Mt.prototype.has=Yu;Mt.prototype.set=Xu;var po=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Qi=po&&typeof module=="object"&&module&&!module.nodeType&&module,Ju=Qi&&Qi.exports===po,Xi=Ju?Bt.Buffer:void 0,Ji=Xi?Xi.allocUnsafe:void 0;function mo(n,e){if(e)return n.slice();var t=n.length,r=Ji?Ji(t):new n.constructor(t);return n.copy(r),r}function ed(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 td(){return[]}var nd=Object.prototype,rd=nd.propertyIsEnumerable,ea=Object.getOwnPropertySymbols,sd=ea?function(n){return n==null?[]:(n=Object(n),ed(ea(n),(function(e){return rd.call(n,e)})))}:td;function id(n,e,t){var r=e(n);return Rn(n)?r:Uu(r,t(n))}function ti(n){return id(n,du,sd)}var ni=qn(Bt,"DataView"),ri=qn(Bt,"Promise"),si=qn(Bt,"Set"),ta="[object Map]",ad="[object Object]",na="[object Promise]",ra="[object Set]",sa="[object WeakMap]",ia="[object DataView]",od=Bn(ni),ld=Bn(Pr),cd=Bn(ri),ud=Bn(si),dd=Bn(Js),At=dr;(ni&&At(new ni(new ArrayBuffer(1)))!=ia||Pr&&At(new Pr)!=ta||ri&&At(ri.resolve())!=na||si&&At(new si)!=ra||Js&&At(new Js)!=sa)&&(At=function(n){var e=dr(n),t=e==ad?n.constructor:void 0,r=t?Bn(t):"";if(r)switch(r){case od:return ia;case ld:return ta;case cd:return na;case ud:return ra;case dd:return sa}return e});var hd=Object.prototype,fd=hd.hasOwnProperty;function gd(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&fd.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var ps=Bt.Uint8Array;function vi(n){var e=new n.constructor(n.byteLength);return new ps(e).set(new ps(n)),e}function pd(n,e){var t=vi(n.buffer);return new n.constructor(t,n.byteOffset,n.byteLength)}var md=/\w*$/;function bd(n){var e=new n.constructor(n.source,md.exec(n));return e.lastIndex=n.lastIndex,e}var aa=gn?gn.prototype:void 0,oa=aa?aa.valueOf:void 0;function Ed(n){return oa?Object(oa.call(n)):{}}function bo(n,e){var t=e?vi(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var yd="[object Boolean]",_d="[object Date]",vd="[object Map]",Nd="[object Number]",Td="[object RegExp]",Ad="[object Set]",wd="[object String]",Sd="[object Symbol]",xd="[object ArrayBuffer]",Od="[object DataView]",Ld="[object Float32Array]",Cd="[object Float64Array]",Id="[object Int8Array]",Rd="[object Int16Array]",kd="[object Int32Array]",Md="[object Uint8Array]",Dd="[object Uint8ClampedArray]",Bd="[object Uint16Array]",qd="[object Uint32Array]";function $d(n,e,t){var r=n.constructor;switch(e){case xd:return vi(n);case yd:case _d:return new r(+n);case Od:return pd(n);case Ld:case Cd:case Id:case Rd:case kd:case Md:case Dd:case Bd:case qd:return bo(n,t);case vd:return new r;case Nd:case wd:return new r(n);case Td:return bd(n);case Ad:return new r;case Sd:return Ed(n)}}function Eo(n){return typeof n.constructor=="function"&&!Ei(n)?sc(fo(n)):{}}var Pd="[object Map]";function Ud(n){return Vt(n)&&At(n)==Pd}var la=cr&&cr.isMap,Fd=la?yi(la):Ud,Hd="[object Set]";function zd(n){return Vt(n)&&At(n)==Hd}var ca=cr&&cr.isSet,jd=ca?yi(ca):zd,Kd=1,yo="[object Arguments]",Gd="[object Array]",Vd="[object Boolean]",Wd="[object Date]",Zd="[object Error]",_o="[object Function]",Yd="[object GeneratorFunction]",Qd="[object Map]",Xd="[object Number]",vo="[object Object]",Jd="[object RegExp]",eh="[object Set]",th="[object String]",nh="[object Symbol]",rh="[object WeakMap]",sh="[object ArrayBuffer]",ih="[object DataView]",ah="[object Float32Array]",oh="[object Float64Array]",lh="[object Int8Array]",ch="[object Int16Array]",uh="[object Int32Array]",dh="[object Uint8Array]",hh="[object Uint8ClampedArray]",fh="[object Uint16Array]",gh="[object Uint32Array]",Ie={};Ie[yo]=Ie[Gd]=Ie[sh]=Ie[ih]=Ie[Vd]=Ie[Wd]=Ie[ah]=Ie[oh]=Ie[lh]=Ie[ch]=Ie[uh]=Ie[Qd]=Ie[Xd]=Ie[vo]=Ie[Jd]=Ie[eh]=Ie[th]=Ie[nh]=Ie[dh]=Ie[hh]=Ie[fh]=Ie[gh]=!0;Ie[Zd]=Ie[_o]=Ie[rh]=!1;function fs(n,e,t,r,s,i){var a,l=e&Kd;if(a!==void 0)return a;if(!pn(n))return n;var c=Rn(n);if(c)a=gd(n);else{var u=At(n),f=u==_o||u==Yd;if(qr(n))return mo(n,l);if(u==vo||u==yo||f&&!s)a=f?{}:Eo(n);else{if(!Ie[u])return s?n:{};a=$d(n,u,l)}}i||(i=new Mt);var p=i.get(n);if(p)return p;i.set(n,a),jd(n)?n.forEach((function(y){a.add(fs(y,e,t,y,n,i))})):Fd(n)&&n.forEach((function(y,v){a.set(v,fs(y,e,t,v,n,i))}));var h=ti,g=c?void 0:h(n);return gc(g||n,(function(y,v){g&&(v=y,y=n[v]),so(a,v,fs(y,e,t,v,n,i))})),a}var ph=1,mh=4;function ar(n){return fs(n,ph|mh)}var bh="__lodash_hash_undefined__";function Eh(n){return this.__data__.set(n,bh),this}function yh(n){return this.__data__.has(n)}function ms(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new $n;++e<t;)this.add(n[e])}ms.prototype.add=ms.prototype.push=Eh;ms.prototype.has=yh;function _h(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 vh(n,e){return n.has(e)}var Nh=1,Th=2;function No(n,e,t,r,s,i){var a=t&Nh,l=n.length,c=e.length;if(l!=c&&!(a&&c>l))return!1;var u=i.get(n),f=i.get(e);if(u&&f)return u==e&&f==n;var p=-1,h=!0,g=t&Th?new ms:void 0;for(i.set(n,e),i.set(e,n);++p<l;){var y=n[p],v=e[p];if(r)var N=a?r(v,y,p,e,n,i):r(y,v,p,n,e,i);if(N!==void 0){if(N)continue;h=!1;break}if(g){if(!_h(e,(function(T,C){if(!vh(g,C)&&(y===T||s(y,T,t,r,i)))return g.push(C)}))){h=!1;break}}else if(!(y===v||s(y,v,t,r,i))){h=!1;break}}return i.delete(n),i.delete(e),h}function Ah(n){var e=-1,t=Array(n.size);return n.forEach((function(r,s){t[++e]=[s,r]})),t}function wh(n){var e=-1,t=Array(n.size);return n.forEach((function(r){t[++e]=r})),t}var Sh=1,xh=2,Oh="[object Boolean]",Lh="[object Date]",Ch="[object Error]",Ih="[object Map]",Rh="[object Number]",kh="[object RegExp]",Mh="[object Set]",Dh="[object String]",Bh="[object Symbol]",qh="[object ArrayBuffer]",$h="[object DataView]",ua=gn?gn.prototype:void 0,qs=ua?ua.valueOf:void 0;function Ph(n,e,t,r,s,i,a){switch(t){case $h:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case qh:return!(n.byteLength!=e.byteLength||!i(new ps(n),new ps(e)));case Oh:case Lh:case Rh:return jr(+n,+e);case Ch:return n.name==e.name&&n.message==e.message;case kh:case Dh:return n==e+"";case Ih:var l=Ah;case Mh:var c=r&Sh;if(l||(l=wh),n.size!=e.size&&!c)return!1;var u=a.get(n);if(u)return u==e;r|=xh,a.set(n,e);var f=No(l(n),l(e),r,s,i,a);return a.delete(n),f;case Bh:if(qs)return qs.call(n)==qs.call(e)}return!1}var Uh=1,Fh=Object.prototype,Hh=Fh.hasOwnProperty;function zh(n,e,t,r,s,i){var a=t&Uh,l=ti(n),c=l.length,u=ti(e),f=u.length;if(c!=f&&!a)return!1;for(var p=c;p--;){var h=l[p];if(!(a?h in e:Hh.call(e,h)))return!1}var g=i.get(n),y=i.get(e);if(g&&y)return g==e&&y==n;var v=!0;i.set(n,e),i.set(e,n);for(var N=a;++p<c;){h=l[p];var T=n[h],C=e[h];if(r)var x=a?r(C,T,h,e,n,i):r(T,C,h,n,e,i);if(!(x===void 0?T===C||s(T,C,t,r,i):x)){v=!1;break}N||(N=h=="constructor")}if(v&&!N){var q=n.constructor,P=e.constructor;q!=P&&"constructor"in n&&"constructor"in e&&!(typeof q=="function"&&q instanceof q&&typeof P=="function"&&P instanceof P)&&(v=!1)}return i.delete(n),i.delete(e),v}var jh=1,da="[object Arguments]",ha="[object Array]",es="[object Object]",Kh=Object.prototype,fa=Kh.hasOwnProperty;function Gh(n,e,t,r,s,i){var a=Rn(n),l=Rn(e),c=a?ha:At(n),u=l?ha:At(e);c=c==da?es:c,u=u==da?es:u;var f=c==es,p=u==es,h=c==u;if(h&&qr(n)){if(!qr(e))return!1;a=!0,f=!1}if(h&&!f)return i||(i=new Mt),a||_i(n)?No(n,e,t,r,s,i):Ph(n,e,c,t,r,s,i);if(!(t&jh)){var g=f&&fa.call(n,"__wrapped__"),y=p&&fa.call(e,"__wrapped__");if(g||y){var v=g?n.value():n,N=y?e.value():e;return i||(i=new Mt),s(v,N,t,r,i)}}return h?(i||(i=new Mt),zh(n,e,t,r,s,i)):!1}function To(n,e,t,r,s){return n===e?!0:n==null||e==null||!Vt(n)&&!Vt(e)?n!==n&&e!==e:Gh(n,e,t,r,To,s)}function Vh(n){return function(e,t,r){for(var s=-1,i=Object(e),a=r(e),l=a.length;l--;){var c=a[++s];if(t(i[c],c,i)===!1)break}return e}}var Wh=Vh();function ii(n,e,t){(t!==void 0&&!jr(n[e],t)||t===void 0&&!(e in n))&&bi(n,e,t)}function Zh(n){return Vt(n)&&Ns(n)}function ai(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function Yh(n){return yc(n,ho(n))}function Qh(n,e,t,r,s,i,a){var l=ai(n,t),c=ai(e,t),u=a.get(c);if(u){ii(n,t,u);return}var f=i?i(l,c,t+"",n,e,a):void 0,p=f===void 0;if(p){var h=Rn(c),g=!h&&qr(c),y=!h&&!g&&_i(c);f=c,h||g||y?Rn(l)?f=l:Zh(l)?f=ac(l):g?(p=!1,f=mo(c,!0)):y?(p=!1,f=bo(c,!0)):f=[]:Gu(c)||ei(c)?(f=l,ei(l)?f=Yh(l):(!pn(l)||mi(l))&&(f=Eo(c))):p=!1}p&&(a.set(c,f),s(f,c,r,i,a),a.delete(c)),ii(n,t,f)}function Ao(n,e,t,r,s){n!==e&&Wh(e,(function(i,a){if(s||(s=new Mt),pn(i))Qh(n,e,a,t,Ao,r,s);else{var l=r?r(ai(n,a),i,a+"",n,e,s):void 0;l===void 0&&(l=i),ii(n,a,l)}}),ho)}function Ni(n,e){return To(n,e)}var hn=Ac((function(n,e,t){Ao(n,e,t)})),Z=(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))(Z||{});class Dt{constructor(e,t,r={}){this.attrName=e,this.keyName=t;const s=Z.TYPE&Z.ATTRIBUTE;this.scope=r.scope!=null?r.scope&Z.LEVEL|s:Z.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 or extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const wo=class oi{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 or(`Unable to create ${t} blot`);const i=s,a=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:i.create(r),l=new i(e,a,r);return oi.blots.set(l.domNode,l),l}find(e,t=!1){return oi.find(e,t)}query(e,t=Z.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&Z.LEVEL&Z.BLOCK?r=this.types.block:e&Z.LEVEL&Z.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&Z.LEVEL&r.scope&&t&Z.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 or("Invalid definition");if(r&&t.blotName==="abstract")throw new or("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}))}};wo.blots=new WeakMap;let ur=wo;function ga(n,e){return(n.getAttribute("class")||"").split(/\s+/).filter((t=>t.indexOf(`${e}-`)===0))}class Xh extends Dt{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){ga(e,this.keyName).forEach((t=>{e.classList.remove(t)})),e.classList.length===0&&e.removeAttribute("class")}value(e){const t=(ga(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}}const Lt=Xh;function $s(n){const e=n.split("-"),t=e.slice(1).map((r=>r[0].toUpperCase()+r.slice(1))).join("");return e[0]+t}class Jh extends Dt{static keys(e){return(e.getAttribute("style")||"").split(";").map((t=>t.split(":")[0].trim()))}add(e,t){return this.canAdd(e,t)?(e.style[$s(this.keyName)]=t,!0):!1}remove(e){e.style[$s(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[$s(this.keyName)];return this.canAdd(e,t)?t:""}}const mn=Jh;class ef{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=ur.find(this.domNode);if(e==null)return;const t=Dt.keys(this.domNode),r=Lt.keys(this.domNode),s=mn.keys(this.domNode);t.concat(r).concat(s).forEach((i=>{const a=e.scroll.query(i,Z.ATTRIBUTE);a instanceof Dt&&(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 ws=ef,So=class{constructor(e,t){this.scroll=e,this.domNode=t,ur.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new or("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),ur.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,Z.BLOT)!=null&&s)i.wrap(r,s);else if(this.scroll.query(r,Z.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 or(`Cannot wrap ${e}`);return r.appendChild(this),r}};So.blotName="abstract";let xo=So;const Oo=class extends xo{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}}};Oo.scope=Z.INLINE_BLOT;let tf=Oo;const et=tf;class nf{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 l=this.iterator(s);let c=l();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=l()}}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 pa(n,e){const t=e.find(n);if(t)return t;try{return e.create(n)}catch{const r=e.create(Z.INLINE);return Array.from(n.childNodes).forEach((s=>{r.domNode.appendChild(s)})),n.parentNode&&n.parentNode.replaceChild(r.domNode,n),r.attach(),r}}const Lo=class ln extends xo{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,ln.uiClass&&this.uiNode.classList.add(ln.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new nf,Array.from(this.domNode.childNodes).filter((e=>e!==this.uiNode)).reverse().forEach((e=>{try{const t=pa(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof or)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 ln?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,l,c)=>{(e.blotName==null&&e(a)||e.blotName!=null&&a instanceof e)&&s.push(a),a instanceof ln&&(s=s.concat(a.descendants(e,l,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===Z.BLOCK_BLOT?(t.next!=null&&this.splitAfter(t),t.prev!=null&&this.splitAfter(t.prev),t.parent.unwrap(),e=!0):t instanceof ln?t.unwrap():t.remove())}))}formatAt(e,t,r,s){this.children.forEachAt(e,t,((i,a,l)=>{i.formatAt(a,l,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 ln?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 ln&&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 l=s.split(i,t);l!=null&&r.appendChild(l)})),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 l=pa(i,this.scroll);(l.next!==a||l.next==null)&&(l.parent!=null&&l.parent.removeChild(this),this.insertBefore(l,a||void 0))})),this.enforceAllowedChildren()}};Lo.uiClass="";let rf=Lo;const xt=rf;function sf(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 er=class tr extends xt{static create(e){return super.create(e)}static formats(e,t){const r=t.query(tr.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 ws(this.domNode)}format(e,t){if(e===this.statics.blotName&&!t)this.children.forEach((r=>{r instanceof tr||(r=r.wrap(tr.blotName,!0)),this.attributes.copy(r)})),this.unwrap();else{const r=this.scroll.query(e,Z.INLINE);if(r==null)return;r instanceof Dt?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,Z.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 tr&&r.prev===this&&sf(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 tr&&this.attributes.move(r),r}};er.allowedChildren=[er,et],er.blotName="inline",er.scope=Z.INLINE_BLOT,er.tagName="SPAN";let af=er;const Ti=af,nr=class li extends xt{static create(e){return super.create(e)}static formats(e,t){const r=t.query(li.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 ws(this.domNode)}format(e,t){const r=this.scroll.query(e,Z.BLOCK);r!=null&&(r instanceof Dt?this.attributes.attribute(r,t):e===this.statics.blotName&&!t?this.replaceWith(li.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,Z.BLOCK)!=null?this.format(r,s):super.formatAt(e,t,r,s)}insertAt(e,t,r){if(r==null||this.scroll.query(t,Z.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()}};nr.blotName="block",nr.scope=Z.BLOCK_BLOT,nr.tagName="P",nr.allowedChildren=[Ti,nr,et];let of=nr;const Ur=of,ci=class extends xt{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())}};ci.blotName="container",ci.scope=Z.BLOCK_BLOT;let lf=ci;const Ss=lf;class cf extends et{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 lt=cf,uf={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},df=100,rr=class extends xt{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,uf),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=Z.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 xt&&c.children.forEach(a),r.delete(c.domNode),c.optimize(t))};let l=e;for(let c=0;l.length>0;c+=1){if(c>=df)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach((u=>{const f=this.find(u.target,!0);f!=null&&(f.domNode===u.target&&(u.type==="childList"?(i(this.find(u.previousSibling,!1)),Array.from(u.addedNodes).forEach((p=>{const h=this.find(p,!1);i(h,!1),h instanceof xt&&h.children.forEach((g=>{i(g,!1)}))}))):u.type==="attributes"&&i(f.prev)),i(f))})),this.children.forEach(a),l=Array.from(this.observer.takeRecords()),s=l.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)}};rr.blotName="scroll",rr.defaultChild=Ur,rr.allowedChildren=[Ur,Ss],rr.scope=Z.BLOCK_BLOT,rr.tagName="DIV";let hf=rr;const Ai=hf,ui=class Co extends et{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 Co&&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}};ui.blotName="text",ui.scope=Z.INLINE_BLOT;let ff=ui;const bs=ff,gf=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Dt,AttributorStore:ws,BlockBlot:Ur,ClassAttributor:Lt,ContainerBlot:Ss,EmbedBlot:lt,InlineBlot:Ti,LeafBlot:et,ParentBlot:xt,Registry:ur,Scope:Z,ScrollBlot:Ai,StyleAttributor:mn,TextBlot:bs},Symbol.toStringTag,{value:"Module"}));var un=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wi(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ts={exports:{}},Ps,ma;function pf(){if(ma)return Ps;ma=1;var n=-1,e=1,t=0;function r(b,O,_,I,k){if(b===O)return b?[[t,b]]:[];if(_!=null){var L=ce(b,O,_);if(L)return L}var B=l(b,O),M=b.substring(0,B);b=b.substring(B),O=O.substring(B),B=u(b,O);var H=b.substring(b.length-B);b=b.substring(0,b.length-B),O=O.substring(0,O.length-B);var $=s(b,O);return M&&$.unshift([t,M]),H&&$.push([t,H]),C($,k),I&&p($),$}function s(b,O){var _;if(!b)return[[e,O]];if(!O)return[[n,b]];var I=b.length>O.length?b:O,k=b.length>O.length?O:b,L=I.indexOf(k);if(L!==-1)return _=[[e,I.substring(0,L)],[t,k],[e,I.substring(L+k.length)]],b.length>O.length&&(_[0][0]=_[2][0]=n),_;if(k.length===1)return[[n,b],[e,O]];var B=f(b,O);if(B){var M=B[0],H=B[1],$=B[2],te=B[3],J=B[4],ie=r(M,$),de=r(H,te);return ie.concat([[t,J]],de)}return i(b,O)}function i(b,O){for(var _=b.length,I=O.length,k=Math.ceil((_+I)/2),L=k,B=2*k,M=new Array(B),H=new Array(B),$=0;$<B;$++)M[$]=-1,H[$]=-1;M[L+1]=0,H[L+1]=0;for(var te=_-I,J=te%2!==0,ie=0,de=0,X=0,Oe=0,Le=0;Le<k;Le++){for(var le=-Le+ie;le<=Le-de;le+=2){var _e=L+le,fe;le===-Le||le!==Le&&M[_e-1]<M[_e+1]?fe=M[_e+1]:fe=M[_e-1]+1;for(var Ee=fe-le;fe<_&&Ee<I&&b.charAt(fe)===O.charAt(Ee);)fe++,Ee++;if(M[_e]=fe,fe>_)de+=2;else if(Ee>I)ie+=2;else if(J){var ve=L+te-le;if(ve>=0&&ve<B&&H[ve]!==-1){var Ne=_-H[ve];if(fe>=Ne)return a(b,O,fe,Ee)}}}for(var De=-Le+X;De<=Le-Oe;De+=2){var ve=L+De,Ne;De===-Le||De!==Le&&H[ve-1]<H[ve+1]?Ne=H[ve+1]:Ne=H[ve-1]+1;for(var ze=Ne-De;Ne<_&&ze<I&&b.charAt(_-Ne-1)===O.charAt(I-ze-1);)Ne++,ze++;if(H[ve]=Ne,Ne>_)Oe+=2;else if(ze>I)X+=2;else if(!J){var _e=L+te-De;if(_e>=0&&_e<B&&M[_e]!==-1){var fe=M[_e],Ee=L+fe-_e;if(Ne=_-Ne,fe>=Ne)return a(b,O,fe,Ee)}}}}return[[n,b],[e,O]]}function a(b,O,_,I){var k=b.substring(0,_),L=O.substring(0,I),B=b.substring(_),M=O.substring(I),H=r(k,L),$=r(B,M);return H.concat($)}function l(b,O){if(!b||!O||b.charAt(0)!==O.charAt(0))return 0;for(var _=0,I=Math.min(b.length,O.length),k=I,L=0;_<k;)b.substring(L,k)==O.substring(L,k)?(_=k,L=_):I=k,k=Math.floor((I-_)/2+_);return x(b.charCodeAt(k-1))&&k--,k}function c(b,O){var _=b.length,I=O.length;if(_==0||I==0)return 0;_>I?b=b.substring(_-I):_<I&&(O=O.substring(0,_));var k=Math.min(_,I);if(b==O)return k;for(var L=0,B=1;;){var M=b.substring(k-B),H=O.indexOf(M);if(H==-1)return L;B+=H,(H==0||b.substring(k-B)==O.substring(0,B))&&(L=B,B++)}}function u(b,O){if(!b||!O||b.slice(-1)!==O.slice(-1))return 0;for(var _=0,I=Math.min(b.length,O.length),k=I,L=0;_<k;)b.substring(b.length-k,b.length-L)==O.substring(O.length-k,O.length-L)?(_=k,L=_):I=k,k=Math.floor((I-_)/2+_);return q(b.charCodeAt(b.length-k))&&k--,k}function f(b,O){var _=b.length>O.length?b:O,I=b.length>O.length?O:b;if(_.length<4||I.length*2<_.length)return null;function k(de,X,Oe){for(var Le=de.substring(Oe,Oe+Math.floor(de.length/4)),le=-1,_e="",fe,Ee,ve,Ne;(le=X.indexOf(Le,le+1))!==-1;){var De=l(de.substring(Oe),X.substring(le)),ze=u(de.substring(0,Oe),X.substring(0,le));_e.length<ze+De&&(_e=X.substring(le-ze,le)+X.substring(le,le+De),fe=de.substring(0,Oe-ze),Ee=de.substring(Oe+De),ve=X.substring(0,le-ze),Ne=X.substring(le+De))}return _e.length*2>=de.length?[fe,Ee,ve,Ne,_e]:null}var L=k(_,I,Math.ceil(_.length/4)),B=k(_,I,Math.ceil(_.length/2)),M;if(!L&&!B)return null;B?L?M=L[4].length>B[4].length?L:B:M=B:M=L;var H,$,te,J;b.length>O.length?(H=M[0],$=M[1],te=M[2],J=M[3]):(te=M[0],J=M[1],H=M[2],$=M[3]);var ie=M[4];return[H,$,te,J,ie]}function p(b){for(var O=!1,_=[],I=0,k=null,L=0,B=0,M=0,H=0,$=0;L<b.length;)b[L][0]==t?(_[I++]=L,B=H,M=$,H=0,$=0,k=b[L][1]):(b[L][0]==e?H+=b[L][1].length:$+=b[L][1].length,k&&k.length<=Math.max(B,M)&&k.length<=Math.max(H,$)&&(b.splice(_[I-1],0,[n,k]),b[_[I-1]+1][0]=e,I--,I--,L=I>0?_[I-1]:-1,B=0,M=0,H=0,$=0,k=null,O=!0)),L++;for(O&&C(b),T(b),L=1;L<b.length;){if(b[L-1][0]==n&&b[L][0]==e){var te=b[L-1][1],J=b[L][1],ie=c(te,J),de=c(J,te);ie>=de?(ie>=te.length/2||ie>=J.length/2)&&(b.splice(L,0,[t,J.substring(0,ie)]),b[L-1][1]=te.substring(0,te.length-ie),b[L+1][1]=J.substring(ie),L++):(de>=te.length/2||de>=J.length/2)&&(b.splice(L,0,[t,te.substring(0,de)]),b[L-1][0]=e,b[L-1][1]=J.substring(0,J.length-de),b[L+1][0]=n,b[L+1][1]=te.substring(de),L++),L++}L++}}var h=/[^a-zA-Z0-9]/,g=/\s/,y=/[\r\n]/,v=/\n\r?\n$/,N=/^\r?\n\r?\n/;function T(b){function O(de,X){if(!de||!X)return 6;var Oe=de.charAt(de.length-1),Le=X.charAt(0),le=Oe.match(h),_e=Le.match(h),fe=le&&Oe.match(g),Ee=_e&&Le.match(g),ve=fe&&Oe.match(y),Ne=Ee&&Le.match(y),De=ve&&de.match(v),ze=Ne&&X.match(N);return De||ze?5:ve||Ne?4:le&&!fe&&Ee?3:fe||Ee?2:le||_e?1:0}for(var _=1;_<b.length-1;){if(b[_-1][0]==t&&b[_+1][0]==t){var I=b[_-1][1],k=b[_][1],L=b[_+1][1],B=u(I,k);if(B){var M=k.substring(k.length-B);I=I.substring(0,I.length-B),k=M+k.substring(0,k.length-B),L=M+L}for(var H=I,$=k,te=L,J=O(I,k)+O(k,L);k.charAt(0)===L.charAt(0);){I+=k.charAt(0),k=k.substring(1)+L.charAt(0),L=L.substring(1);var ie=O(I,k)+O(k,L);ie>=J&&(J=ie,H=I,$=k,te=L)}b[_-1][1]!=H&&(H?b[_-1][1]=H:(b.splice(_-1,1),_--),b[_][1]=$,te?b[_+1][1]=te:(b.splice(_+1,1),_--))}_++}}function C(b,O){b.push([t,""]);for(var _=0,I=0,k=0,L="",B="",M;_<b.length;){if(_<b.length-1&&!b[_][1]){b.splice(_,1);continue}switch(b[_][0]){case e:k++,B+=b[_][1],_++;break;case n:I++,L+=b[_][1],_++;break;case t:var H=_-k-I-1;if(O){if(H>=0&&V(b[H][1])){var $=b[H][1].slice(-1);if(b[H][1]=b[H][1].slice(0,-1),L=$+L,B=$+B,!b[H][1]){b.splice(H,1),_--;var te=H-1;b[te]&&b[te][0]===e&&(k++,B=b[te][1]+B,te--),b[te]&&b[te][0]===n&&(I++,L=b[te][1]+L,te--),H=te}}if(P(b[_][1])){var $=b[_][1].charAt(0);b[_][1]=b[_][1].slice(1),L+=$,B+=$}}if(_<b.length-1&&!b[_][1]){b.splice(_,1);break}if(L.length>0||B.length>0){L.length>0&&B.length>0&&(M=l(B,L),M!==0&&(H>=0?b[H][1]+=B.substring(0,M):(b.splice(0,0,[t,B.substring(0,M)]),_++),B=B.substring(M),L=L.substring(M)),M=u(B,L),M!==0&&(b[_][1]=B.substring(B.length-M)+b[_][1],B=B.substring(0,B.length-M),L=L.substring(0,L.length-M)));var J=k+I;L.length===0&&B.length===0?(b.splice(_-J,J),_=_-J):L.length===0?(b.splice(_-J,J,[e,B]),_=_-J+1):B.length===0?(b.splice(_-J,J,[n,L]),_=_-J+1):(b.splice(_-J,J,[n,L],[e,B]),_=_-J+2)}_!==0&&b[_-1][0]===t?(b[_-1][1]+=b[_][1],b.splice(_,1)):_++,k=0,I=0,L="",B="";break}}b[b.length-1][1]===""&&b.pop();var ie=!1;for(_=1;_<b.length-1;)b[_-1][0]===t&&b[_+1][0]===t&&(b[_][1].substring(b[_][1].length-b[_-1][1].length)===b[_-1][1]?(b[_][1]=b[_-1][1]+b[_][1].substring(0,b[_][1].length-b[_-1][1].length),b[_+1][1]=b[_-1][1]+b[_+1][1],b.splice(_-1,1),ie=!0):b[_][1].substring(0,b[_+1][1].length)==b[_+1][1]&&(b[_-1][1]+=b[_+1][1],b[_][1]=b[_][1].substring(b[_+1][1].length)+b[_+1][1],b.splice(_+1,1),ie=!0)),_++;ie&&C(b,O)}function x(b){return b>=55296&&b<=56319}function q(b){return b>=56320&&b<=57343}function P(b){return q(b.charCodeAt(0))}function V(b){return x(b.charCodeAt(b.length-1))}function F(b){for(var O=[],_=0;_<b.length;_++)b[_][1].length>0&&O.push(b[_]);return O}function ee(b,O,_,I){return V(b)||P(I)?null:F([[t,b],[n,O],[e,_],[t,I]])}function ce(b,O,_){var I=typeof _=="number"?{index:_,length:0}:_.oldRange,k=typeof _=="number"?null:_.newRange,L=b.length,B=O.length;if(I.length===0&&(k===null||k.length===0)){var M=I.index,H=b.slice(0,M),$=b.slice(M),te=k?k.index:null;e:{var J=M+B-L;if(te!==null&&te!==J||J<0||J>B)break e;var ie=O.slice(0,J),de=O.slice(J);if(de!==$)break e;var X=Math.min(M,J),Oe=H.slice(0,X),Le=ie.slice(0,X);if(Oe!==Le)break e;var le=H.slice(X),_e=ie.slice(X);return ee(Oe,le,_e,$)}e:{if(te!==null&&te!==M)break e;var fe=M,ie=O.slice(0,fe),de=O.slice(fe);if(ie!==H)break e;var Ee=Math.min(L-fe,B-fe),ve=$.slice($.length-Ee),Ne=de.slice(de.length-Ee);if(ve!==Ne)break e;var le=$.slice(0,$.length-Ee),_e=de.slice(0,de.length-Ee);return ee(H,le,_e,ve)}}if(I.length>0&&k&&k.length===0)e:{var Oe=b.slice(0,I.index),ve=b.slice(I.index+I.length),X=Oe.length,Ee=ve.length;if(B<X+Ee)break e;var Le=O.slice(0,X),Ne=O.slice(B-Ee);if(Oe!==Le||ve!==Ne)break e;var le=b.slice(X,L-Ee),_e=O.slice(X,B-Ee);return ee(Oe,le,_e,ve)}return null}function pe(b,O,_,I){return r(b,O,_,I,!0)}return pe.INSERT=e,pe.DELETE=n,pe.EQUAL=t,Ps=pe,Ps}var Rr={exports:{}};Rr.exports;var ba;function Io(){return ba||(ba=1,function(n,e){var t=200,r="__lodash_hash_undefined__",s=9007199254740991,i="[object Arguments]",a="[object Array]",l="[object Boolean]",c="[object Date]",u="[object Error]",f="[object Function]",p="[object GeneratorFunction]",h="[object Map]",g="[object Number]",y="[object Object]",v="[object Promise]",N="[object RegExp]",T="[object Set]",C="[object String]",x="[object Symbol]",q="[object WeakMap]",P="[object ArrayBuffer]",V="[object DataView]",F="[object Float32Array]",ee="[object Float64Array]",ce="[object Int8Array]",pe="[object Int16Array]",b="[object Int32Array]",O="[object Uint8Array]",_="[object Uint8ClampedArray]",I="[object Uint16Array]",k="[object Uint32Array]",L=/[\\^$.*+?()[\]{}|]/g,B=/\w*$/,M=/^\[object .+?Constructor\]$/,H=/^(?:0|[1-9]\d*)$/,$={};$[i]=$[a]=$[P]=$[V]=$[l]=$[c]=$[F]=$[ee]=$[ce]=$[pe]=$[b]=$[h]=$[g]=$[y]=$[N]=$[T]=$[C]=$[x]=$[O]=$[_]=$[I]=$[k]=!0,$[u]=$[f]=$[q]=!1;var te=typeof un=="object"&&un&&un.Object===Object&&un,J=typeof self=="object"&&self&&self.Object===Object&&self,ie=te||J||Function("return this")(),de=e&&!e.nodeType&&e,X=de&&!0&&n&&!n.nodeType&&n,Oe=X&&X.exports===de;function Le(o,d){return o.set(d[0],d[1]),o}function le(o,d){return o.add(d),o}function _e(o,d){for(var E=-1,w=o?o.length:0;++E<w&&d(o[E],E,o)!==!1;);return o}function fe(o,d){for(var E=-1,w=d.length,oe=o.length;++E<w;)o[oe+E]=d[E];return o}function Ee(o,d,E,w){for(var oe=-1,Q=o?o.length:0;++oe<Q;)E=d(E,o[oe],oe,o);return E}function ve(o,d){for(var E=-1,w=Array(o);++E<o;)w[E]=d(E);return w}function Ne(o,d){return o?.[d]}function De(o){var d=!1;if(o!=null&&typeof o.toString!="function")try{d=!!(o+"")}catch{}return d}function ze(o){var d=-1,E=Array(o.size);return o.forEach((function(w,oe){E[++d]=[oe,w]})),E}function yn(o,d){return function(E){return o(d(E))}}function Hn(o){var d=-1,E=Array(o.size);return o.forEach((function(w){E[++d]=w})),E}var fr=Array.prototype,gr=Function.prototype,$t=Object.prototype,_n=ie["__core-js_shared__"],zn=function(){var o=/[^.]+$/.exec(_n&&_n.keys&&_n.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),vn=gr.toString,je=$t.hasOwnProperty,Pt=$t.toString,It=RegExp("^"+vn.call(je).replace(L,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ct=Oe?ie.Buffer:void 0,Ut=ie.Symbol,Nn=ie.Uint8Array,rt=yn(Object.getPrototypeOf,Object),jn=Object.create,Kn=$t.propertyIsEnumerable,pr=fr.splice,Qt=Object.getOwnPropertySymbols,Xt=ct?ct.isBuffer:void 0,Gn=yn(Object.keys,Object),Jt=at(ie,"DataView"),yt=at(ie,"Map"),st=at(ie,"Promise"),Ft=at(ie,"Set"),Tn=at(ie,"WeakMap"),Rt=at(Object,"create"),ut=D(Jt),m=D(yt),S=D(st),U=D(Ft),re=D(Tn),Te=Ut?Ut.prototype:void 0,Ce=Te?Te.valueOf:void 0;function z(o){var d=-1,E=o?o.length:0;for(this.clear();++d<E;){var w=o[d];this.set(w[0],w[1])}}function j(){this.__data__=Rt?Rt(null):{}}function se(o){return this.has(o)&&delete this.__data__[o]}function Be(o){var d=this.__data__;if(Rt){var E=d[o];return E===r?void 0:E}return je.call(d,o)?d[o]:void 0}function Re(o){var d=this.__data__;return Rt?d[o]!==void 0:je.call(d,o)}function _t(o,d){var E=this.__data__;return E[o]=Rt&&d===void 0?r:d,this}z.prototype.clear=j,z.prototype.delete=se,z.prototype.get=Be,z.prototype.has=Re,z.prototype.set=_t;function $e(o){var d=-1,E=o?o.length:0;for(this.clear();++d<E;){var w=o[d];this.set(w[0],w[1])}}function An(){this.__data__=[]}function mr(o){var d=this.__data__,E=nn(d,o);if(E<0)return!1;var w=d.length-1;return E==w?d.pop():pr.call(d,E,1),!0}function wn(o){var d=this.__data__,E=nn(d,o);return E<0?void 0:d[E][1]}function br(o){return nn(this.__data__,o)>-1}function Er(o,d){var E=this.__data__,w=nn(E,o);return w<0?E.push([o,d]):E[w][1]=d,this}$e.prototype.clear=An,$e.prototype.delete=mr,$e.prototype.get=wn,$e.prototype.has=br,$e.prototype.set=Er;function Ke(o){var d=-1,E=o?o.length:0;for(this.clear();++d<E;){var w=o[d];this.set(w[0],w[1])}}function Vn(){this.__data__={hash:new z,map:new(yt||$e),string:new z}}function en(o){return Ve(this,o).delete(o)}function yr(o){return Ve(this,o).get(o)}function _r(o){return Ve(this,o).has(o)}function vr(o,d){return Ve(this,o).set(o,d),this}Ke.prototype.clear=Vn,Ke.prototype.delete=en,Ke.prototype.get=yr,Ke.prototype.has=_r,Ke.prototype.set=vr;function Ye(o){this.__data__=new $e(o)}function dt(){this.__data__=new $e}function Wn(o){return this.__data__.delete(o)}function Zn(o){return this.__data__.get(o)}function Nr(o){return this.__data__.has(o)}function Tr(o,d){var E=this.__data__;if(E instanceof $e){var w=E.__data__;if(!yt||w.length<t-1)return w.push([o,d]),this;E=this.__data__=new Ke(w)}return E.set(o,d),this}Ye.prototype.clear=dt,Ye.prototype.delete=Wn,Ye.prototype.get=Zn,Ye.prototype.has=Nr,Ye.prototype.set=Tr;function tn(o,d){var E=qe(o)||ge(o)?ve(o.length,String):[],w=E.length,oe=!!w;for(var Q in o)je.call(o,Q)&&!(oe&&(Q=="length"||sn(Q,w)))&&E.push(Q);return E}function Ht(o,d,E){var w=o[d];(!(je.call(o,d)&&ae(w,E))||E===void 0&&!(d in o))&&(o[d]=E)}function nn(o,d){for(var E=o.length;E--;)if(ae(o[E][0],d))return E;return-1}function R(o,d){return o&&On(d,Lr(d),o)}function Y(o,d,E,w,oe,Q,ye){var me;if(w&&(me=Q?w(o,oe,Q,ye):w(o)),me!==void 0)return me;if(!kt(o))return o;var Pe=qe(o);if(Pe){if(me=Xn(o),!d)return Sr(o,me)}else{var we=ne(o),Xe=we==f||we==p;if(Jn(o))return vt(o,d);if(we==y||we==i||Xe&&!Q){if(De(o))return Q?o:{};if(me=xe(Xe?{}:o),!d)return rn(o,R(me,o))}else{if(!$[we])return Q?o:{};me=Se(o,we,Y,d)}}ye||(ye=new Ye);var it=ye.get(o);if(it)return it;if(ye.set(o,me),!Pe)var Fe=E?Qn(o):Lr(o);return _e(Fe||o,(function(Je,We){Fe&&(We=Je,Je=o[We]),Ht(me,We,Y(Je,d,E,w,We,o,ye))})),me}function ue(o){return kt(o)?jn(o):{}}function Ae(o,d,E){var w=d(o);return qe(o)?w:fe(w,E(o))}function Me(o){return Pt.call(o)}function tt(o){if(!kt(o)||Ln(o))return!1;var d=Or(o)||De(o)?It:M;return d.test(D(o))}function ht(o){if(!an(o))return Gn(o);var d=[];for(var E in Object(o))je.call(o,E)&&E!="constructor"&&d.push(E);return d}function vt(o,d){if(d)return o.slice();var E=new o.constructor(o.length);return o.copy(E),E}function Ue(o){var d=new o.constructor(o.byteLength);return new Nn(d).set(new Nn(o)),d}function Ge(o,d){var E=d?Ue(o.buffer):o.buffer;return new o.constructor(E,o.byteOffset,o.byteLength)}function Sn(o,d,E){var w=d?E(ze(o),!0):ze(o);return Ee(w,Le,new o.constructor)}function xn(o){var d=new o.constructor(o.source,B.exec(o));return d.lastIndex=o.lastIndex,d}function Yn(o,d,E){var w=d?E(Hn(o),!0):Hn(o);return Ee(w,le,new o.constructor)}function Ar(o){return Ce?Object(Ce.call(o)):{}}function wr(o,d){var E=d?Ue(o.buffer):o.buffer;return new o.constructor(E,o.byteOffset,o.length)}function Sr(o,d){var E=-1,w=o.length;for(d||(d=Array(w));++E<w;)d[E]=o[E];return d}function On(o,d,E,w){E||(E={});for(var oe=-1,Q=d.length;++oe<Q;){var ye=d[oe],me=void 0;Ht(E,ye,me===void 0?o[ye]:me)}return E}function rn(o,d){return On(o,ot(o),d)}function Qn(o){return Ae(o,Lr,ot)}function Ve(o,d){var E=o.__data__;return Nt(d)?E[typeof d=="string"?"string":"hash"]:E.map}function at(o,d){var E=Ne(o,d);return tt(E)?E:void 0}var ot=Qt?yn(Qt,Object):Rs,ne=Me;(Jt&&ne(new Jt(new ArrayBuffer(1)))!=V||yt&&ne(new yt)!=h||st&&ne(st.resolve())!=v||Ft&&ne(new Ft)!=T||Tn&&ne(new Tn)!=q)&&(ne=function(o){var d=Pt.call(o),E=d==y?o.constructor:void 0,w=E?D(E):void 0;if(w)switch(w){case ut:return V;case m:return h;case S:return v;case U:return T;case re:return q}return d});function Xn(o){var d=o.length,E=o.constructor(d);return d&&typeof o[0]=="string"&&je.call(o,"index")&&(E.index=o.index,E.input=o.input),E}function xe(o){return typeof o.constructor=="function"&&!an(o)?ue(rt(o)):{}}function Se(o,d,E,w){var oe=o.constructor;switch(d){case P:return Ue(o);case l:case c:return new oe(+o);case V:return Ge(o,w);case F:case ee:case ce:case pe:case b:case O:case _:case I:case k:return wr(o,w);case h:return Sn(o,w,E);case g:case C:return new oe(o);case N:return xn(o);case T:return Yn(o,w,E);case x:return Ar(o)}}function sn(o,d){return d=d??s,!!d&&(typeof o=="number"||H.test(o))&&o>-1&&o%1==0&&o<d}function Nt(o){var d=typeof o;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?o!=="__proto__":o===null}function Ln(o){return!!zn&&zn in o}function an(o){var d=o&&o.constructor,E=typeof d=="function"&&d.prototype||$t;return o===E}function D(o){if(o!=null){try{return vn.call(o)}catch{}try{return o+""}catch{}}return""}function W(o){return Y(o,!0,!0)}function ae(o,d){return o===d||o!==o&&d!==d}function ge(o){return xr(o)&&je.call(o,"callee")&&(!Kn.call(o,"callee")||Pt.call(o)==i)}var qe=Array.isArray;function Qe(o){return o!=null&&Yr(o.length)&&!Or(o)}function xr(o){return Qr(o)&&Qe(o)}var Jn=Xt||ks;function Or(o){var d=kt(o)?Pt.call(o):"";return d==f||d==p}function Yr(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=s}function kt(o){var d=typeof o;return!!o&&(d=="object"||d=="function")}function Qr(o){return!!o&&typeof o=="object"}function Lr(o){return Qe(o)?tn(o):ht(o)}function Rs(){return[]}function ks(){return!1}n.exports=W}(Rr,Rr.exports)),Rr.exports}var kr={exports:{}};kr.exports;var Ea;function Ro(){return Ea||(Ea=1,function(n,e){var t=200,r="__lodash_hash_undefined__",s=1,i=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object AsyncFunction]",f="[object Boolean]",p="[object Date]",h="[object Error]",g="[object Function]",y="[object GeneratorFunction]",v="[object Map]",N="[object Number]",T="[object Null]",C="[object Object]",x="[object Promise]",q="[object Proxy]",P="[object RegExp]",V="[object Set]",F="[object String]",ee="[object Symbol]",ce="[object Undefined]",pe="[object WeakMap]",b="[object ArrayBuffer]",O="[object DataView]",_="[object Float32Array]",I="[object Float64Array]",k="[object Int8Array]",L="[object Int16Array]",B="[object Int32Array]",M="[object Uint8Array]",H="[object Uint8ClampedArray]",$="[object Uint16Array]",te="[object Uint32Array]",J=/[\\^$.*+?()[\]{}|]/g,ie=/^\[object .+?Constructor\]$/,de=/^(?:0|[1-9]\d*)$/,X={};X[_]=X[I]=X[k]=X[L]=X[B]=X[M]=X[H]=X[$]=X[te]=!0,X[l]=X[c]=X[b]=X[f]=X[O]=X[p]=X[h]=X[g]=X[v]=X[N]=X[C]=X[P]=X[V]=X[F]=X[pe]=!1;var Oe=typeof un=="object"&&un&&un.Object===Object&&un,Le=typeof self=="object"&&self&&self.Object===Object&&self,le=Oe||Le||Function("return this")(),_e=e&&!e.nodeType&&e,fe=_e&&!0&&n&&!n.nodeType&&n,Ee=fe&&fe.exports===_e,ve=Ee&&Oe.process,Ne=function(){try{return ve&&ve.binding&&ve.binding("util")}catch{}}(),De=Ne&&Ne.isTypedArray;function ze(o,d){for(var E=-1,w=o==null?0:o.length,oe=0,Q=[];++E<w;){var ye=o[E];d(ye,E,o)&&(Q[oe++]=ye)}return Q}function yn(o,d){for(var E=-1,w=d.length,oe=o.length;++E<w;)o[oe+E]=d[E];return o}function Hn(o,d){for(var E=-1,w=o==null?0:o.length;++E<w;)if(d(o[E],E,o))return!0;return!1}function fr(o,d){for(var E=-1,w=Array(o);++E<o;)w[E]=d(E);return w}function gr(o){return function(d){return o(d)}}function $t(o,d){return o.has(d)}function _n(o,d){return o?.[d]}function zn(o){var d=-1,E=Array(o.size);return o.forEach((function(w,oe){E[++d]=[oe,w]})),E}function vn(o,d){return function(E){return o(d(E))}}function je(o){var d=-1,E=Array(o.size);return o.forEach((function(w){E[++d]=w})),E}var Pt=Array.prototype,It=Function.prototype,ct=Object.prototype,Ut=le["__core-js_shared__"],Nn=It.toString,rt=ct.hasOwnProperty,jn=function(){var o=/[^.]+$/.exec(Ut&&Ut.keys&&Ut.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Kn=ct.toString,pr=RegExp("^"+Nn.call(rt).replace(J,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qt=Ee?le.Buffer:void 0,Xt=le.Symbol,Gn=le.Uint8Array,Jt=ct.propertyIsEnumerable,yt=Pt.splice,st=Xt?Xt.toStringTag:void 0,Ft=Object.getOwnPropertySymbols,Tn=Qt?Qt.isBuffer:void 0,Rt=vn(Object.keys,Object),ut=ot(le,"DataView"),m=ot(le,"Map"),S=ot(le,"Promise"),U=ot(le,"Set"),re=ot(le,"WeakMap"),Te=ot(Object,"create"),Ce=D(ut),z=D(m),j=D(S),se=D(U),Be=D(re),Re=Xt?Xt.prototype:void 0,_t=Re?Re.valueOf:void 0;function $e(o){var d=-1,E=o==null?0:o.length;for(this.clear();++d<E;){var w=o[d];this.set(w[0],w[1])}}function An(){this.__data__=Te?Te(null):{},this.size=0}function mr(o){var d=this.has(o)&&delete this.__data__[o];return this.size-=d?1:0,d}function wn(o){var d=this.__data__;if(Te){var E=d[o];return E===r?void 0:E}return rt.call(d,o)?d[o]:void 0}function br(o){var d=this.__data__;return Te?d[o]!==void 0:rt.call(d,o)}function Er(o,d){var E=this.__data__;return this.size+=this.has(o)?0:1,E[o]=Te&&d===void 0?r:d,this}$e.prototype.clear=An,$e.prototype.delete=mr,$e.prototype.get=wn,$e.prototype.has=br,$e.prototype.set=Er;function Ke(o){var d=-1,E=o==null?0:o.length;for(this.clear();++d<E;){var w=o[d];this.set(w[0],w[1])}}function Vn(){this.__data__=[],this.size=0}function en(o){var d=this.__data__,E=vt(d,o);if(E<0)return!1;var w=d.length-1;return E==w?d.pop():yt.call(d,E,1),--this.size,!0}function yr(o){var d=this.__data__,E=vt(d,o);return E<0?void 0:d[E][1]}function _r(o){return vt(this.__data__,o)>-1}function vr(o,d){var E=this.__data__,w=vt(E,o);return w<0?(++this.size,E.push([o,d])):E[w][1]=d,this}Ke.prototype.clear=Vn,Ke.prototype.delete=en,Ke.prototype.get=yr,Ke.prototype.has=_r,Ke.prototype.set=vr;function Ye(o){var d=-1,E=o==null?0:o.length;for(this.clear();++d<E;){var w=o[d];this.set(w[0],w[1])}}function dt(){this.size=0,this.__data__={hash:new $e,map:new(m||Ke),string:new $e}}function Wn(o){var d=at(this,o).delete(o);return this.size-=d?1:0,d}function Zn(o){return at(this,o).get(o)}function Nr(o){return at(this,o).has(o)}function Tr(o,d){var E=at(this,o),w=E.size;return E.set(o,d),this.size+=E.size==w?0:1,this}Ye.prototype.clear=dt,Ye.prototype.delete=Wn,Ye.prototype.get=Zn,Ye.prototype.has=Nr,Ye.prototype.set=Tr;function tn(o){var d=-1,E=o==null?0:o.length;for(this.__data__=new Ye;++d<E;)this.add(o[d])}function Ht(o){return this.__data__.set(o,r),this}function nn(o){return this.__data__.has(o)}tn.prototype.add=tn.prototype.push=Ht,tn.prototype.has=nn;function R(o){var d=this.__data__=new Ke(o);this.size=d.size}function Y(){this.__data__=new Ke,this.size=0}function ue(o){var d=this.__data__,E=d.delete(o);return this.size=d.size,E}function Ae(o){return this.__data__.get(o)}function Me(o){return this.__data__.has(o)}function tt(o,d){var E=this.__data__;if(E instanceof Ke){var w=E.__data__;if(!m||w.length<t-1)return w.push([o,d]),this.size=++E.size,this;E=this.__data__=new Ye(w)}return E.set(o,d),this.size=E.size,this}R.prototype.clear=Y,R.prototype.delete=ue,R.prototype.get=Ae,R.prototype.has=Me,R.prototype.set=tt;function ht(o,d){var E=ge(o),w=!E&&ae(o),oe=!E&&!w&&Qe(o),Q=!E&&!w&&!oe&&Qr(o),ye=E||w||oe||Q,me=ye?fr(o.length,String):[],Pe=me.length;for(var we in o)rt.call(o,we)&&!(ye&&(we=="length"||oe&&(we=="offset"||we=="parent")||Q&&(we=="buffer"||we=="byteLength"||we=="byteOffset")||Se(we,Pe)))&&me.push(we);return me}function vt(o,d){for(var E=o.length;E--;)if(W(o[E][0],d))return E;return-1}function Ue(o,d,E){var w=d(o);return ge(o)?w:yn(w,E(o))}function Ge(o){return o==null?o===void 0?ce:T:st&&st in Object(o)?ne(o):an(o)}function Sn(o){return kt(o)&&Ge(o)==l}function xn(o,d,E,w,oe){return o===d?!0:o==null||d==null||!kt(o)&&!kt(d)?o!==o&&d!==d:Yn(o,d,E,w,xn,oe)}function Yn(o,d,E,w,oe,Q){var ye=ge(o),me=ge(d),Pe=ye?c:xe(o),we=me?c:xe(d);Pe=Pe==l?C:Pe,we=we==l?C:we;var Xe=Pe==C,it=we==C,Fe=Pe==we;if(Fe&&Qe(o)){if(!Qe(d))return!1;ye=!0,Xe=!1}if(Fe&&!Xe)return Q||(Q=new R),ye||Qr(o)?On(o,d,E,w,oe,Q):rn(o,d,Pe,E,w,oe,Q);if(!(E&s)){var Je=Xe&&rt.call(o,"__wrapped__"),We=it&&rt.call(d,"__wrapped__");if(Je||We){var on=Je?o.value():o,zt=We?d.value():d;return Q||(Q=new R),oe(on,zt,E,w,Q)}}return Fe?(Q||(Q=new R),Qn(o,d,E,w,oe,Q)):!1}function Ar(o){if(!Yr(o)||Nt(o))return!1;var d=Jn(o)?pr:ie;return d.test(D(o))}function wr(o){return kt(o)&&Or(o.length)&&!!X[Ge(o)]}function Sr(o){if(!Ln(o))return Rt(o);var d=[];for(var E in Object(o))rt.call(o,E)&&E!="constructor"&&d.push(E);return d}function On(o,d,E,w,oe,Q){var ye=E&s,me=o.length,Pe=d.length;if(me!=Pe&&!(ye&&Pe>me))return!1;var we=Q.get(o);if(we&&Q.get(d))return we==d;var Xe=-1,it=!0,Fe=E&i?new tn:void 0;for(Q.set(o,d),Q.set(d,o);++Xe<me;){var Je=o[Xe],We=d[Xe];if(w)var on=ye?w(We,Je,Xe,d,o,Q):w(Je,We,Xe,o,d,Q);if(on!==void 0){if(on)continue;it=!1;break}if(Fe){if(!Hn(d,(function(zt,Cn){if(!$t(Fe,Cn)&&(Je===zt||oe(Je,zt,E,w,Q)))return Fe.push(Cn)}))){it=!1;break}}else if(!(Je===We||oe(Je,We,E,w,Q))){it=!1;break}}return Q.delete(o),Q.delete(d),it}function rn(o,d,E,w,oe,Q,ye){switch(E){case O:if(o.byteLength!=d.byteLength||o.byteOffset!=d.byteOffset)return!1;o=o.buffer,d=d.buffer;case b:return!(o.byteLength!=d.byteLength||!Q(new Gn(o),new Gn(d)));case f:case p:case N:return W(+o,+d);case h:return o.name==d.name&&o.message==d.message;case P:case F:return o==d+"";case v:var me=zn;case V:var Pe=w&s;if(me||(me=je),o.size!=d.size&&!Pe)return!1;var we=ye.get(o);if(we)return we==d;w|=i,ye.set(o,d);var Xe=On(me(o),me(d),w,oe,Q,ye);return ye.delete(o),Xe;case ee:if(_t)return _t.call(o)==_t.call(d)}return!1}function Qn(o,d,E,w,oe,Q){var ye=E&s,me=Ve(o),Pe=me.length,we=Ve(d),Xe=we.length;if(Pe!=Xe&&!ye)return!1;for(var it=Pe;it--;){var Fe=me[it];if(!(ye?Fe in d:rt.call(d,Fe)))return!1}var Je=Q.get(o);if(Je&&Q.get(d))return Je==d;var We=!0;Q.set(o,d),Q.set(d,o);for(var on=ye;++it<Pe;){Fe=me[it];var zt=o[Fe],Cn=d[Fe];if(w)var $i=ye?w(Cn,zt,Fe,d,o,Q):w(zt,Cn,Fe,o,d,Q);if(!($i===void 0?zt===Cn||oe(zt,Cn,E,w,Q):$i)){We=!1;break}on||(on=Fe=="constructor")}if(We&&!on){var Xr=o.constructor,Jr=d.constructor;Xr!=Jr&&"constructor"in o&&"constructor"in d&&!(typeof Xr=="function"&&Xr instanceof Xr&&typeof Jr=="function"&&Jr instanceof Jr)&&(We=!1)}return Q.delete(o),Q.delete(d),We}function Ve(o){return Ue(o,Lr,Xn)}function at(o,d){var E=o.__data__;return sn(d)?E[typeof d=="string"?"string":"hash"]:E.map}function ot(o,d){var E=_n(o,d);return Ar(E)?E:void 0}function ne(o){var d=rt.call(o,st),E=o[st];try{o[st]=void 0;var w=!0}catch{}var oe=Kn.call(o);return w&&(d?o[st]=E:delete o[st]),oe}var Xn=Ft?function(o){return o==null?[]:(o=Object(o),ze(Ft(o),(function(d){return Jt.call(o,d)})))}:Rs,xe=Ge;(ut&&xe(new ut(new ArrayBuffer(1)))!=O||m&&xe(new m)!=v||S&&xe(S.resolve())!=x||U&&xe(new U)!=V||re&&xe(new re)!=pe)&&(xe=function(o){var d=Ge(o),E=d==C?o.constructor:void 0,w=E?D(E):"";if(w)switch(w){case Ce:return O;case z:return v;case j:return x;case se:return V;case Be:return pe}return d});function Se(o,d){return d=d??a,!!d&&(typeof o=="number"||de.test(o))&&o>-1&&o%1==0&&o<d}function sn(o){var d=typeof o;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?o!=="__proto__":o===null}function Nt(o){return!!jn&&jn in o}function Ln(o){var d=o&&o.constructor,E=typeof d=="function"&&d.prototype||ct;return o===E}function an(o){return Kn.call(o)}function D(o){if(o!=null){try{return Nn.call(o)}catch{}try{return o+""}catch{}}return""}function W(o,d){return o===d||o!==o&&d!==d}var ae=Sn(function(){return arguments}())?Sn:function(o){return kt(o)&&rt.call(o,"callee")&&!Jt.call(o,"callee")},ge=Array.isArray;function qe(o){return o!=null&&Or(o.length)&&!Jn(o)}var Qe=Tn||ks;function xr(o,d){return xn(o,d)}function Jn(o){if(!Yr(o))return!1;var d=Ge(o);return d==g||d==y||d==u||d==q}function Or(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=a}function Yr(o){var d=typeof o;return o!=null&&(d=="object"||d=="function")}function kt(o){return o!=null&&typeof o=="object"}var Qr=De?gr(De):wr;function Lr(o){return qe(o)?ht(o):Sr(o)}function Rs(){return[]}function ks(){return!1}n.exports=xr}(kr,kr.exports)),kr.exports}var ns={},ya;function mf(){if(ya)return ns;ya=1,Object.defineProperty(ns,"__esModule",{value:!0});const n=Io(),e=Ro();var t;return function(r){function s(c={},u={},f=!1){typeof c!="object"&&(c={}),typeof u!="object"&&(u={});let p=n(u);f||(p=Object.keys(p).reduce(((h,g)=>(p[g]!=null&&(h[g]=p[g]),h)),{}));for(const h in c)c[h]!==void 0&&u[h]===void 0&&(p[h]=c[h]);return Object.keys(p).length>0?p:void 0}r.compose=s;function i(c={},u={}){typeof c!="object"&&(c={}),typeof u!="object"&&(u={});const f=Object.keys(c).concat(Object.keys(u)).reduce(((p,h)=>(e(c[h],u[h])||(p[h]=u[h]===void 0?null:u[h]),p)),{});return Object.keys(f).length>0?f:void 0}r.diff=i;function a(c={},u={}){c=c||{};const f=Object.keys(u).reduce(((p,h)=>(u[h]!==c[h]&&c[h]!==void 0&&(p[h]=u[h]),p)),{});return Object.keys(c).reduce(((p,h)=>(c[h]!==u[h]&&u[h]===void 0&&(p[h]=null),p)),f)}r.invert=a;function l(c,u,f=!1){if(typeof c!="object")return u;if(typeof u!="object")return;if(!f)return u;const p=Object.keys(u).reduce(((h,g)=>(c[g]===void 0&&(h[g]=u[g]),h)),{});return Object.keys(p).length>0?p:void 0}r.transform=l}(t||(t={})),ns.default=t,ns}var rs={},_a;function ko(){if(_a)return rs;_a=1,Object.defineProperty(rs,"__esModule",{value:!0});var n;return function(e){function t(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}e.length=t}(n||(n={})),rs.default=n,rs}var ss={},va;function bf(){if(va)return ss;va=1,Object.defineProperty(ss,"__esModule",{value:!0});const n=ko();class e{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const s=this.ops[this.index];if(s){const i=this.offset,a=n.default.length(s);if(r>=a-i?(r=a-i,this.index+=1,this.offset=0):this.offset+=r,typeof s.delete=="number")return{delete:r};{const l={};return s.attributes&&(l.attributes=s.attributes),typeof s.retain=="number"?l.retain=r:typeof s.retain=="object"&&s.retain!==null?l.retain=s.retain:typeof s.insert=="string"?l.insert=s.insert.substr(i,r):l.insert=s.insert,l}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?n.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,s=this.index,i=this.next(),a=this.ops.slice(this.index);return this.offset=r,this.index=s,[i].concat(a)}}else return[]}}return ss.default=e,ss}var Na;function Ef(){return Na||(Na=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=pf(),r=Io(),s=Ro(),i=mf();e.AttributeMap=i.default;const a=ko();e.Op=a.default;const l=bf();e.OpIterator=l.default;const c="\0",u=(p,h)=>{if(typeof p!="object"||p===null)throw new Error(`cannot retain a ${typeof p}`);if(typeof h!="object"||h===null)throw new Error(`cannot retain a ${typeof h}`);const g=Object.keys(p)[0];if(!g||g!==Object.keys(h)[0])throw new Error(`embed types not matched: ${g} != ${Object.keys(h)[0]}`);return[g,p[g],h[g]]};class f{constructor(h){Array.isArray(h)?this.ops=h:h!=null&&Array.isArray(h.ops)?this.ops=h.ops:this.ops=[]}static registerEmbed(h,g){this.handlers[h]=g}static unregisterEmbed(h){delete this.handlers[h]}static getHandler(h){const g=this.handlers[h];if(!g)throw new Error(`no handlers for embed type "${h}"`);return g}insert(h,g){const y={};return typeof h=="string"&&h.length===0?this:(y.insert=h,g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(y.attributes=g),this.push(y))}delete(h){return h<=0?this:this.push({delete:h})}retain(h,g){if(typeof h=="number"&&h<=0)return this;const y={retain:h};return g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(y.attributes=g),this.push(y)}push(h){let g=this.ops.length,y=this.ops[g-1];if(h=r(h),typeof y=="object"){if(typeof h.delete=="number"&&typeof y.delete=="number")return this.ops[g-1]={delete:y.delete+h.delete},this;if(typeof y.delete=="number"&&h.insert!=null&&(g-=1,y=this.ops[g-1],typeof y!="object"))return this.ops.unshift(h),this;if(s(h.attributes,y.attributes)){if(typeof h.insert=="string"&&typeof y.insert=="string")return this.ops[g-1]={insert:y.insert+h.insert},typeof h.attributes=="object"&&(this.ops[g-1].attributes=h.attributes),this;if(typeof h.retain=="number"&&typeof y.retain=="number")return this.ops[g-1]={retain:y.retain+h.retain},typeof h.attributes=="object"&&(this.ops[g-1].attributes=h.attributes),this}}return g===this.ops.length?this.ops.push(h):this.ops.splice(g,0,h),this}chop(){const h=this.ops[this.ops.length-1];return h&&typeof h.retain=="number"&&!h.attributes&&this.ops.pop(),this}filter(h){return this.ops.filter(h)}forEach(h){this.ops.forEach(h)}map(h){return this.ops.map(h)}partition(h){const g=[],y=[];return this.forEach((v=>{(h(v)?g:y).push(v)})),[g,y]}reduce(h,g){return this.ops.reduce(h,g)}changeLength(){return this.reduce(((h,g)=>g.insert?h+a.default.length(g):g.delete?h-g.delete:h),0)}length(){return this.reduce(((h,g)=>h+a.default.length(g)),0)}slice(h=0,g=1/0){const y=[],v=new l.default(this.ops);let N=0;for(;N<g&&v.hasNext();){let T;N<h?T=v.next(h-N):(T=v.next(g-N),y.push(T)),N+=a.default.length(T)}return new f(y)}compose(h){const g=new l.default(this.ops),y=new l.default(h.ops),v=[],N=y.peek();if(N!=null&&typeof N.retain=="number"&&N.attributes==null){let C=N.retain;for(;g.peekType()==="insert"&&g.peekLength()<=C;)C-=g.peekLength(),v.push(g.next());N.retain-C>0&&y.next(N.retain-C)}const T=new f(v);for(;g.hasNext()||y.hasNext();)if(y.peekType()==="insert")T.push(y.next());else if(g.peekType()==="delete")T.push(g.next());else{const C=Math.min(g.peekLength(),y.peekLength()),x=g.next(C),q=y.next(C);if(q.retain){const P={};if(typeof x.retain=="number")P.retain=typeof q.retain=="number"?C:q.retain;else if(typeof q.retain=="number")x.retain==null?P.insert=x.insert:P.retain=x.retain;else{const F=x.retain==null?"insert":"retain",[ee,ce,pe]=u(x[F],q.retain),b=f.getHandler(ee);P[F]={[ee]:b.compose(ce,pe,F==="retain")}}const V=i.default.compose(x.attributes,q.attributes,typeof x.retain=="number");if(V&&(P.attributes=V),T.push(P),!y.hasNext()&&s(T.ops[T.ops.length-1],P)){const F=new f(g.rest());return T.concat(F).chop()}}else typeof q.delete=="number"&&(typeof x.retain=="number"||typeof x.retain=="object"&&x.retain!==null)&&T.push(q)}return T.chop()}concat(h){const g=new f(this.ops.slice());return h.ops.length>0&&(g.push(h.ops[0]),g.ops=g.ops.concat(h.ops.slice(1))),g}diff(h,g){if(this.ops===h.ops)return new f;const y=[this,h].map((x=>x.map((q=>{if(q.insert!=null)return typeof q.insert=="string"?q.insert:c;const P=x===h?"on":"with";throw new Error("diff() called "+P+" non-document")})).join(""))),v=new f,N=t(y[0],y[1],g,!0),T=new l.default(this.ops),C=new l.default(h.ops);return N.forEach((x=>{let q=x[1].length;for(;q>0;){let P=0;switch(x[0]){case t.INSERT:P=Math.min(C.peekLength(),q),v.push(C.next(P));break;case t.DELETE:P=Math.min(q,T.peekLength()),T.next(P),v.delete(P);break;case t.EQUAL:P=Math.min(T.peekLength(),C.peekLength(),q);const V=T.next(P),F=C.next(P);s(V.insert,F.insert)?v.retain(P,i.default.diff(V.attributes,F.attributes)):v.push(F).delete(P);break}q-=P}})),v.chop()}eachLine(h,g=`\n`){const y=new l.default(this.ops);let v=new f,N=0;for(;y.hasNext();){if(y.peekType()!=="insert")return;const T=y.peek(),C=a.default.length(T)-y.peekLength(),x=typeof T.insert=="string"?T.insert.indexOf(g,C)-C:-1;if(x<0)v.push(y.next());else if(x>0)v.push(y.next(x));else{if(h(v,y.next(1).attributes||{},N)===!1)return;N+=1,v=new f}}v.length()>0&&h(v,{},N)}invert(h){const g=new f;return this.reduce(((y,v)=>{if(v.insert)g.delete(a.default.length(v));else{if(typeof v.retain=="number"&&v.attributes==null)return g.retain(v.retain),y+v.retain;if(v.delete||typeof v.retain=="number"){const N=v.delete||v.retain;return h.slice(y,y+N).forEach((C=>{v.delete?g.push(C):v.retain&&v.attributes&&g.retain(a.default.length(C),i.default.invert(v.attributes,C.attributes))})),y+N}else if(typeof v.retain=="object"&&v.retain!==null){const N=h.slice(y,y+1),T=new l.default(N.ops).next(),[C,x,q]=u(v.retain,T.insert),P=f.getHandler(C);return g.retain({[C]:P.invert(x,q)},i.default.invert(v.attributes,T.attributes)),y+1}}return y}),0),g.chop()}transform(h,g=!1){if(g=!!g,typeof h=="number")return this.transformPosition(h,g);const y=h,v=new l.default(this.ops),N=new l.default(y.ops),T=new f;for(;v.hasNext()||N.hasNext();)if(v.peekType()==="insert"&&(g||N.peekType()!=="insert"))T.retain(a.default.length(v.next()));else if(N.peekType()==="insert")T.push(N.next());else{const C=Math.min(v.peekLength(),N.peekLength()),x=v.next(C),q=N.next(C);if(x.delete)continue;if(q.delete)T.push(q);else{const P=x.retain,V=q.retain;let F=typeof V=="object"&&V!==null?V:C;if(typeof P=="object"&&P!==null&&typeof V=="object"&&V!==null){const ee=Object.keys(P)[0];if(ee===Object.keys(V)[0]){const ce=f.getHandler(ee);ce&&(F={[ee]:ce.transform(P[ee],V[ee],g)})}}T.retain(F,i.default.transform(x.attributes,q.attributes,g))}}return T.chop()}transformPosition(h,g=!1){g=!!g;const y=new l.default(this.ops);let v=0;for(;y.hasNext()&&v<=h;){const N=y.peekLength(),T=y.peekType();if(y.next(),T==="delete"){h-=Math.min(N,h-v);continue}else T==="insert"&&(v<h||!g)&&(h+=N);v+=N}return h}}f.Op=a.default,f.OpIterator=l.default,f.AttributeMap=i.default,f.handlers={},e.default=f,n.exports=f,n.exports.default=f}(ts,ts.exports)),ts.exports}var Et=Ef();const K=wi(Et);class Ct extends lt{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Ct.blotName="break";Ct.tagName="BR";let Ot=class extends bs{};const yf={"&":"&","<":"<",">":">",'"':""","'":"'"};function xs(n){return n.replace(/[&<>"']/g,(e=>yf[e]))}let bn=class In extends Ti{static allowedChildren=[In,Ct,lt,Ot];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(e,t){const r=In.order.indexOf(e),s=In.order.indexOf(t);return r>=0||s>=0?r-s:e===t?0:e<t?-1:1}formatAt(e,t,r,s){if(In.compare(this.statics.blotName,r)<0&&this.scroll.query(r,Z.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 In&&In.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 Ta=1;class Ze extends Ur{cache={};delta(){return this.cache.delta==null&&(this.cache.delta=Mo(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,r,s){t<=0||(this.scroll.query(r,Z.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(((l,c)=>(a=a.split(l,!0),a.insertAt(0,c),c.length)),e+i.length)}insertBefore(e,t){const{head:r}=this.children;super.insertBefore(e,t),r instanceof Ct&&r.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+Ta),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()-Ta)){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}}Ze.blotName="block";Ze.tagName="P";Ze.defaultChild=Ct;Ze.allowedChildren=[Ct,bn,lt,Ot];let bt=class extends lt{attach(){super.attach(),this.attributes=new ws(this.domNode)}delta(){return(new K).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const r=this.scroll.query(e,Z.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(Ze.blotName);return u.insertAt(0,c),u})),l=this.split(e);a.forEach((c=>{this.parent.insertBefore(c,l)})),i&&this.parent.insertBefore(this.scroll.create("text",i),l)}};bt.scope=Z.BLOCK_BLOT;function Mo(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.descendants(et).reduce(((t,r)=>r.length()===0?t:t.insert(r.value(),pt(r,{},e))),new K).insert(`\n`,pt(n))}function pt(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:pt(n.parent,e,t)}class wt extends lt{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(wt.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!==Z.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=wt.CONTENTS.length,r.optimize(),r.formatAt(s,wt.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 Ot?this.prev:null,r=t?t.length():0,s=this.next instanceof Ot?this.next:null,i=s?s.text:"",{textNode:a}=this,l=a.data.split(wt.CONTENTS).join("");a.data=wt.CONTENTS;let c;if(t)c=t,(l||s)&&(t.insertAt(t.length(),l+i),s&&s.remove());else if(s)c=s,s.insertAt(0,l);else{const u=document.createTextNode(l);c=this.scroll.create(u),this.parent.insertBefore(c,this)}if(this.remove(),e){const u=(h,g)=>t&&h===t.domNode?g:h===a?r+g-1:s&&h===s.domNode?r+l.length+g:null,f=u(e.start.node,e.start.offset),p=u(e.end.node,e.end.offset);if(f!==null&&p!==null)return{startNode:c.domNode,startOffset:f,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=wt.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}}var Us={exports:{}},Aa;function _f(){return Aa||(Aa=1,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,f){this.fn=c,this.context=u,this.once=f||!1}function i(c,u,f,p,h){if(typeof f!="function")throw new TypeError("The listener must be a function");var g=new s(f,p||c,h),y=t?t+u:u;return c._events[y]?c._events[y].fn?c._events[y]=[c._events[y],g]:c._events[y].push(g):(c._events[y]=g,c._eventsCount++),c}function a(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],f,p;if(this._eventsCount===0)return u;for(p in f=this._events)e.call(f,p)&&u.push(t?p.slice(1):p);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=t?t+u:u,p=this._events[f];if(!p)return[];if(p.fn)return[p.fn];for(var h=0,g=p.length,y=new Array(g);h<g;h++)y[h]=p[h].fn;return y},l.prototype.listenerCount=function(u){var f=t?t+u:u,p=this._events[f];return p?p.fn?1:p.length:0},l.prototype.emit=function(u,f,p,h,g,y){var v=t?t+u:u;if(!this._events[v])return!1;var N=this._events[v],T=arguments.length,C,x;if(N.fn){switch(N.once&&this.removeListener(u,N.fn,void 0,!0),T){case 1:return N.fn.call(N.context),!0;case 2:return N.fn.call(N.context,f),!0;case 3:return N.fn.call(N.context,f,p),!0;case 4:return N.fn.call(N.context,f,p,h),!0;case 5:return N.fn.call(N.context,f,p,h,g),!0;case 6:return N.fn.call(N.context,f,p,h,g,y),!0}for(x=1,C=new Array(T-1);x<T;x++)C[x-1]=arguments[x];N.fn.apply(N.context,C)}else{var q=N.length,P;for(x=0;x<q;x++)switch(N[x].once&&this.removeListener(u,N[x].fn,void 0,!0),T){case 1:N[x].fn.call(N[x].context);break;case 2:N[x].fn.call(N[x].context,f);break;case 3:N[x].fn.call(N[x].context,f,p);break;case 4:N[x].fn.call(N[x].context,f,p,h);break;default:if(!C)for(P=1,C=new Array(T-1);P<T;P++)C[P-1]=arguments[P];N[x].fn.apply(N[x].context,C)}}return!0},l.prototype.on=function(u,f,p){return i(this,u,f,p,!1)},l.prototype.once=function(u,f,p){return i(this,u,f,p,!0)},l.prototype.removeListener=function(u,f,p,h){var g=t?t+u:u;if(!this._events[g])return this;if(!f)return a(this,g),this;var y=this._events[g];if(y.fn)y.fn===f&&(!h||y.once)&&(!p||y.context===p)&&a(this,g);else{for(var v=0,N=[],T=y.length;v<T;v++)(y[v].fn!==f||h&&!y[v].once||p&&y[v].context!==p)&&N.push(y[v]);N.length?this._events[g]=N.length===1?N[0]:N:a(this,g)}return this},l.prototype.removeAllListeners=function(u){var f;return u?(f=t?t+u:u,this._events[f]&&a(this,f)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=t,l.EventEmitter=l,n.exports=l}(Us)),Us.exports}var vf=_f();const Nf=wi(vf),di=new WeakMap,hi=["error","warn","log","info"];let fi="warn";function Do(n){if(fi&&hi.indexOf(n)<=hi.indexOf(fi)){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 Yt(n){return hi.reduce(((e,t)=>(e[t]=Do.bind(console,t,n),e)),{})}Yt.level=n=>{fi=n};Do.level=Yt.level;const Fs=Yt("quill:events"),Tf=["selectionchange","mousedown","mouseup","click"];Tf.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=di.get(s);i&&i.emitter&&i.emitter.handleDOM(...t)}))}))}));class G extends Nf{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",Fs.error)}emit(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Fs.log.call(Fs,...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:l}=i;(e.target===a||a.contains(e.target))&&l(e,...r)}))}listenDOM(e,t,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:r})}}const Hs=Yt("quill:selection");class Mn{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}}class Af{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 Mn(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,G.sources.USER),1)})),this.emitter.on(G.events.SCROLL_BEFORE_UPDATE,(()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(G.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((l=>l.type==="characterData"||l.type==="childList"||l.type==="attributes"&&l.target===this.root));this.update(a?G.sources.SILENT:s)}catch{}}))})),this.emitter.on(G.events.SCROLL_OPTIMIZE,((r,s)=>{if(s.range){const{startNode:i,startOffset:a,endNode:l,endOffset:c}=s.range;this.setNativeRange(i,a,l,c),this.update(G.sources.SILENT)}})),this.update(G.sources.SILENT)}handleComposition(){this.emitter.on(G.events.COMPOSITION_BEFORE_START,(()=>{this.composing=!0})),this.emitter.on(G.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(G.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,Z.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof et){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[f]=this.scroll.leaf(e+1);if(f){const[p]=this.scroll.line(e),[h]=this.scroll.line(e+1);p===h&&(i=f,a=0)}}[s,a]=i.position(a,!0);const l=document.createRange();if(t>0)return l.setStart(s,a),[i,a]=this.scroll.leaf(e+t),i==null?null:([s,a]=i.position(a,!0),l.setEnd(s,a),l.getBoundingClientRect());let c="left",u;if(s instanceof Text){if(!s.data.length)return null;a<s.data.length?(l.setStart(s,a),l.setEnd(s,a+1)):(l.setStart(s,a-1),l.setEnd(s,a),c="right"),u=l.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 Hs.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&&zs(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[l,c]=a,u=this.scroll.find(l,!0),f=u.offset(this.scroll);return c===0?f:u instanceof et?f+u.index(l,c):f+u.length()})),s=Math.min(Math.max(...r),this.scroll.length()-1),i=Math.min(s,...r);return new Mn(i,s-i)}normalizeNative(e){if(!zs(this.root,e.startContainer)||!e.collapsed&&!zs(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,l]=this.scroll.leaf(s);return a?a.position(l,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(Hs.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:l}=this.getNativeRange()||{};if(l==null||i||e!==l.startContainer||t!==l.startOffset||r!==l.endContainer||s!==l.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]:G.sources.API;if(typeof t=="string"&&(r=t,t=!1),Hs.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]:G.sources.USER;const t=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!Ni(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=[G.events.SELECTION_CHANGE,ar(this.lastRange),ar(t),e];this.emitter.emit(G.events.EDITOR_CHANGE,...i),e!==G.sources.SILENT&&this.emitter.emit(...i)}}}function zs(n,e){try{e.parentNode}catch{return!1}return n.contains(e)}const wf=/^[ -~]*$/;class Sf{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 Of(r.ops.slice()).reduce(((a,l)=>{const c=Et.Op.length(l);let u=l.attributes||{},f=!1,p=!1;if(l.insert!=null){if(s.retain(c),typeof l.insert=="string"){const y=l.insert;p=!y.endsWith(`\n`)&&(t<=a||!!this.scroll.descendant(bt,a)[0]),this.scroll.insertAt(a,y);const[v,N]=this.scroll.line(a);let T=hn({},pt(v));if(v instanceof Ze){const[C]=v.descendant(et,N);C&&(T=hn(T,pt(C)))}u=Et.AttributeMap.diff(T,u)||{}}else if(typeof l.insert=="object"){const y=Object.keys(l.insert)[0];if(y==null)return a;const v=this.scroll.query(y,Z.INLINE)!=null;if(v)(t<=a||this.scroll.descendant(bt,a)[0])&&(p=!0);else if(a>0){const[N,T]=this.scroll.descendant(et,a-1);N instanceof Ot?N.value()[T]!==`\n`&&(f=!0):N instanceof lt&&N.statics.scope===Z.INLINE_BLOT&&(f=!0)}if(this.scroll.insertAt(a,y,l.insert[y]),v){const[N]=this.scroll.descendant(et,a);if(N){const T=hn({},pt(N));u=Et.AttributeMap.diff(T,u)||{}}}}t+=c}else if(s.push(l),l.retain!==null&&typeof l.retain=="object"){const y=Object.keys(l.retain)[0];if(y==null)return a;this.scroll.updateEmbedAt(a,y,l.retain[y])}Object.keys(u).forEach((y=>{this.scroll.formatAt(a,c,y,u[y])}));const h=f?1:0,g=p?1:0;return t+=h+g,s.retain(h),s.delete(g),a+c+h+g}),0),s.reduce(((a,l)=>typeof l.delete=="number"?(this.scroll.deleteAt(a,l.delete),a):a+Et.Op.length(l)),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,ar(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,ar(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((l=>{const[c]=l;c instanceof Ze?r.push(c):c instanceof et&&s.push(c)})):(r=this.scroll.lines(e,t),s=this.scroll.descendants(et,e,t));const[i,a]=[r,s].map((l=>{const c=l.shift();if(c==null)return{};let u=pt(c);for(;Object.keys(u).length>0;){const f=l.shift();if(f==null)return u;u=xf(pt(f),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)?Fr(r,s,t,!0):Fr(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,ar(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!==Ze.blotName)return!1;const t=e;return t.children.length>1?!1:t.children.head instanceof Ct}removeFormat(e,t){const r=this.getText(e,t),[s,i]=this.scroll.line(e+t);let a=0,l=new K;s!=null&&(a=s.length()-i,l=s.delta().slice(i,i+a-1).insert(`\n`));const u=this.getContents(e,t+a).diff((new K).insert(r).concat(l)),f=(new K).retain(e).concat(u);return this.applyDelta(f)}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(wf)&&this.scroll.find(t[0].target)){const i=this.scroll.find(t[0].target),a=pt(i),l=i.offset(this.scroll),c=t[0].oldValue.replace(wt.CONTENTS,""),u=(new K).insert(c),f=(new K).insert(i.value()),p=r&&{oldRange:Sa(r.oldRange,-l),newRange:Sa(r.newRange,-l)};e=(new K).retain(l).concat(u.diff(f,p)).reduce(((g,y)=>y.insert?g.insert(y.insert,a):g.push(y)),new K),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!Ni(s.compose(e),this.delta))&&(e=s.diff(this.delta,r));return e}}function sr(n,e,t){if(n.length===0){const[g]=js(t.pop());return e<=0?`</li></${g}>`:`</li></${g}>${sr([],e-1,t)}`}const[{child:r,offset:s,length:i,indent:a,type:l},...c]=n,[u,f]=js(l);if(a>e)return t.push(l),a===e+1?`<${u}><li${f}>${Fr(r,s,i)}${sr(c,a,t)}`:`<${u}><li>${sr(n,e+1,t)}`;const p=t[t.length-1];if(a===e&&l===p)return`</li><li${f}>${Fr(r,s,i)}${sr(c,a,t)}`;const[h]=js(t.pop());return`</li></${h}>${sr(n,e-1,t)}`}function Fr(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 Ot)return xs(n.value().slice(e,e+t)).replaceAll(" "," ");if(n instanceof xt){if(n.statics.blotName==="list-container"){const u=[];return n.children.forEachAt(e,t,((f,p,h)=>{const g="formats"in f&&typeof f.formats=="function"?f.formats():{};u.push({child:f,offset:p,length:h,indent:g.indent||0,type:g.list})})),sr(u,-1,[])}const s=[];if(n.children.forEachAt(e,t,((u,f,p)=>{s.push(Fr(u,f,p))})),r||n.statics.blotName==="list")return s.join("");const{outerHTML:i,innerHTML:a}=n.domNode,[l,c]=i.split(`>${a}<`);return l==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${c}`:`${l}>${s.join("")}<${c}`}return n.domNode instanceof Element?n.domNode.outerHTML:""}function xf(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 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 Sa(n,e){let{index:t,length:r}=n;return new Mn(t+e,r)}function Of(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 qt{static DEFAULTS={};constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}}const is="\ufeff";class Si extends lt{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(is),this.rightGuard=document.createTextNode(is),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(is).join("");if(e===this.leftGuard)if(this.prev instanceof Ot){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 Ot?(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=is,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 Lf{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 Si)&&(this.emitter.emit(G.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(G.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(G.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(G.events.COMPOSITION_END,e),this.isComposing=!1}}class hr{static DEFAULTS={modules:{}};static themes={default:hr};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 Cf=n=>n.parentElement||n.getRootNode().host||null,If=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}},as=n=>{const e=parseInt(n,10);return Number.isNaN(e)?0:e},xa=(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,Rf=(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}:If(s),l=getComputedStyle(s),c=xa(r.left,r.right,a.left,a.right,as(l.scrollPaddingLeft),as(l.scrollPaddingRight)),u=xa(r.top,r.bottom,a.top,a.bottom,as(l.scrollPaddingTop),as(l.scrollPaddingBottom));if(c||u)if(i)t.defaultView?.scrollBy(c,u);else{const{scrollLeft:f,scrollTop:p}=s;u&&(s.scrollTop+=u),c&&(s.scrollLeft+=c);const h=s.scrollLeft-f,g=s.scrollTop-p;r={left:r.left-h,top:r.top-g,right:r.right-h,bottom:r.bottom-g}}s=i||l.position==="fixed"?null:Cf(s)}},kf=100,Mf=["block","break","cursor","inline","scroll","text"],Df=(n,e,t)=>{const r=new ur;return Mf.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>kf){t.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}})),r},lr=Yt("quill"),os=new ur;xt.uiClass="ql-ui";class A{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:os,theme:"default"};static events=G.events;static sources=G.sources;static version="2.0.3";static imports={delta:K,parchment:gf,"core/module":qt,"core/theme":hr};static debug(e){e===!0&&(e="log"),Yt.level(e)}static find(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return di.get(e)||os.find(e,t)}static import(e){return this.imports[e]==null&&lr.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&&lr.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&os.register(t),typeof t.register=="function"&&t.register(os)}}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=Bf(e,t),this.container=this.options.container,this.container==null){lr.error("Invalid Quill container",e);return}this.options.debug&&A.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",di.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new G;const s=Ai.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 Sf(this.scroll),this.selection=new Af(this.scroll,this.emitter),this.composition=new Lf(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(G.events.EDITOR_CHANGE,(a=>{a===G.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())})),this.emitter.on(G.events.SCROLL_UPDATE,((a,l)=>{const c=this.selection.lastRange,[u]=this.selection.getRange(),f=c&&u?{oldRange:c,newRange:u}:void 0;Tt.call(this,(()=>this.editor.update(null,l,f)),a)})),this.emitter.on(G.events.SCROLL_EMBED_UPDATE,((a,l)=>{const c=this.selection.lastRange,[u]=this.selection.getRange(),f=c&&u?{oldRange:c,newRange:u}:void 0;Tt.call(this,(()=>{const p=(new K).retain(a.offset(this)).retain({[a.statics.blotName]:l});return this.editor.update(p,[],f)}),A.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]=jt(e,t,r),Tt.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]:G.sources.API;return Tt.call(this,(()=>{const s=this.getSelection(!0);let i=new K;if(s==null)return i;if(this.scroll.query(e,Z.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,G.sources.SILENT),i}),r)}formatLine(e,t,r,s,i){let a;return[e,t,a,i]=jt(e,t,r,s,i),Tt.call(this,(()=>this.editor.formatLine(e,t,a)),i,e,0)}formatText(e,t,r,s,i){let a;return[e,t,a,i]=jt(e,t,r,s,i),Tt.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]=jt(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]=jt(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]=jt(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]:A.sources.API;return Tt.call(this,(()=>this.editor.insertEmbed(e,t,r)),s,e)}insertText(e,t,r,s,i){let a;return[e,,a,i]=jt(e,0,r,s,i),Tt.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]=jt(e,t,r),Tt.call(this,(()=>this.editor.removeFormat(e,t)),r,e)}scrollRectIntoView(e){Rf(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]:G.sources.API;return Tt.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||A.sources.API):([e,t,,r]=jt(e,t,r),this.selection.setRange(new Mn(Math.max(0,e),t),r),r!==G.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:G.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]:G.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]:G.sources.API;return Tt.call(this,(()=>(e=new K(e),this.editor.applyDelta(e))),t,!0)}}function Oa(n){return typeof n=="string"?document.querySelector(n):n}function Ks(n){return Object.entries(n??{}).reduce(((e,t)=>{let[r,s]=t;return{...e,[r]:s===!0?{}:s}}),{})}function La(n){return Object.fromEntries(Object.entries(n).filter((e=>e[1]!==void 0)))}function Bf(n,e){const t=Oa(n);if(!t)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===A.DEFAULTS.theme?hr:A.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:i,...a}=A.DEFAULTS,{modules:l,...c}=s.DEFAULTS;let u=Ks(e.modules);u!=null&&u.toolbar&&u.toolbar.constructor!==Object&&(u={...u,toolbar:{container:u.toolbar}});const f=hn({},Ks(i),Ks(l),u),p={...a,...La(c),...La(e)};let h=e.registry;return h?e.formats&&lr.warn('Ignoring "formats" option because "registry" is specified'):h=e.formats?Df(e.formats,p.registry,lr):p.registry,{...p,registry:h,container:t,theme:s,modules:Object.entries(f).reduce(((g,y)=>{let[v,N]=y;if(!N)return g;const T=A.import(`modules/${v}`);return T==null?(lr.error(`Cannot load ${v} module. Are you sure you registered it?`),g):{...g,[v]:hn({},T.DEFAULTS||{},N)}}),{}),bounds:Oa(p.bounds)}}function Tt(n,e,t,r){if(!this.isEnabled()&&e===G.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=Ca(s,a,e):r!==0&&(s=Ca(s,t,r,e)),this.setSelection(s,G.sources.SILENT)),a.length()>0){const l=[G.events.TEXT_CHANGE,a,i,e];this.emitter.emit(G.events.EDITOR_CHANGE,...l),e!==G.sources.SILENT&&this.emitter.emit(...l)}return a}function jt(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||G.sources.API,[n,e,i,s]}function Ca(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((l=>e.transformPosition(l,r!==G.sources.USER))):[i,a]=[n.index,n.index+n.length].map((l=>l<e||l===e&&r===G.sources.USER?l:s>=0?l+s:Math.max(e,l+s))),new Mn(i,a-i)}class Pn extends Ss{}function Ia(n){return n instanceof Ze||n instanceof bt}function Ra(n){return typeof n.updateContent=="function"}class qf extends Ai{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=Ze;static allowedChildren=[Ze,bt,Pn];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(G.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(G.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(G.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 bt||i instanceof bt){this.optimize();return}const a=i.children.head instanceof Ct?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,Z.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===Z.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(bt,e)[0]&&e<this.length()),u=i.type==="block"?i.delta:(new K).insert({[i.key]:i.value});Gs(this,e,u);const f=i.type==="block"?1:0,p=e+u.length()+f;c&&this.insertAt(p-1,`\n`);const h=pt(this.line(e)[0]),g=Et.AttributeMap.diff(h,i.attributes)||{};Object.keys(g).forEach((y=>{this.formatAt(p-1,1,y,g[y])})),e=p}let[a,l]=this.children.find(e);if(r.length&&(a&&(a=a.split(l),l=0),r.forEach((c=>{if(c.type==="block"){const u=this.createBlock(c.attributes,a||void 0);Gs(u,0,c.delta)}else{const u=this.create(c.key,c.value);this.insertBefore(u,a||void 0),Object.keys(c.attributes).forEach((f=>{u.format(f,c.attributes[f])}))}}))),s.type==="block"&&s.delta.length()){const c=a?a.offset(a.scroll)+l:this.length();Gs(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 et?[r,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(Ia,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 l=[],c=a;return s.children.forEachAt(i,a,((u,f,p)=>{Ia(u)?l.push(u):u instanceof Ss&&(l=l.concat(r(u,f,c))),c-=p})),l};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(G.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=G.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&&!Ra(i)})),e.length>0&&this.emitter.emit(G.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(G.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,r){const[s]=this.descendant((i=>i instanceof bt),e);s&&s.statics.blotName===t&&Ra(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 l=a[a.length-1];l&&r.insert(l,s.attributes)}else{const a=Object.keys(i)[0];if(!a)return;this.query(a,Z.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((l=>{let[c,u]=l;this.query(c,Z.BLOCK&Z.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((l=>{let[c,u]=l;i.formatAt(0,a,c,u)})),i}}function Gs(n,e,t){t.reduce(((r,s)=>{const i=Et.Op.length(s);let a=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const l=s.insert;n.insertAt(r,l);const[c]=n.descendant(et,r),u=pt(c);a=Et.AttributeMap.diff(u,a)||{}}else if(typeof s.insert=="object"){const l=Object.keys(s.insert)[0];if(l==null)return r;if(n.insertAt(r,l,s.insert[l]),n.scroll.query(l,Z.INLINE)!=null){const[u]=n.descendant(et,r),f=pt(u);a=Et.AttributeMap.diff(f,a)||{}}}}return Object.keys(a).forEach((l=>{n.formatAt(r,i,l,a[l])})),r+i}),e)}const xi={scope:Z.BLOCK,whitelist:["right","center","justify"]},$f=new Dt("align","align",xi),Bo=new Lt("align","ql-align",xi),qo=new mn("align","text-align",xi);class $o extends mn{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 Pf=new Lt("color","ql-color",{scope:Z.INLINE}),Oi=new $o("color","color",{scope:Z.INLINE}),Uf=new Lt("background","ql-bg",{scope:Z.INLINE}),Li=new $o("background","background-color",{scope:Z.INLINE});class Un extends Pn{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${xs(this.code(e,t))}\n</pre>`}}class nt extends Ze{static TAB=" ";static register(){A.register(Un)}}class Ci extends bn{}Ci.blotName="code";Ci.tagName="CODE";nt.blotName="code-block";nt.className="ql-code-block";nt.tagName="DIV";Un.blotName="code-block-container";Un.className="ql-code-block-container";Un.tagName="DIV";Un.allowedChildren=[nt];nt.allowedChildren=[Ot,Ct,wt];nt.requiredContainer=Un;const Ii={scope:Z.BLOCK,whitelist:["rtl"]},Po=new Dt("direction","dir",Ii),Uo=new Lt("direction","ql-direction",Ii),Fo=new mn("direction","direction",Ii),Ho={scope:Z.INLINE,whitelist:["serif","monospace"]},zo=new Lt("font","ql-font",Ho);class Ff extends mn{value(e){return super.value(e).replace(/["']/g,"")}}const jo=new Ff("font","font-family",Ho),Ko=new Lt("size","ql-size",{scope:Z.INLINE,whitelist:["small","large","huge"]}),Go=new mn("size","font-size",{scope:Z.INLINE,whitelist:["10px","18px","32px"]}),Hf=Yt("quill:keyboard"),zf=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Os extends qt{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=Kf(e);if(s==null){Hf.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 l={...s,key:a,...t,...r};this.bindings[l.key]=this.bindings[l.key]||[],this.bindings[l.key].push(l)}))}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((T=>Os.match(e,T)));if(s.length===0)return;const i=A.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[l,c]=this.quill.getLine(a.index),[u,f]=this.quill.getLeaf(a.index),[p,h]=a.length===0?[u,f]:this.quill.getLeaf(a.index+a.length),g=u instanceof bs?u.value().slice(0,f):"",y=p instanceof bs?p.value().slice(h):"",v={collapsed:a.length===0,empty:a.length===0&&l.length()<=1,format:this.quill.getFormat(a),line:l,offset:c,prefix:g,suffix:y,event:e};s.some((T=>{if(T.collapsed!=null&&T.collapsed!==v.collapsed||T.empty!=null&&T.empty!==v.empty||T.offset!=null&&T.offset!==v.offset)return!1;if(Array.isArray(T.format)){if(T.format.every((C=>v.format[C]==null)))return!1}else if(typeof T.format=="object"&&!Object.keys(T.format).every((C=>T.format[C]===!0?v.format[C]!=null:T.format[C]===!1?v.format[C]==null:Ni(T.format[C],v.format[C]))))return!1;return T.prefix!=null&&!T.prefix.test(v.prefix)||T.suffix!=null&&!T.suffix.test(v.suffix)?!1:T.handler.call(this,a,v,T)!==!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[l]=this.quill.getLine(e.index-1);if(l&&!(l.statics.blotName==="block"&&l.length()<=1)){const u=i.formats(),f=this.quill.getFormat(e.index-1,1);if(s=Et.AttributeMap.diff(u,f)||{},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,A.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[l]=this.quill.getLine(e.index+1);if(l){const c=i.formats(),u=this.quill.getFormat(e.index,1);s=Et.AttributeMap.diff(c,u)||{},Object.keys(s).length>0&&(a=a.retain(l.length()-1).retain(1,s))}}this.quill.updateContents(a,A.sources.USER),this.quill.focus()}handleDeleteRange(e){Ri({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,Z.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,A.sources.USER),this.quill.setSelection(e.index+1,A.sources.SILENT),this.quill.focus()}}const jf={bindings:{bold:Vs("bold"),italic:Vs("italic"),underline:Vs("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",A.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",A.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",A.sources.USER):e.format.list!=null&&this.quill.format("list",!1,A.sources.USER)}},"indent code-block":ka(!0),"outdent code-block":ka(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(n){this.quill.deleteText(n.index-1,1,A.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,A.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index+1,A.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,A.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,A.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,A.sources.USER),this.quill.setSelection(n.index+1,A.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,A.sources.USER),this.quill.setSelection(n.index+1,A.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=Gf(t,r,s,i);if(a==null)return;let l=t.offset();if(a<0){const c=(new K).retain(l).insert(`\n`);this.quill.updateContents(c,A.sources.USER),this.quill.setSelection(n.index+1,n.length,A.sources.SILENT)}else if(a>0){l+=t.length();const c=(new K).retain(l).insert(`\n`);this.quill.updateContents(c,A.sources.USER),this.quill.setSelection(l,A.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,A.sources.USER):this.quill.setSelection(s+r.length(),A.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," ",A.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,A.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index-t,A.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,A.sources.USER),this.quill.setSelection(n.index-1,A.sources.SILENT),!1}return!0}},"embed left":ls("ArrowLeft",!1),"embed left shift":ls("ArrowLeft",!0),"embed right":ls("ArrowRight",!1),"embed right shift":ls("ArrowRight",!0),"table down":Ma(!1),"table up":Ma(!0)}};Os.DEFAULTS=jf;function ka(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,A.sources.USER),this.quill.setSelection(e.index+i.length,A.sources.SILENT);return}const a=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:l,length:c}=e;a.forEach(((u,f)=>{n?(u.insertAt(0,i),f===0?l+=i.length:c+=i.length):u.domNode.textContent.startsWith(i)&&(u.deleteAt(0,i.length),f===0?l-=i.length:c-=i.length)})),this.quill.update(A.sources.USER),this.quill.setSelection(l,c,A.sources.SILENT)}}}function ls(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 lt?(n==="ArrowLeft"?e?this.quill.setSelection(r.index-1,r.length+1,A.sources.USER):this.quill.setSelection(r.index-1,A.sources.USER):e?this.quill.setSelection(r.index,r.length+1,A.sources.USER):this.quill.setSelection(r.index+r.length+1,A.sources.USER),!1):!0}}}function Vs(n){return{key:n[0],shortKey:!0,handler(e,t){this.quill.format(n,!t.format[n],A.sources.USER)}}}function Ma(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,l=s;for(;l.prev!=null;)l=l.prev,a=a.next;const c=a.offset(this.quill.scroll)+Math.min(t.offset,a.length()-1);this.quill.setSelection(c,0,A.sources.USER)}}else{const a=s.table()[r];a!=null&&(n?this.quill.setSelection(a.offset(this.quill.scroll)+a.length()-1,0,A.sources.USER):this.quill.setSelection(a.offset(this.quill.scroll),0,A.sources.USER))}return!1}}}function Kf(n){if(typeof n=="string"||typeof n=="number")n={key:n};else if(typeof n=="object")n=ar(n);else return null;return n.shortKey&&(n[zf]=n.shortKey,delete n.shortKey),n}function Ri(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=Et.AttributeMap.diff(a,i)||{}}e.deleteText(t,A.sources.USER),Object.keys(s).length>0&&e.formatLine(t.index,1,s,A.sources.USER),e.setSelection(t.index,A.sources.SILENT)}function Gf(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 Vf=/font-weight:\s*normal/,Wf=["P","OL","UL"],Da=n=>n&&Wf.includes(n.tagName),Zf=n=>{Array.from(n.querySelectorAll("br")).filter((e=>Da(e.previousElementSibling)&&Da(e.nextElementSibling))).forEach((e=>{e.parentNode?.removeChild(e)}))},Yf=n=>{Array.from(n.querySelectorAll('b[style*="font-weight"]')).filter((e=>e.getAttribute("style")?.match(Vf))).forEach((e=>{const t=n.createDocumentFragment();t.append(...e.childNodes),e.parentNode?.replaceChild(t,e)}))};function Qf(n){n.querySelector('[id^="docs-internal-guid-"]')&&(Yf(n),Zf(n))}const Xf=/\bmso-list:[^;]*ignore/i,Jf=/\bmso-list:[^;]*\bl(\d+)/i,eg=/\bmso-list:[^;]*\blevel(\d+)/i,tg=(n,e)=>{const t=n.getAttribute("style"),r=t?.match(Jf);if(!r)return null;const s=Number(r[1]),i=t?.match(eg),a=i?Number(i[1]):1,l=new RegExp(`@list l${s}:level${a}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),c=e.match(l),u=c&&c[1]==="bullet"?"bullet":"ordered";return{id:s,indent:a,type:u,element:n}},ng=n=>{const e=Array.from(n.querySelectorAll("[style*=mso-list]")),t=[],r=[];e.forEach((a=>{(a.getAttribute("style")||"").match(Xf)?t.push(a):r.push(a)})),t.forEach((a=>a.parentNode?.removeChild(a)));const s=n.documentElement.innerHTML,i=r.map((a=>tg(a,s))).filter((a=>a));for(;i.length;){const a=[];let l=i.shift();for(;l;)a.push(l),l=i.length&&i[0]?.element===l.element.nextElementSibling&&i[0].id===l.id?i.shift():null;const c=document.createElement("ul");a.forEach((p=>{const h=document.createElement("li");h.setAttribute("data-list",p.type),p.indent>1&&h.setAttribute("class",`ql-indent-${p.indent-1}`),h.innerHTML=p.element.innerHTML,c.appendChild(h)}));const u=a[0]?.element,{parentNode:f}=u??{};u&&f?.replaceChild(c,u),a.slice(1).forEach((p=>{let{element:h}=p;f?.removeChild(h)}))}};function rg(n){n.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&ng(n)}const sg=[rg,Qf],ig=n=>{n.documentElement&&sg.forEach((e=>{e(n)}))},ag=Yt("quill:clipboard"),og=[[Node.TEXT_NODE,_g],[Node.TEXT_NODE,qa],["br",fg],[Node.ELEMENT_NODE,qa],[Node.ELEMENT_NODE,hg],[Node.ELEMENT_NODE,dg],[Node.ELEMENT_NODE,Eg],["li",mg],["ol, ul",bg],["pre",gg],["tr",yg],["b",Ws("bold")],["i",Ws("italic")],["strike",Ws("strike")],["style",pg]],lg=[$f,Po].reduce(((n,e)=>(n[e.keyName]=e,n)),{}),Ba=[qo,Li,Oi,Fo,jo,Go].reduce(((n,e)=>(n[e.keyName]=e,n)),{});class cg extends qt{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=[],og.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[nt.blotName])return(new K).insert(r||"",{[nt.blotName]:s[nt.blotName]});if(!t)return(new K).insert(r||"",s);const i=this.convertHTML(t);return Kr(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){ig(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 ki(this.quill.scroll,r,i,a,s)}dangerouslyPasteHTML(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:A.sources.API;if(typeof e=="string"){const s=this.convert({html:e,text:""});this.quill.setContents(s,t),this.quill.setSelection(0,A.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(),A.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&&Ri({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);ag.log("onPaste",a,{text:r,html:s});const l=(new K).retain(e.index).delete(e.length).concat(a);this.quill.updateContents(l,A.sources.USER),this.quill.setSelection(l.length()-e.length,A.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const r=[],s=[];return this.matchers.forEach((i=>{const[a,l]=i;switch(a){case Node.TEXT_NODE:s.push(l);break;case Node.ELEMENT_NODE:r.push(l);break;default:Array.from(e.querySelectorAll(a)).forEach((c=>{t.has(c)?t.get(c)?.push(l):t.set(c,[l])}));break}})),[r,s]}}function Fn(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 Kr(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 dn(n,e){if(!(n instanceof Element))return!1;const t=e.query(n);return t&&t.prototype instanceof lt?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(n.tagName.toLowerCase())}function ug(n,e){return n.previousElementSibling&&n.nextElementSibling&&!dn(n.previousElementSibling,e)&&!dn(n.nextElementSibling,e)}const cs=new WeakMap;function Vo(n){return n==null?!1:(cs.has(n)||(n.tagName==="PRE"?cs.set(n,!0):cs.set(n,Vo(n.parentNode))),cs.get(n))}function ki(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 l=ki(n,a,t,r,s);return a.nodeType===e.ELEMENT_NODE&&(l=t.reduce(((c,u)=>u(a,c,n)),l),l=(s.get(a)||[]).reduce(((c,u)=>u(a,c,n)),l)),i.concat(l)}),new K):new K}function Ws(n){return(e,t,r)=>Fn(t,n,!0,r)}function dg(n,e,t){const r=Dt.keys(n),s=Lt.keys(n),i=mn.keys(n),a={};return r.concat(s).concat(i).forEach((l=>{let c=t.query(l,Z.ATTRIBUTE);c!=null&&(a[c.attrName]=c.value(n),a[c.attrName])||(c=lg[l],c!=null&&(c.attrName===l||c.keyName===l)&&(a[c.attrName]=c.value(n)||void 0),c=Ba[l],c!=null&&(c.attrName===l||c.keyName===l)&&(c=Ba[l],a[c.attrName]=c.value(n)||void 0))})),Object.entries(a).reduce(((l,c)=>{let[u,f]=c;return Fn(l,u,f,t)}),e)}function hg(n,e,t){const r=t.query(n);if(r==null)return e;if(r.prototype instanceof lt){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 Ur&&!Kr(e,`\n`)&&e.insert(`\n`),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return Fn(e,r.blotName,r.formats(n,t),t);return e}function fg(n,e){return Kr(e,`\n`)||e.insert(`\n`),e}function gg(n,e,t){const r=t.query("code-block"),s=r&&"formats"in r&&typeof r.formats=="function"?r.formats(n,t):!0;return Fn(e,"code-block",s,t)}function pg(){return new K}function mg(n,e,t){const r=t.query(n);if(r==null||r.blotName!=="list"||!Kr(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,l)=>l.insert?l.attributes&&typeof l.attributes.indent=="number"?a.push(l):a.insert(l.insert,{indent:s,...l.attributes||{}}):a),new K)}function bg(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"),Fn(e,"list",s,t)}function qa(n,e,t){if(!Kr(e,`\n`)){if(dn(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(dn(r,t))return e.insert(`\n`);const s=t.query(r);if(s&&s.prototype instanceof bt)return e.insert(`\n`);r=r.firstChild}}}return e}function Eg(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[l,c]=a;return Fn(i,l,c,t)}),e),parseFloat(s.textIndent||0)>0?(new K).insert("\t").concat(e):e}function yg(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 Fn(e,"table",i,t)}return e}function _g(n,e,t){let r=n.data;if(n.parentElement?.tagName==="O:P")return e.insert(r.trim());if(!Vo(n)){if(r.trim().length===0&&r.includes(`\n`)&&!ug(n,t))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(n.previousSibling==null&&n.parentElement!=null&&dn(n.parentElement,t)||n.previousSibling instanceof Element&&dn(n.previousSibling,t))&&(r=r.replace(/^ /,"")),(n.nextSibling==null&&n.parentElement!=null&&dn(n.parentElement,t)||n.nextSibling instanceof Element&&dn(n.nextSibling,t))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class vg extends qt{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(A.events.EDITOR_CHANGE,((r,s,i,a)=>{r===A.events.SELECTION_CHANGE?s&&a!==A.sources.SILENT&&(this.currentRange=s):r===A.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||a===A.sources.USER?this.record(s,i):this.transform(s)),this.currentRange=gi(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:gi(r.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(r.delta,A.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){$a(this.stack.undo,e),$a(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,A.sources.USER);else{const t=Tg(this.quill.scroll,e.delta);this.quill.setSelection(t,A.sources.USER)}}}function $a(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&&gi(s.range,t)},t=s.delta.transform(t),n[r].delta.length()===0&&n.splice(r,1)}}function Ng(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,Z.BLOCK)!=null)):!1}function Tg(n,e){const t=e.reduce(((s,i)=>s+(i.delete||0)),0);let r=e.length()-t;return Ng(n,e)&&(r-=1),r}function gi(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 Wo extends qt{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)}}Wo.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,G.sources.USER),this.quill.setSelection(n.index+r.length,G.sources.SILENT)}))}};const Ag=["insertText","insertReplacementText"];class wg extends qt{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",(r=>{this.handleBeforeInput(r)})),/Android/i.test(navigator.userAgent)||e.on(A.events.COMPOSITION_BEFORE_START,(()=>{this.handleCompositionStart()}))}deleteRange(e){Ri({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),A.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,A.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!Ag.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const r=Sg(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 Sg(n){return typeof n.data=="string"?n.data:n.dataTransfer?.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const xg=/Mac/i.test(navigator.platform),Og=100,Lg=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||xg&&n.key==="a"&&n.ctrlKey===!0);class Cg extends qt{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 xt)||!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),A.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",(e=>{!e.defaultPrevented&&Lg(e)&&this.ensureListeningToSelectionChange()}))}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+Og,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 xt)||!r.uiNode)return;const s=document.createRange();s.setStartAfter(r.uiNode),s.setEndAfter(r.uiNode),e.removeAllRanges(),e.addRange(s)}}A.register({"blots/block":Ze,"blots/block/embed":bt,"blots/break":Ct,"blots/container":Pn,"blots/cursor":wt,"blots/embed":Si,"blots/inline":bn,"blots/scroll":qf,"blots/text":Ot,"modules/clipboard":cg,"modules/history":vg,"modules/keyboard":Os,"modules/uploader":Wo,"modules/input":wg,"modules/uiNode":Cg});class Ig extends Lt{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 Rg=new Ig("indent","ql-indent",{scope:Z.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class kg extends Ze{static blotName="blockquote";static tagName="blockquote"}class Mg extends Ze{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}}class Gr extends Pn{}Gr.blotName="list-container";Gr.tagName="OL";class Vr extends Ze{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(){A.register(Gr)}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)}}Vr.blotName="list";Vr.tagName="LI";Gr.allowedChildren=[Vr];Vr.requiredContainer=Gr;class Mi extends bn{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 Dg extends Mi{static blotName="italic";static tagName=["EM","I"]}class Es extends bn{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 Zo(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 Zo(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 Bg extends bn{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 qg extends Mi{static blotName="strike";static tagName=["S","STRIKE"]}class $g extends bn{static blotName="underline";static tagName="U"}class Pg extends Si{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 Pa=["alt","height","width"];let Ug=class extends lt{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 Pa.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 Zo(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){Pa.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}};const Ua=["height","width"];class Fg extends bt{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 Ua.reduce(((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t)),{})}static sanitize(e){return Es.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){Ua.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 Mr=new Lt("code-token","hljs",{scope:Z.INLINE});class Wt extends bn{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(nt.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,r){super(e,t,r),Mr.add(this.domNode,r)}format(e,t){e!==Wt.blotName?super.format(e,t):t?Mr.add(this.domNode,t):(Mr.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),Mr.value(this.domNode)||this.unwrap()}}Wt.blotName="code-token";Wt.className="ql-token";class mt extends nt{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(),Wt.blotName,!1),super.replaceWith(e,t)}}class Br extends Un{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===mt.blotName&&(this.forceNext=!0,this.children.forEach((r=>{r.format(e,t)})))}formatAt(e,t,r,s){r===mt.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=mt.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(Mo(u,!1))),new K),l=e(s,i);a.diff(l).reduce(((c,u)=>{let{retain:f,attributes:p}=u;return f?(p&&Object.keys(p).forEach((h=>{[mt.blotName,Wt.blotName].includes(h)&&this.formatAt(c,f,h,p[h])})),c+f):c}),0)}this.cachedText=s,this.forceNext=!1}}html(e,t){const[r]=this.children.find(e);return`<pre data-language="${r?mt.formats(r.domNode):"plain"}">\n${xs(this.code(e,t))}\n</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=mt.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}Br.allowedChildren=[mt];mt.requiredContainer=Br;mt.allowedChildren=[Wt,wt,Ot,Ct];const Hg=(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 Yo extends qt{static register(){A.register(Wt,!0),A.register(mt,!0),A.register(Br,!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(A.events.SCROLL_BLOT_MOUNT,(e=>{if(!(e instanceof Br))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(mt.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)})),e.uiNode==null&&(e.attachUI(t),e.children.head&&(t.value=mt.formats(e.children.head.domNode)))}))}initTimer(){let e=null;this.quill.on(A.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(A.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(Br):[e]).forEach((i=>{i.highlight(this.highlightBlot,t)})),this.quill.update(A.sources.SILENT),r!=null&&this.quill.setSelection(r,A.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 xs(e).split(`\n`).reduce(((s,i,a)=>(a!==0&&s.insert(`\n`,{[nt.blotName]:t}),s.insert(i))),new K);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(nt.className),r.innerHTML=Hg(this.options.hljs,t,e),ki(this.quill.scroll,r,[(s,i)=>{const a=Mr.value(s);return a?i.compose((new K).retain(i.length(),{[Wt.blotName]:a})):i}],[(s,i)=>s.data.split(`\n`).reduce(((a,l,c)=>(c!==0&&a.insert(`\n`,{[nt.blotName]:t}),a.insert(l))),i)],new WeakMap)}}Yo.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 St extends Ze{static blotName="table";static tagName="TD";static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",Di()),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===St.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 Dn extends Pn{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 fn extends Pn{static blotName="table-body";static tagName="TBODY"}class ys extends Pn{static blotName="table-container";static tagName="TABLE";balanceCells(){const e=this.descendants(Dn),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=St.formats(r.children.head.domNode));const i=this.scroll.create(St.blotName,s);r.appendChild(i),i.optimize()}))}))}cells(e){return this.rows().map((t=>t.children.at(e)))}deleteColumn(e){const[t]=this.descendant(fn);t==null||t.children.head==null||t.children.forEach((r=>{const s=r.children.at(e);s?.remove()}))}insertColumn(e){const[t]=this.descendant(fn);t==null||t.children.head==null||t.children.forEach((r=>{const s=r.children.at(e),i=St.formats(r.children.head.domNode),a=this.scroll.create(St.blotName,i);r.insertBefore(a,s)}))}insertRow(e){const[t]=this.descendant(fn);if(t==null||t.children.head==null)return;const r=Di(),s=this.scroll.create(Dn.blotName);t.children.head.children.forEach((()=>{const a=this.scroll.create(St.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))}}ys.allowedChildren=[fn];fn.requiredContainer=ys;fn.allowedChildren=[Dn];Dn.requiredContainer=fn;Dn.allowedChildren=[St];St.requiredContainer=Dn;function Di(){return`row-${Math.random().toString(36).slice(2,6)}`}class zg extends qt{static register(){A.register(St),A.register(Dn),A.register(fn),A.register(ys)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(ys).forEach((e=>{e.balanceCells()}))}deleteColumn(){const[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update(A.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(A.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const t=e.offset();e.remove(),this.quill.update(A.sources.USER),this.quill.setSelection(t,A.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!==St.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(A.sources.USER);let l=s.rowOffset();e===0&&(l+=1),this.quill.setSelection(t.index+l,t.length,A.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(A.sources.USER),e>0?this.quill.setSelection(t,A.sources.SILENT):this.quill.setSelection(t.index+s.children.length,t.length,A.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:Di()})}),(new K).retain(r.index));this.quill.updateContents(s,A.sources.USER),this.quill.setSelection(r.index,A.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(A.events.SCROLL_OPTIMIZE,(e=>{e.some((t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.quill.once(A.events.TEXT_CHANGE,((r,s,i)=>{i===A.sources.USER&&this.balanceTables()})),!0):!1))}))}}const Fa=Yt("quill:toolbar");class Bi extends qt{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const r=document.createElement("div");r.setAttribute("role","toolbar"),jg(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)){Fa.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(A.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){Fa.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 l=e.options[e.selectedIndex];l.hasAttribute("selected")?i=!1:i=l.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 lt){if(i=prompt(`Enter ${t}`),!i)return;this.quill.updateContents((new K).retain(a.index).delete(a.length).insert({[t]:i}),A.sources.USER)}else this.quill.format(t,i,A.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 l=t[s];typeof l=="string"&&(l=l.replace(/"/g,'\\"')),a=i.querySelector(`option[value="${l}"]`)}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],l=a===i.getAttribute("value")||a!=null&&a.toString()===i.getAttribute("value")||a==null&&!i.getAttribute("value");i.classList.toggle("ql-active",l),i.setAttribute("aria-pressed",l.toString())}else{const a=t[s]!=null;i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}}))}}Bi.DEFAULTS={};function Ha(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 jg(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")Ha(r,s);else{const i=Object.keys(s)[0],a=s[i];Array.isArray(a)?Kg(r,i,a):Ha(r,i,a)}})),n.appendChild(r)}))}function Kg(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)}Bi.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,Z.INLINE)!=null&&this.quill.format(t,!1,A.sources.USER)}))}else this.quill.removeFormat(n.index,n.length,A.sources.USER)},direction(n){const{align:e}=this.quill.getFormat();n==="rtl"&&e==null?this.quill.format("align","right",A.sources.USER):!n&&e==="right"&&this.quill.format("align",!1,A.sources.USER),this.quill.format("direction",n,A.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,A.sources.USER)}},link(n){n===!0&&(n=prompt("Enter link URL:")),this.quill.format("link",n,A.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,A.sources.USER):this.quill.format("list","unchecked",A.sources.USER):this.quill.format("list",n,A.sources.USER)}}};const Gg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',Vg='<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>',Wg='<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>',Zg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',Yg='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',Qg='<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>',Xg='<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>',Jg='<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>',za='<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>',ep='<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>',tp='<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>',np='<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>',rp='<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>',sp='<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>',ip='<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>',ap='<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>',op='<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>',lp='<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>',cp='<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>',up='<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>',dp='<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>',hp='<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>',fp='<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>',gp='<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>',pp='<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>',mp='<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>',bp='<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>',Ep='<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>',yp='<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>',_p='<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>',vp='<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>',Np='<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>',Tp='<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>',Hr={align:{"":Gg,center:Vg,right:Wg,justify:Zg},background:Yg,blockquote:Qg,bold:Xg,clean:Jg,code:za,"code-block":za,color:ep,direction:{"":tp,rtl:np},formula:rp,header:{1:sp,2:ip,3:ap,4:op,5:lp,6:cp},italic:up,image:dp,indent:{"+1":hp,"-1":fp},link:gp,list:{bullet:pp,check:mp,ordered:bp},script:{sub:Ep,super:yp},strike:_p,table:vp,underline:Np,video:Tp},Ap='<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 ja=0;function Ka(n,e){n.setAttribute(e,`${n.getAttribute(e)!=="true"}`)}class Ls{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"),Ka(this.label,"aria-expanded"),Ka(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=Ap,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-${ja}`,ja+=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 Qo extends Ls{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 Xo extends Ls{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 wp=n=>{const{overflowY:e}=getComputedStyle(n,null);return e!=="visible"&&e!=="clip"};let Jo=class{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,wp(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 l=i.bottom-i.top,c=e.bottom-e.top+l;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 Sp=[!1,"center","right","justify"],xp=["#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"],Op=[!1,"serif","monospace"],Lp=["1","2","3",!1],Cp=["small",!1,"large","huge"];class Wr extends hr{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&&Ir(s,Sp),typeof t.align=="object"))return new Xo(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&&Ir(s,xp,i==="background"?"#ffffff":"#000000"),new Qo(s,t[i])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?Ir(s,Op):s.classList.contains("ql-header")?Ir(s,Lp):s.classList.contains("ql-size")&&Ir(s,Cp)),new Ls(s)}));const r=()=>{this.pickers.forEach((s=>{s.update()}))};this.quill.on(G.events.EDITOR_CHANGE,r)}}Wr.DEFAULTS=hn({},hr.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 el extends Jo{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,G.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,G.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=Ip(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,G.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",G.sources.USER),this.quill.setSelection(r+2,G.sources.USER)}break}}this.textbox.value="",this.hide()}}function Ip(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 Ir(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 Rp=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class kp extends el{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(G.events.EDITOR_CHANGE,((r,s,i,a)=>{if(r===G.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&a===G.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const l=this.quill.getLines(s.index,s.length);if(l.length===1){const c=this.quill.getBounds(s);c!=null&&this.position(c)}else{const c=l[l.length-1],u=this.quill.getIndex(c),f=Math.min(c.length()-1,s.index+s.length-u),p=this.quill.getBounds(new Mn(u,f));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(G.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 tl extends Wr{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=Rp),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new kp(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),Hr),this.buildPickers(e.container.querySelectorAll("select"),Hr))}}tl.DEFAULTS=hn({},Wr.DEFAULTS,{modules:{toolbar:{handlers:{link(n){n?this.quill.theme.tooltip.edit():this.quill.format("link",!1,A.sources.USER)}}}}});const Mp=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Dp extends el{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,G.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()})),this.quill.on(G.events.SELECTION_CHANGE,((e,t,r)=>{if(e!=null){if(e.length===0&&r===G.sources.USER){const[s,i]=this.quill.scroll.descendant(Es,e.index);if(s!=null){this.linkRange=new Mn(e.index-i,s.length());const a=Es.formats(s.domNode);this.preview.textContent=a,this.preview.setAttribute("href",a),this.show();const l=this.quill.getBounds(this.linkRange);l!=null&&this.position(l);return}}else delete this.linkRange;this.hide()}}))}show(){super.show(),this.root.removeAttribute("data-mode")}}class nl extends Wr{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=Mp),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"),Hr),this.buildPickers(e.container.querySelectorAll("select"),Hr),this.tooltip=new Dp(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)})))}}nl.DEFAULTS=hn({},Wr.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,A.sources.USER)}}}}});A.register({"attributors/attribute/direction":Po,"attributors/class/align":Bo,"attributors/class/background":Uf,"attributors/class/color":Pf,"attributors/class/direction":Uo,"attributors/class/font":zo,"attributors/class/size":Ko,"attributors/style/align":qo,"attributors/style/background":Li,"attributors/style/color":Oi,"attributors/style/direction":Fo,"attributors/style/font":jo,"attributors/style/size":Go},!0);A.register({"formats/align":Bo,"formats/direction":Uo,"formats/indent":Rg,"formats/background":Li,"formats/color":Oi,"formats/font":zo,"formats/size":Ko,"formats/blockquote":kg,"formats/code-block":nt,"formats/header":Mg,"formats/list":Vr,"formats/bold":Mi,"formats/code":Ci,"formats/italic":Dg,"formats/link":Es,"formats/script":Bg,"formats/strike":qg,"formats/underline":$g,"formats/formula":Pg,"formats/image":Ug,"formats/video":Fg,"modules/syntax":Yo,"modules/table":zg,"modules/toolbar":Bi,"themes/bubble":tl,"themes/snow":nl,"ui/icons":Hr,"ui/picker":Ls,"ui/icon-picker":Xo,"ui/color-picker":Qo,"ui/tooltip":Jo},!0);const rl=n=>n!=null&&(n=Object.getPrototypeOf(n),n===Array.prototype||n===Object.prototype);function sl(n,e,t){for(const[r,s]of Object.entries(e)){const i=`${t}.${r}`;n[i]=s,rl(s)&&sl(n,s,i)}}function Bp(n){const e={...n};for(const[t,r]of Object.entries(n))rl(r)&&sl(e,r,t);return e}const qp=(n,e)=>{if(e)for(const[t,r]of Object.entries(e))n=n.replace(new RegExp(`{{\\s*${t}\\s*}}`,"g"),r);return n},$p=n=>n;function Pp(n,e=$p){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 Up={insertHtmlSnippetMessage:"Insert a HTML Snippet",obfuscate:"Obfuscate"},Fp="image",Hp="Validate",zp="Cancel",jp="Remove",Kp="Done",Gp="Image not inserted, place cursor in editor first",Vp="HTML Snippet",Wp="Confirm Deletion",Zp={content:"Are you sure you want to delete this HTML Snippet?"},Yp={variantLabel:"Size {{ n }}",sizes:"Sizes",imageProperties:"Image properties",left:"Left",right:"Right",center:"Center",alignment:"Alignment",options:"Options",enableZoom:"Enable zoom",link:"Link"},Qp={obfuscator:"Obfuscator",content:"Content:",asALink:"As a link",doNotObfuscate:"Do not obfuscate"},Xp={insertVideo:"Insert a Video",dialog:{title:"Set a video"}},Jp={insertLink:"Insert an internal link"},em={CustomToolbar:Up,image:Fp,validate:Hp,delete:"Delete",cancel:zp,remove:jp,done:Kp,editorFocusLost:Gp,htmlSnippetLabel:Vp,confirmDeletion:Wp,comfirmSnippetDeletionDialog:Zp,makeImagePropertiesDialog:Yp,openObfuscatorDialog:Qp,videoPlugin:Xp,internalLinkPlugin:Jp},tm={insertHtmlSnippetMessage:"Insérer un extrait de code HTML",obfuscate:"Obfusquer"},nm="image",rm="Valider",sm="Annuler",im="Terminé",am="L'image n'a pas été insérée, mettre d'abord le curseur dans l'éditeur",om="Code HTML",lm="Confirmer la suppression",cm="Retirer",um={content:"Voulez-vous vraiment supprimer ce code HTML ?"},dm={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",link:"Lien"},hm={obfuscator:"Obfusqueur",content:"Contenu:",asALink:"En tant que lien",doNotObfuscate:"Ne pas obfusquer"},fm={insertVideo:"Insérer une vidéo",dialog:{title:"Définir une vidéo"}},gm={insertLink:"Insérer un lien interne"},pm={CustomToolbar:tm,image:nm,validate:rm,delete:"Supprimer",cancel:sm,done:im,editorFocusLost:am,htmlSnippetLabel:om,confirmDeletion:lm,remove:cm,comfirmSnippetDeletionDialog:um,makeImagePropertiesDialog:dm,openObfuscatorDialog:hm,videoPlugin:fm,internalLinkPlugin:gm},Ga={en:em,fr:pm};function En(n){const e=Qs((()=>{const r=n()in Ga?n():"en";return Bp(Ga[r])}));return{t:Pp(e,qp)}}var mm=be('<textarea autofocus class="QpInput QpHtmlSnippetInput"rows=8 cols=80>'),il=be('<button class="QpBtn secondary"type=button>'),bm=be("<button class=QpBtn type=button>"),Em=be('<button class="QpBtn danger outlined"type=button>'),ym=be("<p>"),_m=be('<button class="QpBtn danger"type=button>');async function al({service:n,language:e,mode:t,html:r}){const{t:s}=En(e),[i,a]=gt(r??""),l=()=>{c.close({action:"remove"})},c=n.createModalDialog({content:(()=>{var u=mm();return u.addEventListener("change",(f=>a(f.target.value))),cn((()=>u.value=i())),u})(),footer:[t==="update"&&(()=>{var u=Em();return u.$$click=()=>{vm({deleteSnippet:l,closeDialog:()=>{c.close()},language:e,service:n})},he(u,(()=>s("delete"))),u})(),(()=>{var u=il();return u.$$click=()=>c.close(),he(u,(()=>s("cancel"))),u})(),(()=>{var u=bm();return u.$$click=()=>c.close({action:t,values:{html:i()}}),he(u,(()=>s("validate"))),u})()],header:s("htmlSnippetLabel")});return await c.open()}function vm({closeDialog:n,deleteSnippet:e,language:t,service:r}){const{t:s}=En(t),i=r.createModalDialog({header:s("confirmDeletion"),content:(()=>{var a=ym();return he(a,(()=>s("comfirmSnippetDeletionDialog.content"))),a})(),footer:[(()=>{var a=il();return a.$$click=()=>{i.hide()},he(a,(()=>s("cancel"))),a})(),(()=>{var a=_m();return a.$$click=()=>{i.hide(),e()},he(a,(()=>s("validate"))),a})()]});i.show()}vs(["click"]);var Nm=be("<div class=QpSpinner>");function Tm(){return Nm()}var Am=be('<button class="QpBtn outlined danger"type=button>'),wm=be("<button class=QpBtn type=button>"),Zs=be("<h2 class=FieldLabel>"),Va=be("<div class=QpOption>"),Sm=be("<input class=QpOption-input type=text>"),xm=be("<label><input type=checkbox name=enableZoom>"),Om=be("<div><div class=QpOption><label class><input type=checkbox name=enableLinkOnImage></label></div><div class=QpOption>"),Lm=be("<button type=button> <small class=ml-1>(<!>)"),Cm=be("<button type=button>");async function Im({language:n,imageUid:e,themeConf:t,service:r,...s}){const{t:i}=En(n),[a,l]=gt(!1),[c,u]=gt(),[f,p]=gt(),[h,g]=gt(s.zoom),[y,v]=gt(!!s.href),[N,T]=gt(s.href??""),C=Qs((()=>t.fTextImages.map(((F,ee)=>({size:F,label:i("makeImagePropertiesDialog.variantLabel",{n:ee+1})})))),[t,n()]),x=Qs((()=>[{align:"left",label:i("makeImagePropertiesDialog.left")},{align:"center",label:i("makeImagePropertiesDialog.center")},{align:"right",label:i("makeImagePropertiesDialog.right")}]),[n()]),q=async()=>{const F=c();if(!e||!F)throw new Error("missing a find variant name");l(!0);const{url:ee,displayWidth:ce,displayHeight:pe}=await r.useImage(e,F.displaySize);l(!1),V.close({action:"update",values:{uid:e,src:ee,align:f(),variant:F.displaySize,width:ce,height:pe,zoom:h()?void 0:"none",href:y()&&N().trim()||void 0}})};Ms((()=>{s.align&&p(s.align)})),Ms((()=>{if(s.imageSize){const F=C().find((ee=>ee.size.displaySize===s.imageSize));F&&u(F.size)}})),Ms((()=>{y()&&g(!y())}));let P=Gt(Tm,{});a()||(P=[(()=>{var F=Am();return F.$$click=()=>{V.close({action:"remove"})},he(F,(()=>i("remove"))),F})(),(()=>{var F=wm();return F.$$click=q,F.disabled=!e||f===void 0||c===void 0,he(F,(()=>i("validate"))),F})()]);const V=r.createModalDialog({header:i("makeImagePropertiesDialog.imageProperties"),content:[(()=>{var F=Zs();return he(F,(()=>i("makeImagePropertiesDialog.sizes"))),F})(),(()=>{var F=Va();return he(F,Gt(Pi,{get each(){return C()},children:ee=>(()=>{var ce=Lm(),pe=ce.firstChild,b=pe.nextSibling,O=b.firstChild,_=O.nextSibling;return _.nextSibling,ce.$$click=()=>u(ee.size),ce.disabled=!e,he(ce,(()=>ee.label),pe),he(b,(()=>ee.size.displaySize),_),cn((()=>Xs(ce,`QpBtn secondary ${ee.size.displaySize!==c()?.displaySize?"outlined":""}`))),ce})()})),F})(),(()=>{var F=Zs();return he(F,(()=>i("makeImagePropertiesDialog.alignment"))),F})(),(()=>{var F=Va();return he(F,Gt(Pi,{get each(){return x()},children:ee=>(()=>{var ce=Cm();return ce.$$click=()=>p(ee.align),ce.disabled=!e,he(ce,(()=>ee.label)),cn((()=>Xs(ce,`QpBtn secondary ${ee.align!==f()?"outlined":""}`))),ce})()})),F})(),(()=>{var F=Zs();return he(F,(()=>i("makeImagePropertiesDialog.options"))),F})(),(()=>{var F=Om(),ee=F.firstChild,ce=ee.firstChild,pe=ce.firstChild,b=ee.nextSibling;return pe.addEventListener("change",(()=>{v(!y())})),he(ce,(()=>i("makeImagePropertiesDialog.link")),null),he(ce,Gt(Ui,{get when(){return y()},get children(){var O=Sm();return O.addEventListener("change",(_=>{T(_.currentTarget.value)})),cn((()=>O.value=N())),O}}),null),he(b,Gt(Ui,{get when(){return!y()},get children(){var O=xm(),_=O.firstChild;return _.addEventListener("change",(()=>{g(!h())})),he(O,(()=>i("makeImagePropertiesDialog.enableZoom")),null),cn((()=>_.checked=h())),O}})),cn((()=>pe.checked=y())),F})()],footer:P});return await V.open()}vs(["click"]);async function ol({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 ll(n){return Rm(n)||qi(n)}function qi(n){return!!n.match(/^[a-zA-Z0-9. _-]+@[a-zA-Z0-9. -]+\.[a-zA-Z]{2,4}$/g)}function Rm(n){return!!n.match(/^(\+|00)[1-9][0-9 \-\(\)\.]{7,32}$/)}function km(n){return ll(n)?qi(n)?"mailto":"tel":"raw"}function cl(n){if(n==="raw")return"raw";if(n==="mailto")return"mailto";if(n==="tel")return"tel";throw new Error(`invalid link-type '${n}'`)}var Mm=be("<label class=ObfuscatorDialog-label><input type=text class=ml-2>"),Dm=be('<label class="ObfuscatorDialog-label mt-4"><input type=checkbox name=asALink class=mr-2>'),Bm=be('<button class="QpBtn danger outlined"type=button>'),qm=be("<button class=QpBtn type=button>");async function $m({service:n,language:e,value:t}){const{t:r}=En(e),[s,i]=gt(t.asALink),[a,l]=gt(t.content),c=f=>{l(f),ll(f)?i(!0):i(!1)},u=n.createModalDialog({header:r("openObfuscatorDialog.obfuscator"),content:[(()=>{var f=Mm(),p=f.firstChild;return he(f,(()=>r("openObfuscatorDialog.content")),p),p.$$input=h=>c(h.currentTarget.value),cn((()=>p.value=a())),f})(),(()=>{var f=Dm(),p=f.firstChild;return p.addEventListener("change",(()=>i(!s()))),he(f,(()=>r("openObfuscatorDialog.asALink")),null),cn((()=>p.checked=s())),f})()],footer:[(()=>{var f=Bm();return f.$$click=()=>u.close({action:"remove"}),he(f,(()=>r("openObfuscatorDialog.doNotObfuscate"))),f})(),(()=>{var f=qm();return f.$$click=()=>u.close({action:"update",content:a(),asALink:s()?qi(a())?"mailto":"tel":"raw"}),he(f,(()=>r("done"))),f})()]});return await u.open()}vs(["input","click"]);var Pm=be('<button class="QpBtn outlined danger"type=button>'),Um=be('<button class="QpBtn secondary"type=button>'),Fm=be("<button class=QpBtn type=button>");async function ul({service:n,language:e,mode:t,value:r,videoPluginHook:s}){if(!s)return;const{t:i}=En(e),[a,l]=gt(r??""),{dispose:c,element:u}=s.createComponent(r??"",{onChange(p){l(p)},getLanguage:e}),f=n.createModalDialog({content:u,footer:[(()=>{var p=Pm();return p.$$click=()=>{f.close({action:"remove"}),c()},he(p,(()=>i("remove"))),p})(),(()=>{var p=Um();return p.$$click=()=>{f.close(),c()},he(p,(()=>i("cancel"))),p})(),(()=>{var p=Fm();return p.$$click=()=>{f.close({action:t,value:a()??""}),c()},he(p,(()=>i("validate"))),p})()],header:i("videoPlugin.dialog.title")});return await f.open()}vs(["click"]);function Hm(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(Cs(n)??0,r,"link",t)}function dl({editor:n,values:e,service:t,index:r,language:s}){const{t:i}=En(s),a=r??Cs(n);if(a===void 0){t.showToast(i("editorFocusLost"),{severity:"warn"});return}n.insertEmbed(a,"img",e)}function pi(n){const e=Cs(n)??0,[t]=n.getLeaf(e);if(!t)throw new Error("editor.getLeaf() returns undefined");return t.domNode}function hl({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 fl({values:n,editor:e,index:t}){e.insertText(t,n,"internal-link-plugin",n)}function gl({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 Cs(n){const e=n.getSelection();if(e!==null)return e.index+e.length}function zm(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[,l]=a;return l}function jm(n){const e=pl(n);return{imageSize:n.dataset.variant,align:e}}function pl(n){const e=n.classList;if(e.contains("center"))return"center";if(e.contains("left"))return"left";if(e.contains("right"))return"right"}function Km(n){if(n==="center")return"center";if(n==="left")return"left";if(n==="right")return"right"}async function Gm({editor:n,htmlSnippetBtn:e,service:t,language:r}){const s=e.dataset.html,i=await al({service:t,html:s,mode:"update",language:r});i&&Zr({editor:n,element:e,data:i,insertElementHandler:hl,service:t,language:r})}async function Vm({editor:n,internalLinkElement:e,language:t,service:r,internalLinkPluginHook:s}){const i=e.dataset.documentId,a=await ol({language:t,value:i,internalLinkPluginHook:s});if(!a)return;const l=A.find(e);if(!l||l instanceof A)throw new Error("missing link blot");if(a.action==="update"){if(!a.value)return;const c=n.getIndex(l);l.deleteAt(0,l.length()),fl({values:a.value,editor:n,index:c})}else a.action==="remove"&&l.deleteAt(0,l.length())}async function Wm({editor:n,videoElement:e,language:t,service:r,videoPluginHook:s}){const i=e.dataset.videoId,a=await ul({service:r,language:t,mode:"update",value:i,videoPluginHook:s});a&&Zr({editor:n,element:e,data:{action:a.action,values:a.value},insertElementHandler:gl,service:r,language:t})}async function ml({obfuscatorSpan:n,service:e,language:t,editor:r}){const s=n.innerText,i=n.dataset.asALink?cl(n.dataset.asALink):void 0,a=await $m({service:e,language:t,value:{content:s,asALink:i?i!=="raw":!1}});if(!a)return;const l=A.find(n);if(!l||l instanceof A)throw new Error("missing embed blot");const c=r.getIndex(l);a.action==="remove"&&(l.remove(),r.insertText(c,s)),a.action==="update"&&(l.remove(),r.insertText(c,a.content??"",{obfuscate:a.asALink??"raw"}))}async function Zm({element:n,editor:e,themeConf:t,service:r,language:s}){if(!n.querySelector("img"))return;const a=zm(n),{align:l,imageSize:c}=jm(n),u=await Im({imageSize:c,align:l,imageUid:a,themeConf:t,width:Hi(n.getAttribute("width")),height:Hi(n.getAttribute("height")),zoom:n.dataset.zoom!=="none",href:n.dataset.href,service:r,language:s});u&&Zr({editor:e,element:n,data:u,insertElementHandler:dl,service:r,language:s})}function Ym({quillEditor:n,service:e,language:t,videoPluginHook:r,internalLinkPluginHook:s}){const{themeConf:i,useImage:a}=e;return{insertHtmlSnippetHandler:async h=>{if(!n)return;const g=pi(n);await Xm({editorContent:g,quillEditor:n,service:e,language:t})},insertMedia:async h=>{if(!n)return;if(!eb(h)){Hm(n,{label:h.originalName,url:h.url});return}const g=i.fTextImages[0],{displaySize:y}=g,v="center",{url:N,displayWidth:T,displayHeight:C}=await a(h.uid,y);dl({editor:n,values:{uid:h.uid,src:N,width:T,height:C,variant:y,align:v},service:e,language:t})},insertObfuscateBlotHandler:()=>{if(!n)return;const h=n.getSelection();!h||h.length===0||Qm({userSelection:h,quillEditor:n,service:e,language:t})},insertVideoHandler:async()=>{if(!n)return;const h=pi(n);await bl({editorContent:h,quillEditor:n,service:e,language:t,videoPluginHook:r})},insertInternalLinkHandler:async()=>{if(!n)return;const h=Cs(n);h!==void 0&&await Jm({quillEditor:n,service:e,language:t,internalLinkPluginHook:s,index:h})}}}async function Qm({userSelection:n,quillEditor:e,language:t,service:r}){const s=e.getText(n.index,n.length),i=km(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 l of a)if(l.innerText===s){await ml({obfuscatorSpan:l,service:r,language:t,editor:e});break}}async function Xm({editorContent:n,quillEditor:e,service:t,language:r}){const s=await al({service:t,language:r,mode:"insert"});s&&Zr({editor:e,element:n,data:s,insertElementHandler:hl,service:t,language:r})}async function bl({editorContent:n,quillEditor:e,service:t,language:r,videoPluginHook:s,value:i}){const a=await ul({service:t,language:r,mode:i?"update":"insert",value:i,videoPluginHook:s});!a||a.action==="remove"||Zr({editor:e,element:n,data:{action:a.action,values:a.value,updateOptions:{textToReplaceLength:i?.length}},insertElementHandler:gl,service:t,language:r})}async function Jm({quillEditor:n,service:e,language:t,internalLinkPluginHook:r,value:s,index:i}){const a=await ol({language:t,value:s,internalLinkPluginHook:r});!a||a.action==="remove"||!a.value||fl({editor:n,values:a.value,index:i})}function Zr({editor:n,element:e,data:{values:t,action:r,updateOptions:s},insertElementHandler:i,service:a,language:l}){const c=A.find(e);if(!c||c instanceof A)throw new Error("missing embed blot");const u=n.getIndex(c),f=new K;if(!(u===void 0||u===-1)){if(r==="insert"){if(!t)return;i({editor:n,values:t,service:a,index:u,language:l})}else if(r==="update"){if(!t)return;i({editor:n,values:t,service:a,index:u,language:l}),f.retain(u+1),f.delete(s?.textToReplaceLength??1)}else r==="remove"&&(f.retain(u),f.delete(1));n.updateContents(f)}}function eb(n){return"width"in n&&"height"in n}var Ys,Wa;function tb(){if(Wa)return Ys;Wa=1;function n(m){return m instanceof Map?m.clear=m.delete=m.set=function(){throw new Error("map is read-only")}:m instanceof Set&&(m.add=m.clear=m.delete=function(){throw new Error("set is read-only")}),Object.freeze(m),Object.getOwnPropertyNames(m).forEach((S=>{const U=m[S],re=typeof U;(re==="object"||re==="function")&&!Object.isFrozen(U)&&n(U)})),m}class e{constructor(S){S.data===void 0&&(S.data={}),this.data=S.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function t(m){return m.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(m,...S){const U=Object.create(null);for(const re in m)U[re]=m[re];return S.forEach((function(re){for(const Te in re)U[Te]=re[Te]})),U}const s="</span>",i=m=>!!m.scope,a=(m,{prefix:S})=>{if(m.startsWith("language:"))return m.replace("language:","language-");if(m.includes(".")){const U=m.split(".");return[`${S}${U.shift()}`,...U.map(((re,Te)=>`${re}${"_".repeat(Te+1)}`))].join(" ")}return`${S}${m}`};class l{constructor(S,U){this.buffer="",this.classPrefix=U.classPrefix,S.walk(this)}addText(S){this.buffer+=t(S)}openNode(S){if(!i(S))return;const U=a(S.scope,{prefix:this.classPrefix});this.span(U)}closeNode(S){i(S)&&(this.buffer+=s)}value(){return this.buffer}span(S){this.buffer+=`<span class="${S}">`}}const c=(m={})=>{const S={children:[]};return Object.assign(S,m),S};class u{constructor(){this.rootNode=c(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(S){this.top.children.push(S)}openNode(S){const U=c({scope:S});this.add(U),this.stack.push(U)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(S){return this.constructor._walk(S,this.rootNode)}static _walk(S,U){return typeof U=="string"?S.addText(U):U.children&&(S.openNode(U),U.children.forEach((re=>this._walk(S,re))),S.closeNode(U)),S}static _collapse(S){typeof S!="string"&&S.children&&(S.children.every((U=>typeof U=="string"))?S.children=[S.children.join("")]:S.children.forEach((U=>{u._collapse(U)})))}}class f extends u{constructor(S){super(),this.options=S}addText(S){S!==""&&this.add(S)}startScope(S){this.openNode(S)}endScope(){this.closeNode()}__addSublanguage(S,U){const re=S.root;U&&(re.scope=`language:${U}`),this.add(re)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(m){return m?typeof m=="string"?m:m.source:null}function h(m){return v("(?=",m,")")}function g(m){return v("(?:",m,")*")}function y(m){return v("(?:",m,")?")}function v(...m){return m.map((U=>p(U))).join("")}function N(m){const S=m[m.length-1];return typeof S=="object"&&S.constructor===Object?(m.splice(m.length-1,1),S):{}}function T(...m){return"("+(N(m).capture?"":"?:")+m.map((re=>p(re))).join("|")+")"}function C(m){return new RegExp(m.toString()+"|").exec("").length-1}function x(m,S){const U=m&&m.exec(S);return U&&U.index===0}const q=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function P(m,{joinWith:S}){let U=0;return m.map((re=>{U+=1;const Te=U;let Ce=p(re),z="";for(;Ce.length>0;){const j=q.exec(Ce);if(!j){z+=Ce;break}z+=Ce.substring(0,j.index),Ce=Ce.substring(j.index+j[0].length),j[0][0]==="\\"&&j[1]?z+="\\"+String(Number(j[1])+Te):(z+=j[0],j[0]==="("&&U++)}return z})).map((re=>`(${re})`)).join(S)}const V=/\b\B/,F="[a-zA-Z]\\w*",ee="[a-zA-Z_]\\w*",ce="\\b\\d+(\\.\\d+)?",pe="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",b="\\b(0b[01]+)",O="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",_=(m={})=>{const S=/^#![ ]*\//;return m.binary&&(m.begin=v(S,/.*\b/,m.binary,/\b.*/)),r({scope:"meta",begin:S,end:/$/,relevance:0,"on:begin":(U,re)=>{U.index!==0&&re.ignoreMatch()}},m)},I={begin:"\\\\[\\s\\S]",relevance:0},k={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[I]},L={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[I]},B={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/},M=function(m,S,U={}){const re=r({scope:"comment",begin:m,end:S,contains:[]},U);re.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 Te=T("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 re.contains.push({begin:v(/[ ]+/,"(",Te,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),re},H=M("//","$"),$=M("/\\*","\\*/"),te=M("#","$"),J={scope:"number",begin:ce,relevance:0},ie={scope:"number",begin:pe,relevance:0},de={scope:"number",begin:b,relevance:0},X={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[I,{begin:/\[/,end:/\]/,relevance:0,contains:[I]}]},Oe={scope:"title",begin:F,relevance:0},Le={scope:"title",begin:ee,relevance:0},le={begin:"\\.\\s*"+ee,relevance:0};var fe=Object.freeze({__proto__:null,APOS_STRING_MODE:k,BACKSLASH_ESCAPE:I,BINARY_NUMBER_MODE:de,BINARY_NUMBER_RE:b,COMMENT:M,C_BLOCK_COMMENT_MODE:$,C_LINE_COMMENT_MODE:H,C_NUMBER_MODE:ie,C_NUMBER_RE:pe,END_SAME_AS_BEGIN:function(m){return Object.assign(m,{"on:begin":(S,U)=>{U.data._beginMatch=S[1]},"on:end":(S,U)=>{U.data._beginMatch!==S[1]&&U.ignoreMatch()}})},HASH_COMMENT_MODE:te,IDENT_RE:F,MATCH_NOTHING_RE:V,METHOD_GUARD:le,NUMBER_MODE:J,NUMBER_RE:ce,PHRASAL_WORDS_MODE:B,QUOTE_STRING_MODE:L,REGEXP_MODE:X,RE_STARTERS_RE:O,SHEBANG:_,TITLE_MODE:Oe,UNDERSCORE_IDENT_RE:ee,UNDERSCORE_TITLE_MODE:Le});function Ee(m,S){m.input[m.index-1]==="."&&S.ignoreMatch()}function ve(m,S){m.className!==void 0&&(m.scope=m.className,delete m.className)}function Ne(m,S){S&&m.beginKeywords&&(m.begin="\\b("+m.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",m.__beforeBegin=Ee,m.keywords=m.keywords||m.beginKeywords,delete m.beginKeywords,m.relevance===void 0&&(m.relevance=0))}function De(m,S){Array.isArray(m.illegal)&&(m.illegal=T(...m.illegal))}function ze(m,S){if(m.match){if(m.begin||m.end)throw new Error("begin & end are not supported with match");m.begin=m.match,delete m.match}}function yn(m,S){m.relevance===void 0&&(m.relevance=1)}const Hn=(m,S)=>{if(!m.beforeMatch)return;if(m.starts)throw new Error("beforeMatch cannot be used with starts");const U=Object.assign({},m);Object.keys(m).forEach((re=>{delete m[re]})),m.keywords=U.keywords,m.begin=v(U.beforeMatch,h(U.begin)),m.starts={relevance:0,contains:[Object.assign(U,{endsParent:!0})]},m.relevance=0,delete U.beforeMatch},fr=["of","and","for","in","not","or","if","then","parent","list","value"],gr="keyword";function $t(m,S,U=gr){const re=Object.create(null);return typeof m=="string"?Te(U,m.split(" ")):Array.isArray(m)?Te(U,m):Object.keys(m).forEach((function(Ce){Object.assign(re,$t(m[Ce],S,Ce))})),re;function Te(Ce,z){S&&(z=z.map((j=>j.toLowerCase()))),z.forEach((function(j){const se=j.split("|");re[se[0]]=[Ce,_n(se[0],se[1])]}))}}function _n(m,S){return S?Number(S):zn(m)?0:1}function zn(m){return fr.includes(m.toLowerCase())}const vn={},je=m=>{console.error(m)},Pt=(m,...S)=>{console.log(`WARN: ${m}`,...S)},It=(m,S)=>{vn[`${m}/${S}`]||(console.log(`Deprecated as of ${m}. ${S}`),vn[`${m}/${S}`]=!0)},ct=new Error;function Ut(m,S,{key:U}){let re=0;const Te=m[U],Ce={},z={};for(let j=1;j<=S.length;j++)z[j+re]=Te[j],Ce[j+re]=!0,re+=C(S[j-1]);m[U]=z,m[U]._emit=Ce,m[U]._multi=!0}function Nn(m){if(Array.isArray(m.begin)){if(m.skip||m.excludeBegin||m.returnBegin)throw je("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ct;if(typeof m.beginScope!="object"||m.beginScope===null)throw je("beginScope must be object"),ct;Ut(m,m.begin,{key:"beginScope"}),m.begin=P(m.begin,{joinWith:""})}}function rt(m){if(Array.isArray(m.end)){if(m.skip||m.excludeEnd||m.returnEnd)throw je("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ct;if(typeof m.endScope!="object"||m.endScope===null)throw je("endScope must be object"),ct;Ut(m,m.end,{key:"endScope"}),m.end=P(m.end,{joinWith:""})}}function jn(m){m.scope&&typeof m.scope=="object"&&m.scope!==null&&(m.beginScope=m.scope,delete m.scope)}function Kn(m){jn(m),typeof m.beginScope=="string"&&(m.beginScope={_wrap:m.beginScope}),typeof m.endScope=="string"&&(m.endScope={_wrap:m.endScope}),Nn(m),rt(m)}function pr(m){function S(z,j){return new RegExp(p(z),"m"+(m.case_insensitive?"i":"")+(m.unicodeRegex?"u":"")+(j?"g":""))}class U{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(j,se){se.position=this.position++,this.matchIndexes[this.matchAt]=se,this.regexes.push([se,j]),this.matchAt+=C(j)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const j=this.regexes.map((se=>se[1]));this.matcherRe=S(P(j,{joinWith:"|"}),!0),this.lastIndex=0}exec(j){this.matcherRe.lastIndex=this.lastIndex;const se=this.matcherRe.exec(j);if(!se)return null;const Be=se.findIndex(((_t,$e)=>$e>0&&_t!==void 0)),Re=this.matchIndexes[Be];return se.splice(0,Be),Object.assign(se,Re)}}class re{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(j){if(this.multiRegexes[j])return this.multiRegexes[j];const se=new U;return this.rules.slice(j).forEach((([Be,Re])=>se.addRule(Be,Re))),se.compile(),this.multiRegexes[j]=se,se}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(j,se){this.rules.push([j,se]),se.type==="begin"&&this.count++}exec(j){const se=this.getMatcher(this.regexIndex);se.lastIndex=this.lastIndex;let Be=se.exec(j);if(this.resumingScanAtSamePosition()&&!(Be&&Be.index===this.lastIndex)){const Re=this.getMatcher(0);Re.lastIndex=this.lastIndex+1,Be=Re.exec(j)}return Be&&(this.regexIndex+=Be.position+1,this.regexIndex===this.count&&this.considerAll()),Be}}function Te(z){const j=new re;return z.contains.forEach((se=>j.addRule(se.begin,{rule:se,type:"begin"}))),z.terminatorEnd&&j.addRule(z.terminatorEnd,{type:"end"}),z.illegal&&j.addRule(z.illegal,{type:"illegal"}),j}function Ce(z,j){const se=z;if(z.isCompiled)return se;[ve,ze,Kn,Hn].forEach((Re=>Re(z,j))),m.compilerExtensions.forEach((Re=>Re(z,j))),z.__beforeBegin=null,[Ne,De,yn].forEach((Re=>Re(z,j))),z.isCompiled=!0;let Be=null;return typeof z.keywords=="object"&&z.keywords.$pattern&&(z.keywords=Object.assign({},z.keywords),Be=z.keywords.$pattern,delete z.keywords.$pattern),Be=Be||/\w+/,z.keywords&&(z.keywords=$t(z.keywords,m.case_insensitive)),se.keywordPatternRe=S(Be,!0),j&&(z.begin||(z.begin=/\B|\b/),se.beginRe=S(se.begin),!z.end&&!z.endsWithParent&&(z.end=/\B|\b/),z.end&&(se.endRe=S(se.end)),se.terminatorEnd=p(se.end)||"",z.endsWithParent&&j.terminatorEnd&&(se.terminatorEnd+=(z.end?"|":"")+j.terminatorEnd)),z.illegal&&(se.illegalRe=S(z.illegal)),z.contains||(z.contains=[]),z.contains=[].concat(...z.contains.map((function(Re){return Xt(Re==="self"?z:Re)}))),z.contains.forEach((function(Re){Ce(Re,se)})),z.starts&&Ce(z.starts,j),se.matcher=Te(se),se}if(m.compilerExtensions||(m.compilerExtensions=[]),m.contains&&m.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return m.classNameAliases=r(m.classNameAliases||{}),Ce(m)}function Qt(m){return m?m.endsWithParent||Qt(m.starts):!1}function Xt(m){return m.variants&&!m.cachedVariants&&(m.cachedVariants=m.variants.map((function(S){return r(m,{variants:null},S)}))),m.cachedVariants?m.cachedVariants:Qt(m)?r(m,{starts:m.starts?r(m.starts):null}):Object.isFrozen(m)?r(m):m}var Gn="11.10.0";class Jt extends Error{constructor(S,U){super(S),this.name="HTMLInjectionError",this.html=U}}const yt=t,st=r,Ft=Symbol("nomatch"),Tn=7,Rt=function(m){const S=Object.create(null),U=Object.create(null),re=[];let Te=!0;const Ce="Could not find the language '{}', did you forget to load/include a language module?",z={disableAutodetect:!0,name:"Plain text",contains:[]};let j={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:f};function se(R){return j.noHighlightRe.test(R)}function Be(R){let Y=R.className+" ";Y+=R.parentNode?R.parentNode.className:"";const ue=j.languageDetectRe.exec(Y);if(ue){const Ae=dt(ue[1]);return Ae||(Pt(Ce.replace("{}",ue[1])),Pt("Falling back to no-highlight mode for this block.",R)),Ae?ue[1]:"no-highlight"}return Y.split(/\s+/).find((Ae=>se(Ae)||dt(Ae)))}function Re(R,Y,ue){let Ae="",Me="";typeof Y=="object"?(Ae=R,ue=Y.ignoreIllegals,Me=Y.language):(It("10.7.0","highlight(lang, code, ...args) has been deprecated."),It("10.7.0",`Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277`),Me=R,Ae=Y),ue===void 0&&(ue=!0);const tt={code:Ae,language:Me};Ht("before:highlight",tt);const ht=tt.result?tt.result:_t(tt.language,tt.code,ue);return ht.code=tt.code,Ht("after:highlight",ht),ht}function _t(R,Y,ue,Ae){const Me=Object.create(null);function tt(D,W){return D.keywords[W]}function ht(){if(!ne.keywords){xe.addText(Se);return}let D=0;ne.keywordPatternRe.lastIndex=0;let W=ne.keywordPatternRe.exec(Se),ae="";for(;W;){ae+=Se.substring(D,W.index);const ge=Ve.case_insensitive?W[0].toLowerCase():W[0],qe=tt(ne,ge);if(qe){const[Qe,xr]=qe;if(xe.addText(ae),ae="",Me[ge]=(Me[ge]||0)+1,Me[ge]<=Tn&&(sn+=xr),Qe.startsWith("_"))ae+=W[0];else{const Jn=Ve.classNameAliases[Qe]||Qe;Ge(W[0],Jn)}}else ae+=W[0];D=ne.keywordPatternRe.lastIndex,W=ne.keywordPatternRe.exec(Se)}ae+=Se.substring(D),xe.addText(ae)}function vt(){if(Se==="")return;let D=null;if(typeof ne.subLanguage=="string"){if(!S[ne.subLanguage]){xe.addText(Se);return}D=_t(ne.subLanguage,Se,!0,Xn[ne.subLanguage]),Xn[ne.subLanguage]=D._top}else D=An(Se,ne.subLanguage.length?ne.subLanguage:null);ne.relevance>0&&(sn+=D.relevance),xe.__addSublanguage(D._emitter,D.language)}function Ue(){ne.subLanguage!=null?vt():ht(),Se=""}function Ge(D,W){D!==""&&(xe.startScope(W),xe.addText(D),xe.endScope())}function Sn(D,W){let ae=1;const ge=W.length-1;for(;ae<=ge;){if(!D._emit[ae]){ae++;continue}const qe=Ve.classNameAliases[D[ae]]||D[ae],Qe=W[ae];qe?Ge(Qe,qe):(Se=Qe,ht(),Se=""),ae++}}function xn(D,W){return D.scope&&typeof D.scope=="string"&&xe.openNode(Ve.classNameAliases[D.scope]||D.scope),D.beginScope&&(D.beginScope._wrap?(Ge(Se,Ve.classNameAliases[D.beginScope._wrap]||D.beginScope._wrap),Se=""):D.beginScope._multi&&(Sn(D.beginScope,W),Se="")),ne=Object.create(D,{parent:{value:ne}}),ne}function Yn(D,W,ae){let ge=x(D.endRe,ae);if(ge){if(D["on:end"]){const qe=new e(D);D["on:end"](W,qe),qe.isMatchIgnored&&(ge=!1)}if(ge){for(;D.endsParent&&D.parent;)D=D.parent;return D}}if(D.endsWithParent)return Yn(D.parent,W,ae)}function Ar(D){return ne.matcher.regexIndex===0?(Se+=D[0],1):(an=!0,0)}function wr(D){const W=D[0],ae=D.rule,ge=new e(ae),qe=[ae.__beforeBegin,ae["on:begin"]];for(const Qe of qe)if(Qe&&(Qe(D,ge),ge.isMatchIgnored))return Ar(W);return ae.skip?Se+=W:(ae.excludeBegin&&(Se+=W),Ue(),!ae.returnBegin&&!ae.excludeBegin&&(Se=W)),xn(ae,D),ae.returnBegin?0:W.length}function Sr(D){const W=D[0],ae=Y.substring(D.index),ge=Yn(ne,D,ae);if(!ge)return Ft;const qe=ne;ne.endScope&&ne.endScope._wrap?(Ue(),Ge(W,ne.endScope._wrap)):ne.endScope&&ne.endScope._multi?(Ue(),Sn(ne.endScope,D)):qe.skip?Se+=W:(qe.returnEnd||qe.excludeEnd||(Se+=W),Ue(),qe.excludeEnd&&(Se=W));do{ne.scope&&xe.closeNode(),!ne.skip&&!ne.subLanguage&&(sn+=ne.relevance),ne=ne.parent}while(ne!==ge.parent);return ge.starts&&xn(ge.starts,D),qe.returnEnd?0:W.length}function On(){const D=[];for(let W=ne;W!==Ve;W=W.parent)W.scope&&D.unshift(W.scope);D.forEach((W=>xe.openNode(W)))}let rn={};function Qn(D,W){const ae=W&&W[0];if(Se+=D,ae==null)return Ue(),0;if(rn.type==="begin"&&W.type==="end"&&rn.index===W.index&&ae===""){if(Se+=Y.slice(W.index,W.index+1),!Te){const ge=new Error(`0 width match regex (${R})`);throw ge.languageName=R,ge.badRule=rn.rule,ge}return 1}if(rn=W,W.type==="begin")return wr(W);if(W.type==="illegal"&&!ue){const ge=new Error('Illegal lexeme "'+ae+'" for mode "'+(ne.scope||"<unnamed>")+'"');throw ge.mode=ne,ge}else if(W.type==="end"){const ge=Sr(W);if(ge!==Ft)return ge}if(W.type==="illegal"&&ae==="")return 1;if(Ln>1e5&&Ln>W.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Se+=ae,ae.length}const Ve=dt(R);if(!Ve)throw je(Ce.replace("{}",R)),new Error('Unknown language: "'+R+'"');const at=pr(Ve);let ot="",ne=Ae||at;const Xn={},xe=new j.__emitter(j);On();let Se="",sn=0,Nt=0,Ln=0,an=!1;try{if(Ve.__emitTokens)Ve.__emitTokens(Y,xe);else{for(ne.matcher.considerAll();;){Ln++,an?an=!1:ne.matcher.considerAll(),ne.matcher.lastIndex=Nt;const D=ne.matcher.exec(Y);if(!D)break;const W=Y.substring(Nt,D.index),ae=Qn(W,D);Nt=D.index+ae}Qn(Y.substring(Nt))}return xe.finalize(),ot=xe.toHTML(),{language:R,value:ot,relevance:sn,illegal:!1,_emitter:xe,_top:ne}}catch(D){if(D.message&&D.message.includes("Illegal"))return{language:R,value:yt(Y),illegal:!0,relevance:0,_illegalBy:{message:D.message,index:Nt,context:Y.slice(Nt-100,Nt+100),mode:D.mode,resultSoFar:ot},_emitter:xe};if(Te)return{language:R,value:yt(Y),illegal:!1,relevance:0,errorRaised:D,_emitter:xe,_top:ne};throw D}}function $e(R){const Y={value:yt(R),illegal:!1,relevance:0,_top:z,_emitter:new j.__emitter(j)};return Y._emitter.addText(R),Y}function An(R,Y){Y=Y||j.languages||Object.keys(S);const ue=$e(R),Ae=Y.filter(dt).filter(Zn).map((Ue=>_t(Ue,R,!1)));Ae.unshift(ue);const Me=Ae.sort(((Ue,Ge)=>{if(Ue.relevance!==Ge.relevance)return Ge.relevance-Ue.relevance;if(Ue.language&&Ge.language){if(dt(Ue.language).supersetOf===Ge.language)return 1;if(dt(Ge.language).supersetOf===Ue.language)return-1}return 0})),[tt,ht]=Me,vt=tt;return vt.secondBest=ht,vt}function mr(R,Y,ue){const Ae=Y&&U[Y]||ue;R.classList.add("hljs"),R.classList.add(`language-${Ae}`)}function wn(R){let Y=null;const ue=Be(R);if(se(ue))return;if(Ht("before:highlightElement",{el:R,language:ue}),R.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",R);return}if(R.children.length>0&&(j.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(R)),j.throwUnescapedHTML))throw new Jt("One of your code blocks includes unescaped HTML.",R.innerHTML);Y=R;const Ae=Y.textContent,Me=ue?Re(Ae,{language:ue,ignoreIllegals:!0}):An(Ae);R.innerHTML=Me.value,R.dataset.highlighted="yes",mr(R,ue,Me.language),R.result={language:Me.language,re:Me.relevance,relevance:Me.relevance},Me.secondBest&&(R.secondBest={language:Me.secondBest.language,relevance:Me.secondBest.relevance}),Ht("after:highlightElement",{el:R,result:Me,text:Ae})}function br(R){j=st(j,R)}const Er=()=>{en(),It("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ke(){en(),It("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Vn=!1;function en(){if(document.readyState==="loading"){Vn=!0;return}document.querySelectorAll(j.cssSelector).forEach(wn)}function yr(){Vn&&en()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",yr,!1);function _r(R,Y){let ue=null;try{ue=Y(m)}catch(Ae){if(je("Language definition for '{}' could not be registered.".replace("{}",R)),Te)je(Ae);else throw Ae;ue=z}ue.name||(ue.name=R),S[R]=ue,ue.rawDefinition=Y.bind(null,m),ue.aliases&&Wn(ue.aliases,{languageName:R})}function vr(R){delete S[R];for(const Y of Object.keys(U))U[Y]===R&&delete U[Y]}function Ye(){return Object.keys(S)}function dt(R){return R=(R||"").toLowerCase(),S[R]||S[U[R]]}function Wn(R,{languageName:Y}){typeof R=="string"&&(R=[R]),R.forEach((ue=>{U[ue.toLowerCase()]=Y}))}function Zn(R){const Y=dt(R);return Y&&!Y.disableAutodetect}function Nr(R){R["before:highlightBlock"]&&!R["before:highlightElement"]&&(R["before:highlightElement"]=Y=>{R["before:highlightBlock"](Object.assign({block:Y.el},Y))}),R["after:highlightBlock"]&&!R["after:highlightElement"]&&(R["after:highlightElement"]=Y=>{R["after:highlightBlock"](Object.assign({block:Y.el},Y))})}function Tr(R){Nr(R),re.push(R)}function tn(R){const Y=re.indexOf(R);Y!==-1&&re.splice(Y,1)}function Ht(R,Y){const ue=R;re.forEach((function(Ae){Ae[ue]&&Ae[ue](Y)}))}function nn(R){return It("10.7.0","highlightBlock will be removed entirely in v12.0"),It("10.7.0","Please use highlightElement now."),wn(R)}Object.assign(m,{highlight:Re,highlightAuto:An,highlightAll:en,highlightElement:wn,highlightBlock:nn,configure:br,initHighlighting:Er,initHighlightingOnLoad:Ke,registerLanguage:_r,unregisterLanguage:vr,listLanguages:Ye,getLanguage:dt,registerAliases:Wn,autoDetection:Zn,inherit:st,addPlugin:Tr,removePlugin:tn}),m.debugMode=function(){Te=!1},m.safeMode=function(){Te=!0},m.versionString=Gn,m.regex={concat:v,lookahead:h,either:T,optional:y,anyNumberOfTimes:g};for(const R in fe)typeof fe[R]=="object"&&n(fe[R]);return Object.assign(m,fe),m},ut=Rt({});return ut.newInstance=()=>Rt({}),Ys=ut,ut.HighlightJS=ut,ut.default=ut,Ys}var nb=tb();const He=wi(nb);function rb(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"})]}},l={className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,t,s]};s.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},f={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},n.NUMBER_MODE,t]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],g=n.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),y={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[n.inherit(n.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},v=["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],N=["true","false"],T={match:/(\/[a-z._-]+)+/},C=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],q=["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"],P=["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:v,literal:N,built_in:[...C,...x,"set","shopt",...q,...P]},contains:[g,n.SHEBANG(),y,p,i,a,T,l,c,u,f,t]}}function sb(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("<[^<>]+>")+")",l={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})"/})]},f={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]},h={className:"title",begin:e.optional(s)+n.IDENT_RE,relevance:0},g=e.optional(s)+n.IDENT_RE+"\\s*\\(",N={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"},T=[p,l,t,n.C_BLOCK_COMMENT_MODE,f,u],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:N,contains:T.concat([{begin:/\(/,end:/\)/,keywords:N,contains:T.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+a+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:N,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:N,relevance:0},{begin:g,returnBegin:!0,contains:[n.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,u,f,l,{begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,u,f,l]}]},l,t,n.C_BLOCK_COMMENT_MODE,p]};return{name:"C",aliases:["h"],keywords:N,disableAutodetect:!0,illegal:"</",contains:[].concat(C,x,T,[p,{begin:n.IDENT_RE+"::",keywords:N},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},n.TITLE_MODE]}]),exports:{preprocessor:p,strings:u,keywords:N}}}function ib(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("<[^<>]+>")+")",l={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})"/})]},f={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]},h={className:"title",begin:e.optional(s)+n.IDENT_RE,relevance:0},g=e.optional(s)+n.IDENT_RE+"\\s*\\(",y=["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"],v=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],N=["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"],T=["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"],q={type:v,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:N},P={className:"function.dispatch",relevance:0,keywords:{_hint:T},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,n.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},V=[P,p,l,t,n.C_BLOCK_COMMENT_MODE,f,u],F={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:q,contains:V.concat([{begin:/\(/,end:/\)/,keywords:q,contains:V.concat(["self"]),relevance:0}]),relevance:0},ee={className:"function",begin:"("+a+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:q,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:q,relevance:0},{begin:g,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:q,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,u,f,l,{begin:/\(/,end:/\)/,keywords:q,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,u,f,l]}]},l,t,n.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:q,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(F,ee,P,V,[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:q,contains:["self",l]},{begin:n.IDENT_RE+"::",keywords:q},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function ab(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},l=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},f={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=n.inherit(f,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:a},g=n.inherit(h,{illegal:/\n/}),y={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},n.BACKSLASH_ESCAPE,g]},v={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},N=n.inherit(v,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},g]});h.contains=[v,y,f,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,c,n.C_BLOCK_COMMENT_MODE],g.contains=[N,y,p,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,c,n.inherit(n.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const T={variants:[u,v,y,f,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},C={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},x=n.IDENT_RE+"(<"+n.IDENT_RE+"(\\s*,\\s*"+n.IDENT_RE+")*>)?(\\[\\])?",q={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"}},T,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,C,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,C,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:"("+x+"\\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,C],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[T,c,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},q]}}const ob=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_-]*/}}),lb=["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"],cb=["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"],ub=[...lb,...cb],db=["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(),hb=["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(),fb=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),gb=["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 pb(n){const e=n.regex,t=ob(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_-]*",l=[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:":("+hb.join("|")+")"},{begin:":(:)?("+fb.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+gb.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{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:db.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+ub.join("|")+")\\b"}]}}var ir="[0-9](_*[0-9])*",us=`\\.(${ir})`,ds="[0-9a-fA-F](_*[0-9a-fA-F])*",Za={className:"number",variants:[{begin:`(\\b(${ir})((${us})|\\.)?|(${us}))[eE][+-]?(${ir})[fFdD]?\\b`},{begin:`\\b(${ir})((${us})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${us})[fFdD]?\\b`},{begin:`\\b(${ir})[fFdD]\\b`},{begin:`\\b0[xX]((${ds})\\.?|(${ds})?\\.(${ds}))[pP][+-]?(${ir})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${ds})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function El(n,e,t){return t===-1?"":n.replace(e,(r=>El(n,e,t-1)))}function mb(n){const e=n.regex,t="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=t+El("(?:<"+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"]}]},f={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:[f,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,Za,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},Za,u]}}const Ya="[A-Za-z$_][0-9A-Za-z$_]*",bb=["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"],Eb=["true","false","null","undefined","NaN","Infinity"],yl=["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"],_l=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],vl=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],yb=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],_b=[].concat(vl,yl,_l);function vb(n){const e=n.regex,t=(M,{after:H})=>{const $="</"+M[0].slice(1);return M.input.indexOf($,H)!==-1},r=Ya,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,H)=>{const $=M[0].length+M.index,te=M.input[$];if(te==="<"||te===","){H.ignoreMatch();return}te===">"&&(t(M,{after:$})||H.ignoreMatch());let J;const ie=M.input.substring($);if(J=ie.match(/^\s*=/)){H.ignoreMatch();return}if((J=ie.match(/^\s+extends\s+/))&&J.index===0){H.ignoreMatch();return}}},l={$pattern:Ya,keyword:bb,literal:Eb,built_in:_b,"variable.language":yb},c="[0-9](_?[0-9])*",u=`\\.(${c})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${f})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${f})\\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},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,h]},C={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]},x=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,y,v,N,{match:/\$\d+/},p];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const q=[].concat(C,h.contains),P=q.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(q)}]),V={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:P},F={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"}}]},ee={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:{_:[...yl,..._l]}},ce={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},pe={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[V],illegal:/%/},b={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function O(M){return e.concat("(?!",M.join("|"),")")}const _={match:e.concat(/\b/,O([...vl,"super","import"].map((M=>`${M}\\s*\\(`))),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},k={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},V]},L="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",B={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(L)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[V]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),ce,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,y,v,N,C,{match:/\$\d+/},p,ee,{className:"attr",begin:r+e.lookahead(":"),relevance:0},B,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[C,n.REGEXP_MODE,{className:"function",begin:L,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:l,contains:P}]}]},{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"]}]}]},pe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[V,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[V]},_,b,F,k,{match:/\$[(.]/}]}}function Nb(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 Tb(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}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),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}/}]},f={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=n.inherit(u,{contains:[]}),h=n.inherit(f,{contains:[]});u.contains.push(h),f.contains.push(p);let g=[t,c];return[u,f,p,h].forEach((T=>{T.contains=T.contains.concat(g)})),g=g.concat(u,f),{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,f,{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 Ab(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:/\?>/}]},l={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(l)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:n.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(_,I)=>{I.data._beginMatch=_[1]||_[2]},"on:end":(_,I)=>{I.data._beginMatch!==_[1]&&I.ignoreMatch()}},p=n.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),h=`[ \t\n]`,g={scope:"string",variants:[u,c,f,p]},y={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},v=["false","null","true"],N=["__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"],T=["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"],x={keyword:N,literal:(_=>{const I=[];return _.forEach((k=>{I.push(k),k.toLowerCase()===k?I.push(k.toUpperCase()):I.push(k.toLowerCase())})),I})(v),built_in:T},q=_=>_.map((I=>I.replace(/\|\d+$/,""))),P={variants:[{match:[/new/,e.concat(h,"+"),e.concat("(?!",q(T).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},V=e.concat(r,"\\b(?!\\()"),F={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),V],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,e.concat(/::/,e.lookahead(/(?!class\b)/)),V],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"}}]},ee={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},ce={relevance:0,begin:/\(/,end:/\)/,keywords:x,contains:[ee,i,F,n.C_BLOCK_COMMENT_MODE,g,y,P]},pe={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",q(N).join("\\b|"),"|",q(T).join("\\b|"),"\\b)"),r,e.concat(h,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[ce]};ce.contains.push(pe);const b=[ee,F,n.C_BLOCK_COMMENT_MODE,g,y,P],O={begin:e.concat(/#\[\s*/,s),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...b]},...b,{scope:"meta",match:s}]};return{case_insensitive:!1,keywords:x,contains:[O,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,pe,F,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},P,{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:x,contains:["self",i,F,n.C_BLOCK_COMMENT_MODE,g,y]}]},{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,y]}}function wb(n){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Sb(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"],l={$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:l,illegal:/#/},f={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,f,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,c,f,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,f,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,f,u]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",g=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,y=`\\b|${r.join("|")}`,v={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${g}))[eE][+-]?(${h})[jJ]?(?=${y})`},{begin:`(${g})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${y})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${y})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${y})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${y})`},{begin:`\\b(${h})[jJ](?=${y})`}]},N={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},T={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,v,p,n.HASH_COMMENT_MODE]}]};return u.contains=[p,v,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,v,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,N,n.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[T]},{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:[v,T,p]}]}}function xb(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"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[n.COMMENT("#","$",{contains:[l]}),n.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),n.COMMENT("^__END__",n.MATCH_NOTHING_RE)],f={className:"subst",begin:/#\{/,end:/\}/,keywords:a},p={className:"string",contains:[n.BACKSLASH_ESCAPE,f],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,f]})]}]},h="[1-9](_?[0-9])*|0",g="[0-9](_?[0-9])*",y={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${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"}]},v={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},V=[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:[v]},{begin:n.IDENT_RE+"::"},{className:"symbol",begin:n.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:t}],relevance:0},y,{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,f],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);f.contains=V,v.contains=V;const pe=[{begin:/^\s*=>/,starts:{end:"$",contains:V}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:V}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[n.SHEBANG({binary:"ruby"})].concat(pe).concat(u).concat(V)}}function Ob(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))?",l=["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!"],f=["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:f,keyword:l,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:f}},{className:"punctuation",begin:"->"},i]}}function Lb(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"],l=["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"],f=["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"],h=["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=f,y=[...u,...c].filter((x=>!f.includes(x))),v={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},N={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},T={begin:e.concat(/\b/,e.either(...g),/\s*\(/),relevance:0,keywords:{built_in:g}};function C(x,{exceptions:q,when:P}={}){const V=P;return q=q||[],x.map((F=>F.match(/\|\d+$/)||q.includes(F)?F:V(F)?`${F}|0`:F))}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:C(y,{when:x=>x.length<3}),literal:i,type:l,built_in:p},contains:[{begin:e.either(...h),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:y.concat(h),literal:i,type:l}},{className:"type",begin:e.either(...a)},T,v,r,s,n.C_NUMBER_MODE,n.C_BLOCK_COMMENT_MODE,t,N]}}const _s="[A-Za-z$_][0-9A-Za-z$_]*",Nl=["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"],Tl=["true","false","null","undefined","NaN","Infinity"],Al=["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"],wl=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Sl=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],xl=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ol=[].concat(Sl,Al,wl);function Cb(n){const e=n.regex,t=(M,{after:H})=>{const $="</"+M[0].slice(1);return M.input.indexOf($,H)!==-1},r=_s,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,H)=>{const $=M[0].length+M.index,te=M.input[$];if(te==="<"||te===","){H.ignoreMatch();return}te===">"&&(t(M,{after:$})||H.ignoreMatch());let J;const ie=M.input.substring($);if(J=ie.match(/^\s*=/)){H.ignoreMatch();return}if((J=ie.match(/^\s+extends\s+/))&&J.index===0){H.ignoreMatch();return}}},l={$pattern:_s,keyword:Nl,literal:Tl,built_in:Ol,"variable.language":xl},c="[0-9](_?[0-9])*",u=`\\.(${c})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${f})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${f})\\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},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,h]},C={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]},x=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,y,v,N,{match:/\$\d+/},p];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const q=[].concat(C,h.contains),P=q.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(q)}]),V={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:P},F={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"}}]},ee={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:{_:[...Al,...wl]}},ce={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},pe={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[V],illegal:/%/},b={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function O(M){return e.concat("(?!",M.join("|"),")")}const _={match:e.concat(/\b/,O([...Sl,"super","import"].map((M=>`${M}\\s*\\(`))),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},k={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},V]},L="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",B={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(L)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[V]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),ce,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,y,v,N,C,{match:/\$\d+/},p,ee,{className:"attr",begin:r+e.lookahead(":"),relevance:0},B,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[C,n.REGEXP_MODE,{className:"function",begin:L,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:l,contains:P}]}]},{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"]}]}]},pe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[V,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[V]},_,b,F,k,{match:/\$[(.]/}]}}function Ib(n){const e=Cb(n),t=_s,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['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:_s,keyword:Nl.concat(l),literal:Tl,built_in:Ol.concat(r),"variable.language":xl},u={className:"meta",begin:"@"+t},f=(g,y,v)=>{const N=g.contains.findIndex((T=>T.label===y));if(N===-1)throw new Error("can not find mode to replace");g.contains.splice(N,1,v)};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]),f(e,"shebang",n.SHEBANG()),f(e,"use_strict",a);const h=e.contains.find((g=>g.label==="func.def"));return h.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}function Rb(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:/\)/}),l=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,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,a,c,l]}]}]},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 kb(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"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},g={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},y={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},v=[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,y,i],N=[...v];return N.pop(),N.push(a),h.contains=N,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}He.registerLanguage("bash",rb);He.registerLanguage("c",sb);He.registerLanguage("cpp",ib);He.registerLanguage("cs",ab);He.registerLanguage("css",pb);He.registerLanguage("java",mb);He.registerLanguage("javascript",vb);He.registerLanguage("json",Nb);He.registerLanguage("markdown",Tb);He.registerLanguage("plain",wb);He.registerLanguage("php",Ab);He.registerLanguage("python",Sb);He.registerLanguage("sql",Lb);He.registerLanguage("typescript",Ib);He.registerLanguage("ruby",xb);He.registerLanguage("rust",Ob);He.registerLanguage("xml",Rb);He.registerLanguage("yaml",kb);const Mb=[{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 Db=be("<button type=button><span class=QpTooltip-text>");function hs({children:n,btnClass:e,tooltipText:t,btnText:r}){return(()=>{var s=Db(),i=s.firstChild;return Xs(s,`QpTooltip ${e}`),he(s,n,i),he(s,r,i),he(i,t),s})()}var Bb=be("<button type=button class=ql-code>"),qb=be("<button type=button class=ql-code-block>"),$b=be('<span class="pi pi-hashtag">'),Pb=be('<span class="pi pi-pencil">'),Ub=be("<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>"),Fb=be('<span class="pi pi-youtube">'),Hb=be('<span class="pi pi-link">');function zb({language:n,configuration:e,videoPluginHook:t,internalLinkPluginHook:r}){const{t:s}=En(n),i=[Bb(),(()=>{var a=qb();return a.style.setProperty("border","1px dotted #999"),a})()];return(()=>{var a=Ub(),l=a.firstChild,c=l.nextSibling,u=c.nextSibling,f=u.nextSibling,p=f.nextSibling,h=p.nextSibling,g=h.nextSibling,y=g.nextSibling,v=y.nextSibling,N=v.nextSibling,T=N.nextSibling;return he(a,(()=>e?.code&&i),v),he(a,Gt(hs,{btnClass:"ql-html-snippet",get tooltipText(){return s("CustomToolbar.insertHtmlSnippetMessage")},get children(){return $b()}}),T),he(a,Gt(hs,{btnClass:"ql-obfuscate",get tooltipText(){return s("CustomToolbar.obfuscate")},get children(){return Pb()}}),T),he(a,t&&Gt(hs,{btnClass:"ql-video-plugin",get tooltipText(){return s("videoPlugin.insertVideo")},get children(){return Fb()}}),T),he(a,r&&Gt(hs,{btnClass:"ql-internal-link-plugin",get tooltipText(){return s("internalLinkPlugin.insertLink")},get children(){return Hb()}}),T),a})()}var jb=be("<div>"),Kb=be("<div class=QuillEditor>");function Gb({language:n,setValue:e,value:t,service:r,insertMedia:s,videoPluginHook:i,internalLinkPluginHook:a}){const{t:l}=En(n),c=r.configuration,f=r.fieldType.backOffice?.editorRows??26,p=zb({language:n,configuration:c,videoPluginHook:i,internalLinkPluginHook:a});let h=!1;const g=(()=>{var T=jb();return`calc(${f}rem + 24px)`!=null?T.style.setProperty("height",`calc(${f}rem + 24px)`):T.style.removeProperty("height"),T})();async function y(T,C){if(!r.uploadMedia)return;const x=C.toBlob(),q=new File([x],`${l("image")}-${(new Date).getTime()}.${T.split("/")[1]}`,{type:T}),P=await r.uploadMedia(q);P&&s(P)}const v=new A(g,{modules:{toolbar:p,syntax:c.code?{hljs:He,languages:Mb,interval:1e3}:!1,imageDropAndPaste:{handler:(T,C,x)=>{y(C,x).catch(r.logger.error)}}},theme:"snow"});v.on("text-change",((T,C,x)=>{if(!h)return;T.ops.forEach((async P=>{if(P.insert&&typeof P.insert=="string"){const V=P.insert;if(!i?.recognizeUrl(V))return;const ee=pi(v);await bl({editorContent:ee,quillEditor:v,service:r,language:n,videoPluginHook:i,value:V})}}));const q={delta:v.getContents(),html:v.getSemanticHTML()};e(q.delta)}));const N=t();return v.setContents(N??new K),v.history.clear(),h=!0,{element:(()=>{var T=Kb();return he(T,p,null),he(T,g,null),T})(),quill:v}}function Vb(){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}}}}var ft={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 Wb{constructor(e,t,r){this.dataUrl=e,this.type=t,this.name=r||""}}class zr extends Wb{constructor(e,t,r){super(e,t,r),this.dataUrl=e,this.type=t,this.name=r||`${ft.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 l=new Image;l.onload=()=>{const c=l.width,u=l.height;c>u?c>s&&(l.height=u*s/c,l.width=s):u>i&&(l.width=c*i/u,l.height=i);const f=document.createElement("canvas");f.width=l.width,f.height=l.height;const p=f.getContext("2d");if(p){p.drawImage(l,0,0,l.width,l.height);const h=this.type||"image/png",g=f.toDataURL(h,a);t(new zr(g,h,this.name))}else r({message:"[error] QuillImageDropAndPaste: Fail to minify the image, create canvas context failure."})},l.src=ft.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=ft.resolveDataUrl(this.dataUrl,this.type).replace(/^[^,]+,/,""),t=ft.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 Zb{constructor(e,t){this.quill=e,this.option=t}}class Is extends Zb{constructor(e,t){var r;super(e,t),typeof t.autoConvert!="boolean"&&(t.autoConvert=!0),t.enableNativeUploader!==!0&&ft.isObject(e.uploader)&&ft.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 zr(t,r,s)):this.insert.call(this,ft.resolveDataUrl(t,r),r)}),e)}}handlePaste(e){if(e.clipboardData&&e.clipboardData.items&&e.clipboardData.items.length){if(ft.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 zr(t,r)):this.insert(ft.resolveDataUrl(t,r),"image")}),e)}}readFiles(e,t,r){Array.prototype.forEach.call(e,(s=>{ft.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 l=e.getAsFile?e.getAsFile():e;l instanceof Blob&&a.readAsDataURL(l)}else i.match(/^text\/plain$/i)&&e.getAsString((a=>{if(ft.urlIsImageDataUrl(a)){const l=a.match(/^data:(image\/\w+);base64,/),c=l?l[1]:"image/png",u=this.getIndex();t(a,c),this.quill.deleteText(u,a.length,"user"),this.quill.setSelection(u)}else this.option.autoConvert&&ft.urlIsImage(a).then((()=>{setTimeout((()=>{const l=this.getIndex();this.quill.deleteText(l-a.length,a.length,"user"),s.insert(a,"image",l-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=l=>{l.target&&l.target.result&&t(l.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}}Is.ImageData=zr;window.QuillImageDropAndPaste=Is;"Quill"in window&&window.Quill.register("modules/imageDropAndPaste",Is);const Yb=A.import("blots/block/embed");function Qb(){return class extends Yb{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 Xb=A.import("blots/block/embed"),Qa=["alt","height","width"];function Jb({publicSiteUrl:n}){return class extends Xb{static blotName="img";static tagName="figure";static create(s){const i=super.create(s);i.classList.add("Img"),i.setAttribute("contenteditable","false");const a=document.createElement("img");if(s.src&&a.setAttribute("src",e(s.src)),s.width&&a.setAttribute("width",String(s.width)),s.height&&a.setAttribute("height",String(s.height)),a.classList.add("Img-image"),s.align){const l=Km(s.align);l&&i.classList.add(l)}return s.zoom==="none"?i.setAttribute("data-zoom","none"):i.classList.add("zoomable"),s.href&&(i.setAttribute("data-href",s.href),i.classList.add("asLink")),s.uid&&(i.setAttribute("data-uid",s.uid),s.variant&&i.setAttribute("data-variant",s.variant??"")),i.appendChild(a),i}static formats(s){return Qa.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 i=s.querySelector(".Img-image");if(!i)throw new Error("missing img node");const{uid:a,variant:l}=s.dataset;if(!a)throw new Error("missing uid");const c=i.getAttribute("src")||void 0,u=i.getAttribute("width")||void 0,f=u===void 0?void 0:Number(u),p=i.getAttribute("height")||void 0,h=p===void 0?void 0:Number(p),g=pl(s),y=s.dataset.zoom==="none"?"none":void 0,v=s.dataset.href?s.dataset.href:void 0;return{uid:a,src:c?t(c):void 0,width:f,height:h,align:g,variant:l,zoom:y,href:v}}format(s,i){Qa.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}`:e1(r)}function t(r){return r.startsWith(n)?r.substring(n.length):r}}function e1(n){return t1(n,["http","https","data"])?n:"//:0"}function t1(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 n1=A.import("blots/inline");function r1(n){return class extends n1{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 s1=A.import("blots/inline");function i1(){return class extends s1{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 cl(t)}}}const a1=A.import("blots/block/embed");function o1(n){return class extends a1{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 l1({publicSiteUrl:n,videoPluginHook:e,internalLinkPluginHook:t}){A.register("formats/img",Jb({publicSiteUrl:n}),!0),A.register("formats/html-snippet",Qb(),!0),A.register("formats/obfuscate",i1(),!0),A.register("formats/video-plugin",o1(e),!0),A.register("formats/internal-link-plugin",r1(t),!0),A.register("modules/imageDropAndPaste",Is,!0)}const x1={create:u1,init:c1},Kt=Vb();function c1(n){const e=`${n.pluginBaseUrl}/bo-plugin.css`,t=document.createElement("link");t.rel="stylesheet",t.href=e,document.head.appendChild(t),n.registerHook("htmlEditorServiceProvider",(()=>Kt.service))}function u1(n){const{fieldType:e}=n;if(e.dataType!=="json")throw new Error(`field type '${e.name}' is incompatible with Quill plugin, needs data type 'json'`);if(n.initialValue!==void 0&&!Ja(n.initialValue))throw new Error(`field type '${e.name}' is incompatible, should be a json, got '${typeof n.initialValue}'`);const t=Xa(n.initialValue);return Ll((r=>{const[s,i]=gt(t),[a,l]=gt(n.language);l1({publicSiteUrl:n.publicSiteUrl,videoPluginHook:Kt.videoPlugin,internalLinkPluginHook:Kt.internalLinkPlugin});let c;const{element:u,quill:f}=Gb({language:a,value:s,setValue:N=>{const T=s();i(N),d1(N,T)||n.setModifiedValue({j:N})},service:n,videoPluginHook:Kt.videoPlugin,internalLinkPluginHook:Kt.internalLinkPlugin,insertMedia:async N=>await(c?.(N))}),p=Ym({quillEditor:f,service:n,language:a,videoPluginHook:Kt.videoPlugin,internalLinkPluginHook:Kt.internalLinkPlugin});c=p.insertMedia;const h=f.getModule("toolbar");h.addHandler("html-snippet",p.insertHtmlSnippetHandler),h.addHandler("obfuscate",p.insertObfuscateBlotHandler),h.addHandler("video-plugin",p.insertVideoHandler),h.addHandler("internal-link-plugin",p.insertInternalLinkHandler);const g=f.root,y=N=>v(N,f,n.themeConf);g.addEventListener("click",y),Cl((()=>g.removeEventListener("click",y)));const v=async(N,T,C)=>{const x=N.target;x.classList.contains("Img-image")&&(N.stopPropagation(),x.closest(".Img").click()),x.tagName==="FIGURE"&&await Zm({editor:T,themeConf:C,service:n,element:x,language:a}),x.tagName==="BUTTON"&&x.classList.contains("HtmlSnippet")&&await Gm({language:a,editor:T,service:n,htmlSnippetBtn:x}),x.tagName==="SPAN"&&x.classList.contains("ObfuscateBlot")&&await ml({language:a,editor:T,service:n,obfuscatorSpan:x}),x.tagName==="DIV"&&x.classList.contains("VideoPlugin")&&await Wm({editor:T,videoElement:x,language:a,service:n,videoPluginHook:Kt.videoPlugin}),x.tagName==="SPAN"&&x.classList.contains("InternalLinkPlugin")&&await Vm({editor:T,internalLinkElement:x,language:a,service:n,internalLinkPluginHook:Kt.internalLinkPlugin})};return{element:u,setValue:N=>i(Xa(N)),setLanguage:l,getValue:()=>({j:s}),dispose:r,insertMedia:N=>c?.(N)}}))}function d1(n,e){return!n||!e?n===e:JSON.stringify(n)===JSON.stringify(e)}function Xa(n){if(n!==void 0)return Ja(n)&&typeof n.j=="object"&&n.j!==null?n.j:void 0}export{x1 as default};
|