@paroicms/quill-editor-plugin 1.33.0 → 1.33.1
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{createMemo as Xs,createSignal as gt,createEffect as Ui,For as Fi,Show as Hi,createRoot as Cl,onCleanup as Rl}from"https://esm.sh/solid-js@1.9.5";import{delegateEvents as Ts,template as me,insert as ue,effect as cn,className as ps,createComponent as Mt,memo as Bs}from"https://esm.sh/solid-js@1.9.5/web";function Ja(n){return typeof n=="object"&&n!==null&&"j"in n}function eo(n){return/^[0-9]+x|x[0-9]+|x[0-9]+x|[0-9]+x[0-9]+$/.test(n)}var to=typeof global=="object"&&global&&global.Object===Object&&global,Il=typeof self=="object"&&self&&self.Object===Object&&self,$t=to||Il||Function("return this")(),gn=$t.Symbol,no=Object.prototype,kl=no.hasOwnProperty,Ml=no.toString,Cr=gn?gn.toStringTag:void 0;function Dl(n){var e=kl.call(n,Cr),t=n[Cr];try{n[Cr]=void 0;var r=!0}catch{}var s=Ml.call(n);return r&&(e?n[Cr]=t:delete n[Cr]),s}var Bl=Object.prototype,$l=Bl.toString;function ql(n){return $l.call(n)}var Pl="[object Null]",Ul="[object Undefined]",zi=gn?gn.toStringTag:void 0;function dr(n){return n==null?n===void 0?Ul:Pl:zi&&zi in Object(n)?Dl(n):ql(n)}function Vt(n){return n!=null&&typeof n=="object"}var In=Array.isArray;function pn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function ro(n){return n}var Fl="[object AsyncFunction]",Hl="[object Function]",zl="[object GeneratorFunction]",jl="[object Proxy]";function bi(n){if(!pn(n))return!1;var e=dr(n);return e==Hl||e==zl||e==Fl||e==jl}var $s=$t["__core-js_shared__"],ji=function(){var n=/[^.]+$/.exec($s&&$s.keys&&$s.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function Kl(n){return!!ji&&ji in n}var Gl=Function.prototype,Vl=Gl.toString;function Bn(n){if(n!=null){try{return Vl.call(n)}catch{}try{return n+""}catch{}}return""}var Zl=/[\\^$.*+?()[\]{}|]/g,Wl=/^\[object .+?Constructor\]$/,Yl=Function.prototype,Ql=Object.prototype,Xl=Yl.toString,Jl=Ql.hasOwnProperty,ec=RegExp("^"+Xl.call(Jl).replace(Zl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function tc(n){if(!pn(n)||Kl(n))return!1;var e=bi(n)?ec:Wl;return e.test(Bn(n))}function nc(n,e){return n?.[e]}function $n(n,e){var t=nc(n,e);return tc(t)?t:void 0}var Js=$n($t,"WeakMap"),Ki=Object.create,rc=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 sc(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 ic(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var ac=800,oc=16,lc=Date.now;function cc(n){var e=0,t=0;return function(){var r=lc(),s=oc-(r-t);if(t=r,s>0){if(++e>=ac)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function uc(n){return function(){return n}}var ms=function(){try{var n=$n(Object,"defineProperty");return n({},"",{}),n}catch{}}(),dc=ms?function(n,e){return ms(n,"toString",{configurable:!0,enumerable:!1,value:uc(e),writable:!0})}:ro,hc=cc(dc);function fc(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var gc=9007199254740991,pc=/^(?:0|[1-9]\d*)$/;function so(n,e){var t=typeof n;return e=e??gc,!!e&&(t=="number"||t!="symbol"&&pc.test(n))&&n>-1&&n%1==0&&n<e}function Ei(n,e,t){e=="__proto__"&&ms?ms(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 mc=Object.prototype,bc=mc.hasOwnProperty;function io(n,e,t){var r=n[e];(!(bc.call(n,e)&&jr(r,t))||t===void 0&&!(e in n))&&Ei(n,e,t)}function Ec(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?Ei(t,l,c):io(t,l,c)}return t}var Gi=Math.max;function yc(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),sc(n,this,l)}}function _c(n,e){return hc(yc(n,e,ro),n+"")}var vc=9007199254740991;function ao(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=vc}function As(n){return n!=null&&ao(n.length)&&!bi(n)}function Nc(n,e,t){if(!pn(t))return!1;var r=typeof e;return(r=="number"?As(t)&&so(e,t.length):r=="string"&&e in t)?jr(t[e],n):!1}function Tc(n){return _c((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&&Nc(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 Ac=Object.prototype;function yi(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||Ac;return n===t}function wc(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var Sc="[object Arguments]";function Vi(n){return Vt(n)&&dr(n)==Sc}var oo=Object.prototype,xc=oo.hasOwnProperty,Oc=oo.propertyIsEnumerable,ei=Vi(function(){return arguments}())?Vi:function(n){return Vt(n)&&xc.call(n,"callee")&&!Oc.call(n,"callee")};function Lc(){return!1}var lo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Zi=lo&&typeof module=="object"&&module&&!module.nodeType&&module,Cc=Zi&&Zi.exports===lo,Wi=Cc?$t.Buffer:void 0,Rc=Wi?Wi.isBuffer:void 0,$r=Rc||Lc,Ic="[object Arguments]",kc="[object Array]",Mc="[object Boolean]",Dc="[object Date]",Bc="[object Error]",$c="[object Function]",qc="[object Map]",Pc="[object Number]",Uc="[object Object]",Fc="[object RegExp]",Hc="[object Set]",zc="[object String]",jc="[object WeakMap]",Kc="[object ArrayBuffer]",Gc="[object DataView]",Vc="[object Float32Array]",Zc="[object Float64Array]",Wc="[object Int8Array]",Yc="[object Int16Array]",Qc="[object Int32Array]",Xc="[object Uint8Array]",Jc="[object Uint8ClampedArray]",eu="[object Uint16Array]",tu="[object Uint32Array]",ke={};ke[Vc]=ke[Zc]=ke[Wc]=ke[Yc]=ke[Qc]=ke[Xc]=ke[Jc]=ke[eu]=ke[tu]=!0;ke[Ic]=ke[kc]=ke[Kc]=ke[Mc]=ke[Gc]=ke[Dc]=ke[Bc]=ke[$c]=ke[qc]=ke[Pc]=ke[Uc]=ke[Fc]=ke[Hc]=ke[zc]=ke[jc]=!1;function nu(n){return Vt(n)&&ao(n.length)&&!!ke[dr(n)]}function _i(n){return function(e){return n(e)}}var co=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Dr=co&&typeof module=="object"&&module&&!module.nodeType&&module,ru=Dr&&Dr.exports===co,qs=ru&&to.process,cr=function(){try{var n=Dr&&Dr.require&&Dr.require("util").types;return n||qs&&qs.binding&&qs.binding("util")}catch{}}(),Yi=cr&&cr.isTypedArray,vi=Yi?_i(Yi):nu,su=Object.prototype,iu=su.hasOwnProperty;function uo(n,e){var t=In(n),r=!t&&ei(n),s=!t&&!r&&$r(n),i=!t&&!r&&!s&&vi(n),a=t||r||s||i,l=a?wc(n.length,String):[],c=l.length;for(var u in n)(e||iu.call(n,u))&&!(a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||so(u,c)))&&l.push(u);return l}function ho(n,e){return function(t){return n(e(t))}}var au=ho(Object.keys,Object),ou=Object.prototype,lu=ou.hasOwnProperty;function cu(n){if(!yi(n))return au(n);var e=[];for(var t in Object(n))lu.call(n,t)&&t!="constructor"&&e.push(t);return e}function uu(n){return As(n)?uo(n):cu(n)}function du(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var hu=Object.prototype,fu=hu.hasOwnProperty;function gu(n){if(!pn(n))return du(n);var e=yi(n),t=[];for(var r in n)r=="constructor"&&(e||!fu.call(n,r))||t.push(r);return t}function fo(n){return As(n)?uo(n,!0):gu(n)}var qr=$n(Object,"create");function pu(){this.__data__=qr?qr(null):{},this.size=0}function mu(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var bu="__lodash_hash_undefined__",Eu=Object.prototype,yu=Eu.hasOwnProperty;function _u(n){var e=this.__data__;if(qr){var t=e[n];return t===bu?void 0:t}return yu.call(e,n)?e[n]:void 0}var vu=Object.prototype,Nu=vu.hasOwnProperty;function Tu(n){var e=this.__data__;return qr?e[n]!==void 0:Nu.call(e,n)}var Au="__lodash_hash_undefined__";function wu(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=qr&&e===void 0?Au: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=pu;kn.prototype.delete=mu;kn.prototype.get=_u;kn.prototype.has=Tu;kn.prototype.set=wu;function Su(){this.__data__=[],this.size=0}function ws(n,e){for(var t=n.length;t--;)if(jr(n[t][0],e))return t;return-1}var xu=Array.prototype,Ou=xu.splice;function Lu(n){var e=this.__data__,t=ws(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():Ou.call(e,t,1),--this.size,!0}function Cu(n){var e=this.__data__,t=ws(e,n);return t<0?void 0:e[t][1]}function Ru(n){return ws(this.__data__,n)>-1}function Iu(n,e){var t=this.__data__,r=ws(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function Wt(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Wt.prototype.clear=Su;Wt.prototype.delete=Lu;Wt.prototype.get=Cu;Wt.prototype.has=Ru;Wt.prototype.set=Iu;var Pr=$n($t,"Map");function ku(){this.size=0,this.__data__={hash:new kn,map:new(Pr||Wt),string:new kn}}function Mu(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Ss(n,e){var t=n.__data__;return Mu(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Du(n){var e=Ss(this,n).delete(n);return this.size-=e?1:0,e}function Bu(n){return Ss(this,n).get(n)}function $u(n){return Ss(this,n).has(n)}function qu(n,e){var t=Ss(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function qn(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])}}qn.prototype.clear=ku;qn.prototype.delete=Du;qn.prototype.get=Bu;qn.prototype.has=$u;qn.prototype.set=qu;function Pu(n,e){for(var t=-1,r=e.length,s=n.length;++t<r;)n[s+t]=e[t];return n}var go=ho(Object.getPrototypeOf,Object),Uu="[object Object]",Fu=Function.prototype,Hu=Object.prototype,po=Fu.toString,zu=Hu.hasOwnProperty,ju=po.call(Object);function Ku(n){if(!Vt(n)||dr(n)!=Uu)return!1;var e=go(n);if(e===null)return!0;var t=zu.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&po.call(t)==ju}function Gu(){this.__data__=new Wt,this.size=0}function Vu(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function Zu(n){return this.__data__.get(n)}function Wu(n){return this.__data__.has(n)}var Yu=200;function Qu(n,e){var t=this.__data__;if(t instanceof Wt){var r=t.__data__;if(!Pr||r.length<Yu-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new qn(r)}return t.set(n,e),this.size=t.size,this}function Dt(n){var e=this.__data__=new Wt(n);this.size=e.size}Dt.prototype.clear=Gu;Dt.prototype.delete=Vu;Dt.prototype.get=Zu;Dt.prototype.has=Wu;Dt.prototype.set=Qu;var mo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Qi=mo&&typeof module=="object"&&module&&!module.nodeType&&module,Xu=Qi&&Qi.exports===mo,Xi=Xu?$t.Buffer:void 0,Ji=Xi?Xi.allocUnsafe:void 0;function bo(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 Ju(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 ed(){return[]}var td=Object.prototype,nd=td.propertyIsEnumerable,ea=Object.getOwnPropertySymbols,rd=ea?function(n){return n==null?[]:(n=Object(n),Ju(ea(n),(function(e){return nd.call(n,e)})))}:ed;function sd(n,e,t){var r=e(n);return In(n)?r:Pu(r,t(n))}function ti(n){return sd(n,uu,rd)}var ni=$n($t,"DataView"),ri=$n($t,"Promise"),si=$n($t,"Set"),ta="[object Map]",id="[object Object]",na="[object Promise]",ra="[object Set]",sa="[object WeakMap]",ia="[object DataView]",ad=Bn(ni),od=Bn(Pr),ld=Bn(ri),cd=Bn(si),ud=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==id?n.constructor:void 0,r=t?Bn(t):"";if(r)switch(r){case ad:return ia;case od:return ta;case ld:return na;case cd:return ra;case ud:return sa}return e});var dd=Object.prototype,hd=dd.hasOwnProperty;function fd(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&hd.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var bs=$t.Uint8Array;function Ni(n){var e=new n.constructor(n.byteLength);return new bs(e).set(new bs(n)),e}function gd(n,e){var t=Ni(n.buffer);return new n.constructor(t,n.byteOffset,n.byteLength)}var pd=/\w*$/;function md(n){var e=new n.constructor(n.source,pd.exec(n));return e.lastIndex=n.lastIndex,e}var aa=gn?gn.prototype:void 0,oa=aa?aa.valueOf:void 0;function bd(n){return oa?Object(oa.call(n)):{}}function Eo(n,e){var t=e?Ni(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var Ed="[object Boolean]",yd="[object Date]",_d="[object Map]",vd="[object Number]",Nd="[object RegExp]",Td="[object Set]",Ad="[object String]",wd="[object Symbol]",Sd="[object ArrayBuffer]",xd="[object DataView]",Od="[object Float32Array]",Ld="[object Float64Array]",Cd="[object Int8Array]",Rd="[object Int16Array]",Id="[object Int32Array]",kd="[object Uint8Array]",Md="[object Uint8ClampedArray]",Dd="[object Uint16Array]",Bd="[object Uint32Array]";function $d(n,e,t){var r=n.constructor;switch(e){case Sd:return Ni(n);case Ed:case yd:return new r(+n);case xd:return gd(n);case Od:case Ld:case Cd:case Rd:case Id:case kd:case Md:case Dd:case Bd:return Eo(n,t);case _d:return new r;case vd:case Ad:return new r(n);case Nd:return md(n);case Td:return new r;case wd:return bd(n)}}function yo(n){return typeof n.constructor=="function"&&!yi(n)?rc(go(n)):{}}var qd="[object Map]";function Pd(n){return Vt(n)&&At(n)==qd}var la=cr&&cr.isMap,Ud=la?_i(la):Pd,Fd="[object Set]";function Hd(n){return Vt(n)&&At(n)==Fd}var ca=cr&&cr.isSet,zd=ca?_i(ca):Hd,jd=1,_o="[object Arguments]",Kd="[object Array]",Gd="[object Boolean]",Vd="[object Date]",Zd="[object Error]",vo="[object Function]",Wd="[object GeneratorFunction]",Yd="[object Map]",Qd="[object Number]",No="[object Object]",Xd="[object RegExp]",Jd="[object Set]",eh="[object String]",th="[object Symbol]",nh="[object WeakMap]",rh="[object ArrayBuffer]",sh="[object DataView]",ih="[object Float32Array]",ah="[object Float64Array]",oh="[object Int8Array]",lh="[object Int16Array]",ch="[object Int32Array]",uh="[object Uint8Array]",dh="[object Uint8ClampedArray]",hh="[object Uint16Array]",fh="[object Uint32Array]",Re={};Re[_o]=Re[Kd]=Re[rh]=Re[sh]=Re[Gd]=Re[Vd]=Re[ih]=Re[ah]=Re[oh]=Re[lh]=Re[ch]=Re[Yd]=Re[Qd]=Re[No]=Re[Xd]=Re[Jd]=Re[eh]=Re[th]=Re[uh]=Re[dh]=Re[hh]=Re[fh]=!0;Re[Zd]=Re[vo]=Re[nh]=!1;function gs(n,e,t,r,s,i){var a,l=e&jd;if(a!==void 0)return a;if(!pn(n))return n;var c=In(n);if(c)a=fd(n);else{var u=At(n),f=u==vo||u==Wd;if($r(n))return bo(n,l);if(u==No||u==_o||f&&!s)a=f?{}:yo(n);else{if(!Re[u])return s?n:{};a=$d(n,u,l)}}i||(i=new Dt);var g=i.get(n);if(g)return g;i.set(n,a),zd(n)?n.forEach((function(y){a.add(gs(y,e,t,y,n,i))})):Ud(n)&&n.forEach((function(y,v){a.set(v,gs(y,e,t,v,n,i))}));var h=ti,p=c?void 0:h(n);return fc(p||n,(function(y,v){p&&(v=y,y=n[v]),io(a,v,gs(y,e,t,v,n,i))})),a}var gh=1,ph=4;function ar(n){return gs(n,gh|ph)}var mh="__lodash_hash_undefined__";function bh(n){return this.__data__.set(n,mh),this}function Eh(n){return this.__data__.has(n)}function Es(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new qn;++e<t;)this.add(n[e])}Es.prototype.add=Es.prototype.push=bh;Es.prototype.has=Eh;function yh(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 _h(n,e){return n.has(e)}var vh=1,Nh=2;function To(n,e,t,r,s,i){var a=t&vh,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 g=-1,h=!0,p=t&Nh?new Es:void 0;for(i.set(n,e),i.set(e,n);++g<l;){var y=n[g],v=e[g];if(r)var N=a?r(v,y,g,e,n,i):r(y,v,g,n,e,i);if(N!==void 0){if(N)continue;h=!1;break}if(p){if(!yh(e,(function(T,x){if(!_h(p,x)&&(y===T||s(y,T,t,r,i)))return p.push(x)}))){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 Th(n){var e=-1,t=Array(n.size);return n.forEach((function(r,s){t[++e]=[s,r]})),t}function Ah(n){var e=-1,t=Array(n.size);return n.forEach((function(r){t[++e]=r})),t}var wh=1,Sh=2,xh="[object Boolean]",Oh="[object Date]",Lh="[object Error]",Ch="[object Map]",Rh="[object Number]",Ih="[object RegExp]",kh="[object Set]",Mh="[object String]",Dh="[object Symbol]",Bh="[object ArrayBuffer]",$h="[object DataView]",ua=gn?gn.prototype:void 0,Ps=ua?ua.valueOf:void 0;function qh(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 Bh:return!(n.byteLength!=e.byteLength||!i(new bs(n),new bs(e)));case xh:case Oh:case Rh:return jr(+n,+e);case Lh:return n.name==e.name&&n.message==e.message;case Ih:case Mh:return n==e+"";case Ch:var l=Th;case kh:var c=r&wh;if(l||(l=Ah),n.size!=e.size&&!c)return!1;var u=a.get(n);if(u)return u==e;r|=Sh,a.set(n,e);var f=To(l(n),l(e),r,s,i,a);return a.delete(n),f;case Dh:if(Ps)return Ps.call(n)==Ps.call(e)}return!1}var Ph=1,Uh=Object.prototype,Fh=Uh.hasOwnProperty;function Hh(n,e,t,r,s,i){var a=t&Ph,l=ti(n),c=l.length,u=ti(e),f=u.length;if(c!=f&&!a)return!1;for(var g=c;g--;){var h=l[g];if(!(a?h in e:Fh.call(e,h)))return!1}var p=i.get(n),y=i.get(e);if(p&&y)return p==e&&y==n;var v=!0;i.set(n,e),i.set(e,n);for(var N=a;++g<c;){h=l[g];var T=n[h],x=e[h];if(r)var R=a?r(x,T,h,e,n,i):r(T,x,h,n,e,i);if(!(R===void 0?T===x||s(T,x,t,r,i):R)){v=!1;break}N||(N=h=="constructor")}if(v&&!N){var U=n.constructor,P=e.constructor;U!=P&&"constructor"in n&&"constructor"in e&&!(typeof U=="function"&&U instanceof U&&typeof P=="function"&&P instanceof P)&&(v=!1)}return i.delete(n),i.delete(e),v}var zh=1,da="[object Arguments]",ha="[object Array]",es="[object Object]",jh=Object.prototype,fa=jh.hasOwnProperty;function Kh(n,e,t,r,s,i){var a=In(n),l=In(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,g=u==es,h=c==u;if(h&&$r(n)){if(!$r(e))return!1;a=!0,f=!1}if(h&&!f)return i||(i=new Dt),a||vi(n)?To(n,e,t,r,s,i):qh(n,e,c,t,r,s,i);if(!(t&zh)){var p=f&&fa.call(n,"__wrapped__"),y=g&&fa.call(e,"__wrapped__");if(p||y){var v=p?n.value():n,N=y?e.value():e;return i||(i=new Dt),s(v,N,t,r,i)}}return h?(i||(i=new Dt),Hh(n,e,t,r,s,i)):!1}function Ao(n,e,t,r,s){return n===e?!0:n==null||e==null||!Vt(n)&&!Vt(e)?n!==n&&e!==e:Kh(n,e,t,r,Ao,s)}function Gh(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 Vh=Gh();function ii(n,e,t){(t!==void 0&&!jr(n[e],t)||t===void 0&&!(e in n))&&Ei(n,e,t)}function Zh(n){return Vt(n)&&As(n)}function ai(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function Wh(n){return Ec(n,fo(n))}function Yh(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,g=f===void 0;if(g){var h=In(c),p=!h&&$r(c),y=!h&&!p&&vi(c);f=c,h||p||y?In(l)?f=l:Zh(l)?f=ic(l):p?(g=!1,f=bo(c,!0)):y?(g=!1,f=Eo(c,!0)):f=[]:Ku(c)||ei(c)?(f=l,ei(l)?f=Wh(l):(!pn(l)||bi(l))&&(f=yo(c))):g=!1}g&&(a.set(c,f),s(f,c,r,i,a),a.delete(c)),ii(n,t,f)}function wo(n,e,t,r,s){n!==e&&Vh(e,(function(i,a){if(s||(s=new Dt),pn(i))Yh(n,e,a,t,wo,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)}}),fo)}function Ti(n,e){return Ao(n,e)}var hn=Tc((function(n,e,t){wo(n,e,t)})),W=(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))(W||{});class Bt{constructor(e,t,r={}){this.attrName=e,this.keyName=t;const s=W.TYPE&W.ATTRIBUTE;this.scope=r.scope!=null?r.scope&W.LEVEL|s:W.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 So=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=W.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&W.LEVEL&W.BLOCK?r=this.types.block:e&W.LEVEL&W.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&W.LEVEL&r.scope&&t&W.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}))}};So.blots=new WeakMap;let ur=So;function ga(n,e){return(n.getAttribute("class")||"").split(/\s+/).filter((t=>t.indexOf(`${e}-`)===0))}class Qh 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=Qh;function Us(n){const e=n.split("-"),t=e.slice(1).map((r=>r[0].toUpperCase()+r.slice(1))).join("");return e[0]+t}class Xh 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[Us(this.keyName)]=t,!0):!1}remove(e){e.style[Us(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[Us(this.keyName)];return this.canAdd(e,t)?t:""}}const mn=Xh;class Jh{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,W.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 xs=Jh,xo=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,W.BLOT)!=null&&s)i.wrap(r,s);else if(this.scroll.query(r,W.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}};xo.blotName="abstract";let Oo=xo;const Lo=class extends Oo{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}}};Lo.scope=W.INLINE_BLOT;let ef=Lo;const et=ef;class tf{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(W.INLINE);return Array.from(n.childNodes).forEach((s=>{r.domNode.appendChild(s)})),n.parentNode&&n.parentNode.replaceChild(r.domNode,n),r.attach(),r}}const Co=class ln extends Oo{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 tf,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===W.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()}};Co.uiClass="";let nf=Co;const xt=nf;function rf(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 xs(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,W.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,W.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&&rf(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=W.INLINE_BLOT,er.tagName="SPAN";let sf=er;const Ai=sf,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 xs(this.domNode)}format(e,t){const r=this.scroll.query(e,W.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,W.BLOCK)!=null?this.format(r,s):super.formatAt(e,t,r,s)}insertAt(e,t,r){if(r==null||this.scroll.query(t,W.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=W.BLOCK_BLOT,nr.tagName="P",nr.allowedChildren=[Ai,nr,et];let af=nr;const Ur=af,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=W.BLOCK_BLOT;let of=ci;const Os=of;class lf 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=lf,cf={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},uf=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,cf),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=W.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>=uf)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((g=>{const h=this.find(g,!1);i(h,!1),h instanceof xt&&h.children.forEach((p=>{i(p,!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,Os],rr.scope=W.BLOCK_BLOT,rr.tagName="DIV";let df=rr;const wi=df,ui=class Ro 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 Ro&&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=W.INLINE_BLOT;let hf=ui;const ys=hf,ff=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Bt,AttributorStore:xs,BlockBlot:Ur,ClassAttributor:Lt,ContainerBlot:Os,EmbedBlot:lt,InlineBlot:Ai,LeafBlot:et,ParentBlot:xt,Registry:ur,Scope:W,ScrollBlot:wi,StyleAttributor:mn,TextBlot:ys},Symbol.toStringTag,{value:"Module"}));var un=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Si(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ts={exports:{}},Fs,ma;function gf(){if(ma)return Fs;ma=1;var n=-1,e=1,t=0;function r(m,C,_,L,k){if(m===C)return m?[[t,m]]:[];if(_!=null){var O=de(m,C,_);if(O)return O}var D=l(m,C),M=m.substring(0,D);m=m.substring(D),C=C.substring(D),D=u(m,C);var H=m.substring(m.length-D);m=m.substring(0,m.length-D),C=C.substring(0,C.length-D);var $=s(m,C);return M&&$.unshift([t,M]),H&&$.push([t,H]),x($,k),L&&g($),$}function s(m,C){var _;if(!m)return[[e,C]];if(!C)return[[n,m]];var L=m.length>C.length?m:C,k=m.length>C.length?C:m,O=L.indexOf(k);if(O!==-1)return _=[[e,L.substring(0,O)],[t,k],[e,L.substring(O+k.length)]],m.length>C.length&&(_[0][0]=_[2][0]=n),_;if(k.length===1)return[[n,m],[e,C]];var D=f(m,C);if(D){var M=D[0],H=D[1],$=D[2],ee=D[3],J=D[4],ae=r(M,$),fe=r(H,ee);return ae.concat([[t,J]],fe)}return i(m,C)}function i(m,C){for(var _=m.length,L=C.length,k=Math.ceil((_+L)/2),O=k,D=2*k,M=new Array(D),H=new Array(D),$=0;$<D;$++)M[$]=-1,H[$]=-1;M[O+1]=0,H[O+1]=0;for(var ee=_-L,J=ee%2!==0,ae=0,fe=0,X=0,Oe=0,Le=0;Le<k;Le++){for(var ce=-Le+ae;ce<=Le-fe;ce+=2){var _e=O+ce,ge;ce===-Le||ce!==Le&&M[_e-1]<M[_e+1]?ge=M[_e+1]:ge=M[_e-1]+1;for(var Ee=ge-ce;ge<_&&Ee<L&&m.charAt(ge)===C.charAt(Ee);)ge++,Ee++;if(M[_e]=ge,ge>_)fe+=2;else if(Ee>L)ae+=2;else if(J){var ve=O+ee-ce;if(ve>=0&&ve<D&&H[ve]!==-1){var Ne=_-H[ve];if(ge>=Ne)return a(m,C,ge,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<_&&ze<L&&m.charAt(_-Ne-1)===C.charAt(L-ze-1);)Ne++,ze++;if(H[ve]=Ne,Ne>_)Oe+=2;else if(ze>L)X+=2;else if(!J){var _e=O+ee-De;if(_e>=0&&_e<D&&M[_e]!==-1){var ge=M[_e],Ee=O+ge-_e;if(Ne=_-Ne,ge>=Ne)return a(m,C,ge,Ee)}}}}return[[n,m],[e,C]]}function a(m,C,_,L){var k=m.substring(0,_),O=C.substring(0,L),D=m.substring(_),M=C.substring(L),H=r(k,O),$=r(D,M);return H.concat($)}function l(m,C){if(!m||!C||m.charAt(0)!==C.charAt(0))return 0;for(var _=0,L=Math.min(m.length,C.length),k=L,O=0;_<k;)m.substring(O,k)==C.substring(O,k)?(_=k,O=_):L=k,k=Math.floor((L-_)/2+_);return R(m.charCodeAt(k-1))&&k--,k}function c(m,C){var _=m.length,L=C.length;if(_==0||L==0)return 0;_>L?m=m.substring(_-L):_<L&&(C=C.substring(0,_));var k=Math.min(_,L);if(m==C)return k;for(var O=0,D=1;;){var M=m.substring(k-D),H=C.indexOf(M);if(H==-1)return O;D+=H,(H==0||m.substring(k-D)==C.substring(0,D))&&(O=D,D++)}}function u(m,C){if(!m||!C||m.slice(-1)!==C.slice(-1))return 0;for(var _=0,L=Math.min(m.length,C.length),k=L,O=0;_<k;)m.substring(m.length-k,m.length-O)==C.substring(C.length-k,C.length-O)?(_=k,O=_):L=k,k=Math.floor((L-_)/2+_);return U(m.charCodeAt(m.length-k))&&k--,k}function f(m,C){var _=m.length>C.length?m:C,L=m.length>C.length?C:m;if(_.length<4||L.length*2<_.length)return null;function k(fe,X,Oe){for(var Le=fe.substring(Oe,Oe+Math.floor(fe.length/4)),ce=-1,_e="",ge,Ee,ve,Ne;(ce=X.indexOf(Le,ce+1))!==-1;){var De=l(fe.substring(Oe),X.substring(ce)),ze=u(fe.substring(0,Oe),X.substring(0,ce));_e.length<ze+De&&(_e=X.substring(ce-ze,ce)+X.substring(ce,ce+De),ge=fe.substring(0,Oe-ze),Ee=fe.substring(Oe+De),ve=X.substring(0,ce-ze),Ne=X.substring(ce+De))}return _e.length*2>=fe.length?[ge,Ee,ve,Ne,_e]:null}var O=k(_,L,Math.ceil(_.length/4)),D=k(_,L,Math.ceil(_.length/2)),M;if(!O&&!D)return null;D?O?M=O[4].length>D[4].length?O:D:M=D:M=O;var H,$,ee,J;m.length>C.length?(H=M[0],$=M[1],ee=M[2],J=M[3]):(ee=M[0],J=M[1],H=M[2],$=M[3]);var ae=M[4];return[H,$,ee,J,ae]}function g(m){for(var C=!1,_=[],L=0,k=null,O=0,D=0,M=0,H=0,$=0;O<m.length;)m[O][0]==t?(_[L++]=O,D=H,M=$,H=0,$=0,k=m[O][1]):(m[O][0]==e?H+=m[O][1].length:$+=m[O][1].length,k&&k.length<=Math.max(D,M)&&k.length<=Math.max(H,$)&&(m.splice(_[L-1],0,[n,k]),m[_[L-1]+1][0]=e,L--,L--,O=L>0?_[L-1]:-1,D=0,M=0,H=0,$=0,k=null,C=!0)),O++;for(C&&x(m),T(m),O=1;O<m.length;){if(m[O-1][0]==n&&m[O][0]==e){var ee=m[O-1][1],J=m[O][1],ae=c(ee,J),fe=c(J,ee);ae>=fe?(ae>=ee.length/2||ae>=J.length/2)&&(m.splice(O,0,[t,J.substring(0,ae)]),m[O-1][1]=ee.substring(0,ee.length-ae),m[O+1][1]=J.substring(ae),O++):(fe>=ee.length/2||fe>=J.length/2)&&(m.splice(O,0,[t,ee.substring(0,fe)]),m[O-1][0]=e,m[O-1][1]=J.substring(0,J.length-fe),m[O+1][0]=n,m[O+1][1]=ee.substring(fe),O++),O++}O++}}var h=/[^a-zA-Z0-9]/,p=/\s/,y=/[\r\n]/,v=/\n\r?\n$/,N=/^\r?\n\r?\n/;function T(m){function C(fe,X){if(!fe||!X)return 6;var Oe=fe.charAt(fe.length-1),Le=X.charAt(0),ce=Oe.match(h),_e=Le.match(h),ge=ce&&Oe.match(p),Ee=_e&&Le.match(p),ve=ge&&Oe.match(y),Ne=Ee&&Le.match(y),De=ve&&fe.match(v),ze=Ne&&X.match(N);return De||ze?5:ve||Ne?4:ce&&!ge&&Ee?3:ge||Ee?2:ce||_e?1:0}for(var _=1;_<m.length-1;){if(m[_-1][0]==t&&m[_+1][0]==t){var L=m[_-1][1],k=m[_][1],O=m[_+1][1],D=u(L,k);if(D){var M=k.substring(k.length-D);L=L.substring(0,L.length-D),k=M+k.substring(0,k.length-D),O=M+O}for(var H=L,$=k,ee=O,J=C(L,k)+C(k,O);k.charAt(0)===O.charAt(0);){L+=k.charAt(0),k=k.substring(1)+O.charAt(0),O=O.substring(1);var ae=C(L,k)+C(k,O);ae>=J&&(J=ae,H=L,$=k,ee=O)}m[_-1][1]!=H&&(H?m[_-1][1]=H:(m.splice(_-1,1),_--),m[_][1]=$,ee?m[_+1][1]=ee:(m.splice(_+1,1),_--))}_++}}function x(m,C){m.push([t,""]);for(var _=0,L=0,k=0,O="",D="",M;_<m.length;){if(_<m.length-1&&!m[_][1]){m.splice(_,1);continue}switch(m[_][0]){case e:k++,D+=m[_][1],_++;break;case n:L++,O+=m[_][1],_++;break;case t:var H=_-k-L-1;if(C){if(H>=0&&Z(m[H][1])){var $=m[H][1].slice(-1);if(m[H][1]=m[H][1].slice(0,-1),O=$+O,D=$+D,!m[H][1]){m.splice(H,1),_--;var ee=H-1;m[ee]&&m[ee][0]===e&&(k++,D=m[ee][1]+D,ee--),m[ee]&&m[ee][0]===n&&(L++,O=m[ee][1]+O,ee--),H=ee}}if(P(m[_][1])){var $=m[_][1].charAt(0);m[_][1]=m[_][1].slice(1),O+=$,D+=$}}if(_<m.length-1&&!m[_][1]){m.splice(_,1);break}if(O.length>0||D.length>0){O.length>0&&D.length>0&&(M=l(D,O),M!==0&&(H>=0?m[H][1]+=D.substring(0,M):(m.splice(0,0,[t,D.substring(0,M)]),_++),D=D.substring(M),O=O.substring(M)),M=u(D,O),M!==0&&(m[_][1]=D.substring(D.length-M)+m[_][1],D=D.substring(0,D.length-M),O=O.substring(0,O.length-M)));var J=k+L;O.length===0&&D.length===0?(m.splice(_-J,J),_=_-J):O.length===0?(m.splice(_-J,J,[e,D]),_=_-J+1):D.length===0?(m.splice(_-J,J,[n,O]),_=_-J+1):(m.splice(_-J,J,[n,O],[e,D]),_=_-J+2)}_!==0&&m[_-1][0]===t?(m[_-1][1]+=m[_][1],m.splice(_,1)):_++,k=0,L=0,O="",D="";break}}m[m.length-1][1]===""&&m.pop();var ae=!1;for(_=1;_<m.length-1;)m[_-1][0]===t&&m[_+1][0]===t&&(m[_][1].substring(m[_][1].length-m[_-1][1].length)===m[_-1][1]?(m[_][1]=m[_-1][1]+m[_][1].substring(0,m[_][1].length-m[_-1][1].length),m[_+1][1]=m[_-1][1]+m[_+1][1],m.splice(_-1,1),ae=!0):m[_][1].substring(0,m[_+1][1].length)==m[_+1][1]&&(m[_-1][1]+=m[_+1][1],m[_][1]=m[_][1].substring(m[_+1][1].length)+m[_+1][1],m.splice(_+1,1),ae=!0)),_++;ae&&x(m,C)}function R(m){return m>=55296&&m<=56319}function U(m){return m>=56320&&m<=57343}function P(m){return U(m.charCodeAt(0))}function Z(m){return R(m.charCodeAt(m.length-1))}function se(m){for(var C=[],_=0;_<m.length;_++)m[_][1].length>0&&C.push(m[_]);return C}function F(m,C,_,L){return Z(m)||P(L)?null:se([[t,m],[n,C],[e,_],[t,L]])}function de(m,C,_){var L=typeof _=="number"?{index:_,length:0}:_.oldRange,k=typeof _=="number"?null:_.newRange,O=m.length,D=C.length;if(L.length===0&&(k===null||k.length===0)){var M=L.index,H=m.slice(0,M),$=m.slice(M),ee=k?k.index:null;e:{var J=M+D-O;if(ee!==null&&ee!==J||J<0||J>D)break e;var ae=C.slice(0,J),fe=C.slice(J);if(fe!==$)break e;var X=Math.min(M,J),Oe=H.slice(0,X),Le=ae.slice(0,X);if(Oe!==Le)break e;var ce=H.slice(X),_e=ae.slice(X);return F(Oe,ce,_e,$)}e:{if(ee!==null&&ee!==M)break e;var ge=M,ae=C.slice(0,ge),fe=C.slice(ge);if(ae!==H)break e;var Ee=Math.min(O-ge,D-ge),ve=$.slice($.length-Ee),Ne=fe.slice(fe.length-Ee);if(ve!==Ne)break e;var ce=$.slice(0,$.length-Ee),_e=fe.slice(0,fe.length-Ee);return F(H,ce,_e,ve)}}if(L.length>0&&k&&k.length===0)e:{var Oe=m.slice(0,L.index),ve=m.slice(L.index+L.length),X=Oe.length,Ee=ve.length;if(D<X+Ee)break e;var Le=C.slice(0,X),Ne=C.slice(D-Ee);if(Oe!==Le||ve!==Ne)break e;var ce=m.slice(X,O-Ee),_e=C.slice(X,D-Ee);return F(Oe,ce,_e,ve)}return null}function ie(m,C,_,L){return r(m,C,_,L,!0)}return ie.INSERT=e,ie.DELETE=n,ie.EQUAL=t,Fs=ie,Fs}var Ir={exports:{}};Ir.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]",g="[object GeneratorFunction]",h="[object Map]",p="[object Number]",y="[object Object]",v="[object Promise]",N="[object RegExp]",T="[object Set]",x="[object String]",R="[object Symbol]",U="[object WeakMap]",P="[object ArrayBuffer]",Z="[object DataView]",se="[object Float32Array]",F="[object Float64Array]",de="[object Int8Array]",ie="[object Int16Array]",m="[object Int32Array]",C="[object Uint8Array]",_="[object Uint8ClampedArray]",L="[object Uint16Array]",k="[object Uint32Array]",O=/[\\^$.*+?()[\]{}|]/g,D=/\w*$/,M=/^\[object .+?Constructor\]$/,H=/^(?:0|[1-9]\d*)$/,$={};$[i]=$[a]=$[P]=$[Z]=$[l]=$[c]=$[se]=$[F]=$[de]=$[ie]=$[m]=$[h]=$[p]=$[y]=$[N]=$[T]=$[x]=$[R]=$[C]=$[_]=$[L]=$[k]=!0,$[u]=$[f]=$[U]=!1;var ee=typeof un=="object"&&un&&un.Object===Object&&un,J=typeof self=="object"&&self&&self.Object===Object&&self,ae=ee||J||Function("return this")(),fe=e&&!e.nodeType&&e,X=fe&&!0&&n&&!n.nodeType&&n,Oe=X&&X.exports===fe;function Le(o,d){return o.set(d[0],d[1]),o}function ce(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 ge(o,d){for(var E=-1,w=d.length,le=o.length;++E<w;)o[le+E]=d[E];return o}function Ee(o,d,E,w){for(var le=-1,Q=o?o.length:0;++le<Q;)E=d(E,o[le],le,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,le){E[++d]=[le,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=ae["__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,Rt=RegExp("^"+vn.call(je).replace(O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ct=Oe?ae.Buffer:void 0,Ft=ae.Symbol,Nn=ae.Uint8Array,rt=yn(Object.getPrototypeOf,Object),jn=Object.create,Kn=Pt.propertyIsEnumerable,pr=fr.splice,Qt=Object.getOwnPropertySymbols,Xt=ct?ct.isBuffer:void 0,Gn=yn(Object.keys,Object),Jt=at(ae,"DataView"),yt=at(ae,"Map"),st=at(ae,"Promise"),Ht=at(ae,"Set"),Tn=at(ae,"WeakMap"),It=at(Object,"create"),ut=B(Jt),b=B(yt),S=B(st),q=B(Ht),ne=B(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__=It?It(null):{}}function re(o){return this.has(o)&&delete this.__data__[o]}function Be(o){var d=this.__data__;if(It){var E=d[o];return E===r?void 0:E}return je.call(d,o)?d[o]:void 0}function Ie(o){var d=this.__data__;return It?d[o]!==void 0:je.call(d,o)}function _t(o,d){var E=this.__data__;return E[o]=It&&d===void 0?r:d,this}z.prototype.clear=j,z.prototype.delete=re,z.prototype.get=Be,z.prototype.has=Ie,z.prototype.set=_t;function qe(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}qe.prototype.clear=An,qe.prototype.delete=mr,qe.prototype.get=wn,qe.prototype.has=br,qe.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||qe),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 qe(o)}function dt(){this.__data__=new qe}function Zn(o){return this.__data__.delete(o)}function Wn(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 qe){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=Zn,Ye.prototype.get=Wn,Ye.prototype.has=Nr,Ye.prototype.set=Tr;function tn(o,d){var E=$e(o)||pe(o)?ve(o.length,String):[],w=E.length,le=!!w;for(var Q in o)je.call(o,Q)&&!(le&&(Q=="length"||sn(Q,w)))&&E.push(Q);return E}function zt(o,d,E){var w=o[d];(!(je.call(o,d)&&oe(w,E))||E===void 0&&!(d in o))&&(o[d]=E)}function nn(o,d){for(var E=o.length;E--;)if(oe(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,le,Q,ye){var be;if(w&&(be=Q?w(o,le,Q,ye):w(o)),be!==void 0)return be;if(!kt(o))return o;var Pe=$e(o);if(Pe){if(be=Xn(o),!d)return Sr(o,be)}else{var we=te(o),Xe=we==f||we==g;if(Jn(o))return vt(o,d);if(we==y||we==i||Xe&&!Q){if(De(o))return Q?o:{};if(be=xe(Xe?{}:o),!d)return rn(o,I(be,o))}else{if(!$[we])return Q?o:{};be=Se(o,we,Y,d)}}ye||(ye=new Ye);var it=ye.get(o);if(it)return it;if(ye.set(o,be),!Pe)var Fe=E?Qn(o):Lr(o);return _e(Fe||o,(function(Je,Ze){Fe&&(Ze=Je,Je=o[Ze]),zt(be,Ze,Y(Je,d,E,w,Ze,o,ye))})),be}function he(o){return kt(o)?jn(o):{}}function Ae(o,d,E){var w=d(o);return $e(o)?w:ge(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)?Rt:M;return d.test(B(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,D.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,ce,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 le=-1,Q=d.length;++le<Q;){var ye=d[le],be=void 0;zt(E,ye,be===void 0?o[ye]:be)}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):Ms,te=Me;(Jt&&te(new Jt(new ArrayBuffer(1)))!=Z||yt&&te(new yt)!=h||st&&te(st.resolve())!=v||Ht&&te(new Ht)!=T||Tn&&te(new Tn)!=U)&&(te=function(o){var d=Ut.call(o),E=d==y?o.constructor:void 0,w=E?B(E):void 0;if(w)switch(w){case ut:return Z;case b:return h;case S:return v;case q:return T;case ne:return U}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)?he(rt(o)):{}}function Se(o,d,E,w){var le=o.constructor;switch(d){case P:return Ue(o);case l:case c:return new le(+o);case Z:return Ge(o,w);case se:case F:case de:case ie:case m:case C:case _:case L:case k:return wr(o,w);case h:return Sn(o,w,E);case p:case x:return new le(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 B(o){if(o!=null){try{return vn.call(o)}catch{}try{return o+""}catch{}}return""}function V(o){return Y(o,!0,!0)}function oe(o,d){return o===d||o!==o&&d!==d}function pe(o){return xr(o)&&je.call(o,"callee")&&(!Kn.call(o,"callee")||Ut.call(o)==i)}var $e=Array.isArray;function Qe(o){return o!=null&&Yr(o.length)&&!Or(o)}function xr(o){return Qr(o)&&Qe(o)}var Jn=Xt||Ds;function Or(o){var d=kt(o)?Ut.call(o):"";return d==f||d==g}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 Ms(){return[]}function Ds(){return!1}n.exports=V}(Ir,Ir.exports)),Ir.exports}var kr={exports:{}};kr.exports;var Ea;function ko(){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]",g="[object Date]",h="[object Error]",p="[object Function]",y="[object GeneratorFunction]",v="[object Map]",N="[object Number]",T="[object Null]",x="[object Object]",R="[object Promise]",U="[object Proxy]",P="[object RegExp]",Z="[object Set]",se="[object String]",F="[object Symbol]",de="[object Undefined]",ie="[object WeakMap]",m="[object ArrayBuffer]",C="[object DataView]",_="[object Float32Array]",L="[object Float64Array]",k="[object Int8Array]",O="[object Int16Array]",D="[object Int32Array]",M="[object Uint8Array]",H="[object Uint8ClampedArray]",$="[object Uint16Array]",ee="[object Uint32Array]",J=/[\\^$.*+?()[\]{}|]/g,ae=/^\[object .+?Constructor\]$/,fe=/^(?:0|[1-9]\d*)$/,X={};X[_]=X[L]=X[k]=X[O]=X[D]=X[M]=X[H]=X[$]=X[ee]=!0,X[l]=X[c]=X[m]=X[f]=X[C]=X[g]=X[h]=X[p]=X[v]=X[N]=X[x]=X[P]=X[Z]=X[se]=X[ie]=!1;var Oe=typeof un=="object"&&un&&un.Object===Object&&un,Le=typeof self=="object"&&self&&self.Object===Object&&self,ce=Oe||Le||Function("return this")(),_e=e&&!e.nodeType&&e,ge=_e&&!0&&n&&!n.nodeType&&n,Ee=ge&&ge.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,le=0,Q=[];++E<w;){var ye=o[E];d(ye,E,o)&&(Q[le++]=ye)}return Q}function yn(o,d){for(var E=-1,w=d.length,le=o.length;++E<w;)o[le+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,le){E[++d]=[le,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,Rt=Function.prototype,ct=Object.prototype,Ft=ce["__core-js_shared__"],Nn=Rt.toString,rt=ct.hasOwnProperty,jn=function(){var o=/[^.]+$/.exec(Ft&&Ft.keys&&Ft.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?ce.Buffer:void 0,Xt=ce.Symbol,Gn=ce.Uint8Array,Jt=ct.propertyIsEnumerable,yt=Ut.splice,st=Xt?Xt.toStringTag:void 0,Ht=Object.getOwnPropertySymbols,Tn=Qt?Qt.isBuffer:void 0,It=vn(Object.keys,Object),ut=ot(ce,"DataView"),b=ot(ce,"Map"),S=ot(ce,"Promise"),q=ot(ce,"Set"),ne=ot(ce,"WeakMap"),Te=ot(Object,"create"),Ce=B(ut),z=B(b),j=B(S),re=B(q),Be=B(ne),Ie=Xt?Xt.prototype:void 0,_t=Ie?Ie.valueOf:void 0;function qe(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}qe.prototype.clear=An,qe.prototype.delete=mr,qe.prototype.get=wn,qe.prototype.has=br,qe.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 qe,map:new(b||Ke),string:new qe}}function Zn(o){var d=at(this,o).delete(o);return this.size-=d?1:0,d}function Wn(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=Zn,Ye.prototype.get=Wn,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 he(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(!b||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=he,I.prototype.get=Ae,I.prototype.has=Me,I.prototype.set=tt;function ht(o,d){var E=pe(o),w=!E&&oe(o),le=!E&&!w&&Qe(o),Q=!E&&!w&&!le&&Qr(o),ye=E||w||le||Q,be=ye?fr(o.length,String):[],Pe=be.length;for(var we in o)rt.call(o,we)&&!(ye&&(we=="length"||le&&(we=="offset"||we=="parent")||Q&&(we=="buffer"||we=="byteLength"||we=="byteOffset")||Se(we,Pe)))&&be.push(we);return be}function vt(o,d){for(var E=o.length;E--;)if(V(o[E][0],d))return E;return-1}function Ue(o,d,E){var w=d(o);return pe(o)?w:yn(w,E(o))}function Ge(o){return o==null?o===void 0?de:T:st&&st in Object(o)?te(o):an(o)}function Sn(o){return kt(o)&&Ge(o)==l}function xn(o,d,E,w,le){return o===d?!0:o==null||d==null||!kt(o)&&!kt(d)?o!==o&&d!==d:Yn(o,d,E,w,xn,le)}function Yn(o,d,E,w,le,Q){var ye=pe(o),be=pe(d),Pe=ye?c:xe(o),we=be?c:xe(d);Pe=Pe==l?x:Pe,we=we==l?x:we;var Xe=Pe==x,it=we==x,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,le,Q):rn(o,d,Pe,E,w,le,Q);if(!(E&s)){var Je=Xe&&rt.call(o,"__wrapped__"),Ze=it&&rt.call(d,"__wrapped__");if(Je||Ze){var on=Je?o.value():o,jt=Ze?d.value():d;return Q||(Q=new I),le(on,jt,E,w,Q)}}return Fe?(Q||(Q=new I),Qn(o,d,E,w,le,Q)):!1}function Ar(o){if(!Yr(o)||Nt(o))return!1;var d=Jn(o)?pr:ae;return d.test(B(o))}function wr(o){return kt(o)&&Or(o.length)&&!!X[Ge(o)]}function Sr(o){if(!Ln(o))return It(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,le,Q){var ye=E&s,be=o.length,Pe=d.length;if(be!=Pe&&!(ye&&Pe>be))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<be;){var Je=o[Xe],Ze=d[Xe];if(w)var on=ye?w(Ze,Je,Xe,d,o,Q):w(Je,Ze,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||le(Je,jt,E,w,Q)))return Fe.push(Cn)}))){it=!1;break}}else if(!(Je===Ze||le(Je,Ze,E,w,Q))){it=!1;break}}return Q.delete(o),Q.delete(d),it}function rn(o,d,E,w,le,Q,ye){switch(E){case C:if(o.byteLength!=d.byteLength||o.byteOffset!=d.byteOffset)return!1;o=o.buffer,d=d.buffer;case m:return!(o.byteLength!=d.byteLength||!Q(new Gn(o),new Gn(d)));case f:case g:case N:return V(+o,+d);case h:return o.name==d.name&&o.message==d.message;case P:case se:return o==d+"";case v:var be=zn;case Z:var Pe=w&s;if(be||(be=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(be(o),be(d),w,le,Q,ye);return ye.delete(o),Xe;case F:if(_t)return _t.call(o)==_t.call(d)}return!1}function Qn(o,d,E,w,le,Q){var ye=E&s,be=Ve(o),Pe=be.length,we=Ve(d),Xe=we.length;if(Pe!=Xe&&!ye)return!1;for(var it=Pe;it--;){var Fe=be[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 Ze=!0;Q.set(o,d),Q.set(d,o);for(var on=ye;++it<Pe;){Fe=be[it];var jt=o[Fe],Cn=d[Fe];if(w)var Pi=ye?w(Cn,jt,Fe,d,o,Q):w(jt,Cn,Fe,o,d,Q);if(!(Pi===void 0?jt===Cn||le(jt,Cn,E,w,Q):Pi)){Ze=!1;break}on||(on=Fe=="constructor")}if(Ze&&!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)&&(Ze=!1)}return Q.delete(o),Q.delete(d),Ze}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 te(o){var d=rt.call(o,st),E=o[st];try{o[st]=void 0;var w=!0}catch{}var le=Kn.call(o);return w&&(d?o[st]=E:delete o[st]),le}var Xn=Ht?function(o){return o==null?[]:(o=Object(o),ze(Ht(o),(function(d){return Jt.call(o,d)})))}:Ms,xe=Ge;(ut&&xe(new ut(new ArrayBuffer(1)))!=C||b&&xe(new b)!=v||S&&xe(S.resolve())!=R||q&&xe(new q)!=Z||ne&&xe(new ne)!=ie)&&(xe=function(o){var d=Ge(o),E=d==x?o.constructor:void 0,w=E?B(E):"";if(w)switch(w){case Ce:return C;case z:return v;case j:return R;case re:return Z;case Be:return ie}return d});function Se(o,d){return d=d??a,!!d&&(typeof o=="number"||fe.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 B(o){if(o!=null){try{return Nn.call(o)}catch{}try{return o+""}catch{}}return""}function V(o,d){return o===d||o!==o&&d!==d}var oe=Sn(function(){return arguments}())?Sn:function(o){return kt(o)&&rt.call(o,"callee")&&!Jt.call(o,"callee")},pe=Array.isArray;function $e(o){return o!=null&&Or(o.length)&&!Jn(o)}var Qe=Tn||Ds;function xr(o,d){return xn(o,d)}function Jn(o){if(!Yr(o))return!1;var d=Ge(o);return d==p||d==y||d==u||d==U}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 $e(o)?ht(o):Sr(o)}function Ms(){return[]}function Ds(){return!1}n.exports=xr}(kr,kr.exports)),kr.exports}var ns={},ya;function pf(){if(ya)return ns;ya=1,Object.defineProperty(ns,"__esModule",{value:!0});const n=Io(),e=ko();var t;return function(r){function s(c={},u={},f=!1){typeof c!="object"&&(c={}),typeof u!="object"&&(u={});let g=n(u);f||(g=Object.keys(g).reduce(((h,p)=>(g[p]!=null&&(h[p]=g[p]),h)),{}));for(const h in c)c[h]!==void 0&&u[h]===void 0&&(g[h]=c[h]);return Object.keys(g).length>0?g: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(((g,h)=>(e(c[h],u[h])||(g[h]=u[h]===void 0?null:u[h]),g)),{});return Object.keys(f).length>0?f:void 0}r.diff=i;function a(c={},u={}){c=c||{};const f=Object.keys(u).reduce(((g,h)=>(u[h]!==c[h]&&c[h]!==void 0&&(g[h]=u[h]),g)),{});return Object.keys(c).reduce(((g,h)=>(c[h]!==u[h]&&u[h]===void 0&&(g[h]=null),g)),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 g=Object.keys(u).reduce(((h,p)=>(c[p]===void 0&&(h[p]=u[p]),h)),{});return Object.keys(g).length>0?g:void 0}r.transform=l}(t||(t={})),ns.default=t,ns}var rs={},_a;function Mo(){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 mf(){if(va)return ss;va=1,Object.defineProperty(ss,"__esModule",{value:!0});const n=Mo();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 bf(){return Na||(Na=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=gf(),r=Io(),s=ko(),i=pf();e.AttributeMap=i.default;const a=Mo();e.Op=a.default;const l=mf();e.OpIterator=l.default;const c="\0",u=(g,h)=>{if(typeof g!="object"||g===null)throw new Error(`cannot retain a ${typeof g}`);if(typeof h!="object"||h===null)throw new Error(`cannot retain a ${typeof h}`);const p=Object.keys(g)[0];if(!p||p!==Object.keys(h)[0])throw new Error(`embed types not matched: ${p} != ${Object.keys(h)[0]}`);return[p,g[p],h[p]]};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,p){this.handlers[h]=p}static unregisterEmbed(h){delete this.handlers[h]}static getHandler(h){const p=this.handlers[h];if(!p)throw new Error(`no handlers for embed type "${h}"`);return p}insert(h,p){const y={};return typeof h=="string"&&h.length===0?this:(y.insert=h,p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(y.attributes=p),this.push(y))}delete(h){return h<=0?this:this.push({delete:h})}retain(h,p){if(typeof h=="number"&&h<=0)return this;const y={retain:h};return p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(y.attributes=p),this.push(y)}push(h){let p=this.ops.length,y=this.ops[p-1];if(h=r(h),typeof y=="object"){if(typeof h.delete=="number"&&typeof y.delete=="number")return this.ops[p-1]={delete:y.delete+h.delete},this;if(typeof y.delete=="number"&&h.insert!=null&&(p-=1,y=this.ops[p-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[p-1]={insert:y.insert+h.insert},typeof h.attributes=="object"&&(this.ops[p-1].attributes=h.attributes),this;if(typeof h.retain=="number"&&typeof y.retain=="number")return this.ops[p-1]={retain:y.retain+h.retain},typeof h.attributes=="object"&&(this.ops[p-1].attributes=h.attributes),this}}return p===this.ops.length?this.ops.push(h):this.ops.splice(p,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 p=[],y=[];return this.forEach((v=>{(h(v)?p:y).push(v)})),[p,y]}reduce(h,p){return this.ops.reduce(h,p)}changeLength(){return this.reduce(((h,p)=>p.insert?h+a.default.length(p):p.delete?h-p.delete:h),0)}length(){return this.reduce(((h,p)=>h+a.default.length(p)),0)}slice(h=0,p=1/0){const y=[],v=new l.default(this.ops);let N=0;for(;N<p&&v.hasNext();){let T;N<h?T=v.next(h-N):(T=v.next(p-N),y.push(T)),N+=a.default.length(T)}return new f(y)}compose(h){const p=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 x=N.retain;for(;p.peekType()==="insert"&&p.peekLength()<=x;)x-=p.peekLength(),v.push(p.next());N.retain-x>0&&y.next(N.retain-x)}const T=new f(v);for(;p.hasNext()||y.hasNext();)if(y.peekType()==="insert")T.push(y.next());else if(p.peekType()==="delete")T.push(p.next());else{const x=Math.min(p.peekLength(),y.peekLength()),R=p.next(x),U=y.next(x);if(U.retain){const P={};if(typeof R.retain=="number")P.retain=typeof U.retain=="number"?x:U.retain;else if(typeof U.retain=="number")R.retain==null?P.insert=R.insert:P.retain=R.retain;else{const se=R.retain==null?"insert":"retain",[F,de,ie]=u(R[se],U.retain),m=f.getHandler(F);P[se]={[F]:m.compose(de,ie,se==="retain")}}const Z=i.default.compose(R.attributes,U.attributes,typeof R.retain=="number");if(Z&&(P.attributes=Z),T.push(P),!y.hasNext()&&s(T.ops[T.ops.length-1],P)){const se=new f(p.rest());return T.concat(se).chop()}}else typeof U.delete=="number"&&(typeof R.retain=="number"||typeof R.retain=="object"&&R.retain!==null)&&T.push(U)}return T.chop()}concat(h){const p=new f(this.ops.slice());return h.ops.length>0&&(p.push(h.ops[0]),p.ops=p.ops.concat(h.ops.slice(1))),p}diff(h,p){if(this.ops===h.ops)return new f;const y=[this,h].map((R=>R.map((U=>{if(U.insert!=null)return typeof U.insert=="string"?U.insert:c;const P=R===h?"on":"with";throw new Error("diff() called "+P+" non-document")})).join(""))),v=new f,N=t(y[0],y[1],p,!0),T=new l.default(this.ops),x=new l.default(h.ops);return N.forEach((R=>{let U=R[1].length;for(;U>0;){let P=0;switch(R[0]){case t.INSERT:P=Math.min(x.peekLength(),U),v.push(x.next(P));break;case t.DELETE:P=Math.min(U,T.peekLength()),T.next(P),v.delete(P);break;case t.EQUAL:P=Math.min(T.peekLength(),x.peekLength(),U);const Z=T.next(P),se=x.next(P);s(Z.insert,se.insert)?v.retain(P,i.default.diff(Z.attributes,se.attributes)):v.push(se).delete(P);break}U-=P}})),v.chop()}eachLine(h,p=`\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(),x=a.default.length(T)-y.peekLength(),R=typeof T.insert=="string"?T.insert.indexOf(p,x)-x:-1;if(R<0)v.push(y.next());else if(R>0)v.push(y.next(R));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 p=new f;return this.reduce(((y,v)=>{if(v.insert)p.delete(a.default.length(v));else{if(typeof v.retain=="number"&&v.attributes==null)return p.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((x=>{v.delete?p.push(x):v.retain&&v.attributes&&p.retain(a.default.length(x),i.default.invert(v.attributes,x.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(),[x,R,U]=u(v.retain,T.insert),P=f.getHandler(x);return p.retain({[x]:P.invert(R,U)},i.default.invert(v.attributes,T.attributes)),y+1}}return y}),0),p.chop()}transform(h,p=!1){if(p=!!p,typeof h=="number")return this.transformPosition(h,p);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"&&(p||N.peekType()!=="insert"))T.retain(a.default.length(v.next()));else if(N.peekType()==="insert")T.push(N.next());else{const x=Math.min(v.peekLength(),N.peekLength()),R=v.next(x),U=N.next(x);if(R.delete)continue;if(U.delete)T.push(U);else{const P=R.retain,Z=U.retain;let se=typeof Z=="object"&&Z!==null?Z:x;if(typeof P=="object"&&P!==null&&typeof Z=="object"&&Z!==null){const F=Object.keys(P)[0];if(F===Object.keys(Z)[0]){const de=f.getHandler(F);de&&(se={[F]:de.transform(P[F],Z[F],p)})}}T.retain(se,i.default.transform(R.attributes,U.attributes,p))}}return T.chop()}transformPosition(h,p=!1){p=!!p;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||!p)&&(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=bf();const K=Si(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 ys{};const Ef={"&":"&","<":"<",">":">",'"':""","'":"'"};function Ls(n){return n.replace(/[&<>"']/g,(e=>Ef[e]))}let bn=class Rn extends Ai{static allowedChildren=[Rn,Ct,lt,Ot];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(e,t){const r=Rn.order.indexOf(e),s=Rn.order.indexOf(t);return r>=0||s>=0?r-s:e===t?0:e<t?-1:1}formatAt(e,t,r,s){if(Rn.compare(this.statics.blotName,r)<0&&this.scroll.query(r,W.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 Rn&&Rn.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 We extends Ur{cache={};delta(){return this.cache.delta==null&&(this.cache.delta=Do(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,r,s){t<=0||(this.scroll.query(r,W.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}}We.blotName="block";We.tagName="P";We.defaultChild=Ct;We.allowedChildren=[Ct,bn,lt,Ot];let bt=class extends lt{attach(){super.attach(),this.attributes=new xs(this.domNode)}delta(){return(new K).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const r=this.scroll.query(e,W.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(We.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=W.BLOCK_BLOT;function Do(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!==W.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,p)=>t&&h===t.domNode?p:h===a?r+p-1:s&&h===s.domNode?r+l.length+p:null,f=u(e.start.node,e.start.offset),g=u(e.end.node,e.end.offset);if(f!==null&&g!==null)return{startNode:c.domNode,startOffset:f,endNode:c.domNode,endOffset:g}}return null}update(e,t){if(e.some((r=>r.type==="characterData"&&r.target===this.textNode))){const r=this.restore();r&&(t.range=r)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if(t.domNode.tagName==="A"){this.savedLength=wt.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}}var Hs={exports:{}},Aa;function yf(){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,g,h){if(typeof f!="function")throw new TypeError("The listener must be a function");var p=new s(f,g||c,h),y=t?t+u:u;return c._events[y]?c._events[y].fn?c._events[y]=[c._events[y],p]:c._events[y].push(p):(c._events[y]=p,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,g;if(this._eventsCount===0)return u;for(g in f=this._events)e.call(f,g)&&u.push(t?g.slice(1):g);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=t?t+u:u,g=this._events[f];if(!g)return[];if(g.fn)return[g.fn];for(var h=0,p=g.length,y=new Array(p);h<p;h++)y[h]=g[h].fn;return y},l.prototype.listenerCount=function(u){var f=t?t+u:u,g=this._events[f];return g?g.fn?1:g.length:0},l.prototype.emit=function(u,f,g,h,p,y){var v=t?t+u:u;if(!this._events[v])return!1;var N=this._events[v],T=arguments.length,x,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,g),!0;case 4:return N.fn.call(N.context,f,g,h),!0;case 5:return N.fn.call(N.context,f,g,h,p),!0;case 6:return N.fn.call(N.context,f,g,h,p,y),!0}for(R=1,x=new Array(T-1);R<T;R++)x[R-1]=arguments[R];N.fn.apply(N.context,x)}else{var U=N.length,P;for(R=0;R<U;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,g);break;case 4:N[R].fn.call(N[R].context,f,g,h);break;default:if(!x)for(P=1,x=new Array(T-1);P<T;P++)x[P-1]=arguments[P];N[R].fn.apply(N[R].context,x)}}return!0},l.prototype.on=function(u,f,g){return i(this,u,f,g,!1)},l.prototype.once=function(u,f,g){return i(this,u,f,g,!0)},l.prototype.removeListener=function(u,f,g,h){var p=t?t+u:u;if(!this._events[p])return this;if(!f)return a(this,p),this;var y=this._events[p];if(y.fn)y.fn===f&&(!h||y.once)&&(!g||y.context===g)&&a(this,p);else{for(var v=0,N=[],T=y.length;v<T;v++)(y[v].fn!==f||h&&!y[v].once||g&&y[v].context!==g)&&N.push(y[v]);N.length?this._events[p]=N.length===1?N[0]:N:a(this,p)}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}(Hs)),Hs.exports}var _f=yf();const vf=Si(_f),di=new WeakMap,hi=["error","warn","log","info"];let fi="warn";function Bo(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]=Bo.bind(console,t,n),e)),{})}Yt.level=n=>{fi=n};Bo.level=Yt.level;const zs=Yt("quill:events"),Nf=["selectionchange","mousedown","mouseup","click"];Nf.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 vf{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",zs.error)}emit(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return zs.log.call(zs,...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 js=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 Tf{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,W.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[g]=this.scroll.line(e),[h]=this.scroll.line(e+1);g===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 js.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&&Ks(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(!Ks(this.root,e.startContainer)||!e.collapsed&&!Ks(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(js.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),js.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),!Ti(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 Ks(n,e){try{e.parentNode}catch{return!1}return n.contains(e)}const Af=/^[ -~]*$/;class wf{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 xf(r.ops.slice()).reduce(((a,l)=>{const c=Et.Op.length(l);let u=l.attributes||{},f=!1,g=!1;if(l.insert!=null){if(s.retain(c),typeof l.insert=="string"){const y=l.insert;g=!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 We){const[x]=v.descendant(et,N);x&&(T=hn(T,pt(x)))}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,W.INLINE)!=null;if(v)(t<=a||this.scroll.descendant(bt,a)[0])&&(g=!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===W.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,p=g?1:0;return t+=h+p,s.retain(h),s.delete(p),a+c+h+p}),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 We?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=Sf(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!==We.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(Af)&&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()),g=r&&{oldRange:Sa(r.oldRange,-l),newRange:Sa(r.newRange,-l)};e=(new K).retain(l).concat(u.diff(f,g)).reduce(((p,y)=>y.insert?p.insert(y.insert,a):p.push(y)),new K),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!Ti(s.compose(e),this.delta))&&(e=s.diff(this.delta,r));return e}}function sr(n,e,t){if(n.length===0){const[p]=Gs(t.pop());return e<=0?`</li></${p}>`:`</li></${p}>${sr([],e-1,t)}`}const[{child:r,offset:s,length:i,indent:a,type:l},...c]=n,[u,f]=Gs(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 g=t[t.length-1];if(a===e&&l===g)return`</li><li${f}>${Fr(r,s,i)}${sr(c,a,t)}`;const[h]=Gs(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 Ls(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,g,h)=>{const p="formats"in f&&typeof f.formats=="function"?f.formats():{};u.push({child:f,offset:g,length:h,indent:p.indent||0,type:p.list})})),sr(u,-1,[])}const s=[];if(n.children.forEachAt(e,t,((u,f,g)=>{s.push(Fr(u,f,g))})),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 Sf(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 Gs(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 xf(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 xi 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 Of{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 xi)&&(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 Lf=n=>n.parentElement||n.getRootNode().host||null,Cf=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}:Cf(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:g}=s;u&&(s.scrollTop+=u),c&&(s.scrollLeft+=c);const h=s.scrollLeft-f,p=s.scrollTop-g;r={left:r.left-h,top:r.top-p,right:r.right-h,bottom:r.bottom-p}}s=i||l.position==="fixed"?null:Lf(s)}},If=100,kf=["block","break","cursor","inline","scroll","text"],Mf=(n,e,t)=>{const r=new ur;return kf.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>If){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:ff,"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=Df(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=wi.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 wf(this.scroll),this.selection=new Tf(this.scroll,this.emitter),this.composition=new Of(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 g=(new K).retain(a.offset(this)).retain({[a.statics.blotName]:l});return this.editor.update(g,[],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,W.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){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]=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 Vs(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 Df(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=Vs(e.modules);u!=null&&u.toolbar&&u.toolbar.constructor!==Object&&(u={...u,toolbar:{container:u.toolbar}});const f=hn({},Vs(i),Vs(l),u),g={...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?Mf(e.formats,g.registry,lr):g.registry,{...g,registry:h,container:t,theme:s,modules:Object.entries(f).reduce(((p,y)=>{let[v,N]=y;if(!N)return p;const T=A.import(`modules/${v}`);return T==null?(lr.error(`Cannot load ${v} module. Are you sure you registered it?`),p):{...p,[v]:hn({},T.DEFAULTS||{},N)}}),{}),bounds:Oa(g.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 Os{}function Ra(n){return n instanceof We||n instanceof bt}function Ia(n){return typeof n.updateContent=="function"}class Bf extends wi{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=We;static allowedChildren=[We,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,W.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===W.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});Zs(this,e,u);const f=i.type==="block"?1:0,g=e+u.length()+f;c&&this.insertAt(g-1,`\n`);const h=pt(this.line(e)[0]),p=Et.AttributeMap.diff(h,i.attributes)||{};Object.keys(p).forEach((y=>{this.formatAt(g-1,1,y,p[y])})),e=g}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);Zs(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();Zs(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(Ra,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,g)=>{Ra(u)?l.push(u):u instanceof Os&&(l=l.concat(r(u,f,c))),c-=g})),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&&!Ia(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&&Ia(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,W.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,W.BLOCK&W.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 Zs(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,W.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 Oi={scope:W.BLOCK,whitelist:["right","center","justify"]},$f=new Bt("align","align",Oi),$o=new Lt("align","ql-align",Oi),qo=new mn("align","text-align",Oi);class Po 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 qf=new Lt("color","ql-color",{scope:W.INLINE}),Li=new Po("color","color",{scope:W.INLINE}),Pf=new Lt("background","ql-bg",{scope:W.INLINE}),Ci=new Po("background","background-color",{scope:W.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${Ls(this.code(e,t))}\n</pre>`}}class nt extends We{static TAB=" ";static register(){A.register(Un)}}class Ri extends bn{}Ri.blotName="code";Ri.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:W.BLOCK,whitelist:["rtl"]},Uo=new Bt("direction","dir",Ii),Fo=new Lt("direction","ql-direction",Ii),Ho=new mn("direction","direction",Ii),zo={scope:W.INLINE,whitelist:["serif","monospace"]},jo=new Lt("font","ql-font",zo);class Uf extends mn{value(e){return super.value(e).replace(/["']/g,"")}}const Ko=new Uf("font","font-family",zo),Go=new Lt("size","ql-size",{scope:W.INLINE,whitelist:["small","large","huge"]}),Vo=new mn("size","font-size",{scope:W.INLINE,whitelist:["10px","18px","32px"]}),Ff=Yt("quill:keyboard"),Hf=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Cs 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=jf(e);if(s==null){Ff.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=>Cs.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),[g,h]=a.length===0?[u,f]:this.quill.getLeaf(a.index+a.length),p=u instanceof ys?u.value().slice(0,f):"",y=g instanceof ys?g.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:p,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((x=>v.format[x]==null)))return!1}else if(typeof T.format=="object"&&!Object.keys(T.format).every((x=>T.format[x]===!0?v.format[x]!=null:T.format[x]===!1?v.format[x]==null:Ti(T.format[x],v.format[x]))))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 g=(new K).retain(e.index+i.length()-2).retain(1,s);a=a.compose(g)}}}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){ki({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,W.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 zf={bindings:{bold:Ws("bold"),italic:Ws("italic"),underline:Ws("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=Kf(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)}};Cs.DEFAULTS=zf;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 Ws(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 jf(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[Hf]=n.shortKey,delete n.shortKey),n}function ki(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 Kf(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 Gf=/font-weight:\s*normal/,Vf=["P","OL","UL"],Da=n=>n&&Vf.includes(n.tagName),Zf=n=>{Array.from(n.querySelectorAll("br")).filter((e=>Da(e.previousElementSibling)&&Da(e.nextElementSibling))).forEach((e=>{e.parentNode?.removeChild(e)}))},Wf=n=>{Array.from(n.querySelectorAll('b[style*="font-weight"]')).filter((e=>e.getAttribute("style")?.match(Gf))).forEach((e=>{const t=n.createDocumentFragment();t.append(...e.childNodes),e.parentNode?.replaceChild(t,e)}))};function Yf(n){n.querySelector('[id^="docs-internal-guid-"]')&&(Wf(n),Zf(n))}const Qf=/\bmso-list:[^;]*ignore/i,Xf=/\bmso-list:[^;]*\bl(\d+)/i,Jf=/\bmso-list:[^;]*\blevel(\d+)/i,eg=(n,e)=>{const t=n.getAttribute("style"),r=t?.match(Xf);if(!r)return null;const s=Number(r[1]),i=t?.match(Jf),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}},tg=n=>{const e=Array.from(n.querySelectorAll("[style*=mso-list]")),t=[],r=[];e.forEach((a=>{(a.getAttribute("style")||"").match(Qf)?t.push(a):r.push(a)})),t.forEach((a=>a.parentNode?.removeChild(a)));const s=n.documentElement.innerHTML,i=r.map((a=>eg(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((g=>{const h=document.createElement("li");h.setAttribute("data-list",g.type),g.indent>1&&h.setAttribute("class",`ql-indent-${g.indent-1}`),h.innerHTML=g.element.innerHTML,c.appendChild(h)}));const u=a[0]?.element,{parentNode:f}=u??{};u&&f?.replaceChild(c,u),a.slice(1).forEach((g=>{let{element:h}=g;f?.removeChild(h)}))}};function ng(n){n.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&tg(n)}const rg=[ng,Yf],sg=n=>{n.documentElement&&rg.forEach((e=>{e(n)}))},ig=Yt("quill:clipboard"),ag=[[Node.TEXT_NODE,yg],[Node.TEXT_NODE,$a],["br",hg],[Node.ELEMENT_NODE,$a],[Node.ELEMENT_NODE,dg],[Node.ELEMENT_NODE,ug],[Node.ELEMENT_NODE,bg],["li",pg],["ol, ul",mg],["pre",fg],["tr",Eg],["b",Ys("bold")],["i",Ys("italic")],["strike",Ys("strike")],["style",gg]],og=[$f,Uo].reduce(((n,e)=>(n[e.keyName]=e,n)),{}),Ba=[qo,Ci,Li,Ho,Ko,Vo].reduce(((n,e)=>(n[e.keyName]=e,n)),{});class lg 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=[],ag.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){sg(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 Mi(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&&ki({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);ig.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 cg(n,e){return n.previousElementSibling&&n.nextElementSibling&&!dn(n.previousElementSibling,e)&&!dn(n.nextElementSibling,e)}const cs=new WeakMap;function Zo(n){return n==null?!1:(cs.has(n)||(n.tagName==="PRE"?cs.set(n,!0):cs.set(n,Zo(n.parentNode))),cs.get(n))}function Mi(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=Mi(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 Ys(n){return(e,t,r)=>Fn(t,n,!0,r)}function ug(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,W.ATTRIBUTE);c!=null&&(a[c.attrName]=c.value(n),a[c.attrName])||(c=og[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 dg(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 hg(n,e){return Kr(e,`\n`)||e.insert(`\n`),e}function fg(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 gg(){return new K}function pg(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 mg(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 $a(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 bg(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 Eg(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 yg(n,e,t){let r=n.data;if(n.parentElement?.tagName==="O:P")return e.insert(r.trim());if(!Zo(n)){if(r.trim().length===0&&r.includes(`\n`)&&!cg(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 _g 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){qa(this.stack.undo,e),qa(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=Ng(this.quill.scroll,e.delta);this.quill.setSelection(t,A.sources.USER)}}}function qa(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 vg(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,W.BLOCK)!=null)):!1}function Ng(n,e){const t=e.reduce(((s,i)=>s+(i.delete||0)),0);let r=e.length()-t;return vg(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 Tg=["insertText","insertReplacementText"];class Ag 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){ki({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||!Tg.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const r=wg(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 wg(n){return typeof n.data=="string"?n.data:n.dataTransfer?.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const Sg=/Mac/i.test(navigator.platform),xg=100,Og=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||Sg&&n.key==="a"&&n.ctrlKey===!0);class Lg 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&&Og(e)&&this.ensureListeningToSelectionChange()}))}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+xg,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":We,"blots/block/embed":bt,"blots/break":Ct,"blots/container":Pn,"blots/cursor":wt,"blots/embed":xi,"blots/inline":bn,"blots/scroll":Bf,"blots/text":Ot,"modules/clipboard":lg,"modules/history":_g,"modules/keyboard":Cs,"modules/uploader":Wo,"modules/input":Ag,"modules/uiNode":Lg});class Cg 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 Cg("indent","ql-indent",{scope:W.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Ig extends We{static blotName="blockquote";static tagName="blockquote"}class kg extends We{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 We{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 Di 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 Mg extends Di{static blotName="italic";static tagName=["EM","I"]}class _s 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 Yo(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 Yo(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 Dg 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 Bg extends Di{static blotName="strike";static tagName=["S","STRIKE"]}class $g extends bn{static blotName="underline";static tagName="U"}class qg extends xi{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 Pg=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 Yo(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 Ug 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 _s.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:W.INLINE});class Zt 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!==Zt.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()}}Zt.blotName="code-token";Zt.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(),Zt.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(Do(u,!1))),new K),l=e(s,i);a.diff(l).reduce(((c,u)=>{let{retain:f,attributes:g}=u;return f?(g&&Object.keys(g).forEach((h=>{[mt.blotName,Zt.blotName].includes(h)&&this.formatAt(c,f,h,g[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${Ls(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=[Zt,wt,Ot,Ct];const Fg=(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 Qo extends qt{static register(){A.register(Zt,!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 Ls(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=Fg(this.options.hljs,t,e),Mi(this.quill.scroll,r,[(s,i)=>{const a=Mr.value(s);return a?i.compose((new K).retain(i.length(),{[Zt.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)}}Qo.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 We{static blotName="table";static tagName="TD";static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",Bi()),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 vs 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=Bi(),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))}}vs.allowedChildren=[fn];fn.requiredContainer=vs;fn.allowedChildren=[Dn];Dn.requiredContainer=fn;Dn.allowedChildren=[St];St.requiredContainer=Dn;function Bi(){return`row-${Math.random().toString(36).slice(2,6)}`}class Hg extends qt{static register(){A.register(St),A.register(Dn),A.register(fn),A.register(vs)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(vs).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:Bi()})}),(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 $i extends qt{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const r=document.createElement("div");r.setAttribute("role","toolbar"),zg(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())}}))}}$i.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 zg(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)?jg(r,i,a):Ha(r,i,a)}})),n.appendChild(r)}))}function jg(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)}$i.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,W.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 Kg='<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>',Gg='<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>',Vg='<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>',Wg='<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>',Yg='<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>',Qg='<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>',Xg='<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>',Jg='<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>',ep='<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>',tp='<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>',np='<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>',rp='<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>',sp='<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>',ip='<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>',ap='<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>',op='<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>',lp='<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>',cp='<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>',up='<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>',dp='<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>',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-stroke" points="5 7 5 11 3 9 5 7"/></svg>',fp='<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>',gp='<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>',pp='<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>',mp='<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>',bp='<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>',Ep='<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>',yp='<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>',_p='<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>',vp='<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>',Np='<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:{"":Kg,center:Gg,right:Vg,justify:Zg},background:Wg,blockquote:Yg,bold:Qg,clean:Xg,code:za,"code-block":za,color:Jg,direction:{"":ep,rtl:tp},formula:np,header:{1:rp,2:sp,3:ip,4:ap,5:op,6:lp},italic:cp,image:up,indent:{"+1":dp,"-1":hp},link:fp,list:{bullet:gp,check:pp,ordered:mp},script:{sub:bp,super:Ep},strike:yp,table:_p,underline:vp,video:Np},Tp='<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 Rs{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=Tp,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 Xo extends Rs{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 Jo extends Rs{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 Ap=n=>{const{overflowY:e}=getComputedStyle(n,null);return e!=="visible"&&e!=="clip"};let el=class{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,Ap(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 wp=[!1,"center","right","justify"],Sp=["#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"],xp=[!1,"serif","monospace"],Op=["1","2","3",!1],Lp=["small",!1,"large","huge"];class Zr 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&&Rr(s,wp),typeof t.align=="object"))return new Jo(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&&Rr(s,Sp,i==="background"?"#ffffff":"#000000"),new Xo(s,t[i])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?Rr(s,xp):s.classList.contains("ql-header")?Rr(s,Op):s.classList.contains("ql-size")&&Rr(s,Lp)),new Rs(s)}));const r=()=>{this.pickers.forEach((s=>{s.update()}))};this.quill.on(G.events.EDITOR_CHANGE,r)}}Zr.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 tl extends el{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=Cp(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 Cp(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 Rr(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 Ip extends tl{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),g=this.quill.getBounds(new Mn(u,f));g!=null&&this.position(g)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()}))}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",(()=>{this.root.classList.remove("ql-editing")})),this.quill.on(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 nl extends Zr{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 Ip(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))}}nl.DEFAULTS=hn({},Zr.DEFAULTS,{modules:{toolbar:{handlers:{link(n){n?this.quill.theme.tooltip.edit():this.quill.format("link",!1,A.sources.USER)}}}}});const kp=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Mp extends tl{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(_s,e.index);if(s!=null){this.linkRange=new Mn(e.index-i,s.length());const a=_s.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 rl extends Zr{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-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 Mp(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)})))}}rl.DEFAULTS=hn({},Zr.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":Uo,"attributors/class/align":$o,"attributors/class/background":Pf,"attributors/class/color":qf,"attributors/class/direction":Fo,"attributors/class/font":jo,"attributors/class/size":Go,"attributors/style/align":qo,"attributors/style/background":Ci,"attributors/style/color":Li,"attributors/style/direction":Ho,"attributors/style/font":Ko,"attributors/style/size":Vo},!0);A.register({"formats/align":$o,"formats/direction":Fo,"formats/indent":Rg,"formats/background":Ci,"formats/color":Li,"formats/font":jo,"formats/size":Go,"formats/blockquote":Ig,"formats/code-block":nt,"formats/header":kg,"formats/list":Vr,"formats/bold":Di,"formats/code":Ri,"formats/italic":Mg,"formats/link":_s,"formats/script":Dg,"formats/strike":Bg,"formats/underline":$g,"formats/formula":qg,"formats/image":Pg,"formats/video":Ug,"modules/syntax":Qo,"modules/table":Hg,"modules/toolbar":$i,"themes/bubble":nl,"themes/snow":rl,"ui/icons":Hr,"ui/picker":Rs,"ui/icon-picker":Jo,"ui/color-picker":Xo,"ui/tooltip":el},!0);function pi(n){const e=Is(n)??0,[t]=n.getLeaf(e);if(!t)throw new Error("editor.getLeaf() returns undefined");return t.domNode}function Is(n){const e=n.getSelection();if(e!==null)return e.index+e.length}const sl=n=>n!=null&&(n=Object.getPrototypeOf(n),n===Array.prototype||n===Object.prototype);function il(n,e,t){for(const[r,s]of Object.entries(e)){const i=`${t}.${r}`;n[i]=s,sl(s)&&il(n,s,i)}}function Dp(n){const e={...n};for(const[t,r]of Object.entries(n))sl(r)&&il(e,r,t);return e}const Bp=(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 qp(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 Pp={insertHtmlSnippetMessage:"Insert a HTML Snippet",obfuscate:"Obfuscate"},Up="image",Fp="Validate",Hp="Cancel",zp="Done",jp="Remove",Kp="auto",Gp="Image not inserted, place cursor in editor first",Vp="HTML Snippet",Zp="Confirm Deletion",Wp={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",mediaProperties:"Media properties",caption:"Caption",pixelRatio:"Pixel ratio"},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:Pp,image:Up,validate:Fp,delete:"Delete",cancel:Hp,done:zp,remove:jp,auto:Kp,editorFocusLost:Gp,htmlSnippetLabel:Vp,confirmDeletion:Zp,comfirmSnippetDeletionDialog:Wp,makeMediaPropertiesDialog: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="Retirer",om="auto",lm="L'image n'a pas été insérée, mettre d'abord le curseur dans l'éditeur",cm="Code HTML",um="Confirmer la suppression",dm={content:"Voulez-vous vraiment supprimer ce code HTML ?"},hm={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",mediaProperties:"Propriétés du média",caption:"Légende",pixelRatio:"Pixel ratio"},fm={obfuscator:"Obfusqueur",content:"Contenu:",asALink:"En tant que lien",doNotObfuscate:"Ne pas obfusquer"},gm={insertVideo:"Insérer une vidéo",dialog:{title:"Définir une vidéo"}},pm={insertLink:"Insérer un lien interne"},mm={CustomToolbar:tm,image:nm,validate:rm,delete:"Supprimer",cancel:sm,done:im,remove:am,auto:om,editorFocusLost:lm,htmlSnippetLabel:cm,confirmDeletion:um,comfirmSnippetDeletionDialog:dm,makeMediaPropertiesDialog:hm,openObfuscatorDialog:fm,videoPlugin:gm,internalLinkPlugin:pm},Ga={en:em,fr:mm};function En(n){const e=Xs((()=>{const r=n()in Ga?n():"en";return Dp(Ga[r])}));return{t:qp(e,Bp)}}function bm(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(Is(n)??0,r,"link",t)}function al({editor:n,values:e,service:t,index:r,language:s}){const{t:i}=En(s),a=r??Is(n);if(a===void 0){t.showToast(i("editorFocusLost"),{severity:"warn"});return}n.insertEmbed(a,"media",e)}function ol({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 ll({values:n,editor:e,index:t}){e.insertText(t,n,"internal-link-plugin",n)}function cl({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 Em(n){const{mediaId: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 ym(n){const e=ul(n),t=n.dataset.resize;return{resizeRule:t&&eo(t)?t:void 0,align:e}}function ul(n){const e=n.classList;if(e.contains("center"))return"center";if(e.contains("left"))return"left";if(e.contains("right"))return"right"}function _m(n){if(n==="center")return"center";if(n==="left")return"left";if(n==="right")return"right"}var vm=me('<textarea autofocus class="QpInput QpHtmlSnippetInput"rows=8 cols=80>'),dl=me('<button class="QpBtn secondary"type=button>'),Nm=me("<button class=QpBtn type=button>"),Tm=me('<button class="QpBtn danger outlined"type=button>'),Am=me("<p>"),wm=me('<button class="QpBtn danger"type=button>');async function hl({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=vm();return u.addEventListener("change",(f=>a(f.target.value))),cn((()=>u.value=i())),u})(),footer:[t==="update"&&(()=>{var u=Tm();return u.$$click=()=>{Sm({deleteSnippet:l,closeDialog:()=>{c.close()},language:e,service:n})},ue(u,(()=>s("delete"))),u})(),(()=>{var u=dl();return u.$$click=()=>c.close(),ue(u,(()=>s("cancel"))),u})(),(()=>{var u=Nm();return u.$$click=()=>c.close({action:t,values:{html:i()}}),ue(u,(()=>s("validate"))),u})()],header:s("htmlSnippetLabel")});return await c.open()}function Sm({closeDialog:n,deleteSnippet:e,language:t,service:r}){const{t:s}=En(t),i=r.createModalDialog({header:s("confirmDeletion"),content:(()=>{var a=Am();return ue(a,(()=>s("comfirmSnippetDeletionDialog.content"))),a})(),footer:[(()=>{var a=dl();return a.$$click=()=>{i.hide()},ue(a,(()=>s("cancel"))),a})(),(()=>{var a=wm();return a.$$click=()=>{i.hide(),e()},ue(a,(()=>s("validate"))),a})()]});i.show()}Ts(["click"]);async function fl({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}}var xm=me("<span>");function mi({center:n}){const e=n?"QpSpinner center":"QpSpinner";return(()=>{var t=xm();return ps(t,e),t})()}var Om=me('<button class="QpBtn outlined danger"type=button>'),Lm=me("<button class=QpBtn type=button>"),us=me("<h2 class=FieldLabel>"),Va=me("<div class=QpOption>"),Cm=me("<input class=QpOption-input type=text>"),Rm=me("<label><input type=checkbox name=enableZoom>"),Im=me("<div><div class=QpOption><label class><input type=checkbox name=enableLinkOnImage></label></div><div class=QpOption>"),km=me("<div class=QpBox><dl class=QpProp><dt>:</dt><dd></dd></dl><dl class=QpProp><dt>:</dt><dd>"),Mm=me("<button type=button> <small class=ml-1>(<!>)"),Dm=me("<button type=button>");async function Bm({service:n,language:e,fetchedOutput:t,initialValues:r}){const{mediaId:s}=r,{themeConf:i}=n,{t:a}=En(e),[l,c]=gt(r.resizeRule),[u,f]=gt(r.align),[g,h]=gt(r.zoomable),[p,y]=gt(!!r.href),[v,N]=gt(r.href??""),[T,x]=gt();Ui((()=>{n.useBackOfficeImage(s,{resizeRule:l()}).then((F=>{t.source=F?.source,x(F)})).catch((F=>{n.logger.error("Error fetching media:",F)}))}));const R=Xs((()=>i.fTextImageResizeRules.map(((F,de)=>({resizeRule:F,label:a("makeMediaPropertiesDialog.variantLabel",{n:de+1})})))),[i,e()]),U=Xs((()=>[{align:"left",label:a("makeMediaPropertiesDialog.left")},{align:"center",label:a("makeMediaPropertiesDialog.center")},{align:"right",label:a("makeMediaPropertiesDialog.right")}]),[e()]),P=async()=>{se.close({action:"update",values:{mediaId:s,align:u(),resizeRule:l(),zoomable:g(),href:p()&&v().trim()||void 0}})};Ui((()=>{p()&&h(!1)}));const Z=[(()=>{var F=Om();return F.$$click=()=>{se.close({action:"remove"})},ue(F,(()=>a("remove"))),F})(),(()=>{var F=Lm();return F.$$click=P,F.disabled=!s||u===void 0||l===void 0,ue(F,(()=>a("validate"))),F})()],se=n.createModalDialog({header:a("makeMediaPropertiesDialog.imageProperties"),content:[(()=>{var F=us();return ue(F,(()=>a("makeMediaPropertiesDialog.sizes"))),F})(),(()=>{var F=Va();return ue(F,Mt(Fi,{get each(){return R()},children:de=>(()=>{var ie=Mm(),m=ie.firstChild,C=m.nextSibling,_=C.firstChild,L=_.nextSibling;return L.nextSibling,ie.$$click=()=>c(de.resizeRule),ie.disabled=!s,ue(ie,(()=>de.label),m),ue(C,(()=>de.resizeRule.replace("x","×")),L),cn((()=>ps(ie,`QpBtn secondary ${de.resizeRule!==l()?"outlined":""}`))),ie})()})),F})(),(()=>{var F=us();return ue(F,(()=>a("makeMediaPropertiesDialog.alignment"))),F})(),(()=>{var F=Va();return ue(F,Mt(Fi,{get each(){return U()},children:de=>(()=>{var ie=Dm();return ie.$$click=()=>f(de.align),ie.disabled=!s,ue(ie,(()=>de.label)),cn((()=>ps(ie,`QpBtn secondary ${de.align!==u()?"outlined":""}`))),ie})()})),F})(),(()=>{var F=us();return ue(F,(()=>a("makeMediaPropertiesDialog.options"))),F})(),(()=>{var F=Im(),de=F.firstChild,ie=de.firstChild,m=ie.firstChild,C=de.nextSibling;return m.addEventListener("change",(()=>{y(!p())})),ue(ie,(()=>a("makeMediaPropertiesDialog.link")),null),ue(ie,Mt(Hi,{get when(){return p()},get children(){var _=Cm();return _.addEventListener("change",(L=>{N(L.currentTarget.value)})),cn((()=>_.value=v())),_}}),null),ue(C,Mt(Hi,{get when(){return!p()},get children(){var _=Rm(),L=_.firstChild;return L.addEventListener("change",(()=>{h(!g())})),ue(_,(()=>a("makeMediaPropertiesDialog.enableZoom")),null),cn((()=>L.checked=g())),_}})),cn((()=>m.checked=p())),F})(),(()=>{var F=us();return ue(F,(()=>a("makeMediaPropertiesDialog.mediaProperties"))),F})(),(()=>{var F=km(),de=F.firstChild,ie=de.firstChild,m=ie.firstChild,C=ie.nextSibling,_=de.nextSibling,L=_.firstChild,k=L.firstChild,O=L.nextSibling;return ue(ie,(()=>a("makeMediaPropertiesDialog.caption")),m),ue(C,(()=>{var D=Bs((()=>!!T()));return()=>D()?T()?.source.attachedData?.[e()]?.caption??"-":Mt(mi,{})})()),ue(L,(()=>a("makeMediaPropertiesDialog.pixelRatio")),k),ue(O,(()=>{var D=Bs((()=>!!T()));return()=>D()?Bs((()=>!!T()?.source.pixelRatio))()?`${T()?.source.pixelRatio}×`:a("auto"):Mt(mi,{})})()),F})()],footer:Z});return await se.open()}Ts(["click"]);function gl(n){return $m(n)||qi(n)}function qi(n){return!!n.match(/^[a-zA-Z0-9. _-]+@[a-zA-Z0-9. -]+\.[a-zA-Z]{2,4}$/g)}function $m(n){return!!n.match(/^(\+|00)[1-9][0-9 \-\(\)\.]{7,32}$/)}function qm(n){return gl(n)?qi(n)?"mailto":"tel":"raw"}function pl(n){if(n==="raw")return"raw";if(n==="mailto")return"mailto";if(n==="tel")return"tel";throw new Error(`invalid link-type '${n}'`)}var Pm=me("<label class=ObfuscatorDialog-label><input type=text class=ml-2>"),Um=me('<label class="ObfuscatorDialog-label mt-4"><input type=checkbox name=asALink class=mr-2>'),Fm=me('<button class="QpBtn danger outlined"type=button>'),Hm=me("<button class=QpBtn type=button>");async function zm({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),gl(f)?i(!0):i(!1)},u=n.createModalDialog({header:r("openObfuscatorDialog.obfuscator"),content:[(()=>{var f=Pm(),g=f.firstChild;return ue(f,(()=>r("openObfuscatorDialog.content")),g),g.$$input=h=>c(h.currentTarget.value),cn((()=>g.value=a())),f})(),(()=>{var f=Um(),g=f.firstChild;return g.addEventListener("change",(()=>i(!s()))),ue(f,(()=>r("openObfuscatorDialog.asALink")),null),cn((()=>g.checked=s())),f})()],footer:[(()=>{var f=Fm();return f.$$click=()=>u.close({action:"remove"}),ue(f,(()=>r("openObfuscatorDialog.doNotObfuscate"))),f})(),(()=>{var f=Hm();return f.$$click=()=>u.close({action:"update",content:a(),asALink:s()?qi(a())?"mailto":"tel":"raw"}),ue(f,(()=>r("done"))),f})()]});return await u.open()}Ts(["input","click"]);var jm=me('<button class="QpBtn outlined danger"type=button>'),Km=me('<button class="QpBtn secondary"type=button>'),Gm=me("<button class=QpBtn type=button>");async function ml({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(g){l(g)},getLanguage:e}),f=n.createModalDialog({content:u,footer:[(()=>{var g=jm();return g.$$click=()=>{f.close({action:"remove"}),c()},ue(g,(()=>i("remove"))),g})(),(()=>{var g=Km();return g.$$click=()=>{f.close(),c()},ue(g,(()=>i("cancel"))),g})(),(()=>{var g=Gm();return g.$$click=()=>{f.close({action:t,value:a()??""}),c()},ue(g,(()=>i("validate"))),g})()],header:i("videoPlugin.dialog.title")});return await f.open()}Ts(["click"]);async function Vm({editor:n,htmlSnippetBtn:e,service:t,language:r}){const s=e.dataset.html,i=await hl({service:t,html:s,mode:"update",language:r});i&&Wr({editor:n,element:e,data:i,insertElementHandler:ol,service:t,language:r})}async function Zm({editor:n,internalLinkElement:e,language:t,service:r,internalLinkPluginHook:s}){const i=e.dataset.documentId,a=await fl({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()),ll({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 ml({service:r,language:t,mode:"update",value:i,videoPluginHook:s});a&&Wr({editor:n,element:e,data:{action:a.action,values:a.value},insertElementHandler:cl,service:r,language:t})}async function bl({obfuscatorSpan:n,service:e,language:t,editor:r}){const s=n.innerText,i=n.dataset.asALink?pl(n.dataset.asALink):void 0,a=await zm({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 Ym({service:n,language:e,element:t,editor:r}){const s=Em(t),{align:i,resizeRule:a}=ym(t);if(!s||!a)return;const l={source:void 0},c={mediaId:s,resizeRule:a,align:i,zoomable:t.dataset.zoomable==="1",href:t.dataset.href};let u=await Bm({service:n,language:e,initialValues:c,fetchedOutput:l});if(!u){if(!l.source||!t.dataset.source)return;const f=JSON.parse(t.dataset.source);if(f.pixelRatio===l.source.pixelRatio&&f.attachedData?.[e()]?.caption===l.source.attachedData?.[e()]?.caption)return;u={action:"update",values:c}}Wr({service:n,language:e,editor:r,element:t,data:u,insertElementHandler:al})}function Qm({quillEditor:n,service:e,language:t,videoPluginHook:r,internalLinkPluginHook:s}){const{themeConf:i}=e;return{insertHtmlSnippetHandler:async()=>{if(!n)return;const g=pi(n);await Jm({service:e,editorContent:g,quillEditor:n,language:t})},insertMedia:async g=>{if(!n)return;if(g.kind==="file"){bm(n,{label:g.originalName,url:g.url});return}const h=i.fTextImageResizeRules[0];al({service:e,editor:n,values:{mediaId:g.mediaId,resizeRule:h,align:"center",zoomable:!0},language:t})},insertObfuscateBlotHandler:()=>{if(!n)return;const g=n.getSelection();!g||g.length===0||Xm({service:e,userSelection:g,quillEditor:n,language:t})},insertVideoHandler:async()=>{if(!n)return;const g=pi(n);await El({editorContent:g,quillEditor:n,service:e,language:t,videoPluginHook:r})},insertInternalLinkHandler:async()=>{if(!n)return;const g=Is(n);g!==void 0&&await eb({quillEditor:n,service:e,language:t,internalLinkPluginHook:s,index:g})}}}async function Xm({service:n,userSelection:e,quillEditor:t,language:r}){const s=t.getText(e.index,e.length),i=qm(s);t.formatText(e,"obfuscate",i);const a=t.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 bl({obfuscatorSpan:l,service:n,language:r,editor:t});break}}async function Jm({service:n,editorContent:e,quillEditor:t,language:r}){const s=await hl({service:n,language:r,mode:"insert"});s&&Wr({editor:t,element:e,data:s,insertElementHandler:ol,service:n,language:r})}async function El({service:n,editorContent:e,quillEditor:t,language:r,videoPluginHook:s,value:i}){const a=await ml({service:n,language:r,mode:i?"update":"insert",value:i,videoPluginHook:s});!a||a.action==="remove"||Wr({editor:t,element:e,data:{action:a.action,values:a.value,updateOptions:{textToReplaceLength:i?.length}},insertElementHandler:cl,service:n,language:r})}async function eb({service:n,quillEditor:e,language:t,internalLinkPluginHook:r,value:s,index:i}){const a=await fl({language:t,value:s,internalLinkPluginHook:r});!a||a.action==="remove"||!a.value||ll({editor:e,values:a.value,index:i})}function Wr({service:n,editor:e,element:t,data:{values:r,action:s,updateOptions:i},insertElementHandler:a,language:l}){const c=A.find(t);if(!c||c instanceof A)throw new Error("missing embed blot");const u=e.getIndex(c),f=new K;if(!(u===void 0||u===-1)){if(s==="insert"){if(!r)return;a({editor:e,values:r,service:n,index:u,language:l})}else if(s==="update"){if(!r)return;a({editor:e,values:r,service:n,index:u,language:l}),f.retain(u+1),f.delete(i?.textToReplaceLength??1)}else s==="remove"&&(f.retain(u),f.delete(1));e.updateContents(f)}}var Qs,Za;function tb(){if(Za)return Qs;Za=1;function n(b){return b instanceof Map?b.clear=b.delete=b.set=function(){throw new Error("map is read-only")}:b instanceof Set&&(b.add=b.clear=b.delete=function(){throw new Error("set is read-only")}),Object.freeze(b),Object.getOwnPropertyNames(b).forEach((S=>{const q=b[S],ne=typeof q;(ne==="object"||ne==="function")&&!Object.isFrozen(q)&&n(q)})),b}class e{constructor(S){S.data===void 0&&(S.data={}),this.data=S.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function t(b){return b.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(b,...S){const q=Object.create(null);for(const ne in b)q[ne]=b[ne];return S.forEach((function(ne){for(const Te in ne)q[Te]=ne[Te]})),q}const s="</span>",i=b=>!!b.scope,a=(b,{prefix:S})=>{if(b.startsWith("language:"))return b.replace("language:","language-");if(b.includes(".")){const q=b.split(".");return[`${S}${q.shift()}`,...q.map(((ne,Te)=>`${ne}${"_".repeat(Te+1)}`))].join(" ")}return`${S}${b}`};class l{constructor(S,q){this.buffer="",this.classPrefix=q.classPrefix,S.walk(this)}addText(S){this.buffer+=t(S)}openNode(S){if(!i(S))return;const q=a(S.scope,{prefix:this.classPrefix});this.span(q)}closeNode(S){i(S)&&(this.buffer+=s)}value(){return this.buffer}span(S){this.buffer+=`<span class="${S}">`}}const c=(b={})=>{const S={children:[]};return Object.assign(S,b),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 q=c({scope:S});this.add(q),this.stack.push(q)}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,q){return typeof q=="string"?S.addText(q):q.children&&(S.openNode(q),q.children.forEach((ne=>this._walk(S,ne))),S.closeNode(q)),S}static _collapse(S){typeof S!="string"&&S.children&&(S.children.every((q=>typeof q=="string"))?S.children=[S.children.join("")]:S.children.forEach((q=>{u._collapse(q)})))}}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,q){const ne=S.root;q&&(ne.scope=`language:${q}`),this.add(ne)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function g(b){return b?typeof b=="string"?b:b.source:null}function h(b){return v("(?=",b,")")}function p(b){return v("(?:",b,")*")}function y(b){return v("(?:",b,")?")}function v(...b){return b.map((q=>g(q))).join("")}function N(b){const S=b[b.length-1];return typeof S=="object"&&S.constructor===Object?(b.splice(b.length-1,1),S):{}}function T(...b){return"("+(N(b).capture?"":"?:")+b.map((ne=>g(ne))).join("|")+")"}function x(b){return new RegExp(b.toString()+"|").exec("").length-1}function R(b,S){const q=b&&b.exec(S);return q&&q.index===0}const U=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function P(b,{joinWith:S}){let q=0;return b.map((ne=>{q+=1;const Te=q;let Ce=g(ne),z="";for(;Ce.length>0;){const j=U.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]==="("&&q++)}return z})).map((ne=>`(${ne})`)).join(S)}const Z=/\b\B/,se="[a-zA-Z]\\w*",F="[a-zA-Z_]\\w*",de="\\b\\d+(\\.\\d+)?",ie="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",m="\\b(0b[01]+)",C="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",_=(b={})=>{const S=/^#![ ]*\//;return b.binary&&(b.begin=v(S,/.*\b/,b.binary,/\b.*/)),r({scope:"meta",begin:S,end:/$/,relevance:0,"on:begin":(q,ne)=>{q.index!==0&&ne.ignoreMatch()}},b)},L={begin:"\\\\[\\s\\S]",relevance:0},k={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[L]},O={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[L]},D={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(b,S,q={}){const ne=r({scope:"comment",begin:b,end:S,contains:[]},q);ne.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 ne.contains.push({begin:v(/[ ]+/,"(",Te,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),ne},H=M("//","$"),$=M("/\\*","\\*/"),ee=M("#","$"),J={scope:"number",begin:de,relevance:0},ae={scope:"number",begin:ie,relevance:0},fe={scope:"number",begin:m,relevance:0},X={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[L,{begin:/\[/,end:/\]/,relevance:0,contains:[L]}]},Oe={scope:"title",begin:se,relevance:0},Le={scope:"title",begin:F,relevance:0},ce={begin:"\\.\\s*"+F,relevance:0};var ge=Object.freeze({__proto__:null,APOS_STRING_MODE:k,BACKSLASH_ESCAPE:L,BINARY_NUMBER_MODE:fe,BINARY_NUMBER_RE:m,COMMENT:M,C_BLOCK_COMMENT_MODE:$,C_LINE_COMMENT_MODE:H,C_NUMBER_MODE:ae,C_NUMBER_RE:ie,END_SAME_AS_BEGIN:function(b){return Object.assign(b,{"on:begin":(S,q)=>{q.data._beginMatch=S[1]},"on:end":(S,q)=>{q.data._beginMatch!==S[1]&&q.ignoreMatch()}})},HASH_COMMENT_MODE:ee,IDENT_RE:se,MATCH_NOTHING_RE:Z,METHOD_GUARD:ce,NUMBER_MODE:J,NUMBER_RE:de,PHRASAL_WORDS_MODE:D,QUOTE_STRING_MODE:O,REGEXP_MODE:X,RE_STARTERS_RE:C,SHEBANG:_,TITLE_MODE:Oe,UNDERSCORE_IDENT_RE:F,UNDERSCORE_TITLE_MODE:Le});function Ee(b,S){b.input[b.index-1]==="."&&S.ignoreMatch()}function ve(b,S){b.className!==void 0&&(b.scope=b.className,delete b.className)}function Ne(b,S){S&&b.beginKeywords&&(b.begin="\\b("+b.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",b.__beforeBegin=Ee,b.keywords=b.keywords||b.beginKeywords,delete b.beginKeywords,b.relevance===void 0&&(b.relevance=0))}function De(b,S){Array.isArray(b.illegal)&&(b.illegal=T(...b.illegal))}function ze(b,S){if(b.match){if(b.begin||b.end)throw new Error("begin & end are not supported with match");b.begin=b.match,delete b.match}}function yn(b,S){b.relevance===void 0&&(b.relevance=1)}const Hn=(b,S)=>{if(!b.beforeMatch)return;if(b.starts)throw new Error("beforeMatch cannot be used with starts");const q=Object.assign({},b);Object.keys(b).forEach((ne=>{delete b[ne]})),b.keywords=q.keywords,b.begin=v(q.beforeMatch,h(q.begin)),b.starts={relevance:0,contains:[Object.assign(q,{endsParent:!0})]},b.relevance=0,delete q.beforeMatch},fr=["of","and","for","in","not","or","if","then","parent","list","value"],gr="keyword";function Pt(b,S,q=gr){const ne=Object.create(null);return typeof b=="string"?Te(q,b.split(" ")):Array.isArray(b)?Te(q,b):Object.keys(b).forEach((function(Ce){Object.assign(ne,Pt(b[Ce],S,Ce))})),ne;function Te(Ce,z){S&&(z=z.map((j=>j.toLowerCase()))),z.forEach((function(j){const re=j.split("|");ne[re[0]]=[Ce,_n(re[0],re[1])]}))}}function _n(b,S){return S?Number(S):zn(b)?0:1}function zn(b){return fr.includes(b.toLowerCase())}const vn={},je=b=>{console.error(b)},Ut=(b,...S)=>{console.log(`WARN: ${b}`,...S)},Rt=(b,S)=>{vn[`${b}/${S}`]||(console.log(`Deprecated as of ${b}. ${S}`),vn[`${b}/${S}`]=!0)},ct=new Error;function Ft(b,S,{key:q}){let ne=0;const Te=b[q],Ce={},z={};for(let j=1;j<=S.length;j++)z[j+ne]=Te[j],Ce[j+ne]=!0,ne+=x(S[j-1]);b[q]=z,b[q]._emit=Ce,b[q]._multi=!0}function Nn(b){if(Array.isArray(b.begin)){if(b.skip||b.excludeBegin||b.returnBegin)throw je("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ct;if(typeof b.beginScope!="object"||b.beginScope===null)throw je("beginScope must be object"),ct;Ft(b,b.begin,{key:"beginScope"}),b.begin=P(b.begin,{joinWith:""})}}function rt(b){if(Array.isArray(b.end)){if(b.skip||b.excludeEnd||b.returnEnd)throw je("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ct;if(typeof b.endScope!="object"||b.endScope===null)throw je("endScope must be object"),ct;Ft(b,b.end,{key:"endScope"}),b.end=P(b.end,{joinWith:""})}}function jn(b){b.scope&&typeof b.scope=="object"&&b.scope!==null&&(b.beginScope=b.scope,delete b.scope)}function Kn(b){jn(b),typeof b.beginScope=="string"&&(b.beginScope={_wrap:b.beginScope}),typeof b.endScope=="string"&&(b.endScope={_wrap:b.endScope}),Nn(b),rt(b)}function pr(b){function S(z,j){return new RegExp(g(z),"m"+(b.case_insensitive?"i":"")+(b.unicodeRegex?"u":"")+(j?"g":""))}class q{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(j,re){re.position=this.position++,this.matchIndexes[this.matchAt]=re,this.regexes.push([re,j]),this.matchAt+=x(j)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const j=this.regexes.map((re=>re[1]));this.matcherRe=S(P(j,{joinWith:"|"}),!0),this.lastIndex=0}exec(j){this.matcherRe.lastIndex=this.lastIndex;const re=this.matcherRe.exec(j);if(!re)return null;const Be=re.findIndex(((_t,qe)=>qe>0&&_t!==void 0)),Ie=this.matchIndexes[Be];return re.splice(0,Be),Object.assign(re,Ie)}}class ne{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 re=new q;return this.rules.slice(j).forEach((([Be,Ie])=>re.addRule(Be,Ie))),re.compile(),this.multiRegexes[j]=re,re}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(j,re){this.rules.push([j,re]),re.type==="begin"&&this.count++}exec(j){const re=this.getMatcher(this.regexIndex);re.lastIndex=this.lastIndex;let Be=re.exec(j);if(this.resumingScanAtSamePosition()&&!(Be&&Be.index===this.lastIndex)){const Ie=this.getMatcher(0);Ie.lastIndex=this.lastIndex+1,Be=Ie.exec(j)}return Be&&(this.regexIndex+=Be.position+1,this.regexIndex===this.count&&this.considerAll()),Be}}function Te(z){const j=new ne;return z.contains.forEach((re=>j.addRule(re.begin,{rule:re,type:"begin"}))),z.terminatorEnd&&j.addRule(z.terminatorEnd,{type:"end"}),z.illegal&&j.addRule(z.illegal,{type:"illegal"}),j}function Ce(z,j){const re=z;if(z.isCompiled)return re;[ve,ze,Kn,Hn].forEach((Ie=>Ie(z,j))),b.compilerExtensions.forEach((Ie=>Ie(z,j))),z.__beforeBegin=null,[Ne,De,yn].forEach((Ie=>Ie(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,b.case_insensitive)),re.keywordPatternRe=S(Be,!0),j&&(z.begin||(z.begin=/\B|\b/),re.beginRe=S(re.begin),!z.end&&!z.endsWithParent&&(z.end=/\B|\b/),z.end&&(re.endRe=S(re.end)),re.terminatorEnd=g(re.end)||"",z.endsWithParent&&j.terminatorEnd&&(re.terminatorEnd+=(z.end?"|":"")+j.terminatorEnd)),z.illegal&&(re.illegalRe=S(z.illegal)),z.contains||(z.contains=[]),z.contains=[].concat(...z.contains.map((function(Ie){return Xt(Ie==="self"?z:Ie)}))),z.contains.forEach((function(Ie){Ce(Ie,re)})),z.starts&&Ce(z.starts,j),re.matcher=Te(re),re}if(b.compilerExtensions||(b.compilerExtensions=[]),b.contains&&b.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return b.classNameAliases=r(b.classNameAliases||{}),Ce(b)}function Qt(b){return b?b.endsWithParent||Qt(b.starts):!1}function Xt(b){return b.variants&&!b.cachedVariants&&(b.cachedVariants=b.variants.map((function(S){return r(b,{variants:null},S)}))),b.cachedVariants?b.cachedVariants:Qt(b)?r(b,{starts:b.starts?r(b.starts):null}):Object.isFrozen(b)?r(b):b}var Gn="11.10.0";class Jt extends Error{constructor(S,q){super(S),this.name="HTMLInjectionError",this.html=q}}const yt=t,st=r,Ht=Symbol("nomatch"),Tn=7,It=function(b){const S=Object.create(null),q=Object.create(null),ne=[];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 re(I){return j.noHighlightRe.test(I)}function Be(I){let Y=I.className+" ";Y+=I.parentNode?I.parentNode.className:"";const he=j.languageDetectRe.exec(Y);if(he){const Ae=dt(he[1]);return Ae||(Ut(Ce.replace("{}",he[1])),Ut("Falling back to no-highlight mode for this block.",I)),Ae?he[1]:"no-highlight"}return Y.split(/\s+/).find((Ae=>re(Ae)||dt(Ae)))}function Ie(I,Y,he){let Ae="",Me="";typeof Y=="object"?(Ae=I,he=Y.ignoreIllegals,Me=Y.language):(Rt("10.7.0","highlight(lang, code, ...args) has been deprecated."),Rt("10.7.0",`Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277`),Me=I,Ae=Y),he===void 0&&(he=!0);const tt={code:Ae,language:Me};zt("before:highlight",tt);const ht=tt.result?tt.result:_t(tt.language,tt.code,he);return ht.code=tt.code,zt("after:highlight",ht),ht}function _t(I,Y,he,Ae){const Me=Object.create(null);function tt(B,V){return B.keywords[V]}function ht(){if(!te.keywords){xe.addText(Se);return}let B=0;te.keywordPatternRe.lastIndex=0;let V=te.keywordPatternRe.exec(Se),oe="";for(;V;){oe+=Se.substring(B,V.index);const pe=Ve.case_insensitive?V[0].toLowerCase():V[0],$e=tt(te,pe);if($e){const[Qe,xr]=$e;if(xe.addText(oe),oe="",Me[pe]=(Me[pe]||0)+1,Me[pe]<=Tn&&(sn+=xr),Qe.startsWith("_"))oe+=V[0];else{const Jn=Ve.classNameAliases[Qe]||Qe;Ge(V[0],Jn)}}else oe+=V[0];B=te.keywordPatternRe.lastIndex,V=te.keywordPatternRe.exec(Se)}oe+=Se.substring(B),xe.addText(oe)}function vt(){if(Se==="")return;let B=null;if(typeof te.subLanguage=="string"){if(!S[te.subLanguage]){xe.addText(Se);return}B=_t(te.subLanguage,Se,!0,Xn[te.subLanguage]),Xn[te.subLanguage]=B._top}else B=An(Se,te.subLanguage.length?te.subLanguage:null);te.relevance>0&&(sn+=B.relevance),xe.__addSublanguage(B._emitter,B.language)}function Ue(){te.subLanguage!=null?vt():ht(),Se=""}function Ge(B,V){B!==""&&(xe.startScope(V),xe.addText(B),xe.endScope())}function Sn(B,V){let oe=1;const pe=V.length-1;for(;oe<=pe;){if(!B._emit[oe]){oe++;continue}const $e=Ve.classNameAliases[B[oe]]||B[oe],Qe=V[oe];$e?Ge(Qe,$e):(Se=Qe,ht(),Se=""),oe++}}function xn(B,V){return B.scope&&typeof B.scope=="string"&&xe.openNode(Ve.classNameAliases[B.scope]||B.scope),B.beginScope&&(B.beginScope._wrap?(Ge(Se,Ve.classNameAliases[B.beginScope._wrap]||B.beginScope._wrap),Se=""):B.beginScope._multi&&(Sn(B.beginScope,V),Se="")),te=Object.create(B,{parent:{value:te}}),te}function Yn(B,V,oe){let pe=R(B.endRe,oe);if(pe){if(B["on:end"]){const $e=new e(B);B["on:end"](V,$e),$e.isMatchIgnored&&(pe=!1)}if(pe){for(;B.endsParent&&B.parent;)B=B.parent;return B}}if(B.endsWithParent)return Yn(B.parent,V,oe)}function Ar(B){return te.matcher.regexIndex===0?(Se+=B[0],1):(an=!0,0)}function wr(B){const V=B[0],oe=B.rule,pe=new e(oe),$e=[oe.__beforeBegin,oe["on:begin"]];for(const Qe of $e)if(Qe&&(Qe(B,pe),pe.isMatchIgnored))return Ar(V);return oe.skip?Se+=V:(oe.excludeBegin&&(Se+=V),Ue(),!oe.returnBegin&&!oe.excludeBegin&&(Se=V)),xn(oe,B),oe.returnBegin?0:V.length}function Sr(B){const V=B[0],oe=Y.substring(B.index),pe=Yn(te,B,oe);if(!pe)return Ht;const $e=te;te.endScope&&te.endScope._wrap?(Ue(),Ge(V,te.endScope._wrap)):te.endScope&&te.endScope._multi?(Ue(),Sn(te.endScope,B)):$e.skip?Se+=V:($e.returnEnd||$e.excludeEnd||(Se+=V),Ue(),$e.excludeEnd&&(Se=V));do{te.scope&&xe.closeNode(),!te.skip&&!te.subLanguage&&(sn+=te.relevance),te=te.parent}while(te!==pe.parent);return pe.starts&&xn(pe.starts,B),$e.returnEnd?0:V.length}function On(){const B=[];for(let V=te;V!==Ve;V=V.parent)V.scope&&B.unshift(V.scope);B.forEach((V=>xe.openNode(V)))}let rn={};function Qn(B,V){const oe=V&&V[0];if(Se+=B,oe==null)return Ue(),0;if(rn.type==="begin"&&V.type==="end"&&rn.index===V.index&&oe===""){if(Se+=Y.slice(V.index,V.index+1),!Te){const pe=new Error(`0 width match regex (${I})`);throw pe.languageName=I,pe.badRule=rn.rule,pe}return 1}if(rn=V,V.type==="begin")return wr(V);if(V.type==="illegal"&&!he){const pe=new Error('Illegal lexeme "'+oe+'" for mode "'+(te.scope||"<unnamed>")+'"');throw pe.mode=te,pe}else if(V.type==="end"){const pe=Sr(V);if(pe!==Ht)return pe}if(V.type==="illegal"&&oe==="")return 1;if(Ln>1e5&&Ln>V.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Se+=oe,oe.length}const Ve=dt(I);if(!Ve)throw je(Ce.replace("{}",I)),new Error('Unknown language: "'+I+'"');const at=pr(Ve);let ot="",te=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(te.matcher.considerAll();;){Ln++,an?an=!1:te.matcher.considerAll(),te.matcher.lastIndex=Nt;const B=te.matcher.exec(Y);if(!B)break;const V=Y.substring(Nt,B.index),oe=Qn(V,B);Nt=B.index+oe}Qn(Y.substring(Nt))}return xe.finalize(),ot=xe.toHTML(),{language:I,value:ot,relevance:sn,illegal:!1,_emitter:xe,_top:te}}catch(B){if(B.message&&B.message.includes("Illegal"))return{language:I,value:yt(Y),illegal:!0,relevance:0,_illegalBy:{message:B.message,index:Nt,context:Y.slice(Nt-100,Nt+100),mode:B.mode,resultSoFar:ot},_emitter:xe};if(Te)return{language:I,value:yt(Y),illegal:!1,relevance:0,errorRaised:B,_emitter:xe,_top:te};throw B}}function qe(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 he=qe(I),Ae=Y.filter(dt).filter(Wn).map((Ue=>_t(Ue,I,!1)));Ae.unshift(he);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(I,Y,he){const Ae=Y&&q[Y]||he;I.classList.add("hljs"),I.classList.add(`language-${Ae}`)}function wn(I){let Y=null;const he=Be(I);if(re(he))return;if(zt("before:highlightElement",{el:I,language:he}),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=he?Ie(Ae,{language:he,ignoreIllegals:!0}):An(Ae);I.innerHTML=Me.value,I.dataset.highlighted="yes",mr(I,he,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(),Rt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ke(){en(),Rt("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 he=null;try{he=Y(b)}catch(Ae){if(je("Language definition for '{}' could not be registered.".replace("{}",I)),Te)je(Ae);else throw Ae;he=z}he.name||(he.name=I),S[I]=he,he.rawDefinition=Y.bind(null,b),he.aliases&&Zn(he.aliases,{languageName:I})}function vr(I){delete S[I];for(const Y of Object.keys(q))q[Y]===I&&delete q[Y]}function Ye(){return Object.keys(S)}function dt(I){return I=(I||"").toLowerCase(),S[I]||S[q[I]]}function Zn(I,{languageName:Y}){typeof I=="string"&&(I=[I]),I.forEach((he=>{q[he.toLowerCase()]=Y}))}function Wn(I){const Y=dt(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),ne.push(I)}function tn(I){const Y=ne.indexOf(I);Y!==-1&&ne.splice(Y,1)}function zt(I,Y){const he=I;ne.forEach((function(Ae){Ae[he]&&Ae[he](Y)}))}function nn(I){return Rt("10.7.0","highlightBlock will be removed entirely in v12.0"),Rt("10.7.0","Please use highlightElement now."),wn(I)}Object.assign(b,{highlight:Ie,highlightAuto:An,highlightAll:en,highlightElement:wn,highlightBlock:nn,configure:br,initHighlighting:Er,initHighlightingOnLoad:Ke,registerLanguage:_r,unregisterLanguage:vr,listLanguages:Ye,getLanguage:dt,registerAliases:Zn,autoDetection:Wn,inherit:st,addPlugin:Tr,removePlugin:tn}),b.debugMode=function(){Te=!1},b.safeMode=function(){Te=!0},b.versionString=Gn,b.regex={concat:v,lookahead:h,either:T,optional:y,anyNumberOfTimes:p};for(const I in ge)typeof ge[I]=="object"&&n(ge[I]);return Object.assign(b,ge),b},ut=It({});return ut.newInstance=()=>It({}),Qs=ut,ut.HighlightJS=ut,ut.default=ut,Qs}var nb=tb();const He=Si(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:/\\'/},g={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},n.NUMBER_MODE,t]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=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._-]+)+/},x=["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"],U=["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:[...x,...R,"set","shopt",...U,...P]},contains:[p,n.SHEBANG(),y,g,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},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:e.optional(s)+n.IDENT_RE,relevance:0},p=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=[g,l,t,n.C_BLOCK_COMMENT_MODE,f,u],x={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]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:N,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:N,relevance:0},{begin:p,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,g]};return{name:"C",aliases:["h"],keywords:N,disableAutodetect:!0,illegal:"</",contains:[].concat(x,R,T,[g,{begin:n.IDENT_RE+"::",keywords:N},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},n.TITLE_MODE]}]),exports:{preprocessor:g,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},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:e.optional(s)+n.IDENT_RE,relevance:0},p=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"],U={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*\(/))},Z=[P,g,l,t,n.C_BLOCK_COMMENT_MODE,f,u],se={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:U,contains:Z.concat([{begin:/\(/,end:/\)/,keywords:U,contains:Z.concat(["self"]),relevance:0}]),relevance:0},F={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:U,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:U,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:U,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,u,f,l,{begin:/\(/,end:/\)/,keywords:U,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,u,f,l]}]},l,t,n.C_BLOCK_COMMENT_MODE,g]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:U,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(se,F,P,Z,[g,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:U,contains:["self",l]},{begin:n.IDENT_RE+"::",keywords:U},{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:'""'}]},g=n.inherit(f,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:a},p=n.inherit(h,{illegal:/\n/}),y={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},n.BACKSLASH_ESCAPE,p]},v={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},N=n.inherit(v,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[v,y,f,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,c,n.C_BLOCK_COMMENT_MODE],p.contains=[N,y,g,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]},x={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},R=n.IDENT_RE+"(<"+n.IDENT_RE+"(\\s*,\\s*"+n.IDENT_RE+")*>)?(\\[\\])?",U={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,x,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,x,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,x],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]},U]}}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])*",ds=`\\.(${ir})`,hs="[0-9a-fA-F](_*[0-9a-fA-F])*",Wa={className:"number",variants:[{begin:`(\\b(${ir})((${ds})|\\.)?|(${ds}))[eE][+-]?(${ir})[fFdD]?\\b`},{begin:`\\b(${ir})((${ds})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${ds})[fFdD]?\\b`},{begin:`\\b(${ir})[fFdD]\\b`},{begin:`\\b0[xX]((${hs})\\.?|(${hs})?\\.(${hs}))[pP][+-]?(${ir})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${hs})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function yl(n,e,t){return t===-1?"":n.replace(e,(r=>yl(n,e,t-1)))}function mb(n){const e=n.regex,t="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=t+yl("(?:<"+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,Wa,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},Wa,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"],_l=["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"],vl=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Nl=["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(Nl,_l,vl);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,ee=M.input[$];if(ee==="<"||ee===","){H.ignoreMatch();return}ee===">"&&(t(M,{after:$})||H.ignoreMatch());let J;const ae=M.input.substring($);if(J=ae.match(/^\s*=/)){H.ignoreMatch();return}if((J=ae.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]*",g={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:[]},p={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]},x={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,p,y,v,N,{match:/\$\d+/},g];h.contains=R.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(R)});const U=[].concat(x,h.contains),P=U.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(U)}]),Z={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:P},se={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"}}]},F={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:{_:[..._l,...vl]}},de={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ie={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[Z],illegal:/%/},m={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function C(M){return e.concat("(?!",M.join("|"),")")}const _={match:e.concat(/\b/,C([...Nl,"super","import"].map((M=>`${M}\\s*\\(`))),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={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:/\(\)/},Z]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",D={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[Z]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:F},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),de,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,p,y,v,N,x,{match:/\$\d+/},g,F,{className:"attr",begin:r+e.lookahead(":"),relevance:0},D,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,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"]}]}]},ie,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[Z,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[Z]},_,m,se,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}]},g=n.inherit(u,{contains:[]}),h=n.inherit(f,{contains:[]});u.contains.push(h),f.contains.push(g);let p=[t,c];return[u,f,g,h].forEach((T=>{T.contains=T.contains.concat(p)})),p=p.concat(u,f),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},t,i,u,f,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},s,r,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function 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":(_,L)=>{L.data._beginMatch=_[1]||_[2]},"on:end":(_,L)=>{L.data._beginMatch!==_[1]&&L.ignoreMatch()}},g=n.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),h=`[ \t\n]`,p={scope:"string",variants:[u,c,f,g]},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"],R={keyword:N,literal:(_=>{const L=[];return _.forEach((k=>{L.push(k),k.toLowerCase()===k?L.push(k.toUpperCase()):L.push(k.toLowerCase())})),L})(v),built_in:T},U=_=>_.map((L=>L.replace(/\|\d+$/,""))),P={variants:[{match:[/new/,e.concat(h,"+"),e.concat("(?!",U(T).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},Z=e.concat(r,"\\b(?!\\()"),se={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),Z],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,e.concat(/::/,e.lookahead(/(?!class\b)/)),Z],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"}}]},F={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},de={relevance:0,begin:/\(/,end:/\)/,keywords:R,contains:[F,i,se,n.C_BLOCK_COMMENT_MODE,p,y,P]},ie={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",U(N).join("\\b|"),"|",U(T).join("\\b|"),"\\b)"),r,e.concat(h,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[de]};de.contains.push(ie);const m=[F,se,n.C_BLOCK_COMMENT_MODE,p,y,P],C={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",...m]},...m,{scope:"meta",match:s}]};return{case_insensitive:!1,keywords:R,contains:[C,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,ie,se,{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,se,n.C_BLOCK_COMMENT_MODE,p,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]},p,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},g={className:"string",contains:[n.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,c,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])*",p=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,y=`\\b|${r.join("|")}`,v={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${y})`},{begin:`(${p})[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,g,n.HASH_COMMENT_MODE]}]};return u.contains=[g,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"},g,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,g]}]}}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},g={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",p="[0-9](_?[0-9])*",y={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},v={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},Z=[g,{variants:[{match:[/class\s+/,s,/\s+<\s+/,s]},{match:[/\b(class|module)\s+/,s]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,s],scope:{2:"title.class"},keywords:a},{relevance:0,match:[s,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[v]},{begin:n.IDENT_RE+"::"},{className:"symbol",begin:n.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[g,{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=Z,v.contains=Z;const ie=[{begin:/^\s*=>/,starts:{end:"$",contains:Z}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:Z}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[n.SHEBANG({binary:"ruby"})].concat(ie).concat(u).concat(Z)}}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"],g=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],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"],p=f,y=[...u,...c].filter((R=>!f.includes(R))),v={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},N={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},T={begin:e.concat(/\b/,e.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function x(R,{exceptions:U,when:P}={}){const Z=P;return U=U||[],R.map((se=>se.match(/\|\d+$/)||U.includes(se)?se:Z(se)?`${se}|0`:se))}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:x(y,{when:R=>R.length<3}),literal:i,type:l,built_in:g},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 Ns="[A-Za-z$_][0-9A-Za-z$_]*",Tl=["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"],Al=["true","false","null","undefined","NaN","Infinity"],wl=["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"],Sl=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],xl=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ol=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ll=[].concat(xl,wl,Sl);function Cb(n){const e=n.regex,t=(M,{after:H})=>{const $="</"+M[0].slice(1);return M.input.indexOf($,H)!==-1},r=Ns,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,ee=M.input[$];if(ee==="<"||ee===","){H.ignoreMatch();return}ee===">"&&(t(M,{after:$})||H.ignoreMatch());let J;const ae=M.input.substring($);if(J=ae.match(/^\s*=/)){H.ignoreMatch();return}if((J=ae.match(/^\s+extends\s+/))&&J.index===0){H.ignoreMatch();return}}},l={$pattern:Ns,keyword:Tl,literal:Al,built_in:Ll,"variable.language":Ol},c="[0-9](_?[0-9])*",u=`\\.(${c})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={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:[]},p={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]},x={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,p,y,v,N,{match:/\$\d+/},g];h.contains=R.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(R)});const U=[].concat(x,h.contains),P=U.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(U)}]),Z={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:P},se={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"}}]},F={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:{_:[...wl,...Sl]}},de={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ie={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[Z],illegal:/%/},m={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function C(M){return e.concat("(?!",M.join("|"),")")}const _={match:e.concat(/\b/,C([...xl,"super","import"].map((M=>`${M}\\s*\\(`))),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={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:/\(\)/},Z]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",D={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[Z]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:F},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),de,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,p,y,v,N,x,{match:/\$\d+/},g,F,{className:"attr",begin:r+e.lookahead(":"),relevance:0},D,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,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"]}]}]},ie,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[Z,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[Z]},_,m,se,k,{match:/\$[(.]/}]}}function Rb(n){const e=Cb(n),t=Ns,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:Ns,keyword:Tl.concat(l),literal:Al,built_in:Ll.concat(r),"variable.language":Ol},u={className:"meta",begin:"@"+t},f=(p,y,v)=>{const N=p.contains.findIndex((T=>T.label===y));if(N===-1)throw new Error("can not find mode to replace");p.contains.splice(N,1,v)};Object.assign(e.keywords,c),e.exports.PARAMS_CONTAINS.push(u);const g=e.contains.find((p=>p.className==="attr"));e.exports.PARAMS_CONTAINS.push([e.exports.CLASS_REFERENCE,g]),e.contains=e.contains.concat([u,s,i]),f(e,"shebang",n.SHEBANG()),f(e,"use_strict",a);const h=e.contains.find((p=>p.label==="func.def"));return h.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}function Ib(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,{}[\]]+/}]}),g={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},p={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}},g,{className:"number",begin:n.C_NUMBER_RE+"\\b",relevance:0},p,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",Rb);He.registerLanguage("ruby",xb);He.registerLanguage("rust",Ob);He.registerLanguage("xml",Ib);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=me("<button type=button><span class=QpTooltip-text>");function fs({children:n,btnClass:e,tooltipText:t,btnText:r}){return(()=>{var s=Db(),i=s.firstChild;return ps(s,`QpTooltip ${e}`),ue(s,n,i),ue(s,r,i),ue(i,t),s})()}var Bb=me("<button type=button class=ql-code>"),$b=me("<button type=button class=ql-code-block>"),qb=me('<span class="pi pi-hashtag">'),Pb=me('<span class="pi pi-pencil">'),Ub=me("<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=me('<span class="pi pi-youtube">'),Hb=me('<span class="pi pi-link">');function zb({language:n,configuration:e,videoPluginHook:t,internalLinkPluginHook:r}){const{t:s}=En(n),i=[Bb(),(()=>{var a=$b();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,g=f.nextSibling,h=g.nextSibling,p=h.nextSibling,y=p.nextSibling,v=y.nextSibling,N=v.nextSibling,T=N.nextSibling;return ue(a,(()=>e?.code&&i),v),ue(a,Mt(fs,{btnClass:"ql-html-snippet",get tooltipText(){return s("CustomToolbar.insertHtmlSnippetMessage")},get children(){return qb()}}),T),ue(a,Mt(fs,{btnClass:"ql-obfuscate",get tooltipText(){return s("CustomToolbar.obfuscate")},get children(){return Pb()}}),T),ue(a,t&&Mt(fs,{btnClass:"ql-video-plugin",get tooltipText(){return s("videoPlugin.insertVideo")},get children(){return Fb()}}),T),ue(a,r&&Mt(fs,{btnClass:"ql-internal-link-plugin",get tooltipText(){return s("internalLinkPlugin.insertLink")},get children(){return Hb()}}),T),a})()}var jb=me("<div>"),Kb=me("<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,g=zb({language:n,configuration:c,videoPluginHook:i,internalLinkPluginHook:a});let h=!1;const p=(()=>{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,x){if(!r.uploadMedia)return;const R=x.toBlob(),U=new File([R],`${l("image")}-${(new Date).getTime()}.${T.split("/")[1]}`,{type:T}),P=await r.uploadMedia(U);P&&s(P)}const v=new A(p,{modules:{toolbar:g,syntax:c.code?{hljs:He,languages:Mb,interval:1e3}:!1,imageDropAndPaste:{handler:(T,x,R)=>{y(x,R).catch(r.logger.error)}}},theme:"snow"});v.on("text-change",((T,x,R)=>{if(!h)return;T.ops.forEach((async P=>{if(P.insert&&typeof P.insert=="string"){const Z=P.insert;if(!i?.recognizeUrl(Z))return;const F=pi(v);await El({editorContent:F,quillEditor:v,service:r,language:n,videoPluginHook:i,value:Z})}}));const U={delta:v.getContents(),html:v.getSemanticHTML()};e(U.delta)}));const N=t();return v.setContents(N??new K),v.history.clear(),h=!0,{element:(()=>{var T=Kb();return ue(T,g,null),ue(T,p,null),T})(),quill:v}}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 Vb{constructor(e,t,r){this.dataUrl=e,this.type=t,this.name=r||""}}class zr extends Vb{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 g=f.getContext("2d");if(g){g.drawImage(l,0,0,l.width,l.height);const h=this.type||"image/png",p=f.toDataURL(h,a);t(new zr(p,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 ks 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}}ks.ImageData=zr;window.QuillImageDropAndPaste=ks;"Quill"in window&&window.Quill.register("modules/imageDropAndPaste",ks);const Wb=A.import("blots/block/embed");function Yb(){return class extends Wb{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 Qb=A.import("blots/inline");function Xb(n){return class extends Qb{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 Jb=A.import("blots/block/embed"),Qa=["alt"];function e1(n){return class extends Jb{static blotName="media";static tagName="figure";static create(t){const r=super.create(t);return t1(n,r,t),r}static formats(t){return Qa.reduce(((r,s)=>(t.hasAttribute(s)&&(r[s]=t.getAttribute(s)),r)),{})}static match(t){return/\.(jpe?g|gif|png|webp)$/.test(t)||/^data:image\/.+;base64/.test(t)}static value(t){const{mediaId:r,resize:s}=t.dataset;if(!r)throw new Error('missing "media-id" attribute');const i=s&&eo(s)?s:void 0;if(!i)throw new Error('missing "resize" attribute');const a=ul(t),l=t.dataset.zoomable==="1",c=t.dataset.href?t.dataset.href:void 0;return{mediaId:r,resizeRule:i,align:a,zoomable:l,href:c}}format(t,r){Qa.indexOf(t)>-1?r?this.domNode.setAttribute(t,r):this.domNode.removeAttribute(t):super.format(t,r)}}}function t1(n,e,t){e.setAttribute("data-pa-blot","media"),e.setAttribute("contenteditable","false"),e.classList.add("MediaBlot","Fig");const r=document.createElement("img");if(r.classList.add("Fig-media"),t.align){const i=_m(t.align);i&&e.classList.add(i)}e.setAttribute("data-zoomable",t.zoomable?"1":"0"),t.zoomable&&e.classList.add("zoomable"),t.href&&(e.setAttribute("data-href",t.href),e.classList.add("asLink")),e.setAttribute("data-media-id",t.mediaId),e.setAttribute("data-resize",t.resizeRule);const s=mi({center:!0});e.appendChild(s),n1(n,e,r,s,t)}async function n1(n,e,t,r,s){try{const i=await n.useBackOfficeImage(s.mediaId,{resizeRule:s.resizeRule});if(!i)throw new Error(`Media ${s.mediaId} not found`);const{source:a,variant:l}=i;t.setAttribute("src",l.url),t.setAttribute("width",String(l.width)),t.setAttribute("height",String(l.height));const c=a.attachedData?.[n.contentLanguage]?.caption;if(c){const u=document.createElement("figcaption");u.classList.add("Fig-caption"),u.textContent=c,e.appendChild(u)}r1(e,a,s),e.removeChild(r),e.appendChild(t),e.setAttribute("data-source",JSON.stringify(a))}catch(i){n.logger.error("Error setting up media:",i),e.contains(r)&&e.removeChild(r)}}function r1(n,e,t){const r=document.createElement("div");if(r.classList.add("MediaBlot-flags"),e.pixelRatio!==void 0){const s=document.createElement("span");s.classList.add("MediaBlot-flag","Fig-flag--pixelRatio"),s.textContent=`${e.pixelRatio}×`,r.appendChild(s)}if(t.zoomable){const s=document.createElement("span");s.classList.add("MediaBlot-flag"),s.innerHTML=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5">\n <circle cx="6.5" cy="6.5" r="5"/>\n <path d="m10.04 10.04 4.46 4.46"/>\n</svg>`,r.appendChild(s)}if(t.href){const s=document.createElement("span");s.classList.add("MediaBlot-flag"),s.innerHTML=`<svg width="22" height="22" viewBox="0 0 16 16" fill="currentColor">\n <path d="M4.715 6.542 3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1.002 1.002 0 0 0-.154.199 2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4.018 4.018 0 0 1-.128-1.287z"/>\n <path d="M6.586 4.672A3 3 0 0 0 7.414 9.5l.775-.776a2 2 0 0 1-.896-3.346L9.12 3.55a2 2 0 1 1 2.83 2.83l-.793.792c.112.42.155.855.128 1.287l1.372-1.372a3 3 0 1 0-4.243-4.243L6.586 4.672z"/>\n</svg>`,r.appendChild(s)}n.appendChild(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 pl(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({service:n,videoPluginHook:e,internalLinkPluginHook:t}){A.register("formats/media",e1(n),!0),A.register("formats/html-snippet",Yb(),!0),A.register("formats/obfuscate",i1(),!0),A.register("formats/video-plugin",o1(e),!0),A.register("formats/internal-link-plugin",Xb(t),!0),A.register("modules/imageDropAndPaste",ks,!0)}function c1(){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 O1={create:d1,init:u1},Gt=c1();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]=gt(t),[a,l]=gt(n.language);l1({service:n,videoPluginHook:Gt.videoPlugin,internalLinkPluginHook:Gt.internalLinkPlugin});let c;const{element:u,quill:f}=Gb({language:a,value:s,setValue:N=>{const T=s();i(N),h1(N,T)||n.setModifiedValue({j:N})},service:n,videoPluginHook:Gt.videoPlugin,internalLinkPluginHook:Gt.internalLinkPlugin,insertMedia:async N=>await(c?.(N))}),g=Qm({quillEditor:f,service:n,language:a,videoPluginHook:Gt.videoPlugin,internalLinkPluginHook:Gt.internalLinkPlugin});c=g.insertMedia;const h=f.getModule("toolbar");h.addHandler("html-snippet",g.insertHtmlSnippetHandler),h.addHandler("obfuscate",g.insertObfuscateBlotHandler),h.addHandler("video-plugin",g.insertVideoHandler),h.addHandler("internal-link-plugin",g.insertInternalLinkHandler);const p=f.root,y=N=>v(N,f);p.addEventListener("click",y),Rl((()=>p.removeEventListener("click",y)));const v=async(N,T)=>{const x=N.target;x.tagName==="FIGURE"&&x.classList.contains("MediaBlot")&&await Ym({service:n,editor:T,element:x,language:a}),x.tagName==="BUTTON"&&x.classList.contains("HtmlSnippet")&&await Vm({language:a,editor:T,service:n,htmlSnippetBtn:x}),x.tagName==="SPAN"&&x.classList.contains("ObfuscateBlot")&&await bl({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:Gt.videoPlugin}),x.tagName==="SPAN"&&x.classList.contains("InternalLinkPlugin")&&await Zm({editor:T,internalLinkElement:x,language:a,service:n,internalLinkPluginHook:Gt.internalLinkPlugin})};return{element:u,setValue:N=>i(Xa(N)),setLanguage:l,getValue:()=>({j:s}),dispose:r,insertMedia:N=>c?.(N)}}))}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 Xs,createSignal as ft,createEffect as Ui,For as Fi,Show as Hi,createRoot as Cl,onCleanup as Rl}from"https://esm.sh/solid-js@1.9.7";import{delegateEvents as Ts,template as be,insert as ue,effect as ln,className as ps,createComponent as Dt,memo as Bs}from"https://esm.sh/solid-js@1.9.7/web";function Ja(n){return typeof n=="object"&&n!==null&&"j"in n}function eo(n){return/^[0-9]+x|x[0-9]+|x[0-9]+x|[0-9]+x[0-9]+$/.test(n)}var to=typeof global=="object"&&global&&global.Object===Object&&global,Il=typeof self=="object"&&self&&self.Object===Object&&self,qt=to||Il||Function("return this")(),fn=qt.Symbol,no=Object.prototype,kl=no.hasOwnProperty,Ml=no.toString,Lr=fn?fn.toStringTag:void 0;function Dl(n){var e=kl.call(n,Lr),t=n[Lr];try{n[Lr]=void 0;var r=!0}catch{}var s=Ml.call(n);return r&&(e?n[Lr]=t:delete n[Lr]),s}var Bl=Object.prototype,$l=Bl.toString;function ql(n){return $l.call(n)}var Pl="[object Null]",Ul="[object Undefined]",zi=fn?fn.toStringTag:void 0;function lr(n){return n==null?n===void 0?Ul:Pl:zi&&zi in Object(n)?Dl(n):ql(n)}function Zt(n){return n!=null&&typeof n=="object"}var Rn=Array.isArray;function gn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function ro(n){return n}var Fl="[object AsyncFunction]",Hl="[object Function]",zl="[object GeneratorFunction]",jl="[object Proxy]";function bi(n){if(!gn(n))return!1;var e=lr(n);return e==Hl||e==zl||e==Fl||e==jl}var $s=qt["__core-js_shared__"],ji=function(){var n=/[^.]+$/.exec($s&&$s.keys&&$s.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function Kl(n){return!!ji&&ji in n}var Gl=Function.prototype,Vl=Gl.toString;function Dn(n){if(n!=null){try{return Vl.call(n)}catch{}try{return n+""}catch{}}return""}var Zl=/[\\^$.*+?()[\]{}|]/g,Wl=/^\[object .+?Constructor\]$/,Yl=Function.prototype,Ql=Object.prototype,Xl=Yl.toString,Jl=Ql.hasOwnProperty,ec=RegExp("^"+Xl.call(Jl).replace(Zl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function tc(n){if(!gn(n)||Kl(n))return!1;var e=bi(n)?ec:Wl;return e.test(Dn(n))}function nc(n,e){return n?.[e]}function Bn(n,e){var t=nc(n,e);return tc(t)?t:void 0}var Js=Bn(qt,"WeakMap"),Ki=Object.create,rc=function(){function n(){}return function(e){if(!gn(e))return{};if(Ki)return Ki(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();function sc(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 ic(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var ac=800,oc=16,lc=Date.now;function cc(n){var e=0,t=0;return function(){var r=lc(),s=oc-(r-t);if(t=r,s>0){if(++e>=ac)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function uc(n){return function(){return n}}var ms=function(){try{var n=Bn(Object,"defineProperty");return n({},"",{}),n}catch{}}(),dc=ms?function(n,e){return ms(n,"toString",{configurable:!0,enumerable:!1,value:uc(e),writable:!0})}:ro,hc=cc(dc);function fc(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var gc=9007199254740991,pc=/^(?:0|[1-9]\d*)$/;function so(n,e){var t=typeof n;return e=e??gc,!!e&&(t=="number"||t!="symbol"&&pc.test(n))&&n>-1&&n%1==0&&n<e}function Ei(n,e,t){e=="__proto__"&&ms?ms(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function zr(n,e){return n===e||n!==n&&e!==e}var mc=Object.prototype,bc=mc.hasOwnProperty;function io(n,e,t){var r=n[e];(!(bc.call(n,e)&&zr(r,t))||t===void 0&&!(e in n))&&Ei(n,e,t)}function Ec(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?Ei(t,l,c):io(t,l,c)}return t}var Gi=Math.max;function yc(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),sc(n,this,l)}}function _c(n,e){return hc(yc(n,e,ro),n+"")}var vc=9007199254740991;function ao(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=vc}function As(n){return n!=null&&ao(n.length)&&!bi(n)}function Nc(n,e,t){if(!gn(t))return!1;var r=typeof e;return(r=="number"?As(t)&&so(e,t.length):r=="string"&&e in t)?zr(t[e],n):!1}function Tc(n){return _c((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&&Nc(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 Ac=Object.prototype;function yi(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||Ac;return n===t}function wc(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var Sc="[object Arguments]";function Vi(n){return Zt(n)&&lr(n)==Sc}var oo=Object.prototype,xc=oo.hasOwnProperty,Oc=oo.propertyIsEnumerable,ei=Vi(function(){return arguments}())?Vi:function(n){return Zt(n)&&xc.call(n,"callee")&&!Oc.call(n,"callee")};function Lc(){return!1}var lo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Zi=lo&&typeof module=="object"&&module&&!module.nodeType&&module,Cc=Zi&&Zi.exports===lo,Wi=Cc?qt.Buffer:void 0,Rc=Wi?Wi.isBuffer:void 0,Br=Rc||Lc,Ic="[object Arguments]",kc="[object Array]",Mc="[object Boolean]",Dc="[object Date]",Bc="[object Error]",$c="[object Function]",qc="[object Map]",Pc="[object Number]",Uc="[object Object]",Fc="[object RegExp]",Hc="[object Set]",zc="[object String]",jc="[object WeakMap]",Kc="[object ArrayBuffer]",Gc="[object DataView]",Vc="[object Float32Array]",Zc="[object Float64Array]",Wc="[object Int8Array]",Yc="[object Int16Array]",Qc="[object Int32Array]",Xc="[object Uint8Array]",Jc="[object Uint8ClampedArray]",eu="[object Uint16Array]",tu="[object Uint32Array]",Ie={};Ie[Vc]=Ie[Zc]=Ie[Wc]=Ie[Yc]=Ie[Qc]=Ie[Xc]=Ie[Jc]=Ie[eu]=Ie[tu]=!0;Ie[Ic]=Ie[kc]=Ie[Kc]=Ie[Mc]=Ie[Gc]=Ie[Dc]=Ie[Bc]=Ie[$c]=Ie[qc]=Ie[Pc]=Ie[Uc]=Ie[Fc]=Ie[Hc]=Ie[zc]=Ie[jc]=!1;function nu(n){return Zt(n)&&ao(n.length)&&!!Ie[lr(n)]}function _i(n){return function(e){return n(e)}}var co=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mr=co&&typeof module=="object"&&module&&!module.nodeType&&module,ru=Mr&&Mr.exports===co,qs=ru&&to.process,ar=function(){try{var n=Mr&&Mr.require&&Mr.require("util").types;return n||qs&&qs.binding&&qs.binding("util")}catch{}}(),Yi=ar&&ar.isTypedArray,vi=Yi?_i(Yi):nu,su=Object.prototype,iu=su.hasOwnProperty;function uo(n,e){var t=Rn(n),r=!t&&ei(n),s=!t&&!r&&Br(n),i=!t&&!r&&!s&&vi(n),a=t||r||s||i,l=a?wc(n.length,String):[],c=l.length;for(var u in n)(e||iu.call(n,u))&&!(a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||so(u,c)))&&l.push(u);return l}function ho(n,e){return function(t){return n(e(t))}}var au=ho(Object.keys,Object),ou=Object.prototype,lu=ou.hasOwnProperty;function cu(n){if(!yi(n))return au(n);var e=[];for(var t in Object(n))lu.call(n,t)&&t!="constructor"&&e.push(t);return e}function uu(n){return As(n)?uo(n):cu(n)}function du(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var hu=Object.prototype,fu=hu.hasOwnProperty;function gu(n){if(!gn(n))return du(n);var e=yi(n),t=[];for(var r in n)r=="constructor"&&(e||!fu.call(n,r))||t.push(r);return t}function fo(n){return As(n)?uo(n,!0):gu(n)}var $r=Bn(Object,"create");function pu(){this.__data__=$r?$r(null):{},this.size=0}function mu(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var bu="__lodash_hash_undefined__",Eu=Object.prototype,yu=Eu.hasOwnProperty;function _u(n){var e=this.__data__;if($r){var t=e[n];return t===bu?void 0:t}return yu.call(e,n)?e[n]:void 0}var vu=Object.prototype,Nu=vu.hasOwnProperty;function Tu(n){var e=this.__data__;return $r?e[n]!==void 0:Nu.call(e,n)}var Au="__lodash_hash_undefined__";function wu(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=$r&&e===void 0?Au:e,this}function In(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])}}In.prototype.clear=pu;In.prototype.delete=mu;In.prototype.get=_u;In.prototype.has=Tu;In.prototype.set=wu;function Su(){this.__data__=[],this.size=0}function ws(n,e){for(var t=n.length;t--;)if(zr(n[t][0],e))return t;return-1}var xu=Array.prototype,Ou=xu.splice;function Lu(n){var e=this.__data__,t=ws(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():Ou.call(e,t,1),--this.size,!0}function Cu(n){var e=this.__data__,t=ws(e,n);return t<0?void 0:e[t][1]}function Ru(n){return ws(this.__data__,n)>-1}function Iu(n,e){var t=this.__data__,r=ws(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function Yt(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])}}Yt.prototype.clear=Su;Yt.prototype.delete=Lu;Yt.prototype.get=Cu;Yt.prototype.has=Ru;Yt.prototype.set=Iu;var qr=Bn(qt,"Map");function ku(){this.size=0,this.__data__={hash:new In,map:new(qr||Yt),string:new In}}function Mu(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Ss(n,e){var t=n.__data__;return Mu(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Du(n){var e=Ss(this,n).delete(n);return this.size-=e?1:0,e}function Bu(n){return Ss(this,n).get(n)}function $u(n){return Ss(this,n).has(n)}function qu(n,e){var t=Ss(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=ku;$n.prototype.delete=Du;$n.prototype.get=Bu;$n.prototype.has=$u;$n.prototype.set=qu;function Pu(n,e){for(var t=-1,r=e.length,s=n.length;++t<r;)n[s+t]=e[t];return n}var go=ho(Object.getPrototypeOf,Object),Uu="[object Object]",Fu=Function.prototype,Hu=Object.prototype,po=Fu.toString,zu=Hu.hasOwnProperty,ju=po.call(Object);function Ku(n){if(!Zt(n)||lr(n)!=Uu)return!1;var e=go(n);if(e===null)return!0;var t=zu.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&po.call(t)==ju}function Gu(){this.__data__=new Yt,this.size=0}function Vu(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function Zu(n){return this.__data__.get(n)}function Wu(n){return this.__data__.has(n)}var Yu=200;function Qu(n,e){var t=this.__data__;if(t instanceof Yt){var r=t.__data__;if(!qr||r.length<Yu-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 Bt(n){var e=this.__data__=new Yt(n);this.size=e.size}Bt.prototype.clear=Gu;Bt.prototype.delete=Vu;Bt.prototype.get=Zu;Bt.prototype.has=Wu;Bt.prototype.set=Qu;var mo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Qi=mo&&typeof module=="object"&&module&&!module.nodeType&&module,Xu=Qi&&Qi.exports===mo,Xi=Xu?qt.Buffer:void 0,Ji=Xi?Xi.allocUnsafe:void 0;function bo(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 Ju(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 ed(){return[]}var td=Object.prototype,nd=td.propertyIsEnumerable,ea=Object.getOwnPropertySymbols,rd=ea?function(n){return n==null?[]:(n=Object(n),Ju(ea(n),(function(e){return nd.call(n,e)})))}:ed;function sd(n,e,t){var r=e(n);return Rn(n)?r:Pu(r,t(n))}function ti(n){return sd(n,uu,rd)}var ni=Bn(qt,"DataView"),ri=Bn(qt,"Promise"),si=Bn(qt,"Set"),ta="[object Map]",id="[object Object]",na="[object Promise]",ra="[object Set]",sa="[object WeakMap]",ia="[object DataView]",ad=Dn(ni),od=Dn(qr),ld=Dn(ri),cd=Dn(si),ud=Dn(Js),Tt=lr;(ni&&Tt(new ni(new ArrayBuffer(1)))!=ia||qr&&Tt(new qr)!=ta||ri&&Tt(ri.resolve())!=na||si&&Tt(new si)!=ra||Js&&Tt(new Js)!=sa)&&(Tt=function(n){var e=lr(n),t=e==id?n.constructor:void 0,r=t?Dn(t):"";if(r)switch(r){case ad:return ia;case od:return ta;case ld:return na;case cd:return ra;case ud:return sa}return e});var dd=Object.prototype,hd=dd.hasOwnProperty;function fd(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&hd.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var bs=qt.Uint8Array;function Ni(n){var e=new n.constructor(n.byteLength);return new bs(e).set(new bs(n)),e}function gd(n,e){var t=Ni(n.buffer);return new n.constructor(t,n.byteOffset,n.byteLength)}var pd=/\w*$/;function md(n){var e=new n.constructor(n.source,pd.exec(n));return e.lastIndex=n.lastIndex,e}var aa=fn?fn.prototype:void 0,oa=aa?aa.valueOf:void 0;function bd(n){return oa?Object(oa.call(n)):{}}function Eo(n,e){var t=e?Ni(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var Ed="[object Boolean]",yd="[object Date]",_d="[object Map]",vd="[object Number]",Nd="[object RegExp]",Td="[object Set]",Ad="[object String]",wd="[object Symbol]",Sd="[object ArrayBuffer]",xd="[object DataView]",Od="[object Float32Array]",Ld="[object Float64Array]",Cd="[object Int8Array]",Rd="[object Int16Array]",Id="[object Int32Array]",kd="[object Uint8Array]",Md="[object Uint8ClampedArray]",Dd="[object Uint16Array]",Bd="[object Uint32Array]";function $d(n,e,t){var r=n.constructor;switch(e){case Sd:return Ni(n);case Ed:case yd:return new r(+n);case xd:return gd(n);case Od:case Ld:case Cd:case Rd:case Id:case kd:case Md:case Dd:case Bd:return Eo(n,t);case _d:return new r;case vd:case Ad:return new r(n);case Nd:return md(n);case Td:return new r;case wd:return bd(n)}}function yo(n){return typeof n.constructor=="function"&&!yi(n)?rc(go(n)):{}}var qd="[object Map]";function Pd(n){return Zt(n)&&Tt(n)==qd}var la=ar&&ar.isMap,Ud=la?_i(la):Pd,Fd="[object Set]";function Hd(n){return Zt(n)&&Tt(n)==Fd}var ca=ar&&ar.isSet,zd=ca?_i(ca):Hd,jd=1,_o="[object Arguments]",Kd="[object Array]",Gd="[object Boolean]",Vd="[object Date]",Zd="[object Error]",vo="[object Function]",Wd="[object GeneratorFunction]",Yd="[object Map]",Qd="[object Number]",No="[object Object]",Xd="[object RegExp]",Jd="[object Set]",eh="[object String]",th="[object Symbol]",nh="[object WeakMap]",rh="[object ArrayBuffer]",sh="[object DataView]",ih="[object Float32Array]",ah="[object Float64Array]",oh="[object Int8Array]",lh="[object Int16Array]",ch="[object Int32Array]",uh="[object Uint8Array]",dh="[object Uint8ClampedArray]",hh="[object Uint16Array]",fh="[object Uint32Array]",Ce={};Ce[_o]=Ce[Kd]=Ce[rh]=Ce[sh]=Ce[Gd]=Ce[Vd]=Ce[ih]=Ce[ah]=Ce[oh]=Ce[lh]=Ce[ch]=Ce[Yd]=Ce[Qd]=Ce[No]=Ce[Xd]=Ce[Jd]=Ce[eh]=Ce[th]=Ce[uh]=Ce[dh]=Ce[hh]=Ce[fh]=!0;Ce[Zd]=Ce[vo]=Ce[nh]=!1;function gs(n,e,t,r,s,i){var a,l=e&jd;if(a!==void 0)return a;if(!gn(n))return n;var c=Rn(n);if(c)a=fd(n);else{var u=Tt(n),f=u==vo||u==Wd;if(Br(n))return bo(n,l);if(u==No||u==_o||f&&!s)a=f?{}:yo(n);else{if(!Ce[u])return s?n:{};a=$d(n,u,l)}}i||(i=new Bt);var g=i.get(n);if(g)return g;i.set(n,a),zd(n)?n.forEach((function(y){a.add(gs(y,e,t,y,n,i))})):Ud(n)&&n.forEach((function(y,_){a.set(_,gs(y,e,t,_,n,i))}));var h=ti,p=c?void 0:h(n);return fc(p||n,(function(y,_){p&&(_=y,y=n[_]),io(a,_,gs(y,e,t,_,n,i))})),a}var gh=1,ph=4;function rr(n){return gs(n,gh|ph)}var mh="__lodash_hash_undefined__";function bh(n){return this.__data__.set(n,mh),this}function Eh(n){return this.__data__.has(n)}function Es(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new $n;++e<t;)this.add(n[e])}Es.prototype.add=Es.prototype.push=bh;Es.prototype.has=Eh;function yh(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 _h(n,e){return n.has(e)}var vh=1,Nh=2;function To(n,e,t,r,s,i){var a=t&vh,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 g=-1,h=!0,p=t&Nh?new Es:void 0;for(i.set(n,e),i.set(e,n);++g<l;){var y=n[g],_=e[g];if(r)var N=a?r(_,y,g,e,n,i):r(y,_,g,n,e,i);if(N!==void 0){if(N)continue;h=!1;break}if(p){if(!yh(e,(function(T,S){if(!_h(p,S)&&(y===T||s(y,T,t,r,i)))return p.push(S)}))){h=!1;break}}else if(!(y===_||s(y,_,t,r,i))){h=!1;break}}return i.delete(n),i.delete(e),h}function Th(n){var e=-1,t=Array(n.size);return n.forEach((function(r,s){t[++e]=[s,r]})),t}function Ah(n){var e=-1,t=Array(n.size);return n.forEach((function(r){t[++e]=r})),t}var wh=1,Sh=2,xh="[object Boolean]",Oh="[object Date]",Lh="[object Error]",Ch="[object Map]",Rh="[object Number]",Ih="[object RegExp]",kh="[object Set]",Mh="[object String]",Dh="[object Symbol]",Bh="[object ArrayBuffer]",$h="[object DataView]",ua=fn?fn.prototype:void 0,Ps=ua?ua.valueOf:void 0;function qh(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 Bh:return!(n.byteLength!=e.byteLength||!i(new bs(n),new bs(e)));case xh:case Oh:case Rh:return zr(+n,+e);case Lh:return n.name==e.name&&n.message==e.message;case Ih:case Mh:return n==e+"";case Ch:var l=Th;case kh:var c=r&wh;if(l||(l=Ah),n.size!=e.size&&!c)return!1;var u=a.get(n);if(u)return u==e;r|=Sh,a.set(n,e);var f=To(l(n),l(e),r,s,i,a);return a.delete(n),f;case Dh:if(Ps)return Ps.call(n)==Ps.call(e)}return!1}var Ph=1,Uh=Object.prototype,Fh=Uh.hasOwnProperty;function Hh(n,e,t,r,s,i){var a=t&Ph,l=ti(n),c=l.length,u=ti(e),f=u.length;if(c!=f&&!a)return!1;for(var g=c;g--;){var h=l[g];if(!(a?h in e:Fh.call(e,h)))return!1}var p=i.get(n),y=i.get(e);if(p&&y)return p==e&&y==n;var _=!0;i.set(n,e),i.set(e,n);for(var N=a;++g<c;){h=l[g];var T=n[h],S=e[h];if(r)var k=a?r(S,T,h,e,n,i):r(T,S,h,n,e,i);if(!(k===void 0?T===S||s(T,S,t,r,i):k)){_=!1;break}N||(N=h=="constructor")}if(_&&!N){var F=n.constructor,B=e.constructor;F!=B&&"constructor"in n&&"constructor"in e&&!(typeof F=="function"&&F instanceof F&&typeof B=="function"&&B instanceof B)&&(_=!1)}return i.delete(n),i.delete(e),_}var zh=1,da="[object Arguments]",ha="[object Array]",es="[object Object]",jh=Object.prototype,fa=jh.hasOwnProperty;function Kh(n,e,t,r,s,i){var a=Rn(n),l=Rn(e),c=a?ha:Tt(n),u=l?ha:Tt(e);c=c==da?es:c,u=u==da?es:u;var f=c==es,g=u==es,h=c==u;if(h&&Br(n)){if(!Br(e))return!1;a=!0,f=!1}if(h&&!f)return i||(i=new Bt),a||vi(n)?To(n,e,t,r,s,i):qh(n,e,c,t,r,s,i);if(!(t&zh)){var p=f&&fa.call(n,"__wrapped__"),y=g&&fa.call(e,"__wrapped__");if(p||y){var _=p?n.value():n,N=y?e.value():e;return i||(i=new Bt),s(_,N,t,r,i)}}return h?(i||(i=new Bt),Hh(n,e,t,r,s,i)):!1}function Ao(n,e,t,r,s){return n===e?!0:n==null||e==null||!Zt(n)&&!Zt(e)?n!==n&&e!==e:Kh(n,e,t,r,Ao,s)}function Gh(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 Vh=Gh();function ii(n,e,t){(t!==void 0&&!zr(n[e],t)||t===void 0&&!(e in n))&&Ei(n,e,t)}function Zh(n){return Zt(n)&&As(n)}function ai(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function Wh(n){return Ec(n,fo(n))}function Yh(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,g=f===void 0;if(g){var h=Rn(c),p=!h&&Br(c),y=!h&&!p&&vi(c);f=c,h||p||y?Rn(l)?f=l:Zh(l)?f=ic(l):p?(g=!1,f=bo(c,!0)):y?(g=!1,f=Eo(c,!0)):f=[]:Ku(c)||ei(c)?(f=l,ei(l)?f=Wh(l):(!gn(l)||bi(l))&&(f=yo(c))):g=!1}g&&(a.set(c,f),s(f,c,r,i,a),a.delete(c)),ii(n,t,f)}function wo(n,e,t,r,s){n!==e&&Vh(e,(function(i,a){if(s||(s=new Bt),gn(i))Yh(n,e,a,t,wo,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)}}),fo)}function Ti(n,e){return Ao(n,e)}var dn=Tc((function(n,e,t){wo(n,e,t)})),Y=(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))(Y||{});class $t{constructor(e,t,r={}){this.attrName=e,this.keyName=t;const s=Y.TYPE&Y.ATTRIBUTE;this.scope=r.scope!=null?r.scope&Y.LEVEL|s:Y.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 sr extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const So=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 sr(`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=Y.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&Y.LEVEL&Y.BLOCK?r=this.types.block:e&Y.LEVEL&Y.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&Y.LEVEL&r.scope&&t&Y.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 sr("Invalid definition");if(r&&t.blotName==="abstract")throw new sr("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}))}};So.blots=new WeakMap;let or=So;function ga(n,e){return(n.getAttribute("class")||"").split(/\s+/).filter((t=>t.indexOf(`${e}-`)===0))}class Qh extends $t{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 Ot=Qh;function Us(n){const e=n.split("-"),t=e.slice(1).map((r=>r[0].toUpperCase()+r.slice(1))).join("");return e[0]+t}class Xh extends $t{static keys(e){return(e.getAttribute("style")||"").split(";").map((t=>t.split(":")[0].trim()))}add(e,t){return this.canAdd(e,t)?(e.style[Us(this.keyName)]=t,!0):!1}remove(e){e.style[Us(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[Us(this.keyName)];return this.canAdd(e,t)?t:""}}const pn=Xh;class Jh{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=or.find(this.domNode);if(e==null)return;const t=$t.keys(this.domNode),r=Ot.keys(this.domNode),s=pn.keys(this.domNode);t.concat(r).concat(s).forEach((i=>{const a=e.scroll.query(i,Y.ATTRIBUTE);a instanceof $t&&(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 xs=Jh,xo=class{constructor(e,t){this.scroll=e,this.domNode=t,or.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new sr("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),or.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,Y.BLOT)!=null&&s)i.wrap(r,s);else if(this.scroll.query(r,Y.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 sr(`Cannot wrap ${e}`);return r.appendChild(this),r}};xo.blotName="abstract";let Oo=xo;const Lo=class extends Oo{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}}};Lo.scope=Y.INLINE_BLOT;let ef=Lo;const Xe=ef;class tf{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(Y.INLINE);return Array.from(n.childNodes).forEach((s=>{r.domNode.appendChild(s)})),n.parentNode&&n.parentNode.replaceChild(r.domNode,n),r.attach(),r}}const Co=class on extends Oo{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,on.uiClass&&this.uiNode.classList.add(on.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new tf,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 sr)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 on?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 on&&(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===Y.BLOCK_BLOT?(t.next!=null&&this.splitAfter(t),t.prev!=null&&this.splitAfter(t.prev),t.parent.unwrap(),e=!0):t instanceof on?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 on?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 on&&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()}};Co.uiClass="";let nf=Co;const St=nf;function rf(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 Qn=class Xn extends St{static create(e){return super.create(e)}static formats(e,t){const r=t.query(Xn.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 xs(this.domNode)}format(e,t){if(e===this.statics.blotName&&!t)this.children.forEach((r=>{r instanceof Xn||(r=r.wrap(Xn.blotName,!0)),this.attributes.copy(r)})),this.unwrap();else{const r=this.scroll.query(e,Y.INLINE);if(r==null)return;r instanceof $t?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,Y.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 Xn&&r.prev===this&&rf(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 Xn&&this.attributes.move(r),r}};Qn.allowedChildren=[Qn,Xe],Qn.blotName="inline",Qn.scope=Y.INLINE_BLOT,Qn.tagName="SPAN";let sf=Qn;const Ai=sf,Jn=class li extends St{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 xs(this.domNode)}format(e,t){const r=this.scroll.query(e,Y.BLOCK);r!=null&&(r instanceof $t?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,Y.BLOCK)!=null?this.format(r,s):super.formatAt(e,t,r,s)}insertAt(e,t,r){if(r==null||this.scroll.query(t,Y.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()}};Jn.blotName="block",Jn.scope=Y.BLOCK_BLOT,Jn.tagName="P",Jn.allowedChildren=[Ai,Jn,Xe];let af=Jn;const Pr=af,ci=class extends St{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=Y.BLOCK_BLOT;let of=ci;const Os=of;class lf extends Xe{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 ot=lf,cf={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},uf=100,er=class extends St{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,cf),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=Y.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 St&&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>=uf)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((g=>{const h=this.find(g,!1);i(h,!1),h instanceof St&&h.children.forEach((p=>{i(p,!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)}};er.blotName="scroll",er.defaultChild=Pr,er.allowedChildren=[Pr,Os],er.scope=Y.BLOCK_BLOT,er.tagName="DIV";let df=er;const wi=df,ui=class Ro extends Xe{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 Ro&&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=Y.INLINE_BLOT;let hf=ui;const ys=hf,ff=Object.freeze(Object.defineProperty({__proto__:null,Attributor:$t,AttributorStore:xs,BlockBlot:Pr,ClassAttributor:Ot,ContainerBlot:Os,EmbedBlot:ot,InlineBlot:Ai,LeafBlot:Xe,ParentBlot:St,Registry:or,Scope:Y,ScrollBlot:wi,StyleAttributor:pn,TextBlot:ys},Symbol.toStringTag,{value:"Module"}));var cn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Si(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ts={exports:{}},Fs,ma;function gf(){if(ma)return Fs;ma=1;var n=-1,e=1,t=0;function r(m,L,v,C,R){if(m===L)return m?[[t,m]]:[];if(v!=null){var O=se(m,L,v);if(O)return O}var D=l(m,L),M=m.substring(0,D);m=m.substring(D),L=L.substring(D),D=u(m,L);var z=m.substring(m.length-D);m=m.substring(0,m.length-D),L=L.substring(0,L.length-D);var $=s(m,L);return M&&$.unshift([t,M]),z&&$.push([t,z]),S($,R),C&&g($),$}function s(m,L){var v;if(!m)return[[e,L]];if(!L)return[[n,m]];var C=m.length>L.length?m:L,R=m.length>L.length?L:m,O=C.indexOf(R);if(O!==-1)return v=[[e,C.substring(0,O)],[t,R],[e,C.substring(O+R.length)]],m.length>L.length&&(v[0][0]=v[2][0]=n),v;if(R.length===1)return[[n,m],[e,L]];var D=f(m,L);if(D){var M=D[0],z=D[1],$=D[2],ee=D[3],J=D[4],ae=r(M,$),fe=r(z,ee);return ae.concat([[t,J]],fe)}return i(m,L)}function i(m,L){for(var v=m.length,C=L.length,R=Math.ceil((v+C)/2),O=R,D=2*R,M=new Array(D),z=new Array(D),$=0;$<D;$++)M[$]=-1,z[$]=-1;M[O+1]=0,z[O+1]=0;for(var ee=v-C,J=ee%2!==0,ae=0,fe=0,X=0,xe=0,Oe=0;Oe<R;Oe++){for(var ce=-Oe+ae;ce<=Oe-fe;ce+=2){var ve=O+ce,pe;ce===-Oe||ce!==Oe&&M[ve-1]<M[ve+1]?pe=M[ve+1]:pe=M[ve-1]+1;for(var ye=pe-ce;pe<v&&ye<C&&m.charAt(pe)===L.charAt(ye);)pe++,ye++;if(M[ve]=pe,pe>v)fe+=2;else if(ye>C)ae+=2;else if(J){var Ne=O+ee-ce;if(Ne>=0&&Ne<D&&z[Ne]!==-1){var Te=v-z[Ne];if(pe>=Te)return a(m,L,pe,ye)}}}for(var Be=-Oe+X;Be<=Oe-xe;Be+=2){var Ne=O+Be,Te;Be===-Oe||Be!==Oe&&z[Ne-1]<z[Ne+1]?Te=z[Ne+1]:Te=z[Ne-1]+1;for(var je=Te-Be;Te<v&&je<C&&m.charAt(v-Te-1)===L.charAt(C-je-1);)Te++,je++;if(z[Ne]=Te,Te>v)xe+=2;else if(je>C)X+=2;else if(!J){var ve=O+ee-Be;if(ve>=0&&ve<D&&M[ve]!==-1){var pe=M[ve],ye=O+pe-ve;if(Te=v-Te,pe>=Te)return a(m,L,pe,ye)}}}}return[[n,m],[e,L]]}function a(m,L,v,C){var R=m.substring(0,v),O=L.substring(0,C),D=m.substring(v),M=L.substring(C),z=r(R,O),$=r(D,M);return z.concat($)}function l(m,L){if(!m||!L||m.charAt(0)!==L.charAt(0))return 0;for(var v=0,C=Math.min(m.length,L.length),R=C,O=0;v<R;)m.substring(O,R)==L.substring(O,R)?(v=R,O=v):C=R,R=Math.floor((C-v)/2+v);return k(m.charCodeAt(R-1))&&R--,R}function c(m,L){var v=m.length,C=L.length;if(v==0||C==0)return 0;v>C?m=m.substring(v-C):v<C&&(L=L.substring(0,v));var R=Math.min(v,C);if(m==L)return R;for(var O=0,D=1;;){var M=m.substring(R-D),z=L.indexOf(M);if(z==-1)return O;D+=z,(z==0||m.substring(R-D)==L.substring(0,D))&&(O=D,D++)}}function u(m,L){if(!m||!L||m.slice(-1)!==L.slice(-1))return 0;for(var v=0,C=Math.min(m.length,L.length),R=C,O=0;v<R;)m.substring(m.length-R,m.length-O)==L.substring(L.length-R,L.length-O)?(v=R,O=v):C=R,R=Math.floor((C-v)/2+v);return F(m.charCodeAt(m.length-R))&&R--,R}function f(m,L){var v=m.length>L.length?m:L,C=m.length>L.length?L:m;if(v.length<4||C.length*2<v.length)return null;function R(fe,X,xe){for(var Oe=fe.substring(xe,xe+Math.floor(fe.length/4)),ce=-1,ve="",pe,ye,Ne,Te;(ce=X.indexOf(Oe,ce+1))!==-1;){var Be=l(fe.substring(xe),X.substring(ce)),je=u(fe.substring(0,xe),X.substring(0,ce));ve.length<je+Be&&(ve=X.substring(ce-je,ce)+X.substring(ce,ce+Be),pe=fe.substring(0,xe-je),ye=fe.substring(xe+Be),Ne=X.substring(0,ce-je),Te=X.substring(ce+Be))}return ve.length*2>=fe.length?[pe,ye,Ne,Te,ve]:null}var O=R(v,C,Math.ceil(v.length/4)),D=R(v,C,Math.ceil(v.length/2)),M;if(!O&&!D)return null;D?O?M=O[4].length>D[4].length?O:D:M=D:M=O;var z,$,ee,J;m.length>L.length?(z=M[0],$=M[1],ee=M[2],J=M[3]):(ee=M[0],J=M[1],z=M[2],$=M[3]);var ae=M[4];return[z,$,ee,J,ae]}function g(m){for(var L=!1,v=[],C=0,R=null,O=0,D=0,M=0,z=0,$=0;O<m.length;)m[O][0]==t?(v[C++]=O,D=z,M=$,z=0,$=0,R=m[O][1]):(m[O][0]==e?z+=m[O][1].length:$+=m[O][1].length,R&&R.length<=Math.max(D,M)&&R.length<=Math.max(z,$)&&(m.splice(v[C-1],0,[n,R]),m[v[C-1]+1][0]=e,C--,C--,O=C>0?v[C-1]:-1,D=0,M=0,z=0,$=0,R=null,L=!0)),O++;for(L&&S(m),T(m),O=1;O<m.length;){if(m[O-1][0]==n&&m[O][0]==e){var ee=m[O-1][1],J=m[O][1],ae=c(ee,J),fe=c(J,ee);ae>=fe?(ae>=ee.length/2||ae>=J.length/2)&&(m.splice(O,0,[t,J.substring(0,ae)]),m[O-1][1]=ee.substring(0,ee.length-ae),m[O+1][1]=J.substring(ae),O++):(fe>=ee.length/2||fe>=J.length/2)&&(m.splice(O,0,[t,ee.substring(0,fe)]),m[O-1][0]=e,m[O-1][1]=J.substring(0,J.length-fe),m[O+1][0]=n,m[O+1][1]=ee.substring(fe),O++),O++}O++}}var h=/[^a-zA-Z0-9]/,p=/\s/,y=/[\r\n]/,_=/\n\r?\n$/,N=/^\r?\n\r?\n/;function T(m){function L(fe,X){if(!fe||!X)return 6;var xe=fe.charAt(fe.length-1),Oe=X.charAt(0),ce=xe.match(h),ve=Oe.match(h),pe=ce&&xe.match(p),ye=ve&&Oe.match(p),Ne=pe&&xe.match(y),Te=ye&&Oe.match(y),Be=Ne&&fe.match(_),je=Te&&X.match(N);return Be||je?5:Ne||Te?4:ce&&!pe&&ye?3:pe||ye?2:ce||ve?1:0}for(var v=1;v<m.length-1;){if(m[v-1][0]==t&&m[v+1][0]==t){var C=m[v-1][1],R=m[v][1],O=m[v+1][1],D=u(C,R);if(D){var M=R.substring(R.length-D);C=C.substring(0,C.length-D),R=M+R.substring(0,R.length-D),O=M+O}for(var z=C,$=R,ee=O,J=L(C,R)+L(R,O);R.charAt(0)===O.charAt(0);){C+=R.charAt(0),R=R.substring(1)+O.charAt(0),O=O.substring(1);var ae=L(C,R)+L(R,O);ae>=J&&(J=ae,z=C,$=R,ee=O)}m[v-1][1]!=z&&(z?m[v-1][1]=z:(m.splice(v-1,1),v--),m[v][1]=$,ee?m[v+1][1]=ee:(m.splice(v+1,1),v--))}v++}}function S(m,L){m.push([t,""]);for(var v=0,C=0,R=0,O="",D="",M;v<m.length;){if(v<m.length-1&&!m[v][1]){m.splice(v,1);continue}switch(m[v][0]){case e:R++,D+=m[v][1],v++;break;case n:C++,O+=m[v][1],v++;break;case t:var z=v-R-C-1;if(L){if(z>=0&&G(m[z][1])){var $=m[z][1].slice(-1);if(m[z][1]=m[z][1].slice(0,-1),O=$+O,D=$+D,!m[z][1]){m.splice(z,1),v--;var ee=z-1;m[ee]&&m[ee][0]===e&&(R++,D=m[ee][1]+D,ee--),m[ee]&&m[ee][0]===n&&(C++,O=m[ee][1]+O,ee--),z=ee}}if(B(m[v][1])){var $=m[v][1].charAt(0);m[v][1]=m[v][1].slice(1),O+=$,D+=$}}if(v<m.length-1&&!m[v][1]){m.splice(v,1);break}if(O.length>0||D.length>0){O.length>0&&D.length>0&&(M=l(D,O),M!==0&&(z>=0?m[z][1]+=D.substring(0,M):(m.splice(0,0,[t,D.substring(0,M)]),v++),D=D.substring(M),O=O.substring(M)),M=u(D,O),M!==0&&(m[v][1]=D.substring(D.length-M)+m[v][1],D=D.substring(0,D.length-M),O=O.substring(0,O.length-M)));var J=R+C;O.length===0&&D.length===0?(m.splice(v-J,J),v=v-J):O.length===0?(m.splice(v-J,J,[e,D]),v=v-J+1):D.length===0?(m.splice(v-J,J,[n,O]),v=v-J+1):(m.splice(v-J,J,[n,O],[e,D]),v=v-J+2)}v!==0&&m[v-1][0]===t?(m[v-1][1]+=m[v][1],m.splice(v,1)):v++,R=0,C=0,O="",D="";break}}m[m.length-1][1]===""&&m.pop();var ae=!1;for(v=1;v<m.length-1;)m[v-1][0]===t&&m[v+1][0]===t&&(m[v][1].substring(m[v][1].length-m[v-1][1].length)===m[v-1][1]?(m[v][1]=m[v-1][1]+m[v][1].substring(0,m[v][1].length-m[v-1][1].length),m[v+1][1]=m[v-1][1]+m[v+1][1],m.splice(v-1,1),ae=!0):m[v][1].substring(0,m[v+1][1].length)==m[v+1][1]&&(m[v-1][1]+=m[v+1][1],m[v][1]=m[v][1].substring(m[v+1][1].length)+m[v+1][1],m.splice(v+1,1),ae=!0)),v++;ae&&S(m,L)}function k(m){return m>=55296&&m<=56319}function F(m){return m>=56320&&m<=57343}function B(m){return F(m.charCodeAt(0))}function G(m){return k(m.charCodeAt(m.length-1))}function he(m){for(var L=[],v=0;v<m.length;v++)m[v][1].length>0&&L.push(m[v]);return L}function P(m,L,v,C){return G(m)||B(C)?null:he([[t,m],[n,L],[e,v],[t,C]])}function se(m,L,v){var C=typeof v=="number"?{index:v,length:0}:v.oldRange,R=typeof v=="number"?null:v.newRange,O=m.length,D=L.length;if(C.length===0&&(R===null||R.length===0)){var M=C.index,z=m.slice(0,M),$=m.slice(M),ee=R?R.index:null;e:{var J=M+D-O;if(ee!==null&&ee!==J||J<0||J>D)break e;var ae=L.slice(0,J),fe=L.slice(J);if(fe!==$)break e;var X=Math.min(M,J),xe=z.slice(0,X),Oe=ae.slice(0,X);if(xe!==Oe)break e;var ce=z.slice(X),ve=ae.slice(X);return P(xe,ce,ve,$)}e:{if(ee!==null&&ee!==M)break e;var pe=M,ae=L.slice(0,pe),fe=L.slice(pe);if(ae!==z)break e;var ye=Math.min(O-pe,D-pe),Ne=$.slice($.length-ye),Te=fe.slice(fe.length-ye);if(Ne!==Te)break e;var ce=$.slice(0,$.length-ye),ve=fe.slice(0,fe.length-ye);return P(z,ce,ve,Ne)}}if(C.length>0&&R&&R.length===0)e:{var xe=m.slice(0,C.index),Ne=m.slice(C.index+C.length),X=xe.length,ye=Ne.length;if(D<X+ye)break e;var Oe=L.slice(0,X),Te=L.slice(D-ye);if(xe!==Oe||Ne!==Te)break e;var ce=m.slice(X,O-ye),ve=L.slice(X,D-ye);return P(xe,ce,ve,Ne)}return null}function ie(m,L,v,C){return r(m,L,v,C,!0)}return ie.INSERT=e,ie.DELETE=n,ie.EQUAL=t,Fs=ie,Fs}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]",g="[object GeneratorFunction]",h="[object Map]",p="[object Number]",y="[object Object]",_="[object Promise]",N="[object RegExp]",T="[object Set]",S="[object String]",k="[object Symbol]",F="[object WeakMap]",B="[object ArrayBuffer]",G="[object DataView]",he="[object Float32Array]",P="[object Float64Array]",se="[object Int8Array]",ie="[object Int16Array]",m="[object Int32Array]",L="[object Uint8Array]",v="[object Uint8ClampedArray]",C="[object Uint16Array]",R="[object Uint32Array]",O=/[\\^$.*+?()[\]{}|]/g,D=/\w*$/,M=/^\[object .+?Constructor\]$/,z=/^(?:0|[1-9]\d*)$/,$={};$[i]=$[a]=$[B]=$[G]=$[l]=$[c]=$[he]=$[P]=$[se]=$[ie]=$[m]=$[h]=$[p]=$[y]=$[N]=$[T]=$[S]=$[k]=$[L]=$[v]=$[C]=$[R]=!0,$[u]=$[f]=$[F]=!1;var ee=typeof cn=="object"&&cn&&cn.Object===Object&&cn,J=typeof self=="object"&&self&&self.Object===Object&&self,ae=ee||J||Function("return this")(),fe=e&&!e.nodeType&&e,X=fe&&!0&&n&&!n.nodeType&&n,xe=X&&X.exports===fe;function Oe(o,d){return o.set(d[0],d[1]),o}function ce(o,d){return o.add(d),o}function ve(o,d){for(var E=-1,w=o?o.length:0;++E<w&&d(o[E],E,o)!==!1;);return o}function pe(o,d){for(var E=-1,w=d.length,le=o.length;++E<w;)o[le+E]=d[E];return o}function ye(o,d,E,w){for(var le=-1,Q=o?o.length:0;++le<Q;)E=d(E,o[le],le,o);return E}function Ne(o,d){for(var E=-1,w=Array(o);++E<o;)w[E]=d(E);return w}function Te(o,d){return o?.[d]}function Be(o){var d=!1;if(o!=null&&typeof o.toString!="function")try{d=!!(o+"")}catch{}return d}function je(o){var d=-1,E=Array(o.size);return o.forEach((function(w,le){E[++d]=[le,w]})),E}function En(o,d){return function(E){return o(d(E))}}function Fn(o){var d=-1,E=Array(o.size);return o.forEach((function(w){E[++d]=w})),E}var ur=Array.prototype,dr=Function.prototype,Ut=Object.prototype,yn=ae["__core-js_shared__"],Hn=function(){var o=/[^.]+$/.exec(yn&&yn.keys&&yn.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),_n=dr.toString,Ke=Ut.hasOwnProperty,Ft=Ut.toString,Ct=RegExp("^"+_n.call(Ke).replace(O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),lt=xe?ae.Buffer:void 0,Ht=ae.Symbol,vn=ae.Uint8Array,rt=En(Object.getPrototypeOf,Object),zn=Object.create,jn=Ut.propertyIsEnumerable,hr=ur.splice,Xt=Object.getOwnPropertySymbols,Jt=lt?lt.isBuffer:void 0,Kn=En(Object.keys,Object),en=et(ae,"DataView"),Et=et(ae,"Map"),st=et(ae,"Promise"),zt=et(ae,"Set"),Nn=et(ae,"WeakMap"),Rt=et(Object,"create"),ct=H(en),b=H(Et),x=H(st),q=H(zt),ne=H(Nn),Ae=Ht?Ht.prototype:void 0,Le=Ae?Ae.valueOf:void 0;function j(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 K(){this.__data__=Rt?Rt(null):{}}function re(o){return this.has(o)&&delete this.__data__[o]}function $e(o){var d=this.__data__;if(Rt){var E=d[o];return E===r?void 0:E}return Ke.call(d,o)?d[o]:void 0}function Re(o){var d=this.__data__;return Rt?d[o]!==void 0:Ke.call(d,o)}function yt(o,d){var E=this.__data__;return E[o]=Rt&&d===void 0?r:d,this}j.prototype.clear=K,j.prototype.delete=re,j.prototype.get=$e,j.prototype.has=Re,j.prototype.set=yt;function qe(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 Tn(){this.__data__=[]}function fr(o){var d=this.__data__,E=I(d,o);if(E<0)return!1;var w=d.length-1;return E==w?d.pop():hr.call(d,E,1),!0}function An(o){var d=this.__data__,E=I(d,o);return E<0?void 0:d[E][1]}function gr(o){return I(this.__data__,o)>-1}function pr(o,d){var E=this.__data__,w=I(E,o);return w<0?E.push([o,d]):E[w][1]=d,this}qe.prototype.clear=Tn,qe.prototype.delete=fr,qe.prototype.get=An,qe.prototype.has=gr,qe.prototype.set=pr;function Ge(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 Gn(){this.__data__={hash:new j,map:new(Et||qe),string:new j}}function tn(o){return jt(this,o).delete(o)}function mr(o){return jt(this,o).get(o)}function br(o){return jt(this,o).has(o)}function Er(o,d){return jt(this,o).set(o,d),this}Ge.prototype.clear=Gn,Ge.prototype.delete=tn,Ge.prototype.get=mr,Ge.prototype.has=br,Ge.prototype.set=Er;function ke(o){this.__data__=new qe(o)}function Vn(){this.__data__=new qe}function Zn(o){return this.__data__.delete(o)}function yr(o){return this.__data__.get(o)}function _r(o){return this.__data__.has(o)}function vr(o,d){var E=this.__data__;if(E instanceof qe){var w=E.__data__;if(!Et||w.length<t-1)return w.push([o,d]),this;E=this.__data__=new Ge(w)}return E.set(o,d),this}ke.prototype.clear=Vn,ke.prototype.delete=Zn,ke.prototype.get=yr,ke.prototype.has=_r,ke.prototype.set=vr;function _t(o,d){var E=tt(o)||De(o)?Ne(o.length,String):[],w=E.length,le=!!w;for(var Q in o)Ke.call(o,Q)&&!(le&&(Q=="length"||vt(Q,w)))&&E.push(Q);return E}function Wn(o,d,E){var w=o[d];(!(Ke.call(o,d)&&me(w,E))||E===void 0&&!(d in o))&&(o[d]=E)}function I(o,d){for(var E=o.length;E--;)if(me(o[E][0],d))return E;return-1}function V(o,d){return o&&kt(d,Or(d),o)}function de(o,d,E,w,le,Q,_e){var Ee;if(w&&(Ee=Q?w(o,le,Q,_e):w(o)),Ee!==void 0)return Ee;if(!Mt(o))return o;var Fe=tt(o);if(Fe){if(Ee=Pe(o),!d)return wr(o,Ee)}else{var Se=dt(o),Ye=Se==f||Se==g;if(Wr(o))return Ue(o,d);if(Se==y||Se==i||Ye&&!Q){if(Be(o))return Q?o:{};if(Ee=ge(Ye?{}:o),!d)return Yn(o,V(Ee,o))}else{if(!$[Se])return Q?o:{};Ee=rn(o,Se,de,d)}}_e||(_e=new ke);var at=_e.get(o);if(at)return at;if(_e.set(o,Ee),!Fe)var He=E?it(o):Or(o);return ve(He||o,(function(Qe,Ve){He&&(Ve=Qe,Qe=o[Ve]),Wn(Ee,Ve,de(Qe,d,E,w,Ve,o,_e))})),Ee}function we(o){return Mt(o)?zn(o):{}}function Me(o,d,E){var w=d(o);return tt(o)?w:pe(w,E(o))}function Je(o){return Ft.call(o)}function ut(o){if(!Mt(o)||On(o))return!1;var d=xr(o)||Be(o)?Ct:M;return d.test(H(o))}function nn(o){if(!U(o))return Kn(o);var d=[];for(var E in Object(o))Ke.call(o,E)&&E!="constructor"&&d.push(E);return d}function Ue(o,d){if(d)return o.slice();var E=new o.constructor(o.length);return o.copy(E),E}function We(o){var d=new o.constructor(o.byteLength);return new vn(d).set(new vn(o)),d}function It(o,d){var E=d?We(o.buffer):o.buffer;return new o.constructor(E,o.byteOffset,o.byteLength)}function wn(o,d,E){var w=d?E(je(o),!0):je(o);return ye(w,Oe,new o.constructor)}function Sn(o){var d=new o.constructor(o.source,D.exec(o));return d.lastIndex=o.lastIndex,d}function Nr(o,d,E){var w=d?E(Fn(o),!0):Fn(o);return ye(w,ce,new o.constructor)}function Tr(o){return Le?Object(Le.call(o)):{}}function Ar(o,d){var E=d?We(o.buffer):o.buffer;return new o.constructor(E,o.byteOffset,o.length)}function wr(o,d){var E=-1,w=o.length;for(d||(d=Array(w));++E<w;)d[E]=o[E];return d}function kt(o,d,E,w){E||(E={});for(var le=-1,Q=d.length;++le<Q;){var _e=d[le],Ee=void 0;Wn(E,_e,Ee===void 0?o[_e]:Ee)}return E}function Yn(o,d){return kt(o,te(o),d)}function it(o){return Me(o,Or,te)}function jt(o,d){var E=o.__data__;return xn(d)?E[typeof d=="string"?"string":"hash"]:E.map}function et(o,d){var E=Te(o,d);return ut(E)?E:void 0}var te=Xt?En(Xt,Object):Ms,dt=Je;(en&&dt(new en(new ArrayBuffer(1)))!=G||Et&&dt(new Et)!=h||st&&dt(st.resolve())!=_||zt&&dt(new zt)!=T||Nn&&dt(new Nn)!=F)&&(dt=function(o){var d=Ft.call(o),E=d==y?o.constructor:void 0,w=E?H(E):void 0;if(w)switch(w){case ct:return G;case b:return h;case x:return _;case q:return T;case ne:return F}return d});function Pe(o){var d=o.length,E=o.constructor(d);return d&&typeof o[0]=="string"&&Ke.call(o,"index")&&(E.index=o.index,E.input=o.input),E}function ge(o){return typeof o.constructor=="function"&&!U(o)?we(rt(o)):{}}function rn(o,d,E,w){var le=o.constructor;switch(d){case B:return We(o);case l:case c:return new le(+o);case G:return It(o,w);case he:case P:case se:case ie:case m:case L:case v:case C:case R:return Ar(o,w);case h:return wn(o,w,E);case p:case S:return new le(o);case N:return Sn(o);case T:return Nr(o,w,E);case k:return Tr(o)}}function vt(o,d){return d=d??s,!!d&&(typeof o=="number"||z.test(o))&&o>-1&&o%1==0&&o<d}function xn(o){var d=typeof o;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?o!=="__proto__":o===null}function On(o){return!!Hn&&Hn in o}function U(o){var d=o&&o.constructor,E=typeof d=="function"&&d.prototype||Ut;return o===E}function H(o){if(o!=null){try{return _n.call(o)}catch{}try{return o+""}catch{}}return""}function oe(o){return de(o,!0,!0)}function me(o,d){return o===d||o!==o&&d!==d}function De(o){return Sr(o)&&Ke.call(o,"callee")&&(!jn.call(o,"callee")||Ft.call(o)==i)}var tt=Array.isArray;function sn(o){return o!=null&&Yr(o.length)&&!xr(o)}function Sr(o){return Qr(o)&&sn(o)}var Wr=Jt||Ds;function xr(o){var d=Mt(o)?Ft.call(o):"";return d==f||d==g}function Yr(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=s}function Mt(o){var d=typeof o;return!!o&&(d=="object"||d=="function")}function Qr(o){return!!o&&typeof o=="object"}function Or(o){return sn(o)?_t(o):nn(o)}function Ms(){return[]}function Ds(){return!1}n.exports=oe}(Rr,Rr.exports)),Rr.exports}var Ir={exports:{}};Ir.exports;var Ea;function ko(){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]",g="[object Date]",h="[object Error]",p="[object Function]",y="[object GeneratorFunction]",_="[object Map]",N="[object Number]",T="[object Null]",S="[object Object]",k="[object Promise]",F="[object Proxy]",B="[object RegExp]",G="[object Set]",he="[object String]",P="[object Symbol]",se="[object Undefined]",ie="[object WeakMap]",m="[object ArrayBuffer]",L="[object DataView]",v="[object Float32Array]",C="[object Float64Array]",R="[object Int8Array]",O="[object Int16Array]",D="[object Int32Array]",M="[object Uint8Array]",z="[object Uint8ClampedArray]",$="[object Uint16Array]",ee="[object Uint32Array]",J=/[\\^$.*+?()[\]{}|]/g,ae=/^\[object .+?Constructor\]$/,fe=/^(?:0|[1-9]\d*)$/,X={};X[v]=X[C]=X[R]=X[O]=X[D]=X[M]=X[z]=X[$]=X[ee]=!0,X[l]=X[c]=X[m]=X[f]=X[L]=X[g]=X[h]=X[p]=X[_]=X[N]=X[S]=X[B]=X[G]=X[he]=X[ie]=!1;var xe=typeof cn=="object"&&cn&&cn.Object===Object&&cn,Oe=typeof self=="object"&&self&&self.Object===Object&&self,ce=xe||Oe||Function("return this")(),ve=e&&!e.nodeType&&e,pe=ve&&!0&&n&&!n.nodeType&&n,ye=pe&&pe.exports===ve,Ne=ye&&xe.process,Te=function(){try{return Ne&&Ne.binding&&Ne.binding("util")}catch{}}(),Be=Te&&Te.isTypedArray;function je(o,d){for(var E=-1,w=o==null?0:o.length,le=0,Q=[];++E<w;){var _e=o[E];d(_e,E,o)&&(Q[le++]=_e)}return Q}function En(o,d){for(var E=-1,w=d.length,le=o.length;++E<w;)o[le+E]=d[E];return o}function Fn(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 ur(o,d){for(var E=-1,w=Array(o);++E<o;)w[E]=d(E);return w}function dr(o){return function(d){return o(d)}}function Ut(o,d){return o.has(d)}function yn(o,d){return o?.[d]}function Hn(o){var d=-1,E=Array(o.size);return o.forEach((function(w,le){E[++d]=[le,w]})),E}function _n(o,d){return function(E){return o(d(E))}}function Ke(o){var d=-1,E=Array(o.size);return o.forEach((function(w){E[++d]=w})),E}var Ft=Array.prototype,Ct=Function.prototype,lt=Object.prototype,Ht=ce["__core-js_shared__"],vn=Ct.toString,rt=lt.hasOwnProperty,zn=function(){var o=/[^.]+$/.exec(Ht&&Ht.keys&&Ht.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),jn=lt.toString,hr=RegExp("^"+vn.call(rt).replace(J,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Xt=ye?ce.Buffer:void 0,Jt=ce.Symbol,Kn=ce.Uint8Array,en=lt.propertyIsEnumerable,Et=Ft.splice,st=Jt?Jt.toStringTag:void 0,zt=Object.getOwnPropertySymbols,Nn=Xt?Xt.isBuffer:void 0,Rt=_n(Object.keys,Object),ct=te(ce,"DataView"),b=te(ce,"Map"),x=te(ce,"Promise"),q=te(ce,"Set"),ne=te(ce,"WeakMap"),Ae=te(Object,"create"),Le=H(ct),j=H(b),K=H(x),re=H(q),$e=H(ne),Re=Jt?Jt.prototype:void 0,yt=Re?Re.valueOf:void 0;function qe(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 Tn(){this.__data__=Ae?Ae(null):{},this.size=0}function fr(o){var d=this.has(o)&&delete this.__data__[o];return this.size-=d?1:0,d}function An(o){var d=this.__data__;if(Ae){var E=d[o];return E===r?void 0:E}return rt.call(d,o)?d[o]:void 0}function gr(o){var d=this.__data__;return Ae?d[o]!==void 0:rt.call(d,o)}function pr(o,d){var E=this.__data__;return this.size+=this.has(o)?0:1,E[o]=Ae&&d===void 0?r:d,this}qe.prototype.clear=Tn,qe.prototype.delete=fr,qe.prototype.get=An,qe.prototype.has=gr,qe.prototype.set=pr;function Ge(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 Gn(){this.__data__=[],this.size=0}function tn(o){var d=this.__data__,E=Ue(d,o);if(E<0)return!1;var w=d.length-1;return E==w?d.pop():Et.call(d,E,1),--this.size,!0}function mr(o){var d=this.__data__,E=Ue(d,o);return E<0?void 0:d[E][1]}function br(o){return Ue(this.__data__,o)>-1}function Er(o,d){var E=this.__data__,w=Ue(E,o);return w<0?(++this.size,E.push([o,d])):E[w][1]=d,this}Ge.prototype.clear=Gn,Ge.prototype.delete=tn,Ge.prototype.get=mr,Ge.prototype.has=br,Ge.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.size=0,this.__data__={hash:new qe,map:new(b||Ge),string:new qe}}function Zn(o){var d=et(this,o).delete(o);return this.size-=d?1:0,d}function yr(o){return et(this,o).get(o)}function _r(o){return et(this,o).has(o)}function vr(o,d){var E=et(this,o),w=E.size;return E.set(o,d),this.size+=E.size==w?0:1,this}ke.prototype.clear=Vn,ke.prototype.delete=Zn,ke.prototype.get=yr,ke.prototype.has=_r,ke.prototype.set=vr;function _t(o){var d=-1,E=o==null?0:o.length;for(this.__data__=new ke;++d<E;)this.add(o[d])}function Wn(o){return this.__data__.set(o,r),this}function I(o){return this.__data__.has(o)}_t.prototype.add=_t.prototype.push=Wn,_t.prototype.has=I;function V(o){var d=this.__data__=new Ge(o);this.size=d.size}function de(){this.__data__=new Ge,this.size=0}function we(o){var d=this.__data__,E=d.delete(o);return this.size=d.size,E}function Me(o){return this.__data__.get(o)}function Je(o){return this.__data__.has(o)}function ut(o,d){var E=this.__data__;if(E instanceof Ge){var w=E.__data__;if(!b||w.length<t-1)return w.push([o,d]),this.size=++E.size,this;E=this.__data__=new ke(w)}return E.set(o,d),this.size=E.size,this}V.prototype.clear=de,V.prototype.delete=we,V.prototype.get=Me,V.prototype.has=Je,V.prototype.set=ut;function nn(o,d){var E=De(o),w=!E&&me(o),le=!E&&!w&&sn(o),Q=!E&&!w&&!le&&Qr(o),_e=E||w||le||Q,Ee=_e?ur(o.length,String):[],Fe=Ee.length;for(var Se in o)rt.call(o,Se)&&!(_e&&(Se=="length"||le&&(Se=="offset"||Se=="parent")||Q&&(Se=="buffer"||Se=="byteLength"||Se=="byteOffset")||rn(Se,Fe)))&&Ee.push(Se);return Ee}function Ue(o,d){for(var E=o.length;E--;)if(oe(o[E][0],d))return E;return-1}function We(o,d,E){var w=d(o);return De(o)?w:En(w,E(o))}function It(o){return o==null?o===void 0?se:T:st&&st in Object(o)?dt(o):U(o)}function wn(o){return Mt(o)&&It(o)==l}function Sn(o,d,E,w,le){return o===d?!0:o==null||d==null||!Mt(o)&&!Mt(d)?o!==o&&d!==d:Nr(o,d,E,w,Sn,le)}function Nr(o,d,E,w,le,Q){var _e=De(o),Ee=De(d),Fe=_e?c:ge(o),Se=Ee?c:ge(d);Fe=Fe==l?S:Fe,Se=Se==l?S:Se;var Ye=Fe==S,at=Se==S,He=Fe==Se;if(He&&sn(o)){if(!sn(d))return!1;_e=!0,Ye=!1}if(He&&!Ye)return Q||(Q=new V),_e||Qr(o)?kt(o,d,E,w,le,Q):Yn(o,d,Fe,E,w,le,Q);if(!(E&s)){var Qe=Ye&&rt.call(o,"__wrapped__"),Ve=at&&rt.call(d,"__wrapped__");if(Qe||Ve){var an=Qe?o.value():o,Kt=Ve?d.value():d;return Q||(Q=new V),le(an,Kt,E,w,Q)}}return He?(Q||(Q=new V),it(o,d,E,w,le,Q)):!1}function Tr(o){if(!Yr(o)||xn(o))return!1;var d=Wr(o)?hr:ae;return d.test(H(o))}function Ar(o){return Mt(o)&&xr(o.length)&&!!X[It(o)]}function wr(o){if(!On(o))return Rt(o);var d=[];for(var E in Object(o))rt.call(o,E)&&E!="constructor"&&d.push(E);return d}function kt(o,d,E,w,le,Q){var _e=E&s,Ee=o.length,Fe=d.length;if(Ee!=Fe&&!(_e&&Fe>Ee))return!1;var Se=Q.get(o);if(Se&&Q.get(d))return Se==d;var Ye=-1,at=!0,He=E&i?new _t:void 0;for(Q.set(o,d),Q.set(d,o);++Ye<Ee;){var Qe=o[Ye],Ve=d[Ye];if(w)var an=_e?w(Ve,Qe,Ye,d,o,Q):w(Qe,Ve,Ye,o,d,Q);if(an!==void 0){if(an)continue;at=!1;break}if(He){if(!Fn(d,(function(Kt,Ln){if(!Ut(He,Ln)&&(Qe===Kt||le(Qe,Kt,E,w,Q)))return He.push(Ln)}))){at=!1;break}}else if(!(Qe===Ve||le(Qe,Ve,E,w,Q))){at=!1;break}}return Q.delete(o),Q.delete(d),at}function Yn(o,d,E,w,le,Q,_e){switch(E){case L:if(o.byteLength!=d.byteLength||o.byteOffset!=d.byteOffset)return!1;o=o.buffer,d=d.buffer;case m:return!(o.byteLength!=d.byteLength||!Q(new Kn(o),new Kn(d)));case f:case g:case N:return oe(+o,+d);case h:return o.name==d.name&&o.message==d.message;case B:case he:return o==d+"";case _:var Ee=Hn;case G:var Fe=w&s;if(Ee||(Ee=Ke),o.size!=d.size&&!Fe)return!1;var Se=_e.get(o);if(Se)return Se==d;w|=i,_e.set(o,d);var Ye=kt(Ee(o),Ee(d),w,le,Q,_e);return _e.delete(o),Ye;case P:if(yt)return yt.call(o)==yt.call(d)}return!1}function it(o,d,E,w,le,Q){var _e=E&s,Ee=jt(o),Fe=Ee.length,Se=jt(d),Ye=Se.length;if(Fe!=Ye&&!_e)return!1;for(var at=Fe;at--;){var He=Ee[at];if(!(_e?He in d:rt.call(d,He)))return!1}var Qe=Q.get(o);if(Qe&&Q.get(d))return Qe==d;var Ve=!0;Q.set(o,d),Q.set(d,o);for(var an=_e;++at<Fe;){He=Ee[at];var Kt=o[He],Ln=d[He];if(w)var Pi=_e?w(Ln,Kt,He,d,o,Q):w(Kt,Ln,He,o,d,Q);if(!(Pi===void 0?Kt===Ln||le(Kt,Ln,E,w,Q):Pi)){Ve=!1;break}an||(an=He=="constructor")}if(Ve&&!an){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)&&(Ve=!1)}return Q.delete(o),Q.delete(d),Ve}function jt(o){return We(o,Or,Pe)}function et(o,d){var E=o.__data__;return vt(d)?E[typeof d=="string"?"string":"hash"]:E.map}function te(o,d){var E=yn(o,d);return Tr(E)?E:void 0}function dt(o){var d=rt.call(o,st),E=o[st];try{o[st]=void 0;var w=!0}catch{}var le=jn.call(o);return w&&(d?o[st]=E:delete o[st]),le}var Pe=zt?function(o){return o==null?[]:(o=Object(o),je(zt(o),(function(d){return en.call(o,d)})))}:Ms,ge=It;(ct&&ge(new ct(new ArrayBuffer(1)))!=L||b&&ge(new b)!=_||x&&ge(x.resolve())!=k||q&&ge(new q)!=G||ne&&ge(new ne)!=ie)&&(ge=function(o){var d=It(o),E=d==S?o.constructor:void 0,w=E?H(E):"";if(w)switch(w){case Le:return L;case j:return _;case K:return k;case re:return G;case $e:return ie}return d});function rn(o,d){return d=d??a,!!d&&(typeof o=="number"||fe.test(o))&&o>-1&&o%1==0&&o<d}function vt(o){var d=typeof o;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?o!=="__proto__":o===null}function xn(o){return!!zn&&zn in o}function On(o){var d=o&&o.constructor,E=typeof d=="function"&&d.prototype||lt;return o===E}function U(o){return jn.call(o)}function H(o){if(o!=null){try{return vn.call(o)}catch{}try{return o+""}catch{}}return""}function oe(o,d){return o===d||o!==o&&d!==d}var me=wn(function(){return arguments}())?wn:function(o){return Mt(o)&&rt.call(o,"callee")&&!en.call(o,"callee")},De=Array.isArray;function tt(o){return o!=null&&xr(o.length)&&!Wr(o)}var sn=Nn||Ds;function Sr(o,d){return Sn(o,d)}function Wr(o){if(!Yr(o))return!1;var d=It(o);return d==p||d==y||d==u||d==F}function xr(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 Mt(o){return o!=null&&typeof o=="object"}var Qr=Be?dr(Be):Ar;function Or(o){return tt(o)?nn(o):wr(o)}function Ms(){return[]}function Ds(){return!1}n.exports=Sr}(Ir,Ir.exports)),Ir.exports}var ns={},ya;function pf(){if(ya)return ns;ya=1,Object.defineProperty(ns,"__esModule",{value:!0});const n=Io(),e=ko();var t;return function(r){function s(c={},u={},f=!1){typeof c!="object"&&(c={}),typeof u!="object"&&(u={});let g=n(u);f||(g=Object.keys(g).reduce(((h,p)=>(g[p]!=null&&(h[p]=g[p]),h)),{}));for(const h in c)c[h]!==void 0&&u[h]===void 0&&(g[h]=c[h]);return Object.keys(g).length>0?g: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(((g,h)=>(e(c[h],u[h])||(g[h]=u[h]===void 0?null:u[h]),g)),{});return Object.keys(f).length>0?f:void 0}r.diff=i;function a(c={},u={}){c=c||{};const f=Object.keys(u).reduce(((g,h)=>(u[h]!==c[h]&&c[h]!==void 0&&(g[h]=u[h]),g)),{});return Object.keys(c).reduce(((g,h)=>(c[h]!==u[h]&&u[h]===void 0&&(g[h]=null),g)),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 g=Object.keys(u).reduce(((h,p)=>(c[p]===void 0&&(h[p]=u[p]),h)),{});return Object.keys(g).length>0?g:void 0}r.transform=l}(t||(t={})),ns.default=t,ns}var rs={},_a;function Mo(){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 mf(){if(va)return ss;va=1,Object.defineProperty(ss,"__esModule",{value:!0});const n=Mo();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 bf(){return Na||(Na=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=gf(),r=Io(),s=ko(),i=pf();e.AttributeMap=i.default;const a=Mo();e.Op=a.default;const l=mf();e.OpIterator=l.default;const c="\0",u=(g,h)=>{if(typeof g!="object"||g===null)throw new Error(`cannot retain a ${typeof g}`);if(typeof h!="object"||h===null)throw new Error(`cannot retain a ${typeof h}`);const p=Object.keys(g)[0];if(!p||p!==Object.keys(h)[0])throw new Error(`embed types not matched: ${p} != ${Object.keys(h)[0]}`);return[p,g[p],h[p]]};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,p){this.handlers[h]=p}static unregisterEmbed(h){delete this.handlers[h]}static getHandler(h){const p=this.handlers[h];if(!p)throw new Error(`no handlers for embed type "${h}"`);return p}insert(h,p){const y={};return typeof h=="string"&&h.length===0?this:(y.insert=h,p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(y.attributes=p),this.push(y))}delete(h){return h<=0?this:this.push({delete:h})}retain(h,p){if(typeof h=="number"&&h<=0)return this;const y={retain:h};return p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(y.attributes=p),this.push(y)}push(h){let p=this.ops.length,y=this.ops[p-1];if(h=r(h),typeof y=="object"){if(typeof h.delete=="number"&&typeof y.delete=="number")return this.ops[p-1]={delete:y.delete+h.delete},this;if(typeof y.delete=="number"&&h.insert!=null&&(p-=1,y=this.ops[p-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[p-1]={insert:y.insert+h.insert},typeof h.attributes=="object"&&(this.ops[p-1].attributes=h.attributes),this;if(typeof h.retain=="number"&&typeof y.retain=="number")return this.ops[p-1]={retain:y.retain+h.retain},typeof h.attributes=="object"&&(this.ops[p-1].attributes=h.attributes),this}}return p===this.ops.length?this.ops.push(h):this.ops.splice(p,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 p=[],y=[];return this.forEach((_=>{(h(_)?p:y).push(_)})),[p,y]}reduce(h,p){return this.ops.reduce(h,p)}changeLength(){return this.reduce(((h,p)=>p.insert?h+a.default.length(p):p.delete?h-p.delete:h),0)}length(){return this.reduce(((h,p)=>h+a.default.length(p)),0)}slice(h=0,p=1/0){const y=[],_=new l.default(this.ops);let N=0;for(;N<p&&_.hasNext();){let T;N<h?T=_.next(h-N):(T=_.next(p-N),y.push(T)),N+=a.default.length(T)}return new f(y)}compose(h){const p=new l.default(this.ops),y=new l.default(h.ops),_=[],N=y.peek();if(N!=null&&typeof N.retain=="number"&&N.attributes==null){let S=N.retain;for(;p.peekType()==="insert"&&p.peekLength()<=S;)S-=p.peekLength(),_.push(p.next());N.retain-S>0&&y.next(N.retain-S)}const T=new f(_);for(;p.hasNext()||y.hasNext();)if(y.peekType()==="insert")T.push(y.next());else if(p.peekType()==="delete")T.push(p.next());else{const S=Math.min(p.peekLength(),y.peekLength()),k=p.next(S),F=y.next(S);if(F.retain){const B={};if(typeof k.retain=="number")B.retain=typeof F.retain=="number"?S:F.retain;else if(typeof F.retain=="number")k.retain==null?B.insert=k.insert:B.retain=k.retain;else{const he=k.retain==null?"insert":"retain",[P,se,ie]=u(k[he],F.retain),m=f.getHandler(P);B[he]={[P]:m.compose(se,ie,he==="retain")}}const G=i.default.compose(k.attributes,F.attributes,typeof k.retain=="number");if(G&&(B.attributes=G),T.push(B),!y.hasNext()&&s(T.ops[T.ops.length-1],B)){const he=new f(p.rest());return T.concat(he).chop()}}else typeof F.delete=="number"&&(typeof k.retain=="number"||typeof k.retain=="object"&&k.retain!==null)&&T.push(F)}return T.chop()}concat(h){const p=new f(this.ops.slice());return h.ops.length>0&&(p.push(h.ops[0]),p.ops=p.ops.concat(h.ops.slice(1))),p}diff(h,p){if(this.ops===h.ops)return new f;const y=[this,h].map((k=>k.map((F=>{if(F.insert!=null)return typeof F.insert=="string"?F.insert:c;const B=k===h?"on":"with";throw new Error("diff() called "+B+" non-document")})).join(""))),_=new f,N=t(y[0],y[1],p,!0),T=new l.default(this.ops),S=new l.default(h.ops);return N.forEach((k=>{let F=k[1].length;for(;F>0;){let B=0;switch(k[0]){case t.INSERT:B=Math.min(S.peekLength(),F),_.push(S.next(B));break;case t.DELETE:B=Math.min(F,T.peekLength()),T.next(B),_.delete(B);break;case t.EQUAL:B=Math.min(T.peekLength(),S.peekLength(),F);const G=T.next(B),he=S.next(B);s(G.insert,he.insert)?_.retain(B,i.default.diff(G.attributes,he.attributes)):_.push(he).delete(B);break}F-=B}})),_.chop()}eachLine(h,p=`\n`){const y=new l.default(this.ops);let _=new f,N=0;for(;y.hasNext();){if(y.peekType()!=="insert")return;const T=y.peek(),S=a.default.length(T)-y.peekLength(),k=typeof T.insert=="string"?T.insert.indexOf(p,S)-S:-1;if(k<0)_.push(y.next());else if(k>0)_.push(y.next(k));else{if(h(_,y.next(1).attributes||{},N)===!1)return;N+=1,_=new f}}_.length()>0&&h(_,{},N)}invert(h){const p=new f;return this.reduce(((y,_)=>{if(_.insert)p.delete(a.default.length(_));else{if(typeof _.retain=="number"&&_.attributes==null)return p.retain(_.retain),y+_.retain;if(_.delete||typeof _.retain=="number"){const N=_.delete||_.retain;return h.slice(y,y+N).forEach((S=>{_.delete?p.push(S):_.retain&&_.attributes&&p.retain(a.default.length(S),i.default.invert(_.attributes,S.attributes))})),y+N}else if(typeof _.retain=="object"&&_.retain!==null){const N=h.slice(y,y+1),T=new l.default(N.ops).next(),[S,k,F]=u(_.retain,T.insert),B=f.getHandler(S);return p.retain({[S]:B.invert(k,F)},i.default.invert(_.attributes,T.attributes)),y+1}}return y}),0),p.chop()}transform(h,p=!1){if(p=!!p,typeof h=="number")return this.transformPosition(h,p);const y=h,_=new l.default(this.ops),N=new l.default(y.ops),T=new f;for(;_.hasNext()||N.hasNext();)if(_.peekType()==="insert"&&(p||N.peekType()!=="insert"))T.retain(a.default.length(_.next()));else if(N.peekType()==="insert")T.push(N.next());else{const S=Math.min(_.peekLength(),N.peekLength()),k=_.next(S),F=N.next(S);if(k.delete)continue;if(F.delete)T.push(F);else{const B=k.retain,G=F.retain;let he=typeof G=="object"&&G!==null?G:S;if(typeof B=="object"&&B!==null&&typeof G=="object"&&G!==null){const P=Object.keys(B)[0];if(P===Object.keys(G)[0]){const se=f.getHandler(P);se&&(he={[P]:se.transform(B[P],G[P],p)})}}T.retain(he,i.default.transform(k.attributes,F.attributes,p))}}return T.chop()}transformPosition(h,p=!1){p=!!p;const y=new l.default(this.ops);let _=0;for(;y.hasNext()&&_<=h;){const N=y.peekLength(),T=y.peekType();if(y.next(),T==="delete"){h-=Math.min(N,h-_);continue}else T==="insert"&&(_<h||!p)&&(h+=N);_+=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 bt=bf();const Z=Si(bt);class Lt extends ot{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Lt.blotName="break";Lt.tagName="BR";let xt=class extends ys{};const Ef={"&":"&","<":"<",">":">",'"':""","'":"'"};function Ls(n){return n.replace(/[&<>"']/g,(e=>Ef[e]))}let mn=class Cn extends Ai{static allowedChildren=[Cn,Lt,ot,xt];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(e,t){const r=Cn.order.indexOf(e),s=Cn.order.indexOf(t);return r>=0||s>=0?r-s:e===t?0:e<t?-1:1}formatAt(e,t,r,s){if(Cn.compare(this.statics.blotName,r)<0&&this.scroll.query(r,Y.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 Cn&&Cn.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 Pr{cache={};delta(){return this.cache.delta==null&&(this.cache.delta=Do(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,r,s){t<=0||(this.scroll.query(r,Y.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 Lt&&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=Lt;Ze.allowedChildren=[Lt,mn,ot,xt];let mt=class extends ot{attach(){super.attach(),this.attributes=new xs(this.domNode)}delta(){return(new Z).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const r=this.scroll.query(e,Y.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)}};mt.scope=Y.BLOCK_BLOT;function Do(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.descendants(Xe).reduce(((t,r)=>r.length()===0?t:t.insert(r.value(),gt(r,{},e))),new Z).insert(`\n`,gt(n))}function gt(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:gt(n.parent,e,t)}class At extends ot{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(At.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!==Y.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=At.CONTENTS.length,r.optimize(),r.formatAt(s,At.CONTENTS.length,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 xt?this.prev:null,r=t?t.length():0,s=this.next instanceof xt?this.next:null,i=s?s.text:"",{textNode:a}=this,l=a.data.split(At.CONTENTS).join("");a.data=At.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,p)=>t&&h===t.domNode?p:h===a?r+p-1:s&&h===s.domNode?r+l.length+p:null,f=u(e.start.node,e.start.offset),g=u(e.end.node,e.end.offset);if(f!==null&&g!==null)return{startNode:c.domNode,startOffset:f,endNode:c.domNode,endOffset:g}}return null}update(e,t){if(e.some((r=>r.type==="characterData"&&r.target===this.textNode))){const r=this.restore();r&&(t.range=r)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if(t.domNode.tagName==="A"){this.savedLength=At.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}}var Hs={exports:{}},Aa;function yf(){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,g,h){if(typeof f!="function")throw new TypeError("The listener must be a function");var p=new s(f,g||c,h),y=t?t+u:u;return c._events[y]?c._events[y].fn?c._events[y]=[c._events[y],p]:c._events[y].push(p):(c._events[y]=p,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,g;if(this._eventsCount===0)return u;for(g in f=this._events)e.call(f,g)&&u.push(t?g.slice(1):g);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=t?t+u:u,g=this._events[f];if(!g)return[];if(g.fn)return[g.fn];for(var h=0,p=g.length,y=new Array(p);h<p;h++)y[h]=g[h].fn;return y},l.prototype.listenerCount=function(u){var f=t?t+u:u,g=this._events[f];return g?g.fn?1:g.length:0},l.prototype.emit=function(u,f,g,h,p,y){var _=t?t+u:u;if(!this._events[_])return!1;var N=this._events[_],T=arguments.length,S,k;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,g),!0;case 4:return N.fn.call(N.context,f,g,h),!0;case 5:return N.fn.call(N.context,f,g,h,p),!0;case 6:return N.fn.call(N.context,f,g,h,p,y),!0}for(k=1,S=new Array(T-1);k<T;k++)S[k-1]=arguments[k];N.fn.apply(N.context,S)}else{var F=N.length,B;for(k=0;k<F;k++)switch(N[k].once&&this.removeListener(u,N[k].fn,void 0,!0),T){case 1:N[k].fn.call(N[k].context);break;case 2:N[k].fn.call(N[k].context,f);break;case 3:N[k].fn.call(N[k].context,f,g);break;case 4:N[k].fn.call(N[k].context,f,g,h);break;default:if(!S)for(B=1,S=new Array(T-1);B<T;B++)S[B-1]=arguments[B];N[k].fn.apply(N[k].context,S)}}return!0},l.prototype.on=function(u,f,g){return i(this,u,f,g,!1)},l.prototype.once=function(u,f,g){return i(this,u,f,g,!0)},l.prototype.removeListener=function(u,f,g,h){var p=t?t+u:u;if(!this._events[p])return this;if(!f)return a(this,p),this;var y=this._events[p];if(y.fn)y.fn===f&&(!h||y.once)&&(!g||y.context===g)&&a(this,p);else{for(var _=0,N=[],T=y.length;_<T;_++)(y[_].fn!==f||h&&!y[_].once||g&&y[_].context!==g)&&N.push(y[_]);N.length?this._events[p]=N.length===1?N[0]:N:a(this,p)}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}(Hs)),Hs.exports}var _f=yf();const vf=Si(_f),di=new WeakMap,hi=["error","warn","log","info"];let fi="warn";function Bo(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 Qt(n){return hi.reduce(((e,t)=>(e[t]=Bo.bind(console,t,n),e)),{})}Qt.level=n=>{fi=n};Bo.level=Qt.level;const zs=Qt("quill:events"),Nf=["selectionchange","mousedown","mouseup","click"];Nf.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 W extends vf{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",zs.error)}emit(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return zs.log.call(zs,...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 js=Qt("quill:selection");class kn{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}}class Tf{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 kn(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,W.sources.USER),1)})),this.emitter.on(W.events.SCROLL_BEFORE_UPDATE,(()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(W.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?W.sources.SILENT:s)}catch{}}))})),this.emitter.on(W.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(W.sources.SILENT)}})),this.update(W.sources.SILENT)}handleComposition(){this.emitter.on(W.events.COMPOSITION_BEFORE_START,(()=>{this.composing=!0})),this.emitter.on(W.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(W.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,Y.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof Xe){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[g]=this.scroll.line(e),[h]=this.scroll.line(e+1);g===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 js.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&&Ks(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 Xe?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 kn(i,s-i)}normalizeNative(e){if(!Ks(this.root,e.startContainer)||!e.collapsed&&!Ks(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(js.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]:W.sources.API;if(typeof t=="string"&&(r=t,t=!1),js.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]:W.sources.USER;const t=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!Ti(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=[W.events.SELECTION_CHANGE,rr(this.lastRange),rr(t),e];this.emitter.emit(W.events.EDITOR_CHANGE,...i),e!==W.sources.SILENT&&this.emitter.emit(...i)}}}function Ks(n,e){try{e.parentNode}catch{return!1}return n.contains(e)}const Af=/^[ -~]*$/;class wf{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 Z;return xf(r.ops.slice()).reduce(((a,l)=>{const c=bt.Op.length(l);let u=l.attributes||{},f=!1,g=!1;if(l.insert!=null){if(s.retain(c),typeof l.insert=="string"){const y=l.insert;g=!y.endsWith(`\n`)&&(t<=a||!!this.scroll.descendant(mt,a)[0]),this.scroll.insertAt(a,y);const[_,N]=this.scroll.line(a);let T=dn({},gt(_));if(_ instanceof Ze){const[S]=_.descendant(Xe,N);S&&(T=dn(T,gt(S)))}u=bt.AttributeMap.diff(T,u)||{}}else if(typeof l.insert=="object"){const y=Object.keys(l.insert)[0];if(y==null)return a;const _=this.scroll.query(y,Y.INLINE)!=null;if(_)(t<=a||this.scroll.descendant(mt,a)[0])&&(g=!0);else if(a>0){const[N,T]=this.scroll.descendant(Xe,a-1);N instanceof xt?N.value()[T]!==`\n`&&(f=!0):N instanceof ot&&N.statics.scope===Y.INLINE_BLOT&&(f=!0)}if(this.scroll.insertAt(a,y,l.insert[y]),_){const[N]=this.scroll.descendant(Xe,a);if(N){const T=dn({},gt(N));u=bt.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,p=g?1:0;return t+=h+p,s.retain(h),s.delete(p),a+c+h+p}),0),s.reduce(((a,l)=>typeof l.delete=="number"?(this.scroll.deleteAt(a,l.delete),a):a+bt.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 Z).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 Z).retain(e).retain(t,rr(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 Z).retain(e).retain(t,rr(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 Z)}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 Xe&&s.push(c)})):(r=this.scroll.lines(e,t),s=this.scroll.descendants(Xe,e,t));const[i,a]=[r,s].map((l=>{const c=l.shift();if(c==null)return{};let u=gt(c);for(;Object.keys(u).length>0;){const f=l.shift();if(f==null)return u;u=Sf(gt(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)?Ur(r,s,t,!0):Ur(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 Z).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 Z).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 Z).retain(e).insert(t,rr(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 Lt}removeFormat(e,t){const r=this.getText(e,t),[s,i]=this.scroll.line(e+t);let a=0,l=new Z;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 Z).insert(r).concat(l)),f=(new Z).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(Af)&&this.scroll.find(t[0].target)){const i=this.scroll.find(t[0].target),a=gt(i),l=i.offset(this.scroll),c=t[0].oldValue.replace(At.CONTENTS,""),u=(new Z).insert(c),f=(new Z).insert(i.value()),g=r&&{oldRange:Sa(r.oldRange,-l),newRange:Sa(r.newRange,-l)};e=(new Z).retain(l).concat(u.diff(f,g)).reduce(((p,y)=>y.insert?p.insert(y.insert,a):p.push(y)),new Z),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!Ti(s.compose(e),this.delta))&&(e=s.diff(this.delta,r));return e}}function tr(n,e,t){if(n.length===0){const[p]=Gs(t.pop());return e<=0?`</li></${p}>`:`</li></${p}>${tr([],e-1,t)}`}const[{child:r,offset:s,length:i,indent:a,type:l},...c]=n,[u,f]=Gs(l);if(a>e)return t.push(l),a===e+1?`<${u}><li${f}>${Ur(r,s,i)}${tr(c,a,t)}`:`<${u}><li>${tr(n,e+1,t)}`;const g=t[t.length-1];if(a===e&&l===g)return`</li><li${f}>${Ur(r,s,i)}${tr(c,a,t)}`;const[h]=Gs(t.pop());return`</li></${h}>${tr(n,e-1,t)}`}function Ur(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 xt)return Ls(n.value().slice(e,e+t)).replaceAll(" "," ");if(n instanceof St){if(n.statics.blotName==="list-container"){const u=[];return n.children.forEachAt(e,t,((f,g,h)=>{const p="formats"in f&&typeof f.formats=="function"?f.formats():{};u.push({child:f,offset:g,length:h,indent:p.indent||0,type:p.list})})),tr(u,-1,[])}const s=[];if(n.children.forEachAt(e,t,((u,f,g)=>{s.push(Ur(u,f,g))})),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 Sf(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 Gs(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 Z)}function Sa(n,e){let{index:t,length:r}=n;return new kn(t+e,r)}function xf(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 Pt{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 xi extends ot{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 xt){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 xt?(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 Of{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 xi)&&(this.emitter.emit(W.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(W.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(W.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(W.events.COMPOSITION_END,e),this.isComposing=!1}}class cr{static DEFAULTS={modules:{}};static themes={default:cr};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 Lf=n=>n.parentElement||n.getRootNode().host||null,Cf=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}:Cf(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:g}=s;u&&(s.scrollTop+=u),c&&(s.scrollLeft+=c);const h=s.scrollLeft-f,p=s.scrollTop-g;r={left:r.left-h,top:r.top-p,right:r.right-h,bottom:r.bottom-p}}s=i||l.position==="fixed"?null:Lf(s)}},If=100,kf=["block","break","cursor","inline","scroll","text"],Mf=(n,e,t)=>{const r=new or;return kf.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>If){t.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}})),r},ir=Qt("quill"),os=new or;St.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=W.events;static sources=W.sources;static version="2.0.3";static imports={delta:Z,parchment:ff,"core/module":Pt,"core/theme":cr};static debug(e){e===!0&&(e="log"),Qt.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&&ir.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&&ir.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=Df(e,t),this.container=this.options.container,this.container==null){ir.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 W;const s=wi.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 wf(this.scroll),this.selection=new Tf(this.scroll,this.emitter),this.composition=new Of(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(W.events.EDITOR_CHANGE,(a=>{a===W.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())})),this.emitter.on(W.events.SCROLL_UPDATE,((a,l)=>{const c=this.selection.lastRange,[u]=this.selection.getRange(),f=c&&u?{oldRange:c,newRange:u}:void 0;Nt.call(this,(()=>this.editor.update(null,l,f)),a)})),this.emitter.on(W.events.SCROLL_EMBED_UPDATE,((a,l)=>{const c=this.selection.lastRange,[u]=this.selection.getRange(),f=c&&u?{oldRange:c,newRange:u}:void 0;Nt.call(this,(()=>{const g=(new Z).retain(a.offset(this)).retain({[a.statics.blotName]:l});return this.editor.update(g,[],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]=Gt(e,t,r),Nt.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]:W.sources.API;return Nt.call(this,(()=>{const s=this.getSelection(!0);let i=new Z;if(s==null)return i;if(this.scroll.query(e,Y.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,W.sources.SILENT),i}),r)}formatLine(e,t,r,s,i){let a;return[e,t,a,i]=Gt(e,t,r,s,i),Nt.call(this,(()=>this.editor.formatLine(e,t,a)),i,e,0)}formatText(e,t,r,s,i){let a;return[e,t,a,i]=Gt(e,t,r,s,i),Nt.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]=Gt(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]=Gt(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]=Gt(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 Nt.call(this,(()=>this.editor.insertEmbed(e,t,r)),s,e)}insertText(e,t,r,s,i){let a;return[e,,a,i]=Gt(e,0,r,s,i),Nt.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]=Gt(e,t,r),Nt.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]:W.sources.API;return Nt.call(this,(()=>{e=new Z(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]=Gt(e,t,r),this.selection.setRange(new kn(Math.max(0,e),t),r),r!==W.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:W.sources.API;const r=(new Z).insert(e);return this.setContents(r,t)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:W.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]:W.sources.API;return Nt.call(this,(()=>(e=new Z(e),this.editor.applyDelta(e))),t,!0)}}function Oa(n){return typeof n=="string"?document.querySelector(n):n}function Vs(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 Df(n,e){const t=Oa(n);if(!t)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===A.DEFAULTS.theme?cr: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=Vs(e.modules);u!=null&&u.toolbar&&u.toolbar.constructor!==Object&&(u={...u,toolbar:{container:u.toolbar}});const f=dn({},Vs(i),Vs(l),u),g={...a,...La(c),...La(e)};let h=e.registry;return h?e.formats&&ir.warn('Ignoring "formats" option because "registry" is specified'):h=e.formats?Mf(e.formats,g.registry,ir):g.registry,{...g,registry:h,container:t,theme:s,modules:Object.entries(f).reduce(((p,y)=>{let[_,N]=y;if(!N)return p;const T=A.import(`modules/${_}`);return T==null?(ir.error(`Cannot load ${_} module. Are you sure you registered it?`),p):{...p,[_]:dn({},T.DEFAULTS||{},N)}}),{}),bounds:Oa(g.bounds)}}function Nt(n,e,t,r){if(!this.isEnabled()&&e===W.sources.USER&&!this.allowReadOnlyEdits)return new Z;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,W.sources.SILENT)),a.length()>0){const l=[W.events.TEXT_CHANGE,a,i,e];this.emitter.emit(W.events.EDITOR_CHANGE,...l),e!==W.sources.SILENT&&this.emitter.emit(...l)}return a}function Gt(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||W.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!==W.sources.USER))):[i,a]=[n.index,n.index+n.length].map((l=>l<e||l===e&&r===W.sources.USER?l:s>=0?l+s:Math.max(e,l+s))),new kn(i,a-i)}class qn extends Os{}function Ra(n){return n instanceof Ze||n instanceof mt}function Ia(n){return typeof n.updateContent=="function"}class Bf extends wi{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=Ze;static allowedChildren=[Ze,mt,qn];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(W.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(W.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(W.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 mt||i instanceof mt){this.optimize();return}const a=i.children.head instanceof Lt?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,Y.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===Y.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 Z).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(mt,e)[0]&&e<this.length()),u=i.type==="block"?i.delta:(new Z).insert({[i.key]:i.value});Zs(this,e,u);const f=i.type==="block"?1:0,g=e+u.length()+f;c&&this.insertAt(g-1,`\n`);const h=gt(this.line(e)[0]),p=bt.AttributeMap.diff(h,i.attributes)||{};Object.keys(p).forEach((y=>{this.formatAt(g-1,1,y,p[y])})),e=g}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);Zs(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();Zs(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 Xe?[r,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(Ra,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,g)=>{Ra(u)?l.push(u):u instanceof Os&&(l=l.concat(r(u,f,c))),c-=g})),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(W.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=W.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&&!Ia(i)})),e.length>0&&this.emitter.emit(W.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(W.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,r){const[s]=this.descendant((i=>i instanceof mt),e);s&&s.statics.blotName===t&&Ia(s)&&s.updateContent(r)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let r=new Z;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 Z}));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,Y.INLINE)?r.push(s):(r.length()&&t.push({type:"block",delta:r,attributes:{}}),r=new Z,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,Y.BLOCK&Y.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 Zs(n,e,t){t.reduce(((r,s)=>{const i=bt.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(Xe,r),u=gt(c);a=bt.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,Y.INLINE)!=null){const[u]=n.descendant(Xe,r),f=gt(u);a=bt.AttributeMap.diff(f,a)||{}}}}return Object.keys(a).forEach((l=>{n.formatAt(r,i,l,a[l])})),r+i}),e)}const Oi={scope:Y.BLOCK,whitelist:["right","center","justify"]},$f=new $t("align","align",Oi),$o=new Ot("align","ql-align",Oi),qo=new pn("align","text-align",Oi);class Po extends pn{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 qf=new Ot("color","ql-color",{scope:Y.INLINE}),Li=new Po("color","color",{scope:Y.INLINE}),Pf=new Ot("background","ql-bg",{scope:Y.INLINE}),Ci=new Po("background","background-color",{scope:Y.INLINE});class Pn extends qn{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${Ls(this.code(e,t))}\n</pre>`}}class nt extends Ze{static TAB=" ";static register(){A.register(Pn)}}class Ri extends mn{}Ri.blotName="code";Ri.tagName="CODE";nt.blotName="code-block";nt.className="ql-code-block";nt.tagName="DIV";Pn.blotName="code-block-container";Pn.className="ql-code-block-container";Pn.tagName="DIV";Pn.allowedChildren=[nt];nt.allowedChildren=[xt,Lt,At];nt.requiredContainer=Pn;const Ii={scope:Y.BLOCK,whitelist:["rtl"]},Uo=new $t("direction","dir",Ii),Fo=new Ot("direction","ql-direction",Ii),Ho=new pn("direction","direction",Ii),zo={scope:Y.INLINE,whitelist:["serif","monospace"]},jo=new Ot("font","ql-font",zo);class Uf extends pn{value(e){return super.value(e).replace(/["']/g,"")}}const Ko=new Uf("font","font-family",zo),Go=new Ot("size","ql-size",{scope:Y.INLINE,whitelist:["small","large","huge"]}),Vo=new pn("size","font-size",{scope:Y.INLINE,whitelist:["10px","18px","32px"]}),Ff=Qt("quill:keyboard"),Hf=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Cs extends Pt{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=jf(e);if(s==null){Ff.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=>Cs.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),[g,h]=a.length===0?[u,f]:this.quill.getLeaf(a.index+a.length),p=u instanceof ys?u.value().slice(0,f):"",y=g instanceof ys?g.value().slice(h):"",_={collapsed:a.length===0,empty:a.length===0&&l.length()<=1,format:this.quill.getFormat(a),line:l,offset:c,prefix:p,suffix:y,event:e};s.some((T=>{if(T.collapsed!=null&&T.collapsed!==_.collapsed||T.empty!=null&&T.empty!==_.empty||T.offset!=null&&T.offset!==_.offset)return!1;if(Array.isArray(T.format)){if(T.format.every((S=>_.format[S]==null)))return!1}else if(typeof T.format=="object"&&!Object.keys(T.format).every((S=>T.format[S]===!0?_.format[S]!=null:T.format[S]===!1?_.format[S]==null:Ti(T.format[S],_.format[S]))))return!1;return T.prefix!=null&&!T.prefix.test(_.prefix)||T.suffix!=null&&!T.suffix.test(_.suffix)?!1:T.handler.call(this,a,_,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 Z).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=bt.AttributeMap.diff(u,f)||{},Object.keys(s).length>0){const g=(new Z).retain(e.index+i.length()-2).retain(1,s);a=a.compose(g)}}}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 Z).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=bt.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){ki({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,Y.BLOCK)&&!Array.isArray(t.format[a])&&(i[a]=t.format[a]),i)),{}),s=(new Z).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 zf={bindings:{bold:Ws("bold"),italic:Ws("italic"),underline:Ws("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 Z).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 Z).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 Z).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=Kf(t,r,s,i);if(a==null)return;let l=t.offset();if(a<0){const c=(new Z).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 Z).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 Z).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 Z).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)}};Cs.DEFAULTS=zf;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 ot?(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 Ws(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 jf(n){if(typeof n=="string"||typeof n=="number")n={key:n};else if(typeof n=="object")n=rr(n);else return null;return n.shortKey&&(n[Hf]=n.shortKey,delete n.shortKey),n}function ki(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=bt.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 Kf(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 Gf=/font-weight:\s*normal/,Vf=["P","OL","UL"],Da=n=>n&&Vf.includes(n.tagName),Zf=n=>{Array.from(n.querySelectorAll("br")).filter((e=>Da(e.previousElementSibling)&&Da(e.nextElementSibling))).forEach((e=>{e.parentNode?.removeChild(e)}))},Wf=n=>{Array.from(n.querySelectorAll('b[style*="font-weight"]')).filter((e=>e.getAttribute("style")?.match(Gf))).forEach((e=>{const t=n.createDocumentFragment();t.append(...e.childNodes),e.parentNode?.replaceChild(t,e)}))};function Yf(n){n.querySelector('[id^="docs-internal-guid-"]')&&(Wf(n),Zf(n))}const Qf=/\bmso-list:[^;]*ignore/i,Xf=/\bmso-list:[^;]*\bl(\d+)/i,Jf=/\bmso-list:[^;]*\blevel(\d+)/i,eg=(n,e)=>{const t=n.getAttribute("style"),r=t?.match(Xf);if(!r)return null;const s=Number(r[1]),i=t?.match(Jf),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}},tg=n=>{const e=Array.from(n.querySelectorAll("[style*=mso-list]")),t=[],r=[];e.forEach((a=>{(a.getAttribute("style")||"").match(Qf)?t.push(a):r.push(a)})),t.forEach((a=>a.parentNode?.removeChild(a)));const s=n.documentElement.innerHTML,i=r.map((a=>eg(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((g=>{const h=document.createElement("li");h.setAttribute("data-list",g.type),g.indent>1&&h.setAttribute("class",`ql-indent-${g.indent-1}`),h.innerHTML=g.element.innerHTML,c.appendChild(h)}));const u=a[0]?.element,{parentNode:f}=u??{};u&&f?.replaceChild(c,u),a.slice(1).forEach((g=>{let{element:h}=g;f?.removeChild(h)}))}};function ng(n){n.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&tg(n)}const rg=[ng,Yf],sg=n=>{n.documentElement&&rg.forEach((e=>{e(n)}))},ig=Qt("quill:clipboard"),ag=[[Node.TEXT_NODE,yg],[Node.TEXT_NODE,$a],["br",hg],[Node.ELEMENT_NODE,$a],[Node.ELEMENT_NODE,dg],[Node.ELEMENT_NODE,ug],[Node.ELEMENT_NODE,bg],["li",pg],["ol, ul",mg],["pre",fg],["tr",Eg],["b",Ys("bold")],["i",Ys("italic")],["strike",Ys("strike")],["style",gg]],og=[$f,Uo].reduce(((n,e)=>(n[e.keyName]=e,n)),{}),Ba=[qo,Ci,Li,Ho,Ko,Vo].reduce(((n,e)=>(n[e.keyName]=e,n)),{});class lg extends Pt{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=[],ag.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 Z).insert(r||"",{[nt.blotName]:s[nt.blotName]});if(!t)return(new Z).insert(r||"",s);const i=this.convertHTML(t);return jr(i,`\n`)&&(i.ops[i.ops.length-1].attributes==null||s.table)?i.compose((new Z).retain(i.length()-1).delete(1)):i}normalizeHTML(e){sg(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 Mi(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 Z).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&&ki({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);ig.log("onPaste",a,{text:r,html:s});const l=(new Z).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 Un(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 Z):n}function jr(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 un(n,e){if(!(n instanceof Element))return!1;const t=e.query(n);return t&&t.prototype instanceof ot?!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 cg(n,e){return n.previousElementSibling&&n.nextElementSibling&&!un(n.previousElementSibling,e)&&!un(n.nextElementSibling,e)}const cs=new WeakMap;function Zo(n){return n==null?!1:(cs.has(n)||(n.tagName==="PRE"?cs.set(n,!0):cs.set(n,Zo(n.parentNode))),cs.get(n))}function Mi(n,e,t,r,s){return e.nodeType===e.TEXT_NODE?r.reduce(((i,a)=>a(e,i,n)),new Z):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce(((i,a)=>{let l=Mi(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 Z):new Z}function Ys(n){return(e,t,r)=>Un(t,n,!0,r)}function ug(n,e,t){const r=$t.keys(n),s=Ot.keys(n),i=pn.keys(n),a={};return r.concat(s).concat(i).forEach((l=>{let c=t.query(l,Y.ATTRIBUTE);c!=null&&(a[c.attrName]=c.value(n),a[c.attrName])||(c=og[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 Un(l,u,f,t)}),e)}function dg(n,e,t){const r=t.query(n);if(r==null)return e;if(r.prototype instanceof ot){const s={},i=r.value(n);if(i!=null)return s[r.blotName]=i,(new Z).insert(s,r.formats(n,t))}else if(r.prototype instanceof Pr&&!jr(e,`\n`)&&e.insert(`\n`),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return Un(e,r.blotName,r.formats(n,t),t);return e}function hg(n,e){return jr(e,`\n`)||e.insert(`\n`),e}function fg(n,e,t){const r=t.query("code-block"),s=r&&"formats"in r&&typeof r.formats=="function"?r.formats(n,t):!0;return Un(e,"code-block",s,t)}function gg(){return new Z}function pg(n,e,t){const r=t.query(n);if(r==null||r.blotName!=="list"||!jr(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 Z)}function mg(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"),Un(e,"list",s,t)}function $a(n,e,t){if(!jr(e,`\n`)){if(un(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(un(r,t))return e.insert(`\n`);const s=t.query(r);if(s&&s.prototype instanceof mt)return e.insert(`\n`);r=r.firstChild}}}return e}function bg(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 Un(i,l,c,t)}),e),parseFloat(s.textIndent||0)>0?(new Z).insert("\t").concat(e):e}function Eg(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 Un(e,"table",i,t)}return e}function yg(n,e,t){let r=n.data;if(n.parentElement?.tagName==="O:P")return e.insert(r.trim());if(!Zo(n)){if(r.trim().length===0&&r.includes(`\n`)&&!cg(n,t))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(n.previousSibling==null&&n.parentElement!=null&&un(n.parentElement,t)||n.previousSibling instanceof Element&&un(n.previousSibling,t))&&(r=r.replace(/^ /,"")),(n.nextSibling==null&&n.parentElement!=null&&un(n.parentElement,t)||n.nextSibling instanceof Element&&un(n.nextSibling,t))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class _g extends Pt{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){qa(this.stack.undo,e),qa(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=Ng(this.quill.scroll,e.delta);this.quill.setSelection(t,A.sources.USER)}}}function qa(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 vg(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,Y.BLOCK)!=null)):!1}function Ng(n,e){const t=e.reduce(((s,i)=>s+(i.delete||0)),0);let r=e.length()-t;return vg(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 Pt{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 Z).retain(n.index).delete(n.length));this.quill.updateContents(s,W.sources.USER),this.quill.setSelection(n.index+r.length,W.sources.SILENT)}))}};const Tg=["insertText","insertReplacementText"];class Ag extends Pt{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){ki({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 Z).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||!Tg.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const r=wg(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 wg(n){return typeof n.data=="string"?n.data:n.dataTransfer?.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const Sg=/Mac/i.test(navigator.platform),xg=100,Og=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||Sg&&n.key==="a"&&n.ctrlKey===!0);class Lg extends Pt{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 St)||!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&&Og(e)&&this.ensureListeningToSelectionChange()}))}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+xg,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 St)||!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":mt,"blots/break":Lt,"blots/container":qn,"blots/cursor":At,"blots/embed":xi,"blots/inline":mn,"blots/scroll":Bf,"blots/text":xt,"modules/clipboard":lg,"modules/history":_g,"modules/keyboard":Cs,"modules/uploader":Wo,"modules/input":Ag,"modules/uiNode":Lg});class Cg extends Ot{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 Cg("indent","ql-indent",{scope:Y.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Ig extends Ze{static blotName="blockquote";static tagName="blockquote"}class kg extends Ze{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}}class Kr extends qn{}Kr.blotName="list-container";Kr.tagName="OL";class Gr 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(Kr)}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)}}Gr.blotName="list";Gr.tagName="LI";Kr.allowedChildren=[Gr];Gr.requiredContainer=Kr;class Di extends mn{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 Mg extends Di{static blotName="italic";static tagName=["EM","I"]}class _s extends mn{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 Yo(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 Yo(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 Dg extends mn{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 Bg extends Di{static blotName="strike";static tagName=["S","STRIKE"]}class $g extends mn{static blotName="underline";static tagName="U"}class qg extends xi{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 Pg=class extends ot{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 Yo(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 Ug extends mt{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 _s.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 kr=new Ot("code-token","hljs",{scope:Y.INLINE});class Wt extends mn{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),kr.add(this.domNode,r)}format(e,t){e!==Wt.blotName?super.format(e,t):t?kr.add(this.domNode,t):(kr.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),kr.value(this.domNode)||this.unwrap()}}Wt.blotName="code-token";Wt.className="ql-token";class pt 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 Dr extends Pn{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===pt.blotName&&(this.forceNext=!0,this.children.forEach((r=>{r.format(e,t)})))}formatAt(e,t,r,s){r===pt.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=pt.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(Do(u,!1))),new Z),l=e(s,i);a.diff(l).reduce(((c,u)=>{let{retain:f,attributes:g}=u;return f?(g&&Object.keys(g).forEach((h=>{[pt.blotName,Wt.blotName].includes(h)&&this.formatAt(c,f,h,g[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?pt.formats(r.domNode):"plain"}">\n${Ls(this.code(e,t))}\n</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=pt.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}Dr.allowedChildren=[pt];pt.requiredContainer=Dr;pt.allowedChildren=[Wt,At,xt,Lt];const Fg=(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 Qo extends Pt{static register(){A.register(Wt,!0),A.register(pt,!0),A.register(Dr,!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 Dr))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(pt.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)})),e.uiNode==null&&(e.attachUI(t),e.children.head&&(t.value=pt.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(Dr):[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 Ls(e).split(`\n`).reduce(((s,i,a)=>(a!==0&&s.insert(`\n`,{[nt.blotName]:t}),s.insert(i))),new Z);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(nt.className),r.innerHTML=Fg(this.options.hljs,t,e),Mi(this.quill.scroll,r,[(s,i)=>{const a=kr.value(s);return a?i.compose((new Z).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)}}Qo.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 wt 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",Bi()),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===wt.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 Mn extends qn{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 hn extends qn{static blotName="table-body";static tagName="TBODY"}class vs extends qn{static blotName="table-container";static tagName="TABLE";balanceCells(){const e=this.descendants(Mn),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=wt.formats(r.children.head.domNode));const i=this.scroll.create(wt.blotName,s);r.appendChild(i),i.optimize()}))}))}cells(e){return this.rows().map((t=>t.children.at(e)))}deleteColumn(e){const[t]=this.descendant(hn);t==null||t.children.head==null||t.children.forEach((r=>{const s=r.children.at(e);s?.remove()}))}insertColumn(e){const[t]=this.descendant(hn);t==null||t.children.head==null||t.children.forEach((r=>{const s=r.children.at(e),i=wt.formats(r.children.head.domNode),a=this.scroll.create(wt.blotName,i);r.insertBefore(a,s)}))}insertRow(e){const[t]=this.descendant(hn);if(t==null||t.children.head==null)return;const r=Bi(),s=this.scroll.create(Mn.blotName);t.children.head.children.forEach((()=>{const a=this.scroll.create(wt.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))}}vs.allowedChildren=[hn];hn.requiredContainer=vs;hn.allowedChildren=[Mn];Mn.requiredContainer=hn;Mn.allowedChildren=[wt];wt.requiredContainer=Mn;function Bi(){return`row-${Math.random().toString(36).slice(2,6)}`}class Hg extends Pt{static register(){A.register(wt),A.register(Mn),A.register(hn),A.register(vs)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(vs).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!==wt.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:Bi()})}),(new Z).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=Qt("quill:toolbar");class $i extends Pt{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const r=document.createElement("div");r.setAttribute("role","toolbar"),zg(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 ot){if(i=prompt(`Enter ${t}`),!i)return;this.quill.updateContents((new Z).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())}}))}}$i.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 zg(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)?jg(r,i,a):Ha(r,i,a)}})),n.appendChild(r)}))}function jg(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)}$i.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,Y.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 Kg='<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>',Gg='<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>',Vg='<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>',Wg='<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>',Yg='<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>',Qg='<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>',Xg='<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>',Jg='<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>',ep='<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>',tp='<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>',np='<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>',rp='<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>',sp='<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>',ip='<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>',ap='<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>',op='<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>',lp='<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>',cp='<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>',up='<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>',dp='<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>',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-stroke" points="5 7 5 11 3 9 5 7"/></svg>',fp='<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>',gp='<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>',pp='<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>',mp='<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>',bp='<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>',Ep='<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>',yp='<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>',_p='<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>',vp='<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>',Np='<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>',Fr={align:{"":Kg,center:Gg,right:Vg,justify:Zg},background:Wg,blockquote:Yg,bold:Qg,clean:Xg,code:za,"code-block":za,color:Jg,direction:{"":ep,rtl:tp},formula:np,header:{1:rp,2:sp,3:ip,4:ap,5:op,6:lp},italic:cp,image:up,indent:{"+1":dp,"-1":hp},link:fp,list:{bullet:gp,check:pp,ordered:mp},script:{sub:bp,super:Ep},strike:yp,table:_p,underline:vp,video:Np},Tp='<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 Rs{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=Tp,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 Xo extends Rs{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 Jo extends Rs{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 Ap=n=>{const{overflowY:e}=getComputedStyle(n,null);return e!=="visible"&&e!=="clip"};let el=class{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,Ap(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 wp=[!1,"center","right","justify"],Sp=["#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"],xp=[!1,"serif","monospace"],Op=["1","2","3",!1],Lp=["small",!1,"large","huge"];class Vr extends cr{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&&Cr(s,wp),typeof t.align=="object"))return new Jo(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&&Cr(s,Sp,i==="background"?"#ffffff":"#000000"),new Xo(s,t[i])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?Cr(s,xp):s.classList.contains("ql-header")?Cr(s,Op):s.classList.contains("ql-size")&&Cr(s,Lp)),new Rs(s)}));const r=()=>{this.pickers.forEach((s=>{s.update()}))};this.quill.on(W.events.EDITOR_CHANGE,r)}}Vr.DEFAULTS=dn({},cr.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 tl extends el{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,W.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,W.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=Cp(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,W.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",W.sources.USER),this.quill.setSelection(r+2,W.sources.USER)}break}}this.textbox.value="",this.hide()}}function Cp(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 Cr(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 Ip extends tl{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(W.events.EDITOR_CHANGE,((r,s,i,a)=>{if(r===W.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&a===W.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),g=this.quill.getBounds(new kn(u,f));g!=null&&this.position(g)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()}))}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",(()=>{this.root.classList.remove("ql-editing")})),this.quill.on(W.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 nl extends Vr{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 Ip(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),Fr),this.buildPickers(e.container.querySelectorAll("select"),Fr))}}nl.DEFAULTS=dn({},Vr.DEFAULTS,{modules:{toolbar:{handlers:{link(n){n?this.quill.theme.tooltip.edit():this.quill.format("link",!1,A.sources.USER)}}}}});const kp=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Mp extends tl{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,W.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()})),this.quill.on(W.events.SELECTION_CHANGE,((e,t,r)=>{if(e!=null){if(e.length===0&&r===W.sources.USER){const[s,i]=this.quill.scroll.descendant(_s,e.index);if(s!=null){this.linkRange=new kn(e.index-i,s.length());const a=_s.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 rl extends Vr{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-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),Fr),this.buildPickers(e.container.querySelectorAll("select"),Fr),this.tooltip=new Mp(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)})))}}rl.DEFAULTS=dn({},Vr.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":Uo,"attributors/class/align":$o,"attributors/class/background":Pf,"attributors/class/color":qf,"attributors/class/direction":Fo,"attributors/class/font":jo,"attributors/class/size":Go,"attributors/style/align":qo,"attributors/style/background":Ci,"attributors/style/color":Li,"attributors/style/direction":Ho,"attributors/style/font":Ko,"attributors/style/size":Vo},!0);A.register({"formats/align":$o,"formats/direction":Fo,"formats/indent":Rg,"formats/background":Ci,"formats/color":Li,"formats/font":jo,"formats/size":Go,"formats/blockquote":Ig,"formats/code-block":nt,"formats/header":kg,"formats/list":Gr,"formats/bold":Di,"formats/code":Ri,"formats/italic":Mg,"formats/link":_s,"formats/script":Dg,"formats/strike":Bg,"formats/underline":$g,"formats/formula":qg,"formats/image":Pg,"formats/video":Ug,"modules/syntax":Qo,"modules/table":Hg,"modules/toolbar":$i,"themes/bubble":nl,"themes/snow":rl,"ui/icons":Fr,"ui/picker":Rs,"ui/icon-picker":Jo,"ui/color-picker":Xo,"ui/tooltip":el},!0);function pi(n){const e=Is(n)??0,[t]=n.getLeaf(e);if(!t)throw new Error("editor.getLeaf() returns undefined");return t.domNode}function Is(n){const e=n.getSelection();if(e!==null)return e.index+e.length}const sl=n=>n!=null&&(n=Object.getPrototypeOf(n),n===Array.prototype||n===Object.prototype);function il(n,e,t){for(const[r,s]of Object.entries(e)){const i=`${t}.${r}`;n[i]=s,sl(s)&&il(n,s,i)}}function Dp(n){const e={...n};for(const[t,r]of Object.entries(n))sl(r)&&il(e,r,t);return e}const Bp=(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 qp(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 Pp={insertHtmlSnippetMessage:"Insert a HTML Snippet",obfuscate:"Obfuscate"},Up="image",Fp="Validate",Hp="Cancel",zp="Done",jp="Remove",Kp="auto",Gp="Image not inserted, place cursor in editor first",Vp="HTML Snippet",Zp="Confirm Deletion",Wp={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",mediaProperties:"Media properties",caption:"Caption",pixelRatio:"Pixel ratio"},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:Pp,image:Up,validate:Fp,delete:"Delete",cancel:Hp,done:zp,remove:jp,auto:Kp,editorFocusLost:Gp,htmlSnippetLabel:Vp,confirmDeletion:Zp,comfirmSnippetDeletionDialog:Wp,makeMediaPropertiesDialog: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="Retirer",om="auto",lm="L'image n'a pas été insérée, mettre d'abord le curseur dans l'éditeur",cm="Code HTML",um="Confirmer la suppression",dm={content:"Voulez-vous vraiment supprimer ce code HTML ?"},hm={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",mediaProperties:"Propriétés du média",caption:"Légende",pixelRatio:"Pixel ratio"},fm={obfuscator:"Obfusqueur",content:"Contenu:",asALink:"En tant que lien",doNotObfuscate:"Ne pas obfusquer"},gm={insertVideo:"Insérer une vidéo",dialog:{title:"Définir une vidéo"}},pm={insertLink:"Insérer un lien interne"},mm={CustomToolbar:tm,image:nm,validate:rm,delete:"Supprimer",cancel:sm,done:im,remove:am,auto:om,editorFocusLost:lm,htmlSnippetLabel:cm,confirmDeletion:um,comfirmSnippetDeletionDialog:dm,makeMediaPropertiesDialog:hm,openObfuscatorDialog:fm,videoPlugin:gm,internalLinkPlugin:pm},Ga={en:em,fr:mm};function bn(n){const e=Xs((()=>{const r=n()in Ga?n():"en";return Dp(Ga[r])}));return{t:qp(e,Bp)}}function bm(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(Is(n)??0,r,"link",t)}function al({editor:n,values:e,service:t,index:r,language:s}){const{t:i}=bn(s),a=r??Is(n);if(a===void 0){t.showToast(i("editorFocusLost"),{severity:"warn"});return}n.insertEmbed(a,"media",e)}function ol({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 ll({values:n,editor:e,index:t}){e.insertText(t,n,"internal-link-plugin",n)}function cl({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 Em(n){const{mediaId: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 ym(n){const e=ul(n),t=n.dataset.resize;return{resizeRule:t&&eo(t)?t:void 0,align:e}}function ul(n){const e=n.classList;if(e.contains("center"))return"center";if(e.contains("left"))return"left";if(e.contains("right"))return"right"}function _m(n){if(n==="center")return"center";if(n==="left")return"left";if(n==="right")return"right"}var vm=be('<textarea autofocus class="QpInput QpHtmlSnippetInput"rows=8 cols=80>'),dl=be('<button class="QpBtn secondary"type=button>'),Nm=be("<button class=QpBtn type=button>"),Tm=be('<button class="QpBtn danger outlined"type=button>'),Am=be("<p>"),wm=be('<button class="QpBtn danger"type=button>');async function hl({service:n,language:e,mode:t,html:r}){const{t:s}=bn(e),[i,a]=ft(r??""),l=()=>{c.close({action:"remove"})},c=n.createModalDialog({content:(()=>{var u=vm();return u.addEventListener("change",(f=>a(f.target.value))),ln((()=>u.value=i())),u})(),footer:[t==="update"&&(()=>{var u=Tm();return u.$$click=()=>{Sm({deleteSnippet:l,closeDialog:()=>{c.close()},language:e,service:n})},ue(u,(()=>s("delete"))),u})(),(()=>{var u=dl();return u.$$click=()=>c.close(),ue(u,(()=>s("cancel"))),u})(),(()=>{var u=Nm();return u.$$click=()=>c.close({action:t,values:{html:i()}}),ue(u,(()=>s("validate"))),u})()],header:s("htmlSnippetLabel")});return await c.open()}function Sm({closeDialog:n,deleteSnippet:e,language:t,service:r}){const{t:s}=bn(t),i=r.createModalDialog({header:s("confirmDeletion"),content:(()=>{var a=Am();return ue(a,(()=>s("comfirmSnippetDeletionDialog.content"))),a})(),footer:[(()=>{var a=dl();return a.$$click=()=>{i.hide()},ue(a,(()=>s("cancel"))),a})(),(()=>{var a=wm();return a.$$click=()=>{i.hide(),e()},ue(a,(()=>s("validate"))),a})()]});i.show()}Ts(["click"]);async function fl({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}}var xm=be("<span>");function mi({center:n}){const e=n?"QpSpinner center":"QpSpinner";return(()=>{var t=xm();return ps(t,e),t})()}var Om=be('<button class="QpBtn outlined danger"type=button>'),Lm=be("<button class=QpBtn type=button>"),us=be("<h2 class=FieldLabel>"),Va=be("<div class=QpOption>"),Cm=be("<input class=QpOption-input type=text>"),Rm=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>"),km=be("<div class=QpBox><dl class=QpProp><dt>:</dt><dd></dd></dl><dl class=QpProp><dt>:</dt><dd>"),Mm=be("<button type=button> <small class=ml-1>(<!>)"),Dm=be("<button type=button>");async function Bm({service:n,language:e,fetchedOutput:t,initialValues:r}){const{mediaId:s}=r,{themeConf:i}=n,{t:a}=bn(e),[l,c]=ft(r.resizeRule),[u,f]=ft(r.align),[g,h]=ft(r.zoomable),[p,y]=ft(!!r.href),[_,N]=ft(r.href??""),[T,S]=ft();Ui((()=>{n.useBackOfficeImage(s,{resizeRule:l()}).then((P=>{t.source=P?.source,S(P)})).catch((P=>{n.logger.error("Error fetching media:",P)}))}));const k=Xs((()=>i.fTextImageResizeRules.map(((P,se)=>({resizeRule:P,label:a("makeMediaPropertiesDialog.variantLabel",{n:se+1})})))),[i,e()]),F=Xs((()=>[{align:"left",label:a("makeMediaPropertiesDialog.left")},{align:"center",label:a("makeMediaPropertiesDialog.center")},{align:"right",label:a("makeMediaPropertiesDialog.right")}]),[e()]),B=async()=>{he.close({action:"update",values:{mediaId:s,align:u(),resizeRule:l(),zoomable:g(),href:p()&&_().trim()||void 0}})};Ui((()=>{p()&&h(!1)}));const G=[(()=>{var P=Om();return P.$$click=()=>{he.close({action:"remove"})},ue(P,(()=>a("remove"))),P})(),(()=>{var P=Lm();return P.$$click=B,P.disabled=!s||u===void 0||l===void 0,ue(P,(()=>a("validate"))),P})()],he=n.createModalDialog({header:a("makeMediaPropertiesDialog.imageProperties"),content:[(()=>{var P=us();return ue(P,(()=>a("makeMediaPropertiesDialog.sizes"))),P})(),(()=>{var P=Va();return ue(P,Dt(Fi,{get each(){return k()},children:se=>(()=>{var ie=Mm(),m=ie.firstChild,L=m.nextSibling,v=L.firstChild,C=v.nextSibling;return C.nextSibling,ie.$$click=()=>c(se.resizeRule),ie.disabled=!s,ue(ie,(()=>se.label),m),ue(L,(()=>se.resizeRule.replace("x","×")),C),ln((()=>ps(ie,`QpBtn secondary ${se.resizeRule!==l()?"outlined":""}`))),ie})()})),P})(),(()=>{var P=us();return ue(P,(()=>a("makeMediaPropertiesDialog.alignment"))),P})(),(()=>{var P=Va();return ue(P,Dt(Fi,{get each(){return F()},children:se=>(()=>{var ie=Dm();return ie.$$click=()=>f(se.align),ie.disabled=!s,ue(ie,(()=>se.label)),ln((()=>ps(ie,`QpBtn secondary ${se.align!==u()?"outlined":""}`))),ie})()})),P})(),(()=>{var P=us();return ue(P,(()=>a("makeMediaPropertiesDialog.options"))),P})(),(()=>{var P=Im(),se=P.firstChild,ie=se.firstChild,m=ie.firstChild,L=se.nextSibling;return m.addEventListener("change",(()=>{y(!p())})),ue(ie,(()=>a("makeMediaPropertiesDialog.link")),null),ue(ie,Dt(Hi,{get when(){return p()},get children(){var v=Cm();return v.addEventListener("change",(C=>{N(C.currentTarget.value)})),ln((()=>v.value=_())),v}}),null),ue(L,Dt(Hi,{get when(){return!p()},get children(){var v=Rm(),C=v.firstChild;return C.addEventListener("change",(()=>{h(!g())})),ue(v,(()=>a("makeMediaPropertiesDialog.enableZoom")),null),ln((()=>C.checked=g())),v}})),ln((()=>m.checked=p())),P})(),(()=>{var P=us();return ue(P,(()=>a("makeMediaPropertiesDialog.mediaProperties"))),P})(),(()=>{var P=km(),se=P.firstChild,ie=se.firstChild,m=ie.firstChild,L=ie.nextSibling,v=se.nextSibling,C=v.firstChild,R=C.firstChild,O=C.nextSibling;return ue(ie,(()=>a("makeMediaPropertiesDialog.caption")),m),ue(L,(()=>{var D=Bs((()=>!!T()));return()=>D()?T()?.source.attachedData?.[e()]?.caption??"-":Dt(mi,{})})()),ue(C,(()=>a("makeMediaPropertiesDialog.pixelRatio")),R),ue(O,(()=>{var D=Bs((()=>!!T()));return()=>D()?Bs((()=>!!T()?.source.pixelRatio))()?`${T()?.source.pixelRatio}×`:a("auto"):Dt(mi,{})})()),P})()],footer:G});return await he.open()}Ts(["click"]);function gl(n){return $m(n)||qi(n)}function qi(n){return!!n.match(/^[a-zA-Z0-9. _-]+@[a-zA-Z0-9. -]+\.[a-zA-Z]{2,4}$/g)}function $m(n){return!!n.match(/^(\+|00)[1-9][0-9 \-\(\)\.]{7,32}$/)}function qm(n){return gl(n)?qi(n)?"mailto":"tel":"raw"}function pl(n){if(n==="raw")return"raw";if(n==="mailto")return"mailto";if(n==="tel")return"tel";throw new Error(`invalid link-type '${n}'`)}var Pm=be("<label class=ObfuscatorDialog-label><input type=text class=ml-2>"),Um=be('<label class="ObfuscatorDialog-label mt-4"><input type=checkbox name=asALink class=mr-2>'),Fm=be('<button class="QpBtn danger outlined"type=button>'),Hm=be("<button class=QpBtn type=button>");async function zm({service:n,language:e,value:t}){const{t:r}=bn(e),[s,i]=ft(t.asALink),[a,l]=ft(t.content),c=f=>{l(f),gl(f)?i(!0):i(!1)},u=n.createModalDialog({header:r("openObfuscatorDialog.obfuscator"),content:[(()=>{var f=Pm(),g=f.firstChild;return ue(f,(()=>r("openObfuscatorDialog.content")),g),g.$$input=h=>c(h.currentTarget.value),ln((()=>g.value=a())),f})(),(()=>{var f=Um(),g=f.firstChild;return g.addEventListener("change",(()=>i(!s()))),ue(f,(()=>r("openObfuscatorDialog.asALink")),null),ln((()=>g.checked=s())),f})()],footer:[(()=>{var f=Fm();return f.$$click=()=>u.close({action:"remove"}),ue(f,(()=>r("openObfuscatorDialog.doNotObfuscate"))),f})(),(()=>{var f=Hm();return f.$$click=()=>u.close({action:"update",content:a(),asALink:s()?qi(a())?"mailto":"tel":"raw"}),ue(f,(()=>r("done"))),f})()]});return await u.open()}Ts(["input","click"]);var jm=be('<button class="QpBtn outlined danger"type=button>'),Km=be('<button class="QpBtn secondary"type=button>'),Gm=be("<button class=QpBtn type=button>");async function ml({service:n,language:e,mode:t,value:r,videoPluginHook:s}){if(!s)return;const{t:i}=bn(e),[a,l]=ft(r??""),{dispose:c,element:u}=s.createComponent(r??"",{onChange(g){l(g)},getLanguage:e}),f=n.createModalDialog({content:u,footer:[(()=>{var g=jm();return g.$$click=()=>{f.close({action:"remove"}),c()},ue(g,(()=>i("remove"))),g})(),(()=>{var g=Km();return g.$$click=()=>{f.close(),c()},ue(g,(()=>i("cancel"))),g})(),(()=>{var g=Gm();return g.$$click=()=>{f.close({action:t,value:a()??""}),c()},ue(g,(()=>i("validate"))),g})()],header:i("videoPlugin.dialog.title")});return await f.open()}Ts(["click"]);async function Vm({editor:n,htmlSnippetBtn:e,service:t,language:r}){const s=e.dataset.html,i=await hl({service:t,html:s,mode:"update",language:r});i&&Zr({editor:n,element:e,data:i,insertElementHandler:ol,service:t,language:r})}async function Zm({editor:n,internalLinkElement:e,language:t,service:r,internalLinkPluginHook:s}){const i=e.dataset.documentId,a=await fl({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()),ll({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 ml({service:r,language:t,mode:"update",value:i,videoPluginHook:s});a&&Zr({editor:n,element:e,data:{action:a.action,values:a.value},insertElementHandler:cl,service:r,language:t})}async function bl({obfuscatorSpan:n,service:e,language:t,editor:r}){const s=n.innerText,i=n.dataset.asALink?pl(n.dataset.asALink):void 0,a=await zm({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 Ym({service:n,language:e,element:t,editor:r}){const s=Em(t),{align:i,resizeRule:a}=ym(t);if(!s||!a)return;const l={source:void 0},c={mediaId:s,resizeRule:a,align:i,zoomable:t.dataset.zoomable==="1",href:t.dataset.href};let u=await Bm({service:n,language:e,initialValues:c,fetchedOutput:l});if(!u){if(!l.source||!t.dataset.source)return;const f=JSON.parse(t.dataset.source);if(f.pixelRatio===l.source.pixelRatio&&f.attachedData?.[e()]?.caption===l.source.attachedData?.[e()]?.caption)return;u={action:"update",values:c}}Zr({service:n,language:e,editor:r,element:t,data:u,insertElementHandler:al})}function Qm({quillEditor:n,service:e,language:t,videoPluginHook:r,internalLinkPluginHook:s}){const{themeConf:i}=e;return{insertHtmlSnippetHandler:async()=>{if(!n)return;const g=pi(n);await Jm({service:e,editorContent:g,quillEditor:n,language:t})},insertMedia:async g=>{if(!n)return;if(g.kind==="file"){bm(n,{label:g.originalName,url:g.url});return}const h=i.fTextImageResizeRules[0];al({service:e,editor:n,values:{mediaId:g.mediaId,resizeRule:h,align:"center",zoomable:!0},language:t})},insertObfuscateBlotHandler:()=>{if(!n)return;const g=n.getSelection();!g||g.length===0||Xm({service:e,userSelection:g,quillEditor:n,language:t})},insertVideoHandler:async()=>{if(!n)return;const g=pi(n);await El({editorContent:g,quillEditor:n,service:e,language:t,videoPluginHook:r})},insertInternalLinkHandler:async()=>{if(!n)return;const g=Is(n);g!==void 0&&await eb({quillEditor:n,service:e,language:t,internalLinkPluginHook:s,index:g})}}}async function Xm({service:n,userSelection:e,quillEditor:t,language:r}){const s=t.getText(e.index,e.length),i=qm(s);t.formatText(e,"obfuscate",i);const a=t.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 bl({obfuscatorSpan:l,service:n,language:r,editor:t});break}}async function Jm({service:n,editorContent:e,quillEditor:t,language:r}){const s=await hl({service:n,language:r,mode:"insert"});s&&Zr({editor:t,element:e,data:s,insertElementHandler:ol,service:n,language:r})}async function El({service:n,editorContent:e,quillEditor:t,language:r,videoPluginHook:s,value:i}){const a=await ml({service:n,language:r,mode:i?"update":"insert",value:i,videoPluginHook:s});!a||a.action==="remove"||Zr({editor:t,element:e,data:{action:a.action,values:a.value,updateOptions:{textToReplaceLength:i?.length}},insertElementHandler:cl,service:n,language:r})}async function eb({service:n,quillEditor:e,language:t,internalLinkPluginHook:r,value:s,index:i}){const a=await fl({language:t,value:s,internalLinkPluginHook:r});!a||a.action==="remove"||!a.value||ll({editor:e,values:a.value,index:i})}function Zr({service:n,editor:e,element:t,data:{values:r,action:s,updateOptions:i},insertElementHandler:a,language:l}){const c=A.find(t);if(!c||c instanceof A)throw new Error("missing embed blot");const u=e.getIndex(c),f=new Z;if(!(u===void 0||u===-1)){if(s==="insert"){if(!r)return;a({editor:e,values:r,service:n,index:u,language:l})}else if(s==="update"){if(!r)return;a({editor:e,values:r,service:n,index:u,language:l}),f.retain(u+1),f.delete(i?.textToReplaceLength??1)}else s==="remove"&&(f.retain(u),f.delete(1));e.updateContents(f)}}var Qs,Za;function tb(){if(Za)return Qs;Za=1;function n(b){return b instanceof Map?b.clear=b.delete=b.set=function(){throw new Error("map is read-only")}:b instanceof Set&&(b.add=b.clear=b.delete=function(){throw new Error("set is read-only")}),Object.freeze(b),Object.getOwnPropertyNames(b).forEach((x=>{const q=b[x],ne=typeof q;(ne==="object"||ne==="function")&&!Object.isFrozen(q)&&n(q)})),b}class e{constructor(x){x.data===void 0&&(x.data={}),this.data=x.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function t(b){return b.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(b,...x){const q=Object.create(null);for(const ne in b)q[ne]=b[ne];return x.forEach((function(ne){for(const Ae in ne)q[Ae]=ne[Ae]})),q}const s="</span>",i=b=>!!b.scope,a=(b,{prefix:x})=>{if(b.startsWith("language:"))return b.replace("language:","language-");if(b.includes(".")){const q=b.split(".");return[`${x}${q.shift()}`,...q.map(((ne,Ae)=>`${ne}${"_".repeat(Ae+1)}`))].join(" ")}return`${x}${b}`};class l{constructor(x,q){this.buffer="",this.classPrefix=q.classPrefix,x.walk(this)}addText(x){this.buffer+=t(x)}openNode(x){if(!i(x))return;const q=a(x.scope,{prefix:this.classPrefix});this.span(q)}closeNode(x){i(x)&&(this.buffer+=s)}value(){return this.buffer}span(x){this.buffer+=`<span class="${x}">`}}const c=(b={})=>{const x={children:[]};return Object.assign(x,b),x};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(x){this.top.children.push(x)}openNode(x){const q=c({scope:x});this.add(q),this.stack.push(q)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(x){return this.constructor._walk(x,this.rootNode)}static _walk(x,q){return typeof q=="string"?x.addText(q):q.children&&(x.openNode(q),q.children.forEach((ne=>this._walk(x,ne))),x.closeNode(q)),x}static _collapse(x){typeof x!="string"&&x.children&&(x.children.every((q=>typeof q=="string"))?x.children=[x.children.join("")]:x.children.forEach((q=>{u._collapse(q)})))}}class f extends u{constructor(x){super(),this.options=x}addText(x){x!==""&&this.add(x)}startScope(x){this.openNode(x)}endScope(){this.closeNode()}__addSublanguage(x,q){const ne=x.root;q&&(ne.scope=`language:${q}`),this.add(ne)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function g(b){return b?typeof b=="string"?b:b.source:null}function h(b){return _("(?=",b,")")}function p(b){return _("(?:",b,")*")}function y(b){return _("(?:",b,")?")}function _(...b){return b.map((q=>g(q))).join("")}function N(b){const x=b[b.length-1];return typeof x=="object"&&x.constructor===Object?(b.splice(b.length-1,1),x):{}}function T(...b){return"("+(N(b).capture?"":"?:")+b.map((ne=>g(ne))).join("|")+")"}function S(b){return new RegExp(b.toString()+"|").exec("").length-1}function k(b,x){const q=b&&b.exec(x);return q&&q.index===0}const F=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function B(b,{joinWith:x}){let q=0;return b.map((ne=>{q+=1;const Ae=q;let Le=g(ne),j="";for(;Le.length>0;){const K=F.exec(Le);if(!K){j+=Le;break}j+=Le.substring(0,K.index),Le=Le.substring(K.index+K[0].length),K[0][0]==="\\"&&K[1]?j+="\\"+String(Number(K[1])+Ae):(j+=K[0],K[0]==="("&&q++)}return j})).map((ne=>`(${ne})`)).join(x)}const G=/\b\B/,he="[a-zA-Z]\\w*",P="[a-zA-Z_]\\w*",se="\\b\\d+(\\.\\d+)?",ie="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",m="\\b(0b[01]+)",L="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",v=(b={})=>{const x=/^#![ ]*\//;return b.binary&&(b.begin=_(x,/.*\b/,b.binary,/\b.*/)),r({scope:"meta",begin:x,end:/$/,relevance:0,"on:begin":(q,ne)=>{q.index!==0&&ne.ignoreMatch()}},b)},C={begin:"\\\\[\\s\\S]",relevance:0},R={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[C]},O={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[C]},D={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(b,x,q={}){const ne=r({scope:"comment",begin:b,end:x,contains:[]},q);ne.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 Ae=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 ne.contains.push({begin:_(/[ ]+/,"(",Ae,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),ne},z=M("//","$"),$=M("/\\*","\\*/"),ee=M("#","$"),J={scope:"number",begin:se,relevance:0},ae={scope:"number",begin:ie,relevance:0},fe={scope:"number",begin:m,relevance:0},X={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[C,{begin:/\[/,end:/\]/,relevance:0,contains:[C]}]},xe={scope:"title",begin:he,relevance:0},Oe={scope:"title",begin:P,relevance:0},ce={begin:"\\.\\s*"+P,relevance:0};var pe=Object.freeze({__proto__:null,APOS_STRING_MODE:R,BACKSLASH_ESCAPE:C,BINARY_NUMBER_MODE:fe,BINARY_NUMBER_RE:m,COMMENT:M,C_BLOCK_COMMENT_MODE:$,C_LINE_COMMENT_MODE:z,C_NUMBER_MODE:ae,C_NUMBER_RE:ie,END_SAME_AS_BEGIN:function(b){return Object.assign(b,{"on:begin":(x,q)=>{q.data._beginMatch=x[1]},"on:end":(x,q)=>{q.data._beginMatch!==x[1]&&q.ignoreMatch()}})},HASH_COMMENT_MODE:ee,IDENT_RE:he,MATCH_NOTHING_RE:G,METHOD_GUARD:ce,NUMBER_MODE:J,NUMBER_RE:se,PHRASAL_WORDS_MODE:D,QUOTE_STRING_MODE:O,REGEXP_MODE:X,RE_STARTERS_RE:L,SHEBANG:v,TITLE_MODE:xe,UNDERSCORE_IDENT_RE:P,UNDERSCORE_TITLE_MODE:Oe});function ye(b,x){b.input[b.index-1]==="."&&x.ignoreMatch()}function Ne(b,x){b.className!==void 0&&(b.scope=b.className,delete b.className)}function Te(b,x){x&&b.beginKeywords&&(b.begin="\\b("+b.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",b.__beforeBegin=ye,b.keywords=b.keywords||b.beginKeywords,delete b.beginKeywords,b.relevance===void 0&&(b.relevance=0))}function Be(b,x){Array.isArray(b.illegal)&&(b.illegal=T(...b.illegal))}function je(b,x){if(b.match){if(b.begin||b.end)throw new Error("begin & end are not supported with match");b.begin=b.match,delete b.match}}function En(b,x){b.relevance===void 0&&(b.relevance=1)}const Fn=(b,x)=>{if(!b.beforeMatch)return;if(b.starts)throw new Error("beforeMatch cannot be used with starts");const q=Object.assign({},b);Object.keys(b).forEach((ne=>{delete b[ne]})),b.keywords=q.keywords,b.begin=_(q.beforeMatch,h(q.begin)),b.starts={relevance:0,contains:[Object.assign(q,{endsParent:!0})]},b.relevance=0,delete q.beforeMatch},ur=["of","and","for","in","not","or","if","then","parent","list","value"],dr="keyword";function Ut(b,x,q=dr){const ne=Object.create(null);return typeof b=="string"?Ae(q,b.split(" ")):Array.isArray(b)?Ae(q,b):Object.keys(b).forEach((function(Le){Object.assign(ne,Ut(b[Le],x,Le))})),ne;function Ae(Le,j){x&&(j=j.map((K=>K.toLowerCase()))),j.forEach((function(K){const re=K.split("|");ne[re[0]]=[Le,yn(re[0],re[1])]}))}}function yn(b,x){return x?Number(x):Hn(b)?0:1}function Hn(b){return ur.includes(b.toLowerCase())}const _n={},Ke=b=>{console.error(b)},Ft=(b,...x)=>{console.log(`WARN: ${b}`,...x)},Ct=(b,x)=>{_n[`${b}/${x}`]||(console.log(`Deprecated as of ${b}. ${x}`),_n[`${b}/${x}`]=!0)},lt=new Error;function Ht(b,x,{key:q}){let ne=0;const Ae=b[q],Le={},j={};for(let K=1;K<=x.length;K++)j[K+ne]=Ae[K],Le[K+ne]=!0,ne+=S(x[K-1]);b[q]=j,b[q]._emit=Le,b[q]._multi=!0}function vn(b){if(Array.isArray(b.begin)){if(b.skip||b.excludeBegin||b.returnBegin)throw Ke("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),lt;if(typeof b.beginScope!="object"||b.beginScope===null)throw Ke("beginScope must be object"),lt;Ht(b,b.begin,{key:"beginScope"}),b.begin=B(b.begin,{joinWith:""})}}function rt(b){if(Array.isArray(b.end)){if(b.skip||b.excludeEnd||b.returnEnd)throw Ke("skip, excludeEnd, returnEnd not compatible with endScope: {}"),lt;if(typeof b.endScope!="object"||b.endScope===null)throw Ke("endScope must be object"),lt;Ht(b,b.end,{key:"endScope"}),b.end=B(b.end,{joinWith:""})}}function zn(b){b.scope&&typeof b.scope=="object"&&b.scope!==null&&(b.beginScope=b.scope,delete b.scope)}function jn(b){zn(b),typeof b.beginScope=="string"&&(b.beginScope={_wrap:b.beginScope}),typeof b.endScope=="string"&&(b.endScope={_wrap:b.endScope}),vn(b),rt(b)}function hr(b){function x(j,K){return new RegExp(g(j),"m"+(b.case_insensitive?"i":"")+(b.unicodeRegex?"u":"")+(K?"g":""))}class q{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(K,re){re.position=this.position++,this.matchIndexes[this.matchAt]=re,this.regexes.push([re,K]),this.matchAt+=S(K)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const K=this.regexes.map((re=>re[1]));this.matcherRe=x(B(K,{joinWith:"|"}),!0),this.lastIndex=0}exec(K){this.matcherRe.lastIndex=this.lastIndex;const re=this.matcherRe.exec(K);if(!re)return null;const $e=re.findIndex(((yt,qe)=>qe>0&&yt!==void 0)),Re=this.matchIndexes[$e];return re.splice(0,$e),Object.assign(re,Re)}}class ne{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(K){if(this.multiRegexes[K])return this.multiRegexes[K];const re=new q;return this.rules.slice(K).forEach((([$e,Re])=>re.addRule($e,Re))),re.compile(),this.multiRegexes[K]=re,re}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(K,re){this.rules.push([K,re]),re.type==="begin"&&this.count++}exec(K){const re=this.getMatcher(this.regexIndex);re.lastIndex=this.lastIndex;let $e=re.exec(K);if(this.resumingScanAtSamePosition()&&!($e&&$e.index===this.lastIndex)){const Re=this.getMatcher(0);Re.lastIndex=this.lastIndex+1,$e=Re.exec(K)}return $e&&(this.regexIndex+=$e.position+1,this.regexIndex===this.count&&this.considerAll()),$e}}function Ae(j){const K=new ne;return j.contains.forEach((re=>K.addRule(re.begin,{rule:re,type:"begin"}))),j.terminatorEnd&&K.addRule(j.terminatorEnd,{type:"end"}),j.illegal&&K.addRule(j.illegal,{type:"illegal"}),K}function Le(j,K){const re=j;if(j.isCompiled)return re;[Ne,je,jn,Fn].forEach((Re=>Re(j,K))),b.compilerExtensions.forEach((Re=>Re(j,K))),j.__beforeBegin=null,[Te,Be,En].forEach((Re=>Re(j,K))),j.isCompiled=!0;let $e=null;return typeof j.keywords=="object"&&j.keywords.$pattern&&(j.keywords=Object.assign({},j.keywords),$e=j.keywords.$pattern,delete j.keywords.$pattern),$e=$e||/\w+/,j.keywords&&(j.keywords=Ut(j.keywords,b.case_insensitive)),re.keywordPatternRe=x($e,!0),K&&(j.begin||(j.begin=/\B|\b/),re.beginRe=x(re.begin),!j.end&&!j.endsWithParent&&(j.end=/\B|\b/),j.end&&(re.endRe=x(re.end)),re.terminatorEnd=g(re.end)||"",j.endsWithParent&&K.terminatorEnd&&(re.terminatorEnd+=(j.end?"|":"")+K.terminatorEnd)),j.illegal&&(re.illegalRe=x(j.illegal)),j.contains||(j.contains=[]),j.contains=[].concat(...j.contains.map((function(Re){return Jt(Re==="self"?j:Re)}))),j.contains.forEach((function(Re){Le(Re,re)})),j.starts&&Le(j.starts,K),re.matcher=Ae(re),re}if(b.compilerExtensions||(b.compilerExtensions=[]),b.contains&&b.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return b.classNameAliases=r(b.classNameAliases||{}),Le(b)}function Xt(b){return b?b.endsWithParent||Xt(b.starts):!1}function Jt(b){return b.variants&&!b.cachedVariants&&(b.cachedVariants=b.variants.map((function(x){return r(b,{variants:null},x)}))),b.cachedVariants?b.cachedVariants:Xt(b)?r(b,{starts:b.starts?r(b.starts):null}):Object.isFrozen(b)?r(b):b}var Kn="11.11.1";class en extends Error{constructor(x,q){super(x),this.name="HTMLInjectionError",this.html=q}}const Et=t,st=r,zt=Symbol("nomatch"),Nn=7,Rt=function(b){const x=Object.create(null),q=Object.create(null),ne=[];let Ae=!0;const Le="Could not find the language '{}', did you forget to load/include a language module?",j={disableAutodetect:!0,name:"Plain text",contains:[]};let K={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:f};function re(I){return K.noHighlightRe.test(I)}function $e(I){let V=I.className+" ";V+=I.parentNode?I.parentNode.className:"";const de=K.languageDetectRe.exec(V);if(de){const we=ke(de[1]);return we||(Ft(Le.replace("{}",de[1])),Ft("Falling back to no-highlight mode for this block.",I)),we?de[1]:"no-highlight"}return V.split(/\s+/).find((we=>re(we)||ke(we)))}function Re(I,V,de){let we="",Me="";typeof V=="object"?(we=I,de=V.ignoreIllegals,Me=V.language):(Ct("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ct("10.7.0",`Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277`),Me=I,we=V),de===void 0&&(de=!0);const Je={code:we,language:Me};_t("before:highlight",Je);const ut=Je.result?Je.result:yt(Je.language,Je.code,de);return ut.code=Je.code,_t("after:highlight",ut),ut}function yt(I,V,de,we){const Me=Object.create(null);function Je(U,H){return U.keywords[H]}function ut(){if(!te.keywords){Pe.addText(ge);return}let U=0;te.keywordPatternRe.lastIndex=0;let H=te.keywordPatternRe.exec(ge),oe="";for(;H;){oe+=ge.substring(U,H.index);const me=it.case_insensitive?H[0].toLowerCase():H[0],De=Je(te,me);if(De){const[tt,sn]=De;if(Pe.addText(oe),oe="",Me[me]=(Me[me]||0)+1,Me[me]<=Nn&&(rn+=sn),tt.startsWith("_"))oe+=H[0];else{const Sr=it.classNameAliases[tt]||tt;We(H[0],Sr)}}else oe+=H[0];U=te.keywordPatternRe.lastIndex,H=te.keywordPatternRe.exec(ge)}oe+=ge.substring(U),Pe.addText(oe)}function nn(){if(ge==="")return;let U=null;if(typeof te.subLanguage=="string"){if(!x[te.subLanguage]){Pe.addText(ge);return}U=yt(te.subLanguage,ge,!0,dt[te.subLanguage]),dt[te.subLanguage]=U._top}else U=Tn(ge,te.subLanguage.length?te.subLanguage:null);te.relevance>0&&(rn+=U.relevance),Pe.__addSublanguage(U._emitter,U.language)}function Ue(){te.subLanguage!=null?nn():ut(),ge=""}function We(U,H){U!==""&&(Pe.startScope(H),Pe.addText(U),Pe.endScope())}function It(U,H){let oe=1;const me=H.length-1;for(;oe<=me;){if(!U._emit[oe]){oe++;continue}const De=it.classNameAliases[U[oe]]||U[oe],tt=H[oe];De?We(tt,De):(ge=tt,ut(),ge=""),oe++}}function wn(U,H){return U.scope&&typeof U.scope=="string"&&Pe.openNode(it.classNameAliases[U.scope]||U.scope),U.beginScope&&(U.beginScope._wrap?(We(ge,it.classNameAliases[U.beginScope._wrap]||U.beginScope._wrap),ge=""):U.beginScope._multi&&(It(U.beginScope,H),ge="")),te=Object.create(U,{parent:{value:te}}),te}function Sn(U,H,oe){let me=k(U.endRe,oe);if(me){if(U["on:end"]){const De=new e(U);U["on:end"](H,De),De.isMatchIgnored&&(me=!1)}if(me){for(;U.endsParent&&U.parent;)U=U.parent;return U}}if(U.endsWithParent)return Sn(U.parent,H,oe)}function Nr(U){return te.matcher.regexIndex===0?(ge+=U[0],1):(On=!0,0)}function Tr(U){const H=U[0],oe=U.rule,me=new e(oe),De=[oe.__beforeBegin,oe["on:begin"]];for(const tt of De)if(tt&&(tt(U,me),me.isMatchIgnored))return Nr(H);return oe.skip?ge+=H:(oe.excludeBegin&&(ge+=H),Ue(),!oe.returnBegin&&!oe.excludeBegin&&(ge=H)),wn(oe,U),oe.returnBegin?0:H.length}function Ar(U){const H=U[0],oe=V.substring(U.index),me=Sn(te,U,oe);if(!me)return zt;const De=te;te.endScope&&te.endScope._wrap?(Ue(),We(H,te.endScope._wrap)):te.endScope&&te.endScope._multi?(Ue(),It(te.endScope,U)):De.skip?ge+=H:(De.returnEnd||De.excludeEnd||(ge+=H),Ue(),De.excludeEnd&&(ge=H));do{te.scope&&Pe.closeNode(),!te.skip&&!te.subLanguage&&(rn+=te.relevance),te=te.parent}while(te!==me.parent);return me.starts&&wn(me.starts,U),De.returnEnd?0:H.length}function wr(){const U=[];for(let H=te;H!==it;H=H.parent)H.scope&&U.unshift(H.scope);U.forEach((H=>Pe.openNode(H)))}let kt={};function Yn(U,H){const oe=H&&H[0];if(ge+=U,oe==null)return Ue(),0;if(kt.type==="begin"&&H.type==="end"&&kt.index===H.index&&oe===""){if(ge+=V.slice(H.index,H.index+1),!Ae){const me=new Error(`0 width match regex (${I})`);throw me.languageName=I,me.badRule=kt.rule,me}return 1}if(kt=H,H.type==="begin")return Tr(H);if(H.type==="illegal"&&!de){const me=new Error('Illegal lexeme "'+oe+'" for mode "'+(te.scope||"<unnamed>")+'"');throw me.mode=te,me}else if(H.type==="end"){const me=Ar(H);if(me!==zt)return me}if(H.type==="illegal"&&oe==="")return ge+=`\n`,1;if(xn>1e5&&xn>H.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ge+=oe,oe.length}const it=ke(I);if(!it)throw Ke(Le.replace("{}",I)),new Error('Unknown language: "'+I+'"');const jt=hr(it);let et="",te=we||jt;const dt={},Pe=new K.__emitter(K);wr();let ge="",rn=0,vt=0,xn=0,On=!1;try{if(it.__emitTokens)it.__emitTokens(V,Pe);else{for(te.matcher.considerAll();;){xn++,On?On=!1:te.matcher.considerAll(),te.matcher.lastIndex=vt;const U=te.matcher.exec(V);if(!U)break;const H=V.substring(vt,U.index),oe=Yn(H,U);vt=U.index+oe}Yn(V.substring(vt))}return Pe.finalize(),et=Pe.toHTML(),{language:I,value:et,relevance:rn,illegal:!1,_emitter:Pe,_top:te}}catch(U){if(U.message&&U.message.includes("Illegal"))return{language:I,value:Et(V),illegal:!0,relevance:0,_illegalBy:{message:U.message,index:vt,context:V.slice(vt-100,vt+100),mode:U.mode,resultSoFar:et},_emitter:Pe};if(Ae)return{language:I,value:Et(V),illegal:!1,relevance:0,errorRaised:U,_emitter:Pe,_top:te};throw U}}function qe(I){const V={value:Et(I),illegal:!1,relevance:0,_top:j,_emitter:new K.__emitter(K)};return V._emitter.addText(I),V}function Tn(I,V){V=V||K.languages||Object.keys(x);const de=qe(I),we=V.filter(ke).filter(Zn).map((Ue=>yt(Ue,I,!1)));we.unshift(de);const Me=we.sort(((Ue,We)=>{if(Ue.relevance!==We.relevance)return We.relevance-Ue.relevance;if(Ue.language&&We.language){if(ke(Ue.language).supersetOf===We.language)return 1;if(ke(We.language).supersetOf===Ue.language)return-1}return 0})),[Je,ut]=Me,nn=Je;return nn.secondBest=ut,nn}function fr(I,V,de){const we=V&&q[V]||de;I.classList.add("hljs"),I.classList.add(`language-${we}`)}function An(I){let V=null;const de=$e(I);if(re(de))return;if(_t("before:highlightElement",{el:I,language:de}),I.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",I);return}if(I.children.length>0&&(K.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)),K.throwUnescapedHTML))throw new en("One of your code blocks includes unescaped HTML.",I.innerHTML);V=I;const we=V.textContent,Me=de?Re(we,{language:de,ignoreIllegals:!0}):Tn(we);I.innerHTML=Me.value,I.dataset.highlighted="yes",fr(I,de,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}),_t("after:highlightElement",{el:I,result:Me,text:we})}function gr(I){K=st(K,I)}const pr=()=>{tn(),Ct("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ge(){tn(),Ct("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Gn=!1;function tn(){function I(){tn()}if(document.readyState==="loading"){Gn||window.addEventListener("DOMContentLoaded",I,!1),Gn=!0;return}document.querySelectorAll(K.cssSelector).forEach(An)}function mr(I,V){let de=null;try{de=V(b)}catch(we){if(Ke("Language definition for '{}' could not be registered.".replace("{}",I)),Ae)Ke(we);else throw we;de=j}de.name||(de.name=I),x[I]=de,de.rawDefinition=V.bind(null,b),de.aliases&&Vn(de.aliases,{languageName:I})}function br(I){delete x[I];for(const V of Object.keys(q))q[V]===I&&delete q[V]}function Er(){return Object.keys(x)}function ke(I){return I=(I||"").toLowerCase(),x[I]||x[q[I]]}function Vn(I,{languageName:V}){typeof I=="string"&&(I=[I]),I.forEach((de=>{q[de.toLowerCase()]=V}))}function Zn(I){const V=ke(I);return V&&!V.disableAutodetect}function yr(I){I["before:highlightBlock"]&&!I["before:highlightElement"]&&(I["before:highlightElement"]=V=>{I["before:highlightBlock"](Object.assign({block:V.el},V))}),I["after:highlightBlock"]&&!I["after:highlightElement"]&&(I["after:highlightElement"]=V=>{I["after:highlightBlock"](Object.assign({block:V.el},V))})}function _r(I){yr(I),ne.push(I)}function vr(I){const V=ne.indexOf(I);V!==-1&&ne.splice(V,1)}function _t(I,V){const de=I;ne.forEach((function(we){we[de]&&we[de](V)}))}function Wn(I){return Ct("10.7.0","highlightBlock will be removed entirely in v12.0"),Ct("10.7.0","Please use highlightElement now."),An(I)}Object.assign(b,{highlight:Re,highlightAuto:Tn,highlightAll:tn,highlightElement:An,highlightBlock:Wn,configure:gr,initHighlighting:pr,initHighlightingOnLoad:Ge,registerLanguage:mr,unregisterLanguage:br,listLanguages:Er,getLanguage:ke,registerAliases:Vn,autoDetection:Zn,inherit:st,addPlugin:_r,removePlugin:vr}),b.debugMode=function(){Ae=!1},b.safeMode=function(){Ae=!0},b.versionString=Kn,b.regex={concat:_,lookahead:h,either:T,optional:y,anyNumberOfTimes:p};for(const I in pe)typeof pe[I]=="object"&&n(pe[I]);return Object.assign(b,pe),b},ct=Rt({});return ct.newInstance=()=>Rt({}),Qs=ct,ct.HighlightJS=ct,ct.default=ct,Qs}var nb=tb();const ze=Si(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:/\\'/},g={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},n.NUMBER_MODE,t]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=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},_=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],N=["true","false"],T={match:/(\/[a-z._-]+)+/},S=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],k=["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"],B=["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:_,literal:N,built_in:[...S,...k,"set","shopt",...F,...B]},contains:[p,n.SHEBANG(),y,g,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:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:e.optional(s)+n.IDENT_RE,relevance:0},p=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=[g,l,t,n.C_BLOCK_COMMENT_MODE,f,u],S={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},k={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:N,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:N,relevance:0},{begin:p,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,g]};return{name:"C",aliases:["h"],keywords:N,disableAutodetect:!0,illegal:"</",contains:[].concat(S,k,T,[g,{begin:n.IDENT_RE+"::",keywords:N},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},n.TITLE_MODE]}]),exports:{preprocessor:g,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},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:e.optional(s)+n.IDENT_RE,relevance:0},p=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"],_=["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","flat_map","flat_set","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:_,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:N},B={className:"function.dispatch",relevance:0,keywords:{_hint:T},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,n.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},G=[B,g,l,t,n.C_BLOCK_COMMENT_MODE,f,u],he={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:F,contains:G.concat([{begin:/\(/,end:/\)/,keywords:F,contains:G.concat(["self"]),relevance:0}]),relevance:0},P={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:F,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:F,relevance:0},{begin:p,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,g]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:F,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(he,P,B,G,[g,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\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 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","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","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:'""'}]},g=n.inherit(f,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:a},p=n.inherit(h,{illegal:/\n/}),y={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},n.BACKSLASH_ESCAPE,p]},_={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},N=n.inherit(_,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[_,y,f,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,c,n.C_BLOCK_COMMENT_MODE],p.contains=[N,y,g,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]},S={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},k=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,S,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,S,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:"("+k+"\\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,S],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 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","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","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-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-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-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","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","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","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","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","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","masonry-auto-flow","math-depth","math-shift","math-style","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","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-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","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","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","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","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-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].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 nr="[0-9](_*[0-9])*",ds=`\\.(${nr})`,hs="[0-9a-fA-F](_*[0-9a-fA-F])*",Wa={className:"number",variants:[{begin:`(\\b(${nr})((${ds})|\\.)?|(${ds}))[eE][+-]?(${nr})[fFdD]?\\b`},{begin:`\\b(${nr})((${ds})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${ds})[fFdD]?\\b`},{begin:`\\b(${nr})[fFdD]\\b`},{begin:`\\b0[xX]((${hs})\\.?|(${hs})?\\.(${hs}))[pP][+-]?(${nr})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${hs})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function yl(n,e,t){return t===-1?"":n.replace(e,(r=>yl(n,e,t-1)))}function mb(n){const e=n.regex,t="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=t+yl("(?:<"+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","when"],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,Wa,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},Wa,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","using"],Eb=["true","false","null","undefined","NaN","Infinity"],_l=["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"],vl=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Nl=["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(Nl,_l,vl);function vb(n){const e=n.regex,t=(M,{after:z})=>{const $="</"+M[0].slice(1);return M.input.indexOf($,z)!==-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,z)=>{const $=M[0].length+M.index,ee=M.input[$];if(ee==="<"||ee===","){z.ignoreMatch();return}ee===">"&&(t(M,{after:$})||z.ignoreMatch());let J;const ae=M.input.substring($);if(J=ae.match(/^\s*=/)){z.ignoreMatch();return}if((J=ae.match(/^\s+extends\s+/))&&J.index===0){z.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]*",g={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:[]},p={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"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,h]},S={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]},k=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,p,y,_,N,{match:/\$\d+/},g];h.contains=k.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(k)});const F=[].concat(S,h.contains),B=F.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(F)}]),G={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B},he={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"}}]},P={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:{_:[..._l,...vl]}},se={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ie={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[G],illegal:/%/},m={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function L(M){return e.concat("(?!",M.join("|"),")")}const v={match:e.concat(/\b/,L([...Nl,"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},R={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},G]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",D={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[G]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:P},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),se,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,p,y,_,N,S,{match:/\$\d+/},g,P,{scope:"attr",match:r+e.lookahead(":"),relevance:0},D,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[S,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:B}]}]},{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"]}]}]},ie,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[G,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:[G]},v,m,he,R,{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}]},g=n.inherit(u,{contains:[]}),h=n.inherit(f,{contains:[]});u.contains.push(h),f.contains.push(g);let p=[t,c];return[u,f,g,h].forEach((T=>{T.contains=T.contains.concat(p)})),p=p.concat(u,f),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},t,i,u,f,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},s,r,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function 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=e.concat(/[A-Z]+/,t),a={scope:"variable",match:"\\$+"+r},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=n.inherit(n.APOS_STRING_MODE,{illegal:null}),f=n.inherit(n.QUOTE_STRING_MODE,{illegal:null,contains:n.QUOTE_STRING_MODE.contains.concat(c)}),g={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:n.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(C,R)=>{R.data._beginMatch=C[1]||C[2]},"on:end":(C,R)=>{R.data._beginMatch!==C[1]&&R.ignoreMatch()}},h=n.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ \t\n]`,y={scope:"string",variants:[f,u,g,h]},_={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},N=["false","null","true"],T=["__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"],S=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],F={keyword:T,literal:(C=>{const R=[];return C.forEach((O=>{R.push(O),O.toLowerCase()===O?R.push(O.toUpperCase()):R.push(O.toLowerCase())})),R})(N),built_in:S},B=C=>C.map((R=>R.replace(/\|\d+$/,""))),G={variants:[{match:[/new/,e.concat(p,"+"),e.concat("(?!",B(S).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},he=e.concat(r,"\\b(?!\\()"),P={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),he],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,e.concat(/::/,e.lookahead(/(?!class\b)/)),he],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"}}]},se={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},ie={relevance:0,begin:/\(/,end:/\)/,keywords:F,contains:[se,a,P,n.C_BLOCK_COMMENT_MODE,y,_,G]},m={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",B(T).join("\\b|"),"|",B(S).join("\\b|"),"\\b)"),r,e.concat(p,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[ie]};ie.contains.push(m);const L=[se,P,n.C_BLOCK_COMMENT_MODE,y,_,G],v={begin:e.concat(/#\[\s*\\?/,e.either(s,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:N,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:N,keyword:["new","array"]},contains:["self",...L]},...L,{scope:"meta",variants:[{match:s},{match:i}]}]};return{case_insensitive:!1,keywords:F,contains:[v,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}]}},l,{scope:"variable.language",match:/\$this\b/},a,m,P,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},G,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},n.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:F,contains:["self",v,a,P,n.C_BLOCK_COMMENT_MODE,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]},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},g={className:"string",contains:[n.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,c,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])*",p=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,y=`\\b|${r.join("|")}`,_={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${y})`},{begin:`(${p})[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,_,g,n.HASH_COMMENT_MODE]}]};return u.contains=[g,_,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,_,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,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:[_,T,g]}]}}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},g={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",p="[0-9](_?[0-9])*",y={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},_={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},G=[g,{variants:[{match:[/class\s+/,s,/\s+<\s+/,s]},{match:[/\b(class|module)\s+/,s]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,s],scope:{2:"title.class"},keywords:a},{relevance:0,match:[s,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[_]},{begin:n.IDENT_RE+"::"},{className:"symbol",begin:n.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[g,{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=G,_.contains=G;const ie=[{begin:/^\s*=>/,starts:{end:"$",contains:G}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:G}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[n.SHEBANG({binary:"ruby"})].concat(ie).concat(u).concat(G)}}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:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{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={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},s={begin:/"/,end:/"/,contains:[{match:/""/}]},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"],g=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],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"],p=f,y=[...u,...c].filter((B=>!f.includes(B))),_={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},N={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},T={match:e.concat(/\b/,e.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function S(B){return e.concat(/\b/,e.either(...B.map((G=>G.replace(/\s+/,"\\s+")))),/\b/)}const k={scope:"keyword",match:S(h),relevance:0};function F(B,{exceptions:G,when:he}={}){const P=he;return G=G||[],B.map((se=>se.match(/\|\d+$/)||G.includes(se)?se:P(se)?`${se}|0`:se))}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:F(y,{when:B=>B.length<3}),literal:i,type:l,built_in:g},contains:[{scope:"type",match:S(a)},k,T,_,r,s,n.C_NUMBER_MODE,n.C_BLOCK_COMMENT_MODE,t,N]}}const Ns="[A-Za-z$_][0-9A-Za-z$_]*",Tl=["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","using"],Al=["true","false","null","undefined","NaN","Infinity"],wl=["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"],Sl=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],xl=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ol=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ll=[].concat(xl,wl,Sl);function Cb(n){const e=n.regex,t=(M,{after:z})=>{const $="</"+M[0].slice(1);return M.input.indexOf($,z)!==-1},r=Ns,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,z)=>{const $=M[0].length+M.index,ee=M.input[$];if(ee==="<"||ee===","){z.ignoreMatch();return}ee===">"&&(t(M,{after:$})||z.ignoreMatch());let J;const ae=M.input.substring($);if(J=ae.match(/^\s*=/)){z.ignoreMatch();return}if((J=ae.match(/^\s+extends\s+/))&&J.index===0){z.ignoreMatch();return}}},l={$pattern:Ns,keyword:Tl,literal:Al,built_in:Ll,"variable.language":Ol},c="[0-9](_?[0-9])*",u=`\\.(${c})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={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:[]},p={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"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,h]},S={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]},k=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,p,y,_,N,{match:/\$\d+/},g];h.contains=k.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(k)});const F=[].concat(S,h.contains),B=F.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(F)}]),G={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B},he={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"}}]},P={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:{_:[...wl,...Sl]}},se={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ie={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[G],illegal:/%/},m={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function L(M){return e.concat("(?!",M.join("|"),")")}const v={match:e.concat(/\b/,L([...xl,"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},R={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},G]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",D={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[G]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:P},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),se,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,p,y,_,N,S,{match:/\$\d+/},g,P,{scope:"attr",match:r+e.lookahead(":"),relevance:0},D,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[S,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:B}]}]},{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"]}]}]},ie,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[G,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:[G]},v,m,he,R,{match:/\$[(.]/}]}}function Rb(n){const e=n.regex,t=Cb(n),r=Ns,s=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,n.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:s},contains:[t.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:Ns,keyword:Tl.concat(c),literal:Al,built_in:Ll.concat(s),"variable.language":Ol},f={className:"meta",begin:"@"+r},g=(_,N,T)=>{const S=_.contains.findIndex((k=>k.label===N));if(S===-1)throw new Error("can not find mode to replace");_.contains.splice(S,1,T)};Object.assign(t.keywords,u),t.exports.PARAMS_CONTAINS.push(f);const h=t.contains.find((_=>_.scope==="attr")),p=Object.assign({},h,{match:e.concat(r,e.lookahead(/\s*\?:/))});t.exports.PARAMS_CONTAINS.push([t.exports.CLASS_REFERENCE,h,p]),t.contains=t.contains.concat([f,i,a,p]),g(t,"shebang",n.SHEBANG()),g(t,"use_strict",l);const y=t.contains.find((_=>_.label==="func.def"));return y.relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),t}function Ib(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,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[n.BACKSLASH_ESCAPE,s]},l=n.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={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"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},y={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},_={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},N=[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}},h,{className:"number",begin:n.C_NUMBER_RE+"\\b",relevance:0},y,_,i,a],T=[...N];return T.pop(),T.push(l),p.contains=T,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:N}}ze.registerLanguage("bash",rb);ze.registerLanguage("c",sb);ze.registerLanguage("cpp",ib);ze.registerLanguage("cs",ab);ze.registerLanguage("css",pb);ze.registerLanguage("java",mb);ze.registerLanguage("javascript",vb);ze.registerLanguage("json",Nb);ze.registerLanguage("markdown",Tb);ze.registerLanguage("plain",wb);ze.registerLanguage("php",Ab);ze.registerLanguage("python",Sb);ze.registerLanguage("sql",Lb);ze.registerLanguage("typescript",Rb);ze.registerLanguage("ruby",xb);ze.registerLanguage("rust",Ob);ze.registerLanguage("xml",Ib);ze.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 fs({children:n,btnClass:e,tooltipText:t,btnText:r}){return(()=>{var s=Db(),i=s.firstChild;return ps(s,`QpTooltip ${e}`),ue(s,n,i),ue(s,r,i),ue(i,t),s})()}var Bb=be("<button type=button class=ql-code>"),$b=be("<button type=button class=ql-code-block>"),qb=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}=bn(n),i=[Bb(),(()=>{var a=$b();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,g=f.nextSibling,h=g.nextSibling,p=h.nextSibling,y=p.nextSibling,_=y.nextSibling,N=_.nextSibling,T=N.nextSibling;return ue(a,(()=>e?.code&&i),_),ue(a,Dt(fs,{btnClass:"ql-html-snippet",get tooltipText(){return s("CustomToolbar.insertHtmlSnippetMessage")},get children(){return qb()}}),T),ue(a,Dt(fs,{btnClass:"ql-obfuscate",get tooltipText(){return s("CustomToolbar.obfuscate")},get children(){return Pb()}}),T),ue(a,t&&Dt(fs,{btnClass:"ql-video-plugin",get tooltipText(){return s("videoPlugin.insertVideo")},get children(){return Fb()}}),T),ue(a,r&&Dt(fs,{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}=bn(n),c=r.configuration,f=r.fieldType.backOffice?.editorRows??26,g=zb({language:n,configuration:c,videoPluginHook:i,internalLinkPluginHook:a});let h=!1;const p=(()=>{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,S){if(!r.uploadMedia)return;const k=S.toBlob(),F=new File([k],`${l("image")}-${(new Date).getTime()}.${T.split("/")[1]}`,{type:T}),B=await r.uploadMedia(F);B&&s(B)}const _=new A(p,{modules:{toolbar:g,syntax:c.code?{hljs:ze,languages:Mb,interval:1e3}:!1,imageDropAndPaste:{handler:(T,S,k)=>{y(S,k).catch(r.logger.error)}}},theme:"snow"});_.on("text-change",((T,S,k)=>{if(!h)return;T.ops.forEach((async B=>{if(B.insert&&typeof B.insert=="string"){const G=B.insert;if(!i?.recognizeUrl(G))return;const P=pi(_);await El({editorContent:P,quillEditor:_,service:r,language:n,videoPluginHook:i,value:G})}}));const F={delta:_.getContents(),html:_.getSemanticHTML()};e(F.delta)}));const N=t();return _.setContents(N??new Z),_.history.clear(),h=!0,{element:(()=>{var T=Kb();return ue(T,g,null),ue(T,p,null),T})(),quill:_}}var ht={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 Vb{constructor(e,t,r){this.dataUrl=e,this.type=t,this.name=r||""}}class Hr extends Vb{constructor(e,t,r){super(e,t,r),this.dataUrl=e,this.type=t,this.name=r||`${ht.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 g=f.getContext("2d");if(g){g.drawImage(l,0,0,l.width,l.height);const h=this.type||"image/png",p=f.toDataURL(h,a);t(new Hr(p,h,this.name))}else r({message:"[error] QuillImageDropAndPaste: Fail to minify the image, create canvas context failure."})},l.src=ht.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=ht.resolveDataUrl(this.dataUrl,this.type).replace(/^[^,]+,/,""),t=ht.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 ks extends Zb{constructor(e,t){var r;super(e,t),typeof t.autoConvert!="boolean"&&(t.autoConvert=!0),t.enableNativeUploader!==!0&&ht.isObject(e.uploader)&&ht.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 Hr(t,r,s)):this.insert.call(this,ht.resolveDataUrl(t,r),r)}),e)}}handlePaste(e){if(e.clipboardData&&e.clipboardData.items&&e.clipboardData.items.length){if(ht.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 Hr(t,r)):this.insert(ht.resolveDataUrl(t,r),"image")}),e)}}readFiles(e,t,r){Array.prototype.forEach.call(e,(s=>{ht.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(ht.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&&ht.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}}ks.ImageData=Hr;window.QuillImageDropAndPaste=ks;"Quill"in window&&window.Quill.register("modules/imageDropAndPaste",ks);const Wb=A.import("blots/block/embed");function Yb(){return class extends Wb{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 Qb=A.import("blots/inline");function Xb(n){return class extends Qb{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 Jb=A.import("blots/block/embed"),Qa=["alt"];function e1(n){return class extends Jb{static blotName="media";static tagName="figure";static create(t){const r=super.create(t);return t1(n,r,t),r}static formats(t){return Qa.reduce(((r,s)=>(t.hasAttribute(s)&&(r[s]=t.getAttribute(s)),r)),{})}static match(t){return/\.(jpe?g|gif|png|webp)$/.test(t)||/^data:image\/.+;base64/.test(t)}static value(t){const{mediaId:r,resize:s}=t.dataset;if(!r)throw new Error('missing "media-id" attribute');const i=s&&eo(s)?s:void 0;if(!i)throw new Error('missing "resize" attribute');const a=ul(t),l=t.dataset.zoomable==="1",c=t.dataset.href?t.dataset.href:void 0;return{mediaId:r,resizeRule:i,align:a,zoomable:l,href:c}}format(t,r){Qa.indexOf(t)>-1?r?this.domNode.setAttribute(t,r):this.domNode.removeAttribute(t):super.format(t,r)}}}function t1(n,e,t){e.setAttribute("data-pa-blot","media"),e.setAttribute("contenteditable","false"),e.classList.add("MediaBlot","Fig");const r=document.createElement("img");if(r.classList.add("Fig-media"),t.align){const i=_m(t.align);i&&e.classList.add(i)}e.setAttribute("data-zoomable",t.zoomable?"1":"0"),t.zoomable&&e.classList.add("zoomable"),t.href&&(e.setAttribute("data-href",t.href),e.classList.add("asLink")),e.setAttribute("data-media-id",t.mediaId),e.setAttribute("data-resize",t.resizeRule);const s=mi({center:!0});e.appendChild(s),n1(n,e,r,s,t)}async function n1(n,e,t,r,s){try{const i=await n.useBackOfficeImage(s.mediaId,{resizeRule:s.resizeRule});if(!i)throw new Error(`Media ${s.mediaId} not found`);const{source:a,variant:l}=i;t.setAttribute("src",l.url),t.setAttribute("width",String(l.width)),t.setAttribute("height",String(l.height));const c=a.attachedData?.[n.contentLanguage]?.caption;if(c){const u=document.createElement("figcaption");u.classList.add("Fig-caption"),u.textContent=c,e.appendChild(u)}r1(e,a,s),e.removeChild(r),e.appendChild(t),e.setAttribute("data-source",JSON.stringify(a))}catch(i){n.logger.error("Error setting up media:",i),e.contains(r)&&e.removeChild(r)}}function r1(n,e,t){const r=document.createElement("div");if(r.classList.add("MediaBlot-flags"),e.pixelRatio!==void 0){const s=document.createElement("span");s.classList.add("MediaBlot-flag","Fig-flag--pixelRatio"),s.textContent=`${e.pixelRatio}×`,r.appendChild(s)}if(t.zoomable){const s=document.createElement("span");s.classList.add("MediaBlot-flag"),s.innerHTML=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5">\n <circle cx="6.5" cy="6.5" r="5"/>\n <path d="m10.04 10.04 4.46 4.46"/>\n</svg>`,r.appendChild(s)}if(t.href){const s=document.createElement("span");s.classList.add("MediaBlot-flag"),s.innerHTML=`<svg width="22" height="22" viewBox="0 0 16 16" fill="currentColor">\n <path d="M4.715 6.542 3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1.002 1.002 0 0 0-.154.199 2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4.018 4.018 0 0 1-.128-1.287z"/>\n <path d="M6.586 4.672A3 3 0 0 0 7.414 9.5l.775-.776a2 2 0 0 1-.896-3.346L9.12 3.55a2 2 0 1 1 2.83 2.83l-.793.792c.112.42.155.855.128 1.287l1.372-1.372a3 3 0 1 0-4.243-4.243L6.586 4.672z"/>\n</svg>`,r.appendChild(s)}n.appendChild(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 pl(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({service:n,videoPluginHook:e,internalLinkPluginHook:t}){A.register("formats/media",e1(n),!0),A.register("formats/html-snippet",Yb(),!0),A.register("formats/obfuscate",i1(),!0),A.register("formats/video-plugin",o1(e),!0),A.register("formats/internal-link-plugin",Xb(t),!0),A.register("modules/imageDropAndPaste",ks,!0)}function c1(){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 O1={create:d1,init:u1},Vt=c1();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",(()=>Vt.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]=ft(t),[a,l]=ft(n.language);l1({service:n,videoPluginHook:Vt.videoPlugin,internalLinkPluginHook:Vt.internalLinkPlugin});let c;const{element:u,quill:f}=Gb({language:a,value:s,setValue:N=>{const T=s();i(N),h1(N,T)||n.setModifiedValue({j:N})},service:n,videoPluginHook:Vt.videoPlugin,internalLinkPluginHook:Vt.internalLinkPlugin,insertMedia:async N=>await(c?.(N))}),g=Qm({quillEditor:f,service:n,language:a,videoPluginHook:Vt.videoPlugin,internalLinkPluginHook:Vt.internalLinkPlugin});c=g.insertMedia;const h=f.getModule("toolbar");h.addHandler("html-snippet",g.insertHtmlSnippetHandler),h.addHandler("obfuscate",g.insertObfuscateBlotHandler),h.addHandler("video-plugin",g.insertVideoHandler),h.addHandler("internal-link-plugin",g.insertInternalLinkHandler);const p=f.root,y=N=>_(N,f);p.addEventListener("click",y),Rl((()=>p.removeEventListener("click",y)));const _=async(N,T)=>{const S=N.target;S.tagName==="FIGURE"&&S.classList.contains("MediaBlot")&&await Ym({service:n,editor:T,element:S,language:a}),S.tagName==="BUTTON"&&S.classList.contains("HtmlSnippet")&&await Vm({language:a,editor:T,service:n,htmlSnippetBtn:S}),S.tagName==="SPAN"&&S.classList.contains("ObfuscateBlot")&&await bl({language:a,editor:T,service:n,obfuscatorSpan:S}),S.tagName==="DIV"&&S.classList.contains("VideoPlugin")&&await Wm({editor:T,videoElement:S,language:a,service:n,videoPluginHook:Vt.videoPlugin}),S.tagName==="SPAN"&&S.classList.contains("InternalLinkPlugin")&&await Zm({editor:T,internalLinkElement:S,language:a,service:n,internalLinkPluginHook:Vt.internalLinkPlugin})};return{element:u,setValue:N=>i(Xa(N)),setLanguage:l,getValue:()=>({j:s}),dispose:r,insertMedia:N=>c?.(N)}}))}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};
|