@paroicms/quill-editor-plugin 1.45.5 → 1.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createMemo as Xi,createSignal as ft,createEffect as Us,For as Fs,Show as Hs,createRoot as Cl,onCleanup as Rl}from"https://esm.sh/solid-js@1.9.10";import{template as be,className as pi,delegateEvents as Ti,insert as de,effect as ln,createComponent as Dt,memo as Bi,setStyleProperty as Il}from"https://esm.sh/solid-js@1.9.10/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,kl=typeof self=="object"&&self&&self.Object===Object&&self,qt=to||kl||Function("return this")(),fn=qt.Symbol,no=Object.prototype,Ml=no.hasOwnProperty,Dl=no.toString,Lr=fn?fn.toStringTag:void 0;function Bl(n){var e=Ml.call(n,Lr),t=n[Lr];try{n[Lr]=void 0;var r=!0}catch{}var i=Dl.call(n);return r&&(e?n[Lr]=t:delete n[Lr]),i}var $l=Object.prototype,ql=$l.toString;function Pl(n){return ql.call(n)}var Ul="[object Null]",Fl="[object Undefined]",zs=fn?fn.toStringTag:void 0;function lr(n){return n==null?n===void 0?Fl:Ul:zs&&zs in Object(n)?Bl(n):Pl(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 Hl="[object AsyncFunction]",zl="[object Function]",jl="[object GeneratorFunction]",Kl="[object Proxy]";function bs(n){if(!gn(n))return!1;var e=lr(n);return e==zl||e==jl||e==Hl||e==Kl}var $i=qt["__core-js_shared__"],js=function(){var n=/[^.]+$/.exec($i&&$i.keys&&$i.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function Gl(n){return!!js&&js in n}var Vl=Function.prototype,Zl=Vl.toString;function Dn(n){if(n!=null){try{return Zl.call(n)}catch{}try{return n+""}catch{}}return""}var Wl=/[\\^$.*+?()[\]{}|]/g,Yl=/^\[object .+?Constructor\]$/,Ql=Function.prototype,Xl=Object.prototype,Jl=Ql.toString,ec=Xl.hasOwnProperty,tc=RegExp("^"+Jl.call(ec).replace(Wl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nc(n){if(!gn(n)||Gl(n))return!1;var e=bs(n)?tc:Yl;return e.test(Dn(n))}function rc(n,e){return n?.[e]}function Bn(n,e){var t=rc(n,e);return nc(t)?t:void 0}var Ji=Bn(qt,"WeakMap"),Ks=Object.create,ic=function(){function n(){}return function(e){if(!gn(e))return{};if(Ks)return Ks(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 ac(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var oc=800,lc=16,cc=Date.now;function uc(n){var e=0,t=0;return function(){var r=cc(),i=lc-(r-t);if(t=r,i>0){if(++e>=oc)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function dc(n){return function(){return n}}var mi=function(){try{var n=Bn(Object,"defineProperty");return n({},"",{}),n}catch{}}(),hc=mi?function(n,e){return mi(n,"toString",{configurable:!0,enumerable:!1,value:dc(e),writable:!0})}:ro,fc=uc(hc);function gc(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var pc=9007199254740991,mc=/^(?:0|[1-9]\d*)$/;function io(n,e){var t=typeof n;return e=e??pc,!!e&&(t=="number"||t!="symbol"&&mc.test(n))&&n>-1&&n%1==0&&n<e}function Es(n,e,t){e=="__proto__"&&mi?mi(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 bc=Object.prototype,Ec=bc.hasOwnProperty;function so(n,e,t){var r=n[e];(!(Ec.call(n,e)&&zr(r,t))||t===void 0&&!(e in n))&&Es(n,e,t)}function yc(n,e,t,r){var i=!t;t||(t={});for(var s=-1,a=e.length;++s<a;){var l=e[s],c=void 0;c===void 0&&(c=n[l]),i?Es(t,l,c):so(t,l,c)}return t}var Gs=Math.max;function _c(n,e,t){return e=Gs(e===void 0?n.length-1:e,0),function(){for(var r=arguments,i=-1,s=Gs(r.length-e,0),a=Array(s);++i<s;)a[i]=r[e+i];i=-1;for(var l=Array(e+1);++i<e;)l[i]=r[i];return l[e]=t(a),sc(n,this,l)}}function vc(n,e){return fc(_c(n,e,ro),n+"")}var Nc=9007199254740991;function ao(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Nc}function Ai(n){return n!=null&&ao(n.length)&&!bs(n)}function Tc(n,e,t){if(!gn(t))return!1;var r=typeof e;return(r=="number"?Ai(t)&&io(e,t.length):r=="string"&&e in t)?zr(t[e],n):!1}function Ac(n){return vc(function(e,t){var r=-1,i=t.length,s=i>1?t[i-1]:void 0,a=i>2?t[2]:void 0;for(s=n.length>3&&typeof s=="function"?(i--,s):void 0,a&&Tc(t[0],t[1],a)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var l=t[r];l&&n(e,l,r,s)}return e})}var wc=Object.prototype;function ys(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||wc;return n===t}function Sc(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var xc="[object Arguments]";function Vs(n){return Zt(n)&&lr(n)==xc}var oo=Object.prototype,Oc=oo.hasOwnProperty,Lc=oo.propertyIsEnumerable,es=Vs(function(){return arguments}())?Vs:function(n){return Zt(n)&&Oc.call(n,"callee")&&!Lc.call(n,"callee")};function Cc(){return!1}var lo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Zs=lo&&typeof module=="object"&&module&&!module.nodeType&&module,Rc=Zs&&Zs.exports===lo,Ws=Rc?qt.Buffer:void 0,Ic=Ws?Ws.isBuffer:void 0,Br=Ic||Cc,kc="[object Arguments]",Mc="[object Array]",Dc="[object Boolean]",Bc="[object Date]",$c="[object Error]",qc="[object Function]",Pc="[object Map]",Uc="[object Number]",Fc="[object Object]",Hc="[object RegExp]",zc="[object Set]",jc="[object String]",Kc="[object WeakMap]",Gc="[object ArrayBuffer]",Vc="[object DataView]",Zc="[object Float32Array]",Wc="[object Float64Array]",Yc="[object Int8Array]",Qc="[object Int16Array]",Xc="[object Int32Array]",Jc="[object Uint8Array]",eu="[object Uint8ClampedArray]",tu="[object Uint16Array]",nu="[object Uint32Array]",Ie={};Ie[Zc]=Ie[Wc]=Ie[Yc]=Ie[Qc]=Ie[Xc]=Ie[Jc]=Ie[eu]=Ie[tu]=Ie[nu]=!0;Ie[kc]=Ie[Mc]=Ie[Gc]=Ie[Dc]=Ie[Vc]=Ie[Bc]=Ie[$c]=Ie[qc]=Ie[Pc]=Ie[Uc]=Ie[Fc]=Ie[Hc]=Ie[zc]=Ie[jc]=Ie[Kc]=!1;function ru(n){return Zt(n)&&ao(n.length)&&!!Ie[lr(n)]}function _s(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,iu=Mr&&Mr.exports===co,qi=iu&&to.process,ar=function(){try{var n=Mr&&Mr.require&&Mr.require("util").types;return n||qi&&qi.binding&&qi.binding("util")}catch{}}(),Ys=ar&&ar.isTypedArray,vs=Ys?_s(Ys):ru,su=Object.prototype,au=su.hasOwnProperty;function uo(n,e){var t=Rn(n),r=!t&&es(n),i=!t&&!r&&Br(n),s=!t&&!r&&!i&&vs(n),a=t||r||i||s,l=a?Sc(n.length,String):[],c=l.length;for(var u in n)(e||au.call(n,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||io(u,c)))&&l.push(u);return l}function ho(n,e){return function(t){return n(e(t))}}var ou=ho(Object.keys,Object),lu=Object.prototype,cu=lu.hasOwnProperty;function uu(n){if(!ys(n))return ou(n);var e=[];for(var t in Object(n))cu.call(n,t)&&t!="constructor"&&e.push(t);return e}function du(n){return Ai(n)?uo(n):uu(n)}function hu(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var fu=Object.prototype,gu=fu.hasOwnProperty;function pu(n){if(!gn(n))return hu(n);var e=ys(n),t=[];for(var r in n)r=="constructor"&&(e||!gu.call(n,r))||t.push(r);return t}function fo(n){return Ai(n)?uo(n,!0):pu(n)}var $r=Bn(Object,"create");function mu(){this.__data__=$r?$r(null):{},this.size=0}function bu(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var Eu="__lodash_hash_undefined__",yu=Object.prototype,_u=yu.hasOwnProperty;function vu(n){var e=this.__data__;if($r){var t=e[n];return t===Eu?void 0:t}return _u.call(e,n)?e[n]:void 0}var Nu=Object.prototype,Tu=Nu.hasOwnProperty;function Au(n){var e=this.__data__;return $r?e[n]!==void 0:Tu.call(e,n)}var wu="__lodash_hash_undefined__";function Su(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=$r&&e===void 0?wu:e,this}function 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=mu;In.prototype.delete=bu;In.prototype.get=vu;In.prototype.has=Au;In.prototype.set=Su;function xu(){this.__data__=[],this.size=0}function wi(n,e){for(var t=n.length;t--;)if(zr(n[t][0],e))return t;return-1}var Ou=Array.prototype,Lu=Ou.splice;function Cu(n){var e=this.__data__,t=wi(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():Lu.call(e,t,1),--this.size,!0}function Ru(n){var e=this.__data__,t=wi(e,n);return t<0?void 0:e[t][1]}function Iu(n){return wi(this.__data__,n)>-1}function ku(n,e){var t=this.__data__,r=wi(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=xu;Yt.prototype.delete=Cu;Yt.prototype.get=Ru;Yt.prototype.has=Iu;Yt.prototype.set=ku;var qr=Bn(qt,"Map");function Mu(){this.size=0,this.__data__={hash:new In,map:new(qr||Yt),string:new In}}function Du(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Si(n,e){var t=n.__data__;return Du(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Bu(n){var e=Si(this,n).delete(n);return this.size-=e?1:0,e}function $u(n){return Si(this,n).get(n)}function qu(n){return Si(this,n).has(n)}function Pu(n,e){var t=Si(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function $n(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}$n.prototype.clear=Mu;$n.prototype.delete=Bu;$n.prototype.get=$u;$n.prototype.has=qu;$n.prototype.set=Pu;function Uu(n,e){for(var t=-1,r=e.length,i=n.length;++t<r;)n[i+t]=e[t];return n}var go=ho(Object.getPrototypeOf,Object),Fu="[object Object]",Hu=Function.prototype,zu=Object.prototype,po=Hu.toString,ju=zu.hasOwnProperty,Ku=po.call(Object);function Gu(n){if(!Zt(n)||lr(n)!=Fu)return!1;var e=go(n);if(e===null)return!0;var t=ju.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&po.call(t)==Ku}function Vu(){this.__data__=new Yt,this.size=0}function Zu(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function Wu(n){return this.__data__.get(n)}function Yu(n){return this.__data__.has(n)}var Qu=200;function Xu(n,e){var t=this.__data__;if(t instanceof Yt){var r=t.__data__;if(!qr||r.length<Qu-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new $n(r)}return t.set(n,e),this.size=t.size,this}function Bt(n){var e=this.__data__=new Yt(n);this.size=e.size}Bt.prototype.clear=Vu;Bt.prototype.delete=Zu;Bt.prototype.get=Wu;Bt.prototype.has=Yu;Bt.prototype.set=Xu;var mo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Qs=mo&&typeof module=="object"&&module&&!module.nodeType&&module,Ju=Qs&&Qs.exports===mo,Xs=Ju?qt.Buffer:void 0,Js=Xs?Xs.allocUnsafe:void 0;function bo(n,e){if(e)return n.slice();var t=n.length,r=Js?Js(t):new n.constructor(t);return n.copy(r),r}function ed(n,e){for(var t=-1,r=n==null?0:n.length,i=0,s=[];++t<r;){var a=n[t];e(a,t,n)&&(s[i++]=a)}return s}function td(){return[]}var nd=Object.prototype,rd=nd.propertyIsEnumerable,ea=Object.getOwnPropertySymbols,id=ea?function(n){return n==null?[]:(n=Object(n),ed(ea(n),function(e){return rd.call(n,e)}))}:td;function sd(n,e,t){var r=e(n);return Rn(n)?r:Uu(r,t(n))}function ts(n){return sd(n,du,id)}var ns=Bn(qt,"DataView"),rs=Bn(qt,"Promise"),is=Bn(qt,"Set"),ta="[object Map]",ad="[object Object]",na="[object Promise]",ra="[object Set]",ia="[object WeakMap]",sa="[object DataView]",od=Dn(ns),ld=Dn(qr),cd=Dn(rs),ud=Dn(is),dd=Dn(Ji),Tt=lr;(ns&&Tt(new ns(new ArrayBuffer(1)))!=sa||qr&&Tt(new qr)!=ta||rs&&Tt(rs.resolve())!=na||is&&Tt(new is)!=ra||Ji&&Tt(new Ji)!=ia)&&(Tt=function(n){var e=lr(n),t=e==ad?n.constructor:void 0,r=t?Dn(t):"";if(r)switch(r){case od:return sa;case ld:return ta;case cd:return na;case ud:return ra;case dd:return ia}return e});var hd=Object.prototype,fd=hd.hasOwnProperty;function gd(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&fd.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var bi=qt.Uint8Array;function Ns(n){var e=new n.constructor(n.byteLength);return new bi(e).set(new bi(n)),e}function pd(n,e){var t=Ns(n.buffer);return new n.constructor(t,n.byteOffset,n.byteLength)}var md=/\w*$/;function bd(n){var e=new n.constructor(n.source,md.exec(n));return e.lastIndex=n.lastIndex,e}var aa=fn?fn.prototype:void 0,oa=aa?aa.valueOf:void 0;function Ed(n){return oa?Object(oa.call(n)):{}}function Eo(n,e){var t=e?Ns(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var yd="[object Boolean]",_d="[object Date]",vd="[object Map]",Nd="[object Number]",Td="[object RegExp]",Ad="[object Set]",wd="[object String]",Sd="[object Symbol]",xd="[object ArrayBuffer]",Od="[object DataView]",Ld="[object Float32Array]",Cd="[object Float64Array]",Rd="[object Int8Array]",Id="[object Int16Array]",kd="[object Int32Array]",Md="[object Uint8Array]",Dd="[object Uint8ClampedArray]",Bd="[object Uint16Array]",$d="[object Uint32Array]";function qd(n,e,t){var r=n.constructor;switch(e){case xd:return Ns(n);case yd:case _d:return new r(+n);case Od:return pd(n);case Ld:case Cd:case Rd:case Id:case kd:case Md:case Dd:case Bd:case $d:return Eo(n,t);case vd:return new r;case Nd:case wd:return new r(n);case Td:return bd(n);case Ad:return new r;case Sd:return Ed(n)}}function yo(n){return typeof n.constructor=="function"&&!ys(n)?ic(go(n)):{}}var Pd="[object Map]";function Ud(n){return Zt(n)&&Tt(n)==Pd}var la=ar&&ar.isMap,Fd=la?_s(la):Ud,Hd="[object Set]";function zd(n){return Zt(n)&&Tt(n)==Hd}var ca=ar&&ar.isSet,jd=ca?_s(ca):zd,Kd=1,_o="[object Arguments]",Gd="[object Array]",Vd="[object Boolean]",Zd="[object Date]",Wd="[object Error]",vo="[object Function]",Yd="[object GeneratorFunction]",Qd="[object Map]",Xd="[object Number]",No="[object Object]",Jd="[object RegExp]",eh="[object Set]",th="[object String]",nh="[object Symbol]",rh="[object WeakMap]",ih="[object ArrayBuffer]",sh="[object DataView]",ah="[object Float32Array]",oh="[object Float64Array]",lh="[object Int8Array]",ch="[object Int16Array]",uh="[object Int32Array]",dh="[object Uint8Array]",hh="[object Uint8ClampedArray]",fh="[object Uint16Array]",gh="[object Uint32Array]",Ce={};Ce[_o]=Ce[Gd]=Ce[ih]=Ce[sh]=Ce[Vd]=Ce[Zd]=Ce[ah]=Ce[oh]=Ce[lh]=Ce[ch]=Ce[uh]=Ce[Qd]=Ce[Xd]=Ce[No]=Ce[Jd]=Ce[eh]=Ce[th]=Ce[nh]=Ce[dh]=Ce[hh]=Ce[fh]=Ce[gh]=!0;Ce[Wd]=Ce[vo]=Ce[rh]=!1;function gi(n,e,t,r,i,s){var a,l=e&Kd;if(a!==void 0)return a;if(!gn(n))return n;var c=Rn(n);if(c)a=gd(n);else{var u=Tt(n),f=u==vo||u==Yd;if(Br(n))return bo(n,l);if(u==No||u==_o||f&&!i)a=f?{}:yo(n);else{if(!Ce[u])return i?n:{};a=qd(n,u,l)}}s||(s=new Bt);var g=s.get(n);if(g)return g;s.set(n,a),jd(n)?n.forEach(function(y){a.add(gi(y,e,t,y,n,s))}):Fd(n)&&n.forEach(function(y,_){a.set(_,gi(y,e,t,_,n,s))});var h=ts,p=c?void 0:h(n);return gc(p||n,function(y,_){p&&(_=y,y=n[_]),so(a,_,gi(y,e,t,_,n,s))}),a}var ph=1,mh=4;function rr(n){return gi(n,ph|mh)}var bh="__lodash_hash_undefined__";function Eh(n){return this.__data__.set(n,bh),this}function yh(n){return this.__data__.has(n)}function Ei(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new $n;++e<t;)this.add(n[e])}Ei.prototype.add=Ei.prototype.push=Eh;Ei.prototype.has=yh;function _h(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}function vh(n,e){return n.has(e)}var Nh=1,Th=2;function To(n,e,t,r,i,s){var a=t&Nh,l=n.length,c=e.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(n),f=s.get(e);if(u&&f)return u==e&&f==n;var g=-1,h=!0,p=t&Th?new Ei:void 0;for(s.set(n,e),s.set(e,n);++g<l;){var y=n[g],_=e[g];if(r)var N=a?r(_,y,g,e,n,s):r(y,_,g,n,e,s);if(N!==void 0){if(N)continue;h=!1;break}if(p){if(!_h(e,function(T,S){if(!vh(p,S)&&(y===T||i(y,T,t,r,s)))return p.push(S)})){h=!1;break}}else if(!(y===_||i(y,_,t,r,s))){h=!1;break}}return s.delete(n),s.delete(e),h}function Ah(n){var e=-1,t=Array(n.size);return n.forEach(function(r,i){t[++e]=[i,r]}),t}function wh(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=r}),t}var Sh=1,xh=2,Oh="[object Boolean]",Lh="[object Date]",Ch="[object Error]",Rh="[object Map]",Ih="[object Number]",kh="[object RegExp]",Mh="[object Set]",Dh="[object String]",Bh="[object Symbol]",$h="[object ArrayBuffer]",qh="[object DataView]",ua=fn?fn.prototype:void 0,Pi=ua?ua.valueOf:void 0;function Ph(n,e,t,r,i,s,a){switch(t){case qh:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case $h:return!(n.byteLength!=e.byteLength||!s(new bi(n),new bi(e)));case Oh:case Lh:case Ih:return zr(+n,+e);case Ch:return n.name==e.name&&n.message==e.message;case kh:case Dh:return n==e+"";case Rh:var l=Ah;case Mh:var c=r&Sh;if(l||(l=wh),n.size!=e.size&&!c)return!1;var u=a.get(n);if(u)return u==e;r|=xh,a.set(n,e);var f=To(l(n),l(e),r,i,s,a);return a.delete(n),f;case Bh:if(Pi)return Pi.call(n)==Pi.call(e)}return!1}var Uh=1,Fh=Object.prototype,Hh=Fh.hasOwnProperty;function zh(n,e,t,r,i,s){var a=t&Uh,l=ts(n),c=l.length,u=ts(e),f=u.length;if(c!=f&&!a)return!1;for(var g=c;g--;){var h=l[g];if(!(a?h in e:Hh.call(e,h)))return!1}var p=s.get(n),y=s.get(e);if(p&&y)return p==e&&y==n;var _=!0;s.set(n,e),s.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,s):r(T,S,h,n,e,s);if(!(k===void 0?T===S||i(T,S,t,r,s):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 s.delete(n),s.delete(e),_}var jh=1,da="[object Arguments]",ha="[object Array]",ei="[object Object]",Kh=Object.prototype,fa=Kh.hasOwnProperty;function Gh(n,e,t,r,i,s){var a=Rn(n),l=Rn(e),c=a?ha:Tt(n),u=l?ha:Tt(e);c=c==da?ei:c,u=u==da?ei:u;var f=c==ei,g=u==ei,h=c==u;if(h&&Br(n)){if(!Br(e))return!1;a=!0,f=!1}if(h&&!f)return s||(s=new Bt),a||vs(n)?To(n,e,t,r,i,s):Ph(n,e,c,t,r,i,s);if(!(t&jh)){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 s||(s=new Bt),i(_,N,t,r,s)}}return h?(s||(s=new Bt),zh(n,e,t,r,i,s)):!1}function Ao(n,e,t,r,i){return n===e?!0:n==null||e==null||!Zt(n)&&!Zt(e)?n!==n&&e!==e:Gh(n,e,t,r,Ao,i)}function Vh(n){return function(e,t,r){for(var i=-1,s=Object(e),a=r(e),l=a.length;l--;){var c=a[++i];if(t(s[c],c,s)===!1)break}return e}}var Zh=Vh();function ss(n,e,t){(t!==void 0&&!zr(n[e],t)||t===void 0&&!(e in n))&&Es(n,e,t)}function Wh(n){return Zt(n)&&Ai(n)}function as(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function Yh(n){return yc(n,fo(n))}function Qh(n,e,t,r,i,s,a){var l=as(n,t),c=as(e,t),u=a.get(c);if(u){ss(n,t,u);return}var f=s?s(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&&vs(c);f=c,h||p||y?Rn(l)?f=l:Wh(l)?f=ac(l):p?(g=!1,f=bo(c,!0)):y?(g=!1,f=Eo(c,!0)):f=[]:Gu(c)||es(c)?(f=l,es(l)?f=Yh(l):(!gn(l)||bs(l))&&(f=yo(c))):g=!1}g&&(a.set(c,f),i(f,c,r,s,a),a.delete(c)),ss(n,t,f)}function wo(n,e,t,r,i){n!==e&&Zh(e,function(s,a){if(i||(i=new Bt),gn(s))Qh(n,e,a,t,wo,r,i);else{var l=r?r(as(n,a),s,a+"",n,e,i):void 0;l===void 0&&(l=s),ss(n,a,l)}},fo)}function Ts(n,e){return Ao(n,e)}var dn=Ac(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 i=Y.TYPE&Y.ATTRIBUTE;this.scope=r.scope!=null?r.scope&Y.LEVEL|i: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 ir extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const So=class os{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 i=this.query(t);if(i==null)throw new ir(`Unable to create ${t} blot`);const s=i,a=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:s.create(r),l=new s(e,a,r);return os.blots.set(l.domNode,l),l}find(e,t=!1){return os.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(i=>(r=this.classes[i],!!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,i="attrName"in t;if(!r&&!i)throw new ir("Invalid definition");if(r&&t.blotName==="abstract")throw new ir("Cannot register abstract class");const s=r?t.blotName:i?t.attrName:void 0;return this.types[s]=t,i?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 Xh 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=Xh;function Ui(n){const e=n.split("-"),t=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+t}class Jh extends $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[Ui(this.keyName)]=t,!0):!1}remove(e){e.style[Ui(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[Ui(this.keyName)];return this.canAdd(e,t)?t:""}}const pn=Jh;class ef{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=or.find(this.domNode);if(e==null)return;const t=$t.keys(this.domNode),r=Ot.keys(this.domNode),i=pn.keys(this.domNode);t.concat(r).concat(i).forEach(s=>{const a=e.scroll.query(s,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 xi=ef,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 ir("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,i){const s=this.isolate(e,t);if(this.scroll.query(r,Y.BLOT)!=null&&i)s.wrap(r,i);else if(this.scroll.query(r,Y.ATTRIBUTE)!=null){const a=this.scroll.create(this.statics.scope);s.wrap(a),a.format(r,i)}}insertAt(e,t,r){const i=r==null?this.scroll.create("text",t):this.scroll.create(t,r),s=this.split(e);this.parent.insertBefore(i,s||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 ir(`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 tf=Lo;const Xe=tf;class nf{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let r=t();for(;r&&e>0;)e-=1,r=t();return r}contains(e){const t=this.iterator();let r=t();for(;r;){if(r===e)return!0;r=t()}return!1}indexOf(e){const t=this.iterator();let r=t(),i=0;for(;r;){if(r===e)return i;i+=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 i=r();for(;i;){const s=i.length();if(e<s||t&&e===s&&(i.next==null||i.next.length()!==0))return[i,e];e-=s,i=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[i,s]=this.find(e);let a=e-s;const l=this.iterator(i);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 i=r();for(;i;)t=e(t,i),i=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(i=>{r.domNode.appendChild(i)}),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 nf,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const t=pa(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof ir)return;throw t}})}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,(r,i,s)=>{r.deleteAt(i,s)})}descendant(e,t=0){const[r,i]=this.children.find(t);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,i]:r instanceof on?r.descendant(e,i):[null,-1]}descendants(e,t=0,r=Number.MAX_VALUE){let i=[],s=r;return this.children.forEachAt(t,r,(a,l,c)=>{(e.blotName==null&&e(a)||e.blotName!=null&&a instanceof e)&&i.push(a),a instanceof on&&(i=i.concat(a.descendants(e,l,s))),s-=c}),i}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,i){this.children.forEachAt(e,t,(s,a,l)=>{s.formatAt(a,l,r,i)})}insertAt(e,t,r){const[i,s]=this.children.find(e);if(i)i.insertAt(s,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,i]=this.children.find(e,t),s=[[this,e]];return r instanceof on?s.concat(r.path(i,t)):(r!=null&&s.push([r,i]),s)}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(),(i,s,a)=>{const l=i.split(s,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=[],i=[];e.forEach(s=>{s.target===this.domNode&&s.type==="childList"&&(r.push(...s.addedNodes),i.push(...s.removedNodes))}),i.forEach(s=>{if(s.parentNode!=null&&s.tagName!=="IFRAME"&&document.body.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const a=this.scroll.find(s);a!=null&&(a.domNode.parentNode==null||a.domNode.parentNode===this.domNode)&&a.detach()}),r.filter(s=>s.parentNode===this.domNode&&s!==this.uiNode).sort((s,a)=>s===a?0:s.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(s=>{let a=null;s.nextSibling!=null&&(a=this.scroll.find(s.nextSibling));const l=pa(s,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 rf=Co;const St=rf;function sf(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(n[t]!==e[t])return!1;return!0}const 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 xi(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,i){this.formats()[r]!=null||this.scroll.query(r,Y.ATTRIBUTE)?this.isolate(e,t).format(r,i):super.formatAt(e,t,r,i)}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&&sf(t,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(e,t){const r=super.wrap(e,t);return r instanceof Xn&&this.attributes.move(r),r}};Qn.allowedChildren=[Qn,Xe],Qn.blotName="inline",Qn.scope=Y.INLINE_BLOT,Qn.tagName="SPAN";let af=Qn;const As=af,Jn=class ls extends St{static create(e){return super.create(e)}static formats(e,t){const r=t.query(ls.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 xi(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(ls.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,i){this.scroll.query(r,Y.BLOCK)!=null?this.format(r,i):super.formatAt(e,t,r,i)}insertAt(e,t,r){if(r==null||this.scroll.query(t,Y.INLINE)!=null)super.insertAt(e,t,r);else{const i=this.split(e);if(i!=null){const s=this.scroll.create(t,r);i.parent.insertBefore(s,i)}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=[As,Jn,Xe];let of=Jn;const Pr=of,cs=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,i){super.formatAt(e,t,r,i),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())}};cs.blotName="container",cs.scope=Y.BLOCK_BLOT;let lf=cs;const Oi=lf;class cf extends Xe{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,r,i){e===0&&t===this.length()?this.format(r,i):super.formatAt(e,t,r,i)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const ot=cf,uf={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},df=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,uf),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const r=this.registry.find(e,t);return r?r.scroll===this?r:t?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,t=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,i){this.update(),super.formatAt(e,t,r,i)}insertAt(e,t,r){this.update(),super.insertAt(e,t,r)}optimize(e=[],t={}){super.optimize(t);const r=t.mutationsMap||new WeakMap;let i=Array.from(this.observer.takeRecords());for(;i.length>0;)e.push(i.pop());const s=(c,u=!0)=>{c==null||c===this||c.domNode.parentNode!=null&&(r.has(c.domNode)||r.set(c.domNode,[]),u&&s(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>=df)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach(u=>{const f=this.find(u.target,!0);f!=null&&(f.domNode===u.target&&(u.type==="childList"?(s(this.find(u.previousSibling,!1)),Array.from(u.addedNodes).forEach(g=>{const h=this.find(g,!1);s(h,!1),h instanceof St&&h.children.forEach(p=>{s(p,!1)})})):u.type==="attributes"&&s(f.prev)),s(f))}),this.children.forEach(a),l=Array.from(this.observer.takeRecords()),i=l.slice();i.length>0;)e.push(i.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(i=>{const s=this.find(i.target,!0);return s==null?null:r.has(s.domNode)?(r.get(s.domNode).push(i),null):(r.set(s.domNode,[i]),s)}).forEach(i=>{i!=null&&i!==this&&r.has(i.domNode)&&i.update(r.get(i.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,Oi],er.scope=Y.BLOCK_BLOT,er.tagName="DIV";let hf=er;const ws=hf,us=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}};us.blotName="text",us.scope=Y.INLINE_BLOT;let ff=us;const yi=ff,gf=Object.freeze(Object.defineProperty({__proto__:null,Attributor:$t,AttributorStore:xi,BlockBlot:Pr,ClassAttributor:Ot,ContainerBlot:Oi,EmbedBlot:ot,InlineBlot:As,LeafBlot:Xe,ParentBlot:St,Registry:or,Scope:Y,ScrollBlot:ws,StyleAttributor:pn,TextBlot:yi},Symbol.toStringTag,{value:"Module"}));var cn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ss(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ti={exports:{}},Fi,ma;function pf(){if(ma)return Fi;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=ie(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 $=i(m,L);return M&&$.unshift([t,M]),z&&$.push([t,z]),S($,R),C&&g($),$}function i(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 s(m,L)}function s(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 ue=-Oe+ae;ue<=Oe-fe;ue+=2){var ve=O+ue,pe;ue===-Oe||ue!==Oe&&M[ve-1]<M[ve+1]?pe=M[ve+1]:pe=M[ve-1]+1;for(var ye=pe-ue;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-ue;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)),ue=-1,ve="",pe,ye,Ne,Te;(ue=X.indexOf(Oe,ue+1))!==-1;){var Be=l(fe.substring(xe),X.substring(ue)),je=u(fe.substring(0,xe),X.substring(0,ue));ve.length<je+Be&&(ve=X.substring(ue-je,ue)+X.substring(ue,ue+Be),pe=fe.substring(0,xe-je),ye=fe.substring(xe+Be),Ne=X.substring(0,ue-je),Te=X.substring(ue+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),ue=xe.match(h),ve=Oe.match(h),pe=ue&&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:ue&&!pe&&ye?3:pe||ye?2:ue||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&&V(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 V(m){return k(m.charCodeAt(m.length-1))}function ce(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 V(m)||B(C)?null:ce([[t,m],[n,L],[e,v],[t,C]])}function ie(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 ue=z.slice(X),ve=ae.slice(X);return P(xe,ue,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 ue=$.slice(0,$.length-ye),ve=fe.slice(0,fe.length-ye);return P(z,ue,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 ue=m.slice(X,O-ye),ve=L.slice(X,D-ye);return P(xe,ue,ve,Ne)}return null}function se(m,L,v,C){return r(m,L,v,C,!0)}return se.INSERT=e,se.DELETE=n,se.EQUAL=t,Fi=se,Fi}var Rr={exports:{}};Rr.exports;var ba;function Io(){return ba||(ba=1,function(n,e){var t=200,r="__lodash_hash_undefined__",i=9007199254740991,s="[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]",V="[object DataView]",ce="[object Float32Array]",P="[object Float64Array]",ie="[object Int8Array]",se="[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*)$/,$={};$[s]=$[a]=$[B]=$[V]=$[l]=$[c]=$[ce]=$[P]=$[ie]=$[se]=$[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 ue(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"),it=et(ae,"Promise"),zt=et(ae,"Set"),Nn=et(ae,"WeakMap"),Rt=et(Object,"create"),ct=H(en),b=H(Et),x=H(it),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 G(o,d){return o&&kt(d,Or(d),o)}function he(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==s||Ye&&!Q){if(Be(o))return Q?o:{};if(Ee=ge(Ye?{}:o),!d)return Yn(o,G(Ee,o))}else{if(!$[Se])return Q?o:{};Ee=rn(o,Se,he,d)}}_e||(_e=new ke);var at=_e.get(o);if(at)return at;if(_e.set(o,Ee),!Fe)var He=E?st(o):Or(o);return ve(He||o,function(Qe,Ve){He&&(Ve=Qe,Qe=o[Ve]),Wn(Ee,Ve,he(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,ue,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 st(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):Mi,dt=Je;(en&&dt(new en(new ArrayBuffer(1)))!=V||Et&&dt(new Et)!=h||it&&dt(it.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 V;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 V:return It(o,w);case ce:case P:case ie:case se: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??i,!!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 he(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)==s)}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||Di;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<=i}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 Mi(){return[]}function Di(){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__",i=1,s=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]",V="[object Set]",ce="[object String]",P="[object Symbol]",ie="[object Undefined]",se="[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[V]=X[ce]=X[se]=!1;var xe=typeof cn=="object"&&cn&&cn.Object===Object&&cn,Oe=typeof self=="object"&&self&&self.Object===Object&&self,ue=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=ue["__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?ue.Buffer:void 0,Jt=ue.Symbol,Kn=ue.Uint8Array,en=lt.propertyIsEnumerable,Et=Ft.splice,it=Jt?Jt.toStringTag:void 0,zt=Object.getOwnPropertySymbols,Nn=Xt?Xt.isBuffer:void 0,Rt=_n(Object.keys,Object),ct=te(ue,"DataView"),b=te(ue,"Map"),x=te(ue,"Promise"),q=te(ue,"Set"),ne=te(ue,"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 G(o){var d=this.__data__=new Ge(o);this.size=d.size}function he(){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}G.prototype.clear=he,G.prototype.delete=we,G.prototype.get=Me,G.prototype.has=Je,G.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?ie:T:it&&it 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 G),_e||Qr(o)?kt(o,d,E,w,le,Q):Yn(o,d,Fe,E,w,le,Q);if(!(E&i)){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 G),le(an,Kt,E,w,Q)}}return He?(Q||(Q=new G),st(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&i,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&s?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 ce:return o==d+"";case _:var Ee=Hn;case V:var Fe=w&i;if(Ee||(Ee=Ke),o.size!=d.size&&!Fe)return!1;var Se=_e.get(o);if(Se)return Se==d;w|=s,_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 st(o,d,E,w,le,Q){var _e=E&i,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 Ps=_e?w(Ln,Kt,He,d,o,Q):w(Kt,Ln,He,o,d,Q);if(!(Ps===void 0?Kt===Ln||le(Kt,Ln,E,w,Q):Ps)){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,it),E=o[it];try{o[it]=void 0;var w=!0}catch{}var le=jn.call(o);return w&&(d?o[it]=E:delete o[it]),le}var Pe=zt?function(o){return o==null?[]:(o=Object(o),je(zt(o),function(d){return en.call(o,d)}))}:Mi,ge=It;(ct&&ge(new ct(new ArrayBuffer(1)))!=L||b&&ge(new b)!=_||x&&ge(x.resolve())!=k||q&&ge(new q)!=V||ne&&ge(new ne)!=se)&&(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 V;case $e:return se}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||Di;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 Mi(){return[]}function Di(){return!1}n.exports=Sr}(Ir,Ir.exports)),Ir.exports}var ni={},ya;function mf(){if(ya)return ni;ya=1,Object.defineProperty(ni,"__esModule",{value:!0});const n=Io(),e=ko();var t;return function(r){function i(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=i;function s(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=s;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={})),ni.default=t,ni}var ri={},_a;function Mo(){if(_a)return ri;_a=1,Object.defineProperty(ri,"__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={})),ri.default=n,ri}var ii={},va;function bf(){if(va)return ii;va=1,Object.defineProperty(ii,"__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 i=this.ops[this.index];if(i){const s=this.offset,a=n.default.length(i);if(r>=a-s?(r=a-s,this.index+=1,this.offset=0):this.offset+=r,typeof i.delete=="number")return{delete:r};{const l={};return i.attributes&&(l.attributes=i.attributes),typeof i.retain=="number"?l.retain=r:typeof i.retain=="object"&&i.retain!==null?l.retain=i.retain:typeof i.insert=="string"?l.insert=i.insert.substr(s,r):l.insert=i.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,i=this.index,s=this.next(),a=this.ops.slice(this.index);return this.offset=r,this.index=i,[s].concat(a)}}else return[]}}return ii.default=e,ii}var Na;function Ef(){return Na||(Na=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=pf(),r=Io(),i=ko(),s=mf();e.AttributeMap=s.default;const a=Mo();e.Op=a.default;const l=bf();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(i(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 ce=k.retain==null?"insert":"retain",[P,ie,se]=u(k[ce],F.retain),m=f.getHandler(P);B[ce]={[P]:m.compose(ie,se,ce==="retain")}}const V=s.default.compose(k.attributes,F.attributes,typeof k.retain=="number");if(V&&(B.attributes=V),T.push(B),!y.hasNext()&&i(T.ops[T.ops.length-1],B)){const ce=new f(p.rest());return T.concat(ce).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 V=T.next(B),ce=S.next(B);i(V.insert,ce.insert)?_.retain(B,s.default.diff(V.attributes,ce.attributes)):_.push(ce).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),s.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)},s.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,V=F.retain;let ce=typeof V=="object"&&V!==null?V:S;if(typeof B=="object"&&B!==null&&typeof V=="object"&&V!==null){const P=Object.keys(B)[0];if(P===Object.keys(V)[0]){const ie=f.getHandler(P);ie&&(ce={[P]:ie.transform(B[P],V[P],p)})}}T.retain(ce,s.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=s.default,f.handlers={},e.default=f,n.exports=f,n.exports.default=f}(ti,ti.exports)),ti.exports}var bt=Ef();const Z=Ss(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 yi{};const yf={"&":"&","<":"<",">":">",'"':""","'":"'"};function Li(n){return n.replace(/[&<>"']/g,e=>yf[e])}let mn=class Cn extends As{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),i=Cn.order.indexOf(t);return r>=0||i>=0?r-i:e===t?0:e<t?-1:1}formatAt(e,t,r,i){if(Cn.compare(this.statics.blotName,r)<0&&this.scroll.query(r,Y.BLOT)){const s=this.isolate(e,t);i&&s.wrap(r,i)}else super.formatAt(e,t,r,i)}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,i){t<=0||(this.scroll.query(r,Y.BLOCK)?e+t===this.length()&&this.format(r,i):super.formatAt(e,Math.min(t,this.length()-e-1),r,i),this.cache={})}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r),this.cache={};return}if(t.length===0)return;const i=t.split(`\n`),s=i.shift();s.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),s):this.children.tail.insertAt(this.children.tail.length(),s),this.cache={});let a=this;i.reduce((l,c)=>(a=a.split(l,!0),a.insertAt(0,c),c.length),e+s.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 i=this.clone();return e===0?(this.parent.insertBefore(i,this),this):(this.parent.insertBefore(i,this.next),i)}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 xi(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,i){this.format(r,i)}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r);return}const i=t.split(`\n`),s=i.pop(),a=i.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)}),s&&this.parent.insertBefore(this.scroll.create("text",s),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,i=0;for(;r!=null&&r.statics.scope!==Y.BLOCK_BLOT;)i+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=At.CONTENTS.length,r.optimize(),r.formatAt(i,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,i=this.next instanceof xt?this.next:null,s=i?i.text:"",{textNode:a}=this,l=a.data.split(At.CONTENTS).join("");a.data=At.CONTENTS;let c;if(t)c=t,(l||i)&&(t.insertAt(t.length(),l+s),i&&i.remove());else if(i)c=i,i.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:i&&h===i.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 Hi={exports:{}},Aa;function _f(){return Aa||(Aa=1,function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(t=!1));function i(c,u,f){this.fn=c,this.context=u,this.once=f||!1}function s(c,u,f,g,h){if(typeof f!="function")throw new TypeError("The listener must be a function");var p=new i(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 s(this,u,f,g,!1)},l.prototype.once=function(u,f,g){return s(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}(Hi)),Hi.exports}var vf=_f();const Nf=Ss(vf),ds=new WeakMap,hs=["error","warn","log","info"];let fs="warn";function Bo(n){if(fs&&hs.indexOf(n)<=hs.indexOf(fs)){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 hs.reduce((e,t)=>(e[t]=Bo.bind(console,t,n),e),{})}Qt.level=n=>{fs=n};Bo.level=Qt.level;const zi=Qt("quill:events"),Tf=["selectionchange","mousedown","mouseup","click"];Tf.forEach(n=>{document.addEventListener(n,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach(i=>{const s=ds.get(i);s&&s.emitter&&s.emitter.handleDOM(...t)})})});class W extends Nf{static events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",zi.error)}emit(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return zi.log.call(zi,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];(this.domListeners[e.type]||[]).forEach(s=>{let{node:a,handler:l}=s;(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 ji=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 Af{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new 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,(i,s)=>{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=s.some(l=>l.type==="characterData"||l.type==="childList"||l.type==="attributes"&&l.target===this.root);this.update(a?W.sources.SILENT:i)}catch{}})}),this.emitter.on(W.events.SCROLL_OPTIMIZE,(r,i)=>{if(i.range){const{startNode:s,startOffset:a,endNode:l,endOffset:c}=i.range;this.setNativeRange(s,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 i=this.scroll.find(r.start.node,!1);if(i==null)return;if(i instanceof Xe){const s=i.split(r.start.offset);i.parent.insertBefore(this.cursor,s)}else i.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 i,[s,a]=this.scroll.leaf(e);if(s==null)return null;if(t>0&&a===s.length()){const[f]=this.scroll.leaf(e+1);if(f){const[g]=this.scroll.line(e),[h]=this.scroll.line(e+1);g===h&&(s=f,a=0)}}[i,a]=s.position(a,!0);const l=document.createRange();if(t>0)return l.setStart(i,a),[s,a]=this.scroll.leaf(e+t),s==null?null:([i,a]=s.position(a,!0),l.setEnd(i,a),l.getBoundingClientRect());let c="left",u;if(i instanceof Text){if(!i.data.length)return null;a<i.data.length?(l.setStart(i,a),l.setEnd(i,a+1)):(l.setStart(i,a-1),l.setEnd(i,a),c="right"),u=l.getBoundingClientRect()}else{if(!(s.domNode instanceof Element))return null;u=s.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 ji.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&&Ki(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()}),i=Math.min(Math.max(...r),this.scroll.length()-1),s=Math.min(i,...r);return new kn(s,i-s)}normalizeNative(e){if(!Ki(this.root,e.startContainer)||!e.collapsed&&!Ki(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:i,offset:s}=r;for(;!(i instanceof Text)&&i.childNodes.length>0;)if(i.childNodes.length>s)i=i.childNodes[s],s=0;else if(i.childNodes.length===s)i=i.lastChild,i instanceof Text?s=i.data.length:i.childNodes.length>0?s=i.childNodes.length:s=i.childNodes.length+1;else break;r.node=i,r.offset=s}),t}rangeToNative(e){const t=this.scroll.length(),r=(i,s)=>{i=Math.min(t-1,i);const[a,l]=this.scroll.leaf(i);return a?a.position(l,s):[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,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(ji.info("setNativeRange",e,t,r,i),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||s||e!==l.startContainer||t!==l.startOffset||r!==l.endContainer||i!==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"&&(i=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const c=document.createRange();c.setStart(e,t),c.setEnd(r,i),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),ji.info("setRange",e),e!=null){const i=this.rangeToNative(e);this.setNativeRange(...i,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,i]=this.getRange();if(this.lastRange=r,this.lastNative=i,this.lastRange!=null&&(this.savedRange=this.lastRange),!Ts(t,this.lastRange)){if(!this.composing&&i!=null&&i.native.collapsed&&i.start.node!==this.cursor.textNode){const a=this.cursor.restore();a&&this.setNativeRange(a.startNode,a.startOffset,a.endNode,a.endOffset)}const s=[W.events.SELECTION_CHANGE,rr(this.lastRange),rr(t),e];this.emitter.emit(W.events.EDITOR_CHANGE,...s),e!==W.sources.SILENT&&this.emitter.emit(...s)}}}function Ki(n,e){try{e.parentNode}catch{return!1}return n.contains(e)}const wf=/^[ -~]*$/;class Sf{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const r=wa(e),i=new Z;return Of(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(i.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(i.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,i.retain(h),i.delete(p),a+c+h+p},0),i.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(s=>{this.scroll.lines(e,Math.max(t,1)).forEach(a=>{a.format(s,r[s])})}),this.scroll.optimize();const i=(new Z).retain(e).retain(t,rr(r));return this.update(i)}formatText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(r).forEach(s=>{this.scroll.formatAt(e,t,s,r[s])});const i=(new Z).retain(e).retain(t,rr(r));return this.update(i)}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=[],i=[];t===0?this.scroll.path(e).forEach(l=>{const[c]=l;c instanceof Ze?r.push(c):c instanceof Xe&&i.push(c)}):(r=this.scroll.lines(e,t),i=this.scroll.descendants(Xe,e,t));const[s,a]=[r,i].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=xf(gt(f),u)}return u});return{...s,...a}}getHTML(e,t){const[r,i]=this.scroll.line(e);if(r){const s=r.length();return r.length()>=i+t&&!(i===0&&t===s)?Ur(r,i,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),i=(new Z).retain(e).concat(r);return this.scroll.insertContents(e,r),this.update(i)}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(i=>{this.scroll.formatAt(e,t.length,i,r[i])}),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),[i,s]=this.scroll.line(e+t);let a=0,l=new Z;i!=null&&(a=i.length()-s,l=i.delta().slice(s,s+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 i=this.delta;if(t.length===1&&t[0].type==="characterData"&&t[0].target.data.match(wf)&&this.scroll.find(t[0].target)){const s=this.scroll.find(t[0].target),a=gt(s),l=s.offset(this.scroll),c=t[0].oldValue.replace(At.CONTENTS,""),u=(new Z).insert(c),f=(new Z).insert(s.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=i.compose(e)}else this.delta=this.getDelta(),(!e||!Ts(i.compose(e),this.delta))&&(e=i.diff(this.delta,r));return e}}function tr(n,e,t){if(n.length===0){const[p]=Gi(t.pop());return e<=0?`</li></${p}>`:`</li></${p}>${tr([],e-1,t)}`}const[{child:r,offset:i,length:s,indent:a,type:l},...c]=n,[u,f]=Gi(l);if(a>e)return t.push(l),a===e+1?`<${u}><li${f}>${Ur(r,i,s)}${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,i,s)}${tr(c,a,t)}`;const[h]=Gi(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 Li(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 i=[];if(n.children.forEachAt(e,t,(u,f,g)=>{i.push(Ur(u,f,g))}),r||n.statics.blotName==="list")return i.join("");const{outerHTML:s,innerHTML:a}=n.domNode,[l,c]=s.split(`>${a}<`);return l==="<table"?`<table style="border: 1px solid #000;">${i.join("")}<${c}`:`${l}>${i.join("")}<${c}`}return n.domNode instanceof Element?n.domNode.outerHTML:""}function xf(n,e){return Object.keys(e).reduce((t,r)=>{if(n[r]==null)return t;const i=e[r];return i===n[r]?t[r]=i:Array.isArray(i)?i.indexOf(n[r])<0?t[r]=i.concat([n[r]]):t[r]=i:t[r]=[i,n[r]],t},{})}function Gi(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 Of(n){const e=[];return n.forEach(t=>{typeof t.insert=="string"?t.insert.split(`\n`).forEach((i,s)=>{s&&e.push({insert:`\n`,attributes:t.attributes}),i&&e.push({insert:i,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 si="\ufeff";class xs 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(si),this.rightGuard=document.createTextNode(si),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 i=e.data.split(si).join("");if(e===this.leftGuard)if(this.prev instanceof xt){const s=this.prev.length();this.prev.insertAt(s,i),t={startNode:this.prev.domNode,startOffset:s+i.length}}else r=document.createTextNode(i),this.parent.insertBefore(this.scroll.create(r),this),t={startNode:r,startOffset:i.length};else e===this.rightGuard&&(this.next instanceof xt?(this.next.insertAt(0,i),t={startNode:this.next.domNode,startOffset:i.length}):(r=document.createTextNode(i),this.parent.insertBefore(this.scroll.create(r),this.next),t={startNode:r,startOffset:i.length}));return e.data=si,t}update(e,t){e.forEach(r=>{if(r.type==="characterData"&&(r.target===this.leftGuard||r.target===this.rightGuard)){const i=this.restore(r.target);i&&(t.range=i)}})}}class Lf{isComposing=!1;constructor(e,t){this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",e=>{this.isComposing||this.handleCompositionStart(e)}),this.scroll.domNode.addEventListener("compositionend",e=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(e)})})}handleCompositionStart(e){const t=e.target instanceof Node?this.scroll.find(e.target,!0):null;t&&!(t instanceof xs)&&(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 Cf=n=>n.parentElement||n.getRootNode().host||null,Rf=n=>{const e=n.getBoundingClientRect(),t="offsetWidth"in n&&Math.abs(e.width)/n.offsetWidth||1,r="offsetHeight"in n&&Math.abs(e.height)/n.offsetHeight||1;return{top:e.top,right:e.left+n.clientWidth*t,bottom:e.top+n.clientHeight*r,left:e.left}},ai=n=>{const e=parseInt(n,10);return Number.isNaN(e)?0:e},xa=(n,e,t,r,i,s)=>n<t&&e>r?0:n<t?-(t-n+i):e>r?e-n>r-t?n+i-t:e-r+s:0,If=(n,e)=>{const t=n.ownerDocument;let r=e,i=n;for(;i;){const s=i===t.body,a=s?{top:0,right:window.visualViewport?.width??t.documentElement.clientWidth,bottom:window.visualViewport?.height??t.documentElement.clientHeight,left:0}:Rf(i),l=getComputedStyle(i),c=xa(r.left,r.right,a.left,a.right,ai(l.scrollPaddingLeft),ai(l.scrollPaddingRight)),u=xa(r.top,r.bottom,a.top,a.bottom,ai(l.scrollPaddingTop),ai(l.scrollPaddingBottom));if(c||u)if(s)t.defaultView?.scrollBy(c,u);else{const{scrollLeft:f,scrollTop:g}=i;u&&(i.scrollTop+=u),c&&(i.scrollLeft+=c);const h=i.scrollLeft-f,p=i.scrollTop-g;r={left:r.left-h,top:r.top-p,right:r.right-h,bottom:r.bottom-p}}i=s||l.position==="fixed"?null:Cf(i)}},kf=100,Mf=["block","break","cursor","inline","scroll","text"],Df=(n,e,t)=>{const r=new or;return Mf.forEach(i=>{const s=e.query(i);s&&r.register(s)}),n.forEach(i=>{let s=e.query(i);s||t.error(`Cannot register "${i}" specified in "formats" config. Are you sure it was registered?`);let a=0;for(;s;)if(r.register(s),s="blotName"in s?s.requiredContainer??null:null,a+=1,a>kf){t.error(`Cycle detected in registering blot requiredContainer: "${i}"`);break}}),r},sr=Qt("quill"),oi=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:oi,theme:"default"};static events=W.events;static sources=W.sources;static version="2.0.3";static imports={delta:Z,parchment:gf,"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 ds.get(e)||oi.find(e,t)}static import(e){return this.imports[e]==null&&sr.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(i=>{this.register(i,e[i],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&&sr.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&oi.register(t),typeof t.register=="function"&&t.register(oi)}}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=Bf(e,t),this.container=this.options.container,this.container==null){sr.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="",ds.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new W;const i=ws.blotName,s=this.options.registry.query(i);if(!s||!("blotName"in s))throw new Error(`Cannot initialize Quill without "${i}" blot`);if(this.scroll=new s(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new Sf(this.scroll),this.selection=new Af(this.scroll,this.emitter),this.composition=new Lf(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(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 i=this.getSelection(!0);let s=new Z;if(i==null)return s;if(this.scroll.query(e,Y.BLOCK))s=this.editor.formatLine(i.index,i.length,{[e]:t});else{if(i.length===0)return this.selection.format(e,t),s;s=this.editor.formatText(i.index,i.length,{[e]:t})}return this.setSelection(i,W.sources.SILENT),s},r)}formatLine(e,t,r,i,s){let a;return[e,t,a,s]=Gt(e,t,r,i,s),Nt.call(this,()=>this.editor.formatLine(e,t,a),s,e,0)}formatText(e,t,r,i,s){let a;return[e,t,a,s]=Gt(e,t,r,i,s),Nt.call(this,()=>this.editor.formatText(e,t,a),s,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 i=this.container.getBoundingClientRect();return{bottom:r.bottom-i.top,height:r.height,left:r.left-i.left,right:r.right-i.left,top:r.top-i.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 i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:A.sources.API;return Nt.call(this,()=>this.editor.insertEmbed(e,t,r),i,e)}insertText(e,t,r,i,s){let a;return[e,,a,s]=Gt(e,0,r,i,s),Nt.call(this,()=>this.editor.insertText(e,t,a),s,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){If(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(),i=this.editor.deleteText(0,r),s=this.editor.insertContents(0,e),a=this.editor.deleteText(this.getLength()-1,1);return i.compose(s).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 Vi(n){return Object.entries(n??{}).reduce((e,t)=>{let[r,i]=t;return{...e,[r]:i===!0?{}:i}},{})}function La(n){return Object.fromEntries(Object.entries(n).filter(e=>e[1]!==void 0))}function Bf(n,e){const t=Oa(n);if(!t)throw new Error("Invalid Quill container");const i=!e.theme||e.theme===A.DEFAULTS.theme?cr:A.import(`themes/${e.theme}`);if(!i)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:s,...a}=A.DEFAULTS,{modules:l,...c}=i.DEFAULTS;let u=Vi(e.modules);u!=null&&u.toolbar&&u.toolbar.constructor!==Object&&(u={...u,toolbar:{container:u.toolbar}});const f=dn({},Vi(s),Vi(l),u),g={...a,...La(c),...La(e)};let h=e.registry;return h?e.formats&&sr.warn('Ignoring "formats" option because "registry" is specified'):h=e.formats?Df(e.formats,g.registry,sr):g.registry,{...g,registry:h,container:t,theme:i,modules:Object.entries(f).reduce((p,y)=>{let[_,N]=y;if(!N)return p;const T=A.import(`modules/${_}`);return T==null?(sr.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 i=t==null?null:this.getSelection();const s=this.editor.delta,a=n();if(i!=null&&(t===!0&&(t=i.index),r==null?i=Ca(i,a,e):r!==0&&(i=Ca(i,t,r,e)),this.setSelection(i,W.sources.SILENT)),a.length()>0){const l=[W.events.TEXT_CHANGE,a,s,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,i){let s={};return typeof n.index=="number"&&typeof n.length=="number"?typeof e!="number"?(i=r,r=t,t=e,e=n.length,n=n.index):(e=n.length,n=n.index):typeof e!="number"&&(i=r,r=t,t=e,e=0),typeof t=="object"?(s=t,i=r):typeof t=="string"&&(r!=null?s[t]=r:i=t),i=i||W.sources.API,[n,e,s,i]}function Ca(n,e,t,r){const i=typeof t=="number"?t:0;if(n==null)return null;let s,a;return e&&typeof e.transformPosition=="function"?[s,a]=[n.index,n.index+n.length].map(l=>e.transformPosition(l,r!==W.sources.USER)):[s,a]=[n.index,n.index+n.length].map(l=>l<e||l===e&&r===W.sources.USER?l:i>=0?l+i:Math.max(e,l+i)),new kn(s,a-s)}class qn extends Oi{}function Ra(n){return n instanceof Ze||n instanceof mt}function Ia(n){return typeof n.updateContent=="function"}class $f extends ws{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=Ze;static allowedChildren=[Ze,mt,qn];constructor(e,t,r){let{emitter:i}=r;super(e,t),this.emitter=i,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",s=>this.handleDragStart(s))}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,i]=this.line(e),[s]=this.line(e+t);if(super.deleteAt(e,t),s!=null&&r!==s&&i>0){if(r instanceof mt||s instanceof mt){this.optimize();return}const a=s.children.head instanceof Lt?null:s.children.head;r.moveChildren(s,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,i){super.formatAt(e,t,r,i),this.optimize()}insertAt(e,t,r){if(e>=this.length())if(r==null||this.scroll.query(t,Y.BLOCK)==null){const i=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(i),r==null&&t.endsWith(`\n`)?i.insertAt(0,t.slice(0,-1),r):i.insertAt(0,t,r)}else{const i=this.scroll.create(t,r);this.appendChild(i)}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`))),i=r.pop();if(i==null)return;this.batchStart();const s=r.shift();if(s){const c=s.type==="block"&&(s.delta.length()===0||!this.descendant(mt,e)[0]&&e<this.length()),u=s.type==="block"?s.delta:(new Z).insert({[s.key]:s.value});Zi(this,e,u);const f=s.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,s.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);Zi(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])})}})),i.type==="block"&&i.delta.length()){const c=a?a.offset(a.scroll)+l:this.length();Zi(this,c,i.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,i]=t;return r instanceof Xe?[r,i]:[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=(i,s,a)=>{let l=[],c=a;return i.children.forEachAt(s,a,(u,f,g)=>{Ra(u)?l.push(u):u instanceof Oi&&(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:i}=r;const s=this.find(i,!0);return s&&!Ia(s)}),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[i]=this.descendant(s=>s instanceof mt,e);i&&i.statics.blotName===t&&Ia(i)&&i.updateContent(r)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let r=new Z;return e.forEach(i=>{const s=i?.insert;if(s)if(typeof s=="string"){const a=s.split(`\n`);a.slice(0,-1).forEach(c=>{r.insert(c,i.attributes),t.push({type:"block",delta:r,attributes:i.attributes??{}}),r=new Z});const l=a[a.length-1];l&&r.insert(l,i.attributes)}else{const a=Object.keys(s)[0];if(!a)return;this.query(a,Y.INLINE)?r.push(i):(r.length()&&t.push({type:"block",delta:r,attributes:{}}),r=new Z,t.push({type:"blockEmbed",key:a,value:s[a],attributes:i.attributes??{}}))}}),r.length()&&t.push({type:"block",delta:r,attributes:{}}),t}createBlock(e,t){let r;const i={};Object.entries(e).forEach(l=>{let[c,u]=l;this.query(c,Y.BLOCK&Y.BLOT)!=null?r=c:i[c]=u});const s=this.create(r||this.statics.defaultChild.blotName,r?e[r]:void 0);this.insertBefore(s,t||void 0);const a=s.length();return Object.entries(i).forEach(l=>{let[c,u]=l;s.formatAt(0,a,c,u)}),s}}function Zi(n,e,t){t.reduce((r,i)=>{const s=bt.Op.length(i);let a=i.attributes||{};if(i.insert!=null){if(typeof i.insert=="string"){const l=i.insert;n.insertAt(r,l);const[c]=n.descendant(Xe,r),u=gt(c);a=bt.AttributeMap.diff(u,a)||{}}else if(typeof i.insert=="object"){const l=Object.keys(i.insert)[0];if(l==null)return r;if(n.insertAt(r,l,i.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,s,l,a[l])}),r+s},e)}const Os={scope:Y.BLOCK,whitelist:["right","center","justify"]},qf=new $t("align","align",Os),$o=new Ot("align","ql-align",Os),qo=new pn("align","text-align",Os);class Po extends pn{value(e){let t=super.value(e);return t.startsWith("rgb(")?(t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${t.split(",").map(i=>`00${parseInt(i,10).toString(16)}`.slice(-2)).join("")}`):t}}const Pf=new Ot("color","ql-color",{scope:Y.INLINE}),Ls=new Po("color","color",{scope:Y.INLINE}),Uf=new Ot("background","ql-bg",{scope:Y.INLINE}),Cs=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${Li(this.code(e,t))}\n</pre>`}}class nt extends Ze{static TAB=" ";static register(){A.register(Pn)}}class Rs extends mn{}Rs.blotName="code";Rs.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 Is={scope:Y.BLOCK,whitelist:["rtl"]},Uo=new $t("direction","dir",Is),Fo=new Ot("direction","ql-direction",Is),Ho=new pn("direction","direction",Is),zo={scope:Y.INLINE,whitelist:["serif","monospace"]},jo=new Ot("font","ql-font",zo);class Ff extends pn{value(e){return super.value(e).replace(/["']/g,"")}}const Ko=new Ff("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"]}),Hf=Qt("quill:keyboard"),zf=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Ci 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 i=Kf(e);if(i==null){Hf.warn("Attempted to add invalid keyboard binding",i);return}typeof t=="function"&&(t={handler:t}),typeof r=="function"&&(r={handler:r}),(Array.isArray(i.key)?i.key:[i.key]).forEach(a=>{const l={...i,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 i=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter(T=>Ci.match(e,T));if(i.length===0)return;const s=A.find(e.target,!0);if(s&&s.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 yi?u.value().slice(0,f):"",y=g instanceof yi?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};i.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:Ts(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 i={};const[s]=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=s.formats(),f=this.quill.getFormat(e.index-1,1);if(i=bt.AttributeMap.diff(u,f)||{},Object.keys(i).length>0){const g=(new Z).retain(e.index+s.length()-2).retain(1,i);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 i={};const[s]=this.quill.getLine(e.index);let a=(new Z).retain(e.index).delete(r);if(t.offset>=s.length()-1){const[l]=this.quill.getLine(e.index+1);if(l){const c=s.formats(),u=this.quill.getFormat(e.index,1);i=bt.AttributeMap.diff(c,u)||{},Object.keys(i).length>0&&(a=a.retain(l.length()-1).retain(1,i))}}this.quill.updateContents(a,A.sources.USER),this.quill.focus()}handleDeleteRange(e){ks({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const r=Object.keys(t.format).reduce((s,a)=>(this.quill.scroll.query(a,Y.BLOCK)&&!Array.isArray(t.format[a])&&(s[a]=t.format[a]),s),{}),i=(new Z).retain(e.index).delete(e.length).insert(`\n`,r);this.quill.updateContents(i,A.sources.USER),this.quill.setSelection(e.index+1,A.sources.SILENT),this.quill.focus()}}const jf={bindings:{bold:Wi("bold"),italic:Wi("italic"),underline:Wi("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"},i=(new Z).retain(n.index).insert(`\n`,r).retain(e.length()-t-1).retain(1,{list:"unchecked"});this.quill.updateContents(i,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),i=(new Z).retain(n.index).insert(`\n`,e.format).retain(t.length()-r-1).retain(1,{header:null});this.quill.updateContents(i,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,i,s]=e.getTable(n),a=Gf(t,r,i,s);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,i=r.offset(this.quill.scroll);t.shiftKey?this.quill.setSelection(i-1,A.sources.USER):this.quill.setSelection(i+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,i]=this.quill.getLine(n.index);if(i>t)return!0;let s;switch(e.prefix.trim()){case"[]":case"[ ]":s="unchecked";break;case"[x]":s="checked";break;case"-":case"*":s="bullet";break;default:s="ordered"}this.quill.insertText(n.index," ",A.sources.USER),this.quill.history.cutoff();const a=(new Z).retain(n.index-i).delete(t+1).retain(r.length()-2-i).retain(1,{list:s});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,i=e;for(;i!=null&&i.length()<=1&&i.formats()["code-block"];)if(i=i.prev,r-=1,r<=0){const s=(new Z).retain(n.index+e.length()-t-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(s,A.sources.USER),this.quill.setSelection(n.index-1,A.sources.SILENT),!1}return!0}},"embed left":li("ArrowLeft",!1),"embed left shift":li("ArrowLeft",!0),"embed right":li("ArrowRight",!1),"embed right shift":li("ArrowRight",!0),"table down":Ma(!1),"table up":Ma(!0)}};Ci.DEFAULTS=jf;function ka(n){return{key:"Tab",shiftKey:!n,format:{"code-block":!0},handler(e,t){let{event:r}=t;const i=this.quill.scroll.query("code-block"),{TAB:s}=i;if(e.length===0&&!r.shiftKey){this.quill.insertText(e.index,s,A.sources.USER),this.quill.setSelection(e.index+s.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,s),f===0?l+=s.length:c+=s.length):u.domNode.textContent.startsWith(s)&&(u.deleteAt(0,s.length),f===0?l-=s.length:c-=s.length)}),this.quill.update(A.sources.USER),this.quill.setSelection(l,c,A.sources.SILENT)}}}function li(n,e){return{key:n,shiftKey:e,altKey:null,[n==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(r){let{index:i}=r;n==="ArrowRight"&&(i+=r.length+1);const[s]=this.quill.getLeaf(i);return s 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 Wi(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",i=t.line,s=i.parent[r];if(s!=null){if(s.statics.blotName==="table-row"){let a=s.children.head,l=i;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=i.table()[r];a!=null&&(n?this.quill.setSelection(a.offset(this.quill.scroll)+a.length()-1,0,A.sources.USER):this.quill.setSelection(a.offset(this.quill.scroll),0,A.sources.USER))}return!1}}}function Kf(n){if(typeof n=="string"||typeof n=="number")n={key:n};else if(typeof n=="object")n=rr(n);else return null;return n.shortKey&&(n[zf]=n.shortKey,delete n.shortKey),n}function ks(n){let{quill:e,range:t}=n;const r=e.getLines(t);let i={};if(r.length>1){const s=r[0].formats(),a=r[r.length-1].formats();i=bt.AttributeMap.diff(a,s)||{}}e.deleteText(t,A.sources.USER),Object.keys(i).length>0&&e.formatLine(t.index,1,i,A.sources.USER),e.setSelection(t.index,A.sources.SILENT)}function Gf(n,e,t,r){return e.prev==null&&e.next==null?t.prev==null&&t.next==null?r===0?-1:1:t.prev==null?-1:1:e.prev==null?-1:e.next==null?1:null}const Vf=/font-weight:\s*normal/,Zf=["P","OL","UL"],Da=n=>n&&Zf.includes(n.tagName),Wf=n=>{Array.from(n.querySelectorAll("br")).filter(e=>Da(e.previousElementSibling)&&Da(e.nextElementSibling)).forEach(e=>{e.parentNode?.removeChild(e)})},Yf=n=>{Array.from(n.querySelectorAll('b[style*="font-weight"]')).filter(e=>e.getAttribute("style")?.match(Vf)).forEach(e=>{const t=n.createDocumentFragment();t.append(...e.childNodes),e.parentNode?.replaceChild(t,e)})};function Qf(n){n.querySelector('[id^="docs-internal-guid-"]')&&(Yf(n),Wf(n))}const Xf=/\bmso-list:[^;]*ignore/i,Jf=/\bmso-list:[^;]*\bl(\d+)/i,eg=/\bmso-list:[^;]*\blevel(\d+)/i,tg=(n,e)=>{const t=n.getAttribute("style"),r=t?.match(Jf);if(!r)return null;const i=Number(r[1]),s=t?.match(eg),a=s?Number(s[1]):1,l=new RegExp(`@list l${i}:level${a}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),c=e.match(l),u=c&&c[1]==="bullet"?"bullet":"ordered";return{id:i,indent:a,type:u,element:n}},ng=n=>{const e=Array.from(n.querySelectorAll("[style*=mso-list]")),t=[],r=[];e.forEach(a=>{(a.getAttribute("style")||"").match(Xf)?t.push(a):r.push(a)}),t.forEach(a=>a.parentNode?.removeChild(a));const i=n.documentElement.innerHTML,s=r.map(a=>tg(a,i)).filter(a=>a);for(;s.length;){const a=[];let l=s.shift();for(;l;)a.push(l),l=s.length&&s[0]?.element===l.element.nextElementSibling&&s[0].id===l.id?s.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 rg(n){n.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&ng(n)}const ig=[rg,Qf],sg=n=>{n.documentElement&&ig.forEach(e=>{e(n)})},ag=Qt("quill:clipboard"),og=[[Node.TEXT_NODE,_g],[Node.TEXT_NODE,$a],["br",fg],[Node.ELEMENT_NODE,$a],[Node.ELEMENT_NODE,hg],[Node.ELEMENT_NODE,dg],[Node.ELEMENT_NODE,Eg],["li",mg],["ol, ul",bg],["pre",gg],["tr",yg],["b",Yi("bold")],["i",Yi("italic")],["strike",Yi("strike")],["style",pg]],lg=[qf,Uo].reduce((n,e)=>(n[e.keyName]=e,n),{}),Ba=[qo,Cs,Ls,Ho,Ko,Vo].reduce((n,e)=>(n[e.keyName]=e,n),{});class cg 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=[],og.concat(this.options.matchers??[]).forEach(r=>{let[i,s]=r;this.addMatcher(i,s)})}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:r}=e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(i[nt.blotName])return(new Z).insert(r||"",{[nt.blotName]:i[nt.blotName]});if(!t)return(new Z).insert(r||"",i);const s=this.convertHTML(t);return jr(s,`\n`)&&(s.ops[s.ops.length-1].attributes==null||i.table)?s.compose((new Z).retain(s.length()-1).delete(1)):s}normalizeHTML(e){sg(e)}convertHTML(e){const t=(new DOMParser).parseFromString(e,"text/html");this.normalizeHTML(t);const r=t.body,i=new WeakMap,[s,a]=this.prepareMatching(r,i);return Ms(this.quill.scroll,r,s,a,i)}dangerouslyPasteHTML(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:A.sources.API;if(typeof e=="string"){const i=this.convert({html:e,text:""});this.quill.setContents(i,t),this.quill.setSelection(0,A.sources.SILENT)}else{const i=this.convert({html:t,text:""});this.quill.updateContents((new Z).retain(e).concat(i),r),this.quill.setSelection(e+i.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:i,text:s}=this.onCopy(r,t);e.clipboardData?.setData("text/plain",s),e.clipboardData?.setData("text/html",i),t&&ks({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 i=e.clipboardData?.getData("text/plain");if(!r&&!i){const a=e.clipboardData?.getData("text/uri-list");a&&(i=this.normalizeURIList(a))}const s=Array.from(e.clipboardData?.files||[]);if(!r&&s.length>0){this.quill.uploader.upload(t,s);return}if(r&&s.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,s);return}}this.onPaste(t,{html:r,text:i})}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:r,html:i}=t;const s=this.quill.getFormat(e.index),a=this.convert({text:r,html:i},s);ag.log("onPaste",a,{text:r,html:i});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=[],i=[];return this.matchers.forEach(s=>{const[a,l]=s;switch(a){case Node.TEXT_NODE:i.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,i]}}function Un(n,e,t,r){return r.query(e)?n.reduce((i,s)=>{if(!s.insert)return i;if(s.attributes&&s.attributes[e])return i.push(s);const a=t?{[e]:t}:{};return i.insert(s.insert,{...a,...s.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 i=n.ops[r];if(typeof i.insert!="string")break;t=i.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 ug(n,e){return n.previousElementSibling&&n.nextElementSibling&&!un(n.previousElementSibling,e)&&!un(n.nextElementSibling,e)}const ci=new WeakMap;function Zo(n){return n==null?!1:(ci.has(n)||(n.tagName==="PRE"?ci.set(n,!0):ci.set(n,Zo(n.parentNode))),ci.get(n))}function Ms(n,e,t,r,i){return e.nodeType===e.TEXT_NODE?r.reduce((s,a)=>a(e,s,n),new Z):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((s,a)=>{let l=Ms(n,a,t,r,i);return a.nodeType===e.ELEMENT_NODE&&(l=t.reduce((c,u)=>u(a,c,n),l),l=(i.get(a)||[]).reduce((c,u)=>u(a,c,n),l)),s.concat(l)},new Z):new Z}function Yi(n){return(e,t,r)=>Un(t,n,!0,r)}function dg(n,e,t){const r=$t.keys(n),i=Ot.keys(n),s=pn.keys(n),a={};return r.concat(i).concat(s).forEach(l=>{let c=t.query(l,Y.ATTRIBUTE);c!=null&&(a[c.attrName]=c.value(n),a[c.attrName])||(c=lg[l],c!=null&&(c.attrName===l||c.keyName===l)&&(a[c.attrName]=c.value(n)||void 0),c=Ba[l],c!=null&&(c.attrName===l||c.keyName===l)&&(c=Ba[l],a[c.attrName]=c.value(n)||void 0))}),Object.entries(a).reduce((l,c)=>{let[u,f]=c;return Un(l,u,f,t)},e)}function hg(n,e,t){const r=t.query(n);if(r==null)return e;if(r.prototype instanceof ot){const i={},s=r.value(n);if(s!=null)return i[r.blotName]=s,(new Z).insert(i,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 fg(n,e){return jr(e,`\n`)||e.insert(`\n`),e}function gg(n,e,t){const r=t.query("code-block"),i=r&&"formats"in r&&typeof r.formats=="function"?r.formats(n,t):!0;return Un(e,"code-block",i,t)}function pg(){return new Z}function mg(n,e,t){const r=t.query(n);if(r==null||r.blotName!=="list"||!jr(e,`\n`))return e;let i=-1,s=n.parentNode;for(;s!=null;)["OL","UL"].includes(s.tagName)&&(i+=1),s=s.parentNode;return i<=0?e:e.reduce((a,l)=>l.insert?l.attributes&&typeof l.attributes.indent=="number"?a.push(l):a.insert(l.insert,{indent:i,...l.attributes||{}}):a,new Z)}function bg(n,e,t){const r=n;let i=r.tagName==="OL"?"ordered":"bullet";const s=r.getAttribute("data-checked");return s&&(i=s==="true"?"checked":"unchecked"),Un(e,"list",i,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 i=t.query(r);if(i&&i.prototype instanceof mt)return e.insert(`\n`);r=r.firstChild}}}return e}function Eg(n,e,t){const r={},i=n.style||{};return i.fontStyle==="italic"&&(r.italic=!0),i.textDecoration==="underline"&&(r.underline=!0),i.textDecoration==="line-through"&&(r.strike=!0),(i.fontWeight?.startsWith("bold")||parseInt(i.fontWeight,10)>=700)&&(r.bold=!0),e=Object.entries(r).reduce((s,a)=>{let[l,c]=a;return Un(s,l,c,t)},e),parseFloat(i.textIndent||0)>0?(new Z).insert("\t").concat(e):e}function yg(n,e,t){const r=n.parentElement?.tagName==="TABLE"?n.parentElement:n.parentElement?.parentElement;if(r!=null){const s=Array.from(r.querySelectorAll("tr")).indexOf(n)+1;return Un(e,"table",s,t)}return e}function _g(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`)&&!ug(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 vg 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,i,s,a)=>{r===A.events.SELECTION_CHANGE?i&&a!==A.sources.SILENT&&(this.currentRange=i):r===A.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||a===A.sources.USER?this.record(i,s):this.transform(i)),this.currentRange=gs(this.currentRange,i))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",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 i=this.quill.getContents(),s=r.delta.invert(i);this.stack[t].push({delta:s,range:gs(r.range,s)}),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),i=this.currentRange;const s=Date.now();if(this.lastRecorded+this.options.delay>s&&this.stack.undo.length>0){const a=this.stack.undo.pop();a&&(r=r.compose(a.delta),i=a.range)}else this.lastRecorded=s;r.length()!==0&&(this.stack.undo.push({delta:r,range:i}),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=Tg(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 i=n[r];n[r]={delta:t.transform(i.delta,!0),range:i.range&&gs(i.range,t)},t=i.delta.transform(t),n[r].delta.length()===0&&n.splice(r,1)}}function Ng(n,e){const t=e.ops[e.ops.length-1];return t==null?!1:t.insert!=null?typeof t.insert=="string"&&t.insert.endsWith(`\n`):t.attributes!=null?Object.keys(t.attributes).some(r=>n.query(r,Y.BLOCK)!=null):!1}function Tg(n,e){const t=e.reduce((i,s)=>i+(s.delete||0),0);let r=e.length()-t;return Ng(n,e)&&(r-=1),r}function gs(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 i=null;if(document.caretRangeFromPoint)i=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(r.clientX,r.clientY);i=document.createRange(),i.setStart(a.offsetNode,a.offset),i.setEnd(a.offsetNode,a.offset)}const s=i&&e.selection.normalizeNative(i);if(s){const a=e.selection.normalizedToRange(s);r.dataTransfer?.files&&this.upload(a,r.dataTransfer.files)}})}upload(e,t){const r=[];Array.from(t).forEach(i=>{i&&this.options.mimetypes?.includes(i.type)&&r.push(i)}),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(i=>{const s=new FileReader;s.onload=()=>{i(s.result)},s.readAsDataURL(r)}));Promise.all(t).then(r=>{const i=r.reduce((s,a)=>s.insert({image:a}),(new Z).retain(n.index).delete(n.length));this.quill.updateContents(i,W.sources.USER),this.quill.setSelection(n.index+r.length,W.sources.SILENT)})}};const Ag=["insertText","insertReplacementText"];class wg 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){ks({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||!Ag.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const r=Sg(e);if(r==null)return;const i=this.quill.selection.normalizeNative(t),s=i?this.quill.selection.normalizedToRange(i):null;s&&this.replaceText(s,r)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function Sg(n){return typeof n.data=="string"?n.data:n.dataTransfer?.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const xg=/Mac/i.test(navigator.platform),Og=100,Lg=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||xg&&n.key==="a"&&n.ctrlKey===!0);class Cg extends 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:i}=t;if(!(r instanceof St)||!r.uiNode)return!0;const s=getComputedStyle(r.domNode).direction==="rtl";return s&&i.key!=="ArrowRight"||!s&&i.key!=="ArrowLeft"?!0:(this.quill.setSelection(e.index-1,e.length+(i.shiftKey?1:0),A.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",e=>{!e.defaultPrevented&&Lg(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+Og,this.isListening)return;this.isListening=!0;const e=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",e,{once:!0})}handleSelectionChange(){const e=document.getSelection();if(!e)return;const t=e.getRangeAt(0);if(t.collapsed!==!0||t.startOffset!==0)return;const r=this.quill.scroll.find(t.startContainer);if(!(r instanceof St)||!r.uiNode)return;const i=document.createRange();i.setStartAfter(r.uiNode),i.setEndAfter(r.uiNode),e.removeAllRanges(),e.addRange(i)}}A.register({"blots/block":Ze,"blots/block/embed":mt,"blots/break":Lt,"blots/container":qn,"blots/cursor":At,"blots/embed":xs,"blots/inline":mn,"blots/scroll":$f,"blots/text":xt,"modules/clipboard":cg,"modules/history":vg,"modules/keyboard":Ci,"modules/uploader":Wo,"modules/input":wg,"modules/uiNode":Cg});class Rg extends Ot{add(e,t){let r=0;if(t==="+1"||t==="-1"){const i=this.value(e)||0;r=t==="+1"?i+1:i-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 Ig=new Rg("indent","ql-indent",{scope:Y.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class kg extends Ze{static blotName="blockquote";static tagName="blockquote"}class Mg extends Ze{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}}class 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"),i=s=>{if(!e.isEnabled())return;const a=this.statics.formats(t,e);a==="checked"?(this.format("list","unchecked"),s.preventDefault()):a==="unchecked"&&(this.format("list","checked"),s.preventDefault())};r.addEventListener("mousedown",i),r.addEventListener("touchstart",i),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 Ds 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 Dg extends Ds{static blotName="italic";static tagName=["EM","I"]}class _i 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 Bg 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 $g extends Ds{static blotName="strike";static tagName=["S","STRIKE"]}class qg extends mn{static blotName="underline";static tagName="U"}class Pg extends xs{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return typeof e=="string"&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`<span>${e}</span>`}}const Pa=["alt","height","width"];let Ug=class extends 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 Fg 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 _i.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,i){r===pt.blotName&&(this.forceNext=!0),super.formatAt(e,t,r,i)}highlight(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const i=`${Array.from(this.domNode.childNodes).filter(a=>a!==this.uiNode).map(a=>a.textContent).join(`\n`)}\n`,s=pt.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==i){if(i.trim().length>0||this.cachedText==null){const a=this.children.reduce((c,u)=>c.concat(Do(u,!1)),new Z),l=e(i,s);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=i,this.forceNext=!1}}html(e,t){const[r]=this.children.find(e);return`<pre data-language="${r?pt.formats(r.domNode):"plain"}">\n${Li(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 Hg=(n,e,t)=>{if(typeof n.versionString=="string"){const r=n.versionString.split(".")[0];if(parseInt(r,10)>=11)return n.highlight(t,{language:e}).value}return n.highlight(e,t).value};class 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,i)=>{let{key:s}=i;return r[s]=!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:i,label:s}=r;const a=t.ownerDocument.createElement("option");a.textContent=s,a.setAttribute("value",i),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(s=>{s.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 Li(e).split(`\n`).reduce((i,s,a)=>(a!==0&&i.insert(`\n`,{[nt.blotName]:t}),i.insert(s)),new Z);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(nt.className),r.innerHTML=Hg(this.options.hljs,t,e),Ms(this.quill.scroll,r,[(i,s)=>{const a=kr.value(i);return a?s.compose((new Z).retain(s.length(),{[Wt.blotName]:a})):s}],[(i,s)=>i.data.split(`\n`).reduce((a,l,c)=>(c!==0&&a.insert(`\n`,{[nt.blotName]:t}),a.insert(l)),s)],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",Bs()),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(),i=this.next.children.tail.formats();return e.table===t.table&&e.table===r.table&&e.table===i.table}return!1}optimize(e){super.optimize(e),this.children.forEach(t=>{if(t.next==null)return;const r=t.formats(),i=t.next.formats();if(r.table!==i.table){const s=this.splitAfter(t);s&&s.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 vi extends qn{static blotName="table-container";static tagName="TABLE";balanceCells(){const e=this.descendants(Mn),t=e.reduce((r,i)=>Math.max(i.children.length,r),0);e.forEach(r=>{new Array(t-r.children.length).fill(0).forEach(()=>{let i;r.children.head!=null&&(i=wt.formats(r.children.head.domNode));const s=this.scroll.create(wt.blotName,i);r.appendChild(s),s.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 i=r.children.at(e);i?.remove()})}insertColumn(e){const[t]=this.descendant(hn);t==null||t.children.head==null||t.children.forEach(r=>{const i=r.children.at(e),s=wt.formats(r.children.head.domNode),a=this.scroll.create(wt.blotName,s);r.insertBefore(a,i)})}insertRow(e){const[t]=this.descendant(hn);if(t==null||t.children.head==null)return;const r=Bs(),i=this.scroll.create(Mn.blotName);t.children.head.children.forEach(()=>{const a=this.scroll.create(wt.blotName,r);i.appendChild(a)});const s=t.children.at(e);t.insertBefore(i,s)}rows(){const e=this.children.head;return e==null?[]:e.children.map(t=>t)}}vi.allowedChildren=[hn];hn.requiredContainer=vi;hn.allowedChildren=[Mn];Mn.requiredContainer=hn;Mn.allowedChildren=[wt];wt.requiredContainer=Mn;function Bs(){return`row-${Math.random().toString(36).slice(2,6)}`}class zg extends Pt{static register(){A.register(wt),A.register(Mn),A.register(hn),A.register(vi)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(vi).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 i=t.parent;return[i.parent.parent,i,t,r]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[r,i,s]=this.getTable(t);if(s==null)return;const a=s.cellOffset();r.insertColumn(a+e),this.quill.update(A.sources.USER);let l=i.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,i,s]=this.getTable(t);if(s==null)return;const a=i.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+i.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 i=new Array(e).fill(0).reduce(s=>{const a=new Array(t).fill(`\n`).join("");return s.insert(a,{table:Bs()})},(new Z).retain(r.index));this.quill.updateContents(i,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,i,s)=>{s===A.sources.USER&&this.balanceTables()}),!0):!1)})}}const Fa=Qt("quill:toolbar");class $s extends Pt{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const r=document.createElement("div");r.setAttribute("role","toolbar"),jg(r,this.options.container),e.container?.parentNode?.insertBefore(r,e.container),this.container=r}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){Fa.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(r=>{const i=this.options.handlers?.[r];i&&this.addHandler(r,i)}),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(i=>i.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,i=>{let s;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const l=e.options[e.selectedIndex];l.hasAttribute("selected")?s=!1:s=l.value||!1}else e.classList.contains("ql-active")?s=!1:s=e.value||!e.hasAttribute("value"),i.preventDefault();this.quill.focus();const[a]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,s);else if(this.quill.scroll.query(t).prototype instanceof ot){if(s=prompt(`Enter ${t}`),!s)return;this.quill.updateContents((new Z).retain(a.index).delete(a.length).insert({[t]:s}),A.sources.USER)}else this.quill.format(t,s,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[i,s]=r;if(s.tagName==="SELECT"){let a=null;if(e==null)a=null;else if(t[i]==null)a=s.querySelector("option[selected]");else if(!Array.isArray(t[i])){let l=t[i];typeof l=="string"&&(l=l.replace(/"/g,'\\"')),a=s.querySelector(`option[value="${l}"]`)}a==null?(s.value="",s.selectedIndex=-1):a.selected=!0}else if(e==null)s.classList.remove("ql-active"),s.setAttribute("aria-pressed","false");else if(s.hasAttribute("value")){const a=t[i],l=a===s.getAttribute("value")||a!=null&&a.toString()===s.getAttribute("value")||a==null&&!s.getAttribute("value");s.classList.toggle("ql-active",l),s.setAttribute("aria-pressed",l.toString())}else{const a=t[i]!=null;s.classList.toggle("ql-active",a),s.setAttribute("aria-pressed",a.toString())}})}}$s.DEFAULTS={};function Ha(n,e,t){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${e}`),r.setAttribute("aria-pressed","false"),t!=null?(r.value=t,r.setAttribute("aria-label",`${e}: ${t}`)):r.setAttribute("aria-label",e),n.appendChild(r)}function jg(n,e){Array.isArray(e[0])||(e=[e]),e.forEach(t=>{const r=document.createElement("span");r.classList.add("ql-formats"),t.forEach(i=>{if(typeof i=="string")Ha(r,i);else{const s=Object.keys(i)[0],a=i[s];Array.isArray(a)?Kg(r,s,a):Ha(r,s,a)}}),n.appendChild(r)})}function Kg(n,e,t){const r=document.createElement("select");r.classList.add(`ql-${e}`),t.forEach(i=>{const s=document.createElement("option");i!==!1?s.setAttribute("value",String(i)):s.setAttribute("selected","selected"),r.appendChild(s)}),n.appendChild(r)}$s.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 i=n==="+1"?1:-1;t.direction==="rtl"&&(i*=-1),this.quill.format("indent",r+i,A.sources.USER)}},link(n){n===!0&&(n=prompt("Enter link URL:")),this.quill.format("link",n,A.sources.USER)},list(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e);n==="check"?t.list==="checked"||t.list==="unchecked"?this.quill.format("list",!1,A.sources.USER):this.quill.format("list","unchecked",A.sources.USER):this.quill.format("list",n,A.sources.USER)}}};const Gg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',Vg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',Zg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',Wg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',Yg='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',Qg='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',Xg='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',Jg='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',za='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',ep='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',tp='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',np='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',rp='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',ip='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',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>',ap='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',op='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',lp='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',cp='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',up='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',dp='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',hp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',fp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',gp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',pp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',mp='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',bp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',Ep='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',yp='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',_p='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',vp='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',Np='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',Tp='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',Fr={align:{"":Gg,center:Vg,right:Zg,justify:Wg},background:Yg,blockquote:Qg,bold:Xg,clean:Jg,code:za,"code-block":za,color:ep,direction:{"":tp,rtl:np},formula:rp,header:{1:ip,2:sp,3:ap,4:op,5:lp,6:cp},italic:up,image:dp,indent:{"+1":hp,"-1":fp},link:gp,list:{bullet:pp,check:mp,ordered:bp},script:{sub:Ep,super:yp},strike:_p,table:vp,underline:Np,video:Tp},Ap='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let ja=0;function Ka(n,e){n.setAttribute(e,`${n.getAttribute(e)!=="true"}`)}class Ri{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",i=>{switch(i.key){case"Enter":this.selectItem(t,!0),i.preventDefault();break;case"Escape":this.escape(),i.preventDefault();break}}),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=Ap,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${ja}`,ja+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(t=>{const r=this.buildItem(t);e.appendChild(r),t.selected===!0&&this.selectItem(r)}),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach(e=>{this.container.setAttribute(e.name,e.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.container.querySelector(".ql-selected");e!==r&&(r?.classList.remove("ql-selected"),e!=null&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const t=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class Xo extends Ri{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"),i=e&&e.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=i:r.style.fill=i)}}class Jo extends Ri{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(r=>{r.innerHTML=t[r.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const r=e||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const wp=n=>{const{overflowY:e}=getComputedStyle(n,null);return e!=="visible"&&e!=="clip"};let 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,wp(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const t=e.left+e.width/2-this.root.offsetWidth/2,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const i=this.boundsContainer.getBoundingClientRect(),s=this.root.getBoundingClientRect();let a=0;if(s.right>i.right&&(a=i.right-s.right,this.root.style.left=`${t+a}px`),s.left<i.left&&(a=i.left-s.left,this.root.style.left=`${t+a}px`),s.bottom>i.bottom){const l=s.bottom-s.top,c=e.bottom-e.top+l;this.root.style.top=`${r-c}px`,this.root.classList.add("ql-flip")}return a}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}};const Sp=[!1,"center","right","justify"],xp=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],Op=[!1,"serif","monospace"],Lp=["1","2","3",!1],Cp=["small",!1,"large","huge"];class Vr extends cr{constructor(e,t){super(e,t);const r=i=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(i.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(s=>{s.container.contains(i.target)||s.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(s=>{if(s.startsWith("ql-")&&(s=s.slice(3),t[s]!=null))if(s==="direction")r.innerHTML=t[s][""]+t[s].rtl;else if(typeof t[s]=="string")r.innerHTML=t[s];else{const a=r.value||"";a!=null&&t[s][a]&&(r.innerHTML=t[s][a])}})})}buildPickers(e,t){this.pickers=Array.from(e).map(i=>{if(i.classList.contains("ql-align")&&(i.querySelector("option")==null&&Cr(i,Sp),typeof t.align=="object"))return new Jo(i,t.align);if(i.classList.contains("ql-background")||i.classList.contains("ql-color")){const s=i.classList.contains("ql-background")?"background":"color";return i.querySelector("option")==null&&Cr(i,xp,s==="background"?"#ffffff":"#000000"),new Xo(i,t[s])}return i.querySelector("option")==null&&(i.classList.contains("ql-font")?Cr(i,Op):i.classList.contains("ql-header")?Cr(i,Lp):i.classList.contains("ql-size")&&Cr(i,Cp)),new Ri(i)});const r=()=>{this.pickers.forEach(i=>{i.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=Rp(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(t!=null){const r=t.index+t.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),e,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 Rp(n){let e=n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=n.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:n}function Cr(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach(r=>{const i=document.createElement("option");r===t?i.setAttribute("selected","selected"):i.setAttribute("value",String(r)),n.appendChild(i)})}const Ip=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class kp 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,i,s,a)=>{if(r===W.events.SELECTION_CHANGE)if(i!=null&&i.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(i.index,i.length);if(l.length===1){const c=this.quill.getBounds(i);c!=null&&this.position(c)}else{const c=l[l.length-1],u=this.quill.getIndex(c),f=Math.min(c.length()-1,i.index+i.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=Ip),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new kp(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),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 Mp=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Dp 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[i,s]=this.quill.scroll.descendant(_i,e.index);if(i!=null){this.linkRange=new kn(e.index-s,i.length());const a=_i.formats(i.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=Mp),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),Fr),this.buildPickers(e.container.querySelectorAll("select"),Fr),this.tooltip=new Dp(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(t,r)=>{e.handlers.link.call(e,!r.format.link)}))}}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":Uf,"attributors/class/color":Pf,"attributors/class/direction":Fo,"attributors/class/font":jo,"attributors/class/size":Go,"attributors/style/align":qo,"attributors/style/background":Cs,"attributors/style/color":Ls,"attributors/style/direction":Ho,"attributors/style/font":Ko,"attributors/style/size":Vo},!0);A.register({"formats/align":$o,"formats/direction":Fo,"formats/indent":Ig,"formats/background":Cs,"formats/color":Ls,"formats/font":jo,"formats/size":Go,"formats/blockquote":kg,"formats/code-block":nt,"formats/header":Mg,"formats/list":Gr,"formats/bold":Ds,"formats/code":Rs,"formats/italic":Dg,"formats/link":_i,"formats/script":Bg,"formats/strike":$g,"formats/underline":qg,"formats/formula":Pg,"formats/image":Ug,"formats/video":Fg,"modules/syntax":Qo,"modules/table":zg,"modules/toolbar":$s,"themes/bubble":nl,"themes/snow":rl,"ui/icons":Fr,"ui/picker":Ri,"ui/icon-picker":Jo,"ui/color-picker":Xo,"ui/tooltip":el},!0);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 i;const s=new Image;s.onerror=s.onabort=()=>{clearTimeout(i),r(!1)},s.onload=()=>{clearTimeout(i),t(!0)},i=setTimeout(()=>{s.src="//!/an/invalid.jpg",r(!1)},e),s.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 i=-1;for(;++i<e;)r[i]=n.charCodeAt(i);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 i=document.getSelection();let s=!1;i&&i.rangeCount>0&&(s=i.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(),i&&s&&(i.removeAllRanges(),i.addRange(s)),r&&r.focus(),a},isType(n,e){return Object.prototype.toString.call(n)===`[object ${e}]`},isObject(n){return this.isType(n,"Object")}};class Bp{constructor(e,t,r){this.dataUrl=e,this.type=t,this.name=r||""}}class Hr extends Bp{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 i=e.maxWidth||800,s=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>i&&(l.height=u*i/c,l.width=i):u>s&&(l.width=c*s/u,l.height=s);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 i="BlobBuilder"in window?window.BlobBuilder:"MSBlobBuilder"in window?window.MSBlobBuilder:"MozBlobBuilder"in window?window.MozBlobBuilder:window.WebKitBlobBuilder,s=new i;for(let a=0;a<e.length;a++)s.append(e[a]);return s.getBlob(t.type)}}getSuffix(){const e=this.type.match(/^image\/(\w+)$/);return e?e[1]:"png"}}class $p{constructor(e,t){this.quill=e,this.option=t}}class Ii extends $p{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",i)=>{typeof this.option.handler=="function"?this.option.handler.call(this,t,r,new Hr(t,r,i)):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,i=>{ht.isType(i,"DataTransferItem")?this.handleDataTransfer(i,t,r):i instanceof File&&this.handleDroppedFile(i,t,r)})}handleDataTransfer(e,t,r){const i=this,{type:s}=e;if(s.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,s)};const l=e.getAsFile?e.getAsFile():e;l instanceof Blob&&a.readAsDataURL(l)}else s.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"),i.insert(a,"image",l-a.length)})}).catch(()=>{})})}handleDroppedFile(e,t,r){const{type:i,name:s=""}=e;if(i.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,i,s)},a.readAsDataURL(e)}}insert(e,t,r){r=r===void 0?this.getIndex():r;let i;t.startsWith("image")?(i=r+1,this.quill.insertEmbed(r,"image",e,"user")):t.startsWith("text")&&(i=r+e.length,this.quill.insertText(r,e,"user")),setTimeout(()=>{this.quill.setSelection(i)})}getIndex(){let e=(this.quill.getSelection(!0)||{}).index;return(e===void 0||e<0)&&(e=this.quill.getLength()),e}}Ii.ImageData=Hr;window.QuillImageDropAndPaste=Ii;"Quill"in window&&window.Quill.register("modules/imageDropAndPaste",Ii);const qp=A.import("blots/block/embed");function Pp(){return class extends qp{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 Up=A.import("blots/inline");function Fp(n,e){return class extends Up{static blotName="internal-link";static tagName="SPAN";static className="InternalLinkPlugin";static create(r){const i=super.create(r);return e?.getDocumentTitle(r).then(s=>{i.innerHTML=`${s}`}).catch(s=>{n.logger.error("Error fetching document title:",s)}),r&&i.setAttribute("data-document-id",r),i.setAttribute("contenteditable","false"),i}static formats(r){const{documentId:i}=r.dataset;return i}}}var Hp=be("<span>");function ps({center:n}){const e=n?"QpSpinner center":"QpSpinner";return(()=>{var t=Hp();return pi(t,e),t})()}function ms(n){const e=ki(n)??0,[t]=n.getLeaf(e);if(!t)throw new Error("editor.getLeaf() returns undefined");return t.domNode}function ki(n){const e=n.getSelection();if(e!==null)return e.index+e.length}const il=n=>n!=null&&(n=Object.getPrototypeOf(n),n===Array.prototype||n===Object.prototype);function sl(n,e,t){for(const[r,i]of Object.entries(e)){const s=`${t}.${r}`;n[s]=i,il(i)&&sl(n,i,s)}}function zp(n){const e={...n};for(const[t,r]of Object.entries(n))il(r)&&sl(e,r,t);return e}const jp=(n,e)=>{if(e)for(const[t,r]of Object.entries(e))n=n.replace(new RegExp(`{{\\s*${t}\\s*}}`,"g"),r);return n},Kp=n=>n;function Gp(n,e=Kp){return(t,...r)=>{t[0]==="."&&(t=t.slice(1));const i=n()?.[t];switch(typeof i){case"function":return i(...r);case"string":return e(i,r[0]);default:return i}}}const Vp={insertHtmlSnippetMessage:"HTML-Snippet einfügen",obfuscate:"Verschleiern"},Zp="Bild",Wp="Validieren",Yp="Abbrechen",Qp="Fertig",Xp="Entfernen",Jp="auto",em="Bild nicht eingefügt, setzen Sie zuerst den Cursor in den Editor",tm="HTML-Snippet",nm="Löschung bestätigen",rm={content:"Sind Sie sicher, dass Sie dieses HTML-Snippet löschen möchten?"},im={variantLabel:"Größe {{ n }}",sizes:"Größen",imageProperties:"Bildeigenschaften",left:"Links",right:"Rechts",center:"Zentriert",alignment:"Ausrichtung",options:"Optionen",enableZoom:"Zoom aktivieren",link:"Link",mediaProperties:"Medieneigenschaften",caption:"Bildunterschrift",pixelRatio:"Pixelverhältnis"},sm={obfuscator:"Verschleierer",content:"Inhalt:",asALink:"Als Link",doNotObfuscate:"Nicht verschleiern"},am={insertVideo:"Video einfügen",dialog:{title:"Video festlegen"}},om={insertLink:"Internen Link einfügen"},lm={CustomToolbar:Vp,image:Zp,validate:Wp,delete:"Löschen",cancel:Yp,done:Qp,remove:Xp,auto:Jp,editorFocusLost:em,htmlSnippetLabel:tm,confirmDeletion:nm,comfirmSnippetDeletionDialog:rm,makeMediaPropertiesDialog:im,openObfuscatorDialog:sm,videoPlugin:am,internalLinkPlugin:om},cm={insertHtmlSnippetMessage:"Insert a HTML Snippet",obfuscate:"Obfuscate"},um="image",dm="Validate",hm="Cancel",fm="Done",gm="Remove",pm="auto",mm="Image not inserted, place cursor in editor first",bm="HTML Snippet",Em="Confirm Deletion",ym={content:"Are you sure you want to delete this HTML Snippet?"},_m={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"},vm={obfuscator:"Obfuscator",content:"Content:",asALink:"As a link",doNotObfuscate:"Do not obfuscate"},Nm={insertVideo:"Insert a Video",dialog:{title:"Set a video"}},Tm={insertLink:"Insert an internal link"},Am={CustomToolbar:cm,image:um,validate:dm,delete:"Delete",cancel:hm,done:fm,remove:gm,auto:pm,editorFocusLost:mm,htmlSnippetLabel:bm,confirmDeletion:Em,comfirmSnippetDeletionDialog:ym,makeMediaPropertiesDialog:_m,openObfuscatorDialog:vm,videoPlugin:Nm,internalLinkPlugin:Tm},wm={insertHtmlSnippetMessage:"Insertar un fragmento HTML",obfuscate:"Ofuscar"},Sm="imagen",xm="Validar",Om="Cancelar",Lm="Hecho",Cm="Quitar",Rm="auto",Im="Imagen no insertada, coloque primero el cursor en el editor",km="Fragmento HTML",Mm="Confirmar eliminación",Dm={content:"¿Está seguro de que desea eliminar este fragmento HTML?"},Bm={variantLabel:"Tamaño {{ n }}",sizes:"Tamaños",imageProperties:"Propiedades de la imagen",left:"Izquierda",right:"Derecha",center:"Centro",alignment:"Alineación",options:"Opciones",enableZoom:"Habilitar zoom",link:"Enlace",mediaProperties:"Propiedades del medio",caption:"Leyenda",pixelRatio:"Proporción de píxeles"},$m={obfuscator:"Ofuscador",content:"Contenido:",asALink:"Como enlace",doNotObfuscate:"No ofuscar"},qm={insertVideo:"Insertar un video",dialog:{title:"Configurar un video"}},Pm={insertLink:"Insertar un enlace interno"},Um={CustomToolbar:wm,image:Sm,validate:xm,delete:"Eliminar",cancel:Om,done:Lm,remove:Cm,auto:Rm,editorFocusLost:Im,htmlSnippetLabel:km,confirmDeletion:Mm,comfirmSnippetDeletionDialog:Dm,makeMediaPropertiesDialog:Bm,openObfuscatorDialog:$m,videoPlugin:qm,internalLinkPlugin:Pm},Fm={insertHtmlSnippetMessage:"Insérer un extrait de code HTML",obfuscate:"Obfusquer"},Hm="image",zm="Valider",jm="Annuler",Km="Terminé",Gm="Retirer",Vm="auto",Zm="L'image n'a pas été insérée, mettre d'abord le curseur dans l'éditeur",Wm="Code HTML",Ym="Confirmer la suppression",Qm={content:"Voulez-vous vraiment supprimer ce code HTML ?"},Xm={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"},Jm={obfuscator:"Obfusqueur",content:"Contenu:",asALink:"En tant que lien",doNotObfuscate:"Ne pas obfusquer"},eb={insertVideo:"Insérer une vidéo",dialog:{title:"Définir une vidéo"}},tb={insertLink:"Insérer un lien interne"},nb={CustomToolbar:Fm,image:Hm,validate:zm,delete:"Supprimer",cancel:jm,done:Km,remove:Gm,auto:Vm,editorFocusLost:Zm,htmlSnippetLabel:Wm,confirmDeletion:Ym,comfirmSnippetDeletionDialog:Qm,makeMediaPropertiesDialog:Xm,openObfuscatorDialog:Jm,videoPlugin:eb,internalLinkPlugin:tb},rb={insertHtmlSnippetMessage:"Inserisci un frammento HTML",obfuscate:"Offuscare"},ib="immagine",sb="Validare",ab="Annullare",ob="Fatto",lb="Rimuovere",cb="auto",ub="Immagine non inserita, posiziona prima il cursore nell'editor",db="Frammento HTML",hb="Conferma eliminazione",fb={content:"Sei sicuro di voler eliminare questo frammento HTML?"},gb={variantLabel:"Dimensione {{ n }}",sizes:"Dimensioni",imageProperties:"Proprietà dell'immagine",left:"Sinistra",right:"Destra",center:"Centro",alignment:"Allineamento",options:"Opzioni",enableZoom:"Abilita zoom",link:"Link",mediaProperties:"Proprietà del media",caption:"Didascalia",pixelRatio:"Rapporto pixel"},pb={obfuscator:"Offuscatore",content:"Contenuto:",asALink:"Come link",doNotObfuscate:"Non offuscare"},mb={insertVideo:"Inserisci un video",dialog:{title:"Imposta un video"}},bb={insertLink:"Inserisci un link interno"},Eb={CustomToolbar:rb,image:ib,validate:sb,delete:"Eliminare",cancel:ab,done:ob,remove:lb,auto:cb,editorFocusLost:ub,htmlSnippetLabel:db,confirmDeletion:hb,comfirmSnippetDeletionDialog:fb,makeMediaPropertiesDialog:gb,openObfuscatorDialog:pb,videoPlugin:mb,internalLinkPlugin:bb},yb={insertHtmlSnippetMessage:"Inserir um fragmento HTML",obfuscate:"Ofuscar"},_b="imagem",vb="Validar",Nb="Cancelar",Tb="Concluído",Ab="Remover",wb="auto",Sb="Imagem não inserida, posicione primeiro o cursor no editor",xb="Fragmento HTML",Ob="Confirmar exclusão",Lb={content:"Tem certeza de que deseja excluir este fragmento HTML?"},Cb={variantLabel:"Tamanho {{ n }}",sizes:"Tamanhos",imageProperties:"Propriedades da imagem",left:"Esquerda",right:"Direita",center:"Centro",alignment:"Alinhamento",options:"Opções",enableZoom:"Ativar zoom",link:"Link",mediaProperties:"Propriedades da mídia",caption:"Legenda",pixelRatio:"Proporção de pixels"},Rb={obfuscator:"Ofuscador",content:"Conteúdo:",asALink:"Como link",doNotObfuscate:"Não ofuscar"},Ib={insertVideo:"Inserir um vídeo",dialog:{title:"Definir um vídeo"}},kb={insertLink:"Inserir um link interno"},Mb={CustomToolbar:yb,image:_b,validate:vb,delete:"Excluir",cancel:Nb,done:Tb,remove:Ab,auto:wb,editorFocusLost:Sb,htmlSnippetLabel:xb,confirmDeletion:Ob,comfirmSnippetDeletionDialog:Lb,makeMediaPropertiesDialog:Cb,openObfuscatorDialog:Rb,videoPlugin:Ib,internalLinkPlugin:kb},Ga={en:Am,fr:nb,es:Um,de:lm,it:Eb,pt:Mb};function bn(n){const e=Xi(()=>{const r=n()in Ga?n():"en";return zp(Ga[r])});return{t:Gp(e,jp)}}function Db(n,{label:e,url:t}){let r=e??t;const i=n.getSelection();i&&i.length!==0&&(r=n.getText(i.index,i.length),n.deleteText(i.index,i.length)),n.insertText(ki(n)??0,r,"link",t)}function al({editor:n,values:e,service:t,index:r,language:i}){const{t:s}=bn(i),a=r??ki(n);if(a===void 0){t.showToast(s("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",n)}function cl({values:n,editor:e,index:t}){e.insertEmbed(t,"platform-video",n);const[r]=e.getLeaf(t+1);if(!r)throw new Error("missing last inserted element");return r.domNode}function Bb(n){const{mediaId:e}=n.dataset;if(e)return e;const t=n.getAttribute("src");if(!t)return;const{pathname:r}=new URL(t),i=r.split("/"),a=i[i.length-1].match(/^([0-9a-f-]{36})-([0-9]+x[0-9]+)\.([0-9a-z]+$)/);if(!a)return;const[,l]=a;return l}function $b(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 qb(n){if(n==="center")return"center";if(n==="left")return"left";if(n==="right")return"right"}const Pb=A.import("blots/block/embed"),Va=["alt"];function Ub(n){return class extends Pb{static blotName="media";static tagName="figure";static create(t){const r=super.create(t);return Fb(n,r,t),r}static formats(t){return Va.reduce((r,i)=>(t.hasAttribute(i)&&(r[i]=t.getAttribute(i)),r),{})}static match(t){return/\.(jpe?g|gif|png|webp)$/.test(t)||/^data:image\/.+;base64/.test(t)}static value(t){const{mediaId:r,resize:i}=t.dataset;if(!r)throw new Error('missing "media-id" attribute');const s=i&&eo(i)?i:void 0;if(!s)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:s,align:a,zoomable:l,href:c}}format(t,r){Va.indexOf(t)>-1?r?this.domNode.setAttribute(t,r):this.domNode.removeAttribute(t):super.format(t,r)}}}function Fb(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 s=qb(t.align);s&&e.classList.add(s)}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 i=ps({center:!0});e.appendChild(i),Hb(n,e,r,i,t)}async function Hb(n,e,t,r,i){try{const s=await n.useAdminUiImage(i.mediaId,{resizeRule:i.resizeRule});if(!s)throw new Error(`Media ${i.mediaId} not found`);const{source:a,variant:l}=s;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)}zb(e,a,i),e.removeChild(r),e.appendChild(t),e.setAttribute("data-source",JSON.stringify(a))}catch(s){n.logger.error("Error setting up media:",s),e.contains(r)&&e.removeChild(r)}}function zb(n,e,t){const r=document.createElement("div");if(r.classList.add("MediaBlot-flags"),e.pixelRatio!==void 0){const i=document.createElement("span");i.classList.add("MediaBlot-flag","Fig-flag--pixelRatio"),i.textContent=`${e.pixelRatio}×`,r.appendChild(i)}if(t.zoomable){const i=document.createElement("span");i.classList.add("MediaBlot-flag"),i.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(i)}if(t.href){const i=document.createElement("span");i.classList.add("MediaBlot-flag"),i.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(i)}n.appendChild(r)}function dl(n){return jb(n)||qs(n)}function qs(n){return!!n.match(/^[a-zA-Z0-9. _-]+@[a-zA-Z0-9. -]+\.[a-zA-Z]{2,4}$/g)}function jb(n){return!!n.match(/^(\+|00)[1-9][0-9 \-().]{7,32}$/)}function Kb(n){return dl(n)?qs(n)?"mailto":"tel":"raw"}function hl(n){if(n==="raw")return"raw";if(n==="mailto")return"mailto";if(n==="tel")return"tel";throw new Error(`invalid link-type '${n}'`)}const Gb=A.import("blots/inline");function Vb(){return class extends Gb{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 hl(t)}}}const Zb=A.import("blots/block/embed");function Wb(n){return class extends Zb{static blotName="platform-video";static tagName="DIV";static className="PlatformVideo";static create(t){const r=super.create(t),i=n?.getThumbnailUrl(t);return r.style.backgroundImage=`url(${i})`,r.classList.add("PlatformVideo"),r.innerHTML='<span class="pi pi-youtube PlatformVideo-playButton"></span>',t.videoId&&r.setAttribute("data-video-id",t.videoId),t.platform&&r.setAttribute("data-platform",t.platform),r.querySelector("span")?.addEventListener("click",()=>{r.dispatchEvent(new CustomEvent("click",{bubbles:!0}))}),r}static value(t){const{videoId:r,platform:i}=t.dataset;if(r)return{videoId:r,platform:i??"youtube"}}}}function Yb({service:n,videoPluginHook:e,internalLinkPluginHook:t}){A.register("formats/media",Ub(n),!0),A.register("formats/html-snippet",Pp(),!0),A.register("formats/obfuscate",Vb(),!0),A.register("formats/platform-video",Wb(e),!0),A.register("formats/internal-link",Fp(n,t),!0),A.register("modules/imageDropAndPaste",Ii,!0)}var Qb=be('<textarea autofocus class="QpInput QpHtmlSnippetInput"rows=8 cols=80>'),fl=be('<button class="QpBtn secondary"type=button>'),Xb=be("<button class=QpBtn type=button>"),Jb=be('<button class="QpBtn danger outlined"type=button>'),e1=be("<p>"),t1=be('<button class="QpBtn danger"type=button>');async function gl({service:n,language:e,mode:t,html:r}){const{t:i}=bn(e),[s,a]=ft(r??""),l=()=>{c.close({action:"remove"})},c=n.createModalDialog({content:(()=>{var u=Qb();return u.addEventListener("change",f=>a(f.target.value)),ln(()=>u.value=s()),u})(),footer:[t==="update"&&(()=>{var u=Jb();return u.$$click=()=>{n1({deleteSnippet:l,language:e,service:n})},de(u,()=>i("delete")),u})(),(()=>{var u=fl();return u.$$click=()=>c.close(),de(u,()=>i("cancel")),u})(),(()=>{var u=Xb();return u.$$click=()=>c.close({action:t,values:{html:s()}}),de(u,()=>i("validate")),u})()],header:i("htmlSnippetLabel")});return await c.open()}function n1({deleteSnippet:n,language:e,service:t}){const{t:r}=bn(e),i=t.createModalDialog({header:r("confirmDeletion"),content:(()=>{var s=e1();return de(s,()=>r("comfirmSnippetDeletionDialog.content")),s})(),footer:[(()=>{var s=fl();return s.$$click=()=>{i.hide()},de(s,()=>r("cancel")),s})(),(()=>{var s=t1();return s.$$click=()=>{i.hide(),n()},de(s,()=>r("validate")),s})()]});i.show()}Ti(["click"]);async function pl({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 r1=be('<button class="QpBtn outlined danger"type=button>'),i1=be("<button class=QpBtn type=button>"),ui=be("<h2 class=FieldLabel>"),Za=be("<div class=QpOption>"),s1=be("<input class=QpOption-input type=text>"),a1=be("<label><input type=checkbox name=enableZoom>"),o1=be("<div><div class=QpOption><label class><input type=checkbox name=enableLinkOnImage></label></div><div class=QpOption>"),l1=be("<div class=QpBox><dl class=QpProp><dt>:</dt><dd></dd></dl><dl class=QpProp><dt>:</dt><dd>"),c1=be("<button type=button> <small class=ml-1>(<!>)"),u1=be("<button type=button>");async function d1({service:n,language:e,fetchedOutput:t,initialValues:r}){const{mediaId:i}=r,{themeConf:s}=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();Us(()=>{n.useAdminUiImage(i,{resizeRule:l()}).then(P=>{t.source=P?.source,S(P)}).catch(P=>{n.logger.error("Error fetching media:",P)})});const k=Xi(()=>s.fTextImageResizeRules.map((P,ie)=>({resizeRule:P,label:a("makeMediaPropertiesDialog.variantLabel",{n:ie+1})})),[s,e()]),F=Xi(()=>[{align:"left",label:a("makeMediaPropertiesDialog.left")},{align:"center",label:a("makeMediaPropertiesDialog.center")},{align:"right",label:a("makeMediaPropertiesDialog.right")}],[e()]),B=async()=>{ce.close({action:"update",values:{mediaId:i,align:u(),resizeRule:l(),zoomable:g(),href:p()&&_().trim()||void 0}})};Us(()=>{p()&&h(!1)});const V=[(()=>{var P=r1();return P.$$click=()=>{ce.close({action:"remove"})},de(P,()=>a("remove")),P})(),(()=>{var P=i1();return P.$$click=B,P.disabled=!i||u===void 0||l===void 0,de(P,()=>a("validate")),P})()],ce=n.createModalDialog({header:a("makeMediaPropertiesDialog.imageProperties"),content:[(()=>{var P=ui();return de(P,()=>a("makeMediaPropertiesDialog.sizes")),P})(),(()=>{var P=Za();return de(P,Dt(Fs,{get each(){return k()},children:ie=>(()=>{var se=c1(),m=se.firstChild,L=m.nextSibling,v=L.firstChild,C=v.nextSibling;return C.nextSibling,se.$$click=()=>c(ie.resizeRule),se.disabled=!i,de(se,()=>ie.label,m),de(L,()=>ie.resizeRule.replace("x","×"),C),ln(()=>pi(se,`QpBtn secondary ${ie.resizeRule!==l()?"outlined":""}`)),se})()})),P})(),(()=>{var P=ui();return de(P,()=>a("makeMediaPropertiesDialog.alignment")),P})(),(()=>{var P=Za();return de(P,Dt(Fs,{get each(){return F()},children:ie=>(()=>{var se=u1();return se.$$click=()=>f(ie.align),se.disabled=!i,de(se,()=>ie.label),ln(()=>pi(se,`QpBtn secondary ${ie.align!==u()?"outlined":""}`)),se})()})),P})(),(()=>{var P=ui();return de(P,()=>a("makeMediaPropertiesDialog.options")),P})(),(()=>{var P=o1(),ie=P.firstChild,se=ie.firstChild,m=se.firstChild,L=ie.nextSibling;return m.addEventListener("change",()=>{y(!p())}),de(se,()=>a("makeMediaPropertiesDialog.link"),null),de(se,Dt(Hs,{get when(){return p()},get children(){var v=s1();return v.addEventListener("change",C=>{N(C.currentTarget.value)}),ln(()=>v.value=_()),v}}),null),de(L,Dt(Hs,{get when(){return!p()},get children(){var v=a1(),C=v.firstChild;return C.addEventListener("change",()=>{h(!g())}),de(v,()=>a("makeMediaPropertiesDialog.enableZoom"),null),ln(()=>C.checked=g()),v}})),ln(()=>m.checked=p()),P})(),(()=>{var P=ui();return de(P,()=>a("makeMediaPropertiesDialog.mediaProperties")),P})(),(()=>{var P=l1(),ie=P.firstChild,se=ie.firstChild,m=se.firstChild,L=se.nextSibling,v=ie.nextSibling,C=v.firstChild,R=C.firstChild,O=C.nextSibling;return de(se,()=>a("makeMediaPropertiesDialog.caption"),m),de(L,(()=>{var D=Bi(()=>!!T());return()=>D()?T()?.source.attachedData?.[e()]?.caption??"-":Dt(ps,{})})()),de(C,()=>a("makeMediaPropertiesDialog.pixelRatio"),R),de(O,(()=>{var D=Bi(()=>!!T());return()=>D()?Bi(()=>!!T()?.source.pixelRatio)()?`${T()?.source.pixelRatio}×`:a("auto"):Dt(ps,{})})()),P})()],footer:V});return await ce.open()}Ti(["click"]);var h1=be("<label class=ObfuscatorDialog-label><input type=text class=ml-2>"),f1=be('<label class="ObfuscatorDialog-label mt-4"><input type=checkbox name=asALink class=mr-2>'),g1=be('<button class="QpBtn danger outlined"type=button>'),p1=be("<button class=QpBtn type=button>");async function m1({service:n,language:e,value:t}){const{t:r}=bn(e),[i,s]=ft(t.asALink),[a,l]=ft(t.content),c=f=>{l(f),dl(f)?s(!0):s(!1)},u=n.createModalDialog({header:r("openObfuscatorDialog.obfuscator"),content:[(()=>{var f=h1(),g=f.firstChild;return de(f,()=>r("openObfuscatorDialog.content"),g),g.$$input=h=>c(h.currentTarget.value),ln(()=>g.value=a()),f})(),(()=>{var f=f1(),g=f.firstChild;return g.addEventListener("change",()=>s(!i())),de(f,()=>r("openObfuscatorDialog.asALink"),null),ln(()=>g.checked=i()),f})()],footer:[(()=>{var f=g1();return f.$$click=()=>u.close({action:"remove"}),de(f,()=>r("openObfuscatorDialog.doNotObfuscate")),f})(),(()=>{var f=p1();return f.$$click=()=>u.close({action:"update",content:a(),asALink:i()?qs(a())?"mailto":"tel":"raw"}),de(f,()=>r("done")),f})()]});return await u.open()}Ti(["input","click"]);var b1=be('<button class="QpBtn outlined danger"type=button>'),E1=be('<button class="QpBtn secondary"type=button>'),y1=be("<button class=QpBtn type=button>");async function ml({service:n,language:e,mode:t,value:r,videoPluginHook:i}){if(!i)return;const{t:s}=bn(e),[a,l]=ft(r),{dispose:c,element:u}=i.createComponent(r??{videoId:"",platform:"youtube"},{onChange(g){l(g)},getLanguage:e}),f=n.createModalDialog({content:u,footer:[(()=>{var g=b1();return g.$$click=()=>{f.close({action:"remove"}),c()},de(g,()=>s("remove")),g})(),(()=>{var g=E1();return g.$$click=()=>{f.close(),c()},de(g,()=>s("cancel")),g})(),(()=>{var g=y1();return g.$$click=()=>{const h=a();h===null?f.close({action:"remove"}):f.close({action:t,value:h}),c()},de(g,()=>s("validate")),g})()],header:s("videoPlugin.dialog.title")});return await f.open()}Ti(["click"]);async function _1({editor:n,htmlSnippetBtn:e,service:t,language:r}){const i=e.dataset.html,s=await gl({service:t,html:i,mode:"update",language:r});s&&Zr({editor:n,element:e,data:s,insertElementHandler:ol,service:t,language:r})}async function v1({editor:n,internalLinkElement:e,language:t,internalLinkPluginHook:r}){const i=e.dataset.documentId,s=await pl({language:t,value:i,internalLinkPluginHook:r});if(!s)return;const a=A.find(e);if(!a||a instanceof A)throw new Error("missing link blot");if(s.action==="update"){if(!s.value)return;const l=n.getIndex(a);a.deleteAt(0,a.length()),ll({values:s.value,editor:n,index:l})}else s.action==="remove"&&a.deleteAt(0,a.length())}async function N1({editor:n,videoElement:e,language:t,service:r,videoPluginHook:i}){const s=e.dataset.videoId,a=e.dataset.platform??"youtube",l=await ml({service:r,language:t,mode:"update",value:s?{videoId:s,platform:a}:void 0,videoPluginHook:i});l&&Zr({editor:n,element:e,data:{action:l.action,values:l.value},insertElementHandler:cl,service:r,language:t})}async function bl({obfuscatorSpan:n,service:e,language:t,editor:r}){const i=n.innerText,s=n.dataset.asALink?hl(n.dataset.asALink):void 0,a=await m1({service:e,language:t,value:{content:i,asALink:s?s!=="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,i)),a.action==="update"&&(l.remove(),r.insertText(c,a.content??"",{obfuscate:a.asALink??"raw"}))}async function T1({service:n,language:e,element:t,editor:r}){const i=Bb(t),{align:s,resizeRule:a}=$b(t);if(!i||!a)return;const l={source:void 0},c={mediaId:i,resizeRule:a,align:s,zoomable:t.dataset.zoomable==="1",href:t.dataset.href};let u=await d1({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 A1({quillEditor:n,service:e,language:t,videoPluginHook:r,internalLinkPluginHook:i}){const{themeConf:s}=e;return{insertHtmlSnippetHandler:async()=>{if(!n)return;const g=ms(n);await S1({service:e,editorContent:g,quillEditor:n,language:t})},insertMedia:async g=>{if(!n)return;if(g.kind==="file"){Db(n,{label:g.originalName,url:g.url});return}const h=s.fTextImageResizeRules[0];al({service:e,editor:n,values:{mediaId:g.mediaId,resizeRule:h,align:"center",zoomable:!0},language:t})},insertObfuscateBlotHandler:async()=>{if(n)try{const g=n.getSelection();if(!g||g.length===0)return;await w1({service:e,userSelection:g,quillEditor:n,language:t})}catch(g){e.logger.error("Failed to insert obfuscate:",g)}},insertVideoHandler:async()=>{if(!n)return;const g=ms(n);await El({editorContent:g,quillEditor:n,service:e,language:t,videoPluginHook:r})},insertInternalLinkHandler:async()=>{if(!n)return;const g=ki(n);g!==void 0&&await x1({quillEditor:n,language:t,internalLinkPluginHook:i,index:g})}}}async function w1({service:n,userSelection:e,quillEditor:t,language:r}){const i=t.getText(e.index,e.length),s=Kb(i);t.formatText(e,"obfuscate",s);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===i){await bl({obfuscatorSpan:l,service:n,language:r,editor:t});break}}async function S1({service:n,editorContent:e,quillEditor:t,language:r}){const i=await gl({service:n,language:r,mode:"insert"});i&&Zr({editor:t,element:e,data:i,insertElementHandler:ol,service:n,language:r})}async function El({service:n,editorContent:e,quillEditor:t,language:r,videoPluginHook:i,value:s}){const a=await ml({service:n,language:r,mode:s?"update":"insert",value:s,videoPluginHook:i});!a||a.action==="remove"||Zr({editor:t,element:e,data:{action:a.action,values:a.value},insertElementHandler:cl,service:n,language:r})}async function x1({quillEditor:n,language:e,internalLinkPluginHook:t,value:r,index:i}){const s=await pl({language:e,value:r,internalLinkPluginHook:t});!s||s.action==="remove"||!s.value||ll({editor:n,values:s.value,index:i})}function Zr({service:n,editor:e,element:t,data:{values:r,action:i,updateOptions:s},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(i==="insert"){if(!r)return;a({editor:e,values:r,service:n,index:u,language:l})}else if(i==="update"){if(!r)return;a({editor:e,values:r,service:n,index:u,language:l}),f.retain(u+1),f.delete(s?.textToReplaceLength??1)}else i==="remove"&&(f.retain(u),f.delete(1));e.updateContents(f)}}function O1(){const n={videoPlugin:void 0,internalLinkPlugin:void 0};return{get videoPlugin(){return n.videoPlugin},get internalLinkPlugin(){return n.internalLinkPlugin},service:{registerVideoPlugin(e){if(n.videoPlugin)throw new Error("Video plugin already registered");n.videoPlugin=e},registerInternalLinkPlugin(e){if(n.internalLinkPlugin)throw new Error("Internal link plugin already registered");n.internalLinkPlugin=e}}}}var Qi,Wa;function L1(){if(Wa)return Qi;Wa=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 i="</span>",s=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(!s(x))return;const q=a(x.scope,{prefix:this.classPrefix});this.span(q)}closeNode(x){s(x)&&(this.buffer+=i)}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 V=/\b\B/,ce="[a-zA-Z]\\w*",P="[a-zA-Z_]\\w*",ie="\\b\\d+(\\.\\d+)?",se="(-?)(\\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:ie,relevance:0},ae={scope:"number",begin:se,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:ce,relevance:0},Oe={scope:"title",begin:P,relevance:0},ue={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:se,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:ce,MATCH_NOTHING_RE:V,METHOD_GUARD:ue,NUMBER_MODE:J,NUMBER_RE:ie,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,it=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 G=I.className+" ";G+=I.parentNode?I.parentNode.className:"";const he=K.languageDetectRe.exec(G);if(he){const we=ke(he[1]);return we||(Ft(Le.replace("{}",he[1])),Ft("Falling back to no-highlight mode for this block.",I)),we?he[1]:"no-highlight"}return G.split(/\s+/).find(we=>re(we)||ke(we))}function Re(I,G,he){let we="",Me="";typeof G=="object"?(we=I,he=G.ignoreIllegals,Me=G.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=G),he===void 0&&(he=!0);const Je={code:we,language:Me};_t("before:highlight",Je);const ut=Je.result?Je.result:yt(Je.language,Je.code,he);return ut.code=Je.code,_t("after:highlight",ut),ut}function yt(I,G,he,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=st.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=st.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=st.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(st.classNameAliases[U.scope]||U.scope),U.beginScope&&(U.beginScope._wrap?(We(ge,st.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=G.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!==st;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+=G.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"&&!he){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 st=ke(I);if(!st)throw Ke(Le.replace("{}",I)),new Error('Unknown language: "'+I+'"');const jt=hr(st);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(st.__emitTokens)st.__emitTokens(G,Pe);else{for(te.matcher.considerAll();;){xn++,On?On=!1:te.matcher.considerAll(),te.matcher.lastIndex=vt;const U=te.matcher.exec(G);if(!U)break;const H=G.substring(vt,U.index),oe=Yn(H,U);vt=U.index+oe}Yn(G.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(G),illegal:!0,relevance:0,_illegalBy:{message:U.message,index:vt,context:G.slice(vt-100,vt+100),mode:U.mode,resultSoFar:et},_emitter:Pe};if(Ae)return{language:I,value:Et(G),illegal:!1,relevance:0,errorRaised:U,_emitter:Pe,_top:te};throw U}}function qe(I){const G={value:Et(I),illegal:!1,relevance:0,_top:j,_emitter:new K.__emitter(K)};return G._emitter.addText(I),G}function Tn(I,G){G=G||K.languages||Object.keys(x);const he=qe(I),we=G.filter(ke).filter(Zn).map(Ue=>yt(Ue,I,!1));we.unshift(he);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,G,he){const we=G&&q[G]||he;I.classList.add("hljs"),I.classList.add(`language-${we}`)}function An(I){let G=null;const he=$e(I);if(re(he))return;if(_t("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&&(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);G=I;const we=G.textContent,Me=he?Re(we,{language:he,ignoreIllegals:!0}):Tn(we);I.innerHTML=Me.value,I.dataset.highlighted="yes",fr(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}),_t("after:highlightElement",{el:I,result:Me,text:we})}function gr(I){K=it(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,G){let he=null;try{he=G(b)}catch(we){if(Ke("Language definition for '{}' could not be registered.".replace("{}",I)),Ae)Ke(we);else throw we;he=j}he.name||(he.name=I),x[I]=he,he.rawDefinition=G.bind(null,b),he.aliases&&Vn(he.aliases,{languageName:I})}function br(I){delete x[I];for(const G of Object.keys(q))q[G]===I&&delete q[G]}function Er(){return Object.keys(x)}function ke(I){return I=(I||"").toLowerCase(),x[I]||x[q[I]]}function Vn(I,{languageName:G}){typeof I=="string"&&(I=[I]),I.forEach(he=>{q[he.toLowerCase()]=G})}function Zn(I){const G=ke(I);return G&&!G.disableAutodetect}function yr(I){I["before:highlightBlock"]&&!I["before:highlightElement"]&&(I["before:highlightElement"]=G=>{I["before:highlightBlock"](Object.assign({block:G.el},G))}),I["after:highlightBlock"]&&!I["after:highlightElement"]&&(I["after:highlightElement"]=G=>{I["after:highlightBlock"](Object.assign({block:G.el},G))})}function _r(I){yr(I),ne.push(I)}function vr(I){const G=ne.indexOf(I);G!==-1&&ne.splice(G,1)}function _t(I,G){const he=I;ne.forEach(function(we){we[he]&&we[he](G)})}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:it,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({}),Qi=ct,ct.HighlightJS=ct,ct.default=ct,Qi}var C1=L1();const ze=Ss(C1);function R1(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 i={className:"subst",begin:/\$\(/,end:/\)/,contains:[n.BACKSLASH_ESCAPE]},s=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,i]};i.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,s,a,T,l,c,u,f,t]}}function I1(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="("+r+"|"+e.optional(i)+"[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(i)+n.IDENT_RE,relevance:0},p=e.optional(i)+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 k1(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+e.optional(i)+"[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(i)+n.IDENT_RE,relevance:0},p=e.optional(i)+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*\(/))},V=[B,g,l,t,n.C_BLOCK_COMMENT_MODE,f,u],ce={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:F,contains:V.concat([{begin:/\(/,end:/\)/,keywords:F,contains:V.concat(["self"]),relevance:0}]),relevance:0},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(ce,P,B,V,[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 M1(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"],i=["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"],s=["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:i.concat(s),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 D1=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_-]*/}}),B1=["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"],$1=["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"],q1=[...B1,...$1],P1=["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(),U1=["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(),F1=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),H1=["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 z1(n){const e=n.regex,t=D1(n),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",s=/@-?\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:":("+U1.join("|")+")"},{begin:":(:)?("+F1.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+H1.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:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:P1.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+q1.join("|")+")\\b"}]}}var nr="[0-9](_*[0-9])*",di=`\\.(${nr})`,hi="[0-9a-fA-F](_*[0-9a-fA-F])*",Ya={className:"number",variants:[{begin:`(\\b(${nr})((${di})|\\.)?|(${di}))[eE][+-]?(${nr})[fFdD]?\\b`},{begin:`\\b(${nr})((${di})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${di})[fFdD]?\\b`},{begin:`\\b(${nr})[fFdD]\\b`},{begin:`\\b0[xX]((${hi})\\.?|(${hi})?\\.(${hi}))[pP][+-]?(${nr})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${hi})[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 j1(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,Ya,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},Ya,u]}}const Qa="[A-Za-z$_][0-9A-Za-z$_]*",K1=["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"],G1=["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"],V1=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Z1=[].concat(Nl,_l,vl);function W1(n){const e=n.regex,t=(M,{after:z})=>{const $="</"+M[0].slice(1);return M.input.indexOf($,z)!==-1},r=Qa,i={begin:"<>",end:"</>"},s=/<[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:Qa,keyword:K1,literal:G1,built_in:Z1,"variable.language":V1},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)}]),V={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B},ce={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]}},ie={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},se={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[V],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:/\(\)/},V]},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:[V]};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}),ie,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:i.begin,end:i.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},se,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[V,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},C,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[V]},v,m,ce,R,{match:/\$[(.]/}]}}function Y1(n){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},t={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[e,t,n.QUOTE_STRING_MODE,i,n.C_NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Q1(n){const e=n.regex,t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={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}]},s={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,s,u,f,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,r,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function X1(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),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,t),s=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+$/,"")),V={variants:[{match:[/new/,e.concat(p,"+"),e.concat("(?!",B(S).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},ce=e.concat(r,"\\b(?!\\()"),P={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),ce],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),ce],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},ie={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},se={relevance:0,begin:/\(/,end:/\)/,keywords:F,contains:[ie,a,P,n.C_BLOCK_COMMENT_MODE,y,_,V]},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:[se]};se.contains.push(m);const L=[ie,P,n.C_BLOCK_COMMENT_MODE,y,_,V],v={begin:e.concat(/#\[\s*\\?/,e.either(i,s)),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:i},{match:s}]}]};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"}},V,{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 J1(n){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function e0(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 t0(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]+/),i=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}]},V=[g,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:a},{relevance:0,match:[i,/\.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=V,_.contains=V;const se=[{begin:/^\s*=>/,starts:{end:"$",contains:V}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:V}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[n.SHEBANG({binary:"ruby"})].concat(se).concat(u).concat(V)}}function n0(n){const e=n.regex,t=/(r#)?/,r=e.concat(t,n.UNDERSCORE_IDENT_RE),i=e.concat(t,n.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,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:"->"},s]}}function r0(n){const e=n.regex,t=n.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["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(V=>V.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:S(h),relevance:0};function F(B,{exceptions:V,when:ce}={}){const P=ce;return V=V||[],B.map(ie=>ie.match(/\|\d+$/)||V.includes(ie)?ie:P(ie)?`${ie}|0`:ie)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:F(y,{when:B=>B.length<3}),literal:s,type:l,built_in:g},contains:[{scope:"type",match:S(a)},k,T,_,r,i,n.C_NUMBER_MODE,n.C_BLOCK_COMMENT_MODE,t,N]}}const Ni="[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 i0(n){const e=n.regex,t=(M,{after:z})=>{const $="</"+M[0].slice(1);return M.input.indexOf($,z)!==-1},r=Ni,i={begin:"<>",end:"</>"},s=/<[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:Ni,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)}]),V={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B},ce={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]}},ie={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},se={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[V],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:/\(\)/},V]},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:[V]};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}),ie,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:i.begin,end:i.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},se,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[V,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},C,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[V]},v,m,ce,R,{match:/\$[(.]/}]}}function s0(n){const e=n.regex,t=i0(n),r=Ni,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,n.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},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:Ni,keyword:Tl.concat(c),literal:Al,built_in:Ll.concat(i),"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,s,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 a0(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,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=n.inherit(s,{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:[i]},{begin:/'/,end:/'/,contains:[i]},{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:[s,c,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,a,c,l]}]}]},n.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{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 o0(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]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={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,i]},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,_,s,a],T=[...N];return T.pop(),T.push(l),p.contains=T,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:N}}ze.registerLanguage("bash",R1);ze.registerLanguage("c",I1);ze.registerLanguage("cpp",k1);ze.registerLanguage("cs",M1);ze.registerLanguage("css",z1);ze.registerLanguage("java",j1);ze.registerLanguage("javascript",W1);ze.registerLanguage("json",Y1);ze.registerLanguage("markdown",Q1);ze.registerLanguage("plain",J1);ze.registerLanguage("php",X1);ze.registerLanguage("python",e0);ze.registerLanguage("sql",r0);ze.registerLanguage("typescript",s0);ze.registerLanguage("ruby",t0);ze.registerLanguage("rust",n0);ze.registerLanguage("xml",a0);ze.registerLanguage("yaml",o0);const l0=[{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 c0=be("<button type=button><span class=QpTooltip-text>");function fi({children:n,btnClass:e,tooltipText:t,btnText:r}){return(()=>{var i=c0(),s=i.firstChild;return pi(i,`QpTooltip ${e}`),de(i,n,s),de(i,r,s),de(s,t),i})()}var u0=be("<button type=button class=ql-code>"),d0=be('<button type=button class=ql-code-block style="border:1px dotted #999">'),h0=be('<span class="pi pi-hashtag">'),f0=be('<span class="pi pi-pencil">'),g0=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>"),p0=be('<span class="pi pi-youtube">'),m0=be('<span class="pi pi-link">');function b0({language:n,configuration:e,videoPluginHook:t,internalLinkPluginHook:r}){const{t:i}=bn(n),s=[u0(),d0()];return(()=>{var a=g0(),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 de(a,()=>e?.code&&s,_),de(a,Dt(fi,{btnClass:"ql-html-snippet",get tooltipText(){return i("CustomToolbar.insertHtmlSnippetMessage")},get children(){return h0()}}),T),de(a,Dt(fi,{btnClass:"ql-obfuscate",get tooltipText(){return i("CustomToolbar.obfuscate")},get children(){return f0()}}),T),de(a,t&&Dt(fi,{btnClass:"ql-platform-video",get tooltipText(){return i("videoPlugin.insertVideo")},get children(){return p0()}}),T),de(a,r&&Dt(fi,{btnClass:"ql-internal-link",get tooltipText(){return i("internalLinkPlugin.insertLink")},get children(){return m0()}}),T),a})()}var E0=be("<div>"),y0=be("<div class=QuillEditor>");function _0({language:n,setValue:e,value:t,service:r,insertMedia:i,videoPluginHook:s,internalLinkPluginHook:a}){const{t:l}=bn(n),c=r.configuration,f=r.fieldType.adminUi?.editorRows??26,g=b0({language:n,configuration:c,videoPluginHook:s,internalLinkPluginHook:a});let h=!1;const p=(()=>{var T=E0();return Il(T,"height",`calc(${f}rem + 24px)`),T})();async function y(T,S){if(!r.uploadMedia)return;const k=S.toBlob(),F=new File([k],`${l("image")}-${Date.now()}.${T.split("/")[1]}`,{type:T}),B=await r.uploadMedia(F);B&&await i(B)}const _=new A(p,{modules:{toolbar:g,syntax:c.code?{hljs:ze,languages:l0,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 V=B.insert,ce=s?.recognizeUrl(V);if(!ce)return;const P=ms(_);await El({editorContent:P,quillEditor:_,service:r,language:n,videoPluginHook:s,value:ce})}});const F={delta:_.getContents(),html:_.getSemanticHTML()};e(F.delta)});const N=t();return _.setContents(N??new Z),_.history.clear(),h=!0,{element:(()=>{var T=y0();return de(T,g,null),de(T,p,null),T})(),quill:_}}const P0={create:N0,init:v0},Vt=O1();function v0(n){const e=`${n.pluginBaseUrl}/admin-ui-plugin.css`,t=document.createElement("link");t.rel="stylesheet",t.href=e,document.head.appendChild(t),n.registerHook("htmlEditorServiceProvider",()=>Vt.service)}function N0(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[i,s]=ft(t),[a,l]=ft(n.language);Yb({service:n,videoPluginHook:Vt.videoPlugin,internalLinkPluginHook:Vt.internalLinkPlugin});let c;const{element:u,quill:f}=_0({language:a,value:i,setValue:N=>{const T=i();s(N),T0(N,T)||n.setModifiedValue({j:N})},service:n,videoPluginHook:Vt.videoPlugin,internalLinkPluginHook:Vt.internalLinkPlugin,insertMedia:async N=>await(c?.(N))}),g=A1({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("platform-video",g.insertVideoHandler),h.addHandler("internal-link",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 T1({service:n,editor:T,element:S,language:a}),S.tagName==="BUTTON"&&S.classList.contains("HtmlSnippet")&&await _1({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("PlatformVideo")&&await N1({editor:T,videoElement:S,language:a,service:n,videoPluginHook:Vt.videoPlugin}),S.tagName==="SPAN"&&S.classList.contains("InternalLinkPlugin")&&await v1({editor:T,internalLinkElement:S,language:a,internalLinkPluginHook:Vt.internalLinkPlugin})};return{element:u,setValue:N=>s(Xa(N)),setLanguage:l,getValue:()=>({j:i}),dispose:r,insertMedia:N=>c?.(N)}})}function T0(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{P0 as default};
|
|
1
|
+
import{createMemo as Xi,createSignal as ft,createEffect as Us,For as Fs,Show as Hs,createRoot as Cl,onCleanup as Rl}from"https://cdn.jsdelivr.net/npm/solid-js@1.9.10/+esm";import{template as be,className as pi,delegateEvents as Ti,insert as de,effect as ln,createComponent as Dt,memo as Bi,setStyleProperty as Il}from"https://cdn.jsdelivr.net/npm/solid-js@1.9.10/web/+esm";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,kl=typeof self=="object"&&self&&self.Object===Object&&self,qt=to||kl||Function("return this")(),fn=qt.Symbol,no=Object.prototype,Ml=no.hasOwnProperty,Dl=no.toString,Lr=fn?fn.toStringTag:void 0;function Bl(n){var e=Ml.call(n,Lr),t=n[Lr];try{n[Lr]=void 0;var r=!0}catch{}var i=Dl.call(n);return r&&(e?n[Lr]=t:delete n[Lr]),i}var $l=Object.prototype,ql=$l.toString;function Pl(n){return ql.call(n)}var Ul="[object Null]",Fl="[object Undefined]",zs=fn?fn.toStringTag:void 0;function lr(n){return n==null?n===void 0?Fl:Ul:zs&&zs in Object(n)?Bl(n):Pl(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 Hl="[object AsyncFunction]",zl="[object Function]",jl="[object GeneratorFunction]",Kl="[object Proxy]";function bs(n){if(!gn(n))return!1;var e=lr(n);return e==zl||e==jl||e==Hl||e==Kl}var $i=qt["__core-js_shared__"],js=function(){var n=/[^.]+$/.exec($i&&$i.keys&&$i.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function Gl(n){return!!js&&js in n}var Vl=Function.prototype,Zl=Vl.toString;function Dn(n){if(n!=null){try{return Zl.call(n)}catch{}try{return n+""}catch{}}return""}var Wl=/[\\^$.*+?()[\]{}|]/g,Yl=/^\[object .+?Constructor\]$/,Ql=Function.prototype,Xl=Object.prototype,Jl=Ql.toString,ec=Xl.hasOwnProperty,tc=RegExp("^"+Jl.call(ec).replace(Wl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nc(n){if(!gn(n)||Gl(n))return!1;var e=bs(n)?tc:Yl;return e.test(Dn(n))}function rc(n,e){return n?.[e]}function Bn(n,e){var t=rc(n,e);return nc(t)?t:void 0}var Ji=Bn(qt,"WeakMap"),Ks=Object.create,ic=function(){function n(){}return function(e){if(!gn(e))return{};if(Ks)return Ks(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 ac(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var oc=800,lc=16,cc=Date.now;function uc(n){var e=0,t=0;return function(){var r=cc(),i=lc-(r-t);if(t=r,i>0){if(++e>=oc)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function dc(n){return function(){return n}}var mi=function(){try{var n=Bn(Object,"defineProperty");return n({},"",{}),n}catch{}}(),hc=mi?function(n,e){return mi(n,"toString",{configurable:!0,enumerable:!1,value:dc(e),writable:!0})}:ro,fc=uc(hc);function gc(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var pc=9007199254740991,mc=/^(?:0|[1-9]\d*)$/;function io(n,e){var t=typeof n;return e=e??pc,!!e&&(t=="number"||t!="symbol"&&mc.test(n))&&n>-1&&n%1==0&&n<e}function Es(n,e,t){e=="__proto__"&&mi?mi(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 bc=Object.prototype,Ec=bc.hasOwnProperty;function so(n,e,t){var r=n[e];(!(Ec.call(n,e)&&zr(r,t))||t===void 0&&!(e in n))&&Es(n,e,t)}function yc(n,e,t,r){var i=!t;t||(t={});for(var s=-1,a=e.length;++s<a;){var l=e[s],c=void 0;c===void 0&&(c=n[l]),i?Es(t,l,c):so(t,l,c)}return t}var Gs=Math.max;function _c(n,e,t){return e=Gs(e===void 0?n.length-1:e,0),function(){for(var r=arguments,i=-1,s=Gs(r.length-e,0),a=Array(s);++i<s;)a[i]=r[e+i];i=-1;for(var l=Array(e+1);++i<e;)l[i]=r[i];return l[e]=t(a),sc(n,this,l)}}function vc(n,e){return fc(_c(n,e,ro),n+"")}var Nc=9007199254740991;function ao(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Nc}function Ai(n){return n!=null&&ao(n.length)&&!bs(n)}function Tc(n,e,t){if(!gn(t))return!1;var r=typeof e;return(r=="number"?Ai(t)&&io(e,t.length):r=="string"&&e in t)?zr(t[e],n):!1}function Ac(n){return vc(function(e,t){var r=-1,i=t.length,s=i>1?t[i-1]:void 0,a=i>2?t[2]:void 0;for(s=n.length>3&&typeof s=="function"?(i--,s):void 0,a&&Tc(t[0],t[1],a)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var l=t[r];l&&n(e,l,r,s)}return e})}var wc=Object.prototype;function ys(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||wc;return n===t}function Sc(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var xc="[object Arguments]";function Vs(n){return Zt(n)&&lr(n)==xc}var oo=Object.prototype,Oc=oo.hasOwnProperty,Lc=oo.propertyIsEnumerable,es=Vs(function(){return arguments}())?Vs:function(n){return Zt(n)&&Oc.call(n,"callee")&&!Lc.call(n,"callee")};function Cc(){return!1}var lo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Zs=lo&&typeof module=="object"&&module&&!module.nodeType&&module,Rc=Zs&&Zs.exports===lo,Ws=Rc?qt.Buffer:void 0,Ic=Ws?Ws.isBuffer:void 0,Br=Ic||Cc,kc="[object Arguments]",Mc="[object Array]",Dc="[object Boolean]",Bc="[object Date]",$c="[object Error]",qc="[object Function]",Pc="[object Map]",Uc="[object Number]",Fc="[object Object]",Hc="[object RegExp]",zc="[object Set]",jc="[object String]",Kc="[object WeakMap]",Gc="[object ArrayBuffer]",Vc="[object DataView]",Zc="[object Float32Array]",Wc="[object Float64Array]",Yc="[object Int8Array]",Qc="[object Int16Array]",Xc="[object Int32Array]",Jc="[object Uint8Array]",eu="[object Uint8ClampedArray]",tu="[object Uint16Array]",nu="[object Uint32Array]",Ie={};Ie[Zc]=Ie[Wc]=Ie[Yc]=Ie[Qc]=Ie[Xc]=Ie[Jc]=Ie[eu]=Ie[tu]=Ie[nu]=!0;Ie[kc]=Ie[Mc]=Ie[Gc]=Ie[Dc]=Ie[Vc]=Ie[Bc]=Ie[$c]=Ie[qc]=Ie[Pc]=Ie[Uc]=Ie[Fc]=Ie[Hc]=Ie[zc]=Ie[jc]=Ie[Kc]=!1;function ru(n){return Zt(n)&&ao(n.length)&&!!Ie[lr(n)]}function _s(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,iu=Mr&&Mr.exports===co,qi=iu&&to.process,ar=function(){try{var n=Mr&&Mr.require&&Mr.require("util").types;return n||qi&&qi.binding&&qi.binding("util")}catch{}}(),Ys=ar&&ar.isTypedArray,vs=Ys?_s(Ys):ru,su=Object.prototype,au=su.hasOwnProperty;function uo(n,e){var t=Rn(n),r=!t&&es(n),i=!t&&!r&&Br(n),s=!t&&!r&&!i&&vs(n),a=t||r||i||s,l=a?Sc(n.length,String):[],c=l.length;for(var u in n)(e||au.call(n,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||io(u,c)))&&l.push(u);return l}function ho(n,e){return function(t){return n(e(t))}}var ou=ho(Object.keys,Object),lu=Object.prototype,cu=lu.hasOwnProperty;function uu(n){if(!ys(n))return ou(n);var e=[];for(var t in Object(n))cu.call(n,t)&&t!="constructor"&&e.push(t);return e}function du(n){return Ai(n)?uo(n):uu(n)}function hu(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var fu=Object.prototype,gu=fu.hasOwnProperty;function pu(n){if(!gn(n))return hu(n);var e=ys(n),t=[];for(var r in n)r=="constructor"&&(e||!gu.call(n,r))||t.push(r);return t}function fo(n){return Ai(n)?uo(n,!0):pu(n)}var $r=Bn(Object,"create");function mu(){this.__data__=$r?$r(null):{},this.size=0}function bu(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var Eu="__lodash_hash_undefined__",yu=Object.prototype,_u=yu.hasOwnProperty;function vu(n){var e=this.__data__;if($r){var t=e[n];return t===Eu?void 0:t}return _u.call(e,n)?e[n]:void 0}var Nu=Object.prototype,Tu=Nu.hasOwnProperty;function Au(n){var e=this.__data__;return $r?e[n]!==void 0:Tu.call(e,n)}var wu="__lodash_hash_undefined__";function Su(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=$r&&e===void 0?wu:e,this}function 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=mu;In.prototype.delete=bu;In.prototype.get=vu;In.prototype.has=Au;In.prototype.set=Su;function xu(){this.__data__=[],this.size=0}function wi(n,e){for(var t=n.length;t--;)if(zr(n[t][0],e))return t;return-1}var Ou=Array.prototype,Lu=Ou.splice;function Cu(n){var e=this.__data__,t=wi(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():Lu.call(e,t,1),--this.size,!0}function Ru(n){var e=this.__data__,t=wi(e,n);return t<0?void 0:e[t][1]}function Iu(n){return wi(this.__data__,n)>-1}function ku(n,e){var t=this.__data__,r=wi(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=xu;Yt.prototype.delete=Cu;Yt.prototype.get=Ru;Yt.prototype.has=Iu;Yt.prototype.set=ku;var qr=Bn(qt,"Map");function Mu(){this.size=0,this.__data__={hash:new In,map:new(qr||Yt),string:new In}}function Du(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Si(n,e){var t=n.__data__;return Du(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Bu(n){var e=Si(this,n).delete(n);return this.size-=e?1:0,e}function $u(n){return Si(this,n).get(n)}function qu(n){return Si(this,n).has(n)}function Pu(n,e){var t=Si(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function $n(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}$n.prototype.clear=Mu;$n.prototype.delete=Bu;$n.prototype.get=$u;$n.prototype.has=qu;$n.prototype.set=Pu;function Uu(n,e){for(var t=-1,r=e.length,i=n.length;++t<r;)n[i+t]=e[t];return n}var go=ho(Object.getPrototypeOf,Object),Fu="[object Object]",Hu=Function.prototype,zu=Object.prototype,po=Hu.toString,ju=zu.hasOwnProperty,Ku=po.call(Object);function Gu(n){if(!Zt(n)||lr(n)!=Fu)return!1;var e=go(n);if(e===null)return!0;var t=ju.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&po.call(t)==Ku}function Vu(){this.__data__=new Yt,this.size=0}function Zu(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function Wu(n){return this.__data__.get(n)}function Yu(n){return this.__data__.has(n)}var Qu=200;function Xu(n,e){var t=this.__data__;if(t instanceof Yt){var r=t.__data__;if(!qr||r.length<Qu-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new $n(r)}return t.set(n,e),this.size=t.size,this}function Bt(n){var e=this.__data__=new Yt(n);this.size=e.size}Bt.prototype.clear=Vu;Bt.prototype.delete=Zu;Bt.prototype.get=Wu;Bt.prototype.has=Yu;Bt.prototype.set=Xu;var mo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Qs=mo&&typeof module=="object"&&module&&!module.nodeType&&module,Ju=Qs&&Qs.exports===mo,Xs=Ju?qt.Buffer:void 0,Js=Xs?Xs.allocUnsafe:void 0;function bo(n,e){if(e)return n.slice();var t=n.length,r=Js?Js(t):new n.constructor(t);return n.copy(r),r}function ed(n,e){for(var t=-1,r=n==null?0:n.length,i=0,s=[];++t<r;){var a=n[t];e(a,t,n)&&(s[i++]=a)}return s}function td(){return[]}var nd=Object.prototype,rd=nd.propertyIsEnumerable,ea=Object.getOwnPropertySymbols,id=ea?function(n){return n==null?[]:(n=Object(n),ed(ea(n),function(e){return rd.call(n,e)}))}:td;function sd(n,e,t){var r=e(n);return Rn(n)?r:Uu(r,t(n))}function ts(n){return sd(n,du,id)}var ns=Bn(qt,"DataView"),rs=Bn(qt,"Promise"),is=Bn(qt,"Set"),ta="[object Map]",ad="[object Object]",na="[object Promise]",ra="[object Set]",ia="[object WeakMap]",sa="[object DataView]",od=Dn(ns),ld=Dn(qr),cd=Dn(rs),ud=Dn(is),dd=Dn(Ji),Tt=lr;(ns&&Tt(new ns(new ArrayBuffer(1)))!=sa||qr&&Tt(new qr)!=ta||rs&&Tt(rs.resolve())!=na||is&&Tt(new is)!=ra||Ji&&Tt(new Ji)!=ia)&&(Tt=function(n){var e=lr(n),t=e==ad?n.constructor:void 0,r=t?Dn(t):"";if(r)switch(r){case od:return sa;case ld:return ta;case cd:return na;case ud:return ra;case dd:return ia}return e});var hd=Object.prototype,fd=hd.hasOwnProperty;function gd(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&fd.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var bi=qt.Uint8Array;function Ns(n){var e=new n.constructor(n.byteLength);return new bi(e).set(new bi(n)),e}function pd(n,e){var t=Ns(n.buffer);return new n.constructor(t,n.byteOffset,n.byteLength)}var md=/\w*$/;function bd(n){var e=new n.constructor(n.source,md.exec(n));return e.lastIndex=n.lastIndex,e}var aa=fn?fn.prototype:void 0,oa=aa?aa.valueOf:void 0;function Ed(n){return oa?Object(oa.call(n)):{}}function Eo(n,e){var t=e?Ns(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var yd="[object Boolean]",_d="[object Date]",vd="[object Map]",Nd="[object Number]",Td="[object RegExp]",Ad="[object Set]",wd="[object String]",Sd="[object Symbol]",xd="[object ArrayBuffer]",Od="[object DataView]",Ld="[object Float32Array]",Cd="[object Float64Array]",Rd="[object Int8Array]",Id="[object Int16Array]",kd="[object Int32Array]",Md="[object Uint8Array]",Dd="[object Uint8ClampedArray]",Bd="[object Uint16Array]",$d="[object Uint32Array]";function qd(n,e,t){var r=n.constructor;switch(e){case xd:return Ns(n);case yd:case _d:return new r(+n);case Od:return pd(n);case Ld:case Cd:case Rd:case Id:case kd:case Md:case Dd:case Bd:case $d:return Eo(n,t);case vd:return new r;case Nd:case wd:return new r(n);case Td:return bd(n);case Ad:return new r;case Sd:return Ed(n)}}function yo(n){return typeof n.constructor=="function"&&!ys(n)?ic(go(n)):{}}var Pd="[object Map]";function Ud(n){return Zt(n)&&Tt(n)==Pd}var la=ar&&ar.isMap,Fd=la?_s(la):Ud,Hd="[object Set]";function zd(n){return Zt(n)&&Tt(n)==Hd}var ca=ar&&ar.isSet,jd=ca?_s(ca):zd,Kd=1,_o="[object Arguments]",Gd="[object Array]",Vd="[object Boolean]",Zd="[object Date]",Wd="[object Error]",vo="[object Function]",Yd="[object GeneratorFunction]",Qd="[object Map]",Xd="[object Number]",No="[object Object]",Jd="[object RegExp]",eh="[object Set]",th="[object String]",nh="[object Symbol]",rh="[object WeakMap]",ih="[object ArrayBuffer]",sh="[object DataView]",ah="[object Float32Array]",oh="[object Float64Array]",lh="[object Int8Array]",ch="[object Int16Array]",uh="[object Int32Array]",dh="[object Uint8Array]",hh="[object Uint8ClampedArray]",fh="[object Uint16Array]",gh="[object Uint32Array]",Ce={};Ce[_o]=Ce[Gd]=Ce[ih]=Ce[sh]=Ce[Vd]=Ce[Zd]=Ce[ah]=Ce[oh]=Ce[lh]=Ce[ch]=Ce[uh]=Ce[Qd]=Ce[Xd]=Ce[No]=Ce[Jd]=Ce[eh]=Ce[th]=Ce[nh]=Ce[dh]=Ce[hh]=Ce[fh]=Ce[gh]=!0;Ce[Wd]=Ce[vo]=Ce[rh]=!1;function gi(n,e,t,r,i,s){var a,l=e&Kd;if(a!==void 0)return a;if(!gn(n))return n;var c=Rn(n);if(c)a=gd(n);else{var u=Tt(n),f=u==vo||u==Yd;if(Br(n))return bo(n,l);if(u==No||u==_o||f&&!i)a=f?{}:yo(n);else{if(!Ce[u])return i?n:{};a=qd(n,u,l)}}s||(s=new Bt);var g=s.get(n);if(g)return g;s.set(n,a),jd(n)?n.forEach(function(y){a.add(gi(y,e,t,y,n,s))}):Fd(n)&&n.forEach(function(y,_){a.set(_,gi(y,e,t,_,n,s))});var h=ts,p=c?void 0:h(n);return gc(p||n,function(y,_){p&&(_=y,y=n[_]),so(a,_,gi(y,e,t,_,n,s))}),a}var ph=1,mh=4;function rr(n){return gi(n,ph|mh)}var bh="__lodash_hash_undefined__";function Eh(n){return this.__data__.set(n,bh),this}function yh(n){return this.__data__.has(n)}function Ei(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new $n;++e<t;)this.add(n[e])}Ei.prototype.add=Ei.prototype.push=Eh;Ei.prototype.has=yh;function _h(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}function vh(n,e){return n.has(e)}var Nh=1,Th=2;function To(n,e,t,r,i,s){var a=t&Nh,l=n.length,c=e.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(n),f=s.get(e);if(u&&f)return u==e&&f==n;var g=-1,h=!0,p=t&Th?new Ei:void 0;for(s.set(n,e),s.set(e,n);++g<l;){var y=n[g],_=e[g];if(r)var N=a?r(_,y,g,e,n,s):r(y,_,g,n,e,s);if(N!==void 0){if(N)continue;h=!1;break}if(p){if(!_h(e,function(T,S){if(!vh(p,S)&&(y===T||i(y,T,t,r,s)))return p.push(S)})){h=!1;break}}else if(!(y===_||i(y,_,t,r,s))){h=!1;break}}return s.delete(n),s.delete(e),h}function Ah(n){var e=-1,t=Array(n.size);return n.forEach(function(r,i){t[++e]=[i,r]}),t}function wh(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=r}),t}var Sh=1,xh=2,Oh="[object Boolean]",Lh="[object Date]",Ch="[object Error]",Rh="[object Map]",Ih="[object Number]",kh="[object RegExp]",Mh="[object Set]",Dh="[object String]",Bh="[object Symbol]",$h="[object ArrayBuffer]",qh="[object DataView]",ua=fn?fn.prototype:void 0,Pi=ua?ua.valueOf:void 0;function Ph(n,e,t,r,i,s,a){switch(t){case qh:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case $h:return!(n.byteLength!=e.byteLength||!s(new bi(n),new bi(e)));case Oh:case Lh:case Ih:return zr(+n,+e);case Ch:return n.name==e.name&&n.message==e.message;case kh:case Dh:return n==e+"";case Rh:var l=Ah;case Mh:var c=r&Sh;if(l||(l=wh),n.size!=e.size&&!c)return!1;var u=a.get(n);if(u)return u==e;r|=xh,a.set(n,e);var f=To(l(n),l(e),r,i,s,a);return a.delete(n),f;case Bh:if(Pi)return Pi.call(n)==Pi.call(e)}return!1}var Uh=1,Fh=Object.prototype,Hh=Fh.hasOwnProperty;function zh(n,e,t,r,i,s){var a=t&Uh,l=ts(n),c=l.length,u=ts(e),f=u.length;if(c!=f&&!a)return!1;for(var g=c;g--;){var h=l[g];if(!(a?h in e:Hh.call(e,h)))return!1}var p=s.get(n),y=s.get(e);if(p&&y)return p==e&&y==n;var _=!0;s.set(n,e),s.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,s):r(T,S,h,n,e,s);if(!(k===void 0?T===S||i(T,S,t,r,s):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 s.delete(n),s.delete(e),_}var jh=1,da="[object Arguments]",ha="[object Array]",ei="[object Object]",Kh=Object.prototype,fa=Kh.hasOwnProperty;function Gh(n,e,t,r,i,s){var a=Rn(n),l=Rn(e),c=a?ha:Tt(n),u=l?ha:Tt(e);c=c==da?ei:c,u=u==da?ei:u;var f=c==ei,g=u==ei,h=c==u;if(h&&Br(n)){if(!Br(e))return!1;a=!0,f=!1}if(h&&!f)return s||(s=new Bt),a||vs(n)?To(n,e,t,r,i,s):Ph(n,e,c,t,r,i,s);if(!(t&jh)){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 s||(s=new Bt),i(_,N,t,r,s)}}return h?(s||(s=new Bt),zh(n,e,t,r,i,s)):!1}function Ao(n,e,t,r,i){return n===e?!0:n==null||e==null||!Zt(n)&&!Zt(e)?n!==n&&e!==e:Gh(n,e,t,r,Ao,i)}function Vh(n){return function(e,t,r){for(var i=-1,s=Object(e),a=r(e),l=a.length;l--;){var c=a[++i];if(t(s[c],c,s)===!1)break}return e}}var Zh=Vh();function ss(n,e,t){(t!==void 0&&!zr(n[e],t)||t===void 0&&!(e in n))&&Es(n,e,t)}function Wh(n){return Zt(n)&&Ai(n)}function as(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function Yh(n){return yc(n,fo(n))}function Qh(n,e,t,r,i,s,a){var l=as(n,t),c=as(e,t),u=a.get(c);if(u){ss(n,t,u);return}var f=s?s(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&&vs(c);f=c,h||p||y?Rn(l)?f=l:Wh(l)?f=ac(l):p?(g=!1,f=bo(c,!0)):y?(g=!1,f=Eo(c,!0)):f=[]:Gu(c)||es(c)?(f=l,es(l)?f=Yh(l):(!gn(l)||bs(l))&&(f=yo(c))):g=!1}g&&(a.set(c,f),i(f,c,r,s,a),a.delete(c)),ss(n,t,f)}function wo(n,e,t,r,i){n!==e&&Zh(e,function(s,a){if(i||(i=new Bt),gn(s))Qh(n,e,a,t,wo,r,i);else{var l=r?r(as(n,a),s,a+"",n,e,i):void 0;l===void 0&&(l=s),ss(n,a,l)}},fo)}function Ts(n,e){return Ao(n,e)}var dn=Ac(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 i=Y.TYPE&Y.ATTRIBUTE;this.scope=r.scope!=null?r.scope&Y.LEVEL|i: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 ir extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const So=class os{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 i=this.query(t);if(i==null)throw new ir(`Unable to create ${t} blot`);const s=i,a=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:s.create(r),l=new s(e,a,r);return os.blots.set(l.domNode,l),l}find(e,t=!1){return os.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(i=>(r=this.classes[i],!!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,i="attrName"in t;if(!r&&!i)throw new ir("Invalid definition");if(r&&t.blotName==="abstract")throw new ir("Cannot register abstract class");const s=r?t.blotName:i?t.attrName:void 0;return this.types[s]=t,i?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 Xh 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=Xh;function Ui(n){const e=n.split("-"),t=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+t}class Jh extends $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[Ui(this.keyName)]=t,!0):!1}remove(e){e.style[Ui(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[Ui(this.keyName)];return this.canAdd(e,t)?t:""}}const pn=Jh;class ef{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=or.find(this.domNode);if(e==null)return;const t=$t.keys(this.domNode),r=Ot.keys(this.domNode),i=pn.keys(this.domNode);t.concat(r).concat(i).forEach(s=>{const a=e.scroll.query(s,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 xi=ef,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 ir("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,i){const s=this.isolate(e,t);if(this.scroll.query(r,Y.BLOT)!=null&&i)s.wrap(r,i);else if(this.scroll.query(r,Y.ATTRIBUTE)!=null){const a=this.scroll.create(this.statics.scope);s.wrap(a),a.format(r,i)}}insertAt(e,t,r){const i=r==null?this.scroll.create("text",t):this.scroll.create(t,r),s=this.split(e);this.parent.insertBefore(i,s||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 ir(`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 tf=Lo;const Xe=tf;class nf{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let r=t();for(;r&&e>0;)e-=1,r=t();return r}contains(e){const t=this.iterator();let r=t();for(;r;){if(r===e)return!0;r=t()}return!1}indexOf(e){const t=this.iterator();let r=t(),i=0;for(;r;){if(r===e)return i;i+=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 i=r();for(;i;){const s=i.length();if(e<s||t&&e===s&&(i.next==null||i.next.length()!==0))return[i,e];e-=s,i=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[i,s]=this.find(e);let a=e-s;const l=this.iterator(i);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 i=r();for(;i;)t=e(t,i),i=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(i=>{r.domNode.appendChild(i)}),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 nf,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const t=pa(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof ir)return;throw t}})}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,(r,i,s)=>{r.deleteAt(i,s)})}descendant(e,t=0){const[r,i]=this.children.find(t);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,i]:r instanceof on?r.descendant(e,i):[null,-1]}descendants(e,t=0,r=Number.MAX_VALUE){let i=[],s=r;return this.children.forEachAt(t,r,(a,l,c)=>{(e.blotName==null&&e(a)||e.blotName!=null&&a instanceof e)&&i.push(a),a instanceof on&&(i=i.concat(a.descendants(e,l,s))),s-=c}),i}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,i){this.children.forEachAt(e,t,(s,a,l)=>{s.formatAt(a,l,r,i)})}insertAt(e,t,r){const[i,s]=this.children.find(e);if(i)i.insertAt(s,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,i]=this.children.find(e,t),s=[[this,e]];return r instanceof on?s.concat(r.path(i,t)):(r!=null&&s.push([r,i]),s)}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(),(i,s,a)=>{const l=i.split(s,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=[],i=[];e.forEach(s=>{s.target===this.domNode&&s.type==="childList"&&(r.push(...s.addedNodes),i.push(...s.removedNodes))}),i.forEach(s=>{if(s.parentNode!=null&&s.tagName!=="IFRAME"&&document.body.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const a=this.scroll.find(s);a!=null&&(a.domNode.parentNode==null||a.domNode.parentNode===this.domNode)&&a.detach()}),r.filter(s=>s.parentNode===this.domNode&&s!==this.uiNode).sort((s,a)=>s===a?0:s.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(s=>{let a=null;s.nextSibling!=null&&(a=this.scroll.find(s.nextSibling));const l=pa(s,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 rf=Co;const St=rf;function sf(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(n[t]!==e[t])return!1;return!0}const 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 xi(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,i){this.formats()[r]!=null||this.scroll.query(r,Y.ATTRIBUTE)?this.isolate(e,t).format(r,i):super.formatAt(e,t,r,i)}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&&sf(t,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(e,t){const r=super.wrap(e,t);return r instanceof Xn&&this.attributes.move(r),r}};Qn.allowedChildren=[Qn,Xe],Qn.blotName="inline",Qn.scope=Y.INLINE_BLOT,Qn.tagName="SPAN";let af=Qn;const As=af,Jn=class ls extends St{static create(e){return super.create(e)}static formats(e,t){const r=t.query(ls.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 xi(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(ls.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,i){this.scroll.query(r,Y.BLOCK)!=null?this.format(r,i):super.formatAt(e,t,r,i)}insertAt(e,t,r){if(r==null||this.scroll.query(t,Y.INLINE)!=null)super.insertAt(e,t,r);else{const i=this.split(e);if(i!=null){const s=this.scroll.create(t,r);i.parent.insertBefore(s,i)}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=[As,Jn,Xe];let of=Jn;const Pr=of,cs=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,i){super.formatAt(e,t,r,i),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())}};cs.blotName="container",cs.scope=Y.BLOCK_BLOT;let lf=cs;const Oi=lf;class cf extends Xe{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,r,i){e===0&&t===this.length()?this.format(r,i):super.formatAt(e,t,r,i)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const ot=cf,uf={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},df=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,uf),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const r=this.registry.find(e,t);return r?r.scroll===this?r:t?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,t=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,i){this.update(),super.formatAt(e,t,r,i)}insertAt(e,t,r){this.update(),super.insertAt(e,t,r)}optimize(e=[],t={}){super.optimize(t);const r=t.mutationsMap||new WeakMap;let i=Array.from(this.observer.takeRecords());for(;i.length>0;)e.push(i.pop());const s=(c,u=!0)=>{c==null||c===this||c.domNode.parentNode!=null&&(r.has(c.domNode)||r.set(c.domNode,[]),u&&s(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>=df)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach(u=>{const f=this.find(u.target,!0);f!=null&&(f.domNode===u.target&&(u.type==="childList"?(s(this.find(u.previousSibling,!1)),Array.from(u.addedNodes).forEach(g=>{const h=this.find(g,!1);s(h,!1),h instanceof St&&h.children.forEach(p=>{s(p,!1)})})):u.type==="attributes"&&s(f.prev)),s(f))}),this.children.forEach(a),l=Array.from(this.observer.takeRecords()),i=l.slice();i.length>0;)e.push(i.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(i=>{const s=this.find(i.target,!0);return s==null?null:r.has(s.domNode)?(r.get(s.domNode).push(i),null):(r.set(s.domNode,[i]),s)}).forEach(i=>{i!=null&&i!==this&&r.has(i.domNode)&&i.update(r.get(i.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,Oi],er.scope=Y.BLOCK_BLOT,er.tagName="DIV";let hf=er;const ws=hf,us=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}};us.blotName="text",us.scope=Y.INLINE_BLOT;let ff=us;const yi=ff,gf=Object.freeze(Object.defineProperty({__proto__:null,Attributor:$t,AttributorStore:xi,BlockBlot:Pr,ClassAttributor:Ot,ContainerBlot:Oi,EmbedBlot:ot,InlineBlot:As,LeafBlot:Xe,ParentBlot:St,Registry:or,Scope:Y,ScrollBlot:ws,StyleAttributor:pn,TextBlot:yi},Symbol.toStringTag,{value:"Module"}));var cn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ss(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ti={exports:{}},Fi,ma;function pf(){if(ma)return Fi;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=ie(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 $=i(m,L);return M&&$.unshift([t,M]),z&&$.push([t,z]),S($,R),C&&g($),$}function i(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 s(m,L)}function s(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 ue=-Oe+ae;ue<=Oe-fe;ue+=2){var ve=O+ue,pe;ue===-Oe||ue!==Oe&&M[ve-1]<M[ve+1]?pe=M[ve+1]:pe=M[ve-1]+1;for(var ye=pe-ue;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-ue;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)),ue=-1,ve="",pe,ye,Ne,Te;(ue=X.indexOf(Oe,ue+1))!==-1;){var Be=l(fe.substring(xe),X.substring(ue)),je=u(fe.substring(0,xe),X.substring(0,ue));ve.length<je+Be&&(ve=X.substring(ue-je,ue)+X.substring(ue,ue+Be),pe=fe.substring(0,xe-je),ye=fe.substring(xe+Be),Ne=X.substring(0,ue-je),Te=X.substring(ue+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),ue=xe.match(h),ve=Oe.match(h),pe=ue&&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:ue&&!pe&&ye?3:pe||ye?2:ue||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&&V(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 V(m){return k(m.charCodeAt(m.length-1))}function ce(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 V(m)||B(C)?null:ce([[t,m],[n,L],[e,v],[t,C]])}function ie(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 ue=z.slice(X),ve=ae.slice(X);return P(xe,ue,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 ue=$.slice(0,$.length-ye),ve=fe.slice(0,fe.length-ye);return P(z,ue,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 ue=m.slice(X,O-ye),ve=L.slice(X,D-ye);return P(xe,ue,ve,Ne)}return null}function se(m,L,v,C){return r(m,L,v,C,!0)}return se.INSERT=e,se.DELETE=n,se.EQUAL=t,Fi=se,Fi}var Rr={exports:{}};Rr.exports;var ba;function Io(){return ba||(ba=1,function(n,e){var t=200,r="__lodash_hash_undefined__",i=9007199254740991,s="[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]",V="[object DataView]",ce="[object Float32Array]",P="[object Float64Array]",ie="[object Int8Array]",se="[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*)$/,$={};$[s]=$[a]=$[B]=$[V]=$[l]=$[c]=$[ce]=$[P]=$[ie]=$[se]=$[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 ue(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"),it=et(ae,"Promise"),zt=et(ae,"Set"),Nn=et(ae,"WeakMap"),Rt=et(Object,"create"),ct=H(en),b=H(Et),x=H(it),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 G(o,d){return o&&kt(d,Or(d),o)}function he(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==s||Ye&&!Q){if(Be(o))return Q?o:{};if(Ee=ge(Ye?{}:o),!d)return Yn(o,G(Ee,o))}else{if(!$[Se])return Q?o:{};Ee=rn(o,Se,he,d)}}_e||(_e=new ke);var at=_e.get(o);if(at)return at;if(_e.set(o,Ee),!Fe)var He=E?st(o):Or(o);return ve(He||o,function(Qe,Ve){He&&(Ve=Qe,Qe=o[Ve]),Wn(Ee,Ve,he(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,ue,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 st(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):Mi,dt=Je;(en&&dt(new en(new ArrayBuffer(1)))!=V||Et&&dt(new Et)!=h||it&&dt(it.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 V;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 V:return It(o,w);case ce:case P:case ie:case se: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??i,!!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 he(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)==s)}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||Di;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<=i}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 Mi(){return[]}function Di(){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__",i=1,s=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]",V="[object Set]",ce="[object String]",P="[object Symbol]",ie="[object Undefined]",se="[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[V]=X[ce]=X[se]=!1;var xe=typeof cn=="object"&&cn&&cn.Object===Object&&cn,Oe=typeof self=="object"&&self&&self.Object===Object&&self,ue=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=ue["__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?ue.Buffer:void 0,Jt=ue.Symbol,Kn=ue.Uint8Array,en=lt.propertyIsEnumerable,Et=Ft.splice,it=Jt?Jt.toStringTag:void 0,zt=Object.getOwnPropertySymbols,Nn=Xt?Xt.isBuffer:void 0,Rt=_n(Object.keys,Object),ct=te(ue,"DataView"),b=te(ue,"Map"),x=te(ue,"Promise"),q=te(ue,"Set"),ne=te(ue,"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 G(o){var d=this.__data__=new Ge(o);this.size=d.size}function he(){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}G.prototype.clear=he,G.prototype.delete=we,G.prototype.get=Me,G.prototype.has=Je,G.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?ie:T:it&&it 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 G),_e||Qr(o)?kt(o,d,E,w,le,Q):Yn(o,d,Fe,E,w,le,Q);if(!(E&i)){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 G),le(an,Kt,E,w,Q)}}return He?(Q||(Q=new G),st(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&i,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&s?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 ce:return o==d+"";case _:var Ee=Hn;case V:var Fe=w&i;if(Ee||(Ee=Ke),o.size!=d.size&&!Fe)return!1;var Se=_e.get(o);if(Se)return Se==d;w|=s,_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 st(o,d,E,w,le,Q){var _e=E&i,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 Ps=_e?w(Ln,Kt,He,d,o,Q):w(Kt,Ln,He,o,d,Q);if(!(Ps===void 0?Kt===Ln||le(Kt,Ln,E,w,Q):Ps)){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,it),E=o[it];try{o[it]=void 0;var w=!0}catch{}var le=jn.call(o);return w&&(d?o[it]=E:delete o[it]),le}var Pe=zt?function(o){return o==null?[]:(o=Object(o),je(zt(o),function(d){return en.call(o,d)}))}:Mi,ge=It;(ct&&ge(new ct(new ArrayBuffer(1)))!=L||b&&ge(new b)!=_||x&&ge(x.resolve())!=k||q&&ge(new q)!=V||ne&&ge(new ne)!=se)&&(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 V;case $e:return se}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||Di;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 Mi(){return[]}function Di(){return!1}n.exports=Sr}(Ir,Ir.exports)),Ir.exports}var ni={},ya;function mf(){if(ya)return ni;ya=1,Object.defineProperty(ni,"__esModule",{value:!0});const n=Io(),e=ko();var t;return function(r){function i(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=i;function s(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=s;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={})),ni.default=t,ni}var ri={},_a;function Mo(){if(_a)return ri;_a=1,Object.defineProperty(ri,"__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={})),ri.default=n,ri}var ii={},va;function bf(){if(va)return ii;va=1,Object.defineProperty(ii,"__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 i=this.ops[this.index];if(i){const s=this.offset,a=n.default.length(i);if(r>=a-s?(r=a-s,this.index+=1,this.offset=0):this.offset+=r,typeof i.delete=="number")return{delete:r};{const l={};return i.attributes&&(l.attributes=i.attributes),typeof i.retain=="number"?l.retain=r:typeof i.retain=="object"&&i.retain!==null?l.retain=i.retain:typeof i.insert=="string"?l.insert=i.insert.substr(s,r):l.insert=i.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,i=this.index,s=this.next(),a=this.ops.slice(this.index);return this.offset=r,this.index=i,[s].concat(a)}}else return[]}}return ii.default=e,ii}var Na;function Ef(){return Na||(Na=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=pf(),r=Io(),i=ko(),s=mf();e.AttributeMap=s.default;const a=Mo();e.Op=a.default;const l=bf();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(i(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 ce=k.retain==null?"insert":"retain",[P,ie,se]=u(k[ce],F.retain),m=f.getHandler(P);B[ce]={[P]:m.compose(ie,se,ce==="retain")}}const V=s.default.compose(k.attributes,F.attributes,typeof k.retain=="number");if(V&&(B.attributes=V),T.push(B),!y.hasNext()&&i(T.ops[T.ops.length-1],B)){const ce=new f(p.rest());return T.concat(ce).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 V=T.next(B),ce=S.next(B);i(V.insert,ce.insert)?_.retain(B,s.default.diff(V.attributes,ce.attributes)):_.push(ce).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),s.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)},s.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,V=F.retain;let ce=typeof V=="object"&&V!==null?V:S;if(typeof B=="object"&&B!==null&&typeof V=="object"&&V!==null){const P=Object.keys(B)[0];if(P===Object.keys(V)[0]){const ie=f.getHandler(P);ie&&(ce={[P]:ie.transform(B[P],V[P],p)})}}T.retain(ce,s.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=s.default,f.handlers={},e.default=f,n.exports=f,n.exports.default=f}(ti,ti.exports)),ti.exports}var bt=Ef();const Z=Ss(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 yi{};const yf={"&":"&","<":"<",">":">",'"':""","'":"'"};function Li(n){return n.replace(/[&<>"']/g,e=>yf[e])}let mn=class Cn extends As{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),i=Cn.order.indexOf(t);return r>=0||i>=0?r-i:e===t?0:e<t?-1:1}formatAt(e,t,r,i){if(Cn.compare(this.statics.blotName,r)<0&&this.scroll.query(r,Y.BLOT)){const s=this.isolate(e,t);i&&s.wrap(r,i)}else super.formatAt(e,t,r,i)}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,i){t<=0||(this.scroll.query(r,Y.BLOCK)?e+t===this.length()&&this.format(r,i):super.formatAt(e,Math.min(t,this.length()-e-1),r,i),this.cache={})}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r),this.cache={};return}if(t.length===0)return;const i=t.split(`\n`),s=i.shift();s.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),s):this.children.tail.insertAt(this.children.tail.length(),s),this.cache={});let a=this;i.reduce((l,c)=>(a=a.split(l,!0),a.insertAt(0,c),c.length),e+s.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 i=this.clone();return e===0?(this.parent.insertBefore(i,this),this):(this.parent.insertBefore(i,this.next),i)}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 xi(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,i){this.format(r,i)}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r);return}const i=t.split(`\n`),s=i.pop(),a=i.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)}),s&&this.parent.insertBefore(this.scroll.create("text",s),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,i=0;for(;r!=null&&r.statics.scope!==Y.BLOCK_BLOT;)i+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=At.CONTENTS.length,r.optimize(),r.formatAt(i,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,i=this.next instanceof xt?this.next:null,s=i?i.text:"",{textNode:a}=this,l=a.data.split(At.CONTENTS).join("");a.data=At.CONTENTS;let c;if(t)c=t,(l||i)&&(t.insertAt(t.length(),l+s),i&&i.remove());else if(i)c=i,i.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:i&&h===i.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 Hi={exports:{}},Aa;function _f(){return Aa||(Aa=1,function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(t=!1));function i(c,u,f){this.fn=c,this.context=u,this.once=f||!1}function s(c,u,f,g,h){if(typeof f!="function")throw new TypeError("The listener must be a function");var p=new i(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 s(this,u,f,g,!1)},l.prototype.once=function(u,f,g){return s(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}(Hi)),Hi.exports}var vf=_f();const Nf=Ss(vf),ds=new WeakMap,hs=["error","warn","log","info"];let fs="warn";function Bo(n){if(fs&&hs.indexOf(n)<=hs.indexOf(fs)){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 hs.reduce((e,t)=>(e[t]=Bo.bind(console,t,n),e),{})}Qt.level=n=>{fs=n};Bo.level=Qt.level;const zi=Qt("quill:events"),Tf=["selectionchange","mousedown","mouseup","click"];Tf.forEach(n=>{document.addEventListener(n,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach(i=>{const s=ds.get(i);s&&s.emitter&&s.emitter.handleDOM(...t)})})});class W extends Nf{static events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",zi.error)}emit(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return zi.log.call(zi,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];(this.domListeners[e.type]||[]).forEach(s=>{let{node:a,handler:l}=s;(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 ji=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 Af{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new 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,(i,s)=>{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=s.some(l=>l.type==="characterData"||l.type==="childList"||l.type==="attributes"&&l.target===this.root);this.update(a?W.sources.SILENT:i)}catch{}})}),this.emitter.on(W.events.SCROLL_OPTIMIZE,(r,i)=>{if(i.range){const{startNode:s,startOffset:a,endNode:l,endOffset:c}=i.range;this.setNativeRange(s,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 i=this.scroll.find(r.start.node,!1);if(i==null)return;if(i instanceof Xe){const s=i.split(r.start.offset);i.parent.insertBefore(this.cursor,s)}else i.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 i,[s,a]=this.scroll.leaf(e);if(s==null)return null;if(t>0&&a===s.length()){const[f]=this.scroll.leaf(e+1);if(f){const[g]=this.scroll.line(e),[h]=this.scroll.line(e+1);g===h&&(s=f,a=0)}}[i,a]=s.position(a,!0);const l=document.createRange();if(t>0)return l.setStart(i,a),[s,a]=this.scroll.leaf(e+t),s==null?null:([i,a]=s.position(a,!0),l.setEnd(i,a),l.getBoundingClientRect());let c="left",u;if(i instanceof Text){if(!i.data.length)return null;a<i.data.length?(l.setStart(i,a),l.setEnd(i,a+1)):(l.setStart(i,a-1),l.setEnd(i,a),c="right"),u=l.getBoundingClientRect()}else{if(!(s.domNode instanceof Element))return null;u=s.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 ji.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&&Ki(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()}),i=Math.min(Math.max(...r),this.scroll.length()-1),s=Math.min(i,...r);return new kn(s,i-s)}normalizeNative(e){if(!Ki(this.root,e.startContainer)||!e.collapsed&&!Ki(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:i,offset:s}=r;for(;!(i instanceof Text)&&i.childNodes.length>0;)if(i.childNodes.length>s)i=i.childNodes[s],s=0;else if(i.childNodes.length===s)i=i.lastChild,i instanceof Text?s=i.data.length:i.childNodes.length>0?s=i.childNodes.length:s=i.childNodes.length+1;else break;r.node=i,r.offset=s}),t}rangeToNative(e){const t=this.scroll.length(),r=(i,s)=>{i=Math.min(t-1,i);const[a,l]=this.scroll.leaf(i);return a?a.position(l,s):[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,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(ji.info("setNativeRange",e,t,r,i),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||s||e!==l.startContainer||t!==l.startOffset||r!==l.endContainer||i!==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"&&(i=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const c=document.createRange();c.setStart(e,t),c.setEnd(r,i),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),ji.info("setRange",e),e!=null){const i=this.rangeToNative(e);this.setNativeRange(...i,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,i]=this.getRange();if(this.lastRange=r,this.lastNative=i,this.lastRange!=null&&(this.savedRange=this.lastRange),!Ts(t,this.lastRange)){if(!this.composing&&i!=null&&i.native.collapsed&&i.start.node!==this.cursor.textNode){const a=this.cursor.restore();a&&this.setNativeRange(a.startNode,a.startOffset,a.endNode,a.endOffset)}const s=[W.events.SELECTION_CHANGE,rr(this.lastRange),rr(t),e];this.emitter.emit(W.events.EDITOR_CHANGE,...s),e!==W.sources.SILENT&&this.emitter.emit(...s)}}}function Ki(n,e){try{e.parentNode}catch{return!1}return n.contains(e)}const wf=/^[ -~]*$/;class Sf{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const r=wa(e),i=new Z;return Of(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(i.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(i.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,i.retain(h),i.delete(p),a+c+h+p},0),i.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(s=>{this.scroll.lines(e,Math.max(t,1)).forEach(a=>{a.format(s,r[s])})}),this.scroll.optimize();const i=(new Z).retain(e).retain(t,rr(r));return this.update(i)}formatText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(r).forEach(s=>{this.scroll.formatAt(e,t,s,r[s])});const i=(new Z).retain(e).retain(t,rr(r));return this.update(i)}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=[],i=[];t===0?this.scroll.path(e).forEach(l=>{const[c]=l;c instanceof Ze?r.push(c):c instanceof Xe&&i.push(c)}):(r=this.scroll.lines(e,t),i=this.scroll.descendants(Xe,e,t));const[s,a]=[r,i].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=xf(gt(f),u)}return u});return{...s,...a}}getHTML(e,t){const[r,i]=this.scroll.line(e);if(r){const s=r.length();return r.length()>=i+t&&!(i===0&&t===s)?Ur(r,i,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),i=(new Z).retain(e).concat(r);return this.scroll.insertContents(e,r),this.update(i)}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(i=>{this.scroll.formatAt(e,t.length,i,r[i])}),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),[i,s]=this.scroll.line(e+t);let a=0,l=new Z;i!=null&&(a=i.length()-s,l=i.delta().slice(s,s+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 i=this.delta;if(t.length===1&&t[0].type==="characterData"&&t[0].target.data.match(wf)&&this.scroll.find(t[0].target)){const s=this.scroll.find(t[0].target),a=gt(s),l=s.offset(this.scroll),c=t[0].oldValue.replace(At.CONTENTS,""),u=(new Z).insert(c),f=(new Z).insert(s.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=i.compose(e)}else this.delta=this.getDelta(),(!e||!Ts(i.compose(e),this.delta))&&(e=i.diff(this.delta,r));return e}}function tr(n,e,t){if(n.length===0){const[p]=Gi(t.pop());return e<=0?`</li></${p}>`:`</li></${p}>${tr([],e-1,t)}`}const[{child:r,offset:i,length:s,indent:a,type:l},...c]=n,[u,f]=Gi(l);if(a>e)return t.push(l),a===e+1?`<${u}><li${f}>${Ur(r,i,s)}${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,i,s)}${tr(c,a,t)}`;const[h]=Gi(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 Li(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 i=[];if(n.children.forEachAt(e,t,(u,f,g)=>{i.push(Ur(u,f,g))}),r||n.statics.blotName==="list")return i.join("");const{outerHTML:s,innerHTML:a}=n.domNode,[l,c]=s.split(`>${a}<`);return l==="<table"?`<table style="border: 1px solid #000;">${i.join("")}<${c}`:`${l}>${i.join("")}<${c}`}return n.domNode instanceof Element?n.domNode.outerHTML:""}function xf(n,e){return Object.keys(e).reduce((t,r)=>{if(n[r]==null)return t;const i=e[r];return i===n[r]?t[r]=i:Array.isArray(i)?i.indexOf(n[r])<0?t[r]=i.concat([n[r]]):t[r]=i:t[r]=[i,n[r]],t},{})}function Gi(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 Of(n){const e=[];return n.forEach(t=>{typeof t.insert=="string"?t.insert.split(`\n`).forEach((i,s)=>{s&&e.push({insert:`\n`,attributes:t.attributes}),i&&e.push({insert:i,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 si="\ufeff";class xs 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(si),this.rightGuard=document.createTextNode(si),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 i=e.data.split(si).join("");if(e===this.leftGuard)if(this.prev instanceof xt){const s=this.prev.length();this.prev.insertAt(s,i),t={startNode:this.prev.domNode,startOffset:s+i.length}}else r=document.createTextNode(i),this.parent.insertBefore(this.scroll.create(r),this),t={startNode:r,startOffset:i.length};else e===this.rightGuard&&(this.next instanceof xt?(this.next.insertAt(0,i),t={startNode:this.next.domNode,startOffset:i.length}):(r=document.createTextNode(i),this.parent.insertBefore(this.scroll.create(r),this.next),t={startNode:r,startOffset:i.length}));return e.data=si,t}update(e,t){e.forEach(r=>{if(r.type==="characterData"&&(r.target===this.leftGuard||r.target===this.rightGuard)){const i=this.restore(r.target);i&&(t.range=i)}})}}class Lf{isComposing=!1;constructor(e,t){this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",e=>{this.isComposing||this.handleCompositionStart(e)}),this.scroll.domNode.addEventListener("compositionend",e=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(e)})})}handleCompositionStart(e){const t=e.target instanceof Node?this.scroll.find(e.target,!0):null;t&&!(t instanceof xs)&&(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 Cf=n=>n.parentElement||n.getRootNode().host||null,Rf=n=>{const e=n.getBoundingClientRect(),t="offsetWidth"in n&&Math.abs(e.width)/n.offsetWidth||1,r="offsetHeight"in n&&Math.abs(e.height)/n.offsetHeight||1;return{top:e.top,right:e.left+n.clientWidth*t,bottom:e.top+n.clientHeight*r,left:e.left}},ai=n=>{const e=parseInt(n,10);return Number.isNaN(e)?0:e},xa=(n,e,t,r,i,s)=>n<t&&e>r?0:n<t?-(t-n+i):e>r?e-n>r-t?n+i-t:e-r+s:0,If=(n,e)=>{const t=n.ownerDocument;let r=e,i=n;for(;i;){const s=i===t.body,a=s?{top:0,right:window.visualViewport?.width??t.documentElement.clientWidth,bottom:window.visualViewport?.height??t.documentElement.clientHeight,left:0}:Rf(i),l=getComputedStyle(i),c=xa(r.left,r.right,a.left,a.right,ai(l.scrollPaddingLeft),ai(l.scrollPaddingRight)),u=xa(r.top,r.bottom,a.top,a.bottom,ai(l.scrollPaddingTop),ai(l.scrollPaddingBottom));if(c||u)if(s)t.defaultView?.scrollBy(c,u);else{const{scrollLeft:f,scrollTop:g}=i;u&&(i.scrollTop+=u),c&&(i.scrollLeft+=c);const h=i.scrollLeft-f,p=i.scrollTop-g;r={left:r.left-h,top:r.top-p,right:r.right-h,bottom:r.bottom-p}}i=s||l.position==="fixed"?null:Cf(i)}},kf=100,Mf=["block","break","cursor","inline","scroll","text"],Df=(n,e,t)=>{const r=new or;return Mf.forEach(i=>{const s=e.query(i);s&&r.register(s)}),n.forEach(i=>{let s=e.query(i);s||t.error(`Cannot register "${i}" specified in "formats" config. Are you sure it was registered?`);let a=0;for(;s;)if(r.register(s),s="blotName"in s?s.requiredContainer??null:null,a+=1,a>kf){t.error(`Cycle detected in registering blot requiredContainer: "${i}"`);break}}),r},sr=Qt("quill"),oi=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:oi,theme:"default"};static events=W.events;static sources=W.sources;static version="2.0.3";static imports={delta:Z,parchment:gf,"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 ds.get(e)||oi.find(e,t)}static import(e){return this.imports[e]==null&&sr.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(i=>{this.register(i,e[i],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&&sr.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&oi.register(t),typeof t.register=="function"&&t.register(oi)}}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=Bf(e,t),this.container=this.options.container,this.container==null){sr.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="",ds.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new W;const i=ws.blotName,s=this.options.registry.query(i);if(!s||!("blotName"in s))throw new Error(`Cannot initialize Quill without "${i}" blot`);if(this.scroll=new s(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new Sf(this.scroll),this.selection=new Af(this.scroll,this.emitter),this.composition=new Lf(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(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 i=this.getSelection(!0);let s=new Z;if(i==null)return s;if(this.scroll.query(e,Y.BLOCK))s=this.editor.formatLine(i.index,i.length,{[e]:t});else{if(i.length===0)return this.selection.format(e,t),s;s=this.editor.formatText(i.index,i.length,{[e]:t})}return this.setSelection(i,W.sources.SILENT),s},r)}formatLine(e,t,r,i,s){let a;return[e,t,a,s]=Gt(e,t,r,i,s),Nt.call(this,()=>this.editor.formatLine(e,t,a),s,e,0)}formatText(e,t,r,i,s){let a;return[e,t,a,s]=Gt(e,t,r,i,s),Nt.call(this,()=>this.editor.formatText(e,t,a),s,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 i=this.container.getBoundingClientRect();return{bottom:r.bottom-i.top,height:r.height,left:r.left-i.left,right:r.right-i.left,top:r.top-i.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 i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:A.sources.API;return Nt.call(this,()=>this.editor.insertEmbed(e,t,r),i,e)}insertText(e,t,r,i,s){let a;return[e,,a,s]=Gt(e,0,r,i,s),Nt.call(this,()=>this.editor.insertText(e,t,a),s,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){If(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(),i=this.editor.deleteText(0,r),s=this.editor.insertContents(0,e),a=this.editor.deleteText(this.getLength()-1,1);return i.compose(s).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 Vi(n){return Object.entries(n??{}).reduce((e,t)=>{let[r,i]=t;return{...e,[r]:i===!0?{}:i}},{})}function La(n){return Object.fromEntries(Object.entries(n).filter(e=>e[1]!==void 0))}function Bf(n,e){const t=Oa(n);if(!t)throw new Error("Invalid Quill container");const i=!e.theme||e.theme===A.DEFAULTS.theme?cr:A.import(`themes/${e.theme}`);if(!i)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:s,...a}=A.DEFAULTS,{modules:l,...c}=i.DEFAULTS;let u=Vi(e.modules);u!=null&&u.toolbar&&u.toolbar.constructor!==Object&&(u={...u,toolbar:{container:u.toolbar}});const f=dn({},Vi(s),Vi(l),u),g={...a,...La(c),...La(e)};let h=e.registry;return h?e.formats&&sr.warn('Ignoring "formats" option because "registry" is specified'):h=e.formats?Df(e.formats,g.registry,sr):g.registry,{...g,registry:h,container:t,theme:i,modules:Object.entries(f).reduce((p,y)=>{let[_,N]=y;if(!N)return p;const T=A.import(`modules/${_}`);return T==null?(sr.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 i=t==null?null:this.getSelection();const s=this.editor.delta,a=n();if(i!=null&&(t===!0&&(t=i.index),r==null?i=Ca(i,a,e):r!==0&&(i=Ca(i,t,r,e)),this.setSelection(i,W.sources.SILENT)),a.length()>0){const l=[W.events.TEXT_CHANGE,a,s,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,i){let s={};return typeof n.index=="number"&&typeof n.length=="number"?typeof e!="number"?(i=r,r=t,t=e,e=n.length,n=n.index):(e=n.length,n=n.index):typeof e!="number"&&(i=r,r=t,t=e,e=0),typeof t=="object"?(s=t,i=r):typeof t=="string"&&(r!=null?s[t]=r:i=t),i=i||W.sources.API,[n,e,s,i]}function Ca(n,e,t,r){const i=typeof t=="number"?t:0;if(n==null)return null;let s,a;return e&&typeof e.transformPosition=="function"?[s,a]=[n.index,n.index+n.length].map(l=>e.transformPosition(l,r!==W.sources.USER)):[s,a]=[n.index,n.index+n.length].map(l=>l<e||l===e&&r===W.sources.USER?l:i>=0?l+i:Math.max(e,l+i)),new kn(s,a-s)}class qn extends Oi{}function Ra(n){return n instanceof Ze||n instanceof mt}function Ia(n){return typeof n.updateContent=="function"}class $f extends ws{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=Ze;static allowedChildren=[Ze,mt,qn];constructor(e,t,r){let{emitter:i}=r;super(e,t),this.emitter=i,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",s=>this.handleDragStart(s))}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,i]=this.line(e),[s]=this.line(e+t);if(super.deleteAt(e,t),s!=null&&r!==s&&i>0){if(r instanceof mt||s instanceof mt){this.optimize();return}const a=s.children.head instanceof Lt?null:s.children.head;r.moveChildren(s,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,i){super.formatAt(e,t,r,i),this.optimize()}insertAt(e,t,r){if(e>=this.length())if(r==null||this.scroll.query(t,Y.BLOCK)==null){const i=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(i),r==null&&t.endsWith(`\n`)?i.insertAt(0,t.slice(0,-1),r):i.insertAt(0,t,r)}else{const i=this.scroll.create(t,r);this.appendChild(i)}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`))),i=r.pop();if(i==null)return;this.batchStart();const s=r.shift();if(s){const c=s.type==="block"&&(s.delta.length()===0||!this.descendant(mt,e)[0]&&e<this.length()),u=s.type==="block"?s.delta:(new Z).insert({[s.key]:s.value});Zi(this,e,u);const f=s.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,s.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);Zi(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])})}})),i.type==="block"&&i.delta.length()){const c=a?a.offset(a.scroll)+l:this.length();Zi(this,c,i.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,i]=t;return r instanceof Xe?[r,i]:[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=(i,s,a)=>{let l=[],c=a;return i.children.forEachAt(s,a,(u,f,g)=>{Ra(u)?l.push(u):u instanceof Oi&&(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:i}=r;const s=this.find(i,!0);return s&&!Ia(s)}),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[i]=this.descendant(s=>s instanceof mt,e);i&&i.statics.blotName===t&&Ia(i)&&i.updateContent(r)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let r=new Z;return e.forEach(i=>{const s=i?.insert;if(s)if(typeof s=="string"){const a=s.split(`\n`);a.slice(0,-1).forEach(c=>{r.insert(c,i.attributes),t.push({type:"block",delta:r,attributes:i.attributes??{}}),r=new Z});const l=a[a.length-1];l&&r.insert(l,i.attributes)}else{const a=Object.keys(s)[0];if(!a)return;this.query(a,Y.INLINE)?r.push(i):(r.length()&&t.push({type:"block",delta:r,attributes:{}}),r=new Z,t.push({type:"blockEmbed",key:a,value:s[a],attributes:i.attributes??{}}))}}),r.length()&&t.push({type:"block",delta:r,attributes:{}}),t}createBlock(e,t){let r;const i={};Object.entries(e).forEach(l=>{let[c,u]=l;this.query(c,Y.BLOCK&Y.BLOT)!=null?r=c:i[c]=u});const s=this.create(r||this.statics.defaultChild.blotName,r?e[r]:void 0);this.insertBefore(s,t||void 0);const a=s.length();return Object.entries(i).forEach(l=>{let[c,u]=l;s.formatAt(0,a,c,u)}),s}}function Zi(n,e,t){t.reduce((r,i)=>{const s=bt.Op.length(i);let a=i.attributes||{};if(i.insert!=null){if(typeof i.insert=="string"){const l=i.insert;n.insertAt(r,l);const[c]=n.descendant(Xe,r),u=gt(c);a=bt.AttributeMap.diff(u,a)||{}}else if(typeof i.insert=="object"){const l=Object.keys(i.insert)[0];if(l==null)return r;if(n.insertAt(r,l,i.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,s,l,a[l])}),r+s},e)}const Os={scope:Y.BLOCK,whitelist:["right","center","justify"]},qf=new $t("align","align",Os),$o=new Ot("align","ql-align",Os),qo=new pn("align","text-align",Os);class Po extends pn{value(e){let t=super.value(e);return t.startsWith("rgb(")?(t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${t.split(",").map(i=>`00${parseInt(i,10).toString(16)}`.slice(-2)).join("")}`):t}}const Pf=new Ot("color","ql-color",{scope:Y.INLINE}),Ls=new Po("color","color",{scope:Y.INLINE}),Uf=new Ot("background","ql-bg",{scope:Y.INLINE}),Cs=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${Li(this.code(e,t))}\n</pre>`}}class nt extends Ze{static TAB=" ";static register(){A.register(Pn)}}class Rs extends mn{}Rs.blotName="code";Rs.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 Is={scope:Y.BLOCK,whitelist:["rtl"]},Uo=new $t("direction","dir",Is),Fo=new Ot("direction","ql-direction",Is),Ho=new pn("direction","direction",Is),zo={scope:Y.INLINE,whitelist:["serif","monospace"]},jo=new Ot("font","ql-font",zo);class Ff extends pn{value(e){return super.value(e).replace(/["']/g,"")}}const Ko=new Ff("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"]}),Hf=Qt("quill:keyboard"),zf=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Ci 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 i=Kf(e);if(i==null){Hf.warn("Attempted to add invalid keyboard binding",i);return}typeof t=="function"&&(t={handler:t}),typeof r=="function"&&(r={handler:r}),(Array.isArray(i.key)?i.key:[i.key]).forEach(a=>{const l={...i,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 i=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter(T=>Ci.match(e,T));if(i.length===0)return;const s=A.find(e.target,!0);if(s&&s.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 yi?u.value().slice(0,f):"",y=g instanceof yi?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};i.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:Ts(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 i={};const[s]=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=s.formats(),f=this.quill.getFormat(e.index-1,1);if(i=bt.AttributeMap.diff(u,f)||{},Object.keys(i).length>0){const g=(new Z).retain(e.index+s.length()-2).retain(1,i);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 i={};const[s]=this.quill.getLine(e.index);let a=(new Z).retain(e.index).delete(r);if(t.offset>=s.length()-1){const[l]=this.quill.getLine(e.index+1);if(l){const c=s.formats(),u=this.quill.getFormat(e.index,1);i=bt.AttributeMap.diff(c,u)||{},Object.keys(i).length>0&&(a=a.retain(l.length()-1).retain(1,i))}}this.quill.updateContents(a,A.sources.USER),this.quill.focus()}handleDeleteRange(e){ks({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const r=Object.keys(t.format).reduce((s,a)=>(this.quill.scroll.query(a,Y.BLOCK)&&!Array.isArray(t.format[a])&&(s[a]=t.format[a]),s),{}),i=(new Z).retain(e.index).delete(e.length).insert(`\n`,r);this.quill.updateContents(i,A.sources.USER),this.quill.setSelection(e.index+1,A.sources.SILENT),this.quill.focus()}}const jf={bindings:{bold:Wi("bold"),italic:Wi("italic"),underline:Wi("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"},i=(new Z).retain(n.index).insert(`\n`,r).retain(e.length()-t-1).retain(1,{list:"unchecked"});this.quill.updateContents(i,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),i=(new Z).retain(n.index).insert(`\n`,e.format).retain(t.length()-r-1).retain(1,{header:null});this.quill.updateContents(i,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,i,s]=e.getTable(n),a=Gf(t,r,i,s);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,i=r.offset(this.quill.scroll);t.shiftKey?this.quill.setSelection(i-1,A.sources.USER):this.quill.setSelection(i+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,i]=this.quill.getLine(n.index);if(i>t)return!0;let s;switch(e.prefix.trim()){case"[]":case"[ ]":s="unchecked";break;case"[x]":s="checked";break;case"-":case"*":s="bullet";break;default:s="ordered"}this.quill.insertText(n.index," ",A.sources.USER),this.quill.history.cutoff();const a=(new Z).retain(n.index-i).delete(t+1).retain(r.length()-2-i).retain(1,{list:s});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,i=e;for(;i!=null&&i.length()<=1&&i.formats()["code-block"];)if(i=i.prev,r-=1,r<=0){const s=(new Z).retain(n.index+e.length()-t-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(s,A.sources.USER),this.quill.setSelection(n.index-1,A.sources.SILENT),!1}return!0}},"embed left":li("ArrowLeft",!1),"embed left shift":li("ArrowLeft",!0),"embed right":li("ArrowRight",!1),"embed right shift":li("ArrowRight",!0),"table down":Ma(!1),"table up":Ma(!0)}};Ci.DEFAULTS=jf;function ka(n){return{key:"Tab",shiftKey:!n,format:{"code-block":!0},handler(e,t){let{event:r}=t;const i=this.quill.scroll.query("code-block"),{TAB:s}=i;if(e.length===0&&!r.shiftKey){this.quill.insertText(e.index,s,A.sources.USER),this.quill.setSelection(e.index+s.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,s),f===0?l+=s.length:c+=s.length):u.domNode.textContent.startsWith(s)&&(u.deleteAt(0,s.length),f===0?l-=s.length:c-=s.length)}),this.quill.update(A.sources.USER),this.quill.setSelection(l,c,A.sources.SILENT)}}}function li(n,e){return{key:n,shiftKey:e,altKey:null,[n==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(r){let{index:i}=r;n==="ArrowRight"&&(i+=r.length+1);const[s]=this.quill.getLeaf(i);return s 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 Wi(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",i=t.line,s=i.parent[r];if(s!=null){if(s.statics.blotName==="table-row"){let a=s.children.head,l=i;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=i.table()[r];a!=null&&(n?this.quill.setSelection(a.offset(this.quill.scroll)+a.length()-1,0,A.sources.USER):this.quill.setSelection(a.offset(this.quill.scroll),0,A.sources.USER))}return!1}}}function Kf(n){if(typeof n=="string"||typeof n=="number")n={key:n};else if(typeof n=="object")n=rr(n);else return null;return n.shortKey&&(n[zf]=n.shortKey,delete n.shortKey),n}function ks(n){let{quill:e,range:t}=n;const r=e.getLines(t);let i={};if(r.length>1){const s=r[0].formats(),a=r[r.length-1].formats();i=bt.AttributeMap.diff(a,s)||{}}e.deleteText(t,A.sources.USER),Object.keys(i).length>0&&e.formatLine(t.index,1,i,A.sources.USER),e.setSelection(t.index,A.sources.SILENT)}function Gf(n,e,t,r){return e.prev==null&&e.next==null?t.prev==null&&t.next==null?r===0?-1:1:t.prev==null?-1:1:e.prev==null?-1:e.next==null?1:null}const Vf=/font-weight:\s*normal/,Zf=["P","OL","UL"],Da=n=>n&&Zf.includes(n.tagName),Wf=n=>{Array.from(n.querySelectorAll("br")).filter(e=>Da(e.previousElementSibling)&&Da(e.nextElementSibling)).forEach(e=>{e.parentNode?.removeChild(e)})},Yf=n=>{Array.from(n.querySelectorAll('b[style*="font-weight"]')).filter(e=>e.getAttribute("style")?.match(Vf)).forEach(e=>{const t=n.createDocumentFragment();t.append(...e.childNodes),e.parentNode?.replaceChild(t,e)})};function Qf(n){n.querySelector('[id^="docs-internal-guid-"]')&&(Yf(n),Wf(n))}const Xf=/\bmso-list:[^;]*ignore/i,Jf=/\bmso-list:[^;]*\bl(\d+)/i,eg=/\bmso-list:[^;]*\blevel(\d+)/i,tg=(n,e)=>{const t=n.getAttribute("style"),r=t?.match(Jf);if(!r)return null;const i=Number(r[1]),s=t?.match(eg),a=s?Number(s[1]):1,l=new RegExp(`@list l${i}:level${a}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),c=e.match(l),u=c&&c[1]==="bullet"?"bullet":"ordered";return{id:i,indent:a,type:u,element:n}},ng=n=>{const e=Array.from(n.querySelectorAll("[style*=mso-list]")),t=[],r=[];e.forEach(a=>{(a.getAttribute("style")||"").match(Xf)?t.push(a):r.push(a)}),t.forEach(a=>a.parentNode?.removeChild(a));const i=n.documentElement.innerHTML,s=r.map(a=>tg(a,i)).filter(a=>a);for(;s.length;){const a=[];let l=s.shift();for(;l;)a.push(l),l=s.length&&s[0]?.element===l.element.nextElementSibling&&s[0].id===l.id?s.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 rg(n){n.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&ng(n)}const ig=[rg,Qf],sg=n=>{n.documentElement&&ig.forEach(e=>{e(n)})},ag=Qt("quill:clipboard"),og=[[Node.TEXT_NODE,_g],[Node.TEXT_NODE,$a],["br",fg],[Node.ELEMENT_NODE,$a],[Node.ELEMENT_NODE,hg],[Node.ELEMENT_NODE,dg],[Node.ELEMENT_NODE,Eg],["li",mg],["ol, ul",bg],["pre",gg],["tr",yg],["b",Yi("bold")],["i",Yi("italic")],["strike",Yi("strike")],["style",pg]],lg=[qf,Uo].reduce((n,e)=>(n[e.keyName]=e,n),{}),Ba=[qo,Cs,Ls,Ho,Ko,Vo].reduce((n,e)=>(n[e.keyName]=e,n),{});class cg 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=[],og.concat(this.options.matchers??[]).forEach(r=>{let[i,s]=r;this.addMatcher(i,s)})}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:r}=e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(i[nt.blotName])return(new Z).insert(r||"",{[nt.blotName]:i[nt.blotName]});if(!t)return(new Z).insert(r||"",i);const s=this.convertHTML(t);return jr(s,`\n`)&&(s.ops[s.ops.length-1].attributes==null||i.table)?s.compose((new Z).retain(s.length()-1).delete(1)):s}normalizeHTML(e){sg(e)}convertHTML(e){const t=(new DOMParser).parseFromString(e,"text/html");this.normalizeHTML(t);const r=t.body,i=new WeakMap,[s,a]=this.prepareMatching(r,i);return Ms(this.quill.scroll,r,s,a,i)}dangerouslyPasteHTML(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:A.sources.API;if(typeof e=="string"){const i=this.convert({html:e,text:""});this.quill.setContents(i,t),this.quill.setSelection(0,A.sources.SILENT)}else{const i=this.convert({html:t,text:""});this.quill.updateContents((new Z).retain(e).concat(i),r),this.quill.setSelection(e+i.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:i,text:s}=this.onCopy(r,t);e.clipboardData?.setData("text/plain",s),e.clipboardData?.setData("text/html",i),t&&ks({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 i=e.clipboardData?.getData("text/plain");if(!r&&!i){const a=e.clipboardData?.getData("text/uri-list");a&&(i=this.normalizeURIList(a))}const s=Array.from(e.clipboardData?.files||[]);if(!r&&s.length>0){this.quill.uploader.upload(t,s);return}if(r&&s.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,s);return}}this.onPaste(t,{html:r,text:i})}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:r,html:i}=t;const s=this.quill.getFormat(e.index),a=this.convert({text:r,html:i},s);ag.log("onPaste",a,{text:r,html:i});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=[],i=[];return this.matchers.forEach(s=>{const[a,l]=s;switch(a){case Node.TEXT_NODE:i.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,i]}}function Un(n,e,t,r){return r.query(e)?n.reduce((i,s)=>{if(!s.insert)return i;if(s.attributes&&s.attributes[e])return i.push(s);const a=t?{[e]:t}:{};return i.insert(s.insert,{...a,...s.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 i=n.ops[r];if(typeof i.insert!="string")break;t=i.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 ug(n,e){return n.previousElementSibling&&n.nextElementSibling&&!un(n.previousElementSibling,e)&&!un(n.nextElementSibling,e)}const ci=new WeakMap;function Zo(n){return n==null?!1:(ci.has(n)||(n.tagName==="PRE"?ci.set(n,!0):ci.set(n,Zo(n.parentNode))),ci.get(n))}function Ms(n,e,t,r,i){return e.nodeType===e.TEXT_NODE?r.reduce((s,a)=>a(e,s,n),new Z):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((s,a)=>{let l=Ms(n,a,t,r,i);return a.nodeType===e.ELEMENT_NODE&&(l=t.reduce((c,u)=>u(a,c,n),l),l=(i.get(a)||[]).reduce((c,u)=>u(a,c,n),l)),s.concat(l)},new Z):new Z}function Yi(n){return(e,t,r)=>Un(t,n,!0,r)}function dg(n,e,t){const r=$t.keys(n),i=Ot.keys(n),s=pn.keys(n),a={};return r.concat(i).concat(s).forEach(l=>{let c=t.query(l,Y.ATTRIBUTE);c!=null&&(a[c.attrName]=c.value(n),a[c.attrName])||(c=lg[l],c!=null&&(c.attrName===l||c.keyName===l)&&(a[c.attrName]=c.value(n)||void 0),c=Ba[l],c!=null&&(c.attrName===l||c.keyName===l)&&(c=Ba[l],a[c.attrName]=c.value(n)||void 0))}),Object.entries(a).reduce((l,c)=>{let[u,f]=c;return Un(l,u,f,t)},e)}function hg(n,e,t){const r=t.query(n);if(r==null)return e;if(r.prototype instanceof ot){const i={},s=r.value(n);if(s!=null)return i[r.blotName]=s,(new Z).insert(i,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 fg(n,e){return jr(e,`\n`)||e.insert(`\n`),e}function gg(n,e,t){const r=t.query("code-block"),i=r&&"formats"in r&&typeof r.formats=="function"?r.formats(n,t):!0;return Un(e,"code-block",i,t)}function pg(){return new Z}function mg(n,e,t){const r=t.query(n);if(r==null||r.blotName!=="list"||!jr(e,`\n`))return e;let i=-1,s=n.parentNode;for(;s!=null;)["OL","UL"].includes(s.tagName)&&(i+=1),s=s.parentNode;return i<=0?e:e.reduce((a,l)=>l.insert?l.attributes&&typeof l.attributes.indent=="number"?a.push(l):a.insert(l.insert,{indent:i,...l.attributes||{}}):a,new Z)}function bg(n,e,t){const r=n;let i=r.tagName==="OL"?"ordered":"bullet";const s=r.getAttribute("data-checked");return s&&(i=s==="true"?"checked":"unchecked"),Un(e,"list",i,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 i=t.query(r);if(i&&i.prototype instanceof mt)return e.insert(`\n`);r=r.firstChild}}}return e}function Eg(n,e,t){const r={},i=n.style||{};return i.fontStyle==="italic"&&(r.italic=!0),i.textDecoration==="underline"&&(r.underline=!0),i.textDecoration==="line-through"&&(r.strike=!0),(i.fontWeight?.startsWith("bold")||parseInt(i.fontWeight,10)>=700)&&(r.bold=!0),e=Object.entries(r).reduce((s,a)=>{let[l,c]=a;return Un(s,l,c,t)},e),parseFloat(i.textIndent||0)>0?(new Z).insert("\t").concat(e):e}function yg(n,e,t){const r=n.parentElement?.tagName==="TABLE"?n.parentElement:n.parentElement?.parentElement;if(r!=null){const s=Array.from(r.querySelectorAll("tr")).indexOf(n)+1;return Un(e,"table",s,t)}return e}function _g(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`)&&!ug(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 vg 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,i,s,a)=>{r===A.events.SELECTION_CHANGE?i&&a!==A.sources.SILENT&&(this.currentRange=i):r===A.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||a===A.sources.USER?this.record(i,s):this.transform(i)),this.currentRange=gs(this.currentRange,i))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",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 i=this.quill.getContents(),s=r.delta.invert(i);this.stack[t].push({delta:s,range:gs(r.range,s)}),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),i=this.currentRange;const s=Date.now();if(this.lastRecorded+this.options.delay>s&&this.stack.undo.length>0){const a=this.stack.undo.pop();a&&(r=r.compose(a.delta),i=a.range)}else this.lastRecorded=s;r.length()!==0&&(this.stack.undo.push({delta:r,range:i}),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=Tg(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 i=n[r];n[r]={delta:t.transform(i.delta,!0),range:i.range&&gs(i.range,t)},t=i.delta.transform(t),n[r].delta.length()===0&&n.splice(r,1)}}function Ng(n,e){const t=e.ops[e.ops.length-1];return t==null?!1:t.insert!=null?typeof t.insert=="string"&&t.insert.endsWith(`\n`):t.attributes!=null?Object.keys(t.attributes).some(r=>n.query(r,Y.BLOCK)!=null):!1}function Tg(n,e){const t=e.reduce((i,s)=>i+(s.delete||0),0);let r=e.length()-t;return Ng(n,e)&&(r-=1),r}function gs(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 i=null;if(document.caretRangeFromPoint)i=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(r.clientX,r.clientY);i=document.createRange(),i.setStart(a.offsetNode,a.offset),i.setEnd(a.offsetNode,a.offset)}const s=i&&e.selection.normalizeNative(i);if(s){const a=e.selection.normalizedToRange(s);r.dataTransfer?.files&&this.upload(a,r.dataTransfer.files)}})}upload(e,t){const r=[];Array.from(t).forEach(i=>{i&&this.options.mimetypes?.includes(i.type)&&r.push(i)}),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(i=>{const s=new FileReader;s.onload=()=>{i(s.result)},s.readAsDataURL(r)}));Promise.all(t).then(r=>{const i=r.reduce((s,a)=>s.insert({image:a}),(new Z).retain(n.index).delete(n.length));this.quill.updateContents(i,W.sources.USER),this.quill.setSelection(n.index+r.length,W.sources.SILENT)})}};const Ag=["insertText","insertReplacementText"];class wg 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){ks({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||!Ag.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const r=Sg(e);if(r==null)return;const i=this.quill.selection.normalizeNative(t),s=i?this.quill.selection.normalizedToRange(i):null;s&&this.replaceText(s,r)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function Sg(n){return typeof n.data=="string"?n.data:n.dataTransfer?.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const xg=/Mac/i.test(navigator.platform),Og=100,Lg=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||xg&&n.key==="a"&&n.ctrlKey===!0);class Cg extends 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:i}=t;if(!(r instanceof St)||!r.uiNode)return!0;const s=getComputedStyle(r.domNode).direction==="rtl";return s&&i.key!=="ArrowRight"||!s&&i.key!=="ArrowLeft"?!0:(this.quill.setSelection(e.index-1,e.length+(i.shiftKey?1:0),A.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",e=>{!e.defaultPrevented&&Lg(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+Og,this.isListening)return;this.isListening=!0;const e=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",e,{once:!0})}handleSelectionChange(){const e=document.getSelection();if(!e)return;const t=e.getRangeAt(0);if(t.collapsed!==!0||t.startOffset!==0)return;const r=this.quill.scroll.find(t.startContainer);if(!(r instanceof St)||!r.uiNode)return;const i=document.createRange();i.setStartAfter(r.uiNode),i.setEndAfter(r.uiNode),e.removeAllRanges(),e.addRange(i)}}A.register({"blots/block":Ze,"blots/block/embed":mt,"blots/break":Lt,"blots/container":qn,"blots/cursor":At,"blots/embed":xs,"blots/inline":mn,"blots/scroll":$f,"blots/text":xt,"modules/clipboard":cg,"modules/history":vg,"modules/keyboard":Ci,"modules/uploader":Wo,"modules/input":wg,"modules/uiNode":Cg});class Rg extends Ot{add(e,t){let r=0;if(t==="+1"||t==="-1"){const i=this.value(e)||0;r=t==="+1"?i+1:i-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 Ig=new Rg("indent","ql-indent",{scope:Y.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class kg extends Ze{static blotName="blockquote";static tagName="blockquote"}class Mg extends Ze{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}}class 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"),i=s=>{if(!e.isEnabled())return;const a=this.statics.formats(t,e);a==="checked"?(this.format("list","unchecked"),s.preventDefault()):a==="unchecked"&&(this.format("list","checked"),s.preventDefault())};r.addEventListener("mousedown",i),r.addEventListener("touchstart",i),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 Ds 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 Dg extends Ds{static blotName="italic";static tagName=["EM","I"]}class _i 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 Bg 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 $g extends Ds{static blotName="strike";static tagName=["S","STRIKE"]}class qg extends mn{static blotName="underline";static tagName="U"}class Pg extends xs{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return typeof e=="string"&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`<span>${e}</span>`}}const Pa=["alt","height","width"];let Ug=class extends 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 Fg 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 _i.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,i){r===pt.blotName&&(this.forceNext=!0),super.formatAt(e,t,r,i)}highlight(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const i=`${Array.from(this.domNode.childNodes).filter(a=>a!==this.uiNode).map(a=>a.textContent).join(`\n`)}\n`,s=pt.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==i){if(i.trim().length>0||this.cachedText==null){const a=this.children.reduce((c,u)=>c.concat(Do(u,!1)),new Z),l=e(i,s);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=i,this.forceNext=!1}}html(e,t){const[r]=this.children.find(e);return`<pre data-language="${r?pt.formats(r.domNode):"plain"}">\n${Li(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 Hg=(n,e,t)=>{if(typeof n.versionString=="string"){const r=n.versionString.split(".")[0];if(parseInt(r,10)>=11)return n.highlight(t,{language:e}).value}return n.highlight(e,t).value};class 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,i)=>{let{key:s}=i;return r[s]=!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:i,label:s}=r;const a=t.ownerDocument.createElement("option");a.textContent=s,a.setAttribute("value",i),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(s=>{s.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 Li(e).split(`\n`).reduce((i,s,a)=>(a!==0&&i.insert(`\n`,{[nt.blotName]:t}),i.insert(s)),new Z);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(nt.className),r.innerHTML=Hg(this.options.hljs,t,e),Ms(this.quill.scroll,r,[(i,s)=>{const a=kr.value(i);return a?s.compose((new Z).retain(s.length(),{[Wt.blotName]:a})):s}],[(i,s)=>i.data.split(`\n`).reduce((a,l,c)=>(c!==0&&a.insert(`\n`,{[nt.blotName]:t}),a.insert(l)),s)],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",Bs()),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(),i=this.next.children.tail.formats();return e.table===t.table&&e.table===r.table&&e.table===i.table}return!1}optimize(e){super.optimize(e),this.children.forEach(t=>{if(t.next==null)return;const r=t.formats(),i=t.next.formats();if(r.table!==i.table){const s=this.splitAfter(t);s&&s.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 vi extends qn{static blotName="table-container";static tagName="TABLE";balanceCells(){const e=this.descendants(Mn),t=e.reduce((r,i)=>Math.max(i.children.length,r),0);e.forEach(r=>{new Array(t-r.children.length).fill(0).forEach(()=>{let i;r.children.head!=null&&(i=wt.formats(r.children.head.domNode));const s=this.scroll.create(wt.blotName,i);r.appendChild(s),s.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 i=r.children.at(e);i?.remove()})}insertColumn(e){const[t]=this.descendant(hn);t==null||t.children.head==null||t.children.forEach(r=>{const i=r.children.at(e),s=wt.formats(r.children.head.domNode),a=this.scroll.create(wt.blotName,s);r.insertBefore(a,i)})}insertRow(e){const[t]=this.descendant(hn);if(t==null||t.children.head==null)return;const r=Bs(),i=this.scroll.create(Mn.blotName);t.children.head.children.forEach(()=>{const a=this.scroll.create(wt.blotName,r);i.appendChild(a)});const s=t.children.at(e);t.insertBefore(i,s)}rows(){const e=this.children.head;return e==null?[]:e.children.map(t=>t)}}vi.allowedChildren=[hn];hn.requiredContainer=vi;hn.allowedChildren=[Mn];Mn.requiredContainer=hn;Mn.allowedChildren=[wt];wt.requiredContainer=Mn;function Bs(){return`row-${Math.random().toString(36).slice(2,6)}`}class zg extends Pt{static register(){A.register(wt),A.register(Mn),A.register(hn),A.register(vi)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(vi).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 i=t.parent;return[i.parent.parent,i,t,r]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[r,i,s]=this.getTable(t);if(s==null)return;const a=s.cellOffset();r.insertColumn(a+e),this.quill.update(A.sources.USER);let l=i.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,i,s]=this.getTable(t);if(s==null)return;const a=i.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+i.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 i=new Array(e).fill(0).reduce(s=>{const a=new Array(t).fill(`\n`).join("");return s.insert(a,{table:Bs()})},(new Z).retain(r.index));this.quill.updateContents(i,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,i,s)=>{s===A.sources.USER&&this.balanceTables()}),!0):!1)})}}const Fa=Qt("quill:toolbar");class $s extends Pt{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const r=document.createElement("div");r.setAttribute("role","toolbar"),jg(r,this.options.container),e.container?.parentNode?.insertBefore(r,e.container),this.container=r}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){Fa.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(r=>{const i=this.options.handlers?.[r];i&&this.addHandler(r,i)}),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(i=>i.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,i=>{let s;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const l=e.options[e.selectedIndex];l.hasAttribute("selected")?s=!1:s=l.value||!1}else e.classList.contains("ql-active")?s=!1:s=e.value||!e.hasAttribute("value"),i.preventDefault();this.quill.focus();const[a]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,s);else if(this.quill.scroll.query(t).prototype instanceof ot){if(s=prompt(`Enter ${t}`),!s)return;this.quill.updateContents((new Z).retain(a.index).delete(a.length).insert({[t]:s}),A.sources.USER)}else this.quill.format(t,s,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[i,s]=r;if(s.tagName==="SELECT"){let a=null;if(e==null)a=null;else if(t[i]==null)a=s.querySelector("option[selected]");else if(!Array.isArray(t[i])){let l=t[i];typeof l=="string"&&(l=l.replace(/"/g,'\\"')),a=s.querySelector(`option[value="${l}"]`)}a==null?(s.value="",s.selectedIndex=-1):a.selected=!0}else if(e==null)s.classList.remove("ql-active"),s.setAttribute("aria-pressed","false");else if(s.hasAttribute("value")){const a=t[i],l=a===s.getAttribute("value")||a!=null&&a.toString()===s.getAttribute("value")||a==null&&!s.getAttribute("value");s.classList.toggle("ql-active",l),s.setAttribute("aria-pressed",l.toString())}else{const a=t[i]!=null;s.classList.toggle("ql-active",a),s.setAttribute("aria-pressed",a.toString())}})}}$s.DEFAULTS={};function Ha(n,e,t){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${e}`),r.setAttribute("aria-pressed","false"),t!=null?(r.value=t,r.setAttribute("aria-label",`${e}: ${t}`)):r.setAttribute("aria-label",e),n.appendChild(r)}function jg(n,e){Array.isArray(e[0])||(e=[e]),e.forEach(t=>{const r=document.createElement("span");r.classList.add("ql-formats"),t.forEach(i=>{if(typeof i=="string")Ha(r,i);else{const s=Object.keys(i)[0],a=i[s];Array.isArray(a)?Kg(r,s,a):Ha(r,s,a)}}),n.appendChild(r)})}function Kg(n,e,t){const r=document.createElement("select");r.classList.add(`ql-${e}`),t.forEach(i=>{const s=document.createElement("option");i!==!1?s.setAttribute("value",String(i)):s.setAttribute("selected","selected"),r.appendChild(s)}),n.appendChild(r)}$s.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 i=n==="+1"?1:-1;t.direction==="rtl"&&(i*=-1),this.quill.format("indent",r+i,A.sources.USER)}},link(n){n===!0&&(n=prompt("Enter link URL:")),this.quill.format("link",n,A.sources.USER)},list(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e);n==="check"?t.list==="checked"||t.list==="unchecked"?this.quill.format("list",!1,A.sources.USER):this.quill.format("list","unchecked",A.sources.USER):this.quill.format("list",n,A.sources.USER)}}};const Gg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',Vg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',Zg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',Wg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',Yg='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',Qg='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',Xg='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',Jg='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',za='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',ep='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',tp='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',np='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',rp='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',ip='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',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>',ap='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',op='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',lp='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',cp='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',up='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',dp='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',hp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',fp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',gp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',pp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',mp='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',bp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',Ep='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',yp='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',_p='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',vp='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',Np='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',Tp='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',Fr={align:{"":Gg,center:Vg,right:Zg,justify:Wg},background:Yg,blockquote:Qg,bold:Xg,clean:Jg,code:za,"code-block":za,color:ep,direction:{"":tp,rtl:np},formula:rp,header:{1:ip,2:sp,3:ap,4:op,5:lp,6:cp},italic:up,image:dp,indent:{"+1":hp,"-1":fp},link:gp,list:{bullet:pp,check:mp,ordered:bp},script:{sub:Ep,super:yp},strike:_p,table:vp,underline:Np,video:Tp},Ap='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let ja=0;function Ka(n,e){n.setAttribute(e,`${n.getAttribute(e)!=="true"}`)}class Ri{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",i=>{switch(i.key){case"Enter":this.selectItem(t,!0),i.preventDefault();break;case"Escape":this.escape(),i.preventDefault();break}}),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=Ap,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${ja}`,ja+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(t=>{const r=this.buildItem(t);e.appendChild(r),t.selected===!0&&this.selectItem(r)}),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach(e=>{this.container.setAttribute(e.name,e.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.container.querySelector(".ql-selected");e!==r&&(r?.classList.remove("ql-selected"),e!=null&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const t=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class Xo extends Ri{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"),i=e&&e.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=i:r.style.fill=i)}}class Jo extends Ri{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(r=>{r.innerHTML=t[r.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const r=e||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const wp=n=>{const{overflowY:e}=getComputedStyle(n,null);return e!=="visible"&&e!=="clip"};let 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,wp(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const t=e.left+e.width/2-this.root.offsetWidth/2,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const i=this.boundsContainer.getBoundingClientRect(),s=this.root.getBoundingClientRect();let a=0;if(s.right>i.right&&(a=i.right-s.right,this.root.style.left=`${t+a}px`),s.left<i.left&&(a=i.left-s.left,this.root.style.left=`${t+a}px`),s.bottom>i.bottom){const l=s.bottom-s.top,c=e.bottom-e.top+l;this.root.style.top=`${r-c}px`,this.root.classList.add("ql-flip")}return a}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}};const Sp=[!1,"center","right","justify"],xp=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],Op=[!1,"serif","monospace"],Lp=["1","2","3",!1],Cp=["small",!1,"large","huge"];class Vr extends cr{constructor(e,t){super(e,t);const r=i=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(i.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(s=>{s.container.contains(i.target)||s.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(s=>{if(s.startsWith("ql-")&&(s=s.slice(3),t[s]!=null))if(s==="direction")r.innerHTML=t[s][""]+t[s].rtl;else if(typeof t[s]=="string")r.innerHTML=t[s];else{const a=r.value||"";a!=null&&t[s][a]&&(r.innerHTML=t[s][a])}})})}buildPickers(e,t){this.pickers=Array.from(e).map(i=>{if(i.classList.contains("ql-align")&&(i.querySelector("option")==null&&Cr(i,Sp),typeof t.align=="object"))return new Jo(i,t.align);if(i.classList.contains("ql-background")||i.classList.contains("ql-color")){const s=i.classList.contains("ql-background")?"background":"color";return i.querySelector("option")==null&&Cr(i,xp,s==="background"?"#ffffff":"#000000"),new Xo(i,t[s])}return i.querySelector("option")==null&&(i.classList.contains("ql-font")?Cr(i,Op):i.classList.contains("ql-header")?Cr(i,Lp):i.classList.contains("ql-size")&&Cr(i,Cp)),new Ri(i)});const r=()=>{this.pickers.forEach(i=>{i.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=Rp(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(t!=null){const r=t.index+t.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),e,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 Rp(n){let e=n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=n.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:n}function Cr(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach(r=>{const i=document.createElement("option");r===t?i.setAttribute("selected","selected"):i.setAttribute("value",String(r)),n.appendChild(i)})}const Ip=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class kp 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,i,s,a)=>{if(r===W.events.SELECTION_CHANGE)if(i!=null&&i.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(i.index,i.length);if(l.length===1){const c=this.quill.getBounds(i);c!=null&&this.position(c)}else{const c=l[l.length-1],u=this.quill.getIndex(c),f=Math.min(c.length()-1,i.index+i.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=Ip),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new kp(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),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 Mp=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Dp 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[i,s]=this.quill.scroll.descendant(_i,e.index);if(i!=null){this.linkRange=new kn(e.index-s,i.length());const a=_i.formats(i.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=Mp),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),Fr),this.buildPickers(e.container.querySelectorAll("select"),Fr),this.tooltip=new Dp(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(t,r)=>{e.handlers.link.call(e,!r.format.link)}))}}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":Uf,"attributors/class/color":Pf,"attributors/class/direction":Fo,"attributors/class/font":jo,"attributors/class/size":Go,"attributors/style/align":qo,"attributors/style/background":Cs,"attributors/style/color":Ls,"attributors/style/direction":Ho,"attributors/style/font":Ko,"attributors/style/size":Vo},!0);A.register({"formats/align":$o,"formats/direction":Fo,"formats/indent":Ig,"formats/background":Cs,"formats/color":Ls,"formats/font":jo,"formats/size":Go,"formats/blockquote":kg,"formats/code-block":nt,"formats/header":Mg,"formats/list":Gr,"formats/bold":Ds,"formats/code":Rs,"formats/italic":Dg,"formats/link":_i,"formats/script":Bg,"formats/strike":$g,"formats/underline":qg,"formats/formula":Pg,"formats/image":Ug,"formats/video":Fg,"modules/syntax":Qo,"modules/table":zg,"modules/toolbar":$s,"themes/bubble":nl,"themes/snow":rl,"ui/icons":Fr,"ui/picker":Ri,"ui/icon-picker":Jo,"ui/color-picker":Xo,"ui/tooltip":el},!0);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 i;const s=new Image;s.onerror=s.onabort=()=>{clearTimeout(i),r(!1)},s.onload=()=>{clearTimeout(i),t(!0)},i=setTimeout(()=>{s.src="//!/an/invalid.jpg",r(!1)},e),s.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 i=-1;for(;++i<e;)r[i]=n.charCodeAt(i);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 i=document.getSelection();let s=!1;i&&i.rangeCount>0&&(s=i.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(),i&&s&&(i.removeAllRanges(),i.addRange(s)),r&&r.focus(),a},isType(n,e){return Object.prototype.toString.call(n)===`[object ${e}]`},isObject(n){return this.isType(n,"Object")}};class Bp{constructor(e,t,r){this.dataUrl=e,this.type=t,this.name=r||""}}class Hr extends Bp{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 i=e.maxWidth||800,s=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>i&&(l.height=u*i/c,l.width=i):u>s&&(l.width=c*s/u,l.height=s);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 i="BlobBuilder"in window?window.BlobBuilder:"MSBlobBuilder"in window?window.MSBlobBuilder:"MozBlobBuilder"in window?window.MozBlobBuilder:window.WebKitBlobBuilder,s=new i;for(let a=0;a<e.length;a++)s.append(e[a]);return s.getBlob(t.type)}}getSuffix(){const e=this.type.match(/^image\/(\w+)$/);return e?e[1]:"png"}}class $p{constructor(e,t){this.quill=e,this.option=t}}class Ii extends $p{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",i)=>{typeof this.option.handler=="function"?this.option.handler.call(this,t,r,new Hr(t,r,i)):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,i=>{ht.isType(i,"DataTransferItem")?this.handleDataTransfer(i,t,r):i instanceof File&&this.handleDroppedFile(i,t,r)})}handleDataTransfer(e,t,r){const i=this,{type:s}=e;if(s.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,s)};const l=e.getAsFile?e.getAsFile():e;l instanceof Blob&&a.readAsDataURL(l)}else s.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"),i.insert(a,"image",l-a.length)})}).catch(()=>{})})}handleDroppedFile(e,t,r){const{type:i,name:s=""}=e;if(i.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,i,s)},a.readAsDataURL(e)}}insert(e,t,r){r=r===void 0?this.getIndex():r;let i;t.startsWith("image")?(i=r+1,this.quill.insertEmbed(r,"image",e,"user")):t.startsWith("text")&&(i=r+e.length,this.quill.insertText(r,e,"user")),setTimeout(()=>{this.quill.setSelection(i)})}getIndex(){let e=(this.quill.getSelection(!0)||{}).index;return(e===void 0||e<0)&&(e=this.quill.getLength()),e}}Ii.ImageData=Hr;window.QuillImageDropAndPaste=Ii;"Quill"in window&&window.Quill.register("modules/imageDropAndPaste",Ii);const qp=A.import("blots/block/embed");function Pp(){return class extends qp{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 Up=A.import("blots/inline");function Fp(n,e){return class extends Up{static blotName="internal-link";static tagName="SPAN";static className="InternalLinkPlugin";static create(r){const i=super.create(r);return e?.getDocumentTitle(r).then(s=>{i.innerHTML=`${s}`}).catch(s=>{n.logger.error("Error fetching document title:",s)}),r&&i.setAttribute("data-document-id",r),i.setAttribute("contenteditable","false"),i}static formats(r){const{documentId:i}=r.dataset;return i}}}var Hp=be("<span>");function ps({center:n}){const e=n?"QpSpinner center":"QpSpinner";return(()=>{var t=Hp();return pi(t,e),t})()}function ms(n){const e=ki(n)??0,[t]=n.getLeaf(e);if(!t)throw new Error("editor.getLeaf() returns undefined");return t.domNode}function ki(n){const e=n.getSelection();if(e!==null)return e.index+e.length}const il=n=>n!=null&&(n=Object.getPrototypeOf(n),n===Array.prototype||n===Object.prototype);function sl(n,e,t){for(const[r,i]of Object.entries(e)){const s=`${t}.${r}`;n[s]=i,il(i)&&sl(n,i,s)}}function zp(n){const e={...n};for(const[t,r]of Object.entries(n))il(r)&&sl(e,r,t);return e}const jp=(n,e)=>{if(e)for(const[t,r]of Object.entries(e))n=n.replace(new RegExp(`{{\\s*${t}\\s*}}`,"g"),r);return n},Kp=n=>n;function Gp(n,e=Kp){return(t,...r)=>{t[0]==="."&&(t=t.slice(1));const i=n()?.[t];switch(typeof i){case"function":return i(...r);case"string":return e(i,r[0]);default:return i}}}const Vp={insertHtmlSnippetMessage:"HTML-Snippet einfügen",obfuscate:"Verschleiern"},Zp="Bild",Wp="Validieren",Yp="Abbrechen",Qp="Fertig",Xp="Entfernen",Jp="auto",em="Bild nicht eingefügt, setzen Sie zuerst den Cursor in den Editor",tm="HTML-Snippet",nm="Löschung bestätigen",rm={content:"Sind Sie sicher, dass Sie dieses HTML-Snippet löschen möchten?"},im={variantLabel:"Größe {{ n }}",sizes:"Größen",imageProperties:"Bildeigenschaften",left:"Links",right:"Rechts",center:"Zentriert",alignment:"Ausrichtung",options:"Optionen",enableZoom:"Zoom aktivieren",link:"Link",mediaProperties:"Medieneigenschaften",caption:"Bildunterschrift",pixelRatio:"Pixelverhältnis"},sm={obfuscator:"Verschleierer",content:"Inhalt:",asALink:"Als Link",doNotObfuscate:"Nicht verschleiern"},am={insertVideo:"Video einfügen",dialog:{title:"Video festlegen"}},om={insertLink:"Internen Link einfügen"},lm={CustomToolbar:Vp,image:Zp,validate:Wp,delete:"Löschen",cancel:Yp,done:Qp,remove:Xp,auto:Jp,editorFocusLost:em,htmlSnippetLabel:tm,confirmDeletion:nm,comfirmSnippetDeletionDialog:rm,makeMediaPropertiesDialog:im,openObfuscatorDialog:sm,videoPlugin:am,internalLinkPlugin:om},cm={insertHtmlSnippetMessage:"Insert a HTML Snippet",obfuscate:"Obfuscate"},um="image",dm="Validate",hm="Cancel",fm="Done",gm="Remove",pm="auto",mm="Image not inserted, place cursor in editor first",bm="HTML Snippet",Em="Confirm Deletion",ym={content:"Are you sure you want to delete this HTML Snippet?"},_m={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"},vm={obfuscator:"Obfuscator",content:"Content:",asALink:"As a link",doNotObfuscate:"Do not obfuscate"},Nm={insertVideo:"Insert a Video",dialog:{title:"Set a video"}},Tm={insertLink:"Insert an internal link"},Am={CustomToolbar:cm,image:um,validate:dm,delete:"Delete",cancel:hm,done:fm,remove:gm,auto:pm,editorFocusLost:mm,htmlSnippetLabel:bm,confirmDeletion:Em,comfirmSnippetDeletionDialog:ym,makeMediaPropertiesDialog:_m,openObfuscatorDialog:vm,videoPlugin:Nm,internalLinkPlugin:Tm},wm={insertHtmlSnippetMessage:"Insertar un fragmento HTML",obfuscate:"Ofuscar"},Sm="imagen",xm="Validar",Om="Cancelar",Lm="Hecho",Cm="Quitar",Rm="auto",Im="Imagen no insertada, coloque primero el cursor en el editor",km="Fragmento HTML",Mm="Confirmar eliminación",Dm={content:"¿Está seguro de que desea eliminar este fragmento HTML?"},Bm={variantLabel:"Tamaño {{ n }}",sizes:"Tamaños",imageProperties:"Propiedades de la imagen",left:"Izquierda",right:"Derecha",center:"Centro",alignment:"Alineación",options:"Opciones",enableZoom:"Habilitar zoom",link:"Enlace",mediaProperties:"Propiedades del medio",caption:"Leyenda",pixelRatio:"Proporción de píxeles"},$m={obfuscator:"Ofuscador",content:"Contenido:",asALink:"Como enlace",doNotObfuscate:"No ofuscar"},qm={insertVideo:"Insertar un video",dialog:{title:"Configurar un video"}},Pm={insertLink:"Insertar un enlace interno"},Um={CustomToolbar:wm,image:Sm,validate:xm,delete:"Eliminar",cancel:Om,done:Lm,remove:Cm,auto:Rm,editorFocusLost:Im,htmlSnippetLabel:km,confirmDeletion:Mm,comfirmSnippetDeletionDialog:Dm,makeMediaPropertiesDialog:Bm,openObfuscatorDialog:$m,videoPlugin:qm,internalLinkPlugin:Pm},Fm={insertHtmlSnippetMessage:"Insérer un extrait de code HTML",obfuscate:"Obfusquer"},Hm="image",zm="Valider",jm="Annuler",Km="Terminé",Gm="Retirer",Vm="auto",Zm="L'image n'a pas été insérée, mettre d'abord le curseur dans l'éditeur",Wm="Code HTML",Ym="Confirmer la suppression",Qm={content:"Voulez-vous vraiment supprimer ce code HTML ?"},Xm={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"},Jm={obfuscator:"Obfusqueur",content:"Contenu:",asALink:"En tant que lien",doNotObfuscate:"Ne pas obfusquer"},eb={insertVideo:"Insérer une vidéo",dialog:{title:"Définir une vidéo"}},tb={insertLink:"Insérer un lien interne"},nb={CustomToolbar:Fm,image:Hm,validate:zm,delete:"Supprimer",cancel:jm,done:Km,remove:Gm,auto:Vm,editorFocusLost:Zm,htmlSnippetLabel:Wm,confirmDeletion:Ym,comfirmSnippetDeletionDialog:Qm,makeMediaPropertiesDialog:Xm,openObfuscatorDialog:Jm,videoPlugin:eb,internalLinkPlugin:tb},rb={insertHtmlSnippetMessage:"Inserisci un frammento HTML",obfuscate:"Offuscare"},ib="immagine",sb="Validare",ab="Annullare",ob="Fatto",lb="Rimuovere",cb="auto",ub="Immagine non inserita, posiziona prima il cursore nell'editor",db="Frammento HTML",hb="Conferma eliminazione",fb={content:"Sei sicuro di voler eliminare questo frammento HTML?"},gb={variantLabel:"Dimensione {{ n }}",sizes:"Dimensioni",imageProperties:"Proprietà dell'immagine",left:"Sinistra",right:"Destra",center:"Centro",alignment:"Allineamento",options:"Opzioni",enableZoom:"Abilita zoom",link:"Link",mediaProperties:"Proprietà del media",caption:"Didascalia",pixelRatio:"Rapporto pixel"},pb={obfuscator:"Offuscatore",content:"Contenuto:",asALink:"Come link",doNotObfuscate:"Non offuscare"},mb={insertVideo:"Inserisci un video",dialog:{title:"Imposta un video"}},bb={insertLink:"Inserisci un link interno"},Eb={CustomToolbar:rb,image:ib,validate:sb,delete:"Eliminare",cancel:ab,done:ob,remove:lb,auto:cb,editorFocusLost:ub,htmlSnippetLabel:db,confirmDeletion:hb,comfirmSnippetDeletionDialog:fb,makeMediaPropertiesDialog:gb,openObfuscatorDialog:pb,videoPlugin:mb,internalLinkPlugin:bb},yb={insertHtmlSnippetMessage:"Inserir um fragmento HTML",obfuscate:"Ofuscar"},_b="imagem",vb="Validar",Nb="Cancelar",Tb="Concluído",Ab="Remover",wb="auto",Sb="Imagem não inserida, posicione primeiro o cursor no editor",xb="Fragmento HTML",Ob="Confirmar exclusão",Lb={content:"Tem certeza de que deseja excluir este fragmento HTML?"},Cb={variantLabel:"Tamanho {{ n }}",sizes:"Tamanhos",imageProperties:"Propriedades da imagem",left:"Esquerda",right:"Direita",center:"Centro",alignment:"Alinhamento",options:"Opções",enableZoom:"Ativar zoom",link:"Link",mediaProperties:"Propriedades da mídia",caption:"Legenda",pixelRatio:"Proporção de pixels"},Rb={obfuscator:"Ofuscador",content:"Conteúdo:",asALink:"Como link",doNotObfuscate:"Não ofuscar"},Ib={insertVideo:"Inserir um vídeo",dialog:{title:"Definir um vídeo"}},kb={insertLink:"Inserir um link interno"},Mb={CustomToolbar:yb,image:_b,validate:vb,delete:"Excluir",cancel:Nb,done:Tb,remove:Ab,auto:wb,editorFocusLost:Sb,htmlSnippetLabel:xb,confirmDeletion:Ob,comfirmSnippetDeletionDialog:Lb,makeMediaPropertiesDialog:Cb,openObfuscatorDialog:Rb,videoPlugin:Ib,internalLinkPlugin:kb},Ga={en:Am,fr:nb,es:Um,de:lm,it:Eb,pt:Mb};function bn(n){const e=Xi(()=>{const r=n()in Ga?n():"en";return zp(Ga[r])});return{t:Gp(e,jp)}}function Db(n,{label:e,url:t}){let r=e??t;const i=n.getSelection();i&&i.length!==0&&(r=n.getText(i.index,i.length),n.deleteText(i.index,i.length)),n.insertText(ki(n)??0,r,"link",t)}function al({editor:n,values:e,service:t,index:r,language:i}){const{t:s}=bn(i),a=r??ki(n);if(a===void 0){t.showToast(s("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",n)}function cl({values:n,editor:e,index:t}){e.insertEmbed(t,"platform-video",n);const[r]=e.getLeaf(t+1);if(!r)throw new Error("missing last inserted element");return r.domNode}function Bb(n){const{mediaId:e}=n.dataset;if(e)return e;const t=n.getAttribute("src");if(!t)return;const{pathname:r}=new URL(t),i=r.split("/"),a=i[i.length-1].match(/^([0-9a-f-]{36})-([0-9]+x[0-9]+)\.([0-9a-z]+$)/);if(!a)return;const[,l]=a;return l}function $b(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 qb(n){if(n==="center")return"center";if(n==="left")return"left";if(n==="right")return"right"}const Pb=A.import("blots/block/embed"),Va=["alt"];function Ub(n){return class extends Pb{static blotName="media";static tagName="figure";static create(t){const r=super.create(t);return Fb(n,r,t),r}static formats(t){return Va.reduce((r,i)=>(t.hasAttribute(i)&&(r[i]=t.getAttribute(i)),r),{})}static match(t){return/\.(jpe?g|gif|png|webp)$/.test(t)||/^data:image\/.+;base64/.test(t)}static value(t){const{mediaId:r,resize:i}=t.dataset;if(!r)throw new Error('missing "media-id" attribute');const s=i&&eo(i)?i:void 0;if(!s)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:s,align:a,zoomable:l,href:c}}format(t,r){Va.indexOf(t)>-1?r?this.domNode.setAttribute(t,r):this.domNode.removeAttribute(t):super.format(t,r)}}}function Fb(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 s=qb(t.align);s&&e.classList.add(s)}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 i=ps({center:!0});e.appendChild(i),Hb(n,e,r,i,t)}async function Hb(n,e,t,r,i){try{const s=await n.useAdminUiImage(i.mediaId,{resizeRule:i.resizeRule});if(!s)throw new Error(`Media ${i.mediaId} not found`);const{source:a,variant:l}=s;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)}zb(e,a,i),e.removeChild(r),e.appendChild(t),e.setAttribute("data-source",JSON.stringify(a))}catch(s){n.logger.error("Error setting up media:",s),e.contains(r)&&e.removeChild(r)}}function zb(n,e,t){const r=document.createElement("div");if(r.classList.add("MediaBlot-flags"),e.pixelRatio!==void 0){const i=document.createElement("span");i.classList.add("MediaBlot-flag","Fig-flag--pixelRatio"),i.textContent=`${e.pixelRatio}×`,r.appendChild(i)}if(t.zoomable){const i=document.createElement("span");i.classList.add("MediaBlot-flag"),i.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(i)}if(t.href){const i=document.createElement("span");i.classList.add("MediaBlot-flag"),i.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(i)}n.appendChild(r)}function dl(n){return jb(n)||qs(n)}function qs(n){return!!n.match(/^[a-zA-Z0-9. _-]+@[a-zA-Z0-9. -]+\.[a-zA-Z]{2,4}$/g)}function jb(n){return!!n.match(/^(\+|00)[1-9][0-9 \-().]{7,32}$/)}function Kb(n){return dl(n)?qs(n)?"mailto":"tel":"raw"}function hl(n){if(n==="raw")return"raw";if(n==="mailto")return"mailto";if(n==="tel")return"tel";throw new Error(`invalid link-type '${n}'`)}const Gb=A.import("blots/inline");function Vb(){return class extends Gb{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 hl(t)}}}const Zb=A.import("blots/block/embed");function Wb(n){return class extends Zb{static blotName="platform-video";static tagName="DIV";static className="PlatformVideo";static create(t){const r=super.create(t),i=n?.getThumbnailUrl(t);return r.style.backgroundImage=`url(${i})`,r.classList.add("PlatformVideo"),r.innerHTML='<span class="pi pi-youtube PlatformVideo-playButton"></span>',t.videoId&&r.setAttribute("data-video-id",t.videoId),t.platform&&r.setAttribute("data-platform",t.platform),r.querySelector("span")?.addEventListener("click",()=>{r.dispatchEvent(new CustomEvent("click",{bubbles:!0}))}),r}static value(t){const{videoId:r,platform:i}=t.dataset;if(r)return{videoId:r,platform:i??"youtube"}}}}function Yb({service:n,videoPluginHook:e,internalLinkPluginHook:t}){A.register("formats/media",Ub(n),!0),A.register("formats/html-snippet",Pp(),!0),A.register("formats/obfuscate",Vb(),!0),A.register("formats/platform-video",Wb(e),!0),A.register("formats/internal-link",Fp(n,t),!0),A.register("modules/imageDropAndPaste",Ii,!0)}var Qb=be('<textarea autofocus class="QpInput QpHtmlSnippetInput"rows=8 cols=80>'),fl=be('<button class="QpBtn secondary"type=button>'),Xb=be("<button class=QpBtn type=button>"),Jb=be('<button class="QpBtn danger outlined"type=button>'),e1=be("<p>"),t1=be('<button class="QpBtn danger"type=button>');async function gl({service:n,language:e,mode:t,html:r}){const{t:i}=bn(e),[s,a]=ft(r??""),l=()=>{c.close({action:"remove"})},c=n.createModalDialog({content:(()=>{var u=Qb();return u.addEventListener("change",f=>a(f.target.value)),ln(()=>u.value=s()),u})(),footer:[t==="update"&&(()=>{var u=Jb();return u.$$click=()=>{n1({deleteSnippet:l,language:e,service:n})},de(u,()=>i("delete")),u})(),(()=>{var u=fl();return u.$$click=()=>c.close(),de(u,()=>i("cancel")),u})(),(()=>{var u=Xb();return u.$$click=()=>c.close({action:t,values:{html:s()}}),de(u,()=>i("validate")),u})()],header:i("htmlSnippetLabel")});return await c.open()}function n1({deleteSnippet:n,language:e,service:t}){const{t:r}=bn(e),i=t.createModalDialog({header:r("confirmDeletion"),content:(()=>{var s=e1();return de(s,()=>r("comfirmSnippetDeletionDialog.content")),s})(),footer:[(()=>{var s=fl();return s.$$click=()=>{i.hide()},de(s,()=>r("cancel")),s})(),(()=>{var s=t1();return s.$$click=()=>{i.hide(),n()},de(s,()=>r("validate")),s})()]});i.show()}Ti(["click"]);async function pl({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 r1=be('<button class="QpBtn outlined danger"type=button>'),i1=be("<button class=QpBtn type=button>"),ui=be("<h2 class=FieldLabel>"),Za=be("<div class=QpOption>"),s1=be("<input class=QpOption-input type=text>"),a1=be("<label><input type=checkbox name=enableZoom>"),o1=be("<div><div class=QpOption><label class><input type=checkbox name=enableLinkOnImage></label></div><div class=QpOption>"),l1=be("<div class=QpBox><dl class=QpProp><dt>:</dt><dd></dd></dl><dl class=QpProp><dt>:</dt><dd>"),c1=be("<button type=button> <small class=ml-1>(<!>)"),u1=be("<button type=button>");async function d1({service:n,language:e,fetchedOutput:t,initialValues:r}){const{mediaId:i}=r,{themeConf:s}=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();Us(()=>{n.useAdminUiImage(i,{resizeRule:l()}).then(P=>{t.source=P?.source,S(P)}).catch(P=>{n.logger.error("Error fetching media:",P)})});const k=Xi(()=>s.fTextImageResizeRules.map((P,ie)=>({resizeRule:P,label:a("makeMediaPropertiesDialog.variantLabel",{n:ie+1})})),[s,e()]),F=Xi(()=>[{align:"left",label:a("makeMediaPropertiesDialog.left")},{align:"center",label:a("makeMediaPropertiesDialog.center")},{align:"right",label:a("makeMediaPropertiesDialog.right")}],[e()]),B=async()=>{ce.close({action:"update",values:{mediaId:i,align:u(),resizeRule:l(),zoomable:g(),href:p()&&_().trim()||void 0}})};Us(()=>{p()&&h(!1)});const V=[(()=>{var P=r1();return P.$$click=()=>{ce.close({action:"remove"})},de(P,()=>a("remove")),P})(),(()=>{var P=i1();return P.$$click=B,P.disabled=!i||u===void 0||l===void 0,de(P,()=>a("validate")),P})()],ce=n.createModalDialog({header:a("makeMediaPropertiesDialog.imageProperties"),content:[(()=>{var P=ui();return de(P,()=>a("makeMediaPropertiesDialog.sizes")),P})(),(()=>{var P=Za();return de(P,Dt(Fs,{get each(){return k()},children:ie=>(()=>{var se=c1(),m=se.firstChild,L=m.nextSibling,v=L.firstChild,C=v.nextSibling;return C.nextSibling,se.$$click=()=>c(ie.resizeRule),se.disabled=!i,de(se,()=>ie.label,m),de(L,()=>ie.resizeRule.replace("x","×"),C),ln(()=>pi(se,`QpBtn secondary ${ie.resizeRule!==l()?"outlined":""}`)),se})()})),P})(),(()=>{var P=ui();return de(P,()=>a("makeMediaPropertiesDialog.alignment")),P})(),(()=>{var P=Za();return de(P,Dt(Fs,{get each(){return F()},children:ie=>(()=>{var se=u1();return se.$$click=()=>f(ie.align),se.disabled=!i,de(se,()=>ie.label),ln(()=>pi(se,`QpBtn secondary ${ie.align!==u()?"outlined":""}`)),se})()})),P})(),(()=>{var P=ui();return de(P,()=>a("makeMediaPropertiesDialog.options")),P})(),(()=>{var P=o1(),ie=P.firstChild,se=ie.firstChild,m=se.firstChild,L=ie.nextSibling;return m.addEventListener("change",()=>{y(!p())}),de(se,()=>a("makeMediaPropertiesDialog.link"),null),de(se,Dt(Hs,{get when(){return p()},get children(){var v=s1();return v.addEventListener("change",C=>{N(C.currentTarget.value)}),ln(()=>v.value=_()),v}}),null),de(L,Dt(Hs,{get when(){return!p()},get children(){var v=a1(),C=v.firstChild;return C.addEventListener("change",()=>{h(!g())}),de(v,()=>a("makeMediaPropertiesDialog.enableZoom"),null),ln(()=>C.checked=g()),v}})),ln(()=>m.checked=p()),P})(),(()=>{var P=ui();return de(P,()=>a("makeMediaPropertiesDialog.mediaProperties")),P})(),(()=>{var P=l1(),ie=P.firstChild,se=ie.firstChild,m=se.firstChild,L=se.nextSibling,v=ie.nextSibling,C=v.firstChild,R=C.firstChild,O=C.nextSibling;return de(se,()=>a("makeMediaPropertiesDialog.caption"),m),de(L,(()=>{var D=Bi(()=>!!T());return()=>D()?T()?.source.attachedData?.[e()]?.caption??"-":Dt(ps,{})})()),de(C,()=>a("makeMediaPropertiesDialog.pixelRatio"),R),de(O,(()=>{var D=Bi(()=>!!T());return()=>D()?Bi(()=>!!T()?.source.pixelRatio)()?`${T()?.source.pixelRatio}×`:a("auto"):Dt(ps,{})})()),P})()],footer:V});return await ce.open()}Ti(["click"]);var h1=be("<label class=ObfuscatorDialog-label><input type=text class=ml-2>"),f1=be('<label class="ObfuscatorDialog-label mt-4"><input type=checkbox name=asALink class=mr-2>'),g1=be('<button class="QpBtn danger outlined"type=button>'),p1=be("<button class=QpBtn type=button>");async function m1({service:n,language:e,value:t}){const{t:r}=bn(e),[i,s]=ft(t.asALink),[a,l]=ft(t.content),c=f=>{l(f),dl(f)?s(!0):s(!1)},u=n.createModalDialog({header:r("openObfuscatorDialog.obfuscator"),content:[(()=>{var f=h1(),g=f.firstChild;return de(f,()=>r("openObfuscatorDialog.content"),g),g.$$input=h=>c(h.currentTarget.value),ln(()=>g.value=a()),f})(),(()=>{var f=f1(),g=f.firstChild;return g.addEventListener("change",()=>s(!i())),de(f,()=>r("openObfuscatorDialog.asALink"),null),ln(()=>g.checked=i()),f})()],footer:[(()=>{var f=g1();return f.$$click=()=>u.close({action:"remove"}),de(f,()=>r("openObfuscatorDialog.doNotObfuscate")),f})(),(()=>{var f=p1();return f.$$click=()=>u.close({action:"update",content:a(),asALink:i()?qs(a())?"mailto":"tel":"raw"}),de(f,()=>r("done")),f})()]});return await u.open()}Ti(["input","click"]);var b1=be('<button class="QpBtn outlined danger"type=button>'),E1=be('<button class="QpBtn secondary"type=button>'),y1=be("<button class=QpBtn type=button>");async function ml({service:n,language:e,mode:t,value:r,videoPluginHook:i}){if(!i)return;const{t:s}=bn(e),[a,l]=ft(r),{dispose:c,element:u}=i.createComponent(r??{videoId:"",platform:"youtube"},{onChange(g){l(g)},getLanguage:e}),f=n.createModalDialog({content:u,footer:[(()=>{var g=b1();return g.$$click=()=>{f.close({action:"remove"}),c()},de(g,()=>s("remove")),g})(),(()=>{var g=E1();return g.$$click=()=>{f.close(),c()},de(g,()=>s("cancel")),g})(),(()=>{var g=y1();return g.$$click=()=>{const h=a();h===null?f.close({action:"remove"}):f.close({action:t,value:h}),c()},de(g,()=>s("validate")),g})()],header:s("videoPlugin.dialog.title")});return await f.open()}Ti(["click"]);async function _1({editor:n,htmlSnippetBtn:e,service:t,language:r}){const i=e.dataset.html,s=await gl({service:t,html:i,mode:"update",language:r});s&&Zr({editor:n,element:e,data:s,insertElementHandler:ol,service:t,language:r})}async function v1({editor:n,internalLinkElement:e,language:t,internalLinkPluginHook:r}){const i=e.dataset.documentId,s=await pl({language:t,value:i,internalLinkPluginHook:r});if(!s)return;const a=A.find(e);if(!a||a instanceof A)throw new Error("missing link blot");if(s.action==="update"){if(!s.value)return;const l=n.getIndex(a);a.deleteAt(0,a.length()),ll({values:s.value,editor:n,index:l})}else s.action==="remove"&&a.deleteAt(0,a.length())}async function N1({editor:n,videoElement:e,language:t,service:r,videoPluginHook:i}){const s=e.dataset.videoId,a=e.dataset.platform??"youtube",l=await ml({service:r,language:t,mode:"update",value:s?{videoId:s,platform:a}:void 0,videoPluginHook:i});l&&Zr({editor:n,element:e,data:{action:l.action,values:l.value},insertElementHandler:cl,service:r,language:t})}async function bl({obfuscatorSpan:n,service:e,language:t,editor:r}){const i=n.innerText,s=n.dataset.asALink?hl(n.dataset.asALink):void 0,a=await m1({service:e,language:t,value:{content:i,asALink:s?s!=="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,i)),a.action==="update"&&(l.remove(),r.insertText(c,a.content??"",{obfuscate:a.asALink??"raw"}))}async function T1({service:n,language:e,element:t,editor:r}){const i=Bb(t),{align:s,resizeRule:a}=$b(t);if(!i||!a)return;const l={source:void 0},c={mediaId:i,resizeRule:a,align:s,zoomable:t.dataset.zoomable==="1",href:t.dataset.href};let u=await d1({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 A1({quillEditor:n,service:e,language:t,videoPluginHook:r,internalLinkPluginHook:i}){const{themeConf:s}=e;return{insertHtmlSnippetHandler:async()=>{if(!n)return;const g=ms(n);await S1({service:e,editorContent:g,quillEditor:n,language:t})},insertMedia:async g=>{if(!n)return;if(g.kind==="file"){Db(n,{label:g.originalName,url:g.url});return}const h=s.fTextImageResizeRules[0];al({service:e,editor:n,values:{mediaId:g.mediaId,resizeRule:h,align:"center",zoomable:!0},language:t})},insertObfuscateBlotHandler:async()=>{if(n)try{const g=n.getSelection();if(!g||g.length===0)return;await w1({service:e,userSelection:g,quillEditor:n,language:t})}catch(g){e.logger.error("Failed to insert obfuscate:",g)}},insertVideoHandler:async()=>{if(!n)return;const g=ms(n);await El({editorContent:g,quillEditor:n,service:e,language:t,videoPluginHook:r})},insertInternalLinkHandler:async()=>{if(!n)return;const g=ki(n);g!==void 0&&await x1({quillEditor:n,language:t,internalLinkPluginHook:i,index:g})}}}async function w1({service:n,userSelection:e,quillEditor:t,language:r}){const i=t.getText(e.index,e.length),s=Kb(i);t.formatText(e,"obfuscate",s);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===i){await bl({obfuscatorSpan:l,service:n,language:r,editor:t});break}}async function S1({service:n,editorContent:e,quillEditor:t,language:r}){const i=await gl({service:n,language:r,mode:"insert"});i&&Zr({editor:t,element:e,data:i,insertElementHandler:ol,service:n,language:r})}async function El({service:n,editorContent:e,quillEditor:t,language:r,videoPluginHook:i,value:s}){const a=await ml({service:n,language:r,mode:s?"update":"insert",value:s,videoPluginHook:i});!a||a.action==="remove"||Zr({editor:t,element:e,data:{action:a.action,values:a.value},insertElementHandler:cl,service:n,language:r})}async function x1({quillEditor:n,language:e,internalLinkPluginHook:t,value:r,index:i}){const s=await pl({language:e,value:r,internalLinkPluginHook:t});!s||s.action==="remove"||!s.value||ll({editor:n,values:s.value,index:i})}function Zr({service:n,editor:e,element:t,data:{values:r,action:i,updateOptions:s},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(i==="insert"){if(!r)return;a({editor:e,values:r,service:n,index:u,language:l})}else if(i==="update"){if(!r)return;a({editor:e,values:r,service:n,index:u,language:l}),f.retain(u+1),f.delete(s?.textToReplaceLength??1)}else i==="remove"&&(f.retain(u),f.delete(1));e.updateContents(f)}}function O1(){const n={videoPlugin:void 0,internalLinkPlugin:void 0};return{get videoPlugin(){return n.videoPlugin},get internalLinkPlugin(){return n.internalLinkPlugin},service:{registerVideoPlugin(e){if(n.videoPlugin)throw new Error("Video plugin already registered");n.videoPlugin=e},registerInternalLinkPlugin(e){if(n.internalLinkPlugin)throw new Error("Internal link plugin already registered");n.internalLinkPlugin=e}}}}var Qi,Wa;function L1(){if(Wa)return Qi;Wa=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 i="</span>",s=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(!s(x))return;const q=a(x.scope,{prefix:this.classPrefix});this.span(q)}closeNode(x){s(x)&&(this.buffer+=i)}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 V=/\b\B/,ce="[a-zA-Z]\\w*",P="[a-zA-Z_]\\w*",ie="\\b\\d+(\\.\\d+)?",se="(-?)(\\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:ie,relevance:0},ae={scope:"number",begin:se,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:ce,relevance:0},Oe={scope:"title",begin:P,relevance:0},ue={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:se,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:ce,MATCH_NOTHING_RE:V,METHOD_GUARD:ue,NUMBER_MODE:J,NUMBER_RE:ie,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,it=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 G=I.className+" ";G+=I.parentNode?I.parentNode.className:"";const he=K.languageDetectRe.exec(G);if(he){const we=ke(he[1]);return we||(Ft(Le.replace("{}",he[1])),Ft("Falling back to no-highlight mode for this block.",I)),we?he[1]:"no-highlight"}return G.split(/\s+/).find(we=>re(we)||ke(we))}function Re(I,G,he){let we="",Me="";typeof G=="object"?(we=I,he=G.ignoreIllegals,Me=G.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=G),he===void 0&&(he=!0);const Je={code:we,language:Me};_t("before:highlight",Je);const ut=Je.result?Je.result:yt(Je.language,Je.code,he);return ut.code=Je.code,_t("after:highlight",ut),ut}function yt(I,G,he,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=st.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=st.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=st.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(st.classNameAliases[U.scope]||U.scope),U.beginScope&&(U.beginScope._wrap?(We(ge,st.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=G.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!==st;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+=G.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"&&!he){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 st=ke(I);if(!st)throw Ke(Le.replace("{}",I)),new Error('Unknown language: "'+I+'"');const jt=hr(st);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(st.__emitTokens)st.__emitTokens(G,Pe);else{for(te.matcher.considerAll();;){xn++,On?On=!1:te.matcher.considerAll(),te.matcher.lastIndex=vt;const U=te.matcher.exec(G);if(!U)break;const H=G.substring(vt,U.index),oe=Yn(H,U);vt=U.index+oe}Yn(G.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(G),illegal:!0,relevance:0,_illegalBy:{message:U.message,index:vt,context:G.slice(vt-100,vt+100),mode:U.mode,resultSoFar:et},_emitter:Pe};if(Ae)return{language:I,value:Et(G),illegal:!1,relevance:0,errorRaised:U,_emitter:Pe,_top:te};throw U}}function qe(I){const G={value:Et(I),illegal:!1,relevance:0,_top:j,_emitter:new K.__emitter(K)};return G._emitter.addText(I),G}function Tn(I,G){G=G||K.languages||Object.keys(x);const he=qe(I),we=G.filter(ke).filter(Zn).map(Ue=>yt(Ue,I,!1));we.unshift(he);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,G,he){const we=G&&q[G]||he;I.classList.add("hljs"),I.classList.add(`language-${we}`)}function An(I){let G=null;const he=$e(I);if(re(he))return;if(_t("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&&(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);G=I;const we=G.textContent,Me=he?Re(we,{language:he,ignoreIllegals:!0}):Tn(we);I.innerHTML=Me.value,I.dataset.highlighted="yes",fr(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}),_t("after:highlightElement",{el:I,result:Me,text:we})}function gr(I){K=it(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,G){let he=null;try{he=G(b)}catch(we){if(Ke("Language definition for '{}' could not be registered.".replace("{}",I)),Ae)Ke(we);else throw we;he=j}he.name||(he.name=I),x[I]=he,he.rawDefinition=G.bind(null,b),he.aliases&&Vn(he.aliases,{languageName:I})}function br(I){delete x[I];for(const G of Object.keys(q))q[G]===I&&delete q[G]}function Er(){return Object.keys(x)}function ke(I){return I=(I||"").toLowerCase(),x[I]||x[q[I]]}function Vn(I,{languageName:G}){typeof I=="string"&&(I=[I]),I.forEach(he=>{q[he.toLowerCase()]=G})}function Zn(I){const G=ke(I);return G&&!G.disableAutodetect}function yr(I){I["before:highlightBlock"]&&!I["before:highlightElement"]&&(I["before:highlightElement"]=G=>{I["before:highlightBlock"](Object.assign({block:G.el},G))}),I["after:highlightBlock"]&&!I["after:highlightElement"]&&(I["after:highlightElement"]=G=>{I["after:highlightBlock"](Object.assign({block:G.el},G))})}function _r(I){yr(I),ne.push(I)}function vr(I){const G=ne.indexOf(I);G!==-1&&ne.splice(G,1)}function _t(I,G){const he=I;ne.forEach(function(we){we[he]&&we[he](G)})}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:it,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({}),Qi=ct,ct.HighlightJS=ct,ct.default=ct,Qi}var C1=L1();const ze=Ss(C1);function R1(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 i={className:"subst",begin:/\$\(/,end:/\)/,contains:[n.BACKSLASH_ESCAPE]},s=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,i]};i.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,s,a,T,l,c,u,f,t]}}function I1(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="("+r+"|"+e.optional(i)+"[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(i)+n.IDENT_RE,relevance:0},p=e.optional(i)+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 k1(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+e.optional(i)+"[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(i)+n.IDENT_RE,relevance:0},p=e.optional(i)+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*\(/))},V=[B,g,l,t,n.C_BLOCK_COMMENT_MODE,f,u],ce={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:F,contains:V.concat([{begin:/\(/,end:/\)/,keywords:F,contains:V.concat(["self"]),relevance:0}]),relevance:0},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(ce,P,B,V,[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 M1(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"],i=["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"],s=["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:i.concat(s),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 D1=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_-]*/}}),B1=["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"],$1=["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"],q1=[...B1,...$1],P1=["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(),U1=["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(),F1=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),H1=["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 z1(n){const e=n.regex,t=D1(n),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",s=/@-?\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:":("+U1.join("|")+")"},{begin:":(:)?("+F1.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+H1.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:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:P1.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+q1.join("|")+")\\b"}]}}var nr="[0-9](_*[0-9])*",di=`\\.(${nr})`,hi="[0-9a-fA-F](_*[0-9a-fA-F])*",Ya={className:"number",variants:[{begin:`(\\b(${nr})((${di})|\\.)?|(${di}))[eE][+-]?(${nr})[fFdD]?\\b`},{begin:`\\b(${nr})((${di})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${di})[fFdD]?\\b`},{begin:`\\b(${nr})[fFdD]\\b`},{begin:`\\b0[xX]((${hi})\\.?|(${hi})?\\.(${hi}))[pP][+-]?(${nr})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${hi})[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 j1(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,Ya,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},Ya,u]}}const Qa="[A-Za-z$_][0-9A-Za-z$_]*",K1=["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"],G1=["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"],V1=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Z1=[].concat(Nl,_l,vl);function W1(n){const e=n.regex,t=(M,{after:z})=>{const $="</"+M[0].slice(1);return M.input.indexOf($,z)!==-1},r=Qa,i={begin:"<>",end:"</>"},s=/<[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:Qa,keyword:K1,literal:G1,built_in:Z1,"variable.language":V1},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)}]),V={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B},ce={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]}},ie={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},se={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[V],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:/\(\)/},V]},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:[V]};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}),ie,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:i.begin,end:i.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},se,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[V,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},C,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[V]},v,m,ce,R,{match:/\$[(.]/}]}}function Y1(n){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},t={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[e,t,n.QUOTE_STRING_MODE,i,n.C_NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Q1(n){const e=n.regex,t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={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}]},s={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,s,u,f,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,r,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function X1(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),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,t),s=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+$/,"")),V={variants:[{match:[/new/,e.concat(p,"+"),e.concat("(?!",B(S).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},ce=e.concat(r,"\\b(?!\\()"),P={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),ce],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),ce],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},ie={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},se={relevance:0,begin:/\(/,end:/\)/,keywords:F,contains:[ie,a,P,n.C_BLOCK_COMMENT_MODE,y,_,V]},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:[se]};se.contains.push(m);const L=[ie,P,n.C_BLOCK_COMMENT_MODE,y,_,V],v={begin:e.concat(/#\[\s*\\?/,e.either(i,s)),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:i},{match:s}]}]};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"}},V,{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 J1(n){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function e0(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 t0(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]+/),i=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}]},V=[g,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:a},{relevance:0,match:[i,/\.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=V,_.contains=V;const se=[{begin:/^\s*=>/,starts:{end:"$",contains:V}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:V}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[n.SHEBANG({binary:"ruby"})].concat(se).concat(u).concat(V)}}function n0(n){const e=n.regex,t=/(r#)?/,r=e.concat(t,n.UNDERSCORE_IDENT_RE),i=e.concat(t,n.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,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:"->"},s]}}function r0(n){const e=n.regex,t=n.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["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(V=>V.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:S(h),relevance:0};function F(B,{exceptions:V,when:ce}={}){const P=ce;return V=V||[],B.map(ie=>ie.match(/\|\d+$/)||V.includes(ie)?ie:P(ie)?`${ie}|0`:ie)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:F(y,{when:B=>B.length<3}),literal:s,type:l,built_in:g},contains:[{scope:"type",match:S(a)},k,T,_,r,i,n.C_NUMBER_MODE,n.C_BLOCK_COMMENT_MODE,t,N]}}const Ni="[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 i0(n){const e=n.regex,t=(M,{after:z})=>{const $="</"+M[0].slice(1);return M.input.indexOf($,z)!==-1},r=Ni,i={begin:"<>",end:"</>"},s=/<[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:Ni,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)}]),V={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B},ce={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]}},ie={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},se={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[V],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:/\(\)/},V]},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:[V]};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}),ie,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:i.begin,end:i.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},se,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[V,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},C,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[V]},v,m,ce,R,{match:/\$[(.]/}]}}function s0(n){const e=n.regex,t=i0(n),r=Ni,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,n.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},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:Ni,keyword:Tl.concat(c),literal:Al,built_in:Ll.concat(i),"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,s,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 a0(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,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=n.inherit(s,{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:[i]},{begin:/'/,end:/'/,contains:[i]},{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:[s,c,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,a,c,l]}]}]},n.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{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 o0(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]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={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,i]},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,_,s,a],T=[...N];return T.pop(),T.push(l),p.contains=T,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:N}}ze.registerLanguage("bash",R1);ze.registerLanguage("c",I1);ze.registerLanguage("cpp",k1);ze.registerLanguage("cs",M1);ze.registerLanguage("css",z1);ze.registerLanguage("java",j1);ze.registerLanguage("javascript",W1);ze.registerLanguage("json",Y1);ze.registerLanguage("markdown",Q1);ze.registerLanguage("plain",J1);ze.registerLanguage("php",X1);ze.registerLanguage("python",e0);ze.registerLanguage("sql",r0);ze.registerLanguage("typescript",s0);ze.registerLanguage("ruby",t0);ze.registerLanguage("rust",n0);ze.registerLanguage("xml",a0);ze.registerLanguage("yaml",o0);const l0=[{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 c0=be("<button type=button><span class=QpTooltip-text>");function fi({children:n,btnClass:e,tooltipText:t,btnText:r}){return(()=>{var i=c0(),s=i.firstChild;return pi(i,`QpTooltip ${e}`),de(i,n,s),de(i,r,s),de(s,t),i})()}var u0=be("<button type=button class=ql-code>"),d0=be('<button type=button class=ql-code-block style="border:1px dotted #999">'),h0=be('<span class="pi pi-hashtag">'),f0=be('<span class="pi pi-pencil">'),g0=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>"),p0=be('<span class="pi pi-youtube">'),m0=be('<span class="pi pi-link">');function b0({language:n,configuration:e,videoPluginHook:t,internalLinkPluginHook:r}){const{t:i}=bn(n),s=[u0(),d0()];return(()=>{var a=g0(),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 de(a,()=>e?.code&&s,_),de(a,Dt(fi,{btnClass:"ql-html-snippet",get tooltipText(){return i("CustomToolbar.insertHtmlSnippetMessage")},get children(){return h0()}}),T),de(a,Dt(fi,{btnClass:"ql-obfuscate",get tooltipText(){return i("CustomToolbar.obfuscate")},get children(){return f0()}}),T),de(a,t&&Dt(fi,{btnClass:"ql-platform-video",get tooltipText(){return i("videoPlugin.insertVideo")},get children(){return p0()}}),T),de(a,r&&Dt(fi,{btnClass:"ql-internal-link",get tooltipText(){return i("internalLinkPlugin.insertLink")},get children(){return m0()}}),T),a})()}var E0=be("<div>"),y0=be("<div class=QuillEditor>");function _0({language:n,setValue:e,value:t,service:r,insertMedia:i,videoPluginHook:s,internalLinkPluginHook:a}){const{t:l}=bn(n),c=r.configuration,f=r.fieldType.adminUi?.editorRows??26,g=b0({language:n,configuration:c,videoPluginHook:s,internalLinkPluginHook:a});let h=!1;const p=(()=>{var T=E0();return Il(T,"height",`calc(${f}rem + 24px)`),T})();async function y(T,S){if(!r.uploadMedia)return;const k=S.toBlob(),F=new File([k],`${l("image")}-${Date.now()}.${T.split("/")[1]}`,{type:T}),B=await r.uploadMedia(F);B&&await i(B)}const _=new A(p,{modules:{toolbar:g,syntax:c.code?{hljs:ze,languages:l0,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 V=B.insert,ce=s?.recognizeUrl(V);if(!ce)return;const P=ms(_);await El({editorContent:P,quillEditor:_,service:r,language:n,videoPluginHook:s,value:ce})}});const F={delta:_.getContents(),html:_.getSemanticHTML()};e(F.delta)});const N=t();return _.setContents(N??new Z),_.history.clear(),h=!0,{element:(()=>{var T=y0();return de(T,g,null),de(T,p,null),T})(),quill:_}}const P0={create:N0,init:v0},Vt=O1();function v0(n){const e=`${n.pluginBaseUrl}/admin-ui-plugin.css`,t=document.createElement("link");t.rel="stylesheet",t.href=e,document.head.appendChild(t),n.registerHook("htmlEditorServiceProvider",()=>Vt.service)}function N0(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[i,s]=ft(t),[a,l]=ft(n.language);Yb({service:n,videoPluginHook:Vt.videoPlugin,internalLinkPluginHook:Vt.internalLinkPlugin});let c;const{element:u,quill:f}=_0({language:a,value:i,setValue:N=>{const T=i();s(N),T0(N,T)||n.setModifiedValue({j:N})},service:n,videoPluginHook:Vt.videoPlugin,internalLinkPluginHook:Vt.internalLinkPlugin,insertMedia:async N=>await(c?.(N))}),g=A1({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("platform-video",g.insertVideoHandler),h.addHandler("internal-link",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 T1({service:n,editor:T,element:S,language:a}),S.tagName==="BUTTON"&&S.classList.contains("HtmlSnippet")&&await _1({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("PlatformVideo")&&await N1({editor:T,videoElement:S,language:a,service:n,videoPluginHook:Vt.videoPlugin}),S.tagName==="SPAN"&&S.classList.contains("InternalLinkPlugin")&&await v1({editor:T,internalLinkElement:S,language:a,internalLinkPluginHook:Vt.internalLinkPlugin})};return{element:u,setValue:N=>s(Xa(N)),setLanguage:l,getValue:()=>({j:i}),dispose:r,insertMedia:N=>c?.(N)}})}function T0(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{P0 as default};
|