@jackuait/blok 0.1.1 → 0.2.1-beta.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.
package/dist/blok.umd.js CHANGED
@@ -1,5 +1,4 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".ce-hint--align-start{text-align:left}.ce-hint--align-center{text-align:center}.ce-hint__description{opacity:.6;margin-top:3px}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- (function(xt,pe){typeof exports=="object"&&typeof module<"u"?module.exports=pe():typeof define=="function"&&define.amd?define(pe):(xt=typeof globalThis<"u"?globalThis:xt||self,xt.Blok=pe())})(this,function(){"use strict";function xt(n,e){for(var t=0;t<e.length;t++){const o=e[t];if(typeof o!="string"&&!Array.isArray(o)){for(const r in o)if(r!=="default"&&!(r in n)){const i=Object.getOwnPropertyDescriptor(o,r);i&&Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:()=>o[r]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}var pe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function li(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Tl(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function o(){if(this instanceof o){var r=[null];r.push.apply(r,arguments);var i=Function.bind.apply(e,r);return new i}return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(o){var r=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:function(){return n[o]}})}),t}function oo(){}Object.assign(oo,{default:oo,register:oo,revert:function(){},__esModule:!0}),typeof Element.prototype.scrollIntoViewIfNeeded>"u"&&(Element.prototype.scrollIntoViewIfNeeded=function(n){const e=n??!0,t=this.parentElement;if(!t)return;const o=window.getComputedStyle(t,null),r=parseInt(o.getPropertyValue("border-top-width")),i=parseInt(o.getPropertyValue("border-left-width")),s=this.offsetTop-t.offsetTop<t.scrollTop,a=this.offsetTop-t.offsetTop+this.clientHeight-r>t.scrollTop+t.clientHeight,l=this.offsetLeft-t.offsetLeft<t.scrollLeft,c=this.offsetLeft-t.offsetLeft+this.clientWidth-i>t.scrollLeft+t.clientWidth,d=s&&!a;(s||a)&&e&&(t.scrollTop=this.offsetTop-t.offsetTop-t.clientHeight/2-r+this.clientHeight/2),(l||c)&&e&&(t.scrollLeft=this.offsetLeft-t.offsetLeft-t.clientWidth/2-i+this.clientWidth/2),(s||a||l||c)&&!e&&this.scrollIntoView(d)});const kl=globalThis.setTimeout.bind(globalThis),wl=globalThis.clearTimeout.bind(globalThis),Qt=new Map,Cl=n=>{const e=Number(n);return Number.isFinite(e)&&e>0?e:Date.now()};typeof window.requestIdleCallback>"u"&&(window.requestIdleCallback=function(n){const e=Date.now(),t={},o=kl(()=>{const i=t.value;typeof i=="number"&&Qt.delete(i),n({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-e))}})},1),r=Cl(o);return t.value=r,Qt.set(r,o),r}),typeof window.cancelIdleCallback>"u"&&(window.cancelIdleCallback=function(n){const e=Qt.get(n);e!==void 0&&(Qt.delete(n),wl(e)),globalThis.clearTimeout(n)});let Sl=(n=21)=>crypto.getRandomValues(new Uint8Array(n)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");var xl="Expected a function";function Bl(n,e,t){if(typeof n!="function")throw new TypeError(xl);return setTimeout(function(){n.apply(void 0,t)},e)}var _l=Bl;function Al(n){return n}var ci=Al;function Il(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)}var Ol=Il,Nl=Ol,di=Math.max;function Rl(n,e,t){return e=di(e===void 0?n.length-1:e,0),function(){for(var o=arguments,r=-1,i=di(o.length-e,0),s=Array(i);++r<i;)s[r]=o[e+r];r=-1;for(var a=Array(e+1);++r<e;)a[r]=o[r];return a[e]=t(s),Nl(n,this,a)}}var Ll=Rl;function Pl(n){return function(){return n}}var Ml=Pl,Dl=typeof pe=="object"&&pe&&pe.Object===Object&&pe,ui=Dl,$l=ui,Fl=typeof self=="object"&&self&&self.Object===Object&&self,Hl=$l||Fl||Function("return this")(),ke=Hl,jl=ke,zl=jl.Symbol,en=zl,hi=en,fi=Object.prototype,Wl=fi.hasOwnProperty,Ul=fi.toString,Bt=hi?hi.toStringTag:void 0;function Kl(n){var e=Wl.call(n,Bt),t=n[Bt];try{n[Bt]=void 0;var o=!0}catch{}var r=Ul.call(n);return o&&(e?n[Bt]=t:delete n[Bt]),r}var Gl=Kl,Yl=Object.prototype,Xl=Yl.toString;function Vl(n){return Xl.call(n)}var ql=Vl,pi=en,Zl=Gl,Jl=ql,Ql="[object Null]",ec="[object Undefined]",gi=pi?pi.toStringTag:void 0;function tc(n){return n==null?n===void 0?ec:Ql:gi&&gi in Object(n)?Zl(n):Jl(n)}var Re=tc;function nc(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var Be=nc,oc=Re,rc=Be,ic="[object AsyncFunction]",sc="[object Function]",ac="[object GeneratorFunction]",lc="[object Proxy]";function cc(n){if(!rc(n))return!1;var e=oc(n);return e==sc||e==ac||e==ic||e==lc}var tn=cc,dc=ke,uc=dc["__core-js_shared__"],hc=uc,ro=hc,mi=function(){var n=/[^.]+$/.exec(ro&&ro.keys&&ro.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function fc(n){return!!mi&&mi in n}var pc=fc,gc=Function.prototype,mc=gc.toString;function vc(n){if(n!=null){try{return mc.call(n)}catch{}try{return n+""}catch{}}return""}var vi=vc,bc=tn,yc=pc,Ec=Be,Tc=vi,kc=/[\\^$.*+?()[\]{}|]/g,wc=/^\[object .+?Constructor\]$/,Cc=Function.prototype,Sc=Object.prototype,xc=Cc.toString,Bc=Sc.hasOwnProperty,_c=RegExp("^"+xc.call(Bc).replace(kc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ac(n){if(!Ec(n)||yc(n))return!1;var e=bc(n)?_c:wc;return e.test(Tc(n))}var Ic=Ac;function Oc(n,e){return n==null?void 0:n[e]}var Nc=Oc,Rc=Ic,Lc=Nc;function Pc(n,e){var t=Lc(n,e);return Rc(t)?t:void 0}var Ge=Pc,Mc=Ge,Dc=function(){try{var n=Mc(Object,"defineProperty");return n({},"",{}),n}catch{}}(),bi=Dc,$c=Ml,yi=bi,Fc=ci,Hc=yi?function(n,e){return yi(n,"toString",{configurable:!0,enumerable:!1,value:$c(e),writable:!0})}:Fc,jc=Hc,zc=800,Wc=16,Uc=Date.now;function Kc(n){var e=0,t=0;return function(){var o=Uc(),r=Wc-(o-t);if(t=o,r>0){if(++e>=zc)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}var Gc=Kc,Yc=jc,Xc=Gc,Vc=Xc(Yc),qc=Vc,Zc=ci,Jc=Ll,Qc=qc;function ed(n,e){return Qc(Jc(n,e,Zc),n+"")}var Ei=ed,td=/\s/;function nd(n){for(var e=n.length;e--&&td.test(n.charAt(e)););return e}var od=nd,rd=od,id=/^\s+/;function sd(n){return n&&n.slice(0,rd(n)+1).replace(id,"")}var ad=sd;function ld(n){return n!=null&&typeof n=="object"}var _e=ld,cd=Re,dd=_e,ud="[object Symbol]";function hd(n){return typeof n=="symbol"||dd(n)&&cd(n)==ud}var fd=hd,pd=ad,Ti=Be,gd=fd,ki=0/0,md=/^[-+]0x[0-9a-f]+$/i,vd=/^0b[01]+$/i,bd=/^0o[0-7]+$/i,yd=parseInt;function Ed(n){if(typeof n=="number")return n;if(gd(n))return ki;if(Ti(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Ti(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=pd(n);var t=vd.test(n);return t||bd.test(n)?yd(n.slice(2),t?2:8):md.test(n)?ki:+n}var wi=Ed,Td=_l,kd=Ei,wd=wi,Cd=kd(function(n,e,t){return Td(n,wd(e)||0,t)}),Sd=Cd,xd=Re,Bd=_e,_d="[object Boolean]";function Ad(n){return n===!0||n===!1||Bd(n)&&xd(n)==_d}var Id=Ad,Od=Object.prototype;function Nd(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||Od;return n===t}var nn=Nd;function Rd(n,e){return function(t){return n(e(t))}}var Ci=Rd,Ld=Ci,Pd=Ld(Object.keys,Object),Md=Pd,Dd=nn,$d=Md,Fd=Object.prototype,Hd=Fd.hasOwnProperty;function jd(n){if(!Dd(n))return $d(n);var e=[];for(var t in Object(n))Hd.call(n,t)&&t!="constructor"&&e.push(t);return e}var Si=jd,zd=Ge,Wd=ke,Ud=zd(Wd,"DataView"),Kd=Ud,Gd=Ge,Yd=ke,Xd=Gd(Yd,"Map"),io=Xd,Vd=Ge,qd=ke,Zd=Vd(qd,"Promise"),Jd=Zd,Qd=Ge,eu=ke,tu=Qd(eu,"Set"),nu=tu,ou=Ge,ru=ke,iu=ou(ru,"WeakMap"),su=iu,so=Kd,ao=io,lo=Jd,co=nu,uo=su,xi=Re,rt=vi,Bi="[object Map]",au="[object Object]",_i="[object Promise]",Ai="[object Set]",Ii="[object WeakMap]",Oi="[object DataView]",lu=rt(so),cu=rt(ao),du=rt(lo),uu=rt(co),hu=rt(uo),Ye=xi;(so&&Ye(new so(new ArrayBuffer(1)))!=Oi||ao&&Ye(new ao)!=Bi||lo&&Ye(lo.resolve())!=_i||co&&Ye(new co)!=Ai||uo&&Ye(new uo)!=Ii)&&(Ye=function(n){var e=xi(n),t=e==au?n.constructor:void 0,o=t?rt(t):"";if(o)switch(o){case lu:return Oi;case cu:return Bi;case du:return _i;case uu:return Ai;case hu:return Ii}return e});var ho=Ye,fu=Re,pu=_e,gu="[object Arguments]";function mu(n){return pu(n)&&fu(n)==gu}var vu=mu,Ni=vu,bu=_e,Ri=Object.prototype,yu=Ri.hasOwnProperty,Eu=Ri.propertyIsEnumerable,Tu=Ni(function(){return arguments}())?Ni:function(n){return bu(n)&&yu.call(n,"callee")&&!Eu.call(n,"callee")},fo=Tu,ku=Array.isArray,it=ku,wu=9007199254740991;function Cu(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=wu}var Li=Cu,Su=tn,xu=Li;function Bu(n){return n!=null&&xu(n.length)&&!Su(n)}var st=Bu,Xe={},_u={get exports(){return Xe},set exports(n){Xe=n}};function Au(){return!1}var Iu=Au;(function(n,e){var t=ke,o=Iu,r=e&&!e.nodeType&&e,i=r&&!0&&n&&!n.nodeType&&n,s=i&&i.exports===r,a=s?t.Buffer:void 0,l=a?a.isBuffer:void 0,c=l||o;n.exports=c})(_u,Xe);var Ou=Re,Nu=Li,Ru=_e,Lu="[object Arguments]",Pu="[object Array]",Mu="[object Boolean]",Du="[object Date]",$u="[object Error]",Fu="[object Function]",Hu="[object Map]",ju="[object Number]",zu="[object Object]",Wu="[object RegExp]",Uu="[object Set]",Ku="[object String]",Gu="[object WeakMap]",Yu="[object ArrayBuffer]",Xu="[object DataView]",Vu="[object Float32Array]",qu="[object Float64Array]",Zu="[object Int8Array]",Ju="[object Int16Array]",Qu="[object Int32Array]",eh="[object Uint8Array]",th="[object Uint8ClampedArray]",nh="[object Uint16Array]",oh="[object Uint32Array]",U={};U[Vu]=U[qu]=U[Zu]=U[Ju]=U[Qu]=U[eh]=U[th]=U[nh]=U[oh]=!0,U[Lu]=U[Pu]=U[Yu]=U[Mu]=U[Xu]=U[Du]=U[$u]=U[Fu]=U[Hu]=U[ju]=U[zu]=U[Wu]=U[Uu]=U[Ku]=U[Gu]=!1;function rh(n){return Ru(n)&&Nu(n.length)&&!!U[Ou(n)]}var ih=rh;function sh(n){return function(e){return n(e)}}var ah=sh,on={},lh={get exports(){return on},set exports(n){on=n}};(function(n,e){var t=ui,o=e&&!e.nodeType&&e,r=o&&!0&&n&&!n.nodeType&&n,i=r&&r.exports===o,s=i&&t.process,a=function(){try{var l=r&&r.require&&r.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();n.exports=a})(lh,on);var ch=ih,dh=ah,Pi=on,Mi=Pi&&Pi.isTypedArray,uh=Mi?dh(Mi):ch,rn=uh,hh=Si,fh=ho,ph=fo,gh=it,mh=st,vh=Xe,bh=nn,yh=rn,Eh="[object Map]",Th="[object Set]",kh=Object.prototype,wh=kh.hasOwnProperty;function Ch(n){if(n==null)return!0;if(mh(n)&&(gh(n)||typeof n=="string"||typeof n.splice=="function"||vh(n)||yh(n)||ph(n)))return!n.length;var e=fh(n);if(e==Eh||e==Th)return!n.size;if(bh(n))return!hh(n).length;for(var t in n)if(wh.call(n,t))return!1;return!0}var Sh=Ch;function xh(){this.__data__=[],this.size=0}var Bh=xh;function _h(n,e){return n===e||n!==n&&e!==e}var _t=_h,Ah=_t;function Ih(n,e){for(var t=n.length;t--;)if(Ah(n[t][0],e))return t;return-1}var sn=Ih,Oh=sn,Nh=Array.prototype,Rh=Nh.splice;function Lh(n){var e=this.__data__,t=Oh(e,n);if(t<0)return!1;var o=e.length-1;return t==o?e.pop():Rh.call(e,t,1),--this.size,!0}var Ph=Lh,Mh=sn;function Dh(n){var e=this.__data__,t=Mh(e,n);return t<0?void 0:e[t][1]}var $h=Dh,Fh=sn;function Hh(n){return Fh(this.__data__,n)>-1}var jh=Hh,zh=sn;function Wh(n,e){var t=this.__data__,o=zh(t,n);return o<0?(++this.size,t.push([n,e])):t[o][1]=e,this}var Uh=Wh,Kh=Bh,Gh=Ph,Yh=$h,Xh=jh,Vh=Uh;function at(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var o=n[e];this.set(o[0],o[1])}}at.prototype.clear=Kh,at.prototype.delete=Gh,at.prototype.get=Yh,at.prototype.has=Xh,at.prototype.set=Vh;var an=at,qh=an;function Zh(){this.__data__=new qh,this.size=0}var Jh=Zh;function Qh(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}var ef=Qh;function tf(n){return this.__data__.get(n)}var nf=tf;function of(n){return this.__data__.has(n)}var rf=of,sf=Ge,af=sf(Object,"create"),ln=af,Di=ln;function lf(){this.__data__=Di?Di(null):{},this.size=0}var cf=lf;function df(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var uf=df,hf=ln,ff="__lodash_hash_undefined__",pf=Object.prototype,gf=pf.hasOwnProperty;function mf(n){var e=this.__data__;if(hf){var t=e[n];return t===ff?void 0:t}return gf.call(e,n)?e[n]:void 0}var vf=mf,bf=ln,yf=Object.prototype,Ef=yf.hasOwnProperty;function Tf(n){var e=this.__data__;return bf?e[n]!==void 0:Ef.call(e,n)}var kf=Tf,wf=ln,Cf="__lodash_hash_undefined__";function Sf(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=wf&&e===void 0?Cf:e,this}var xf=Sf,Bf=cf,_f=uf,Af=vf,If=kf,Of=xf;function lt(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var o=n[e];this.set(o[0],o[1])}}lt.prototype.clear=Bf,lt.prototype.delete=_f,lt.prototype.get=Af,lt.prototype.has=If,lt.prototype.set=Of;var Nf=lt,$i=Nf,Rf=an,Lf=io;function Pf(){this.size=0,this.__data__={hash:new $i,map:new(Lf||Rf),string:new $i}}var Mf=Pf;function Df(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}var $f=Df,Ff=$f;function Hf(n,e){var t=n.__data__;return Ff(e)?t[typeof e=="string"?"string":"hash"]:t.map}var cn=Hf,jf=cn;function zf(n){var e=jf(this,n).delete(n);return this.size-=e?1:0,e}var Wf=zf,Uf=cn;function Kf(n){return Uf(this,n).get(n)}var Gf=Kf,Yf=cn;function Xf(n){return Yf(this,n).has(n)}var Vf=Xf,qf=cn;function Zf(n,e){var t=qf(this,n),o=t.size;return t.set(n,e),this.size+=t.size==o?0:1,this}var Jf=Zf,Qf=Mf,ep=Wf,tp=Gf,np=Vf,op=Jf;function ct(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var o=n[e];this.set(o[0],o[1])}}ct.prototype.clear=Qf,ct.prototype.delete=ep,ct.prototype.get=tp,ct.prototype.has=np,ct.prototype.set=op;var Fi=ct,rp=an,ip=io,sp=Fi,ap=200;function lp(n,e){var t=this.__data__;if(t instanceof rp){var o=t.__data__;if(!ip||o.length<ap-1)return o.push([n,e]),this.size=++t.size,this;t=this.__data__=new sp(o)}return t.set(n,e),this.size=t.size,this}var cp=lp,dp=an,up=Jh,hp=ef,fp=nf,pp=rf,gp=cp;function dt(n){var e=this.__data__=new dp(n);this.size=e.size}dt.prototype.clear=up,dt.prototype.delete=hp,dt.prototype.get=fp,dt.prototype.has=pp,dt.prototype.set=gp;var Hi=dt,mp="__lodash_hash_undefined__";function vp(n){return this.__data__.set(n,mp),this}var bp=vp;function yp(n){return this.__data__.has(n)}var Ep=yp,Tp=Fi,kp=bp,wp=Ep;function dn(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new Tp;++e<t;)this.add(n[e])}dn.prototype.add=dn.prototype.push=kp,dn.prototype.has=wp;var Cp=dn;function Sp(n,e){for(var t=-1,o=n==null?0:n.length;++t<o;)if(e(n[t],t,n))return!0;return!1}var xp=Sp;function Bp(n,e){return n.has(e)}var _p=Bp,Ap=Cp,Ip=xp,Op=_p,Np=1,Rp=2;function Lp(n,e,t,o,r,i){var s=t&Np,a=n.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=i.get(n),d=i.get(e);if(c&&d)return c==e&&d==n;var u=-1,h=!0,g=t&Rp?new Ap:void 0;for(i.set(n,e),i.set(e,n);++u<a;){var f=n[u],m=e[u];if(o)var b=s?o(m,f,u,e,n,i):o(f,m,u,n,e,i);if(b!==void 0){if(b)continue;h=!1;break}if(g){if(!Ip(e,function(E,k){if(!Op(g,k)&&(f===E||r(f,E,t,o,i)))return g.push(k)})){h=!1;break}}else if(!(f===m||r(f,m,t,o,i))){h=!1;break}}return i.delete(n),i.delete(e),h}var ji=Lp,Pp=ke,Mp=Pp.Uint8Array,zi=Mp;function Dp(n){var e=-1,t=Array(n.size);return n.forEach(function(o,r){t[++e]=[r,o]}),t}var Wi=Dp;function $p(n){var e=-1,t=Array(n.size);return n.forEach(function(o){t[++e]=o}),t}var Ui=$p,Ki=en,Gi=zi,Fp=_t,Hp=ji,jp=Wi,zp=Ui,Wp=1,Up=2,Kp="[object Boolean]",Gp="[object Date]",Yp="[object Error]",Xp="[object Map]",Vp="[object Number]",qp="[object RegExp]",Zp="[object Set]",Jp="[object String]",Qp="[object Symbol]",eg="[object ArrayBuffer]",tg="[object DataView]",Yi=Ki?Ki.prototype:void 0,po=Yi?Yi.valueOf:void 0;function ng(n,e,t,o,r,i,s){switch(t){case tg:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case eg:return!(n.byteLength!=e.byteLength||!i(new Gi(n),new Gi(e)));case Kp:case Gp:case Vp:return Fp(+n,+e);case Yp:return n.name==e.name&&n.message==e.message;case qp:case Jp:return n==e+"";case Xp:var a=jp;case Zp:var l=o&Wp;if(a||(a=zp),n.size!=e.size&&!l)return!1;var c=s.get(n);if(c)return c==e;o|=Up,s.set(n,e);var d=Hp(a(n),a(e),o,r,i,s);return s.delete(n),d;case Qp:if(po)return po.call(n)==po.call(e)}return!1}var og=ng;function rg(n,e){for(var t=-1,o=e.length,r=n.length;++t<o;)n[r+t]=e[t];return n}var ig=rg,sg=ig,ag=it;function lg(n,e,t){var o=e(n);return ag(n)?o:sg(o,t(n))}var cg=lg;function dg(n,e){for(var t=-1,o=n==null?0:n.length,r=0,i=[];++t<o;){var s=n[t];e(s,t,n)&&(i[r++]=s)}return i}var ug=dg;function hg(){return[]}var fg=hg,pg=ug,gg=fg,mg=Object.prototype,vg=mg.propertyIsEnumerable,Xi=Object.getOwnPropertySymbols,bg=Xi?function(n){return n==null?[]:(n=Object(n),pg(Xi(n),function(e){return vg.call(n,e)}))}:gg,yg=bg;function Eg(n,e){for(var t=-1,o=Array(n);++t<n;)o[t]=e(t);return o}var Tg=Eg,kg=9007199254740991,wg=/^(?:0|[1-9]\d*)$/;function Cg(n,e){var t=typeof n;return e=e??kg,!!e&&(t=="number"||t!="symbol"&&wg.test(n))&&n>-1&&n%1==0&&n<e}var Vi=Cg,Sg=Tg,xg=fo,Bg=it,_g=Xe,Ag=Vi,Ig=rn,Og=Object.prototype,Ng=Og.hasOwnProperty;function Rg(n,e){var t=Bg(n),o=!t&&xg(n),r=!t&&!o&&_g(n),i=!t&&!o&&!r&&Ig(n),s=t||o||r||i,a=s?Sg(n.length,String):[],l=a.length;for(var c in n)(e||Ng.call(n,c))&&!(s&&(c=="length"||r&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ag(c,l)))&&a.push(c);return a}var qi=Rg,Lg=qi,Pg=Si,Mg=st;function Dg(n){return Mg(n)?Lg(n):Pg(n)}var Zi=Dg,$g=cg,Fg=yg,Hg=Zi;function jg(n){return $g(n,Hg,Fg)}var zg=jg,Ji=zg,Wg=1,Ug=Object.prototype,Kg=Ug.hasOwnProperty;function Gg(n,e,t,o,r,i){var s=t&Wg,a=Ji(n),l=a.length,c=Ji(e),d=c.length;if(l!=d&&!s)return!1;for(var u=l;u--;){var h=a[u];if(!(s?h in e:Kg.call(e,h)))return!1}var g=i.get(n),f=i.get(e);if(g&&f)return g==e&&f==n;var m=!0;i.set(n,e),i.set(e,n);for(var b=s;++u<l;){h=a[u];var E=n[h],k=e[h];if(o)var N=s?o(k,E,h,e,n,i):o(E,k,h,n,e,i);if(!(N===void 0?E===k||r(E,k,t,o,i):N)){m=!1;break}b||(b=h=="constructor")}if(m&&!b){var x=n.constructor,P=e.constructor;x!=P&&"constructor"in n&&"constructor"in e&&!(typeof x=="function"&&x instanceof x&&typeof P=="function"&&P instanceof P)&&(m=!1)}return i.delete(n),i.delete(e),m}var Yg=Gg,go=Hi,Xg=ji,Vg=og,qg=Yg,Qi=ho,es=it,ts=Xe,Zg=rn,Jg=1,ns="[object Arguments]",os="[object Array]",un="[object Object]",Qg=Object.prototype,rs=Qg.hasOwnProperty;function em(n,e,t,o,r,i){var s=es(n),a=es(e),l=s?os:Qi(n),c=a?os:Qi(e);l=l==ns?un:l,c=c==ns?un:c;var d=l==un,u=c==un,h=l==c;if(h&&ts(n)){if(!ts(e))return!1;s=!0,d=!1}if(h&&!d)return i||(i=new go),s||Zg(n)?Xg(n,e,t,o,r,i):Vg(n,e,l,t,o,r,i);if(!(t&Jg)){var g=d&&rs.call(n,"__wrapped__"),f=u&&rs.call(e,"__wrapped__");if(g||f){var m=g?n.value():n,b=f?e.value():e;return i||(i=new go),r(m,b,t,o,i)}}return h?(i||(i=new go),qg(n,e,t,o,r,i)):!1}var tm=em,nm=tm,is=_e;function ss(n,e,t,o,r){return n===e?!0:n==null||e==null||!is(n)&&!is(e)?n!==n&&e!==e:nm(n,e,t,o,ss,r)}var om=ss,rm=om;function im(n,e){return rm(n,e)}var sm=im,am=Re,lm=_e,cm="[object Number]";function dm(n){return typeof n=="number"||lm(n)&&am(n)==cm}var um=dm,hm=Ci,fm=hm(Object.getPrototypeOf,Object),as=fm,pm=Re,gm=as,mm=_e,vm="[object Object]",bm=Function.prototype,ym=Object.prototype,ls=bm.toString,Em=ym.hasOwnProperty,Tm=ls.call(Object);function km(n){if(!mm(n)||pm(n)!=vm)return!1;var e=gm(n);if(e===null)return!0;var t=Em.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&ls.call(t)==Tm}var cs=km,wm=Re,Cm=it,Sm=_e,xm="[object String]";function Bm(n){return typeof n=="string"||!Cm(n)&&Sm(n)&&wm(n)==xm}var ds=Bm;function _m(n){return n===void 0}var Am=_m,us=bi;function Im(n,e,t){e=="__proto__"&&us?us(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}var mo=Im,Om=mo,Nm=_t;function Rm(n,e,t){(t!==void 0&&!Nm(n[e],t)||t===void 0&&!(e in n))&&Om(n,e,t)}var hs=Rm;function Lm(n){return function(e,t,o){for(var r=-1,i=Object(e),s=o(e),a=s.length;a--;){var l=s[n?a:++r];if(t(i[l],l,i)===!1)break}return e}}var Pm=Lm,Mm=Pm,Dm=Mm(),$m=Dm,hn={},Fm={get exports(){return hn},set exports(n){hn=n}};(function(n,e){var t=ke,o=e&&!e.nodeType&&e,r=o&&!0&&n&&!n.nodeType&&n,i=r&&r.exports===o,s=i?t.Buffer:void 0,a=s?s.allocUnsafe:void 0;function l(c,d){if(d)return c.slice();var u=c.length,h=a?a(u):new c.constructor(u);return c.copy(h),h}n.exports=l})(Fm,hn);var fs=zi;function Hm(n){var e=new n.constructor(n.byteLength);return new fs(e).set(new fs(n)),e}var jm=Hm,zm=jm;function Wm(n,e){var t=e?zm(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var Um=Wm;function Km(n,e){var t=-1,o=n.length;for(e||(e=Array(o));++t<o;)e[t]=n[t];return e}var ps=Km,Gm=Be,gs=Object.create,Ym=function(){function n(){}return function(e){if(!Gm(e))return{};if(gs)return gs(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}(),Xm=Ym,Vm=Xm,qm=as,Zm=nn;function Jm(n){return typeof n.constructor=="function"&&!Zm(n)?Vm(qm(n)):{}}var Qm=Jm,ev=st,tv=_e;function nv(n){return tv(n)&&ev(n)}var ov=nv;function rv(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}var ms=rv,iv=mo,sv=_t,av=Object.prototype,lv=av.hasOwnProperty;function cv(n,e,t){var o=n[e];(!(lv.call(n,e)&&sv(o,t))||t===void 0&&!(e in n))&&iv(n,e,t)}var dv=cv,uv=dv,hv=mo;function fv(n,e,t,o){var r=!t;t||(t={});for(var i=-1,s=e.length;++i<s;){var a=e[i],l=o?o(t[a],n[a],a,t,n):void 0;l===void 0&&(l=n[a]),r?hv(t,a,l):uv(t,a,l)}return t}var pv=fv;function gv(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var mv=gv,vv=Be,bv=nn,yv=mv,Ev=Object.prototype,Tv=Ev.hasOwnProperty;function kv(n){if(!vv(n))return yv(n);var e=bv(n),t=[];for(var o in n)o=="constructor"&&(e||!Tv.call(n,o))||t.push(o);return t}var wv=kv,Cv=qi,Sv=wv,xv=st;function Bv(n){return xv(n)?Cv(n,!0):Sv(n)}var vs=Bv,_v=pv,Av=vs;function Iv(n){return _v(n,Av(n))}var Ov=Iv,bs=hs,Nv=hn,Rv=Um,Lv=ps,Pv=Qm,ys=fo,Es=it,Mv=ov,Dv=Xe,$v=tn,Fv=Be,Hv=cs,jv=rn,Ts=ms,zv=Ov;function Wv(n,e,t,o,r,i,s){var a=Ts(n,t),l=Ts(e,t),c=s.get(l);if(c){bs(n,t,c);return}var d=i?i(a,l,t+"",n,e,s):void 0,u=d===void 0;if(u){var h=Es(l),g=!h&&Dv(l),f=!h&&!g&&jv(l);d=l,h||g||f?Es(a)?d=a:Mv(a)?d=Lv(a):g?(u=!1,d=Nv(l,!0)):f?(u=!1,d=Rv(l,!0)):d=[]:Hv(l)||ys(l)?(d=a,ys(a)?d=zv(a):(!Fv(a)||$v(a))&&(d=Pv(l))):u=!1}u&&(s.set(l,d),r(d,l,o,i,s),s.delete(l)),bs(n,t,d)}var Uv=Wv,Kv=Hi,Gv=hs,Yv=$m,Xv=Uv,Vv=Be,qv=vs,Zv=ms;function ks(n,e,t,o,r){n!==e&&Yv(e,function(i,s){if(r||(r=new Kv),Vv(i))Xv(n,e,s,t,ks,o,r);else{var a=o?o(Zv(n,s),i,s+"",n,e,r):void 0;a===void 0&&(a=i),Gv(n,s,a)}},qv)}var Jv=ks,Qv=_t,eb=st,tb=Vi,nb=Be;function ob(n,e,t){if(!nb(t))return!1;var o=typeof e;return(o=="number"?eb(t)&&tb(e,t.length):o=="string"&&e in t)?Qv(t[e],n):!1}var rb=ob,ib=Ei,sb=rb;function ab(n){return ib(function(e,t){var o=-1,r=t.length,i=r>1?t[r-1]:void 0,s=r>2?t[2]:void 0;for(i=n.length>3&&typeof i=="function"?(r--,i):void 0,s&&sb(t[0],t[1],s)&&(i=r<3?void 0:i,r=1),e=Object(e);++o<r;){var a=t[o];a&&n(e,a,o,i)}return e})}var lb=ab,cb=Jv,db=lb,ub=db(function(n,e,t,o){cb(n,e,t,o)}),hb=ub,fb=ke,pb=function(){return fb.Date.now()},gb=pb,mb=Be,vo=gb,ws=wi,vb="Expected a function",bb=Math.max,yb=Math.min;function Eb(n,e,t){var o,r,i,s,a,l,c=0,d=!1,u=!1,h=!0;if(typeof n!="function")throw new TypeError(vb);e=ws(e)||0,mb(t)&&(d=!!t.leading,u="maxWait"in t,i=u?bb(ws(t.maxWait)||0,e):i,h="trailing"in t?!!t.trailing:h);function g(I){var X=o,C=r;return o=r=void 0,c=I,s=n.apply(C,X),s}function f(I){return c=I,a=setTimeout(E,e),d?g(I):s}function m(I){var X=I-l,C=I-c,T=e-X;return u?yb(T,i-C):T}function b(I){var X=I-l,C=I-c;return l===void 0||X>=e||X<0||u&&C>=i}function E(){var I=vo();if(b(I))return k(I);a=setTimeout(E,m(I))}function k(I){return a=void 0,h&&o?g(I):(o=r=void 0,s)}function N(){a!==void 0&&clearTimeout(a),c=0,o=l=r=a=void 0}function x(){return a===void 0?s:k(vo())}function P(){var I=vo(),X=b(I);if(o=arguments,r=this,l=I,X){if(a===void 0)return f(l);if(u)return clearTimeout(a),a=setTimeout(E,e),g(l)}return a===void 0&&(a=setTimeout(E,e)),s}return P.cancel=N,P.flush=x,P}var Tb=Eb,kb=Tb,wb=Be,Cb="Expected a function";function Sb(n,e,t){var o=!0,r=!0;if(typeof n!="function")throw new TypeError(Cb);return wb(t)&&(o="leading"in t?!!t.leading:o,r="trailing"in t?!!t.trailing:r),kb(n,e,{leading:o,maxWait:e,trailing:r})}var xb=Sb;function Bb(n){for(var e,t=[];!(e=n.next()).done;)t.push(e.value);return t}var _b=Bb;function Ab(n){return n.split("")}var Ib=Ab,Ob="\\ud800-\\udfff",Nb="\\u0300-\\u036f",Rb="\\ufe20-\\ufe2f",Lb="\\u20d0-\\u20ff",Pb=Nb+Rb+Lb,Mb="\\ufe0e\\ufe0f",Db="\\u200d",$b=RegExp("["+Db+Ob+Pb+Mb+"]");function Fb(n){return $b.test(n)}var Hb=Fb,Cs="\\ud800-\\udfff",jb="\\u0300-\\u036f",zb="\\ufe20-\\ufe2f",Wb="\\u20d0-\\u20ff",Ub=jb+zb+Wb,Kb="\\ufe0e\\ufe0f",Gb="["+Cs+"]",bo="["+Ub+"]",yo="\\ud83c[\\udffb-\\udfff]",Yb="(?:"+bo+"|"+yo+")",Ss="[^"+Cs+"]",xs="(?:\\ud83c[\\udde6-\\uddff]){2}",Bs="[\\ud800-\\udbff][\\udc00-\\udfff]",Xb="\\u200d",_s=Yb+"?",As="["+Kb+"]?",Vb="(?:"+Xb+"(?:"+[Ss,xs,Bs].join("|")+")"+As+_s+")*",qb=As+_s+Vb,Zb="(?:"+[Ss+bo+"?",bo,xs,Bs,Gb].join("|")+")",Jb=RegExp(yo+"(?="+yo+")|"+Zb+qb,"g");function Qb(n){return n.match(Jb)||[]}var ey=Qb,ty=Ib,ny=Hb,oy=ey;function ry(n){return ny(n)?oy(n):ty(n)}var iy=ry;function sy(n,e){for(var t=-1,o=n==null?0:n.length,r=Array(o);++t<o;)r[t]=e(n[t],t,n);return r}var ay=sy,ly=ay;function cy(n,e){return ly(e,function(t){return n[t]})}var dy=cy,uy=dy,hy=Zi;function fy(n){return n==null?[]:uy(n,hy(n))}var py=fy,Is=en,gy=ps,my=ho,vy=st,by=ds,yy=_b,Ey=Wi,Ty=Ui,ky=iy,wy=py,Cy="[object Map]",Sy="[object Set]",Eo=Is?Is.iterator:void 0;function xy(n){if(!n)return[];if(vy(n))return by(n)?ky(n):gy(n);if(Eo&&n[Eo])return yy(n[Eo]());var e=my(n),t=e==Cy?Ey:e==Sy?Ty:wy;return t(n)}var By=xy,Os=(n=>(n.VERBOSE="VERBOSE",n.INFO="INFO",n.WARN="WARN",n.ERROR="ERROR",n))(Os||{});const fn=()=>"0.1.1",S={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,LEFT:37,UP:38,DOWN:40,RIGHT:39,DELETE:46,NUMBER_KEY_MIN:47,NUMBER_KEY_MAX:58,LETTER_KEY_MIN:64,LETTER_KEY_MAX:91,META:91,NUMPAD_KEY_MIN:95,NUMPAD_KEY_MAX:112,PUNCTUATION_KEY_MIN:185,PUNCTUATION_KEY_MAX:193,BRACKET_KEY_MIN:218,BRACKET_KEY_MAX:223,PROCESSING_KEY:229,SLASH:191},_y={LEFT:0,WHEEL:1,RIGHT:2,BACKWARD:3,FORWARD:4},Ay=1e8,Iy=16,ye=(()=>{try{return Function("return this")()}catch{return}})();ye&&typeof ye.window>"u"&&(ye.window=ye);const pn=()=>{if(ye!=null&&ye.window)return ye.window},Ns=()=>{if(ye!=null&&ye.navigator)return ye.navigator;const n=pn();return n==null?void 0:n.navigator},At=(n,e,t="log",o,r="color: inherit")=>{const i=typeof console>"u"?void 0:console;if(!i||typeof i[t]!="function")return;const s=["info","log","warn","error"].includes(t),a=[];switch(At.logLevel){case"ERROR":if(t!=="error")return;break;case"WARN":if(!["error","warn"].includes(t))return;break;case"INFO":if(!s||n)return;break}o&&a.push(o);const l=`Editor.js ${fn()}`,c=`line-height: 1em;
1
+ (function(We,Oe){typeof exports=="object"&&typeof module!="undefined"?module.exports=Oe():typeof define=="function"&&define.amd?define(Oe):(We=typeof globalThis!="undefined"?globalThis:We||self,We.Blok=Oe())})(this,(function(){"use strict";var eA=Object.defineProperty,tA=Object.defineProperties;var nA=Object.getOwnPropertyDescriptors;var ta=Object.getOwnPropertySymbols;var Kw=Object.prototype.hasOwnProperty,Vw=Object.prototype.propertyIsEnumerable;var Ww=(We,Oe,gt)=>Oe in We?eA(We,Oe,{enumerable:!0,configurable:!0,writable:!0,value:gt}):We[Oe]=gt,be=(We,Oe)=>{for(var gt in Oe||(Oe={}))Kw.call(Oe,gt)&&Ww(We,gt,Oe[gt]);if(ta)for(var gt of ta(Oe))Vw.call(Oe,gt)&&Ww(We,gt,Oe[gt]);return We},_t=(We,Oe)=>tA(We,nA(Oe));var $w=(We,Oe)=>{var gt={};for(var Yt in We)Kw.call(We,Yt)&&Oe.indexOf(Yt)<0&&(gt[Yt]=We[Yt]);if(We!=null&&ta)for(var Yt of ta(We))Oe.indexOf(Yt)<0&&Vw.call(We,Yt)&&(gt[Yt]=We[Yt]);return gt};var Pr;var We=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Oe(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var gt,Yt;function Gw(){if(Yt)return gt;Yt=1;function l(){}return gt=Object.assign(l,{default:l,register:l,revert:function(){},__esModule:!0}),gt}Gw(),typeof Element.prototype.scrollIntoViewIfNeeded=="undefined"&&(Element.prototype.scrollIntoViewIfNeeded=function(l){const e=l!=null?l:!0,t=this.parentElement;if(!t)return;const o=window.getComputedStyle(t,null),i=parseInt(o.getPropertyValue("border-top-width")),a=parseInt(o.getPropertyValue("border-left-width")),c=this.offsetTop-t.offsetTop<t.scrollTop,d=this.offsetTop-t.offsetTop+this.clientHeight-i>t.scrollTop+t.clientHeight,h=this.offsetLeft-t.offsetLeft<t.scrollLeft,g=this.offsetLeft-t.offsetLeft+this.clientWidth-a>t.scrollLeft+t.clientWidth,v=c&&!d;(c||d)&&e&&(t.scrollTop=this.offsetTop-t.offsetTop-t.clientHeight/2-i+this.clientHeight/2),(h||g)&&e&&(t.scrollLeft=this.offsetLeft-t.offsetLeft-t.clientWidth/2-a+this.clientWidth/2),(c||d||h||g)&&!e&&this.scrollIntoView(v)});const Xw=globalThis.setTimeout.bind(globalThis),Yw=globalThis.clearTimeout.bind(globalThis),Zi=new Map,Qw=l=>{const e=Number(l);return Number.isFinite(e)&&e>0?e:Date.now()};typeof window.requestIdleCallback=="undefined"&&(window.requestIdleCallback=function(l){const e=Date.now(),t={},o=Xw(()=>{const a=t.value;typeof a=="number"&&Zi.delete(a),l({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-e))}})},1),i=Qw(o);return t.value=i,Zi.set(i,o),i}),typeof window.cancelIdleCallback=="undefined"&&(window.cancelIdleCallback=function(l){const e=Zi.get(l);e!==void 0&&(Zi.delete(l),Yw(e)),globalThis.clearTimeout(l)});const Zw="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Jw=(l=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(l|=0));for(;l--;)e+=Zw[t[l]&63];return e};var na,Zh;function e0(){if(Zh)return na;Zh=1;var l="Expected a function";function e(t,o,i){if(typeof t!="function")throw new TypeError(l);return setTimeout(function(){t.apply(void 0,i)},o)}return na=e,na}var ra,Jh;function ep(){if(Jh)return ra;Jh=1;function l(e){return e}return ra=l,ra}var oa,tp;function t0(){if(tp)return oa;tp=1;function l(e,t,o){switch(o.length){case 0:return e.call(t);case 1:return e.call(t,o[0]);case 2:return e.call(t,o[0],o[1]);case 3:return e.call(t,o[0],o[1],o[2])}return e.apply(t,o)}return oa=l,oa}var ia,np;function n0(){if(np)return ia;np=1;var l=t0(),e=Math.max;function t(o,i,a){return i=e(i===void 0?o.length-1:i,0),function(){for(var c=arguments,d=-1,h=e(c.length-i,0),g=Array(h);++d<h;)g[d]=c[i+d];d=-1;for(var v=Array(i+1);++d<i;)v[d]=c[d];return v[i]=a(g),l(o,this,v)}}return ia=t,ia}var sa,rp;function r0(){if(rp)return sa;rp=1;function l(e){return function(){return e}}return sa=l,sa}var la,op;function ip(){if(op)return la;op=1;var l=typeof We=="object"&&We&&We.Object===Object&&We;return la=l,la}var aa,sp;function un(){if(sp)return aa;sp=1;var l=ip(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=l||e||Function("return this")();return aa=t,aa}var ca,lp;function Ji(){if(lp)return ca;lp=1;var l=un(),e=l.Symbol;return ca=e,ca}var ua,ap;function o0(){if(ap)return ua;ap=1;var l=Ji(),e=Object.prototype,t=e.hasOwnProperty,o=e.toString,i=l?l.toStringTag:void 0;function a(c){var d=t.call(c,i),h=c[i];try{c[i]=void 0;var g=!0}catch(y){}var v=o.call(c);return g&&(d?c[i]=h:delete c[i]),v}return ua=a,ua}var da,cp;function i0(){if(cp)return da;cp=1;var l=Object.prototype,e=l.toString;function t(o){return e.call(o)}return da=t,da}var fa,up;function Rn(){if(up)return fa;up=1;var l=Ji(),e=o0(),t=i0(),o="[object Null]",i="[object Undefined]",a=l?l.toStringTag:void 0;function c(d){return d==null?d===void 0?i:o:a&&a in Object(d)?e(d):t(d)}return fa=c,fa}var ha,dp;function wn(){if(dp)return ha;dp=1;function l(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return ha=l,ha}var pa,fp;function es(){if(fp)return pa;fp=1;var l=Rn(),e=wn(),t="[object AsyncFunction]",o="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function c(d){if(!e(d))return!1;var h=l(d);return h==o||h==i||h==t||h==a}return pa=c,pa}var ga,hp;function s0(){if(hp)return ga;hp=1;var l=un(),e=l["__core-js_shared__"];return ga=e,ga}var ma,pp;function l0(){if(pp)return ma;pp=1;var l=s0(),e=(function(){var o=/[^.]+$/.exec(l&&l.keys&&l.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})();function t(o){return!!e&&e in o}return ma=t,ma}var va,gp;function mp(){if(gp)return va;gp=1;var l=Function.prototype,e=l.toString;function t(o){if(o!=null){try{return e.call(o)}catch(i){}try{return o+""}catch(i){}}return""}return va=t,va}var ya,vp;function a0(){if(vp)return ya;vp=1;var l=es(),e=l0(),t=wn(),o=mp(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,c=Function.prototype,d=Object.prototype,h=c.toString,g=d.hasOwnProperty,v=RegExp("^"+h.call(g).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function y(b){if(!t(b)||e(b))return!1;var x=l(b)?v:a;return x.test(o(b))}return ya=y,ya}var ba,yp;function c0(){if(yp)return ba;yp=1;function l(e,t){return e==null?void 0:e[t]}return ba=l,ba}var ka,bp;function Sr(){if(bp)return ka;bp=1;var l=a0(),e=c0();function t(o,i){var a=e(o,i);return l(a)?a:void 0}return ka=t,ka}var wa,kp;function wp(){if(kp)return wa;kp=1;var l=Sr(),e=(function(){try{var t=l(Object,"defineProperty");return t({},"",{}),t}catch(o){}})();return wa=e,wa}var Ta,Tp;function u0(){if(Tp)return Ta;Tp=1;var l=r0(),e=wp(),t=ep(),o=e?function(i,a){return e(i,"toString",{configurable:!0,enumerable:!1,value:l(a),writable:!0})}:t;return Ta=o,Ta}var Sa,Sp;function d0(){if(Sp)return Sa;Sp=1;var l=800,e=16,t=Date.now;function o(i){var a=0,c=0;return function(){var d=t(),h=e-(d-c);if(c=d,h>0){if(++a>=l)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return Sa=o,Sa}var xa,xp;function f0(){if(xp)return xa;xp=1;var l=u0(),e=d0(),t=e(l);return xa=t,xa}var Ca,Cp;function Ep(){if(Cp)return Ca;Cp=1;var l=ep(),e=n0(),t=f0();function o(i,a){return t(e(i,a,l),i+"")}return Ca=o,Ca}var Ea,Bp;function h0(){if(Bp)return Ea;Bp=1;var l=/\s/;function e(t){for(var o=t.length;o--&&l.test(t.charAt(o)););return o}return Ea=e,Ea}var Ba,Ap;function p0(){if(Ap)return Ba;Ap=1;var l=h0(),e=/^\s+/;function t(o){return o&&o.slice(0,l(o)+1).replace(e,"")}return Ba=t,Ba}var Aa,Ip;function Tn(){if(Ip)return Aa;Ip=1;function l(e){return e!=null&&typeof e=="object"}return Aa=l,Aa}var Ia,_p;function g0(){if(_p)return Ia;_p=1;var l=Rn(),e=Tn(),t="[object Symbol]";function o(i){return typeof i=="symbol"||e(i)&&l(i)==t}return Ia=o,Ia}var _a,Np;function Rp(){if(Np)return _a;Np=1;var l=p0(),e=wn(),t=g0(),o=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,d=parseInt;function h(g){if(typeof g=="number")return g;if(t(g))return o;if(e(g)){var v=typeof g.valueOf=="function"?g.valueOf():g;g=e(v)?v+"":v}if(typeof g!="string")return g===0?g:+g;g=l(g);var y=a.test(g);return y||c.test(g)?d(g.slice(2),y?2:8):i.test(g)?o:+g}return _a=h,_a}var Na,Op;function m0(){if(Op)return Na;Op=1;var l=e0(),e=Ep(),t=Rp(),o=e(function(i,a,c){return l(i,t(a)||0,c)});return Na=o,Na}var v0=m0();const y0=Oe(v0);var Ra,Lp;function b0(){if(Lp)return Ra;Lp=1;var l=Rn(),e=Tn(),t="[object Boolean]";function o(i){return i===!0||i===!1||e(i)&&l(i)==t}return Ra=o,Ra}var k0=b0();const w0=Oe(k0);var Oa,Dp;function ts(){if(Dp)return Oa;Dp=1;var l=Object.prototype;function e(t){var o=t&&t.constructor,i=typeof o=="function"&&o.prototype||l;return t===i}return Oa=e,Oa}var La,Pp;function Mp(){if(Pp)return La;Pp=1;function l(e,t){return function(o){return e(t(o))}}return La=l,La}var Da,Fp;function T0(){if(Fp)return Da;Fp=1;var l=Mp(),e=l(Object.keys,Object);return Da=e,Da}var Pa,zp;function Hp(){if(zp)return Pa;zp=1;var l=ts(),e=T0(),t=Object.prototype,o=t.hasOwnProperty;function i(a){if(!l(a))return e(a);var c=[];for(var d in Object(a))o.call(a,d)&&d!="constructor"&&c.push(d);return c}return Pa=i,Pa}var Ma,jp;function S0(){if(jp)return Ma;jp=1;var l=Sr(),e=un(),t=l(e,"DataView");return Ma=t,Ma}var Fa,qp;function za(){if(qp)return Fa;qp=1;var l=Sr(),e=un(),t=l(e,"Map");return Fa=t,Fa}var Ha,Up;function x0(){if(Up)return Ha;Up=1;var l=Sr(),e=un(),t=l(e,"Promise");return Ha=t,Ha}var ja,Wp;function C0(){if(Wp)return ja;Wp=1;var l=Sr(),e=un(),t=l(e,"Set");return ja=t,ja}var qa,Kp;function E0(){if(Kp)return qa;Kp=1;var l=Sr(),e=un(),t=l(e,"WeakMap");return qa=t,qa}var Ua,Vp;function Wa(){if(Vp)return Ua;Vp=1;var l=S0(),e=za(),t=x0(),o=C0(),i=E0(),a=Rn(),c=mp(),d="[object Map]",h="[object Object]",g="[object Promise]",v="[object Set]",y="[object WeakMap]",b="[object DataView]",x=c(l),w=c(e),T=c(t),C=c(o),O=c(i),L=a;return(l&&L(new l(new ArrayBuffer(1)))!=b||e&&L(new e)!=d||t&&L(t.resolve())!=g||o&&L(new o)!=v||i&&L(new i)!=y)&&(L=function(U){var H=a(U),Y=H==h?U.constructor:void 0,q=Y?c(Y):"";if(q)switch(q){case x:return b;case w:return d;case T:return g;case C:return v;case O:return y}return H}),Ua=L,Ua}var Ka,$p;function B0(){if($p)return Ka;$p=1;var l=Rn(),e=Tn(),t="[object Arguments]";function o(i){return e(i)&&l(i)==t}return Ka=o,Ka}var Va,Gp;function $a(){if(Gp)return Va;Gp=1;var l=B0(),e=Tn(),t=Object.prototype,o=t.hasOwnProperty,i=t.propertyIsEnumerable,a=l((function(){return arguments})())?l:function(c){return e(c)&&o.call(c,"callee")&&!i.call(c,"callee")};return Va=a,Va}var Ga,Xp;function Zr(){if(Xp)return Ga;Xp=1;var l=Array.isArray;return Ga=l,Ga}var Xa,Yp;function Qp(){if(Yp)return Xa;Yp=1;var l=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=l}return Xa=e,Xa}var Ya,Zp;function Jr(){if(Zp)return Ya;Zp=1;var l=es(),e=Qp();function t(o){return o!=null&&e(o.length)&&!l(o)}return Ya=t,Ya}var Fo={exports:{}},Qa,Jp;function A0(){if(Jp)return Qa;Jp=1;function l(){return!1}return Qa=l,Qa}Fo.exports;var eg;function ns(){return eg||(eg=1,(function(l,e){var t=un(),o=A0(),i=e&&!e.nodeType&&e,a=i&&!0&&l&&!l.nodeType&&l,c=a&&a.exports===i,d=c?t.Buffer:void 0,h=d?d.isBuffer:void 0,g=h||o;l.exports=g})(Fo,Fo.exports)),Fo.exports}var Za,tg;function I0(){if(tg)return Za;tg=1;var l=Rn(),e=Qp(),t=Tn(),o="[object Arguments]",i="[object Array]",a="[object Boolean]",c="[object Date]",d="[object Error]",h="[object Function]",g="[object Map]",v="[object Number]",y="[object Object]",b="[object RegExp]",x="[object Set]",w="[object String]",T="[object WeakMap]",C="[object ArrayBuffer]",O="[object DataView]",L="[object Float32Array]",U="[object Float64Array]",H="[object Int8Array]",Y="[object Int16Array]",q="[object Int32Array]",W="[object Uint8Array]",F="[object Uint8ClampedArray]",re="[object Uint16Array]",ce="[object Uint32Array]",Z={};Z[L]=Z[U]=Z[H]=Z[Y]=Z[q]=Z[W]=Z[F]=Z[re]=Z[ce]=!0,Z[o]=Z[i]=Z[C]=Z[a]=Z[O]=Z[c]=Z[d]=Z[h]=Z[g]=Z[v]=Z[y]=Z[b]=Z[x]=Z[w]=Z[T]=!1;function ye(J){return t(J)&&e(J.length)&&!!Z[l(J)]}return Za=ye,Za}var Ja,ng;function _0(){if(ng)return Ja;ng=1;function l(e){return function(t){return e(t)}}return Ja=l,Ja}var zo={exports:{}};zo.exports;var rg;function N0(){return rg||(rg=1,(function(l,e){var t=ip(),o=e&&!e.nodeType&&e,i=o&&!0&&l&&!l.nodeType&&l,a=i&&i.exports===o,c=a&&t.process,d=(function(){try{var h=i&&i.require&&i.require("util").types;return h||c&&c.binding&&c.binding("util")}catch(g){}})();l.exports=d})(zo,zo.exports)),zo.exports}var ec,og;function rs(){if(og)return ec;og=1;var l=I0(),e=_0(),t=N0(),o=t&&t.isTypedArray,i=o?e(o):l;return ec=i,ec}var tc,ig;function R0(){if(ig)return tc;ig=1;var l=Hp(),e=Wa(),t=$a(),o=Zr(),i=Jr(),a=ns(),c=ts(),d=rs(),h="[object Map]",g="[object Set]",v=Object.prototype,y=v.hasOwnProperty;function b(x){if(x==null)return!0;if(i(x)&&(o(x)||typeof x=="string"||typeof x.splice=="function"||a(x)||d(x)||t(x)))return!x.length;var w=e(x);if(w==h||w==g)return!x.size;if(c(x))return!l(x).length;for(var T in x)if(y.call(x,T))return!1;return!0}return tc=b,tc}var O0=R0();const L0=Oe(O0);var nc,sg;function D0(){if(sg)return nc;sg=1;function l(){this.__data__=[],this.size=0}return nc=l,nc}var rc,lg;function Ho(){if(lg)return rc;lg=1;function l(e,t){return e===t||e!==e&&t!==t}return rc=l,rc}var oc,ag;function os(){if(ag)return oc;ag=1;var l=Ho();function e(t,o){for(var i=t.length;i--;)if(l(t[i][0],o))return i;return-1}return oc=e,oc}var ic,cg;function P0(){if(cg)return ic;cg=1;var l=os(),e=Array.prototype,t=e.splice;function o(i){var a=this.__data__,c=l(a,i);if(c<0)return!1;var d=a.length-1;return c==d?a.pop():t.call(a,c,1),--this.size,!0}return ic=o,ic}var sc,ug;function M0(){if(ug)return sc;ug=1;var l=os();function e(t){var o=this.__data__,i=l(o,t);return i<0?void 0:o[i][1]}return sc=e,sc}var lc,dg;function F0(){if(dg)return lc;dg=1;var l=os();function e(t){return l(this.__data__,t)>-1}return lc=e,lc}var ac,fg;function z0(){if(fg)return ac;fg=1;var l=os();function e(t,o){var i=this.__data__,a=l(i,t);return a<0?(++this.size,i.push([t,o])):i[a][1]=o,this}return ac=e,ac}var cc,hg;function is(){if(hg)return cc;hg=1;var l=D0(),e=P0(),t=M0(),o=F0(),i=z0();function a(c){var d=-1,h=c==null?0:c.length;for(this.clear();++d<h;){var g=c[d];this.set(g[0],g[1])}}return a.prototype.clear=l,a.prototype.delete=e,a.prototype.get=t,a.prototype.has=o,a.prototype.set=i,cc=a,cc}var uc,pg;function H0(){if(pg)return uc;pg=1;var l=is();function e(){this.__data__=new l,this.size=0}return uc=e,uc}var dc,gg;function j0(){if(gg)return dc;gg=1;function l(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o}return dc=l,dc}var fc,mg;function q0(){if(mg)return fc;mg=1;function l(e){return this.__data__.get(e)}return fc=l,fc}var hc,vg;function U0(){if(vg)return hc;vg=1;function l(e){return this.__data__.has(e)}return hc=l,hc}var pc,yg;function ss(){if(yg)return pc;yg=1;var l=Sr(),e=l(Object,"create");return pc=e,pc}var gc,bg;function W0(){if(bg)return gc;bg=1;var l=ss();function e(){this.__data__=l?l(null):{},this.size=0}return gc=e,gc}var mc,kg;function K0(){if(kg)return mc;kg=1;function l(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return mc=l,mc}var vc,wg;function V0(){if(wg)return vc;wg=1;var l=ss(),e="__lodash_hash_undefined__",t=Object.prototype,o=t.hasOwnProperty;function i(a){var c=this.__data__;if(l){var d=c[a];return d===e?void 0:d}return o.call(c,a)?c[a]:void 0}return vc=i,vc}var yc,Tg;function $0(){if(Tg)return yc;Tg=1;var l=ss(),e=Object.prototype,t=e.hasOwnProperty;function o(i){var a=this.__data__;return l?a[i]!==void 0:t.call(a,i)}return yc=o,yc}var bc,Sg;function G0(){if(Sg)return bc;Sg=1;var l=ss(),e="__lodash_hash_undefined__";function t(o,i){var a=this.__data__;return this.size+=this.has(o)?0:1,a[o]=l&&i===void 0?e:i,this}return bc=t,bc}var kc,xg;function X0(){if(xg)return kc;xg=1;var l=W0(),e=K0(),t=V0(),o=$0(),i=G0();function a(c){var d=-1,h=c==null?0:c.length;for(this.clear();++d<h;){var g=c[d];this.set(g[0],g[1])}}return a.prototype.clear=l,a.prototype.delete=e,a.prototype.get=t,a.prototype.has=o,a.prototype.set=i,kc=a,kc}var wc,Cg;function Y0(){if(Cg)return wc;Cg=1;var l=X0(),e=is(),t=za();function o(){this.size=0,this.__data__={hash:new l,map:new(t||e),string:new l}}return wc=o,wc}var Tc,Eg;function Q0(){if(Eg)return Tc;Eg=1;function l(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return Tc=l,Tc}var Sc,Bg;function ls(){if(Bg)return Sc;Bg=1;var l=Q0();function e(t,o){var i=t.__data__;return l(o)?i[typeof o=="string"?"string":"hash"]:i.map}return Sc=e,Sc}var xc,Ag;function Z0(){if(Ag)return xc;Ag=1;var l=ls();function e(t){var o=l(this,t).delete(t);return this.size-=o?1:0,o}return xc=e,xc}var Cc,Ig;function J0(){if(Ig)return Cc;Ig=1;var l=ls();function e(t){return l(this,t).get(t)}return Cc=e,Cc}var Ec,_g;function eT(){if(_g)return Ec;_g=1;var l=ls();function e(t){return l(this,t).has(t)}return Ec=e,Ec}var Bc,Ng;function tT(){if(Ng)return Bc;Ng=1;var l=ls();function e(t,o){var i=l(this,t),a=i.size;return i.set(t,o),this.size+=i.size==a?0:1,this}return Bc=e,Bc}var Ac,Rg;function Og(){if(Rg)return Ac;Rg=1;var l=Y0(),e=Z0(),t=J0(),o=eT(),i=tT();function a(c){var d=-1,h=c==null?0:c.length;for(this.clear();++d<h;){var g=c[d];this.set(g[0],g[1])}}return a.prototype.clear=l,a.prototype.delete=e,a.prototype.get=t,a.prototype.has=o,a.prototype.set=i,Ac=a,Ac}var Ic,Lg;function nT(){if(Lg)return Ic;Lg=1;var l=is(),e=za(),t=Og(),o=200;function i(a,c){var d=this.__data__;if(d instanceof l){var h=d.__data__;if(!e||h.length<o-1)return h.push([a,c]),this.size=++d.size,this;d=this.__data__=new t(h)}return d.set(a,c),this.size=d.size,this}return Ic=i,Ic}var _c,Dg;function Pg(){if(Dg)return _c;Dg=1;var l=is(),e=H0(),t=j0(),o=q0(),i=U0(),a=nT();function c(d){var h=this.__data__=new l(d);this.size=h.size}return c.prototype.clear=e,c.prototype.delete=t,c.prototype.get=o,c.prototype.has=i,c.prototype.set=a,_c=c,_c}var Nc,Mg;function rT(){if(Mg)return Nc;Mg=1;var l="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,l),this}return Nc=e,Nc}var Rc,Fg;function oT(){if(Fg)return Rc;Fg=1;function l(e){return this.__data__.has(e)}return Rc=l,Rc}var Oc,zg;function iT(){if(zg)return Oc;zg=1;var l=Og(),e=rT(),t=oT();function o(i){var a=-1,c=i==null?0:i.length;for(this.__data__=new l;++a<c;)this.add(i[a])}return o.prototype.add=o.prototype.push=e,o.prototype.has=t,Oc=o,Oc}var Lc,Hg;function sT(){if(Hg)return Lc;Hg=1;function l(e,t){for(var o=-1,i=e==null?0:e.length;++o<i;)if(t(e[o],o,e))return!0;return!1}return Lc=l,Lc}var Dc,jg;function lT(){if(jg)return Dc;jg=1;function l(e,t){return e.has(t)}return Dc=l,Dc}var Pc,qg;function Ug(){if(qg)return Pc;qg=1;var l=iT(),e=sT(),t=lT(),o=1,i=2;function a(c,d,h,g,v,y){var b=h&o,x=c.length,w=d.length;if(x!=w&&!(b&&w>x))return!1;var T=y.get(c),C=y.get(d);if(T&&C)return T==d&&C==c;var O=-1,L=!0,U=h&i?new l:void 0;for(y.set(c,d),y.set(d,c);++O<x;){var H=c[O],Y=d[O];if(g)var q=b?g(Y,H,O,d,c,y):g(H,Y,O,c,d,y);if(q!==void 0){if(q)continue;L=!1;break}if(U){if(!e(d,function(W,F){if(!t(U,F)&&(H===W||v(H,W,h,g,y)))return U.push(F)})){L=!1;break}}else if(!(H===Y||v(H,Y,h,g,y))){L=!1;break}}return y.delete(c),y.delete(d),L}return Pc=a,Pc}var Mc,Wg;function Kg(){if(Wg)return Mc;Wg=1;var l=un(),e=l.Uint8Array;return Mc=e,Mc}var Fc,Vg;function $g(){if(Vg)return Fc;Vg=1;function l(e){var t=-1,o=Array(e.size);return e.forEach(function(i,a){o[++t]=[a,i]}),o}return Fc=l,Fc}var zc,Gg;function Xg(){if(Gg)return zc;Gg=1;function l(e){var t=-1,o=Array(e.size);return e.forEach(function(i){o[++t]=i}),o}return zc=l,zc}var Hc,Yg;function aT(){if(Yg)return Hc;Yg=1;var l=Ji(),e=Kg(),t=Ho(),o=Ug(),i=$g(),a=Xg(),c=1,d=2,h="[object Boolean]",g="[object Date]",v="[object Error]",y="[object Map]",b="[object Number]",x="[object RegExp]",w="[object Set]",T="[object String]",C="[object Symbol]",O="[object ArrayBuffer]",L="[object DataView]",U=l?l.prototype:void 0,H=U?U.valueOf:void 0;function Y(q,W,F,re,ce,Z,ye){switch(F){case L:if(q.byteLength!=W.byteLength||q.byteOffset!=W.byteOffset)return!1;q=q.buffer,W=W.buffer;case O:return!(q.byteLength!=W.byteLength||!Z(new e(q),new e(W)));case h:case g:case b:return t(+q,+W);case v:return q.name==W.name&&q.message==W.message;case x:case T:return q==W+"";case y:var J=i;case w:var we=re&c;if(J||(J=a),q.size!=W.size&&!we)return!1;var Re=ye.get(q);if(Re)return Re==W;re|=d,ye.set(q,W);var xe=o(J(q),J(W),re,ce,Z,ye);return ye.delete(q),xe;case C:if(H)return H.call(q)==H.call(W)}return!1}return Hc=Y,Hc}var jc,Qg;function cT(){if(Qg)return jc;Qg=1;function l(e,t){for(var o=-1,i=t.length,a=e.length;++o<i;)e[a+o]=t[o];return e}return jc=l,jc}var qc,Zg;function uT(){if(Zg)return qc;Zg=1;var l=cT(),e=Zr();function t(o,i,a){var c=i(o);return e(o)?c:l(c,a(o))}return qc=t,qc}var Uc,Jg;function dT(){if(Jg)return Uc;Jg=1;function l(e,t){for(var o=-1,i=e==null?0:e.length,a=0,c=[];++o<i;){var d=e[o];t(d,o,e)&&(c[a++]=d)}return c}return Uc=l,Uc}var Wc,em;function fT(){if(em)return Wc;em=1;function l(){return[]}return Wc=l,Wc}var Kc,tm;function hT(){if(tm)return Kc;tm=1;var l=dT(),e=fT(),t=Object.prototype,o=t.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(c){return c==null?[]:(c=Object(c),l(i(c),function(d){return o.call(c,d)}))}:e;return Kc=a,Kc}var Vc,nm;function pT(){if(nm)return Vc;nm=1;function l(e,t){for(var o=-1,i=Array(e);++o<e;)i[o]=t(o);return i}return Vc=l,Vc}var $c,rm;function om(){if(rm)return $c;rm=1;var l=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(o,i){var a=typeof o;return i=i==null?l:i,!!i&&(a=="number"||a!="symbol"&&e.test(o))&&o>-1&&o%1==0&&o<i}return $c=t,$c}var Gc,im;function sm(){if(im)return Gc;im=1;var l=pT(),e=$a(),t=Zr(),o=ns(),i=om(),a=rs(),c=Object.prototype,d=c.hasOwnProperty;function h(g,v){var y=t(g),b=!y&&e(g),x=!y&&!b&&o(g),w=!y&&!b&&!x&&a(g),T=y||b||x||w,C=T?l(g.length,String):[],O=C.length;for(var L in g)(v||d.call(g,L))&&!(T&&(L=="length"||x&&(L=="offset"||L=="parent")||w&&(L=="buffer"||L=="byteLength"||L=="byteOffset")||i(L,O)))&&C.push(L);return C}return Gc=h,Gc}var Xc,lm;function am(){if(lm)return Xc;lm=1;var l=sm(),e=Hp(),t=Jr();function o(i){return t(i)?l(i):e(i)}return Xc=o,Xc}var Yc,cm;function gT(){if(cm)return Yc;cm=1;var l=uT(),e=hT(),t=am();function o(i){return l(i,t,e)}return Yc=o,Yc}var Qc,um;function mT(){if(um)return Qc;um=1;var l=gT(),e=1,t=Object.prototype,o=t.hasOwnProperty;function i(a,c,d,h,g,v){var y=d&e,b=l(a),x=b.length,w=l(c),T=w.length;if(x!=T&&!y)return!1;for(var C=x;C--;){var O=b[C];if(!(y?O in c:o.call(c,O)))return!1}var L=v.get(a),U=v.get(c);if(L&&U)return L==c&&U==a;var H=!0;v.set(a,c),v.set(c,a);for(var Y=y;++C<x;){O=b[C];var q=a[O],W=c[O];if(h)var F=y?h(W,q,O,c,a,v):h(q,W,O,a,c,v);if(!(F===void 0?q===W||g(q,W,d,h,v):F)){H=!1;break}Y||(Y=O=="constructor")}if(H&&!Y){var re=a.constructor,ce=c.constructor;re!=ce&&"constructor"in a&&"constructor"in c&&!(typeof re=="function"&&re instanceof re&&typeof ce=="function"&&ce instanceof ce)&&(H=!1)}return v.delete(a),v.delete(c),H}return Qc=i,Qc}var Zc,dm;function vT(){if(dm)return Zc;dm=1;var l=Pg(),e=Ug(),t=aT(),o=mT(),i=Wa(),a=Zr(),c=ns(),d=rs(),h=1,g="[object Arguments]",v="[object Array]",y="[object Object]",b=Object.prototype,x=b.hasOwnProperty;function w(T,C,O,L,U,H){var Y=a(T),q=a(C),W=Y?v:i(T),F=q?v:i(C);W=W==g?y:W,F=F==g?y:F;var re=W==y,ce=F==y,Z=W==F;if(Z&&c(T)){if(!c(C))return!1;Y=!0,re=!1}if(Z&&!re)return H||(H=new l),Y||d(T)?e(T,C,O,L,U,H):t(T,C,W,O,L,U,H);if(!(O&h)){var ye=re&&x.call(T,"__wrapped__"),J=ce&&x.call(C,"__wrapped__");if(ye||J){var we=ye?T.value():T,Re=J?C.value():C;return H||(H=new l),U(we,Re,O,L,H)}}return Z?(H||(H=new l),o(T,C,O,L,U,H)):!1}return Zc=w,Zc}var Jc,fm;function yT(){if(fm)return Jc;fm=1;var l=vT(),e=Tn();function t(o,i,a,c,d){return o===i?!0:o==null||i==null||!e(o)&&!e(i)?o!==o&&i!==i:l(o,i,a,c,t,d)}return Jc=t,Jc}var eu,hm;function bT(){if(hm)return eu;hm=1;var l=yT();function e(t,o){return l(t,o)}return eu=e,eu}var kT=bT();const wT=Oe(kT);var TT=es();const ST=Oe(TT);var tu,pm;function xT(){if(pm)return tu;pm=1;var l=Rn(),e=Tn(),t="[object Number]";function o(i){return typeof i=="number"||e(i)&&l(i)==t}return tu=o,tu}var CT=xT();const ET=Oe(CT);var nu,gm;function mm(){if(gm)return nu;gm=1;var l=Mp(),e=l(Object.getPrototypeOf,Object);return nu=e,nu}var ru,vm;function ym(){if(vm)return ru;vm=1;var l=Rn(),e=mm(),t=Tn(),o="[object Object]",i=Function.prototype,a=Object.prototype,c=i.toString,d=a.hasOwnProperty,h=c.call(Object);function g(v){if(!t(v)||l(v)!=o)return!1;var y=e(v);if(y===null)return!0;var b=d.call(y,"constructor")&&y.constructor;return typeof b=="function"&&b instanceof b&&c.call(b)==h}return ru=g,ru}var BT=ym();const AT=Oe(BT);var ou,bm;function km(){if(bm)return ou;bm=1;var l=Rn(),e=Zr(),t=Tn(),o="[object String]";function i(a){return typeof a=="string"||!e(a)&&t(a)&&l(a)==o}return ou=i,ou}var IT=km();const _T=Oe(IT);var iu,wm;function NT(){if(wm)return iu;wm=1;function l(e){return e===void 0}return iu=l,iu}var RT=NT();const OT=Oe(RT);var su,Tm;function lu(){if(Tm)return su;Tm=1;var l=wp();function e(t,o,i){o=="__proto__"&&l?l(t,o,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[o]=i}return su=e,su}var au,Sm;function xm(){if(Sm)return au;Sm=1;var l=lu(),e=Ho();function t(o,i,a){(a!==void 0&&!e(o[i],a)||a===void 0&&!(i in o))&&l(o,i,a)}return au=t,au}var cu,Cm;function LT(){if(Cm)return cu;Cm=1;function l(e){return function(t,o,i){for(var a=-1,c=Object(t),d=i(t),h=d.length;h--;){var g=d[e?h:++a];if(o(c[g],g,c)===!1)break}return t}}return cu=l,cu}var uu,Em;function DT(){if(Em)return uu;Em=1;var l=LT(),e=l();return uu=e,uu}var jo={exports:{}};jo.exports;var Bm;function PT(){return Bm||(Bm=1,(function(l,e){var t=un(),o=e&&!e.nodeType&&e,i=o&&!0&&l&&!l.nodeType&&l,a=i&&i.exports===o,c=a?t.Buffer:void 0,d=c?c.allocUnsafe:void 0;function h(g,v){if(v)return g.slice();var y=g.length,b=d?d(y):new g.constructor(y);return g.copy(b),b}l.exports=h})(jo,jo.exports)),jo.exports}var du,Am;function MT(){if(Am)return du;Am=1;var l=Kg();function e(t){var o=new t.constructor(t.byteLength);return new l(o).set(new l(t)),o}return du=e,du}var fu,Im;function FT(){if(Im)return fu;Im=1;var l=MT();function e(t,o){var i=o?l(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}return fu=e,fu}var hu,_m;function Nm(){if(_m)return hu;_m=1;function l(e,t){var o=-1,i=e.length;for(t||(t=Array(i));++o<i;)t[o]=e[o];return t}return hu=l,hu}var pu,Rm;function zT(){if(Rm)return pu;Rm=1;var l=wn(),e=Object.create,t=(function(){function o(){}return function(i){if(!l(i))return{};if(e)return e(i);o.prototype=i;var a=new o;return o.prototype=void 0,a}})();return pu=t,pu}var gu,Om;function HT(){if(Om)return gu;Om=1;var l=zT(),e=mm(),t=ts();function o(i){return typeof i.constructor=="function"&&!t(i)?l(e(i)):{}}return gu=o,gu}var mu,Lm;function jT(){if(Lm)return mu;Lm=1;var l=Jr(),e=Tn();function t(o){return e(o)&&l(o)}return mu=t,mu}var vu,Dm;function Pm(){if(Dm)return vu;Dm=1;function l(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return vu=l,vu}var yu,Mm;function qT(){if(Mm)return yu;Mm=1;var l=lu(),e=Ho(),t=Object.prototype,o=t.hasOwnProperty;function i(a,c,d){var h=a[c];(!(o.call(a,c)&&e(h,d))||d===void 0&&!(c in a))&&l(a,c,d)}return yu=i,yu}var bu,Fm;function UT(){if(Fm)return bu;Fm=1;var l=qT(),e=lu();function t(o,i,a,c){var d=!a;a||(a={});for(var h=-1,g=i.length;++h<g;){var v=i[h],y=c?c(a[v],o[v],v,a,o):void 0;y===void 0&&(y=o[v]),d?e(a,v,y):l(a,v,y)}return a}return bu=t,bu}var ku,zm;function WT(){if(zm)return ku;zm=1;function l(e){var t=[];if(e!=null)for(var o in Object(e))t.push(o);return t}return ku=l,ku}var wu,Hm;function KT(){if(Hm)return wu;Hm=1;var l=wn(),e=ts(),t=WT(),o=Object.prototype,i=o.hasOwnProperty;function a(c){if(!l(c))return t(c);var d=e(c),h=[];for(var g in c)g=="constructor"&&(d||!i.call(c,g))||h.push(g);return h}return wu=a,wu}var Tu,jm;function qm(){if(jm)return Tu;jm=1;var l=sm(),e=KT(),t=Jr();function o(i){return t(i)?l(i,!0):e(i)}return Tu=o,Tu}var Su,Um;function VT(){if(Um)return Su;Um=1;var l=UT(),e=qm();function t(o){return l(o,e(o))}return Su=t,Su}var xu,Wm;function $T(){if(Wm)return xu;Wm=1;var l=xm(),e=PT(),t=FT(),o=Nm(),i=HT(),a=$a(),c=Zr(),d=jT(),h=ns(),g=es(),v=wn(),y=ym(),b=rs(),x=Pm(),w=VT();function T(C,O,L,U,H,Y,q){var W=x(C,L),F=x(O,L),re=q.get(F);if(re){l(C,L,re);return}var ce=Y?Y(W,F,L+"",C,O,q):void 0,Z=ce===void 0;if(Z){var ye=c(F),J=!ye&&h(F),we=!ye&&!J&&b(F);ce=F,ye||J||we?c(W)?ce=W:d(W)?ce=o(W):J?(Z=!1,ce=e(F,!0)):we?(Z=!1,ce=t(F,!0)):ce=[]:y(F)||a(F)?(ce=W,a(W)?ce=w(W):(!v(W)||g(W))&&(ce=i(F))):Z=!1}Z&&(q.set(F,ce),H(ce,F,U,Y,q),q.delete(F)),l(C,L,ce)}return xu=T,xu}var Cu,Km;function GT(){if(Km)return Cu;Km=1;var l=Pg(),e=xm(),t=DT(),o=$T(),i=wn(),a=qm(),c=Pm();function d(h,g,v,y,b){h!==g&&t(g,function(x,w){if(b||(b=new l),i(x))o(h,g,w,v,d,y,b);else{var T=y?y(c(h,w),x,w+"",h,g,b):void 0;T===void 0&&(T=x),e(h,w,T)}},a)}return Cu=d,Cu}var Eu,Vm;function XT(){if(Vm)return Eu;Vm=1;var l=Ho(),e=Jr(),t=om(),o=wn();function i(a,c,d){if(!o(d))return!1;var h=typeof c;return(h=="number"?e(d)&&t(c,d.length):h=="string"&&c in d)?l(d[c],a):!1}return Eu=i,Eu}var Bu,$m;function YT(){if($m)return Bu;$m=1;var l=Ep(),e=XT();function t(o){return l(function(i,a){var c=-1,d=a.length,h=d>1?a[d-1]:void 0,g=d>2?a[2]:void 0;for(h=o.length>3&&typeof h=="function"?(d--,h):void 0,g&&e(a[0],a[1],g)&&(h=d<3?void 0:h,d=1),i=Object(i);++c<d;){var v=a[c];v&&o(i,v,c,h)}return i})}return Bu=t,Bu}var Au,Gm;function QT(){if(Gm)return Au;Gm=1;var l=GT(),e=YT(),t=e(function(o,i,a,c){l(o,i,a,c)});return Au=t,Au}var ZT=QT();const JT=Oe(ZT);var Iu,Xm;function eS(){if(Xm)return Iu;Xm=1;var l=un(),e=function(){return l.Date.now()};return Iu=e,Iu}var _u,Ym;function tS(){if(Ym)return _u;Ym=1;var l=wn(),e=eS(),t=Rp(),o="Expected a function",i=Math.max,a=Math.min;function c(d,h,g){var v,y,b,x,w,T,C=0,O=!1,L=!1,U=!0;if(typeof d!="function")throw new TypeError(o);h=t(h)||0,l(g)&&(O=!!g.leading,L="maxWait"in g,b=L?i(t(g.maxWait)||0,h):b,U="trailing"in g?!!g.trailing:U);function H(J){var we=v,Re=y;return v=y=void 0,C=J,x=d.apply(Re,we),x}function Y(J){return C=J,w=setTimeout(F,h),O?H(J):x}function q(J){var we=J-T,Re=J-C,xe=h-we;return L?a(xe,b-Re):xe}function W(J){var we=J-T,Re=J-C;return T===void 0||we>=h||we<0||L&&Re>=b}function F(){var J=e();if(W(J))return re(J);w=setTimeout(F,q(J))}function re(J){return w=void 0,U&&v?H(J):(v=y=void 0,x)}function ce(){w!==void 0&&clearTimeout(w),C=0,v=T=y=w=void 0}function Z(){return w===void 0?x:re(e())}function ye(){var J=e(),we=W(J);if(v=arguments,y=this,T=J,we){if(w===void 0)return Y(T);if(L)return clearTimeout(w),w=setTimeout(F,h),H(T)}return w===void 0&&(w=setTimeout(F,h)),x}return ye.cancel=ce,ye.flush=Z,ye}return _u=c,_u}var Nu,Qm;function nS(){if(Qm)return Nu;Qm=1;var l=tS(),e=wn(),t="Expected a function";function o(i,a,c){var d=!0,h=!0;if(typeof i!="function")throw new TypeError(t);return e(c)&&(d="leading"in c?!!c.leading:d,h="trailing"in c?!!c.trailing:h),l(i,a,{leading:d,maxWait:a,trailing:h})}return Nu=o,Nu}var rS=nS();const oS=Oe(rS);var Ru,Zm;function iS(){if(Zm)return Ru;Zm=1;function l(e){for(var t,o=[];!(t=e.next()).done;)o.push(t.value);return o}return Ru=l,Ru}var Ou,Jm;function sS(){if(Jm)return Ou;Jm=1;function l(e){return e.split("")}return Ou=l,Ou}var Lu,ev;function lS(){if(ev)return Lu;ev=1;var l="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",o="\\u20d0-\\u20ff",i=e+t+o,a="\\ufe0e\\ufe0f",c="\\u200d",d=RegExp("["+c+l+i+a+"]");function h(g){return d.test(g)}return Lu=h,Lu}var Du,tv;function aS(){if(tv)return Du;tv=1;var l="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",o="\\u20d0-\\u20ff",i=e+t+o,a="\\ufe0e\\ufe0f",c="["+l+"]",d="["+i+"]",h="\\ud83c[\\udffb-\\udfff]",g="(?:"+d+"|"+h+")",v="[^"+l+"]",y="(?:\\ud83c[\\udde6-\\uddff]){2}",b="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",w=g+"?",T="["+a+"]?",C="(?:"+x+"(?:"+[v,y,b].join("|")+")"+T+w+")*",O=T+w+C,L="(?:"+[v+d+"?",d,y,b,c].join("|")+")",U=RegExp(h+"(?="+h+")|"+L+O,"g");function H(Y){return Y.match(U)||[]}return Du=H,Du}var Pu,nv;function cS(){if(nv)return Pu;nv=1;var l=sS(),e=lS(),t=aS();function o(i){return e(i)?t(i):l(i)}return Pu=o,Pu}var Mu,rv;function uS(){if(rv)return Mu;rv=1;function l(e,t){for(var o=-1,i=e==null?0:e.length,a=Array(i);++o<i;)a[o]=t(e[o],o,e);return a}return Mu=l,Mu}var Fu,ov;function dS(){if(ov)return Fu;ov=1;var l=uS();function e(t,o){return l(o,function(i){return t[i]})}return Fu=e,Fu}var zu,iv;function fS(){if(iv)return zu;iv=1;var l=dS(),e=am();function t(o){return o==null?[]:l(o,e(o))}return zu=t,zu}var Hu,sv;function hS(){if(sv)return Hu;sv=1;var l=Ji(),e=Nm(),t=Wa(),o=Jr(),i=km(),a=iS(),c=$g(),d=Xg(),h=cS(),g=fS(),v="[object Map]",y="[object Set]",b=l?l.iterator:void 0;function x(w){if(!w)return[];if(o(w))return i(w)?h(w):e(w);if(b&&w[b])return a(w[b]());var T=t(w),C=T==v?c:T==y?d:g;return C(w)}return Hu=x,Hu}var pS=hS();const gS=Oe(pS);var lv=(l=>(l.VERBOSE="VERBOSE",l.INFO="INFO",l.WARN="WARN",l.ERROR="ERROR",l))(lv||{});const as=()=>"0.2.1-beta.0",se={BACKSPACE:8,TAB:9,ENTER:13,LEFT:37,UP:38,DOWN:40,RIGHT:39,DELETE:46},mS={LEFT:0},vS=1e8,yS=16,Qt=(()=>{try{return Function("return this")()}catch(l){return}})();Qt&&typeof Qt.window=="undefined"&&(Qt.window=Qt);const cs=()=>{if(Qt!=null&&Qt.window)return Qt.window},av=()=>{if(Qt!=null&&Qt.navigator)return Qt.navigator;const l=cs();return l==null?void 0:l.navigator},qo=(l,e,t="log",o,i="color: inherit")=>{const a=typeof console=="undefined"?void 0:console;if(!a||typeof a[t]!="function")return;const c=["info","log","warn","error"].includes(t),d=[];switch(qo.logLevel){case"ERROR":if(t!=="error")return;break;case"WARN":if(!["error","warn"].includes(t))return;break;case"INFO":if(!c||l)return;break}o&&d.push(o);const h=`Blok ${as()}`,g=`line-height: 1em;
3
2
  color: #006FEA;
4
3
  display: inline-block;
5
4
  font-size: 11px;
@@ -8,46 +7,167 @@
8
7
  padding: 4px 9px;
9
8
  border-radius: 30px;
10
9
  border: 1px solid rgba(56, 138, 229, 0.16);
11
- margin: 4px 5px 4px 0;`,d=(()=>n?s?(a.unshift(c,r),`%c${l}%c ${e}`):`( ${l} )${e}`:e)(),u=(()=>s?o!==void 0?[`${d} %o`,...a]:[d,...a]:[d])();try{i[t](...u)}catch{}};At.logLevel="VERBOSE";const Oy=n=>{At.logLevel=n},$=(n,e="log",t,o)=>{At(!1,n,e,t,o)},Ee=(n,e="log",t,o)=>{At(!0,n,e,t,o)},j=n=>tn(n),W=n=>cs(n),we=n=>ds(n),Rs=n=>Id(n),Ls=n=>um(n),Ny=function(n){return Am(n)},Q=n=>Sh(n),Ps=n=>By(n),gn=(n,e)=>function(...t){Sd(()=>n.apply(this,t),e)},Ry=n=>n.name.split(".").pop()??"",Ly=n=>/^[-\w]+\/([-+\w]+|\*)$/.test(n),Ms=(n,e,t)=>{const o={timeoutId:null};return function(...r){const i=()=>{o.timeoutId=null,t!==!0&&n.apply(this,r)},s=t===!0&&o.timeoutId===null;o.timeoutId!==null&&clearTimeout(o.timeoutId),o.timeoutId=setTimeout(i,e),s&&n.apply(this,r)}},To=(n,e,t)=>xb(n,e,t),Py=()=>{var r;const n={win:!1,mac:!1,x11:!1,linux:!1},e=Ns(),t=((r=e==null?void 0:e.userAgent)==null?void 0:r.toLowerCase())??"",o=t?Object.keys(n).find(i=>t.indexOf(i)!==-1):void 0;return o!==void 0&&(n[o]=!0),n},mn=n=>n&&n.slice(0,1).toUpperCase()+n.slice(1),My=(n,e)=>{if(Array.isArray(e))return e},It=(n,...e)=>!W(n)||e.length===0?n:e.reduce((t,o)=>W(o)?hb(t,o,My):t,n),ko=n=>{const e=Py(),t=n.replace(/shift/gi,"⇧").replace(/backspace/gi,"⌫").replace(/enter/gi,"⏎").replace(/up/gi,"↑").replace(/left/gi,"→").replace(/down/gi,"↓").replace(/right/gi,"←").replace(/escape/gi,"⎋").replace(/insert/gi,"Ins").replace(/delete/gi,"␡").replace(/\+/gi," + ");return e.mac?t.replace(/ctrl|cmd/gi,"⌘").replace(/alt/gi,"⌥"):t.replace(/cmd/gi,"Ctrl").replace(/windows/gi,"WIN")},Dy=n=>{try{return new URL(n).href}catch{}const e=pn();return n.substring(0,2)==="//"?e?`${e.location.protocol}${n}`:n:e?`${e.location.origin}${n}`:n},$y=()=>Sl(10),Fy=n=>{const e=pn();e&&e.open(n,"_blank")},Hy=(n="")=>`${n}${Math.floor(Math.random()*Ay).toString(Iy)}`,Ds=650,ut=()=>{const n=pn();return!n||typeof n.matchMedia!="function"?!1:n.matchMedia(`(max-width: ${Ds}px)`).matches},wo=(()=>{const n=Ns();if(!n)return!1;const e=n.userAgent||"",t=n.userAgentData,o=t==null?void 0:t.platform;return!!(/iP(ad|hone|od)/.test(e)||o!==void 0&&o!==""&&/iP(ad|hone|od)/.test(o)||((n.maxTouchPoints??0)>1?(o!==void 0&&o!==""?o:void 0)??(()=>n.platform)():void 0)==="MacIntel")})(),jy=(n,e)=>sm(n,e);class v{static isSingleTag(e){return!!e.tagName&&["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"].includes(e.tagName)}static isLineBreakTag(e){return!!e&&["BR","WBR"].includes(e.tagName)}static make(e,t=null,o={}){const r=document.createElement(e);if(Array.isArray(t)){const i=t.filter(s=>s!==void 0);r.classList.add(...i)}typeof t=="string"&&r.classList.add(t);for(const i in o){if(!Object.prototype.hasOwnProperty.call(o,i))continue;const s=o[i];if(s!=null){if(i in r){r[i]=s;continue}r.setAttribute(i,String(s))}}return r}static text(e){return document.createTextNode(e)}static append(e,t){Array.isArray(t)?t.forEach(o=>e.appendChild(o)):e.appendChild(t)}static prepend(e,t){Array.isArray(t)?[...t].reverse().forEach(r=>e.prepend(r)):e.prepend(t)}static find(e=document,t){return e.querySelector(t)}static get(e){return document.getElementById(e)}static findAll(e=document,t){return e.querySelectorAll(t)}static get allInputsSelector(){return"[contenteditable=true], textarea, input:not([type]), "+["text","password","email","number","search","tel","url"].map(t=>`input[type="${t}"]`).join(", ")}static findAllInputs(e){return Ps(e.querySelectorAll(v.allInputsSelector)).reduce((t,o)=>v.isNativeInput(o)||v.containsOnlyInlineElements(o)?[...t,o]:[...t,...v.getDeepestBlockElements(o)],[])}static getDeepestNode(e,t=!1){var d;const o=t?"lastChild":"firstChild",r=t?"previousSibling":"nextSibling";if(e===null||e.nodeType!==Node.ELEMENT_NODE)return e;const i=e[o];if(i===null)return e;const s=i;if(!(v.isSingleTag(s)&&!v.isNativeInput(s)&&!v.isLineBreakTag(s)))return this.getDeepestNode(s,t);const l=s[r];if(l)return this.getDeepestNode(l,t);const c=(d=s.parentNode)==null?void 0:d[r];return c?this.getDeepestNode(c,t):s.parentNode}static isElement(e){return Ls(e)?!1:e!=null&&e.nodeType!=null&&e.nodeType===Node.ELEMENT_NODE}static isFragment(e){return Ls(e)?!1:e!=null&&e.nodeType!=null&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}static isContentEditable(e){return e.contentEditable==="true"}static isNativeInput(e){const t=["INPUT","TEXTAREA"];return e!=null&&typeof e.tagName=="string"?t.includes(e.tagName):!1}static canSetCaret(e){return v.isNativeInput(e)?!new Set(["file","checkbox","radio","hidden","submit","button","image","reset"]).has(e.type):v.isContentEditable(e)}static isNodeEmpty(e,t){var i;if(this.isSingleTag(e)&&!this.isLineBreakTag(e))return!1;const o=this.isElement(e)&&this.isNativeInput(e)?e.value:(i=e.textContent)==null?void 0:i.replace("​",""),r=t?o==null?void 0:o.replace(new RegExp(t,"g"),""):o;return((r==null?void 0:r.length)??0)===0}static isLeaf(e){return e?e.childNodes.length===0:!1}static isEmpty(e,t){const o=[e];for(;o.length>0;){const r=o.shift();if(r){if(this.isLeaf(r)&&!this.isNodeEmpty(r,t))return!1;r.childNodes&&o.push(...Array.from(r.childNodes))}}return!0}static isHTMLString(e){const t=v.make("div");return t.innerHTML=e,t.childElementCount>0}static getContentLength(e){var t;return v.isNativeInput(e)?e.value.length:e.nodeType===Node.TEXT_NODE?e.length:((t=e.textContent)==null?void 0:t.length)??0}static get blockElements(){return["address","article","aside","blockquote","canvas","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","noscript","ol","output","p","pre","ruby","section","table","tbody","thead","tr","tfoot","ul","video"]}static containsOnlyInlineElements(e){const t=we(e)?(()=>{const r=document.createElement("div");return r.innerHTML=e,r})():e,o=r=>!v.blockElements.includes(r.tagName.toLowerCase())&&Array.from(r.children).every(o);return Array.from(t.children).every(o)}static getDeepestBlockElements(e){return v.containsOnlyInlineElements(e)?[e]:Array.from(e.children).reduce((t,o)=>[...t,...v.getDeepestBlockElements(o)],[])}static getHolder(e){if(!we(e))return e;const t=document.getElementById(e);if(t!==null)return t;throw new Error(`Element with id "${e}" not found`)}static isAnchor(e){return e.tagName.toLowerCase()==="a"}static offset(e){const t=e.getBoundingClientRect(),o=window.scrollX||document.documentElement.scrollLeft,r=window.scrollY||document.documentElement.scrollTop,i=t.top+r,s=t.left+o;return{top:i,left:s,bottom:i+t.height,right:s+t.width}}static getNodeByOffset(e,t){const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null),r=(c,d,u,h)=>{if(!c&&u){const b=d-h,E=Math.max(t-b,0),k=Math.min(E,h);return{node:u,offset:k}}if(!c)return{node:null,offset:0};const f=(c.textContent??"").length;return d+f>=t?{node:c,offset:Math.min(t-d,f)}:r(o.nextNode(),d+f,c,f)},i=o.nextNode(),{node:s,offset:a}=r(i,0,null,0);if(!s)return{node:null,offset:0};const l=s.textContent;return!l||l.length===0?{node:null,offset:0}:{node:s,offset:a}}}const Co=n=>!/[^\t\n\r \u200B]/.test(n),zy=n=>{const e=window.getComputedStyle(n),t=parseFloat(e.fontSize),o=parseFloat(e.lineHeight)||t*1.2,r=parseFloat(e.paddingTop),i=parseFloat(e.borderTopWidth),s=parseFloat(e.marginTop),a=t*.8,l=(o-t)/2;return s+i+r+l+a},$s=n=>{const{dataset:e}=n;e.empty=v.isEmpty(n)?"true":"false"},Fs={ui:{blockTunes:{toggler:{"Click to tune":""}},inlineToolbar:{converter:{"Convert to":""}},toolbar:{toolbox:{Add:""}},popover:{Filter:"","Nothing found":"","Convert to":""}},toolNames:{Text:"",Link:"",Bold:"",Italic:""},tools:{link:{"Add a link":""},stub:{"The block can not be displayed correctly.":""}},blockTunes:{delete:{Delete:"","Click to delete":""},moveUp:{"Move up":""},moveDown:{"Move down":""}}},ht=class{static ui(n,e){return ht._t(n,e)}static t(n,e){return ht._t(n,e)}static setDictionary(n){ht.currentDictionary=n}static _t(n,e){const t=ht.getNamespace(n);return!t||!t[e]?e:t[e]}static getNamespace(n){return n.split(".").reduce((t,o)=>{if(!t||!Object.keys(t).length)return{};const r=t[o];return typeof r=="string"?{}:r},ht.currentDictionary)}};let ne=ht;ne.currentDictionary=Fs;class Ot extends Error{}class Nt{constructor(){this.subscribers={}}on(e,t){e in this.subscribers||(this.subscribers[e]=[]),this.subscribers[e].push(t)}once(e,t){e in this.subscribers||(this.subscribers[e]=[]);const o=r=>{const i=t(r),s=this.subscribers[e].indexOf(o);return s!==-1&&this.subscribers[e].splice(s,1),i};this.subscribers[e].push(o)}emit(e,t){Q(this.subscribers)||!this.subscribers[e]||this.subscribers[e].reduce((o,r)=>{const i=r(o);return i!==void 0?i:o},t)}off(e,t){const o=this.subscribers[e];if(o===void 0){console.warn(`EventDispatcher .off(): there is no subscribers for event "${e.toString()}". Probably, .off() called before .on()`);return}const r=o.indexOf(t);r!==-1&&o.splice(r,1)}destroy(){this.subscribers={}}}const Le=function(e){return Object.setPrototypeOf(this,{get id(){return e.id},get name(){return e.name},get config(){return e.config},get holder(){return e.holder},get isEmpty(){return e.isEmpty},get selected(){return e.selected},set stretched(o){e.setStretchState(o)},get stretched(){return e.stretched},get focusable(){return e.focusable},call(o,r){return e.call(o,r)},save(){return e.save()},validate(o){return e.validate(o)},dispatchChange(){e.dispatchChange()},getActiveToolboxEntry(){return e.getActiveToolboxEntry()}}),Object.defineProperties(this,{id:{get(){return e.id},enumerable:!0,configurable:!0},name:{get(){return e.name},enumerable:!0,configurable:!0}}),this};class Rt{constructor(){this.allListeners=[]}on(e,t,o,r=!1){if(this.findOne(e,t,o,r))return;const s=Hy("l"),a={id:s,element:e,eventType:t,handler:o,options:r};return this.allListeners.push(a),e.addEventListener(t,o,r),s}off(e,t,o,r){const i=this.findAll(e,t,o,r);i.forEach((s,a)=>{const l=this.allListeners.indexOf(i[a]);l>-1&&(this.allListeners.splice(l,1),s.element.removeEventListener(s.eventType,s.handler,s.options))})}offById(e){const t=this.findById(e);if(!t)return;t.element.removeEventListener(t.eventType,t.handler,t.options);const o=this.allListeners.indexOf(t);o>-1&&this.allListeners.splice(o,1)}findOne(e,t,o,r){return this.findAll(e,t,o,r)[0]??null}findAll(e,t,o,r){return e?this.findByEventTarget(e).filter(s=>{const a=t===void 0||s.eventType===t,l=o===void 0||s.handler===o,c=this.areOptionsEqual(s.options,r);return a&&l&&c}):[]}removeAll(){this.allListeners.forEach(e=>{e.element.removeEventListener(e.eventType,e.handler,e.options)}),this.allListeners=[]}destroy(){this.removeAll()}findByEventTarget(e){return this.allListeners.filter(t=>t.element===e)}findByType(e){return this.allListeners.filter(t=>t.eventType===e)}findByHandler(e){return this.allListeners.filter(t=>t.handler===e)}findById(e){return this.allListeners.find(t=>t.id===e)}normalizeListenerOptions(e){return typeof e=="boolean"?{capture:e,once:!1,passive:!1}:e?{capture:e.capture??!1,once:e.once??!1,passive:e.passive??!1,signal:e.signal}:{capture:!1,once:!1,passive:!1}}areOptionsEqual(e,t){if(t===void 0)return!0;const o=this.normalizeListenerOptions(e),r=this.normalizeListenerOptions(t);return o.capture===r.capture&&o.once===r.once&&o.passive===r.passive&&o.signal===r.signal}}class F{constructor({config:e,eventsDispatcher:t}){if(this.nodes={},this.listeners=new Rt,this.readOnlyMutableListeners={on:(o,r,i,s=!1)=>{const a=this.listeners.on(o,r,i,s);a&&this.mutableListenerIds.push(a)},clearAll:()=>{for(const o of this.mutableListenerIds)this.listeners.offById(o);this.mutableListenerIds=[]}},this.mutableListenerIds=[],new.target===F)throw new TypeError("Constructors for abstract class Module are not allowed.");this.config=e,this.eventsDispatcher=t,this.Editor={}}set state(e){this.Editor=e}removeAllNodes(){for(const e in this.nodes){const t=this.nodes[e];t instanceof HTMLElement&&t.remove()}}get isRtl(){var e;return((e=this.config.i18n)==null?void 0:e.direction)==="rtl"}}class w{constructor(){this.instance=null,this.selection=null,this.savedSelectionRange=null,this.isFakeBackgroundEnabled=!1,this.fakeBackgroundElements=[]}static get CSS(){return{editorWrapper:"codex-editor",editorZone:"codex-editor__redactor"}}static get anchorNode(){const e=window.getSelection();return e?e.anchorNode:null}static get anchorElement(){const e=window.getSelection();if(!e)return null;const t=e.anchorNode;return t?v.isElement(t)?t:t.parentElement:null}static get anchorOffset(){const e=window.getSelection();return e?e.anchorOffset:null}static get isCollapsed(){const e=window.getSelection();return e?e.isCollapsed:null}static get isAtEditor(){return this.isSelectionAtEditor(w.get())}static isSelectionAtEditor(e){if(!e)return!1;const t=e.anchorNode||e.focusNode,o=t&&t.nodeType===Node.TEXT_NODE?t.parentNode:t,r=o&&o instanceof Element?o.closest(`.${w.CSS.editorZone}`):null;return r?r.nodeType===Node.ELEMENT_NODE:!1}static isRangeAtEditor(e){if(!e)return;const t=e.startContainer&&e.startContainer.nodeType===Node.TEXT_NODE?e.startContainer.parentNode:e.startContainer,o=t&&t instanceof Element?t.closest(`.${w.CSS.editorZone}`):null;return o?o.nodeType===Node.ELEMENT_NODE:!1}static get isSelectionExists(){const e=w.get();return!!(e!=null&&e.anchorNode)}static get range(){return this.getRangeFromSelection(this.get())}static getRangeFromSelection(e){return e&&e.rangeCount?e.getRangeAt(0):null}static get rect(){const e=document.selection,t={x:0,y:0,width:0,height:0};if(e&&e.type!=="Control"){const a=e.createRange();return t.x=a.boundingLeft,t.y=a.boundingTop,t.width=a.boundingWidth,t.height=a.boundingHeight,t}const o=window.getSelection();if(!o)return $("Method window.getSelection returned null","warn"),t;if(o.rangeCount===null||isNaN(o.rangeCount))return $("Method SelectionUtils.rangeCount is not supported","warn"),t;if(o.rangeCount===0)return t;const r=o.getRangeAt(0).cloneRange(),i=r.getBoundingClientRect();if(i.x===0&&i.y===0){const s=document.createElement("span");s.appendChild(document.createTextNode("​")),r.insertNode(s);const a=s.getBoundingClientRect(),l=s.parentNode;return l==null||l.removeChild(s),l==null||l.normalize(),a}return i}static get text(){const e=window.getSelection();return(e==null?void 0:e.toString())??""}static get(){return window.getSelection()}static setCursor(e,t=0){const o=document.createRange(),r=window.getSelection(),i=v.isNativeInput(e);if(i&&!v.canSetCaret(e))return e.getBoundingClientRect();if(i){const s=e;return s.focus(),s.selectionStart=t,s.selectionEnd=t,s.getBoundingClientRect()}return o.setStart(e,t),o.setEnd(e,t),r?(r.removeAllRanges(),r.addRange(o),o.getBoundingClientRect()):e.getBoundingClientRect()}static isRangeInsideContainer(e){const t=w.range;return t===null?!1:e.contains(t.startContainer)}static addFakeCursor(){const e=w.range;if(e===null)return;const t=v.make("span","codex-editor__fake-cursor");t.dataset.mutationFree="true",e.collapse(),e.insertNode(t)}static isFakeCursorInsideContainer(e){return v.find(e,".codex-editor__fake-cursor")!==null}static removeFakeCursor(e=document.body){const t=v.find(e,".codex-editor__fake-cursor");t&&t.remove()}removeFakeBackground(){var i;if(!this.fakeBackgroundElements.length){this.isFakeBackgroundEnabled=!1;return}const e=this.fakeBackgroundElements[0],t=this.fakeBackgroundElements[this.fakeBackgroundElements.length-1],o=e.firstChild,r=t.lastChild;if(this.fakeBackgroundElements.forEach(s=>{this.unwrapFakeBackground(s)}),o&&r){const s=document.createRange();s.setStart(o,0),s.setEnd(r,((i=r.textContent)==null?void 0:i.length)||0),this.savedSelectionRange=s}this.fakeBackgroundElements=[],this.isFakeBackgroundEnabled=!1}setFakeBackground(){this.removeFakeBackground();const e=window.getSelection();if(!e||e.rangeCount===0)return;const t=e.getRangeAt(0);if(t.collapsed)return;const o=this.collectTextNodes(t);if(o.length===0)return;const r=t.startContainer,i=t.startOffset,s=t.endContainer,a=t.endOffset;if(this.fakeBackgroundElements=[],o.forEach(c=>{var E;const d=document.createRange(),u=c===r,h=c===s,g=u?i:0,f=((E=c.textContent)==null?void 0:E.length)??0,m=h?a:f;if(g===m)return;d.setStart(c,g),d.setEnd(c,m);const b=this.wrapRangeWithFakeBackground(d);b&&this.fakeBackgroundElements.push(b)}),!this.fakeBackgroundElements.length)return;const l=document.createRange();l.setStartBefore(this.fakeBackgroundElements[0]),l.setEndAfter(this.fakeBackgroundElements[this.fakeBackgroundElements.length-1]),e.removeAllRanges(),e.addRange(l),this.isFakeBackgroundEnabled=!0}collectTextNodes(e){const t=[],{commonAncestorContainer:o}=e;if(o.nodeType===Node.TEXT_NODE)return t.push(o),t;const r=document.createTreeWalker(o,NodeFilter.SHOW_TEXT,{acceptNode:i=>e.intersectsNode(i)&&i.textContent&&i.textContent.length>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});for(;r.nextNode();)t.push(r.currentNode);return t}wrapRangeWithFakeBackground(e){if(e.collapsed)return null;const t=v.make("span","codex-editor__fake-background");t.dataset.fakeBackground="true",t.dataset.mutationFree="true",t.style.backgroundColor="#a8d6ff",t.style.color="inherit",t.style.display="inline",t.style.padding="0",t.style.margin="0";const o=e.extractContents();return o.childNodes.length===0?null:(t.appendChild(o),e.insertNode(t),t)}unwrapFakeBackground(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}save(){this.savedSelectionRange=w.range}restore(){if(!this.savedSelectionRange)return;const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(this.savedSelectionRange))}clearSaved(){this.savedSelectionRange=null}collapseToEnd(){const e=window.getSelection();if(!e||!e.focusNode)return;const t=document.createRange();t.selectNodeContents(e.focusNode),t.collapse(!1),e.removeAllRanges(),e.addRange(t)}findParentTag(e,t,o=10){const r=window.getSelection();if(!r||!r.anchorNode||!r.focusNode)return null;const i=[r.anchorNode,r.focusNode],s=a=>{const l=(c,d)=>{if(d<=0||!c.parentNode)return null;const u=c.parentNode,h=!t||u.classList&&u.classList.contains(t);return u.tagName===e&&h?u:l(u,d-1)};return l(a,o)};for(const a of i){const l=s(a);if(l)return l}return null}expandToTag(e){const t=window.getSelection();if(!t)return;t.removeAllRanges();const o=document.createRange();o.selectNodeContents(e),t.addRange(o)}}const Wy=(n,e)=>{const{type:t,target:o,addedNodes:r,removedNodes:i}=n;return n.type==="attributes"&&n.attributeName==="data-empty"?!1:e.contains(o)?!0:t!=="childList"?!1:Array.from(r).some(l=>l===e)?!0:Array.from(i).some(l=>l===e)},So="redactor dom changed",Hs="block changed",js="fake cursor is about to be toggled",zs="fake cursor have been set",Lt="editor mobile layout toggled",xo="block-settings-opened",Bo="block-settings-closed",_o=(n,e)=>{if(!n.conversionConfig)return!1;const t=n.conversionConfig[e];return j(t)||we(t)},vn=(n,e)=>_o(n.tool,e),Ws=(n,e)=>Object.entries(n).some(([t,o])=>e[t]&&jy(e[t],o)),Us=async(n,e)=>{const o=(await n.save()).data,r=e.find(i=>i.name===n.name);return r!==void 0&&!_o(r,"export")?[]:e.reduce((i,s)=>{if(!_o(s,"import")||s.toolbox===void 0)return i;const a=s.toolbox.filter(l=>{if(Q(l)||l.icon===void 0)return!1;const c=l.data!==void 0;return!(c&&Ws(l.data,o)||!c&&s.name===n.name)});return i.push({...s,toolbox:a}),i},[])},Ks=(n,e)=>n.mergeable?n.name===e.name?!0:vn(e,"export")&&vn(n,"import"):!1,Uy=(n,e)=>{const t=e==null?void 0:e.export;return j(t)?t(n):we(t)?n[t]:(t!==void 0&&$("Conversion «export» property must be a string or function. String means key of saved data object to export. Function should export processed string to export."),"")},Gs=(n,e,t)=>{const o=e==null?void 0:e.import;return j(o)?o(n,t):we(o)?{[o]:n}:(o!==void 0&&$("Conversion «import» property must be a string or function. String means key of tool data to import. Function accepts a imported string and return composed tool data."),{})};var oe=(n=>(n.Default="default",n.Separator="separator",n.Html="html",n))(oe||{});const ft="data-block-tool";var Pe=(n=>(n.RENDERED="rendered",n.MOVED="moved",n.UPDATED="updated",n.REMOVED="removed",n.ON_PASTE="onPaste",n))(Pe||{});class re extends Nt{constructor({id:e=$y(),data:t,tool:o,readOnly:r,tunesData:i},s){super(),this.cachedInputs=[],this.lastSavedTunes={},this.toolRenderedElement=null,this.tunesInstances=new Map,this.defaultTunesInstances=new Map,this.unavailableTunesData={},this.inputIndex=0,this.editorEventBus=null,this.redactorDomChangedCallback=()=>{},this.handleFocus=()=>{this.dropInputsCache(),this.updateCurrentInput()},this.didMutated=(l=void 0)=>{const c=l===void 0,d=l instanceof InputEvent;!c&&!d&&this.detectToolRootChange(l),(()=>c||d?!0:!(l.length>0&&l.every(g=>{const{addedNodes:f,removedNodes:m,target:b}=g;return[...Array.from(f),...Array.from(m),b].some(k=>{const N=v.isElement(k)?k:k.parentElement??null;return N===null?!1:N.closest('[data-mutation-free="true"]')!==null})})))()&&(this.dropInputsCache(),this.updateCurrentInput(),this.toggleInputsEmptyMark(),this.call("updated"),this.emit("didMutated",this))},this.name=o.name,this.id=e,this.settings=o.settings,this.config=this.settings,this.editorEventBus=s||null,this.blockAPI=new Le(this),this.lastSavedData=t??{},this.lastSavedTunes=i??{},this.tool=o,this.toolInstance=o.create(t,this.blockAPI,r),this.tunes=o.tunes,this.composeTunes(i);const a=this.compose();if(a==null)throw new Error(`Tool "${this.name}" did not return a block holder element during render()`);this.holder=a,window.requestIdleCallback(()=>{this.watchBlockMutations(),this.addInputEvents(),this.toggleInputsEmptyMark()})}static get CSS(){return{wrapper:"ce-block",wrapperStretched:"ce-block--stretched",content:"ce-block__content",selected:"ce-block--selected"}}call(e,t){const o=this.toolInstance[e];if(j(o))try{o.call(this.toolInstance,t)}catch(r){const i=r instanceof Error?r.message:String(r);$(`Error during '${e}' call: ${i}`,"error")}}async mergeWith(e){if(!j(this.toolInstance.merge))throw new Error(`Block tool "${this.name}" does not support merging`);await this.toolInstance.merge(e)}async save(){const e=await this.extractToolData();if(e===void 0)return;const t={...this.unavailableTunesData};[...this.tunesInstances.entries(),...this.defaultTunesInstances.entries()].forEach(([i,s])=>{if(j(s.save))try{t[i]=s.save()}catch(a){$(`Tune ${s.constructor.name} save method throws an Error %o`,"warn",a)}});const o=window.performance.now();this.lastSavedData=e,this.lastSavedTunes={...t};const r=window.performance.now();return{id:this.id,tool:this.name,data:e,tunes:t,time:r-o}}async extractToolData(){try{const e=await this.toolInstance.save(this.pluginsContent);if(!this.isEmpty||e===void 0||e===null||typeof e!="object")return e;const t={...e},o=r=>{const i=t[r];if(typeof i!="string")return;const s=document.createElement("div");s.innerHTML=i,v.isEmpty(s)&&(t[r]="")};return o("text"),o("html"),t}catch(e){const t=e instanceof Error?e:new Error(String(e));$(`Saving process for ${this.name} tool failed due to the ${t}`,"log",t);return}}async validate(e){return this.toolInstance.validate instanceof Function?await this.toolInstance.validate(e):!0}getTunes(){const e=[],t=[],o=(s,a)=>{if(s){if(v.isElement(s)){a.push({type:oe.Html,element:s});return}if(Array.isArray(s)){a.push(...s);return}a.push(s)}},r=typeof this.toolInstance.renderSettings=="function"?this.toolInstance.renderSettings():[];return o(r,e),[...this.tunesInstances.values(),...this.defaultTunesInstances.values()].map(s=>s.render()).forEach(s=>{o(s,t)}),{toolTunes:e,commonTunes:t}}updateCurrentInput(){const e=w.anchorNode,t=document.activeElement,o=i=>{if(!i)return;const s=i instanceof HTMLElement?i:i.parentElement;if(s===null)return;const a=this.inputs.find(d=>d===s||d.contains(s));if(a!==void 0)return a;const l=s.closest(v.allInputsSelector);if(!(l instanceof HTMLElement))return;const c=this.inputs.find(d=>d===l);if(c!==void 0)return c};if(v.isNativeInput(t)){this.currentInput=t;return}const r=o(e)??(t instanceof HTMLElement?o(t):void 0);if(r!==void 0){this.currentInput=r;return}t instanceof HTMLElement&&this.inputs.includes(t)&&(this.currentInput=t)}dispatchChange(){this.didMutated()}destroy(){this.unwatchBlockMutations(),this.removeInputEvents(),super.destroy(),j(this.toolInstance.destroy)&&this.toolInstance.destroy()}async getActiveToolboxEntry(){const e=this.tool.toolbox;if(!e)return;if(e.length===1)return Promise.resolve(e[0]);const t=await this.data;return e.find(o=>Ws(o.data,t))}async exportDataAsString(){const e=await this.data;return Uy(e,this.tool.conversionConfig)}get inputs(){if(this.cachedInputs.length!==0)return this.cachedInputs;const e=v.findAllInputs(this.holder);return this.inputIndex>e.length-1&&(this.inputIndex=e.length-1),this.cachedInputs=e,e}get currentInput(){return this.inputs[this.inputIndex]}set currentInput(e){if(e===void 0)return;const t=this.inputs.findIndex(o=>o===e||o.contains(e));t!==-1&&(this.inputIndex=t)}get firstInput(){return this.inputs[0]}get lastInput(){const e=this.inputs;return e[e.length-1]}get nextInput(){return this.inputs[this.inputIndex+1]}get previousInput(){return this.inputs[this.inputIndex-1]}get data(){return this.save().then(e=>e&&!Q(e.data)?e.data:{})}get preservedData(){return this.lastSavedData??{}}get preservedTunes(){return this.lastSavedTunes??{}}get sanitize(){return this.tool.sanitizeConfig}get mergeable(){return j(this.toolInstance.merge)}get focusable(){return this.inputs.length!==0}get isEmpty(){const e=v.isEmpty(this.pluginsContent,"/"),t=!this.hasMedia;return e&&t}get hasMedia(){const e=["img","iframe","video","audio","source","input","textarea","twitterwidget"];return!!this.holder.querySelector(e.join(","))}set selected(e){var r,i;this.holder.classList.toggle(re.CSS.selected,e);const t=e===!0&&w.isRangeInsideContainer(this.holder),o=e===!1&&w.isFakeCursorInsideContainer(this.holder);!t&&!o||((r=this.editorEventBus)==null||r.emit(js,{state:e}),t&&w.addFakeCursor(),o&&w.removeFakeCursor(this.holder),(i=this.editorEventBus)==null||i.emit(zs,{state:e}))}get selected(){return this.holder.classList.contains(re.CSS.selected)}setStretchState(e){this.holder.classList.toggle(re.CSS.wrapperStretched,e)}set stretched(e){this.setStretchState(e)}get stretched(){return this.holder.classList.contains(re.CSS.wrapperStretched)}get pluginsContent(){if(this.toolRenderedElement===null)throw new Error("Block pluginsContent is not yet initialized");return this.toolRenderedElement}compose(){const e=v.make("div",re.CSS.wrapper),t=v.make("div",re.CSS.content),o=this.toolInstance.render();this.name&&!e.hasAttribute(ft)&&e.setAttribute(ft,this.name),e.dataset.id=this.id,o instanceof Promise?o.then(i=>{this.toolRenderedElement=i,this.addToolDataAttributes(i,e),t.appendChild(i)}).catch(i=>{$("Tool render promise rejected: %o","error",i)}):(this.toolRenderedElement=o,this.addToolDataAttributes(o,e),t.appendChild(o));const r=[...this.tunesInstances.values(),...this.defaultTunesInstances.values()].reduce((i,s)=>{if(j(s.wrap))try{return s.wrap(i)}catch(a){return $(`Tune ${s.constructor.name} wrap method throws an Error %o`,"warn",a),i}return i},t);return e.appendChild(r),e}addToolDataAttributes(e,t){var s;this.name&&!t.hasAttribute(ft)&&t.setAttribute(ft,this.name),this.name&&!e.hasAttribute(ft)&&e.setAttribute(ft,this.name);const o="data-placeholder",r=(s=this.config)==null?void 0:s.placeholder,i=typeof r=="string"?r.trim():"";if(i.length>0){e.setAttribute(o,i);return}r===!1&&e.hasAttribute(o)&&e.removeAttribute(o)}composeTunes(e){Array.from(this.tunes.values()).forEach(t=>{(t.isInternal?this.defaultTunesInstances:this.tunesInstances).set(t.name,t.create(e[t.name],this.blockAPI))}),Object.entries(e).forEach(([t,o])=>{this.tunesInstances.has(t)||(this.unavailableTunesData[t]=o)})}addInputEvents(){this.inputs.forEach(e=>{e.addEventListener("focus",this.handleFocus),v.isNativeInput(e)&&e.addEventListener("input",this.didMutated)})}removeInputEvents(){this.inputs.forEach(e=>{e.removeEventListener("focus",this.handleFocus),v.isNativeInput(e)&&e.removeEventListener("input",this.didMutated)})}watchBlockMutations(){var e;this.redactorDomChangedCallback=t=>{const{mutations:o}=t,r=this.toolRenderedElement;r!==null&&o.some(s=>Wy(s,r))&&this.didMutated(o)},(e=this.editorEventBus)==null||e.on(So,this.redactorDomChangedCallback)}unwatchBlockMutations(){var e;(e=this.editorEventBus)==null||e.off(So,this.redactorDomChangedCallback)}detectToolRootChange(e){const t=this.toolRenderedElement;t!==null&&e.forEach(o=>{if(Array.from(o.removedNodes).includes(t)){const i=o.addedNodes[o.addedNodes.length-1];this.toolRenderedElement=i}})}dropInputsCache(){this.cachedInputs=[]}toggleInputsEmptyMark(){this.inputs.forEach($s)}}class Ky extends F{constructor(){super(...arguments),this.insert=(e,t={},o={},r,i,s,a)=>{const l=e??this.config.defaultBlock,c=this.Editor.BlockManager.insert({id:a,tool:l,data:t,index:r,needToFocus:i,replace:s});return new Le(c)},this.composeBlockData=async e=>{const t=this.Editor.Tools.blockTools.get(e);if(t===void 0)throw new Error(`Block Tool with type "${e}" not found`);return new re({tool:t,api:this.Editor.API,readOnly:!0,data:{},tunesData:{}}).data},this.update=async(e,t,o)=>{const{BlockManager:r}=this.Editor,i=r.getBlockById(e);if(i===void 0)throw new Error(`Block with id "${e}" not found`);const s=await r.update(i,t,o);return new Le(s)},this.convert=async(e,t,o)=>{var u,h;const{BlockManager:r,Tools:i}=this.Editor,s=r.getBlockById(e);if(!s)throw new Error(`Block with id "${e}" not found`);const a=i.blockTools.get(s.name),l=i.blockTools.get(t);if(!l)throw new Error(`Block Tool with type "${t}" not found`);const c=((u=a==null?void 0:a.conversionConfig)==null?void 0:u.export)!==void 0,d=((h=l.conversionConfig)==null?void 0:h.import)!==void 0;if(c&&d){const g=await r.convert(s,t,o);return new Le(g)}else{const g=[c?!1:mn(s.name),d?!1:mn(t)].filter(Boolean).join(" and ");throw new Error(`Conversion from "${s.name}" to "${t}" is not possible. ${g} tool(s) should provide a "conversionConfig"`)}},this.insertMany=(e,t=this.Editor.BlockManager.blocks.length-1)=>{this.validateIndex(t);const o=e.map(({id:r,type:i,data:s})=>this.Editor.BlockManager.composeBlock({id:r,tool:i||this.config.defaultBlock,data:s}));return this.Editor.BlockManager.insertMany(o,t),o.map(r=>new Le(r))}}get methods(){return{clear:()=>this.clear(),render:e=>this.render(e),renderFromHTML:e=>this.renderFromHTML(e),delete:e=>this.delete(e),move:(e,t)=>this.move(e,t),getBlockByIndex:e=>this.getBlockByIndex(e),getById:e=>this.getById(e),getCurrentBlockIndex:()=>this.getCurrentBlockIndex(),getBlockIndex:e=>this.getBlockIndex(e),getBlocksCount:()=>this.getBlocksCount(),getBlockByElement:e=>this.getBlockByElement(e),insert:this.insert,insertMany:this.insertMany,update:this.update,composeBlockData:this.composeBlockData,convert:this.convert,stretchBlock:(e,t=!0)=>this.stretchBlock(e,t)}}getBlocksCount(){return this.Editor.BlockManager.blocks.length}getCurrentBlockIndex(){return this.Editor.BlockManager.currentBlockIndex}getBlockIndex(e){const t=this.Editor.BlockManager.getBlockById(e);if(!t){Ee("There is no block with id `"+e+"`","warn");return}return this.Editor.BlockManager.getBlockIndex(t)}getBlockByIndex(e){const t=this.Editor.BlockManager.getBlockByIndex(e);if(t===void 0){Ee("There is no block at index `"+e+"`","warn");return}return new Le(t)}getById(e){const t=this.Editor.BlockManager.getBlockById(e);return t===void 0?(Ee("There is no block with id `"+e+"`","warn"),null):new Le(t)}getBlockByElement(e){const t=this.Editor.BlockManager.getBlock(e);if(t===void 0){Ee("There is no block corresponding to element `"+e+"`","warn");return}return new Le(t)}move(e,t){this.Editor.BlockManager.move(e,t)}delete(e=this.Editor.BlockManager.currentBlockIndex){const t=this.Editor.BlockManager.getBlockByIndex(e);if(t===void 0){Ee(`There is no block at index \`${e}\``,"warn");return}try{this.Editor.BlockManager.removeBlock(t)}catch(o){Ee(o,"warn");return}this.Editor.BlockManager.blocks.length===0&&this.Editor.BlockManager.insert(),this.Editor.BlockManager.currentBlock&&this.Editor.Caret.setToBlock(this.Editor.BlockManager.currentBlock,this.Editor.Caret.positions.END),this.Editor.Toolbar.close()}async clear(){await this.Editor.BlockManager.clear(!0),this.Editor.InlineToolbar.close()}async render(e){if(e===void 0||e.blocks===void 0)throw new Error("Incorrect data passed to the render() method");this.Editor.ModificationsObserver.disable(),await this.Editor.BlockManager.clear(),await this.Editor.Renderer.render(e.blocks),this.Editor.ModificationsObserver.enable()}async renderFromHTML(e){return await this.Editor.BlockManager.clear(),this.Editor.Paste.processText(e,!0)}stretchBlock(e,t=!0){const o=this.Editor.BlockManager.getBlockByIndex(e);o&&o.setStretchState(t)}validateIndex(e){if(typeof e!="number")throw new Error("Index should be a number");if(e<0)throw new Error("Index should be greater than or equal to 0");if(e===null)throw new Error("Index should be greater than or equal to 0")}}const Gy=(n,e)=>typeof n=="number"?e.BlockManager.getBlockByIndex(n):typeof n=="string"?e.BlockManager.getBlockById(n):e.BlockManager.getBlockById(n.id);class Yy extends F{constructor(){super(...arguments),this.setToFirstBlock=(e=this.Editor.Caret.positions.DEFAULT,t=0)=>this.Editor.BlockManager.firstBlock?(this.Editor.Caret.setToBlock(this.Editor.BlockManager.firstBlock,e,t),!0):!1,this.setToLastBlock=(e=this.Editor.Caret.positions.DEFAULT,t=0)=>this.Editor.BlockManager.lastBlock?(this.Editor.Caret.setToBlock(this.Editor.BlockManager.lastBlock,e,t),!0):!1,this.setToPreviousBlock=(e=this.Editor.Caret.positions.DEFAULT,t=0)=>this.Editor.BlockManager.previousBlock?(this.Editor.Caret.setToBlock(this.Editor.BlockManager.previousBlock,e,t),!0):!1,this.setToNextBlock=(e=this.Editor.Caret.positions.DEFAULT,t=0)=>this.Editor.BlockManager.nextBlock?(this.Editor.Caret.setToBlock(this.Editor.BlockManager.nextBlock,e,t),!0):!1,this.setToBlock=(e,t=this.Editor.Caret.positions.DEFAULT,o=0)=>{const r=Gy(e,this.Editor);return r===void 0?!1:(this.Editor.Caret.setToBlock(r,t,o),!0)},this.focus=(e=!1)=>e?this.setToLastBlock(this.Editor.Caret.positions.END):this.setToFirstBlock(this.Editor.Caret.positions.START)}get methods(){return{setToFirstBlock:this.setToFirstBlock,setToLastBlock:this.setToLastBlock,setToPreviousBlock:this.setToPreviousBlock,setToNextBlock:this.setToNextBlock,setToBlock:this.setToBlock,focus:this.focus}}}class Xy extends F{get methods(){return{emit:(e,t)=>this.emit(e,t),off:(e,t)=>this.off(e,t),on:(e,t)=>this.on(e,t)}}on(e,t){this.eventsDispatcher.on(e,t)}emit(e,t){this.eventsDispatcher.emit(e,t)}off(e,t){this.eventsDispatcher.off(e,t)}}class Ao extends F{static getNamespace(e,t){return t?`blockTunes.${e}`:`tools.${e}`}get methods(){return{t:e=>(Ee("I18n.t() method can be accessed only from Tools","warn"),"")}}getMethodsForTool(e,t){return Object.assign(this.methods,{t:o=>ne.t(Ao.getNamespace(e,t),o)})}}class Vy extends F{get methods(){return{blocks:this.Editor.BlocksAPI.methods,caret:this.Editor.CaretAPI.methods,tools:this.Editor.ToolsAPI.methods,events:this.Editor.EventsAPI.methods,listeners:this.Editor.ListenersAPI.methods,notifier:this.Editor.NotifierAPI.methods,sanitizer:this.Editor.SanitizerAPI.methods,saver:this.Editor.SaverAPI.methods,selection:this.Editor.SelectionAPI.methods,styles:this.Editor.StylesAPI.classes,toolbar:this.Editor.ToolbarAPI.methods,inlineToolbar:this.Editor.InlineToolbarAPI.methods,tooltip:this.Editor.TooltipAPI.methods,i18n:this.Editor.I18nAPI.methods,readOnly:this.Editor.ReadOnlyAPI.methods,ui:this.Editor.UiAPI.methods}}getMethodsForTool(e,t){return Object.assign(this.methods,{i18n:this.Editor.I18nAPI.getMethodsForTool(e,t)})}}class qy extends F{get methods(){return{close:()=>this.close(),open:()=>this.open()}}open(){this.Editor.InlineToolbar.tryToShow()}close(){this.Editor.InlineToolbar.close()}}class Zy extends F{get methods(){return{on:(e,t,o,r)=>this.on(e,t,o,r),off:(e,t,o,r)=>this.off(e,t,o,r),offById:e=>this.offById(e)}}on(e,t,o,r){return this.listeners.on(e,t,o,r)}off(e,t,o,r){this.listeners.off(e,t,o,r)}offById(e){this.listeners.offById(e)}}class Jy{constructor(){this.notifierModule=null,this.loadingPromise=null}loadNotifierModule(){return this.notifierModule!==null?Promise.resolve(this.notifierModule):(this.loadingPromise===null&&(this.loadingPromise=Promise.resolve().then(()=>Mw).then(e=>{const t=(e==null?void 0:e.default)??e;if(!this.isNotifierModule(t))throw new Error('codex-notifier module does not expose a "show" method.');return this.notifierModule=t,t}).catch(e=>{throw this.loadingPromise=null,e})),this.loadingPromise)}show(e){this.loadNotifierModule().then(t=>{t.show(e)}).catch(t=>{console.error("[Editor.js] Failed to display notification. Reason:",t)})}isNotifierModule(e){return typeof e=="object"&&e!==null&&"show"in e&&typeof e.show=="function"}}class Qy extends F{constructor({config:e,eventsDispatcher:t}){super({config:e,eventsDispatcher:t}),this.notifier=new Jy}get methods(){return{show:e=>this.show(e)}}show(e){return this.notifier.show(e)}}class eE extends F{get methods(){const e=()=>this.isEnabled;return{toggle:t=>this.toggle(t),get isEnabled(){return e()}}}toggle(e){return this.Editor.ReadOnly.toggle(e)}get isEnabled(){return this.Editor.ReadOnly.isEnabled}}var Io={},tE={get exports(){return Io},set exports(n){Io=n}};(function(n,e){(function(t,o){n.exports=o()})(pe,function(){function t(u){var h=u.tags,g=Object.keys(h),f=g.map(function(m){return typeof h[m]}).every(function(m){return m==="object"||m==="boolean"||m==="function"});if(!f)throw new Error("The configuration was invalid");this.config=u}var o=["P","LI","TD","TH","DIV","H1","H2","H3","H4","H5","H6","PRE"];function r(u){return o.indexOf(u.nodeName)!==-1}var i=["A","B","STRONG","I","EM","SUB","SUP","U","STRIKE"];function s(u){return i.indexOf(u.nodeName)!==-1}t.prototype.clean=function(u){const h=document.implementation.createHTMLDocument(),g=h.createElement("div");return g.innerHTML=u,this._sanitize(h,g),g.innerHTML},t.prototype._sanitize=function(u,h){var g=a(u,h),f=g.firstChild();if(f)do{if(f.nodeType===Node.TEXT_NODE)if(f.data.trim()===""&&(f.previousElementSibling&&r(f.previousElementSibling)||f.nextElementSibling&&r(f.nextElementSibling))){h.removeChild(f),this._sanitize(u,h);break}else continue;if(f.nodeType===Node.COMMENT_NODE){h.removeChild(f),this._sanitize(u,h);break}var m=s(f),b;m&&(b=Array.prototype.some.call(f.childNodes,r));var E=!!h.parentNode,k=r(h)&&r(f)&&E,N=f.nodeName.toLowerCase(),x=l(this.config,N,f),P=m&&b;if(P||c(f,x)||!this.config.keepNestedBlockElements&&k){if(!(f.nodeName==="SCRIPT"||f.nodeName==="STYLE"))for(;f.childNodes.length>0;)h.insertBefore(f.childNodes[0],f);h.removeChild(f),this._sanitize(u,h);break}for(var I=0;I<f.attributes.length;I+=1){var X=f.attributes[I];d(X,x,f)&&(f.removeAttribute(X.name),I=I-1)}this._sanitize(u,f)}while(f=g.nextSibling())};function a(u,h){return u.createTreeWalker(h,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT,null,!1)}function l(u,h,g){return typeof u.tags[h]=="function"?u.tags[h](g):u.tags[h]}function c(u,h){return typeof h>"u"?!0:typeof h=="boolean"?!h:!1}function d(u,h,g){var f=u.name.toLowerCase();return h===!0?!1:typeof h[f]=="function"?!h[f](u.value,g):typeof h[f]>"u"||h[f]===!1?!0:typeof h[f]=="string"?h[f]!==u.value:!1}return t})})(tE);const nE=Io,oE=/^\s*(?:javascript\s*:|data\s*:\s*text\s*\/\s*html)/i,rE=/\s*(?:href|src)\s*=\s*(?:"\s*(?:javascript\s*:|data\s*:\s*text\s*\/\s*html)[^"]*"|'\s*(?:javascript\s*:|data\s*:\s*text\s*\/\s*html)[^']*|(?:javascript\s*:|data\s*:\s*text\s*\/\s*html)[^ \t\r\n>]*)/gi,Oo=(n,e,t={})=>n.map(o=>{const i=(j(e)?e(o.tool):e)??{};return W(i)&&Q(i)&&Q(t)?o:{...o,data:No(o.data,i,t)}}),Ae=(n,e={})=>{const t={tags:e};return new nE(t).clean(n)},No=(n,e,t)=>Array.isArray(n)?iE(n,e,t):W(n)?sE(n,e,t):we(n)?aE(n,e,t):n,iE=(n,e,t)=>n.map(o=>No(o,e,t)),sE=(n,e,t)=>{const o={},r=n;for(const i in n){if(!Object.prototype.hasOwnProperty.call(n,i))continue;const s=r[i],a=W(e)?e:void 0,l=a==null?void 0:a[i],c=l!==void 0&&lE(l)?l:e;o[i]=No(s,c,t)}return o},aE=(n,e,t)=>{const o=pE(e,t);if(o){const r=Ae(n,o);return Ro(Xs(r,o))}if(!Q(t)){const r=Ae(n,t);return Ro(Xs(r,t))}return Ro(n)},lE=n=>W(n)||Rs(n)||j(n),cE=n=>n?oE.test(n):!1,Ro=n=>{if(!n||n.indexOf("<")===-1)return n;if(typeof document<"u"){const e=document.createElement("template");return e.innerHTML=n,e.content.querySelectorAll("[href],[src]").forEach(o=>{["href","src"].forEach(r=>{const i=o.getAttribute(r);cE(i)&&o.removeAttribute(r)})}),e.innerHTML}return n.replace(rE,"")},Lo=n=>{if(Q(n))return{};const e={};for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=Ve(n[t]));return e},Ys=n=>function(t){const o=n.call(this,t);return o??{}},dE=new Set(["class","id","title","role","dir","lang"]),uE=n=>{const e=n.toLowerCase();return e.startsWith("data-")||e.startsWith("aria-")||dE.has(e)},hE=n=>{const e={};return Array.from(n.attributes).forEach(t=>{uE(t.name)&&(e[t.name]=!0)}),e},Ve=n=>n===!0?Ys(hE):n===!1?!1:j(n)?Ys(n):we(n)?n:W(n)?It({},n):n,fE=(n,e)=>{if(Q(n))return Lo(e);const t={};for(const o in n){if(!Object.prototype.hasOwnProperty.call(n,o))continue;const r=n[o],i=e?e[o]:void 0;if(j(i)){t[o]=Ve(i);continue}if(j(r)){t[o]=Ve(r);continue}if(W(r)&&W(i)){t[o]=It({},i,r);continue}if(i!==void 0){t[o]=Ve(i);continue}t[o]=Ve(r)}return t},pE=(n,e)=>W(n)&&!j(n)?fE(e,n):n===!1?{}:Q(e)?null:Lo(e),Po=(n,...e)=>{if(Q(n))return Object.assign({},...e);const t=Lo(n);return e.forEach(o=>{if(o)for(const r in o){if(!Object.prototype.hasOwnProperty.call(o,r)||!Object.prototype.hasOwnProperty.call(t,r))continue;const i=o[r],s=t[r];if(j(i)){t[r]=i;continue}if(!(i===!0&&j(s))){if(i===!0){const a=W(s)&&!j(s);t[r]=a?It({},s):Ve(i);continue}if(W(i)&&W(s)){t[r]=It({},s,i);continue}t[r]=Ve(i)}}}),t},Xs=(n,e)=>{if(typeof document>"u"||!n||n.indexOf("<")===-1)return n;const t=Object.entries(e).filter(([,r])=>j(r));if(t.length===0)return n;const o=document.createElement("template");return o.innerHTML=n,t.forEach(([r,i])=>{o.content.querySelectorAll(r).forEach(a=>{const l=i(a);if(!(Rs(l)||j(l)||l==null))for(const[c,d]of Object.entries(l)){if(d===!1){a.removeAttribute(c);continue}d!==!0&&we(d)&&a.setAttribute(c,d)}})}),o.innerHTML};class gE extends F{get methods(){return{clean:(e,t)=>this.clean(e,t)}}clean(e,t){return Ae(e,t)}}class mE extends F{get methods(){return{save:()=>this.save()}}async save(){var i,s;const e="Editor's content can not be saved in read-only mode";if(this.Editor.ReadOnly.isEnabled)throw Ee(e,"warn"),new Error(e);const t=await this.Editor.Saver.save();if(t!==void 0)return t;const o=(s=(i=this.Editor.Saver).getLastSaveError)==null?void 0:s.call(i);if(o instanceof Error)throw o;const r=o!==void 0?String(o):"Editor's content can not be saved because collecting data failed";throw new Error(r)}}class vE extends F{constructor(){super(...arguments),this.selectionUtils=new w}get methods(){return{findParentTag:(e,t)=>this.findParentTag(e,t),expandToTag:e=>this.expandToTag(e),save:()=>this.selectionUtils.save(),restore:()=>this.selectionUtils.restore(),setFakeBackground:()=>this.selectionUtils.setFakeBackground(),removeFakeBackground:()=>this.selectionUtils.removeFakeBackground()}}findParentTag(e,t){return this.selectionUtils.findParentTag(e,t)}expandToTag(e){this.selectionUtils.expandToTag(e)}}class bE extends F{get methods(){return{getBlockTools:()=>Array.from(this.Editor.Tools.blockTools.values())}}}class yE extends F{get classes(){return{block:"cdx-block",inlineToolButton:"ce-inline-tool",inlineToolButtonActive:"ce-inline-tool--active",input:"cdx-input",loader:"cdx-loader",button:"cdx-button",settingsButton:"cdx-settings-button",settingsButtonActive:"cdx-settings-button--active"}}}class EE extends F{get methods(){return{close:()=>this.close(),open:()=>this.open(),toggleBlockSettings:e=>this.toggleBlockSettings(e),toggleToolbox:e=>this.toggleToolbox(e)}}open(){this.Editor.Toolbar.moveAndOpen()}close(){this.Editor.Toolbar.close()}toggleBlockSettings(e){if(this.Editor.BlockManager.currentBlockIndex===-1){Ee("Could't toggle the Toolbar because there is no block selected ","warn");return}e??!this.Editor.BlockSettings.opened?(this.Editor.Toolbar.moveAndOpen(),this.Editor.BlockSettings.open()):this.Editor.BlockSettings.close()}toggleToolbox(e){if(this.Editor.BlockManager.currentBlockIndex===-1){Ee("Could't toggle the Toolbox because there is no block selected ","warn");return}e??!this.Editor.Toolbar.toolbox.opened?(this.Editor.Toolbar.moveAndOpen(),this.Editor.Toolbar.toolbox.open()):this.Editor.Toolbar.toolbox.close()}}const TE=`:root{--ct-color-bg: #1d202b;--ct-color-font: #cdd1e0}.ct{position:absolute;z-index:999;top:0;left:0;background-color:#1d202b;opacity:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;-webkit-transition:opacity 50ms ease-in,-webkit-transform 70ms cubic-bezier(.215,.61,.355,1);transition:opacity 50ms ease-in,-webkit-transform 70ms cubic-bezier(.215,.61,.355,1);transition:opacity 50ms ease-in,transform 70ms cubic-bezier(.215,.61,.355,1);transition:opacity 50ms ease-in,transform 70ms cubic-bezier(.215,.61,.355,1),-webkit-transform 70ms cubic-bezier(.215,.61,.355,1);will-change:opacity,top,left;-webkit-box-shadow:0 8px 12px 0 rgba(29,32,43,.17),0 4px 5px -3px rgba(5,6,12,.49);box-shadow:0 8px 12px #1d202b2b,0 4px 5px -3px #05060c7d;border-radius:9px}.ct:before{content:"";top:0;right:0;bottom:0;left:0;position:absolute;background-color:#1d202b;z-index:-1;border-radius:4px}@supports (-webkit-mask-box-image: url()){.ct:before{border-radius:0;-webkit-mask-box-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M10.71 0h2.58c3.02 0 4.64.42 6.1 1.2a8.18 8.18 0 013.4 3.4C23.6 6.07 24 7.7 24 10.71v2.58c0 3.02-.42 4.64-1.2 6.1a8.18 8.18 0 01-3.4 3.4c-1.47.8-3.1 1.21-6.11 1.21H10.7c-3.02 0-4.64-.42-6.1-1.2a8.18 8.18 0 01-3.4-3.4C.4 17.93 0 16.3 0 13.29V10.7c0-3.02.42-4.64 1.2-6.1a8.18 8.18 0 013.4-3.4C6.07.4 7.7 0 10.71 0z" fill="#000" fill-rule="nonzero"/></svg>') 48% 41% 37.9% 53.3%}}@media (max-width: 768px){.ct{display:none}}.ct__content{padding:6px 10px;color:#cdd1e0;font-size:12px;text-align:center;letter-spacing:.02em;line-height:1em}.ct:after{content:"";width:8px;height:8px;position:absolute;background-color:#1d202b;z-index:-1}.ct--bottom{-webkit-transform:translateY(5px);transform:translateY(5px)}.ct--bottom:after{top:-3px;left:50%;-webkit-transform:translateX(-50%) rotate(-45deg);transform:translate(-50%) rotate(-45deg)}.ct--top{-webkit-transform:translateY(-5px);transform:translateY(-5px)}.ct--top:after{top:auto;bottom:-3px;left:50%;-webkit-transform:translateX(-50%) rotate(-45deg);transform:translate(-50%) rotate(-45deg)}.ct--left{-webkit-transform:translateX(-5px);transform:translate(-5px)}.ct--left:after{top:50%;left:auto;right:0;-webkit-transform:translate(41.6%,-50%) rotate(-45deg);transform:translate(41.6%,-50%) rotate(-45deg)}.ct--right{-webkit-transform:translateX(5px);transform:translate(5px)}.ct--right:after{top:50%;left:0;-webkit-transform:translate(-41.6%,-50%) rotate(-45deg);transform:translate(-41.6%,-50%) rotate(-45deg)}.ct--shown{opacity:1;-webkit-transform:none;transform:none}
12
- `,kE=180,wE=400,pt="data-interface",CE="editorjs",SE="inline-toolbar",Mo="tooltip",Vs="[data-interface=editorjs]",xE="[data-interface=inline-toolbar]";typeof process<"u"&&process.platform?process.platform==="darwin"?"Meta":"Control":typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes("mac")?"Meta":"Control";const Do=10,BE="tooltip",_E="aria-hidden",AE="false",IE="true",OE="visibility",NE="visible",RE="hidden";/**
13
- * Tiny any beautiful tooltips module.
14
- *
15
- * Can be showed near passed Element with any specified HTML content
16
- * @author CodeX <codex.so>
17
- * @license MIT
18
- */const gt=class{constructor(){this.nodes={wrapper:null,content:null},this.showed=!1,this.offsetTop=Do,this.offsetLeft=Do,this.offsetRight=Do,this.showingTimeout=null,this.hidingDelay=0,this.hidingTimeout=null,this.ariaObserver=null,this.handleWindowScroll=()=>{this.showed&&this.hide(!0)},this.loadStyles(),this.prepare(),window.addEventListener("scroll",this.handleWindowScroll,{passive:!0})}get CSS(){return{tooltip:"ct",tooltipContent:"ct__content",tooltipShown:"ct--shown",placement:{left:"ct--left",bottom:"ct--bottom",right:"ct--right",top:"ct--top"}}}static getInstance(){return gt.instance||(gt.instance=new gt),gt.instance}show(n,e,t={}){this.nodes.wrapper||this.prepare(),this.hidingTimeout&&(clearTimeout(this.hidingTimeout),this.hidingTimeout=null);const r=Object.assign({placement:"bottom",marginTop:0,marginLeft:0,marginRight:0,marginBottom:0,delay:70,hidingDelay:0},t);if(r.hidingDelay&&(this.hidingDelay=r.hidingDelay),!!this.nodes.content&&(this.nodes.content.innerHTML="",this.nodes.content.appendChild(this.createContentNode(e)),!!this.nodes.wrapper)){switch(this.nodes.wrapper.classList.remove(...Object.values(this.CSS.placement)),r.placement){case"top":this.placeTop(n,r);break;case"left":this.placeLeft(n,r);break;case"right":this.placeRight(n,r);break;case"bottom":default:this.placeBottom(n,r);break}if(r&&r.delay){this.showingTimeout=setTimeout(()=>{this.nodes.wrapper&&(this.nodes.wrapper.classList.add(this.CSS.tooltipShown),this.updateTooltipVisibility()),this.showed=!0},r.delay);return}this.nodes.wrapper&&(this.nodes.wrapper.classList.add(this.CSS.tooltipShown),this.updateTooltipVisibility()),this.showed=!0}}createContentNode(n){if(typeof n=="string")return document.createTextNode(n);if(n instanceof Node)return n;throw Error("[CodeX Tooltip] Wrong type of «content» passed. It should be an instance of Node or String. But "+typeof n+" given.")}hide(n=!1){const e=!!this.hidingDelay&&!n;if(e&&this.hidingTimeout&&clearTimeout(this.hidingTimeout),e){this.hidingTimeout=setTimeout(()=>{this.hide(!0)},this.hidingDelay);return}this.nodes.wrapper&&(this.nodes.wrapper.classList.remove(this.CSS.tooltipShown),this.updateTooltipVisibility()),this.showed=!1,this.showingTimeout&&(clearTimeout(this.showingTimeout),this.showingTimeout=null)}onHover(n,e,t={}){n.addEventListener("mouseenter",()=>{this.show(n,e,t)}),n.addEventListener("mouseleave",()=>{this.hide()})}destroy(){var n;(n=this.ariaObserver)==null||n.disconnect(),this.ariaObserver=null,this.nodes.wrapper&&this.nodes.wrapper.remove(),window.removeEventListener("scroll",this.handleWindowScroll),gt.instance=null}prepare(){this.nodes.wrapper=this.make("div",this.CSS.tooltip),this.nodes.wrapper.setAttribute(pt,Mo),this.nodes.content=this.make("div",this.CSS.tooltipContent),this.nodes.wrapper&&this.nodes.content&&(this.append(this.nodes.wrapper,this.nodes.content),this.append(document.body,this.nodes.wrapper),this.ensureTooltipAttributes())}updateTooltipVisibility(){if(!this.nodes.wrapper)return;const n=this.nodes.wrapper.classList.contains(this.CSS.tooltipShown);this.nodes.wrapper.style.setProperty(OE,n?NE:RE),this.nodes.wrapper.setAttribute(_E,n?AE:IE)}watchTooltipVisibility(){var n;this.nodes.wrapper&&((n=this.ariaObserver)==null||n.disconnect(),this.updateTooltipVisibility(),this.ariaObserver=new MutationObserver(()=>{this.updateTooltipVisibility()}),this.ariaObserver.observe(this.nodes.wrapper,{attributes:!0,attributeFilter:["class"]}))}ensureTooltipAttributes(){this.nodes.wrapper&&((!this.nodes.wrapper.hasAttribute(pt)||this.nodes.wrapper.getAttribute(pt)!==Mo)&&this.nodes.wrapper.setAttribute(pt,Mo),this.nodes.wrapper.setAttribute("role",BE),this.watchTooltipVisibility())}loadStyles(){const n="codex-tooltips-style";if(document.getElementById(n))return;const e=this.make("style",null,{textContent:TE,id:n});this.prepend(document.head,e)}placeBottom(n,e){if(!this.nodes.wrapper)return;const t=n.getBoundingClientRect(),o=t.left+n.clientWidth/2-this.nodes.wrapper.offsetWidth/2,r=t.bottom+this.getScrollTop()+this.offsetTop+(e.marginTop??0);this.applyPlacement("bottom",o,r)}placeTop(n,e){if(!this.nodes.wrapper)return;const t=n.getBoundingClientRect(),o=t.left+n.clientWidth/2-this.nodes.wrapper.offsetWidth/2,r=t.top+this.getScrollTop()-this.nodes.wrapper.clientHeight-this.offsetTop;this.applyPlacement("top",o,r)}placeLeft(n,e){if(!this.nodes.wrapper)return;const t=n.getBoundingClientRect(),o=t.left-this.nodes.wrapper.offsetWidth-this.offsetLeft-(e.marginLeft??0),r=t.top+this.getScrollTop()+n.clientHeight/2-this.nodes.wrapper.offsetHeight/2;this.applyPlacement("left",o,r)}placeRight(n,e){if(!this.nodes.wrapper)return;const t=n.getBoundingClientRect(),o=t.right+this.offsetRight+(e.marginRight??0),r=t.top+this.getScrollTop()+n.clientHeight/2-this.nodes.wrapper.offsetHeight/2;this.applyPlacement("right",o,r)}applyPlacement(n,e,t){this.nodes.wrapper&&(this.nodes.wrapper.classList.add(this.CSS.placement[n]),this.nodes.wrapper.style.left=`${e}px`,this.nodes.wrapper.style.top=`${t}px`)}getScrollTop(){var n;return typeof window.scrollY=="number"?window.scrollY:((n=document.documentElement)==null?void 0:n.scrollTop)??document.body.scrollTop??0}make(n,e=null,t={}){const o=document.createElement(n);Array.isArray(e)&&o.classList.add(...e),typeof e=="string"&&o.classList.add(e);for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(o[r]=t[r]);return o}append(n,e){Array.isArray(e)?e.forEach(t=>n.appendChild(t)):n.appendChild(e)}prepend(n,e){Array.isArray(e)?e.reverse().forEach(o=>n.prepend(o)):n.prepend(e)}};let qs=gt;qs.instance=null;const bn=()=>qs.getInstance(),LE=(n,e,t)=>{bn().show(n,e,t??{})},Pt=(n=!1)=>{bn().hide(n)},yn=(n,e,t)=>{bn().onHover(n,e,t??{})},PE=()=>{bn().destroy()};class ME extends F{constructor({config:e,eventsDispatcher:t}){super({config:e,eventsDispatcher:t})}get methods(){return{show:(e,t,o)=>this.show(e,t,o),hide:()=>this.hide(),onHover:(e,t,o)=>this.onHover(e,t,o)}}show(e,t,o){LE(e,t,o)}hide(){Pt()}onHover(e,t,o){yn(e,t,o)}}class DE extends F{get methods(){return{nodes:this.editorNodes}}get editorNodes(){return{wrapper:this.Editor.UI.nodes.wrapper,redactor:this.Editor.UI.nodes.redactor}}}const Zs=(n,e)=>{const t={};return Object.entries(n).forEach(([o,r])=>{if(!W(r)){t[o]=r;return}const i=e?`${e}.${o}`:o;if(!Object.values(r).every(a=>we(a))){t[o]=Zs(r,i);return}t[o]=i}),t},ae=Zs(Fs),Mt=class{constructor(n,e){this.cursor=-1,this.items=[],this.items=n??[],this.focusedCssClass=e}get currentItem(){return this.cursor===-1?null:this.items[this.cursor]}setCursor(n){n<this.items.length&&n>=-1&&(this.dropCursor(),this.cursor=n,this.items[this.cursor].classList.add(this.focusedCssClass))}setItems(n){this.items=n}hasItems(){return this.items.length>0}next(){this.cursor=this.leafNodesAndReturnIndex(Mt.directions.RIGHT)}previous(){this.cursor=this.leafNodesAndReturnIndex(Mt.directions.LEFT)}dropCursor(){this.cursor!==-1&&(this.items[this.cursor].classList.remove(this.focusedCssClass),this.cursor=-1)}leafNodesAndReturnIndex(n){if(this.items.length===0)return this.cursor;const e=n===Mt.directions.RIGHT?-1:0,t=this.cursor===-1?e:this.cursor;t!==-1&&this.items[t].classList.remove(this.focusedCssClass);const o=n===Mt.directions.RIGHT?(t+1)%this.items.length:(this.items.length+t-1)%this.items.length;return v.canSetCaret(this.items[o])&&gn(()=>w.setCursor(this.items[o]),50)(),this.items[o].classList.add(this.focusedCssClass),o}};let mt=Mt;mt.directions={RIGHT:"right",LEFT:"left"};class Fe{constructor(e){this.iterator=null,this.activated=!1,this.skipNextTabFocus=!1,this.flipCallbacks=[],this.onKeyDown=t=>{const o=t.target;if(this.shouldSkipTarget(o,t))return;const r=this.getKeyCode(t),i=r===S.LEFT||r===S.RIGHT||r===S.UP||r===S.DOWN;if(!(t.shiftKey&&i||!this.isEventReadyForHandling(t)))switch(t.stopPropagation(),t.stopImmediatePropagation(),r!==null&&Fe.usedKeys.includes(r)&&t.preventDefault(),r){case S.TAB:this.handleTabPress(t);break;case S.LEFT:case S.UP:this.flipLeft();break;case S.RIGHT:case S.DOWN:this.flipRight();break;case S.ENTER:this.handleEnterPress(t);break}},this.iterator=new mt(e.items||[],e.focusedItemClass??""),this.activateCallback=e.activateCallback,this.allowedKeys=e.allowedKeys||Fe.usedKeys,this.handleContentEditableTargets=e.handleContentEditableTargets??!1}get isActivated(){return this.activated}static get usedKeys(){return[S.TAB,S.LEFT,S.RIGHT,S.ENTER,S.UP,S.DOWN]}activate(e,t){var o,r;this.activated=!0,e&&((o=this.iterator)==null||o.setItems(e)),t!==void 0&&((r=this.iterator)==null||r.setCursor(t)),document.addEventListener("keydown",this.onKeyDown,!0),window.addEventListener("keydown",this.onKeyDown,!0)}deactivate(){this.activated=!1,this.dropCursor(),this.skipNextTabFocus=!1,document.removeEventListener("keydown",this.onKeyDown,!0),window.removeEventListener("keydown",this.onKeyDown,!0)}focusFirst(){this.dropCursor(),this.flipRight()}focusItem(e){const t=this.iterator;if(t&&t.hasItems()){if(e<0){t.dropCursor();return}!t.currentItem&&e===0&&(this.skipNextTabFocus=!0),t.setCursor(e)}}flipLeft(){var e;(e=this.iterator)==null||e.previous(),this.flipCallback()}flipRight(){var e;(e=this.iterator)==null||e.next(),this.flipCallback()}hasFocus(){var e;return!!((e=this.iterator)!=null&&e.currentItem)}onFlip(e){this.flipCallbacks.push(e)}removeOnFlip(e){this.flipCallbacks=this.flipCallbacks.filter(t=>t!==e)}dropCursor(){var e;(e=this.iterator)==null||e.dropCursor()}getKeyCode(e){return{Tab:S.TAB,Enter:S.ENTER,ArrowLeft:S.LEFT,ArrowRight:S.RIGHT,ArrowUp:S.UP,ArrowDown:S.DOWN}[e.key]??null}isEventReadyForHandling(e){const t=this.getKeyCode(e);return this.activated&&t!==null&&this.allowedKeys.includes(t)}setHandleContentEditableTargets(e){this.handleContentEditableTargets=e}handleTabPress(e){const o=e.shiftKey?mt.directions.LEFT:mt.directions.RIGHT;if(this.skipNextTabFocus){this.skipNextTabFocus=!1;return}switch(o){case mt.directions.RIGHT:this.flipRight();break;case mt.directions.LEFT:this.flipLeft();break}}handleExternalKeydown(e){this.onKeyDown(e)}handleEnterPress(e){var t,o;this.activated&&((t=this.iterator)!=null&&t.currentItem&&(e.stopPropagation(),e.preventDefault(),this.iterator.currentItem.click()),j(this.activateCallback)&&((o=this.iterator)!=null&&o.currentItem)&&this.activateCallback(this.iterator.currentItem))}flipCallback(){var e,t,o;(e=this.iterator)!=null&&e.currentItem&&((o=(t=this.iterator.currentItem).scrollIntoViewIfNeeded)==null||o.call(t)),this.flipCallbacks.forEach(r=>r())}shouldSkipTarget(e,t){var l;if(!e)return!1;const o=e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement,r=((l=e.dataset)==null?void 0:l.flipperTabTarget)==="true"&&t.key==="Tab",i=e.isContentEditable,s=e.closest('[data-link-tool-input-opened="true"]')!==null,a=i&&!this.handleContentEditableTargets;return o&&!r||a||s}}const $E='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M9 12L9 7.1C9 7.04477 9.04477 7 9.1 7H10.4C11.5 7 14 7.1 14 9.5C14 9.5 14 12 11 12M9 12V16.8C9 16.9105 9.08954 17 9.2 17H12.5C14 17 15 16 15 14.5C15 11.7046 11 12 11 12M9 12H11"/></svg>',FE='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M14.5 17.5L9.64142 12.6414C9.56331 12.5633 9.56331 12.4367 9.64142 12.3586L14.5 7.5"/></svg>',HE='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M9.58284 17.5L14.4414 12.6414C14.5195 12.5633 14.5195 12.4367 14.4414 12.3586L9.58284 7.5"/></svg>',jE='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M8 8L12 12M12 12L16 16M12 12L16 8M12 12L8 16"/></svg>',zE='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4" stroke="currentColor" stroke-width="2"/></svg>',WE='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M13.34 10C12.4223 12.7337 11 17 11 17"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M14.21 7H14.2"/></svg>',UE='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M7.69998 12.6L7.67896 12.62C6.53993 13.7048 6.52012 15.5155 7.63516 16.625V16.625C8.72293 17.7073 10.4799 17.7102 11.5712 16.6314L13.0263 15.193C14.0703 14.1609 14.2141 12.525 13.3662 11.3266L13.22 11.12"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M16.22 11.12L16.3564 10.9805C17.2895 10.0265 17.3478 8.5207 16.4914 7.49733V7.49733C15.5691 6.39509 13.9269 6.25143 12.8271 7.17675L11.3901 8.38588C10.0935 9.47674 9.95706 11.4241 11.0888 12.6852L11.12 12.72"/></svg>',KE='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M9.40999 7.29999H9.4"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M14.6 7.29999H14.59"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M9.30999 12H9.3"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M14.6 12H14.59"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M9.40999 16.7H9.4"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M14.6 16.7H14.59"/></svg>',GE='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M12 7V12M12 17V12M17 12H12M12 12H7"/></svg>',Js='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M11.5 17.5L5 11M5 11V15.5M5 11H9.5"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M12.5 6.5L19 13M19 13V8.5M19 13H14.5"/></svg>',YE='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><circle cx="10.5" cy="10.5" r="5.5" stroke="currentColor" stroke-width="2"/><line x1="15.4142" x2="19" y1="15" y2="18.5858" stroke="currentColor" stroke-linecap="round" stroke-width="2"/></svg>',XE='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><rect width="14" height="14" x="5" y="5" stroke="currentColor" stroke-width="2" rx="4"/><line x1="12" x2="12" y1="9" y2="12" stroke="currentColor" stroke-linecap="round" stroke-width="2"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M12 15.02V15.01"/></svg>',VE="__",qE="--",He=n=>(e,t)=>[[n,e].filter(r=>!!r).join(VE),t].filter(r=>!!r).join(qE),Dt=He("ce-hint"),$t={root:Dt(),alignedStart:Dt(null,"align-left"),alignedCenter:Dt(null,"align-center"),title:Dt("title"),description:Dt("description")},jw="";class ZE{constructor(e){this.nodes={root:v.make("div",[$t.root,e.alignment==="center"?$t.alignedCenter:$t.alignedStart]),title:v.make("div",$t.title,{textContent:e.title})},this.nodes.root.appendChild(this.nodes.title),e.description!==void 0&&(this.nodes.description=v.make("div",$t.description,{textContent:e.description}),this.nodes.root.appendChild(this.nodes.description))}getElement(){return this.nodes.root}}class $o{constructor(e){this.params=e}get name(){if(this.params!==void 0&&"name"in this.params)return this.params.name}destroy(){Pt()}onChildrenOpen(){var e;this.params!==void 0&&"children"in this.params&&typeof((e=this.params.children)==null?void 0:e.onOpen)=="function"&&this.params.children.onOpen()}onChildrenClose(){var e;this.params!==void 0&&"children"in this.params&&typeof((e=this.params.children)==null?void 0:e.onClose)=="function"&&this.params.children.onClose()}handleClick(){var e,t;this.params!==void 0&&"onActivate"in this.params&&((t=(e=this.params).onActivate)==null||t.call(e,this.params))}addHint(e,t){const o=new ZE(t);yn(e,o.getElement(),{placement:t.position,hidingDelay:100})}get children(){var e;return this.params!==void 0&&"children"in this.params&&((e=this.params.children)==null?void 0:e.items)!==void 0?this.params.children.items:[]}get hasChildren(){return this.children.length>0}get isChildrenOpen(){var e;return this.params!==void 0&&"children"in this.params&&((e=this.params.children)==null?void 0:e.isOpen)===!0}get isChildrenFlippable(){var e;return!(this.params===void 0||!("children"in this.params)||((e=this.params.children)==null?void 0:e.isFlippable)===!1)}get isChildrenSearchable(){var e;return this.params!==void 0&&"children"in this.params&&((e=this.params.children)==null?void 0:e.searchable)===!0}get closeOnActivate(){return this.params!==void 0&&"closeOnActivate"in this.params&&this.params.closeOnActivate}get isActive(){return this.params===void 0||!("isActive"in this.params)?!1:typeof this.params.isActive=="function"?this.params.isActive():this.params.isActive===!0}}const ge=He("ce-popover-item"),G={container:ge(),active:ge(null,"active"),disabled:ge(null,"disabled"),focused:ge(null,"focused"),hidden:ge(null,"hidden"),confirmationState:ge(null,"confirmation"),noHover:ge(null,"no-hover"),noFocus:ge(null,"no-focus"),title:ge("title"),secondaryTitle:ge("secondary-title"),icon:ge("icon"),iconTool:ge("icon","tool"),iconChevronRight:ge("icon","chevron-right"),wobbleAnimation:He("wobble")()},Fo="data-popover-item-active";class je extends $o{constructor(e,t){super(e),this.params=e,this.nodes={root:null,icon:null},this.confirmationState=null,this.removeSpecialFocusBehavior=()=>{var o;(o=this.nodes.root)==null||o.classList.remove(G.noFocus)},this.removeSpecialHoverBehavior=()=>{var o;(o=this.nodes.root)==null||o.classList.remove(G.noHover)},this.onErrorAnimationEnd=()=>{var o,r;(o=this.nodes.icon)==null||o.classList.remove(G.wobbleAnimation),(r=this.nodes.icon)==null||r.removeEventListener("animationend",this.onErrorAnimationEnd)},this.nodes.root=this.make(e,t)}get isDisabled(){return this.params.isDisabled===!0}get toggle(){return this.params.toggle}get title(){return this.params.title||this.params.label}get isConfirmationStateEnabled(){return this.confirmationState!==null}get isFocused(){return this.nodes.root===null?!1:this.nodes.root.classList.contains(G.focused)}getElement(){return this.nodes.root}handleClick(){if(this.isConfirmationStateEnabled&&this.confirmationState!==null){this.activateOrEnableConfirmationMode(this.confirmationState);return}this.activateOrEnableConfirmationMode(this.params)}toggleActive(e){if(this.nodes.root===null)return;const t=e!==void 0?e:!this.nodes.root.classList.contains(G.active);this.nodes.root.classList.toggle(G.active,t),t?this.nodes.root.setAttribute(Fo,"true"):this.nodes.root.removeAttribute(Fo)}toggleHidden(e){var t;(t=this.nodes.root)==null||t.classList.toggle(G.hidden,e)}reset(){this.isConfirmationStateEnabled&&this.disableConfirmationMode()}onFocus(){this.disableSpecialHoverAndFocusBehavior()}make(e,t){var s,a;const o=(t==null?void 0:t.wrapperTag)||"div",r=v.make(o,G.container,{type:o==="button"?"button":void 0});e.name&&(r.dataset.itemName=e.name),this.nodes.icon=v.make("div",[G.icon,G.iconTool],{innerHTML:e.icon||zE}),r.appendChild(this.nodes.icon);const i=e.title||e.label;return i!==void 0&&r.appendChild(v.make("div",G.title,{innerHTML:i||""})),e.secondaryLabel&&r.appendChild(v.make("div",G.secondaryTitle,{textContent:e.secondaryLabel})),this.hasChildren&&r.appendChild(v.make("div",[G.icon,G.iconChevronRight],{innerHTML:HE})),this.isActive&&(r.classList.add(G.active),r.setAttribute(Fo,"true")),e.isDisabled&&r.classList.add(G.disabled),e.hint!==void 0&&((s=t==null?void 0:t.hint)==null?void 0:s.enabled)!==!1&&this.addHint(r,{...e.hint,position:((a=t==null?void 0:t.hint)==null?void 0:a.position)||"right"}),r}enableConfirmationMode(e){if(this.nodes.root===null)return;const t={...this.params,...e,confirmation:"confirmation"in e?e.confirmation:void 0},o=this.make(t);this.nodes.root.innerHTML=o.innerHTML,this.nodes.root.classList.add(G.confirmationState),this.confirmationState=e,this.enableSpecialHoverAndFocusBehavior()}disableConfirmationMode(){if(this.nodes.root===null)return;const e=this.make(this.params);this.nodes.root.innerHTML=e.innerHTML,this.nodes.root.classList.remove(G.confirmationState),this.confirmationState=null,this.disableSpecialHoverAndFocusBehavior()}enableSpecialHoverAndFocusBehavior(){var e,t,o;(e=this.nodes.root)==null||e.classList.add(G.noHover),(t=this.nodes.root)==null||t.classList.add(G.noFocus),(o=this.nodes.root)==null||o.addEventListener("mouseleave",this.removeSpecialHoverBehavior,{once:!0})}disableSpecialHoverAndFocusBehavior(){var e;this.removeSpecialFocusBehavior(),this.removeSpecialHoverBehavior(),(e=this.nodes.root)==null||e.removeEventListener("mouseleave",this.removeSpecialHoverBehavior)}activateOrEnableConfirmationMode(e){var t;if(!("confirmation"in e)||e.confirmation===void 0)try{(t=e.onActivate)==null||t.call(e,e),this.disableConfirmationMode()}catch{this.animateError()}else this.enableConfirmationMode(e.confirmation)}animateError(){var e,t,o;(e=this.nodes.icon)!=null&&e.classList.contains(G.wobbleAnimation)||((t=this.nodes.icon)==null||t.classList.add(G.wobbleAnimation),(o=this.nodes.icon)==null||o.addEventListener("animationend",this.onErrorAnimationEnd))}}const Ho=He("ce-popover-item-separator"),jo={container:Ho(),line:Ho("line"),hidden:Ho(null,"hidden")};class Qs extends $o{constructor(){super(),this.nodes={root:v.make("div",jo.container),line:v.make("div",jo.line)},this.nodes.root.appendChild(this.nodes.line)}getElement(){return this.nodes.root}toggleHidden(e){var t;(t=this.nodes.root)==null||t.classList.toggle(jo.hidden,e)}}var Ce=(n=>(n.Closed="closed",n.ClosedOnActivate="closed-on-activate",n))(Ce||{});const de=He("ce-popover"),J={popover:de(),popoverContainer:de("container"),popoverOpenTop:de(null,"open-top"),popoverOpenLeft:de(null,"open-left"),popoverOpened:de(null,"opened"),search:de("search"),nothingFoundMessage:de("nothing-found-message"),nothingFoundMessageDisplayed:de("nothing-found-message","displayed"),items:de("items"),overlay:de("overlay"),overlayHidden:de("overlay","hidden"),popoverNested:de(null,"nested"),getPopoverNestedClass:n=>de(null,`nested-level-${n.toString()}`),popoverInline:de(null,"inline"),popoverHeader:de("header")};var vt=(n=>(n.NestingLevel="--nesting-level",n.PopoverHeight="--popover-height",n.InlinePopoverWidth="--inline-popover-width",n.TriggerItemLeft="--trigger-item-left",n.TriggerItemTop="--trigger-item-top",n))(vt||{});const ea=He("ce-popover-item-html"),ta={root:ea(),hidden:ea(null,"hidden")};class Ft extends $o{constructor(e,t){var o,r;super(e),this.nodes={root:v.make("div",ta.root)},this.nodes.root.appendChild(e.element),e.name&&(this.nodes.root.dataset.itemName=e.name),e.hint!==void 0&&((o=t==null?void 0:t.hint)==null?void 0:o.enabled)!==!1&&this.addHint(this.nodes.root,{...e.hint,position:((r=t==null?void 0:t.hint)==null?void 0:r.position)||"right"})}getElement(){return this.nodes.root}toggleHidden(e){var t;(t=this.nodes.root)==null||t.classList.toggle(ta.hidden,e)}getControls(){const e=this.nodes.root.querySelectorAll(`button, ${v.allInputsSelector}`);return Array.from(e)}}class na extends Nt{constructor(e,t={}){super(),this.params=e,this.itemsRenderParams=t,this.listeners=new Rt,this.messages={nothingFound:"Nothing found",search:"Search"},this.items=this.buildItems(e.items),e.messages&&(this.messages={...this.messages,...e.messages}),this.nodes={},this.nodes.popoverContainer=v.make("div",[J.popoverContainer]),this.nodes.nothingFoundMessage=v.make("div",[J.nothingFoundMessage],{textContent:this.messages.nothingFound}),this.nodes.popoverContainer.appendChild(this.nodes.nothingFoundMessage),this.nodes.items=v.make("div",[J.items]),this.items.forEach(o=>{const r=o.getElement();r!==null&&this.nodes.items.appendChild(r)}),this.nodes.popoverContainer.appendChild(this.nodes.items),this.listeners.on(this.nodes.popoverContainer,"click",o=>this.handleClick(o)),this.nodes.popover=v.make("div",[J.popover,this.params.class]),this.nodes.popover.appendChild(this.nodes.popoverContainer)}get itemsDefault(){return this.items.filter(e=>e instanceof je)}getElement(){return this.nodes.popover}show(){!this.nodes.popover.isConnected&&!this.nodes.popover.parentNode&&document.body.appendChild(this.nodes.popover),this.nodes.popover.classList.add(J.popoverOpened),this.nodes.popover.setAttribute("data-popover-opened","true"),this.search!==void 0&&this.search.focus()}hide(){this.nodes.popover.classList.remove(J.popoverOpened),this.nodes.popover.classList.remove(J.popoverOpenTop),this.nodes.popover.removeAttribute("data-popover-opened"),this.itemsDefault.forEach(e=>e.reset()),this.search!==void 0&&this.search.clear(),this.emit(Ce.Closed)}destroy(){var e;this.items.forEach(t=>t.destroy()),this.nodes.popover.remove(),this.listeners.removeAll(),(e=this.search)==null||e.destroy()}activateItemByName(e){const t=this.items.find(o=>o.name===e);t!==void 0&&this.handleItemClick(t)}buildItems(e){return e.map(t=>{switch(t.type){case oe.Separator:return new Qs;case oe.Html:return new Ft(t,this.itemsRenderParams[oe.Html]);default:return new je(t,this.itemsRenderParams[oe.Default])}})}getTargetItem(e){return this.items.filter(t=>t instanceof je||t instanceof Ft).find(t=>{const o=t.getElement();return o===null?!1:e.composedPath().includes(o)})}handleItemClick(e){if(!(e instanceof je&&e.isDisabled)){if(e.hasChildren){this.showNestedItems(e),this.callHandleClickIfPresent(e);return}this.itemsDefault.filter(t=>t!==e).forEach(t=>t.reset()),this.callHandleClickIfPresent(e),this.toggleItemActivenessIfNeeded(e),e.closeOnActivate===!0&&(this.hide(),this.emit(Ce.ClosedOnActivate))}}handleClick(e){const t=this.getTargetItem(e);t!==void 0&&this.handleItemClick(t)}toggleItemActivenessIfNeeded(e){if(!(e instanceof je)||(e.toggle===!0&&e.toggleActive(),typeof e.toggle!="string"))return;const t=this.itemsDefault.filter(o=>o.toggle===e.toggle);if(t.length===1){e.toggleActive();return}t.forEach(o=>{o.toggleActive(o===e)})}callHandleClickIfPresent(e){"handleClick"in e&&typeof e.handleClick=="function"&&e.handleClick()}hasNode(e){return this.nodes.popover.contains(e)}}var zo=(n=>(n.Search="search",n))(zo||{});const Wo=He("cdx-search-field"),Uo={wrapper:Wo(),icon:Wo("icon"),input:Wo("input")};class JE extends Nt{constructor({items:e,placeholder:t}){super(),this.searchQuery="",this.handleValueChange=()=>{this.applySearch(this.input.value)},this.listeners=new Rt,this.items=e,this.wrapper=v.make("div",Uo.wrapper);const o=v.make("div",Uo.icon,{innerHTML:YE});this.input=v.make("input",Uo.input,{type:"search",placeholder:t,tabIndex:-1}),this.input.dataset.flipperTabTarget="true",this.wrapper.appendChild(o),this.wrapper.appendChild(this.input),this.overrideValueProperty(),["input","keyup","search","change"].forEach(i=>{this.listeners.on(this.input,i,this.handleValueChange)})}getElement(){return this.wrapper}focus(){this.input.focus()}clear(){this.input.value=""}applySearch(e){this.searchQuery!==e&&(this.searchQuery=e,this.emit(zo.Search,{query:e,items:this.foundItems}))}overrideValueProperty(){const e=Object.getPrototypeOf(this.input),t=Object.getOwnPropertyDescriptor(e,"value");if((t==null?void 0:t.set)===void 0||t.get===void 0)return;const o=this.applySearch.bind(this);Object.defineProperty(this.input,"value",{configurable:t.configurable??!0,enumerable:t.enumerable??!1,get(){var r;return((r=t.get)==null?void 0:r.call(this))??""},set(r){var i;(i=t.set)==null||i.call(this,r),o(r)}})}destroy(){this.listeners.removeAll()}get foundItems(){return this.items.filter(e=>this.checkItem(e))}checkItem(e){var r,i;const t=((r=e.title)==null?void 0:r.toLowerCase())||"",o=(i=this.searchQuery)==null?void 0:i.toLowerCase();return o!==void 0?t.includes(o):!1}}class qe extends na{constructor(e,t){super(e,t),this.nestingLevel=0,this.nestedPopoverTriggerItem=null,this.previouslyHoveredItem=null,this.scopeElement=document.body,this.hide=()=>{var o;super.hide(),this.destroyNestedPopoverIfExists(),(o=this.flipper)==null||o.deactivate(),this.previouslyHoveredItem=null},this.onFlip=()=>{const o=this.itemsDefault.find(r=>r.isFocused);o==null||o.onFocus()},this.onSearch=o=>{var a;const r=o.query==="",i=o.items.length===0;this.items.forEach(l=>{const c=l instanceof je,d=l instanceof Qs||l instanceof Ft,u=c?!o.items.includes(l):d&&(i||!r);l.toggleHidden(u)}),this.toggleNothingFoundMessage(i);const s=o.query===""?this.flippableElements:o.items.map(l=>l.getElement());(a=this.flipper)!=null&&a.isActivated&&(this.flipper.deactivate(),this.flipper.activate(s))},e.trigger&&(this.trigger=e.trigger),e.nestingLevel!==void 0&&(this.nestingLevel=e.nestingLevel),this.nestingLevel>0&&this.nodes.popover.classList.add(J.popoverNested),e.scopeElement!==void 0&&(this.scopeElement=e.scopeElement),this.nodes.popoverContainer!==null&&this.listeners.on(this.nodes.popoverContainer,"mouseover",o=>this.handleHover(o)),e.searchable&&this.addSearch(),e.flippable!==!1&&(e.flipper!==void 0?(e.flipper.deactivate(),e.flipper.removeOnFlip(this.onFlip),this.flipper=e.flipper):this.flipper=new Fe({items:this.flippableElements,focusedItemClass:G.focused,allowedKeys:[S.TAB,S.UP,S.DOWN,S.ENTER]}),this.flipper.onFlip(this.onFlip))}hasFocus(){return this.flipper===void 0?!1:this.flipper.hasFocus()}get scrollTop(){return this.nodes.items===null?0:this.nodes.items.scrollTop}get offsetTop(){return this.nodes.popoverContainer===null?0:this.nodes.popoverContainer.offsetTop}show(){var e;if(this.trigger){document.body.appendChild(this.nodes.popover);const{top:t,left:o}=this.calculatePosition();this.nodes.popover.style.position="absolute",this.nodes.popover.style.top=`${t}px`,this.nodes.popover.style.left=`${o}px`,this.nodes.popover.style.setProperty("--popover-top","0px"),this.nodes.popover.style.setProperty("--popover-left","0px")}this.nodes.popover.style.setProperty(vt.PopoverHeight,this.size.height+"px"),!this.trigger&&!this.shouldOpenBottom&&this.nodes.popover.classList.add(J.popoverOpenTop),!this.trigger&&!this.shouldOpenRight&&this.nodes.popover.classList.add(J.popoverOpenLeft),super.show(),(e=this.flipper)==null||e.activate(this.flippableElements)}calculatePosition(){if(!this.trigger)return{top:0,left:0};const e=this.trigger.getBoundingClientRect(),t=this.size,o=window.innerWidth,r=window.innerHeight,i=8,s=e.bottom+i+window.scrollY,l=e.bottom+i+t.height>r+window.scrollY&&e.top-i-t.height>window.scrollY?e.top-i-t.height+window.scrollY:s,c=e.left+window.scrollX,u=c+t.width>o+window.scrollX?Math.max(0,e.right-t.width+window.scrollX):c;return{top:l,left:u}}destroy(){this.hide(),super.destroy()}hasNode(e){return super.hasNode(e)?!0:this.nestedPopover!==void 0&&this.nestedPopover!==null?this.nestedPopover.hasNode(e):!1}showNestedItems(e){this.nestedPopover!==null&&this.nestedPopover!==void 0||(this.nestedPopoverTriggerItem=e,this.showNestedPopoverForItem(e))}handleHover(e){const t=this.getTargetItem(e);t!==void 0&&this.previouslyHoveredItem!==t&&(this.destroyNestedPopoverIfExists(),this.previouslyHoveredItem=t,t.hasChildren&&this.showNestedPopoverForItem(t))}setTriggerItemPosition(e,t){const o=t.getElement(),r=(o?o.offsetTop:0)-this.scrollTop,i=this.offsetTop+r;e.style.setProperty(vt.TriggerItemTop,i+"px")}destroyNestedPopoverIfExists(){var e,t;this.nestedPopover===void 0||this.nestedPopover===null||(this.nestedPopover.off(Ce.ClosedOnActivate,this.hide),this.nestedPopover.hide(),this.nestedPopover.destroy(),this.nestedPopover.getElement().remove(),this.nestedPopover=null,(e=this.flipper)==null||e.activate(this.flippableElements),requestAnimationFrame(()=>{var o;(o=this.flipper)==null||o.focusFirst()}),(t=this.nestedPopoverTriggerItem)==null||t.onChildrenClose())}showNestedPopoverForItem(e){var o;this.nestedPopover=new qe({searchable:e.isChildrenSearchable,items:e.children,nestingLevel:this.nestingLevel+1,flippable:e.isChildrenFlippable,messages:this.messages}),e.onChildrenOpen(),this.nestedPopover.on(Ce.ClosedOnActivate,this.hide);const t=this.nestedPopover.getElement();return this.nodes.popover.appendChild(t),this.setTriggerItemPosition(t,e),t.style.setProperty(vt.NestingLevel,this.nestedPopover.nestingLevel.toString()),this.nestedPopover.show(),(o=this.flipper)==null||o.deactivate(),this.nestedPopover}get shouldOpenBottom(){if(this.nodes.popover===void 0||this.nodes.popover===null)return!1;const e=this.nodes.popoverContainer.getBoundingClientRect(),t=this.scopeElement.getBoundingClientRect(),o=this.size.height,r=e.top+o,i=e.top-o,s=Math.min(window.innerHeight,t.bottom);return i<t.top||r<=s}get shouldOpenRight(){if(this.nodes.popover===void 0||this.nodes.popover===null)return!1;const e=this.nodes.popover.getBoundingClientRect(),t=this.scopeElement.getBoundingClientRect(),o=this.size.width,r=e.right+o,i=e.left-o,s=Math.min(window.innerWidth,t.right);return i<t.left||r<=s}get size(){var r;if(this._size)return this._size;const e={height:0,width:0};if(this.nodes.popover===null)return e;const t=this.nodes.popover.cloneNode(!0);t.style.visibility="hidden",t.style.position="absolute",t.style.top="-1000px",t.classList.add(J.popoverOpened),(r=t.querySelector("."+J.popoverNested))==null||r.remove(),document.body.appendChild(t);const o=t.querySelector("."+J.popoverContainer);return e.height=o.offsetHeight,e.width=o.offsetWidth,t.remove(),this._size=e,e}get flippableElements(){return this.items.flatMap(t=>{if(!(t instanceof je))return t instanceof Ft?t.getControls():[];if(t.isDisabled)return[];const o=t.getElement();return o?[o]:[]}).filter(t=>t!=null)}addSearch(){this.search=new JE({items:this.itemsDefault,placeholder:this.messages.search}),this.search.on(zo.Search,this.onSearch);const e=this.search.getElement();e.classList.add(J.search),this.nodes.popoverContainer.insertBefore(e,this.nodes.popoverContainer.firstChild)}toggleNothingFoundMessage(e){this.nodes.nothingFoundMessage.classList.toggle(J.nothingFoundMessageDisplayed,e)}}class Ko extends qe{constructor(e){var o;const t=!ut();super({...e,class:J.popoverInline},{[oe.Default]:{wrapperTag:"button",hint:{position:"top",alignment:"center",enabled:t}},[oe.Html]:{hint:{position:"top",alignment:"center",enabled:t}}}),(o=this.flipper)==null||o.setHandleContentEditableTargets(!0),this.items.forEach(r=>{!(r instanceof je)&&!(r instanceof Ft)||r.hasChildren&&r.isChildrenOpen&&this.showNestedItems(r)})}get offsetLeft(){return this.nodes.popoverContainer===null?0:this.nodes.popoverContainer.offsetLeft}show(){var t;super.show();const e=this.nestingLevel===0?(t=this.nodes.popoverContainer)==null?void 0:t.getBoundingClientRect():void 0;if(e!==void 0){const o=`${e.width}px`,r=`${e.height}px`;this.nodes.popover.style.setProperty(vt.InlinePopoverWidth,o),this.nodes.popover.style.width=o,this.nodes.popover.style.height=r}requestAnimationFrame(()=>{var o,r;(o=this.flipper)==null||o.deactivate(),(r=this.flipper)==null||r.activate(this.flippableElements)})}handleHover(){}setTriggerItemPosition(e,t){const o=t.getElement(),r=o?o.offsetLeft:0,i=this.offsetLeft+r;e.style.setProperty(vt.TriggerItemLeft,i+"px")}showNestedItems(e){if(this.nestedPopoverTriggerItem===e){this.destroyNestedPopoverIfExists(),this.nestedPopoverTriggerItem=null;return}super.showNestedItems(e)}showNestedPopoverForItem(e){var i;const t=super.showNestedPopoverForItem(e),o=t.getElement();(i=t.flipper)==null||i.setHandleContentEditableTargets(!0);const r=s=>{var a,l;if(!(s.key!=="Tab"||s.shiftKey)){if(this.nestedPopover!==t){document.removeEventListener("keydown",r,!0);return}s.preventDefault(),s.stopPropagation(),(a=t.flipper)==null||a.activate(t.flippableElements),(l=t.flipper)==null||l.focusFirst(),document.removeEventListener("keydown",r,!0)}};return document.addEventListener("keydown",r,!0),t.on(Ce.Closed,()=>{document.removeEventListener("keydown",r,!0)}),o.classList.add(J.getPopoverNestedClass(t.nestingLevel)),t}handleItemClick(e){var t;e!==this.nestedPopoverTriggerItem&&((t=this.nestedPopoverTriggerItem)==null||t.handleClick(),super.destroyNestedPopoverIfExists()),super.handleItemClick(e)}}const Ht=class{constructor(){this.scrollPosition=null}lock(){wo?this.lockHard():document.body.classList.add(Ht.CSS.scrollLocked)}unlock(){wo?this.unlockHard():document.body.classList.remove(Ht.CSS.scrollLocked)}lockHard(){this.scrollPosition=window.pageYOffset,document.documentElement.style.setProperty("--window-scroll-offset",`${this.scrollPosition}px`),document.body.classList.add(Ht.CSS.scrollLockedHard)}unlockHard(){document.body.classList.remove(Ht.CSS.scrollLockedHard),this.scrollPosition!==null&&window.scrollTo(0,this.scrollPosition),this.scrollPosition=null}};let oa=Ht;oa.CSS={scrollLocked:"ce-scroll-locked",scrollLockedHard:"ce-scroll-locked--hard"};const Go=He("ce-popover-header"),Yo={root:Go(),text:Go("text"),backButton:Go("back-button")};class QE{constructor({text:e,onBackButtonClick:t}){this.listeners=new Rt,this.text=e,this.onBackButtonClick=t,this.nodes={root:v.make("div",[Yo.root]),backButton:v.make("button",[Yo.backButton]),text:v.make("div",[Yo.text])},this.nodes.backButton.innerHTML=FE,this.nodes.root.appendChild(this.nodes.backButton),this.listeners.on(this.nodes.backButton,"click",this.onBackButtonClick),this.nodes.text.innerText=this.text,this.nodes.root.appendChild(this.nodes.text)}getElement(){return this.nodes.root}destroy(){this.nodes.root.remove(),this.listeners.destroy()}}class eT{constructor(){this.history=[]}push(e){this.history.push(e)}pop(){return this.history.pop()}get currentTitle(){return this.history.length===0?"":this.history[this.history.length-1].title}get currentItems(){return this.history.length===0?[]:this.history[this.history.length-1].items}reset(){for(;this.history.length>1;)this.pop()}}class ra extends na{constructor(e){super(e,{[oe.Default]:{hint:{enabled:!1}},[oe.Html]:{hint:{enabled:!1}}}),this.scrollLocker=new oa,this.history=new eT,this.isHidden=!0,this.nodes.overlay=v.make("div",[J.overlay,J.overlayHidden]),this.nodes.popover.insertBefore(this.nodes.overlay,this.nodes.popover.firstChild),this.listeners.on(this.nodes.overlay,"click",()=>{this.hide()}),this.history.push({items:e.items})}show(){this.nodes.overlay.classList.remove(J.overlayHidden),super.show(),this.scrollLocker.lock(),this.isHidden=!1}hide(){this.isHidden||(super.hide(),this.nodes.overlay.classList.add(J.overlayHidden),this.scrollLocker.unlock(),this.history.reset(),this.isHidden=!0)}destroy(){super.destroy(),this.scrollLocker.unlock()}showNestedItems(e){this.updateItemsAndHeader(e.children,e.title),this.history.push({title:e.title,items:e.children})}updateItemsAndHeader(e,t){var i;this.header!==null&&this.header!==void 0&&(this.header.destroy(),this.header=null);const o=t!==void 0;o&&(this.header=new QE({text:t,onBackButtonClick:()=>{this.history.pop(),this.updateItemsAndHeader(this.history.currentItems,this.history.currentTitle)}}));const r=((i=this.header)==null?void 0:i.getElement())??null;o&&r!==null&&this.nodes.popoverContainer.insertBefore(r,this.nodes.popoverContainer.firstChild),this.items.forEach(s=>{var a;return(a=s.getElement())==null?void 0:a.remove()}),this.items=this.buildItems(e),this.items.forEach(s=>{var l;const a=s.getElement();a!==null&&((l=this.nodes.items)==null||l.appendChild(a))})}}class tT extends F{constructor(){super(...arguments),this.opened=!1,this.selection=new w,this.popover=null,this.flipperInstance=new Fe({focusedItemClass:G.focused,allowedKeys:[S.TAB,S.UP,S.DOWN,S.ENTER]}),this.flipperKeydownHandler=null,this.flipperKeydownSource=null,this.close=()=>{this.opened&&(this.opened=!1,w.isAtEditor||this.selection.restore(),this.selection.clearSaved(),this.detachFlipperKeydownListener(),!this.Editor.CrossBlockSelection.isCrossBlockSelectionStarted&&this.Editor.BlockManager.currentBlock&&this.Editor.BlockSelection.unselectBlock(this.Editor.BlockManager.currentBlock),this.eventsDispatcher.emit(this.events.closed),this.popover&&(this.popover.off(Ce.Closed,this.onPopoverClose),this.popover.destroy(),this.popover.getElement().remove(),this.popover=null))},this.onPopoverClose=()=>{this.close()}}get events(){return{opened:xo,closed:Bo}}get CSS(){return{settings:"ce-settings"}}get flipper(){return this.flipperInstance}make(){this.nodes.wrapper=v.make("div",[this.CSS.settings]),this.eventsDispatcher.on(Lt,this.close)}destroy(){this.detachFlipperKeydownListener(),this.removeAllNodes(),this.listeners.destroy(),this.eventsDispatcher.off(Lt,this.close)}async open(e,t){const o=e??this.Editor.BlockManager.currentBlock;if(o===void 0)return;this.opened=!0,this.selection.save(),this.Editor.BlockSelection.selectBlock(o),this.Editor.BlockSelection.clearCache();const{toolTunes:r,commonTunes:i}=o.getTunes();this.eventsDispatcher.emit(this.events.opened);const s=ut()?ra:qe,a={searchable:!0,trigger:t||this.nodes.wrapper,items:await this.getTunesItems(o,i,r),scopeElement:this.Editor.API.methods.ui.nodes.redactor,messages:{nothingFound:ne.ui(ae.ui.popover,"Nothing found"),search:ne.ui(ae.ui.popover,"Filter")}};s===qe&&(a.flipper=this.flipperInstance),this.popover=new s(a),this.popover.on(Ce.Closed,this.onPopoverClose),this.popover.show(),s===qe&&this.flipperInstance.focusItem(0),this.attachFlipperKeydownListener(o)}getElement(){return this.nodes.wrapper}contains(e){var t,o;return!!((t=this.nodes.wrapper)!=null&&t.contains(e)||(o=this.popover)!=null&&o.hasNode(e))}async getTunesItems(e,t,o){const r=[];o!==void 0&&o.length>0&&(r.push(...o),r.push({type:oe.Separator}));const i=Array.from(this.Editor.Tools.blockTools.values()),a=(await Us(e,i)).reduce((l,c)=>(c.toolbox===void 0||c.toolbox.forEach(d=>{const u=d.title??c.name;l.push({icon:d.icon,title:ne.t(ae.toolNames,u),name:c.name,closeOnActivate:!0,onActivate:async()=>{const{BlockManager:h,Caret:g,Toolbar:f}=this.Editor,m=await h.convert(e,c.name,d.data);f.close(),g.setToBlock(m,g.positions.END)}})}),l),[]);return a.length>0&&(r.push({icon:Js,name:"convert-to",title:ne.ui(ae.ui.popover,"Convert to"),children:{searchable:!0,items:a}}),r.push({type:oe.Separator})),r.push(...t),r}attachFlipperKeydownListener(e){this.detachFlipperKeydownListener();const t=e==null?void 0:e.pluginsContent;t instanceof HTMLElement&&(this.flipperInstance.setHandleContentEditableTargets(!0),this.flipperKeydownHandler=o=>{this.flipperInstance.handleExternalKeydown(o)},t.addEventListener("keydown",this.flipperKeydownHandler,!0),this.flipperKeydownSource=t)}detachFlipperKeydownListener(){this.flipperKeydownSource!==null&&this.flipperKeydownHandler!==null&&this.flipperKeydownSource.removeEventListener("keydown",this.flipperKeydownHandler,!0),this.flipperInstance.setHandleContentEditableTargets(!1),this.flipperKeydownSource=null,this.flipperKeydownHandler=null}}var Xo={},nT={get exports(){return Xo},set exports(n){Xo=n}};/*!
19
- * Library for handling keyboard shortcuts
20
- * @copyright CodeX (https://codex.so)
21
- * @license MIT
22
- * @author CodeX (https://codex.so)
23
- * @version 1.1.1
24
- */(function(n,e){(function(t,o){n.exports=o()})(window,function(){return function(t){var o={};function r(i){if(o[i])return o[i].exports;var s=o[i]={i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,r),s.l=!0,s.exports}return r.m=t,r.c=o,r.d=function(i,s,a){r.o(i,s)||Object.defineProperty(i,s,{enumerable:!0,get:a})},r.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},r.t=function(i,s){if(1&s&&(i=r(i)),8&s||4&s&&typeof i=="object"&&i&&i.__esModule)return i;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:i}),2&s&&typeof i!="string")for(var l in i)r.d(a,l,function(c){return i[c]}.bind(null,l));return a},r.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(s,"a",s),s},r.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},r.p="",r(r.s=0)}([function(t,o,r){function i(l,c){for(var d=0;d<c.length;d++){var u=c[d];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(l,u.key,u)}}function s(l,c,d){return c&&i(l.prototype,c),d&&i(l,d),l}r.r(o);var a=function(){function l(c){var d=this;(function(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")})(this,l),this.commands={},this.keys={},this.name=c.name,this.parseShortcutName(c.name),this.element=c.on,this.callback=c.callback,this.executeShortcut=function(u){d.execute(u)},this.element.addEventListener("keydown",this.executeShortcut,!1)}return s(l,null,[{key:"supportedCommands",get:function(){return{SHIFT:["SHIFT"],CMD:["CMD","CONTROL","COMMAND","WINDOWS","CTRL"],ALT:["ALT","OPTION"]}}},{key:"keyCodes",get:function(){return{0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,BACKSPACE:8,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DELETE:46}}}]),s(l,[{key:"parseShortcutName",value:function(c){c=c.split("+");for(var d=0;d<c.length;d++){c[d]=c[d].toUpperCase();var u=!1;for(var h in l.supportedCommands)if(l.supportedCommands[h].includes(c[d])){u=this.commands[h]=!0;break}u||(this.keys[c[d]]=!0)}for(var g in l.supportedCommands)this.commands[g]||(this.commands[g]=!1)}},{key:"execute",value:function(c){var d,u={CMD:c.ctrlKey||c.metaKey,SHIFT:c.shiftKey,ALT:c.altKey},h=!0;for(d in this.commands)this.commands[d]!==u[d]&&(h=!1);var g,f=!0;for(g in this.keys)f=f&&c.keyCode===l.keyCodes[g];h&&f&&this.callback(c)}},{key:"remove",value:function(){this.element.removeEventListener("keydown",this.executeShortcut)}}]),l}();o.default=a}]).default})})(nT);const oT=li(Xo);class rT{constructor(){this.registeredShortcuts=new Map}add(e){if(this.findShortcut(e.on,e.name))throw Error(`Shortcut ${e.name} is already registered for ${e.on}. Please remove it before add a new handler.`);const o=new oT({name:e.name,on:e.on,callback:e.handler}),r=this.registeredShortcuts.get(e.on)||[];this.registeredShortcuts.set(e.on,[...r,o])}remove(e,t){const o=this.findShortcut(e,t);if(!o)return;o.remove();const r=this.registeredShortcuts.get(e);if(!r)return;const i=r.filter(s=>s!==o);if(i.length===0){this.registeredShortcuts.delete(e);return}this.registeredShortcuts.set(e,i)}findShortcut(e,t){return(this.registeredShortcuts.get(e)||[]).find(({name:r})=>r===t)}}const bt=new rT;var En=(n=>(n.Opened="toolbox-opened",n.Closed="toolbox-closed",n.BlockAdded="toolbox-block-added",n))(En||{});class Vo extends Nt{constructor({api:e,tools:t,i18nLabels:o,triggerElement:r}){super(),this.opened=!1,this.listeners=new Rt,this.popover=null,this.handleMobileLayoutToggle=()=>{this.destroyPopover(),this.initPopover()},this.onPopoverClose=()=>{this.opened=!1,this.emit("toolbox-closed")},this.api=e,this.tools=t,this.i18nLabels=o,this.triggerElement=r,this.enableShortcuts(),this.nodes={toolbox:v.make("div",Vo.CSS.toolbox)},this.initPopover(),this.api.events.on(Lt,this.handleMobileLayoutToggle)}get isEmpty(){return this.toolsToBeDisplayed.length===0}static get CSS(){return{toolbox:"ce-toolbox"}}getElement(){return this.nodes.toolbox}contains(e){var t;return!!(this.nodes.toolbox.contains(e)||(t=this.popover)!=null&&t.getElement().contains(e))}hasFocus(){if(this.popover!==null)return"hasFocus"in this.popover?this.popover.hasFocus():void 0}destroy(){var e;super.destroy(),this.nodes&&this.nodes.toolbox&&this.nodes.toolbox.remove(),this.removeAllShortcuts(),(e=this.popover)==null||e.off(Ce.Closed,this.onPopoverClose),this.listeners.destroy(),this.api.events.off(Lt,this.handleMobileLayoutToggle)}async toolButtonActivated(e,t){await this.insertNewBlock(e,t)}open(){var e;this.isEmpty||((e=this.popover)==null||e.show(),this.opened=!0,this.emit("toolbox-opened"))}close(){var e;(e=this.popover)==null||e.hide(),this.opened=!1,this.emit("toolbox-closed")}toggle(){this.opened?this.close():this.open()}initPopover(){const e=ut()?ra:qe;this.popover=new e({scopeElement:this.api.ui.nodes.redactor,trigger:this.triggerElement||this.nodes.toolbox,searchable:!0,messages:{nothingFound:this.i18nLabels.nothingFound,search:this.i18nLabels.filter},items:this.toolboxItemsToBeDisplayed}),this.popover.on(Ce.Closed,this.onPopoverClose)}destroyPopover(){this.popover!==null&&(this.popover.hide(),this.popover.off(Ce.Closed,this.onPopoverClose),this.popover.destroy(),this.popover=null),this.nodes.toolbox!==null&&(this.nodes.toolbox.innerHTML="")}get toolsToBeDisplayed(){if(this._toolsToBeDisplayed)return this._toolsToBeDisplayed;const e=[];return this.tools.forEach(t=>{t.toolbox&&e.push(t)}),this._toolsToBeDisplayed=e,e}get toolboxItemsToBeDisplayed(){if(this._toolboxItemsToBeDisplayed)return this._toolboxItemsToBeDisplayed;const e=(o,r,i=!0)=>({icon:o.icon,title:ne.t(ae.toolNames,o.title||mn(r.name)),name:r.name,onActivate:()=>{this.toolButtonActivated(r.name,o.data)},secondaryLabel:r.shortcut&&i?ko(r.shortcut):""}),t=this.toolsToBeDisplayed.reduce((o,r)=>{const{toolbox:i}=r;return i===void 0||(Array.isArray(i)?i:[i]).forEach((a,l)=>{o.push(e(a,r,l===0))}),o},[]);return this._toolboxItemsToBeDisplayed=t,t}enableShortcuts(){this.toolsToBeDisplayed.forEach(e=>{const t=e.shortcut;t&&this.enableShortcutForTool(e.name,t)})}enableShortcutForTool(e,t){bt.add({name:t,on:this.api.ui.nodes.redactor,handler:async o=>{o.preventDefault();const r=this.api.blocks.getCurrentBlockIndex(),i=this.api.blocks.getBlockByIndex(r);if(i)try{const s=await this.api.blocks.convert(i.id,e);this.api.caret.setToBlock(s,"end");return}catch{}await this.insertNewBlock(e)}})}removeAllShortcuts(){this.toolsToBeDisplayed.forEach(e=>{const t=e.shortcut;t&&bt.remove(this.api.ui.nodes.redactor,t)})}async insertNewBlock(e,t){const o=this.api.blocks.getCurrentBlockIndex(),r=this.api.blocks.getBlockByIndex(o);if(!r)return;const i=r.isEmpty?o:o+1,a=t!==void 0&&Object.keys(t).length>0?Object.assign(await this.api.blocks.composeBlockData(e),t):void 0,l=this.api.blocks.insert(e,a,void 0,i,void 0,r.isEmpty);this.api.caret.setToBlock(i),this.emit("toolbox-block-added",{block:l}),this.api.toolbar.close()}}const ia="block hovered",iT=async(n,e)=>{const t=navigator.keyboard;if(!t)return e;try{return(await t.getLayoutMap()).get(n)||e}catch(o){return console.error(o),e}};class sT extends F{constructor({config:e,eventsDispatcher:t}){super({config:e,eventsDispatcher:t}),this.hoveredBlock=null,this.toolboxInstance=null,this.onBlockSettingsOpen=()=>{var o;(o=this.nodes.settingsToggler)==null||o.classList.add(this.CSS.settingsTogglerOpened)},this.onBlockSettingsClose=()=>{var o;(o=this.nodes.settingsToggler)==null||o.classList.remove(this.CSS.settingsTogglerOpened)}}get CSS(){return{toolbar:"ce-toolbar",content:"ce-toolbar__content",actions:"ce-toolbar__actions",actionsOpened:"ce-toolbar__actions--opened",toolbarOpened:"ce-toolbar--opened",openedToolboxHolderModifier:"codex-editor--toolbox-opened",plusButton:"ce-toolbar__plus",plusButtonShortcut:"ce-toolbar__plus-shortcut",settingsToggler:"ce-toolbar__settings-btn",settingsTogglerHidden:"ce-toolbar__settings-btn--hidden",settingsTogglerOpened:"ce-toolbar__settings-btn--opened"}}get opened(){var e;return((e=this.nodes.wrapper)==null?void 0:e.classList.contains(this.CSS.toolbarOpened))??!1}contains(e){var t,o;return!!((t=this.nodes.wrapper)!=null&&t.contains(e)||(o=this.toolboxInstance)!=null&&o.contains(e)||this.Editor.BlockSettings.contains(e))}get toolbox(){var e;return{opened:(e=this.toolboxInstance)==null?void 0:e.opened,close:()=>{var t;(t=this.toolboxInstance)==null||t.close()},open:()=>{if(this.toolboxInstance===null){$("toolbox.open() called before initialization is finished","warn");return}this.hoveredBlock&&(this.Editor.BlockManager.currentBlock=this.hoveredBlock),this.toolboxInstance.open()},toggle:()=>{if(this.toolboxInstance===null){$("toolbox.toggle() called before initialization is finished","warn");return}this.toolboxInstance.toggle()},hasFocus:()=>{var t;return(t=this.toolboxInstance)==null?void 0:t.hasFocus()}}}get blockActions(){return{hide:()=>{var e;(e=this.nodes.actions)==null||e.classList.remove(this.CSS.actionsOpened)},show:()=>{var e;(e=this.nodes.actions)==null||e.classList.add(this.CSS.actionsOpened)}}}get blockTunesToggler(){return{hide:()=>{var e;return(e=this.nodes.settingsToggler)==null?void 0:e.classList.add(this.CSS.settingsTogglerHidden)},show:()=>{var e;return(e=this.nodes.settingsToggler)==null?void 0:e.classList.remove(this.CSS.settingsTogglerHidden)}}}toggleReadOnly(e){e?(this.destroy(),this.Editor.BlockSettings.destroy(),this.disableModuleBindings()):window.requestIdleCallback(async()=>{await this.drawUI(),this.enableModuleBindings()},{timeout:2e3})}moveAndOpen(e){if(this.toolboxInstance===null){$("Can't open Toolbar since Editor initialization is not finished yet","warn");return}this.toolboxInstance.opened&&this.toolboxInstance.close(),this.Editor.BlockSettings.opened&&this.Editor.BlockSettings.close();const t=e??this.Editor.BlockManager.currentBlock;if(!t)return;this.hoveredBlock=t;const{wrapper:o,plusButton:r}=this.nodes;if(!o||!r)return;const i=t.holder,{isMobile:s}=this.Editor.UI,a=20,l=t.firstInput,c=i.getBoundingClientRect(),d=l!==void 0?l.getBoundingClientRect():null,u=d!==null?d.top-c.top:null,h=(()=>{if(s)return i.offsetHeight;const m=parseInt(window.getComputedStyle(t.pluginsContent).paddingTop,10);if(l===void 0||u===null||u>a)return m;const b=zy(l),E=parseInt(window.getComputedStyle(r).height,10),k=8;return b-E+k+u})();o.style.top=`${Math.floor(h)}px`,i.appendChild(o);const g=t.getTunes(),f=g.toolTunes.length>0||g.commonTunes.length>0;this.Editor.BlockManager.blocks.length===1&&t.isEmpty&&!f?this.blockTunesToggler.hide():this.blockTunesToggler.show(),this.open()}close(){var e,t;this.Editor.ReadOnly.isEnabled||((e=this.nodes.wrapper)==null||e.classList.remove(this.CSS.toolbarOpened),this.blockActions.hide(),(t=this.toolboxInstance)==null||t.close(),this.Editor.BlockSettings.close(),this.reset())}reset(){this.nodes.wrapper&&(this.nodes.wrapper.style.top="unset",this.Editor.UI.nodes.wrapper.appendChild(this.nodes.wrapper))}open(e=!0){var t;(t=this.nodes.wrapper)==null||t.classList.add(this.CSS.toolbarOpened),e?this.blockActions.show():this.blockActions.hide()}async make(){const e=v.make("div",this.CSS.toolbar);this.nodes.wrapper=e;const t=v.make("div",this.CSS.content),o=v.make("div",this.CSS.actions);this.nodes.content=t,this.nodes.actions=o,v.append(e,t),v.append(t,o);const r=v.make("div",this.CSS.plusButton,{innerHTML:GE});this.nodes.plusButton=r,v.append(o,r),this.readOnlyMutableListeners.on(r,"click",()=>{Pt(!0),this.plusButtonClicked()},!1);const i=v.make("div");i.appendChild(document.createTextNode(ne.ui(ae.ui.toolbar.toolbox,"Add"))),i.appendChild(v.make("div",this.CSS.plusButtonShortcut,{textContent:"/"})),yn(r,i,{hidingDelay:400});const s=v.make("span",this.CSS.settingsToggler,{innerHTML:KE});this.nodes.settingsToggler=s,v.append(o,s);const a=v.make("div"),l=v.text(ne.ui(ae.ui.blockTunes.toggler,"Click to tune")),c=await iT("Slash","/");a.appendChild(l),a.appendChild(v.make("div",this.CSS.plusButtonShortcut,{textContent:ko(`CMD + ${c}`)})),yn(s,a,{hidingDelay:400}),v.append(o,this.makeToolbox());const d=this.Editor.BlockSettings.getElement();if(!d)throw new Error("Block Settings element was not created");v.append(o,d),v.append(this.Editor.UI.nodes.wrapper,e)}makeToolbox(){this.toolboxInstance=new Vo({api:this.Editor.API.methods,tools:this.Editor.Tools.blockTools,i18nLabels:{filter:ne.ui(ae.ui.popover,"Filter"),nothingFound:ne.ui(ae.ui.popover,"Nothing found")},triggerElement:this.nodes.plusButton}),this.toolboxInstance.on(En.Opened,()=>{this.Editor.UI.nodes.wrapper.classList.add(this.CSS.openedToolboxHolderModifier)}),this.toolboxInstance.on(En.Closed,()=>{this.Editor.UI.nodes.wrapper.classList.remove(this.CSS.openedToolboxHolderModifier)}),this.toolboxInstance.on(En.BlockAdded,({block:t})=>{const{BlockManager:o,Caret:r}=this.Editor,i=o.getBlockById(t.id);if(!i||i.inputs.length!==0)return;if(i===o.lastBlock){o.insertAtEnd(),r.setToBlock(o.lastBlock);return}const s=o.nextBlock;s&&r.setToBlock(s)});const e=this.toolboxInstance.getElement();if(e===null)throw new Error("Toolbox element was not created");return e}plusButtonClicked(){var e;this.hoveredBlock&&(this.Editor.BlockManager.currentBlock=this.hoveredBlock),(e=this.toolboxInstance)==null||e.toggle()}enableModuleBindings(){const e=this.nodes.settingsToggler;e&&(this.readOnlyMutableListeners.on(e,"mousedown",t=>{t.stopPropagation(),Pt(!0)},!0),this.readOnlyMutableListeners.on(e,"click",t=>{var o;t.stopPropagation(),this.settingsTogglerClicked(),(o=this.toolboxInstance)!=null&&o.opened&&this.toolboxInstance.close()},!0)),ut()||this.eventsDispatcher.on(ia,t=>{var r;const o=t.block;o instanceof re&&(this.Editor.BlockSettings.opened||(r=this.toolboxInstance)!=null&&r.opened||this.moveAndOpen(o))}),this.eventsDispatcher.on(xo,this.onBlockSettingsOpen),this.eventsDispatcher.on(Bo,this.onBlockSettingsClose)}disableModuleBindings(){this.readOnlyMutableListeners.clearAll(),this.eventsDispatcher.off(xo,this.onBlockSettingsOpen),this.eventsDispatcher.off(Bo,this.onBlockSettingsClose)}settingsTogglerClicked(){const e=this.hoveredBlock;e&&(this.Editor.BlockManager.currentBlock=e,this.Editor.BlockSettings.opened?this.Editor.BlockSettings.close():this.Editor.BlockSettings.open(e,this.nodes.settingsToggler))}async drawUI(){this.Editor.BlockSettings.make(),await this.make()}destroy(){this.removeAllNodes(),this.toolboxInstance&&this.toolboxInstance.destroy()}}var Ze=(n=>(n[n.Block=0]="Block",n[n.Inline=1]="Inline",n[n.Tune=2]="Tune",n))(Ze||{}),Tn=(n=>(n.Shortcut="shortcut",n.Toolbox="toolbox",n.EnabledInlineTools="inlineToolbar",n.EnabledBlockTunes="tunes",n.Config="config",n))(Tn||{}),sa=(n=>(n.Shortcut="shortcut",n.SanitizeConfig="sanitize",n))(sa||{}),yt=(n=>(n.IsEnabledLineBreaks="enableLineBreaks",n.Toolbox="toolbox",n.ConversionConfig="conversionConfig",n.IsReadOnlySupported="isReadOnlySupported",n.PasteConfig="pasteConfig",n))(yt||{}),aa=(n=>(n.IsInline="isInline",n.Title="title",n.IsReadOnlySupported="isReadOnlySupported",n))(aa||{}),qo=(n=>(n.IsTune="isTune",n))(qo||{});class Zo{constructor({name:e,constructable:t,config:o,api:r,isDefault:i,isInternal:s=!1,defaultPlaceholder:a}){this.api=r,this.name=e,this.constructable=t,this.config=o,this.isDefault=i,this.isInternal=s,this.defaultPlaceholder=a}get settings(){const e=this.config.config??{};return this.isDefault&&!("placeholder"in e)&&this.defaultPlaceholder&&(e.placeholder=this.defaultPlaceholder),e}reset(){if(j(this.constructable.reset))return this.constructable.reset()}prepare(){const e=this.constructable.prepare;if(!j(e))return;const t={toolName:this.name,config:this.settings};return e.call(this.constructable,t)}get shortcut(){const e=this.constructable.shortcut;return this.config.shortcut||e}get sanitizeConfig(){return this.constructable.sanitize||{}}isInline(){return this.type===Ze.Inline}isBlock(){return this.type===Ze.Block}isTune(){return this.type===Ze.Tune}}class aT extends F{constructor({config:e,eventsDispatcher:t}){super({config:e,eventsDispatcher:t}),this.CSS={inlineToolbar:"ce-inline-toolbar"},this.opened=!1,this.popover=null,this.toolbarVerticalMargin=ut()?20:6,this.initialized=!1,this.initializationScheduled=!1,this.tools=new Map,this.registeredShortcuts=new Map,this.shortcutsRegistered=!1,this.shortcutRegistrationScheduled=!1,this.listeners.on(document,"keydown",o=>{const r=o;r.shiftKey&&(r.key==="ArrowDown"||r.key==="ArrowUp")&&this.tryToShow()},!0),this.scheduleInitialization(),this.tryRegisterShortcuts()}set state(e){super.state=e,this.tryRegisterShortcuts()}initialize(){var e,t,o;if(!this.initialized){if(!((o=(t=(e=this.Editor)==null?void 0:e.UI)==null?void 0:t.nodes)!=null&&o.wrapper)||this.Editor.Tools===void 0){this.scheduleInitialization();return}this.make(),this.tryRegisterShortcuts(),this.initialized=!0}}tryRegisterShortcuts(){var t;if(this.shortcutsRegistered)return;if(((t=this.Editor)==null?void 0:t.Tools)===void 0){this.scheduleShortcutRegistration();return}this.registerInitialShortcuts()&&(this.shortcutsRegistered=!0)}scheduleShortcutRegistration(){if(this.shortcutsRegistered||this.shortcutRegistrationScheduled)return;this.shortcutRegistrationScheduled=!0;const e=()=>{this.shortcutRegistrationScheduled=!1,this.tryRegisterShortcuts()};typeof window<"u"&&typeof window.setTimeout=="function"?window.setTimeout(e,0):e()}scheduleInitialization(){if(this.initialized||this.initializationScheduled)return;this.initializationScheduled=!0;const e=()=>{this.initializationScheduled=!1,this.initialize()},t=()=>{window.setTimeout(e,0)};typeof window<"u"&&"requestIdleCallback"in window?window.requestIdleCallback(()=>{t()},{timeout:2e3}):t()}async tryToShow(e=!1){e&&this.close(),this.initialize(),this.allowedToShow()&&(await this.open(),this.Editor.Toolbar.close())}close(){var r,i,s,a,l,c;if(!this.opened)return;for(const d of this.tools.values());this.tools=new Map,this.reset(),this.opened=!1;const e=this.popover??this.createFallbackPopover();(r=e==null?void 0:e.hide)==null||r.call(e),(i=e==null?void 0:e.destroy)==null||i.call(e);const t=Ko.mock,o=(a=(s=t==null?void 0:t.results)==null?void 0:s.at(-1))==null?void 0:a.value;o&&o!==e&&((l=o.hide)==null||l.call(o),(c=o.destroy)==null||c.call(o)),this.popover=null}containsNode(e){return this.nodes.wrapper===void 0?!1:this.nodes.wrapper.contains(e)}destroy(){var e;this.removeAllNodes(),(e=this.popover)==null||e.destroy(),this.popover=null}make(){this.nodes.wrapper=v.make("div",[this.CSS.inlineToolbar,...this.isRtl?[this.Editor.UI.CSS.editorRtlFix]:[]]),this.nodes.wrapper.setAttribute(pt,SE),this.nodes.wrapper.setAttribute("data-cy","inline-toolbar"),v.append(this.Editor.UI.nodes.wrapper,this.nodes.wrapper)}async open(){var r,i,s,a,l,c,d,u,h,g;if(this.opened)return;this.initialize(),this.opened=!0,this.popover!==null&&this.popover.destroy(),this.createToolsInstances();const e=await this.getPopoverItems();this.popover=new Ko({items:e,scopeElement:((a=(s=(i=(r=this.Editor.API)==null?void 0:r.methods)==null?void 0:i.ui)==null?void 0:s.nodes)==null?void 0:a.redactor)??this.Editor.UI.nodes.redactor,messages:{nothingFound:ne.ui(ae.ui.popover,"Nothing found"),search:ne.ui(ae.ui.popover,"Filter")}});const t=(c=(l=this.popover).getElement)==null?void 0:c.call(l),o=((d=this.popover.size)==null?void 0:d.width)??(t==null?void 0:t.getBoundingClientRect().width)??0;this.move(o),t&&((u=this.nodes.wrapper)==null||u.append(t)),(g=(h=this.popover).show)==null||g.call(h)}move(e){const t=w.rect,o=this.Editor.UI.nodes.wrapper.getBoundingClientRect(),r={x:t.x-o.x,y:t.y+t.height-o.top+this.toolbarVerticalMargin};r.x+e+o.x>this.Editor.UI.contentRect.right&&(r.x=this.Editor.UI.contentRect.right-e-o.x),this.nodes.wrapper.style.left=Math.floor(r.x)+"px",this.nodes.wrapper.style.top=Math.floor(r.y)+"px"}reset(){this.nodes.wrapper!==void 0&&(this.nodes.wrapper.style.left="0",this.nodes.wrapper.style.top="0")}allowedToShow(){const e=["IMG","INPUT"],t=this.resolveSelection(),o=w.text;if(!t||!t.anchorNode||t.isCollapsed||o.length<1)return!1;const r=v.isElement(t.anchorNode)?t.anchorNode:t.anchorNode.parentElement;if(r===null||t!==null&&e.includes(r.tagName))return!1;const i=v.isElement(t.anchorNode)?t.anchorNode:t.anchorNode.parentElement,a=(i?this.Editor.BlockManager.getBlock(i):null)??this.Editor.BlockManager.currentBlock;if(a==null||this.getTools().some(f=>a.tool.inlineTools.has(f.name))===!1)return!1;const d="[contenteditable]";if(r.closest(d)!==null)return!0;const h=a.holder;return h&&(h.matches(d)?h:h.closest(d))?!0:this.Editor.ReadOnly.isEnabled?w.isSelectionAtEditor(t):!1}getTools(){const e=this.Editor.BlockManager.currentBlock??(()=>{const o=this.resolveSelection(),r=o==null?void 0:o.anchorNode;if(!r)return null;const i=v.isElement(r)?r:r.parentElement;return i?this.Editor.BlockManager.getBlock(i):null})();return e?Array.from(e.tool.inlineTools.values()).filter(o=>!(this.Editor.ReadOnly.isEnabled&&o.isReadOnlySupported!==!0)):[]}createToolsInstances(){this.tools=new Map,this.getTools().forEach(t=>{const o=t.create();this.tools.set(t,o)})}async getPopoverItems(){const e=[],t=Array.from(this.tools.entries());for(const[o,[r,i]]of t.entries()){const s=await i.render(),a=this.getToolShortcut(r.name);this.tryEnableShortcut(r.name,a);const l=a!==void 0?ko(a):void 0,c=ne.t(ae.toolNames,r.title||mn(r.name));[s].flat().forEach(d=>{this.processPopoverItem(d,r.name,i,c,l,e,o)})}return e}tryEnableShortcut(e,t){if(t!==void 0)try{this.enableShortcuts(e,t)}catch{}}processPopoverItem(e,t,o,r,i,s,a){const l={name:t,hint:{title:r,description:i}};if(!v.isElement(e)){if(e.type===oe.Html){s.push({...l,...e,type:oe.Html});return}if(e.type===oe.Separator){s.push({type:oe.Separator});return}this.processDefaultItem(e,l,s,a)}}processDefaultItem(e,t,o,r){const i={...t,...e,type:oe.Default};"children"in i&&r!==0&&o.push({type:oe.Separator}),o.push(i)}getToolShortcut(e){const{Tools:t}=this.Editor,o=t.inlineTools.get(e),r=t.internal.inlineTools;return Array.from(r.keys()).includes(e)?this.inlineTools[e][sa.Shortcut]:o==null?void 0:o.shortcut}enableShortcuts(e,t){const o=this.registeredShortcuts.get(e);o!==t&&(this.isShortcutTakenByAnotherTool(e,t)||(o!==void 0&&(bt.remove(document,o),this.registeredShortcuts.delete(e)),bt.add({name:t,handler:r=>{const{currentBlock:i}=this.Editor.BlockManager;i&&i.tool.enabledInlineTools!==!1&&(r.preventDefault(),this.activateToolByShortcut(e))},on:document}),this.registeredShortcuts.set(e,t)))}isShortcutTakenByAnotherTool(e,t){return Array.from(this.registeredShortcuts.entries()).some(([o,r])=>o!==e&&r===t)}async activateToolByShortcut(e){var o,r;if(this.opened||await this.tryToShow(),!w.get()){(o=this.popover)==null||o.activateItemByName(e);return}(r=this.popover)==null||r.activateItemByName(e)}get inlineTools(){const e={};return Array.from(this.Editor.Tools.inlineTools.entries()).forEach(([t,o])=>{e[t]=o.create()}),e}registerInitialShortcuts(){var o;const e=(o=this.Editor.Tools)==null?void 0:o.inlineTools;return e?(Array.from(e.keys()).forEach(r=>{const i=this.getToolShortcut(r);this.tryEnableShortcut(r,i)}),!0):(this.scheduleShortcutRegistration(),!1)}createFallbackPopover(){var e,t,o,r;try{const i=((r=(o=(t=(e=this.Editor.API)==null?void 0:e.methods)==null?void 0:t.ui)==null?void 0:o.nodes)==null?void 0:r.redactor)??this.Editor.UI.nodes.redactor;return new Ko({items:[],scopeElement:i,messages:{nothingFound:ne.ui(ae.ui.popover,"Nothing found"),search:ne.ui(ae.ui.popover,"Filter")}})}catch{return null}}resolveSelection(){const e=w.selection;if(e!==void 0)return e;const t=w.instance;return t!==void 0?t:w.get()}}const Jo=" ",Qo=new WeakSet,er=()=>{const n=window.getSelection();if(n===null)return[null,0];const e=n.focusNode,t=n.focusOffset;if(e===null)return[null,0];if(e.nodeType===Node.TEXT_NODE||e.childNodes.length===0)return[e,t];const o=e.childNodes[t];if(o!==void 0)return[o,0];const r=e.childNodes[t-1]??null,i=(r==null?void 0:r.textContent)??null;return[r,i!==null?i.length:0]},la=n=>{if(!(n instanceof HTMLElement)||v.isSingleTag(n)||v.isNativeInput(n))return!1;if(n.childNodes.length===0)return!0;const e=n.textContent??"";return e.includes(Jo)||!Co(e)?!1:Array.from(n.children).every(t=>la(t))},ca=typeof window<"u"&&typeof window.MutationObserver<"u"?new window.MutationObserver(n=>{for(const e of n){const t=e.nextSibling;e.removedNodes.forEach(o=>{var l;if(!(o instanceof Element)||!la(o))return;const r=t instanceof Text?t:null;if(r===null||!r.isConnected)return;const i=r.parentElement;if(!((i==null?void 0:i.isContentEditable)??!1))return;const s=((l=r.textContent)==null?void 0:l[0])??null;(s===Jo||s===" ")&&Qo.add(r)})}}):null,da=new WeakSet,ua=n=>{if(ca===null||da.has(n))return;const e=()=>{n.body!==null&&(ca.observe(n.body,{childList:!0,subtree:!0}),da.add(n))};n.readyState==="loading"?n.addEventListener("DOMContentLoaded",e,{once:!0}):e()};typeof window<"u"&&typeof window.document<"u"&&ua(window.document);const lT=n=>{ua(n.ownerDocument);const[e,t]=er();if(e===null||!n.contains(e)||e.nodeType===Node.TEXT_NODE&&t<(e.textContent??"").length)return null;const o=document.createTreeWalker(n,NodeFilter.SHOW_TEXT);for(o.currentNode=e;;){const r=o.nextNode();if(r===null)return null;const i=r.textContent??"";if(i.length===0)continue;const s=i[0];if(!(s===Jo||s===" ")||r===e)return null;const l=document.createRange();try{l.setStart(e,t),l.setEnd(r,0)}catch{return null}const c=l.cloneContents(),d=document.createElement("div");d.appendChild(c);const u=Array.from(d.querySelectorAll("*")).some(g=>{const f=g.textContent??"";return f.length===0||Co(f)}),h=Qo.has(r);if(!(!u&&!h))return h&&Qo.delete(r),{node:r,offset:0}}},ha=(n,e,t,o)=>{const r=document.createRange();o==="left"?(r.selectNodeContents(n),r.setEnd(e,t)):(r.selectNodeContents(n),r.setStart(e,t));const i=r.cloneContents(),s=document.createElement("div");s.appendChild(i);const a=s.textContent||"";if(s.querySelectorAll("img, br, hr, input, area, base, col, embed, link, meta, param, source, track, wbr").length>0)return!1;const c=a.includes(" ")||s.innerHTML.includes("&nbsp;")||r.toString().includes(" "),d=e.nodeType===Node.TEXT_NODE&&(o==="left"?(e.textContent||"").slice(0,t):(e.textContent||"").slice(t)).includes(" ");if(c||d)return!1;s.style.position="absolute",s.style.visibility="hidden",s.style.height="auto",s.style.width="auto",s.style.whiteSpace=window.getComputedStyle(n).whiteSpace,document.body.appendChild(s);const u=s.getBoundingClientRect().width;return document.body.removeChild(s),!(u>0||!Co(a)||window.getComputedStyle(n).whiteSpace.startsWith("pre")&&a.length>0)},kn=n=>{const e=v.getDeepestNode(n);if(e===null||v.isEmpty(n))return!0;if(v.isNativeInput(e))return e.selectionEnd===0;if(v.isEmpty(n))return!0;const[t,o]=er();if(t===null)return!1;const r=window.getSelection(),i=(r==null?void 0:r.focusNode)??null;return i!==null&&i!==n&&!(i.nodeType===Node.TEXT_NODE&&i.parentNode===n)?!1:ha(n,t,o,"left")},wn=n=>{const e=v.getDeepestNode(n,!0);if(e===null)return!0;if(v.isNativeInput(e))return e.selectionEnd===e.value.length;const[t,o]=er();return t===null?!1:ha(n,t,o,"right")};var fa={},tr={},Cn={},Je={},nr={},or={};Object.defineProperty(or,"__esModule",{value:!0}),or.allInputsSelector=cT;function cT(){var n=["text","password","email","number","search","tel","url"];return"[contenteditable=true], textarea, input:not([type]), "+n.map(function(e){return'input[type="'.concat(e,'"]')}).join(", ")}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.allInputsSelector=void 0;var e=or;Object.defineProperty(n,"allInputsSelector",{enumerable:!0,get:function(){return e.allInputsSelector}})})(nr);var Qe={},rr={};Object.defineProperty(rr,"__esModule",{value:!0}),rr.isNativeInput=dT;function dT(n){var e=["INPUT","TEXTAREA"];return n&&n.tagName?e.includes(n.tagName):!1}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.isNativeInput=void 0;var e=rr;Object.defineProperty(n,"isNativeInput",{enumerable:!0,get:function(){return e.isNativeInput}})})(Qe);var pa={},ir={};Object.defineProperty(ir,"__esModule",{value:!0}),ir.append=uT;function uT(n,e){Array.isArray(e)?e.forEach(function(t){n.appendChild(t)}):n.appendChild(e)}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.append=void 0;var e=ir;Object.defineProperty(n,"append",{enumerable:!0,get:function(){return e.append}})})(pa);var sr={},ar={};Object.defineProperty(ar,"__esModule",{value:!0}),ar.blockElements=hT;function hT(){return["address","article","aside","blockquote","canvas","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","noscript","ol","output","p","pre","ruby","section","table","tbody","thead","tr","tfoot","ul","video"]}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.blockElements=void 0;var e=ar;Object.defineProperty(n,"blockElements",{enumerable:!0,get:function(){return e.blockElements}})})(sr);var ga={},lr={};Object.defineProperty(lr,"__esModule",{value:!0}),lr.calculateBaseline=fT;function fT(n){var e=window.getComputedStyle(n),t=parseFloat(e.fontSize),o=parseFloat(e.lineHeight)||t*1.2,r=parseFloat(e.paddingTop),i=parseFloat(e.borderTopWidth),s=parseFloat(e.marginTop),a=t*.8,l=(o-t)/2,c=s+i+r+l+a;return c}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.calculateBaseline=void 0;var e=lr;Object.defineProperty(n,"calculateBaseline",{enumerable:!0,get:function(){return e.calculateBaseline}})})(ga);var ma={},cr={},dr={},ur={};Object.defineProperty(ur,"__esModule",{value:!0}),ur.isContentEditable=pT;function pT(n){return n.contentEditable==="true"}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.isContentEditable=void 0;var e=ur;Object.defineProperty(n,"isContentEditable",{enumerable:!0,get:function(){return e.isContentEditable}})})(dr),Object.defineProperty(cr,"__esModule",{value:!0}),cr.canSetCaret=vT;var gT=Qe,mT=dr;function vT(n){var e=!0;if((0,gT.isNativeInput)(n))switch(n.type){case"file":case"checkbox":case"radio":case"hidden":case"submit":case"button":case"image":case"reset":e=!1;break}else e=(0,mT.isContentEditable)(n);return e}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.canSetCaret=void 0;var e=cr;Object.defineProperty(n,"canSetCaret",{enumerable:!0,get:function(){return e.canSetCaret}})})(ma);var Sn={},hr={};function bT(n,e,t){const o=t.value!==void 0?"value":"get",r=t[o],i=`#${e}Cache`;if(t[o]=function(...s){return this[i]===void 0&&(this[i]=r.apply(this,s)),this[i]},o==="get"&&t.set){const s=t.set;t.set=function(a){delete n[i],s.apply(this,a)}}return t}function va(){const n={win:!1,mac:!1,x11:!1,linux:!1},e=Object.keys(n).find(t=>window.navigator.appVersion.toLowerCase().indexOf(t)!==-1);return e!==void 0&&(n[e]=!0),n}function fr(n){return n!=null&&n!==""&&(typeof n!="object"||Object.keys(n).length>0)}function yT(n){return!fr(n)}const ET=()=>typeof window<"u"&&window.navigator!==null&&fr(window.navigator.platform)&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1);function TT(n){const e=va();return n=n.replace(/shift/gi,"⇧").replace(/backspace/gi,"⌫").replace(/enter/gi,"⏎").replace(/up/gi,"↑").replace(/left/gi,"→").replace(/down/gi,"↓").replace(/right/gi,"←").replace(/escape/gi,"⎋").replace(/insert/gi,"Ins").replace(/delete/gi,"␡").replace(/\+/gi,"+"),e.mac?n=n.replace(/ctrl|cmd/gi,"⌘").replace(/alt/gi,"⌥"):n=n.replace(/cmd/gi,"Ctrl").replace(/windows/gi,"WIN"),n}function kT(n){return n[0].toUpperCase()+n.slice(1)}function wT(n){const e=document.createElement("div");e.style.position="absolute",e.style.left="-999px",e.style.bottom="-999px",e.innerHTML=n,document.body.appendChild(e);const t=window.getSelection(),o=document.createRange();if(o.selectNode(e),t===null)throw new Error("Cannot copy text to clipboard");t.removeAllRanges(),t.addRange(o),document.execCommand("copy"),document.body.removeChild(e)}function CT(n,e,t){let o;return(...r)=>{const i=this,s=()=>{o=void 0,t!==!0&&n.apply(i,r)},a=t===!0&&o!==void 0;window.clearTimeout(o),o=window.setTimeout(s,e),a&&n.apply(i,r)}}function ze(n){return Object.prototype.toString.call(n).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}function ST(n){return ze(n)==="boolean"}function ba(n){return ze(n)==="function"||ze(n)==="asyncfunction"}function xT(n){return ba(n)&&/^\s*class\s+/.test(n.toString())}function BT(n){return ze(n)==="number"}function xn(n){return ze(n)==="object"}function _T(n){return Promise.resolve(n)===n}function AT(n){return ze(n)==="string"}function IT(n){return ze(n)==="undefined"}function pr(n,...e){if(!e.length)return n;const t=e.shift();if(xn(n)&&xn(t))for(const o in t)xn(t[o])?(n[o]===void 0&&Object.assign(n,{[o]:{}}),pr(n[o],t[o])):Object.assign(n,{[o]:t[o]});return pr(n,...e)}function OT(n,e,t){const o=`«${e}» is deprecated and will be removed in the next major release. Please use the «${t}» instead.`;n&&console.warn(o)}function NT(n){try{return new URL(n).href}catch{}return n.substring(0,2)==="//"?window.location.protocol+n:window.location.origin+n}function RT(n){return n>47&&n<58||n===32||n===13||n===229||n>64&&n<91||n>95&&n<112||n>185&&n<193||n>218&&n<223}const LT={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,LEFT:37,UP:38,DOWN:40,RIGHT:39,DELETE:46,META:91,SLASH:191},PT={LEFT:0,WHEEL:1,RIGHT:2,BACKWARD:3,FORWARD:4};let MT=class{constructor(){this.completed=Promise.resolve()}add(e){return new Promise((t,o)=>{this.completed=this.completed.then(e).then(t).catch(o)})}};function DT(n,e,t=void 0){let o,r,i,s=null,a=0;t||(t={});const l=function(){a=t.leading===!1?0:Date.now(),s=null,i=n.apply(o,r),s===null&&(o=r=null)};return function(){const c=Date.now();!a&&t.leading===!1&&(a=c);const d=e-(c-a);return o=this,r=arguments,d<=0||d>e?(s&&(clearTimeout(s),s=null),a=c,i=n.apply(o,r),s===null&&(o=r=null)):!s&&t.trailing!==!1&&(s=setTimeout(l,d)),i}}const gr=Tl(Object.freeze(Object.defineProperty({__proto__:null,PromiseQueue:MT,beautifyShortcut:TT,cacheable:bT,capitalize:kT,copyTextToClipboard:wT,debounce:CT,deepMerge:pr,deprecationAssert:OT,getUserOS:va,getValidUrl:NT,isBoolean:ST,isClass:xT,isEmpty:yT,isFunction:ba,isIosDevice:ET,isNumber:BT,isObject:xn,isPrintableKey:RT,isPromise:_T,isString:AT,isUndefined:IT,keyCodes:LT,mouseButtons:PT,notEmpty:fr,throttle:DT,typeOf:ze},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(hr,"__esModule",{value:!0}),hr.containsOnlyInlineElements=HT;var $T=gr,FT=sr;function HT(n){var e;(0,$T.isString)(n)?(e=document.createElement("div"),e.innerHTML=n):e=n;var t=function(o){return!(0,FT.blockElements)().includes(o.tagName.toLowerCase())&&Array.from(o.children).every(t)};return Array.from(e.children).every(t)}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.containsOnlyInlineElements=void 0;var e=hr;Object.defineProperty(n,"containsOnlyInlineElements",{enumerable:!0,get:function(){return e.containsOnlyInlineElements}})})(Sn);var ya={},mr={},Bn={},vr={};Object.defineProperty(vr,"__esModule",{value:!0}),vr.make=jT;function jT(n,e,t){var o;e===void 0&&(e=null),t===void 0&&(t={});var r=document.createElement(n);if(Array.isArray(e)){var i=e.filter(function(a){return a!==void 0});(o=r.classList).add.apply(o,i)}else e!==null&&r.classList.add(e);for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=t[s]);return r}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.make=void 0;var e=vr;Object.defineProperty(n,"make",{enumerable:!0,get:function(){return e.make}})})(Bn),Object.defineProperty(mr,"__esModule",{value:!0}),mr.fragmentToString=WT;var zT=Bn;function WT(n){var e=(0,zT.make)("div");return e.appendChild(n),e.innerHTML}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.fragmentToString=void 0;var e=mr;Object.defineProperty(n,"fragmentToString",{enumerable:!0,get:function(){return e.fragmentToString}})})(ya);var Ea={},br={};Object.defineProperty(br,"__esModule",{value:!0}),br.getContentLength=KT;var UT=Qe;function KT(n){var e,t;return(0,UT.isNativeInput)(n)?n.value.length:n.nodeType===Node.TEXT_NODE?n.length:(t=(e=n.textContent)===null||e===void 0?void 0:e.length)!==null&&t!==void 0?t:0}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.getContentLength=void 0;var e=br;Object.defineProperty(n,"getContentLength",{enumerable:!0,get:function(){return e.getContentLength}})})(Ea);var yr={},Er={},Ta=pe&&pe.__spreadArray||function(n,e,t){if(t||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return n.concat(i||Array.prototype.slice.call(e))};Object.defineProperty(Er,"__esModule",{value:!0}),Er.getDeepestBlockElements=ka;var GT=Sn;function ka(n){return(0,GT.containsOnlyInlineElements)(n)?[n]:Array.from(n.children).reduce(function(e,t){return Ta(Ta([],e,!0),ka(t),!0)},[])}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.getDeepestBlockElements=void 0;var e=Er;Object.defineProperty(n,"getDeepestBlockElements",{enumerable:!0,get:function(){return e.getDeepestBlockElements}})})(yr);var wa={},Tr={},_n={},kr={};Object.defineProperty(kr,"__esModule",{value:!0}),kr.isLineBreakTag=YT;function YT(n){return["BR","WBR"].includes(n.tagName)}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.isLineBreakTag=void 0;var e=kr;Object.defineProperty(n,"isLineBreakTag",{enumerable:!0,get:function(){return e.isLineBreakTag}})})(_n);var An={},wr={};Object.defineProperty(wr,"__esModule",{value:!0}),wr.isSingleTag=XT;function XT(n){return["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"].includes(n.tagName)}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.isSingleTag=void 0;var e=wr;Object.defineProperty(n,"isSingleTag",{enumerable:!0,get:function(){return e.isSingleTag}})})(An),Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.getDeepestNode=Ca;var VT=Qe,qT=_n,ZT=An;function Ca(n,e){e===void 0&&(e=!1);var t=e?"lastChild":"firstChild",o=e?"previousSibling":"nextSibling";if(n.nodeType===Node.ELEMENT_NODE&&n[t]){var r=n[t];if((0,ZT.isSingleTag)(r)&&!(0,VT.isNativeInput)(r)&&!(0,qT.isLineBreakTag)(r))if(r[o])r=r[o];else if(r.parentNode!==null&&r.parentNode[o])r=r.parentNode[o];else return r.parentNode;return Ca(r,e)}return n}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.getDeepestNode=void 0;var e=Tr;Object.defineProperty(n,"getDeepestNode",{enumerable:!0,get:function(){return e.getDeepestNode}})})(wa);var Sa={},Cr={},In=pe&&pe.__spreadArray||function(n,e,t){if(t||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return n.concat(i||Array.prototype.slice.call(e))};Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.findAllInputs=nk;var JT=Sn,QT=yr,ek=nr,tk=Qe;function nk(n){return Array.from(n.querySelectorAll((0,ek.allInputsSelector)())).reduce(function(e,t){return(0,tk.isNativeInput)(t)||(0,JT.containsOnlyInlineElements)(t)?In(In([],e,!0),[t],!1):In(In([],e,!0),(0,QT.getDeepestBlockElements)(t),!0)},[])}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.findAllInputs=void 0;var e=Cr;Object.defineProperty(n,"findAllInputs",{enumerable:!0,get:function(){return e.findAllInputs}})})(Sa);var xa={},Sr={};Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.isCollapsedWhitespaces=ok;function ok(n){return!/[^\t\n\r ]/.test(n)}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.isCollapsedWhitespaces=void 0;var e=Sr;Object.defineProperty(n,"isCollapsedWhitespaces",{enumerable:!0,get:function(){return e.isCollapsedWhitespaces}})})(xa);var xr={},Br={};Object.defineProperty(Br,"__esModule",{value:!0}),Br.isElement=ik;var rk=gr;function ik(n){return(0,rk.isNumber)(n)?!1:!!n&&!!n.nodeType&&n.nodeType===Node.ELEMENT_NODE}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.isElement=void 0;var e=Br;Object.defineProperty(n,"isElement",{enumerable:!0,get:function(){return e.isElement}})})(xr);var Ba={},_r={},Ar={},Ir={};Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.isLeaf=sk;function sk(n){return n===null?!1:n.childNodes.length===0}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.isLeaf=void 0;var e=Ir;Object.defineProperty(n,"isLeaf",{enumerable:!0,get:function(){return e.isLeaf}})})(Ar);var Or={},Nr={};Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.isNodeEmpty=uk;var ak=_n,lk=xr,ck=Qe,dk=An;function uk(n,e){var t="";return(0,dk.isSingleTag)(n)&&!(0,ak.isLineBreakTag)(n)?!1:((0,lk.isElement)(n)&&(0,ck.isNativeInput)(n)?t=n.value:n.textContent!==null&&(t=n.textContent.replace("​","")),e!==void 0&&(t=t.replace(new RegExp(e,"g"),"")),t.trim().length===0)}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.isNodeEmpty=void 0;var e=Nr;Object.defineProperty(n,"isNodeEmpty",{enumerable:!0,get:function(){return e.isNodeEmpty}})})(Or),Object.defineProperty(_r,"__esModule",{value:!0}),_r.isEmpty=pk;var hk=Ar,fk=Or;function pk(n,e){n.normalize();for(var t=[n];t.length>0;){var o=t.shift();if(o){if(n=o,(0,hk.isLeaf)(n)&&!(0,fk.isNodeEmpty)(n,e))return!1;t.push.apply(t,Array.from(n.childNodes))}}return!0}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.isEmpty=void 0;var e=_r;Object.defineProperty(n,"isEmpty",{enumerable:!0,get:function(){return e.isEmpty}})})(Ba);var _a={},Rr={};Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.isFragment=mk;var gk=gr;function mk(n){return(0,gk.isNumber)(n)?!1:!!n&&!!n.nodeType&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.isFragment=void 0;var e=Rr;Object.defineProperty(n,"isFragment",{enumerable:!0,get:function(){return e.isFragment}})})(_a);var Aa={},Lr={};Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.isHTMLString=bk;var vk=Bn;function bk(n){var e=(0,vk.make)("div");return e.innerHTML=n,e.childElementCount>0}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.isHTMLString=void 0;var e=Lr;Object.defineProperty(n,"isHTMLString",{enumerable:!0,get:function(){return e.isHTMLString}})})(Aa);var Ia={},Pr={};Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.offset=yk;function yk(n){var e=n.getBoundingClientRect(),t=window.pageXOffset||document.documentElement.scrollLeft,o=window.pageYOffset||document.documentElement.scrollTop,r=e.top+o,i=e.left+t;return{top:r,left:i,bottom:r+e.height,right:i+e.width}}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.offset=void 0;var e=Pr;Object.defineProperty(n,"offset",{enumerable:!0,get:function(){return e.offset}})})(Ia);var Oa={},Mr={};Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.prepend=Ek;function Ek(n,e){Array.isArray(e)?(e=e.reverse(),e.forEach(function(t){return n.prepend(t)})):n.prepend(e)}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.prepend=void 0;var e=Mr;Object.defineProperty(n,"prepend",{enumerable:!0,get:function(){return e.prepend}})})(Oa),function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.prepend=n.offset=n.make=n.isLineBreakTag=n.isSingleTag=n.isNodeEmpty=n.isLeaf=n.isHTMLString=n.isFragment=n.isEmpty=n.isElement=n.isContentEditable=n.isCollapsedWhitespaces=n.findAllInputs=n.isNativeInput=n.allInputsSelector=n.getDeepestNode=n.getDeepestBlockElements=n.getContentLength=n.fragmentToString=n.containsOnlyInlineElements=n.canSetCaret=n.calculateBaseline=n.blockElements=n.append=void 0;var e=nr;Object.defineProperty(n,"allInputsSelector",{enumerable:!0,get:function(){return e.allInputsSelector}});var t=Qe;Object.defineProperty(n,"isNativeInput",{enumerable:!0,get:function(){return t.isNativeInput}});var o=pa;Object.defineProperty(n,"append",{enumerable:!0,get:function(){return o.append}});var r=sr;Object.defineProperty(n,"blockElements",{enumerable:!0,get:function(){return r.blockElements}});var i=ga;Object.defineProperty(n,"calculateBaseline",{enumerable:!0,get:function(){return i.calculateBaseline}});var s=ma;Object.defineProperty(n,"canSetCaret",{enumerable:!0,get:function(){return s.canSetCaret}});var a=Sn;Object.defineProperty(n,"containsOnlyInlineElements",{enumerable:!0,get:function(){return a.containsOnlyInlineElements}});var l=ya;Object.defineProperty(n,"fragmentToString",{enumerable:!0,get:function(){return l.fragmentToString}});var c=Ea;Object.defineProperty(n,"getContentLength",{enumerable:!0,get:function(){return c.getContentLength}});var d=yr;Object.defineProperty(n,"getDeepestBlockElements",{enumerable:!0,get:function(){return d.getDeepestBlockElements}});var u=wa;Object.defineProperty(n,"getDeepestNode",{enumerable:!0,get:function(){return u.getDeepestNode}});var h=Sa;Object.defineProperty(n,"findAllInputs",{enumerable:!0,get:function(){return h.findAllInputs}});var g=xa;Object.defineProperty(n,"isCollapsedWhitespaces",{enumerable:!0,get:function(){return g.isCollapsedWhitespaces}});var f=dr;Object.defineProperty(n,"isContentEditable",{enumerable:!0,get:function(){return f.isContentEditable}});var m=xr;Object.defineProperty(n,"isElement",{enumerable:!0,get:function(){return m.isElement}});var b=Ba;Object.defineProperty(n,"isEmpty",{enumerable:!0,get:function(){return b.isEmpty}});var E=_a;Object.defineProperty(n,"isFragment",{enumerable:!0,get:function(){return E.isFragment}});var k=Aa;Object.defineProperty(n,"isHTMLString",{enumerable:!0,get:function(){return k.isHTMLString}});var N=Ar;Object.defineProperty(n,"isLeaf",{enumerable:!0,get:function(){return N.isLeaf}});var x=Or;Object.defineProperty(n,"isNodeEmpty",{enumerable:!0,get:function(){return x.isNodeEmpty}});var P=_n;Object.defineProperty(n,"isLineBreakTag",{enumerable:!0,get:function(){return P.isLineBreakTag}});var I=An;Object.defineProperty(n,"isSingleTag",{enumerable:!0,get:function(){return I.isSingleTag}});var X=Bn;Object.defineProperty(n,"make",{enumerable:!0,get:function(){return X.make}});var C=Ia;Object.defineProperty(n,"offset",{enumerable:!0,get:function(){return C.offset}});var T=Oa;Object.defineProperty(n,"prepend",{enumerable:!0,get:function(){return T.prepend}})}(Je);var On={};Object.defineProperty(On,"__esModule",{value:!0}),On.getContenteditableSlice=kk;var Tk=Je;function kk(n,e,t,o,r){var i;r===void 0&&(r=!1);var s=document.createRange();if(o==="left"?(s.setStart(n,0),s.setEnd(e,t)):(s.setStart(e,t),s.setEnd(n,n.childNodes.length)),r===!0){var a=s.extractContents();return(0,Tk.fragmentToString)(a)}var l=s.cloneContents(),c=document.createElement("div");c.appendChild(l);var d=(i=c.textContent)!==null&&i!==void 0?i:"";return d}Object.defineProperty(Cn,"__esModule",{value:!0}),Cn.checkContenteditableSliceForEmptiness=Sk;var wk=Je,Ck=On;function Sk(n,e,t,o){var r=(0,Ck.getContenteditableSlice)(n,e,t,o);return(0,wk.isCollapsedWhitespaces)(r)}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.checkContenteditableSliceForEmptiness=void 0;var e=Cn;Object.defineProperty(n,"checkContenteditableSliceForEmptiness",{enumerable:!0,get:function(){return e.checkContenteditableSliceForEmptiness}})})(tr);var Na={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.getContenteditableSlice=void 0;var e=On;Object.defineProperty(n,"getContenteditableSlice",{enumerable:!0,get:function(){return e.getContenteditableSlice}})})(Na);var Ra={},Dr={};Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.focus=Bk;var xk=Je;function Bk(n,e){var t,o;if(e===void 0&&(e=!0),(0,xk.isNativeInput)(n)){n.focus();var r=e?0:n.value.length;n.setSelectionRange(r,r)}else{var i=document.createRange(),s=window.getSelection();if(!s)return;var a=function(h){var g=document.createTextNode("");h.appendChild(g),i.setStart(g,0),i.setEnd(g,0)},l=function(h){return h!=null},c=n.childNodes,d=e?c[0]:c[c.length-1];if(l(d)){for(;l(d)&&d.nodeType!==Node.TEXT_NODE;)d=e?d.firstChild:d.lastChild;if(l(d)&&d.nodeType===Node.TEXT_NODE){var u=(o=(t=d.textContent)===null||t===void 0?void 0:t.length)!==null&&o!==void 0?o:0,r=e?0:u;i.setStart(d,r),i.setEnd(d,r)}else a(n)}else a(n);s.removeAllRanges(),s.addRange(i)}}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.focus=void 0;var e=Dr;Object.defineProperty(n,"focus",{enumerable:!0,get:function(){return e.focus}})})(Ra);var $r={},Nn={};Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.getCaretNodeAndOffset=_k;function _k(){var n=window.getSelection();if(n===null)return[null,0];var e=n.focusNode,t=n.focusOffset;return e===null?[null,0]:(e.nodeType!==Node.TEXT_NODE&&e.childNodes.length>0&&(e.childNodes[t]!==void 0?(e=e.childNodes[t],t=0):(e=e.childNodes[t-1],e.textContent!==null&&(t=e.textContent.length))),[e,t])}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.getCaretNodeAndOffset=void 0;var e=Nn;Object.defineProperty(n,"getCaretNodeAndOffset",{enumerable:!0,get:function(){return e.getCaretNodeAndOffset}})})($r);var La={},Rn={};Object.defineProperty(Rn,"__esModule",{value:!0}),Rn.getRange=Ak;function Ak(){var n=window.getSelection();return n&&n.rangeCount?n.getRangeAt(0):null}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.getRange=void 0;var e=Rn;Object.defineProperty(n,"getRange",{enumerable:!0,get:function(){return e.getRange}})})(La);var Pa={},Fr={};Object.defineProperty(Fr,"__esModule",{value:!0}),Fr.isCaretAtEndOfInput=Nk;var Ma=Je,Ik=$r,Ok=tr;function Nk(n){var e=(0,Ma.getDeepestNode)(n,!0);if(e===null)return!0;if((0,Ma.isNativeInput)(e))return e.selectionEnd===e.value.length;var t=(0,Ik.getCaretNodeAndOffset)(),o=t[0],r=t[1];return o===null?!1:(0,Ok.checkContenteditableSliceForEmptiness)(n,o,r,"right")}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.isCaretAtEndOfInput=void 0;var e=Fr;Object.defineProperty(n,"isCaretAtEndOfInput",{enumerable:!0,get:function(){return e.isCaretAtEndOfInput}})})(Pa);var Da={},Hr={};Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.isCaretAtStartOfInput=Pk;var Ln=Je,Rk=Nn,Lk=Cn;function Pk(n){var e=(0,Ln.getDeepestNode)(n);if(e===null||(0,Ln.isEmpty)(n))return!0;if((0,Ln.isNativeInput)(e))return e.selectionEnd===0;if((0,Ln.isEmpty)(n))return!0;var t=(0,Rk.getCaretNodeAndOffset)(),o=t[0],r=t[1];return o===null?!1:(0,Lk.checkContenteditableSliceForEmptiness)(n,o,r,"left")}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.isCaretAtStartOfInput=void 0;var e=Hr;Object.defineProperty(n,"isCaretAtStartOfInput",{enumerable:!0,get:function(){return e.isCaretAtStartOfInput}})})(Da);var $a={},jr={};Object.defineProperty(jr,"__esModule",{value:!0}),jr.save=$k;var Mk=Je,Dk=Rn;function $k(){var n=(0,Dk.getRange)(),e=(0,Mk.make)("span");if(e.id="cursor",e.hidden=!0,!!n)return n.insertNode(e),function(){var o=window.getSelection();o&&(n.setStartAfter(e),n.setEndAfter(e),o.removeAllRanges(),o.addRange(n),setTimeout(function(){e.remove()},150))}}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.save=void 0;var e=jr;Object.defineProperty(n,"save",{enumerable:!0,get:function(){return e.save}})})($a),function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.save=n.isCaretAtStartOfInput=n.isCaretAtEndOfInput=n.getRange=n.getCaretNodeAndOffset=n.focus=n.getContenteditableSlice=n.checkContenteditableSliceForEmptiness=void 0;var e=tr;Object.defineProperty(n,"checkContenteditableSliceForEmptiness",{enumerable:!0,get:function(){return e.checkContenteditableSliceForEmptiness}});var t=Na;Object.defineProperty(n,"getContenteditableSlice",{enumerable:!0,get:function(){return t.getContenteditableSlice}});var o=Ra;Object.defineProperty(n,"focus",{enumerable:!0,get:function(){return o.focus}});var r=$r;Object.defineProperty(n,"getCaretNodeAndOffset",{enumerable:!0,get:function(){return r.getCaretNodeAndOffset}});var i=La;Object.defineProperty(n,"getRange",{enumerable:!0,get:function(){return i.getRange}});var s=Pa;Object.defineProperty(n,"isCaretAtEndOfInput",{enumerable:!0,get:function(){return s.isCaretAtEndOfInput}});var a=Da;Object.defineProperty(n,"isCaretAtStartOfInput",{enumerable:!0,get:function(){return a.isCaretAtStartOfInput}});var l=$a;Object.defineProperty(n,"save",{enumerable:!0,get:function(){return l.save}})}(fa);const Fa={Backspace:S.BACKSPACE,Delete:S.DELETE,Enter:S.ENTER,Tab:S.TAB,ArrowDown:S.DOWN,ArrowRight:S.RIGHT,ArrowUp:S.UP,ArrowLeft:S.LEFT},Fk=new Set(["Enter","Process","Spacebar","Space","Dead"]),Pn='[contenteditable="true"], textarea, input';class Hk extends F{keydown(e){if(this.beforeKeydownProcessing(e),this.handleSelectedBlocksDeletion(e)||e.defaultPrevented)return;switch(this.getKeyCode(e)){case S.BACKSPACE:this.backspace(e);break;case S.DELETE:this.delete(e);break;case S.ENTER:this.enter(e);break;case S.DOWN:case S.RIGHT:this.arrowRightAndDown(e);break;case S.UP:case S.LEFT:this.arrowLeftAndUp(e);break;case S.TAB:this.tabPressed(e);break}e.key==="/"&&!e.ctrlKey&&!e.metaKey&&this.slashPressed(e),e.code==="Slash"&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.commandSlashPressed())}handleSelectedBlocksDeletion(e){const{BlockSelection:t,BlockManager:o,Caret:r}=this.Editor,i=e.key==="Backspace"||e.key==="Delete",s=w.isSelectionExists,a=w.isCollapsed===!0;if(!(i&&t.anyBlockSelected&&(!s||a)))return!1;const c=o.removeSelectedBlocks();if(c!==void 0){const d=o.insertDefaultBlockAtIndex(c,!0);r.setToBlock(d,r.positions.START)}return t.clearSelection(e),e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),!0}beforeKeydownProcessing(e){!this.needToolbarClosing(e)||!this.isPrintableKeyEvent(e)||(this.Editor.Toolbar.close(),e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)||this.Editor.BlockSelection.clearSelection(e)}keyup(e){e.shiftKey||this.Editor.UI.checkEmptiness()}handleCommandC(e){const{BlockSelection:t}=this.Editor;t.anyBlockSelected&&t.copySelectedBlocks(e)}handleCommandX(e){const{BlockSelection:t,BlockManager:o,Caret:r}=this.Editor;t.anyBlockSelected&&t.copySelectedBlocks(e).then(()=>{const i=o.removeSelectedBlocks();if(i!==void 0){const s=o.insertDefaultBlockAtIndex(i,!0);r.setToBlock(s,r.positions.START)}t.clearSelection(e)}).catch(()=>{})}tabPressed(e){const{InlineToolbar:t,Caret:o}=this.Editor;if(t.opened)return;(e.shiftKey?o.navigatePrevious(!0):o.navigateNext(!0))&&e.preventDefault()}commandSlashPressed(){this.Editor.BlockSelection.selectedBlocks.length>1||this.activateBlockSettings()}slashPressed(e){if(!this.Editor.UI.nodes.wrapper.contains(e.target))return;const o=this.Editor.BlockManager.currentBlock;o!=null&&o.isEmpty&&(e.preventDefault(),this.Editor.Caret.insertContentAtCaretPosition("/"),this.activateToolbox())}enter(e){const{BlockManager:t,UI:o}=this.Editor,r=t.currentBlock;if(r===void 0||r.tool.isLineBreaksEnabled||o.someToolbarOpened&&o.someFlipperButtonFocused||e.shiftKey&&!wo)return;const i=(()=>r.currentInput!==void 0&&kn(r.currentInput)&&!r.hasMedia?(this.Editor.BlockManager.insertDefaultBlockAtIndex(this.Editor.BlockManager.currentBlockIndex),r):r.currentInput&&wn(r.currentInput)?this.Editor.BlockManager.insertDefaultBlockAtIndex(this.Editor.BlockManager.currentBlockIndex+1):this.Editor.BlockManager.split())();this.Editor.Caret.setToBlock(i),this.Editor.Toolbar.moveAndOpen(i),e.preventDefault()}backspace(e){const{BlockManager:t,Caret:o}=this.Editor,{currentBlock:r,previousBlock:i}=t;if(r===void 0||!w.isCollapsed||!r.currentInput||!kn(r.currentInput))return;if(e.preventDefault(),this.Editor.Toolbar.close(),!(r.currentInput===r.firstInput)){o.navigatePrevious();return}if(i===null)return;if(i.isEmpty){t.removeBlock(i);return}if(r.isEmpty){t.removeBlock(r);const l=t.currentBlock;l&&o.setToBlock(l,o.positions.END);return}Ks(i,r)?this.mergeBlocks(i,r):o.setToBlock(i,o.positions.END)}delete(e){const{BlockManager:t,Caret:o}=this.Editor,{currentBlock:r,nextBlock:i}=t;if(r===void 0||!w.isCollapsed||!r.currentInput||!wn(r.currentInput))return;if(e.preventDefault(),this.Editor.Toolbar.close(),!(r.currentInput===r.lastInput)){o.navigateNext();return}if(i===null)return;if(i.isEmpty){t.removeBlock(i);return}if(r.isEmpty){t.removeBlock(r),o.setToBlock(i,o.positions.START);return}Ks(r,i)?this.mergeBlocks(r,i):o.setToBlock(i,o.positions.START)}mergeBlocks(e,t){const{BlockManager:o,Toolbar:r}=this.Editor;e.lastInput!==void 0&&(fa.focus(e.lastInput,!1),o.mergeBlocks(e,t).then(()=>{r.close()}).catch(()=>{}))}arrowRightAndDown(e){const t=this.getKeyCode(e);if(t===null)return;const o=Fe.usedKeys.includes(t)&&(!e.shiftKey||t===S.TAB);if(this.Editor.UI.someToolbarOpened&&o)return;e.shiftKey||this.Editor.Toolbar.close();const r=w.get();r!=null&&r.anchorNode&&!this.Editor.BlockSelection.anyBlockSelected&&this.Editor.BlockManager.setCurrentBlockByChildNode(r.anchorNode);const{currentBlock:i}=this.Editor.BlockManager,s=e.target,a=document.activeElement instanceof HTMLElement?document.activeElement:null,l=[i==null?void 0:i.inputs.find(E=>s!==null&&E.contains(s)),i==null?void 0:i.inputs.find(E=>a!==null&&E.contains(a)),s==null?void 0:s.closest(Pn),a==null?void 0:a.closest(Pn)],c=(i==null?void 0:i.currentInput)??l.find(E=>E instanceof HTMLElement),u=(c!==void 0?wn(c):void 0)||this.Editor.BlockSelection.anyBlockSelected,h=e.shiftKey&&t===S.DOWN;if(h&&u){this.Editor.CrossBlockSelection.toggleBlockSelectedState();return}h&&this.Editor.InlineToolbar.tryToShow();const f=t===S.RIGHT&&!e.shiftKey&&!this.isRtl&&c instanceof HTMLElement?lT(c):null;if(f!==null){w.setCursor(f.node,f.offset),e.preventDefault();return}if(t===S.DOWN||t===S.RIGHT&&!this.isRtl?this.Editor.Caret.navigateNext():this.Editor.Caret.navigatePrevious()){e.preventDefault();return}gn(()=>{this.Editor.BlockManager.currentBlock&&this.Editor.BlockManager.currentBlock.updateCurrentInput()},20)(),this.Editor.BlockSelection.clearSelection(e)}arrowLeftAndUp(e){const t=this.Editor.UI.someToolbarOpened,o=this.getKeyCode(e);if(o===null||t&&Fe.usedKeys.includes(o)&&(!e.shiftKey||o===S.TAB))return;t&&this.Editor.UI.closeAllToolbars(),e.shiftKey||this.Editor.Toolbar.close();const r=window.getSelection();r!=null&&r.anchorNode&&!this.Editor.BlockSelection.anyBlockSelected&&this.Editor.BlockManager.setCurrentBlockByChildNode(r.anchorNode);const{currentBlock:i}=this.Editor.BlockManager,s=e.target,a=document.activeElement instanceof HTMLElement?document.activeElement:null,l=[i==null?void 0:i.inputs.find(m=>s!==null&&m.contains(s)),i==null?void 0:i.inputs.find(m=>a!==null&&m.contains(a)),s==null?void 0:s.closest(Pn),a==null?void 0:a.closest(Pn)],c=(i==null?void 0:i.currentInput)??l.find(m=>m instanceof HTMLElement),u=(c!==void 0?kn(c):void 0)||this.Editor.BlockSelection.anyBlockSelected,h=e.shiftKey&&o===S.UP;if(h&&u){this.Editor.CrossBlockSelection.toggleBlockSelectedState(!1);return}if(h&&this.Editor.InlineToolbar.tryToShow(),o===S.UP||o===S.LEFT&&!this.isRtl?this.Editor.Caret.navigatePrevious():this.Editor.Caret.navigateNext()){e.preventDefault();return}gn(()=>{this.Editor.BlockManager.currentBlock&&this.Editor.BlockManager.currentBlock.updateCurrentInput()},20)(),this.Editor.BlockSelection.clearSelection(e)}needToolbarClosing(e){const t=this.getKeyCode(e),o=t===S.ENTER,r=t===S.TAB,i=o&&this.Editor.Toolbar.toolbox.opened,s=o&&this.Editor.BlockSettings.opened,a=o&&this.Editor.InlineToolbar.opened,l=r;return!(e.shiftKey||l||i||s||a)}activateToolbox(){this.Editor.Toolbar.opened||this.Editor.Toolbar.moveAndOpen(),this.Editor.Toolbar.toolbox.open()}activateBlockSettings(){this.Editor.Toolbar.opened||this.Editor.Toolbar.moveAndOpen(),this.Editor.BlockSettings.opened||Promise.resolve(this.Editor.BlockSettings.open()).catch(()=>{})}getKeyCode(e){const t=e.key&&Fa[e.key];if(t!==void 0&&typeof t=="number")return t;const o=e.code&&Fa[e.code];return o!==void 0&&typeof o=="number"?o:null}isPrintableKeyEvent(e){return e.key?e.key.length===1||Fk.has(e.key):!1}}class zr{constructor(e){this.blocks=[],this.workingArea=e}get length(){return this.blocks.length}get array(){return this.blocks}get nodes(){return Ps(this.workingArea.children)}static set(e,t,o){return isNaN(Number(t))?(Reflect.set(e,t,o),!0):(e.insert(+t,o),!0)}static get(e,t){return isNaN(Number(t))?Reflect.get(e,t):e.get(+t)}push(e){this.blocks.push(e),this.insertToDOM(e)}move(e,t,o=!1){const r=this.blocks.splice(t,1)[0];if(!o){const s=e-1,a=Math.max(0,s),l=this.blocks[a],c=e>0?"afterend":"beforebegin";this.insertToDOM(r,c,l)}this.blocks.splice(e,0,r);const i=this.composeBlockEvent("move",{fromIndex:t,toIndex:e});r.call(Pe.MOVED,i)}insert(e,t,o=!1){if(!this.length){this.push(t);return}const r=e>this.length?this.length:e;o&&(this.blocks[r].holder.remove(),this.blocks[r].call(Pe.REMOVED));const i=o?1:0;if(this.blocks.splice(r,i,t),r>0){const a=this.blocks[r-1];this.insertToDOM(t,"afterend",a);return}const s=this.blocks[r+1];if(s!==void 0){this.insertToDOM(t,"beforebegin",s);return}this.insertToDOM(t)}replace(e,t){if(this.blocks[e]===void 0)throw Error("Incorrect index");this.blocks[e].holder.replaceWith(t.holder),this.blocks[e]=t}insertMany(e,t){const o=new DocumentFragment;for(const r of e)o.appendChild(r.holder);if(!this.length){this.blocks.push(...e),this.workingArea.appendChild(o),e.forEach(r=>r.call(Pe.RENDERED));return}if(t>0){const r=Math.min(t-1,this.length-1);this.blocks[r].holder.after(o)}t===0&&this.workingArea.prepend(o),this.blocks.splice(t,0,...e),e.forEach(r=>r.call(Pe.RENDERED))}remove(e){const t=isNaN(e)?this.length-1:e;this.blocks[t].holder.remove(),this.blocks[t].call(Pe.REMOVED),this.blocks.splice(t,1)}removeAll(){this.workingArea.innerHTML="",this.blocks.forEach(e=>e.call(Pe.REMOVED)),this.blocks.length=0}insertAfter(e,t){const o=this.blocks.indexOf(e);this.insert(o+1,t)}get(e){return this.blocks[e]}indexOf(e){return this.blocks.indexOf(e)}insertToDOM(e,t,o){t&&o!==void 0?o.holder.insertAdjacentElement(t,e.holder):this.workingArea.appendChild(e.holder),e.call(Pe.RENDERED)}composeBlockEvent(e,t){return new CustomEvent(e,{detail:t})}}/**!
25
- * Sortable 1.15.6
26
- * @author RubaXa <trash@rubaxa.org>
27
- * @author owenm <owen23355@gmail.com>
28
- * @license MIT
29
- */function Ha(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function Ie(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ha(Object(t),!0).forEach(function(o){jk(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ha(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function Mn(n){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Mn=function(e){return typeof e}:Mn=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mn(n)}function jk(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Me(){return Me=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n},Me.apply(this,arguments)}function zk(n,e){if(n==null)return{};var t={},o=Object.keys(n),r,i;for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}function Wk(n,e){if(n==null)return{};var t=zk(n,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);for(r=0;r<i.length;r++)o=i[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(t[o]=n[o])}return t}var Uk="1.15.6";function De(n){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(n)}var $e=De(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),jt=De(/Edge/i),ja=De(/firefox/i),zt=De(/safari/i)&&!De(/chrome/i)&&!De(/android/i),Wr=De(/iP(ad|od|hone)/i),za=De(/chrome/i)&&De(/android/i),Wa={capture:!1,passive:!1};function H(n,e,t){n.addEventListener(e,t,!$e&&Wa)}function D(n,e,t){n.removeEventListener(e,t,!$e&&Wa)}function Dn(n,e){if(e){if(e[0]===">"&&(e=e.substring(1)),n)try{if(n.matches)return n.matches(e);if(n.msMatchesSelector)return n.msMatchesSelector(e);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(e)}catch{return!1}return!1}}function Ua(n){return n.host&&n!==document&&n.host.nodeType?n.host:n.parentNode}function Se(n,e,t,o){if(n){t=t||document;do{if(e!=null&&(e[0]===">"?n.parentNode===t&&Dn(n,e):Dn(n,e))||o&&n===t)return n;if(n===t)break}while(n=Ua(n))}return null}var Ka=/\s+/g;function me(n,e,t){if(n&&e)if(n.classList)n.classList[t?"add":"remove"](e);else{var o=(" "+n.className+" ").replace(Ka," ").replace(" "+e+" "," ");n.className=(o+(t?" "+e:"")).replace(Ka," ")}}function B(n,e,t){var o=n&&n.style;if(o){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(t=n.currentStyle),e===void 0?t:t[e];!(e in o)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),o[e]=t+(typeof t=="string"?"":"px")}}function Et(n,e){var t="";if(typeof n=="string")t=n;else do{var o=B(n,"transform");o&&o!=="none"&&(t=o+" "+t)}while(!e&&(n=n.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(t)}function Ga(n,e,t){if(n){var o=n.getElementsByTagName(e),r=0,i=o.length;if(t)for(;r<i;r++)t(o[r],r);return o}return[]}function Oe(){var n=document.scrollingElement;return n||document.documentElement}function ee(n,e,t,o,r){if(!(!n.getBoundingClientRect&&n!==window)){var i,s,a,l,c,d,u;if(n!==window&&n.parentNode&&n!==Oe()?(i=n.getBoundingClientRect(),s=i.top,a=i.left,l=i.bottom,c=i.right,d=i.height,u=i.width):(s=0,a=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(e||t)&&n!==window&&(r=r||n.parentNode,!$e))do if(r&&r.getBoundingClientRect&&(B(r,"transform")!=="none"||t&&B(r,"position")!=="static")){var h=r.getBoundingClientRect();s-=h.top+parseInt(B(r,"border-top-width")),a-=h.left+parseInt(B(r,"border-left-width")),l=s+i.height,c=a+i.width;break}while(r=r.parentNode);if(o&&n!==window){var g=Et(r||n),f=g&&g.a,m=g&&g.d;g&&(s/=m,a/=f,u/=f,d/=m,l=s+d,c=a+u)}return{top:s,left:a,bottom:l,right:c,width:u,height:d}}}function Ya(n,e,t){for(var o=We(n,!0),r=ee(n)[e];o;){var i=ee(o)[t],s=void 0;if(t==="top"||t==="left"?s=r>=i:s=r<=i,!s)return o;if(o===Oe())break;o=We(o,!1)}return!1}function Tt(n,e,t,o){for(var r=0,i=0,s=n.children;i<s.length;){if(s[i].style.display!=="none"&&s[i]!==_.ghost&&(o||s[i]!==_.dragged)&&Se(s[i],t.draggable,n,!1)){if(r===e)return s[i];r++}i++}return null}function Ur(n,e){for(var t=n.lastElementChild;t&&(t===_.ghost||B(t,"display")==="none"||e&&!Dn(t,e));)t=t.previousElementSibling;return t||null}function Te(n,e){var t=0;if(!n||!n.parentNode)return-1;for(;n=n.previousElementSibling;)n.nodeName.toUpperCase()!=="TEMPLATE"&&n!==_.clone&&(!e||Dn(n,e))&&t++;return t}function Xa(n){var e=0,t=0,o=Oe();if(n)do{var r=Et(n),i=r.a,s=r.d;e+=n.scrollLeft*i,t+=n.scrollTop*s}while(n!==o&&(n=n.parentNode));return[e,t]}function Kk(n,e){for(var t in n)if(n.hasOwnProperty(t)){for(var o in e)if(e.hasOwnProperty(o)&&e[o]===n[t][o])return Number(t)}return-1}function We(n,e){if(!n||!n.getBoundingClientRect)return Oe();var t=n,o=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var r=B(t);if(t.clientWidth<t.scrollWidth&&(r.overflowX=="auto"||r.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(r.overflowY=="auto"||r.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return Oe();if(o||e)return t;o=!0}}while(t=t.parentNode);return Oe()}function Gk(n,e){if(n&&e)for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function Kr(n,e){return Math.round(n.top)===Math.round(e.top)&&Math.round(n.left)===Math.round(e.left)&&Math.round(n.height)===Math.round(e.height)&&Math.round(n.width)===Math.round(e.width)}var Wt;function Va(n,e){return function(){if(!Wt){var t=arguments,o=this;t.length===1?n.call(o,t[0]):n.apply(o,t),Wt=setTimeout(function(){Wt=void 0},e)}}}function Yk(){clearTimeout(Wt),Wt=void 0}function qa(n,e,t){n.scrollLeft+=e,n.scrollTop+=t}function Za(n){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(n).cloneNode(!0):t?t(n).clone(!0)[0]:n.cloneNode(!0)}function Ja(n,e,t){var o={};return Array.from(n.children).forEach(function(r){var i,s,a,l;if(!(!Se(r,e.draggable,n,!1)||r.animated||r===t)){var c=ee(r);o.left=Math.min((i=o.left)!==null&&i!==void 0?i:1/0,c.left),o.top=Math.min((s=o.top)!==null&&s!==void 0?s:1/0,c.top),o.right=Math.max((a=o.right)!==null&&a!==void 0?a:-1/0,c.right),o.bottom=Math.max((l=o.bottom)!==null&&l!==void 0?l:-1/0,c.bottom)}}),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var he="Sortable"+new Date().getTime();function Xk(){var n=[],e;return{captureAnimationState:function(){if(n=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(r){if(!(B(r,"display")==="none"||r===_.ghost)){n.push({target:r,rect:ee(r)});var i=Ie({},n[n.length-1].rect);if(r.thisAnimationDuration){var s=Et(r,!0);s&&(i.top-=s.f,i.left-=s.e)}r.fromRect=i}})}},addAnimationState:function(o){n.push(o)},removeAnimationState:function(o){n.splice(Kk(n,{target:o}),1)},animateAll:function(o){var r=this;if(!this.options.animation){clearTimeout(e),typeof o=="function"&&o();return}var i=!1,s=0;n.forEach(function(a){var l=0,c=a.target,d=c.fromRect,u=ee(c),h=c.prevFromRect,g=c.prevToRect,f=a.rect,m=Et(c,!0);m&&(u.top-=m.f,u.left-=m.e),c.toRect=u,c.thisAnimationDuration&&Kr(h,u)&&!Kr(d,u)&&(f.top-u.top)/(f.left-u.left)===(d.top-u.top)/(d.left-u.left)&&(l=qk(f,h,g,r.options)),Kr(u,d)||(c.prevFromRect=d,c.prevToRect=u,l||(l=r.options.animation),r.animate(c,f,u,l)),l&&(i=!0,s=Math.max(s,l),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},l),c.thisAnimationDuration=l)}),clearTimeout(e),i?e=setTimeout(function(){typeof o=="function"&&o()},s):typeof o=="function"&&o(),n=[]},animate:function(o,r,i,s){if(s){B(o,"transition",""),B(o,"transform","");var a=Et(this.el),l=a&&a.a,c=a&&a.d,d=(r.left-i.left)/(l||1),u=(r.top-i.top)/(c||1);o.animatingX=!!d,o.animatingY=!!u,B(o,"transform","translate3d("+d+"px,"+u+"px,0)"),this.forRepaintDummy=Vk(o),B(o,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),B(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){B(o,"transition",""),B(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},s)}}}}function Vk(n){return n.offsetWidth}function qk(n,e,t,o){return Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*o.animation}var kt=[],Gr={initializeByDefault:!0},Ut={mount:function(e){for(var t in Gr)Gr.hasOwnProperty(t)&&!(t in e)&&(e[t]=Gr[t]);kt.forEach(function(o){if(o.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),kt.push(e)},pluginEvent:function(e,t,o){var r=this;this.eventCanceled=!1,o.cancel=function(){r.eventCanceled=!0};var i=e+"Global";kt.forEach(function(s){t[s.pluginName]&&(t[s.pluginName][i]&&t[s.pluginName][i](Ie({sortable:t},o)),t.options[s.pluginName]&&t[s.pluginName][e]&&t[s.pluginName][e](Ie({sortable:t},o)))})},initializePlugins:function(e,t,o,r){kt.forEach(function(a){var l=a.pluginName;if(!(!e.options[l]&&!a.initializeByDefault)){var c=new a(e,t,e.options);c.sortable=e,c.options=e.options,e[l]=c,Me(o,c.defaults)}});for(var i in e.options)if(e.options.hasOwnProperty(i)){var s=this.modifyOption(e,i,e.options[i]);typeof s<"u"&&(e.options[i]=s)}},getEventProperties:function(e,t){var o={};return kt.forEach(function(r){typeof r.eventProperties=="function"&&Me(o,r.eventProperties.call(t[r.pluginName],e))}),o},modifyOption:function(e,t,o){var r;return kt.forEach(function(i){e[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[t]=="function"&&(r=i.optionListeners[t].call(e[i.pluginName],o))}),r}};function Zk(n){var e=n.sortable,t=n.rootEl,o=n.name,r=n.targetEl,i=n.cloneEl,s=n.toEl,a=n.fromEl,l=n.oldIndex,c=n.newIndex,d=n.oldDraggableIndex,u=n.newDraggableIndex,h=n.originalEvent,g=n.putSortable,f=n.extraEventProperties;if(e=e||t&&t[he],!!e){var m,b=e.options,E="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!$e&&!jt?m=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(m=document.createEvent("Event"),m.initEvent(o,!0,!0)),m.to=s||t,m.from=a||t,m.item=r||t,m.clone=i,m.oldIndex=l,m.newIndex=c,m.oldDraggableIndex=d,m.newDraggableIndex=u,m.originalEvent=h,m.pullMode=g?g.lastPutMode:void 0;var k=Ie(Ie({},f),Ut.getEventProperties(o,e));for(var N in k)m[N]=k[N];t&&t.dispatchEvent(m),b[E]&&b[E].call(e,m)}}var Jk=["evt"],fe=function(e,t){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=o.evt,i=Wk(o,Jk);Ut.pluginEvent.bind(_)(e,t,Ie({dragEl:y,parentEl:q,ghostEl:O,rootEl:Y,nextEl:et,lastDownEl:$n,cloneEl:V,cloneHidden:Ue,dragStarted:Gt,putSortable:ie,activeSortable:_.active,originalEvent:r,oldIndex:wt,oldDraggableIndex:Kt,newIndex:ve,newDraggableIndex:Ke,hideGhostForTarget:il,unhideGhostForTarget:sl,cloneNowHidden:function(){Ue=!0},cloneNowShown:function(){Ue=!1},dispatchSortableEvent:function(a){ue({sortable:t,name:a,originalEvent:r})}},i))};function ue(n){Zk(Ie({putSortable:ie,cloneEl:V,targetEl:y,rootEl:Y,oldIndex:wt,oldDraggableIndex:Kt,newIndex:ve,newDraggableIndex:Ke},n))}var y,q,O,Y,et,$n,V,Ue,wt,ve,Kt,Ke,Fn,ie,Ct=!1,Hn=!1,jn=[],tt,xe,Yr,Xr,Qa,el,Gt,St,Yt,Xt=!1,zn=!1,Wn,le,Vr=[],qr=!1,Un=[],Kn=typeof document<"u",Gn=Wr,tl=jt||$e?"cssFloat":"float",Qk=Kn&&!za&&!Wr&&"draggable"in document.createElement("div"),nl=function(){if(Kn){if($e)return!1;var n=document.createElement("x");return n.style.cssText="pointer-events:auto",n.style.pointerEvents==="auto"}}(),ol=function(e,t){var o=B(e),r=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),i=Tt(e,0,t),s=Tt(e,1,t),a=i&&B(i),l=s&&B(s),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+ee(i).width,d=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+ee(s).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&a.float!=="none"){var u=a.float==="left"?"left":"right";return s&&(l.clear==="both"||l.clear===u)?"vertical":"horizontal"}return i&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=r&&o[tl]==="none"||s&&o[tl]==="none"&&c+d>r)?"vertical":"horizontal"},ew=function(e,t,o){var r=o?e.left:e.top,i=o?e.right:e.bottom,s=o?e.width:e.height,a=o?t.left:t.top,l=o?t.right:t.bottom,c=o?t.width:t.height;return r===a||i===l||r+s/2===a+c/2},tw=function(e,t){var o;return jn.some(function(r){var i=r[he].options.emptyInsertThreshold;if(!(!i||Ur(r))){var s=ee(r),a=e>=s.left-i&&e<=s.right+i,l=t>=s.top-i&&t<=s.bottom+i;if(a&&l)return o=r}}),o},rl=function(e){function t(i,s){return function(a,l,c,d){var u=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(i==null&&(s||u))return!0;if(i==null||i===!1)return!1;if(s&&i==="clone")return i;if(typeof i=="function")return t(i(a,l,c,d),s)(a,l,c,d);var h=(s?a:l).options.group.name;return i===!0||typeof i=="string"&&i===h||i.join&&i.indexOf(h)>-1}}var o={},r=e.group;(!r||Mn(r)!="object")&&(r={name:r}),o.name=r.name,o.checkPull=t(r.pull,!0),o.checkPut=t(r.put),o.revertClone=r.revertClone,e.group=o},il=function(){!nl&&O&&B(O,"display","none")},sl=function(){!nl&&O&&B(O,"display","")};Kn&&!za&&document.addEventListener("click",function(n){if(Hn)return n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),Hn=!1,!1},!0);var nt=function(e){if(y){e=e.touches?e.touches[0]:e;var t=tw(e.clientX,e.clientY);if(t){var o={};for(var r in e)e.hasOwnProperty(r)&&(o[r]=e[r]);o.target=o.rootEl=t,o.preventDefault=void 0,o.stopPropagation=void 0,t[he]._onDragOver(o)}}},nw=function(e){y&&y.parentNode[he]._isOutsideThisEl(e.target)};function _(n,e){if(!(n&&n.nodeType&&n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));this.el=n,this.options=e=Me({},e),n[he]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return ol(n,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,a){s.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:_.supportPointer!==!1&&"PointerEvent"in window&&(!zt||Wr),emptyInsertThreshold:5};Ut.initializePlugins(this,n,t);for(var o in t)!(o in e)&&(e[o]=t[o]);rl(e);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=e.forceFallback?!1:Qk,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?H(n,"pointerdown",this._onTapStart):(H(n,"mousedown",this._onTapStart),H(n,"touchstart",this._onTapStart)),this.nativeDraggable&&(H(n,"dragover",this),H(n,"dragenter",this)),jn.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Me(this,Xk())}_.prototype={constructor:_,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(St=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,y):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,o=this.el,r=this.options,i=r.preventOnFilter,s=e.type,a=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,l=(a||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,d=r.filter;if(dw(o),!y&&!(/mousedown|pointerdown/.test(s)&&e.button!==0||r.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&zt&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=Se(l,r.draggable,o,!1),!(l&&l.animated)&&$n!==l)){if(wt=Te(l),Kt=Te(l,r.draggable),typeof d=="function"){if(d.call(this,e,l,this)){ue({sortable:t,rootEl:c,name:"filter",targetEl:l,toEl:o,fromEl:o}),fe("filter",t,{evt:e}),i&&e.preventDefault();return}}else if(d&&(d=d.split(",").some(function(u){if(u=Se(c,u.trim(),o,!1),u)return ue({sortable:t,rootEl:u,name:"filter",targetEl:l,fromEl:o,toEl:o}),fe("filter",t,{evt:e}),!0}),d)){i&&e.preventDefault();return}r.handle&&!Se(c,r.handle,o,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(e,t,o){var r=this,i=r.el,s=r.options,a=i.ownerDocument,l;if(o&&!y&&o.parentNode===i){var c=ee(o);if(Y=i,y=o,q=y.parentNode,et=y.nextSibling,$n=o,Fn=s.group,_.dragged=y,tt={target:y,clientX:(t||e).clientX,clientY:(t||e).clientY},Qa=tt.clientX-c.left,el=tt.clientY-c.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,y.style["will-change"]="all",l=function(){if(fe("delayEnded",r,{evt:e}),_.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!ja&&r.nativeDraggable&&(y.draggable=!0),r._triggerDragStart(e,t),ue({sortable:r,name:"choose",originalEvent:e}),me(y,s.chosenClass,!0)},s.ignore.split(",").forEach(function(d){Ga(y,d.trim(),Zr)}),H(a,"dragover",nt),H(a,"mousemove",nt),H(a,"touchmove",nt),s.supportPointer?(H(a,"pointerup",r._onDrop),!this.nativeDraggable&&H(a,"pointercancel",r._onDrop)):(H(a,"mouseup",r._onDrop),H(a,"touchend",r._onDrop),H(a,"touchcancel",r._onDrop)),ja&&this.nativeDraggable&&(this.options.touchStartThreshold=4,y.draggable=!0),fe("delayStart",this,{evt:e}),s.delay&&(!s.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(jt||$e))){if(_.eventCanceled){this._onDrop();return}s.supportPointer?(H(a,"pointerup",r._disableDelayedDrag),H(a,"pointercancel",r._disableDelayedDrag)):(H(a,"mouseup",r._disableDelayedDrag),H(a,"touchend",r._disableDelayedDrag),H(a,"touchcancel",r._disableDelayedDrag)),H(a,"mousemove",r._delayedDragTouchMoveHandler),H(a,"touchmove",r._delayedDragTouchMoveHandler),s.supportPointer&&H(a,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(l,s.delay)}else l()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){y&&Zr(y),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;D(e,"mouseup",this._disableDelayedDrag),D(e,"touchend",this._disableDelayedDrag),D(e,"touchcancel",this._disableDelayedDrag),D(e,"pointerup",this._disableDelayedDrag),D(e,"pointercancel",this._disableDelayedDrag),D(e,"mousemove",this._delayedDragTouchMoveHandler),D(e,"touchmove",this._delayedDragTouchMoveHandler),D(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?H(document,"pointermove",this._onTouchMove):t?H(document,"touchmove",this._onTouchMove):H(document,"mousemove",this._onTouchMove):(H(y,"dragend",this),H(Y,"dragstart",this._onDragStart));try{document.selection?Xn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(Ct=!1,Y&&y){fe("dragStarted",this,{evt:t}),this.nativeDraggable&&H(document,"dragover",nw);var o=this.options;!e&&me(y,o.dragClass,!1),me(y,o.ghostClass,!0),_.active=this,e&&this._appendGhost(),ue({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(xe){this._lastX=xe.clientX,this._lastY=xe.clientY,il();for(var e=document.elementFromPoint(xe.clientX,xe.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(xe.clientX,xe.clientY),e!==t);)t=e;if(y.parentNode[he]._isOutsideThisEl(e),t)do{if(t[he]){var o=void 0;if(o=t[he]._onDragOver({clientX:xe.clientX,clientY:xe.clientY,target:e,rootEl:t}),o&&!this.options.dragoverBubble)break}e=t}while(t=Ua(t));sl()}},_onTouchMove:function(e){if(tt){var t=this.options,o=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,s=O&&Et(O,!0),a=O&&s&&s.a,l=O&&s&&s.d,c=Gn&&le&&Xa(le),d=(i.clientX-tt.clientX+r.x)/(a||1)+(c?c[0]-Vr[0]:0)/(a||1),u=(i.clientY-tt.clientY+r.y)/(l||1)+(c?c[1]-Vr[1]:0)/(l||1);if(!_.active&&!Ct){if(o&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<o)return;this._onDragStart(e,!0)}if(O){s?(s.e+=d-(Yr||0),s.f+=u-(Xr||0)):s={a:1,b:0,c:0,d:1,e:d,f:u};var h="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");B(O,"webkitTransform",h),B(O,"mozTransform",h),B(O,"msTransform",h),B(O,"transform",h),Yr=d,Xr=u,xe=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!O){var e=this.options.fallbackOnBody?document.body:Y,t=ee(y,!0,Gn,!0,e),o=this.options;if(Gn){for(le=e;B(le,"position")==="static"&&B(le,"transform")==="none"&&le!==document;)le=le.parentNode;le!==document.body&&le!==document.documentElement?(le===document&&(le=Oe()),t.top+=le.scrollTop,t.left+=le.scrollLeft):le=Oe(),Vr=Xa(le)}O=y.cloneNode(!0),me(O,o.ghostClass,!1),me(O,o.fallbackClass,!0),me(O,o.dragClass,!0),B(O,"transition",""),B(O,"transform",""),B(O,"box-sizing","border-box"),B(O,"margin",0),B(O,"top",t.top),B(O,"left",t.left),B(O,"width",t.width),B(O,"height",t.height),B(O,"opacity","0.8"),B(O,"position",Gn?"absolute":"fixed"),B(O,"zIndex","100000"),B(O,"pointerEvents","none"),_.ghost=O,e.appendChild(O),B(O,"transform-origin",Qa/parseInt(O.style.width)*100+"% "+el/parseInt(O.style.height)*100+"%")}},_onDragStart:function(e,t){var o=this,r=e.dataTransfer,i=o.options;if(fe("dragStart",this,{evt:e}),_.eventCanceled){this._onDrop();return}fe("setupClone",this),_.eventCanceled||(V=Za(y),V.removeAttribute("id"),V.draggable=!1,V.style["will-change"]="",this._hideClone(),me(V,this.options.chosenClass,!1),_.clone=V),o.cloneId=Xn(function(){fe("clone",o),!_.eventCanceled&&(o.options.removeCloneOnHide||Y.insertBefore(V,y),o._hideClone(),ue({sortable:o,name:"clone"}))}),!t&&me(y,i.dragClass,!0),t?(Hn=!0,o._loopId=setInterval(o._emulateDragOver,50)):(D(document,"mouseup",o._onDrop),D(document,"touchend",o._onDrop),D(document,"touchcancel",o._onDrop),r&&(r.effectAllowed="move",i.setData&&i.setData.call(o,r,y)),H(document,"drop",o),B(y,"transform","translateZ(0)")),Ct=!0,o._dragStartId=Xn(o._dragStarted.bind(o,t,e)),H(document,"selectstart",o),Gt=!0,window.getSelection().removeAllRanges(),zt&&B(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,o=e.target,r,i,s,a=this.options,l=a.group,c=_.active,d=Fn===l,u=a.sort,h=ie||c,g,f=this,m=!1;if(qr)return;function b(be,Jt){fe(be,f,Ie({evt:e,isOwner:d,axis:g?"vertical":"horizontal",revert:s,dragRect:r,targetRect:i,canSort:u,fromSortable:h,target:o,completed:k,onMove:function(to,no){return Yn(Y,t,y,r,to,ee(to),e,no)},changed:N},Jt))}function E(){b("dragOverAnimationCapture"),f.captureAnimationState(),f!==h&&h.captureAnimationState()}function k(be){return b("dragOverCompleted",{insertion:be}),be&&(d?c._hideClone():c._showClone(f),f!==h&&(me(y,ie?ie.options.ghostClass:c.options.ghostClass,!1),me(y,a.ghostClass,!0)),ie!==f&&f!==_.active?ie=f:f===_.active&&ie&&(ie=null),h===f&&(f._ignoreWhileAnimating=o),f.animateAll(function(){b("dragOverAnimationComplete"),f._ignoreWhileAnimating=null}),f!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(o===y&&!y.animated||o===t&&!o.animated)&&(St=null),!a.dragoverBubble&&!e.rootEl&&o!==document&&(y.parentNode[he]._isOutsideThisEl(e.target),!be&&nt(e)),!a.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function N(){ve=Te(y),Ke=Te(y,a.draggable),ue({sortable:f,name:"change",toEl:t,newIndex:ve,newDraggableIndex:Ke,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),o=Se(o,a.draggable,t,!0),b("dragOver"),_.eventCanceled)return m;if(y.contains(e.target)||o.animated&&o.animatingX&&o.animatingY||f._ignoreWhileAnimating===o)return k(!1);if(Hn=!1,c&&!a.disabled&&(d?u||(s=q!==Y):ie===this||(this.lastPutMode=Fn.checkPull(this,c,y,e))&&l.checkPut(this,c,y,e))){if(g=this._getDirection(e,o)==="vertical",r=ee(y),b("dragOverValid"),_.eventCanceled)return m;if(s)return q=Y,E(),this._hideClone(),b("revert"),_.eventCanceled||(et?Y.insertBefore(y,et):Y.appendChild(y)),k(!0);var x=Ur(t,a.draggable);if(!x||sw(e,g,this)&&!x.animated){if(x===y)return k(!1);if(x&&t===e.target&&(o=x),o&&(i=ee(o)),Yn(Y,t,y,r,o,i,e,!!o)!==!1)return E(),x&&x.nextSibling?t.insertBefore(y,x.nextSibling):t.appendChild(y),q=t,N(),k(!0)}else if(x&&iw(e,g,this)){var P=Tt(t,0,a,!0);if(P===y)return k(!1);if(o=P,i=ee(o),Yn(Y,t,y,r,o,i,e,!1)!==!1)return E(),t.insertBefore(y,P),q=t,N(),k(!0)}else if(o.parentNode===t){i=ee(o);var I=0,X,C=y.parentNode!==t,T=!ew(y.animated&&y.toRect||r,o.animated&&o.toRect||i,g),A=g?"top":"left",R=Ya(o,"top","top")||Ya(y,"top","top"),z=R?R.scrollTop:void 0;St!==o&&(X=i[A],Xt=!1,zn=!T&&a.invertSwap||C),I=aw(e,o,i,g,T?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,zn,St===o);var L;if(I!==0){var K=Te(y);do K-=I,L=q.children[K];while(L&&(B(L,"display")==="none"||L===O))}if(I===0||L===o)return k(!1);St=o,Yt=I;var M=o.nextElementSibling,Z=!1;Z=I===1;var Ne=Yn(Y,t,y,r,o,i,e,Z);if(Ne!==!1)return(Ne===1||Ne===-1)&&(Z=Ne===1),qr=!0,setTimeout(rw,30),E(),Z&&!M?t.appendChild(y):o.parentNode.insertBefore(y,Z?M:o),R&&qa(R,0,z-R.scrollTop),q=y.parentNode,X!==void 0&&!zn&&(Wn=Math.abs(X-ee(o)[A])),N(),k(!0)}if(t.contains(y))return k(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){D(document,"mousemove",this._onTouchMove),D(document,"touchmove",this._onTouchMove),D(document,"pointermove",this._onTouchMove),D(document,"dragover",nt),D(document,"mousemove",nt),D(document,"touchmove",nt)},_offUpEvents:function(){var e=this.el.ownerDocument;D(e,"mouseup",this._onDrop),D(e,"touchend",this._onDrop),D(e,"pointerup",this._onDrop),D(e,"pointercancel",this._onDrop),D(e,"touchcancel",this._onDrop),D(document,"selectstart",this)},_onDrop:function(e){var t=this.el,o=this.options;if(ve=Te(y),Ke=Te(y,o.draggable),fe("drop",this,{evt:e}),q=y&&y.parentNode,ve=Te(y),Ke=Te(y,o.draggable),_.eventCanceled){this._nulling();return}Ct=!1,zn=!1,Xt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Jr(this.cloneId),Jr(this._dragStartId),this.nativeDraggable&&(D(document,"drop",this),D(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),zt&&B(document.body,"user-select",""),B(y,"transform",""),e&&(Gt&&(e.cancelable&&e.preventDefault(),!o.dropBubble&&e.stopPropagation()),O&&O.parentNode&&O.parentNode.removeChild(O),(Y===q||ie&&ie.lastPutMode!=="clone")&&V&&V.parentNode&&V.parentNode.removeChild(V),y&&(this.nativeDraggable&&D(y,"dragend",this),Zr(y),y.style["will-change"]="",Gt&&!Ct&&me(y,ie?ie.options.ghostClass:this.options.ghostClass,!1),me(y,this.options.chosenClass,!1),ue({sortable:this,name:"unchoose",toEl:q,newIndex:null,newDraggableIndex:null,originalEvent:e}),Y!==q?(ve>=0&&(ue({rootEl:q,name:"add",toEl:q,fromEl:Y,originalEvent:e}),ue({sortable:this,name:"remove",toEl:q,originalEvent:e}),ue({rootEl:q,name:"sort",toEl:q,fromEl:Y,originalEvent:e}),ue({sortable:this,name:"sort",toEl:q,originalEvent:e})),ie&&ie.save()):ve!==wt&&ve>=0&&(ue({sortable:this,name:"update",toEl:q,originalEvent:e}),ue({sortable:this,name:"sort",toEl:q,originalEvent:e})),_.active&&((ve==null||ve===-1)&&(ve=wt,Ke=Kt),ue({sortable:this,name:"end",toEl:q,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){fe("nulling",this),Y=y=q=O=et=V=$n=Ue=tt=xe=Gt=ve=Ke=wt=Kt=St=Yt=ie=Fn=_.dragged=_.ghost=_.clone=_.active=null,Un.forEach(function(e){e.checked=!0}),Un.length=Yr=Xr=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":y&&(this._onDragOver(e),ow(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,o=this.el.children,r=0,i=o.length,s=this.options;r<i;r++)t=o[r],Se(t,s.draggable,this.el,!1)&&e.push(t.getAttribute(s.dataIdAttr)||cw(t));return e},sort:function(e,t){var o={},r=this.el;this.toArray().forEach(function(i,s){var a=r.children[s];Se(a,this.options.draggable,r,!1)&&(o[i]=a)},this),t&&this.captureAnimationState(),e.forEach(function(i){o[i]&&(r.removeChild(o[i]),r.appendChild(o[i]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return Se(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var o=this.options;if(t===void 0)return o[e];var r=Ut.modifyOption(this,e,t);typeof r<"u"?o[e]=r:o[e]=t,e==="group"&&rl(o)},destroy:function(){fe("destroy",this);var e=this.el;e[he]=null,D(e,"mousedown",this._onTapStart),D(e,"touchstart",this._onTapStart),D(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(D(e,"dragover",this),D(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),jn.splice(jn.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Ue){if(fe("hideClone",this),_.eventCanceled)return;B(V,"display","none"),this.options.removeCloneOnHide&&V.parentNode&&V.parentNode.removeChild(V),Ue=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(Ue){if(fe("showClone",this),_.eventCanceled)return;y.parentNode==Y&&!this.options.group.revertClone?Y.insertBefore(V,y):et?Y.insertBefore(V,et):Y.appendChild(V),this.options.group.revertClone&&this.animate(y,V),B(V,"display",""),Ue=!1}}};function ow(n){n.dataTransfer&&(n.dataTransfer.dropEffect="move"),n.cancelable&&n.preventDefault()}function Yn(n,e,t,o,r,i,s,a){var l,c=n[he],d=c.options.onMove,u;return window.CustomEvent&&!$e&&!jt?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=e,l.from=n,l.dragged=t,l.draggedRect=o,l.related=r||e,l.relatedRect=i||ee(e),l.willInsertAfter=a,l.originalEvent=s,n.dispatchEvent(l),d&&(u=d.call(c,l,s)),u}function Zr(n){n.draggable=!1}function rw(){qr=!1}function iw(n,e,t){var o=ee(Tt(t.el,0,t.options,!0)),r=Ja(t.el,t.options,O),i=10;return e?n.clientX<r.left-i||n.clientY<o.top&&n.clientX<o.right:n.clientY<r.top-i||n.clientY<o.bottom&&n.clientX<o.left}function sw(n,e,t){var o=ee(Ur(t.el,t.options.draggable)),r=Ja(t.el,t.options,O),i=10;return e?n.clientX>r.right+i||n.clientY>o.bottom&&n.clientX>o.left:n.clientY>r.bottom+i||n.clientX>o.right&&n.clientY>o.top}function aw(n,e,t,o,r,i,s,a){var l=o?n.clientY:n.clientX,c=o?t.height:t.width,d=o?t.top:t.left,u=o?t.bottom:t.right,h=!1;if(!s){if(a&&Wn<c*r){if(!Xt&&(Yt===1?l>d+c*i/2:l<u-c*i/2)&&(Xt=!0),Xt)h=!0;else if(Yt===1?l<d+Wn:l>u-Wn)return-Yt}else if(l>d+c*(1-r)/2&&l<u-c*(1-r)/2)return lw(e)}return h=h||s,h&&(l<d+c*i/2||l>u-c*i/2)?l>d+c/2?1:-1:0}function lw(n){return Te(y)<Te(n)?1:-1}function cw(n){for(var e=n.tagName+n.className+n.src+n.href+n.textContent,t=e.length,o=0;t--;)o+=e.charCodeAt(t);return o.toString(36)}function dw(n){Un.length=0;for(var e=n.getElementsByTagName("input"),t=e.length;t--;){var o=e[t];o.checked&&Un.push(o)}}function Xn(n){return setTimeout(n,0)}function Jr(n){return clearTimeout(n)}Kn&&H(document,"touchmove",function(n){(_.active||Ct)&&n.cancelable&&n.preventDefault()}),_.utils={on:H,off:D,css:B,find:Ga,is:function(e,t){return!!Se(e,t,e,!1)},extend:Gk,throttle:Va,closest:Se,toggleClass:me,clone:Za,index:Te,nextTick:Xn,cancelNextTick:Jr,detectDirection:ol,getChild:Tt,expando:he},_.get=function(n){return n[he]},_.mount=function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];e[0].constructor===Array&&(e=e[0]),e.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(_.utils=Ie(Ie({},_.utils),o.utils)),Ut.mount(o)})},_.create=function(n,e){return new _(n,e)},_.version=Uk;var te=[],Vt,Qr,ei=!1,ti,ni,Vn,qt;function uw(){function n(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return n.prototype={dragStarted:function(t){var o=t.originalEvent;this.sortable.nativeDraggable?H(document,"dragover",this._handleAutoScroll):this.options.supportPointer?H(document,"pointermove",this._handleFallbackAutoScroll):o.touches?H(document,"touchmove",this._handleFallbackAutoScroll):H(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var o=t.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?D(document,"dragover",this._handleAutoScroll):(D(document,"pointermove",this._handleFallbackAutoScroll),D(document,"touchmove",this._handleFallbackAutoScroll),D(document,"mousemove",this._handleFallbackAutoScroll)),al(),qn(),Yk()},nulling:function(){Vn=Qr=Vt=ei=qt=ti=ni=null,te.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,o){var r=this,i=(t.touches?t.touches[0]:t).clientX,s=(t.touches?t.touches[0]:t).clientY,a=document.elementFromPoint(i,s);if(Vn=t,o||this.options.forceAutoScrollFallback||jt||$e||zt){oi(t,this.options,a,o);var l=We(a,!0);ei&&(!qt||i!==ti||s!==ni)&&(qt&&al(),qt=setInterval(function(){var c=We(document.elementFromPoint(i,s),!0);c!==l&&(l=c,qn()),oi(t,r.options,c,o)},10),ti=i,ni=s)}else{if(!this.options.bubbleScroll||We(a,!0)===Oe()){qn();return}oi(t,this.options,We(a,!1),!1)}}},Me(n,{pluginName:"scroll",initializeByDefault:!0})}function qn(){te.forEach(function(n){clearInterval(n.pid)}),te=[]}function al(){clearInterval(qt)}var oi=Va(function(n,e,t,o){if(e.scroll){var r=(n.touches?n.touches[0]:n).clientX,i=(n.touches?n.touches[0]:n).clientY,s=e.scrollSensitivity,a=e.scrollSpeed,l=Oe(),c=!1,d;Qr!==t&&(Qr=t,qn(),Vt=e.scroll,d=e.scrollFn,Vt===!0&&(Vt=We(t,!0)));var u=0,h=Vt;do{var g=h,f=ee(g),m=f.top,b=f.bottom,E=f.left,k=f.right,N=f.width,x=f.height,P=void 0,I=void 0,X=g.scrollWidth,C=g.scrollHeight,T=B(g),A=g.scrollLeft,R=g.scrollTop;g===l?(P=N<X&&(T.overflowX==="auto"||T.overflowX==="scroll"||T.overflowX==="visible"),I=x<C&&(T.overflowY==="auto"||T.overflowY==="scroll"||T.overflowY==="visible")):(P=N<X&&(T.overflowX==="auto"||T.overflowX==="scroll"),I=x<C&&(T.overflowY==="auto"||T.overflowY==="scroll"));var z=P&&(Math.abs(k-r)<=s&&A+N<X)-(Math.abs(E-r)<=s&&!!A),L=I&&(Math.abs(b-i)<=s&&R+x<C)-(Math.abs(m-i)<=s&&!!R);if(!te[u])for(var K=0;K<=u;K++)te[K]||(te[K]={});(te[u].vx!=z||te[u].vy!=L||te[u].el!==g)&&(te[u].el=g,te[u].vx=z,te[u].vy=L,clearInterval(te[u].pid),(z!=0||L!=0)&&(c=!0,te[u].pid=setInterval(function(){o&&this.layer===0&&_.active._onTouchMove(Vn);var M=te[this.layer].vy?te[this.layer].vy*a:0,Z=te[this.layer].vx?te[this.layer].vx*a:0;typeof d=="function"&&d.call(_.dragged.parentNode[he],Z,M,n,Vn,te[this.layer].el)!=="continue"||qa(te[this.layer].el,Z,M)}.bind({layer:u}),24))),u++}while(e.bubbleScroll&&h!==l&&(h=We(h,!1)));ei=c}},30),ll=function(e){var t=e.originalEvent,o=e.putSortable,r=e.dragEl,i=e.activeSortable,s=e.dispatchSortableEvent,a=e.hideGhostForTarget,l=e.unhideGhostForTarget;if(t){var c=o||i;a();var d=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(d.clientX,d.clientY);l(),c&&!c.el.contains(u)&&(s("spill"),this.onSpill({dragEl:r,putSortable:o}))}};function ri(){}ri.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,o=e.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var r=Tt(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),o&&o.animateAll()},drop:ll},Me(ri,{pluginName:"revertOnSpill"});function ii(){}ii.prototype={onSpill:function(e){var t=e.dragEl,o=e.putSortable,r=o||this.sortable;r.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),r.animateAll()},drop:ll},Me(ii,{pluginName:"removeOnSpill"}),_.mount(new uw),_.mount(ii,ri);const cl="block-removed",hw="block-added",fw="block-moved",dl="block-changed";class ul{constructor(){this.tail=Promise.resolve()}get completed(){return this.failure?Promise.reject(this.failure):this.tail}add(e){if(this.failure)return Promise.reject(this.failure);const t=this.tail.then(()=>e());return this.tail=t.catch(o=>{this.failure=o}),t}}class pw extends F{constructor(){super(...arguments),this._currentBlockIndex=-1,this._blocks=null,this.sortable=null}get currentBlockIndex(){return this._currentBlockIndex}set currentBlockIndex(e){this._currentBlockIndex=e}get firstBlock(){return this.blocksStore[0]}get lastBlock(){return this.blocksStore[this.blocksStore.length-1]}get currentBlock(){return this.blocksStore[this.currentBlockIndex]}set currentBlock(e){if(e===void 0){this.unsetCurrentBlock();return}this.currentBlockIndex=this.getBlockIndex(e)}get nextBlock(){return this.currentBlockIndex===this.blocksStore.length-1?null:this.blocksStore[this.currentBlockIndex+1]??null}get nextContentfulBlock(){return this.blocks.slice(this.currentBlockIndex+1).find(t=>!!t.inputs.length)}get previousContentfulBlock(){return this.blocks.slice(0,this.currentBlockIndex).reverse().find(t=>!!t.inputs.length)}get previousBlock(){return this.currentBlockIndex===0?null:this.blocksStore[this.currentBlockIndex-1]??null}get blocks(){return this.blocksStore.array}get isEditorEmpty(){return this.blocks.every(e=>e.isEmpty)}prepare(){const e=new zr(this.Editor.UI.nodes.redactor);this._blocks=new Proxy(e,{set:zr.set,get:zr.get}),this.listeners.on(document,"copy",t=>{this.Editor.BlockEvents.handleCommandC(t)}),this.sortable=new _(this.Editor.UI.nodes.redactor,{animation:150,forceFallback:!0,handle:`.${this.Editor.Toolbar.CSS.settingsToggler}`,onStart:()=>{this.Editor.UI.nodes.wrapper.classList.add(this.Editor.UI.CSS.editorDragging),Pt(!0)},onEnd:t=>{this.Editor.UI.nodes.wrapper.classList.remove(this.Editor.UI.CSS.editorDragging),!(t.newIndex===void 0||t.oldIndex===void 0)&&this.move(t.newIndex,t.oldIndex,!0)}})}toggleReadOnly(e){e?this.disableModuleBindings():this.enableModuleBindings()}composeBlock({tool:e,data:t={},id:o=void 0,tunes:r={}}){const i=this.Editor.ReadOnly.isEnabled,s=this.Editor.Tools.blockTools.get(e);if(s===void 0)throw new Error(`Could not compose Block. Tool «${e}» not found.`);const a=new re({id:o,data:t,tool:s,api:this.Editor.API,readOnly:i,tunesData:r},this.eventsDispatcher);return i||window.requestIdleCallback(()=>{this.bindBlockEvents(a)},{timeout:2e3}),a}insert({id:e=void 0,tool:t,data:o,index:r,needToFocus:i=!0,replace:s=!1,tunes:a}={}){const l=r??this.currentBlockIndex+(s?0:1),c=t??this.config.defaultBlock;if(c===void 0)throw new Error("Could not insert Block. Tool name is not specified.");const d={tool:c};e!==void 0&&(d.id=e),o!==void 0&&(d.data=o),a!==void 0&&(d.tunes=a);const u=this.composeBlock(d),h=s?this.getBlockByIndex(l):void 0;if(s&&h===void 0)throw new Error(`Could not replace Block at index ${l}. Block not found.`);return s&&h!==void 0&&this.blockDidMutated(cl,h,{index:l}),this.blocksStore.insert(l,u,s),this.blockDidMutated(hw,u,{index:l}),i&&(this.currentBlockIndex=l),!i&&l<=this.currentBlockIndex&&this.currentBlockIndex++,u}insertMany(e,t=0){this.blocksStore.insertMany(e,t)}async update(e,t,o){if(!t&&!o)return e;const r=await e.data,i=this.composeBlock({id:e.id,tool:e.name,data:Object.assign({},r,t??{}),tunes:o??e.tunes}),s=this.getBlockIndex(e);return this.blocksStore.replace(s,i),this.blockDidMutated(dl,i,{index:s}),i}replace(e,t,o){const r=this.getBlockIndex(e);return this.insert({tool:t,data:o,index:r,replace:!0})}get blocksStore(){if(this._blocks===null)throw new Error("BlockManager: blocks store is not initialized. Call prepare() before accessing blocks.");return this._blocks}paste(e,t,o=!1){const r=this.insert({tool:e,replace:o});try{window.requestIdleCallback(()=>{r.call(Pe.ON_PASTE,t)})}catch(i){$(`${e}: onPaste callback call is failed`,"error",i)}return r}insertDefaultBlockAtIndex(e,t=!1){const o=this.config.defaultBlock;if(o===void 0)throw new Error("Could not insert default Block. Default block tool is not defined in the configuration.");return this.insert({tool:o,index:e,needToFocus:t})}insertAtEnd(){return this.currentBlockIndex=this.blocks.length-1,this.insert()}async mergeBlocks(e,t){const o=async s=>{await e.mergeWith(s),await this.removeBlock(t),this.currentBlockIndex=this.blocksStore.indexOf(e)},r=e.name===t.name&&e.mergeable,i=r?await t.data:void 0;if(r&&Q(i)){console.error("Could not merge Block. Failed to extract original Block data.");return}if(r&&i!==void 0){const[s]=Oo([{data:i,tool:t.name}],e.tool.sanitizeConfig,this.config.sanitizer);await o(s.data);return}if(e.mergeable&&vn(t,"export")&&vn(e,"import")){const s=await t.exportDataAsString(),a=Ae(s,e.tool.sanitizeConfig),l=Gs(a,e.tool.conversionConfig);await o(l)}}removeBlock(e,t=!0){return new Promise(o=>{const r=this.blocksStore.indexOf(e);if(!this.validateIndex(r))throw new Error("Can't find a Block to remove");this.blocksStore.remove(r),e.destroy(),this.blockDidMutated(cl,e,{index:r}),this.currentBlockIndex>=r&&this.currentBlockIndex--;const i=this.blocks.length===0;i&&this.unsetCurrentBlock(),i&&t&&this.insert(),!i&&r===0&&(this.currentBlockIndex=0),o()})}removeSelectedBlocks(){const e=this.blocks.map((t,o)=>({block:t,index:o})).filter(({block:t})=>t.selected).sort((t,o)=>o.index-t.index);return e.forEach(({block:t})=>{this.removeBlock(t,!1)}),e.length>0?e[e.length-1].index:void 0}removeAllBlocks(){const e=r=>{r<0||(this.blocksStore.remove(r),e(r-1))};e(this.blocksStore.length-1),this.unsetCurrentBlock(),this.insert();const t=this.currentBlock,o=t==null?void 0:t.firstInput;o!==void 0&&o.focus()}split(){const e=this.Editor.Caret.extractFragmentFromCaretPosition(),t=v.make("div");t.appendChild(e);const o={text:v.isEmpty(t)?"":t.innerHTML};return this.insert({data:o})}getBlockByIndex(e){const t=e===-1?this.blocksStore.length-1:e;return this.blocksStore[t]}getBlockIndex(e){return this.blocksStore.indexOf(e)}getBlockById(e){return this.blocksStore.array.find(t=>t.id===e)}getBlock(e){const t=v.isElement(e)?e:e.parentNode;if(!t)return;const o=this.blocksStore.nodes,r=t.closest(`.${re.CSS.wrapper}`);if(!r)return;const i=o.indexOf(r);if(i>=0)return this.blocksStore[i]}setCurrentBlockByChildNode(e){const t=v.isElement(e)?e:e.parentNode;if(!t)return;const o=t.closest(`.${re.CSS.wrapper}`);if(!o)return;const r=o.closest(`.${this.Editor.UI.CSS.editorWrapper}`);if(!(r==null?void 0:r.isEqualNode(this.Editor.UI.nodes.wrapper))||!(o instanceof HTMLElement))return;this.currentBlockIndex=this.blocksStore.nodes.indexOf(o);const s=this.currentBlock;return s==null||s.updateCurrentInput(),s}getBlockByChildNode(e){if(!(e instanceof Node))return;const t=v.isElement(e)?e:e.parentNode;if(!t)return;const o=t.closest(`.${re.CSS.wrapper}`);if(o)return this.blocks.find(r=>r.holder===o)}move(e,t=this.currentBlockIndex,o=!1){if(isNaN(e)||isNaN(t)){$("Warning during 'move' call: incorrect indices provided.","warn");return}if(!this.validateIndex(e)||!this.validateIndex(t)){$("Warning during 'move' call: indices cannot be lower than 0 or greater than the amount of blocks.","warn");return}this.blocksStore.move(e,t,o),this.currentBlockIndex=e;const r=this.currentBlock;if(r===void 0)throw new Error(`Could not move Block. Block at index ${e} is not available.`);this.blockDidMutated(fw,r,{fromIndex:t,toIndex:e})}async convert(e,t,o){const r=await e.save();if(!r||r.data===void 0)throw new Error("Could not convert Block. Failed to extract original Block data.");const i=this.Editor.Tools.blockTools.get(t);if(!i)throw new Error(`Could not convert Block. Tool «${t}» not found.`);const s=await e.exportDataAsString(),a=Ae(s,Po(this.config.sanitizer,i.sanitizeConfig)),l=Gs(a,i.conversionConfig,i.settings),c=o?Object.assign(l,o):l;return this.replace(e,i.name,c)}unsetCurrentBlock(){this.currentBlockIndex=-1}async clear(e=!1){const t=new ul;[...this.blocks].forEach(r=>{t.add(async()=>{await this.removeBlock(r,!1)})}),await t.completed,this.unsetCurrentBlock(),e&&this.insert(),this.Editor.UI.checkEmptiness()}async destroy(){this.sortable&&(this.sortable.destroy(),this.sortable=null),await Promise.all(this.blocks.map(e=>e.destroy()))}bindBlockEvents(e){const{BlockEvents:t}=this.Editor;this.readOnlyMutableListeners.on(e.holder,"keydown",o=>{o instanceof KeyboardEvent&&t.keydown(o)}),this.readOnlyMutableListeners.on(e.holder,"keyup",o=>{o instanceof KeyboardEvent&&t.keyup(o)}),e.on("didMutated",o=>this.blockDidMutated(dl,o,{index:this.getBlockIndex(o)}))}disableModuleBindings(){this.readOnlyMutableListeners.clearAll()}enableModuleBindings(){this.readOnlyMutableListeners.on(document,"cut",e=>{this.Editor.BlockEvents.handleCommandX(e)}),this.blocks.forEach(e=>{this.bindBlockEvents(e)})}validateIndex(e){return!(e<0||e>=this.blocksStore.length)}blockDidMutated(e,t,o){const r={target:new Le(t),...o},i=new CustomEvent(e,{detail:{...r}});return Object.prototype.propertyIsEnumerable.call(i,"type")||Object.defineProperty(i,"type",{value:e,enumerable:!0,configurable:!0}),Object.prototype.propertyIsEnumerable.call(i,"detail")||Object.defineProperty(i,"detail",{value:r,enumerable:!0,configurable:!0}),this.eventsDispatcher.emit(Hs,{event:i}),t}}class gw extends F{constructor(){super(...arguments),this.anyBlockSelectedCache=null,this.needToSelectAll=!1,this.nativeInputSelected=!1,this.readyToBlockSelection=!1,this.selection=new w}get sanitizerConfig(){const e={p:{},h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},ol:{},ul:{},li:{},br:!0,img:{src:!0,width:!0,height:!0},a:{href:!0},b:{},i:{},u:{}};return Po(this.config.sanitizer,e)}get allBlocksSelected(){const{BlockManager:e}=this.Editor;return e.blocks.every(t=>t.selected===!0)}set allBlocksSelected(e){const{BlockManager:t}=this.Editor;for(const o of t.blocks)o.selected=e;this.clearCache()}get anyBlockSelected(){const{BlockManager:e}=this.Editor;return this.anyBlockSelectedCache===null&&(this.anyBlockSelectedCache=e.blocks.some(t=>t.selected===!0)),this.anyBlockSelectedCache}get selectedBlocks(){return this.Editor.BlockManager.blocks.filter(e=>e.selected)}prepare(){this.selection=new w,bt.add({name:"CMD+A",handler:e=>{const{BlockManager:t,ReadOnly:o}=this.Editor;if(o.isEnabled){e.preventDefault(),this.selectAllBlocks();return}t.currentBlock&&this.handleCommandA(e)},on:this.Editor.UI.nodes.redactor})}toggleReadOnly(){const e=w.get();e==null||e.removeAllRanges(),this.allBlocksSelected=!1}unSelectBlockByIndex(e){const{BlockManager:t}=this.Editor,o=typeof e=="number"?t.getBlockByIndex(e):t.currentBlock;o&&(o.selected=!1,this.clearCache())}clearSelection(e,t=!1){const{RectangleSelection:o}=this.Editor;this.needToSelectAll=!1,this.nativeInputSelected=!1,this.readyToBlockSelection=!1;const r=e&&e instanceof KeyboardEvent,i=e,s=r&&i.key&&i.key.length===1;if(this.anyBlockSelected&&r&&s&&!w.isSelectionExists&&this.replaceSelectedBlocksWithPrintableKey(e),this.Editor.CrossBlockSelection.clear(e),t&&this.selection.restore(),!this.anyBlockSelected||o.isRectActivated()){this.Editor.RectangleSelection.clearSelection();return}this.allBlocksSelected=!1}async copySelectedBlocks(e){e.preventDefault();const t=e.clipboardData;if(!t)return;const o=v.make("div"),r=[];this.selectedBlocks.forEach(a=>{const l=Ae(a.holder.innerHTML,this.sanitizerConfig),c=v.make("div");c.innerHTML=l;const d=c.textContent??"";if(r.push(d),!Array.from(c.childNodes).some(g=>g.nodeType===Node.ELEMENT_NODE)&&d.trim().length>0){const g=v.make("p");g.innerHTML=c.innerHTML,o.appendChild(g)}else for(;c.firstChild;)o.appendChild(c.firstChild)});const i=r.join(`
10
+ margin: 4px 5px 4px 0;`,v=l?c?(d.unshift(g,i),`%c${h}%c ${e}`):`( ${h} )${e}`:e,y=c?o!==void 0?[`${v} %o`,...d]:[v,...d]:[v];try{a[t](...y)}catch(b){}};qo.logLevel="VERBOSE";const bS=l=>{qo.logLevel=l},Be=(l,e="log",t,o)=>{qo(!1,l,e,t,o)},Zt=(l,e="log",t,o)=>{qo(!0,l,e,t,o)},De=l=>ST(l),Ue=l=>AT(l),dn=l=>_T(l),cv=l=>w0(l),uv=l=>ET(l),kS=function(l){return OT(l)},lt=l=>L0(l),dv=l=>gS(l),us=(l,e)=>function(...t){y0(()=>l.apply(this,t),e)},wS=l=>{var e;return(e=l.name.split(".").pop())!=null?e:""},TS=l=>/^[-\w]+\/([-+\w]+|\*)$/.test(l),fv=(l,e,t)=>{const o={timeoutId:null};return function(...i){const a=()=>{o.timeoutId=null,l.apply(this,i)};o.timeoutId!==null&&clearTimeout(o.timeoutId),o.timeoutId=setTimeout(a,e)}},ju=(l,e,t)=>oS(l,e,t),hv=()=>{var i,a;const l={win:!1,mac:!1,x11:!1,linux:!1},e=av(),t=(a=(i=e==null?void 0:e.userAgent)==null?void 0:i.toLowerCase())!=null?a:"",o=t?Object.keys(l).find(c=>t.indexOf(c)!==-1):void 0;return o!==void 0&&(l[o]=!0),l},ds=l=>l&&l.slice(0,1).toUpperCase()+l.slice(1),SS=(l,e)=>{if(Array.isArray(e))return e},Uo=(l,...e)=>!Ue(l)||e.length===0?l:e.reduce((t,o)=>Ue(o)?JT(t,o,SS):t,l),pv=l=>{const e=hv(),t=l.replace(/shift/gi,"⇧").replace(/backspace/gi,"⌫").replace(/enter/gi,"⏎").replace(/up/gi,"↑").replace(/left/gi,"→").replace(/down/gi,"↓").replace(/right/gi,"←").replace(/escape/gi,"⎋").replace(/insert/gi,"Ins").replace(/delete/gi,"␡").replace(/\+/gi," + ");return e.mac?t.replace(/ctrl|cmd/gi,"⌘").replace(/alt/gi,"⌥"):t.replace(/cmd/gi,"Ctrl").replace(/windows/gi,"WIN")},xS=l=>{try{return new URL(l).href}catch(t){}const e=cs();return l.substring(0,2)==="//"?e?`${e.location.protocol}${l}`:l:e?`${e.location.origin}${l}`:l},CS=()=>Jw(10),ES=l=>{const e=cs();e&&e.open(l,"_blank")},BS=(l="")=>`${l}${Math.floor(Math.random()*vS).toString(yS)}`,gv=650,Xn=()=>{const l=cs();return!l||typeof l.matchMedia!="function"?!1:l.matchMedia(`(max-width: ${gv}px)`).matches},qu=(()=>{var h;const l=av();if(!l)return!1;const e=l.userAgent||"",t=l.userAgentData,o=t==null?void 0:t.platform;if(/iP(ad|hone|od)/.test(e)||o!==void 0&&o!==""&&/iP(ad|hone|od)/.test(o))return!0;const i=((h=l.maxTouchPoints)!=null?h:0)>1,a=()=>l.platform,c=o!==void 0&&o!==""?o:void 0;return(i?c!=null?c:a():void 0)==="MacIntel"})(),AS=(l,e)=>wT(l,e);class R{static isSingleTag(e){return!!e.tagName&&["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"].includes(e.tagName)}static isLineBreakTag(e){return!!e&&["BR","WBR"].includes(e.tagName)}static make(e,t=null,o={}){const i=document.createElement(e);if(Array.isArray(t)){const a=t.filter(c=>c!==void 0&&c!=="").flatMap(c=>c.split(" ")).filter(c=>c!=="");i.classList.add(...a)}if(typeof t=="string"&&t!==""){const a=t.split(" ").filter(c=>c!=="");i.classList.add(...a)}for(const a in o){if(!Object.prototype.hasOwnProperty.call(o,a))continue;const c=o[a];if(c!=null){if(a in i){i[a]=c;continue}i.setAttribute(a,String(c))}}return i}static text(e){return document.createTextNode(e)}static append(e,t){Array.isArray(t)?t.forEach(o=>e.appendChild(o)):e.appendChild(t)}static prepend(e,t){Array.isArray(t)?[...t].reverse().forEach(i=>e.prepend(i)):e.prepend(t)}static find(e=document,t){return e.querySelector(t)}static get(e){return document.getElementById(e)}static findAll(e=document,t){return e.querySelectorAll(t)}static get allInputsSelector(){return"[contenteditable=true], textarea, input:not([type]), "+["text","password","email","number","search","tel","url"].map(t=>`input[type="${t}"]`).join(", ")}static findAllInputs(e){return dv(e.querySelectorAll(R.allInputsSelector)).reduce((t,o)=>R.isNativeInput(o)||R.containsOnlyInlineElements(o)?[...t,o]:[...t,...R.getDeepestBlockElements(o)],[])}static getDeepestNode(e,t=!1){var v;const o=t?"lastChild":"firstChild",i=t?"previousSibling":"nextSibling";if(e===null||e.nodeType!==Node.ELEMENT_NODE)return e;const a=e[o];if(a===null)return e;const c=a;if(!(R.isSingleTag(c)&&!R.isNativeInput(c)&&!R.isLineBreakTag(c)))return this.getDeepestNode(c,t);const h=c[i];if(h)return this.getDeepestNode(h,t);const g=(v=c.parentNode)==null?void 0:v[i];return g?this.getDeepestNode(g,t):c.parentNode}static isElement(e){return uv(e)?!1:e!=null&&e.nodeType!=null&&e.nodeType===Node.ELEMENT_NODE}static isFragment(e){return uv(e)?!1:e!=null&&e.nodeType!=null&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}static isContentEditable(e){return e.contentEditable==="true"}static isNativeInput(e){const t=["INPUT","TEXTAREA"];return e!=null&&typeof e.tagName=="string"?t.includes(e.tagName):!1}static canSetCaret(e){return R.isNativeInput(e)?!new Set(["file","checkbox","radio","hidden","submit","button","image","reset"]).has(e.type):R.isContentEditable(e)}static isNodeEmpty(e,t){var a,c;if(this.isSingleTag(e)&&!this.isLineBreakTag(e))return!1;const o=this.isElement(e)&&this.isNativeInput(e)?e.value:(a=e.textContent)==null?void 0:a.replace("​",""),i=t?o==null?void 0:o.replace(new RegExp(t,"g"),""):o;return((c=i==null?void 0:i.length)!=null?c:0)===0}static isLeaf(e){return e?e.childNodes.length===0:!1}static isEmpty(e,t){const o=[e];for(;o.length>0;){const i=o.shift();if(i){if(this.isLeaf(i)&&!this.isNodeEmpty(i,t))return!1;i.childNodes&&o.push(...Array.from(i.childNodes))}}return!0}static isHTMLString(e){const t=R.make("div");return t.innerHTML=e,t.childElementCount>0}static getContentLength(e){var t,o;return R.isNativeInput(e)?e.value.length:e.nodeType===Node.TEXT_NODE?e.length:(o=(t=e.textContent)==null?void 0:t.length)!=null?o:0}static get blockElements(){return["address","article","aside","blockquote","canvas","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","noscript","ol","output","p","pre","ruby","section","table","tbody","thead","tr","tfoot","ul","video"]}static containsOnlyInlineElements(e){const t=dn(e)?(()=>{const i=document.createElement("div");return i.innerHTML=e,i})():e,o=i=>!R.blockElements.includes(i.tagName.toLowerCase())&&Array.from(i.children).every(o);return Array.from(t.children).every(o)}static getDeepestBlockElements(e){return R.containsOnlyInlineElements(e)?[e]:Array.from(e.children).reduce((t,o)=>[...t,...R.getDeepestBlockElements(o)],[])}static getHolder(e){if(!dn(e))return e;const t=document.getElementById(e);if(t!==null)return t;throw new Error(`Element with id "${e}" not found`)}static isAnchor(e){return e.tagName.toLowerCase()==="a"}static offset(e){const t=e.getBoundingClientRect(),o=window.scrollX||document.documentElement.scrollLeft,i=window.scrollY||document.documentElement.scrollTop,a=t.top+i,c=t.left+o;return{top:a,left:c,bottom:a+t.height,right:c+t.width}}static getNodeByOffset(e,t){const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null),i=(g,v,y,b)=>{var C;if(!g&&y){const O=v-b,L=Math.max(t-O,0),U=Math.min(L,b);return{node:y,offset:U}}if(!g)return{node:null,offset:0};const w=((C=g.textContent)!=null?C:"").length;return v+w>=t?{node:g,offset:Math.min(t-v,w)}:i(o.nextNode(),v+w,g,w)},a=o.nextNode(),{node:c,offset:d}=i(a,0,null,0);if(!c)return{node:null,offset:0};const h=c.textContent;return!h||h.length===0?{node:null,offset:0}:{node:c,offset:d}}}const Uu=l=>!/[^\t\n\r \u200B]/.test(l),IS=l=>{const e=window.getComputedStyle(l),t=parseFloat(e.fontSize),o=parseFloat(e.lineHeight)||t*1.2,i=parseFloat(e.paddingTop),a=parseFloat(e.borderTopWidth),c=parseFloat(e.marginTop),d=t*.8,h=(o-t)/2;return c+a+i+h+d},mv=l=>{l.setAttribute("data-blok-empty",R.isEmpty(l)?"true":"false")},vv={ui:{blockTunes:{toggler:{"Drag to move":"","Click to open the menu":""}},inlineToolbar:{converter:{"Convert to":""}},toolbar:{toolbox:{"Click to add below":"","Option-click to add above":"","Ctrl-click to add above":""}},popover:{Filter:"","Nothing found":"","Convert to":""}},toolNames:{Text:"",Link:"",Bold:"",Italic:""},tools:{link:{"Add a link":""},stub:{"The block can not be displayed correctly.":""}},blockTunes:{delete:{Delete:"","Click to delete":""},moveUp:{"Move up":""},moveDown:{"Move down":""}}},tr=class tr{static ui(e,t){return tr._t(e,t)}static t(e,t){return tr._t(e,t)}static setDictionary(e){tr.currentDictionary=e}static _t(e,t){const o=tr.getNamespace(e);return!o||!o[t]?t:o[t]}static getNamespace(e){return e.split(".").reduce((o,i)=>{if(!o||!Object.keys(o).length)return{};const a=o[i];return typeof a=="string"?{}:a},tr.currentDictionary)}};tr.currentDictionary=vv;let Ge=tr;class Wo extends Error{}class Ko{constructor(){this.subscribers={}}on(e,t){e in this.subscribers||(this.subscribers[e]=[]),this.subscribers[e].push(t)}once(e,t){e in this.subscribers||(this.subscribers[e]=[]);const o=i=>{const a=t(i),c=this.subscribers[e].indexOf(o);return c!==-1&&this.subscribers[e].splice(c,1),a};this.subscribers[e].push(o)}emit(e,t){lt(this.subscribers)||!this.subscribers[e]||this.subscribers[e].reduce((o,i)=>{const a=i(o);return a!==void 0?a:o},t)}off(e,t){const o=this.subscribers[e];if(o===void 0){console.warn(`EventDispatcher .off(): there is no subscribers for event "${e.toString()}". Probably, .off() called before .on()`);return}const i=o.indexOf(t);i!==-1&&o.splice(i,1)}destroy(){this.subscribers={}}}const On=function(e){return Object.setPrototypeOf(this,{get id(){return e.id},get name(){return e.name},get config(){return e.config},get holder(){return e.holder},get isEmpty(){return e.isEmpty},get selected(){return e.selected},set stretched(o){e.setStretchState(o)},get stretched(){return e.stretched},get focusable(){return e.focusable},call(o,i){return e.call(o,i)},save(){return e.save()},validate(o){return e.validate(o)},dispatchChange(){e.dispatchChange()},getActiveToolboxEntry(){return e.getActiveToolboxEntry()}}),Object.defineProperties(this,{id:{get(){return e.id},enumerable:!0,configurable:!0},name:{get(){return e.name},enumerable:!0,configurable:!0}}),this};class Vo{constructor(){this.allListeners=[]}on(e,t,o,i=!1){if(this.findOne(e,t,o,i))return;const c=BS("l"),d={id:c,element:e,eventType:t,handler:o,options:i};return this.allListeners.push(d),e.addEventListener(t,o,i),c}off(e,t,o,i){const a=this.findAll(e,t,o,i);a.forEach((c,d)=>{const h=this.allListeners.indexOf(a[d]);h>-1&&(this.allListeners.splice(h,1),c.element.removeEventListener(c.eventType,c.handler,c.options))})}offById(e){const t=this.findById(e);if(!t)return;t.element.removeEventListener(t.eventType,t.handler,t.options);const o=this.allListeners.indexOf(t);o>-1&&this.allListeners.splice(o,1)}findOne(e,t,o,i){var c;return(c=this.findAll(e,t,o,i)[0])!=null?c:null}findAll(e,t,o,i){return e?this.findByEventTarget(e).filter(c=>{const d=t===void 0||c.eventType===t,h=o===void 0||c.handler===o,g=this.areOptionsEqual(c.options,i);return d&&h&&g}):[]}removeAll(){this.allListeners.forEach(e=>{e.element.removeEventListener(e.eventType,e.handler,e.options)}),this.allListeners=[]}destroy(){this.removeAll()}findByEventTarget(e){return this.allListeners.filter(t=>t.element===e)}findByType(e){return this.allListeners.filter(t=>t.eventType===e)}findByHandler(e){return this.allListeners.filter(t=>t.handler===e)}findById(e){return this.allListeners.find(t=>t.id===e)}normalizeListenerOptions(e){var t,o,i;return typeof e=="boolean"?{capture:e,once:!1,passive:!1}:e?{capture:(t=e.capture)!=null?t:!1,once:(o=e.once)!=null?o:!1,passive:(i=e.passive)!=null?i:!1,signal:e.signal}:{capture:!1,once:!1,passive:!1}}areOptionsEqual(e,t){if(t===void 0)return!0;const o=this.normalizeListenerOptions(e),i=this.normalizeListenerOptions(t);return o.capture===i.capture&&o.once===i.once&&o.passive===i.passive&&o.signal===i.signal}}class Ae{constructor({config:e,eventsDispatcher:t}){if(this.nodes={},this.listeners=new Vo,this.readOnlyMutableListeners={on:(o,i,a,c=!1)=>{const d=this.listeners.on(o,i,a,c);d&&this.mutableListenerIds.push(d)},clearAll:()=>{for(const o of this.mutableListenerIds)this.listeners.offById(o);this.mutableListenerIds=[]}},this.mutableListenerIds=[],new.target===Ae)throw new TypeError("Constructors for abstract class Module are not allowed.");this.config=e,this.eventsDispatcher=t,this.Blok={}}set state(e){this.Blok=e}removeAllNodes(){for(const e in this.nodes){const t=this.nodes[e];t instanceof HTMLElement&&t.remove()}}get isRtl(){var e;return((e=this.config.i18n)==null?void 0:e.direction)==="rtl"}}const _S=(l,e)=>{const t=new Array(l.length+e.length);for(let o=0;o<l.length;o++)t[o]=l[o];for(let o=0;o<e.length;o++)t[l.length+o]=e[o];return t},NS=(l,e)=>({classGroupId:l,validator:e}),yv=(l=new Map,e=null,t)=>({nextPart:l,validators:e,classGroupId:t}),fs="-",bv=[],RS="arbitrary..",OS=l=>{const e=DS(l),{conflictingClassGroups:t,conflictingClassGroupModifiers:o}=l;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return LS(c);const d=c.split(fs),h=d[0]===""&&d.length>1?1:0;return kv(d,h,e)},getConflictingClassGroupIds:(c,d)=>{if(d){const h=o[c],g=t[c];return h?g?_S(g,h):h:g||bv}return t[c]||bv}}},kv=(l,e,t)=>{if(l.length-e===0)return t.classGroupId;const i=l[e],a=t.nextPart.get(i);if(a){const g=kv(l,e+1,a);if(g)return g}const c=t.validators;if(c===null)return;const d=e===0?l.join(fs):l.slice(e).join(fs),h=c.length;for(let g=0;g<h;g++){const v=c[g];if(v.validator(d))return v.classGroupId}},LS=l=>l.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=l.slice(1,-1),t=e.indexOf(":"),o=e.slice(0,t);return o?RS+o:void 0})(),DS=l=>{const{theme:e,classGroups:t}=l;return PS(t,e)},PS=(l,e)=>{const t=yv();for(const o in l){const i=l[o];Wu(i,t,o,e)}return t},Wu=(l,e,t,o)=>{const i=l.length;for(let a=0;a<i;a++){const c=l[a];MS(c,e,t,o)}},MS=(l,e,t,o)=>{if(typeof l=="string"){FS(l,e,t);return}if(typeof l=="function"){zS(l,e,t,o);return}HS(l,e,t,o)},FS=(l,e,t)=>{const o=l===""?e:wv(e,l);o.classGroupId=t},zS=(l,e,t,o)=>{if(jS(l)){Wu(l(o),e,t,o);return}e.validators===null&&(e.validators=[]),e.validators.push(NS(t,l))},HS=(l,e,t,o)=>{const i=Object.entries(l),a=i.length;for(let c=0;c<a;c++){const[d,h]=i[c];Wu(h,wv(e,d),t,o)}},wv=(l,e)=>{let t=l;const o=e.split(fs),i=o.length;for(let a=0;a<i;a++){const c=o[a];let d=t.nextPart.get(c);d||(d=yv(),t.nextPart.set(c,d)),t=d}return t},jS=l=>"isThemeGetter"in l&&l.isThemeGetter===!0,qS=l=>{if(l<1)return{get:()=>{},set:()=>{}};let e=0,t=Object.create(null),o=Object.create(null);const i=(a,c)=>{t[a]=c,e++,e>l&&(e=0,o=t,t=Object.create(null))};return{get(a){let c=t[a];if(c!==void 0)return c;if((c=o[a])!==void 0)return i(a,c),c},set(a,c){a in t?t[a]=c:i(a,c)}}},Ku="!",Tv=":",US=[],Sv=(l,e,t,o,i)=>({modifiers:l,hasImportantModifier:e,baseClassName:t,maybePostfixModifierPosition:o,isExternal:i}),WS=l=>{const{prefix:e,experimentalParseClassName:t}=l;let o=i=>{const a=[];let c=0,d=0,h=0,g;const v=i.length;for(let T=0;T<v;T++){const C=i[T];if(c===0&&d===0){if(C===Tv){a.push(i.slice(h,T)),h=T+1;continue}if(C==="/"){g=T;continue}}C==="["?c++:C==="]"?c--:C==="("?d++:C===")"&&d--}const y=a.length===0?i:i.slice(h);let b=y,x=!1;y.endsWith(Ku)?(b=y.slice(0,-1),x=!0):y.startsWith(Ku)&&(b=y.slice(1),x=!0);const w=g&&g>h?g-h:void 0;return Sv(a,x,b,w)};if(e){const i=e+Tv,a=o;o=c=>c.startsWith(i)?a(c.slice(i.length)):Sv(US,!1,c,void 0,!0)}if(t){const i=o;o=a=>t({className:a,parseClassName:i})}return o},KS=l=>{const e=new Map;return l.orderSensitiveModifiers.forEach((t,o)=>{e.set(t,1e6+o)}),t=>{const o=[];let i=[];for(let a=0;a<t.length;a++){const c=t[a],d=c[0]==="[",h=e.has(c);d||h?(i.length>0&&(i.sort(),o.push(...i),i=[]),o.push(c)):i.push(c)}return i.length>0&&(i.sort(),o.push(...i)),o}},VS=l=>be({cache:qS(l.cacheSize),parseClassName:WS(l),sortModifiers:KS(l)},OS(l)),$S=/\s+/,GS=(l,e)=>{const{parseClassName:t,getClassGroupId:o,getConflictingClassGroupIds:i,sortModifiers:a}=e,c=[],d=l.trim().split($S);let h="";for(let g=d.length-1;g>=0;g-=1){const v=d[g],{isExternal:y,modifiers:b,hasImportantModifier:x,baseClassName:w,maybePostfixModifierPosition:T}=t(v);if(y){h=v+(h.length>0?" "+h:h);continue}let C=!!T,O=o(C?w.substring(0,T):w);if(!O){if(!C){h=v+(h.length>0?" "+h:h);continue}if(O=o(w),!O){h=v+(h.length>0?" "+h:h);continue}C=!1}const L=b.length===0?"":b.length===1?b[0]:a(b).join(":"),U=x?L+Ku:L,H=U+O;if(c.indexOf(H)>-1)continue;c.push(H);const Y=i(O,C);for(let q=0;q<Y.length;++q){const W=Y[q];c.push(U+W)}h=v+(h.length>0?" "+h:h)}return h},xv=(...l)=>{let e=0,t,o,i="";for(;e<l.length;)(t=l[e++])&&(o=Cv(t))&&(i&&(i+=" "),i+=o);return i},Cv=l=>{if(typeof l=="string")return l;let e,t="";for(let o=0;o<l.length;o++)l[o]&&(e=Cv(l[o]))&&(t&&(t+=" "),t+=e);return t},XS=(l,...e)=>{let t,o,i,a;const c=h=>{const g=e.reduce((v,y)=>y(v),l());return t=VS(g),o=t.cache.get,i=t.cache.set,a=d,d(h)},d=h=>{const g=o(h);if(g)return g;const v=GS(h,t);return i(h,v),v};return a=c,(...h)=>a(xv(...h))},YS=[],ft=l=>{const e=t=>t[l]||YS;return e.isThemeGetter=!0,e},Ev=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Bv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,QS=/^\d+\/\d+$/,ZS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,JS=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,e1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,t1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,n1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,eo=l=>QS.test(l),ke=l=>!!l&&!Number.isNaN(Number(l)),Yn=l=>!!l&&Number.isInteger(Number(l)),Vu=l=>l.endsWith("%")&&ke(l.slice(0,-1)),Ln=l=>ZS.test(l),r1=()=>!0,o1=l=>JS.test(l)&&!e1.test(l),Av=()=>!1,i1=l=>t1.test(l),s1=l=>n1.test(l),l1=l=>!ee(l)&&!te(l),a1=l=>to(l,Ov,Av),ee=l=>Ev.test(l),xr=l=>to(l,Lv,o1),$u=l=>to(l,h1,ke),Iv=l=>to(l,Nv,Av),c1=l=>to(l,Rv,s1),hs=l=>to(l,Dv,i1),te=l=>Bv.test(l),$o=l=>no(l,Lv),u1=l=>no(l,p1),_v=l=>no(l,Nv),d1=l=>no(l,Ov),f1=l=>no(l,Rv),ps=l=>no(l,Dv,!0),to=(l,e,t)=>{const o=Ev.exec(l);return o?o[1]?e(o[1]):t(o[2]):!1},no=(l,e,t=!1)=>{const o=Bv.exec(l);return o?o[1]?e(o[1]):t:!1},Nv=l=>l==="position"||l==="percentage",Rv=l=>l==="image"||l==="url",Ov=l=>l==="length"||l==="size"||l==="bg-size",Lv=l=>l==="length",h1=l=>l==="number",p1=l=>l==="family-name",Dv=l=>l==="shadow",Te=XS(()=>{const l=ft("color"),e=ft("font"),t=ft("text"),o=ft("font-weight"),i=ft("tracking"),a=ft("leading"),c=ft("breakpoint"),d=ft("container"),h=ft("spacing"),g=ft("radius"),v=ft("shadow"),y=ft("inset-shadow"),b=ft("text-shadow"),x=ft("drop-shadow"),w=ft("blur"),T=ft("perspective"),C=ft("aspect"),O=ft("ease"),L=ft("animate"),U=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],Y=()=>[...H(),te,ee],q=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto","contain","none"],F=()=>[te,ee,h],re=()=>[eo,"full","auto",...F()],ce=()=>[Yn,"none","subgrid",te,ee],Z=()=>["auto",{span:["full",Yn,te,ee]},Yn,te,ee],ye=()=>[Yn,"auto",te,ee],J=()=>["auto","min","max","fr",te,ee],we=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Re=()=>["start","end","center","stretch","center-safe","end-safe"],xe=()=>["auto",...F()],_e=()=>[eo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...F()],D=()=>[l,te,ee],ae=()=>[...H(),_v,Iv,{position:[te,ee]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",d1,a1,{size:[te,ee]}],P=()=>[Vu,$o,xr],le=()=>["","none","full",g,te,ee],fe=()=>["",ke,$o,xr],Ce=()=>["solid","dashed","dotted","double"],Ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[ke,Vu,_v,Iv],Pe=()=>["","none",w,te,ee],He=()=>["none",ke,te,ee],mt=()=>["none",ke,te,ee],rr=()=>[ke,te,ee],Fr=()=>[eo,"full",...F()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ln],breakpoint:[Ln],color:[r1],container:[Ln],"drop-shadow":[Ln],ease:["in","out","in-out"],font:[l1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ln],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ln],shadow:[Ln],spacing:["px",ke],text:[Ln],"text-shadow":[Ln],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",eo,ee,te,C]}],container:["container"],columns:[{columns:[ke,ee,te,d]}],"break-after":[{"break-after":U()}],"break-before":[{"break-before":U()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:Y()}],overflow:[{overflow:q()}],"overflow-x":[{"overflow-x":q()}],"overflow-y":[{"overflow-y":q()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:re()}],"inset-x":[{"inset-x":re()}],"inset-y":[{"inset-y":re()}],start:[{start:re()}],end:[{end:re()}],top:[{top:re()}],right:[{right:re()}],bottom:[{bottom:re()}],left:[{left:re()}],visibility:["visible","invisible","collapse"],z:[{z:[Yn,"auto",te,ee]}],basis:[{basis:[eo,"full","auto",d,...F()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ke,eo,"auto","initial","none",ee]}],grow:[{grow:["",ke,te,ee]}],shrink:[{shrink:["",ke,te,ee]}],order:[{order:[Yn,"first","last","none",te,ee]}],"grid-cols":[{"grid-cols":ce()}],"col-start-end":[{col:Z()}],"col-start":[{"col-start":ye()}],"col-end":[{"col-end":ye()}],"grid-rows":[{"grid-rows":ce()}],"row-start-end":[{row:Z()}],"row-start":[{"row-start":ye()}],"row-end":[{"row-end":ye()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:F()}],"gap-x":[{"gap-x":F()}],"gap-y":[{"gap-y":F()}],"justify-content":[{justify:[...we(),"normal"]}],"justify-items":[{"justify-items":[...Re(),"normal"]}],"justify-self":[{"justify-self":["auto",...Re()]}],"align-content":[{content:["normal",...we()]}],"align-items":[{items:[...Re(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Re(),{baseline:["","last"]}]}],"place-content":[{"place-content":we()}],"place-items":[{"place-items":[...Re(),"baseline"]}],"place-self":[{"place-self":["auto",...Re()]}],p:[{p:F()}],px:[{px:F()}],py:[{py:F()}],ps:[{ps:F()}],pe:[{pe:F()}],pt:[{pt:F()}],pr:[{pr:F()}],pb:[{pb:F()}],pl:[{pl:F()}],m:[{m:xe()}],mx:[{mx:xe()}],my:[{my:xe()}],ms:[{ms:xe()}],me:[{me:xe()}],mt:[{mt:xe()}],mr:[{mr:xe()}],mb:[{mb:xe()}],ml:[{ml:xe()}],"space-x":[{"space-x":F()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":F()}],"space-y-reverse":["space-y-reverse"],size:[{size:_e()}],w:[{w:[d,"screen",..._e()]}],"min-w":[{"min-w":[d,"screen","none",..._e()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[c]},..._e()]}],h:[{h:["screen","lh",..._e()]}],"min-h":[{"min-h":["screen","lh","none",..._e()]}],"max-h":[{"max-h":["screen","lh",..._e()]}],"font-size":[{text:["base",t,$o,xr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,te,$u]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Vu,ee]}],"font-family":[{font:[u1,ee,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,te,ee]}],"line-clamp":[{"line-clamp":[ke,"none",te,$u]}],leading:[{leading:[a,...F()]}],"list-image":[{"list-image":["none",te,ee]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",te,ee]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[ke,"from-font","auto",te,xr]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[ke,"auto",te,ee]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",te,ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",te,ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ae()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Yn,te,ee],radial:["",te,ee],conic:[Yn,te,ee]},f1,c1]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:le()}],"rounded-s":[{"rounded-s":le()}],"rounded-e":[{"rounded-e":le()}],"rounded-t":[{"rounded-t":le()}],"rounded-r":[{"rounded-r":le()}],"rounded-b":[{"rounded-b":le()}],"rounded-l":[{"rounded-l":le()}],"rounded-ss":[{"rounded-ss":le()}],"rounded-se":[{"rounded-se":le()}],"rounded-ee":[{"rounded-ee":le()}],"rounded-es":[{"rounded-es":le()}],"rounded-tl":[{"rounded-tl":le()}],"rounded-tr":[{"rounded-tr":le()}],"rounded-br":[{"rounded-br":le()}],"rounded-bl":[{"rounded-bl":le()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ce(),"hidden","none"]}],"divide-style":[{divide:[...Ce(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...Ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ke,te,ee]}],"outline-w":[{outline:["",ke,$o,xr]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",v,ps,hs]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",y,ps,hs]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[ke,xr]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",b,ps,hs]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[ke,te,ee]}],"mix-blend":[{"mix-blend":[...Ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ne()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[te,ee]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":H()}],"mask-image-conic-pos":[{"mask-conic":[ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ae()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",te,ee]}],filter:[{filter:["","none",te,ee]}],blur:[{blur:Pe()}],brightness:[{brightness:[ke,te,ee]}],contrast:[{contrast:[ke,te,ee]}],"drop-shadow":[{"drop-shadow":["","none",x,ps,hs]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",ke,te,ee]}],"hue-rotate":[{"hue-rotate":[ke,te,ee]}],invert:[{invert:["",ke,te,ee]}],saturate:[{saturate:[ke,te,ee]}],sepia:[{sepia:["",ke,te,ee]}],"backdrop-filter":[{"backdrop-filter":["","none",te,ee]}],"backdrop-blur":[{"backdrop-blur":Pe()}],"backdrop-brightness":[{"backdrop-brightness":[ke,te,ee]}],"backdrop-contrast":[{"backdrop-contrast":[ke,te,ee]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ke,te,ee]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ke,te,ee]}],"backdrop-invert":[{"backdrop-invert":["",ke,te,ee]}],"backdrop-opacity":[{"backdrop-opacity":[ke,te,ee]}],"backdrop-saturate":[{"backdrop-saturate":[ke,te,ee]}],"backdrop-sepia":[{"backdrop-sepia":["",ke,te,ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":F()}],"border-spacing-x":[{"border-spacing-x":F()}],"border-spacing-y":[{"border-spacing-y":F()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",te,ee]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ke,"initial",te,ee]}],ease:[{ease:["linear","initial",O,te,ee]}],delay:[{delay:[ke,te,ee]}],animate:[{animate:["none",L,te,ee]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[T,te,ee]}],"perspective-origin":[{"perspective-origin":Y()}],rotate:[{rotate:He()}],"rotate-x":[{"rotate-x":He()}],"rotate-y":[{"rotate-y":He()}],"rotate-z":[{"rotate-z":He()}],scale:[{scale:mt()}],"scale-x":[{"scale-x":mt()}],"scale-y":[{"scale-y":mt()}],"scale-z":[{"scale-z":mt()}],"scale-3d":["scale-3d"],skew:[{skew:rr()}],"skew-x":[{"skew-x":rr()}],"skew-y":[{"skew-y":rr()}],transform:[{transform:[te,ee,"","none","gpu","cpu"]}],"transform-origin":[{origin:Y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Fr()}],"translate-x":[{"translate-x":Fr()}],"translate-y":[{"translate-y":Fr()}],"translate-z":[{"translate-z":Fr()}],"translate-none":["translate-none"],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",te,ee]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",te,ee]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[ke,$o,xr,$u]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}}),kt=xv;class X{constructor(){this.instance=null,this.selection=null,this.savedSelectionRange=null,this.isFakeBackgroundEnabled=!1,this.fakeBackgroundElements=[]}static get CSS(){return{blokWrapper:"blok-editor",blokZone:"blok-editor__redactor"}}static get anchorNode(){const e=window.getSelection();return e?e.anchorNode:null}static get anchorElement(){const e=window.getSelection();if(!e)return null;const t=e.anchorNode;return t?R.isElement(t)?t:t.parentElement:null}static get anchorOffset(){const e=window.getSelection();return e?e.anchorOffset:null}static get isCollapsed(){const e=window.getSelection();return e?e.isCollapsed:null}static get isAtBlok(){return this.isSelectionAtBlok(X.get())}static isSelectionAtBlok(e){if(!e)return!1;const t=e.anchorNode||e.focusNode,o=t&&t.nodeType===Node.TEXT_NODE?t.parentNode:t,i=o&&o instanceof Element?o.closest(`.${X.CSS.blokZone}`):null;return i?i.nodeType===Node.ELEMENT_NODE:!1}static isRangeAtBlok(e){if(!e)return;const t=e.startContainer&&e.startContainer.nodeType===Node.TEXT_NODE?e.startContainer.parentNode:e.startContainer,o=t&&t instanceof Element?t.closest(`.${X.CSS.blokZone}`):null;return o?o.nodeType===Node.ELEMENT_NODE:!1}static get isSelectionExists(){const e=X.get();return!!(e!=null&&e.anchorNode)}static get range(){return this.getRangeFromSelection(this.get())}static getRangeFromSelection(e){return e&&e.rangeCount?e.getRangeAt(0):null}static get rect(){const e=document.selection,t={x:0,y:0,width:0,height:0};if(e&&e.type!=="Control"){const d=e.createRange();return t.x=d.boundingLeft,t.y=d.boundingTop,t.width=d.boundingWidth,t.height=d.boundingHeight,t}const o=window.getSelection();if(!o)return Be("Method window.getSelection returned null","warn"),t;if(o.rangeCount===null||isNaN(o.rangeCount))return Be("Method SelectionUtils.rangeCount is not supported","warn"),t;if(o.rangeCount===0)return t;const i=o.getRangeAt(0).cloneRange(),a=i.getBoundingClientRect();if(a.x===0&&a.y===0){const c=document.createElement("span");c.appendChild(document.createTextNode("​")),i.insertNode(c);const d=c.getBoundingClientRect(),h=c.parentNode;return h==null||h.removeChild(c),h==null||h.normalize(),d}return a}static get text(){var t;const e=window.getSelection();return(t=e==null?void 0:e.toString())!=null?t:""}static get(){return window.getSelection()}static setCursor(e,t=0){const o=document.createRange(),i=window.getSelection(),a=R.isNativeInput(e);if(a&&!R.canSetCaret(e))return e.getBoundingClientRect();if(a){const c=e;return c.focus(),c.selectionStart=t,c.selectionEnd=t,c.getBoundingClientRect()}return o.setStart(e,t),o.setEnd(e,t),i?(i.removeAllRanges(),i.addRange(o),o.getBoundingClientRect()):e.getBoundingClientRect()}static isRangeInsideContainer(e){const t=X.range;return t===null?!1:e.contains(t.startContainer)}static addFakeCursor(){const e=X.range;if(e===null)return;const t=R.make("span","blok-editor__fake-cursor");t.setAttribute("data-blok-mutation-free","true"),e.collapse(),e.insertNode(t)}static isFakeCursorInsideContainer(e){return R.find(e,".blok-editor__fake-cursor")!==null}static removeFakeCursor(e=document.body){const t=R.find(e,".blok-editor__fake-cursor");t&&t.remove()}removeFakeBackground(){var a;if(!this.fakeBackgroundElements.length){this.isFakeBackgroundEnabled=!1;return}const e=this.fakeBackgroundElements[0],t=this.fakeBackgroundElements[this.fakeBackgroundElements.length-1],o=e.firstChild,i=t.lastChild;if(this.fakeBackgroundElements.forEach(c=>{this.unwrapFakeBackground(c)}),o&&i){const c=document.createRange();c.setStart(o,0),c.setEnd(i,((a=i.textContent)==null?void 0:a.length)||0),this.savedSelectionRange=c}this.fakeBackgroundElements=[],this.isFakeBackgroundEnabled=!1}setFakeBackground(){this.removeFakeBackground();const e=window.getSelection();if(!e||e.rangeCount===0)return;const t=e.getRangeAt(0);if(t.collapsed)return;const o=this.collectTextNodes(t);if(o.length===0)return;const i=t.startContainer,a=t.startOffset,c=t.endContainer,d=t.endOffset;if(this.fakeBackgroundElements=[],o.forEach(g=>{var O,L;const v=document.createRange(),y=g===i,b=g===c,x=y?a:0,w=(L=(O=g.textContent)==null?void 0:O.length)!=null?L:0,T=b?d:w;if(x===T)return;v.setStart(g,x),v.setEnd(g,T);const C=this.wrapRangeWithFakeBackground(v);C&&this.fakeBackgroundElements.push(C)}),!this.fakeBackgroundElements.length)return;const h=document.createRange();h.setStartBefore(this.fakeBackgroundElements[0]),h.setEndAfter(this.fakeBackgroundElements[this.fakeBackgroundElements.length-1]),e.removeAllRanges(),e.addRange(h),this.isFakeBackgroundEnabled=!0}collectTextNodes(e){const t=[],{commonAncestorContainer:o}=e;if(o.nodeType===Node.TEXT_NODE)return t.push(o),t;const i=document.createTreeWalker(o,NodeFilter.SHOW_TEXT,{acceptNode:a=>e.intersectsNode(a)&&a.textContent&&a.textContent.length>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});for(;i.nextNode();)t.push(i.currentNode);return t}wrapRangeWithFakeBackground(e){if(e.collapsed)return null;const t=R.make("span","blok-editor__fake-background");t.setAttribute("data-blok-testid","fake-background"),t.setAttribute("data-blok-fake-background","true"),t.setAttribute("data-blok-mutation-free","true"),t.style.backgroundColor="#a8d6ff",t.style.color="inherit",t.style.display="inline",t.style.padding="0",t.style.margin="0";const o=e.extractContents();return o.childNodes.length===0?null:(t.appendChild(o),e.insertNode(t),t)}unwrapFakeBackground(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}save(){this.savedSelectionRange=X.range}restore(){if(!this.savedSelectionRange)return;const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(this.savedSelectionRange))}clearSaved(){this.savedSelectionRange=null}collapseToEnd(){const e=window.getSelection();if(!e||!e.focusNode)return;const t=document.createRange();t.selectNodeContents(e.focusNode),t.collapse(!1),e.removeAllRanges(),e.addRange(t)}findParentTag(e,t,o=10){const i=window.getSelection();if(!i||!i.anchorNode||!i.focusNode)return null;const a=[i.anchorNode,i.focusNode],c=d=>{const h=(g,v)=>{if(v<=0||!g)return null;const y=g.nodeType===Node.ELEMENT_NODE&&g.tagName===e,b=!t||g.classList&&g.classList.contains(t);if(y&&b)return g;if(!g.parentNode)return null;const x=g.parentNode,w=!t||x.classList&&x.classList.contains(t);return x.tagName===e&&w?x:h(x,v-1)};return h(d,o)};for(const d of a){const h=c(d);if(h)return h}return null}expandToTag(e){const t=window.getSelection();if(!t)return;t.removeAllRanges();const o=document.createRange();o.selectNodeContents(e),t.addRange(o)}}const g1=(l,e)=>{const{type:t,target:o,addedNodes:i,removedNodes:a}=l;return l.type==="attributes"&&l.attributeName==="data-blok-empty"?!1:e.contains(o)?!0:t!=="childList"?!1:Array.from(i).some(h=>h===e)?!0:Array.from(a).some(h=>h===e)},Gu="redactor dom changed",Pv="block changed",Mv="fake cursor is about to be toggled",Fv="fake cursor have been set",Go="blok mobile layout toggled",Xu="block-settings-opened",Yu="block-settings-closed",Qu=(l,e)=>{if(!l.conversionConfig)return!1;const t=l.conversionConfig[e];return De(t)||dn(t)},gs=(l,e)=>Qu(l.tool,e),zv=(l,e)=>Object.entries(l).some((([t,o])=>e[t]&&AS(e[t],o))),Hv=async(l,e)=>{const o=(await l.save()).data,i=e.find(a=>a.name===l.name);return i!==void 0&&!Qu(i,"export")?[]:e.reduce((a,c)=>{if(!Qu(c,"import")||c.toolbox===void 0)return a;const d=c.toolbox.filter(h=>{if(lt(h)||h.icon===void 0)return!1;const g=h.data!==void 0;return!(g&&zv(h.data,o)||!g&&c.name===l.name)});return a.push(_t(be({},c),{toolbox:d})),a},[])},jv=(l,e)=>l.mergeable?l.name===e.name?!0:gs(e,"export")&&gs(l,"import"):!1,m1=(l,e)=>{const t=e==null?void 0:e.export;return De(t)?t(l):dn(t)?l[t]:(t!==void 0&&Be("Conversion «export» property must be a string or function. String means key of saved data object to export. Function should export processed string to export."),"")},qv=(l,e,t)=>{const o=e==null?void 0:e.import;return De(o)?o(l,t):dn(o)?{[o]:l}:(o!==void 0&&Be("Conversion «import» property must be a string or function. String means key of tool data to import. Function accepts a imported string and return composed tool data."),{})};var ot=(l=>(l.Default="default",l.Separator="separator",l.Html="html",l))(ot||{}),Dn=(l=>(l.RENDERED="rendered",l.MOVED="moved",l.UPDATED="updated",l.REMOVED="removed",l.ON_PASTE="onPaste",l))(Dn||{});const Ze=class Ze extends Ko{constructor({id:e=CS(),data:t,tool:o,readOnly:i,tunesData:a},c){super(),this.cachedInputs=[],this.lastSavedTunes={},this.toolRenderedElement=null,this.contentElement=null,this.tunesInstances=new Map,this.defaultTunesInstances=new Map,this.readyResolver=null,this.unavailableTunesData={},this.inputIndex=0,this.blokEventBus=null,this.redactorDomChangedCallback=()=>{},this.handleFocus=()=>{this.dropInputsCache(),this.updateCurrentInput()},this.didMutated=(h=void 0)=>{const g=h===void 0,v=h instanceof InputEvent;!g&&!v&&this.detectToolRootChange(h),(g||v?!0:!(h.length>0&&h.every(x=>{const{addedNodes:w,removedNodes:T,target:C}=x;return[...Array.from(w),...Array.from(T),C].every(L=>{var H;const U=R.isElement(L)?L:(H=L.parentElement)!=null?H:null;return U===null?!1:U.closest('[data-blok-mutation-free="true"]')!==null})})))&&(this.dropInputsCache(),this.updateCurrentInput(),this.toggleInputsEmptyMark(),this.call("updated"),this.emit("didMutated",this))},this.ready=new Promise(h=>{this.readyResolver=h}),this.name=o.name,this.id=e,this.settings=o.settings,this.config=this.settings,this.blokEventBus=c||null,this.blockAPI=new On(this),this.lastSavedData=t!=null?t:{},this.lastSavedTunes=a!=null?a:{},this.tool=o,this.toolInstance=o.create(t,this.blockAPI,i),this.tunes=o.tunes,this.composeTunes(a);const d=this.compose();if(d==null)throw new Error(`Tool "${this.name}" did not return a block holder element during render()`);this.holder=d,window.requestIdleCallback(()=>{this.watchBlockMutations(),this.addInputEvents(),this.toggleInputsEmptyMark()})}static get CSS(){return{wrapper:"blok-element",wrapperStretched:"is-stretched",content:"blok-element__content",selected:"is-selected"}}call(e,t){const o=this.toolInstance[e];if(De(o))try{o.call(this.toolInstance,t)}catch(i){const a=i instanceof Error?i.message:String(i);Be(`Error during '${e}' call: ${a}`,"error")}}async mergeWith(e){if(!De(this.toolInstance.merge))throw new Error(`Block tool "${this.name}" does not support merging`);await this.toolInstance.merge(e)}async save(){const e=await this.extractToolData();if(e===void 0)return;const t=be({},this.unavailableTunesData);[...this.tunesInstances.entries(),...this.defaultTunesInstances.entries()].forEach(([a,c])=>{if(De(c.save))try{t[a]=c.save()}catch(d){Be(`Tune ${c.constructor.name} save method throws an Error %o`,"warn",d)}});const o=window.performance.now();this.lastSavedData=e,this.lastSavedTunes=be({},t);const i=window.performance.now();return{id:this.id,tool:this.name,data:e,tunes:t,time:i-o}}async extractToolData(){try{const e=await this.toolInstance.save(this.pluginsContent);if(!this.isEmpty||e===void 0||e===null||typeof e!="object")return e;const t=be({},e),o=i=>{const a=t[i];if(typeof a!="string")return;const c=document.createElement("div");c.innerHTML=a,R.isEmpty(c)&&(t[i]="")};return o("text"),o("html"),t}catch(e){const t=e instanceof Error?e:new Error(String(e));Be(`Saving process for ${this.name} tool failed due to the ${t}`,"log",t);return}}async validate(e){return this.toolInstance.validate instanceof Function?await this.toolInstance.validate(e):!0}getTunes(){const e=[],t=[],o=(c,d)=>{if(c){if(R.isElement(c)){d.push({type:ot.Html,element:c});return}if(Array.isArray(c)){d.push(...c);return}d.push(c)}},i=typeof this.toolInstance.renderSettings=="function"?this.toolInstance.renderSettings():[];return o(i,e),[...this.tunesInstances.values(),...this.defaultTunesInstances.values()].map(c=>c.render()).forEach(c=>{o(c,t)}),{toolTunes:e,commonTunes:t}}updateCurrentInput(){var a;const e=X.anchorNode,t=document.activeElement,o=c=>{if(!c)return;const d=c instanceof HTMLElement?c:c.parentElement;if(d===null)return;const h=this.inputs.find(y=>y===d||y.contains(d));if(h!==void 0)return h;const g=d.closest(R.allInputsSelector);if(!(g instanceof HTMLElement))return;const v=this.inputs.find(y=>y===g);if(v!==void 0)return v};if(R.isNativeInput(t)){this.currentInput=t;return}const i=(a=o(e))!=null?a:t instanceof HTMLElement?o(t):void 0;if(i!==void 0){this.currentInput=i;return}t instanceof HTMLElement&&this.inputs.includes(t)&&(this.currentInput=t)}dispatchChange(){this.didMutated()}destroy(){this.unwatchBlockMutations(),this.removeInputEvents(),super.destroy(),De(this.toolInstance.destroy)&&this.toolInstance.destroy()}async getActiveToolboxEntry(){const e=this.tool.toolbox;if(!e)return;if(e.length===1)return Promise.resolve(e[0]);const t=await this.data;return e.find(o=>zv(o.data,t))}async exportDataAsString(){const e=await this.data;return m1(e,this.tool.conversionConfig)}get inputs(){if(this.cachedInputs.length!==0)return this.cachedInputs;const e=R.findAllInputs(this.holder);return this.inputIndex>e.length-1&&(this.inputIndex=e.length-1),this.cachedInputs=e,e}get currentInput(){return this.inputs[this.inputIndex]}set currentInput(e){if(e===void 0)return;const t=this.inputs.findIndex(o=>o===e||o.contains(e));t!==-1&&(this.inputIndex=t)}get firstInput(){return this.inputs[0]}get lastInput(){const e=this.inputs;return e[e.length-1]}get nextInput(){return this.inputs[this.inputIndex+1]}get previousInput(){return this.inputs[this.inputIndex-1]}get data(){return this.save().then(e=>e&&!lt(e.data)?e.data:{})}get preservedData(){var e;return(e=this.lastSavedData)!=null?e:{}}get preservedTunes(){var e;return(e=this.lastSavedTunes)!=null?e:{}}get sanitize(){return this.tool.sanitizeConfig}get mergeable(){return De(this.toolInstance.merge)}get focusable(){return this.inputs.length!==0}get isEmpty(){const e=R.isEmpty(this.pluginsContent,"/"),t=!this.hasMedia;return e&&t}get hasMedia(){const e=["img","iframe","video","audio","source","input","textarea","twitterwidget"];return!!this.holder.querySelector(e.join(","))}set selected(e){var i,a;if(this.holder.classList.toggle(Ze.CSS.selected,e),this.contentElement){const c=this.stretched?Ze.styles.contentStretched:"";this.contentElement.className=e?Te(Ze.CSS.content,Ze.styles.content,Ze.styles.contentSelected):Te(Ze.CSS.content,Ze.styles.content,c)}e?this.holder.setAttribute("data-blok-selected","true"):this.holder.removeAttribute("data-blok-selected");const t=e===!0&&X.isRangeInsideContainer(this.holder),o=e===!1&&X.isFakeCursorInsideContainer(this.holder);!t&&!o||((i=this.blokEventBus)==null||i.emit(Mv,{state:e}),t&&X.addFakeCursor(),o&&X.removeFakeCursor(this.holder),(a=this.blokEventBus)==null||a.emit(Fv,{state:e}))}get selected(){return this.holder.classList.contains(Ze.CSS.selected)}setStretchState(e){this.holder.classList.toggle(Ze.CSS.wrapperStretched,e),this.contentElement&&!this.selected&&(this.contentElement.className=e?Te(Ze.CSS.content,Ze.styles.content,Ze.styles.contentStretched):Te(Ze.CSS.content,Ze.styles.content))}set stretched(e){this.setStretchState(e)}get stretched(){return this.holder.classList.contains(Ze.CSS.wrapperStretched)}get pluginsContent(){if(this.toolRenderedElement===null)throw new Error("Block pluginsContent is not yet initialized");return this.toolRenderedElement}compose(){var a;const e=R.make("div",Te(Ze.CSS.wrapper,Ze.styles.wrapper)),t=R.make("div",Te(Ze.CSS.content,Ze.styles.content));this.contentElement=t,t.setAttribute("data-blok-testid","block-content");const o=this.toolInstance.render();e.setAttribute("data-blok-testid","block-wrapper"),this.name&&!e.hasAttribute("data-blok-component")&&e.setAttribute("data-blok-component",this.name),e.setAttribute("data-blok-id",this.id),o instanceof Promise?o.then(c=>{var d;this.toolRenderedElement=c,this.addToolDataAttributes(c,e),t.appendChild(c),(d=this.readyResolver)==null||d.call(this)}).catch(c=>{var d;Be("Tool render promise rejected: %o","error",c),(d=this.readyResolver)==null||d.call(this)}):(this.toolRenderedElement=o,this.addToolDataAttributes(o,e),t.appendChild(o),(a=this.readyResolver)==null||a.call(this));const i=[...this.tunesInstances.values(),...this.defaultTunesInstances.values()].reduce((c,d)=>{if(De(d.wrap))try{return d.wrap(c)}catch(h){return Be(`Tune ${d.constructor.name} wrap method throws an Error %o`,"warn",h),c}return c},t);return e.appendChild(i),e}addToolDataAttributes(e,t){var d;this.name&&!t.hasAttribute("data-blok-component")&&t.setAttribute("data-blok-component",this.name);const o="data-blok-placeholder",i=(d=this.config)==null?void 0:d.placeholder,a=typeof i=="string"?i.trim():"",c=["empty:before:pointer-events-none","empty:before:text-gray-text","empty:before:cursor-text","empty:before:content-[attr(data-blok-placeholder)]","[&[data-blok-empty=true]]:before:pointer-events-none","[&[data-blok-empty=true]]:before:text-gray-text","[&[data-blok-empty=true]]:before:cursor-text","[&[data-blok-empty=true]]:before:content-[attr(data-blok-placeholder)]"];if(a.length>0){e.setAttribute(o,a),e.classList.add(...c);return}i===!1&&e.hasAttribute(o)&&e.removeAttribute(o)}composeTunes(e){Array.from(this.tunes.values()).forEach(t=>{(t.isInternal?this.defaultTunesInstances:this.tunesInstances).set(t.name,t.create(e[t.name],this.blockAPI))}),Object.entries(e).forEach(([t,o])=>{this.tunesInstances.has(t)||(this.unavailableTunesData[t]=o)})}addInputEvents(){this.inputs.forEach(e=>{e.addEventListener("focus",this.handleFocus),R.isNativeInput(e)&&e.addEventListener("input",this.didMutated)})}removeInputEvents(){this.inputs.forEach(e=>{e.removeEventListener("focus",this.handleFocus),R.isNativeInput(e)&&e.removeEventListener("input",this.didMutated)})}watchBlockMutations(){var e;this.redactorDomChangedCallback=t=>{const{mutations:o}=t,i=this.toolRenderedElement;if(i===null)return;const a=o.filter(c=>g1(c,i));a.length>0&&this.didMutated(a)},(e=this.blokEventBus)==null||e.on(Gu,this.redactorDomChangedCallback)}unwatchBlockMutations(){var e;(e=this.blokEventBus)==null||e.off(Gu,this.redactorDomChangedCallback)}refreshToolRootElement(){const e=this.holder.querySelector(`.${Ze.CSS.content}`);if(!e)return;const t=e.firstElementChild;t&&t!==this.toolRenderedElement&&(this.toolRenderedElement=t,this.dropInputsCache())}detectToolRootChange(e){const t=this.toolRenderedElement;t!==null&&e.forEach(o=>{if(Array.from(o.removedNodes).includes(t)){const a=o.addedNodes[o.addedNodes.length-1];this.toolRenderedElement=a}})}dropInputsCache(){this.cachedInputs=[]}toggleInputsEmptyMark(){this.inputs.forEach(mv)}};Ze.styles={wrapper:"relative opacity-100 animate-fade-in first:mt-0 [&_a]:cursor-pointer [&_a]:underline [&_a]:text-link [&_b]:font-bold [&_i]:italic",content:"relative mx-auto transition-colors duration-150 ease-out max-w-content",contentSelected:"bg-selection [&_[contenteditable]]:select-none [&_img]:opacity-55 [&_.blok-stub]:opacity-55",contentStretched:"max-w-none"};let Sn=Ze;class v1 extends Ae{constructor(){super(...arguments),this.insert=(e,t={},o={},i,a,c,d)=>{const h=e!=null?e:this.config.defaultBlock,g=this.Blok.BlockManager.insert({id:d,tool:h,data:t,index:i,needToFocus:a,replace:c});return new On(g)},this.composeBlockData=async e=>{const t=this.Blok.Tools.blockTools.get(e);if(t===void 0)throw new Error(`Block Tool with type "${e}" not found`);return new Sn({tool:t,api:this.Blok.API,readOnly:!0,data:{},tunesData:{}}).data},this.update=async(e,t,o)=>{const{BlockManager:i}=this.Blok,a=i.getBlockById(e);if(a===void 0)throw new Error(`Block with id "${e}" not found`);const c=await i.update(a,t,o);return new On(c)},this.convert=async(e,t,o)=>{var y,b;const{BlockManager:i,Tools:a}=this.Blok,c=i.getBlockById(e);if(!c)throw new Error(`Block with id "${e}" not found`);const d=a.blockTools.get(c.name),h=a.blockTools.get(t);if(!h)throw new Error(`Block Tool with type "${t}" not found`);const g=((y=d==null?void 0:d.conversionConfig)==null?void 0:y.export)!==void 0,v=((b=h.conversionConfig)==null?void 0:b.import)!==void 0;if(g&&v){const x=await i.convert(c,t,o);return new On(x)}else{const x=[g?!1:ds(c.name),v?!1:ds(t)].filter(Boolean).join(" and ");throw new Error(`Conversion from "${c.name}" to "${t}" is not possible. ${x} tool(s) should provide a "conversionConfig"`)}},this.insertMany=(e,t=this.Blok.BlockManager.blocks.length-1)=>{this.validateIndex(t);const o=e.map(({id:i,type:a,data:c})=>this.Blok.BlockManager.composeBlock({id:i,tool:a||this.config.defaultBlock,data:c}));return this.Blok.BlockManager.insertMany(o,t),o.map(i=>new On(i))}}get methods(){return{clear:()=>this.clear(),render:e=>this.render(e),renderFromHTML:e=>this.renderFromHTML(e),delete:e=>this.delete(e),move:(e,t)=>this.move(e,t),getBlockByIndex:e=>this.getBlockByIndex(e),getById:e=>this.getById(e),getCurrentBlockIndex:()=>this.getCurrentBlockIndex(),getBlockIndex:e=>this.getBlockIndex(e),getBlocksCount:()=>this.getBlocksCount(),getBlockByElement:e=>this.getBlockByElement(e),insert:this.insert,insertMany:this.insertMany,update:this.update,composeBlockData:this.composeBlockData,convert:this.convert,stretchBlock:(e,t=!0)=>this.stretchBlock(e,t)}}getBlocksCount(){return this.Blok.BlockManager.blocks.length}getCurrentBlockIndex(){return this.Blok.BlockManager.currentBlockIndex}getBlockIndex(e){const t=this.Blok.BlockManager.getBlockById(e);if(!t){Zt("There is no block with id `"+e+"`","warn");return}return this.Blok.BlockManager.getBlockIndex(t)}getBlockByIndex(e){const t=this.Blok.BlockManager.getBlockByIndex(e);if(t===void 0){Zt("There is no block at index `"+e+"`","warn");return}return new On(t)}getById(e){const t=this.Blok.BlockManager.getBlockById(e);return t===void 0?(Zt("There is no block with id `"+e+"`","warn"),null):new On(t)}getBlockByElement(e){const t=this.Blok.BlockManager.getBlock(e);if(t===void 0){Zt("There is no block corresponding to element `"+e+"`","warn");return}return new On(t)}move(e,t){this.Blok.BlockManager.move(e,t)}delete(e=this.Blok.BlockManager.currentBlockIndex){const t=this.Blok.BlockManager.getBlockByIndex(e);if(t===void 0){Zt(`There is no block at index \`${e}\``,"warn");return}try{this.Blok.BlockManager.removeBlock(t)}catch(o){Zt(o,"warn");return}this.Blok.BlockManager.blocks.length===0&&this.Blok.BlockManager.insert(),this.Blok.BlockManager.currentBlock&&this.Blok.Caret.setToBlock(this.Blok.BlockManager.currentBlock,this.Blok.Caret.positions.END),this.Blok.Toolbar.close()}async clear(){await this.Blok.BlockManager.clear(!0),this.Blok.InlineToolbar.close()}async render(e){if(e===void 0||e.blocks===void 0)throw new Error("Incorrect data passed to the render() method");this.Blok.ModificationsObserver.disable(),await this.Blok.BlockManager.clear(),await this.Blok.Renderer.render(e.blocks),this.Blok.ModificationsObserver.enable()}async renderFromHTML(e){return await this.Blok.BlockManager.clear(),this.Blok.Paste.processText(e,!0)}stretchBlock(e,t=!0){const o=this.Blok.BlockManager.getBlockByIndex(e);o&&o.setStretchState(t)}validateIndex(e){if(typeof e!="number")throw new Error("Index should be a number");if(e<0)throw new Error("Index should be greater than or equal to 0");if(e===null)throw new Error("Index should be greater than or equal to 0")}}const y1=(l,e)=>typeof l=="number"?e.BlockManager.getBlockByIndex(l):typeof l=="string"?e.BlockManager.getBlockById(l):e.BlockManager.getBlockById(l.id);class b1 extends Ae{constructor(){super(...arguments),this.setToFirstBlock=(e=this.Blok.Caret.positions.DEFAULT,t=0)=>this.Blok.BlockManager.firstBlock?(this.Blok.Caret.setToBlock(this.Blok.BlockManager.firstBlock,e,t),!0):!1,this.setToLastBlock=(e=this.Blok.Caret.positions.DEFAULT,t=0)=>this.Blok.BlockManager.lastBlock?(this.Blok.Caret.setToBlock(this.Blok.BlockManager.lastBlock,e,t),!0):!1,this.setToPreviousBlock=(e=this.Blok.Caret.positions.DEFAULT,t=0)=>this.Blok.BlockManager.previousBlock?(this.Blok.Caret.setToBlock(this.Blok.BlockManager.previousBlock,e,t),!0):!1,this.setToNextBlock=(e=this.Blok.Caret.positions.DEFAULT,t=0)=>this.Blok.BlockManager.nextBlock?(this.Blok.Caret.setToBlock(this.Blok.BlockManager.nextBlock,e,t),!0):!1,this.setToBlock=(e,t=this.Blok.Caret.positions.DEFAULT,o=0)=>{const i=y1(e,this.Blok);return i===void 0?!1:(this.Blok.Caret.setToBlock(i,t,o),!0)},this.focus=(e=!1)=>e?this.setToLastBlock(this.Blok.Caret.positions.END):this.setToFirstBlock(this.Blok.Caret.positions.START)}get methods(){return{setToFirstBlock:this.setToFirstBlock,setToLastBlock:this.setToLastBlock,setToPreviousBlock:this.setToPreviousBlock,setToNextBlock:this.setToNextBlock,setToBlock:this.setToBlock,focus:this.focus}}}class k1 extends Ae{get methods(){return{emit:(e,t)=>this.emit(e,t),off:(e,t)=>this.off(e,t),on:(e,t)=>this.on(e,t)}}on(e,t){this.eventsDispatcher.on(e,t)}emit(e,t){this.eventsDispatcher.emit(e,t)}off(e,t){this.eventsDispatcher.off(e,t)}}class Zu extends Ae{static getNamespace(e,t){return t?`blockTunes.${e}`:`tools.${e}`}get methods(){return{t:e=>(Zt("I18n.t() method can be accessed only from Tools","warn"),"")}}getMethodsForTool(e,t){return Object.assign(this.methods,{t:o=>Ge.t(Zu.getNamespace(e,t),o)})}}class w1 extends Ae{get methods(){return{blocks:this.Blok.BlocksAPI.methods,caret:this.Blok.CaretAPI.methods,tools:this.Blok.ToolsAPI.methods,events:this.Blok.EventsAPI.methods,listeners:this.Blok.ListenersAPI.methods,notifier:this.Blok.NotifierAPI.methods,sanitizer:this.Blok.SanitizerAPI.methods,saver:this.Blok.SaverAPI.methods,selection:this.Blok.SelectionAPI.methods,styles:this.Blok.StylesAPI.classes,toolbar:this.Blok.ToolbarAPI.methods,inlineToolbar:this.Blok.InlineToolbarAPI.methods,tooltip:this.Blok.TooltipAPI.methods,i18n:this.Blok.I18nAPI.methods,readOnly:this.Blok.ReadOnlyAPI.methods,ui:this.Blok.UiAPI.methods}}getMethodsForTool(e,t){return Object.assign(this.methods,{i18n:this.Blok.I18nAPI.getMethodsForTool(e,t)})}}class T1 extends Ae{get methods(){return{close:()=>this.close(),open:()=>this.open()}}open(){this.Blok.InlineToolbar.tryToShow()}close(){this.Blok.InlineToolbar.close()}}class S1 extends Ae{get methods(){return{on:(e,t,o,i)=>this.on(e,t,o,i),off:(e,t,o,i)=>this.off(e,t,o,i),offById:e=>this.offById(e)}}on(e,t,o,i){return this.listeners.on(e,t,o,i)}off(e,t,o,i){this.listeners.off(e,t,o,i)}offById(e){this.listeners.offById(e)}}class x1{constructor(){this.notifierModule=null,this.loadingPromise=null}loadNotifierModule(){return this.notifierModule!==null?Promise.resolve(this.notifierModule):(this.loadingPromise===null&&(this.loadingPromise=Promise.resolve().then(()=>rE).then(e=>{var o;const t=(o=e==null?void 0:e.default)!=null?o:e;if(!this.isNotifierModule(t))throw new Error('notifier module does not expose a "show" method.');return this.notifierModule=t,t}).catch(e=>{throw this.loadingPromise=null,e})),this.loadingPromise)}show(e){this.loadNotifierModule().then(t=>{t.show(e)}).catch(t=>{console.error("[Blok] Failed to display notification. Reason:",t)})}isNotifierModule(e){return typeof e=="object"&&e!==null&&"show"in e&&typeof e.show=="function"}}class C1 extends Ae{constructor({config:e,eventsDispatcher:t}){super({config:e,eventsDispatcher:t}),this.notifier=new x1}get methods(){return{show:e=>this.show(e)}}show(e){return this.notifier.show(e)}}class E1 extends Ae{get methods(){const e=()=>this.isEnabled;return{toggle:t=>this.toggle(t),get isEnabled(){return e()}}}toggle(e){return this.Blok.ReadOnly.toggle(e)}get isEnabled(){return this.Blok.ReadOnly.isEnabled}}var ms={exports:{}},B1=ms.exports,Uv;function A1(){return Uv||(Uv=1,(function(l,e){(function(t,o){l.exports=o()})(B1,function(){function t(y){var b=y.tags,x=Object.keys(b),w=x.map(function(T){return typeof b[T]}).every(function(T){return T==="object"||T==="boolean"||T==="function"});if(!w)throw new Error("The configuration was invalid");this.config=y}var o=["P","LI","TD","TH","DIV","H1","H2","H3","H4","H5","H6","PRE"];function i(y){return o.indexOf(y.nodeName)!==-1}var a=["A","B","STRONG","I","EM","SUB","SUP","U","STRIKE"];function c(y){return a.indexOf(y.nodeName)!==-1}t.prototype.clean=function(y){const b=document.implementation.createHTMLDocument(),x=b.createElement("div");return x.innerHTML=y,this._sanitize(b,x),x.innerHTML},t.prototype._sanitize=function(y,b){var x=d(y,b),w=x.firstChild();if(w)do{if(w.nodeType===Node.TEXT_NODE)if(w.data.trim()===""&&(w.previousElementSibling&&i(w.previousElementSibling)||w.nextElementSibling&&i(w.nextElementSibling))){b.removeChild(w),this._sanitize(y,b);break}else continue;if(w.nodeType===Node.COMMENT_NODE){b.removeChild(w),this._sanitize(y,b);break}var T=c(w),C;T&&(C=Array.prototype.some.call(w.childNodes,i));var O=!!b.parentNode,L=i(b)&&i(w)&&O,U=w.nodeName.toLowerCase(),H=h(this.config,U,w),Y=T&&C;if(Y||g(w,H)||!this.config.keepNestedBlockElements&&L){if(!(w.nodeName==="SCRIPT"||w.nodeName==="STYLE"))for(;w.childNodes.length>0;)b.insertBefore(w.childNodes[0],w);b.removeChild(w),this._sanitize(y,b);break}for(var q=0;q<w.attributes.length;q+=1){var W=w.attributes[q];v(W,H,w)&&(w.removeAttribute(W.name),q=q-1)}this._sanitize(y,w)}while(w=x.nextSibling())};function d(y,b){return y.createTreeWalker(b,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT,null,!1)}function h(y,b,x){return typeof y.tags[b]=="function"?y.tags[b](x):y.tags[b]}function g(y,b){return typeof b=="undefined"?!0:typeof b=="boolean"?!b:!1}function v(y,b,x){var w=y.name.toLowerCase();return b===!0?!1:typeof b[w]=="function"?!b[w](y.value,x):typeof b[w]=="undefined"||b[w]===!1?!0:typeof b[w]=="string"?b[w]!==y.value:!1}return t})})(ms)),ms.exports}var I1=A1();const _1=Oe(I1),N1=/^\s*(?:javascript\s*:|data\s*:\s*text\s*\/\s*html)/i,R1=/\s*(?:href|src)\s*=\s*(?:"\s*(?:javascript\s*:|data\s*:\s*text\s*\/\s*html)[^"]*"|'\s*(?:javascript\s*:|data\s*:\s*text\s*\/\s*html)[^']*|(?:javascript\s*:|data\s*:\s*text\s*\/\s*html)[^ \t\r\n>]*)/gi,Ju=(l,e,t={})=>l.map(o=>{const i=De(e)?e(o.tool):e,a=i!=null?i:{};return Ue(a)&&lt(a)&&lt(t)?o:_t(be({},o),{data:ed(o.data,a,t)})}),xn=(l,e={})=>{const t={tags:e};return new _1(t).clean(l)},ed=(l,e,t)=>Array.isArray(l)?O1(l,e,t):Ue(l)?L1(l,e,t):dn(l)?D1(l,e,t):l,O1=(l,e,t)=>l.map(o=>ed(o,e,t)),L1=(l,e,t)=>{const o={},i=l;for(const a in l){if(!Object.prototype.hasOwnProperty.call(l,a))continue;const c=i[a],d=Ue(e)?e:void 0,h=d==null?void 0:d[a],g=h!==void 0&&P1(h)?h:e;o[a]=ed(c,g,t)}return o},D1=(l,e,t)=>{const o=q1(e,t);if(o){const i=xn(l,o);return td(Kv(i,o))}if(!lt(t)){const i=xn(l,t);return td(Kv(i,t))}return td(l)},P1=l=>Ue(l)||cv(l)||De(l),M1=l=>l?N1.test(l):!1,td=l=>{if(!l||l.indexOf("<")===-1)return l;if(typeof document!="undefined"){const e=document.createElement("template");return e.innerHTML=l,e.content.querySelectorAll("[href],[src]").forEach(o=>{["href","src"].forEach(i=>{const a=o.getAttribute(i);M1(a)&&o.removeAttribute(i)})}),e.innerHTML}return l.replace(R1,"")},nd=l=>{if(lt(l))return{};const e={};for(const t in l)Object.prototype.hasOwnProperty.call(l,t)&&(e[t]=Cr(l[t]));return e},Wv=l=>function(t){const o=l.call(this,t);return o==null?{}:o},F1=new Set(["class","id","title","role","dir","lang"]),z1=l=>{const e=l.toLowerCase();return e.startsWith("data-")||e.startsWith("aria-")||F1.has(e)},H1=l=>{const e={};return Array.from(l.attributes).forEach(t=>{z1(t.name)&&(e[t.name]=!0)}),e},Cr=l=>l===!0?Wv(H1):l===!1?!1:De(l)?Wv(l):dn(l)?l:Ue(l)?Uo({},l):l,j1=(l,e)=>{if(lt(l))return nd(e);const t={};for(const o in l){if(!Object.prototype.hasOwnProperty.call(l,o))continue;const i=l[o],a=e?e[o]:void 0;if(De(a)){t[o]=Cr(a);continue}if(De(i)){t[o]=Cr(i);continue}if(Ue(i)&&Ue(a)){t[o]=Uo({},a,i);continue}if(a!==void 0){t[o]=Cr(a);continue}t[o]=Cr(i)}return t},q1=(l,e)=>Ue(l)&&!De(l)?j1(e,l):l===!1?{}:lt(e)?null:nd(e),rd=(l,...e)=>{if(lt(l))return Object.assign({},...e);const t=nd(l);return e.forEach(o=>{if(o)for(const i in o){if(!Object.prototype.hasOwnProperty.call(o,i))continue;const a=o[i];if(!Object.prototype.hasOwnProperty.call(t,i))continue;const c=t[i];if(De(a)){t[i]=a;continue}if(!(a===!0&&De(c))){if(a===!0){const d=Ue(c)&&!De(c);t[i]=d?Uo({},c):Cr(a);continue}if(Ue(a)&&Ue(c)){t[i]=Uo({},c,a);continue}t[i]=Cr(a)}}}),t},Kv=(l,e)=>{if(typeof document=="undefined"||!l||l.indexOf("<")===-1)return l;const t=Object.entries(e).filter(([,i])=>De(i));if(t.length===0)return l;const o=document.createElement("template");return o.innerHTML=l,t.forEach(([i,a])=>{o.content.querySelectorAll(i).forEach(d=>{const h=a(d);if(!(cv(h)||De(h)||h==null))for(const[g,v]of Object.entries(h)){if(v===!1){d.removeAttribute(g);continue}v!==!0&&dn(v)&&d.setAttribute(g,v)}})}),o.innerHTML};class U1 extends Ae{get methods(){return{clean:(e,t)=>this.clean(e,t)}}clean(e,t){return xn(e,t)}}class W1 extends Ae{get methods(){return{save:()=>this.save()}}async save(){var a,c;const e="Blok's content can not be saved in read-only mode";if(this.Blok.ReadOnly.isEnabled)throw Zt(e,"warn"),new Error(e);const t=await this.Blok.Saver.save();if(t!==void 0)return t;const o=(c=(a=this.Blok.Saver).getLastSaveError)==null?void 0:c.call(a);if(o instanceof Error)throw o;const i=o!==void 0?String(o):"Blok's content can not be saved because collecting data failed";throw new Error(i)}}class K1 extends Ae{constructor(){super(...arguments),this.selectionUtils=new X}get methods(){return{findParentTag:(e,t)=>this.findParentTag(e,t),expandToTag:e=>this.expandToTag(e),save:()=>this.selectionUtils.save(),restore:()=>this.selectionUtils.restore(),setFakeBackground:()=>this.selectionUtils.setFakeBackground(),removeFakeBackground:()=>this.selectionUtils.removeFakeBackground()}}findParentTag(e,t){return this.selectionUtils.findParentTag(e,t)}expandToTag(e){this.selectionUtils.expandToTag(e)}}class V1 extends Ae{get methods(){return{getBlockTools:()=>Array.from(this.Blok.Tools.blockTools.values())}}}class $1 extends Ae{get classes(){return{block:"py-[theme(spacing.block-padding-vertical)] px-0 [&::-webkit-input-placeholder]:!leading-normal",inlineToolButton:"flex justify-center items-center border-0 rounded h-full p-0 w-7 bg-transparent cursor-pointer leading-normal text-black",inlineToolButtonActive:"bg-icon-active-bg text-icon-active-text",input:"w-full rounded-[3px] border border-line-gray px-3 py-2.5 outline-none shadow-input [&[data-blok-placeholder]]:before:!static [&[data-blok-placeholder]]:before:inline-block [&[data-blok-placeholder]]:before:w-0 [&[data-blok-placeholder]]:before:whitespace-nowrap [&[data-blok-placeholder]]:before:pointer-events-none",loader:"relative border border-line-gray before:absolute before:left-1/2 before:top-1/2 before:w-[18px] before:h-[18px] before:rounded-full before:content-[''] before:-ml-[11px] before:-mt-[11px] before:border-2 before:border-line-gray before:border-l-active-icon before:animate-rotation",button:"p-[13px] rounded-[3px] border border-line-gray text-[14.9px] bg-white text-center cursor-pointer text-gray-text shadow-button-base hover:bg-[#fbfcfe] hover:shadow-button-base-hover [&_svg]:h-5 [&_svg]:mr-[0.2em] [&_svg]:-mt-0.5",settingsButton:"inline-flex items-center justify-center rounded-[3px] cursor-pointer border-0 outline-none bg-transparent align-bottom text-inherit m-0 min-w-toolbox-btn min-h-toolbox-btn [&_svg]:w-auto [&_svg]:h-auto mobile:w-toolbox-btn-mobile mobile:h-toolbox-btn-mobile mobile:rounded-lg mobile:[&_svg]:w-icon-mobile mobile:[&_svg]:h-icon-mobile can-hover:hover:bg-bg-light",settingsButtonActive:"text-active-icon",settingsButtonFocused:"shadow-button-focused bg-item-focus-bg",settingsButtonFocusedAnimated:"animate-button-clicked"}}}class G1 extends Ae{get methods(){return{close:()=>this.close(),open:()=>this.open(),toggleBlockSettings:e=>this.toggleBlockSettings(e),toggleToolbox:e=>this.toggleToolbox(e)}}open(){this.Blok.Toolbar.moveAndOpen()}close(){this.Blok.Toolbar.close()}toggleBlockSettings(e){if(this.Blok.BlockManager.currentBlockIndex===-1){Zt("Could't toggle the Toolbar because there is no block selected ","warn");return}(e!=null?e:!this.Blok.BlockSettings.opened)?(this.Blok.Toolbar.moveAndOpen(),this.Blok.BlockSettings.open()):this.Blok.BlockSettings.close()}toggleToolbox(e){if(this.Blok.BlockManager.currentBlockIndex===-1){Zt("Could't toggle the Toolbox because there is no block selected ","warn");return}(e!=null?e:!this.Blok.Toolbar.toolbox.opened)?(this.Blok.Toolbar.moveAndOpen(),this.Blok.Toolbar.toolbox.open()):this.Blok.Toolbar.toolbox.close()}}const X1=180,Y1=400,ro="data-blok-interface",Q1="blok",Z1="inline-toolbar",od="tooltip",Vv="[data-blok-interface=blok]",$v="[data-blok-interface=inline-toolbar]";typeof process!="undefined"&&process.platform?process.platform==="darwin"?"Meta":"Control":typeof navigator!="undefined"&&navigator.userAgent.toLowerCase().includes("mac")?"Meta":"Control";const id=10,J1="tooltip",ex="aria-hidden",tx="false",nx="true",rx="visibility",ox="visible",ix="hidden",nr=class nr{constructor(){this.nodes={wrapper:null,content:null},this.showed=!1,this.offsetTop=id,this.offsetLeft=id,this.offsetRight=id,this.showingTimeout=null,this.hidingDelay=0,this.hidingTimeout=null,this.ariaObserver=null,this.handleWindowScroll=()=>{this.showed&&this.hide(!0)},this.prepare(),window.addEventListener("scroll",this.handleWindowScroll,{passive:!0})}get CSS(){return{tooltip:kt("absolute z-overlay top-0 left-0","bg-tooltip-bg opacity-0","select-none pointer-events-none","transition-[opacity,transform] duration-[50ms,70ms] ease-in","rounded-lg shadow-tooltip","will-change-[opacity,top,left]","before:content-[''] before:absolute before:inset-0 before:bg-tooltip-bg before:-z-10 before:rounded-lg","mobile:hidden").split(" "),tooltipContent:kt("px-2.5 py-1.5","text-tooltip-font text-xs text-center","tracking-[0.02em] leading-[1em]").split(" "),tooltipShown:["opacity-100","transform-none"],placement:{left:["-translate-x-[5px]"],bottom:["translate-y-[5px]"],right:["translate-x-[5px]"],top:["-translate-y-[5px]"]}}}static getInstance(){return nr.instance||(nr.instance=new nr),nr.instance}show(e,t,o={}){this.nodes.wrapper||this.prepare(),this.hidingTimeout&&(clearTimeout(this.hidingTimeout),this.hidingTimeout=null);const a=Object.assign({placement:"bottom",marginTop:0,marginLeft:0,marginRight:0,marginBottom:0,delay:70,hidingDelay:0},o);if(a.hidingDelay&&(this.hidingDelay=a.hidingDelay),!this.nodes.content||(this.nodes.content.innerHTML="",this.nodes.content.appendChild(this.createContentNode(t)),!this.nodes.wrapper))return;const c=Object.values(this.CSS.placement).flatMap(d=>Array.isArray(d)?d:[d]);switch(this.nodes.wrapper.classList.remove(...c),a.placement){case"top":this.placeTop(e,a);break;case"left":this.placeLeft(e,a);break;case"right":this.placeRight(e,a);break;case"bottom":default:this.placeBottom(e,a);break}if(a&&a.delay){this.showingTimeout=setTimeout(()=>{if(this.nodes.wrapper){const d=Array.isArray(this.CSS.tooltipShown)?this.CSS.tooltipShown:[this.CSS.tooltipShown];this.nodes.wrapper.classList.add(...d),this.updateTooltipVisibility()}this.showed=!0},a.delay);return}if(this.nodes.wrapper){const d=Array.isArray(this.CSS.tooltipShown)?this.CSS.tooltipShown:[this.CSS.tooltipShown];this.nodes.wrapper.classList.add(...d),this.updateTooltipVisibility()}this.showed=!0}createContentNode(e){if(typeof e=="string")return document.createTextNode(e);if(e instanceof Node)return e;throw Error("[Blok Tooltip] Wrong type of «content» passed. It should be an instance of Node or String. But "+typeof e+" given.")}hide(e=!1){const t=!!this.hidingDelay&&!e;if(t&&this.hidingTimeout&&clearTimeout(this.hidingTimeout),t){this.hidingTimeout=setTimeout(()=>{this.hide(!0)},this.hidingDelay);return}if(this.nodes.wrapper){const o=Array.isArray(this.CSS.tooltipShown)?this.CSS.tooltipShown:[this.CSS.tooltipShown];this.nodes.wrapper.classList.remove(...o),this.updateTooltipVisibility()}this.showed=!1,this.showingTimeout&&(clearTimeout(this.showingTimeout),this.showingTimeout=null)}onHover(e,t,o={}){e.addEventListener("mouseenter",()=>{this.show(e,t,o)}),e.addEventListener("mouseleave",()=>{this.hide()})}destroy(){var e;(e=this.ariaObserver)==null||e.disconnect(),this.ariaObserver=null,this.nodes.wrapper&&this.nodes.wrapper.remove(),window.removeEventListener("scroll",this.handleWindowScroll),nr.instance=null}prepare(){this.nodes.wrapper=this.make("div",this.CSS.tooltip),this.nodes.wrapper.setAttribute(ro,od),this.nodes.wrapper.setAttribute("data-blok-testid","tooltip"),this.nodes.content=this.make("div",this.CSS.tooltipContent),this.nodes.content.setAttribute("data-blok-testid","tooltip-content"),this.nodes.wrapper&&this.nodes.content&&(this.append(this.nodes.wrapper,this.nodes.content),this.append(document.body,this.nodes.wrapper),this.ensureTooltipAttributes())}updateTooltipVisibility(){if(!this.nodes.wrapper)return;const e=Array.isArray(this.CSS.tooltipShown)?this.CSS.tooltipShown[0]:this.CSS.tooltipShown,t=this.nodes.wrapper.classList.contains(e);this.nodes.wrapper.style.setProperty(rx,t?ox:ix),this.nodes.wrapper.setAttribute(ex,t?tx:nx),this.nodes.wrapper.setAttribute("data-blok-shown",t?"true":"false")}watchTooltipVisibility(){var e;this.nodes.wrapper&&((e=this.ariaObserver)==null||e.disconnect(),this.updateTooltipVisibility(),this.ariaObserver=new MutationObserver(()=>{this.updateTooltipVisibility()}),this.ariaObserver.observe(this.nodes.wrapper,{attributes:!0,attributeFilter:["class"]}))}ensureTooltipAttributes(){this.nodes.wrapper&&((!this.nodes.wrapper.hasAttribute(ro)||this.nodes.wrapper.getAttribute(ro)!==od)&&this.nodes.wrapper.setAttribute(ro,od),this.nodes.wrapper.setAttribute("role",J1),this.watchTooltipVisibility())}placeBottom(e,t){var c;if(!this.nodes.wrapper)return;const o=e.getBoundingClientRect(),i=o.left+e.clientWidth/2-this.nodes.wrapper.offsetWidth/2,a=o.bottom+this.getScrollTop()+this.offsetTop+((c=t.marginTop)!=null?c:0);this.applyPlacement("bottom",i,a)}placeTop(e,t){if(!this.nodes.wrapper)return;const o=e.getBoundingClientRect(),i=o.left+e.clientWidth/2-this.nodes.wrapper.offsetWidth/2,a=o.top+this.getScrollTop()-this.nodes.wrapper.clientHeight-this.offsetTop;this.applyPlacement("top",i,a)}placeLeft(e,t){var c;if(!this.nodes.wrapper)return;const o=e.getBoundingClientRect(),i=o.left-this.nodes.wrapper.offsetWidth-this.offsetLeft-((c=t.marginLeft)!=null?c:0),a=o.top+this.getScrollTop()+e.clientHeight/2-this.nodes.wrapper.offsetHeight/2;this.applyPlacement("left",i,a)}placeRight(e,t){var c;if(!this.nodes.wrapper)return;const o=e.getBoundingClientRect(),i=o.right+this.offsetRight+((c=t.marginRight)!=null?c:0),a=o.top+this.getScrollTop()+e.clientHeight/2-this.nodes.wrapper.offsetHeight/2;this.applyPlacement("right",i,a)}applyPlacement(e,t,o){if(!this.nodes.wrapper)return;const i=Array.isArray(this.CSS.placement[e])?this.CSS.placement[e]:[this.CSS.placement[e]];this.nodes.wrapper.classList.add(...i),this.nodes.wrapper.setAttribute("data-blok-placement",e),this.nodes.wrapper.style.left=`${t}px`,this.nodes.wrapper.style.top=`${o}px`}getScrollTop(){var e,t,o;return typeof window.scrollY=="number"?window.scrollY:(o=(t=(e=document.documentElement)==null?void 0:e.scrollTop)!=null?t:document.body.scrollTop)!=null?o:0}make(e,t=null,o={}){const i=document.createElement(e);Array.isArray(t)&&i.classList.add(...t),typeof t=="string"&&i.classList.add(t);for(const a in o)Object.prototype.hasOwnProperty.call(o,a)&&(i[a]=o[a]);return i}append(e,t){Array.isArray(t)?t.forEach(o=>e.appendChild(o)):e.appendChild(t)}prepend(e,t){Array.isArray(t)?t.reverse().forEach(i=>e.prepend(i)):e.prepend(t)}};nr.instance=null;let sd=nr;const vs=()=>sd.getInstance(),sx=(l,e,t)=>{vs().show(l,e,t!=null?t:{})},Xo=(l=!1)=>{vs().hide(l)},ys=(l,e,t)=>{vs().onHover(l,e,t!=null?t:{})},lx=()=>{vs().destroy()};class ax extends Ae{constructor({config:e,eventsDispatcher:t}){super({config:e,eventsDispatcher:t})}get methods(){return{show:(e,t,o)=>this.show(e,t,o),hide:()=>this.hide(),onHover:(e,t,o)=>this.onHover(e,t,o)}}show(e,t,o){sx(e,t,o)}hide(){Xo()}onHover(e,t,o){ys(e,t,o)}}class cx extends Ae{get methods(){return{nodes:this.blokNodes}}get blokNodes(){return{wrapper:this.Blok.UI.nodes.wrapper,redactor:this.Blok.UI.nodes.redactor}}}const Gv=(l,e)=>{const t={};return Object.entries(l).forEach(([o,i])=>{if(!Ue(i)){t[o]=i;return}const a=e?`${e}.${o}`:o;if(!Object.values(i).every(d=>dn(d))){t[o]=Gv(i,a);return}t[o]=a}),t},at=Gv(vv),Lr=class Lr{constructor(e,t){this.cursor=-1,this.items=[],this.items=e!=null?e:[],this.focusedCssClass=t}get currentItem(){return this.cursor===-1?null:this.items[this.cursor]}setCursor(e){e<this.items.length&&e>=-1&&(this.dropCursor(),this.cursor=e,this.items[this.cursor].classList.add(this.focusedCssClass),this.items[this.cursor].setAttribute("data-blok-focused","true"))}setItems(e){this.items=e}hasItems(){return this.items.length>0}next(){this.cursor=this.leafNodesAndReturnIndex(Lr.directions.RIGHT)}previous(){this.cursor=this.leafNodesAndReturnIndex(Lr.directions.LEFT)}dropCursor(){this.cursor!==-1&&(this.items[this.cursor].classList.remove(this.focusedCssClass),this.items[this.cursor].removeAttribute("data-blok-focused"),this.cursor=-1)}leafNodesAndReturnIndex(e){if(this.items.length===0)return this.cursor;const t=e===Lr.directions.RIGHT?-1:0,o=this.cursor===-1?t:this.cursor;o!==-1&&(this.items[o].classList.remove(this.focusedCssClass),this.items[o].removeAttribute("data-blok-focused"));const i=e===Lr.directions.RIGHT?(o+1)%this.items.length:(this.items.length+o-1)%this.items.length;return R.canSetCaret(this.items[i])&&us(()=>X.setCursor(this.items[i]),50)(),this.items[i].classList.add(this.focusedCssClass),this.items[i].setAttribute("data-blok-focused","true"),i}};Lr.directions={RIGHT:"right",LEFT:"left"};let Er=Lr;class Qn{constructor(e){var t,o;this.iterator=null,this.activated=!1,this.skipNextTabFocus=!1,this.flipCallbacks=[],this.onKeyDown=i=>{var g;const a=i.target;if(this.shouldSkipTarget(a,i))return;const c=this.getKeyCode(i),d=c===se.LEFT||c===se.RIGHT||c===se.UP||c===se.DOWN;if(!(i.shiftKey&&d||!this.isEventReadyForHandling(i))&&!(c===se.ENTER&&!((g=this.iterator)!=null&&g.currentItem)))switch(i.stopPropagation(),i.stopImmediatePropagation(),c!==null&&Qn.usedKeys.includes(c)&&i.preventDefault(),c){case se.TAB:this.handleTabPress(i);break;case se.LEFT:case se.UP:this.flipLeft();break;case se.RIGHT:case se.DOWN:this.flipRight();break;case se.ENTER:this.handleEnterPress(i);break}},this.iterator=new Er(e.items||[],(t=e.focusedItemClass)!=null?t:""),this.activateCallback=e.activateCallback,this.allowedKeys=e.allowedKeys||Qn.usedKeys,this.handleContentEditableTargets=(o=e.handleContentEditableTargets)!=null?o:!1}get isActivated(){return this.activated}static get usedKeys(){return[se.TAB,se.LEFT,se.RIGHT,se.ENTER,se.UP,se.DOWN]}activate(e,t){var o,i;this.activated=!0,e&&((o=this.iterator)==null||o.setItems(e)),t!==void 0&&((i=this.iterator)==null||i.setCursor(t)),document.addEventListener("keydown",this.onKeyDown,!0),window.addEventListener("keydown",this.onKeyDown,!0)}deactivate(){this.activated=!1,this.dropCursor(),this.skipNextTabFocus=!1,document.removeEventListener("keydown",this.onKeyDown,!0),window.removeEventListener("keydown",this.onKeyDown,!0)}focusFirst(){this.dropCursor(),this.flipRight()}focusItem(e){const t=this.iterator;if(t&&t.hasItems()){if(e<0){t.dropCursor();return}!t.currentItem&&e===0&&(this.skipNextTabFocus=!0),t.setCursor(e)}}flipLeft(){var e;(e=this.iterator)==null||e.previous(),this.flipCallback()}flipRight(){var e;(e=this.iterator)==null||e.next(),this.flipCallback()}hasFocus(){var e;return!!((e=this.iterator)!=null&&e.currentItem)}onFlip(e){this.flipCallbacks.push(e)}removeOnFlip(e){this.flipCallbacks=this.flipCallbacks.filter(t=>t!==e)}dropCursor(){var e;(e=this.iterator)==null||e.dropCursor()}getKeyCode(e){var o;return(o={Tab:se.TAB,Enter:se.ENTER,ArrowLeft:se.LEFT,ArrowRight:se.RIGHT,ArrowUp:se.UP,ArrowDown:se.DOWN}[e.key])!=null?o:null}isEventReadyForHandling(e){const t=this.getKeyCode(e);return this.activated&&t!==null&&this.allowedKeys.includes(t)}setHandleContentEditableTargets(e){this.handleContentEditableTargets=e}handleTabPress(e){const o=e.shiftKey?Er.directions.LEFT:Er.directions.RIGHT;if(this.skipNextTabFocus){this.skipNextTabFocus=!1;return}switch(o){case Er.directions.RIGHT:this.flipRight();break;case Er.directions.LEFT:this.flipLeft();break}}handleExternalKeydown(e){this.onKeyDown(e)}handleEnterPress(e){var t,o;this.activated&&((t=this.iterator)!=null&&t.currentItem&&(e.stopPropagation(),e.preventDefault(),this.iterator.currentItem.click()),De(this.activateCallback)&&((o=this.iterator)!=null&&o.currentItem)&&this.activateCallback(this.iterator.currentItem))}flipCallback(){var e,t,o;(e=this.iterator)!=null&&e.currentItem&&((o=(t=this.iterator.currentItem).scrollIntoViewIfNeeded)==null||o.call(t)),this.flipCallbacks.forEach(i=>i())}shouldSkipTarget(e,t){if(!e)return!1;const o=e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement,i=e.getAttribute("data-blok-flipper-tab-target")==="true"&&t.key==="Tab",a=e.isContentEditable,c=e.closest('[data-blok-link-tool-input-opened="true"]')!==null,d=a&&!this.handleContentEditableTargets;return o&&!i||d||c}}var ld={exports:{}},Yo={},ad={exports:{}},Se={};var Xv;function ux(){if(Xv)return Se;Xv=1;var l=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.iterator;function b(A){return A===null||typeof A!="object"?null:(A=y&&A[y]||A["@@iterator"],typeof A=="function"?A:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,T={};function C(A,P,le){this.props=A,this.context=P,this.refs=T,this.updater=le||x}C.prototype.isReactComponent={},C.prototype.setState=function(A,P){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,P,"setState")},C.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function O(){}O.prototype=C.prototype;function L(A,P,le){this.props=A,this.context=P,this.refs=T,this.updater=le||x}var U=L.prototype=new O;U.constructor=L,w(U,C.prototype),U.isPureReactComponent=!0;var H=Array.isArray,Y=Object.prototype.hasOwnProperty,q={current:null},W={key:!0,ref:!0,__self:!0,__source:!0};function F(A,P,le){var fe,Ce={},Ne=null,me=null;if(P!=null)for(fe in P.ref!==void 0&&(me=P.ref),P.key!==void 0&&(Ne=""+P.key),P)Y.call(P,fe)&&!W.hasOwnProperty(fe)&&(Ce[fe]=P[fe]);var Pe=arguments.length-2;if(Pe===1)Ce.children=le;else if(1<Pe){for(var He=Array(Pe),mt=0;mt<Pe;mt++)He[mt]=arguments[mt+2];Ce.children=He}if(A&&A.defaultProps)for(fe in Pe=A.defaultProps,Pe)Ce[fe]===void 0&&(Ce[fe]=Pe[fe]);return{$$typeof:l,type:A,key:Ne,ref:me,props:Ce,_owner:q.current}}function re(A,P){return{$$typeof:l,type:A.type,key:P,ref:A.ref,props:A.props,_owner:A._owner}}function ce(A){return typeof A=="object"&&A!==null&&A.$$typeof===l}function Z(A){var P={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(le){return P[le]})}var ye=/\/+/g;function J(A,P){return typeof A=="object"&&A!==null&&A.key!=null?Z(""+A.key):P.toString(36)}function we(A,P,le,fe,Ce){var Ne=typeof A;(Ne==="undefined"||Ne==="boolean")&&(A=null);var me=!1;if(A===null)me=!0;else switch(Ne){case"string":case"number":me=!0;break;case"object":switch(A.$$typeof){case l:case e:me=!0}}if(me)return me=A,Ce=Ce(me),A=fe===""?"."+J(me,0):fe,H(Ce)?(le="",A!=null&&(le=A.replace(ye,"$&/")+"/"),we(Ce,P,le,"",function(mt){return mt})):Ce!=null&&(ce(Ce)&&(Ce=re(Ce,le+(!Ce.key||me&&me.key===Ce.key?"":(""+Ce.key).replace(ye,"$&/")+"/")+A)),P.push(Ce)),1;if(me=0,fe=fe===""?".":fe+":",H(A))for(var Pe=0;Pe<A.length;Pe++){Ne=A[Pe];var He=fe+J(Ne,Pe);me+=we(Ne,P,le,He,Ce)}else if(He=b(A),typeof He=="function")for(A=He.call(A),Pe=0;!(Ne=A.next()).done;)Ne=Ne.value,He=fe+J(Ne,Pe++),me+=we(Ne,P,le,He,Ce);else if(Ne==="object")throw P=String(A),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.");return me}function Re(A,P,le){if(A==null)return A;var fe=[],Ce=0;return we(A,fe,"","",function(Ne){return P.call(le,Ne,Ce++)}),fe}function xe(A){if(A._status===-1){var P=A._result;P=P(),P.then(function(le){(A._status===0||A._status===-1)&&(A._status=1,A._result=le)},function(le){(A._status===0||A._status===-1)&&(A._status=2,A._result=le)}),A._status===-1&&(A._status=0,A._result=P)}if(A._status===1)return A._result.default;throw A._result}var _e={current:null},D={transition:null},ae={ReactCurrentDispatcher:_e,ReactCurrentBatchConfig:D,ReactCurrentOwner:q};function G(){throw Error("act(...) is not supported in production builds of React.")}return Se.Children={map:Re,forEach:function(A,P,le){Re(A,function(){P.apply(this,arguments)},le)},count:function(A){var P=0;return Re(A,function(){P++}),P},toArray:function(A){return Re(A,function(P){return P})||[]},only:function(A){if(!ce(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},Se.Component=C,Se.Fragment=t,Se.Profiler=i,Se.PureComponent=L,Se.StrictMode=o,Se.Suspense=h,Se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ae,Se.act=G,Se.cloneElement=function(A,P,le){if(A==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+A+".");var fe=w({},A.props),Ce=A.key,Ne=A.ref,me=A._owner;if(P!=null){if(P.ref!==void 0&&(Ne=P.ref,me=q.current),P.key!==void 0&&(Ce=""+P.key),A.type&&A.type.defaultProps)var Pe=A.type.defaultProps;for(He in P)Y.call(P,He)&&!W.hasOwnProperty(He)&&(fe[He]=P[He]===void 0&&Pe!==void 0?Pe[He]:P[He])}var He=arguments.length-2;if(He===1)fe.children=le;else if(1<He){Pe=Array(He);for(var mt=0;mt<He;mt++)Pe[mt]=arguments[mt+2];fe.children=Pe}return{$$typeof:l,type:A.type,key:Ce,ref:Ne,props:fe,_owner:me}},Se.createContext=function(A){return A={$$typeof:c,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},A.Provider={$$typeof:a,_context:A},A.Consumer=A},Se.createElement=F,Se.createFactory=function(A){var P=F.bind(null,A);return P.type=A,P},Se.createRef=function(){return{current:null}},Se.forwardRef=function(A){return{$$typeof:d,render:A}},Se.isValidElement=ce,Se.lazy=function(A){return{$$typeof:v,_payload:{_status:-1,_result:A},_init:xe}},Se.memo=function(A,P){return{$$typeof:g,type:A,compare:P===void 0?null:P}},Se.startTransition=function(A){var P=D.transition;D.transition={};try{A()}finally{D.transition=P}},Se.unstable_act=G,Se.useCallback=function(A,P){return _e.current.useCallback(A,P)},Se.useContext=function(A){return _e.current.useContext(A)},Se.useDebugValue=function(){},Se.useDeferredValue=function(A){return _e.current.useDeferredValue(A)},Se.useEffect=function(A,P){return _e.current.useEffect(A,P)},Se.useId=function(){return _e.current.useId()},Se.useImperativeHandle=function(A,P,le){return _e.current.useImperativeHandle(A,P,le)},Se.useInsertionEffect=function(A,P){return _e.current.useInsertionEffect(A,P)},Se.useLayoutEffect=function(A,P){return _e.current.useLayoutEffect(A,P)},Se.useMemo=function(A,P){return _e.current.useMemo(A,P)},Se.useReducer=function(A,P,le){return _e.current.useReducer(A,P,le)},Se.useRef=function(A){return _e.current.useRef(A)},Se.useState=function(A){return _e.current.useState(A)},Se.useSyncExternalStore=function(A,P,le){return _e.current.useSyncExternalStore(A,P,le)},Se.useTransition=function(){return _e.current.useTransition()},Se.version="18.3.1",Se}var Yv;function Qv(){return Yv||(Yv=1,ad.exports=ux()),ad.exports}var Zv;function dx(){if(Zv)return Yo;Zv=1;var l=Qv(),e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function c(d,h,g){var v,y={},b=null,x=null;g!==void 0&&(b=""+g),h.key!==void 0&&(b=""+h.key),h.ref!==void 0&&(x=h.ref);for(v in h)o.call(h,v)&&!a.hasOwnProperty(v)&&(y[v]=h[v]);if(d&&d.defaultProps)for(v in h=d.defaultProps,h)y[v]===void 0&&(y[v]=h[v]);return{$$typeof:e,type:d,key:b,ref:x,props:y,_owner:i.current}}return Yo.Fragment=t,Yo.jsx=c,Yo.jsxs=c,Yo}var Jv;function fx(){return Jv||(Jv=1,ld.exports=dx()),ld.exports}var Pn=fx(),bs={},cd={exports:{}},Pt={},ud={exports:{}},dd={};var ey;function hx(){return ey||(ey=1,(function(l){function e(D,ae){var G=D.length;D.push(ae);e:for(;0<G;){var A=G-1>>>1,P=D[A];if(0<i(P,ae))D[A]=ae,D[G]=P,G=A;else break e}}function t(D){return D.length===0?null:D[0]}function o(D){if(D.length===0)return null;var ae=D[0],G=D.pop();if(G!==ae){D[0]=G;e:for(var A=0,P=D.length,le=P>>>1;A<le;){var fe=2*(A+1)-1,Ce=D[fe],Ne=fe+1,me=D[Ne];if(0>i(Ce,G))Ne<P&&0>i(me,Ce)?(D[A]=me,D[Ne]=G,A=Ne):(D[A]=Ce,D[fe]=G,A=fe);else if(Ne<P&&0>i(me,G))D[A]=me,D[Ne]=G,A=Ne;else break e}}return ae}function i(D,ae){var G=D.sortIndex-ae.sortIndex;return G!==0?G:D.id-ae.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;l.unstable_now=function(){return a.now()}}else{var c=Date,d=c.now();l.unstable_now=function(){return c.now()-d}}var h=[],g=[],v=1,y=null,b=3,x=!1,w=!1,T=!1,C=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate!="undefined"?setImmediate:null;typeof navigator!="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function U(D){for(var ae=t(g);ae!==null;){if(ae.callback===null)o(g);else if(ae.startTime<=D)o(g),ae.sortIndex=ae.expirationTime,e(h,ae);else break;ae=t(g)}}function H(D){if(T=!1,U(D),!w)if(t(h)!==null)w=!0,xe(Y);else{var ae=t(g);ae!==null&&_e(H,ae.startTime-D)}}function Y(D,ae){w=!1,T&&(T=!1,O(F),F=-1),x=!0;var G=b;try{for(U(ae),y=t(h);y!==null&&(!(y.expirationTime>ae)||D&&!Z());){var A=y.callback;if(typeof A=="function"){y.callback=null,b=y.priorityLevel;var P=A(y.expirationTime<=ae);ae=l.unstable_now(),typeof P=="function"?y.callback=P:y===t(h)&&o(h),U(ae)}else o(h);y=t(h)}if(y!==null)var le=!0;else{var fe=t(g);fe!==null&&_e(H,fe.startTime-ae),le=!1}return le}finally{y=null,b=G,x=!1}}var q=!1,W=null,F=-1,re=5,ce=-1;function Z(){return!(l.unstable_now()-ce<re)}function ye(){if(W!==null){var D=l.unstable_now();ce=D;var ae=!0;try{ae=W(!0,D)}finally{ae?J():(q=!1,W=null)}}else q=!1}var J;if(typeof L=="function")J=function(){L(ye)};else if(typeof MessageChannel!="undefined"){var we=new MessageChannel,Re=we.port2;we.port1.onmessage=ye,J=function(){Re.postMessage(null)}}else J=function(){C(ye,0)};function xe(D){W=D,q||(q=!0,J())}function _e(D,ae){F=C(function(){D(l.unstable_now())},ae)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(D){D.callback=null},l.unstable_continueExecution=function(){w||x||(w=!0,xe(Y))},l.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):re=0<D?Math.floor(1e3/D):5},l.unstable_getCurrentPriorityLevel=function(){return b},l.unstable_getFirstCallbackNode=function(){return t(h)},l.unstable_next=function(D){switch(b){case 1:case 2:case 3:var ae=3;break;default:ae=b}var G=b;b=ae;try{return D()}finally{b=G}},l.unstable_pauseExecution=function(){},l.unstable_requestPaint=function(){},l.unstable_runWithPriority=function(D,ae){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var G=b;b=D;try{return ae()}finally{b=G}},l.unstable_scheduleCallback=function(D,ae,G){var A=l.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?A+G:A):G=A,D){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=G+P,D={id:v++,callback:ae,priorityLevel:D,startTime:G,expirationTime:P,sortIndex:-1},G>A?(D.sortIndex=G,e(g,D),t(h)===null&&D===t(g)&&(T?(O(F),F=-1):T=!0,_e(H,G-A))):(D.sortIndex=P,e(h,D),w||x||(w=!0,xe(Y))),D},l.unstable_shouldYield=Z,l.unstable_wrapCallback=function(D){var ae=b;return function(){var G=b;b=ae;try{return D.apply(this,arguments)}finally{b=G}}}})(dd)),dd}var ty;function px(){return ty||(ty=1,ud.exports=hx()),ud.exports}var ny;function gx(){if(ny)return Pt;ny=1;var l=Qv(),e=px();function t(n){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+n,s=1;s<arguments.length;s++)r+="&args[]="+encodeURIComponent(arguments[s]);return"Minified React error #"+n+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,i={};function a(n,r){c(n,r),c(n+"Capture",r)}function c(n,r){for(i[n]=r,n=0;n<r.length;n++)o.add(r[n])}var d=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),h=Object.prototype.hasOwnProperty,g=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,v={},y={};function b(n){return h.call(y,n)?!0:h.call(v,n)?!1:g.test(n)?y[n]=!0:(v[n]=!0,!1)}function x(n,r,s,u){if(s!==null&&s.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return u?!1:s!==null?!s.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function w(n,r,s,u){if(r===null||typeof r=="undefined"||x(n,r,s,u))return!0;if(u)return!1;if(s!==null)switch(s.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function T(n,r,s,u,f,p,m){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=u,this.attributeNamespace=f,this.mustUseProperty=s,this.propertyName=n,this.type=r,this.sanitizeURL=p,this.removeEmptyString=m}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){C[n]=new T(n,0,!1,n,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var r=n[0];C[r]=new T(r,1,!1,n[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(n){C[n]=new T(n,2,!1,n.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){C[n]=new T(n,2,!1,n,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){C[n]=new T(n,3,!1,n.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(n){C[n]=new T(n,3,!0,n,null,!1,!1)}),["capture","download"].forEach(function(n){C[n]=new T(n,4,!1,n,null,!1,!1)}),["cols","rows","size","span"].forEach(function(n){C[n]=new T(n,6,!1,n,null,!1,!1)}),["rowSpan","start"].forEach(function(n){C[n]=new T(n,5,!1,n.toLowerCase(),null,!1,!1)});var O=/[\-:]([a-z])/g;function L(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var r=n.replace(O,L);C[r]=new T(r,1,!1,n,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var r=n.replace(O,L);C[r]=new T(r,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(n){var r=n.replace(O,L);C[r]=new T(r,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(n){C[n]=new T(n,1,!1,n.toLowerCase(),null,!1,!1)}),C.xlinkHref=new T("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(n){C[n]=new T(n,1,!1,n.toLowerCase(),null,!0,!0)});function U(n,r,s,u){var f=C.hasOwnProperty(r)?C[r]:null;(f!==null?f.type!==0:u||!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(w(r,s,f,u)&&(s=null),u||f===null?b(r)&&(s===null?n.removeAttribute(r):n.setAttribute(r,""+s)):f.mustUseProperty?n[f.propertyName]=s===null?f.type===3?!1:"":s:(r=f.attributeName,u=f.attributeNamespace,s===null?n.removeAttribute(r):(f=f.type,s=f===3||f===4&&s===!0?"":""+s,u?n.setAttributeNS(u,r,s):n.setAttribute(r,s))))}var H=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Y=Symbol.for("react.element"),q=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),re=Symbol.for("react.profiler"),ce=Symbol.for("react.provider"),Z=Symbol.for("react.context"),ye=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),we=Symbol.for("react.suspense_list"),Re=Symbol.for("react.memo"),xe=Symbol.for("react.lazy"),_e=Symbol.for("react.offscreen"),D=Symbol.iterator;function ae(n){return n===null||typeof n!="object"?null:(n=D&&n[D]||n["@@iterator"],typeof n=="function"?n:null)}var G=Object.assign,A;function P(n){if(A===void 0)try{throw Error()}catch(s){var r=s.stack.trim().match(/\n( *(at )?)/);A=r&&r[1]||""}return`
11
+ `+A+n}var le=!1;function fe(n,r){if(!n||le)return"";le=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(r)if(r=function(){throw Error()},Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(r,[])}catch(N){var u=N}Reflect.construct(n,[],r)}else{try{r.call()}catch(N){u=N}n.call(r.prototype)}else{try{throw Error()}catch(N){u=N}n()}}catch(N){if(N&&u&&typeof N.stack=="string"){for(var f=N.stack.split(`
12
+ `),p=u.stack.split(`
13
+ `),m=f.length-1,k=p.length-1;1<=m&&0<=k&&f[m]!==p[k];)k--;for(;1<=m&&0<=k;m--,k--)if(f[m]!==p[k]){if(m!==1||k!==1)do if(m--,k--,0>k||f[m]!==p[k]){var S=`
14
+ `+f[m].replace(" at new "," at ");return n.displayName&&S.includes("<anonymous>")&&(S=S.replace("<anonymous>",n.displayName)),S}while(1<=m&&0<=k);break}}}finally{le=!1,Error.prepareStackTrace=s}return(n=n?n.displayName||n.name:"")?P(n):""}function Ce(n){switch(n.tag){case 5:return P(n.type);case 16:return P("Lazy");case 13:return P("Suspense");case 19:return P("SuspenseList");case 0:case 2:case 15:return n=fe(n.type,!1),n;case 11:return n=fe(n.type.render,!1),n;case 1:return n=fe(n.type,!0),n;default:return""}}function Ne(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case W:return"Fragment";case q:return"Portal";case re:return"Profiler";case F:return"StrictMode";case J:return"Suspense";case we:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case Z:return(n.displayName||"Context")+".Consumer";case ce:return(n._context.displayName||"Context")+".Provider";case ye:var r=n.render;return n=n.displayName,n||(n=r.displayName||r.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case Re:return r=n.displayName||null,r!==null?r:Ne(n.type)||"Memo";case xe:r=n._payload,n=n._init;try{return Ne(n(r))}catch(s){}}return null}function me(n){var r=n.type;switch(n.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=r.render,n=n.displayName||n.name||"",r.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ne(r);case 8:return r===F?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function Pe(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function He(n){var r=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function mt(n){var r=He(n)?"checked":"value",s=Object.getOwnPropertyDescriptor(n.constructor.prototype,r),u=""+n[r];if(!n.hasOwnProperty(r)&&typeof s!="undefined"&&typeof s.get=="function"&&typeof s.set=="function"){var f=s.get,p=s.set;return Object.defineProperty(n,r,{configurable:!0,get:function(){return f.call(this)},set:function(m){u=""+m,p.call(this,m)}}),Object.defineProperty(n,r,{enumerable:s.enumerable}),{getValue:function(){return u},setValue:function(m){u=""+m},stopTracking:function(){n._valueTracker=null,delete n[r]}}}}function rr(n){n._valueTracker||(n._valueTracker=mt(n))}function Fr(n){if(!n)return!1;var r=n._valueTracker;if(!r)return!0;var s=r.getValue(),u="";return n&&(u=He(n)?n.checked?"true":"false":n.value),n=u,n!==s?(r.setValue(n),!0):!1}function Vs(n){if(n=n||(typeof document!="undefined"?document:void 0),typeof n=="undefined")return null;try{return n.activeElement||n.body}catch(r){return n.body}}function of(n,r){var s=r.checked;return G({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s!=null?s:n._wrapperState.initialChecked})}function Qy(n,r){var s=r.defaultValue==null?"":r.defaultValue,u=r.checked!=null?r.checked:r.defaultChecked;s=Pe(r.value!=null?r.value:s),n._wrapperState={initialChecked:u,initialValue:s,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function Zy(n,r){r=r.checked,r!=null&&U(n,"checked",r,!1)}function sf(n,r){Zy(n,r);var s=Pe(r.value),u=r.type;if(s!=null)u==="number"?(s===0&&n.value===""||n.value!=s)&&(n.value=""+s):n.value!==""+s&&(n.value=""+s);else if(u==="submit"||u==="reset"){n.removeAttribute("value");return}r.hasOwnProperty("value")?lf(n,r.type,s):r.hasOwnProperty("defaultValue")&&lf(n,r.type,Pe(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(n.defaultChecked=!!r.defaultChecked)}function Jy(n,r,s){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var u=r.type;if(!(u!=="submit"&&u!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+n._wrapperState.initialValue,s||r===n.value||(n.value=r),n.defaultValue=r}s=n.name,s!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,s!==""&&(n.name=s)}function lf(n,r,s){(r!=="number"||Vs(n.ownerDocument)!==n)&&(s==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+s&&(n.defaultValue=""+s))}var hi=Array.isArray;function ho(n,r,s,u){if(n=n.options,r){r={};for(var f=0;f<s.length;f++)r["$"+s[f]]=!0;for(s=0;s<n.length;s++)f=r.hasOwnProperty("$"+n[s].value),n[s].selected!==f&&(n[s].selected=f),f&&u&&(n[s].defaultSelected=!0)}else{for(s=""+Pe(s),r=null,f=0;f<n.length;f++){if(n[f].value===s){n[f].selected=!0,u&&(n[f].defaultSelected=!0);return}r!==null||n[f].disabled||(r=n[f])}r!==null&&(r.selected=!0)}}function af(n,r){if(r.dangerouslySetInnerHTML!=null)throw Error(t(91));return G({},r,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function eb(n,r){var s=r.value;if(s==null){if(s=r.children,r=r.defaultValue,s!=null){if(r!=null)throw Error(t(92));if(hi(s)){if(1<s.length)throw Error(t(93));s=s[0]}r=s}r==null&&(r=""),s=r}n._wrapperState={initialValue:Pe(s)}}function tb(n,r){var s=Pe(r.value),u=Pe(r.defaultValue);s!=null&&(s=""+s,s!==n.value&&(n.value=s),r.defaultValue==null&&n.defaultValue!==s&&(n.defaultValue=s)),u!=null&&(n.defaultValue=""+u)}function nb(n){var r=n.textContent;r===n._wrapperState.initialValue&&r!==""&&r!==null&&(n.value=r)}function rb(n){switch(n){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function cf(n,r){return n==null||n==="http://www.w3.org/1999/xhtml"?rb(r):n==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var $s,ob=(function(n){return typeof MSApp!="undefined"&&MSApp.execUnsafeLocalFunction?function(r,s,u,f){MSApp.execUnsafeLocalFunction(function(){return n(r,s,u,f)})}:n})(function(n,r){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=r;else{for($s=$s||document.createElement("div"),$s.innerHTML="<svg>"+r.valueOf().toString()+"</svg>",r=$s.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;r.firstChild;)n.appendChild(r.firstChild)}});function pi(n,r){if(r){var s=n.firstChild;if(s&&s===n.lastChild&&s.nodeType===3){s.nodeValue=r;return}}n.textContent=r}var gi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},oE=["Webkit","ms","Moz","O"];Object.keys(gi).forEach(function(n){oE.forEach(function(r){r=r+n.charAt(0).toUpperCase()+n.substring(1),gi[r]=gi[n]})});function ib(n,r,s){return r==null||typeof r=="boolean"||r===""?"":s||typeof r!="number"||r===0||gi.hasOwnProperty(n)&&gi[n]?(""+r).trim():r+"px"}function sb(n,r){n=n.style;for(var s in r)if(r.hasOwnProperty(s)){var u=s.indexOf("--")===0,f=ib(s,r[s],u);s==="float"&&(s="cssFloat"),u?n.setProperty(s,f):n[s]=f}}var iE=G({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function uf(n,r){if(r){if(iE[n]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(t(137,n));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(t(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(t(61))}if(r.style!=null&&typeof r.style!="object")throw Error(t(62))}}function df(n,r){if(n.indexOf("-")===-1)return typeof r.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ff=null;function hf(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var pf=null,po=null,go=null;function lb(n){if(n=Mi(n)){if(typeof pf!="function")throw Error(t(280));var r=n.stateNode;r&&(r=ml(r),pf(n.stateNode,n.type,r))}}function ab(n){po?go?go.push(n):go=[n]:po=n}function cb(){if(po){var n=po,r=go;if(go=po=null,lb(n),r)for(n=0;n<r.length;n++)lb(r[n])}}function ub(n,r){return n(r)}function db(){}var gf=!1;function fb(n,r,s){if(gf)return n(r,s);gf=!0;try{return ub(n,r,s)}finally{gf=!1,(po!==null||go!==null)&&(db(),cb())}}function mi(n,r){var s=n.stateNode;if(s===null)return null;var u=ml(s);if(u===null)return null;s=u[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(n=n.type,u=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!u;break e;default:n=!1}if(n)return null;if(s&&typeof s!="function")throw Error(t(231,r,typeof s));return s}var mf=!1;if(d)try{var vi={};Object.defineProperty(vi,"passive",{get:function(){mf=!0}}),window.addEventListener("test",vi,vi),window.removeEventListener("test",vi,vi)}catch(n){mf=!1}function sE(n,r,s,u,f,p,m,k,S){var N=Array.prototype.slice.call(arguments,3);try{r.apply(s,N)}catch(z){this.onError(z)}}var yi=!1,Gs=null,Xs=!1,vf=null,lE={onError:function(n){yi=!0,Gs=n}};function aE(n,r,s,u,f,p,m,k,S){yi=!1,Gs=null,sE.apply(lE,arguments)}function cE(n,r,s,u,f,p,m,k,S){if(aE.apply(this,arguments),yi){if(yi){var N=Gs;yi=!1,Gs=null}else throw Error(t(198));Xs||(Xs=!0,vf=N)}}function zr(n){var r=n,s=n;if(n.alternate)for(;r.return;)r=r.return;else{n=r;do r=n,(r.flags&4098)!==0&&(s=r.return),n=r.return;while(n)}return r.tag===3?s:null}function hb(n){if(n.tag===13){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function pb(n){if(zr(n)!==n)throw Error(t(188))}function uE(n){var r=n.alternate;if(!r){if(r=zr(n),r===null)throw Error(t(188));return r!==n?null:n}for(var s=n,u=r;;){var f=s.return;if(f===null)break;var p=f.alternate;if(p===null){if(u=f.return,u!==null){s=u;continue}break}if(f.child===p.child){for(p=f.child;p;){if(p===s)return pb(f),n;if(p===u)return pb(f),r;p=p.sibling}throw Error(t(188))}if(s.return!==u.return)s=f,u=p;else{for(var m=!1,k=f.child;k;){if(k===s){m=!0,s=f,u=p;break}if(k===u){m=!0,u=f,s=p;break}k=k.sibling}if(!m){for(k=p.child;k;){if(k===s){m=!0,s=p,u=f;break}if(k===u){m=!0,u=p,s=f;break}k=k.sibling}if(!m)throw Error(t(189))}}if(s.alternate!==u)throw Error(t(190))}if(s.tag!==3)throw Error(t(188));return s.stateNode.current===s?n:r}function gb(n){return n=uE(n),n!==null?mb(n):null}function mb(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var r=mb(n);if(r!==null)return r;n=n.sibling}return null}var vb=e.unstable_scheduleCallback,yb=e.unstable_cancelCallback,dE=e.unstable_shouldYield,fE=e.unstable_requestPaint,it=e.unstable_now,hE=e.unstable_getCurrentPriorityLevel,yf=e.unstable_ImmediatePriority,bb=e.unstable_UserBlockingPriority,Ys=e.unstable_NormalPriority,pE=e.unstable_LowPriority,kb=e.unstable_IdlePriority,Qs=null,Bn=null;function gE(n){if(Bn&&typeof Bn.onCommitFiberRoot=="function")try{Bn.onCommitFiberRoot(Qs,n,void 0,(n.current.flags&128)===128)}catch(r){}}var pn=Math.clz32?Math.clz32:yE,mE=Math.log,vE=Math.LN2;function yE(n){return n>>>=0,n===0?32:31-(mE(n)/vE|0)|0}var Zs=64,Js=4194304;function bi(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function el(n,r){var s=n.pendingLanes;if(s===0)return 0;var u=0,f=n.suspendedLanes,p=n.pingedLanes,m=s&268435455;if(m!==0){var k=m&~f;k!==0?u=bi(k):(p&=m,p!==0&&(u=bi(p)))}else m=s&~f,m!==0?u=bi(m):p!==0&&(u=bi(p));if(u===0)return 0;if(r!==0&&r!==u&&(r&f)===0&&(f=u&-u,p=r&-r,f>=p||f===16&&(p&4194240)!==0))return r;if((u&4)!==0&&(u|=s&16),r=n.entangledLanes,r!==0)for(n=n.entanglements,r&=u;0<r;)s=31-pn(r),f=1<<s,u|=n[s],r&=~f;return u}function bE(n,r){switch(n){case 1:case 2:case 4:return r+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function kE(n,r){for(var s=n.suspendedLanes,u=n.pingedLanes,f=n.expirationTimes,p=n.pendingLanes;0<p;){var m=31-pn(p),k=1<<m,S=f[m];S===-1?((k&s)===0||(k&u)!==0)&&(f[m]=bE(k,r)):S<=r&&(n.expiredLanes|=k),p&=~k}}function bf(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function wb(){var n=Zs;return Zs<<=1,(Zs&4194240)===0&&(Zs=64),n}function kf(n){for(var r=[],s=0;31>s;s++)r.push(n);return r}function ki(n,r,s){n.pendingLanes|=r,r!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,r=31-pn(r),n[r]=s}function wE(n,r){var s=n.pendingLanes&~r;n.pendingLanes=r,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=r,n.mutableReadLanes&=r,n.entangledLanes&=r,r=n.entanglements;var u=n.eventTimes;for(n=n.expirationTimes;0<s;){var f=31-pn(s),p=1<<f;r[f]=0,u[f]=-1,n[f]=-1,s&=~p}}function wf(n,r){var s=n.entangledLanes|=r;for(n=n.entanglements;s;){var u=31-pn(s),f=1<<u;f&r|n[u]&r&&(n[u]|=r),s&=~f}}var je=0;function Tb(n){return n&=-n,1<n?4<n?(n&268435455)!==0?16:536870912:4:1}var Sb,Tf,xb,Cb,Eb,Sf=!1,tl=[],or=null,ir=null,sr=null,wi=new Map,Ti=new Map,lr=[],TE="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Bb(n,r){switch(n){case"focusin":case"focusout":or=null;break;case"dragenter":case"dragleave":ir=null;break;case"mouseover":case"mouseout":sr=null;break;case"pointerover":case"pointerout":wi.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ti.delete(r.pointerId)}}function Si(n,r,s,u,f,p){return n===null||n.nativeEvent!==p?(n={blockedOn:r,domEventName:s,eventSystemFlags:u,nativeEvent:p,targetContainers:[f]},r!==null&&(r=Mi(r),r!==null&&Tf(r)),n):(n.eventSystemFlags|=u,r=n.targetContainers,f!==null&&r.indexOf(f)===-1&&r.push(f),n)}function SE(n,r,s,u,f){switch(r){case"focusin":return or=Si(or,n,r,s,u,f),!0;case"dragenter":return ir=Si(ir,n,r,s,u,f),!0;case"mouseover":return sr=Si(sr,n,r,s,u,f),!0;case"pointerover":var p=f.pointerId;return wi.set(p,Si(wi.get(p)||null,n,r,s,u,f)),!0;case"gotpointercapture":return p=f.pointerId,Ti.set(p,Si(Ti.get(p)||null,n,r,s,u,f)),!0}return!1}function Ab(n){var r=Hr(n.target);if(r!==null){var s=zr(r);if(s!==null){if(r=s.tag,r===13){if(r=hb(s),r!==null){n.blockedOn=r,Eb(n.priority,function(){xb(s)});return}}else if(r===3&&s.stateNode.current.memoizedState.isDehydrated){n.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}n.blockedOn=null}function nl(n){if(n.blockedOn!==null)return!1;for(var r=n.targetContainers;0<r.length;){var s=Cf(n.domEventName,n.eventSystemFlags,r[0],n.nativeEvent);if(s===null){s=n.nativeEvent;var u=new s.constructor(s.type,s);ff=u,s.target.dispatchEvent(u),ff=null}else return r=Mi(s),r!==null&&Tf(r),n.blockedOn=s,!1;r.shift()}return!0}function Ib(n,r,s){nl(n)&&s.delete(r)}function xE(){Sf=!1,or!==null&&nl(or)&&(or=null),ir!==null&&nl(ir)&&(ir=null),sr!==null&&nl(sr)&&(sr=null),wi.forEach(Ib),Ti.forEach(Ib)}function xi(n,r){n.blockedOn===r&&(n.blockedOn=null,Sf||(Sf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,xE)))}function Ci(n){function r(f){return xi(f,n)}if(0<tl.length){xi(tl[0],n);for(var s=1;s<tl.length;s++){var u=tl[s];u.blockedOn===n&&(u.blockedOn=null)}}for(or!==null&&xi(or,n),ir!==null&&xi(ir,n),sr!==null&&xi(sr,n),wi.forEach(r),Ti.forEach(r),s=0;s<lr.length;s++)u=lr[s],u.blockedOn===n&&(u.blockedOn=null);for(;0<lr.length&&(s=lr[0],s.blockedOn===null);)Ab(s),s.blockedOn===null&&lr.shift()}var mo=H.ReactCurrentBatchConfig,rl=!0;function CE(n,r,s,u){var f=je,p=mo.transition;mo.transition=null;try{je=1,xf(n,r,s,u)}finally{je=f,mo.transition=p}}function EE(n,r,s,u){var f=je,p=mo.transition;mo.transition=null;try{je=4,xf(n,r,s,u)}finally{je=f,mo.transition=p}}function xf(n,r,s,u){if(rl){var f=Cf(n,r,s,u);if(f===null)qf(n,r,u,ol,s),Bb(n,u);else if(SE(f,n,r,s,u))u.stopPropagation();else if(Bb(n,u),r&4&&-1<TE.indexOf(n)){for(;f!==null;){var p=Mi(f);if(p!==null&&Sb(p),p=Cf(n,r,s,u),p===null&&qf(n,r,u,ol,s),p===f)break;f=p}f!==null&&u.stopPropagation()}else qf(n,r,u,null,s)}}var ol=null;function Cf(n,r,s,u){if(ol=null,n=hf(u),n=Hr(n),n!==null)if(r=zr(n),r===null)n=null;else if(s=r.tag,s===13){if(n=hb(r),n!==null)return n;n=null}else if(s===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;n=null}else r!==n&&(n=null);return ol=n,null}function _b(n){switch(n){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(hE()){case yf:return 1;case bb:return 4;case Ys:case pE:return 16;case kb:return 536870912;default:return 16}default:return 16}}var ar=null,Ef=null,il=null;function Nb(){if(il)return il;var n,r=Ef,s=r.length,u,f="value"in ar?ar.value:ar.textContent,p=f.length;for(n=0;n<s&&r[n]===f[n];n++);var m=s-n;for(u=1;u<=m&&r[s-u]===f[p-u];u++);return il=f.slice(n,1<u?1-u:void 0)}function sl(n){var r=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&r===13&&(n=13)):n=r,n===10&&(n=13),32<=n||n===13?n:0}function ll(){return!0}function Rb(){return!1}function Vt(n){function r(s,u,f,p,m){this._reactName=s,this._targetInst=f,this.type=u,this.nativeEvent=p,this.target=m,this.currentTarget=null;for(var k in n)n.hasOwnProperty(k)&&(s=n[k],this[k]=s?s(p):p[k]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?ll:Rb,this.isPropagationStopped=Rb,this}return G(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=ll)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=ll)},persist:function(){},isPersistent:ll}),r}var vo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bf=Vt(vo),Ei=G({},vo,{view:0,detail:0}),BE=Vt(Ei),Af,If,Bi,al=G({},Ei,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nf,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Bi&&(Bi&&n.type==="mousemove"?(Af=n.screenX-Bi.screenX,If=n.screenY-Bi.screenY):If=Af=0,Bi=n),Af)},movementY:function(n){return"movementY"in n?n.movementY:If}}),Ob=Vt(al),AE=G({},al,{dataTransfer:0}),IE=Vt(AE),_E=G({},Ei,{relatedTarget:0}),_f=Vt(_E),NE=G({},vo,{animationName:0,elapsedTime:0,pseudoElement:0}),RE=Vt(NE),OE=G({},vo,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),LE=Vt(OE),DE=G({},vo,{data:0}),Lb=Vt(DE),PE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ME={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},FE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zE(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=FE[n])?!!r[n]:!1}function Nf(){return zE}var HE=G({},Ei,{key:function(n){if(n.key){var r=PE[n.key]||n.key;if(r!=="Unidentified")return r}return n.type==="keypress"?(n=sl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?ME[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nf,charCode:function(n){return n.type==="keypress"?sl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?sl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),jE=Vt(HE),qE=G({},al,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Db=Vt(qE),UE=G({},Ei,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nf}),WE=Vt(UE),KE=G({},vo,{propertyName:0,elapsedTime:0,pseudoElement:0}),VE=Vt(KE),$E=G({},al,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),GE=Vt($E),XE=[9,13,27,32],Rf=d&&"CompositionEvent"in window,Ai=null;d&&"documentMode"in document&&(Ai=document.documentMode);var YE=d&&"TextEvent"in window&&!Ai,Pb=d&&(!Rf||Ai&&8<Ai&&11>=Ai),Mb=" ",Fb=!1;function zb(n,r){switch(n){case"keyup":return XE.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hb(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var yo=!1;function QE(n,r){switch(n){case"compositionend":return Hb(r);case"keypress":return r.which!==32?null:(Fb=!0,Mb);case"textInput":return n=r.data,n===Mb&&Fb?null:n;default:return null}}function ZE(n,r){if(yo)return n==="compositionend"||!Rf&&zb(n,r)?(n=Nb(),il=Ef=ar=null,yo=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Pb&&r.locale!=="ko"?null:r.data;default:return null}}var JE={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function jb(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r==="input"?!!JE[n.type]:r==="textarea"}function qb(n,r,s,u){ab(u),r=hl(r,"onChange"),0<r.length&&(s=new Bf("onChange","change",null,s,u),n.push({event:s,listeners:r}))}var Ii=null,_i=null;function eB(n){sk(n,0)}function cl(n){var r=So(n);if(Fr(r))return n}function tB(n,r){if(n==="change")return r}var Ub=!1;if(d){var Of;if(d){var Lf="oninput"in document;if(!Lf){var Wb=document.createElement("div");Wb.setAttribute("oninput","return;"),Lf=typeof Wb.oninput=="function"}Of=Lf}else Of=!1;Ub=Of&&(!document.documentMode||9<document.documentMode)}function Kb(){Ii&&(Ii.detachEvent("onpropertychange",Vb),_i=Ii=null)}function Vb(n){if(n.propertyName==="value"&&cl(_i)){var r=[];qb(r,_i,n,hf(n)),fb(eB,r)}}function nB(n,r,s){n==="focusin"?(Kb(),Ii=r,_i=s,Ii.attachEvent("onpropertychange",Vb)):n==="focusout"&&Kb()}function rB(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return cl(_i)}function oB(n,r){if(n==="click")return cl(r)}function iB(n,r){if(n==="input"||n==="change")return cl(r)}function sB(n,r){return n===r&&(n!==0||1/n===1/r)||n!==n&&r!==r}var gn=typeof Object.is=="function"?Object.is:sB;function Ni(n,r){if(gn(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var s=Object.keys(n),u=Object.keys(r);if(s.length!==u.length)return!1;for(u=0;u<s.length;u++){var f=s[u];if(!h.call(r,f)||!gn(n[f],r[f]))return!1}return!0}function $b(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Gb(n,r){var s=$b(n);n=0;for(var u;s;){if(s.nodeType===3){if(u=n+s.textContent.length,n<=r&&u>=r)return{node:s,offset:r-n};n=u}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=$b(s)}}function Xb(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?Xb(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function Yb(){for(var n=window,r=Vs();r instanceof n.HTMLIFrameElement;){try{var s=typeof r.contentWindow.location.href=="string"}catch(u){s=!1}if(s)n=r.contentWindow;else break;r=Vs(n.document)}return r}function Df(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r&&(r==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||r==="textarea"||n.contentEditable==="true")}function lB(n){var r=Yb(),s=n.focusedElem,u=n.selectionRange;if(r!==s&&s&&s.ownerDocument&&Xb(s.ownerDocument.documentElement,s)){if(u!==null&&Df(s)){if(r=u.start,n=u.end,n===void 0&&(n=r),"selectionStart"in s)s.selectionStart=r,s.selectionEnd=Math.min(n,s.value.length);else if(n=(r=s.ownerDocument||document)&&r.defaultView||window,n.getSelection){n=n.getSelection();var f=s.textContent.length,p=Math.min(u.start,f);u=u.end===void 0?p:Math.min(u.end,f),!n.extend&&p>u&&(f=u,u=p,p=f),f=Gb(s,p);var m=Gb(s,u);f&&m&&(n.rangeCount!==1||n.anchorNode!==f.node||n.anchorOffset!==f.offset||n.focusNode!==m.node||n.focusOffset!==m.offset)&&(r=r.createRange(),r.setStart(f.node,f.offset),n.removeAllRanges(),p>u?(n.addRange(r),n.extend(m.node,m.offset)):(r.setEnd(m.node,m.offset),n.addRange(r)))}}for(r=[],n=s;n=n.parentNode;)n.nodeType===1&&r.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<r.length;s++)n=r[s],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var aB=d&&"documentMode"in document&&11>=document.documentMode,bo=null,Pf=null,Ri=null,Mf=!1;function Qb(n,r,s){var u=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Mf||bo==null||bo!==Vs(u)||(u=bo,"selectionStart"in u&&Df(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Ri&&Ni(Ri,u)||(Ri=u,u=hl(Pf,"onSelect"),0<u.length&&(r=new Bf("onSelect","select",null,r,s),n.push({event:r,listeners:u}),r.target=bo)))}function ul(n,r){var s={};return s[n.toLowerCase()]=r.toLowerCase(),s["Webkit"+n]="webkit"+r,s["Moz"+n]="moz"+r,s}var ko={animationend:ul("Animation","AnimationEnd"),animationiteration:ul("Animation","AnimationIteration"),animationstart:ul("Animation","AnimationStart"),transitionend:ul("Transition","TransitionEnd")},Ff={},Zb={};d&&(Zb=document.createElement("div").style,"AnimationEvent"in window||(delete ko.animationend.animation,delete ko.animationiteration.animation,delete ko.animationstart.animation),"TransitionEvent"in window||delete ko.transitionend.transition);function dl(n){if(Ff[n])return Ff[n];if(!ko[n])return n;var r=ko[n],s;for(s in r)if(r.hasOwnProperty(s)&&s in Zb)return Ff[n]=r[s];return n}var Jb=dl("animationend"),ek=dl("animationiteration"),tk=dl("animationstart"),nk=dl("transitionend"),rk=new Map,ok="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function cr(n,r){rk.set(n,r),a(r,[n])}for(var zf=0;zf<ok.length;zf++){var Hf=ok[zf],cB=Hf.toLowerCase(),uB=Hf[0].toUpperCase()+Hf.slice(1);cr(cB,"on"+uB)}cr(Jb,"onAnimationEnd"),cr(ek,"onAnimationIteration"),cr(tk,"onAnimationStart"),cr("dblclick","onDoubleClick"),cr("focusin","onFocus"),cr("focusout","onBlur"),cr(nk,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Oi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),dB=new Set("cancel close invalid load scroll toggle".split(" ").concat(Oi));function ik(n,r,s){var u=n.type||"unknown-event";n.currentTarget=s,cE(u,r,void 0,n),n.currentTarget=null}function sk(n,r){r=(r&4)!==0;for(var s=0;s<n.length;s++){var u=n[s],f=u.event;u=u.listeners;e:{var p=void 0;if(r)for(var m=u.length-1;0<=m;m--){var k=u[m],S=k.instance,N=k.currentTarget;if(k=k.listener,S!==p&&f.isPropagationStopped())break e;ik(f,k,N),p=S}else for(m=0;m<u.length;m++){if(k=u[m],S=k.instance,N=k.currentTarget,k=k.listener,S!==p&&f.isPropagationStopped())break e;ik(f,k,N),p=S}}}if(Xs)throw n=vf,Xs=!1,vf=null,n}function Ve(n,r){var s=r[Gf];s===void 0&&(s=r[Gf]=new Set);var u=n+"__bubble";s.has(u)||(lk(r,n,2,!1),s.add(u))}function jf(n,r,s){var u=0;r&&(u|=4),lk(s,n,u,r)}var fl="_reactListening"+Math.random().toString(36).slice(2);function Li(n){if(!n[fl]){n[fl]=!0,o.forEach(function(s){s!=="selectionchange"&&(dB.has(s)||jf(s,!1,n),jf(s,!0,n))});var r=n.nodeType===9?n:n.ownerDocument;r===null||r[fl]||(r[fl]=!0,jf("selectionchange",!1,r))}}function lk(n,r,s,u){switch(_b(r)){case 1:var f=CE;break;case 4:f=EE;break;default:f=xf}s=f.bind(null,r,s,n),f=void 0,!mf||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(f=!0),u?f!==void 0?n.addEventListener(r,s,{capture:!0,passive:f}):n.addEventListener(r,s,!0):f!==void 0?n.addEventListener(r,s,{passive:f}):n.addEventListener(r,s,!1)}function qf(n,r,s,u,f){var p=u;if((r&1)===0&&(r&2)===0&&u!==null)e:for(;;){if(u===null)return;var m=u.tag;if(m===3||m===4){var k=u.stateNode.containerInfo;if(k===f||k.nodeType===8&&k.parentNode===f)break;if(m===4)for(m=u.return;m!==null;){var S=m.tag;if((S===3||S===4)&&(S=m.stateNode.containerInfo,S===f||S.nodeType===8&&S.parentNode===f))return;m=m.return}for(;k!==null;){if(m=Hr(k),m===null)return;if(S=m.tag,S===5||S===6){u=p=m;continue e}k=k.parentNode}}u=u.return}fb(function(){var N=p,z=hf(s),j=[];e:{var M=rk.get(n);if(M!==void 0){var $=Bf,ne=n;switch(n){case"keypress":if(sl(s)===0)break e;case"keydown":case"keyup":$=jE;break;case"focusin":ne="focus",$=_f;break;case"focusout":ne="blur",$=_f;break;case"beforeblur":case"afterblur":$=_f;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":$=Ob;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=IE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=WE;break;case Jb:case ek:case tk:$=RE;break;case nk:$=VE;break;case"scroll":$=BE;break;case"wheel":$=GE;break;case"copy":case"cut":case"paste":$=LE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=Db}var oe=(r&4)!==0,st=!oe&&n==="scroll",I=oe?M!==null?M+"Capture":null:M;oe=[];for(var E=N,_;E!==null;){_=E;var K=_.stateNode;if(_.tag===5&&K!==null&&(_=K,I!==null&&(K=mi(E,I),K!=null&&oe.push(Di(E,K,_)))),st)break;E=E.return}0<oe.length&&(M=new $(M,ne,null,s,z),j.push({event:M,listeners:oe}))}}if((r&7)===0){e:{if(M=n==="mouseover"||n==="pointerover",$=n==="mouseout"||n==="pointerout",M&&s!==ff&&(ne=s.relatedTarget||s.fromElement)&&(Hr(ne)||ne[jn]))break e;if(($||M)&&(M=z.window===z?z:(M=z.ownerDocument)?M.defaultView||M.parentWindow:window,$?(ne=s.relatedTarget||s.toElement,$=N,ne=ne?Hr(ne):null,ne!==null&&(st=zr(ne),ne!==st||ne.tag!==5&&ne.tag!==6)&&(ne=null)):($=null,ne=N),$!==ne)){if(oe=Ob,K="onMouseLeave",I="onMouseEnter",E="mouse",(n==="pointerout"||n==="pointerover")&&(oe=Db,K="onPointerLeave",I="onPointerEnter",E="pointer"),st=$==null?M:So($),_=ne==null?M:So(ne),M=new oe(K,E+"leave",$,s,z),M.target=st,M.relatedTarget=_,K=null,Hr(z)===N&&(oe=new oe(I,E+"enter",ne,s,z),oe.target=_,oe.relatedTarget=st,K=oe),st=K,$&&ne)t:{for(oe=$,I=ne,E=0,_=oe;_;_=wo(_))E++;for(_=0,K=I;K;K=wo(K))_++;for(;0<E-_;)oe=wo(oe),E--;for(;0<_-E;)I=wo(I),_--;for(;E--;){if(oe===I||I!==null&&oe===I.alternate)break t;oe=wo(oe),I=wo(I)}oe=null}else oe=null;$!==null&&ak(j,M,$,oe,!1),ne!==null&&st!==null&&ak(j,st,ne,oe,!0)}}e:{if(M=N?So(N):window,$=M.nodeName&&M.nodeName.toLowerCase(),$==="select"||$==="input"&&M.type==="file")var ie=tB;else if(jb(M))if(Ub)ie=iB;else{ie=rB;var ue=nB}else($=M.nodeName)&&$.toLowerCase()==="input"&&(M.type==="checkbox"||M.type==="radio")&&(ie=oB);if(ie&&(ie=ie(n,N))){qb(j,ie,s,z);break e}ue&&ue(n,M,N),n==="focusout"&&(ue=M._wrapperState)&&ue.controlled&&M.type==="number"&&lf(M,"number",M.value)}switch(ue=N?So(N):window,n){case"focusin":(jb(ue)||ue.contentEditable==="true")&&(bo=ue,Pf=N,Ri=null);break;case"focusout":Ri=Pf=bo=null;break;case"mousedown":Mf=!0;break;case"contextmenu":case"mouseup":case"dragend":Mf=!1,Qb(j,s,z);break;case"selectionchange":if(aB)break;case"keydown":case"keyup":Qb(j,s,z)}var de;if(Rf)e:{switch(n){case"compositionstart":var ge="onCompositionStart";break e;case"compositionend":ge="onCompositionEnd";break e;case"compositionupdate":ge="onCompositionUpdate";break e}ge=void 0}else yo?zb(n,s)&&(ge="onCompositionEnd"):n==="keydown"&&s.keyCode===229&&(ge="onCompositionStart");ge&&(Pb&&s.locale!=="ko"&&(yo||ge!=="onCompositionStart"?ge==="onCompositionEnd"&&yo&&(de=Nb()):(ar=z,Ef="value"in ar?ar.value:ar.textContent,yo=!0)),ue=hl(N,ge),0<ue.length&&(ge=new Lb(ge,n,null,s,z),j.push({event:ge,listeners:ue}),de?ge.data=de:(de=Hb(s),de!==null&&(ge.data=de)))),(de=YE?QE(n,s):ZE(n,s))&&(N=hl(N,"onBeforeInput"),0<N.length&&(z=new Lb("onBeforeInput","beforeinput",null,s,z),j.push({event:z,listeners:N}),z.data=de))}sk(j,r)})}function Di(n,r,s){return{instance:n,listener:r,currentTarget:s}}function hl(n,r){for(var s=r+"Capture",u=[];n!==null;){var f=n,p=f.stateNode;f.tag===5&&p!==null&&(f=p,p=mi(n,s),p!=null&&u.unshift(Di(n,p,f)),p=mi(n,r),p!=null&&u.push(Di(n,p,f))),n=n.return}return u}function wo(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function ak(n,r,s,u,f){for(var p=r._reactName,m=[];s!==null&&s!==u;){var k=s,S=k.alternate,N=k.stateNode;if(S!==null&&S===u)break;k.tag===5&&N!==null&&(k=N,f?(S=mi(s,p),S!=null&&m.unshift(Di(s,S,k))):f||(S=mi(s,p),S!=null&&m.push(Di(s,S,k)))),s=s.return}m.length!==0&&n.push({event:r,listeners:m})}var fB=/\r\n?/g,hB=/\u0000|\uFFFD/g;function ck(n){return(typeof n=="string"?n:""+n).replace(fB,`
15
+ `).replace(hB,"")}function pl(n,r,s){if(r=ck(r),ck(n)!==r&&s)throw Error(t(425))}function gl(){}var Uf=null,Wf=null;function Kf(n,r){return n==="textarea"||n==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Vf=typeof setTimeout=="function"?setTimeout:void 0,pB=typeof clearTimeout=="function"?clearTimeout:void 0,uk=typeof Promise=="function"?Promise:void 0,gB=typeof queueMicrotask=="function"?queueMicrotask:typeof uk!="undefined"?function(n){return uk.resolve(null).then(n).catch(mB)}:Vf;function mB(n){setTimeout(function(){throw n})}function $f(n,r){var s=r,u=0;do{var f=s.nextSibling;if(n.removeChild(s),f&&f.nodeType===8)if(s=f.data,s==="/$"){if(u===0){n.removeChild(f),Ci(r);return}u--}else s!=="$"&&s!=="$?"&&s!=="$!"||u++;s=f}while(s);Ci(r)}function ur(n){for(;n!=null;n=n.nextSibling){var r=n.nodeType;if(r===1||r===3)break;if(r===8){if(r=n.data,r==="$"||r==="$!"||r==="$?")break;if(r==="/$")return null}}return n}function dk(n){n=n.previousSibling;for(var r=0;n;){if(n.nodeType===8){var s=n.data;if(s==="$"||s==="$!"||s==="$?"){if(r===0)return n;r--}else s==="/$"&&r++}n=n.previousSibling}return null}var To=Math.random().toString(36).slice(2),An="__reactFiber$"+To,Pi="__reactProps$"+To,jn="__reactContainer$"+To,Gf="__reactEvents$"+To,vB="__reactListeners$"+To,yB="__reactHandles$"+To;function Hr(n){var r=n[An];if(r)return r;for(var s=n.parentNode;s;){if(r=s[jn]||s[An]){if(s=r.alternate,r.child!==null||s!==null&&s.child!==null)for(n=dk(n);n!==null;){if(s=n[An])return s;n=dk(n)}return r}n=s,s=n.parentNode}return null}function Mi(n){return n=n[An]||n[jn],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function So(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(t(33))}function ml(n){return n[Pi]||null}var Xf=[],xo=-1;function dr(n){return{current:n}}function $e(n){0>xo||(n.current=Xf[xo],Xf[xo]=null,xo--)}function Ke(n,r){xo++,Xf[xo]=n.current,n.current=r}var fr={},Et=dr(fr),zt=dr(!1),jr=fr;function Co(n,r){var s=n.type.contextTypes;if(!s)return fr;var u=n.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===r)return u.__reactInternalMemoizedMaskedChildContext;var f={},p;for(p in s)f[p]=r[p];return u&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=r,n.__reactInternalMemoizedMaskedChildContext=f),f}function Ht(n){return n=n.childContextTypes,n!=null}function vl(){$e(zt),$e(Et)}function fk(n,r,s){if(Et.current!==fr)throw Error(t(168));Ke(Et,r),Ke(zt,s)}function hk(n,r,s){var u=n.stateNode;if(r=r.childContextTypes,typeof u.getChildContext!="function")return s;u=u.getChildContext();for(var f in u)if(!(f in r))throw Error(t(108,me(n)||"Unknown",f));return G({},s,u)}function yl(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||fr,jr=Et.current,Ke(Et,n),Ke(zt,zt.current),!0}function pk(n,r,s){var u=n.stateNode;if(!u)throw Error(t(169));s?(n=hk(n,r,jr),u.__reactInternalMemoizedMergedChildContext=n,$e(zt),$e(Et),Ke(Et,n)):$e(zt),Ke(zt,s)}var qn=null,bl=!1,Yf=!1;function gk(n){qn===null?qn=[n]:qn.push(n)}function bB(n){bl=!0,gk(n)}function hr(){if(!Yf&&qn!==null){Yf=!0;var n=0,r=je;try{var s=qn;for(je=1;n<s.length;n++){var u=s[n];do u=u(!0);while(u!==null)}qn=null,bl=!1}catch(f){throw qn!==null&&(qn=qn.slice(n+1)),vb(yf,hr),f}finally{je=r,Yf=!1}}return null}var Eo=[],Bo=0,kl=null,wl=0,rn=[],on=0,qr=null,Un=1,Wn="";function Ur(n,r){Eo[Bo++]=wl,Eo[Bo++]=kl,kl=n,wl=r}function mk(n,r,s){rn[on++]=Un,rn[on++]=Wn,rn[on++]=qr,qr=n;var u=Un;n=Wn;var f=32-pn(u)-1;u&=~(1<<f),s+=1;var p=32-pn(r)+f;if(30<p){var m=f-f%5;p=(u&(1<<m)-1).toString(32),u>>=m,f-=m,Un=1<<32-pn(r)+f|s<<f|u,Wn=p+n}else Un=1<<p|s<<f|u,Wn=n}function Qf(n){n.return!==null&&(Ur(n,1),mk(n,1,0))}function Zf(n){for(;n===kl;)kl=Eo[--Bo],Eo[Bo]=null,wl=Eo[--Bo],Eo[Bo]=null;for(;n===qr;)qr=rn[--on],rn[on]=null,Wn=rn[--on],rn[on]=null,Un=rn[--on],rn[on]=null}var $t=null,Gt=null,Ye=!1,mn=null;function vk(n,r){var s=cn(5,null,null,0);s.elementType="DELETED",s.stateNode=r,s.return=n,r=n.deletions,r===null?(n.deletions=[s],n.flags|=16):r.push(s)}function yk(n,r){switch(n.tag){case 5:var s=n.type;return r=r.nodeType!==1||s.toLowerCase()!==r.nodeName.toLowerCase()?null:r,r!==null?(n.stateNode=r,$t=n,Gt=ur(r.firstChild),!0):!1;case 6:return r=n.pendingProps===""||r.nodeType!==3?null:r,r!==null?(n.stateNode=r,$t=n,Gt=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(s=qr!==null?{id:Un,overflow:Wn}:null,n.memoizedState={dehydrated:r,treeContext:s,retryLane:1073741824},s=cn(18,null,null,0),s.stateNode=r,s.return=n,n.child=s,$t=n,Gt=null,!0):!1;default:return!1}}function Jf(n){return(n.mode&1)!==0&&(n.flags&128)===0}function eh(n){if(Ye){var r=Gt;if(r){var s=r;if(!yk(n,r)){if(Jf(n))throw Error(t(418));r=ur(s.nextSibling);var u=$t;r&&yk(n,r)?vk(u,s):(n.flags=n.flags&-4097|2,Ye=!1,$t=n)}}else{if(Jf(n))throw Error(t(418));n.flags=n.flags&-4097|2,Ye=!1,$t=n}}}function bk(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;$t=n}function Tl(n){if(n!==$t)return!1;if(!Ye)return bk(n),Ye=!0,!1;var r;if((r=n.tag!==3)&&!(r=n.tag!==5)&&(r=n.type,r=r!=="head"&&r!=="body"&&!Kf(n.type,n.memoizedProps)),r&&(r=Gt)){if(Jf(n))throw kk(),Error(t(418));for(;r;)vk(n,r),r=ur(r.nextSibling)}if(bk(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(t(317));e:{for(n=n.nextSibling,r=0;n;){if(n.nodeType===8){var s=n.data;if(s==="/$"){if(r===0){Gt=ur(n.nextSibling);break e}r--}else s!=="$"&&s!=="$!"&&s!=="$?"||r++}n=n.nextSibling}Gt=null}}else Gt=$t?ur(n.stateNode.nextSibling):null;return!0}function kk(){for(var n=Gt;n;)n=ur(n.nextSibling)}function Ao(){Gt=$t=null,Ye=!1}function th(n){mn===null?mn=[n]:mn.push(n)}var kB=H.ReactCurrentBatchConfig;function Fi(n,r,s){if(n=s.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(t(309));var u=s.stateNode}if(!u)throw Error(t(147,n));var f=u,p=""+n;return r!==null&&r.ref!==null&&typeof r.ref=="function"&&r.ref._stringRef===p?r.ref:(r=function(m){var k=f.refs;m===null?delete k[p]:k[p]=m},r._stringRef=p,r)}if(typeof n!="string")throw Error(t(284));if(!s._owner)throw Error(t(290,n))}return n}function Sl(n,r){throw n=Object.prototype.toString.call(r),Error(t(31,n==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":n))}function wk(n){var r=n._init;return r(n._payload)}function Tk(n){function r(I,E){if(n){var _=I.deletions;_===null?(I.deletions=[E],I.flags|=16):_.push(E)}}function s(I,E){if(!n)return null;for(;E!==null;)r(I,E),E=E.sibling;return null}function u(I,E){for(I=new Map;E!==null;)E.key!==null?I.set(E.key,E):I.set(E.index,E),E=E.sibling;return I}function f(I,E){return I=wr(I,E),I.index=0,I.sibling=null,I}function p(I,E,_){return I.index=_,n?(_=I.alternate,_!==null?(_=_.index,_<E?(I.flags|=2,E):_):(I.flags|=2,E)):(I.flags|=1048576,E)}function m(I){return n&&I.alternate===null&&(I.flags|=2),I}function k(I,E,_,K){return E===null||E.tag!==6?(E=Vh(_,I.mode,K),E.return=I,E):(E=f(E,_),E.return=I,E)}function S(I,E,_,K){var ie=_.type;return ie===W?z(I,E,_.props.children,K,_.key):E!==null&&(E.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===xe&&wk(ie)===E.type)?(K=f(E,_.props),K.ref=Fi(I,E,_),K.return=I,K):(K=$l(_.type,_.key,_.props,null,I.mode,K),K.ref=Fi(I,E,_),K.return=I,K)}function N(I,E,_,K){return E===null||E.tag!==4||E.stateNode.containerInfo!==_.containerInfo||E.stateNode.implementation!==_.implementation?(E=$h(_,I.mode,K),E.return=I,E):(E=f(E,_.children||[]),E.return=I,E)}function z(I,E,_,K,ie){return E===null||E.tag!==7?(E=Qr(_,I.mode,K,ie),E.return=I,E):(E=f(E,_),E.return=I,E)}function j(I,E,_){if(typeof E=="string"&&E!==""||typeof E=="number")return E=Vh(""+E,I.mode,_),E.return=I,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case Y:return _=$l(E.type,E.key,E.props,null,I.mode,_),_.ref=Fi(I,null,E),_.return=I,_;case q:return E=$h(E,I.mode,_),E.return=I,E;case xe:var K=E._init;return j(I,K(E._payload),_)}if(hi(E)||ae(E))return E=Qr(E,I.mode,_,null),E.return=I,E;Sl(I,E)}return null}function M(I,E,_,K){var ie=E!==null?E.key:null;if(typeof _=="string"&&_!==""||typeof _=="number")return ie!==null?null:k(I,E,""+_,K);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Y:return _.key===ie?S(I,E,_,K):null;case q:return _.key===ie?N(I,E,_,K):null;case xe:return ie=_._init,M(I,E,ie(_._payload),K)}if(hi(_)||ae(_))return ie!==null?null:z(I,E,_,K,null);Sl(I,_)}return null}function $(I,E,_,K,ie){if(typeof K=="string"&&K!==""||typeof K=="number")return I=I.get(_)||null,k(E,I,""+K,ie);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case Y:return I=I.get(K.key===null?_:K.key)||null,S(E,I,K,ie);case q:return I=I.get(K.key===null?_:K.key)||null,N(E,I,K,ie);case xe:var ue=K._init;return $(I,E,_,ue(K._payload),ie)}if(hi(K)||ae(K))return I=I.get(_)||null,z(E,I,K,ie,null);Sl(E,K)}return null}function ne(I,E,_,K){for(var ie=null,ue=null,de=E,ge=E=0,bt=null;de!==null&&ge<_.length;ge++){de.index>ge?(bt=de,de=null):bt=de.sibling;var Me=M(I,de,_[ge],K);if(Me===null){de===null&&(de=bt);break}n&&de&&Me.alternate===null&&r(I,de),E=p(Me,E,ge),ue===null?ie=Me:ue.sibling=Me,ue=Me,de=bt}if(ge===_.length)return s(I,de),Ye&&Ur(I,ge),ie;if(de===null){for(;ge<_.length;ge++)de=j(I,_[ge],K),de!==null&&(E=p(de,E,ge),ue===null?ie=de:ue.sibling=de,ue=de);return Ye&&Ur(I,ge),ie}for(de=u(I,de);ge<_.length;ge++)bt=$(de,I,ge,_[ge],K),bt!==null&&(n&&bt.alternate!==null&&de.delete(bt.key===null?ge:bt.key),E=p(bt,E,ge),ue===null?ie=bt:ue.sibling=bt,ue=bt);return n&&de.forEach(function(Tr){return r(I,Tr)}),Ye&&Ur(I,ge),ie}function oe(I,E,_,K){var ie=ae(_);if(typeof ie!="function")throw Error(t(150));if(_=ie.call(_),_==null)throw Error(t(151));for(var ue=ie=null,de=E,ge=E=0,bt=null,Me=_.next();de!==null&&!Me.done;ge++,Me=_.next()){de.index>ge?(bt=de,de=null):bt=de.sibling;var Tr=M(I,de,Me.value,K);if(Tr===null){de===null&&(de=bt);break}n&&de&&Tr.alternate===null&&r(I,de),E=p(Tr,E,ge),ue===null?ie=Tr:ue.sibling=Tr,ue=Tr,de=bt}if(Me.done)return s(I,de),Ye&&Ur(I,ge),ie;if(de===null){for(;!Me.done;ge++,Me=_.next())Me=j(I,Me.value,K),Me!==null&&(E=p(Me,E,ge),ue===null?ie=Me:ue.sibling=Me,ue=Me);return Ye&&Ur(I,ge),ie}for(de=u(I,de);!Me.done;ge++,Me=_.next())Me=$(de,I,ge,Me.value,K),Me!==null&&(n&&Me.alternate!==null&&de.delete(Me.key===null?ge:Me.key),E=p(Me,E,ge),ue===null?ie=Me:ue.sibling=Me,ue=Me);return n&&de.forEach(function(JB){return r(I,JB)}),Ye&&Ur(I,ge),ie}function st(I,E,_,K){if(typeof _=="object"&&_!==null&&_.type===W&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Y:e:{for(var ie=_.key,ue=E;ue!==null;){if(ue.key===ie){if(ie=_.type,ie===W){if(ue.tag===7){s(I,ue.sibling),E=f(ue,_.props.children),E.return=I,I=E;break e}}else if(ue.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===xe&&wk(ie)===ue.type){s(I,ue.sibling),E=f(ue,_.props),E.ref=Fi(I,ue,_),E.return=I,I=E;break e}s(I,ue);break}else r(I,ue);ue=ue.sibling}_.type===W?(E=Qr(_.props.children,I.mode,K,_.key),E.return=I,I=E):(K=$l(_.type,_.key,_.props,null,I.mode,K),K.ref=Fi(I,E,_),K.return=I,I=K)}return m(I);case q:e:{for(ue=_.key;E!==null;){if(E.key===ue)if(E.tag===4&&E.stateNode.containerInfo===_.containerInfo&&E.stateNode.implementation===_.implementation){s(I,E.sibling),E=f(E,_.children||[]),E.return=I,I=E;break e}else{s(I,E);break}else r(I,E);E=E.sibling}E=$h(_,I.mode,K),E.return=I,I=E}return m(I);case xe:return ue=_._init,st(I,E,ue(_._payload),K)}if(hi(_))return ne(I,E,_,K);if(ae(_))return oe(I,E,_,K);Sl(I,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,E!==null&&E.tag===6?(s(I,E.sibling),E=f(E,_),E.return=I,I=E):(s(I,E),E=Vh(_,I.mode,K),E.return=I,I=E),m(I)):s(I,E)}return st}var Io=Tk(!0),Sk=Tk(!1),xl=dr(null),Cl=null,_o=null,nh=null;function rh(){nh=_o=Cl=null}function oh(n){var r=xl.current;$e(xl),n._currentValue=r}function ih(n,r,s){for(;n!==null;){var u=n.alternate;if((n.childLanes&r)!==r?(n.childLanes|=r,u!==null&&(u.childLanes|=r)):u!==null&&(u.childLanes&r)!==r&&(u.childLanes|=r),n===s)break;n=n.return}}function No(n,r){Cl=n,nh=_o=null,n=n.dependencies,n!==null&&n.firstContext!==null&&((n.lanes&r)!==0&&(jt=!0),n.firstContext=null)}function sn(n){var r=n._currentValue;if(nh!==n)if(n={context:n,memoizedValue:r,next:null},_o===null){if(Cl===null)throw Error(t(308));_o=n,Cl.dependencies={lanes:0,firstContext:n}}else _o=_o.next=n;return r}var Wr=null;function sh(n){Wr===null?Wr=[n]:Wr.push(n)}function xk(n,r,s,u){var f=r.interleaved;return f===null?(s.next=s,sh(r)):(s.next=f.next,f.next=s),r.interleaved=s,Kn(n,u)}function Kn(n,r){n.lanes|=r;var s=n.alternate;for(s!==null&&(s.lanes|=r),s=n,n=n.return;n!==null;)n.childLanes|=r,s=n.alternate,s!==null&&(s.childLanes|=r),s=n,n=n.return;return s.tag===3?s.stateNode:null}var pr=!1;function lh(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ck(n,r){n=n.updateQueue,r.updateQueue===n&&(r.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function Vn(n,r){return{eventTime:n,lane:r,tag:0,payload:null,callback:null,next:null}}function gr(n,r,s){var u=n.updateQueue;if(u===null)return null;if(u=u.shared,(Le&2)!==0){var f=u.pending;return f===null?r.next=r:(r.next=f.next,f.next=r),u.pending=r,Kn(n,s)}return f=u.interleaved,f===null?(r.next=r,sh(u)):(r.next=f.next,f.next=r),u.interleaved=r,Kn(n,s)}function El(n,r,s){if(r=r.updateQueue,r!==null&&(r=r.shared,(s&4194240)!==0)){var u=r.lanes;u&=n.pendingLanes,s|=u,r.lanes=s,wf(n,s)}}function Ek(n,r){var s=n.updateQueue,u=n.alternate;if(u!==null&&(u=u.updateQueue,s===u)){var f=null,p=null;if(s=s.firstBaseUpdate,s!==null){do{var m={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};p===null?f=p=m:p=p.next=m,s=s.next}while(s!==null);p===null?f=p=r:p=p.next=r}else f=p=r;s={baseState:u.baseState,firstBaseUpdate:f,lastBaseUpdate:p,shared:u.shared,effects:u.effects},n.updateQueue=s;return}n=s.lastBaseUpdate,n===null?s.firstBaseUpdate=r:n.next=r,s.lastBaseUpdate=r}function Bl(n,r,s,u){var f=n.updateQueue;pr=!1;var p=f.firstBaseUpdate,m=f.lastBaseUpdate,k=f.shared.pending;if(k!==null){f.shared.pending=null;var S=k,N=S.next;S.next=null,m===null?p=N:m.next=N,m=S;var z=n.alternate;z!==null&&(z=z.updateQueue,k=z.lastBaseUpdate,k!==m&&(k===null?z.firstBaseUpdate=N:k.next=N,z.lastBaseUpdate=S))}if(p!==null){var j=f.baseState;m=0,z=N=S=null,k=p;do{var M=k.lane,$=k.eventTime;if((u&M)===M){z!==null&&(z=z.next={eventTime:$,lane:0,tag:k.tag,payload:k.payload,callback:k.callback,next:null});e:{var ne=n,oe=k;switch(M=r,$=s,oe.tag){case 1:if(ne=oe.payload,typeof ne=="function"){j=ne.call($,j,M);break e}j=ne;break e;case 3:ne.flags=ne.flags&-65537|128;case 0:if(ne=oe.payload,M=typeof ne=="function"?ne.call($,j,M):ne,M==null)break e;j=G({},j,M);break e;case 2:pr=!0}}k.callback!==null&&k.lane!==0&&(n.flags|=64,M=f.effects,M===null?f.effects=[k]:M.push(k))}else $={eventTime:$,lane:M,tag:k.tag,payload:k.payload,callback:k.callback,next:null},z===null?(N=z=$,S=j):z=z.next=$,m|=M;if(k=k.next,k===null){if(k=f.shared.pending,k===null)break;M=k,k=M.next,M.next=null,f.lastBaseUpdate=M,f.shared.pending=null}}while(!0);if(z===null&&(S=j),f.baseState=S,f.firstBaseUpdate=N,f.lastBaseUpdate=z,r=f.shared.interleaved,r!==null){f=r;do m|=f.lane,f=f.next;while(f!==r)}else p===null&&(f.shared.lanes=0);$r|=m,n.lanes=m,n.memoizedState=j}}function Bk(n,r,s){if(n=r.effects,r.effects=null,n!==null)for(r=0;r<n.length;r++){var u=n[r],f=u.callback;if(f!==null){if(u.callback=null,u=s,typeof f!="function")throw Error(t(191,f));f.call(u)}}}var zi={},In=dr(zi),Hi=dr(zi),ji=dr(zi);function Kr(n){if(n===zi)throw Error(t(174));return n}function ah(n,r){switch(Ke(ji,r),Ke(Hi,n),Ke(In,zi),n=r.nodeType,n){case 9:case 11:r=(r=r.documentElement)?r.namespaceURI:cf(null,"");break;default:n=n===8?r.parentNode:r,r=n.namespaceURI||null,n=n.tagName,r=cf(r,n)}$e(In),Ke(In,r)}function Ro(){$e(In),$e(Hi),$e(ji)}function Ak(n){Kr(ji.current);var r=Kr(In.current),s=cf(r,n.type);r!==s&&(Ke(Hi,n),Ke(In,s))}function ch(n){Hi.current===n&&($e(In),$e(Hi))}var Je=dr(0);function Al(n){for(var r=n;r!==null;){if(r.tag===13){var s=r.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.data==="$!"))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var uh=[];function dh(){for(var n=0;n<uh.length;n++)uh[n]._workInProgressVersionPrimary=null;uh.length=0}var Il=H.ReactCurrentDispatcher,fh=H.ReactCurrentBatchConfig,Vr=0,et=null,ht=null,vt=null,_l=!1,qi=!1,Ui=0,wB=0;function Bt(){throw Error(t(321))}function hh(n,r){if(r===null)return!1;for(var s=0;s<r.length&&s<n.length;s++)if(!gn(n[s],r[s]))return!1;return!0}function ph(n,r,s,u,f,p){if(Vr=p,et=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,Il.current=n===null||n.memoizedState===null?CB:EB,n=s(u,f),qi){p=0;do{if(qi=!1,Ui=0,25<=p)throw Error(t(301));p+=1,vt=ht=null,r.updateQueue=null,Il.current=BB,n=s(u,f)}while(qi)}if(Il.current=Ol,r=ht!==null&&ht.next!==null,Vr=0,vt=ht=et=null,_l=!1,r)throw Error(t(300));return n}function gh(){var n=Ui!==0;return Ui=0,n}function _n(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?et.memoizedState=vt=n:vt=vt.next=n,vt}function ln(){if(ht===null){var n=et.alternate;n=n!==null?n.memoizedState:null}else n=ht.next;var r=vt===null?et.memoizedState:vt.next;if(r!==null)vt=r,ht=n;else{if(n===null)throw Error(t(310));ht=n,n={memoizedState:ht.memoizedState,baseState:ht.baseState,baseQueue:ht.baseQueue,queue:ht.queue,next:null},vt===null?et.memoizedState=vt=n:vt=vt.next=n}return vt}function Wi(n,r){return typeof r=="function"?r(n):r}function mh(n){var r=ln(),s=r.queue;if(s===null)throw Error(t(311));s.lastRenderedReducer=n;var u=ht,f=u.baseQueue,p=s.pending;if(p!==null){if(f!==null){var m=f.next;f.next=p.next,p.next=m}u.baseQueue=f=p,s.pending=null}if(f!==null){p=f.next,u=u.baseState;var k=m=null,S=null,N=p;do{var z=N.lane;if((Vr&z)===z)S!==null&&(S=S.next={lane:0,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null}),u=N.hasEagerState?N.eagerState:n(u,N.action);else{var j={lane:z,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null};S===null?(k=S=j,m=u):S=S.next=j,et.lanes|=z,$r|=z}N=N.next}while(N!==null&&N!==p);S===null?m=u:S.next=k,gn(u,r.memoizedState)||(jt=!0),r.memoizedState=u,r.baseState=m,r.baseQueue=S,s.lastRenderedState=u}if(n=s.interleaved,n!==null){f=n;do p=f.lane,et.lanes|=p,$r|=p,f=f.next;while(f!==n)}else f===null&&(s.lanes=0);return[r.memoizedState,s.dispatch]}function vh(n){var r=ln(),s=r.queue;if(s===null)throw Error(t(311));s.lastRenderedReducer=n;var u=s.dispatch,f=s.pending,p=r.memoizedState;if(f!==null){s.pending=null;var m=f=f.next;do p=n(p,m.action),m=m.next;while(m!==f);gn(p,r.memoizedState)||(jt=!0),r.memoizedState=p,r.baseQueue===null&&(r.baseState=p),s.lastRenderedState=p}return[p,u]}function Ik(){}function _k(n,r){var s=et,u=ln(),f=r(),p=!gn(u.memoizedState,f);if(p&&(u.memoizedState=f,jt=!0),u=u.queue,yh(Ok.bind(null,s,u,n),[n]),u.getSnapshot!==r||p||vt!==null&&vt.memoizedState.tag&1){if(s.flags|=2048,Ki(9,Rk.bind(null,s,u,f,r),void 0,null),yt===null)throw Error(t(349));(Vr&30)!==0||Nk(s,r,f)}return f}function Nk(n,r,s){n.flags|=16384,n={getSnapshot:r,value:s},r=et.updateQueue,r===null?(r={lastEffect:null,stores:null},et.updateQueue=r,r.stores=[n]):(s=r.stores,s===null?r.stores=[n]:s.push(n))}function Rk(n,r,s,u){r.value=s,r.getSnapshot=u,Lk(r)&&Dk(n)}function Ok(n,r,s){return s(function(){Lk(r)&&Dk(n)})}function Lk(n){var r=n.getSnapshot;n=n.value;try{var s=r();return!gn(n,s)}catch(u){return!0}}function Dk(n){var r=Kn(n,1);r!==null&&kn(r,n,1,-1)}function Pk(n){var r=_n();return typeof n=="function"&&(n=n()),r.memoizedState=r.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Wi,lastRenderedState:n},r.queue=n,n=n.dispatch=xB.bind(null,et,n),[r.memoizedState,n]}function Ki(n,r,s,u){return n={tag:n,create:r,destroy:s,deps:u,next:null},r=et.updateQueue,r===null?(r={lastEffect:null,stores:null},et.updateQueue=r,r.lastEffect=n.next=n):(s=r.lastEffect,s===null?r.lastEffect=n.next=n:(u=s.next,s.next=n,n.next=u,r.lastEffect=n)),n}function Mk(){return ln().memoizedState}function Nl(n,r,s,u){var f=_n();et.flags|=n,f.memoizedState=Ki(1|r,s,void 0,u===void 0?null:u)}function Rl(n,r,s,u){var f=ln();u=u===void 0?null:u;var p=void 0;if(ht!==null){var m=ht.memoizedState;if(p=m.destroy,u!==null&&hh(u,m.deps)){f.memoizedState=Ki(r,s,p,u);return}}et.flags|=n,f.memoizedState=Ki(1|r,s,p,u)}function Fk(n,r){return Nl(8390656,8,n,r)}function yh(n,r){return Rl(2048,8,n,r)}function zk(n,r){return Rl(4,2,n,r)}function Hk(n,r){return Rl(4,4,n,r)}function jk(n,r){if(typeof r=="function")return n=n(),r(n),function(){r(null)};if(r!=null)return n=n(),r.current=n,function(){r.current=null}}function qk(n,r,s){return s=s!=null?s.concat([n]):null,Rl(4,4,jk.bind(null,r,n),s)}function bh(){}function Uk(n,r){var s=ln();r=r===void 0?null:r;var u=s.memoizedState;return u!==null&&r!==null&&hh(r,u[1])?u[0]:(s.memoizedState=[n,r],n)}function Wk(n,r){var s=ln();r=r===void 0?null:r;var u=s.memoizedState;return u!==null&&r!==null&&hh(r,u[1])?u[0]:(n=n(),s.memoizedState=[n,r],n)}function Kk(n,r,s){return(Vr&21)===0?(n.baseState&&(n.baseState=!1,jt=!0),n.memoizedState=s):(gn(s,r)||(s=wb(),et.lanes|=s,$r|=s,n.baseState=!0),r)}function TB(n,r){var s=je;je=s!==0&&4>s?s:4,n(!0);var u=fh.transition;fh.transition={};try{n(!1),r()}finally{je=s,fh.transition=u}}function Vk(){return ln().memoizedState}function SB(n,r,s){var u=br(n);if(s={lane:u,action:s,hasEagerState:!1,eagerState:null,next:null},$k(n))Gk(r,s);else if(s=xk(n,r,s,u),s!==null){var f=Dt();kn(s,n,u,f),Xk(s,r,u)}}function xB(n,r,s){var u=br(n),f={lane:u,action:s,hasEagerState:!1,eagerState:null,next:null};if($k(n))Gk(r,f);else{var p=n.alternate;if(n.lanes===0&&(p===null||p.lanes===0)&&(p=r.lastRenderedReducer,p!==null))try{var m=r.lastRenderedState,k=p(m,s);if(f.hasEagerState=!0,f.eagerState=k,gn(k,m)){var S=r.interleaved;S===null?(f.next=f,sh(r)):(f.next=S.next,S.next=f),r.interleaved=f;return}}catch(N){}finally{}s=xk(n,r,f,u),s!==null&&(f=Dt(),kn(s,n,u,f),Xk(s,r,u))}}function $k(n){var r=n.alternate;return n===et||r!==null&&r===et}function Gk(n,r){qi=_l=!0;var s=n.pending;s===null?r.next=r:(r.next=s.next,s.next=r),n.pending=r}function Xk(n,r,s){if((s&4194240)!==0){var u=r.lanes;u&=n.pendingLanes,s|=u,r.lanes=s,wf(n,s)}}var Ol={readContext:sn,useCallback:Bt,useContext:Bt,useEffect:Bt,useImperativeHandle:Bt,useInsertionEffect:Bt,useLayoutEffect:Bt,useMemo:Bt,useReducer:Bt,useRef:Bt,useState:Bt,useDebugValue:Bt,useDeferredValue:Bt,useTransition:Bt,useMutableSource:Bt,useSyncExternalStore:Bt,useId:Bt,unstable_isNewReconciler:!1},CB={readContext:sn,useCallback:function(n,r){return _n().memoizedState=[n,r===void 0?null:r],n},useContext:sn,useEffect:Fk,useImperativeHandle:function(n,r,s){return s=s!=null?s.concat([n]):null,Nl(4194308,4,jk.bind(null,r,n),s)},useLayoutEffect:function(n,r){return Nl(4194308,4,n,r)},useInsertionEffect:function(n,r){return Nl(4,2,n,r)},useMemo:function(n,r){var s=_n();return r=r===void 0?null:r,n=n(),s.memoizedState=[n,r],n},useReducer:function(n,r,s){var u=_n();return r=s!==void 0?s(r):r,u.memoizedState=u.baseState=r,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:r},u.queue=n,n=n.dispatch=SB.bind(null,et,n),[u.memoizedState,n]},useRef:function(n){var r=_n();return n={current:n},r.memoizedState=n},useState:Pk,useDebugValue:bh,useDeferredValue:function(n){return _n().memoizedState=n},useTransition:function(){var n=Pk(!1),r=n[0];return n=TB.bind(null,n[1]),_n().memoizedState=n,[r,n]},useMutableSource:function(){},useSyncExternalStore:function(n,r,s){var u=et,f=_n();if(Ye){if(s===void 0)throw Error(t(407));s=s()}else{if(s=r(),yt===null)throw Error(t(349));(Vr&30)!==0||Nk(u,r,s)}f.memoizedState=s;var p={value:s,getSnapshot:r};return f.queue=p,Fk(Ok.bind(null,u,p,n),[n]),u.flags|=2048,Ki(9,Rk.bind(null,u,p,s,r),void 0,null),s},useId:function(){var n=_n(),r=yt.identifierPrefix;if(Ye){var s=Wn,u=Un;s=(u&~(1<<32-pn(u)-1)).toString(32)+s,r=":"+r+"R"+s,s=Ui++,0<s&&(r+="H"+s.toString(32)),r+=":"}else s=wB++,r=":"+r+"r"+s.toString(32)+":";return n.memoizedState=r},unstable_isNewReconciler:!1},EB={readContext:sn,useCallback:Uk,useContext:sn,useEffect:yh,useImperativeHandle:qk,useInsertionEffect:zk,useLayoutEffect:Hk,useMemo:Wk,useReducer:mh,useRef:Mk,useState:function(){return mh(Wi)},useDebugValue:bh,useDeferredValue:function(n){var r=ln();return Kk(r,ht.memoizedState,n)},useTransition:function(){var n=mh(Wi)[0],r=ln().memoizedState;return[n,r]},useMutableSource:Ik,useSyncExternalStore:_k,useId:Vk,unstable_isNewReconciler:!1},BB={readContext:sn,useCallback:Uk,useContext:sn,useEffect:yh,useImperativeHandle:qk,useInsertionEffect:zk,useLayoutEffect:Hk,useMemo:Wk,useReducer:vh,useRef:Mk,useState:function(){return vh(Wi)},useDebugValue:bh,useDeferredValue:function(n){var r=ln();return ht===null?r.memoizedState=n:Kk(r,ht.memoizedState,n)},useTransition:function(){var n=vh(Wi)[0],r=ln().memoizedState;return[n,r]},useMutableSource:Ik,useSyncExternalStore:_k,useId:Vk,unstable_isNewReconciler:!1};function vn(n,r){if(n&&n.defaultProps){r=G({},r),n=n.defaultProps;for(var s in n)r[s]===void 0&&(r[s]=n[s]);return r}return r}function kh(n,r,s,u){r=n.memoizedState,s=s(u,r),s=s==null?r:G({},r,s),n.memoizedState=s,n.lanes===0&&(n.updateQueue.baseState=s)}var Ll={isMounted:function(n){return(n=n._reactInternals)?zr(n)===n:!1},enqueueSetState:function(n,r,s){n=n._reactInternals;var u=Dt(),f=br(n),p=Vn(u,f);p.payload=r,s!=null&&(p.callback=s),r=gr(n,p,f),r!==null&&(kn(r,n,f,u),El(r,n,f))},enqueueReplaceState:function(n,r,s){n=n._reactInternals;var u=Dt(),f=br(n),p=Vn(u,f);p.tag=1,p.payload=r,s!=null&&(p.callback=s),r=gr(n,p,f),r!==null&&(kn(r,n,f,u),El(r,n,f))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var s=Dt(),u=br(n),f=Vn(s,u);f.tag=2,r!=null&&(f.callback=r),r=gr(n,f,u),r!==null&&(kn(r,n,u,s),El(r,n,u))}};function Yk(n,r,s,u,f,p,m){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(u,p,m):r.prototype&&r.prototype.isPureReactComponent?!Ni(s,u)||!Ni(f,p):!0}function Qk(n,r,s){var u=!1,f=fr,p=r.contextType;return typeof p=="object"&&p!==null?p=sn(p):(f=Ht(r)?jr:Et.current,u=r.contextTypes,p=(u=u!=null)?Co(n,f):fr),r=new r(s,p),n.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Ll,n.stateNode=r,r._reactInternals=n,u&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=f,n.__reactInternalMemoizedMaskedChildContext=p),r}function Zk(n,r,s,u){n=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(s,u),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(s,u),r.state!==n&&Ll.enqueueReplaceState(r,r.state,null)}function wh(n,r,s,u){var f=n.stateNode;f.props=s,f.state=n.memoizedState,f.refs={},lh(n);var p=r.contextType;typeof p=="object"&&p!==null?f.context=sn(p):(p=Ht(r)?jr:Et.current,f.context=Co(n,p)),f.state=n.memoizedState,p=r.getDerivedStateFromProps,typeof p=="function"&&(kh(n,r,p,s),f.state=n.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(r=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),r!==f.state&&Ll.enqueueReplaceState(f,f.state,null),Bl(n,s,f,u),f.state=n.memoizedState),typeof f.componentDidMount=="function"&&(n.flags|=4194308)}function Oo(n,r){try{var s="",u=r;do s+=Ce(u),u=u.return;while(u);var f=s}catch(p){f=`
16
+ Error generating stack: `+p.message+`
17
+ `+p.stack}return{value:n,source:r,stack:f,digest:null}}function Th(n,r,s){return{value:n,source:null,stack:s!=null?s:null,digest:r!=null?r:null}}function Sh(n,r){try{console.error(r.value)}catch(s){setTimeout(function(){throw s})}}var AB=typeof WeakMap=="function"?WeakMap:Map;function Jk(n,r,s){s=Vn(-1,s),s.tag=3,s.payload={element:null};var u=r.value;return s.callback=function(){jl||(jl=!0,Fh=u),Sh(n,r)},s}function ew(n,r,s){s=Vn(-1,s),s.tag=3;var u=n.type.getDerivedStateFromError;if(typeof u=="function"){var f=r.value;s.payload=function(){return u(f)},s.callback=function(){Sh(n,r)}}var p=n.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(s.callback=function(){Sh(n,r),typeof u!="function"&&(vr===null?vr=new Set([this]):vr.add(this));var m=r.stack;this.componentDidCatch(r.value,{componentStack:m!==null?m:""})}),s}function tw(n,r,s){var u=n.pingCache;if(u===null){u=n.pingCache=new AB;var f=new Set;u.set(r,f)}else f=u.get(r),f===void 0&&(f=new Set,u.set(r,f));f.has(s)||(f.add(s),n=qB.bind(null,n,r,s),r.then(n,n))}function nw(n){do{var r;if((r=n.tag===13)&&(r=n.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return n;n=n.return}while(n!==null);return null}function rw(n,r,s,u,f){return(n.mode&1)===0?(n===r?n.flags|=65536:(n.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(r=Vn(-1,1),r.tag=2,gr(s,r,1))),s.lanes|=1),n):(n.flags|=65536,n.lanes=f,n)}var IB=H.ReactCurrentOwner,jt=!1;function Lt(n,r,s,u){r.child=n===null?Sk(r,null,s,u):Io(r,n.child,s,u)}function ow(n,r,s,u,f){s=s.render;var p=r.ref;return No(r,f),u=ph(n,r,s,u,p,f),s=gh(),n!==null&&!jt?(r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~f,$n(n,r,f)):(Ye&&s&&Qf(r),r.flags|=1,Lt(n,r,u,f),r.child)}function iw(n,r,s,u,f){if(n===null){var p=s.type;return typeof p=="function"&&!Kh(p)&&p.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(r.tag=15,r.type=p,sw(n,r,p,u,f)):(n=$l(s.type,null,u,r,r.mode,f),n.ref=r.ref,n.return=r,r.child=n)}if(p=n.child,(n.lanes&f)===0){var m=p.memoizedProps;if(s=s.compare,s=s!==null?s:Ni,s(m,u)&&n.ref===r.ref)return $n(n,r,f)}return r.flags|=1,n=wr(p,u),n.ref=r.ref,n.return=r,r.child=n}function sw(n,r,s,u,f){if(n!==null){var p=n.memoizedProps;if(Ni(p,u)&&n.ref===r.ref)if(jt=!1,r.pendingProps=u=p,(n.lanes&f)!==0)(n.flags&131072)!==0&&(jt=!0);else return r.lanes=n.lanes,$n(n,r,f)}return xh(n,r,s,u,f)}function lw(n,r,s){var u=r.pendingProps,f=u.children,p=n!==null?n.memoizedState:null;if(u.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ke(Do,Xt),Xt|=s;else{if((s&1073741824)===0)return n=p!==null?p.baseLanes|s:s,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:n,cachePool:null,transitions:null},r.updateQueue=null,Ke(Do,Xt),Xt|=n,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=p!==null?p.baseLanes:s,Ke(Do,Xt),Xt|=u}else p!==null?(u=p.baseLanes|s,r.memoizedState=null):u=s,Ke(Do,Xt),Xt|=u;return Lt(n,r,f,s),r.child}function aw(n,r){var s=r.ref;(n===null&&s!==null||n!==null&&n.ref!==s)&&(r.flags|=512,r.flags|=2097152)}function xh(n,r,s,u,f){var p=Ht(s)?jr:Et.current;return p=Co(r,p),No(r,f),s=ph(n,r,s,u,p,f),u=gh(),n!==null&&!jt?(r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~f,$n(n,r,f)):(Ye&&u&&Qf(r),r.flags|=1,Lt(n,r,s,f),r.child)}function cw(n,r,s,u,f){if(Ht(s)){var p=!0;yl(r)}else p=!1;if(No(r,f),r.stateNode===null)Pl(n,r),Qk(r,s,u),wh(r,s,u,f),u=!0;else if(n===null){var m=r.stateNode,k=r.memoizedProps;m.props=k;var S=m.context,N=s.contextType;typeof N=="object"&&N!==null?N=sn(N):(N=Ht(s)?jr:Et.current,N=Co(r,N));var z=s.getDerivedStateFromProps,j=typeof z=="function"||typeof m.getSnapshotBeforeUpdate=="function";j||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(k!==u||S!==N)&&Zk(r,m,u,N),pr=!1;var M=r.memoizedState;m.state=M,Bl(r,u,m,f),S=r.memoizedState,k!==u||M!==S||zt.current||pr?(typeof z=="function"&&(kh(r,s,z,u),S=r.memoizedState),(k=pr||Yk(r,s,k,u,M,S,N))?(j||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(r.flags|=4194308)):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=u,r.memoizedState=S),m.props=u,m.state=S,m.context=N,u=k):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),u=!1)}else{m=r.stateNode,Ck(n,r),k=r.memoizedProps,N=r.type===r.elementType?k:vn(r.type,k),m.props=N,j=r.pendingProps,M=m.context,S=s.contextType,typeof S=="object"&&S!==null?S=sn(S):(S=Ht(s)?jr:Et.current,S=Co(r,S));var $=s.getDerivedStateFromProps;(z=typeof $=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(k!==j||M!==S)&&Zk(r,m,u,S),pr=!1,M=r.memoizedState,m.state=M,Bl(r,u,m,f);var ne=r.memoizedState;k!==j||M!==ne||zt.current||pr?(typeof $=="function"&&(kh(r,s,$,u),ne=r.memoizedState),(N=pr||Yk(r,s,N,u,M,ne,S)||!1)?(z||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(u,ne,S),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(u,ne,S)),typeof m.componentDidUpdate=="function"&&(r.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof m.componentDidUpdate!="function"||k===n.memoizedProps&&M===n.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||k===n.memoizedProps&&M===n.memoizedState||(r.flags|=1024),r.memoizedProps=u,r.memoizedState=ne),m.props=u,m.state=ne,m.context=S,u=N):(typeof m.componentDidUpdate!="function"||k===n.memoizedProps&&M===n.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||k===n.memoizedProps&&M===n.memoizedState||(r.flags|=1024),u=!1)}return Ch(n,r,s,u,p,f)}function Ch(n,r,s,u,f,p){aw(n,r);var m=(r.flags&128)!==0;if(!u&&!m)return f&&pk(r,s,!1),$n(n,r,p);u=r.stateNode,IB.current=r;var k=m&&typeof s.getDerivedStateFromError!="function"?null:u.render();return r.flags|=1,n!==null&&m?(r.child=Io(r,n.child,null,p),r.child=Io(r,null,k,p)):Lt(n,r,k,p),r.memoizedState=u.state,f&&pk(r,s,!0),r.child}function uw(n){var r=n.stateNode;r.pendingContext?fk(n,r.pendingContext,r.pendingContext!==r.context):r.context&&fk(n,r.context,!1),ah(n,r.containerInfo)}function dw(n,r,s,u,f){return Ao(),th(f),r.flags|=256,Lt(n,r,s,u),r.child}var Eh={dehydrated:null,treeContext:null,retryLane:0};function Bh(n){return{baseLanes:n,cachePool:null,transitions:null}}function fw(n,r,s){var u=r.pendingProps,f=Je.current,p=!1,m=(r.flags&128)!==0,k;if((k=m)||(k=n!==null&&n.memoizedState===null?!1:(f&2)!==0),k?(p=!0,r.flags&=-129):(n===null||n.memoizedState!==null)&&(f|=1),Ke(Je,f&1),n===null)return eh(r),n=r.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?((r.mode&1)===0?r.lanes=1:n.data==="$!"?r.lanes=8:r.lanes=1073741824,null):(m=u.children,n=u.fallback,p?(u=r.mode,p=r.child,m={mode:"hidden",children:m},(u&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=m):p=Gl(m,u,0,null),n=Qr(n,u,s,null),p.return=r,n.return=r,p.sibling=n,r.child=p,r.child.memoizedState=Bh(s),r.memoizedState=Eh,n):Ah(r,m));if(f=n.memoizedState,f!==null&&(k=f.dehydrated,k!==null))return _B(n,r,m,u,k,f,s);if(p){p=u.fallback,m=r.mode,f=n.child,k=f.sibling;var S={mode:"hidden",children:u.children};return(m&1)===0&&r.child!==f?(u=r.child,u.childLanes=0,u.pendingProps=S,r.deletions=null):(u=wr(f,S),u.subtreeFlags=f.subtreeFlags&14680064),k!==null?p=wr(k,p):(p=Qr(p,m,s,null),p.flags|=2),p.return=r,u.return=r,u.sibling=p,r.child=u,u=p,p=r.child,m=n.child.memoizedState,m=m===null?Bh(s):{baseLanes:m.baseLanes|s,cachePool:null,transitions:m.transitions},p.memoizedState=m,p.childLanes=n.childLanes&~s,r.memoizedState=Eh,u}return p=n.child,n=p.sibling,u=wr(p,{mode:"visible",children:u.children}),(r.mode&1)===0&&(u.lanes=s),u.return=r,u.sibling=null,n!==null&&(s=r.deletions,s===null?(r.deletions=[n],r.flags|=16):s.push(n)),r.child=u,r.memoizedState=null,u}function Ah(n,r){return r=Gl({mode:"visible",children:r},n.mode,0,null),r.return=n,n.child=r}function Dl(n,r,s,u){return u!==null&&th(u),Io(r,n.child,null,s),n=Ah(r,r.pendingProps.children),n.flags|=2,r.memoizedState=null,n}function _B(n,r,s,u,f,p,m){if(s)return r.flags&256?(r.flags&=-257,u=Th(Error(t(422))),Dl(n,r,m,u)):r.memoizedState!==null?(r.child=n.child,r.flags|=128,null):(p=u.fallback,f=r.mode,u=Gl({mode:"visible",children:u.children},f,0,null),p=Qr(p,f,m,null),p.flags|=2,u.return=r,p.return=r,u.sibling=p,r.child=u,(r.mode&1)!==0&&Io(r,n.child,null,m),r.child.memoizedState=Bh(m),r.memoizedState=Eh,p);if((r.mode&1)===0)return Dl(n,r,m,null);if(f.data==="$!"){if(u=f.nextSibling&&f.nextSibling.dataset,u)var k=u.dgst;return u=k,p=Error(t(419)),u=Th(p,u,void 0),Dl(n,r,m,u)}if(k=(m&n.childLanes)!==0,jt||k){if(u=yt,u!==null){switch(m&-m){case 4:f=2;break;case 16:f=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:f=32;break;case 536870912:f=268435456;break;default:f=0}f=(f&(u.suspendedLanes|m))!==0?0:f,f!==0&&f!==p.retryLane&&(p.retryLane=f,Kn(n,f),kn(u,n,f,-1))}return Wh(),u=Th(Error(t(421))),Dl(n,r,m,u)}return f.data==="$?"?(r.flags|=128,r.child=n.child,r=UB.bind(null,n),f._reactRetry=r,null):(n=p.treeContext,Gt=ur(f.nextSibling),$t=r,Ye=!0,mn=null,n!==null&&(rn[on++]=Un,rn[on++]=Wn,rn[on++]=qr,Un=n.id,Wn=n.overflow,qr=r),r=Ah(r,u.children),r.flags|=4096,r)}function hw(n,r,s){n.lanes|=r;var u=n.alternate;u!==null&&(u.lanes|=r),ih(n.return,r,s)}function Ih(n,r,s,u,f){var p=n.memoizedState;p===null?n.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:u,tail:s,tailMode:f}:(p.isBackwards=r,p.rendering=null,p.renderingStartTime=0,p.last=u,p.tail=s,p.tailMode=f)}function pw(n,r,s){var u=r.pendingProps,f=u.revealOrder,p=u.tail;if(Lt(n,r,u.children,s),u=Je.current,(u&2)!==0)u=u&1|2,r.flags|=128;else{if(n!==null&&(n.flags&128)!==0)e:for(n=r.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&hw(n,s,r);else if(n.tag===19)hw(n,s,r);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===r)break e;for(;n.sibling===null;){if(n.return===null||n.return===r)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}u&=1}if(Ke(Je,u),(r.mode&1)===0)r.memoizedState=null;else switch(f){case"forwards":for(s=r.child,f=null;s!==null;)n=s.alternate,n!==null&&Al(n)===null&&(f=s),s=s.sibling;s=f,s===null?(f=r.child,r.child=null):(f=s.sibling,s.sibling=null),Ih(r,!1,f,s,p);break;case"backwards":for(s=null,f=r.child,r.child=null;f!==null;){if(n=f.alternate,n!==null&&Al(n)===null){r.child=f;break}n=f.sibling,f.sibling=s,s=f,f=n}Ih(r,!0,s,null,p);break;case"together":Ih(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function Pl(n,r){(r.mode&1)===0&&n!==null&&(n.alternate=null,r.alternate=null,r.flags|=2)}function $n(n,r,s){if(n!==null&&(r.dependencies=n.dependencies),$r|=r.lanes,(s&r.childLanes)===0)return null;if(n!==null&&r.child!==n.child)throw Error(t(153));if(r.child!==null){for(n=r.child,s=wr(n,n.pendingProps),r.child=s,s.return=r;n.sibling!==null;)n=n.sibling,s=s.sibling=wr(n,n.pendingProps),s.return=r;s.sibling=null}return r.child}function NB(n,r,s){switch(r.tag){case 3:uw(r),Ao();break;case 5:Ak(r);break;case 1:Ht(r.type)&&yl(r);break;case 4:ah(r,r.stateNode.containerInfo);break;case 10:var u=r.type._context,f=r.memoizedProps.value;Ke(xl,u._currentValue),u._currentValue=f;break;case 13:if(u=r.memoizedState,u!==null)return u.dehydrated!==null?(Ke(Je,Je.current&1),r.flags|=128,null):(s&r.child.childLanes)!==0?fw(n,r,s):(Ke(Je,Je.current&1),n=$n(n,r,s),n!==null?n.sibling:null);Ke(Je,Je.current&1);break;case 19:if(u=(s&r.childLanes)!==0,(n.flags&128)!==0){if(u)return pw(n,r,s);r.flags|=128}if(f=r.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Ke(Je,Je.current),u)break;return null;case 22:case 23:return r.lanes=0,lw(n,r,s)}return $n(n,r,s)}var gw,_h,mw,vw;gw=function(n,r){for(var s=r.child;s!==null;){if(s.tag===5||s.tag===6)n.appendChild(s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return;s=s.return}s.sibling.return=s.return,s=s.sibling}},_h=function(){},mw=function(n,r,s,u){var f=n.memoizedProps;if(f!==u){n=r.stateNode,Kr(In.current);var p=null;switch(s){case"input":f=of(n,f),u=of(n,u),p=[];break;case"select":f=G({},f,{value:void 0}),u=G({},u,{value:void 0}),p=[];break;case"textarea":f=af(n,f),u=af(n,u),p=[];break;default:typeof f.onClick!="function"&&typeof u.onClick=="function"&&(n.onclick=gl)}uf(s,u);var m;s=null;for(N in f)if(!u.hasOwnProperty(N)&&f.hasOwnProperty(N)&&f[N]!=null)if(N==="style"){var k=f[N];for(m in k)k.hasOwnProperty(m)&&(s||(s={}),s[m]="")}else N!=="dangerouslySetInnerHTML"&&N!=="children"&&N!=="suppressContentEditableWarning"&&N!=="suppressHydrationWarning"&&N!=="autoFocus"&&(i.hasOwnProperty(N)?p||(p=[]):(p=p||[]).push(N,null));for(N in u){var S=u[N];if(k=f!=null?f[N]:void 0,u.hasOwnProperty(N)&&S!==k&&(S!=null||k!=null))if(N==="style")if(k){for(m in k)!k.hasOwnProperty(m)||S&&S.hasOwnProperty(m)||(s||(s={}),s[m]="");for(m in S)S.hasOwnProperty(m)&&k[m]!==S[m]&&(s||(s={}),s[m]=S[m])}else s||(p||(p=[]),p.push(N,s)),s=S;else N==="dangerouslySetInnerHTML"?(S=S?S.__html:void 0,k=k?k.__html:void 0,S!=null&&k!==S&&(p=p||[]).push(N,S)):N==="children"?typeof S!="string"&&typeof S!="number"||(p=p||[]).push(N,""+S):N!=="suppressContentEditableWarning"&&N!=="suppressHydrationWarning"&&(i.hasOwnProperty(N)?(S!=null&&N==="onScroll"&&Ve("scroll",n),p||k===S||(p=[])):(p=p||[]).push(N,S))}s&&(p=p||[]).push("style",s);var N=p;(r.updateQueue=N)&&(r.flags|=4)}},vw=function(n,r,s,u){s!==u&&(r.flags|=4)};function Vi(n,r){if(!Ye)switch(n.tailMode){case"hidden":r=n.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?n.tail=null:s.sibling=null;break;case"collapsed":s=n.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?r||n.tail===null?n.tail=null:n.tail.sibling=null:u.sibling=null}}function At(n){var r=n.alternate!==null&&n.alternate.child===n.child,s=0,u=0;if(r)for(var f=n.child;f!==null;)s|=f.lanes|f.childLanes,u|=f.subtreeFlags&14680064,u|=f.flags&14680064,f.return=n,f=f.sibling;else for(f=n.child;f!==null;)s|=f.lanes|f.childLanes,u|=f.subtreeFlags,u|=f.flags,f.return=n,f=f.sibling;return n.subtreeFlags|=u,n.childLanes=s,r}function RB(n,r,s){var u=r.pendingProps;switch(Zf(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return At(r),null;case 1:return Ht(r.type)&&vl(),At(r),null;case 3:return u=r.stateNode,Ro(),$e(zt),$e(Et),dh(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(n===null||n.child===null)&&(Tl(r)?r.flags|=4:n===null||n.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,mn!==null&&(jh(mn),mn=null))),_h(n,r),At(r),null;case 5:ch(r);var f=Kr(ji.current);if(s=r.type,n!==null&&r.stateNode!=null)mw(n,r,s,u,f),n.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!u){if(r.stateNode===null)throw Error(t(166));return At(r),null}if(n=Kr(In.current),Tl(r)){u=r.stateNode,s=r.type;var p=r.memoizedProps;switch(u[An]=r,u[Pi]=p,n=(r.mode&1)!==0,s){case"dialog":Ve("cancel",u),Ve("close",u);break;case"iframe":case"object":case"embed":Ve("load",u);break;case"video":case"audio":for(f=0;f<Oi.length;f++)Ve(Oi[f],u);break;case"source":Ve("error",u);break;case"img":case"image":case"link":Ve("error",u),Ve("load",u);break;case"details":Ve("toggle",u);break;case"input":Qy(u,p),Ve("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!p.multiple},Ve("invalid",u);break;case"textarea":eb(u,p),Ve("invalid",u)}uf(s,p),f=null;for(var m in p)if(p.hasOwnProperty(m)){var k=p[m];m==="children"?typeof k=="string"?u.textContent!==k&&(p.suppressHydrationWarning!==!0&&pl(u.textContent,k,n),f=["children",k]):typeof k=="number"&&u.textContent!==""+k&&(p.suppressHydrationWarning!==!0&&pl(u.textContent,k,n),f=["children",""+k]):i.hasOwnProperty(m)&&k!=null&&m==="onScroll"&&Ve("scroll",u)}switch(s){case"input":rr(u),Jy(u,p,!0);break;case"textarea":rr(u),nb(u);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(u.onclick=gl)}u=f,r.updateQueue=u,u!==null&&(r.flags|=4)}else{m=f.nodeType===9?f:f.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=rb(s)),n==="http://www.w3.org/1999/xhtml"?s==="script"?(n=m.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild)):typeof u.is=="string"?n=m.createElement(s,{is:u.is}):(n=m.createElement(s),s==="select"&&(m=n,u.multiple?m.multiple=!0:u.size&&(m.size=u.size))):n=m.createElementNS(n,s),n[An]=r,n[Pi]=u,gw(n,r,!1,!1),r.stateNode=n;e:{switch(m=df(s,u),s){case"dialog":Ve("cancel",n),Ve("close",n),f=u;break;case"iframe":case"object":case"embed":Ve("load",n),f=u;break;case"video":case"audio":for(f=0;f<Oi.length;f++)Ve(Oi[f],n);f=u;break;case"source":Ve("error",n),f=u;break;case"img":case"image":case"link":Ve("error",n),Ve("load",n),f=u;break;case"details":Ve("toggle",n),f=u;break;case"input":Qy(n,u),f=of(n,u),Ve("invalid",n);break;case"option":f=u;break;case"select":n._wrapperState={wasMultiple:!!u.multiple},f=G({},u,{value:void 0}),Ve("invalid",n);break;case"textarea":eb(n,u),f=af(n,u),Ve("invalid",n);break;default:f=u}uf(s,f),k=f;for(p in k)if(k.hasOwnProperty(p)){var S=k[p];p==="style"?sb(n,S):p==="dangerouslySetInnerHTML"?(S=S?S.__html:void 0,S!=null&&ob(n,S)):p==="children"?typeof S=="string"?(s!=="textarea"||S!=="")&&pi(n,S):typeof S=="number"&&pi(n,""+S):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(i.hasOwnProperty(p)?S!=null&&p==="onScroll"&&Ve("scroll",n):S!=null&&U(n,p,S,m))}switch(s){case"input":rr(n),Jy(n,u,!1);break;case"textarea":rr(n),nb(n);break;case"option":u.value!=null&&n.setAttribute("value",""+Pe(u.value));break;case"select":n.multiple=!!u.multiple,p=u.value,p!=null?ho(n,!!u.multiple,p,!1):u.defaultValue!=null&&ho(n,!!u.multiple,u.defaultValue,!0);break;default:typeof f.onClick=="function"&&(n.onclick=gl)}switch(s){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}}u&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return At(r),null;case 6:if(n&&r.stateNode!=null)vw(n,r,n.memoizedProps,u);else{if(typeof u!="string"&&r.stateNode===null)throw Error(t(166));if(s=Kr(ji.current),Kr(In.current),Tl(r)){if(u=r.stateNode,s=r.memoizedProps,u[An]=r,(p=u.nodeValue!==s)&&(n=$t,n!==null))switch(n.tag){case 3:pl(u.nodeValue,s,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&pl(u.nodeValue,s,(n.mode&1)!==0)}p&&(r.flags|=4)}else u=(s.nodeType===9?s:s.ownerDocument).createTextNode(u),u[An]=r,r.stateNode=u}return At(r),null;case 13:if($e(Je),u=r.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(Ye&&Gt!==null&&(r.mode&1)!==0&&(r.flags&128)===0)kk(),Ao(),r.flags|=98560,p=!1;else if(p=Tl(r),u!==null&&u.dehydrated!==null){if(n===null){if(!p)throw Error(t(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(t(317));p[An]=r}else Ao(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;At(r),p=!1}else mn!==null&&(jh(mn),mn=null),p=!0;if(!p)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=s,r):(u=u!==null,u!==(n!==null&&n.memoizedState!==null)&&u&&(r.child.flags|=8192,(r.mode&1)!==0&&(n===null||(Je.current&1)!==0?pt===0&&(pt=3):Wh())),r.updateQueue!==null&&(r.flags|=4),At(r),null);case 4:return Ro(),_h(n,r),n===null&&Li(r.stateNode.containerInfo),At(r),null;case 10:return oh(r.type._context),At(r),null;case 17:return Ht(r.type)&&vl(),At(r),null;case 19:if($e(Je),p=r.memoizedState,p===null)return At(r),null;if(u=(r.flags&128)!==0,m=p.rendering,m===null)if(u)Vi(p,!1);else{if(pt!==0||n!==null&&(n.flags&128)!==0)for(n=r.child;n!==null;){if(m=Al(n),m!==null){for(r.flags|=128,Vi(p,!1),u=m.updateQueue,u!==null&&(r.updateQueue=u,r.flags|=4),r.subtreeFlags=0,u=s,s=r.child;s!==null;)p=s,n=u,p.flags&=14680066,m=p.alternate,m===null?(p.childLanes=0,p.lanes=n,p.child=null,p.subtreeFlags=0,p.memoizedProps=null,p.memoizedState=null,p.updateQueue=null,p.dependencies=null,p.stateNode=null):(p.childLanes=m.childLanes,p.lanes=m.lanes,p.child=m.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=m.memoizedProps,p.memoizedState=m.memoizedState,p.updateQueue=m.updateQueue,p.type=m.type,n=m.dependencies,p.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),s=s.sibling;return Ke(Je,Je.current&1|2),r.child}n=n.sibling}p.tail!==null&&it()>Po&&(r.flags|=128,u=!0,Vi(p,!1),r.lanes=4194304)}else{if(!u)if(n=Al(m),n!==null){if(r.flags|=128,u=!0,s=n.updateQueue,s!==null&&(r.updateQueue=s,r.flags|=4),Vi(p,!0),p.tail===null&&p.tailMode==="hidden"&&!m.alternate&&!Ye)return At(r),null}else 2*it()-p.renderingStartTime>Po&&s!==1073741824&&(r.flags|=128,u=!0,Vi(p,!1),r.lanes=4194304);p.isBackwards?(m.sibling=r.child,r.child=m):(s=p.last,s!==null?s.sibling=m:r.child=m,p.last=m)}return p.tail!==null?(r=p.tail,p.rendering=r,p.tail=r.sibling,p.renderingStartTime=it(),r.sibling=null,s=Je.current,Ke(Je,u?s&1|2:s&1),r):(At(r),null);case 22:case 23:return Uh(),u=r.memoizedState!==null,n!==null&&n.memoizedState!==null!==u&&(r.flags|=8192),u&&(r.mode&1)!==0?(Xt&1073741824)!==0&&(At(r),r.subtreeFlags&6&&(r.flags|=8192)):At(r),null;case 24:return null;case 25:return null}throw Error(t(156,r.tag))}function OB(n,r){switch(Zf(r),r.tag){case 1:return Ht(r.type)&&vl(),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return Ro(),$e(zt),$e(Et),dh(),n=r.flags,(n&65536)!==0&&(n&128)===0?(r.flags=n&-65537|128,r):null;case 5:return ch(r),null;case 13:if($e(Je),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(t(340));Ao()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return $e(Je),null;case 4:return Ro(),null;case 10:return oh(r.type._context),null;case 22:case 23:return Uh(),null;case 24:return null;default:return null}}var Ml=!1,It=!1,LB=typeof WeakSet=="function"?WeakSet:Set,Q=null;function Lo(n,r){var s=n.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(u){rt(n,r,u)}else s.current=null}function Nh(n,r,s){try{s()}catch(u){rt(n,r,u)}}var yw=!1;function DB(n,r){if(Uf=rl,n=Yb(),Df(n)){if("selectionStart"in n)var s={start:n.selectionStart,end:n.selectionEnd};else e:{s=(s=n.ownerDocument)&&s.defaultView||window;var u=s.getSelection&&s.getSelection();if(u&&u.rangeCount!==0){s=u.anchorNode;var f=u.anchorOffset,p=u.focusNode;u=u.focusOffset;try{s.nodeType,p.nodeType}catch(K){s=null;break e}var m=0,k=-1,S=-1,N=0,z=0,j=n,M=null;t:for(;;){for(var $;j!==s||f!==0&&j.nodeType!==3||(k=m+f),j!==p||u!==0&&j.nodeType!==3||(S=m+u),j.nodeType===3&&(m+=j.nodeValue.length),($=j.firstChild)!==null;)M=j,j=$;for(;;){if(j===n)break t;if(M===s&&++N===f&&(k=m),M===p&&++z===u&&(S=m),($=j.nextSibling)!==null)break;j=M,M=j.parentNode}j=$}s=k===-1||S===-1?null:{start:k,end:S}}else s=null}s=s||{start:0,end:0}}else s=null;for(Wf={focusedElem:n,selectionRange:s},rl=!1,Q=r;Q!==null;)if(r=Q,n=r.child,(r.subtreeFlags&1028)!==0&&n!==null)n.return=r,Q=n;else for(;Q!==null;){r=Q;try{var ne=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(ne!==null){var oe=ne.memoizedProps,st=ne.memoizedState,I=r.stateNode,E=I.getSnapshotBeforeUpdate(r.elementType===r.type?oe:vn(r.type,oe),st);I.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var _=r.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(K){rt(r,r.return,K)}if(n=r.sibling,n!==null){n.return=r.return,Q=n;break}Q=r.return}return ne=yw,yw=!1,ne}function $i(n,r,s){var u=r.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var f=u=u.next;do{if((f.tag&n)===n){var p=f.destroy;f.destroy=void 0,p!==void 0&&Nh(r,s,p)}f=f.next}while(f!==u)}}function Fl(n,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&n)===n){var u=s.create;s.destroy=u()}s=s.next}while(s!==r)}}function Rh(n){var r=n.ref;if(r!==null){var s=n.stateNode;switch(n.tag){case 5:n=s;break;default:n=s}typeof r=="function"?r(n):r.current=n}}function bw(n){var r=n.alternate;r!==null&&(n.alternate=null,bw(r)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(r=n.stateNode,r!==null&&(delete r[An],delete r[Pi],delete r[Gf],delete r[vB],delete r[yB])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function kw(n){return n.tag===5||n.tag===3||n.tag===4}function ww(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||kw(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Oh(n,r,s){var u=n.tag;if(u===5||u===6)n=n.stateNode,r?s.nodeType===8?s.parentNode.insertBefore(n,r):s.insertBefore(n,r):(s.nodeType===8?(r=s.parentNode,r.insertBefore(n,s)):(r=s,r.appendChild(n)),s=s._reactRootContainer,s!=null||r.onclick!==null||(r.onclick=gl));else if(u!==4&&(n=n.child,n!==null))for(Oh(n,r,s),n=n.sibling;n!==null;)Oh(n,r,s),n=n.sibling}function Lh(n,r,s){var u=n.tag;if(u===5||u===6)n=n.stateNode,r?s.insertBefore(n,r):s.appendChild(n);else if(u!==4&&(n=n.child,n!==null))for(Lh(n,r,s),n=n.sibling;n!==null;)Lh(n,r,s),n=n.sibling}var Tt=null,yn=!1;function mr(n,r,s){for(s=s.child;s!==null;)Tw(n,r,s),s=s.sibling}function Tw(n,r,s){if(Bn&&typeof Bn.onCommitFiberUnmount=="function")try{Bn.onCommitFiberUnmount(Qs,s)}catch(k){}switch(s.tag){case 5:It||Lo(s,r);case 6:var u=Tt,f=yn;Tt=null,mr(n,r,s),Tt=u,yn=f,Tt!==null&&(yn?(n=Tt,s=s.stateNode,n.nodeType===8?n.parentNode.removeChild(s):n.removeChild(s)):Tt.removeChild(s.stateNode));break;case 18:Tt!==null&&(yn?(n=Tt,s=s.stateNode,n.nodeType===8?$f(n.parentNode,s):n.nodeType===1&&$f(n,s),Ci(n)):$f(Tt,s.stateNode));break;case 4:u=Tt,f=yn,Tt=s.stateNode.containerInfo,yn=!0,mr(n,r,s),Tt=u,yn=f;break;case 0:case 11:case 14:case 15:if(!It&&(u=s.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){f=u=u.next;do{var p=f,m=p.destroy;p=p.tag,m!==void 0&&((p&2)!==0||(p&4)!==0)&&Nh(s,r,m),f=f.next}while(f!==u)}mr(n,r,s);break;case 1:if(!It&&(Lo(s,r),u=s.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=s.memoizedProps,u.state=s.memoizedState,u.componentWillUnmount()}catch(k){rt(s,r,k)}mr(n,r,s);break;case 21:mr(n,r,s);break;case 22:s.mode&1?(It=(u=It)||s.memoizedState!==null,mr(n,r,s),It=u):mr(n,r,s);break;default:mr(n,r,s)}}function Sw(n){var r=n.updateQueue;if(r!==null){n.updateQueue=null;var s=n.stateNode;s===null&&(s=n.stateNode=new LB),r.forEach(function(u){var f=WB.bind(null,n,u);s.has(u)||(s.add(u),u.then(f,f))})}}function bn(n,r){var s=r.deletions;if(s!==null)for(var u=0;u<s.length;u++){var f=s[u];try{var p=n,m=r,k=m;e:for(;k!==null;){switch(k.tag){case 5:Tt=k.stateNode,yn=!1;break e;case 3:Tt=k.stateNode.containerInfo,yn=!0;break e;case 4:Tt=k.stateNode.containerInfo,yn=!0;break e}k=k.return}if(Tt===null)throw Error(t(160));Tw(p,m,f),Tt=null,yn=!1;var S=f.alternate;S!==null&&(S.return=null),f.return=null}catch(N){rt(f,r,N)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)xw(r,n),r=r.sibling}function xw(n,r){var s=n.alternate,u=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(bn(r,n),Nn(n),u&4){try{$i(3,n,n.return),Fl(3,n)}catch(oe){rt(n,n.return,oe)}try{$i(5,n,n.return)}catch(oe){rt(n,n.return,oe)}}break;case 1:bn(r,n),Nn(n),u&512&&s!==null&&Lo(s,s.return);break;case 5:if(bn(r,n),Nn(n),u&512&&s!==null&&Lo(s,s.return),n.flags&32){var f=n.stateNode;try{pi(f,"")}catch(oe){rt(n,n.return,oe)}}if(u&4&&(f=n.stateNode,f!=null)){var p=n.memoizedProps,m=s!==null?s.memoizedProps:p,k=n.type,S=n.updateQueue;if(n.updateQueue=null,S!==null)try{k==="input"&&p.type==="radio"&&p.name!=null&&Zy(f,p),df(k,m);var N=df(k,p);for(m=0;m<S.length;m+=2){var z=S[m],j=S[m+1];z==="style"?sb(f,j):z==="dangerouslySetInnerHTML"?ob(f,j):z==="children"?pi(f,j):U(f,z,j,N)}switch(k){case"input":sf(f,p);break;case"textarea":tb(f,p);break;case"select":var M=f._wrapperState.wasMultiple;f._wrapperState.wasMultiple=!!p.multiple;var $=p.value;$!=null?ho(f,!!p.multiple,$,!1):M!==!!p.multiple&&(p.defaultValue!=null?ho(f,!!p.multiple,p.defaultValue,!0):ho(f,!!p.multiple,p.multiple?[]:"",!1))}f[Pi]=p}catch(oe){rt(n,n.return,oe)}}break;case 6:if(bn(r,n),Nn(n),u&4){if(n.stateNode===null)throw Error(t(162));f=n.stateNode,p=n.memoizedProps;try{f.nodeValue=p}catch(oe){rt(n,n.return,oe)}}break;case 3:if(bn(r,n),Nn(n),u&4&&s!==null&&s.memoizedState.isDehydrated)try{Ci(r.containerInfo)}catch(oe){rt(n,n.return,oe)}break;case 4:bn(r,n),Nn(n);break;case 13:bn(r,n),Nn(n),f=n.child,f.flags&8192&&(p=f.memoizedState!==null,f.stateNode.isHidden=p,!p||f.alternate!==null&&f.alternate.memoizedState!==null||(Mh=it())),u&4&&Sw(n);break;case 22:if(z=s!==null&&s.memoizedState!==null,n.mode&1?(It=(N=It)||z,bn(r,n),It=N):bn(r,n),Nn(n),u&8192){if(N=n.memoizedState!==null,(n.stateNode.isHidden=N)&&!z&&(n.mode&1)!==0)for(Q=n,z=n.child;z!==null;){for(j=Q=z;Q!==null;){switch(M=Q,$=M.child,M.tag){case 0:case 11:case 14:case 15:$i(4,M,M.return);break;case 1:Lo(M,M.return);var ne=M.stateNode;if(typeof ne.componentWillUnmount=="function"){u=M,s=M.return;try{r=u,ne.props=r.memoizedProps,ne.state=r.memoizedState,ne.componentWillUnmount()}catch(oe){rt(u,s,oe)}}break;case 5:Lo(M,M.return);break;case 22:if(M.memoizedState!==null){Bw(j);continue}}$!==null?($.return=M,Q=$):Bw(j)}z=z.sibling}e:for(z=null,j=n;;){if(j.tag===5){if(z===null){z=j;try{f=j.stateNode,N?(p=f.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(k=j.stateNode,S=j.memoizedProps.style,m=S!=null&&S.hasOwnProperty("display")?S.display:null,k.style.display=ib("display",m))}catch(oe){rt(n,n.return,oe)}}}else if(j.tag===6){if(z===null)try{j.stateNode.nodeValue=N?"":j.memoizedProps}catch(oe){rt(n,n.return,oe)}}else if((j.tag!==22&&j.tag!==23||j.memoizedState===null||j===n)&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===n)break e;for(;j.sibling===null;){if(j.return===null||j.return===n)break e;z===j&&(z=null),j=j.return}z===j&&(z=null),j.sibling.return=j.return,j=j.sibling}}break;case 19:bn(r,n),Nn(n),u&4&&Sw(n);break;case 21:break;default:bn(r,n),Nn(n)}}function Nn(n){var r=n.flags;if(r&2){try{e:{for(var s=n.return;s!==null;){if(kw(s)){var u=s;break e}s=s.return}throw Error(t(160))}switch(u.tag){case 5:var f=u.stateNode;u.flags&32&&(pi(f,""),u.flags&=-33);var p=ww(n);Lh(n,p,f);break;case 3:case 4:var m=u.stateNode.containerInfo,k=ww(n);Oh(n,k,m);break;default:throw Error(t(161))}}catch(S){rt(n,n.return,S)}n.flags&=-3}r&4096&&(n.flags&=-4097)}function PB(n,r,s){Q=n,Cw(n)}function Cw(n,r,s){for(var u=(n.mode&1)!==0;Q!==null;){var f=Q,p=f.child;if(f.tag===22&&u){var m=f.memoizedState!==null||Ml;if(!m){var k=f.alternate,S=k!==null&&k.memoizedState!==null||It;k=Ml;var N=It;if(Ml=m,(It=S)&&!N)for(Q=f;Q!==null;)m=Q,S=m.child,m.tag===22&&m.memoizedState!==null?Aw(f):S!==null?(S.return=m,Q=S):Aw(f);for(;p!==null;)Q=p,Cw(p),p=p.sibling;Q=f,Ml=k,It=N}Ew(n)}else(f.subtreeFlags&8772)!==0&&p!==null?(p.return=f,Q=p):Ew(n)}}function Ew(n){for(;Q!==null;){var r=Q;if((r.flags&8772)!==0){var s=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:It||Fl(5,r);break;case 1:var u=r.stateNode;if(r.flags&4&&!It)if(s===null)u.componentDidMount();else{var f=r.elementType===r.type?s.memoizedProps:vn(r.type,s.memoizedProps);u.componentDidUpdate(f,s.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var p=r.updateQueue;p!==null&&Bk(r,p,u);break;case 3:var m=r.updateQueue;if(m!==null){if(s=null,r.child!==null)switch(r.child.tag){case 5:s=r.child.stateNode;break;case 1:s=r.child.stateNode}Bk(r,m,s)}break;case 5:var k=r.stateNode;if(s===null&&r.flags&4){s=k;var S=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":S.autoFocus&&s.focus();break;case"img":S.src&&(s.src=S.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var N=r.alternate;if(N!==null){var z=N.memoizedState;if(z!==null){var j=z.dehydrated;j!==null&&Ci(j)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}It||r.flags&512&&Rh(r)}catch(M){rt(r,r.return,M)}}if(r===n){Q=null;break}if(s=r.sibling,s!==null){s.return=r.return,Q=s;break}Q=r.return}}function Bw(n){for(;Q!==null;){var r=Q;if(r===n){Q=null;break}var s=r.sibling;if(s!==null){s.return=r.return,Q=s;break}Q=r.return}}function Aw(n){for(;Q!==null;){var r=Q;try{switch(r.tag){case 0:case 11:case 15:var s=r.return;try{Fl(4,r)}catch(S){rt(r,s,S)}break;case 1:var u=r.stateNode;if(typeof u.componentDidMount=="function"){var f=r.return;try{u.componentDidMount()}catch(S){rt(r,f,S)}}var p=r.return;try{Rh(r)}catch(S){rt(r,p,S)}break;case 5:var m=r.return;try{Rh(r)}catch(S){rt(r,m,S)}}}catch(S){rt(r,r.return,S)}if(r===n){Q=null;break}var k=r.sibling;if(k!==null){k.return=r.return,Q=k;break}Q=r.return}}var MB=Math.ceil,zl=H.ReactCurrentDispatcher,Dh=H.ReactCurrentOwner,an=H.ReactCurrentBatchConfig,Le=0,yt=null,dt=null,St=0,Xt=0,Do=dr(0),pt=0,Gi=null,$r=0,Hl=0,Ph=0,Xi=null,qt=null,Mh=0,Po=1/0,Gn=null,jl=!1,Fh=null,vr=null,ql=!1,yr=null,Ul=0,Yi=0,zh=null,Wl=-1,Kl=0;function Dt(){return(Le&6)!==0?it():Wl!==-1?Wl:Wl=it()}function br(n){return(n.mode&1)===0?1:(Le&2)!==0&&St!==0?St&-St:kB.transition!==null?(Kl===0&&(Kl=wb()),Kl):(n=je,n!==0||(n=window.event,n=n===void 0?16:_b(n.type)),n)}function kn(n,r,s,u){if(50<Yi)throw Yi=0,zh=null,Error(t(185));ki(n,s,u),((Le&2)===0||n!==yt)&&(n===yt&&((Le&2)===0&&(Hl|=s),pt===4&&kr(n,St)),Ut(n,u),s===1&&Le===0&&(r.mode&1)===0&&(Po=it()+500,bl&&hr()))}function Ut(n,r){var s=n.callbackNode;kE(n,r);var u=el(n,n===yt?St:0);if(u===0)s!==null&&yb(s),n.callbackNode=null,n.callbackPriority=0;else if(r=u&-u,n.callbackPriority!==r){if(s!=null&&yb(s),r===1)n.tag===0?bB(_w.bind(null,n)):gk(_w.bind(null,n)),gB(function(){(Le&6)===0&&hr()}),s=null;else{switch(Tb(u)){case 1:s=yf;break;case 4:s=bb;break;case 16:s=Ys;break;case 536870912:s=kb;break;default:s=Ys}s=Fw(s,Iw.bind(null,n))}n.callbackPriority=r,n.callbackNode=s}}function Iw(n,r){if(Wl=-1,Kl=0,(Le&6)!==0)throw Error(t(327));var s=n.callbackNode;if(Mo()&&n.callbackNode!==s)return null;var u=el(n,n===yt?St:0);if(u===0)return null;if((u&30)!==0||(u&n.expiredLanes)!==0||r)r=Vl(n,u);else{r=u;var f=Le;Le|=2;var p=Rw();(yt!==n||St!==r)&&(Gn=null,Po=it()+500,Xr(n,r));do try{HB();break}catch(k){Nw(n,k)}while(!0);rh(),zl.current=p,Le=f,dt!==null?r=0:(yt=null,St=0,r=pt)}if(r!==0){if(r===2&&(f=bf(n),f!==0&&(u=f,r=Hh(n,f))),r===1)throw s=Gi,Xr(n,0),kr(n,u),Ut(n,it()),s;if(r===6)kr(n,u);else{if(f=n.current.alternate,(u&30)===0&&!FB(f)&&(r=Vl(n,u),r===2&&(p=bf(n),p!==0&&(u=p,r=Hh(n,p))),r===1))throw s=Gi,Xr(n,0),kr(n,u),Ut(n,it()),s;switch(n.finishedWork=f,n.finishedLanes=u,r){case 0:case 1:throw Error(t(345));case 2:Yr(n,qt,Gn);break;case 3:if(kr(n,u),(u&130023424)===u&&(r=Mh+500-it(),10<r)){if(el(n,0)!==0)break;if(f=n.suspendedLanes,(f&u)!==u){Dt(),n.pingedLanes|=n.suspendedLanes&f;break}n.timeoutHandle=Vf(Yr.bind(null,n,qt,Gn),r);break}Yr(n,qt,Gn);break;case 4:if(kr(n,u),(u&4194240)===u)break;for(r=n.eventTimes,f=-1;0<u;){var m=31-pn(u);p=1<<m,m=r[m],m>f&&(f=m),u&=~p}if(u=f,u=it()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*MB(u/1960))-u,10<u){n.timeoutHandle=Vf(Yr.bind(null,n,qt,Gn),u);break}Yr(n,qt,Gn);break;case 5:Yr(n,qt,Gn);break;default:throw Error(t(329))}}}return Ut(n,it()),n.callbackNode===s?Iw.bind(null,n):null}function Hh(n,r){var s=Xi;return n.current.memoizedState.isDehydrated&&(Xr(n,r).flags|=256),n=Vl(n,r),n!==2&&(r=qt,qt=s,r!==null&&jh(r)),n}function jh(n){qt===null?qt=n:qt.push.apply(qt,n)}function FB(n){for(var r=n;;){if(r.flags&16384){var s=r.updateQueue;if(s!==null&&(s=s.stores,s!==null))for(var u=0;u<s.length;u++){var f=s[u],p=f.getSnapshot;f=f.value;try{if(!gn(p(),f))return!1}catch(m){return!1}}}if(s=r.child,r.subtreeFlags&16384&&s!==null)s.return=r,r=s;else{if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function kr(n,r){for(r&=~Ph,r&=~Hl,n.suspendedLanes|=r,n.pingedLanes&=~r,n=n.expirationTimes;0<r;){var s=31-pn(r),u=1<<s;n[s]=-1,r&=~u}}function _w(n){if((Le&6)!==0)throw Error(t(327));Mo();var r=el(n,0);if((r&1)===0)return Ut(n,it()),null;var s=Vl(n,r);if(n.tag!==0&&s===2){var u=bf(n);u!==0&&(r=u,s=Hh(n,u))}if(s===1)throw s=Gi,Xr(n,0),kr(n,r),Ut(n,it()),s;if(s===6)throw Error(t(345));return n.finishedWork=n.current.alternate,n.finishedLanes=r,Yr(n,qt,Gn),Ut(n,it()),null}function qh(n,r){var s=Le;Le|=1;try{return n(r)}finally{Le=s,Le===0&&(Po=it()+500,bl&&hr())}}function Gr(n){yr!==null&&yr.tag===0&&(Le&6)===0&&Mo();var r=Le;Le|=1;var s=an.transition,u=je;try{if(an.transition=null,je=1,n)return n()}finally{je=u,an.transition=s,Le=r,(Le&6)===0&&hr()}}function Uh(){Xt=Do.current,$e(Do)}function Xr(n,r){n.finishedWork=null,n.finishedLanes=0;var s=n.timeoutHandle;if(s!==-1&&(n.timeoutHandle=-1,pB(s)),dt!==null)for(s=dt.return;s!==null;){var u=s;switch(Zf(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&vl();break;case 3:Ro(),$e(zt),$e(Et),dh();break;case 5:ch(u);break;case 4:Ro();break;case 13:$e(Je);break;case 19:$e(Je);break;case 10:oh(u.type._context);break;case 22:case 23:Uh()}s=s.return}if(yt=n,dt=n=wr(n.current,null),St=Xt=r,pt=0,Gi=null,Ph=Hl=$r=0,qt=Xi=null,Wr!==null){for(r=0;r<Wr.length;r++)if(s=Wr[r],u=s.interleaved,u!==null){s.interleaved=null;var f=u.next,p=s.pending;if(p!==null){var m=p.next;p.next=f,u.next=m}s.pending=u}Wr=null}return n}function Nw(n,r){do{var s=dt;try{if(rh(),Il.current=Ol,_l){for(var u=et.memoizedState;u!==null;){var f=u.queue;f!==null&&(f.pending=null),u=u.next}_l=!1}if(Vr=0,vt=ht=et=null,qi=!1,Ui=0,Dh.current=null,s===null||s.return===null){pt=1,Gi=r,dt=null;break}e:{var p=n,m=s.return,k=s,S=r;if(r=St,k.flags|=32768,S!==null&&typeof S=="object"&&typeof S.then=="function"){var N=S,z=k,j=z.tag;if((z.mode&1)===0&&(j===0||j===11||j===15)){var M=z.alternate;M?(z.updateQueue=M.updateQueue,z.memoizedState=M.memoizedState,z.lanes=M.lanes):(z.updateQueue=null,z.memoizedState=null)}var $=nw(m);if($!==null){$.flags&=-257,rw($,m,k,p,r),$.mode&1&&tw(p,N,r),r=$,S=N;var ne=r.updateQueue;if(ne===null){var oe=new Set;oe.add(S),r.updateQueue=oe}else ne.add(S);break e}else{if((r&1)===0){tw(p,N,r),Wh();break e}S=Error(t(426))}}else if(Ye&&k.mode&1){var st=nw(m);if(st!==null){(st.flags&65536)===0&&(st.flags|=256),rw(st,m,k,p,r),th(Oo(S,k));break e}}p=S=Oo(S,k),pt!==4&&(pt=2),Xi===null?Xi=[p]:Xi.push(p),p=m;do{switch(p.tag){case 3:p.flags|=65536,r&=-r,p.lanes|=r;var I=Jk(p,S,r);Ek(p,I);break e;case 1:k=S;var E=p.type,_=p.stateNode;if((p.flags&128)===0&&(typeof E.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(vr===null||!vr.has(_)))){p.flags|=65536,r&=-r,p.lanes|=r;var K=ew(p,k,r);Ek(p,K);break e}}p=p.return}while(p!==null)}Lw(s)}catch(ie){r=ie,dt===s&&s!==null&&(dt=s=s.return);continue}break}while(!0)}function Rw(){var n=zl.current;return zl.current=Ol,n===null?Ol:n}function Wh(){(pt===0||pt===3||pt===2)&&(pt=4),yt===null||($r&268435455)===0&&(Hl&268435455)===0||kr(yt,St)}function Vl(n,r){var s=Le;Le|=2;var u=Rw();(yt!==n||St!==r)&&(Gn=null,Xr(n,r));do try{zB();break}catch(f){Nw(n,f)}while(!0);if(rh(),Le=s,zl.current=u,dt!==null)throw Error(t(261));return yt=null,St=0,pt}function zB(){for(;dt!==null;)Ow(dt)}function HB(){for(;dt!==null&&!dE();)Ow(dt)}function Ow(n){var r=Mw(n.alternate,n,Xt);n.memoizedProps=n.pendingProps,r===null?Lw(n):dt=r,Dh.current=null}function Lw(n){var r=n;do{var s=r.alternate;if(n=r.return,(r.flags&32768)===0){if(s=RB(s,r,Xt),s!==null){dt=s;return}}else{if(s=OB(s,r),s!==null){s.flags&=32767,dt=s;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{pt=6,dt=null;return}}if(r=r.sibling,r!==null){dt=r;return}dt=r=n}while(r!==null);pt===0&&(pt=5)}function Yr(n,r,s){var u=je,f=an.transition;try{an.transition=null,je=1,jB(n,r,s,u)}finally{an.transition=f,je=u}return null}function jB(n,r,s,u){do Mo();while(yr!==null);if((Le&6)!==0)throw Error(t(327));s=n.finishedWork;var f=n.finishedLanes;if(s===null)return null;if(n.finishedWork=null,n.finishedLanes=0,s===n.current)throw Error(t(177));n.callbackNode=null,n.callbackPriority=0;var p=s.lanes|s.childLanes;if(wE(n,p),n===yt&&(dt=yt=null,St=0),(s.subtreeFlags&2064)===0&&(s.flags&2064)===0||ql||(ql=!0,Fw(Ys,function(){return Mo(),null})),p=(s.flags&15990)!==0,(s.subtreeFlags&15990)!==0||p){p=an.transition,an.transition=null;var m=je;je=1;var k=Le;Le|=4,Dh.current=null,DB(n,s),xw(s,n),lB(Wf),rl=!!Uf,Wf=Uf=null,n.current=s,PB(s),fE(),Le=k,je=m,an.transition=p}else n.current=s;if(ql&&(ql=!1,yr=n,Ul=f),p=n.pendingLanes,p===0&&(vr=null),gE(s.stateNode),Ut(n,it()),r!==null)for(u=n.onRecoverableError,s=0;s<r.length;s++)f=r[s],u(f.value,{componentStack:f.stack,digest:f.digest});if(jl)throw jl=!1,n=Fh,Fh=null,n;return(Ul&1)!==0&&n.tag!==0&&Mo(),p=n.pendingLanes,(p&1)!==0?n===zh?Yi++:(Yi=0,zh=n):Yi=0,hr(),null}function Mo(){if(yr!==null){var n=Tb(Ul),r=an.transition,s=je;try{if(an.transition=null,je=16>n?16:n,yr===null)var u=!1;else{if(n=yr,yr=null,Ul=0,(Le&6)!==0)throw Error(t(331));var f=Le;for(Le|=4,Q=n.current;Q!==null;){var p=Q,m=p.child;if((Q.flags&16)!==0){var k=p.deletions;if(k!==null){for(var S=0;S<k.length;S++){var N=k[S];for(Q=N;Q!==null;){var z=Q;switch(z.tag){case 0:case 11:case 15:$i(8,z,p)}var j=z.child;if(j!==null)j.return=z,Q=j;else for(;Q!==null;){z=Q;var M=z.sibling,$=z.return;if(bw(z),z===N){Q=null;break}if(M!==null){M.return=$,Q=M;break}Q=$}}}var ne=p.alternate;if(ne!==null){var oe=ne.child;if(oe!==null){ne.child=null;do{var st=oe.sibling;oe.sibling=null,oe=st}while(oe!==null)}}Q=p}}if((p.subtreeFlags&2064)!==0&&m!==null)m.return=p,Q=m;else e:for(;Q!==null;){if(p=Q,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:$i(9,p,p.return)}var I=p.sibling;if(I!==null){I.return=p.return,Q=I;break e}Q=p.return}}var E=n.current;for(Q=E;Q!==null;){m=Q;var _=m.child;if((m.subtreeFlags&2064)!==0&&_!==null)_.return=m,Q=_;else e:for(m=E;Q!==null;){if(k=Q,(k.flags&2048)!==0)try{switch(k.tag){case 0:case 11:case 15:Fl(9,k)}}catch(ie){rt(k,k.return,ie)}if(k===m){Q=null;break e}var K=k.sibling;if(K!==null){K.return=k.return,Q=K;break e}Q=k.return}}if(Le=f,hr(),Bn&&typeof Bn.onPostCommitFiberRoot=="function")try{Bn.onPostCommitFiberRoot(Qs,n)}catch(ie){}u=!0}return u}finally{je=s,an.transition=r}}return!1}function Dw(n,r,s){r=Oo(s,r),r=Jk(n,r,1),n=gr(n,r,1),r=Dt(),n!==null&&(ki(n,1,r),Ut(n,r))}function rt(n,r,s){if(n.tag===3)Dw(n,n,s);else for(;r!==null;){if(r.tag===3){Dw(r,n,s);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(vr===null||!vr.has(u))){n=Oo(s,n),n=ew(r,n,1),r=gr(r,n,1),n=Dt(),r!==null&&(ki(r,1,n),Ut(r,n));break}}r=r.return}}function qB(n,r,s){var u=n.pingCache;u!==null&&u.delete(r),r=Dt(),n.pingedLanes|=n.suspendedLanes&s,yt===n&&(St&s)===s&&(pt===4||pt===3&&(St&130023424)===St&&500>it()-Mh?Xr(n,0):Ph|=s),Ut(n,r)}function Pw(n,r){r===0&&((n.mode&1)===0?r=1:(r=Js,Js<<=1,(Js&130023424)===0&&(Js=4194304)));var s=Dt();n=Kn(n,r),n!==null&&(ki(n,r,s),Ut(n,s))}function UB(n){var r=n.memoizedState,s=0;r!==null&&(s=r.retryLane),Pw(n,s)}function WB(n,r){var s=0;switch(n.tag){case 13:var u=n.stateNode,f=n.memoizedState;f!==null&&(s=f.retryLane);break;case 19:u=n.stateNode;break;default:throw Error(t(314))}u!==null&&u.delete(r),Pw(n,s)}var Mw;Mw=function(n,r,s){if(n!==null)if(n.memoizedProps!==r.pendingProps||zt.current)jt=!0;else{if((n.lanes&s)===0&&(r.flags&128)===0)return jt=!1,NB(n,r,s);jt=(n.flags&131072)!==0}else jt=!1,Ye&&(r.flags&1048576)!==0&&mk(r,wl,r.index);switch(r.lanes=0,r.tag){case 2:var u=r.type;Pl(n,r),n=r.pendingProps;var f=Co(r,Et.current);No(r,s),f=ph(null,r,u,n,f,s);var p=gh();return r.flags|=1,typeof f=="object"&&f!==null&&typeof f.render=="function"&&f.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,Ht(u)?(p=!0,yl(r)):p=!1,r.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,lh(r),f.updater=Ll,r.stateNode=f,f._reactInternals=r,wh(r,u,n,s),r=Ch(null,r,u,!0,p,s)):(r.tag=0,Ye&&p&&Qf(r),Lt(null,r,f,s),r=r.child),r;case 16:u=r.elementType;e:{switch(Pl(n,r),n=r.pendingProps,f=u._init,u=f(u._payload),r.type=u,f=r.tag=VB(u),n=vn(u,n),f){case 0:r=xh(null,r,u,n,s);break e;case 1:r=cw(null,r,u,n,s);break e;case 11:r=ow(null,r,u,n,s);break e;case 14:r=iw(null,r,u,vn(u.type,n),s);break e}throw Error(t(306,u,""))}return r;case 0:return u=r.type,f=r.pendingProps,f=r.elementType===u?f:vn(u,f),xh(n,r,u,f,s);case 1:return u=r.type,f=r.pendingProps,f=r.elementType===u?f:vn(u,f),cw(n,r,u,f,s);case 3:e:{if(uw(r),n===null)throw Error(t(387));u=r.pendingProps,p=r.memoizedState,f=p.element,Ck(n,r),Bl(r,u,null,s);var m=r.memoizedState;if(u=m.element,p.isDehydrated)if(p={element:u,isDehydrated:!1,cache:m.cache,pendingSuspenseBoundaries:m.pendingSuspenseBoundaries,transitions:m.transitions},r.updateQueue.baseState=p,r.memoizedState=p,r.flags&256){f=Oo(Error(t(423)),r),r=dw(n,r,u,s,f);break e}else if(u!==f){f=Oo(Error(t(424)),r),r=dw(n,r,u,s,f);break e}else for(Gt=ur(r.stateNode.containerInfo.firstChild),$t=r,Ye=!0,mn=null,s=Sk(r,null,u,s),r.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Ao(),u===f){r=$n(n,r,s);break e}Lt(n,r,u,s)}r=r.child}return r;case 5:return Ak(r),n===null&&eh(r),u=r.type,f=r.pendingProps,p=n!==null?n.memoizedProps:null,m=f.children,Kf(u,f)?m=null:p!==null&&Kf(u,p)&&(r.flags|=32),aw(n,r),Lt(n,r,m,s),r.child;case 6:return n===null&&eh(r),null;case 13:return fw(n,r,s);case 4:return ah(r,r.stateNode.containerInfo),u=r.pendingProps,n===null?r.child=Io(r,null,u,s):Lt(n,r,u,s),r.child;case 11:return u=r.type,f=r.pendingProps,f=r.elementType===u?f:vn(u,f),ow(n,r,u,f,s);case 7:return Lt(n,r,r.pendingProps,s),r.child;case 8:return Lt(n,r,r.pendingProps.children,s),r.child;case 12:return Lt(n,r,r.pendingProps.children,s),r.child;case 10:e:{if(u=r.type._context,f=r.pendingProps,p=r.memoizedProps,m=f.value,Ke(xl,u._currentValue),u._currentValue=m,p!==null)if(gn(p.value,m)){if(p.children===f.children&&!zt.current){r=$n(n,r,s);break e}}else for(p=r.child,p!==null&&(p.return=r);p!==null;){var k=p.dependencies;if(k!==null){m=p.child;for(var S=k.firstContext;S!==null;){if(S.context===u){if(p.tag===1){S=Vn(-1,s&-s),S.tag=2;var N=p.updateQueue;if(N!==null){N=N.shared;var z=N.pending;z===null?S.next=S:(S.next=z.next,z.next=S),N.pending=S}}p.lanes|=s,S=p.alternate,S!==null&&(S.lanes|=s),ih(p.return,s,r),k.lanes|=s;break}S=S.next}}else if(p.tag===10)m=p.type===r.type?null:p.child;else if(p.tag===18){if(m=p.return,m===null)throw Error(t(341));m.lanes|=s,k=m.alternate,k!==null&&(k.lanes|=s),ih(m,s,r),m=p.sibling}else m=p.child;if(m!==null)m.return=p;else for(m=p;m!==null;){if(m===r){m=null;break}if(p=m.sibling,p!==null){p.return=m.return,m=p;break}m=m.return}p=m}Lt(n,r,f.children,s),r=r.child}return r;case 9:return f=r.type,u=r.pendingProps.children,No(r,s),f=sn(f),u=u(f),r.flags|=1,Lt(n,r,u,s),r.child;case 14:return u=r.type,f=vn(u,r.pendingProps),f=vn(u.type,f),iw(n,r,u,f,s);case 15:return sw(n,r,r.type,r.pendingProps,s);case 17:return u=r.type,f=r.pendingProps,f=r.elementType===u?f:vn(u,f),Pl(n,r),r.tag=1,Ht(u)?(n=!0,yl(r)):n=!1,No(r,s),Qk(r,u,f),wh(r,u,f,s),Ch(null,r,u,!0,n,s);case 19:return pw(n,r,s);case 22:return lw(n,r,s)}throw Error(t(156,r.tag))};function Fw(n,r){return vb(n,r)}function KB(n,r,s,u){this.tag=n,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cn(n,r,s,u){return new KB(n,r,s,u)}function Kh(n){return n=n.prototype,!(!n||!n.isReactComponent)}function VB(n){if(typeof n=="function")return Kh(n)?1:0;if(n!=null){if(n=n.$$typeof,n===ye)return 11;if(n===Re)return 14}return 2}function wr(n,r){var s=n.alternate;return s===null?(s=cn(n.tag,r,n.key,n.mode),s.elementType=n.elementType,s.type=n.type,s.stateNode=n.stateNode,s.alternate=n,n.alternate=s):(s.pendingProps=r,s.type=n.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=n.flags&14680064,s.childLanes=n.childLanes,s.lanes=n.lanes,s.child=n.child,s.memoizedProps=n.memoizedProps,s.memoizedState=n.memoizedState,s.updateQueue=n.updateQueue,r=n.dependencies,s.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},s.sibling=n.sibling,s.index=n.index,s.ref=n.ref,s}function $l(n,r,s,u,f,p){var m=2;if(u=n,typeof n=="function")Kh(n)&&(m=1);else if(typeof n=="string")m=5;else e:switch(n){case W:return Qr(s.children,f,p,r);case F:m=8,f|=8;break;case re:return n=cn(12,s,r,f|2),n.elementType=re,n.lanes=p,n;case J:return n=cn(13,s,r,f),n.elementType=J,n.lanes=p,n;case we:return n=cn(19,s,r,f),n.elementType=we,n.lanes=p,n;case _e:return Gl(s,f,p,r);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case ce:m=10;break e;case Z:m=9;break e;case ye:m=11;break e;case Re:m=14;break e;case xe:m=16,u=null;break e}throw Error(t(130,n==null?n:typeof n,""))}return r=cn(m,s,r,f),r.elementType=n,r.type=u,r.lanes=p,r}function Qr(n,r,s,u){return n=cn(7,n,u,r),n.lanes=s,n}function Gl(n,r,s,u){return n=cn(22,n,u,r),n.elementType=_e,n.lanes=s,n.stateNode={isHidden:!1},n}function Vh(n,r,s){return n=cn(6,n,null,r),n.lanes=s,n}function $h(n,r,s){return r=cn(4,n.children!==null?n.children:[],n.key,r),r.lanes=s,r.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},r}function $B(n,r,s,u,f){this.tag=r,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=kf(0),this.expirationTimes=kf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kf(0),this.identifierPrefix=u,this.onRecoverableError=f,this.mutableSourceEagerHydrationData=null}function Gh(n,r,s,u,f,p,m,k,S){return n=new $B(n,r,s,k,S),r===1?(r=1,p===!0&&(r|=8)):r=0,p=cn(3,null,null,r),n.current=p,p.stateNode=n,p.memoizedState={element:u,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},lh(p),n}function GB(n,r,s){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:q,key:u==null?null:""+u,children:n,containerInfo:r,implementation:s}}function zw(n){if(!n)return fr;n=n._reactInternals;e:{if(zr(n)!==n||n.tag!==1)throw Error(t(170));var r=n;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if(Ht(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(t(171))}if(n.tag===1){var s=n.type;if(Ht(s))return hk(n,s,r)}return r}function Hw(n,r,s,u,f,p,m,k,S){return n=Gh(s,u,!0,n,f,p,m,k,S),n.context=zw(null),s=n.current,u=Dt(),f=br(s),p=Vn(u,f),p.callback=r!=null?r:null,gr(s,p,f),n.current.lanes=f,ki(n,f,u),Ut(n,u),n}function Xl(n,r,s,u){var f=r.current,p=Dt(),m=br(f);return s=zw(s),r.context===null?r.context=s:r.pendingContext=s,r=Vn(p,m),r.payload={element:n},u=u===void 0?null:u,u!==null&&(r.callback=u),n=gr(f,r,m),n!==null&&(kn(n,f,m,p),El(n,f,m)),m}function Yl(n){if(n=n.current,!n.child)return null;switch(n.child.tag){case 5:return n.child.stateNode;default:return n.child.stateNode}}function jw(n,r){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var s=n.retryLane;n.retryLane=s!==0&&s<r?s:r}}function Xh(n,r){jw(n,r),(n=n.alternate)&&jw(n,r)}function XB(){return null}var qw=typeof reportError=="function"?reportError:function(n){console.error(n)};function Yh(n){this._internalRoot=n}Ql.prototype.render=Yh.prototype.render=function(n){var r=this._internalRoot;if(r===null)throw Error(t(409));Xl(n,r,null,null)},Ql.prototype.unmount=Yh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var r=n.containerInfo;Gr(function(){Xl(null,n,null,null)}),r[jn]=null}};function Ql(n){this._internalRoot=n}Ql.prototype.unstable_scheduleHydration=function(n){if(n){var r=Cb();n={blockedOn:null,target:n,priority:r};for(var s=0;s<lr.length&&r!==0&&r<lr[s].priority;s++);lr.splice(s,0,n),s===0&&Ab(n)}};function Qh(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function Zl(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function Uw(){}function YB(n,r,s,u,f){if(f){if(typeof u=="function"){var p=u;u=function(){var N=Yl(m);p.call(N)}}var m=Hw(r,u,n,0,null,!1,!1,"",Uw);return n._reactRootContainer=m,n[jn]=m.current,Li(n.nodeType===8?n.parentNode:n),Gr(),m}for(;f=n.lastChild;)n.removeChild(f);if(typeof u=="function"){var k=u;u=function(){var N=Yl(S);k.call(N)}}var S=Gh(n,0,!1,null,null,!1,!1,"",Uw);return n._reactRootContainer=S,n[jn]=S.current,Li(n.nodeType===8?n.parentNode:n),Gr(function(){Xl(r,S,s,u)}),S}function Jl(n,r,s,u,f){var p=s._reactRootContainer;if(p){var m=p;if(typeof f=="function"){var k=f;f=function(){var S=Yl(m);k.call(S)}}Xl(r,m,n,f)}else m=YB(s,r,n,f,u);return Yl(m)}Sb=function(n){switch(n.tag){case 3:var r=n.stateNode;if(r.current.memoizedState.isDehydrated){var s=bi(r.pendingLanes);s!==0&&(wf(r,s|1),Ut(r,it()),(Le&6)===0&&(Po=it()+500,hr()))}break;case 13:Gr(function(){var u=Kn(n,1);if(u!==null){var f=Dt();kn(u,n,1,f)}}),Xh(n,1)}},Tf=function(n){if(n.tag===13){var r=Kn(n,134217728);if(r!==null){var s=Dt();kn(r,n,134217728,s)}Xh(n,134217728)}},xb=function(n){if(n.tag===13){var r=br(n),s=Kn(n,r);if(s!==null){var u=Dt();kn(s,n,r,u)}Xh(n,r)}},Cb=function(){return je},Eb=function(n,r){var s=je;try{return je=n,r()}finally{je=s}},pf=function(n,r,s){switch(r){case"input":if(sf(n,s),r=s.name,s.type==="radio"&&r!=null){for(s=n;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<s.length;r++){var u=s[r];if(u!==n&&u.form===n.form){var f=ml(u);if(!f)throw Error(t(90));Fr(u),sf(u,f)}}}break;case"textarea":tb(n,s);break;case"select":r=s.value,r!=null&&ho(n,!!s.multiple,r,!1)}},ub=qh,db=Gr;var QB={usingClientEntryPoint:!1,Events:[Mi,So,ml,ab,cb,qh]},Qi={findFiberByHostInstance:Hr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ZB={bundleType:Qi.bundleType,version:Qi.version,rendererPackageName:Qi.rendererPackageName,rendererConfig:Qi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:H.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=gb(n),n===null?null:n.stateNode},findFiberByHostInstance:Qi.findFiberByHostInstance||XB,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"){var ea=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ea.isDisabled&&ea.supportsFiber)try{Qs=ea.inject(ZB),Bn=ea}catch(n){}}return Pt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=QB,Pt.createPortal=function(n,r){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Qh(r))throw Error(t(200));return GB(n,r,null,s)},Pt.createRoot=function(n,r){if(!Qh(n))throw Error(t(299));var s=!1,u="",f=qw;return r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onRecoverableError!==void 0&&(f=r.onRecoverableError)),r=Gh(n,1,!1,null,null,s,!1,u,f),n[jn]=r.current,Li(n.nodeType===8?n.parentNode:n),new Yh(r)},Pt.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var r=n._reactInternals;if(r===void 0)throw typeof n.render=="function"?Error(t(188)):(n=Object.keys(n).join(","),Error(t(268,n)));return n=gb(r),n=n===null?null:n.stateNode,n},Pt.flushSync=function(n){return Gr(n)},Pt.hydrate=function(n,r,s){if(!Zl(r))throw Error(t(200));return Jl(null,n,r,!0,s)},Pt.hydrateRoot=function(n,r,s){if(!Qh(n))throw Error(t(405));var u=s!=null&&s.hydratedSources||null,f=!1,p="",m=qw;if(s!=null&&(s.unstable_strictMode===!0&&(f=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onRecoverableError!==void 0&&(m=s.onRecoverableError)),r=Hw(r,null,n,1,s!=null?s:null,f,!1,p,m),n[jn]=r.current,Li(n),u)for(n=0;n<u.length;n++)s=u[n],f=s._getVersion,f=f(s._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[s,f]:r.mutableSourceEagerHydrationData.push(s,f);return new Ql(r)},Pt.render=function(n,r,s){if(!Zl(r))throw Error(t(200));return Jl(null,n,r,!1,s)},Pt.unmountComponentAtNode=function(n){if(!Zl(n))throw Error(t(40));return n._reactRootContainer?(Gr(function(){Jl(null,null,n,!1,function(){n._reactRootContainer=null,n[jn]=null})}),!0):!1},Pt.unstable_batchedUpdates=qh,Pt.unstable_renderSubtreeIntoContainer=function(n,r,s,u){if(!Zl(s))throw Error(t(200));if(n==null||n._reactInternals===void 0)throw Error(t(38));return Jl(n,r,s,!1,u)},Pt.version="18.3.1-next-f1338f8080-20240426",Pt}var ry;function oy(){if(ry)return cd.exports;ry=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(e){console.error(e)}}return l(),cd.exports=gx(),cd.exports}var iy;function mx(){if(iy)return bs;iy=1;var l=oy();return bs.createRoot=l.createRoot,bs.hydrateRoot=l.hydrateRoot,bs}var vx=mx(),yx=oy();const Qo={root:"",alignedStart:"text-start",alignedCenter:"text-center",title:"",description:"opacity-60 mt-[3px]"};class bx{constructor(e){const t=e.alignment==="center"?"center":"start";this.nodes={root:R.make("div",[Qo.root,t==="center"?Qo.alignedCenter:Qo.alignedStart]),title:R.make("div",Qo.title,{textContent:e.title})},this.nodes.root.setAttribute("data-alignment",t),this.nodes.root.appendChild(this.nodes.title),e.description!==void 0&&(this.nodes.description=R.make("div",Qo.description,{textContent:e.description}),this.nodes.root.appendChild(this.nodes.description))}getElement(){return this.nodes.root}}class fd{constructor(e){this.params=e}get name(){if(this.params!==void 0&&"name"in this.params)return this.params.name}destroy(){Xo()}onChildrenOpen(){var e;this.params!==void 0&&"children"in this.params&&typeof((e=this.params.children)==null?void 0:e.onOpen)=="function"&&this.params.children.onOpen()}onChildrenClose(){var e;this.params!==void 0&&"children"in this.params&&typeof((e=this.params.children)==null?void 0:e.onClose)=="function"&&this.params.children.onClose()}handleClick(){var e,t;this.params!==void 0&&"onActivate"in this.params&&((t=(e=this.params).onActivate)==null||t.call(e,this.params))}addHint(e,t){const o=new bx(t);ys(e,o.getElement(),{placement:t.position,hidingDelay:100})}get children(){var e;return this.params!==void 0&&"children"in this.params&&((e=this.params.children)==null?void 0:e.items)!==void 0?this.params.children.items:[]}get hasChildren(){return this.children.length>0}get isChildrenOpen(){var e;return this.params!==void 0&&"children"in this.params&&((e=this.params.children)==null?void 0:e.isOpen)===!0}get isChevronHidden(){var e;return this.params!==void 0&&"children"in this.params&&((e=this.params.children)==null?void 0:e.hideChevron)===!0}get isChildrenFlippable(){var e;return!(this.params===void 0||!("children"in this.params)||((e=this.params.children)==null?void 0:e.isFlippable)===!1)}get isChildrenSearchable(){var e;return this.params!==void 0&&"children"in this.params&&((e=this.params.children)==null?void 0:e.searchable)===!0}get closeOnActivate(){return this.params!==void 0&&"closeOnActivate"in this.params&&this.params.closeOnActivate}get isActive(){return this.params===void 0||!("isActive"in this.params)?!1:typeof this.params.isActive=="function"?this.params.isActive():this.params.isActive===!0}}const Nt={item:'flex items-center select-none border-none bg-transparent rounded-md p-[var(--item-padding)] text-text-primary mb-px can-hover:hover:cursor-pointer can-hover:hover:bg-item-hover-bg [&[data-blok-force-hover]]:cursor-pointer [&[data-blok-force-hover]]:bg-item-hover-bg [&[data-blok-focused="true"]]:bg-item-focus-bg [&[data-blok-popover-item-no-hover]]:hover:bg-transparent [&[data-blok-popover-item-no-hover]]:cursor-default',itemActive:"bg-icon-active-bg text-icon-active-text",itemDisabled:"cursor-default pointer-events-none text-text-secondary",itemFocused:"!bg-item-focus-bg",itemConfirmation:"!bg-item-confirm-bg !text-white",icon:"flex items-center justify-center w-[26px] h-[26px] [&_svg]:w-icon [&_svg]:h-icon",iconTool:"mr-2",title:"text-sm leading-5 font-medium overflow-hidden whitespace-nowrap text-ellipsis mr-auto",secondaryTitle:"text-xs whitespace-nowrap pr-1.5 opacity-60 tracking-[-0.1em] text-text-secondary",focused:"is-focused"},Zo={item:"rounded p-1",icon:"w-auto h-auto [&_svg]:w-icon [&_svg]:h-icon mobile:[&_svg]:w-icon-mobile mobile:[&_svg]:h-icon-mobile",iconTool:"shadow-none bg-transparent !mr-0",chevronRight:"rotate-90"},ks={item:"rounded-md p-[3px] mobile:p-1",iconTool:"!mr-2",icon:"w-toolbox-btn h-toolbox-btn"},qe={item:"data-blok-popover-item",icon:"data-blok-popover-item-icon",iconTool:"data-blok-tool",iconChevronRight:"data-blok-popover-item-icon-chevron-right",title:"data-blok-popover-item-title",secondaryTitle:"data-blok-popover-item-secondary-title",active:"data-blok-popover-item-active",hidden:"data-blok-hidden",confirmation:"data-blok-popover-item-confirmation",noHover:"data-blok-popover-item-no-hover",noFocus:"data-blok-popover-item-no-focus",focused:"data-blok-focused",wobble:"data-blok-popover-item-wobble",disabled:"data-blok-disabled"},kx=`
18
+ <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
19
+ <path d="m4.5 15 11-11m0 11L4.5 4" stroke="currentColor" stroke-linecap="round"/>
20
+ </svg>
21
+ `,wx=`
22
+ <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
23
+ <path
24
+ d="M5.5 11h4.9231c.6528 0 1.2789-.3161 1.7405-.8787.4617-.56259.721-1.32565.721-2.1213 0-.79565-.2593-1.55871-.721-2.12132C11.702 5.31607 11.0759 5 10.4231 5H5.5v6Zm0 0h5.5385c.6528 0 1.2789.3161 1.7405.8787.4617.5626.721 1.3257.721 2.1213 0 .7956-.2593 1.5587-.721 2.1213-.4616.5626-1.0877.8787-1.7405.8787H5.5v-6Z"
25
+ stroke="currentColor"
26
+ stroke-width="1.25"
27
+ stroke-linecap="round"
28
+ stroke-linejoin="round"
29
+ />
30
+ </svg>
31
+ `,Tx=`
32
+ <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
33
+ <path
34
+ d="M8.5 5h6m-10 12h6m1-12-4 12"
35
+ stroke="currentColor"
36
+ stroke-linecap="round"
37
+ stroke-linejoin="round"
38
+ />
39
+ </svg>
40
+ `,Sx=`
41
+ <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
42
+ <path
43
+ d="m9.98288 15.0959-.91628.9157c-.29867.3092-.65593.5559-1.05095.7255-.39502.1697-.81987.259-1.24978.2628-.4299.0037-.85625-.0782-1.25415-.241-.39791-.1628-.75941-.4032-1.06341-.7072-.304-.304-.54441-.6655-.70721-1.0634-.16279-.3979-.24471-.8243-.24098-1.2542.00374-.4299.09306-.8547.26274-1.2497.16969-.3951.41635-.7523.72558-1.051l.91499-.9163m8.24197.9156.9163-.9156c.6028-.60809.9402-1.43021.9383-2.28645-.0019-.85625-.3429-1.67688-.9483-2.28234-.6055-.60546-1.4261-.94643-2.2823-.9483-.8563-.00188-1.6784.3355-2.28652.9383l-.91628.91563M7.258 13.2413l4.5328-4.53278"
44
+ stroke="currentColor"
45
+ stroke-width=".784151"
46
+ stroke-linecap="round"
47
+ stroke-linejoin="round"
48
+ />
49
+ </svg>
50
+ `,xx=`
51
+ <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
52
+ <path
53
+ d="M15.5 14.003h-3v-3.0004m-9-6.00078h3v3.0004m1.55478-3.80901A5.2170862 5.2170862 0 0 1 9.5 4.00014c1.1682.00058 2.3059.37321 3.2481 1.06388.9422.69067 1.64 1.66348 1.9923 2.77744.3523 1.11396.3407 2.31114-.033 3.41814-.3738 1.1069-1.0903 2.0661-2.0457 2.7384m-1.7165.8088c-.4703.1317-.9568.1967-1.4452.1931-1.16819-.0006-2.30585-.3733-3.24807-1.0639-.94222-.6907-1.64004-1.6635-1.99232-2.7775-.35229-1.1139-.34072-2.31114.03302-3.41808.37375-1.10694 1.09024-2.06608 2.04563-2.73841"
54
+ stroke="currentColor"
55
+ stroke-miterlimit="10"
56
+ stroke-linecap="round"
57
+ />
58
+ </svg>
59
+ `,Cx=`
60
+ <svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg">
61
+ <path
62
+ d="M8 6c0-.55228.44772-1 1-1s1 .44772 1 1-.44772 1-1 1-1-.44772-1-1Zm0 6c0-.5523.44772-1 1-1s1 .4477 1 1-.44772 1-1 1-1-.4477-1-1Zm0 6c0-.5523.44772-1 1-1s1 .4477 1 1-.44772 1-1 1-1-.4477-1-1Zm6-12c0-.55228.4477-1 1-1s1 .44772 1 1-.4477 1-1 1-1-.44772-1-1Zm0 6c0-.5523.4477-1 1-1s1 .4477 1 1-.4477 1-1 1-1-.4477-1-1Zm0 6c0-.5523.4477-1 1-1s1 .4477 1 1-.4477 1-1 1-1-.4477-1-1Z"
63
+ fill="currentColor"
64
+ />
65
+ </svg>
66
+ `,Ex=`
67
+ <svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg">
68
+ <path d="M4.5 11.0711h14.1421m-7.071 7.071V4" stroke="currentColor" stroke-linecap="round"/>
69
+ </svg>
70
+ `,Bx=`
71
+ <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
72
+ <path d="m12.5 5-5 5 5 5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
73
+ </svg>
74
+ `,Ax=`
75
+ <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
76
+ <path d="m7.5 15 5-5-5-5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
77
+ </svg>
78
+ `,Ix=`
79
+ <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
80
+ <path
81
+ d="m17.5 17.5-5-5m1.6667-4.16667c0 .76605-.1509 1.52459-.4441 2.23237-.2931.7077-.7228 1.3507-1.2645 1.8924-.5417.5417-1.1847.9714-1.8924 1.2645-.70778.2932-1.46632.4441-2.23237.4441-.76604 0-1.52458-.1509-2.23232-.4441-.70773-.2931-1.35079-.7228-1.89247-1.2645-.54167-.5417-.97135-1.1847-1.2645-1.8924C2.65088 9.85792 2.5 9.09938 2.5 8.33333c0-1.54709.61458-3.03082 1.70854-4.12479C5.30251 3.11458 6.78624 2.5 8.33333 2.5c1.5471 0 3.03087.61458 4.12477 1.70854 1.094 1.09397 1.7086 2.5777 1.7086 4.12479Z"
82
+ stroke="currentColor"
83
+ stroke-linecap="round"
84
+ stroke-linejoin="round"
85
+ />
86
+ </svg>
87
+ `,_x=`
88
+ <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
89
+ <path
90
+ d="M3.33334 10H10m-6.66666 5V5M10 15V5m4.1667 5 2.5-1.66667V15"
91
+ stroke="currentColor"
92
+ stroke-linecap="round"
93
+ stroke-linejoin="round"
94
+ />
95
+ </svg>
96
+ `,Nx=`
97
+ <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
98
+ <path
99
+ d="M3.33334 10H10m-6.66666 5V5M10 15V5m7.5 10h-3.3333c0-3.3333 3.3333-2.5 3.3333-5 0-1.25-1.6667-2.08333-3.3333-.83333"
100
+ stroke="currentColor"
101
+ stroke-linecap="round"
102
+ stroke-linejoin="round"
103
+ />
104
+ </svg>
105
+ `,Rx=`
106
+ <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
107
+ <path
108
+ d="M3.33334 10H10m-6.66666 5V5M10 15V5m4.5833 3.75C16 7.91667 17.5 8.75 17.5 10c0 .442-.1756.866-.4882 1.1785-.3125.3126-.7364.4882-1.1785.4882.4421 0 .866.1756 1.1785.4881.3126.3126.4882.7365.4882 1.1785 0 1.5-1.6667 2.5-3.3333 1.25"
109
+ stroke="currentColor"
110
+ stroke-linecap="round"
111
+ stroke-linejoin="round"
112
+ />
113
+ </svg>
114
+ `,Ox=`
115
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
116
+ <path
117
+ d="M10 15V5M14.1667 8.33333V10.8333C14.1667 11.0543 14.2545 11.2663 14.4107 11.4226C14.567 11.5789 14.779 11.6667 15 11.6667H17.5M17.5 8.33333V15M3.33334 10H10M3.33334 15V5"
118
+ stroke="black"
119
+ stroke-linecap="round"
120
+ stroke-linejoin="round"
121
+ />
122
+ </svg>
123
+ `,Lx=`
124
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
125
+ <path
126
+ d="M3.33334 10H10M3.33334 15V5M10 15V5M17.5 8.33333H14.1667V10.8333H15.25C16.5 10.8333 17.5 11.75 17.5 12.9167C17.5 14.0833 16.5 15 15.25 15C14.8333 15 14.5 14.9167 14.1667 14.75"
127
+ stroke="black"
128
+ stroke-linecap="round"
129
+ stroke-linejoin="round"
130
+ />
131
+ </svg>
132
+ `,Dx=`
133
+ <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
134
+ <path
135
+ d="M3.33334 10H10m-6.66666 5V5M10 15V5m4.1667 8.3333c0 .9205.7462 1.6667 1.6666 1.6667.9205 0 1.6667-.7462 1.6667-1.6667 0-.9204-.7462-1.6666-1.6667-1.6666-.9204 0-1.6666.7462-1.6666 1.6666Zm0 0c0-2.0833.8333-3.3333 2.5-4.99997"
136
+ stroke="currentColor"
137
+ stroke-linecap="round"
138
+ stroke-linejoin="round"
139
+ />
140
+ </svg>
141
+ `,Px=`
142
+ <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
143
+ <path
144
+ d="M6.5 10h6.6667M6.5 15V5m6.6667 10V5"
145
+ stroke="currentColor"
146
+ stroke-linecap="round"
147
+ stroke-linejoin="round"
148
+ />
149
+ </svg>
150
+ `,Mx=`
151
+ <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
152
+ <path
153
+ d="M14.5 7.28571V6h-9v1.28571M10 6v9m0 0H8.71429M10 15h1.2857"
154
+ stroke="currentColor"
155
+ stroke-linecap="round"
156
+ stroke-linejoin="round"
157
+ />
158
+ </svg>
159
+ `,Fx=`
160
+ <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
161
+ <path
162
+ d="M18.5667 18H1.5l8.5333-16 8.5334 16Z"
163
+ stroke="currentColor"
164
+ stroke-width="1.06667"
165
+ stroke-linecap="round"
166
+ stroke-linejoin="round"
167
+ />
168
+ <rect x="9.75" y="14.25" width=".5" height=".5" rx=".25" fill="currentColor" stroke="currentColor" stroke-width=".5"/>
169
+ <rect x="9.75" y="8.25" width=".5" height="4.5" rx=".25" fill="currentColor" stroke="currentColor" stroke-width=".5"/>
170
+ </svg>
171
+ `,zx=({icon:l,title:e,secondaryLabel:t,isActive:o=!1,isDisabled:i=!1,hasChildren:a=!1,hideChevron:c=!1,wrapperTag:d="div",name:h,iconWithGap:g=!0,isInline:v=!1,isNestedInline:y=!1})=>{const b=Te(Nt.item,v&&Zo.item,y&&ks.item,o&&Nt.itemActive,i&&Nt.itemDisabled),x=Te(Nt.icon,v&&Zo.icon,y&&ks.icon,g&&Nt.iconTool,g&&v&&Zo.iconTool,g&&y&&ks.iconTool),w=Te(Nt.icon,v&&Zo.chevronRight),T=a&&!c,C=Pn.jsxs(Pn.Fragment,{children:[l&&Pn.jsx("div",_t(be({[qe.icon]:""},g&&{[qe.iconTool]:""}),{className:x,"data-blok-testid":"popover-item-icon",dangerouslySetInnerHTML:{__html:l}})),e!==void 0&&Pn.jsx("div",{[qe.title]:"",className:Nt.title,"data-blok-testid":"popover-item-title",children:e}),t&&Pn.jsx("div",{[qe.secondaryTitle]:"",className:Nt.secondaryTitle,"data-blok-testid":"popover-item-secondary-title",children:t}),T&&Pn.jsx("div",{[qe.icon]:"",[qe.iconChevronRight]:"",className:w,"data-blok-testid":"popover-item-chevron-right",dangerouslySetInnerHTML:{__html:Ax}})]}),O=be(be(be({className:b,[qe.item]:"","data-blok-testid":"popover-item"},h&&{"data-blok-item-name":h}),i&&{[qe.disabled]:"true"}),o&&{[qe.active]:"true"});return d==="button"?Pn.jsx("button",_t(be({type:"button"},O),{children:C})):Pn.jsx("div",_t(be({},O),{children:C}))},hd='[data-blok-testid="popover-item-icon"]',Hx=l=>{const e=document.createElement("div"),t=vx.createRoot(e);yx.flushSync(()=>{t.render(l)});const o=e.firstElementChild;return t.unmount(),o};class Mn extends fd{constructor(e,t){super(e),this.params=e,this.nodes={root:null,icon:null},this.confirmationState=null,this.removeSpecialFocusBehavior=()=>{var o;(o=this.nodes.root)==null||o.removeAttribute(qe.noFocus)},this.removeSpecialHoverBehavior=()=>{var o;(o=this.nodes.root)==null||o.removeAttribute(qe.noHover)},this.onErrorAnimationEnd=()=>{var o,i,a;(o=this.nodes.icon)==null||o.removeAttribute(qe.wobble),(i=this.nodes.icon)==null||i.classList.remove("animate-wobble"),(a=this.nodes.icon)==null||a.removeEventListener("animationend",this.onErrorAnimationEnd)},this.renderParams=t,this.nodes.root=this.make(e,t)}get isDisabled(){return this.params.isDisabled===!0}get toggle(){return this.params.toggle}get title(){return this.params.title||this.params.label}get isConfirmationStateEnabled(){return this.confirmationState!==null}get isFocused(){return this.nodes.root===null?!1:this.nodes.root.hasAttribute(qe.focused)}getElement(){return this.nodes.root}handleClick(){if(this.isConfirmationStateEnabled&&this.confirmationState!==null){this.activateOrEnableConfirmationMode(this.confirmationState);return}this.activateOrEnableConfirmationMode(this.params)}toggleActive(e){if(this.nodes.root===null)return;(e!==void 0?e:!this.nodes.root.hasAttribute(qe.active))?this.nodes.root.setAttribute(qe.active,"true"):this.nodes.root.removeAttribute(qe.active),this.updateRootClasses()}toggleHidden(e){var t,o;e?(t=this.nodes.root)==null||t.setAttribute(qe.hidden,"true"):(o=this.nodes.root)==null||o.removeAttribute(qe.hidden),this.updateRootClasses()}reset(){this.isConfirmationStateEnabled&&this.disableConfirmationMode()}onFocus(){this.disableSpecialHoverAndFocusBehavior()}make(e,t){var a,c,d;const o=e.title||e.label,i=Hx(Pn.jsx(zx,{icon:e.icon,title:o,secondaryLabel:e.secondaryLabel,isActive:this.isActive,isDisabled:e.isDisabled,hasChildren:this.hasChildren,hideChevron:this.isChevronHidden,wrapperTag:t==null?void 0:t.wrapperTag,name:e.name,iconWithGap:t==null?void 0:t.iconWithGap,isInline:t==null?void 0:t.isInline,isNestedInline:t==null?void 0:t.isNestedInline}));return this.nodes.icon=i.querySelector(hd),e.hint!==void 0&&((a=t==null?void 0:t.hint)==null?void 0:a.enabled)!==!1&&this.addHint(i,_t(be({},e.hint),{position:((c=t==null?void 0:t.hint)==null?void 0:c.position)||"right",alignment:((d=t==null?void 0:t.hint)==null?void 0:d.alignment)||"center"})),i}enableConfirmationMode(e){if(this.nodes.root===null)return;const t=_t(be(be({},this.params),e),{confirmation:"confirmation"in e?e.confirmation:void 0}),o=this.make(t,this.renderParams);this.nodes.root.innerHTML=o.innerHTML,this.nodes.root.setAttribute(qe.confirmation,"true"),this.nodes.icon=this.nodes.root.querySelector(hd),this.confirmationState=e,this.enableSpecialHoverAndFocusBehavior(),this.updateRootClasses()}disableConfirmationMode(){if(this.nodes.root===null)return;const e=this.make(this.params,this.renderParams);this.nodes.root.innerHTML=e.innerHTML,this.nodes.root.removeAttribute(qe.confirmation),this.nodes.icon=this.nodes.root.querySelector(hd),this.confirmationState=null,this.disableSpecialHoverAndFocusBehavior(),this.updateRootClasses()}enableSpecialHoverAndFocusBehavior(){var e,t,o;(e=this.nodes.root)==null||e.setAttribute(qe.noHover,"true"),(t=this.nodes.root)==null||t.setAttribute(qe.noFocus,"true"),(o=this.nodes.root)==null||o.addEventListener("mouseleave",this.removeSpecialHoverBehavior,{once:!0})}disableSpecialHoverAndFocusBehavior(){var e;this.removeSpecialFocusBehavior(),this.removeSpecialHoverBehavior(),(e=this.nodes.root)==null||e.removeEventListener("mouseleave",this.removeSpecialHoverBehavior)}activateOrEnableConfirmationMode(e){var t;if(!("confirmation"in e)||e.confirmation===void 0)try{(t=e.onActivate)==null||t.call(e,e),this.disableConfirmationMode()}catch(o){this.animateError()}else this.enableConfirmationMode(e.confirmation)}animateError(){var e,t,o,i;(e=this.nodes.icon)!=null&&e.hasAttribute(qe.wobble)||((t=this.nodes.icon)==null||t.setAttribute(qe.wobble,"true"),(o=this.nodes.icon)==null||o.classList.add("animate-wobble"),(i=this.nodes.icon)==null||i.addEventListener("animationend",this.onErrorAnimationEnd))}updateRootClasses(){var d,h,g,v;if(this.nodes.root===null)return;const e=this.nodes.root.hasAttribute(qe.active),t=this.nodes.root.hasAttribute(qe.hidden),o=this.nodes.root.hasAttribute(qe.confirmation),i=this.nodes.root.hasAttribute(qe.focused),a=(h=(d=this.renderParams)==null?void 0:d.isInline)!=null?h:!1,c=(v=(g=this.renderParams)==null?void 0:g.isNestedInline)!=null?v:!1;this.nodes.root.className=Te(Nt.item,a&&Zo.item,c&&ks.item,e&&Nt.itemActive,this.isDisabled&&Nt.itemDisabled,i&&Nt.itemFocused,o&&Nt.itemConfirmation,t&&"!hidden")}}const Br={container:"py-1 px-[3px]",containerHidden:"hidden",line:"h-px w-full bg-popover-border"},ws={container:"px-1 py-0",line:"h-full w-px",nestedContainer:"py-1 px-[3px]",nestedLine:"w-full h-px"},Ts={root:"data-blok-popover-item-separator",line:"data-blok-popover-item-separator-line",hidden:"data-blok-hidden"};class sy extends fd{constructor(e){var i,a;super(),this.isInline=(i=e==null?void 0:e.isInline)!=null?i:!1,this.isNestedInline=(a=e==null?void 0:e.isNestedInline)!=null?a:!1;const t=this.getContainerClass(),o=this.getLineClass();this.nodes={root:R.make("div",t,{[Ts.root]:""}),line:R.make("div",o,{[Ts.line]:""})},this.nodes.root.setAttribute("data-blok-testid","popover-item-separator"),this.nodes.root.appendChild(this.nodes.line)}getElement(){return this.nodes.root}toggleHidden(e){var t,o;e?((t=this.nodes.root)==null||t.setAttribute(Ts.hidden,"true"),this.nodes.root.className=Te(this.getContainerClass(),Br.containerHidden)):((o=this.nodes.root)==null||o.removeAttribute(Ts.hidden),this.nodes.root.className=this.getContainerClass())}getContainerClass(){return this.isNestedInline?Te(Br.container,ws.nestedContainer):this.isInline?Te(Br.container,ws.container):Br.container}getLineClass(){return this.isNestedInline?Te(Br.line,ws.nestedLine):this.isInline?Te(Br.line,ws.line):Br.line}}var Jt=(l=>(l.Closed="closed",l.ClosedOnActivate="closed-on-activate",l))(Jt||{});const Fe={popover:"",popoverContainer:"absolute flex flex-col overflow-hidden box-border opacity-0 pointer-events-none p-0 border-none z-[4] max-h-0 min-w-[var(--width)] w-[var(--width)] rounded-lg shadow-[0_3px_15px_-3px_theme(colors.popover-shadow)] left-[var(--popover-left)] top-[var(--popover-top)] bg-popover-bg",popoverContainerMobile:"fixed max-w-none rounded-[10px] min-w-[calc(100%-var(--offset)*2)] inset-[auto_var(--offset)_calc(var(--offset)+env(safe-area-inset-bottom))_var(--offset)]",popoverContainerOpened:"opacity-100 pointer-events-auto p-1 max-h-[var(--max-height)] border border-popover-border animate-[panelShowing_100ms_ease]",popoverContainerOpenedMobile:"animate-[panelShowingMobile_250ms_ease]",popoverOverlay:"hidden bg-dark",popoverOverlayMobile:"fixed inset-0 block visible z-[3] opacity-50 transition-opacity duration-[120ms] ease-in will-change-[opacity]",search:"mb-1.5",items:"overflow-y-auto overscroll-contain",nothingFoundMessage:"hidden cursor-default text-sm leading-5 font-medium whitespace-nowrap overflow-hidden text-ellipsis text-gray-text p-[3px]",nothingFoundMessageDisplayed:"!block"},en={popover:"relative",popoverOpened:"inline-block",items:"flex",popoverContainer:"flex-row top-0 min-w-max w-max p-1 mobile:absolute",popoverContainerOpened:"animate-none",nestedLevel1Container:"left-0",nestedContainer:"h-fit p-1.5 flex-col",nestedItems:"block w-full"},ze={popover:"data-blok-popover",popoverContainer:"data-blok-popover-container",popoverItems:"data-blok-popover-items",popoverOverlay:"data-blok-popover-overlay",popoverInline:"data-blok-popover-inline",nested:"data-blok-nested",nestedLevel:"data-blok-nested-level",opened:"data-blok-popover-opened",openTop:"data-blok-popover-open-top",openLeft:"data-blok-popover-open-left",overlayHidden:"data-blok-overlay-hidden",nothingFoundDisplayed:"data-blok-nothing-found-displayed"},jx=l=>`level-${l}`;var tn=(l=>(l.NestingLevel="--nesting-level",l.PopoverHeight="--popover-height",l.InlinePopoverWidth="--inline-popover-width",l.PopoverTop="--popover-top",l.PopoverLeft="--popover-left",l.TriggerItemLeft="--trigger-item-left",l.TriggerItemTop="--trigger-item-top",l))(tn||{});const Jo={root:"",rootHidden:"hidden"},ly={root:"flex items-center"},pd={root:"data-blok-popover-item-html",hidden:"data-blok-hidden"};class ei extends fd{constructor(e,t){var i,a,c,d;super(e),this.isInline=(i=t==null?void 0:t.isInline)!=null?i:!1;const o=this.isInline?Te(Jo.root,ly.root):Jo.root;this.nodes={root:R.make("div",o,{[pd.root]:""})},this.nodes.root.appendChild(e.element),this.nodes.root.setAttribute("data-blok-testid","popover-item-html"),e.name&&this.nodes.root.setAttribute("data-blok-item-name",e.name),e.hint!==void 0&&((a=t==null?void 0:t.hint)==null?void 0:a.enabled)!==!1&&this.addHint(this.nodes.root,_t(be({},e.hint),{position:((c=t==null?void 0:t.hint)==null?void 0:c.position)||"right",alignment:((d=t==null?void 0:t.hint)==null?void 0:d.alignment)||"center"}))}getElement(){return this.nodes.root}toggleHidden(e){var o,i;const t=this.isInline?Te(Jo.root,ly.root):Jo.root;e?((o=this.nodes.root)==null||o.setAttribute(pd.hidden,"true"),this.nodes.root.className=Te(t,Jo.rootHidden)):((i=this.nodes.root)==null||i.removeAttribute(pd.hidden),this.nodes.root.className=t)}getControls(){const e=this.nodes.root.querySelectorAll(`button, ${R.allInputsSelector}`);return Array.from(e)}}class ay extends Ko{constructor(e,t={}){super(),this.params=e,this.itemsRenderParams=t,this.listeners=new Vo,this.messages={nothingFound:"Nothing found",search:"Search"},this.items=this.buildItems(e.items),e.messages&&(this.messages=be(be({},this.messages),e.messages)),this.nodes={},this.nodes.popoverContainer=R.make("div",[Fe.popoverContainer],{[ze.popoverContainer]:"","data-blok-testid":"popover-container"}),this.nodes.nothingFoundMessage=R.make("div",[Fe.nothingFoundMessage],{textContent:this.messages.nothingFound,"data-blok-testid":"popover-nothing-found"}),this.nodes.popoverContainer.appendChild(this.nodes.nothingFoundMessage),this.nodes.items=R.make("div",[Fe.items],{[ze.popoverItems]:"","data-blok-testid":"popover-items"}),this.items.forEach(o=>{const i=o.getElement();i!==null&&this.nodes.items.appendChild(i)}),this.nodes.popoverContainer.appendChild(this.nodes.items),this.listeners.on(this.nodes.popoverContainer,"click",o=>this.handleClick(o)),this.nodes.popover=R.make("div",[Fe.popover,this.params.class],{[ze.popover]:"","data-blok-testid":"popover"}),this.nodes.popover.style.setProperty("--width","200px"),this.nodes.popover.style.setProperty("--max-height","270px"),this.nodes.popover.style.setProperty("--item-padding","3px"),this.nodes.popover.style.setProperty("--item-height","calc(1.25rem + 2 * var(--item-padding))"),this.nodes.popover.style.setProperty("--popover-top","calc(100% + 0.5rem)"),this.nodes.popover.style.setProperty("--popover-left","0"),this.nodes.popover.style.setProperty("--nested-popover-overlap","0.25rem"),this.params.class&&this.nodes.popover.setAttribute("data-blok-popover-custom-class",this.params.class),this.nodes.popover.appendChild(this.nodes.popoverContainer)}get itemsDefault(){return this.items.filter(e=>e instanceof Mn)}getElement(){return this.nodes.popover}show(){!this.nodes.popover.isConnected&&!this.nodes.popover.parentNode&&document.body.appendChild(this.nodes.popover),this.nodes.popover.setAttribute(ze.opened,"true"),this.nodes.popoverContainer.className=Te(Fe.popoverContainer,Fe.popoverContainerOpened),this.itemsDefault.forEach(e=>this.refreshItemActiveState(e)),this.search!==void 0&&this.search.focus()}hide(){this.nodes.popover.removeAttribute(ze.opened),this.nodes.popover.removeAttribute(ze.openTop),this.nodes.popover.removeAttribute(ze.openLeft),this.nodes.popoverContainer.className=Fe.popoverContainer,this.itemsDefault.forEach(e=>e.reset()),this.search!==void 0&&this.search.clear(),this.emit(Jt.Closed)}destroy(){var e;this.items.forEach(t=>t.destroy()),this.nodes.popover.remove(),this.listeners.removeAll(),(e=this.search)==null||e.destroy()}activateItemByName(e){const t=this.items.find(o=>o.name===e);t!==void 0&&this.handleItemClick(t)}buildItems(e){return e.map(t=>{switch(t.type){case ot.Separator:return new sy(this.itemsRenderParams[ot.Separator]);case ot.Html:return new ei(t,this.itemsRenderParams[ot.Html]);default:return new Mn(t,this.itemsRenderParams[ot.Default])}})}getTargetItem(e){return this.items.filter(t=>t instanceof Mn||t instanceof ei).find(t=>{const o=t.getElement();return o===null?!1:e.composedPath().includes(o)})}handleItemClick(e){if(!(e instanceof Mn&&e.isDisabled)){if(e.hasChildren){this.showNestedItems(e),this.callHandleClickIfPresent(e);return}this.itemsDefault.filter(t=>t!==e).forEach(t=>t.reset()),this.callHandleClickIfPresent(e),this.toggleItemActivenessIfNeeded(e),this.refreshItemActiveState(e),e.closeOnActivate===!0&&(this.hide(),this.emit(Jt.ClosedOnActivate))}}handleClick(e){const t=this.getTargetItem(e);t!==void 0&&this.handleItemClick(t)}toggleItemActivenessIfNeeded(e){if(!(e instanceof Mn)||(e.toggle===!0&&e.toggleActive(),typeof e.toggle!="string"))return;const t=this.itemsDefault.filter(o=>o.toggle===e.toggle);if(t.length===1){e.toggleActive();return}t.forEach(o=>{o.toggleActive(o===e)})}refreshItemActiveState(e){e instanceof Mn&&e.toggle===void 0&&e.toggleActive(e.isActive)}callHandleClickIfPresent(e){"handleClick"in e&&typeof e.handleClick=="function"&&e.handleClick()}hasNode(e){return this.nodes.popover.contains(e)}}var gd=(l=>(l.Search="search",l))(gd||{});const md={wrapper:"bg-[#F8F8F8] border border-[rgba(226,226,229,0.20)] rounded p-0.5 grid grid-cols-[auto_auto_1fr] grid-rows-[auto]",icon:"w-toolbox-btn h-toolbox-btn flex items-center justify-center mr-2 [&_svg]:w-icon [&_svg]:h-icon [&_svg]:text-gray-text",input:"text-sm outline-none font-medium font-inherit border-0 bg-transparent m-0 p-0 leading-[22px] min-w-[calc(100%-theme('spacing.6')-10px)] placeholder:text-gray-text placeholder:font-medium"};class qx extends Ko{constructor({items:e,placeholder:t}){super(),this.searchQuery="",this.handleValueChange=()=>{this.applySearch(this.input.value)},this.listeners=new Vo,this.items=e,this.wrapper=R.make("div",md.wrapper),this.wrapper.setAttribute("data-blok-testid","popover-search-field");const o=R.make("div",md.icon,{innerHTML:Ix});this.input=R.make("input",md.input,{type:"search",placeholder:t,tabIndex:-1}),this.input.setAttribute("data-blok-flipper-tab-target","true"),this.input.setAttribute("data-blok-testid","popover-search-input"),this.wrapper.appendChild(o),this.wrapper.appendChild(this.input),this.overrideValueProperty(),["input","keyup","search","change"].forEach(a=>{this.listeners.on(this.input,a,this.handleValueChange)})}getElement(){return this.wrapper}focus(){this.input.focus()}clear(){this.input.value=""}applySearch(e){this.searchQuery!==e&&(this.searchQuery=e,this.emit(gd.Search,{query:e,items:this.foundItems}))}overrideValueProperty(){var i,a;const e=Object.getPrototypeOf(this.input),t=Object.getOwnPropertyDescriptor(e,"value");if((t==null?void 0:t.set)===void 0||t.get===void 0)return;const o=this.applySearch.bind(this);Object.defineProperty(this.input,"value",{configurable:(i=t.configurable)!=null?i:!0,enumerable:(a=t.enumerable)!=null?a:!1,get(){var c,d;return(d=(c=t.get)==null?void 0:c.call(this))!=null?d:""},set(c){var d;(d=t.set)==null||d.call(this,c),o(c)}})}destroy(){this.listeners.removeAll()}get foundItems(){return this.items.filter(e=>this.checkItem(e))}checkItem(e){var i,a;const t=((i=e.title)==null?void 0:i.toLowerCase())||"",o=(a=this.searchQuery)==null?void 0:a.toLowerCase();return o!==void 0?t.includes(o):!1}}class Ar extends ay{constructor(e,t){super(e,t),this.nestingLevel=0,this.nestedPopoverTriggerItem=null,this.previouslyHoveredItem=null,this.scopeElement=document.body,this.hide=()=>{var o;super.hide(),this.destroyNestedPopoverIfExists(),(o=this.flipper)==null||o.deactivate(),this.previouslyHoveredItem=null},this.onFlip=()=>{const o=this.itemsDefault.find(i=>i.isFocused);o==null||o.onFocus()},this.onSearch=o=>{var d;const i=o.query==="",a=o.items.length===0;this.items.forEach(h=>{const g=h instanceof Mn,v=h instanceof sy||h instanceof ei,y=g?!o.items.includes(h):v&&(a||!i);h.toggleHidden(y)}),this.toggleNothingFoundMessage(a);const c=o.query===""?this.flippableElements:o.items.map(h=>h.getElement());(d=this.flipper)!=null&&d.isActivated&&(this.flipper.deactivate(),this.flipper.activate(c))},e.trigger&&(this.trigger=e.trigger),e.nestingLevel!==void 0&&(this.nestingLevel=e.nestingLevel),this.nestingLevel>0&&this.nodes.popover.setAttribute(ze.nested,"true"),e.scopeElement!==void 0&&(this.scopeElement=e.scopeElement),this.nodes.popoverContainer!==null&&this.listeners.on(this.nodes.popoverContainer,"mouseover",o=>this.handleHover(o)),e.searchable&&this.addSearch(),e.flippable!==!1&&(e.flipper!==void 0?(e.flipper.deactivate(),e.flipper.removeOnFlip(this.onFlip),this.flipper=e.flipper):this.flipper=new Qn({items:this.flippableElements,focusedItemClass:Nt.focused,allowedKeys:[se.TAB,se.UP,se.DOWN,se.ENTER]}),this.flipper.onFlip(this.onFlip))}hasFocus(){return this.flipper===void 0?!1:this.flipper.hasFocus()}get scrollTop(){return this.nodes.items===null?0:this.nodes.items.scrollTop}get offsetTop(){return this.nodes.popoverContainer===null?0:this.nodes.popoverContainer.offsetTop}show(){var e;if(this.trigger){document.body.appendChild(this.nodes.popover);const{top:t,left:o}=this.calculatePosition();this.nodes.popover.style.position="absolute",this.nodes.popover.style.top=`${t}px`,this.nodes.popover.style.left=`${o}px`,this.nodes.popover.style.setProperty(tn.PopoverTop,"0px"),this.nodes.popover.style.setProperty(tn.PopoverLeft,"0px")}this.nodes.popover.style.setProperty(tn.PopoverHeight,this.size.height+"px"),!this.trigger&&!this.shouldOpenBottom&&(this.nodes.popover.setAttribute(ze.openTop,"true"),this.nodes.popover.style.setProperty(tn.PopoverTop,"calc(-1 * (0.5rem + var(--popover-height)))")),!this.trigger&&!this.shouldOpenRight&&(this.nodes.popover.setAttribute(ze.openLeft,"true"),this.nodes.popover.style.setProperty(tn.PopoverLeft,"calc(-1 * var(--width) + 100%)")),super.show(),(e=this.flipper)==null||e.activate(this.flippableElements)}calculatePosition(){if(!this.trigger)return{top:0,left:0};const e=this.trigger.getBoundingClientRect(),t=this.size,o=window.innerWidth,i=window.innerHeight,a=8,c=e.bottom+a+window.scrollY,h=e.bottom+a+t.height>i+window.scrollY&&e.top-a-t.height>window.scrollY?e.top-a-t.height+window.scrollY:c,g=e.left+window.scrollX,y=g+t.width>o+window.scrollX?Math.max(0,e.right-t.width+window.scrollX):g;return{top:h,left:y}}destroy(){this.hide(),super.destroy()}hasNode(e){return super.hasNode(e)?!0:this.nestedPopover!==void 0&&this.nestedPopover!==null?this.nestedPopover.hasNode(e):!1}showNestedItems(e){this.nestedPopover!==null&&this.nestedPopover!==void 0||(this.nestedPopoverTriggerItem=e,this.showNestedPopoverForItem(e))}handleHover(e){const t=this.getTargetItem(e);t!==void 0&&this.previouslyHoveredItem!==t&&(this.destroyNestedPopoverIfExists(),this.previouslyHoveredItem=t,t.hasChildren&&this.showNestedPopoverForItem(t))}setTriggerItemPosition(e,t){const o=t.getElement(),i=(o?o.offsetTop:0)-this.scrollTop,a=this.offsetTop+i;e.style.setProperty(tn.TriggerItemTop,a+"px")}destroyNestedPopoverIfExists(){var e,t;this.nestedPopover===void 0||this.nestedPopover===null||(this.nestedPopover.off(Jt.ClosedOnActivate,this.hide),this.nestedPopover.hide(),this.nestedPopover.destroy(),this.nestedPopover.getElement().remove(),this.nestedPopover=null,(e=this.flipper)==null||e.activate(this.flippableElements),requestAnimationFrame(()=>{var o;(o=this.flipper)==null||o.focusFirst()}),(t=this.nestedPopoverTriggerItem)==null||t.onChildrenClose())}showNestedPopoverForItem(e){var o;this.nestedPopover=new Ar({searchable:e.isChildrenSearchable,items:e.children,nestingLevel:this.nestingLevel+1,flippable:e.isChildrenFlippable,messages:this.messages}),e.onChildrenOpen(),this.nestedPopover.on(Jt.ClosedOnActivate,this.hide);const t=this.nestedPopover.getElement();return this.nodes.popover.appendChild(t),this.setTriggerItemPosition(t,e),t.style.setProperty(tn.NestingLevel,this.nestedPopover.nestingLevel.toString()),this.applyNestedPopoverPositioning(t),this.nestedPopover.show(),(o=this.flipper)==null||o.deactivate(),this.nestedPopover}applyNestedPopoverPositioning(e){const t=e.querySelector(`[${ze.popoverContainer}]`);if(!t)return;const o=this.nodes.popover.hasAttribute(ze.openTop),i=this.nodes.popover.hasAttribute(ze.openLeft);t.style.position="absolute",i?e.style.setProperty(tn.PopoverLeft,"calc(-1 * (var(--nesting-level) + 1) * var(--width) + 100%)"):e.style.setProperty(tn.PopoverLeft,"calc(var(--nesting-level) * (var(--width) - var(--nested-popover-overlap)))"),o?t.style.top="calc(var(--trigger-item-top) - var(--popover-height) + var(--item-height) + 0.5rem + var(--nested-popover-overlap))":t.style.top="calc(var(--trigger-item-top) - var(--nested-popover-overlap))"}get shouldOpenBottom(){if(this.nodes.popover===void 0||this.nodes.popover===null)return!1;const e=this.nodes.popoverContainer.getBoundingClientRect(),t=this.scopeElement.getBoundingClientRect(),o=this.size.height,i=e.top+o,a=e.top-o,c=Math.min(window.innerHeight,t.bottom);return a<t.top||i<=c}get shouldOpenRight(){if(this.nodes.popover===void 0||this.nodes.popover===null)return!1;const e=this.nodes.popover.getBoundingClientRect(),t=this.scopeElement.getBoundingClientRect(),o=this.size.width,i=e.right+o,a=e.left-o,c=Math.min(window.innerWidth,t.right);return a<t.left||i<=c}get size(){var i;if(this._size)return this._size;const e={height:0,width:0};if(this.nodes.popover===null)return e;const t=this.nodes.popover.cloneNode(!0);t.style.visibility="hidden",t.style.position="absolute",t.style.top="-1000px",t.setAttribute(ze.opened,"true"),(i=t.querySelector(`[${ze.nested}]`))==null||i.remove(),document.body.appendChild(t);const o=t.querySelector(`[${ze.popoverContainer}]`);return e.height=o.offsetHeight,e.width=o.offsetWidth,t.remove(),this._size=e,e}get flippableElements(){return this.items.flatMap(t=>{if(!(t instanceof Mn))return t instanceof ei?t.getControls():[];if(t.isDisabled)return[];const o=t.getElement();return o?[o]:[]}).filter(t=>t!=null)}addSearch(){this.search=new qx({items:this.itemsDefault,placeholder:this.messages.search}),this.search.on(gd.Search,this.onSearch);const e=this.search.getElement();e.classList.add(Fe.search),this.nodes.popoverContainer.insertBefore(e,this.nodes.popoverContainer.firstChild)}toggleNothingFoundMessage(e){this.nodes.nothingFoundMessage.classList.toggle(Fe.nothingFoundMessageDisplayed,e),e?this.nodes.nothingFoundMessage.setAttribute(ze.nothingFoundDisplayed,"true"):this.nodes.nothingFoundMessage.removeAttribute(ze.nothingFoundDisplayed)}}const Ux="38px",Wx="46px";class vd extends Ar{constructor(e){var o;const t=!Xn();super(be({},e),{[ot.Default]:{wrapperTag:"button",hint:{position:"top",alignment:"center",enabled:t},iconWithGap:!1,isInline:!0},[ot.Html]:{hint:{position:"top",alignment:"center",enabled:t},isInline:!0},[ot.Separator]:{isInline:!0}}),this.hide=()=>{var i;this.nodes.popover.removeAttribute(ze.opened),this.nodes.popover.removeAttribute(ze.openTop),this.nodes.popover.removeAttribute(ze.openLeft),this.itemsDefault.forEach(a=>a.reset()),this.search!==void 0&&this.search.clear(),this.destroyNestedPopoverIfExists(),(i=this.flipper)==null||i.deactivate(),this.nodes.popover.className=Te(Fe.popover,en.popover),this.nodes.popoverContainer&&(this.nodes.popoverContainer.className=Te(Fe.popoverContainer,en.popoverContainer),this.nodes.popoverContainer.style.height=""),this.emit(Jt.Closed)},this.nodes.popover.className=Te(Fe.popover,en.popover),this.nodes.popoverContainer&&(this.nodes.popoverContainer.className=Te(Fe.popoverContainer,en.popoverContainer)),this.nodes.items&&(this.nodes.items.className=Te(Fe.items,en.items)),this.nodes.popover.style.setProperty("--height",Ux),this.nodes.popover.style.setProperty("--height-mobile",Wx),this.nodes.popover.setAttribute(ze.popoverInline,""),(o=this.flipper)==null||o.setHandleContentEditableTargets(!0),this.items.forEach(i=>{!(i instanceof Mn)&&!(i instanceof ei)||i.hasChildren&&i.isChildrenOpen&&this.showNestedItems(i)})}get offsetLeft(){return this.nodes.popoverContainer===null?0:this.nodes.popoverContainer.offsetLeft}show(){var t;if(super.show(),this.nodes.popover.className=Te(Fe.popover,en.popover,en.popoverOpened),this.nodes.popoverContainer){this.nodes.popoverContainer.className=Te(Fe.popoverContainer,Fe.popoverContainerOpened,en.popoverContainer,en.popoverContainerOpened);const o=Xn()?"var(--height-mobile)":"var(--height)";this.nodes.popoverContainer.style.height=o}const e=this.nestingLevel===0?(t=this.nodes.popoverContainer)==null?void 0:t.getBoundingClientRect():void 0;if(e!==void 0){const o=`${e.width}px`,i=`${e.height}px`;this.nodes.popover.style.setProperty(tn.InlinePopoverWidth,o),this.nodes.popover.style.width=o,this.nodes.popover.style.height=i}requestAnimationFrame(()=>{var o,i;(o=this.flipper)==null||o.deactivate(),(i=this.flipper)==null||i.activate(this.flippableElements)})}handleHover(){}setTriggerItemPosition(e,t){const o=t.getElement(),i=o?o.offsetLeft:0,a=this.offsetLeft+i;e.style.setProperty(tn.TriggerItemLeft,a+"px")}showNestedItems(e){if(this.nestedPopoverTriggerItem===e){this.destroyNestedPopoverIfExists(),this.nestedPopoverTriggerItem=null;return}super.showNestedItems(e)}showNestedPopoverForItem(e){var d;const t=super.showNestedPopoverForItem(e),o=t.getElement();(d=t.flipper)==null||d.setHandleContentEditableTargets(!0);const i=o.querySelector(`[${ze.popoverContainer}]`);i&&(i.className=Te(i.className,en.nestedContainer));const a=o.querySelector(`[${ze.popoverItems}]`);a&&(a.className=Te(a.className,en.nestedItems));const c=h=>{var g,v;if(!(h.key!=="Tab"||h.shiftKey)){if(this.nestedPopover!==t){document.removeEventListener("keydown",c,!0);return}h.preventDefault(),h.stopPropagation(),(g=t.flipper)==null||g.activate(t.flippableElements),(v=t.flipper)==null||v.focusFirst(),document.removeEventListener("keydown",c,!0)}};if(document.addEventListener("keydown",c,!0),t.on(Jt.Closed,()=>{document.removeEventListener("keydown",c,!0)}),o.setAttribute(ze.nestedLevel,jx(t.nestingLevel)),t.nestingLevel===1&&i){i.className=Te(i.className,en.nestedLevel1Container);const h=Xn()?"calc(var(--height-mobile) + 3px)":"calc(var(--height) + 3px)";i.style.top=h}return t}handleItemClick(e){var t;e!==this.nestedPopoverTriggerItem&&((t=this.nestedPopoverTriggerItem)==null||t.handleClick(),super.destroyNestedPopoverIfExists()),super.handleItemClick(e)}}const nt=class nt{constructor(){this.scrollPosition=null}lock(){qu?this.lockHard():(document.body.classList.add(nt.CSS.scrollLocked,nt.CSS.overflowHidden),document.body.setAttribute(nt.DATA_ATTR.scrollLocked,"true"))}unlock(){qu?this.unlockHard():(document.body.classList.remove(nt.CSS.scrollLocked,nt.CSS.overflowHidden),document.body.removeAttribute(nt.DATA_ATTR.scrollLocked))}lockHard(){this.scrollPosition=window.pageYOffset,document.documentElement.style.setProperty("--window-scroll-offset",`${this.scrollPosition}px`),document.body.classList.add(nt.CSS.scrollLocked,nt.CSS.scrollLockedHard,nt.CSS.overflowHidden,nt.CSS.fixed,nt.CSS.wFull),document.body.style.top="calc(-1 * var(--window-scroll-offset))",document.body.setAttribute(nt.DATA_ATTR.scrollLockedHard,"true")}unlockHard(){document.body.classList.remove(nt.CSS.scrollLocked,nt.CSS.scrollLockedHard,nt.CSS.overflowHidden,nt.CSS.fixed,nt.CSS.wFull),document.body.style.top="",document.body.removeAttribute(nt.DATA_ATTR.scrollLockedHard),this.scrollPosition!==null&&window.scrollTo(0,this.scrollPosition),this.scrollPosition=null}};nt.CSS={scrollLocked:"blok-scroll-locked",scrollLockedHard:"is-hard",overflowHidden:"overflow-hidden",fixed:"fixed",wFull:"w-full"},nt.DATA_ATTR={scrollLocked:"data-blok-scroll-locked",scrollLockedHard:"data-blok-scroll-locked-hard"};let yd=nt;const bd={root:"flex items-center mb-2 mt-1",text:"text-lg font-semibold text-text-primary",backButton:"border-0 bg-transparent w-9 h-9 text-text-primary cursor-pointer [&_svg]:block [&_svg]:w-7 [&_svg]:h-7"},kd={root:"data-blok-popover-header",text:"data-blok-popover-header-text",backButton:"data-blok-popover-header-back-button"};class Kx{constructor({text:e,onBackButtonClick:t}){this.listeners=new Vo,this.text=e,this.onBackButtonClick=t,this.nodes={root:R.make("div",[bd.root],{"data-blok-testid":"popover-header",[kd.root]:""}),backButton:R.make("button",[bd.backButton],{"data-blok-testid":"popover-header-back-button",[kd.backButton]:""}),text:R.make("div",[bd.text],{"data-blok-testid":"popover-header-text",[kd.text]:""})},this.nodes.backButton.innerHTML=Bx,this.nodes.root.appendChild(this.nodes.backButton),this.listeners.on(this.nodes.backButton,"click",this.onBackButtonClick),this.nodes.text.innerText=this.text,this.nodes.root.appendChild(this.nodes.text)}getElement(){return this.nodes.root}destroy(){this.nodes.root.remove(),this.listeners.destroy()}}class Vx{constructor(){this.history=[]}push(e){this.history.push(e)}pop(){return this.history.pop()}get currentTitle(){return this.history.length===0?"":this.history[this.history.length-1].title}get currentItems(){return this.history.length===0?[]:this.history[this.history.length-1].items}reset(){for(;this.history.length>1;)this.pop()}}class cy extends ay{constructor(e){super(e,{[ot.Default]:{hint:{enabled:!1}},[ot.Html]:{hint:{enabled:!1}}}),this.scrollLocker=new yd,this.history=new Vx,this.isHidden=!0,this.nodes.overlay=R.make("div",[Fe.popoverOverlay],{[ze.popoverOverlay]:"",[ze.overlayHidden]:"","data-blok-testid":"popover-overlay"}),this.nodes.popover.insertBefore(this.nodes.overlay,this.nodes.popover.firstChild),this.listeners.on(this.nodes.overlay,"click",()=>{this.hide()}),this.history.push({items:e.items}),this.nodes.popoverContainer.style.setProperty("--offset","5px"),this.nodes.popoverContainer.className=Te(Fe.popoverContainer,Fe.popoverContainerMobile)}show(){this.nodes.overlay.removeAttribute(ze.overlayHidden),this.nodes.overlay.className=Te(Fe.popoverOverlay,Fe.popoverOverlayMobile),super.show(),this.nodes.popoverContainer.className=Te(Fe.popoverContainer,Fe.popoverContainerMobile,Fe.popoverContainerOpened,Fe.popoverContainerOpenedMobile),this.scrollLocker.lock(),this.isHidden=!1}hide(){this.isHidden||(super.hide(),this.nodes.overlay.setAttribute(ze.overlayHidden,""),this.nodes.overlay.className=Fe.popoverOverlay,this.nodes.popoverContainer.className=Te(Fe.popoverContainer,Fe.popoverContainerMobile),this.scrollLocker.unlock(),this.history.reset(),this.isHidden=!0)}destroy(){super.destroy(),this.scrollLocker.unlock()}showNestedItems(e){this.updateItemsAndHeader(e.children,e.title),this.history.push({title:e.title,items:e.children})}updateItemsAndHeader(e,t){var a,c;this.header!==null&&this.header!==void 0&&(this.header.destroy(),this.header=null);const o=t!==void 0;o&&(this.header=new Kx({text:t,onBackButtonClick:()=>{this.history.pop(),this.updateItemsAndHeader(this.history.currentItems,this.history.currentTitle)}}));const i=(c=(a=this.header)==null?void 0:a.getElement())!=null?c:null;o&&i!==null&&this.nodes.popoverContainer.insertBefore(i,this.nodes.popoverContainer.firstChild),this.items.forEach(d=>{var h;return(h=d.getElement())==null?void 0:h.remove()}),this.items=this.buildItems(e),this.items.forEach(d=>{var g;const h=d.getElement();h!==null&&((g=this.nodes.items)==null||g.appendChild(h))})}}class $x extends Ae{constructor(){super(...arguments),this.opened=!1,this.selection=new X,this.popover=null,this.flipperInstance=new Qn({focusedItemClass:Nt.focused,allowedKeys:[se.TAB,se.UP,se.DOWN,se.ENTER]}),this.flipperKeydownHandler=null,this.flipperKeydownSource=null,this.close=()=>{this.opened&&(this.opened=!1,X.isAtBlok||this.selection.restore(),this.selection.clearSaved(),this.detachFlipperKeydownListener(),!this.Blok.CrossBlockSelection.isCrossBlockSelectionStarted&&this.Blok.BlockManager.currentBlock&&this.Blok.BlockSelection.unselectBlock(this.Blok.BlockManager.currentBlock),this.eventsDispatcher.emit(this.events.closed),this.popover&&(this.popover.off(Jt.Closed,this.onPopoverClose),this.popover.destroy(),this.popover.getElement().remove(),this.popover=null))},this.onPopoverClose=()=>{this.close()}}get events(){return{opened:Xu,closed:Yu}}get CSS(){return{settings:"blok-settings"}}get flipper(){return this.flipperInstance}make(){this.nodes.wrapper=R.make("div",[this.CSS.settings]),this.nodes.wrapper.setAttribute("data-blok-testid","block-tunes-wrapper"),this.eventsDispatcher.on(Go,this.close)}destroy(){this.detachFlipperKeydownListener(),this.removeAllNodes(),this.listeners.destroy(),this.eventsDispatcher.off(Go,this.close)}async open(e,t){const o=e!=null?e:this.Blok.BlockManager.currentBlock;if(o===void 0)return;this.opened=!0,this.selection.save(),this.Blok.BlockSelection.selectBlock(o),this.Blok.BlockSelection.clearCache();const{toolTunes:i,commonTunes:a}=o.getTunes();this.eventsDispatcher.emit(this.events.opened);const c=Xn()?cy:Ar,d={searchable:!0,trigger:t||this.nodes.wrapper,items:await this.getTunesItems(o,a,i),scopeElement:this.Blok.API.methods.ui.nodes.redactor,messages:{nothingFound:Ge.ui(at.ui.popover,"Nothing found"),search:Ge.ui(at.ui.popover,"Filter")}};c===Ar&&(d.flipper=this.flipperInstance),this.popover=new c(d),this.popover.getElement().setAttribute("data-blok-testid","block-tunes-popover"),this.popover.on(Jt.Closed,this.onPopoverClose),this.popover.show(),c===Ar&&this.flipperInstance.focusItem(0),this.attachFlipperKeydownListener(o)}getElement(){return this.nodes.wrapper}contains(e){var t,o;return!!((t=this.nodes.wrapper)!=null&&t.contains(e)||(o=this.popover)!=null&&o.hasNode(e))}async getTunesItems(e,t,o){const i=[];o!==void 0&&o.length>0&&(i.push(...o),i.push({type:ot.Separator}));const a=Array.from(this.Blok.Tools.blockTools.values()),d=(await Hv(e,a)).reduce((h,g)=>(g.toolbox===void 0||g.toolbox.forEach(v=>{var b;const y=(b=v.title)!=null?b:g.name;h.push({icon:v.icon,title:Ge.t(at.toolNames,y),name:g.name,closeOnActivate:!0,onActivate:async()=>{const{BlockManager:x,Caret:w,Toolbar:T}=this.Blok,C=await x.convert(e,g.name,v.data);T.close(),w.setToBlock(C,w.positions.END)}})}),h),[]);return d.length>0&&(i.push({icon:xx,name:"convert-to",title:Ge.ui(at.ui.popover,"Convert to"),children:{searchable:!0,items:d}}),i.push({type:ot.Separator})),i.push(...t),i}attachFlipperKeydownListener(e){this.detachFlipperKeydownListener();const t=e==null?void 0:e.pluginsContent;t instanceof HTMLElement&&(this.flipperInstance.setHandleContentEditableTargets(!0),this.flipperKeydownHandler=o=>{this.flipperInstance.handleExternalKeydown(o)},t.addEventListener("keydown",this.flipperKeydownHandler,!0),this.flipperKeydownSource=t)}detachFlipperKeydownListener(){this.flipperKeydownSource!==null&&this.flipperKeydownHandler!==null&&this.flipperKeydownSource.removeEventListener("keydown",this.flipperKeydownHandler,!0),this.flipperInstance.setHandleContentEditableTargets(!1),this.flipperKeydownSource=null,this.flipperKeydownHandler=null}}const uy={SHIFT:["SHIFT"],CMD:["CMD","CONTROL","COMMAND","WINDOWS","CTRL"],ALT:["ALT","OPTION"]},Gx={0:"Digit0",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",A:"KeyA",B:"KeyB",C:"KeyC",D:"KeyD",E:"KeyE",F:"KeyF",G:"KeyG",H:"KeyH",I:"KeyI",J:"KeyJ",K:"KeyK",L:"KeyL",M:"KeyM",N:"KeyN",O:"KeyO",P:"KeyP",Q:"KeyQ",R:"KeyR",S:"KeyS",T:"KeyT",U:"KeyU",V:"KeyV",W:"KeyW",X:"KeyX",Y:"KeyY",Z:"KeyZ",BACKSPACE:"Backspace",ENTER:"Enter",ESCAPE:"Escape",LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown",INSERT:"Insert",DELETE:"Delete",".":"Period"},Xx=l=>Object.keys(uy).find(t=>uy[t].includes(l));class Yx{constructor(e){this.commands={SHIFT:!1,CMD:!1,ALT:!1},this.keys={},this.name=e.name,this.element=e.on,this.callback=e.callback,this.parseShortcutName(e.name),this.executeShortcut=t=>{this.execute(t)},this.element.addEventListener("keydown",this.executeShortcut,!1)}remove(){this.element.removeEventListener("keydown",this.executeShortcut)}parseShortcutName(e){const t=e.split("+");for(const o of t){const i=o.toUpperCase(),a=Xx(i);a!==void 0?this.commands[a]=!0:this.keys[i]=!0}}checkModifiers(e){const t={CMD:e.ctrlKey||e.metaKey,SHIFT:e.shiftKey,ALT:e.altKey};return Object.keys(this.commands).every(i=>this.commands[i]===t[i])}checkKeys(e){return Object.keys(this.keys).every(o=>{const i=Gx[o];return e.code===i})}execute(e){const t=this.checkModifiers(e),o=this.checkKeys(e);t&&o&&this.callback(e)}}let Qx=class{constructor(){this.registeredShortcuts=new Map}add(e){if(this.findShortcut(e.on,e.name))throw Error(`Shortcut ${e.name} is already registered for ${e.on}. Please remove it before add a new handler.`);const o=new Yx({name:e.name,on:e.on,callback:e.handler}),i=this.registeredShortcuts.get(e.on)||[];this.registeredShortcuts.set(e.on,[...i,o])}remove(e,t){const o=this.findShortcut(e,t);if(!o)return;o.remove();const i=this.registeredShortcuts.get(e);if(!i)return;const a=i.filter(c=>c!==o);if(a.length===0){this.registeredShortcuts.delete(e);return}this.registeredShortcuts.set(e,a)}findShortcut(e,t){return(this.registeredShortcuts.get(e)||[]).find(({name:i})=>i===t)}};const oo=new Qx;var Ss=(l=>(l.Opened="toolbox-opened",l.Closed="toolbox-closed",l.BlockAdded="toolbox-block-added",l))(Ss||{});class wd extends Ko{constructor({api:e,tools:t,i18nLabels:o,triggerElement:i}){super(),this.opened=!1,this.listeners=new Vo,this.popover=null,this.handleMobileLayoutToggle=()=>{this.destroyPopover(),this.initPopover()},this.onPopoverClose=()=>{this.opened=!1,this.emit("toolbox-closed")},this.api=e,this.tools=t,this.i18nLabels=o,this.triggerElement=i,this.enableShortcuts(),this.nodes={toolbox:R.make("div",wd.CSS.toolbox)},this.nodes.toolbox.setAttribute("data-blok-testid","toolbox"),this.initPopover(),this.api.events.on(Go,this.handleMobileLayoutToggle)}get isEmpty(){return this.toolsToBeDisplayed.length===0}static get CSS(){return{toolbox:"blok-toolbox"}}getElement(){return this.nodes.toolbox}contains(e){var t;return!!(this.nodes.toolbox.contains(e)||(t=this.popover)!=null&&t.getElement().contains(e))}hasFocus(){if(this.popover!==null)return"hasFocus"in this.popover?this.popover.hasFocus():void 0}destroy(){var e;super.destroy(),this.nodes&&this.nodes.toolbox&&this.nodes.toolbox.remove(),this.removeAllShortcuts(),(e=this.popover)==null||e.off(Jt.Closed,this.onPopoverClose),this.listeners.destroy(),this.api.events.off(Go,this.handleMobileLayoutToggle)}async toolButtonActivated(e,t){await this.insertNewBlock(e,t)}open(){var e;this.isEmpty||((e=this.popover)==null||e.show(),this.opened=!0,this.emit("toolbox-opened"))}close(){var e;(e=this.popover)==null||e.hide(),this.opened=!1,this.emit("toolbox-closed")}toggle(){this.opened?this.close():this.open()}initPopover(){const e=Xn()?cy:Ar;this.popover=new e({scopeElement:this.api.ui.nodes.redactor,trigger:this.triggerElement||this.nodes.toolbox,searchable:!0,messages:{nothingFound:this.i18nLabels.nothingFound,search:this.i18nLabels.filter},items:this.toolboxItemsToBeDisplayed}),this.popover.on(Jt.Closed,this.onPopoverClose),this.popover.getElement().setAttribute("data-blok-testid","toolbox-popover")}destroyPopover(){this.popover!==null&&(this.popover.hide(),this.popover.off(Jt.Closed,this.onPopoverClose),this.popover.destroy(),this.popover=null),this.nodes.toolbox!==null&&(this.nodes.toolbox.innerHTML="")}get toolsToBeDisplayed(){if(this._toolsToBeDisplayed)return this._toolsToBeDisplayed;const e=[];return this.tools.forEach(t=>{t.toolbox&&e.push(t)}),this._toolsToBeDisplayed=e,e}get toolboxItemsToBeDisplayed(){if(this._toolboxItemsToBeDisplayed)return this._toolboxItemsToBeDisplayed;const e=(o,i,a=!0)=>({icon:o.icon,title:Ge.t(at.toolNames,o.title||ds(i.name)),name:i.name,onActivate:()=>{this.toolButtonActivated(i.name,o.data)},secondaryLabel:i.shortcut&&a?pv(i.shortcut):""}),t=this.toolsToBeDisplayed.reduce((o,i)=>{const{toolbox:a}=i;return a===void 0||(Array.isArray(a)?a:[a]).forEach((d,h)=>{o.push(e(d,i,h===0))}),o},[]);return this._toolboxItemsToBeDisplayed=t,t}enableShortcuts(){this.toolsToBeDisplayed.forEach(e=>{const t=e.shortcut;t&&this.enableShortcutForTool(e.name,t)})}enableShortcutForTool(e,t){oo.add({name:t,on:this.api.ui.nodes.redactor,handler:async o=>{o.preventDefault();const i=this.api.blocks.getCurrentBlockIndex(),a=this.api.blocks.getBlockByIndex(i);if(a)try{const c=await this.api.blocks.convert(a.id,e);this.api.caret.setToBlock(c,"end");return}catch(c){}await this.insertNewBlock(e)}})}removeAllShortcuts(){this.toolsToBeDisplayed.forEach(e=>{const t=e.shortcut;t&&oo.remove(this.api.ui.nodes.redactor,t)})}async insertNewBlock(e,t){const o=this.api.blocks.getCurrentBlockIndex(),i=this.api.blocks.getBlockByIndex(o);if(!i)return;const a=i.isEmpty?o:o+1,d=t!==void 0&&Object.keys(t).length>0?Object.assign(await this.api.blocks.composeBlockData(e),t):void 0,h=this.api.blocks.insert(e,d,void 0,a,void 0,i.isEmpty);this.api.caret.setToBlock(a),this.emit("toolbox-block-added",{block:h}),this.api.toolbar.close()}}const dy="block hovered",fy=1e3;class Zx extends Ae{constructor({config:e,eventsDispatcher:t}){super({config:e,eventsDispatcher:t}),this.hoveredBlock=null,this.toolboxInstance=null,this.settingsTogglerMouseDownPosition=null,this.onBlockSettingsOpen=()=>{var o;(o=this.nodes.settingsToggler)==null||o.classList.add(this.CSS.settingsTogglerOpened)},this.onBlockSettingsClose=()=>{var o;(o=this.nodes.settingsToggler)==null||o.classList.remove(this.CSS.settingsTogglerOpened)}}get CSS(){return{toolbar:kt("absolute left-0 right-0 top-0 transition-opacity duration-100 ease-linear will-change-[opacity,top]"),toolbarSelector:"blok-toolbar",toolbarOpened:"block",toolbarClosed:"hidden",content:kt("relative mx-auto max-w-content"),actions:kt("absolute flex opacity-0 pr-[5px]","right-full","mobile:right-auto","group-[.blok-editor--rtl]:right-auto group-[.blok-editor--rtl]:left-[calc(-1*theme(width.toolbox-btn))]","mobile:group-[.blok-editor--rtl]:ml-0 mobile:group-[.blok-editor--rtl]:mr-auto mobile:group-[.blok-editor--rtl]:pr-0 mobile:group-[.blok-editor--rtl]:pl-[10px]"),actionsOpened:"opacity-100",openedToolboxHolderModifier:"is-toolbox-opened",plusButton:kt("text-dark cursor-pointer w-toolbox-btn h-toolbox-btn rounded-[7px] inline-flex justify-center items-center select-none","shrink-0","[&_svg]:h-6 [&_svg]:w-6","can-hover:hover:bg-bg-light","mobile:bg-white mobile:border mobile:border-[#e8e8eb] mobile:shadow-overlay-pane mobile:rounded-[6px] mobile:z-[2]","mobile:w-toolbox-btn-mobile mobile:h-toolbox-btn-mobile","group-[.blok-editor--rtl]:right-[calc(-1*theme(width.toolbox-btn))] group-[.blok-editor--rtl]:left-auto","not-mobile:group-[.blok-editor--narrow]:left-[5px]","not-mobile:group-[.blok-editor--narrow.blok-editor--rtl]:left-0 not-mobile:group-[.blok-editor--narrow.blok-editor--rtl]:right-[5px]"),plusButtonShortcut:"mt-[5px] opacity-60",plusButtonShortcutKey:"text-white",settingsTogglerHandle:"blok-settings-toggler",settingsToggler:kt("blok-settings-toggler","text-dark cursor-pointer w-toolbox-btn h-toolbox-btn rounded-[7px] inline-flex justify-center items-center select-none","cursor-pointer select-none","[&_svg]:h-6 [&_svg]:w-6","active:cursor-grabbing","can-hover:hover:bg-bg-light can-hover:hover:cursor-grab","group-[.is-toolbox-opened]:can-hover:hover:cursor-pointer","mobile:bg-white mobile:border mobile:border-[#e8e8eb] mobile:shadow-overlay-pane mobile:rounded-[6px] mobile:z-[2]","mobile:w-toolbox-btn-mobile mobile:h-toolbox-btn-mobile","not-mobile:w-6"),settingsTogglerHidden:"hidden",settingsTogglerOpened:kt("can-hover:hover:cursor-pointer")}}get opened(){var e,t;return(t=(e=this.nodes.wrapper)==null?void 0:e.classList.contains(this.CSS.toolbarOpened))!=null?t:!1}contains(e){var t,o;return!!((t=this.nodes.wrapper)!=null&&t.contains(e)||(o=this.toolboxInstance)!=null&&o.contains(e)||this.Blok.BlockSettings.contains(e))}get toolbox(){var e;return{opened:(e=this.toolboxInstance)==null?void 0:e.opened,close:()=>{var t;(t=this.toolboxInstance)==null||t.close()},open:()=>{if(this.toolboxInstance===null){Be("toolbox.open() called before initialization is finished","warn");return}this.hoveredBlock&&(this.Blok.BlockManager.currentBlock=this.hoveredBlock),this.toolboxInstance.open()},toggle:()=>{if(this.toolboxInstance===null){Be("toolbox.toggle() called before initialization is finished","warn");return}this.toolboxInstance.toggle()},hasFocus:()=>{var t;return(t=this.toolboxInstance)==null?void 0:t.hasFocus()}}}get blockActions(){return{hide:()=>{var e,t;(e=this.nodes.actions)==null||e.classList.remove(this.CSS.actionsOpened),(t=this.nodes.actions)==null||t.removeAttribute("data-blok-opened")},show:()=>{var e,t;(e=this.nodes.actions)==null||e.classList.add(this.CSS.actionsOpened),(t=this.nodes.actions)==null||t.setAttribute("data-blok-opened","true")}}}get blockTunesToggler(){return{hide:()=>{var e;return(e=this.nodes.settingsToggler)==null?void 0:e.classList.add(this.CSS.settingsTogglerHidden)},show:()=>{var e;return(e=this.nodes.settingsToggler)==null?void 0:e.classList.remove(this.CSS.settingsTogglerHidden)}}}toggleReadOnly(e){e?(this.destroy(),this.Blok.BlockSettings.destroy(),this.disableModuleBindings()):window.requestIdleCallback(async()=>{await this.drawUI(),this.enableModuleBindings()},{timeout:2e3})}moveAndOpen(e){if(this.toolboxInstance===null){Be("Can't open Toolbar since Blok initialization is not finished yet","warn");return}this.toolboxInstance.opened&&this.toolboxInstance.close(),this.Blok.BlockSettings.opened&&this.Blok.BlockSettings.close();const t=e!=null?e:this.Blok.BlockManager.currentBlock;if(!t)return;this.hoveredBlock=t;const{wrapper:o,plusButton:i}=this.nodes;if(!o||!i)return;const a=t.holder,{isMobile:c}=this.Blok.UI,d=20,h=t.firstInput,g=a.getBoundingClientRect(),v=h!==void 0?h.getBoundingClientRect():null,y=v!==null?v.top-g.top:null,b=(()=>{const T=parseInt(window.getComputedStyle(t.pluginsContent).paddingTop,10);if(c){const H=parseInt(window.getComputedStyle(i).height,10);return T-H}if(h===void 0||y===null||y>d)return T;const C=IS(h),O=parseInt(window.getComputedStyle(i).height,10);return C-O+8+y})();o.style.top=`${Math.floor(b)}px`,a.appendChild(o);const x=t.getTunes(),w=x.toolTunes.length>0||x.commonTunes.length>0;this.Blok.BlockManager.blocks.length===1&&t.isEmpty&&!w?this.blockTunesToggler.hide():this.blockTunesToggler.show(),this.open()}close(){var e,t,o,i;this.Blok.ReadOnly.isEnabled||((e=this.nodes.wrapper)==null||e.classList.remove(this.CSS.toolbarOpened),(t=this.nodes.wrapper)==null||t.classList.add(this.CSS.toolbarClosed),(o=this.nodes.wrapper)==null||o.removeAttribute("data-blok-opened"),this.blockActions.hide(),(i=this.toolboxInstance)==null||i.close(),this.Blok.BlockSettings.close(),this.reset())}reset(){this.nodes.wrapper&&(this.nodes.wrapper.style.top="unset",this.Blok.UI.nodes.wrapper.appendChild(this.nodes.wrapper))}open(e=!0){var t,o,i;(t=this.nodes.wrapper)==null||t.classList.remove(this.CSS.toolbarClosed),(o=this.nodes.wrapper)==null||o.classList.add(this.CSS.toolbarOpened),(i=this.nodes.wrapper)==null||i.setAttribute("data-blok-opened","true"),e?this.blockActions.show():this.blockActions.hide()}async make(){const e=R.make("div",[this.CSS.toolbar,this.CSS.toolbarSelector,this.CSS.toolbarClosed,"group-[.is-dragging]:pointer-events-none"]);this.nodes.wrapper=e,e.setAttribute("data-blok-testid","toolbar");const t=R.make("div",this.CSS.content),o=R.make("div",[this.CSS.actions,"not-mobile:group-[.blok-editor--narrow]:right-[calc(-1*theme(spacing.narrow-mode-right-padding)-5px)]","not-mobile:group-[.blok-editor--narrow.blok-editor--rtl]:right-auto","not-mobile:group-[.blok-editor--narrow.blok-editor--rtl]:left-[calc(-1*theme(spacing.narrow-mode-right-padding)-5px)]","not-mobile:group-[.blok-editor--narrow.blok-editor--rtl]:left-[-5px]"]);this.nodes.content=t,this.nodes.actions=o,o.setAttribute("data-blok-testid","toolbar-actions"),R.append(e,t),R.append(t,o);const i=R.make("div",this.CSS.plusButton,{innerHTML:Ex});i.setAttribute("data-blok-testid","plus-button"),this.nodes.plusButton=i,R.append(o,i),this.readOnlyMutableListeners.on(i,"click",()=>{Xo(!0),this.plusButtonClicked()},!1);const a=R.make("div"),c=T=>{const C=document.createDocumentFragment(),O=T.indexOf(" ");if(O>0){const L=T.substring(0,O),U=T.substring(O);C.appendChild(R.make("span",this.CSS.plusButtonShortcutKey,{textContent:L})),C.appendChild(document.createTextNode(U))}else C.appendChild(document.createTextNode(T));return C};a.appendChild(c(Ge.ui(at.ui.toolbar.toolbox,"Click to add below"))),a.appendChild(R.make("br"));const h=hv().win?Ge.ui(at.ui.toolbar.toolbox,"Ctrl-click to add above"):Ge.ui(at.ui.toolbar.toolbox,"Option-click to add above");a.appendChild(c(h)),ys(i,a,{hidingDelay:400});const g=R.make("span",[this.CSS.settingsToggler,"group-[.is-dragging]:cursor-grabbing"],{innerHTML:Cx});g.setAttribute("data-blok-testid","settings-toggler"),this.nodes.settingsToggler=g,R.append(o,g);const v=R.make("div"),y=T=>{const C=R.make("div"),[O,...L]=T.split(" "),U=R.make("span",null,{textContent:O});return U.style.color="white",C.appendChild(U),L.length>0&&C.appendChild(R.text(" "+L.join(" "))),C},b=Ge.ui(at.ui.blockTunes.toggler,"Drag to move"),x=Ge.ui(at.ui.blockTunes.toggler,"Click to open the menu");v.appendChild(y(b)),v.appendChild(y(x)),ys(g,v,{hidingDelay:400}),R.append(o,this.makeToolbox());const w=this.Blok.BlockSettings.getElement();if(!w)throw new Error("Block Settings element was not created");R.append(o,w),R.append(this.Blok.UI.nodes.wrapper,e)}makeToolbox(){this.toolboxInstance=new wd({api:this.Blok.API.methods,tools:this.Blok.Tools.blockTools,i18nLabels:{filter:Ge.ui(at.ui.popover,"Filter"),nothingFound:Ge.ui(at.ui.popover,"Nothing found")},triggerElement:this.nodes.plusButton}),this.toolboxInstance.on(Ss.Opened,()=>{this.Blok.UI.nodes.wrapper.classList.add(this.CSS.openedToolboxHolderModifier),this.Blok.UI.nodes.wrapper.setAttribute("data-blok-toolbox-opened","true")}),this.toolboxInstance.on(Ss.Closed,()=>{this.Blok.UI.nodes.wrapper.classList.remove(this.CSS.openedToolboxHolderModifier),this.Blok.UI.nodes.wrapper.removeAttribute("data-blok-toolbox-opened")}),this.toolboxInstance.on(Ss.BlockAdded,({block:t})=>{const{BlockManager:o,Caret:i}=this.Blok,a=o.getBlockById(t.id);if(!a||a.inputs.length!==0)return;if(a===o.lastBlock){o.insertAtEnd(),i.setToBlock(o.lastBlock);return}const c=o.nextBlock;c&&i.setToBlock(c)});const e=this.toolboxInstance.getElement();if(e===null)throw new Error("Toolbox element was not created");return e}plusButtonClicked(){var e;this.hoveredBlock&&(this.Blok.BlockManager.currentBlock=this.hoveredBlock),this.Blok.BlockSettings.opened&&this.Blok.BlockSettings.close(),(e=this.toolboxInstance)==null||e.toggle()}enableModuleBindings(){const e=this.nodes.settingsToggler;e&&(this.readOnlyMutableListeners.on(e,"mousedown",t=>{t.stopPropagation(),Xo(!0);const o=t;this.settingsTogglerMouseDownPosition={x:o.clientX,y:o.clientY}},!0),this.readOnlyMutableListeners.on(e,"click",t=>{var c;t.stopPropagation();const o=t,i=this.settingsTogglerMouseDownPosition;this.settingsTogglerMouseDownPosition=null,!(i!==null&&(Math.abs(o.clientX-i.x)>fy||Math.abs(o.clientY-i.y)>fy))&&(this.settingsTogglerClicked(),(c=this.toolboxInstance)!=null&&c.opened&&this.toolboxInstance.close())},!0)),Xn()||this.eventsDispatcher.on(dy,t=>{var i;const o=t.block;o instanceof Sn&&(this.Blok.BlockSettings.opened||(i=this.toolboxInstance)!=null&&i.opened||this.moveAndOpen(o))}),this.eventsDispatcher.on(Xu,this.onBlockSettingsOpen),this.eventsDispatcher.on(Yu,this.onBlockSettingsClose)}disableModuleBindings(){this.readOnlyMutableListeners.clearAll(),this.eventsDispatcher.off(Xu,this.onBlockSettingsOpen),this.eventsDispatcher.off(Yu,this.onBlockSettingsClose)}settingsTogglerClicked(){const e=this.hoveredBlock;e&&(this.Blok.BlockManager.currentBlock=e,this.Blok.BlockSettings.opened?this.Blok.BlockSettings.close():this.Blok.BlockSettings.open(e,this.nodes.settingsToggler))}async drawUI(){this.Blok.BlockSettings.make(),await this.make()}destroy(){this.removeAllNodes(),this.toolboxInstance&&this.toolboxInstance.destroy()}}var Ir=(l=>(l[l.Block=0]="Block",l[l.Inline=1]="Inline",l[l.Tune=2]="Tune",l))(Ir||{}),xs=(l=>(l.Shortcut="shortcut",l.Toolbox="toolbox",l.EnabledInlineTools="inlineToolbar",l.EnabledBlockTunes="tunes",l.Config="config",l))(xs||{}),hy=(l=>(l.Shortcut="shortcut",l.SanitizeConfig="sanitize",l))(hy||{}),io=(l=>(l.IsEnabledLineBreaks="enableLineBreaks",l.Toolbox="toolbox",l.ConversionConfig="conversionConfig",l.IsReadOnlySupported="isReadOnlySupported",l.PasteConfig="pasteConfig",l))(io||{}),py=(l=>(l.IsInline="isInline",l.Title="title",l.IsReadOnlySupported="isReadOnlySupported",l))(py||{}),Td=(l=>(l.IsTune="isTune",l))(Td||{});class Sd{constructor({name:e,constructable:t,config:o,api:i,isDefault:a,isInternal:c=!1,defaultPlaceholder:d}){this.api=i,this.name=e,this.constructable=t,this.config=o,this.isDefault=a,this.isInternal=c,this.defaultPlaceholder=d}get settings(){var t;const e=(t=this.config.config)!=null?t:{};return this.isDefault&&!("placeholder"in e)&&this.defaultPlaceholder&&(e.placeholder=this.defaultPlaceholder),e}reset(){if(De(this.constructable.reset))return this.constructable.reset()}prepare(){const e=this.constructable.prepare;if(!De(e))return;const t={toolName:this.name,config:this.settings};return e.call(this.constructable,t)}get shortcut(){const e=this.constructable.shortcut;return this.config.shortcut||e}get sanitizeConfig(){return this.constructable.sanitize||{}}isInline(){return this.type===Ir.Inline}isBlock(){return this.type===Ir.Block}isTune(){return this.type===Ir.Tune}}const Jx="absolute top-0 left-0 z-[3] opacity-100 visible transition-opacity duration-[250ms] ease-out will-change-[opacity,left,top] [&_[hidden]]:!hidden";class eC extends Ae{constructor({config:e,eventsDispatcher:t}){super({config:e,eventsDispatcher:t}),this.opened=!1,this.popover=null,this.toolbarVerticalMargin=Xn()?20:6,this.initialized=!1,this.initializationScheduled=!1,this.tools=new Map,this.registeredShortcuts=new Map,this.shortcutsRegistered=!1,this.shortcutRegistrationScheduled=!1,this.listeners.on(document,"keydown",o=>{const i=o;i.shiftKey&&(i.key==="ArrowDown"||i.key==="ArrowUp")&&this.tryToShow()},!0),this.scheduleInitialization(),this.tryRegisterShortcuts()}set state(e){super.state=e,this.tryRegisterShortcuts()}initialize(){var e,t,o;if(!this.initialized){if(!((o=(t=(e=this.Blok)==null?void 0:e.UI)==null?void 0:t.nodes)!=null&&o.wrapper)||this.Blok.Tools===void 0){this.scheduleInitialization();return}this.make(),this.tryRegisterShortcuts(),this.initialized=!0}}tryRegisterShortcuts(){var t;if(this.shortcutsRegistered)return;if(((t=this.Blok)==null?void 0:t.Tools)===void 0){this.scheduleShortcutRegistration();return}this.registerInitialShortcuts()&&(this.shortcutsRegistered=!0)}scheduleShortcutRegistration(){if(this.shortcutsRegistered||this.shortcutRegistrationScheduled)return;this.shortcutRegistrationScheduled=!0;const e=()=>{this.shortcutRegistrationScheduled=!1,this.tryRegisterShortcuts()};typeof window!="undefined"&&typeof window.setTimeout=="function"?window.setTimeout(e,0):e()}scheduleInitialization(){if(this.initialized||this.initializationScheduled)return;this.initializationScheduled=!0;const e=()=>{this.initializationScheduled=!1,this.initialize()},t=()=>{window.setTimeout(e,0)};typeof window!="undefined"&&"requestIdleCallback"in window?window.requestIdleCallback(()=>{t()},{timeout:2e3}):t()}async tryToShow(e=!1){e&&this.close(),this.initialize(),this.allowedToShow()&&(await this.open(),this.Blok.Toolbar.close())}close(){var i,a,c,d,h,g,v;if(!this.opened)return;for(const y of this.tools.values());this.tools=new Map,this.reset(),this.opened=!1;const e=(i=this.popover)!=null?i:this.createFallbackPopover();(a=e==null?void 0:e.hide)==null||a.call(e),(c=e==null?void 0:e.destroy)==null||c.call(e);const t=vd.mock,o=(h=(d=t==null?void 0:t.results)==null?void 0:d.at(-1))==null?void 0:h.value;o&&o!==e&&((g=o.hide)==null||g.call(o),(v=o.destroy)==null||v.call(o)),this.popover=null}containsNode(e){return this.nodes.wrapper===void 0?!1:this.nodes.wrapper.contains(e)}destroy(){var e;this.removeAllNodes(),(e=this.popover)==null||e.destroy(),this.popover=null}make(){this.nodes.wrapper=R.make("div"),this.nodes.wrapper.className=Te(Jx,this.isRtl?this.Blok.UI.CSS.blokRtlFix:""),this.nodes.wrapper.setAttribute(ro,Z1),this.nodes.wrapper.setAttribute("data-blok-testid","inline-toolbar"),R.append(this.Blok.UI.nodes.wrapper,this.nodes.wrapper)}async open(){var i,a,c,d,h,g,v,y,b,x,w,T,C;if(this.opened)return;this.initialize(),this.opened=!0,this.popover!==null&&this.popover.destroy(),this.createToolsInstances();const e=await this.getPopoverItems();this.popover=new vd({items:e,scopeElement:(h=(d=(c=(a=(i=this.Blok.API)==null?void 0:i.methods)==null?void 0:a.ui)==null?void 0:c.nodes)==null?void 0:d.redactor)!=null?h:this.Blok.UI.nodes.redactor,messages:{nothingFound:Ge.ui(at.ui.popover,"Nothing found"),search:Ge.ui(at.ui.popover,"Filter")}});const t=(v=(g=this.popover).getElement)==null?void 0:v.call(g),o=(x=(b=(y=this.popover.size)==null?void 0:y.width)!=null?b:t==null?void 0:t.getBoundingClientRect().width)!=null?x:0;this.move(o),t&&((w=this.nodes.wrapper)==null||w.append(t)),(C=(T=this.popover).show)==null||C.call(T)}move(e){const t=X.rect,o=this.Blok.UI.nodes.wrapper.getBoundingClientRect(),i={x:t.x-o.x,y:t.y+t.height-o.top+this.toolbarVerticalMargin};i.x+e+o.x>this.Blok.UI.contentRect.right&&(i.x=this.Blok.UI.contentRect.right-e-o.x),this.nodes.wrapper.style.left=Math.floor(i.x)+"px",this.nodes.wrapper.style.top=Math.floor(i.y)+"px"}reset(){this.nodes.wrapper!==void 0&&(this.nodes.wrapper.style.left="0",this.nodes.wrapper.style.top="0")}allowedToShow(){const e=["IMG","INPUT"],t=this.resolveSelection(),o=X.text;if(!t||!t.anchorNode||t.isCollapsed||o.length<1)return!1;const i=R.isElement(t.anchorNode)?t.anchorNode:t.anchorNode.parentElement;if(i===null||t!==null&&e.includes(i.tagName))return!1;const a=R.isElement(t.anchorNode)?t.anchorNode:t.anchorNode.parentElement,c=a?this.Blok.BlockManager.getBlock(a):null,d=c!=null?c:this.Blok.BlockManager.currentBlock;if(d==null||this.getTools().some(w=>d.tool.inlineTools.has(w.name))===!1)return!1;const v="[contenteditable]";if(i.closest(v)!==null)return!0;const b=d.holder;return b&&(b.matches(v)?b:b.closest(v))?!0:this.Blok.ReadOnly.isEnabled?X.isSelectionAtBlok(t):!1}getTools(){var o;const e=(o=this.Blok.BlockManager.currentBlock)!=null?o:(()=>{const i=this.resolveSelection(),a=i==null?void 0:i.anchorNode;if(!a)return null;const c=R.isElement(a)?a:a.parentElement;return c?this.Blok.BlockManager.getBlock(c):null})();return e?Array.from(e.tool.inlineTools.values()).filter(i=>!(this.Blok.ReadOnly.isEnabled&&i.isReadOnlySupported!==!0)):[]}createToolsInstances(){this.tools=new Map,this.getTools().forEach(t=>{const o=t.create();this.tools.set(t,o)})}async getPopoverItems(){const e=[],t=Array.from(this.tools.entries());for(const[o,[i,a]]of t.entries()){const c=await a.render(),d=this.getToolShortcut(i.name);this.tryEnableShortcut(i.name,d);const h=d!==void 0?pv(d):void 0,g=Ge.t(at.toolNames,i.title||ds(i.name));[c].flat().forEach(v=>{this.processPopoverItem(v,i.name,a,g,h,e,o)})}return e}tryEnableShortcut(e,t){if(t!==void 0)try{this.enableShortcuts(e,t)}catch(o){}}processPopoverItem(e,t,o,i,a,c,d){const h={name:t,hint:{title:i,description:a}};if(!R.isElement(e)){if(e.type===ot.Html){c.push(_t(be(be({},h),e),{type:ot.Html}));return}if(e.type===ot.Separator){c.push({type:ot.Separator});return}this.processDefaultItem(e,h,c,d)}}processDefaultItem(e,t,o,i){const a=_t(be(be({},t),e),{type:ot.Default});o.push(a),"children"in a&&i===0&&o.push({type:ot.Separator})}getToolShortcut(e){const{Tools:t}=this.Blok,o=t.inlineTools.get(e),i=t.internal.inlineTools;return Array.from(i.keys()).includes(e)?this.inlineTools[e][hy.Shortcut]:o==null?void 0:o.shortcut}enableShortcuts(e,t){const o=this.registeredShortcuts.get(e);o!==t&&(this.isShortcutTakenByAnotherTool(e,t)||(o!==void 0&&(oo.remove(document,o),this.registeredShortcuts.delete(e)),oo.add({name:t,handler:i=>{const{currentBlock:a}=this.Blok.BlockManager;a&&a.tool.enabledInlineTools!==!1&&(i.preventDefault(),this.activateToolByShortcut(e))},on:document}),this.registeredShortcuts.set(e,t)))}isShortcutTakenByAnotherTool(e,t){return Array.from(this.registeredShortcuts.entries()).some(([o,i])=>o!==e&&i===t)}async activateToolByShortcut(e){if(this.opened||await this.tryToShow(),this.popover){this.popover.activateItemByName(e);return}this.invokeToolActionDirectly(e)}invokeToolActionDirectly(e){const t=this.Blok.Tools.inlineTools.get(e);if(!t)return;const i=t.create().render(),a=Array.isArray(i)?i:[i];for(const c of a)if("onActivate"in c&&typeof c.onActivate=="function"){c.onActivate(c);return}}get inlineTools(){const e={};return Array.from(this.Blok.Tools.inlineTools.entries()).forEach(([t,o])=>{e[t]=o.create()}),e}registerInitialShortcuts(){var o;const e=(o=this.Blok.Tools)==null?void 0:o.inlineTools;return e?(Array.from(e.keys()).forEach(i=>{const a=this.getToolShortcut(i);this.tryEnableShortcut(i,a)}),!0):(this.scheduleShortcutRegistration(),!1)}createFallbackPopover(){var e,t,o,i,a;try{const c=(a=(i=(o=(t=(e=this.Blok.API)==null?void 0:e.methods)==null?void 0:t.ui)==null?void 0:o.nodes)==null?void 0:i.redactor)!=null?a:this.Blok.UI.nodes.redactor;return new vd({items:[],scopeElement:c,messages:{nothingFound:Ge.ui(at.ui.popover,"Nothing found"),search:Ge.ui(at.ui.popover,"Filter")}})}catch(c){return null}}resolveSelection(){const e=X.selection;if(e!==void 0)return e;const t=X.instance;return t!==void 0?t:X.get()}}const xd=" ",Cd=new WeakSet,Ed=()=>{var c,d;const l=window.getSelection();if(l===null)return[null,0];const e=l.focusNode,t=l.focusOffset;if(e===null)return[null,0];if(e.nodeType===Node.TEXT_NODE||e.childNodes.length===0)return[e,t];const o=e.childNodes[t];if(o!==void 0)return[o,0];const i=(c=e.childNodes[t-1])!=null?c:null,a=(d=i==null?void 0:i.textContent)!=null?d:null;return[i,a!==null?a.length:0]},gy=l=>{var t;if(!(l instanceof HTMLElement)||R.isSingleTag(l)||R.isNativeInput(l))return!1;if(l.childNodes.length===0)return!0;const e=(t=l.textContent)!=null?t:"";return e.includes(xd)||!Uu(e)?!1:Array.from(l.children).every(o=>gy(o))},my=typeof window!="undefined"&&typeof window.MutationObserver!="undefined"?new window.MutationObserver(l=>{for(const e of l){const t=e.nextSibling;e.removedNodes.forEach(o=>{var h,g,v;if(!(o instanceof Element)||!gy(o))return;const i=t instanceof Text?t:null;if(i===null||!i.isConnected)return;const a=i.parentElement;if(!((h=a==null?void 0:a.isContentEditable)!=null&&h))return;const c=(v=(g=i.textContent)==null?void 0:g[0])!=null?v:null;(c===xd||c===" ")&&Cd.add(i)})}}):null,vy=new WeakSet,yy=l=>{if(my===null||vy.has(l))return;const e=()=>{l.body!==null&&(my.observe(l.body,{childList:!0,subtree:!0}),vy.add(l))};l.readyState==="loading"?l.addEventListener("DOMContentLoaded",e,{once:!0}):e()};typeof window!="undefined"&&typeof window.document!="undefined"&&yy(window.document);const tC=l=>{var i,a;yy(l.ownerDocument);const[e,t]=Ed();if(e===null||!l.contains(e)||e.nodeType===Node.TEXT_NODE&&t<((i=e.textContent)!=null?i:"").length)return null;const o=document.createTreeWalker(l,NodeFilter.SHOW_TEXT);for(o.currentNode=e;;){const c=o.nextNode();if(c===null)return null;const d=(a=c.textContent)!=null?a:"";if(d.length===0)continue;const h=d[0];if(!(h===xd||h===" ")||c===e)return null;const v=document.createRange();try{v.setStart(e,t),v.setEnd(c,0)}catch(T){return null}const y=v.cloneContents(),b=document.createElement("div");b.appendChild(y);const x=Array.from(b.querySelectorAll("*")).some(T=>{var O;const C=(O=T.textContent)!=null?O:"";return C.length===0||Uu(C)}),w=Cd.has(c);if(!(!x&&!w))return w&&Cd.delete(c),{node:c,offset:0}}},by=(l,e,t,o)=>{const i=document.createRange();o==="left"?(i.selectNodeContents(l),i.setEnd(e,t)):(i.selectNodeContents(l),i.setStart(e,t));const a=i.cloneContents(),c=document.createElement("div");c.appendChild(a);const d=c.textContent||"";if(c.querySelectorAll("img, br, hr, input, area, base, col, embed, link, meta, param, source, track, wbr").length>0)return!1;const g=d.includes(" ")||c.innerHTML.includes("&nbsp;")||i.toString().includes(" "),v=e.nodeType===Node.TEXT_NODE&&(o==="left"?(e.textContent||"").slice(0,t):(e.textContent||"").slice(t)).includes(" ");if(g||v)return!1;c.style.position="absolute",c.style.visibility="hidden",c.style.height="auto",c.style.width="auto",c.style.whiteSpace=window.getComputedStyle(l).whiteSpace,document.body.appendChild(c);const y=c.getBoundingClientRect().width;return document.body.removeChild(c),!(y>0||!Uu(d)||window.getComputedStyle(l).whiteSpace.startsWith("pre")&&d.length>0)},Cs=l=>{var c;const e=R.getDeepestNode(l);if(e===null||R.isEmpty(l))return!0;if(R.isNativeInput(e))return e.selectionEnd===0;if(R.isEmpty(l))return!0;const[t,o]=Ed();if(t===null)return!1;const i=window.getSelection(),a=(c=i==null?void 0:i.focusNode)!=null?c:null;return a!==null&&a!==l&&!(a.nodeType===Node.TEXT_NODE&&a.parentNode===l)?!1:by(l,t,o,"left")},Es=l=>{const e=R.getDeepestNode(l,!0);if(e===null)return!0;if(R.isNativeInput(e))return e.selectionEnd===e.value.length;const[t,o]=Ed();return t===null?!1:by(l,t,o,"right")},nC=(l,e=!0)=>{var y,b,x,w;if(R.isNativeInput(l)){l.focus();const T=e?0:l.value.length;l.setSelectionRange(T,T);return}const t=document.createRange(),o=window.getSelection();if(!o)return;const i=(T,C=!1)=>{const O=document.createTextNode("");C?T.insertBefore(O,T.firstChild):T.appendChild(O),t.setStart(O,0),t.setEnd(O,0)},a=(T,C)=>{if(T===null)return null;if(T.nodeType===Node.TEXT_NODE)return T;const O=C?T.firstChild:T.lastChild;return a(O,C)},c=l.childNodes,d=e?(y=c[0])!=null?y:null:(b=c[c.length-1])!=null?b:null,h=a(d,e);if(d===null){i(l),o.removeAllRanges(),o.addRange(t);return}if(h===null||h.nodeType!==Node.TEXT_NODE){i(l,e),o.removeAllRanges(),o.addRange(t);return}const g=(w=(x=h.textContent)==null?void 0:x.length)!=null?w:0,v=e?0:g;t.setStart(h,v),t.setEnd(h,v),o.removeAllRanges(),o.addRange(t)},ky={Backspace:se.BACKSPACE,Delete:se.DELETE,Enter:se.ENTER,Tab:se.TAB,ArrowDown:se.DOWN,ArrowRight:se.RIGHT,ArrowUp:se.UP,ArrowLeft:se.LEFT},rC=new Set(["Enter","Process","Spacebar","Space","Dead"]),Bs='[contenteditable="true"], textarea, input';class oC extends Ae{keydown(e){if(this.beforeKeydownProcessing(e),this.handleSelectedBlocksDeletion(e)||e.defaultPrevented)return;switch(this.getKeyCode(e)){case se.BACKSPACE:this.backspace(e);break;case se.DELETE:this.delete(e);break;case se.ENTER:this.enter(e);break;case se.DOWN:case se.RIGHT:this.arrowRightAndDown(e);break;case se.UP:case se.LEFT:this.arrowLeftAndUp(e);break;case se.TAB:this.tabPressed(e);break}e.key==="/"&&!e.ctrlKey&&!e.metaKey&&this.slashPressed(e),e.code==="Slash"&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.commandSlashPressed())}handleSelectedBlocksDeletion(e){const{BlockSelection:t,BlockManager:o,Caret:i,BlockSettings:a}=this.Blok;if(a.contains(e.target))return!1;const c=e.key==="Backspace"||e.key==="Delete",d=X.isSelectionExists,h=X.isCollapsed===!0;if(!(c&&t.anyBlockSelected&&(!d||h)))return!1;const v=o.removeSelectedBlocks();if(v!==void 0){const y=o.insertDefaultBlockAtIndex(v,!0);i.setToBlock(y,i.positions.START)}return t.clearSelection(e),e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),!0}beforeKeydownProcessing(e){!this.needToolbarClosing(e)||!this.isPrintableKeyEvent(e)||(this.Blok.Toolbar.close(),e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)||this.Blok.BlockSelection.clearSelection(e)}keyup(e){e.shiftKey||this.Blok.UI.checkEmptiness()}handleCommandC(e){const{BlockSelection:t}=this.Blok;t.anyBlockSelected&&t.copySelectedBlocks(e)}handleCommandX(e){const{BlockSelection:t,BlockManager:o,Caret:i}=this.Blok;t.anyBlockSelected&&t.copySelectedBlocks(e).then(()=>{const a=o.removeSelectedBlocks();if(a!==void 0){const c=o.insertDefaultBlockAtIndex(a,!0);i.setToBlock(c,i.positions.START)}t.clearSelection(e)}).catch(()=>{})}tabPressed(e){const{InlineToolbar:t,Caret:o}=this.Blok;if(t.opened)return;(e.shiftKey?o.navigatePrevious(!0):o.navigateNext(!0))&&e.preventDefault()}commandSlashPressed(){this.Blok.BlockSelection.selectedBlocks.length>1||this.activateBlockSettings()}slashPressed(e){if(!this.Blok.UI.nodes.wrapper.contains(e.target))return;const o=this.Blok.BlockManager.currentBlock;o!=null&&o.isEmpty&&(e.preventDefault(),this.Blok.Caret.insertContentAtCaretPosition("/"),this.activateToolbox())}enter(e){const{BlockManager:t,UI:o}=this.Blok,i=t.currentBlock;if(i===void 0||i.tool.isLineBreaksEnabled||o.someToolbarOpened&&o.someFlipperButtonFocused||e.shiftKey&&!qu)return;const a=i.currentInput!==void 0&&Cs(i.currentInput)&&!i.hasMedia?(this.Blok.BlockManager.insertDefaultBlockAtIndex(this.Blok.BlockManager.currentBlockIndex),i):i.currentInput&&Es(i.currentInput)?this.Blok.BlockManager.insertDefaultBlockAtIndex(this.Blok.BlockManager.currentBlockIndex+1):this.Blok.BlockManager.split();this.Blok.Caret.setToBlock(a),this.Blok.Toolbar.moveAndOpen(a),e.preventDefault()}backspace(e){const{BlockManager:t,Caret:o}=this.Blok,{currentBlock:i,previousBlock:a}=t;if(i===void 0||!X.isCollapsed||!i.currentInput||!Cs(i.currentInput))return;if(e.preventDefault(),this.Blok.Toolbar.close(),!(i.currentInput===i.firstInput)){o.navigatePrevious();return}if(a===null)return;if(a.isEmpty){t.removeBlock(a);return}if(i.isEmpty){t.removeBlock(i);const h=t.currentBlock;h&&o.setToBlock(h,o.positions.END);return}jv(a,i)?this.mergeBlocks(a,i):o.setToBlock(a,o.positions.END)}delete(e){const{BlockManager:t,Caret:o}=this.Blok,{currentBlock:i,nextBlock:a}=t;if(i===void 0||!X.isCollapsed||!i.currentInput||!Es(i.currentInput))return;if(e.preventDefault(),this.Blok.Toolbar.close(),!(i.currentInput===i.lastInput)){o.navigateNext();return}if(a===null)return;if(a.isEmpty){t.removeBlock(a);return}if(i.isEmpty){t.removeBlock(i),o.setToBlock(a,o.positions.START);return}jv(i,a)?this.mergeBlocks(i,a):o.setToBlock(a,o.positions.START)}mergeBlocks(e,t){const{BlockManager:o,Toolbar:i}=this.Blok;e.lastInput!==void 0&&(nC(e.lastInput,!1),o.mergeBlocks(e,t).then(()=>{i.close()}).catch(()=>{}))}arrowRightAndDown(e){var O;const t=this.getKeyCode(e);if(t===null)return;const o=Qn.usedKeys.includes(t)&&(!e.shiftKey||t===se.TAB);if(this.Blok.UI.someToolbarOpened&&o)return;e.shiftKey||this.Blok.Toolbar.close();const i=X.get();i!=null&&i.anchorNode&&!this.Blok.BlockSelection.anyBlockSelected&&this.Blok.BlockManager.setCurrentBlockByChildNode(i.anchorNode);const{currentBlock:a}=this.Blok.BlockManager,c=e.target,d=document.activeElement instanceof HTMLElement?document.activeElement:null,h=[a==null?void 0:a.inputs.find(L=>c!==null&&L.contains(c)),a==null?void 0:a.inputs.find(L=>d!==null&&L.contains(d)),c==null?void 0:c.closest(Bs),d==null?void 0:d.closest(Bs)],g=(O=a==null?void 0:a.currentInput)!=null?O:h.find(L=>L instanceof HTMLElement),y=(g!==void 0?Es(g):void 0)||this.Blok.BlockSelection.anyBlockSelected,b=e.shiftKey&&t===se.DOWN;if(b&&y){this.Blok.CrossBlockSelection.toggleBlockSelectedState();return}b&&this.Blok.InlineToolbar.tryToShow();const w=t===se.RIGHT&&!e.shiftKey&&!this.isRtl&&g instanceof HTMLElement?tC(g):null;if(w!==null){X.setCursor(w.node,w.offset),e.preventDefault();return}if(t===se.DOWN||t===se.RIGHT&&!this.isRtl?this.Blok.Caret.navigateNext():this.Blok.Caret.navigatePrevious()){e.preventDefault();return}us(()=>{this.Blok.BlockManager.currentBlock&&this.Blok.BlockManager.currentBlock.updateCurrentInput()},20)(),this.Blok.BlockSelection.clearSelection(e)}arrowLeftAndUp(e){var T;const t=this.Blok.UI.someToolbarOpened,o=this.getKeyCode(e);if(o===null||t&&Qn.usedKeys.includes(o)&&(!e.shiftKey||o===se.TAB))return;t&&this.Blok.UI.closeAllToolbars(),e.shiftKey||this.Blok.Toolbar.close();const i=window.getSelection();i!=null&&i.anchorNode&&!this.Blok.BlockSelection.anyBlockSelected&&this.Blok.BlockManager.setCurrentBlockByChildNode(i.anchorNode);const{currentBlock:a}=this.Blok.BlockManager,c=e.target,d=document.activeElement instanceof HTMLElement?document.activeElement:null,h=[a==null?void 0:a.inputs.find(C=>c!==null&&C.contains(c)),a==null?void 0:a.inputs.find(C=>d!==null&&C.contains(d)),c==null?void 0:c.closest(Bs),d==null?void 0:d.closest(Bs)],g=(T=a==null?void 0:a.currentInput)!=null?T:h.find(C=>C instanceof HTMLElement),y=(g!==void 0?Cs(g):void 0)||this.Blok.BlockSelection.anyBlockSelected,b=e.shiftKey&&o===se.UP;if(b&&y){this.Blok.CrossBlockSelection.toggleBlockSelectedState(!1);return}if(b&&this.Blok.InlineToolbar.tryToShow(),o===se.UP||o===se.LEFT&&!this.isRtl?this.Blok.Caret.navigatePrevious():this.Blok.Caret.navigateNext()){e.preventDefault();return}us(()=>{this.Blok.BlockManager.currentBlock&&this.Blok.BlockManager.currentBlock.updateCurrentInput()},20)(),this.Blok.BlockSelection.clearSelection(e)}needToolbarClosing(e){const t=this.getKeyCode(e),o=t===se.ENTER,i=t===se.TAB,a=o&&this.Blok.Toolbar.toolbox.opened,c=o&&this.Blok.BlockSettings.opened,d=o&&this.Blok.InlineToolbar.opened,h=i;return!(e.shiftKey||h||a||c||d)}activateToolbox(){this.Blok.Toolbar.opened||this.Blok.Toolbar.moveAndOpen(),this.Blok.Toolbar.toolbox.open()}activateBlockSettings(){this.Blok.Toolbar.opened||this.Blok.Toolbar.moveAndOpen(),this.Blok.BlockSettings.opened||Promise.resolve(this.Blok.BlockSettings.open()).catch(()=>{})}getKeyCode(e){const t=e.key&&ky[e.key];if(t!==void 0&&typeof t=="number")return t;const o=e.code&&ky[e.code];return o!==void 0&&typeof o=="number"?o:null}isPrintableKeyEvent(e){return e.key?e.key.length===1||rC.has(e.key):!1}}class Bd{constructor(e){this.blocks=[],this.workingArea=e}get length(){return this.blocks.length}get array(){return this.blocks}get nodes(){return dv(this.workingArea.children)}static set(e,t,o){return isNaN(Number(t))?(Reflect.set(e,t,o),!0):(e.insert(+t,o),!0)}static get(e,t){return isNaN(Number(t))?Reflect.get(e,t):e.get(+t)}push(e){this.blocks.push(e),this.insertToDOM(e)}move(e,t,o=!1){const i=this.blocks.splice(t,1)[0];if(!o){const c=e-1,d=Math.max(0,c),h=this.blocks[d],g=e>0?"afterend":"beforebegin";this.insertToDOM(i,g,h)}this.blocks.splice(e,0,i);const a=this.composeBlockEvent("move",{fromIndex:t,toIndex:e});i.call(Dn.MOVED,a)}insert(e,t,o=!1){if(!this.length){this.push(t);return}const i=e>this.length?this.length:e;o&&(this.blocks[i].holder.remove(),this.blocks[i].call(Dn.REMOVED));const a=o?1:0;if(this.blocks.splice(i,a,t),i>0){const d=this.blocks[i-1];this.insertToDOM(t,"afterend",d);return}const c=this.blocks[i+1];if(c!==void 0){this.insertToDOM(t,"beforebegin",c);return}this.insertToDOM(t)}replace(e,t){if(this.blocks[e]===void 0)throw Error("Incorrect index");this.blocks[e].holder.replaceWith(t.holder),this.blocks[e]=t}insertMany(e,t){const o=new DocumentFragment;for(const i of e)o.appendChild(i.holder);if(!this.length){this.blocks.push(...e),this.workingArea.appendChild(o),e.forEach(i=>i.call(Dn.RENDERED));return}if(t>0){const i=Math.min(t-1,this.length-1);this.blocks[i].holder.after(o)}t===0&&this.workingArea.prepend(o),this.blocks.splice(t,0,...e),e.forEach(i=>i.call(Dn.RENDERED))}remove(e){const t=isNaN(e)?this.length-1:e;this.blocks[t].holder.remove(),this.blocks[t].call(Dn.REMOVED),this.blocks.splice(t,1)}removeAll(){this.workingArea.innerHTML="",this.blocks.forEach(e=>e.call(Dn.REMOVED)),this.blocks.length=0}insertAfter(e,t){const o=this.blocks.indexOf(e);this.insert(o+1,t)}get(e){return this.blocks[e]}indexOf(e){return this.blocks.indexOf(e)}insertToDOM(e,t,o){t&&o!==void 0?o.holder.insertAdjacentElement(t,e.holder):this.workingArea.appendChild(e.holder),e.call(Dn.RENDERED)}composeBlockEvent(e,t){return new CustomEvent(e,{detail:t})}}function wy(l,e){var t=Object.keys(l);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(l);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(l,i).enumerable})),t.push.apply(t,o)}return t}function Cn(l){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?wy(Object(t),!0).forEach(function(o){iC(l,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(t)):wy(Object(t)).forEach(function(o){Object.defineProperty(l,o,Object.getOwnPropertyDescriptor(t,o))})}return l}function As(l){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?As=function(e){return typeof e}:As=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},As(l)}function iC(l,e,t){return e in l?Object.defineProperty(l,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):l[e]=t,l}function Fn(){return Fn=Object.assign||function(l){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(l[o]=t[o])}return l},Fn.apply(this,arguments)}function sC(l,e){if(l==null)return{};var t={},o=Object.keys(l),i,a;for(a=0;a<o.length;a++)i=o[a],!(e.indexOf(i)>=0)&&(t[i]=l[i]);return t}function lC(l,e){if(l==null)return{};var t=sC(l,e),o,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(l);for(i=0;i<a.length;i++)o=a[i],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(l,o)&&(t[o]=l[o])}return t}var aC="1.15.6";function zn(l){if(typeof window!="undefined"&&window.navigator)return!!navigator.userAgent.match(l)}var Hn=zn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ti=zn(/Edge/i),Ty=zn(/firefox/i),ni=zn(/safari/i)&&!zn(/chrome/i)&&!zn(/android/i),Ad=zn(/iP(ad|od|hone)/i),Sy=zn(/chrome/i)&&zn(/android/i),xy={capture:!1,passive:!1};function Ie(l,e,t){l.addEventListener(e,t,!Hn&&xy)}function Ee(l,e,t){l.removeEventListener(e,t,!Hn&&xy)}function Is(l,e){if(e){if(e[0]===">"&&(e=e.substring(1)),l)try{if(l.matches)return l.matches(e);if(l.msMatchesSelector)return l.msMatchesSelector(e);if(l.webkitMatchesSelector)return l.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function Cy(l){return l.host&&l!==document&&l.host.nodeType?l.host:l.parentNode}function fn(l,e,t,o){if(l){t=t||document;do{if(e!=null&&(e[0]===">"?l.parentNode===t&&Is(l,e):Is(l,e))||o&&l===t)return l;if(l===t)break}while(l=Cy(l))}return null}var Ey=/\s+/g;function Wt(l,e,t){if(l&&e)if(l.classList)l.classList[t?"add":"remove"](e);else{var o=(" "+l.className+" ").replace(Ey," ").replace(" "+e+" "," ");l.className=(o+(t?" "+e:"")).replace(Ey," ")}}function he(l,e,t){var o=l&&l.style;if(o){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(l,""):l.currentStyle&&(t=l.currentStyle),e===void 0?t:t[e];!(e in o)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),o[e]=t+(typeof t=="string"?"":"px")}}function so(l,e){var t="";if(typeof l=="string")t=l;else do{var o=he(l,"transform");o&&o!=="none"&&(t=o+" "+t)}while(!e&&(l=l.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(t)}function By(l,e,t){if(l){var o=l.getElementsByTagName(e),i=0,a=o.length;if(t)for(;i<a;i++)t(o[i],i);return o}return[]}function En(){var l=document.scrollingElement;return l||document.documentElement}function ct(l,e,t,o,i){if(!(!l.getBoundingClientRect&&l!==window)){var a,c,d,h,g,v,y;if(l!==window&&l.parentNode&&l!==En()?(a=l.getBoundingClientRect(),c=a.top,d=a.left,h=a.bottom,g=a.right,v=a.height,y=a.width):(c=0,d=0,h=window.innerHeight,g=window.innerWidth,v=window.innerHeight,y=window.innerWidth),(e||t)&&l!==window&&(i=i||l.parentNode,!Hn))do if(i&&i.getBoundingClientRect&&(he(i,"transform")!=="none"||t&&he(i,"position")!=="static")){var b=i.getBoundingClientRect();c-=b.top+parseInt(he(i,"border-top-width")),d-=b.left+parseInt(he(i,"border-left-width")),h=c+a.height,g=d+a.width;break}while(i=i.parentNode);if(o&&l!==window){var x=so(i||l),w=x&&x.a,T=x&&x.d;x&&(c/=T,d/=w,y/=w,v/=T,h=c+v,g=d+y)}return{top:c,left:d,bottom:h,right:g,width:y,height:v}}}function Ay(l,e,t){for(var o=Zn(l,!0),i=ct(l)[e];o;){var a=ct(o)[t],c=void 0;if(c=i>=a,!c)return o;if(o===En())break;o=Zn(o,!1)}return!1}function lo(l,e,t,o){for(var i=0,a=0,c=l.children;a<c.length;){if(c[a].style.display!=="none"&&c[a]!==pe.ghost&&(o||c[a]!==pe.dragged)&&fn(c[a],t.draggable,l,!1)){if(i===e)return c[a];i++}a++}return null}function Id(l,e){for(var t=l.lastElementChild;t&&(t===pe.ghost||he(t,"display")==="none"||e&&!Is(t,e));)t=t.previousElementSibling;return t||null}function nn(l,e){var t=0;if(!l||!l.parentNode)return-1;for(;l=l.previousElementSibling;)l.nodeName.toUpperCase()!=="TEMPLATE"&&l!==pe.clone&&(!e||Is(l,e))&&t++;return t}function Iy(l){var e=0,t=0,o=En();if(l)do{var i=so(l),a=i.a,c=i.d;e+=l.scrollLeft*a,t+=l.scrollTop*c}while(l!==o&&(l=l.parentNode));return[e,t]}function cC(l,e){for(var t in l)if(l.hasOwnProperty(t)){for(var o in e)if(e.hasOwnProperty(o)&&e[o]===l[t][o])return Number(t)}return-1}function Zn(l,e){if(!l||!l.getBoundingClientRect)return En();var t=l,o=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var i=he(t);if(t.clientWidth<t.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return En();if(o||e)return t;o=!0}}while(t=t.parentNode);return En()}function uC(l,e){if(l&&e)for(var t in e)e.hasOwnProperty(t)&&(l[t]=e[t]);return l}function _d(l,e){return Math.round(l.top)===Math.round(e.top)&&Math.round(l.left)===Math.round(e.left)&&Math.round(l.height)===Math.round(e.height)&&Math.round(l.width)===Math.round(e.width)}var ri;function _y(l,e){return function(){if(!ri){var t=arguments,o=this;t.length===1?l.call(o,t[0]):l.apply(o,t),ri=setTimeout(function(){ri=void 0},e)}}}function dC(){clearTimeout(ri),ri=void 0}function Ny(l,e,t){l.scrollLeft+=e,l.scrollTop+=t}function Ry(l){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(l).cloneNode(!0):t?t(l).clone(!0)[0]:l.cloneNode(!0)}function Oy(l,e,t){var o={};return Array.from(l.children).forEach(function(i){var a,c,d,h;if(!(!fn(i,e.draggable,l,!1)||i.animated||i===t)){var g=ct(i);o.left=Math.min((a=o.left)!==null&&a!==void 0?a:1/0,g.left),o.top=Math.min((c=o.top)!==null&&c!==void 0?c:1/0,g.top),o.right=Math.max((d=o.right)!==null&&d!==void 0?d:-1/0,g.right),o.bottom=Math.max((h=o.bottom)!==null&&h!==void 0?h:-1/0,g.bottom)}}),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var Mt="Sortable"+new Date().getTime();function fC(){var l=[],e;return{captureAnimationState:function(){if(l=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(i){if(!(he(i,"display")==="none"||i===pe.ghost)){l.push({target:i,rect:ct(i)});var a=Cn({},l[l.length-1].rect);if(i.thisAnimationDuration){var c=so(i,!0);c&&(a.top-=c.f,a.left-=c.e)}i.fromRect=a}})}},addAnimationState:function(o){l.push(o)},removeAnimationState:function(o){l.splice(cC(l,{target:o}),1)},animateAll:function(o){var i=this;if(!this.options.animation){clearTimeout(e),typeof o=="function"&&o();return}var a=!1,c=0;l.forEach(function(d){var h=0,g=d.target,v=g.fromRect,y=ct(g),b=g.prevFromRect,x=g.prevToRect,w=d.rect,T=so(g,!0);T&&(y.top-=T.f,y.left-=T.e),g.toRect=y,g.thisAnimationDuration&&_d(b,y)&&!_d(v,y)&&(w.top-y.top)/(w.left-y.left)===(v.top-y.top)/(v.left-y.left)&&(h=pC(w,b,x,i.options)),_d(y,v)||(g.prevFromRect=v,g.prevToRect=y,h||(h=i.options.animation),i.animate(g,w,y,h)),h&&(a=!0,c=Math.max(c,h),clearTimeout(g.animationResetTimer),g.animationResetTimer=setTimeout(function(){g.animationTime=0,g.prevFromRect=null,g.fromRect=null,g.prevToRect=null,g.thisAnimationDuration=null},h),g.thisAnimationDuration=h)}),clearTimeout(e),a?e=setTimeout(function(){typeof o=="function"&&o()},c):typeof o=="function"&&o(),l=[]},animate:function(o,i,a,c){if(c){he(o,"transition",""),he(o,"transform","");var d=so(this.el),h=d&&d.a,g=d&&d.d,v=(i.left-a.left)/(h||1),y=(i.top-a.top)/(g||1);o.animatingX=!!v,o.animatingY=!!y,he(o,"transform","translate3d("+v+"px,"+y+"px,0)"),this.forRepaintDummy=hC(o),he(o,"transition","transform "+c+"ms"+(this.options.easing?" "+this.options.easing:"")),he(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){he(o,"transition",""),he(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},c)}}}}function hC(l){return l.offsetWidth}function pC(l,e,t,o){return Math.sqrt(Math.pow(e.top-l.top,2)+Math.pow(e.left-l.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*o.animation}var ao=[],Nd={initializeByDefault:!0},oi={mount:function(e){for(var t in Nd)Nd.hasOwnProperty(t)&&!(t in e)&&(e[t]=Nd[t]);ao.forEach(function(o){if(o.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),ao.push(e)},pluginEvent:function(e,t,o){var i=this;this.eventCanceled=!1,o.cancel=function(){i.eventCanceled=!0};var a=e+"Global";ao.forEach(function(c){t[c.pluginName]&&(t[c.pluginName][a]&&t[c.pluginName][a](Cn({sortable:t},o)),t.options[c.pluginName]&&t[c.pluginName][e]&&t[c.pluginName][e](Cn({sortable:t},o)))})},initializePlugins:function(e,t,o,i){ao.forEach(function(d){var h=d.pluginName;if(!(!e.options[h]&&!d.initializeByDefault)){var g=new d(e,t,e.options);g.sortable=e,g.options=e.options,e[h]=g,Fn(o,g.defaults)}});for(var a in e.options)if(e.options.hasOwnProperty(a)){var c=this.modifyOption(e,a,e.options[a]);typeof c!="undefined"&&(e.options[a]=c)}},getEventProperties:function(e,t){var o={};return ao.forEach(function(i){typeof i.eventProperties=="function"&&Fn(o,i.eventProperties.call(t[i.pluginName],e))}),o},modifyOption:function(e,t,o){var i;return ao.forEach(function(a){e[a.pluginName]&&a.optionListeners&&typeof a.optionListeners[t]=="function"&&(i=a.optionListeners[t].call(e[a.pluginName],o))}),i}};function gC(l){var e=l.sortable,t=l.rootEl,o=l.name,i=l.targetEl,a=l.cloneEl,c=l.toEl,d=l.fromEl,h=l.oldIndex,g=l.newIndex,v=l.oldDraggableIndex,y=l.newDraggableIndex,b=l.originalEvent,x=l.putSortable,w=l.extraEventProperties;if(e=e||t&&t[Mt],!!e){var T,C=e.options,O="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!Hn&&!ti?T=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(T=document.createEvent("Event"),T.initEvent(o,!0,!0)),T.to=c||t,T.from=d||t,T.item=i||t,T.clone=a,T.oldIndex=h,T.newIndex=g,T.oldDraggableIndex=v,T.newDraggableIndex=y,T.originalEvent=b,T.pullMode=x?x.lastPutMode:void 0;var L=Cn(Cn({},w),oi.getEventProperties(o,e));for(var U in L)T[U]=L[U];t&&t.dispatchEvent(T),C[O]&&C[O].call(e,T)}}var mC=["evt"],Ft=function(e,t){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=o.evt,a=lC(o,mC);oi.pluginEvent.bind(pe)(e,t,Cn({dragEl:V,parentEl:tt,ghostEl:ve,rootEl:Xe,nextEl:_r,lastDownEl:_s,cloneEl:Qe,cloneHidden:Jn,dragStarted:si,putSortable:wt,activeSortable:pe.active,originalEvent:i,oldIndex:co,oldDraggableIndex:ii,newIndex:Kt,newDraggableIndex:er,hideGhostForTarget:Hy,unhideGhostForTarget:jy,cloneNowHidden:function(){Jn=!0},cloneNowShown:function(){Jn=!1},dispatchSortableEvent:function(d){Rt({sortable:t,name:d,originalEvent:i})}},a))};function Rt(l){gC(Cn({putSortable:wt,cloneEl:Qe,targetEl:V,rootEl:Xe,oldIndex:co,oldDraggableIndex:ii,newIndex:Kt,newDraggableIndex:er},l))}var V,tt,ve,Xe,_r,_s,Qe,Jn,co,Kt,ii,er,Ns,wt,uo=!1,Rs=!1,Os=[],Nr,hn,Rd,Od,Ly,Dy,si,fo,li,ai=!1,Ls=!1,Ds,xt,Ld=[],Dd=!1,Ps=[],Ms=typeof document!="undefined",Fs=Ad,Py=ti||Hn?"cssFloat":"float",vC=Ms&&!Sy&&!Ad&&"draggable"in document.createElement("div"),My=(function(){if(Ms){if(Hn)return!1;var l=document.createElement("x");return l.style.cssText="pointer-events:auto",l.style.pointerEvents==="auto"}})(),Fy=function(e,t){var o=he(e),i=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),a=lo(e,0,t),c=lo(e,1,t),d=a&&he(a),h=c&&he(c),g=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+ct(a).width,v=h&&parseInt(h.marginLeft)+parseInt(h.marginRight)+ct(c).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&d.float&&d.float!=="none"){var y=d.float==="left"?"left":"right";return c&&(h.clear==="both"||h.clear===y)?"vertical":"horizontal"}return a&&(d.display==="block"||d.display==="flex"||d.display==="table"||d.display==="grid"||g>=i&&o[Py]==="none"||c&&o[Py]==="none"&&g+v>i)?"vertical":"horizontal"},yC=function(e,t,o){var i=o?e.left:e.top,a=o?e.right:e.bottom,c=o?e.width:e.height,d=o?t.left:t.top,h=o?t.right:t.bottom,g=o?t.width:t.height;return i===d||a===h||i+c/2===d+g/2},bC=function(e,t){var o;return Os.some(function(i){var a=i[Mt].options.emptyInsertThreshold;if(!(!a||Id(i))){var c=ct(i),d=e>=c.left-a&&e<=c.right+a,h=t>=c.top-a&&t<=c.bottom+a;if(d&&h)return o=i}}),o},zy=function(e){function t(a,c){return function(d,h,g,v){var y=d.options.group.name&&h.options.group.name&&d.options.group.name===h.options.group.name;if(a==null&&(c||y))return!0;if(a==null||a===!1)return!1;if(c&&a==="clone")return a;if(typeof a=="function")return t(a(d,h,g,v),c)(d,h,g,v);var b=(c?d:h).options.group.name;return a===!0||typeof a=="string"&&a===b||a.join&&a.indexOf(b)>-1}}var o={},i=e.group;(!i||As(i)!="object")&&(i={name:i}),o.name=i.name,o.checkPull=t(i.pull,!0),o.checkPut=t(i.put),o.revertClone=i.revertClone,e.group=o},Hy=function(){!My&&ve&&he(ve,"display","none")},jy=function(){!My&&ve&&he(ve,"display","")};Ms&&!Sy&&document.addEventListener("click",function(l){if(Rs)return l.preventDefault(),l.stopPropagation&&l.stopPropagation(),l.stopImmediatePropagation&&l.stopImmediatePropagation(),Rs=!1,!1},!0);var Rr=function(e){if(V){e=e.touches?e.touches[0]:e;var t=bC(e.clientX,e.clientY);if(t){var o={};for(var i in e)e.hasOwnProperty(i)&&(o[i]=e[i]);o.target=o.rootEl=t,o.preventDefault=void 0,o.stopPropagation=void 0,t[Mt]._onDragOver(o)}}},kC=function(e){V&&V.parentNode[Mt]._isOutsideThisEl(e.target)};function pe(l,e){if(!(l&&l.nodeType&&l.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(l));this.el=l,this.options=e=Fn({},e),l[Mt]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(l.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Fy(l,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(c,d){c.setData("Text",d.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:pe.supportPointer!==!1&&"PointerEvent"in window&&(!ni||Ad),emptyInsertThreshold:5};oi.initializePlugins(this,l,t);for(var o in t)!(o in e)&&(e[o]=t[o]);zy(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:vC,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Ie(l,"pointerdown",this._onTapStart):(Ie(l,"mousedown",this._onTapStart),Ie(l,"touchstart",this._onTapStart)),this.nativeDraggable&&(Ie(l,"dragover",this),Ie(l,"dragenter",this)),Os.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Fn(this,fC())}pe.prototype={constructor:pe,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(fo=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,V):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,o=this.el,i=this.options,a=i.preventOnFilter,c=e.type,d=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,h=(d||e).target,g=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||h,v=i.filter;if(AC(o),!V&&!(/mousedown|pointerdown/.test(c)&&e.button!==0||i.disabled)&&!g.isContentEditable&&!(!this.nativeDraggable&&ni&&h&&h.tagName.toUpperCase()==="SELECT")&&(h=fn(h,i.draggable,o,!1),!(h&&h.animated)&&_s!==h)){if(co=nn(h),ii=nn(h,i.draggable),typeof v=="function"){if(v.call(this,e,h,this)){Rt({sortable:t,rootEl:g,name:"filter",targetEl:h,toEl:o,fromEl:o}),Ft("filter",t,{evt:e}),a&&e.preventDefault();return}}else if(v&&(v=v.split(",").some(function(y){if(y=fn(g,y.trim(),o,!1),y)return Rt({sortable:t,rootEl:y,name:"filter",targetEl:h,fromEl:o,toEl:o}),Ft("filter",t,{evt:e}),!0}),v)){a&&e.preventDefault();return}i.handle&&!fn(g,i.handle,o,!1)||this._prepareDragStart(e,d,h)}}},_prepareDragStart:function(e,t,o){var i=this,a=i.el,c=i.options,d=a.ownerDocument,h;if(o&&!V&&o.parentNode===a){var g=ct(o);if(Xe=a,V=o,tt=V.parentNode,_r=V.nextSibling,_s=o,Ns=c.group,pe.dragged=V,Nr={target:V,clientX:(t||e).clientX,clientY:(t||e).clientY},Ly=Nr.clientX-g.left,Dy=Nr.clientY-g.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,V.style["will-change"]="all",h=function(){if(Ft("delayEnded",i,{evt:e}),pe.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!Ty&&i.nativeDraggable&&(V.draggable=!0),i._triggerDragStart(e,t),Rt({sortable:i,name:"choose",originalEvent:e}),Wt(V,c.chosenClass,!0)},c.ignore.split(",").forEach(function(v){By(V,v.trim(),Pd)}),Ie(d,"dragover",Rr),Ie(d,"mousemove",Rr),Ie(d,"touchmove",Rr),c.supportPointer?(Ie(d,"pointerup",i._onDrop),!this.nativeDraggable&&Ie(d,"pointercancel",i._onDrop)):(Ie(d,"mouseup",i._onDrop),Ie(d,"touchend",i._onDrop),Ie(d,"touchcancel",i._onDrop)),Ty&&this.nativeDraggable&&(this.options.touchStartThreshold=4,V.draggable=!0),Ft("delayStart",this,{evt:e}),c.delay&&(!c.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(ti||Hn))){if(pe.eventCanceled){this._onDrop();return}c.supportPointer?(Ie(d,"pointerup",i._disableDelayedDrag),Ie(d,"pointercancel",i._disableDelayedDrag)):(Ie(d,"mouseup",i._disableDelayedDrag),Ie(d,"touchend",i._disableDelayedDrag),Ie(d,"touchcancel",i._disableDelayedDrag)),Ie(d,"mousemove",i._delayedDragTouchMoveHandler),Ie(d,"touchmove",i._delayedDragTouchMoveHandler),c.supportPointer&&Ie(d,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(h,c.delay)}else h()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){V&&Pd(V),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Ee(e,"mouseup",this._disableDelayedDrag),Ee(e,"touchend",this._disableDelayedDrag),Ee(e,"touchcancel",this._disableDelayedDrag),Ee(e,"pointerup",this._disableDelayedDrag),Ee(e,"pointercancel",this._disableDelayedDrag),Ee(e,"mousemove",this._delayedDragTouchMoveHandler),Ee(e,"touchmove",this._delayedDragTouchMoveHandler),Ee(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?Ie(document,"pointermove",this._onTouchMove):t?Ie(document,"touchmove",this._onTouchMove):Ie(document,"mousemove",this._onTouchMove):(Ie(V,"dragend",this),Ie(Xe,"dragstart",this._onDragStart));try{document.selection?Hs(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(o){}},_dragStarted:function(e,t){if(uo=!1,Xe&&V){Ft("dragStarted",this,{evt:t}),this.nativeDraggable&&Ie(document,"dragover",kC);var o=this.options;!e&&Wt(V,o.dragClass,!1),Wt(V,o.ghostClass,!0),pe.active=this,e&&this._appendGhost(),Rt({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(hn){this._lastX=hn.clientX,this._lastY=hn.clientY,Hy();for(var e=document.elementFromPoint(hn.clientX,hn.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(hn.clientX,hn.clientY),e!==t);)t=e;if(V.parentNode[Mt]._isOutsideThisEl(e),t)do{if(t[Mt]){var o=void 0;if(o=t[Mt]._onDragOver({clientX:hn.clientX,clientY:hn.clientY,target:e,rootEl:t}),o&&!this.options.dragoverBubble)break}e=t}while(t=Cy(t));jy()}},_onTouchMove:function(e){if(Nr){var t=this.options,o=t.fallbackTolerance,i=t.fallbackOffset,a=e.touches?e.touches[0]:e,c=ve&&so(ve,!0),d=ve&&c&&c.a,h=ve&&c&&c.d,g=Fs&&xt&&Iy(xt),v=(a.clientX-Nr.clientX+i.x)/(d||1)+(g?g[0]-Ld[0]:0)/(d||1),y=(a.clientY-Nr.clientY+i.y)/(h||1)+(g?g[1]-Ld[1]:0)/(h||1);if(!pe.active&&!uo){if(o&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))<o)return;this._onDragStart(e,!0)}if(ve){c?(c.e+=v-(Rd||0),c.f+=y-(Od||0)):c={a:1,b:0,c:0,d:1,e:v,f:y};var b="matrix(".concat(c.a,",").concat(c.b,",").concat(c.c,",").concat(c.d,",").concat(c.e,",").concat(c.f,")");he(ve,"webkitTransform",b),he(ve,"mozTransform",b),he(ve,"msTransform",b),he(ve,"transform",b),Rd=v,Od=y,hn=a}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!ve){var e=this.options.fallbackOnBody?document.body:Xe,t=ct(V,!0,Fs,!0,e),o=this.options;if(Fs){for(xt=e;he(xt,"position")==="static"&&he(xt,"transform")==="none"&&xt!==document;)xt=xt.parentNode;xt!==document.body&&xt!==document.documentElement?(xt===document&&(xt=En()),t.top+=xt.scrollTop,t.left+=xt.scrollLeft):xt=En(),Ld=Iy(xt)}ve=V.cloneNode(!0),Wt(ve,o.ghostClass,!1),Wt(ve,o.fallbackClass,!0),Wt(ve,o.dragClass,!0),he(ve,"transition",""),he(ve,"transform",""),he(ve,"box-sizing","border-box"),he(ve,"margin",0),he(ve,"top",t.top),he(ve,"left",t.left),he(ve,"width",t.width),he(ve,"height",t.height),he(ve,"opacity","0.8"),he(ve,"position",Fs?"absolute":"fixed"),he(ve,"zIndex","100000"),he(ve,"pointerEvents","none"),pe.ghost=ve,e.appendChild(ve),he(ve,"transform-origin",Ly/parseInt(ve.style.width)*100+"% "+Dy/parseInt(ve.style.height)*100+"%")}},_onDragStart:function(e,t){var o=this,i=e.dataTransfer,a=o.options;if(Ft("dragStart",this,{evt:e}),pe.eventCanceled){this._onDrop();return}Ft("setupClone",this),pe.eventCanceled||(Qe=Ry(V),Qe.removeAttribute("id"),Qe.draggable=!1,Qe.style["will-change"]="",this._hideClone(),Wt(Qe,this.options.chosenClass,!1),pe.clone=Qe),o.cloneId=Hs(function(){Ft("clone",o),!pe.eventCanceled&&(o.options.removeCloneOnHide||Xe.insertBefore(Qe,V),o._hideClone(),Rt({sortable:o,name:"clone"}))}),!t&&Wt(V,a.dragClass,!0),t?(Rs=!0,o._loopId=setInterval(o._emulateDragOver,50)):(Ee(document,"mouseup",o._onDrop),Ee(document,"touchend",o._onDrop),Ee(document,"touchcancel",o._onDrop),i&&(i.effectAllowed="move",a.setData&&a.setData.call(o,i,V)),Ie(document,"drop",o),he(V,"transform","translateZ(0)")),uo=!0,o._dragStartId=Hs(o._dragStarted.bind(o,t,e)),Ie(document,"selectstart",o),si=!0,window.getSelection().removeAllRanges(),ni&&he(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,o=e.target,i,a,c,d=this.options,h=d.group,g=pe.active,v=Ns===h,y=d.sort,b=wt||g,x,w=this,T=!1;if(Dd)return;function C(D,ae){Ft(D,w,Cn({evt:e,isOwner:v,axis:x?"vertical":"horizontal",revert:c,dragRect:i,targetRect:a,canSort:y,fromSortable:b,target:o,completed:L,onMove:function(A,P){return zs(Xe,t,V,i,A,ct(A),e,P)},changed:U},ae))}function O(){C("dragOverAnimationCapture"),w.captureAnimationState(),w!==b&&b.captureAnimationState()}function L(D){return C("dragOverCompleted",{insertion:D}),D&&(v?g._hideClone():g._showClone(w),w!==b&&(Wt(V,wt?wt.options.ghostClass:g.options.ghostClass,!1),Wt(V,d.ghostClass,!0)),wt!==w&&w!==pe.active?wt=w:w===pe.active&&wt&&(wt=null),b===w&&(w._ignoreWhileAnimating=o),w.animateAll(function(){C("dragOverAnimationComplete"),w._ignoreWhileAnimating=null}),w!==b&&(b.animateAll(),b._ignoreWhileAnimating=null)),(o===V&&!V.animated||o===t&&!o.animated)&&(fo=null),!d.dragoverBubble&&!e.rootEl&&o!==document&&(V.parentNode[Mt]._isOutsideThisEl(e.target),!D&&Rr(e)),!d.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),T=!0}function U(){Kt=nn(V),er=nn(V,d.draggable),Rt({sortable:w,name:"change",toEl:t,newIndex:Kt,newDraggableIndex:er,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),o=fn(o,d.draggable,t,!0),C("dragOver"),pe.eventCanceled)return T;if(V.contains(e.target)||o.animated&&o.animatingX&&o.animatingY||w._ignoreWhileAnimating===o)return L(!1);if(Rs=!1,g&&!d.disabled&&(v?y||(c=tt!==Xe):wt===this||(this.lastPutMode=Ns.checkPull(this,g,V,e))&&h.checkPut(this,g,V,e))){if(x=this._getDirection(e,o)==="vertical",i=ct(V),C("dragOverValid"),pe.eventCanceled)return T;if(c)return tt=Xe,O(),this._hideClone(),C("revert"),pe.eventCanceled||(_r?Xe.insertBefore(V,_r):Xe.appendChild(V)),L(!0);var H=Id(t,d.draggable);if(!H||xC(e,x,this)&&!H.animated){if(H===V)return L(!1);if(H&&t===e.target&&(o=H),o&&(a=ct(o)),zs(Xe,t,V,i,o,a,e,!!o)!==!1)return O(),H&&H.nextSibling?t.insertBefore(V,H.nextSibling):t.appendChild(V),tt=t,U(),L(!0)}else if(H&&SC(e,x,this)){var Y=lo(t,0,d,!0);if(Y===V)return L(!1);if(o=Y,a=ct(o),zs(Xe,t,V,i,o,a,e,!1)!==!1)return O(),t.insertBefore(V,Y),tt=t,U(),L(!0)}else if(o.parentNode===t){a=ct(o);var q=0,W,F=V.parentNode!==t,re=!yC(V.animated&&V.toRect||i,o.animated&&o.toRect||a,x),ce=x?"top":"left",Z=Ay(o,"top","top")||Ay(V,"top","top"),ye=Z?Z.scrollTop:void 0;fo!==o&&(W=a[ce],ai=!1,Ls=!re&&d.invertSwap||F),q=CC(e,o,a,x,re?1:d.swapThreshold,d.invertedSwapThreshold==null?d.swapThreshold:d.invertedSwapThreshold,Ls,fo===o);var J;if(q!==0){var we=nn(V);do we-=q,J=tt.children[we];while(J&&(he(J,"display")==="none"||J===ve))}if(q===0||J===o)return L(!1);fo=o,li=q;var Re=o.nextElementSibling,xe=!1;xe=q===1;var _e=zs(Xe,t,V,i,o,a,e,xe);if(_e!==!1)return(_e===1||_e===-1)&&(xe=_e===1),Dd=!0,setTimeout(TC,30),O(),xe&&!Re?t.appendChild(V):o.parentNode.insertBefore(V,xe?Re:o),Z&&Ny(Z,0,ye-Z.scrollTop),tt=V.parentNode,W!==void 0&&!Ls&&(Ds=Math.abs(W-ct(o)[ce])),U(),L(!0)}if(t.contains(V))return L(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Ee(document,"mousemove",this._onTouchMove),Ee(document,"touchmove",this._onTouchMove),Ee(document,"pointermove",this._onTouchMove),Ee(document,"dragover",Rr),Ee(document,"mousemove",Rr),Ee(document,"touchmove",Rr)},_offUpEvents:function(){var e=this.el.ownerDocument;Ee(e,"mouseup",this._onDrop),Ee(e,"touchend",this._onDrop),Ee(e,"pointerup",this._onDrop),Ee(e,"pointercancel",this._onDrop),Ee(e,"touchcancel",this._onDrop),Ee(document,"selectstart",this)},_onDrop:function(e){var t=this.el,o=this.options;if(Kt=nn(V),er=nn(V,o.draggable),Ft("drop",this,{evt:e}),tt=V&&V.parentNode,Kt=nn(V),er=nn(V,o.draggable),pe.eventCanceled){this._nulling();return}uo=!1,Ls=!1,ai=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Md(this.cloneId),Md(this._dragStartId),this.nativeDraggable&&(Ee(document,"drop",this),Ee(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),ni&&he(document.body,"user-select",""),he(V,"transform",""),e&&(si&&(e.cancelable&&e.preventDefault(),!o.dropBubble&&e.stopPropagation()),ve&&ve.parentNode&&ve.parentNode.removeChild(ve),(Xe===tt||wt&&wt.lastPutMode!=="clone")&&Qe&&Qe.parentNode&&Qe.parentNode.removeChild(Qe),V&&(this.nativeDraggable&&Ee(V,"dragend",this),Pd(V),V.style["will-change"]="",si&&!uo&&Wt(V,wt?wt.options.ghostClass:this.options.ghostClass,!1),Wt(V,this.options.chosenClass,!1),Rt({sortable:this,name:"unchoose",toEl:tt,newIndex:null,newDraggableIndex:null,originalEvent:e}),Xe!==tt?(Kt>=0&&(Rt({rootEl:tt,name:"add",toEl:tt,fromEl:Xe,originalEvent:e}),Rt({sortable:this,name:"remove",toEl:tt,originalEvent:e}),Rt({rootEl:tt,name:"sort",toEl:tt,fromEl:Xe,originalEvent:e}),Rt({sortable:this,name:"sort",toEl:tt,originalEvent:e})),wt&&wt.save()):Kt!==co&&Kt>=0&&(Rt({sortable:this,name:"update",toEl:tt,originalEvent:e}),Rt({sortable:this,name:"sort",toEl:tt,originalEvent:e})),pe.active&&((Kt==null||Kt===-1)&&(Kt=co,er=ii),Rt({sortable:this,name:"end",toEl:tt,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Ft("nulling",this),Xe=V=tt=ve=_r=Qe=_s=Jn=Nr=hn=si=Kt=er=co=ii=fo=li=wt=Ns=pe.dragged=pe.ghost=pe.clone=pe.active=null,Ps.forEach(function(e){e.checked=!0}),Ps.length=Rd=Od=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":V&&(this._onDragOver(e),wC(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,o=this.el.children,i=0,a=o.length,c=this.options;i<a;i++)t=o[i],fn(t,c.draggable,this.el,!1)&&e.push(t.getAttribute(c.dataIdAttr)||BC(t));return e},sort:function(e,t){var o={},i=this.el;this.toArray().forEach(function(a,c){var d=i.children[c];fn(d,this.options.draggable,i,!1)&&(o[a]=d)},this),t&&this.captureAnimationState(),e.forEach(function(a){o[a]&&(i.removeChild(o[a]),i.appendChild(o[a]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return fn(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var o=this.options;if(t===void 0)return o[e];var i=oi.modifyOption(this,e,t);typeof i!="undefined"?o[e]=i:o[e]=t,e==="group"&&zy(o)},destroy:function(){Ft("destroy",this);var e=this.el;e[Mt]=null,Ee(e,"mousedown",this._onTapStart),Ee(e,"touchstart",this._onTapStart),Ee(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(Ee(e,"dragover",this),Ee(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Os.splice(Os.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Jn){if(Ft("hideClone",this),pe.eventCanceled)return;he(Qe,"display","none"),this.options.removeCloneOnHide&&Qe.parentNode&&Qe.parentNode.removeChild(Qe),Jn=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(Jn){if(Ft("showClone",this),pe.eventCanceled)return;V.parentNode==Xe&&!this.options.group.revertClone?Xe.insertBefore(Qe,V):_r?Xe.insertBefore(Qe,_r):Xe.appendChild(Qe),this.options.group.revertClone&&this.animate(V,Qe),he(Qe,"display",""),Jn=!1}}};function wC(l){l.dataTransfer&&(l.dataTransfer.dropEffect="move"),l.cancelable&&l.preventDefault()}function zs(l,e,t,o,i,a,c,d){var h,g=l[Mt],v=g.options.onMove,y;return window.CustomEvent&&!Hn&&!ti?h=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(h=document.createEvent("Event"),h.initEvent("move",!0,!0)),h.to=e,h.from=l,h.dragged=t,h.draggedRect=o,h.related=i||e,h.relatedRect=a||ct(e),h.willInsertAfter=d,h.originalEvent=c,l.dispatchEvent(h),v&&(y=v.call(g,h,c)),y}function Pd(l){l.draggable=!1}function TC(){Dd=!1}function SC(l,e,t){var o=ct(lo(t.el,0,t.options,!0)),i=Oy(t.el,t.options,ve),a=10;return e?l.clientX<i.left-a||l.clientY<o.top&&l.clientX<o.right:l.clientY<i.top-a||l.clientY<o.bottom&&l.clientX<o.left}function xC(l,e,t){var o=ct(Id(t.el,t.options.draggable)),i=Oy(t.el,t.options,ve),a=10;return e?l.clientX>i.right+a||l.clientY>o.bottom&&l.clientX>o.left:l.clientY>i.bottom+a||l.clientX>o.right&&l.clientY>o.top}function CC(l,e,t,o,i,a,c,d){var h=o?l.clientY:l.clientX,g=o?t.height:t.width,v=o?t.top:t.left,y=o?t.bottom:t.right,b=!1;if(!c){if(d&&Ds<g*i){if(!ai&&(li===1?h>v+g*a/2:h<y-g*a/2)&&(ai=!0),ai)b=!0;else if(li===1?h<v+Ds:h>y-Ds)return-li}else if(h>v+g*(1-i)/2&&h<y-g*(1-i)/2)return EC(e)}return b=b||c,b&&(h<v+g*a/2||h>y-g*a/2)?h>v+g/2?1:-1:0}function EC(l){return nn(V)<nn(l)?1:-1}function BC(l){for(var e=l.tagName+l.className+l.src+l.href+l.textContent,t=e.length,o=0;t--;)o+=e.charCodeAt(t);return o.toString(36)}function AC(l){Ps.length=0;for(var e=l.getElementsByTagName("input"),t=e.length;t--;){var o=e[t];o.checked&&Ps.push(o)}}function Hs(l){return setTimeout(l,0)}function Md(l){return clearTimeout(l)}Ms&&Ie(document,"touchmove",function(l){(pe.active||uo)&&l.cancelable&&l.preventDefault()}),pe.utils={on:Ie,off:Ee,css:he,find:By,is:function(e,t){return!!fn(e,t,e,!1)},extend:uC,throttle:_y,closest:fn,toggleClass:Wt,clone:Ry,index:nn,nextTick:Hs,cancelNextTick:Md,detectDirection:Fy,getChild:lo,expando:Mt},pe.get=function(l){return l[Mt]},pe.mount=function(){for(var l=arguments.length,e=new Array(l),t=0;t<l;t++)e[t]=arguments[t];e[0].constructor===Array&&(e=e[0]),e.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(pe.utils=Cn(Cn({},pe.utils),o.utils)),oi.mount(o)})},pe.create=function(l,e){return new pe(l,e)},pe.version=aC;var ut=[],ci,Fd,zd=!1,Hd,jd,js,ui;function IC(){function l(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return l.prototype={dragStarted:function(t){var o=t.originalEvent;this.sortable.nativeDraggable?Ie(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Ie(document,"pointermove",this._handleFallbackAutoScroll):o.touches?Ie(document,"touchmove",this._handleFallbackAutoScroll):Ie(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var o=t.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?Ee(document,"dragover",this._handleAutoScroll):(Ee(document,"pointermove",this._handleFallbackAutoScroll),Ee(document,"touchmove",this._handleFallbackAutoScroll),Ee(document,"mousemove",this._handleFallbackAutoScroll)),qy(),qs(),dC()},nulling:function(){js=Fd=ci=zd=ui=Hd=jd=null,ut.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,o){var i=this,a=(t.touches?t.touches[0]:t).clientX,c=(t.touches?t.touches[0]:t).clientY,d=document.elementFromPoint(a,c);if(js=t,o||this.options.forceAutoScrollFallback||ti||Hn||ni){qd(t,this.options,d,o);var h=Zn(d,!0);zd&&(!ui||a!==Hd||c!==jd)&&(ui&&qy(),ui=setInterval(function(){var g=Zn(document.elementFromPoint(a,c),!0);g!==h&&(h=g,qs()),qd(t,i.options,g,o)},10),Hd=a,jd=c)}else{if(!this.options.bubbleScroll||Zn(d,!0)===En()){qs();return}qd(t,this.options,Zn(d,!1),!1)}}},Fn(l,{pluginName:"scroll",initializeByDefault:!0})}function qs(){ut.forEach(function(l){clearInterval(l.pid)}),ut=[]}function qy(){clearInterval(ui)}var qd=_y(function(l,e,t,o){if(e.scroll){var i=(l.touches?l.touches[0]:l).clientX,a=(l.touches?l.touches[0]:l).clientY,c=e.scrollSensitivity,d=e.scrollSpeed,h=En(),g=!1,v;Fd!==t&&(Fd=t,qs(),ci=e.scroll,v=e.scrollFn,ci===!0&&(ci=Zn(t,!0)));var y=0,b=ci;do{var x=b,w=ct(x),T=w.top,C=w.bottom,O=w.left,L=w.right,U=w.width,H=w.height,Y=void 0,q=void 0,W=x.scrollWidth,F=x.scrollHeight,re=he(x),ce=x.scrollLeft,Z=x.scrollTop;x===h?(Y=U<W&&(re.overflowX==="auto"||re.overflowX==="scroll"||re.overflowX==="visible"),q=H<F&&(re.overflowY==="auto"||re.overflowY==="scroll"||re.overflowY==="visible")):(Y=U<W&&(re.overflowX==="auto"||re.overflowX==="scroll"),q=H<F&&(re.overflowY==="auto"||re.overflowY==="scroll"));var ye=Y&&(Math.abs(L-i)<=c&&ce+U<W)-(Math.abs(O-i)<=c&&!!ce),J=q&&(Math.abs(C-a)<=c&&Z+H<F)-(Math.abs(T-a)<=c&&!!Z);if(!ut[y])for(var we=0;we<=y;we++)ut[we]||(ut[we]={});(ut[y].vx!=ye||ut[y].vy!=J||ut[y].el!==x)&&(ut[y].el=x,ut[y].vx=ye,ut[y].vy=J,clearInterval(ut[y].pid),(ye!=0||J!=0)&&(g=!0,ut[y].pid=setInterval(function(){o&&this.layer===0&&pe.active._onTouchMove(js);var Re=ut[this.layer].vy?ut[this.layer].vy*d:0,xe=ut[this.layer].vx?ut[this.layer].vx*d:0;typeof v=="function"&&v.call(pe.dragged.parentNode[Mt],xe,Re,l,js,ut[this.layer].el)!=="continue"||Ny(ut[this.layer].el,xe,Re)}.bind({layer:y}),24))),y++}while(e.bubbleScroll&&b!==h&&(b=Zn(b,!1)));zd=g}},30),Uy=function(e){var t=e.originalEvent,o=e.putSortable,i=e.dragEl,a=e.activeSortable,c=e.dispatchSortableEvent,d=e.hideGhostForTarget,h=e.unhideGhostForTarget;if(t){var g=o||a;d();var v=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,y=document.elementFromPoint(v.clientX,v.clientY);h(),g&&!g.el.contains(y)&&(c("spill"),this.onSpill({dragEl:i,putSortable:o}))}};function Ud(){}Ud.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,o=e.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var i=lo(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(t,i):this.sortable.el.appendChild(t),this.sortable.animateAll(),o&&o.animateAll()},drop:Uy},Fn(Ud,{pluginName:"revertOnSpill"});function Wd(){}Wd.prototype={onSpill:function(e){var t=e.dragEl,o=e.putSortable,i=o||this.sortable;i.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),i.animateAll()},drop:Uy},Fn(Wd,{pluginName:"removeOnSpill"}),pe.mount(new IC),pe.mount(Wd,Ud);const Wy="block-removed",_C="block-added",NC="block-moved",Ky="block-changed";class Vy{constructor(){this.tail=Promise.resolve()}get completed(){return this.failure?Promise.reject(this.failure):this.tail}add(e){if(this.failure)return Promise.reject(this.failure);const t=this.tail.then(()=>e());return this.tail=t.catch(o=>{this.failure=o}),t}}class RC extends Ae{constructor(){super(...arguments),this._currentBlockIndex=-1,this._blocks=null,this.sortable=null}get currentBlockIndex(){return this._currentBlockIndex}set currentBlockIndex(e){this._currentBlockIndex=e}get firstBlock(){return this.blocksStore[0]}get lastBlock(){return this.blocksStore[this.blocksStore.length-1]}get currentBlock(){return this.blocksStore[this.currentBlockIndex]}set currentBlock(e){if(e===void 0){this.unsetCurrentBlock();return}this.currentBlockIndex=this.getBlockIndex(e)}get nextBlock(){if(this.currentBlockIndex===this.blocksStore.length-1)return null;const t=this.blocksStore[this.currentBlockIndex+1];return t!=null?t:null}get nextContentfulBlock(){return this.blocks.slice(this.currentBlockIndex+1).find(t=>!!t.inputs.length)}get previousContentfulBlock(){return this.blocks.slice(0,this.currentBlockIndex).reverse().find(t=>!!t.inputs.length)}get previousBlock(){if(this.currentBlockIndex===0)return null;const t=this.blocksStore[this.currentBlockIndex-1];return t!=null?t:null}get blocks(){return this.blocksStore.array}get isBlokEmpty(){return this.blocks.every(e=>e.isEmpty)}prepare(){const e=new Bd(this.Blok.UI.nodes.redactor);this._blocks=new Proxy(e,{set:Bd.set,get:Bd.get}),this.listeners.on(document,"copy",t=>{this.Blok.BlockEvents.handleCommandC(t)}),this.sortable=new pe(this.Blok.UI.nodes.redactor,{animation:150,forceFallback:!0,handle:`.${this.Blok.Toolbar.CSS.settingsTogglerHandle}`,onStart:()=>{this.Blok.UI.nodes.wrapper.classList.add(this.Blok.UI.CSS.blokDragging),Xo(!0)},onEnd:t=>{this.Blok.UI.nodes.wrapper.classList.remove(this.Blok.UI.CSS.blokDragging),!(t.newIndex===void 0||t.oldIndex===void 0)&&this.move(t.newIndex,t.oldIndex,!0)}})}toggleReadOnly(e){e?this.disableModuleBindings():this.enableModuleBindings()}composeBlock({tool:e,data:t={},id:o=void 0,tunes:i={}}){const a=this.Blok.ReadOnly.isEnabled,c=this.Blok.Tools.blockTools.get(e);if(c===void 0)throw new Error(`Could not compose Block. Tool «${e}» not found.`);const d=new Sn({id:o,data:t,tool:c,api:this.Blok.API,readOnly:a,tunesData:i},this.eventsDispatcher);return a||window.requestIdleCallback(()=>{this.bindBlockEvents(d)},{timeout:2e3}),d}insert({id:e=void 0,tool:t,data:o,index:i,needToFocus:a=!0,replace:c=!1,tunes:d}={}){const h=i!=null?i:this.currentBlockIndex+(c?0:1),g=t!=null?t:this.config.defaultBlock;if(g===void 0)throw new Error("Could not insert Block. Tool name is not specified.");const v={tool:g};e!==void 0&&(v.id=e),o!==void 0&&(v.data=o),d!==void 0&&(v.tunes=d);const y=this.composeBlock(v),b=c?this.getBlockByIndex(h):void 0;if(c&&b===void 0)throw new Error(`Could not replace Block at index ${h}. Block not found.`);return c&&b!==void 0&&this.blockDidMutated(Wy,b,{index:h}),this.blocksStore.insert(h,y,c),this.blockDidMutated(_C,y,{index:h}),a&&(this.currentBlockIndex=h),!a&&h<=this.currentBlockIndex&&this.currentBlockIndex++,y}insertMany(e,t=0){this.blocksStore.insertMany(e,t)}async update(e,t,o){if(!t&&!o)return e;const i=await e.data,a=this.composeBlock({id:e.id,tool:e.name,data:Object.assign({},i,t!=null?t:{}),tunes:o!=null?o:e.tunes}),c=this.getBlockIndex(e);return this.blocksStore.replace(c,a),this.blockDidMutated(Ky,a,{index:c}),a}replace(e,t,o){const i=this.getBlockIndex(e);return this.insert({tool:t,data:o,index:i,replace:!0})}get blocksStore(){if(this._blocks===null)throw new Error("BlockManager: blocks store is not initialized. Call prepare() before accessing blocks.");return this._blocks}async paste(e,t,o=!1){const i=this.insert({tool:e,replace:o});try{await i.ready,i.call(Dn.ON_PASTE,t),i.refreshToolRootElement()}catch(a){Be(`${e}: onPaste callback call is failed`,"error",a)}return i}insertDefaultBlockAtIndex(e,t=!1){const o=this.config.defaultBlock;if(o===void 0)throw new Error("Could not insert default Block. Default block tool is not defined in the configuration.");return this.insert({tool:o,index:e,needToFocus:t})}insertAtEnd(){return this.currentBlockIndex=this.blocks.length-1,this.insert()}async mergeBlocks(e,t){const o=async c=>{await e.mergeWith(c),await this.removeBlock(t),this.currentBlockIndex=this.blocksStore.indexOf(e)},i=e.name===t.name&&e.mergeable,a=i?await t.data:void 0;if(i&&lt(a)){console.error("Could not merge Block. Failed to extract original Block data.");return}if(i&&a!==void 0){const[c]=Ju([{data:a,tool:t.name}],e.tool.sanitizeConfig,this.config.sanitizer);await o(c.data);return}if(e.mergeable&&gs(t,"export")&&gs(e,"import")){const c=await t.exportDataAsString(),d=xn(c,e.tool.sanitizeConfig),h=qv(d,e.tool.conversionConfig);await o(h)}}removeBlock(e,t=!0){return new Promise(o=>{const i=this.blocksStore.indexOf(e);if(!this.validateIndex(i))throw new Error("Can't find a Block to remove");this.blocksStore.remove(i),e.destroy(),this.blockDidMutated(Wy,e,{index:i}),this.currentBlockIndex>=i&&this.currentBlockIndex--;const a=this.blocks.length===0;a&&this.unsetCurrentBlock(),a&&t&&this.insert(),!a&&i===0&&(this.currentBlockIndex=0),o()})}removeSelectedBlocks(){const e=this.blocks.map((t,o)=>({block:t,index:o})).filter(({block:t})=>t.selected).sort((t,o)=>o.index-t.index);return e.forEach(({block:t})=>{this.removeBlock(t,!1)}),e.length>0?e[e.length-1].index:void 0}removeAllBlocks(){const e=i=>{i<0||(this.blocksStore.remove(i),e(i-1))};e(this.blocksStore.length-1),this.unsetCurrentBlock(),this.insert();const t=this.currentBlock,o=t==null?void 0:t.firstInput;o!==void 0&&o.focus()}split(){const e=this.Blok.Caret.extractFragmentFromCaretPosition(),t=R.make("div");t.appendChild(e);const o={text:R.isEmpty(t)?"":t.innerHTML};return this.insert({data:o})}getBlockByIndex(e){const t=e===-1?this.blocksStore.length-1:e;return this.blocksStore[t]}getBlockIndex(e){return this.blocksStore.indexOf(e)}getBlockById(e){return this.blocksStore.array.find(t=>t.id===e)}getBlock(e){const t=R.isElement(e)?e:e.parentNode;if(!t)return;const o=this.blocksStore.nodes,i=t.closest(`.${Sn.CSS.wrapper}`);if(!i)return;const a=o.indexOf(i);if(a>=0)return this.blocksStore[a]}setCurrentBlockByChildNode(e){const t=R.isElement(e)?e:e.parentNode;if(!t)return;const o=t.closest(`.${Sn.CSS.wrapper}`);if(!o)return;const i=o.closest(`.${this.Blok.UI.CSS.blokWrapper}`);if(!(i==null?void 0:i.isEqualNode(this.Blok.UI.nodes.wrapper))||!(o instanceof HTMLElement))return;this.currentBlockIndex=this.blocksStore.nodes.indexOf(o);const c=this.currentBlock;return c==null||c.updateCurrentInput(),c}getBlockByChildNode(e){if(!(e instanceof Node))return;const t=R.isElement(e)?e:e.parentNode;if(!t)return;const o=t.closest(`.${Sn.CSS.wrapper}`);if(o)return this.blocks.find(i=>i.holder===o)}move(e,t=this.currentBlockIndex,o=!1){if(isNaN(e)||isNaN(t)){Be("Warning during 'move' call: incorrect indices provided.","warn");return}if(!this.validateIndex(e)||!this.validateIndex(t)){Be("Warning during 'move' call: indices cannot be lower than 0 or greater than the amount of blocks.","warn");return}this.blocksStore.move(e,t,o),this.currentBlockIndex=e;const i=this.currentBlock;if(i===void 0)throw new Error(`Could not move Block. Block at index ${e} is not available.`);this.blockDidMutated(NC,i,{fromIndex:t,toIndex:e})}async convert(e,t,o){const i=await e.save();if(!i||i.data===void 0)throw new Error("Could not convert Block. Failed to extract original Block data.");const a=this.Blok.Tools.blockTools.get(t);if(!a)throw new Error(`Could not convert Block. Tool «${t}» not found.`);const c=await e.exportDataAsString(),d=xn(c,rd(this.config.sanitizer,a.sanitizeConfig)),h=qv(d,a.conversionConfig,a.settings),g=o?Object.assign(h,o):h;return this.replace(e,a.name,g)}unsetCurrentBlock(){this.currentBlockIndex=-1}async clear(e=!1){const t=new Vy;[...this.blocks].forEach(i=>{t.add(async()=>{await this.removeBlock(i,!1)})}),await t.completed,this.unsetCurrentBlock(),e&&this.insert(),this.Blok.UI.checkEmptiness()}async destroy(){this.sortable&&(this.sortable.destroy(),this.sortable=null),await Promise.all(this.blocks.map(e=>e.destroy()))}bindBlockEvents(e){const{BlockEvents:t}=this.Blok;this.readOnlyMutableListeners.on(e.holder,"keydown",o=>{o instanceof KeyboardEvent&&t.keydown(o)}),this.readOnlyMutableListeners.on(e.holder,"keyup",o=>{o instanceof KeyboardEvent&&t.keyup(o)}),e.on("didMutated",o=>this.blockDidMutated(Ky,o,{index:this.getBlockIndex(o)}))}disableModuleBindings(){this.readOnlyMutableListeners.clearAll()}enableModuleBindings(){this.readOnlyMutableListeners.on(document,"cut",e=>{this.Blok.BlockEvents.handleCommandX(e)}),this.blocks.forEach(e=>{this.bindBlockEvents(e)})}validateIndex(e){return!(e<0||e>=this.blocksStore.length)}blockDidMutated(e,t,o){const i=be({target:new On(t)},o),a=new CustomEvent(e,{detail:be({},i)});return Object.prototype.propertyIsEnumerable.call(a,"type")||Object.defineProperty(a,"type",{value:e,enumerable:!0,configurable:!0}),Object.prototype.propertyIsEnumerable.call(a,"detail")||Object.defineProperty(a,"detail",{value:i,enumerable:!0,configurable:!0}),this.eventsDispatcher.emit(Pv,{event:a}),t}}class OC extends Ae{constructor(){super(...arguments),this.anyBlockSelectedCache=null,this.needToSelectAll=!1,this.nativeInputSelected=!1,this.readyToBlockSelection=!1,this.selection=new X}get sanitizerConfig(){const e={p:{},h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},ol:{},ul:{},li:{},br:!0,img:{src:!0,width:!0,height:!0},a:{href:!0},b:{},i:{},u:{}};return rd(this.config.sanitizer,e)}get allBlocksSelected(){const{BlockManager:e}=this.Blok;return e.blocks.every(t=>t.selected===!0)}set allBlocksSelected(e){const{BlockManager:t}=this.Blok;for(const o of t.blocks)o.selected=e;this.clearCache()}get anyBlockSelected(){const{BlockManager:e}=this.Blok;return this.anyBlockSelectedCache===null&&(this.anyBlockSelectedCache=e.blocks.some(t=>t.selected===!0)),this.anyBlockSelectedCache}get selectedBlocks(){return this.Blok.BlockManager.blocks.filter(e=>e.selected)}prepare(){this.selection=new X,oo.add({name:"CMD+A",handler:e=>{const{BlockManager:t,ReadOnly:o}=this.Blok;if(o.isEnabled){e.preventDefault(),this.selectAllBlocks();return}t.currentBlock&&this.handleCommandA(e)},on:this.Blok.UI.nodes.redactor})}toggleReadOnly(){const e=X.get();e==null||e.removeAllRanges(),this.allBlocksSelected=!1}unSelectBlockByIndex(e){const{BlockManager:t}=this.Blok,o=typeof e=="number"?t.getBlockByIndex(e):t.currentBlock;o&&(o.selected=!1,this.clearCache())}clearSelection(e,t=!1){const{RectangleSelection:o}=this.Blok;this.needToSelectAll=!1,this.nativeInputSelected=!1,this.readyToBlockSelection=!1;const i=e&&e instanceof KeyboardEvent,a=e,c=i&&a.key&&a.key.length===1;if(this.anyBlockSelected&&i&&c&&!X.isSelectionExists&&this.replaceSelectedBlocksWithPrintableKey(e),this.Blok.CrossBlockSelection.clear(e),t&&this.selection.restore(),!this.anyBlockSelected||o.isRectActivated()){this.Blok.RectangleSelection.clearSelection();return}this.allBlocksSelected=!1}async copySelectedBlocks(e){e.preventDefault();const t=e.clipboardData;if(!t)return;const o=R.make("div"),i=[];this.selectedBlocks.forEach(d=>{var x;const h=xn(d.holder.innerHTML,this.sanitizerConfig),g=R.make("div");g.innerHTML=h;const v=(x=g.textContent)!=null?x:"";if(i.push(v),!Array.from(g.childNodes).some(w=>w.nodeType===Node.ELEMENT_NODE)&&v.trim().length>0){const w=R.make("p");w.innerHTML=g.innerHTML,o.appendChild(w)}else for(;g.firstChild;)o.appendChild(g.firstChild)});const a=i.join(`
30
172
 
31
- `),s=o.innerHTML;t.setData("text/plain",i),t.setData("text/html",s);try{const a=await Promise.all(this.selectedBlocks.map(l=>l.save()));t.setData(this.Editor.Paste.MIME_TYPE,JSON.stringify(a))}catch{}}selectBlockByIndex(e){const{BlockManager:t}=this.Editor,o=t.getBlockByIndex(e);o!==void 0&&this.selectBlock(o)}selectBlock(e){this.selection.save();const t=w.get();t==null||t.removeAllRanges();const o=e;o.selected=!0,this.clearCache(),this.Editor.InlineToolbar.close()}unselectBlock(e){const t=e;t.selected=!1,this.clearCache()}clearCache(){this.anyBlockSelectedCache=null}destroy(){bt.remove(this.Editor.UI.nodes.redactor,"CMD+A")}handleCommandA(e){if(this.Editor.RectangleSelection.clearSelection(),v.isNativeInput(e.target)&&!this.readyToBlockSelection){this.readyToBlockSelection=!0;return}const t=this.Editor.BlockManager.getBlock(e.target);if(!t)return;const o=t.inputs;if(o.length>1&&!this.readyToBlockSelection){this.readyToBlockSelection=!0;return}if(o.length===1&&!this.needToSelectAll){this.needToSelectAll=!0;return}if(this.needToSelectAll){e.preventDefault(),this.selectAllBlocks(),this.needToSelectAll=!1,this.readyToBlockSelection=!1;return}this.readyToBlockSelection&&(e.preventDefault(),this.selectBlock(t),this.needToSelectAll=!0)}selectAllBlocks(){this.selection.save();const e=w.get();e==null||e.removeAllRanges(),this.allBlocksSelected=!0,this.Editor.InlineToolbar.close()}replaceSelectedBlocksWithPrintableKey(e){const{BlockManager:t,Caret:o}=this.Editor,r=t.removeSelectedBlocks();if(r===void 0)return;t.insertDefaultBlockAtIndex(r,!0);const i=t.currentBlock;i&&o.setToBlock(i),gn(()=>{const s=e.key;o.insertContentAtCaretPosition(s.length>1?"":s)},20)()}}const mw=127,hl=n=>{for(const e of n){if(e.trim().length===0)continue;if(e>="0"&&e<="9"||e.toLowerCase()!==e.toUpperCase())return!1;const t=e.codePointAt(0);if(typeof t=="number"&&t>mw)return!1}return!0},fl=n=>{var e;return n.nodeType===Node.TEXT_NODE?[n]:(e=n.hasChildNodes)!=null&&e.call(n)?Array.from(n.childNodes).flatMap(t=>fl(t)):[]},vw=n=>{const e=fl(n);if(e.length===0)return null;const t=e[e.length-1],o=[...e].reverse().find(r=>!hl(r.textContent??""))??null;return o&&o!==t&&hl(t.textContent??"")&&o.parentNode!==n?o:t};class Zn extends F{get positions(){return{START:"start",END:"end",DEFAULT:"default"}}static get CSS(){return{shadowCaret:"cdx-shadow-caret"}}setToBlock(e,t=this.positions.DEFAULT,o=0){var u;const{BlockManager:r,BlockSelection:i}=this.Editor;if(i.clearSelection(),!e.focusable){(u=window.getSelection())==null||u.removeAllRanges(),i.selectBlock(e),r.currentBlock=e;return}const a=(()=>t===this.positions.START?e.firstInput:t===this.positions.END?e.lastInput:e.currentInput)();if(!a)return;const l=h=>{if(t===this.positions.START)return{node:v.getDeepestNode(h,!1),offset:0};if(t===this.positions.END)return this.resolveEndPositionNode(h);const{node:g,offset:f}=v.getNodeByOffset(h,o);return g?{node:g,offset:f}:{node:v.getDeepestNode(h,!1),offset:0}},{node:c,offset:d}=l(a);c&&(this.set(c,d),r.setCurrentBlockByChildNode(e.holder),r.currentBlock.currentInput=a)}resolveEndPositionNode(e){const t=v.getDeepestNode(e,!0);if(t instanceof HTMLElement&&v.isNativeInput(t))return{node:t,offset:v.getContentLength(t)};const o=vw(e);return o?{node:o,offset:v.getContentLength(o)}:t?{node:t,offset:v.getContentLength(t)}:{node:null,offset:0}}setToInput(e,t=this.positions.DEFAULT,o=0){const{currentBlock:r}=this.Editor.BlockManager,i=v.getDeepestNode(e);switch(t){case this.positions.START:this.set(i,0);break;case this.positions.END:i&&this.set(i,v.getContentLength(i));break;default:o&&this.set(i,o)}r&&(r.currentInput=e)}set(e,t=0){const{top:r,bottom:i}=w.setCursor(e,t),{innerHeight:s}=window;if(r<0){window.scrollBy(0,r-30);return}i>s&&window.scrollBy(0,i-s+30)}setToTheLastBlock(){const e=this.Editor.BlockManager.lastBlock;if(e)if(e.tool.isDefault&&e.isEmpty)this.setToBlock(e);else{const t=this.Editor.BlockManager.insertAtEnd();this.setToBlock(t)}}extractFragmentFromCaretPosition(){const e=w.get();if(!e||!e.rangeCount)return;const t=e.getRangeAt(0),o=this.Editor.BlockManager.currentBlock;if(!o)return;const r=o.currentInput;if(t.deleteContents(),!r)return;if(v.isNativeInput(r)){const s=r,a=document.createDocumentFragment(),l=s.selectionStart??0,c=s.value.substring(0,l),d=s.value.substring(l);return a.textContent=d,s.value=c,a}const i=t.cloneRange();return i.selectNodeContents(r),i.setStart(t.endContainer,t.endOffset),i.extractContents()}navigateNext(e=!1){const{BlockManager:t}=this.Editor,{currentBlock:o,nextBlock:r}=t;if(o===void 0)return!1;const{nextInput:i,currentInput:s}=o,a=s!==void 0?wn(s):void 0,l=e||a||!o.focusable;if(i&&l)return this.setToInput(i,this.positions.START),!0;const d=(()=>r!==null?r:o.tool.isDefault||!l?null:t.insertAtEnd())();return d!==null&&l?(this.setToBlock(d,this.positions.START),!0):!1}navigatePrevious(e=!1){const{currentBlock:t,previousBlock:o}=this.Editor.BlockManager;if(!t)return!1;const{previousInput:r,currentInput:i}=t,s=i!==void 0?kn(i):void 0,a=e||s||!t.focusable;return r&&a?(this.setToInput(r,this.positions.END),!0):o!==null&&a?(this.setToBlock(o,this.positions.END),!0):!1}createShadow(e){const t=document.createElement("span");t.classList.add(Zn.CSS.shadowCaret),e.insertAdjacentElement("beforeend",t)}restoreCaret(e){const t=e.querySelector(`.${Zn.CSS.shadowCaret}`);if(!t)return;new w().expandToTag(t);const r=document.createRange();r.selectNode(t),r.extractContents()}insertContentAtCaretPosition(e){const t=document.createDocumentFragment(),o=document.createElement("div"),r=w.get(),i=w.range;if(!r||!i)return;o.innerHTML=e,Array.from(o.childNodes).forEach(c=>t.appendChild(c)),t.childNodes.length===0&&t.appendChild(new Text);const s=t.lastChild;i.deleteContents(),i.insertNode(t);const a=document.createRange(),l=s.nodeType===Node.TEXT_NODE?s:s.firstChild;l!==null&&l.textContent!==null&&a.setStart(l,l.textContent.length),r.removeAllRanges(),r.addRange(a)}}class bw extends F{constructor(){super(...arguments),this.firstSelectedBlock=null,this.lastSelectedBlock=null,this.onMouseUp=()=>{this.listeners.off(document,"mouseover",this.onMouseOver),this.listeners.off(document,"mouseup",this.onMouseUp)},this.onMouseOver=e=>{var a;const t=e,{BlockManager:o,BlockSelection:r}=this.Editor;if(t.relatedTarget===null&&t.target===null)return;const i=o.getBlockByChildNode(t.relatedTarget)||this.lastSelectedBlock,s=o.getBlockByChildNode(t.target);if(!(!i||!s)&&s!==i){if(this.firstSelectedBlock&&i===this.firstSelectedBlock){(a=w.get())==null||a.removeAllRanges(),i.selected=!0,s.selected=!0,r.clearCache();return}if(this.firstSelectedBlock&&s===this.firstSelectedBlock){i.selected=!1,s.selected=!1,r.clearCache();return}this.Editor.InlineToolbar.close(),this.toggleBlocksSelectedState(i,s),this.lastSelectedBlock=s}}}async prepare(){this.listeners.on(document,"mousedown",e=>{this.enableCrossBlockSelection(e)})}watchSelection(e){if(e.button!==_y.LEFT)return;const{BlockManager:t}=this.Editor,o=t.getBlock(e.target);o&&(this.firstSelectedBlock=o,this.lastSelectedBlock=o,this.listeners.on(document,"mouseover",this.onMouseOver),this.listeners.on(document,"mouseup",this.onMouseUp))}get isCrossBlockSelectionStarted(){return!!this.firstSelectedBlock&&!!this.lastSelectedBlock&&this.firstSelectedBlock!==this.lastSelectedBlock}toggleBlockSelectedState(e=!0){var a;const{BlockManager:t,BlockSelection:o}=this.Editor,r=t.currentBlock;if(!this.lastSelectedBlock&&!r||(!this.lastSelectedBlock&&r&&(this.lastSelectedBlock=this.firstSelectedBlock=r),this.firstSelectedBlock===this.lastSelectedBlock&&this.firstSelectedBlock&&(this.firstSelectedBlock.selected=!0,o.clearCache(),(a=w.get())==null||a.removeAllRanges(),this.Editor.Toolbar.close()),!this.lastSelectedBlock))return;const i=t.blocks.indexOf(this.lastSelectedBlock)+(e?1:-1),s=t.blocks[i];s&&(this.lastSelectedBlock.selected!==s.selected?(s.selected=!0,o.clearCache(),this.Editor.Toolbar.close()):(this.lastSelectedBlock.selected=!1,o.clearCache(),this.Editor.Toolbar.close()),this.lastSelectedBlock=s,this.Editor.InlineToolbar.close(),s.holder.scrollIntoView({block:"nearest"}))}clear(e){const{BlockManager:t,BlockSelection:o,Caret:r}=this.Editor;if(!this.firstSelectedBlock||!this.lastSelectedBlock)return;const i=t.blocks.indexOf(this.firstSelectedBlock),s=t.blocks.indexOf(this.lastSelectedBlock);if(!o.anyBlockSelected||i===-1||s===-1){this.firstSelectedBlock=this.lastSelectedBlock=null;return}if(e&&e instanceof KeyboardEvent)switch(e.key){case"ArrowDown":case"ArrowRight":r.setToBlock(t.blocks[Math.max(i,s)],r.positions.END);break;case"ArrowUp":case"ArrowLeft":r.setToBlock(t.blocks[Math.min(i,s)],r.positions.START);break;default:r.setToBlock(t.blocks[Math.max(i,s)],r.positions.END)}this.firstSelectedBlock=this.lastSelectedBlock=null}enableCrossBlockSelection(e){const{UI:t}=this.Editor;w.isCollapsed||this.Editor.BlockSelection.clearSelection(e),t.nodes.redactor.contains(e.target)?this.watchSelection(e):this.Editor.BlockSelection.clearSelection(e)}toggleBlocksSelectedState(e,t){const{BlockManager:o,BlockSelection:r}=this.Editor,i=o.blocks.indexOf(e),s=o.blocks.indexOf(t),a=e.selected!==t.selected,l=Math.min(i,s),c=Math.max(i,s);for(const d of Array.from({length:c-l+1},(u,h)=>l+h)){const u=o.blocks[d];u!==this.firstSelectedBlock&&u!==(a?e:t)&&(o.blocks[d].selected=!o.blocks[d].selected,r.clearCache())}this.Editor.Toolbar.close()}}class yw extends F{constructor({config:e,eventsDispatcher:t}){super({config:e,eventsDispatcher:t}),this.disabled=!1,this.batchingTimeout=null,this.batchingOnChangeQueue=new Map,this.batchTime=wE,this.mutationObserver=new MutationObserver(o=>{this.redactorChanged(o)}),this.eventsDispatcher.on(Hs,o=>{this.particularBlockChanged(o.event)}),this.eventsDispatcher.on(js,()=>{this.disable()}),this.eventsDispatcher.on(zs,()=>{this.enable()})}enable(){this.mutationObserver.observe(this.Editor.UI.nodes.redactor,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),this.disabled=!1}disable(){this.mutationObserver.disconnect(),this.disabled=!0}particularBlockChanged(e){this.disabled||!j(this.config.onChange)||(this.batchingOnChangeQueue.set(`block:${e.detail.target.id}:event:${e.type}`,e),this.batchingTimeout&&clearTimeout(this.batchingTimeout),this.batchingTimeout=setTimeout(()=>{const t=this.batchingOnChangeQueue.size===1?this.batchingOnChangeQueue.values().next().value:Array.from(this.batchingOnChangeQueue.values());this.config.onChange&&this.config.onChange(this.Editor.API.methods,t),this.batchingOnChangeQueue.clear()},this.batchTime))}redactorChanged(e){this.eventsDispatcher.emit(So,{mutations:e})}}const pl=new Set(["table","thead","tbody","tfoot","tr","th","td","caption","colgroup","col","ul","ol","li","dl","dt","dd"]),gl=class extends F{constructor(){super(...arguments),this.MIME_TYPE="application/x-editor-js",this.toolsTags={},this.tagsByTool={},this.toolsPatterns=[],this.toolsFiles={},this.exceptionList=[],this.handlePasteEventWrapper=n=>{this.handlePasteEvent(n)},this.processTool=n=>{try{const e=n.create({},{},!1);if(n.pasteConfig===!1){this.exceptionList.push(n.name);return}if(!j(e.onPaste))return;this.getTagsConfig(n),this.getFilesConfig(n),this.getPatternsConfig(n)}catch(e){$(`Paste handling for «${n.name}» Tool hasn't been set up because of the error`,"warn",e)}},this.handlePasteEvent=async n=>{const{BlockManager:e,Toolbar:t}=this.Editor,o=e.setCurrentBlockByChildNode(n.target);!o||n.target&&this.isNativeBehaviour(n.target)&&n.clipboardData&&!n.clipboardData.types.includes("Files")||this.exceptionList.includes(o.name)||(n.preventDefault(),n.clipboardData&&await this.processDataTransfer(n.clipboardData),t.close())}}async prepare(){this.processTools()}shouldReplaceCurrentBlockForFile(n){const{BlockManager:e}=this.Editor,t=e.currentBlock;return t?n&&t.name===n?!0:!!t.tool.isDefault&&t.isEmpty:!1}getStructuralTagsSanitizeConfig(n){const e={},t=[n];for(;t.length>0;){const o=t.pop();if(!o)continue;const r=o.tagName.toLowerCase();pl.has(r)&&(e[r]=e[r]??{}),t.push(...Array.from(o.children))}return e}toggleReadOnly(n){n?this.unsetCallback():this.setCallback()}containsFiles(n){var t;if(Array.from(n.types).includes("Files")||(t=n.files)!=null&&t.length)return!0;try{const o=n.types;if(typeof(o==null?void 0:o.contains)=="function"&&o.contains("Files"))return!0}catch{}return!1}async processDataTransfer(n){const{Tools:e}=this.Editor;if(this.containsFiles(n)&&!Q(this.toolsFiles)){await this.processFiles(n.files);return}const o=n.getData(this.MIME_TYPE),r=n.getData("text/plain"),s=n.getData("text/html");if(o)try{this.insertEditorJSData(JSON.parse(o));return}catch{}const a=Object.fromEntries(Object.keys(this.toolsTags).map(g=>[g.toLowerCase(),this.toolsTags[g].sanitizationConfig??{}])),l=e.getAllInlineToolsSanitizeConfig(),c=Po(this.config.sanitizer,a,l,{br:{}}),d=Ae(s,c),u=v.isHTMLString(d);!d.trim()||d.trim()===r||!u?await this.processText(r):await this.processText(d,!0)}async processText(n,e=!1){var s,a;const{Caret:t,BlockManager:o}=this.Editor,r=e?this.processHTML(n):this.processPlain(n);if(!r.length)return;if(r.length>1){const c=!!((s=o.currentBlock)!=null&&s.tool.isDefault)&&!!((a=o.currentBlock)!=null&&a.isEmpty);r.forEach((d,u)=>{this.insertBlock(d,u===0&&c)}),o.currentBlock&&t.setToBlock(o.currentBlock,t.positions.END);return}const[i]=r;if(i.isBlock){await this.processSingleBlock(i);return}await this.processInlinePaste(i)}setCallback(){this.listeners.on(this.Editor.UI.nodes.holder,"paste",this.handlePasteEventWrapper)}unsetCallback(){this.listeners.off(this.Editor.UI.nodes.holder,"paste",this.handlePasteEventWrapper)}processTools(){const n=this.Editor.Tools.blockTools;Array.from(n.values()).forEach(this.processTool)}collectTagNames(n){return we(n)?[n]:W(n)?Object.keys(n):[]}getTagsConfig(n){if(n.pasteConfig===!1)return;const e=n.pasteConfig.tags||[],t=[];e.forEach(o=>{const r=this.collectTagNames(o);t.push(...r),r.forEach(i=>{if(Object.prototype.hasOwnProperty.call(this.toolsTags,i)){$(`Paste handler for «${n.name}» Tool on «${i}» tag is skipped because it is already used by «${this.toolsTags[i].tool.name}» Tool.`,"warn");return}const s=W(o)?o[i]:void 0;this.toolsTags[i.toUpperCase()]={tool:n,sanitizationConfig:s}})}),this.tagsByTool[n.name]=t.map(o=>o.toUpperCase())}getFilesConfig(n){if(n.pasteConfig===!1)return;const{files:e={}}=n.pasteConfig,{extensions:t,mimeTypes:o}=e;if(!t&&!o)return;const r=(()=>t==null?[]:Array.isArray(t)?t:($(`«extensions» property of the paste config for «${n.name}» Tool should be an array`),[]))(),i=(()=>o==null?[]:Array.isArray(o)?o.filter(s=>Ly(s)?!0:($(`MIME type value «${s}» for the «${n.name}» Tool is not a valid MIME type`,"warn"),!1)):($(`«mimeTypes» property of the paste config for «${n.name}» Tool should be an array`),[]))();this.toolsFiles[n.name]={extensions:r,mimeTypes:i}}getPatternsConfig(n){n.pasteConfig===!1||!n.pasteConfig.patterns||Q(n.pasteConfig.patterns)||Object.entries(n.pasteConfig.patterns).forEach(([e,t])=>{t instanceof RegExp||$(`Pattern ${t} for «${n.name}» Tool is skipped because it should be a Regexp instance.`,"warn"),this.toolsPatterns.push({key:e,pattern:t,tool:n})})}isNativeBehaviour(n){return v.isNativeInput(n)}async processFiles(n){var i;const{BlockManager:e}=this.Editor,o=(await Promise.all(Array.from(n).map(s=>this.processFile(s)))).filter(s=>s!=null);if(o.length===0)return;const r=this.shouldReplaceCurrentBlockForFile((i=o[0])==null?void 0:i.type);o.forEach((s,a)=>{e.paste(s.type,s.event,a===0&&r)})}async processFile(n){const e=Ry(n),t=Object.entries(this.toolsFiles).find(([i,{mimeTypes:s,extensions:a}])=>{const[l,c]=n.type.split("/"),d=a.find(h=>h.toLowerCase()===e.toLowerCase()),u=s.find(h=>{const[g,f]=h.split("/");return g===l&&(f===c||f==="*")});return d!==void 0||u!==void 0});if(!t)return;const[o]=t;return{event:this.composePasteEvent("file",{file:n}),type:o}}processHTML(n){const{Tools:e}=this.Editor,t=v.make("DIV");return t.innerHTML=n,this.getNodes(t).map(r=>{var m;const i=(()=>{switch(r.nodeType){case Node.DOCUMENT_FRAGMENT_NODE:{const b=v.make("div");return b.appendChild(r),{content:b,tool:e.defaultTool,isBlock:!1}}case Node.ELEMENT_NODE:{const b=r,E=this.toolsTags[b.tagName];return{content:b,tool:(E==null?void 0:E.tool)??e.defaultTool,isBlock:!0}}default:return null}})();if(!i)return null;const{content:s,tool:a,isBlock:l}=i,d=(a.pasteConfig===!1?[]:((m=a.pasteConfig)==null?void 0:m.tags)||[]).reduce((b,E)=>{const k=this.collectTagNames(E),N={...b};return k.forEach(x=>{const P=W(E)?E[x]:null;N[x.toLowerCase()]=P??{}}),N},{}),u=this.getStructuralTagsSanitizeConfig(s),h=Object.assign({},u,d,a.baseSanitizeConfig),g=(()=>{if(s.tagName.toLowerCase()!=="table")return s.innerHTML=Ae(s.innerHTML,h),s;const b=Ae(s.outerHTML,h),k=v.make("div",void 0,{innerHTML:b}).firstChild;return!k||!(k instanceof HTMLElement)?null:k})();if(!g)return null;const f=this.composePasteEvent("tag",{data:g});return{content:g,isBlock:l,tool:a.name,event:f}}).filter(r=>{if(!r)return!1;const i=v.isEmpty(r.content),s=v.isSingleTag(r.content);return!i||s})}processPlain(n){const{defaultBlock:e}=this.config;if(!n)return[];const t=e;return n.split(/\r?\n/).filter(o=>o.trim()).map(o=>{const r=v.make("div");r.textContent=o;const i=this.composePasteEvent("tag",{data:r});return{content:r,tool:t,isBlock:!1,event:i}})}async processSingleBlock(n){const{Caret:e,BlockManager:t}=this.Editor,{currentBlock:o}=t;if(!o||n.tool!==o.name||!v.containsOnlyInlineElements(n.content.innerHTML)){this.insertBlock(n,o?o.tool.isDefault&&o.isEmpty:!1);return}e.insertContentAtCaretPosition(n.content.innerHTML)}async processInlinePaste(n){var l;const{BlockManager:e,Caret:t}=this.Editor,{content:o}=n,r=((l=e.currentBlock)==null?void 0:l.tool.isDefault)??!1,i=o.textContent,a=r&&i!==null&&i.length<gl.PATTERN_PROCESSING_MAX_LENGTH&&i!==null?await this.processPattern(i):void 0;if(a){const c=e.currentBlock&&e.currentBlock.tool.isDefault&&e.currentBlock.isEmpty,d=e.paste(a.tool,a.event,c);t.setToBlock(d,t.positions.END);return}if(e.currentBlock&&e.currentBlock.currentInput){const c=e.currentBlock.tool.baseSanitizeConfig;t.insertContentAtCaretPosition(Ae(o.innerHTML,c))}else this.insertBlock(n)}async processPattern(n){const e=this.toolsPatterns.find(o=>{const r=o.pattern.exec(n);return r?n===r.shift():!1});return e?{event:this.composePasteEvent("pattern",{key:e.key,data:n}),tool:e.tool.name}:void 0}insertBlock(n,e=!1){const{BlockManager:t,Caret:o}=this.Editor,{currentBlock:r}=t;if(e&&r&&r.isEmpty){const s=t.paste(n.tool,n.event,!0);o.setToBlock(s,o.positions.END);return}const i=t.paste(n.tool,n.event);o.setToBlock(i,o.positions.END)}insertEditorJSData(n){const{BlockManager:e,Caret:t,Tools:o}=this.Editor;Oo(n,i=>{var s;return((s=o.blockTools.get(i))==null?void 0:s.sanitizeConfig)??{}},this.config.sanitizer).forEach(({tool:i,data:s},a)=>{var d,u;const l=a===0&&!!((d=e.currentBlock)!=null&&d.tool.isDefault)&&!!((u=e.currentBlock)!=null&&u.isEmpty),c=e.insert({tool:i,data:s,replace:l});t.setToBlock(c,t.positions.END)})}processElementNode(n,e,t){const o=Object.keys(this.toolsTags),r=n,i=this.toolsTags[r.tagName],s=i==null?void 0:i.tool,a=this.tagsByTool[(s==null?void 0:s.name)??""]??[],l=o.includes(r.tagName),c=v.blockElements.includes(r.tagName.toLowerCase()),d=pl.has(r.tagName.toLowerCase()),u=Array.from(r.children).some(({tagName:g})=>o.includes(g)&&!a.includes(g)),h=Array.from(r.children).some(({tagName:g})=>v.blockElements.includes(g.toLowerCase()));if(!c&&!l&&!u)return t.appendChild(r),[...e,t];if(l&&!u||c&&!h&&!u||d&&!u)return[...e,t,r]}getNodes(n){const e=Array.from(n.childNodes),t=(o,r)=>{if(v.isEmpty(r)&&!v.isSingleTag(r))return o;const i=o[o.length-1],s=i!==void 0&&v.isFragment(i),{destNode:a,remainingNodes:l}=s?{destNode:i,remainingNodes:o.slice(0,-1)}:{destNode:new DocumentFragment,remainingNodes:o};if(r.nodeType===Node.TEXT_NODE)return a.appendChild(r),[...l,a];if(r.nodeType!==Node.ELEMENT_NODE)return[...l,a];const c=this.processElementNode(r,l,a);if(c)return c;const d=Array.from(r.childNodes).reduce(t,[]);return[...l,...d]};return e.reduce(t,[])}composePasteEvent(n,e){return new CustomEvent(n,{detail:e})}};let ml=gl;ml.PATTERN_PROCESSING_MAX_LENGTH=450;class Ew extends F{constructor(){super(...arguments),this.toolsDontSupportReadOnly=[],this.readOnlyEnabled=!1}get isEnabled(){return this.readOnlyEnabled}async prepare(){const{Tools:e}=this.Editor,{blockTools:t}=e,o=[];Array.from(t.entries()).forEach(([r,i])=>{i.isReadOnlySupported||o.push(r)}),this.toolsDontSupportReadOnly=o,this.config.readOnly===!0&&o.length>0&&this.throwCriticalError(),await this.toggle(this.config.readOnly,!0)}async toggle(e=!this.readOnlyEnabled,t=!1){e&&this.toolsDontSupportReadOnly.length>0&&this.throwCriticalError();const o=this.readOnlyEnabled;this.readOnlyEnabled=e;for(const i of Object.values(this.Editor))i!=null&&typeof i.toggleReadOnly=="function"&&i.toggleReadOnly(e);if(o===e)return this.readOnlyEnabled;if(t)return this.readOnlyEnabled;this.Editor.ModificationsObserver.disable();const r=await this.Editor.Saver.save();return r===void 0?(this.Editor.ModificationsObserver.enable(),this.readOnlyEnabled):(await this.Editor.BlockManager.clear(),await this.Editor.Renderer.render(r.blocks),this.Editor.ModificationsObserver.enable(),this.readOnlyEnabled)}throwCriticalError(){throw new Ot(`To enable read-only mode all connected tools should support it. Tools ${this.toolsDontSupportReadOnly.join(", ")} don't support read-only mode.`)}}class Zt extends F{constructor(){super(...arguments),this.isRectSelectionActivated=!1,this.SCROLL_SPEED=3,this.HEIGHT_OF_SCROLL_ZONE=40,this.BOTTOM_SCROLL_ZONE=1,this.TOP_SCROLL_ZONE=2,this.MAIN_MOUSE_BUTTON=0,this.mousedown=!1,this.isScrolling=!1,this.inScrollZone=null,this.startX=0,this.startY=0,this.mouseX=0,this.mouseY=0,this.stackOfSelected=[],this.rectCrossesBlocks=!1,this.overlayRectangle=null,this.listenerIds=[]}static get CSS(){return{overlay:"codex-editor-overlay",overlayContainer:"codex-editor-overlay__container",rect:"codex-editor-overlay__rectangle",topScrollZone:"codex-editor-overlay__scroll-zone--top",bottomScrollZone:"codex-editor-overlay__scroll-zone--bottom"}}prepare(){this.enableModuleBindings()}startSelection(e,t){const o=this.getScrollLeft(),r=this.getScrollTop(),i=document.elementFromPoint(e-o,t-r);if(!i)return;i.closest(`.${this.Editor.Toolbar.CSS.toolbar}`)||(this.Editor.BlockSelection.allBlocksSelected=!1,this.clearSelection(),this.stackOfSelected=[]);const a=[`.${re.CSS.content}`,`.${this.Editor.Toolbar.CSS.toolbar}`,`.${this.Editor.InlineToolbar.CSS.inlineToolbar}`],l=i.closest("."+this.Editor.UI.CSS.editorWrapper),c=a.some(d=>!!i.closest(d));!l||c||(this.mousedown=!0,this.startX=e,this.startY=t)}endSelection(){this.mousedown=!1,this.startX=0,this.startY=0,this.overlayRectangle!==null&&(this.overlayRectangle.style.display="none")}isRectActivated(){return this.isRectSelectionActivated}clearSelection(){this.isRectSelectionActivated=!1}enableModuleBindings(){const{container:e}=this.genHTML();this.listeners.on(e,"mousedown",r=>{this.processMouseDown(r)},!1);const t=To(r=>{r instanceof MouseEvent&&this.processMouseMove(r)},10);this.listeners.on(document.body,"mousemove",t,{passive:!0}),this.listeners.on(document.body,"mouseleave",()=>{this.processMouseLeave()});const o=To(r=>{this.processScroll(r)},10);this.listeners.on(window,"scroll",o,{passive:!0}),this.listeners.on(document.body,"mouseup",()=>{this.processMouseUp()},!1)}processMouseDown(e){if(e.button!==this.MAIN_MOUSE_BUTTON)return;e.target.closest(v.allInputsSelector)!==null||this.startSelection(e.pageX,e.pageY)}processMouseMove(e){this.changingRectangle(e),this.scrollByZones(e.clientY)}processMouseLeave(){this.clearSelection(),this.endSelection()}processScroll(e){this.changingRectangle(e)}processMouseUp(){this.clearSelection(),this.endSelection()}scrollByZones(e){if(this.inScrollZone=null,e<=this.HEIGHT_OF_SCROLL_ZONE&&(this.inScrollZone=this.TOP_SCROLL_ZONE),document.documentElement.clientHeight-e<=this.HEIGHT_OF_SCROLL_ZONE&&(this.inScrollZone=this.BOTTOM_SCROLL_ZONE),!this.inScrollZone){this.isScrolling=!1;return}this.isScrolling||(this.scrollVertical(this.inScrollZone===this.TOP_SCROLL_ZONE?-this.SCROLL_SPEED:this.SCROLL_SPEED),this.isScrolling=!0)}genHTML(){const{UI:e}=this.Editor,t=e.nodes.holder.querySelector("."+e.CSS.editorWrapper),o=v.make("div",Zt.CSS.overlay,{}),r=v.make("div",Zt.CSS.overlayContainer,{}),i=v.make("div",Zt.CSS.rect,{});if(!t)throw new Error("RectangleSelection: editor wrapper not found");return r.appendChild(i),o.appendChild(r),t.appendChild(o),this.overlayRectangle=i,{container:t,overlay:o}}scrollVertical(e){if(!(this.inScrollZone&&this.mousedown))return;const t=this.getScrollTop();window.scrollBy(0,e),this.mouseY+=this.getScrollTop()-t,setTimeout(()=>{this.scrollVertical(e)},0)}changingRectangle(e){if(!this.mousedown)return;const t=this.overlayRectangle;if(t===null)return;e.pageY!==void 0&&(this.mouseX=e.pageX,this.mouseY=e.pageY);const{rightPos:o,leftPos:r,index:i}=this.genInfoForMouseSelection(),s=this.startX>o&&this.mouseX>o,a=this.startX<r&&this.mouseX<r;if(this.rectCrossesBlocks=!(s||a),this.isRectSelectionActivated||(this.rectCrossesBlocks=!1,this.isRectSelectionActivated=!0,this.shrinkRectangleToPoint(),t.style.display="block"),this.updateRectangleSize(),this.Editor.Toolbar.close(),i===void 0)return;this.trySelectNextBlock(i),this.inverseSelection();const l=w.get();l&&l.removeAllRanges()}shrinkRectangleToPoint(){if(this.overlayRectangle===null)return;const e=this.getScrollLeft(),t=this.getScrollTop();this.overlayRectangle.style.left=`${this.startX-e}px`,this.overlayRectangle.style.top=`${this.startY-t}px`,this.overlayRectangle.style.bottom=`calc(100% - ${this.startY-t}px)`,this.overlayRectangle.style.right=`calc(100% - ${this.startX-e}px)`}inverseSelection(){if(this.stackOfSelected.length===0)return;const e=this.Editor.BlockManager.getBlockByIndex(this.stackOfSelected[0]);if(!e)return;const t=e.selected;if(this.rectCrossesBlocks&&!t)for(const o of this.stackOfSelected)this.Editor.BlockSelection.selectBlockByIndex(o);if(!this.rectCrossesBlocks&&t)for(const o of this.stackOfSelected)this.Editor.BlockSelection.unSelectBlockByIndex(o)}updateRectangleSize(){if(this.overlayRectangle===null)return;const e=this.getScrollLeft(),t=this.getScrollTop();this.mouseY>=this.startY?(this.overlayRectangle.style.top=`${this.startY-t}px`,this.overlayRectangle.style.bottom=`calc(100% - ${this.mouseY-t}px)`):(this.overlayRectangle.style.bottom=`calc(100% - ${this.startY-t}px)`,this.overlayRectangle.style.top=`${this.mouseY-t}px`),this.mouseX>=this.startX?(this.overlayRectangle.style.left=`${this.startX-e}px`,this.overlayRectangle.style.right=`calc(100% - ${this.mouseX-e}px)`):(this.overlayRectangle.style.right=`calc(100% - ${this.startX-e}px)`,this.overlayRectangle.style.left=`${this.mouseX-e}px`)}genInfoForMouseSelection(){var f;const t=document.body.offsetWidth/2,o=this.getScrollTop(),r=this.mouseY-o,i=document.elementFromPoint(t,r),s=(f=this.Editor.BlockManager.lastBlock)==null?void 0:f.holder,a=s==null?void 0:s.querySelector("."+re.CSS.content),c=(a?Number.parseInt(window.getComputedStyle(a).width,10):0)/2,d=t-c,u=t+c;if(!i)return{index:void 0,leftPos:d,rightPos:u};const h=this.Editor.BlockManager.getBlockByChildNode(i);return{index:h!==void 0?this.Editor.BlockManager.blocks.findIndex(m=>m.holder===h.holder):void 0,leftPos:d,rightPos:u}}getScrollTop(){var e,t;return typeof window.scrollY=="number"?window.scrollY:((e=document.documentElement)==null?void 0:e.scrollTop)??((t=document.body)==null?void 0:t.scrollTop)??0}getScrollLeft(){var e,t;return typeof window.scrollX=="number"?window.scrollX:((e=document.documentElement)==null?void 0:e.scrollLeft)??((t=document.body)==null?void 0:t.scrollLeft)??0}addBlockInSelection(e){this.rectCrossesBlocks&&this.Editor.BlockSelection.selectBlockByIndex(e),this.stackOfSelected.push(e)}trySelectNextBlock(e){const t=this.stackOfSelected.length,o=this.stackOfSelected[t-1];if(o===e)return;const i=this.stackOfSelected[t-2],s=i!==void 0&&o!==void 0?o-i>0:!1,a=t<=1,l=o!==void 0&&e>o&&s,c=o!==void 0&&e<o&&t>1&&!s,u=!(l||c||a);if(!u&&(o===void 0||e>o)){const f=o!==void 0?o+1:e;Array.from({length:e-f+1},(m,b)=>f+b).forEach(m=>{this.addBlockInSelection(m)});return}if(!u&&o!==void 0&&e<o){Array.from({length:o-e},(f,m)=>o-1-m).forEach(f=>{this.addBlockInSelection(f)});return}if(!u)return;const h=f=>o===void 0?!1:e>o?e>f:e<f,g=[];for(const f of[...this.stackOfSelected].reverse()){if(!h(f))break;this.rectCrossesBlocks&&this.Editor.BlockSelection.unSelectBlockByIndex(f),g.push(f)}g.length>0&&this.stackOfSelected.splice(this.stackOfSelected.length-g.length,g.length)}}class Tw extends F{render(e){return new Promise(t=>{const{Tools:o,BlockManager:r}=this.Editor;if(e.length===0)r.insert();else{const i=e.map(s=>{const{tunes:a,id:l}=s,c=s.type,d=(()=>o.available.has(c)?{tool:c,data:s.data}:(Ee(`Tool «${c}» is not found. Check 'tools' property at the Editor.js config.`,"warn"),{tool:o.stubTool,data:this.composeStubDataForTool(c,s.data,l)}))();return((h,g)=>{try{return r.composeBlock({id:l,tool:h,data:g,tunes:a})}catch(f){$(`Block «${h}» skipped because of plugins error`,"error",{data:g,error:f});const m=this.composeStubDataForTool(h,g,l);return r.composeBlock({id:l,tool:o.stubTool,data:m,tunes:a})}})(d.tool,d.data)});r.insertMany(i)}window.requestIdleCallback(()=>{t()},{timeout:2e3})})}composeStubDataForTool(e,t,o){const{Tools:r}=this.Editor,i=(()=>{if(!r.unavailable.has(e))return e;const s=r.unavailable.get(e).toolbox;return s!==void 0&&s[0].title!==void 0?s[0].title:e})();return{savedData:{id:o,type:e,data:t},title:i}}}class kw extends F{async save(){const{BlockManager:e,Tools:t}=this.Editor,o=e.blocks;if(o.length===1&&o[0].isEmpty)return{time:+new Date,blocks:[],version:fn()};const r=o.map(i=>this.getSavedData(i));this.lastSaveError=void 0;try{const i=await Promise.all(r),s=this.sanitizeExtractedData(i,a=>{var l;return(l=t.blockTools.get(a))==null?void 0:l.sanitizeConfig},this.config.sanitizer);return this.makeOutput(s)}catch(i){this.lastSaveError=i;const s=i instanceof Error?i:new Error(String(i));Ee("Saving failed due to the Error %o","error",s);return}}async getSavedData(e){const t=await e.save(),o=e.name,r=(t==null?void 0:t.data)!==void 0?t:this.getPreservedSavedData(e);if(r===void 0)return{tool:o,isValid:!1};const i=await e.validate(r.data);return{...r,isValid:i}}makeOutput(e){const t=[];return e.forEach(({id:o,tool:r,data:i,tunes:s,isValid:a})=>{if(!a){$(`Block «${r}» skipped because saved data is invalid`);return}if(r===void 0||i===void 0){$("Block skipped because saved data is missing required fields");return}if(r===this.Editor.Tools.stubTool&&this.isStubSavedData(i)){t.push(i);return}if(r===this.Editor.Tools.stubTool){$("Stub block data is malformed and was skipped");return}const l=s===void 0||Q(s),c={id:o,type:r,data:i,...!l&&{tunes:s}};t.push(c)}),{time:+new Date,blocks:t,version:fn()}}sanitizeExtractedData(e,t,o){const r=[];if(e.forEach((a,l)=>{this.hasSanitizableData(a)&&r.push({index:l,data:a})}),r.length===0)return e;const i=Oo(r.map(({data:a})=>a),t,o),s=e.map(a=>({...a}));return r.forEach(({index:a},l)=>{const c=i[l];s[a]={...s[a],data:c.data}}),s}hasSanitizableData(e){return e.data!==void 0&&typeof e.tool=="string"}isStubSavedData(e){if(!W(e))return!1;const t=e;return typeof t.type=="string"&&t.data!==void 0}getLastSaveError(){return this.lastSaveError}getPreservedSavedData(e){const t=e.preservedData;if(Q(t))return;const o=e.preservedTunes;return{id:e.id,tool:e.name,data:t,...Q(o)?{}:{tunes:o},time:0}}}(function(){try{if(typeof document<"u"){var n=document.createElement("style");n.appendChild(document.createTextNode(".ce-paragraph{line-height:1.6em;outline:none}.ce-block:only-of-type .ce-paragraph[data-placeholder-active]:empty:before,.ce-block:only-of-type .ce-paragraph[data-placeholder-active][data-empty=true]:before{content:attr(data-placeholder-active)}.ce-paragraph p:first-of-type{margin-top:0}.ce-paragraph p:last-of-type{margin-bottom:0}")),document.head.appendChild(n)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();const ww='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M8 9V7.2C8 7.08954 8.08954 7 8.2 7L12 7M16 9V7.2C16 7.08954 15.9105 7 15.8 7L12 7M12 7L12 17M12 17H10M12 17H14"/></svg>';function Cw(n){const e=document.createElement("div");e.innerHTML=n.trim();const t=document.createDocumentFragment();return t.append(...Array.from(e.childNodes)),t}/**
32
- * Base Paragraph Block for the Editor.js.
33
- * Represents a regular text block
34
- *
35
- * @author CodeX (team@codex.so)
36
- * @copyright CodeX 2018
37
- * @license The MIT License (MIT)
38
- */class si{static get DEFAULT_PLACEHOLDER(){return""}constructor({data:e,config:t,api:o,readOnly:r}){this.api=o,this.readOnly=r,this._CSS={block:this.api.styles.block,wrapper:"ce-paragraph"},this.readOnly||(this.onKeyUp=this.onKeyUp.bind(this)),this._placeholder=t.placeholder?t.placeholder:si.DEFAULT_PLACEHOLDER,this._data=e??{},this._element=null,this._preserveBlank=t.preserveBlank??!1}onKeyUp(e){if(e.code!=="Backspace"&&e.code!=="Delete"||!this._element)return;const{textContent:t}=this._element;t===""&&(this._element.innerHTML="")}drawView(){const e=document.createElement("DIV");return e.classList.add(this._CSS.wrapper,this._CSS.block),e.contentEditable="false",e.dataset.placeholderActive=this.api.i18n.t(this._placeholder),this._data.text&&(e.innerHTML=this._data.text),this.readOnly||(e.contentEditable="true",e.addEventListener("keyup",this.onKeyUp)),e}render(){return this._element=this.drawView(),this._element}merge(e){if(!this._element)return;this._data.text+=e.text;const t=Cw(e.text);this._element.appendChild(t),this._element.normalize()}validate(e){return!(e.text.trim()===""&&!this._preserveBlank)}save(e){return{text:e.innerHTML}}onPaste(e){const t={text:e.detail.data.innerHTML};this._data=t,window.requestAnimationFrame(()=>{this._element&&(this._element.innerHTML=this._data.text||"")})}static get conversionConfig(){return{export:"text",import:"text"}}static get sanitize(){return{text:{br:!0}}}static get isReadOnlySupported(){return!0}static get pasteConfig(){return{tags:["P"]}}static get toolbox(){return{icon:ww,title:"Text"}}}const p=class{static get sanitize(){return{strong:{},b:{}}}static normalizeAllBoldTags(){if(typeof document>"u")return;const n=w.CSS.editorWrapper,e=`${Vs} b, .${n} b`;document.querySelectorAll(e).forEach(t=>{p.ensureStrongElement(t)})}static normalizeBoldInNode(n){var r;const e=n.nodeType===Node.ELEMENT_NODE?n:n.parentElement;if(!e||typeof e.closest!="function")return;const t=w.CSS.editorWrapper;e.closest(`${Vs}, .${t}`)&&(e.tagName==="B"&&p.ensureStrongElement(e),(r=e.querySelectorAll)==null||r.call(e,"b").forEach(i=>{p.ensureStrongElement(i)}))}constructor(){typeof document>"u"||(p.instances.add(this),p.initializeGlobalListeners())}static initializeGlobalListeners(){return typeof document>"u"?!1:(p.shortcutListenerRegistered||(document.addEventListener("keydown",p.handleShortcut,!0),p.shortcutListenerRegistered=!0),p.selectionListenerRegistered||(document.addEventListener("selectionchange",p.handleGlobalSelectionChange,!0),p.selectionListenerRegistered=!0),p.inputListenerRegistered||(document.addEventListener("input",p.handleGlobalInput,!0),p.inputListenerRegistered=!0),p.beforeInputListenerRegistered||(document.addEventListener("beforeinput",p.handleBeforeInput,!0),p.beforeInputListenerRegistered=!0),p.ensureMutationObserver(),!0)}static maintainCollapsedExitState(){if(!(typeof document>"u"))for(const n of Array.from(p.collapsedExitRecords)){const e=p.resolveBoundary(n);if(!e){p.collapsedExitRecords.delete(n);continue}n.boundary=e.boundary,n.boldElement=e.boldElement;const t=e.boundary,o=e.boldElement,r=n.allowedLength,i=o.textContent??"";if(i.length>r){const b=i.slice(0,r),E=i.slice(r);o.textContent=b,t.textContent=(t.textContent??"")+E}const s=t.textContent??"";s.length>1&&s.startsWith("​")&&(t.textContent=s.slice(1));const a=window.getSelection();p.ensureCaretAtBoundary(a,t),p.scheduleBoundaryCaretAdjustment(t);const l=t.textContent??"",c=l.replace(/\u200B/g,""),d=c.match(/^\s+/),u=/\S/.test(c),h=l.startsWith("​");d&&(n.hasLeadingSpace=!0,n.leadingWhitespace=d[0]),u&&(n.hasTypedContent=!0);const g=/^\s/.test(c),f=n.hasTypedContent&&!h&&(o.textContent??"").length<=r,m=n.hasLeadingSpace&&n.hasTypedContent&&!g;if(f&&m){const b=l.replace(/^[\u200B\s]+/,""),E=n.leadingWhitespace||" ";t.textContent=`${E}${b}`,p.ensureCaretAtBoundary(a,t)}f&&p.collapsedExitRecords.delete(n)}}static ensureCaretAtBoundary(n,e){!n||!n.isCollapsed||p.setCaretToBoundaryEnd(n,e)}static scheduleBoundaryCaretAdjustment(n){p.pendingBoundaryCaretAdjustments.has(n)||(p.pendingBoundaryCaretAdjustments.add(n),setTimeout(()=>{var r;p.pendingBoundaryCaretAdjustments.delete(n);const e=n.ownerDocument??(typeof document<"u"?document:null);if(!e)return;const t=e.getSelection();if(!t||!t.isCollapsed||t.anchorNode!==n)return;const o=((r=n.textContent)==null?void 0:r.length)??0;t.anchorOffset!==o&&p.setCaret(t,n,o)},0))}static ensureTextNodeAfter(n){const e=n.nextSibling;if((e==null?void 0:e.nodeType)===Node.TEXT_NODE)return e;const t=n.parentNode;if(!t)return null;const o=n.ownerDocument??(typeof document<"u"?document:null);if(!o)return null;const r=o.createTextNode("");return t.insertBefore(r,e),r}static resolveBoundary(n){if(!n.boldElement.isConnected)return null;const e=p.ensureStrongElement(n.boldElement),t=n.boundary,r=t.isConnected&&t.previousSibling===e?t:p.ensureTextNodeAfter(e);return r?{boundary:r,boldElement:e}:null}static setCaretToBoundaryEnd(n,e){var r;const t=document.createRange(),o=((r=e.textContent)==null?void 0:r.length)??0;t.setStart(e,o),t.collapse(!0),n.removeAllRanges(),n.addRange(t)}static hasBoldParent(n){return n?n.nodeType===Node.ELEMENT_NODE&&p.isBoldTag(n)?!0:p.hasBoldParent(n.parentNode):!1}static findBoldElement(n){return n?n.nodeType===Node.ELEMENT_NODE&&p.isBoldTag(n)?p.ensureStrongElement(n):p.findBoldElement(n.parentNode):null}static isBoldTag(n){const e=n.tagName;return e==="B"||e==="STRONG"}static ensureStrongElement(n){if(n.tagName==="STRONG")return n;const e=document.createElement("strong");for(n.hasAttributes()&&Array.from(n.attributes).forEach(t=>{e.setAttribute(t.name,t.value)});n.firstChild;)e.appendChild(n.firstChild);return n.replaceWith(e),e}static mergeStrongNodes(n,e){const t=p.ensureStrongElement(n),o=p.ensureStrongElement(e);for(;o.firstChild;)t.appendChild(o.firstChild);return o.remove(),t}render(){return{icon:$E,name:"bold",onActivate:()=>{this.toggleBold()},isActive:()=>{const n=window.getSelection();return n?this.isSelectionVisuallyBold(n):!1}}}toggleBold(){const n=window.getSelection();if(!n||n.rangeCount===0)return;const e=n.getRangeAt(0);if(e.collapsed){this.toggleCollapsedSelection();return}this.isRangeBold(e,{ignoreWhitespace:!0})?this.unwrapBoldTags(e):this.wrapWithBold(e)}isSelectionVisuallyBold(n){if(!n||n.rangeCount===0)return!1;const e=n.getRangeAt(0);return this.isRangeBold(e,{ignoreWhitespace:!0})}wrapWithBold(n){const e=this.getRangeHtmlWithoutBold(n),t=this.replaceRangeWithHtml(n,`<strong>${e}</strong>`),o=window.getSelection();o&&t&&(o.removeAllRanges(),o.addRange(t)),p.normalizeAllBoldTags();const r=o?p.findBoldElement(o.focusNode):null;if(!r)return;const i=this.mergeAdjacentBold(r);this.normalizeWhitespaceAround(i),this.selectElementContents(i),p.normalizeBoldTagsWithinEditor(window.getSelection()),p.replaceNbspInBlock(window.getSelection()),this.notifySelectionChange()}unwrapBoldTags(n){const e=this.collectBoldAncestors(n),t=window.getSelection();if(!t)return;const o=document.createElement("span"),r=n.extractContents();o.dataset.boldMarker=`unwrap-${p.markerSequence++}`,o.appendChild(r),this.removeNestedBold(o),n.insertNode(o);const i=document.createRange();for(i.selectNodeContents(o),t.removeAllRanges(),t.addRange(i);;){const c=p.findBoldElement(o);if(!c)break;this.moveMarkerOutOfBold(o,c)}const s=o.firstChild,a=o.lastChild;this.unwrapElement(o);const l=s&&a?(()=>{const c=document.createRange();return c.setStartBefore(s),c.setEndAfter(a),t.removeAllRanges(),t.addRange(c),c})():void 0;l||t.removeAllRanges(),this.replaceNbspWithinRange(l),p.normalizeBoldTagsWithinEditor(t),p.replaceNbspInBlock(t),p.removeEmptyBoldElements(t),e.forEach(c=>{p.isElementEmpty(c)&&c.remove()}),this.notifySelectionChange()}replaceRangeWithHtml(n,e){const t=p.createFragmentFromHtml(e),o=t.firstChild??null,r=t.lastChild??null;if(n.deleteContents(),!o||!r)return;n.insertNode(t);const i=document.createRange();return i.setStartBefore(o),i.setEndAfter(r),i}moveMarkerOutOfBold(n,e){const t=e.parentNode;if(!t)return;if(e.childNodes.length===1&&e.firstChild===n){e.replaceWith(n);return}if(e.firstChild===n){t.insertBefore(n,e);return}if(e.lastChild===n){t.insertBefore(n,e.nextSibling);return}const s=e.cloneNode(!1);for(;n.nextSibling;)s.appendChild(n.nextSibling);t.insertBefore(s,e.nextSibling),t.insertBefore(n,s)}selectElementContents(n){const e=window.getSelection();if(!e)return;const t=document.createRange();t.selectNodeContents(n),e.removeAllRanges(),e.addRange(t)}get shortcut(){return"CMD+B"}isRangeBold(n,e){if(n.collapsed)return!!p.findBoldElement(n.startContainer);const t=document.createTreeWalker(n.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode:r=>{try{return n.intersectsNode(r)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}catch{const s=document.createRange();s.selectNodeContents(r);const a=n.compareBoundaryPoints(Range.END_TO_START,s)>0,l=n.compareBoundaryPoints(Range.START_TO_END,s)<0;return a&&l?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}}),o=[];for(;t.nextNode();){const r=t.currentNode,i=r.textContent??"";e.ignoreWhitespace&&i.trim().length===0||i.length!==0&&o.push(r)}return o.length===0?!!p.findBoldElement(n.startContainer):o.every(r=>p.hasBoldParent(r))}removeNestedBold(n){var t;const e=(t=n.querySelectorAll)==null?void 0:t.call(n,"b,strong");e&&e.forEach(o=>{this.unwrapElement(o)})}unwrapElement(n){const e=n.parentNode;if(!e){n.remove();return}for(;n.firstChild;)e.insertBefore(n.firstChild,n);e.removeChild(n)}mergeAdjacentBold(n){const e=p.ensureStrongElement(n),t=e.previousSibling,o=t&&t.nodeType===Node.ELEMENT_NODE&&p.isBoldTag(t)?p.mergeStrongNodes(t,e):e,r=o.nextSibling;return r&&r.nodeType===Node.ELEMENT_NODE&&p.isBoldTag(r)?p.mergeStrongNodes(o,r):o}toggleCollapsedSelection(){const n=window.getSelection();if(!n||n.rangeCount===0)return;const e=n.getRangeAt(0),t=p.findBoldElement(e.startContainer),o=(()=>{if(t&&t.getAttribute(p.DATA_ATTR_COLLAPSED_ACTIVE)!=="true")return p.exitCollapsedBold(n,t);const r=t??p.getBoundaryBold(e);return r?p.exitCollapsedBold(n,r):this.startCollapsedBold(e)})();document.dispatchEvent(new Event("selectionchange")),o&&(n.removeAllRanges(),n.addRange(o)),p.normalizeBoldTagsWithinEditor(n),p.replaceNbspInBlock(n),p.removeEmptyBoldElements(n),this.notifySelectionChange()}startCollapsedBold(n){if(!n.collapsed)return;const e=document.createElement("strong"),t=document.createTextNode("");e.appendChild(t),e.setAttribute(p.DATA_ATTR_COLLAPSED_ACTIVE,"true");const o=n.startContainer,r=n.startOffset;if(!(()=>o.nodeType===Node.TEXT_NODE?this.insertCollapsedBoldIntoText(o,e,r):o.nodeType===Node.ELEMENT_NODE?(this.insertCollapsedBoldIntoElement(o,e,r),!0):!1)())return;const s=window.getSelection(),a=document.createRange();a.setStart(t,0),a.collapse(!0);const l=this.mergeAdjacentBold(e);return p.normalizeBoldTagsWithinEditor(s),p.replaceNbspInBlock(s),p.removeEmptyBoldElements(s),s&&(s.removeAllRanges(),s.addRange(a)),this.notifySelectionChange(),l.firstChild instanceof Text?(()=>{var d;const c=document.createRange();return c.setStart(l.firstChild,((d=l.firstChild.textContent)==null?void 0:d.length)??0),c.collapse(!0),c})():a}insertCollapsedBoldIntoText(n,e,t){const o=n,r=o.parentNode;if(!r)return!1;const i=o.textContent??"",s=i.slice(0,t),a=i.slice(t);o.textContent=s;const l=a.length?document.createTextNode(a):null;return l&&r.insertBefore(l,o.nextSibling),r.insertBefore(e,l??o.nextSibling),e.setAttribute(p.DATA_ATTR_PREV_LENGTH,s.length.toString()),!0}insertCollapsedBoldIntoElement(n,e,t){const o=n.childNodes[t]??null;n.insertBefore(e,o),e.setAttribute(p.DATA_ATTR_PREV_LENGTH,"0")}static isElementEmpty(n){return(n.textContent??"").length===0}notifySelectionChange(){p.enforceCollapsedBoldLengths(window.getSelection()),document.dispatchEvent(new Event("selectionchange")),this.updateToolbarButtonState()}updateToolbarButtonState(){const n=window.getSelection();if(!n)return;const e=n.anchorNode,t=(e==null?void 0:e.nodeType)===Node.ELEMENT_NODE?e:e==null?void 0:e.parentElement,o=t==null?void 0:t.closest(`.${w.CSS.editorWrapper}`);if(!o)return;const r=o.querySelector("[data-cy=inline-toolbar]");if(!(r instanceof HTMLElement))return;const i=r.querySelector('[data-item-name="bold"]');if(!(i instanceof HTMLElement))return;const s=this.isSelectionVisuallyBold(n);i.classList.toggle("ce-popover-item--active",s),s?i.setAttribute("data-popover-item-active","true"):i.removeAttribute("data-popover-item-active")}normalizeWhitespaceAround(n){p.replaceNbspWithSpace(n.previousSibling),p.replaceNbspWithSpace(n.nextSibling)}static replaceNbspWithSpace(n){if(!n||n.nodeType!==Node.TEXT_NODE)return;const e=n,t=e.textContent??"";t.includes(" ")&&(e.textContent=t.replace(/\u00A0/g," "))}restoreSelectionFromMarkers(n){const e=document.querySelector(`[data-bold-marker="${n}-start"]`),t=document.querySelector(`[data-bold-marker="${n}-end"]`);if(!e||!t){e==null||e.remove(),t==null||t.remove();return}const o=window.getSelection();if(!o){e.remove(),t.remove();return}const r=document.createRange();return r.setStartAfter(e),r.setEndBefore(t),o.removeAllRanges(),o.addRange(r),e.remove(),t.remove(),r}replaceNbspWithinRange(n){if(!n)return;const e=document.createTreeWalker(n.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode:t=>{try{return n.intersectsNode(t)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}catch{const r=document.createRange();r.selectNodeContents(t);const i=n.compareBoundaryPoints(Range.END_TO_START,r)>0,s=n.compareBoundaryPoints(Range.START_TO_END,r)<0;return i&&s?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}});for(;e.nextNode();)p.replaceNbspWithSpace(e.currentNode)}static normalizeBoldTagsWithinEditor(n){const e=(n==null?void 0:n.anchorNode)??(n==null?void 0:n.focusNode);if(!e)return;const t=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement,o=t==null?void 0:t.closest(`.${w.CSS.editorWrapper}`);o&&o.querySelectorAll("b").forEach(r=>{p.ensureStrongElement(r)})}static replaceNbspInBlock(n){const e=(n==null?void 0:n.anchorNode)??(n==null?void 0:n.focusNode);if(!e)return;const t=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement,o=t==null?void 0:t.closest('[data-block-tool="paragraph"]');if(!o)return;const r=document.createTreeWalker(o,NodeFilter.SHOW_TEXT);for(;r.nextNode();)p.replaceNbspWithSpace(r.currentNode);o.querySelectorAll("b").forEach(i=>{p.ensureStrongElement(i)})}static removeEmptyBoldElements(n){const e=(n==null?void 0:n.anchorNode)??(n==null?void 0:n.focusNode);if(!e)return;const t=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement,o=t==null?void 0:t.closest('[data-block-tool="paragraph"]');if(!o)return;const r=(n==null?void 0:n.focusNode)??null;o.querySelectorAll("strong").forEach(i=>{const s=i.getAttribute(p.DATA_ATTR_COLLAPSED_ACTIVE)==="true",a=i.hasAttribute(p.DATA_ATTR_COLLAPSED_LENGTH);s||a||(i.textContent??"").length===0&&!p.isNodeWithin(r,i)&&i.remove()})}static synchronizeCollapsedBold(n){const e=(n==null?void 0:n.anchorNode)??(n==null?void 0:n.focusNode),t=e&&e.nodeType===Node.ELEMENT_NODE?e:e==null?void 0:e.parentElement,o=(t==null?void 0:t.closest(`.${w.CSS.editorWrapper}`))??(t==null?void 0:t.ownerDocument);if(!o)return;const r=`strong[${p.DATA_ATTR_COLLAPSED_ACTIVE}="true"]`;o.querySelectorAll(r).forEach(i=>{var I;const s=i.getAttribute(p.DATA_ATTR_PREV_LENGTH),a=i.previousSibling;if(!s||!a||a.nodeType!==Node.TEXT_NODE)return;const l=Number(s);if(!Number.isFinite(l))return;const c=a,d=c.textContent??"";if(d.length<=l)return;const u=d.slice(0,l),h=d.slice(l);c.textContent=u;const g=h.match(/^[\u00A0\s]+/);if(g&&!i.hasAttribute(p.DATA_ATTR_LEADING_WHITESPACE)&&i.setAttribute(p.DATA_ATTR_LEADING_WHITESPACE,g[0]),h.length===0)return;const f=i.textContent??"",m=f+h,b=i.getAttribute(p.DATA_ATTR_LEADING_WHITESPACE)??"",k=b.length>0&&f.length===0&&!m.startsWith(b)?b+m:m,N=document.createTextNode(k);for(;i.firstChild;)i.removeChild(i.firstChild);if(i.appendChild(N),!(n!=null&&n.isCollapsed)||!p.isNodeWithin(n.focusNode,c))return;const x=document.createRange(),P=((I=N.textContent)==null?void 0:I.length)??0;x.setStart(N,P),x.collapse(!0),n.removeAllRanges(),n.addRange(x)})}static moveCaretAfterBoundaryBold(n){if(!n.rangeCount)return;const e=n.getRangeAt(0);if(!e.collapsed)return;const t=p.findBoldElement(e.startContainer);(t==null?void 0:t.getAttribute(p.DATA_ATTR_COLLAPSED_ACTIVE))!=="true"&&(p.moveCaretFromElementContainer(n,e)||p.moveCaretFromTextContainer(n,e))}static getAdjacentBold(n){const e=n.startContainer;return e.nodeType===Node.TEXT_NODE?p.getBoldAdjacentToText(n,e):e.nodeType===Node.ELEMENT_NODE?p.getBoldAdjacentToElement(n,e):null}static getBoldAdjacentToText(n,e){var i;const t=((i=e.textContent)==null?void 0:i.length)??0,o=e.previousSibling;if(n.startOffset===0&&p.isBoldElement(o))return o;if(n.startOffset!==t)return null;const r=e.nextSibling;return p.isBoldElement(r)?r:null}static getBoldAdjacentToElement(n,e){const t=n.startOffset>0?e.childNodes[n.startOffset-1]??null:null;if(p.isBoldElement(t))return t;const o=e.childNodes[n.startOffset]??null;return p.isBoldElement(o)?o:null}static exitCollapsedIfNeeded(n,e){if(!!p.findBoldElement(e.startContainer))return;const o=p.getBoundaryBold(e)??p.getAdjacentBold(e);if(!o)return;const r=p.exitCollapsedBold(n,o);r&&(n.removeAllRanges(),n.addRange(r))}static moveCaretFromElementContainer(n,e){if(e.startContainer.nodeType!==Node.ELEMENT_NODE)return!1;const t=e.startContainer;return p.moveCaretAfterPreviousBold(n,t,e.startOffset)?!0:p.moveCaretBeforeNextBold(n,t,e.startOffset)}static moveCaretAfterPreviousBold(n,e,t){var s;const o=t>0?e.childNodes[t-1]??null:null;if(!p.isBoldElement(o))return!1;const r=p.ensureFollowingTextNode(o,o.nextSibling);if(!r)return!1;const i=((s=r.textContent)==null?void 0:s.length)??0;return p.setCaret(n,r,i),!0}static moveCaretBeforeNextBold(n,e,t){const o=e.childNodes[t]??null;if(!p.isBoldElement(o))return!1;const r=p.ensureFollowingTextNode(o,o.nextSibling);return r?(p.setCaret(n,r,0),!0):(p.setCaretAfterNode(n,o),!0)}static moveCaretFromTextContainer(n,e){var l;if(e.startContainer.nodeType!==Node.TEXT_NODE)return;const t=e.startContainer,o=t.previousSibling,r=t.textContent??"",i=/^\s/.test(r);if(e.startOffset===0&&p.isBoldElement(o)&&(r.length===0||i)){p.setCaret(n,t,r.length);return}const s=p.findBoldElement(t);if(!s||e.startOffset!==(((l=t.textContent)==null?void 0:l.length)??0))return;const a=p.ensureFollowingTextNode(s,s.nextSibling);if(a){p.setCaret(n,a,0);return}p.setCaretAfterNode(n,s)}static guardCollapsedBoundaryKeydown(n){if(n.defaultPrevented||n.metaKey||n.ctrlKey||n.altKey||n.key.length!==1)return;const t=window.getSelection();if(!t||!t.isCollapsed||t.rangeCount===0)return;const o=t.getRangeAt(0);if(o.startContainer.nodeType!==Node.TEXT_NODE)return;const r=o.startContainer,i=r.textContent??"";if(i.length===0||o.startOffset!==0)return;const s=r.previousSibling;p.isBoldElement(s)&&/^\s/.test(i)&&p.setCaret(t,r,i.length)}static isBoldElement(n){return!!(n&&n.nodeType===Node.ELEMENT_NODE&&p.isBoldTag(n))}static setCaret(n,e,t){const o=document.createRange();o.setStart(e,t),o.collapse(!0),n.removeAllRanges(),n.addRange(o)}static setCaretAfterNode(n,e){if(!e)return;const t=document.createRange();t.setStartAfter(e),t.collapse(!0),n.removeAllRanges(),n.addRange(t)}static ensureFollowingTextNode(n,e){const t=n.parentNode;if(!t)return null;if(e&&e.nodeType===Node.TEXT_NODE)return e;const o=document.createTextNode("");return t.insertBefore(o,e),o}static enforceCollapsedBoldLengths(n){const e=(n==null?void 0:n.anchorNode)??(n==null?void 0:n.focusNode);if(!e)return;const t=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement,o=t==null?void 0:t.closest(`.${w.CSS.editorWrapper}`);if(!o)return;o.querySelectorAll(`strong[${p.DATA_ATTR_COLLAPSED_LENGTH}]`).forEach(i=>{var k,N;const s=i,a=s.getAttribute(p.DATA_ATTR_COLLAPSED_LENGTH);if(!a)return;const l=Number(a),c=s.textContent??"";if(!Number.isFinite(l))return;const d=c.length>l,u=d?p.splitCollapsedBoldText(s,l,c):null,h=s.getAttribute(p.DATA_ATTR_PREV_LENGTH),g=h?Number(h):NaN,f=s.previousSibling,m=(f==null?void 0:f.nodeType)===Node.TEXT_NODE?f:null,b=(m==null?void 0:m.textContent)??"",E=!!(h&&Number.isFinite(g)&&m&&b.length>g);if(E&&m){const x=b.slice(0,g),P=b.slice(g);m.textContent=x;const I=document.createTextNode(P);(k=s.parentNode)==null||k.insertBefore(I,s.nextSibling)}if(E&&s.removeAttribute(p.DATA_ATTR_PREV_LENGTH),n!=null&&n.isCollapsed&&u&&p.isNodeWithin(n.focusNode,s)){const x=document.createRange(),P=((N=u.textContent)==null?void 0:N.length)??0;x.setStart(u,P),x.collapse(!0),n.removeAllRanges(),n.addRange(x)}d&&s.removeAttribute(p.DATA_ATTR_COLLAPSED_LENGTH)})}static splitCollapsedBoldText(n,e,t){const o=n,r=o.parentNode;if(!r)return null;const i=t.slice(0,e),s=t.slice(e);o.textContent=i;const a=document.createTextNode(s);return r.insertBefore(a,o.nextSibling),a}static isNodeWithin(n,e){return n?n===e||e.contains(n):!1}static handleGlobalSelectionChange(){p.refreshSelectionState("selectionchange")}static handleGlobalInput(){p.refreshSelectionState("input")}static refreshSelectionState(n){const e=window.getSelection();p.enforceCollapsedBoldLengths(e),p.maintainCollapsedExitState(),p.synchronizeCollapsedBold(e),p.normalizeBoldTagsWithinEditor(e),p.replaceNbspInBlock(e),p.removeEmptyBoldElements(e),n==="input"&&e&&p.moveCaretAfterBoundaryBold(e),p.normalizeAllBoldTags()}static ensureMutationObserver(){if(typeof MutationObserver>"u"||p.mutationObserver)return;const n=new MutationObserver(e=>{if(!p.isProcessingMutation){p.isProcessingMutation=!0;try{e.forEach(t=>{t.addedNodes.forEach(o=>{p.normalizeBoldInNode(o)}),t.type==="characterData"&&t.target&&p.normalizeBoldInNode(t.target)})}finally{p.isProcessingMutation=!1}}});n.observe(document.body,{subtree:!0,childList:!0,characterData:!0}),p.mutationObserver=n}static handleBeforeInput(n){if(n.inputType!=="formatBold")return;const e=window.getSelection(),t=!!(e&&p.isSelectionInsideEditor(e)),o=p.isEventTargetInsideEditor(n.target);!t&&!o||(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),p.normalizeAllBoldTags())}static exitCollapsedBold(n,e){const t=p.ensureStrongElement(e),o=t.parentNode;if(o)return p.isElementEmpty(t)?p.removeEmptyBoldElement(n,t,o):p.exitCollapsedBoldWithContent(n,t,o)}static removeEmptyBoldElement(n,e,t){const o=document.createRange();return o.setStartBefore(e),o.collapse(!0),t.removeChild(e),n.removeAllRanges(),n.addRange(o),o}static exitCollapsedBoldWithContent(n,e,t){var u,h;e.setAttribute(p.DATA_ATTR_COLLAPSED_LENGTH,(((u=e.textContent)==null?void 0:u.length)??0).toString()),e.removeAttribute(p.DATA_ATTR_PREV_LENGTH),e.removeAttribute(p.DATA_ATTR_COLLAPSED_ACTIVE),e.removeAttribute(p.DATA_ATTR_LEADING_WHITESPACE);const o=e.nextSibling,r=!o||o.nodeType!==Node.TEXT_NODE,i=r?document.createTextNode("​"):null;i&&t.insertBefore(i,o);const s=i??o;!r&&(s.textContent??"").length===0&&(s.textContent="​");const a=document.createRange(),c=(s.textContent??"").startsWith("​")?1:0;a.setStart(s,c),a.collapse(!0),n.removeAllRanges(),n.addRange(a);const d=p.ensureStrongElement(e);return p.collapsedExitRecords.add({boundary:s,boldElement:d,allowedLength:((h=d.textContent)==null?void 0:h.length)??0,hasLeadingSpace:!1,hasTypedContent:!1,leadingWhitespace:""}),a}static getBoundaryBold(n){const e=n.startContainer;return e.nodeType===Node.TEXT_NODE?p.getBoundaryBoldForText(n,e):e.nodeType===Node.ELEMENT_NODE?p.getBoundaryBoldForElement(n,e):null}static getBoundaryBoldForText(n,e){var r;const t=((r=e.textContent)==null?void 0:r.length)??0;if(n.startOffset===t)return p.findBoldElement(e);if(n.startOffset!==0)return null;const o=e.previousSibling;return p.isBoldElement(o)?o:null}static getBoundaryBoldForElement(n,e){if(n.startOffset<=0)return null;const t=e.childNodes[n.startOffset-1];return p.isBoldElement(t)?t:null}static handleShortcut(n){if(p.guardCollapsedBoundaryKeydown(n),!p.isBoldShortcut(n))return;const e=window.getSelection();if(!e||!e.rangeCount||!p.isSelectionInsideEditor(e))return;const t=p.instances.values().next().value??new p;t&&(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),t.toggleBold())}static isBoldShortcut(n){return!((typeof navigator<"u"?navigator.userAgent.toLowerCase():"").includes("mac")?n.metaKey:n.ctrlKey)||n.altKey?!1:n.key.toLowerCase()==="b"}static isSelectionInsideEditor(n){const e=n.anchorNode;if(!e)return!1;const t=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;return!!(t!=null&&t.closest(`.${w.CSS.editorWrapper}`))}static isEventTargetInsideEditor(n){var t;if(!n||typeof Node>"u")return!1;if(n instanceof Element)return!!n.closest(`.${w.CSS.editorWrapper}`);if(n instanceof Text)return!!((t=n.parentElement)!=null&&t.closest(`.${w.CSS.editorWrapper}`));if(typeof ShadowRoot<"u"&&n instanceof ShadowRoot)return p.isEventTargetInsideEditor(n.host);if(!(n instanceof Node))return!1;const e=n.parentNode;return e?e instanceof Element?!!e.closest(`.${w.CSS.editorWrapper}`):p.isEventTargetInsideEditor(e):!1}getRangeHtmlWithoutBold(n){const e=n.cloneContents();this.removeNestedBold(e);const t=document.createElement("div");return t.appendChild(e),t.innerHTML}static createFragmentFromHtml(n){const e=document.createElement("template");return e.innerHTML=n,e.content}collectBoldAncestors(n){const e=new Set,t=document.createTreeWalker(n.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode:o=>{try{return n.intersectsNode(o)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}catch{const i=document.createRange();i.selectNodeContents(o);const s=n.compareBoundaryPoints(Range.END_TO_START,i)>0,a=n.compareBoundaryPoints(Range.START_TO_END,i)<0;return s&&a?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}});for(;t.nextNode();){const o=p.findBoldElement(t.currentNode);o&&e.add(o)}return Array.from(e)}};let se=p;se.isInline=!0,se.title="Bold",se.shortcutListenerRegistered=!1,se.selectionListenerRegistered=!1,se.inputListenerRegistered=!1,se.beforeInputListenerRegistered=!1,se.globalListenersInitialized=p.initializeGlobalListeners(),se.collapsedExitRecords=new Set,se.markerSequence=0,se.isProcessingMutation=!1,se.DATA_ATTR_COLLAPSED_LENGTH="data-bold-collapsed-length",se.DATA_ATTR_COLLAPSED_ACTIVE="data-bold-collapsed-active",se.DATA_ATTR_PREV_LENGTH="data-bold-prev-length",se.DATA_ATTR_LEADING_WHITESPACE="data-bold-leading-ws",se.instances=new Set,se.pendingBoundaryCaretAdjustments=new WeakSet;class ai{static get sanitize(){return{i:{},em:{}}}render(){return{icon:WE,name:"italic",onActivate:()=>{this.toggleItalic()},isActive:()=>{const e=window.getSelection();return e?this.isSelectionVisuallyItalic(e):!1}}}get shortcut(){return"CMD+I"}toggleItalic(){const e=window.getSelection();if(!e||e.rangeCount===0)return;const t=e.getRangeAt(0);if(t.collapsed){this.toggleCollapsedItalic(t,e);return}this.isRangeItalic(t,{ignoreWhitespace:!0})?this.unwrapItalicTags(t):this.wrapWithItalic(t)}toggleCollapsedItalic(e,t){if(this.isRangeItalic(e,{ignoreWhitespace:!0})){const r=document.createTextNode("​");e.insertNode(r),e.selectNode(r),this.unwrapItalicTags(e);const i=document.createRange();i.setStart(r,1),i.setEnd(r,1),t.removeAllRanges(),t.addRange(i)}else{const r=document.createElement("i"),i=document.createTextNode("​");r.appendChild(i),e.insertNode(r);const s=document.createRange();s.setStart(i,1),s.setEnd(i,1),t.removeAllRanges(),t.addRange(s)}}isSelectionVisuallyItalic(e){if(!e||e.rangeCount===0)return!1;const t=e.getRangeAt(0);return this.isRangeItalic(t,{ignoreWhitespace:!0})}isRangeItalic(e,t){if(e.collapsed)return!!this.findItalicElement(e.startContainer);const o=document.createTreeWalker(e.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode:i=>{try{return e.intersectsNode(i)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}catch{const a=document.createRange();a.selectNodeContents(i);const l=e.compareBoundaryPoints(Range.END_TO_START,a)>0,c=e.compareBoundaryPoints(Range.START_TO_END,a)<0;return l&&c?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}}),r=[];for(;o.nextNode();){const i=o.currentNode,s=i.textContent??"";t.ignoreWhitespace&&s.trim().length===0||s.length!==0&&r.push(i)}return r.length===0?!!this.findItalicElement(e.startContainer):r.every(i=>this.hasItalicParent(i))}wrapWithItalic(e){const t=this.getRangeHtmlWithoutItalic(e),o=this.replaceRangeWithHtml(e,`<i>${t}</i>`),r=window.getSelection();r&&o&&(r.removeAllRanges(),r.addRange(o))}unwrapItalicTags(e){const t=this.collectItalicAncestors(e),o=window.getSelection();if(!o)return;const r=document.createElement("span"),i=e.extractContents();r.appendChild(i),this.removeNestedItalic(r),e.insertNode(r);const s=document.createRange();for(s.selectNodeContents(r),o.removeAllRanges(),o.addRange(s);;){const d=this.findItalicElement(r);if(!d)break;this.moveMarkerOutOfItalic(r,d)}const a=r.firstChild,l=r.lastChild;this.unwrapElement(r),(a&&l?(()=>{const d=document.createRange();return d.setStartBefore(a),d.setEndAfter(l),o.removeAllRanges(),o.addRange(d),d})():void 0)||o.removeAllRanges(),t.forEach(d=>{(d.textContent??"").length===0&&d.remove()})}hasItalicParent(e){return e?e.nodeType===Node.ELEMENT_NODE&&this.isItalicTag(e)?!0:this.hasItalicParent(e.parentNode):!1}findItalicElement(e){return e?e.nodeType===Node.ELEMENT_NODE&&this.isItalicTag(e)?e:this.findItalicElement(e.parentNode):null}isItalicTag(e){const t=e.tagName;return t==="I"||t==="EM"}collectItalicAncestors(e){const t=new Set,o=document.createTreeWalker(e.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode:r=>{try{return e.intersectsNode(r)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}catch{const s=document.createRange();s.selectNodeContents(r);const a=e.compareBoundaryPoints(Range.END_TO_START,s)>0,l=e.compareBoundaryPoints(Range.START_TO_END,s)<0;return a&&l?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}});for(;o.nextNode();){const r=this.findItalicElement(o.currentNode);r&&t.add(r)}return Array.from(t)}getRangeHtmlWithoutItalic(e){const t=e.cloneContents();this.removeNestedItalic(t);const o=document.createElement("div");return o.appendChild(t),o.innerHTML}removeNestedItalic(e){var o;const t=(o=e.querySelectorAll)==null?void 0:o.call(e,"i,em");t&&t.forEach(r=>{this.unwrapElement(r)})}unwrapElement(e){const t=e.parentNode;if(!t){e.remove();return}for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}replaceRangeWithHtml(e,t){const o=this.createFragmentFromHtml(t),r=o.firstChild??null,i=o.lastChild??null;if(e.deleteContents(),!r||!i)return;e.insertNode(o);const s=document.createRange();return s.setStartBefore(r),s.setEndAfter(i),s}createFragmentFromHtml(e){const t=document.createElement("template");return t.innerHTML=e,t.content}moveMarkerOutOfItalic(e,t){const o=t.parentNode;if(!o)return;if(Array.from(t.childNodes).forEach(l=>{l.nodeType===Node.TEXT_NODE&&(l.textContent??"").length===0&&l.remove()}),t.childNodes.length===1&&t.firstChild===e){t.replaceWith(e);return}if(t.firstChild===e){o.insertBefore(e,t);return}if(t.lastChild===e){o.insertBefore(e,t.nextSibling);return}const a=t.cloneNode(!1);for(;e.nextSibling;)a.appendChild(e.nextSibling);o.insertBefore(a,t.nextSibling),o.insertBefore(e,a)}}ai.isInline=!0,ai.title="Italic";var Jn;const Sw=(Jn=class{constructor({api:n}){this.CSS={button:"ce-inline-tool",buttonActive:"ce-inline-tool--active",buttonModifier:"ce-inline-tool--link",buttonUnlink:"ce-inline-tool--unlink",input:"ce-inline-tool-input",inputShowed:"ce-inline-tool-input--showed"},this.DATA_ATTRIBUTES={buttonActive:"data-link-tool-active",buttonUnlink:"data-link-tool-unlink",inputOpened:"data-link-tool-input-opened"},this.nodes={input:null,button:null},this.inputOpened=!1,this.unlinkAvailable=!1,this.handleButtonClick=e=>{!this.inputOpened||!this.unlinkAvailable||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this.restoreSelection(),this.unlink(),this.inlineToolbar.close())},this.toolbar=n.toolbar,this.inlineToolbar=n.inlineToolbar,this.notifier=n.notifier,this.i18n=n.i18n,this.selection=new w,this.nodes.input=this.createInput()}static get sanitize(){return{a:{href:!0,target:"_blank",rel:"nofollow"}}}render(){return{icon:UE,isActive:()=>!!this.selection.findParentTag("A"),children:{items:[{type:oe.Html,element:this.nodes.input}],onOpen:()=>{this.openActions(!0)},onClose:()=>{this.closeActions()}}}}createInput(){const n=document.createElement("input");return n.placeholder=this.i18n.t("Add a link"),n.enterKeyHint="done",n.classList.add(this.CSS.input),this.setBooleanStateAttribute(n,this.DATA_ATTRIBUTES.inputOpened,!1),n.addEventListener("keydown",e=>{e.key==="Enter"&&this.enterPressed(e)}),n}get shortcut(){return"CMD+K"}openActions(n=!1){if(!this.nodes.input)return;const e=this.selection.findParentTag("A"),t=!!e;if(this.updateButtonStateAttributes(t),this.unlinkAvailable=t,e){const o=e.getAttribute("href");this.nodes.input.value=o!==null?o:""}else this.nodes.input.value="";this.nodes.input.classList.add(this.CSS.inputShowed),this.setBooleanStateAttribute(this.nodes.input,this.DATA_ATTRIBUTES.inputOpened,!0),this.selection.save(),n&&this.focusInputWithRetry(),this.inputOpened=!0}focusInputWithRetry(){this.nodes.input&&(this.nodes.input.focus(),!(typeof window>"u"||typeof document>"u")&&window.setTimeout(()=>{var n;document.activeElement!==this.nodes.input&&((n=this.nodes.input)==null||n.focus())},0))}getButtonElement(){if(this.nodes.button&&document.contains(this.nodes.button))return this.nodes.button;const n=document.querySelector(`${xE} [data-item-name="link"]`);return n&&n.addEventListener("click",this.handleButtonClick,!0),this.nodes.button=n??null,this.nodes.button}updateButtonStateAttributes(n){const e=this.getButtonElement();if(!e)return;const t=typeof n=="boolean"?n:!!this.selection.findParentTag("A");this.setBooleanStateAttribute(e,this.DATA_ATTRIBUTES.buttonActive,t),this.setBooleanStateAttribute(e,this.DATA_ATTRIBUTES.buttonUnlink,t)}closeActions(n=!0){(this.selection.isFakeBackgroundEnabled||n&&this.selection.savedSelectionRange)&&this.restoreSelection(),this.nodes.input&&(this.nodes.input.classList.remove(this.CSS.inputShowed),this.setBooleanStateAttribute(this.nodes.input,this.DATA_ATTRIBUTES.inputOpened,!1),this.nodes.input.value="",this.updateButtonStateAttributes(!1),this.unlinkAvailable=!1,n&&this.selection.clearSaved(),this.inputOpened=!1)}restoreSelection(){const n=new w,e=w.isAtEditor;if(e&&n.save(),this.selection.removeFakeBackground(),this.selection.restore(),!e&&this.selection.savedSelectionRange){const r=this.selection.savedSelectionRange.commonAncestorContainer,i=r.nodeType===Node.ELEMENT_NODE?r:r.parentElement;i==null||i.focus()}if(!e)return;n.restore();const t=n.savedSelectionRange;if(t){const o=t.commonAncestorContainer,r=o.nodeType===Node.ELEMENT_NODE?o:o.parentElement;r==null||r.focus()}}enterPressed(n){if(!this.nodes.input)return;const e=this.nodes.input.value||"";if(!e.trim()){this.selection.restore(),this.unlink(),n.preventDefault(),this.closeActions(),this.inlineToolbar.close();return}if(!this.validateURL(e)){this.notifier.show({message:"Pasted link is not valid.",style:"error"}),$("Incorrect Link pasted","warn",e);return}const t=this.prepareLink(e);this.selection.removeFakeBackground(),this.selection.restore(),this.insertLink(t),n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),this.selection.collapseToEnd(),this.inlineToolbar.close()}validateURL(n){return!/\s/.test(n)}prepareLink(n){return this.addProtocol(n.trim())}addProtocol(n){if(/^(\w+):(\/\/)?/.test(n))return n;const e=/^\/[^/\s]/.test(n),t=n.substring(0,1)==="#",o=/^\/\/[^/\s]/.test(n);return!e&&!t&&!o?"http://"+n:n}insertLink(n){const e=this.selection.findParentTag("A");if(e){this.selection.expandToTag(e),e.href=n,e.target="_blank",e.rel="nofollow";return}const t=w.range;if(!t)return;const o=document.createElement("a");o.href=n,o.target="_blank",o.rel="nofollow",o.appendChild(t.extractContents()),t.insertNode(o),this.selection.expandToTag(o)}unlink(){const n=this.selection.findParentTag("A");n&&(this.unwrap(n),this.updateButtonStateAttributes(!1),this.unlinkAvailable=!1)}unwrap(n){var t;const e=document.createDocumentFragment();for(;n.firstChild;)e.appendChild(n.firstChild);(t=n.parentNode)==null||t.replaceChild(e,n)}setBooleanStateAttribute(n,e,t){n&&n.setAttribute(e,t?"true":"false")}},Jn.isInline=!0,Jn.title="Link",Jn);class vl{constructor({api:e}){this.i18nAPI=e.i18n,this.blocksAPI=e.blocks,this.selectionAPI=e.selection,this.toolsAPI=e.tools,this.caretAPI=e.caret}async render(){const e=w.get();if(e===null)return[];const t=this.blocksAPI.getBlockByElement(e.anchorNode);if(t===void 0)return[];const o=this.toolsAPI.getBlockTools(),r=await Us(t,o);if(r.length===0)return[];const i=r.reduce((c,d)=>{var u;return(u=d.toolbox)==null||u.forEach(h=>{h.title!==void 0&&c.push({icon:h.icon,title:ne.t(ae.toolNames,h.title),name:d.name,closeOnActivate:!0,onActivate:async()=>{const g=await this.blocksAPI.convert(t.id,d.name,h.data);this.caretAPI.setToBlock(g,"end")}})}),c},[]),s=await t.getActiveToolboxEntry(),a=s!==void 0?s.icon:Js,l=!ut();return{icon:a,name:"convert-to",hint:{title:ne.ui(ae.ui.inlineToolbar.converter,"Convert to")},children:{searchable:l,items:i,onOpen:()=>{l&&(this.selectionAPI.setFakeBackground(),this.selectionAPI.save())},onClose:()=>{l&&(this.selectionAPI.restore(),this.selectionAPI.removeFakeBackground())}}}}}vl.isInline=!0;class bl{constructor({data:e,api:t}){this.CSS={wrapper:"ce-stub",info:"ce-stub__info",title:"ce-stub__title",subtitle:"ce-stub__subtitle"},this.api=t,this.title=e.title||this.api.i18n.t("Error"),this.subtitle=this.api.i18n.t("The block can not be displayed correctly."),this.savedData=e.savedData,this.wrapper=this.make()}render(){return this.wrapper}save(){return this.savedData}make(){const e=v.make("div",this.CSS.wrapper),t=XE,o=v.make("div",this.CSS.info),r=v.make("div",this.CSS.title,{textContent:this.title}),i=v.make("div",this.CSS.subtitle,{textContent:this.subtitle});return e.innerHTML=t,o.appendChild(r),o.appendChild(i),e.appendChild(o),e}}bl.isReadOnlySupported=!0;class xw extends Zo{constructor(){super(...arguments),this.type=Ze.Inline}getMissingMethods(e){const t=this.constructable,o=t==null?void 0:t.prototype;return o?e.filter(r=>typeof o[r]!="function"):[...e]}create(){const e=this.constructable;return new e({api:this.api,config:this.settings})}get isReadOnlySupported(){const e=this.constructable;return(e==null?void 0:e.isReadOnlySupported)??!1}get title(){return this.constructable.title||""}}class Bw extends Zo{constructor(){super(...arguments),this.type=Ze.Tune}create(e,t){const o=this.constructable;return new o({api:this.api,config:this.settings,block:t,data:e})}}class ce extends Map{get blockTools(){const e=Array.from(this.entries()).filter(([,t])=>t.isBlock());return new ce(e)}get inlineTools(){const e=Array.from(this.entries()).filter(([,t])=>t.isInline());return new ce(e)}get blockTunes(){const e=Array.from(this.entries()).filter(([,t])=>t.isTune());return new ce(e)}get internalTools(){const e=Array.from(this.entries()).filter(([,t])=>t.isInternal);return new ce(e)}get externalTools(){const e=Array.from(this.entries()).filter(([,t])=>!t.isInternal);return new ce(e)}}class _w extends Zo{constructor(){super(...arguments),this.type=Ze.Block,this.inlineTools=new ce,this.tunes=new ce}create(e,t,o){return new this.constructable({data:e,block:t,readOnly:o,api:this.api,config:this.settings})}get isReadOnlySupported(){return this.constructable[yt.IsReadOnlySupported]===!0}get isLineBreaksEnabled(){return this.constructable[yt.IsEnabledLineBreaks]??!1}get toolbox(){const e=this.constructable[yt.Toolbox],t=this.config[Tn.Toolbox];if(!(!e||Q(e))&&t!==!1)return t==null?Array.isArray(e)?e:[e]:!Array.isArray(t)&&Array.isArray(e)?[t]:Array.isArray(t)?Array.isArray(e)?t.map((o,r)=>{const i=e[r];return i?{...i,...o}:o}):t:[{...e,...t}]}get conversionConfig(){return this.constructable[yt.ConversionConfig]}get enabledInlineTools(){return this.config[Tn.EnabledInlineTools]||!1}get enabledBlockTunes(){return this.config[Tn.EnabledBlockTunes]}get pasteConfig(){return this.constructable[yt.PasteConfig]??{}}get sanitizeConfig(){if(this._sanitizeConfig)return this._sanitizeConfig;const e=super.sanitizeConfig,t=this.baseSanitizeConfig;if(Q(e))return this._sanitizeConfig=t,t;const o={};for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;const i=e[r];W(i)?o[r]=Object.assign({},t,i):o[r]=i}return this._sanitizeConfig=o,o}get baseSanitizeConfig(){if(this._baseSanitizeConfig)return this._baseSanitizeConfig;const e={};return Array.from(this.inlineTools.values()).forEach(t=>Object.assign(e,t.sanitizeConfig)),Array.from(this.tunes.values()).forEach(t=>Object.assign(e,t.sanitizeConfig)),this._baseSanitizeConfig=e,e}}class Aw{constructor(e,t,o){this.api=o,this.config=e,this.editorConfig=t}get(e){const{class:t,isInternal:o=!1,...r}=this.config[e],i=t;if(i===void 0)throw new Error(`Tool "${e}" does not provide a class.`);const s=this.getConstructor(i),a=!!Reflect.get(i,qo.IsTune);return new s({name:e,constructable:i,config:r,api:this.api.getMethodsForTool(e,a),isDefault:e===this.editorConfig.defaultBlock,defaultPlaceholder:this.editorConfig.placeholder,isInternal:o})}getConstructor(e){switch(!0){case!!Reflect.get(e,aa.IsInline):return xw;case!!Reflect.get(e,qo.IsTune):return Bw;default:return _w}}}class yl{constructor({api:e}){this.api=e}render(){return{icon:jE,title:this.api.i18n.t("Delete"),name:"delete",confirmation:{title:this.api.i18n.t("Click to delete"),onActivate:()=>this.handleClick()}}}handleClick(){this.api.blocks.delete()}}yl.isTune=!0;const ot=n=>{if(!j(n))throw new Error("Tool constructable must be a function");return n};class Iw extends F{constructor(){super(...arguments),this.stubTool="stub",this.factory=null,this.toolsAvailable=new ce,this.toolsUnavailable=new ce,this.inlineToolsSanitizeConfigCache=null}get available(){return this.toolsAvailable}get unavailable(){return this.toolsUnavailable}get inlineTools(){return this.available.inlineTools}get blockTools(){return this.available.blockTools}get blockTunes(){return this.available.blockTunes}get defaultTool(){const e=this.config.defaultBlock;if(!e)throw new Error("Default block tool name is not configured");const t=this.blockTools.get(e);if(!t)throw new Error(`Default block tool "${e}" not found in available block tools`);return t}get internal(){return this.available.internalTools}async prepare(){const e=this.config.tools??{};this.config.tools=It({},this.internalTools,e),this.validateTools();const t=this.config.tools;if(!t||Object.keys(t).length===0)throw Error("Can't start without tools");const o=this.prepareConfig(t);this.factory=new Aw(o,this.config,this.Editor.API);const r=this.getListOfPrepareFunctions(o);if(r.length===0)return Promise.resolve();const i=l=>{this.isToolPrepareData(l)&&this.toolPrepareMethodSuccess({toolName:l.toolName})},s=l=>{this.isToolPrepareData(l)&&this.toolPrepareMethodFallback({toolName:l.toolName})},a=new ul;r.forEach(l=>{a.add(async()=>{const c=Ny(l.data)?{}:l.data;try{await l.function(l.data),i(c)}catch{s(c)}})}),await a.completed,this.prepareBlockTools()}getAllInlineToolsSanitizeConfig(){if(this.inlineToolsSanitizeConfigCache)return this.inlineToolsSanitizeConfigCache;const e={};return Array.from(this.inlineTools.values()).forEach(t=>{Object.assign(e,t.sanitizeConfig)}),this.inlineToolsSanitizeConfigCache=e,e}destroy(){for(const e of this.available.values()){const t=(()=>{try{return e.reset()}catch(o){$(`Tool "${e.name}" reset failed`,"warn",o);return}})();t instanceof Promise&&t.catch(o=>{$(`Tool "${e.name}" reset failed`,"warn",o)})}}get internalTools(){return{convertTo:{class:ot(vl),isInternal:!0},link:{class:ot(Sw),isInternal:!0},bold:{class:ot(se),isInternal:!0},italic:{class:ot(ai),isInternal:!0},paragraph:{class:ot(si),inlineToolbar:!0,config:{preserveBlank:!0},isInternal:!0},stub:{class:ot(bl),isInternal:!0},delete:{class:ot(yl),isInternal:!0}}}toolPrepareMethodSuccess(e){const t=this.getFactory().get(e.toolName);if(!t.isInline()){this.toolsAvailable.set(t.name,t);return}const o=["render"],r=t.getMissingMethods(o);if(r.length){$(`Incorrect Inline Tool: ${t.name}. Some of required methods is not implemented %o`,"warn",r),this.toolsUnavailable.set(t.name,t);return}this.toolsAvailable.set(t.name,t)}toolPrepareMethodFallback(e){const t=this.getFactory();this.toolsUnavailable.set(e.toolName,t.get(e.toolName))}getListOfPrepareFunctions(e){return Object.entries(e).map(([t,o])=>{const r={toolName:t,config:o.config??{}};return{function:async s=>{const a=o.class;if(!a||!j(a.prepare))return;const l=s??r;return a.prepare.call(a,l)},data:r}})}prepareBlockTools(){Array.from(this.blockTools.values()).forEach(e=>{this.assignInlineToolsToBlockTool(e),this.assignBlockTunesToBlockTool(e)})}assignInlineToolsToBlockTool(e){const t=e;if(this.config.inlineToolbar!==!1){if(t.enabledInlineTools===!0){const o=Array.isArray(this.config.inlineToolbar)?this.createInlineToolsCollection(this.config.inlineToolbar):new ce(Array.from(this.inlineTools.entries()));t.inlineTools=o;return}if(Array.isArray(t.enabledInlineTools)){const o=this.createInlineToolsCollection(["convertTo",...t.enabledInlineTools]);t.inlineTools=o}}}assignBlockTunesToBlockTool(e){const t=e;if(t.enabledBlockTunes!==!1){if(Array.isArray(t.enabledBlockTunes)){const o=this.createBlockTunesCollection(t.enabledBlockTunes),r=[...Array.from(o.entries()),...Array.from(this.blockTunes.internalTools.entries())];t.tunes=new ce(r);return}if(Array.isArray(this.config.tunes)){const o=this.createBlockTunesCollection(this.config.tunes),r=[...Array.from(o.entries()),...Array.from(this.blockTunes.internalTools.entries())];t.tunes=new ce(r);return}t.tunes=new ce(Array.from(this.blockTunes.internalTools.entries()))}}validateTools(){const e=this.config.tools;if(!e)return;const t=this.internalTools;for(const o in e){if(!Object.prototype.hasOwnProperty.call(e,o)||o in t)continue;const r=e[o],i=j(r),a=j(r.class);if(!i&&!a)throw new Ot(`Tool «${o}» must be a constructor function or an object with function in the «class» property`)}}prepareConfig(e){const t={};for(const o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;const r=e[o];if(W(r)){t[o]=r;continue}t[o]={class:r}}return t}isToolPrepareData(e){const t=e;return typeof(t==null?void 0:t.toolName)=="string"}getFactory(){if(this.factory===null)throw new Error("Tools factory is not initialized");return this.factory}createInlineToolsCollection(e){const t=[];for(const o of e){const r=this.inlineTools.get(o);if(!r){$(`Inline tool "${o}" is not available and will be skipped`,"warn");continue}t.push([o,r])}return new ce(t)}createBlockTunesCollection(e){const t=[];for(const o of e){const r=this.blockTunes.get(o);if(!r){$(`Block tune "${o}" is not available and will be skipped`,"warn");continue}t.push([o,r])}return new ce(t)}}const Ow=`:root{--selectionColor: #e1f2ff;--inlineSelectionColor: #d4ecff;--bg-light: #eff2f5;--grayText: #707684;--color-dark: #1d202b;--color-active-icon: #388ae5;--content-width: 650px;--narrow-mode-right-padding: 50px;--toolbox-buttons-size: 26px;--toolbox-buttons-size--mobile: 36px;--icon-size: 20px;--icon-size--mobile: 28px;--block-padding-vertical: .4em;--color-line-gray: #eff0f1 }.codex-editor{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;z-index:1}.codex-editor .hide{display:none}.codex-editor__redactor [contenteditable]:empty:after{content:"\\feff"}@media (min-width: 651px){.codex-editor--narrow .codex-editor__redactor{margin-right:50px}}@media (min-width: 651px){.codex-editor--narrow.codex-editor--rtl .codex-editor__redactor{margin-left:50px;margin-right:0}}@media (min-width: 651px){.codex-editor--narrow .ce-toolbar__actions{right:-5px}}.codex-editor-copyable{position:absolute;height:1px;width:1px;top:-400%;opacity:.001}.codex-editor-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:999;pointer-events:none;overflow:hidden}.codex-editor-overlay__container{position:relative;pointer-events:auto;z-index:0}.codex-editor-overlay__rectangle{position:absolute;pointer-events:none;background-color:#2eaadc33;border:1px solid transparent}.codex-editor svg{max-height:100%}.codex-editor path{stroke:currentColor}.codex-editor ::-moz-selection{background-color:#d4ecff}.codex-editor ::selection{background-color:#d4ecff}.codex-editor--dragging,.codex-editor--dragging .ce-toolbar__settings-btn{cursor:-webkit-grabbing;cursor:grabbing}.codex-editor--dragging .ce-toolbar{pointer-events:none}.codex-editor--toolbox-opened [contentEditable=true][data-placeholder]:focus:before{opacity:0!important}.ce-scroll-locked{overflow:hidden}.ce-scroll-locked--hard{overflow:hidden;top:calc(-1 * var(--window-scroll-offset));position:fixed;width:100%}.ce-toolbar{position:absolute;left:0;right:0;top:0;-webkit-transition:opacity .1s ease;transition:opacity .1s ease;will-change:opacity,top;display:none}.ce-toolbar--opened{display:block}.ce-toolbar__content{max-width:650px;margin:0 auto;position:relative}.ce-toolbar__plus{color:#1d202b;cursor:pointer;width:26px;height:26px;border-radius:7px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-flex-negative:0;flex-shrink:0}@media (max-width: 650px){.ce-toolbar__plus{width:36px;height:36px}}@media (hover: hover){.ce-toolbar__plus:hover{background-color:#eff2f5}}.ce-toolbar__plus--active{background-color:#eff2f5;-webkit-animation:bounceIn .75s 1;animation:bounceIn .75s 1;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.ce-toolbar__plus-shortcut{opacity:.6;word-spacing:-2px;margin-top:5px}@media (max-width: 650px){.ce-toolbar__plus{position:absolute;background-color:#fff;border:1px solid #e8e8eb;-webkit-box-shadow:0 3px 15px -3px rgba(13,20,33,.13);box-shadow:0 3px 15px -3px #0d142121;border-radius:6px;z-index:2;position:static}.ce-toolbar__plus--left-oriented:before{left:15px;margin-left:0}.ce-toolbar__plus--right-oriented:before{left:auto;right:15px;margin-left:0}}.ce-toolbar__actions{position:absolute;right:100%;opacity:0;display:-webkit-box;display:-ms-flexbox;display:flex;padding-right:5px}.ce-toolbar__actions--opened{opacity:1}@media (max-width: 650px){.ce-toolbar__actions{right:auto}}.ce-toolbar__settings-btn{color:#1d202b;width:26px;height:26px;border-radius:7px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;margin-left:3px;cursor:pointer;user-select:none}@media (max-width: 650px){.ce-toolbar__settings-btn{width:36px;height:36px}}@media (hover: hover){.ce-toolbar__settings-btn:hover{background-color:#eff2f5}}.ce-toolbar__settings-btn--active{background-color:#eff2f5;-webkit-animation:bounceIn .75s 1;animation:bounceIn .75s 1;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@media (hover: hover){.ce-toolbar__settings-btn:hover{cursor:-webkit-grab;cursor:grab}}.ce-toolbar__settings-btn:active{cursor:-webkit-grabbing;cursor:grabbing}@media (hover: hover){.ce-toolbar__settings-btn--opened:hover{cursor:pointer}}@media (min-width: 651px){.ce-toolbar__settings-btn{width:24px}}.ce-toolbar__settings-btn--hidden{display:none}@media (max-width: 650px){.ce-toolbar__settings-btn{position:absolute;background-color:#fff;border:1px solid #e8e8eb;-webkit-box-shadow:0 3px 15px -3px rgba(13,20,33,.13);box-shadow:0 3px 15px -3px #0d142121;border-radius:6px;z-index:2;position:static}.ce-toolbar__settings-btn--left-oriented:before{left:15px;margin-left:0}.ce-toolbar__settings-btn--right-oriented:before{left:auto;right:15px;margin-left:0}}.ce-toolbar__plus svg,.ce-toolbar__settings-btn svg{width:24px;height:24px}@media (min-width: 651px){.codex-editor--narrow .ce-toolbar__plus{left:5px}}@media (hover: hover){.codex-editor--toolbox-opened .ce-toolbar__settings-btn:hover{cursor:pointer}}@media (min-width: 651px){.codex-editor--narrow .ce-toolbox .ce-popover{right:0;left:auto;left:initial}}.ce-inline-toolbar{--y-offset: 8px;--color-background-icon-active: rgba(56, 138, 229, .1);--color-text-icon-active: #388ae5;--color-text-primary: black;position:absolute;-webkit-transition:opacity .25s ease;transition:opacity .25s ease;will-change:opacity,left,top;top:0;left:0;z-index:3;opacity:1;visibility:visible}.ce-inline-toolbar [hidden]{display:none!important}.ce-inline-toolbar__toggler-and-button-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;padding:0 6px}.ce-inline-toolbar__buttons{display:-webkit-box;display:-ms-flexbox;display:flex}.ce-inline-toolbar__dropdown{display:-webkit-box;display:-ms-flexbox;display:flex;padding:6px;margin:0 6px 0 -6px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;border-right:1px solid #eff0f1;-webkit-box-sizing:border-box;box-sizing:border-box}@media (hover: hover){.ce-inline-toolbar__dropdown:hover{background:#eff2f5}}.ce-inline-toolbar__dropdown--hidden{display:none}.ce-inline-toolbar__dropdown-content,.ce-inline-toolbar__dropdown-arrow{display:-webkit-box;display:-ms-flexbox;display:flex}.ce-inline-toolbar__dropdown-content svg,.ce-inline-toolbar__dropdown-arrow svg{width:20px;height:20px}.ce-inline-toolbar__shortcut{opacity:.6;word-spacing:-3px;margin-top:3px}.ce-inline-tool{color:var(--color-text-primary);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:0;border-radius:4px;line-height:normal;height:100%;padding:0;width:28px;background-color:transparent;cursor:pointer}@media (max-width: 650px){.ce-inline-tool{width:36px;height:36px}}@media (hover: hover){.ce-inline-tool:hover{background-color:#f8f8f8}}.ce-inline-tool svg{display:block;width:20px;height:20px}@media (max-width: 650px){.ce-inline-tool svg{width:28px;height:28px}}.ce-inline-tool--link .icon--unlink,.ce-inline-tool--unlink .icon--link{display:none}.ce-inline-tool--unlink .icon--unlink{display:inline-block;margin-bottom:-1px}.ce-inline-tool-input{background:#f8f8f8;border:1px solid rgba(226,226,229,.2);border-radius:6px;padding:4px 8px;font-size:14px;line-height:22px;outline:none;margin:0;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;display:none;font-weight:500;-webkit-appearance:none;font-family:inherit}@media (max-width: 650px){.ce-inline-tool-input{font-size:15px;font-weight:500}}.ce-inline-tool-input::-webkit-input-placeholder{color:#707684}.ce-inline-tool-input::-moz-placeholder{color:#707684}.ce-inline-tool-input:-ms-input-placeholder{color:#707684}.ce-inline-tool-input::-ms-input-placeholder{color:#707684}.ce-inline-tool-input::placeholder{color:#707684}.ce-inline-tool-input--showed{display:block}.ce-inline-tool--active{background:var(--color-background-icon-active);color:var(--color-text-icon-active)}@-webkit-keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.ce-block{position:relative;-webkit-animation:fade-in .3s ease;animation:fade-in .3s ease;-webkit-animation-fill-mode:none;animation-fill-mode:none;-webkit-animation-fill-mode:initial;animation-fill-mode:initial}.ce-block:first-of-type{margin-top:0}.ce-block--selected .ce-block__content{background:#e1f2ff}.ce-block--selected .ce-block__content [contenteditable]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ce-block--selected .ce-block__content img,.ce-block--selected .ce-block__content .ce-stub{opacity:.55}.ce-block--stretched .ce-block__content{max-width:none}.ce-block__content{position:relative;max-width:650px;margin:0 auto;-webkit-transition:background-color .15s ease;transition:background-color .15s ease}.ce-block a{cursor:pointer;-webkit-text-decoration:underline;text-decoration:underline}.ce-block b{font-weight:700}.ce-block i{font-style:italic}@-webkit-keyframes bounceIn{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}20%{-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03)}60%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@keyframes bounceIn{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}20%{-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03)}60%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@-webkit-keyframes selectionBounce{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}50%{-webkit-transform:scale3d(1.01,1.01,1.01);transform:scale3d(1.01,1.01,1.01)}70%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@keyframes selectionBounce{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}50%{-webkit-transform:scale3d(1.01,1.01,1.01);transform:scale3d(1.01,1.01,1.01)}70%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@-webkit-keyframes buttonClicked{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:scale3d(.95,.95,.95);transform:scale3d(.95,.95,.95)}60%{-webkit-transform:scale3d(1.02,1.02,1.02);transform:scale3d(1.02,1.02,1.02)}80%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@keyframes buttonClicked{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:scale3d(.95,.95,.95);transform:scale3d(.95,.95,.95)}60%{-webkit-transform:scale3d(1.02,1.02,1.02);transform:scale3d(1.02,1.02,1.02)}80%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}.cdx-block{padding:.4em 0}.cdx-block::-webkit-input-placeholder{line-height:normal!important}.cdx-input{border:1px solid #eff0f1;-webkit-box-shadow:inset 0 1px 2px 0 rgba(35,44,72,.06);box-shadow:inset 0 1px 2px #232c480f;border-radius:3px;padding:10px 12px;outline:none;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.cdx-input[data-placeholder]:before{position:static!important}.cdx-input[data-placeholder]:before{display:inline-block;width:0;white-space:nowrap;pointer-events:none}.cdx-settings-button{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border-radius:3px;cursor:pointer;border:0;outline:none;background-color:transparent;vertical-align:bottom;color:inherit;margin:0;min-width:26px;min-height:26px}.cdx-settings-button--focused{background:rgba(34,186,255,.08)!important}.cdx-settings-button--focused{-webkit-box-shadow:inset 0 0 0 1px rgba(7,161,227,.08);box-shadow:inset 0 0 0 1px #07a1e314}.cdx-settings-button--focused-animated{-webkit-animation-name:buttonClicked;animation-name:buttonClicked;-webkit-animation-duration:.25s;animation-duration:.25s}.cdx-settings-button--active{color:#388ae5}.cdx-settings-button svg{width:auto;height:auto}@media (max-width: 650px){.cdx-settings-button svg{width:28px;height:28px}}@media (max-width: 650px){.cdx-settings-button{width:36px;height:36px;border-radius:8px}}@media (hover: hover){.cdx-settings-button:hover{background-color:#eff2f5}}.cdx-loader{position:relative;border:1px solid #eff0f1}.cdx-loader:before{content:"";position:absolute;left:50%;top:50%;width:18px;height:18px;margin:-11px 0 0 -11px;border:2px solid #eff0f1;border-left-color:#388ae5;border-radius:50%;-webkit-animation:cdxRotation 1.2s infinite linear;animation:cdxRotation 1.2s infinite linear}@-webkit-keyframes cdxRotation{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes cdxRotation{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.cdx-button{padding:13px;border-radius:3px;border:1px solid #eff0f1;font-size:14.9px;background:#fff;-webkit-box-shadow:0 2px 2px 0 rgba(18,30,57,.04);box-shadow:0 2px 2px #121e390a;color:#707684;text-align:center;cursor:pointer}@media (hover: hover){.cdx-button:hover{background:#fbfcfe;-webkit-box-shadow:0 1px 3px 0 rgba(18,30,57,.08);box-shadow:0 1px 3px #121e3914}}.cdx-button svg{height:20px;margin-right:.2em;margin-top:-2px}.ce-stub{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:12px 18px;margin:10px 0;border-radius:10px;background:#eff2f5;border:1px solid #eff0f1;color:#707684;font-size:14px}.ce-stub svg{width:20px;height:20px}.ce-stub__info{margin-left:14px}.ce-stub__title{font-weight:500;text-transform:capitalize}.codex-editor.codex-editor--rtl{direction:rtl}.codex-editor.codex-editor--rtl .cdx-list{padding-left:0;padding-right:40px}.codex-editor.codex-editor--rtl .ce-toolbar__plus{right:-26px;left:auto}.codex-editor.codex-editor--rtl .ce-toolbar__actions{right:auto;left:-26px}@media (max-width: 650px){.codex-editor.codex-editor--rtl .ce-toolbar__actions{margin-left:0;margin-right:auto;padding-right:0;padding-left:10px}}.codex-editor.codex-editor--rtl .ce-settings{left:5px;right:auto}.codex-editor.codex-editor--rtl .ce-settings:before{right:auto;left:25px}.codex-editor.codex-editor--rtl .ce-settings__button:not(:nth-child(3n+3)){margin-left:3px;margin-right:0}.codex-editor.codex-editor--rtl .ce-conversion-tool__icon{margin-right:0;margin-left:10px}.codex-editor.codex-editor--rtl .ce-inline-toolbar__dropdown{border-right:0 solid transparent;border-left:1px solid #eff0f1;margin:0 -6px 0 6px}.codex-editor.codex-editor--rtl .ce-inline-toolbar__dropdown .icon--toggler-down{margin-left:0;margin-right:4px}@media (min-width: 651px){.codex-editor--narrow.codex-editor--rtl .ce-toolbar__plus{left:0;right:5px}}@media (min-width: 651px){.codex-editor--narrow.codex-editor--rtl .ce-toolbar__actions{left:-5px}}.cdx-search-field{--icon-margin-right: 10px;background:#F8F8F8;border:1px solid rgba(226,226,229,.2);border-radius:6px;padding:2px;display:grid;grid-template-columns:auto auto 1fr;grid-template-rows:auto}.cdx-search-field__icon{width:26px;height:26px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-right:var(--icon-margin-right)}.cdx-search-field__icon svg{width:20px;height:20px;color:#707684}.cdx-search-field__input{font-size:14px;outline:none;font-weight:500;font-family:inherit;border:0;background:transparent;margin:0;padding:0;line-height:22px;min-width:calc(100% - 26px - var(--icon-margin-right))}.cdx-search-field__input::-webkit-input-placeholder{color:#707684;font-weight:500}.cdx-search-field__input::-moz-placeholder{color:#707684;font-weight:500}.cdx-search-field__input:-ms-input-placeholder{color:#707684;font-weight:500}.cdx-search-field__input::-ms-input-placeholder{color:#707684;font-weight:500}.cdx-search-field__input::placeholder{color:#707684;font-weight:500}.ce-popover{--border-radius: 6px;--width: 200px;--max-height: 270px;--padding: 6px;--offset-from-target: 8px;--color-border: #eff0f1;--color-shadow: rgba(13, 20, 33, .1);--color-background: white;--color-text-primary: black;--color-text-secondary: #707684;--color-border-icon: rgba(201, 201, 204, .48);--color-border-icon-disabled: #eff0f1;--color-text-icon-active: #388ae5;--color-background-icon-active: rgba(56, 138, 229, .1);--color-background-item-focus: rgba(34, 186, 255, .08);--color-shadow-item-focus: rgba(7, 161, 227, .08);--color-background-item-hover: #f8f8f8;--color-background-item-confirm: #e24a4a;--color-background-item-confirm-hover: #ce4343;--popover-top: calc(100% + var(--offset-from-target));--popover-left: 0;--nested-popover-overlap: 4px;--icon-size: 20px;--item-padding: 3px;--item-height: calc(var(--icon-size) + 2 * var(--item-padding))}.ce-popover__container{min-width:var(--width);width:var(--width);border-radius:var(--border-radius);overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 3px 15px -3px var(--color-shadow);box-shadow:0 3px 15px -3px var(--color-shadow);position:absolute;left:var(--popover-left);top:var(--popover-top);background:var(--color-background);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;z-index:4;opacity:0;max-height:0;pointer-events:none;padding:0;border:none}.ce-popover--opened>.ce-popover__container{opacity:1;padding:var(--padding);max-height:var(--max-height);pointer-events:auto;-webkit-animation:panelShowing .1s ease;animation:panelShowing .1s ease;border:1px solid var(--color-border)}@media (max-width: 650px){.ce-popover--opened>.ce-popover__container{-webkit-animation:panelShowingMobile .25s ease;animation:panelShowingMobile .25s ease}}.ce-popover--open-top .ce-popover__container{--popover-top: calc(-1 * (var(--offset-from-target) + var(--popover-height)))}.ce-popover--open-left .ce-popover__container{--popover-left: calc(-1 * var(--width) + 100%)}.ce-popover__items{overflow-y:auto;-ms-scroll-chaining:none;overscroll-behavior:contain}@media (max-width: 650px){.ce-popover__overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#1d202b;z-index:3;opacity:.5;-webkit-transition:opacity .12s ease-in;transition:opacity .12s ease-in;will-change:opacity;visibility:visible}}.ce-popover__overlay--hidden{display:none}@media (max-width: 650px){.ce-popover .ce-popover__container{--offset: 5px;position:fixed;max-width:none;min-width:calc(100% - var(--offset) * 2);top:auto;right:var(--offset);bottom:calc(var(--offset) + env(safe-area-inset-bottom));left:var(--offset);border-radius:10px}}.ce-popover__search{margin-bottom:5px}.ce-popover__nothing-found-message{color:#707684;display:none;cursor:default;padding:3px;font-size:14px;line-height:20px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ce-popover__nothing-found-message--displayed{display:block}.ce-popover--nested .ce-popover__container{--popover-left: calc(var(--nesting-level) * (var(--width) - var(--nested-popover-overlap)));top:calc(var(--trigger-item-top) - var(--nested-popover-overlap));position:absolute}.ce-popover--open-top.ce-popover--nested .ce-popover__container{top:calc(var(--trigger-item-top) - var(--popover-height) + var(--item-height) + var(--offset-from-target) + var(--nested-popover-overlap))}.ce-popover--open-left .ce-popover--nested .ce-popover__container{--popover-left: calc(-1 * (var(--nesting-level) + 1) * var(--width) + 100%)}.ce-popover-item-separator{padding:4px 3px}.ce-popover-item-separator--hidden{display:none}.ce-popover-item-separator__line{height:1px;background:var(--color-border);width:100%}.ce-popover-item-html--hidden{display:none}.ce-popover-item{--border-radius: 6px;border-radius:var(--border-radius);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:var(--item-padding);color:var(--color-text-primary);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:none;background:transparent}@media (max-width: 650px){.ce-popover-item{padding:4px}}.ce-popover-item:not(:last-of-type){margin-bottom:1px}.ce-popover-item__icon{width:26px;height:26px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.ce-popover-item__icon svg{width:20px;height:20px}@media (max-width: 650px){.ce-popover-item__icon{width:36px;height:36px;border-radius:8px}.ce-popover-item__icon svg{width:28px;height:28px}}.ce-popover-item__icon--tool{margin-right:4px}.ce-popover-item__title{font-size:14px;line-height:20px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-right:auto}@media (max-width: 650px){.ce-popover-item__title{font-size:16px}}.ce-popover-item__secondary-title{color:var(--color-text-secondary);font-size:12px;white-space:nowrap;letter-spacing:-.1em;padding-right:5px;opacity:.6}@media (max-width: 650px){.ce-popover-item__secondary-title{display:none}}.ce-popover-item--active{background:var(--color-background-icon-active);color:var(--color-text-icon-active)}.ce-popover-item--disabled{color:var(--color-text-secondary);cursor:default;pointer-events:none}.ce-popover-item--focused:not(.ce-popover-item--no-focus){background:var(--color-background-item-focus)!important}.ce-popover-item--hidden{display:none}@media (hover: hover){.ce-popover-item:hover{cursor:pointer}.ce-popover-item:hover:not(.ce-popover-item--no-hover){background-color:var(--color-background-item-hover)}}.ce-popover-item--confirmation{background:var(--color-background-item-confirm)}.ce-popover-item--confirmation .ce-popover-item__title,.ce-popover-item--confirmation .ce-popover-item__icon{color:#fff}@media (hover: hover){.ce-popover-item--confirmation:not(.ce-popover-item--no-hover):hover{background:var(--color-background-item-confirm-hover)}}.ce-popover-item--confirmation:not(.ce-popover-item--no-focus).ce-popover-item--focused{background:var(--color-background-item-confirm-hover)!important}@-webkit-keyframes panelShowing{0%{opacity:0;-webkit-transform:translateY(-8px) scale(.9);transform:translateY(-8px) scale(.9)}70%{opacity:1;-webkit-transform:translateY(2px);transform:translateY(2px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes panelShowing{0%{opacity:0;-webkit-transform:translateY(-8px) scale(.9);transform:translateY(-8px) scale(.9)}70%{opacity:1;-webkit-transform:translateY(2px);transform:translateY(2px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes panelShowingMobile{0%{opacity:0;-webkit-transform:translateY(14px) scale(.98);transform:translateY(14px) scale(.98)}70%{opacity:1;-webkit-transform:translateY(-4px);transform:translateY(-4px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes panelShowingMobile{0%{opacity:0;-webkit-transform:translateY(14px) scale(.98);transform:translateY(14px) scale(.98)}70%{opacity:1;-webkit-transform:translateY(-4px);transform:translateY(-4px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}.wobble{-webkit-animation-name:wobble;animation-name:wobble;-webkit-animation-duration:.4s;animation-duration:.4s}@-webkit-keyframes wobble{0%{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}15%{-webkit-transform:translate3d(-9%,0,0);transform:translate3d(-9%,0,0)}30%{-webkit-transform:translate3d(9%,0,0);transform:translate3d(9%,0,0)}45%{-webkit-transform:translate3d(-4%,0,0);transform:translate3d(-4%,0,0)}60%{-webkit-transform:translate3d(4%,0,0);transform:translate3d(4%,0,0)}75%{-webkit-transform:translate3d(-1%,0,0);transform:translate3d(-1%,0,0)}to{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}}@keyframes wobble{0%{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}15%{-webkit-transform:translate3d(-9%,0,0);transform:translate3d(-9%,0,0)}30%{-webkit-transform:translate3d(9%,0,0);transform:translate3d(9%,0,0)}45%{-webkit-transform:translate3d(-4%,0,0);transform:translate3d(-4%,0,0)}60%{-webkit-transform:translate3d(4%,0,0);transform:translate3d(4%,0,0)}75%{-webkit-transform:translate3d(-1%,0,0);transform:translate3d(-1%,0,0)}to{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}}.ce-popover-header{margin-bottom:8px;margin-top:4px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.ce-popover-header__text{font-size:18px;font-weight:600}.ce-popover-header__back-button{border:0;background:transparent;width:36px;height:36px;color:var(--color-text-primary)}.ce-popover-header__back-button svg{display:block;width:28px;height:28px}.ce-popover--inline{--height: 38px;--height-mobile: 46px;--container-padding: 4px;position:relative}.ce-popover--inline.ce-popover--opened{display:inline-block;width:-webkit-max-content;width:-moz-max-content;width:max-content;height:var(--height)}@media (max-width: 650px){.ce-popover--inline.ce-popover--opened{height:var(--height-mobile)}}.ce-popover--inline .ce-popover__custom-content{margin-bottom:0}.ce-popover--inline .ce-popover__items{display:-webkit-box;display:-ms-flexbox;display:flex}.ce-popover--inline .ce-popover__container{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;padding:var(--container-padding);height:var(--height);top:0;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;width:-webkit-max-content;width:-moz-max-content;width:max-content;-webkit-animation:none;animation:none}@media (max-width: 650px){.ce-popover--inline .ce-popover__container{height:var(--height-mobile);position:absolute}}.ce-popover--inline .ce-popover-item-separator{padding:0 4px}.ce-popover--inline .ce-popover-item-separator__line{height:100%;width:1px}.ce-popover--inline .ce-popover-item{border-radius:4px;padding:4px}.ce-popover--inline .ce-popover-item__icon--tool{-webkit-box-shadow:none;box-shadow:none;background:transparent;margin-right:0}.ce-popover--inline .ce-popover-item__icon{width:auto;width:initial;height:auto;height:initial}.ce-popover--inline .ce-popover-item__icon svg{width:20px;height:20px}@media (max-width: 650px){.ce-popover--inline .ce-popover-item__icon svg{width:28px;height:28px}}.ce-popover--inline .ce-popover-item:not(:last-of-type){margin-bottom:0;margin-bottom:initial}.ce-popover--inline .ce-popover-item-html{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.ce-popover--inline .ce-popover-item__icon--chevron-right{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.ce-popover--inline [data-item-name=link] .ce-popover-item__icon--chevron-right{display:none}.ce-popover--inline .ce-popover--nested-level-1 .ce-popover__container{--offset: 3px;left:0;top:calc(var(--height) + var(--offset))}@media (max-width: 650px){.ce-popover--inline .ce-popover--nested-level-1 .ce-popover__container{top:calc(var(--height-mobile) + var(--offset))}}.ce-popover--inline .ce-popover--nested .ce-popover__container{min-width:var(--width);width:var(--width);height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;padding:6px;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.ce-popover--inline .ce-popover--nested .ce-popover__items{display:block;width:100%}.ce-popover--inline .ce-popover--nested .ce-popover-item{border-radius:6px;padding:3px}@media (max-width: 650px){.ce-popover--inline .ce-popover--nested .ce-popover-item{padding:4px}}.ce-popover--inline .ce-popover--nested .ce-popover-item__icon--tool{margin-right:4px}.ce-popover--inline .ce-popover--nested .ce-popover-item__icon{width:26px;height:26px}.ce-popover--inline .ce-popover--nested .ce-popover-item-separator{padding:4px 3px}.ce-popover--inline .ce-popover--nested .ce-popover-item-separator__line{width:100%;height:1px}.codex-editor [data-placeholder]:empty:before,.codex-editor [data-placeholder][data-empty=true]:before{pointer-events:none;color:#707684;cursor:text;content:attr(data-placeholder)}.codex-editor [data-placeholder-active]:empty:before,.codex-editor [data-placeholder-active][data-empty=true]:before{pointer-events:none;color:#707684;cursor:text}.codex-editor [data-placeholder-active]:empty:focus:before,.codex-editor [data-placeholder-active][data-empty=true]:focus:before{content:attr(data-placeholder-active)}
39
- `;class Nw extends F{constructor(){super(...arguments),this.isMobile=!1,this.contentRectCache=null,this.resizeDebouncer=Ms(()=>{this.windowResize()},200),this.selectionChangeDebounced=Ms(()=>{this.selectionChanged()},kE),this.documentTouchedListener=e=>{this.documentTouched(e)}}get CSS(){return{editorWrapper:"codex-editor",editorWrapperNarrow:"codex-editor--narrow",editorZone:"codex-editor__redactor",editorZoneHidden:"codex-editor__redactor--hidden",editorEmpty:"codex-editor--empty",editorRtlFix:"codex-editor--rtl",editorDragging:"codex-editor--dragging"}}get contentRect(){if(this.contentRectCache!==null)return this.contentRectCache;const e=this.nodes.wrapper.querySelector(`.${re.CSS.content}`);return e?(this.contentRectCache=e.getBoundingClientRect(),this.contentRectCache):{width:650,left:0,right:0}}async prepare(){this.setIsMobile(),this.make(),this.loadStyles()}toggleReadOnly(e){if(e){this.unbindReadOnlySensitiveListeners();return}const t=()=>{this.bindReadOnlySensitiveListeners()};t();const o=window.requestIdleCallback;typeof o=="function"&&o(t,{timeout:2e3})}checkEmptiness(){const{BlockManager:e}=this.Editor;this.nodes.wrapper.classList.toggle(this.CSS.editorEmpty,e.isEditorEmpty)}get someToolbarOpened(){const{Toolbar:e,BlockSettings:t,InlineToolbar:o}=this.Editor;return!!(t.opened||o.opened||e.toolbox.opened)}get someFlipperButtonFocused(){return this.Editor.Toolbar.toolbox.hasFocus()?!0:Object.entries(this.Editor).filter(([e,t])=>t.flipper instanceof Fe).some(([e,t])=>t.flipper.hasFocus())}destroy(){this.nodes.holder.innerHTML="",this.unbindReadOnlyInsensitiveListeners()}closeAllToolbars(){const{Toolbar:e,BlockSettings:t,InlineToolbar:o}=this.Editor;t.close(),o.close(),e.toolbox.close()}setIsMobile(){const e=window.innerWidth<Ds;e!==this.isMobile&&this.eventsDispatcher.emit(Lt,{isEnabled:this.isMobile}),this.isMobile=e}make(){const e=this.config.holder;if(!e)throw new Error("Editor holder is not specified in the configuration.");this.nodes.holder=v.getHolder(e),this.nodes.wrapper=v.make("div",[this.CSS.editorWrapper,...this.isRtl?[this.CSS.editorRtlFix]:[]]),this.nodes.wrapper.setAttribute(pt,CE),this.nodes.redactor=v.make("div",this.CSS.editorZone),this.nodes.holder.offsetWidth<this.contentRect.width&&this.nodes.wrapper.classList.add(this.CSS.editorWrapperNarrow),this.nodes.redactor.style.paddingBottom=this.config.minHeight+"px",this.nodes.wrapper.appendChild(this.nodes.redactor),this.nodes.holder.appendChild(this.nodes.wrapper),this.bindReadOnlyInsensitiveListeners()}loadStyles(){const e="editor-js-styles";if(v.get(e))return;const t=v.make("style",null,{id:e,textContent:Ow.toString()});this.config.style&&!Q(this.config.style)&&this.config.style.nonce&&t.setAttribute("nonce",this.config.style.nonce),v.prepend(document.head,t)}bindReadOnlyInsensitiveListeners(){this.listeners.on(document,"selectionchange",this.selectionChangeDebounced),this.listeners.on(window,"resize",this.resizeDebouncer,{passive:!0}),this.listeners.on(this.nodes.redactor,"mousedown",this.documentTouchedListener,{capture:!0,passive:!0}),this.listeners.on(this.nodes.redactor,"touchstart",this.documentTouchedListener,{capture:!0,passive:!0})}unbindReadOnlyInsensitiveListeners(){this.listeners.off(document,"selectionchange",this.selectionChangeDebounced),this.listeners.off(window,"resize",this.resizeDebouncer),this.listeners.off(this.nodes.redactor,"mousedown",this.documentTouchedListener),this.listeners.off(this.nodes.redactor,"touchstart",this.documentTouchedListener)}bindReadOnlySensitiveListeners(){this.readOnlyMutableListeners.on(this.nodes.redactor,"click",e=>{e instanceof MouseEvent&&this.redactorClicked(e)},!1),this.readOnlyMutableListeners.on(document,"keydown",e=>{e instanceof KeyboardEvent&&this.documentKeydown(e)},!0),this.readOnlyMutableListeners.on(document,"mousedown",e=>{e instanceof MouseEvent&&this.documentClicked(e)},!0),this.watchBlockHoveredEvents(),this.enableInputsEmptyMark()}watchBlockHoveredEvents(){const e={lastHovered:null},o=To(r=>{var a;if(!(r instanceof MouseEvent)&&!(r instanceof TouchEvent))return;const i=(a=r.target)==null?void 0:a.closest(".ce-block");if(this.Editor.BlockSelection.anyBlockSelected||!i||e.lastHovered===i)return;e.lastHovered=i;const s=this.Editor.BlockManager.getBlockByChildNode(i);s&&this.eventsDispatcher.emit(ia,{block:s})},20);this.readOnlyMutableListeners.on(this.nodes.redactor,"mousemove",r=>{o(r)},{passive:!0})}unbindReadOnlySensitiveListeners(){this.readOnlyMutableListeners.clearAll()}windowResize(){this.contentRectCache=null,this.setIsMobile()}documentKeydown(e){switch(e.key??""){case"Enter":this.enterPressed(e);break;case"Backspace":case"Delete":this.backspacePressed(e);break;case"Escape":this.escapePressed(e);break;default:this.defaultBehaviour(e);break}}defaultBehaviour(e){const{currentBlock:t}=this.Editor.BlockManager,o=e.target.closest(`.${this.CSS.editorWrapper}`),r=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;if(t!==void 0&&o===null){this.Editor.BlockEvents.keydown(e);return}o||t&&r||(this.Editor.BlockManager.unsetCurrentBlock(),this.Editor.Toolbar.close())}backspacePressed(e){const{BlockManager:t,BlockSelection:o,Caret:r}=this.Editor,i=w.isSelectionExists,s=w.isCollapsed;if(!(o.anyBlockSelected&&(!i||s===!0||this.Editor.CrossBlockSelection.isCrossBlockSelectionStarted)))return;const l=t.removeSelectedBlocks();if(l===void 0)return;const c=t.insertDefaultBlockAtIndex(l,!0);r.setToBlock(c,r.positions.START),o.clearSelection(e),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation()}escapePressed(e){if(this.Editor.BlockSelection.clearSelection(e),this.Editor.Toolbar.toolbox.opened){this.Editor.Toolbar.toolbox.close(),this.Editor.BlockManager.currentBlock&&this.Editor.Caret.setToBlock(this.Editor.BlockManager.currentBlock,this.Editor.Caret.positions.END);return}if(this.Editor.BlockSettings.opened){this.Editor.BlockSettings.close();return}if(this.Editor.InlineToolbar.opened){this.Editor.InlineToolbar.close();return}this.Editor.Toolbar.close()}enterPressed(e){const{BlockManager:t,BlockSelection:o}=this.Editor;if(this.someToolbarOpened)return;const r=t.currentBlockIndex>=0,i=w.isSelectionExists,s=w.isCollapsed;if(o.anyBlockSelected&&(!i||s===!0)){o.clearSelection(e),e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation();return}if(!this.someToolbarOpened&&r&&e.target.tagName==="BODY"){const a=this.Editor.BlockManager.insert();e.preventDefault(),this.Editor.Caret.setToBlock(a),this.Editor.Toolbar.moveAndOpen(a)}this.Editor.BlockSelection.clearSelection(e)}documentClicked(e){var h;if(!e.isTrusted)return;const t=e.target,o=this.nodes.holder.contains(t)||w.isAtEditor,r=this.nodes.redactor.contains(t),i=this.Editor.Toolbar.contains(t);(!(o||i)||!r&&!i)&&(this.Editor.BlockManager.unsetCurrentBlock(),this.Editor.Toolbar.close());const l=this.Editor.BlockSettings.contains(t),c=(h=this.Editor.Toolbar.nodes.settingsToggler)==null?void 0:h.contains(t),d=l||c,u=this.Editor.BlockSettings.opened&&!d;if(u&&this.Editor.BlockSettings.close(),u&&r){const g=this.Editor.BlockManager.getBlockByChildNode(t);this.Editor.Toolbar.moveAndOpen(g)}this.Editor.BlockSelection.clearSelection(e)}documentTouched(e){const t=e.target,o=(()=>{if(t!==this.nodes.redactor)return t;if(e instanceof MouseEvent)return document.elementFromPoint(e.clientX,e.clientY)??t;if(e instanceof TouchEvent&&e.touches.length>0){const{clientX:r,clientY:i}=e.touches[0];return document.elementFromPoint(r,i)??t}return t})();try{this.Editor.BlockManager.setCurrentBlockByChildNode(o)}catch{this.Editor.RectangleSelection.isRectActivated()||this.Editor.Caret.setToTheLastBlock()}!this.Editor.ReadOnly.isEnabled&&!this.Editor.Toolbar.contains(t)&&this.Editor.Toolbar.moveAndOpen()}redactorClicked(e){if(!w.isCollapsed)return;const t=e.target,o=e.metaKey||e.ctrlKey;if(!(v.isAnchor(t)&&o)){this.processBottomZoneClick(e);return}e.stopImmediatePropagation(),e.stopPropagation();const i=t.getAttribute("href");if(!i)return;const s=Dy(i);Fy(s)}processBottomZoneClick(e){var d,u;const t=this.Editor.BlockManager.getBlockByIndex(-1),o=v.offset(t.holder).bottom,r=e.pageY,{BlockSelection:i}=this.Editor;if(!(e.target instanceof Element&&e.target.isEqualNode(this.nodes.redactor)&&!i.anyBlockSelected&&o<r))return;e.stopImmediatePropagation(),e.stopPropagation();const{BlockManager:a,Caret:l,Toolbar:c}=this.Editor;(!((d=a.lastBlock)!=null&&d.tool.isDefault)||!((u=a.lastBlock)!=null&&u.isEmpty))&&a.insertAtEnd(),l.setToTheLastBlock(),c.moveAndOpen(a.lastBlock)}selectionChanged(){var l;const{CrossBlockSelection:e,BlockSelection:t}=this.Editor,o=w.anchorElement;if(e.isCrossBlockSelectionStarted&&t.anyBlockSelected&&((l=w.get())==null||l.removeAllRanges()),!o&&!w.range&&this.Editor.InlineToolbar.close(),!o)return;const r=o.closest(`.${re.CSS.content}`),i=r===null||r.closest(`.${w.CSS.editorWrapper}`)!==this.nodes.wrapper,s=o.dataset.inlineToolbar==="true";i&&!this.Editor.InlineToolbar.containsNode(o)&&this.Editor.InlineToolbar.close(),!(i&&!s)&&(this.Editor.BlockManager.currentBlock||this.Editor.BlockManager.setCurrentBlockByChildNode(o),this.Editor.InlineToolbar.tryToShow(!0))}enableInputsEmptyMark(){const e=t=>{const o=t.target;$s(o)};this.readOnlyMutableListeners.on(this.nodes.wrapper,"input",e),this.readOnlyMutableListeners.on(this.nodes.wrapper,"focusin",e),this.readOnlyMutableListeners.on(this.nodes.wrapper,"focusout",e)}}const Rw={BlocksAPI:Ky,CaretAPI:Yy,EventsAPI:Xy,I18nAPI:Ao,API:Vy,InlineToolbarAPI:qy,ListenersAPI:Zy,NotifierAPI:Qy,ReadOnlyAPI:eE,SanitizerAPI:gE,SaverAPI:mE,SelectionAPI:vE,ToolsAPI:bE,StylesAPI:yE,ToolbarAPI:EE,TooltipAPI:ME,UiAPI:DE,BlockSettings:tT,Toolbar:sT,InlineToolbar:aT,BlockEvents:Hk,BlockManager:pw,BlockSelection:gw,Caret:Zn,CrossBlockSelection:bw,ModificationsObserver:yw,Paste:ml,ReadOnly:Ew,RectangleSelection:Zt,Renderer:Tw,Saver:kw,Tools:Iw,UI:Nw};class Lw{constructor(e){this.moduleInstances={},this.eventsDispatcher=new Nt,this.config={},this.isReady=new Promise((t,o)=>{Promise.resolve().then(async()=>{this.configuration=e,this.validate(),this.init(),await this.start(),await this.render();const{BlockManager:r,Caret:i,UI:s,ModificationsObserver:a}=this.moduleInstances;s.checkEmptiness(),a.enable(),this.configuration.autofocus===!0&&this.configuration.readOnly!==!0&&i.setToBlock(r.blocks[0],i.positions.START),t()}).catch(r=>{$(`Editor.js is not ready because of ${r}`,"error"),o(r)})})}set configuration(e){var l,c,d;W(e)?this.config={...e}:this.config={holder:e},this.config.holder==null&&(this.config.holder="editorjs"),this.config.logLevel==null&&(this.config.logLevel=Os.VERBOSE),Oy(this.config.logLevel),this.config.defaultBlock=this.config.defaultBlock??"paragraph";const t=this.config.tools,o=this.config.defaultBlock,r=t!=null&&Object.prototype.hasOwnProperty.call(t,o??""),i=(l=this.config.data)==null?void 0:l.blocks,s=Array.isArray(i)&&i.length>0;if(o&&o!=="paragraph"&&!r&&!s){$(`Default block "${o}" is not configured. Falling back to "paragraph" tool.`,"warn"),this.config.defaultBlock="paragraph";const h={...this.config.tools??{}},g=h.paragraph;h.paragraph=this.createParagraphToolConfig(g),this.config.tools=h}this.config.minHeight=this.config.minHeight!==void 0?this.config.minHeight:300;const a={type:this.config.defaultBlock,data:{}};this.config.placeholder===void 0&&(this.config.placeholder=!1),this.config.sanitizer=this.config.sanitizer??{},this.config.hideToolbar=this.config.hideToolbar??!1,this.config.tools=this.config.tools||{},this.config.i18n=this.config.i18n||{},this.config.data=this.config.data||{blocks:[]},this.config.onReady=this.config.onReady||(()=>{}),this.config.onChange=this.config.onChange||(()=>{}),this.config.inlineToolbar=this.config.inlineToolbar!==void 0?this.config.inlineToolbar:!0,(Q(this.config.data)||!this.config.data.blocks||this.config.data.blocks.length===0)&&(this.config.data={blocks:[a]}),this.config.readOnly=this.config.readOnly||!1,(c=this.config.i18n)!=null&&c.messages&&ne.setDictionary(this.config.i18n.messages),this.config.i18n.direction=((d=this.config.i18n)==null?void 0:d.direction)||"ltr"}get configuration(){return this.config}validate(){const{holder:e}=this.config;if(we(e)&&!v.get(e))throw Error(`element with ID «${e}» is missing. Pass correct holder's ID.`);if(e&&W(e)&&!v.isElement(e))throw Error("«holder» value must be an Element node")}init(){this.constructModules(),this.configureModules()}async start(){await["Tools","UI","BlockManager","Paste","BlockSelection","RectangleSelection","CrossBlockSelection","ReadOnly"].reduce((t,o)=>t.then(async()=>{try{await this.moduleInstances[o].prepare()}catch(r){if(r instanceof Ot)throw new Error(r.message);$(`Module ${o} was skipped because of %o`,"warn",r)}}),Promise.resolve())}render(){const e=this.moduleInstances.Renderer;if(!e)throw new Ot("Renderer module is not initialized");if(!this.config.data)throw new Ot("Editor data is not initialized");return e.render(this.config.data.blocks)}constructModules(){Object.entries(Rw).forEach(([e,t])=>{try{this.moduleInstances[e]=new t({config:this.configuration,eventsDispatcher:this.eventsDispatcher})}catch(o){$(`[constructModules] Module ${e} skipped because`,"error",o)}})}configureModules(){for(const e in this.moduleInstances)Object.prototype.hasOwnProperty.call(this.moduleInstances,e)&&(this.moduleInstances[e].state=this.getModulesDiff(e))}createParagraphToolConfig(e){if(e===void 0)return{config:{preserveBlank:!0}};if(j(e))return{class:e,config:{preserveBlank:!0}};if(W(e)){const t=e,o=t.config;return{...t,config:{...W(o)?o:{},preserveBlank:!0}}}return{config:{preserveBlank:!0}}}getModulesDiff(e){const t={};for(const o in this.moduleInstances)o!==e&&(t[o]=this.moduleInstances[o]);return t}}/**
40
- * Editor.js
41
- * @license Apache-2.0
42
- * @see Editor.js <https://editorjs.io>
43
- * @author CodeX Team <https://codex.so>
44
- */class Qn{static get version(){return fn()}constructor(e){this.initialConfiguration=W(e)?{...e}:e;const t=W(e)&&j(e.onReady)?e.onReady:()=>{},o=new Lw(e);this.destroy=()=>{},this.isReady=o.isReady.then(()=>{this.exportAPI(o),t()})}exportAPI(e){var f;const t=["configuration"],o=()=>{Object.values(e.moduleInstances).forEach(m=>{if(m==null)return;j(m.destroy)&&m.destroy();const b=m.listeners;b&&j(b.removeAll)&&b.removeAll()}),PE();for(const m in this)Object.prototype.hasOwnProperty.call(this,m)&&delete this[m];Object.setPrototypeOf(this,null)};t.forEach(m=>{if(m!=="configuration"){this[m]=e[m];return}const b=e.configuration,E=W(this.initialConfiguration)?this.initialConfiguration:b??this.initialConfiguration;E!==void 0&&(this[m]=E)}),this.destroy=o;const r=e.moduleInstances.API.methods,i=((f=e.moduleInstances.EventsAPI)==null?void 0:f.methods)??r.events;if(i!==void 0){const m=b=>{Object.prototype.hasOwnProperty.call(b,"eventsDispatcher")||Object.defineProperty(b,"eventsDispatcher",{value:i,configurable:!0,enumerable:!0,writable:!1})};m(r),m(this)}Object.getPrototypeOf(r)!==Qn.prototype&&Object.setPrototypeOf(r,Qn.prototype),Object.setPrototypeOf(this,r);const s=Object.create(null),a=e.moduleInstances,l=a,c=m=>/^[A-Z]+$/.test(m)?m.toLowerCase():m.charAt(0).toLowerCase()+m.slice(1);Object.keys(l).forEach(m=>{const b=c(m);Object.defineProperty(s,b,{configurable:!0,enumerable:!0,get:()=>l[m]})});const d=a.Toolbar,u=a.BlockSettings;d!==void 0&&u!==void 0&&d.blockSettings===void 0&&(d.blockSettings=u);const h=a.InlineToolbar;d!==void 0&&h!==void 0&&d.inlineToolbar===void 0&&(d.inlineToolbar=h),Object.defineProperty(this,"module",{value:s,configurable:!0,enumerable:!1,writable:!1}),delete this.exportAPI,Object.entries({blocks:{clear:"clear",render:"render"},caret:{focus:"focus"},events:{on:"on",off:"off",emit:"emit"},saver:{save:"save"}}).forEach(([m,b])=>{Object.entries(b).forEach(([E,k])=>{const N=m,x=e.moduleInstances.API.methods[N];this[k]=x[E]})})}}var eo={},Pw={get exports(){return eo},set exports(n){eo=n}};(function(n,e){(function(t,o){n.exports=o()})(window,function(){return function(t){var o={};function r(i){if(o[i])return o[i].exports;var s=o[i]={i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,r),s.l=!0,s.exports}return r.m=t,r.c=o,r.d=function(i,s,a){r.o(i,s)||Object.defineProperty(i,s,{enumerable:!0,get:a})},r.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},r.t=function(i,s){if(1&s&&(i=r(i)),8&s||4&s&&typeof i=="object"&&i&&i.__esModule)return i;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:i}),2&s&&typeof i!="string")for(var l in i)r.d(a,l,function(c){return i[c]}.bind(null,l));return a},r.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(s,"a",s),s},r.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},r.p="/",r(r.s=0)}([function(t,o,r){r(1),t.exports=function(){var i=r(6),s="cdx-notify--bounce-in",a=null;return{show:function(l){if(l.message){(function(){if(a)return!0;a=i.getWrapper(),document.body.appendChild(a)})();var c=null,d=l.time||8e3;switch(l.type){case"confirm":c=i.confirm(l);break;case"prompt":c=i.prompt(l);break;default:c=i.alert(l),window.setTimeout(function(){c.remove()},d)}a.appendChild(c),c.classList.add(s)}}}}()},function(t,o,r){var i=r(2);typeof i=="string"&&(i=[[t.i,i,""]]);var s={hmr:!0,transform:void 0,insertInto:void 0};r(4)(i,s),i.locals&&(t.exports=i.locals)},function(t,o,r){(t.exports=r(3)(!1)).push([t.i,`.cdx-notify--error{background:#fffbfb!important}.cdx-notify--error::before{background:#fb5d5d!important}.cdx-notify__input{max-width:130px;padding:5px 10px;background:#f7f7f7;border:0;border-radius:3px;font-size:13px;color:#656b7c;outline:0}.cdx-notify__input:-ms-input-placeholder{color:#656b7c}.cdx-notify__input::placeholder{color:#656b7c}.cdx-notify__input:focus:-ms-input-placeholder{color:rgba(101,107,124,.3)}.cdx-notify__input:focus::placeholder{color:rgba(101,107,124,.3)}.cdx-notify__button{border:none;border-radius:3px;font-size:13px;padding:5px 10px;cursor:pointer}.cdx-notify__button:last-child{margin-left:10px}.cdx-notify__button--cancel{background:#f2f5f7;box-shadow:0 2px 1px 0 rgba(16,19,29,0);color:#656b7c}.cdx-notify__button--cancel:hover{background:#eee}.cdx-notify__button--confirm{background:#34c992;box-shadow:0 1px 1px 0 rgba(18,49,35,.05);color:#fff}.cdx-notify__button--confirm:hover{background:#33b082}.cdx-notify__btns-wrapper{display:-ms-flexbox;display:flex;-ms-flex-flow:row nowrap;flex-flow:row nowrap;margin-top:5px}.cdx-notify__cross{position:absolute;top:5px;right:5px;width:10px;height:10px;padding:5px;opacity:.54;cursor:pointer}.cdx-notify__cross::after,.cdx-notify__cross::before{content:'';position:absolute;left:9px;top:5px;height:12px;width:2px;background:#575d67}.cdx-notify__cross::before{transform:rotate(-45deg)}.cdx-notify__cross::after{transform:rotate(45deg)}.cdx-notify__cross:hover{opacity:1}.cdx-notifies{position:fixed;z-index:2;bottom:20px;left:20px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif}.cdx-notify{position:relative;width:220px;margin-top:15px;padding:13px 16px;background:#fff;box-shadow:0 11px 17px 0 rgba(23,32,61,.13);border-radius:5px;font-size:14px;line-height:1.4em;word-wrap:break-word}.cdx-notify::before{content:'';position:absolute;display:block;top:0;left:0;width:3px;height:calc(100% - 6px);margin:3px;border-radius:5px;background:0 0}@keyframes bounceIn{0%{opacity:0;transform:scale(.3)}50%{opacity:1;transform:scale(1.05)}70%{transform:scale(.9)}100%{transform:scale(1)}}.cdx-notify--bounce-in{animation-name:bounceIn;animation-duration:.6s;animation-iteration-count:1}.cdx-notify--success{background:#fafffe!important}.cdx-notify--success::before{background:#41ffb1!important}`,""])},function(t,o){t.exports=function(r){var i=[];return i.toString=function(){return this.map(function(s){var a=function(l,c){var d=l[1]||"",u=l[3];if(!u)return d;if(c&&typeof btoa=="function"){var h=(f=u,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(f))))+" */"),g=u.sources.map(function(m){return"/*# sourceURL="+u.sourceRoot+m+" */"});return[d].concat(g).concat([h]).join(`
45
- `)}var f;return[d].join(`
46
- `)}(s,r);return s[2]?"@media "+s[2]+"{"+a+"}":a}).join("")},i.i=function(s,a){typeof s=="string"&&(s=[[null,s,""]]);for(var l={},c=0;c<this.length;c++){var d=this[c][0];typeof d=="number"&&(l[d]=!0)}for(c=0;c<s.length;c++){var u=s[c];typeof u[0]=="number"&&l[u[0]]||(a&&!u[2]?u[2]=a:a&&(u[2]="("+u[2]+") and ("+a+")"),i.push(u))}},i}},function(t,o,r){var i,s,a={},l=(i=function(){return window&&document&&document.all&&!window.atob},function(){return s===void 0&&(s=i.apply(this,arguments)),s}),c=function(C){var T={};return function(A){if(typeof A=="function")return A();if(T[A]===void 0){var R=function(z){return document.querySelector(z)}.call(this,A);if(window.HTMLIFrameElement&&R instanceof window.HTMLIFrameElement)try{R=R.contentDocument.head}catch{R=null}T[A]=R}return T[A]}}(),d=null,u=0,h=[],g=r(5);function f(C,T){for(var A=0;A<C.length;A++){var R=C[A],z=a[R.id];if(z){z.refs++;for(var L=0;L<z.parts.length;L++)z.parts[L](R.parts[L]);for(;L<R.parts.length;L++)z.parts.push(x(R.parts[L],T))}else{var K=[];for(L=0;L<R.parts.length;L++)K.push(x(R.parts[L],T));a[R.id]={id:R.id,refs:1,parts:K}}}}function m(C,T){for(var A=[],R={},z=0;z<C.length;z++){var L=C[z],K=T.base?L[0]+T.base:L[0],M={css:L[1],media:L[2],sourceMap:L[3]};R[K]?R[K].parts.push(M):A.push(R[K]={id:K,parts:[M]})}return A}function b(C,T){var A=c(C.insertInto);if(!A)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var R=h[h.length-1];if(C.insertAt==="top")R?R.nextSibling?A.insertBefore(T,R.nextSibling):A.appendChild(T):A.insertBefore(T,A.firstChild),h.push(T);else if(C.insertAt==="bottom")A.appendChild(T);else{if(typeof C.insertAt!="object"||!C.insertAt.before)throw new Error(`[Style Loader]
47
-
48
- Invalid value for parameter 'insertAt' ('options.insertAt') found.
49
- Must be 'top', 'bottom', or Object.
50
- (https://github.com/webpack-contrib/style-loader#insertat)
51
- `);var z=c(C.insertInto+" "+C.insertAt.before);A.insertBefore(T,z)}}function E(C){if(C.parentNode===null)return!1;C.parentNode.removeChild(C);var T=h.indexOf(C);T>=0&&h.splice(T,1)}function k(C){var T=document.createElement("style");return C.attrs.type===void 0&&(C.attrs.type="text/css"),N(T,C.attrs),b(C,T),T}function N(C,T){Object.keys(T).forEach(function(A){C.setAttribute(A,T[A])})}function x(C,T){var A,R,z,L;if(T.transform&&C.css){if(!(L=T.transform(C.css)))return function(){};C.css=L}if(T.singleton){var K=u++;A=d||(d=k(T)),R=X.bind(null,A,K,!1),z=X.bind(null,A,K,!0)}else C.sourceMap&&typeof URL=="function"&&typeof URL.createObjectURL=="function"&&typeof URL.revokeObjectURL=="function"&&typeof Blob=="function"&&typeof btoa=="function"?(A=function(M){var Z=document.createElement("link");return M.attrs.type===void 0&&(M.attrs.type="text/css"),M.attrs.rel="stylesheet",N(Z,M.attrs),b(M,Z),Z}(T),R=function(M,Z,Ne){var be=Ne.css,Jt=Ne.sourceMap,El=Z.convertToAbsoluteUrls===void 0&&Jt;(Z.convertToAbsoluteUrls||El)&&(be=g(be)),Jt&&(be+=`
52
- /*# sourceMappingURL=data:application/json;base64,`+btoa(unescape(encodeURIComponent(JSON.stringify(Jt))))+" */");var to=new Blob([be],{type:"text/css"}),no=M.href;M.href=URL.createObjectURL(to),no&&URL.revokeObjectURL(no)}.bind(null,A,T),z=function(){E(A),A.href&&URL.revokeObjectURL(A.href)}):(A=k(T),R=function(M,Z){var Ne=Z.css,be=Z.media;if(be&&M.setAttribute("media",be),M.styleSheet)M.styleSheet.cssText=Ne;else{for(;M.firstChild;)M.removeChild(M.firstChild);M.appendChild(document.createTextNode(Ne))}}.bind(null,A),z=function(){E(A)});return R(C),function(M){if(M){if(M.css===C.css&&M.media===C.media&&M.sourceMap===C.sourceMap)return;R(C=M)}else z()}}t.exports=function(C,T){if(typeof DEBUG<"u"&&DEBUG&&typeof document!="object")throw new Error("The style-loader cannot be used in a non-browser environment");(T=T||{}).attrs=typeof T.attrs=="object"?T.attrs:{},T.singleton||typeof T.singleton=="boolean"||(T.singleton=l()),T.insertInto||(T.insertInto="head"),T.insertAt||(T.insertAt="bottom");var A=m(C,T);return f(A,T),function(R){for(var z=[],L=0;L<A.length;L++){var K=A[L];(M=a[K.id]).refs--,z.push(M)}for(R&&f(m(R,T),T),L=0;L<z.length;L++){var M;if((M=z[L]).refs===0){for(var Z=0;Z<M.parts.length;Z++)M.parts[Z]();delete a[M.id]}}}};var P,I=(P=[],function(C,T){return P[C]=T,P.filter(Boolean).join(`
53
- `)});function X(C,T,A,R){var z=A?"":R.css;if(C.styleSheet)C.styleSheet.cssText=I(T,z);else{var L=document.createTextNode(z),K=C.childNodes;K[T]&&C.removeChild(K[T]),K.length?C.insertBefore(L,K[T]):C.appendChild(L)}}},function(t,o){t.exports=function(r){var i=typeof window<"u"&&window.location;if(!i)throw new Error("fixUrls requires window.location");if(!r||typeof r!="string")return r;var s=i.protocol+"//"+i.host,a=s+i.pathname.replace(/\/[^\/]*$/,"/");return r.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(l,c){var d,u=c.trim().replace(/^"(.*)"$/,function(h,g){return g}).replace(/^'(.*)'$/,function(h,g){return g});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(u)?l:(d=u.indexOf("//")===0?u:u.indexOf("/")===0?s+u:a+u.replace(/^\.\//,""),"url("+JSON.stringify(d)+")")})}},function(t,o,r){var i,s,a,l,c,d,u,h,g;t.exports=(i="cdx-notifies",s="cdx-notify",a="cdx-notify__cross",l="cdx-notify__button--confirm",c="cdx-notify__button--cancel",d="cdx-notify__input",u="cdx-notify__button",h="cdx-notify__btns-wrapper",{alert:g=function(f){var m=document.createElement("DIV"),b=document.createElement("DIV"),E=f.message,k=f.style;return m.classList.add(s),k&&m.classList.add(s+"--"+k),m.innerHTML=E,b.classList.add(a),b.addEventListener("click",m.remove.bind(m)),m.appendChild(b),m},confirm:function(f){var m=g(f),b=document.createElement("div"),E=document.createElement("button"),k=document.createElement("button"),N=m.querySelector("."+a),x=f.cancelHandler,P=f.okHandler;return b.classList.add(h),E.innerHTML=f.okText||"Confirm",k.innerHTML=f.cancelText||"Cancel",E.classList.add(u),k.classList.add(u),E.classList.add(l),k.classList.add(c),x&&typeof x=="function"&&(k.addEventListener("click",x),N.addEventListener("click",x)),P&&typeof P=="function"&&E.addEventListener("click",P),E.addEventListener("click",m.remove.bind(m)),k.addEventListener("click",m.remove.bind(m)),b.appendChild(E),b.appendChild(k),m.appendChild(b),m},prompt:function(f){var m=g(f),b=document.createElement("div"),E=document.createElement("button"),k=document.createElement("input"),N=m.querySelector("."+a),x=f.cancelHandler,P=f.okHandler;return b.classList.add(h),E.innerHTML=f.okText||"Ok",E.classList.add(u),E.classList.add(l),k.classList.add(d),f.placeholder&&k.setAttribute("placeholder",f.placeholder),f.default&&(k.value=f.default),f.inputType&&(k.type=f.inputType),x&&typeof x=="function"&&N.addEventListener("click",x),P&&typeof P=="function"&&E.addEventListener("click",function(){P(k.value)}),E.addEventListener("click",m.remove.bind(m)),b.appendChild(k),b.appendChild(E),m.appendChild(b),m},getWrapper:function(){var f=document.createElement("DIV");return f.classList.add(i),f}})}])})})(Pw);const Mw=xt({__proto__:null,default:li(eo)},[eo]);return Qn});
173
+ `),c=o.innerHTML;t.setData("text/plain",a),t.setData("text/html",c);try{const d=await Promise.all(this.selectedBlocks.map(h=>h.save()));t.setData(this.Blok.Paste.MIME_TYPE,JSON.stringify(d))}catch(d){}}selectBlockByIndex(e){const{BlockManager:t}=this.Blok,o=t.getBlockByIndex(e);o!==void 0&&this.selectBlock(o)}selectBlock(e){this.selection.save();const t=X.get();t==null||t.removeAllRanges();const o=e;o.selected=!0,this.clearCache(),this.Blok.InlineToolbar.close()}unselectBlock(e){const t=e;t.selected=!1,this.clearCache()}clearCache(){this.anyBlockSelectedCache=null}destroy(){oo.remove(this.Blok.UI.nodes.redactor,"CMD+A")}handleCommandA(e){if(this.Blok.RectangleSelection.clearSelection(),R.isNativeInput(e.target)&&!this.readyToBlockSelection){this.readyToBlockSelection=!0;return}const t=this.Blok.BlockManager.getBlock(e.target);if(!t)return;const o=t.inputs;if(o.length>1&&!this.readyToBlockSelection){this.readyToBlockSelection=!0;return}if(o.length===1&&!this.needToSelectAll){this.needToSelectAll=!0;return}if(this.needToSelectAll){e.preventDefault(),this.selectAllBlocks(),this.needToSelectAll=!1,this.readyToBlockSelection=!1;return}this.readyToBlockSelection&&(e.preventDefault(),this.selectBlock(t),this.needToSelectAll=!0)}selectAllBlocks(){this.selection.save();const e=X.get();e==null||e.removeAllRanges(),this.allBlocksSelected=!0,this.Blok.InlineToolbar.close()}replaceSelectedBlocksWithPrintableKey(e){const{BlockManager:t,Caret:o}=this.Blok,i=t.removeSelectedBlocks();if(i===void 0)return;t.insertDefaultBlockAtIndex(i,!0);const a=t.currentBlock;a&&o.setToBlock(a),us(()=>{const c=e.key;o.insertContentAtCaretPosition(c.length>1?"":c)},20)()}}const LC=127,$y=l=>{for(const e of l){if(e.trim().length===0)continue;if(e>="0"&&e<="9"||e.toLowerCase()!==e.toUpperCase())return!1;const t=e.codePointAt(0);if(typeof t=="number"&&t>LC)return!1}return!0},Gy=l=>{var e;return l.nodeType===Node.TEXT_NODE?[l]:(e=l.hasChildNodes)!=null&&e.call(l)?Array.from(l.childNodes).flatMap(t=>Gy(t)):[]},DC=l=>{var i,a;const e=Gy(l);if(e.length===0)return null;const t=e[e.length-1],o=(i=[...e].reverse().find(c=>{var d;return!$y((d=c.textContent)!=null?d:"")}))!=null?i:null;return o&&o!==t&&$y((a=t.textContent)!=null?a:"")&&o.parentNode!==l?o:t};class Kd extends Ae{get positions(){return{START:"start",END:"end",DEFAULT:"default"}}static get CSS(){return{shadowCaret:"blok-shadow-caret"}}setToBlock(e,t=this.positions.DEFAULT,o=0){var y;const{BlockManager:i,BlockSelection:a}=this.Blok;if(a.clearSelection(),!e.focusable){(y=window.getSelection())==null||y.removeAllRanges(),a.selectBlock(e),i.currentBlock=e;return}const d=t===this.positions.START?e.firstInput:t===this.positions.END?e.lastInput:e.currentInput;if(!d)return;const h=b=>{if(t===this.positions.START)return{node:R.getDeepestNode(b,!1),offset:0};if(t===this.positions.END)return this.resolveEndPositionNode(b);const{node:x,offset:w}=R.getNodeByOffset(b,o);return x?{node:x,offset:w}:{node:R.getDeepestNode(b,!1),offset:0}},{node:g,offset:v}=h(d);g&&(this.set(g,v),i.setCurrentBlockByChildNode(e.holder),i.currentBlock.currentInput=d)}resolveEndPositionNode(e){const t=R.getDeepestNode(e,!0);if(t instanceof HTMLElement&&R.isNativeInput(t))return{node:t,offset:R.getContentLength(t)};const o=DC(e);return o?{node:o,offset:R.getContentLength(o)}:t?{node:t,offset:R.getContentLength(t)}:{node:null,offset:0}}setToInput(e,t=this.positions.DEFAULT,o=0){const{currentBlock:i}=this.Blok.BlockManager,a=R.getDeepestNode(e);switch(t){case this.positions.START:this.set(a,0);break;case this.positions.END:a&&this.set(a,R.getContentLength(a));break;default:o&&this.set(a,o)}i&&(i.currentInput=e)}set(e,t=0){const{top:i,bottom:a}=X.setCursor(e,t),{innerHeight:c}=window;if(i<0){window.scrollBy(0,i-30);return}a>c&&window.scrollBy(0,a-c+30)}setToTheLastBlock(){const e=this.Blok.BlockManager.lastBlock;if(e)if(e.tool.isDefault&&e.isEmpty)this.setToBlock(e);else{const t=this.Blok.BlockManager.insertAtEnd();this.setToBlock(t)}}extractFragmentFromCaretPosition(){var c;const e=X.get();if(!e||!e.rangeCount)return;const t=e.getRangeAt(0),o=this.Blok.BlockManager.currentBlock;if(!o)return;const i=o.currentInput;if(t.deleteContents(),!i)return;if(R.isNativeInput(i)){const d=i,h=document.createDocumentFragment(),g=(c=d.selectionStart)!=null?c:0,v=d.value.substring(0,g),y=d.value.substring(g);return h.textContent=y,d.value=v,h}const a=t.cloneRange();return a.selectNodeContents(i),a.setStart(t.endContainer,t.endOffset),a.extractContents()}navigateNext(e=!1){const{BlockManager:t}=this.Blok,{currentBlock:o,nextBlock:i}=t;if(o===void 0)return!1;const{nextInput:a,currentInput:c}=o,d=c!==void 0?Es(c):void 0,h=e||d||!o.focusable;if(a&&h)return this.setToInput(a,this.positions.START),!0;const v=i!==null?i:o.tool.isDefault||!h?null:t.insertAtEnd();return v!==null&&h?(this.setToBlock(v,this.positions.START),!0):!1}navigatePrevious(e=!1){const{currentBlock:t,previousBlock:o}=this.Blok.BlockManager;if(!t)return!1;const{previousInput:i,currentInput:a}=t,c=a!==void 0?Cs(a):void 0,d=e||c||!t.focusable;return i&&d?(this.setToInput(i,this.positions.END),!0):o!==null&&d?(this.setToBlock(o,this.positions.END),!0):!1}createShadow(e){const t=document.createElement("span");t.classList.add(Kd.CSS.shadowCaret),t.setAttribute("data-blok-testid","shadow-caret"),e.insertAdjacentElement("beforeend",t)}restoreCaret(e){const t=e.querySelector('[data-blok-testid="shadow-caret"]');if(!t)return;new X().expandToTag(t);const i=document.createRange();i.selectNode(t),i.extractContents()}insertContentAtCaretPosition(e){const t=document.createDocumentFragment(),o=document.createElement("div"),i=X.get(),a=X.range;if(!i||!a)return;o.innerHTML=e,Array.from(o.childNodes).forEach(g=>t.appendChild(g)),t.childNodes.length===0&&t.appendChild(new Text);const c=t.lastChild;a.deleteContents(),a.insertNode(t);const d=document.createRange(),h=c.nodeType===Node.TEXT_NODE?c:c.firstChild;h!==null&&h.textContent!==null&&d.setStart(h,h.textContent.length),i.removeAllRanges(),i.addRange(d)}}class PC extends Ae{constructor(){super(...arguments),this.firstSelectedBlock=null,this.lastSelectedBlock=null,this.onMouseUp=()=>{this.listeners.off(document,"mouseover",this.onMouseOver),this.listeners.off(document,"mouseup",this.onMouseUp)},this.onMouseOver=e=>{var d;const t=e,{BlockManager:o,BlockSelection:i}=this.Blok;if(t.relatedTarget===null&&t.target===null)return;const a=o.getBlockByChildNode(t.relatedTarget)||this.lastSelectedBlock,c=o.getBlockByChildNode(t.target);if(!(!a||!c)&&c!==a){if(this.firstSelectedBlock&&a===this.firstSelectedBlock){(d=X.get())==null||d.removeAllRanges(),a.selected=!0,c.selected=!0,i.clearCache();return}if(this.firstSelectedBlock&&c===this.firstSelectedBlock){a.selected=!1,c.selected=!1,i.clearCache();return}this.Blok.InlineToolbar.close(),this.toggleBlocksSelectedState(a,c),this.lastSelectedBlock=c}}}async prepare(){this.listeners.on(document,"mousedown",e=>{this.enableCrossBlockSelection(e)})}watchSelection(e){if(e.button!==mS.LEFT)return;const{BlockManager:t}=this.Blok,o=t.getBlock(e.target);o&&(this.firstSelectedBlock=o,this.lastSelectedBlock=o,this.listeners.on(document,"mouseover",this.onMouseOver),this.listeners.on(document,"mouseup",this.onMouseUp))}get isCrossBlockSelectionStarted(){return!!this.firstSelectedBlock&&!!this.lastSelectedBlock&&this.firstSelectedBlock!==this.lastSelectedBlock}toggleBlockSelectedState(e=!0){var d;const{BlockManager:t,BlockSelection:o}=this.Blok,i=t.currentBlock;if(!this.lastSelectedBlock&&!i||(!this.lastSelectedBlock&&i&&(this.lastSelectedBlock=this.firstSelectedBlock=i),this.firstSelectedBlock===this.lastSelectedBlock&&this.firstSelectedBlock&&(this.firstSelectedBlock.selected=!0,o.clearCache(),(d=X.get())==null||d.removeAllRanges(),this.Blok.Toolbar.close()),!this.lastSelectedBlock))return;const a=t.blocks.indexOf(this.lastSelectedBlock)+(e?1:-1),c=t.blocks[a];c&&(this.lastSelectedBlock.selected!==c.selected?(c.selected=!0,o.clearCache(),this.Blok.Toolbar.close()):(this.lastSelectedBlock.selected=!1,o.clearCache(),this.Blok.Toolbar.close()),this.lastSelectedBlock=c,this.Blok.InlineToolbar.close(),c.holder.scrollIntoView({block:"nearest"}))}clear(e){const{BlockManager:t,BlockSelection:o,Caret:i}=this.Blok;if(!this.firstSelectedBlock||!this.lastSelectedBlock)return;const a=t.blocks.indexOf(this.firstSelectedBlock),c=t.blocks.indexOf(this.lastSelectedBlock);if(!o.anyBlockSelected||a===-1||c===-1){this.firstSelectedBlock=this.lastSelectedBlock=null;return}if(e&&e instanceof KeyboardEvent)switch(e.key){case"ArrowDown":case"ArrowRight":i.setToBlock(t.blocks[Math.max(a,c)],i.positions.END);break;case"ArrowUp":case"ArrowLeft":i.setToBlock(t.blocks[Math.min(a,c)],i.positions.START);break;default:i.setToBlock(t.blocks[Math.max(a,c)],i.positions.END)}this.firstSelectedBlock=this.lastSelectedBlock=null}enableCrossBlockSelection(e){const{UI:t}=this.Blok;X.isCollapsed||this.Blok.BlockSelection.clearSelection(e),t.nodes.redactor.contains(e.target)?this.watchSelection(e):this.Blok.BlockSelection.clearSelection(e)}toggleBlocksSelectedState(e,t){const{BlockManager:o,BlockSelection:i}=this.Blok,a=o.blocks.indexOf(e),c=o.blocks.indexOf(t),d=e.selected!==t.selected,h=Math.min(a,c),g=Math.max(a,c);for(const v of Array.from({length:g-h+1},(y,b)=>h+b)){const y=o.blocks[v];y!==this.firstSelectedBlock&&y!==(d?e:t)&&(o.blocks[v].selected=!o.blocks[v].selected,i.clearCache())}this.Blok.Toolbar.close()}}class MC extends Ae{constructor({config:e,eventsDispatcher:t}){super({config:e,eventsDispatcher:t}),this.disabled=!1,this.batchingTimeout=null,this.batchingOnChangeQueue=new Map,this.batchTime=Y1,this.mutationObserver=new MutationObserver(o=>{this.redactorChanged(o)}),this.eventsDispatcher.on(Pv,o=>{this.particularBlockChanged(o.event)}),this.eventsDispatcher.on(Mv,()=>{this.disable()}),this.eventsDispatcher.on(Fv,()=>{this.enable()})}enable(){this.mutationObserver.observe(this.Blok.UI.nodes.redactor,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),this.disabled=!1}disable(){this.mutationObserver.disconnect(),this.disabled=!0}particularBlockChanged(e){this.disabled||!De(this.config.onChange)||(this.batchingOnChangeQueue.set(`block:${e.detail.target.id}:event:${e.type}`,e),this.batchingTimeout&&clearTimeout(this.batchingTimeout),this.batchingTimeout=setTimeout(()=>{const t=Array.from(this.batchingOnChangeQueue.values());if(t.length===0)return;const o=t.length===1?t[0]:t;this.config.onChange&&this.config.onChange(this.Blok.API.methods,o),this.batchingOnChangeQueue.clear()},this.batchTime))}redactorChanged(e){this.eventsDispatcher.emit(Gu,{mutations:e})}}const Xy=new Set(["table","thead","tbody","tfoot","tr","th","td","caption","colgroup","col","ul","ol","li","dl","dt","dd"]),Us=class Us extends Ae{constructor(){super(...arguments),this.MIME_TYPE="application/x-blok",this.toolsTags={},this.tagsByTool={},this.toolsPatterns=[],this.toolsFiles={},this.exceptionList=[],this.handlePasteEventWrapper=e=>{this.handlePasteEvent(e)},this.processTool=e=>{try{if(e.pasteConfig===!1){this.exceptionList.push(e.name);return}if(!e.hasOnPasteHandler)return;this.getTagsConfig(e),this.getFilesConfig(e),this.getPatternsConfig(e)}catch(t){Be(`Paste handling for «${e.name}» Tool hasn't been set up because of the error`,"warn",t)}},this.handlePasteEvent=async e=>{const{BlockManager:t,Toolbar:o}=this.Blok,i=t.setCurrentBlockByChildNode(e.target);!i||e.target&&this.isNativeBehaviour(e.target)&&e.clipboardData&&!e.clipboardData.types.includes("Files")||this.exceptionList.includes(i.name)||(e.preventDefault(),e.clipboardData&&await this.processDataTransfer(e.clipboardData),o.close())}}async prepare(){this.processTools()}shouldReplaceCurrentBlockForFile(e){const{BlockManager:t}=this.Blok,o=t.currentBlock;return o?e&&o.name===e?!0:!!o.tool.isDefault&&o.isEmpty:!1}getStructuralTagsSanitizeConfig(e){var i;const t={},o=[e];for(;o.length>0;){const a=o.pop();if(!a)continue;const c=a.tagName.toLowerCase();Xy.has(c)&&(t[c]=(i=t[c])!=null?i:{}),o.push(...Array.from(a.children))}return t}toggleReadOnly(e){e?this.unsetCallback():this.setCallback()}containsFiles(e){var o;if(Array.from(e.types).includes("Files")||(o=e.files)!=null&&o.length)return!0;try{const i=e.types;if(typeof(i==null?void 0:i.contains)=="function"&&i.contains("Files"))return!0}catch(i){}return!1}async processDataTransfer(e){const{Tools:t}=this.Blok;if(this.containsFiles(e)&&!lt(this.toolsFiles)){await this.processFiles(e.files);return}const i=e.getData(this.MIME_TYPE),a=e.getData("text/plain"),d=e.getData("text/html");if(i)try{this.insertBlokData(JSON.parse(i));return}catch(w){}const h=Object.fromEntries(Object.keys(this.toolsTags).map(w=>{var T;return[w.toLowerCase(),(T=this.toolsTags[w].sanitizationConfig)!=null?T:{}]})),g=t.getAllInlineToolsSanitizeConfig(),v=rd(this.config.sanitizer,h,g,{br:{}}),y=xn(d,v),b=R.isHTMLString(y);!y.trim()||y.trim()===a||!b?await this.processText(a):await this.processText(y,!0)}async processText(e,t=!1){var d,h;const{Caret:o,BlockManager:i}=this.Blok,a=t?this.processHTML(e):this.processPlain(e);if(!a.length)return;if(a.length>1){const v=!!((d=i.currentBlock)!=null&&d.tool.isDefault)&&!!((h=i.currentBlock)!=null&&h.isEmpty);for(const[y,b]of a.entries())await this.insertBlock(b,y===0&&v);i.currentBlock&&o.setToBlock(i.currentBlock,o.positions.END);return}const[c]=a;if(c.isBlock){await this.processSingleBlock(c);return}await this.processInlinePaste(c)}setCallback(){this.listeners.on(this.Blok.UI.nodes.holder,"paste",this.handlePasteEventWrapper)}unsetCallback(){this.listeners.off(this.Blok.UI.nodes.holder,"paste",this.handlePasteEventWrapper)}processTools(){const e=this.Blok.Tools.blockTools;Array.from(e.values()).forEach(this.processTool)}collectTagNames(e){return dn(e)?[e]:Ue(e)?Object.keys(e):[]}getTagsConfig(e){if(e.pasteConfig===!1)return;const t=e.pasteConfig.tags||[],o=[];t.forEach(i=>{const a=this.collectTagNames(i);o.push(...a),a.forEach(c=>{if(Object.prototype.hasOwnProperty.call(this.toolsTags,c)){Be(`Paste handler for «${e.name}» Tool on «${c}» tag is skipped because it is already used by «${this.toolsTags[c].tool.name}» Tool.`,"warn");return}const d=Ue(i)?i[c]:void 0;this.toolsTags[c.toUpperCase()]={tool:e,sanitizationConfig:d}})}),this.tagsByTool[e.name]=o.map(i=>i.toUpperCase())}getFilesConfig(e){if(e.pasteConfig===!1)return;const{files:t={}}=e.pasteConfig,{extensions:o,mimeTypes:i}=t;if(!o&&!i)return;const a=o==null?[]:Array.isArray(o)?o:(Be(`«extensions» property of the paste config for «${e.name}» Tool should be an array`),[]),c=i==null?[]:Array.isArray(i)?i.filter(d=>TS(d)?!0:(Be(`MIME type value «${d}» for the «${e.name}» Tool is not a valid MIME type`,"warn"),!1)):(Be(`«mimeTypes» property of the paste config for «${e.name}» Tool should be an array`),[]);this.toolsFiles[e.name]={extensions:a,mimeTypes:c}}getPatternsConfig(e){e.pasteConfig===!1||!e.pasteConfig.patterns||lt(e.pasteConfig.patterns)||Object.entries(e.pasteConfig.patterns).forEach(([t,o])=>{o instanceof RegExp||Be(`Pattern ${o} for «${e.name}» Tool is skipped because it should be a Regexp instance.`,"warn"),this.toolsPatterns.push({key:t,pattern:o,tool:e})})}isNativeBehaviour(e){return R.isNativeInput(e)}async processFiles(e){var c;const{BlockManager:t}=this.Blok,i=(await Promise.all(Array.from(e).map(d=>this.processFile(d)))).filter(d=>d!=null);if(i.length===0)return;const a=this.shouldReplaceCurrentBlockForFile((c=i[0])==null?void 0:c.type);for(const[d,h]of i.entries())await t.paste(h.type,h.event,d===0&&a)}async processFile(e){const t=wS(e),o=Object.entries(this.toolsFiles).find(([c,{mimeTypes:d,extensions:h}])=>{const[g,v]=e.type.split("/"),y=h.find(x=>x.toLowerCase()===t.toLowerCase()),b=d.find(x=>{const[w,T]=x.split("/");return w===g&&(T===v||T==="*")});return y!==void 0||b!==void 0});if(!o)return;const[i]=o;return{event:this.composePasteEvent("file",{file:e}),type:i}}processHTML(e){const{Tools:t}=this.Blok,o=R.make("DIV");return o.innerHTML=e,this.getNodes(o).map(a=>{var C;const c=(()=>{var O;switch(a.nodeType){case Node.DOCUMENT_FRAGMENT_NODE:{const L=R.make("div");return L.appendChild(a),{content:L,tool:t.defaultTool,isBlock:!1}}case Node.ELEMENT_NODE:{const L=a,U=this.toolsTags[L.tagName];return{content:L,tool:(O=U==null?void 0:U.tool)!=null?O:t.defaultTool,isBlock:!0}}default:return null}})();if(!c)return null;const{content:d,tool:h,isBlock:g}=c,y=(h.pasteConfig===!1?[]:((C=h.pasteConfig)==null?void 0:C.tags)||[]).reduce((O,L)=>{const U=this.collectTagNames(L),H=be({},O);return U.forEach(Y=>{const q=Ue(L)?L[Y]:null;H[Y.toLowerCase()]=q!=null?q:{}}),H},{}),b=this.getStructuralTagsSanitizeConfig(d),x=Object.assign({},b,y,h.baseSanitizeConfig),w=(()=>{if(d.tagName.toLowerCase()!=="table")return d.innerHTML=xn(d.innerHTML,x),d;const O=xn(d.outerHTML,x),U=R.make("div",void 0,{innerHTML:O}).firstChild;return!U||!(U instanceof HTMLElement)?null:U})();if(!w)return null;const T=this.composePasteEvent("tag",{data:w});return{content:w,isBlock:g,tool:h.name,event:T}}).filter(a=>{if(!a)return!1;const c=R.isEmpty(a.content),d=R.isSingleTag(a.content);return!c||d})}processPlain(e){const{defaultBlock:t}=this.config;if(!e)return[];const o=t;return e.split(/\r?\n/).filter(i=>i.trim()).map(i=>{const a=R.make("div");a.textContent=i;const c=this.composePasteEvent("tag",{data:a});return{content:a,tool:o,isBlock:!1,event:c}})}async processSingleBlock(e){const{Caret:t,BlockManager:o}=this.Blok,{currentBlock:i}=o;if(!i||e.tool!==i.name||!R.containsOnlyInlineElements(e.content.innerHTML)){await this.insertBlock(e,i?i.tool.isDefault&&i.isEmpty:!1);return}t.insertContentAtCaretPosition(e.content.innerHTML)}async processInlinePaste(e){var g,v;const{BlockManager:t,Caret:o}=this.Blok,{content:i}=e,a=(v=(g=t.currentBlock)==null?void 0:g.tool.isDefault)!=null?v:!1,c=i.textContent,h=a&&c!==null&&c.length<Us.PATTERN_PROCESSING_MAX_LENGTH&&c!==null?await this.processPattern(c):void 0;if(h){const y=t.currentBlock&&t.currentBlock.tool.isDefault&&t.currentBlock.isEmpty,b=await t.paste(h.tool,h.event,y);o.setToBlock(b,o.positions.END);return}if(t.currentBlock&&t.currentBlock.currentInput){const y=t.currentBlock.tool.baseSanitizeConfig;o.insertContentAtCaretPosition(xn(i.innerHTML,y))}else await this.insertBlock(e)}async processPattern(e){const t=this.toolsPatterns.find(i=>{const a=i.pattern.exec(e);return a?e===a.shift():!1});return t?{event:this.composePasteEvent("pattern",{key:t.key,data:e}),tool:t.tool.name}:void 0}async insertBlock(e,t=!1){const{BlockManager:o,Caret:i}=this.Blok,{currentBlock:a}=o;if(t&&a&&a.isEmpty){const d=await o.paste(e.tool,e.event,!0);i.setToBlock(d,i.positions.END);return}const c=await o.paste(e.tool,e.event);i.setToBlock(c,i.positions.END)}insertBlokData(e){const{BlockManager:t,Caret:o,Tools:i}=this.Blok;Ju(e,c=>{var d,h;return(h=(d=i.blockTools.get(c))==null?void 0:d.sanitizeConfig)!=null?h:{}},this.config.sanitizer).forEach(({tool:c,data:d},h)=>{var y,b;const g=h===0&&!!((y=t.currentBlock)!=null&&y.tool.isDefault)&&!!((b=t.currentBlock)!=null&&b.isEmpty),v=t.insert({tool:c,data:d,replace:g});o.setToBlock(v,o.positions.END)})}processElementNode(e,t,o){var w,T;const i=Object.keys(this.toolsTags),a=e,c=this.toolsTags[a.tagName],d=c==null?void 0:c.tool,h=(T=this.tagsByTool[(w=d==null?void 0:d.name)!=null?w:""])!=null?T:[],g=i.includes(a.tagName),v=R.blockElements.includes(a.tagName.toLowerCase()),y=Xy.has(a.tagName.toLowerCase()),b=Array.from(a.children).some(({tagName:C})=>i.includes(C)&&!h.includes(C)),x=Array.from(a.children).some(({tagName:C})=>R.blockElements.includes(C.toLowerCase()));if(!v&&!g&&!b)return o.appendChild(a),[...t,o];if(g&&!b||v&&!x&&!b||y&&!b)return[...t,o,a]}getNodes(e){const t=Array.from(e.childNodes),o=(i,a)=>{if(R.isEmpty(a)&&!R.isSingleTag(a))return i;const c=i[i.length-1],d=c!==void 0&&R.isFragment(c),{destNode:h,remainingNodes:g}=d?{destNode:c,remainingNodes:i.slice(0,-1)}:{destNode:new DocumentFragment,remainingNodes:i};if(a.nodeType===Node.TEXT_NODE)return h.appendChild(a),[...g,h];if(a.nodeType!==Node.ELEMENT_NODE)return[...g,h];const v=this.processElementNode(a,g,h);if(v)return v;const y=Array.from(a.childNodes).reduce(o,[]);return[...g,...y]};return t.reduce(o,[])}composePasteEvent(e,t){return new CustomEvent(e,{detail:t})}};Us.PATTERN_PROCESSING_MAX_LENGTH=450;let Vd=Us;class FC extends Ae{constructor(){super(...arguments),this.toolsDontSupportReadOnly=[],this.readOnlyEnabled=!1}get isEnabled(){return this.readOnlyEnabled}async prepare(){const{Tools:e}=this.Blok,{blockTools:t}=e,o=[];Array.from(t.entries()).forEach(([i,a])=>{a.isReadOnlySupported||o.push(i)}),this.toolsDontSupportReadOnly=o,this.config.readOnly===!0&&o.length>0&&this.throwCriticalError(),await this.toggle(this.config.readOnly,!0)}async toggle(e=!this.readOnlyEnabled,t=!1){e&&this.toolsDontSupportReadOnly.length>0&&this.throwCriticalError();const o=this.readOnlyEnabled;this.readOnlyEnabled=e;for(const a of Object.values(this.Blok))a!=null&&typeof a.toggleReadOnly=="function"&&a.toggleReadOnly(e);if(o===e)return this.readOnlyEnabled;if(t)return this.readOnlyEnabled;this.Blok.ModificationsObserver.disable();const i=await this.Blok.Saver.save();return i===void 0?(this.Blok.ModificationsObserver.enable(),this.readOnlyEnabled):(await this.Blok.BlockManager.clear(),await this.Blok.Renderer.render(i.blocks),this.Blok.ModificationsObserver.enable(),this.readOnlyEnabled)}throwCriticalError(){throw new Wo(`To enable read-only mode all connected tools should support it. Tools ${this.toolsDontSupportReadOnly.join(", ")} don't support read-only mode.`)}}class di extends Ae{constructor(){super(...arguments),this.isRectSelectionActivated=!1,this.SCROLL_SPEED=3,this.HEIGHT_OF_SCROLL_ZONE=40,this.BOTTOM_SCROLL_ZONE=1,this.TOP_SCROLL_ZONE=2,this.MAIN_MOUSE_BUTTON=0,this.mousedown=!1,this.isScrolling=!1,this.inScrollZone=null,this.startX=0,this.startY=0,this.mouseX=0,this.mouseY=0,this.stackOfSelected=[],this.rectCrossesBlocks=!1,this.overlayRectangle=null,this.listenerIds=[]}static get CSS(){return{overlay:"blok-editor-overlay",overlayContainer:"blok-editor-overlay__container",rect:"blok-editor-overlay__rectangle",topScrollZone:"blok-editor-overlay__scroll-zone--top",bottomScrollZone:"blok-editor-overlay__scroll-zone--bottom"}}prepare(){this.enableModuleBindings()}startSelection(e,t){const o=this.getScrollLeft(),i=this.getScrollTop(),a=document.elementFromPoint(e-o,t-i);if(!a)return;a.closest(`.${this.Blok.Toolbar.CSS.toolbarSelector}`)||(this.Blok.BlockSelection.allBlocksSelected=!1,this.clearSelection(),this.stackOfSelected=[]);const d=[`.${Sn.CSS.content}`,`.${this.Blok.Toolbar.CSS.toolbarSelector}`,$v],h=a.closest("."+this.Blok.UI.CSS.blokWrapper),g=d.some(v=>!!a.closest(v));!h||g||(this.mousedown=!0,this.startX=e,this.startY=t)}endSelection(){this.mousedown=!1,this.startX=0,this.startY=0,this.overlayRectangle!==null&&(this.overlayRectangle.style.display="none")}isRectActivated(){return this.isRectSelectionActivated}clearSelection(){this.isRectSelectionActivated=!1}enableModuleBindings(){const{container:e}=this.genHTML();this.listeners.on(e,"mousedown",i=>{this.processMouseDown(i)},!1);const t=ju(i=>{i instanceof MouseEvent&&this.processMouseMove(i)},10);this.listeners.on(document.body,"mousemove",t,{passive:!0}),this.listeners.on(document.body,"mouseleave",()=>{this.processMouseLeave()});const o=ju(i=>{this.processScroll(i)},10);this.listeners.on(window,"scroll",o,{passive:!0}),this.listeners.on(document.body,"mouseup",()=>{this.processMouseUp()},!1)}processMouseDown(e){if(e.button!==this.MAIN_MOUSE_BUTTON)return;e.target.closest(R.allInputsSelector)!==null||this.startSelection(e.pageX,e.pageY)}processMouseMove(e){this.changingRectangle(e),this.scrollByZones(e.clientY)}processMouseLeave(){this.clearSelection(),this.endSelection()}processScroll(e){this.changingRectangle(e)}processMouseUp(){this.clearSelection(),this.endSelection()}scrollByZones(e){if(this.inScrollZone=null,e<=this.HEIGHT_OF_SCROLL_ZONE&&(this.inScrollZone=this.TOP_SCROLL_ZONE),document.documentElement.clientHeight-e<=this.HEIGHT_OF_SCROLL_ZONE&&(this.inScrollZone=this.BOTTOM_SCROLL_ZONE),!this.inScrollZone){this.isScrolling=!1;return}this.isScrolling||(this.scrollVertical(this.inScrollZone===this.TOP_SCROLL_ZONE?-this.SCROLL_SPEED:this.SCROLL_SPEED),this.isScrolling=!0)}genHTML(){const{UI:e}=this.Blok,t=e.nodes.holder.querySelector("."+e.CSS.blokWrapper),o=R.make("div",[di.CSS.overlay,"fixed","inset-0","z-overlay","pointer-events-none","overflow-hidden"],{}),i=R.make("div",[di.CSS.overlayContainer,"relative","pointer-events-auto","z-0"],{}),a=R.make("div",[di.CSS.rect,"absolute","pointer-events-none","bg-selection-highlight","border","border-transparent"],{});if(o.setAttribute("data-blok-testid","overlay"),a.setAttribute("data-blok-testid","overlay-rectangle"),!t)throw new Error("RectangleSelection: blok wrapper not found");return i.appendChild(a),o.appendChild(i),t.appendChild(o),this.overlayRectangle=a,{container:t,overlay:o}}scrollVertical(e){if(!(this.inScrollZone&&this.mousedown))return;const t=this.getScrollTop();window.scrollBy(0,e),this.mouseY+=this.getScrollTop()-t,setTimeout(()=>{this.scrollVertical(e)},0)}changingRectangle(e){if(!this.mousedown)return;const t=this.overlayRectangle;if(t===null)return;e.pageY!==void 0&&(this.mouseX=e.pageX,this.mouseY=e.pageY);const{rightPos:o,leftPos:i,index:a}=this.genInfoForMouseSelection(),c=this.startX>o&&this.mouseX>o,d=this.startX<i&&this.mouseX<i;if(this.rectCrossesBlocks=!(c||d),this.isRectSelectionActivated||(this.rectCrossesBlocks=!1,this.isRectSelectionActivated=!0,this.shrinkRectangleToPoint(),t.style.display="block"),this.updateRectangleSize(),this.Blok.Toolbar.close(),a===void 0)return;this.trySelectNextBlock(a),this.inverseSelection();const h=X.get();h&&h.removeAllRanges()}shrinkRectangleToPoint(){if(this.overlayRectangle===null)return;const e=this.getScrollLeft(),t=this.getScrollTop();this.overlayRectangle.style.left=`${this.startX-e}px`,this.overlayRectangle.style.top=`${this.startY-t}px`,this.overlayRectangle.style.bottom=`calc(100% - ${this.startY-t}px)`,this.overlayRectangle.style.right=`calc(100% - ${this.startX-e}px)`}inverseSelection(){if(this.stackOfSelected.length===0)return;const e=this.Blok.BlockManager.getBlockByIndex(this.stackOfSelected[0]);if(!e)return;const t=e.selected;if(this.rectCrossesBlocks&&!t)for(const o of this.stackOfSelected)this.Blok.BlockSelection.selectBlockByIndex(o);if(!this.rectCrossesBlocks&&t)for(const o of this.stackOfSelected)this.Blok.BlockSelection.unSelectBlockByIndex(o)}updateRectangleSize(){if(this.overlayRectangle===null)return;const e=this.getScrollLeft(),t=this.getScrollTop();this.mouseY>=this.startY?(this.overlayRectangle.style.top=`${this.startY-t}px`,this.overlayRectangle.style.bottom=`calc(100% - ${this.mouseY-t}px)`):(this.overlayRectangle.style.bottom=`calc(100% - ${this.startY-t}px)`,this.overlayRectangle.style.top=`${this.mouseY-t}px`),this.mouseX>=this.startX?(this.overlayRectangle.style.left=`${this.startX-e}px`,this.overlayRectangle.style.right=`calc(100% - ${this.mouseX-e}px)`):(this.overlayRectangle.style.right=`calc(100% - ${this.startX-e}px)`,this.overlayRectangle.style.left=`${this.mouseX-e}px`)}genInfoForMouseSelection(){var w;const t=document.body.offsetWidth/2,o=this.getScrollTop(),i=this.mouseY-o,a=document.elementFromPoint(t,i),c=(w=this.Blok.BlockManager.lastBlock)==null?void 0:w.holder,d=c==null?void 0:c.querySelector("."+Sn.CSS.content),g=(d?Number.parseInt(window.getComputedStyle(d).width,10):0)/2,v=t-g,y=t+g;if(!a)return{index:void 0,leftPos:v,rightPos:y};const b=this.Blok.BlockManager.getBlockByChildNode(a);return{index:b!==void 0?this.Blok.BlockManager.blocks.findIndex(T=>T.holder===b.holder):void 0,leftPos:v,rightPos:y}}getScrollTop(){var e,t,o,i;return typeof window.scrollY=="number"?window.scrollY:(i=(o=(e=document.documentElement)==null?void 0:e.scrollTop)!=null?o:(t=document.body)==null?void 0:t.scrollTop)!=null?i:0}getScrollLeft(){var e,t,o,i;return typeof window.scrollX=="number"?window.scrollX:(i=(o=(e=document.documentElement)==null?void 0:e.scrollLeft)!=null?o:(t=document.body)==null?void 0:t.scrollLeft)!=null?i:0}addBlockInSelection(e){this.rectCrossesBlocks&&this.Blok.BlockSelection.selectBlockByIndex(e),this.stackOfSelected.push(e)}trySelectNextBlock(e){const t=this.stackOfSelected.length,o=this.stackOfSelected[t-1];if(o===e)return;const a=this.stackOfSelected[t-2],c=a!==void 0&&o!==void 0?o-a>0:!1,d=t<=1,h=o!==void 0&&e>o&&c,g=o!==void 0&&e<o&&t>1&&!c,y=!(h||g||d);if(!y&&(o===void 0||e>o)){const w=o!==void 0?o+1:e;Array.from({length:e-w+1},(T,C)=>w+C).forEach(T=>{this.addBlockInSelection(T)});return}if(!y&&o!==void 0&&e<o){Array.from({length:o-e},(w,T)=>o-1-T).forEach(w=>{this.addBlockInSelection(w)});return}if(!y)return;const b=w=>o===void 0?!1:e>o?e>w:e<w,x=[];for(const w of[...this.stackOfSelected].reverse()){if(!b(w))break;this.rectCrossesBlocks&&this.Blok.BlockSelection.unSelectBlockByIndex(w),x.push(w)}x.length>0&&this.stackOfSelected.splice(this.stackOfSelected.length-x.length,x.length)}}class zC extends Ae{render(e){return new Promise(t=>{const{Tools:o,BlockManager:i}=this.Blok;if(e.length===0)i.insert();else{const a=e.map(c=>{const{tunes:d,id:h}=c,g=c.type,v=o.available.has(g)?{tool:g,data:c.data}:(Zt(`Tool «${g}» is not found. Check 'tools' property at the Blok config.`,"warn"),{tool:o.stubTool,data:this.composeStubDataForTool(g,c.data,h)});return((b,x)=>{try{return i.composeBlock({id:h,tool:b,data:x,tunes:d})}catch(w){Be(`Block «${b}» skipped because of plugins error`,"error",{data:x,error:w});const T=this.composeStubDataForTool(b,x,h);return i.composeBlock({id:h,tool:o.stubTool,data:T,tunes:d})}})(v.tool,v.data)});i.insertMany(a)}window.requestIdleCallback(()=>{t()},{timeout:2e3})})}composeStubDataForTool(e,t,o){const{Tools:i}=this.Blok,a=(()=>{if(!i.unavailable.has(e))return e;const c=i.unavailable.get(e).toolbox;return c!==void 0&&c[0].title!==void 0?c[0].title:e})();return{savedData:{id:o,type:e,data:t},title:a}}}class HC extends Ae{async save(){const{BlockManager:e,Tools:t}=this.Blok,o=e.blocks;if(o.length===1&&o[0].isEmpty)return{time:+new Date,blocks:[],version:as()};const i=o.map(a=>this.getSavedData(a));this.lastSaveError=void 0;try{const a=await Promise.all(i),c=this.sanitizeExtractedData(a,d=>{var h;return(h=t.blockTools.get(d))==null?void 0:h.sanitizeConfig},this.config.sanitizer);return this.makeOutput(c)}catch(a){this.lastSaveError=a;const c=a instanceof Error?a:new Error(String(a));Zt("Saving failed due to the Error %o","error",c);return}}async getSavedData(e){const t=await e.save(),o=e.name,i=(t==null?void 0:t.data)!==void 0?t:this.getPreservedSavedData(e);if(i===void 0)return{tool:o,isValid:!1};const a=await e.validate(i.data);return _t(be({},i),{isValid:a})}makeOutput(e){const t=[];return e.forEach(({id:o,tool:i,data:a,tunes:c,isValid:d})=>{if(!d){Be(`Block «${i}» skipped because saved data is invalid`);return}if(i===void 0||a===void 0){Be("Block skipped because saved data is missing required fields");return}if(i===this.Blok.Tools.stubTool&&this.isStubSavedData(a)){t.push(a);return}if(i===this.Blok.Tools.stubTool){Be("Stub block data is malformed and was skipped");return}const h=c===void 0||lt(c),g=be({id:o,type:i,data:a},!h&&{tunes:c});t.push(g)}),{time:+new Date,blocks:t,version:as()}}sanitizeExtractedData(e,t,o){const i=[];if(e.forEach((d,h)=>{this.hasSanitizableData(d)&&i.push({index:h,data:d})}),i.length===0)return e;const a=Ju(i.map(({data:d})=>d),t,o),c=e.map(d=>be({},d));return i.forEach(({index:d},h)=>{const g=a[h];c[d]=_t(be({},c[d]),{data:g.data})}),c}hasSanitizableData(e){return e.data!==void 0&&typeof e.tool=="string"}isStubSavedData(e){if(!Ue(e))return!1;const t=e;return typeof t.type=="string"&&t.data!==void 0}getLastSaveError(){return this.lastSaveError}getPreservedSavedData(e){const t=e.preservedData;if(lt(t))return;const o=e.preservedTunes;return _t(be({id:e.id,tool:e.name,data:t},lt(o)?{}:{tunes:o}),{time:0})}}const jC=l=>{const e=document.createElement("div");e.innerHTML=l.trim();const t=document.createDocumentFragment();return t.append(...Array.from(e.childNodes)),t},Dr=class Dr{static get DEFAULT_PLACEHOLDER(){return""}constructor({data:e,config:t,api:o,readOnly:i}){var a,c;this.api=o,this.readOnly=i,this._CSS={block:this.api.styles.block,wrapper:"blok-paragraph"},this.readOnly||(this.onKeyUp=this.onKeyUp.bind(this)),this._placeholder=(a=t==null?void 0:t.placeholder)!=null?a:Dr.DEFAULT_PLACEHOLDER,this._data=e!=null?e:{text:""},this._element=null,this._preserveBlank=(c=t==null?void 0:t.preserveBlank)!=null?c:!1}onKeyUp(e){if(e.code!=="Backspace"&&e.code!=="Delete"||!this._element)return;const{textContent:t}=this._element;t===""&&(this._element.innerHTML="")}drawView(){const e=document.createElement("DIV");return e.className=Te(this._CSS.wrapper,this._CSS.block,Dr.WRAPPER_CLASSES,Dr.PLACEHOLDER_CLASSES),e.contentEditable="false",e.setAttribute("data-placeholder-active",this.api.i18n.t(this._placeholder)),this._data.text&&(e.innerHTML=this._data.text),this.readOnly||(e.contentEditable="true",e.addEventListener("keyup",this.onKeyUp)),e}render(){return this._element=this.drawView(),this._element}merge(e){if(!this._element)return;this._data.text+=e.text;const t=jC(e.text);this._element.appendChild(t),this._element.normalize()}validate(e){return!(e.text.trim()===""&&!this._preserveBlank)}save(e){return{text:e.innerHTML}}onPaste(e){const t=e.detail;if(!("data"in t))return;const i={text:t.data.innerHTML};this._data=i,window.requestAnimationFrame(()=>{this._element&&(this._element.innerHTML=this._data.text||"")})}static get conversionConfig(){return{export:"text",import:"text"}}static get sanitize(){return{text:{br:!0}}}static get isReadOnlySupported(){return!0}static get pasteConfig(){return{tags:["P"]}}static get toolbox(){return{icon:Mx,title:"Text"}}};Dr.WRAPPER_CLASSES=["leading-[1.6em]","outline-none","[&>p:first-of-type]:mt-0","[&>p:last-of-type]:mb-0"],Dr.PLACEHOLDER_CLASSES=["empty:before:pointer-events-none","empty:before:text-gray-text","empty:before:cursor-text","empty:before:content-[attr(data-placeholder-active)]","[&[data-empty=true]]:before:pointer-events-none","[&[data-empty=true]]:before:text-gray-text","[&[data-empty=true]]:before:cursor-text","[&[data-empty=true]]:before:content-[attr(data-placeholder-active)]"];let $d=Dr;const B=class B{static get sanitize(){return{strong:{},b:{}}}static normalizeAllBoldTags(){if(typeof document=="undefined")return;const e=X.CSS.blokWrapper,t=`${Vv} b, .${e} b`;document.querySelectorAll(t).forEach(o=>{B.ensureStrongElement(o)})}static normalizeBoldInNode(e){var a;const t=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;if(!t||typeof t.closest!="function")return;const o=X.CSS.blokWrapper;t.closest(`${Vv}, .${o}`)&&(t.tagName==="B"&&B.ensureStrongElement(t),(a=t.querySelectorAll)==null||a.call(t,"b").forEach(c=>{B.ensureStrongElement(c)}))}constructor(){typeof document!="undefined"&&(B.instances.add(this),B.initializeGlobalListeners())}static initializeGlobalListeners(){return typeof document=="undefined"?!1:(B.shortcutListenerRegistered||(document.addEventListener("keydown",B.handleShortcut,!0),B.shortcutListenerRegistered=!0),B.selectionListenerRegistered||(document.addEventListener("selectionchange",B.handleGlobalSelectionChange,!0),B.selectionListenerRegistered=!0),B.inputListenerRegistered||(document.addEventListener("input",B.handleGlobalInput,!0),B.inputListenerRegistered=!0),B.beforeInputListenerRegistered||(document.addEventListener("beforeinput",B.handleBeforeInput,!0),B.beforeInputListenerRegistered=!0),B.ensureMutationObserver(),!0)}static maintainCollapsedExitState(){var e,t,o,i,a;if(typeof document!="undefined")for(const c of Array.from(B.collapsedExitRecords)){const d=B.resolveBoundary(c);if(!d){B.collapsedExitRecords.delete(c);continue}c.boundary=d.boundary,c.boldElement=d.boldElement;const h=d.boundary,g=d.boldElement,v=c.allowedLength,y=(e=g.textContent)!=null?e:"";if(y.length>v){const q=y.slice(0,v),W=y.slice(v);g.textContent=q,h.textContent=((t=h.textContent)!=null?t:"")+W}const b=(o=h.textContent)!=null?o:"";b.length>1&&b.startsWith("​")&&(h.textContent=b.slice(1));const x=window.getSelection();B.ensureCaretAtBoundary(x,h),B.scheduleBoundaryCaretAdjustment(h);const w=(i=h.textContent)!=null?i:"",T=w.replace(/\u200B/g,""),C=T.match(/^\s+/),O=/\S/.test(T),L=w.startsWith("​");C&&(c.hasLeadingSpace=!0,c.leadingWhitespace=C[0]),O&&(c.hasTypedContent=!0);const U=/^\s/.test(T),H=c.hasTypedContent&&!L&&((a=g.textContent)!=null?a:"").length<=v,Y=c.hasLeadingSpace&&c.hasTypedContent&&!U;if(H&&Y){const q=w.replace(/^[\u200B\s]+/,""),W=c.leadingWhitespace||" ";h.textContent=`${W}${q}`,B.ensureCaretAtBoundary(x,h)}H&&B.collapsedExitRecords.delete(c)}}static ensureCaretAtBoundary(e,t){!e||!e.isCollapsed||B.setCaretToBoundaryEnd(e,t)}static scheduleBoundaryCaretAdjustment(e){B.pendingBoundaryCaretAdjustments.has(e)||(B.pendingBoundaryCaretAdjustments.add(e),setTimeout(()=>{var a,c,d;B.pendingBoundaryCaretAdjustments.delete(e);const t=(a=e.ownerDocument)!=null?a:typeof document!="undefined"?document:null;if(!t)return;const o=t.getSelection();if(!o||!o.isCollapsed||o.anchorNode!==e)return;const i=(d=(c=e.textContent)==null?void 0:c.length)!=null?d:0;o.anchorOffset!==i&&B.setCaret(o,e,i)},0))}static ensureTextNodeAfter(e){var c;const t=e.nextSibling;if((t==null?void 0:t.nodeType)===Node.TEXT_NODE)return t;const o=e.parentNode;if(!o)return null;const i=(c=e.ownerDocument)!=null?c:typeof document!="undefined"?document:null;if(!i)return null;const a=i.createTextNode("");return o.insertBefore(a,t),a}static resolveBoundary(e){if(!e.boldElement.isConnected)return null;const t=B.ensureStrongElement(e.boldElement),o=e.boundary,a=o.isConnected&&o.previousSibling===t?o:B.ensureTextNodeAfter(t);return a?{boundary:a,boldElement:t}:null}static setCaretToBoundaryEnd(e,t){var a,c;const o=document.createRange(),i=(c=(a=t.textContent)==null?void 0:a.length)!=null?c:0;o.setStart(t,i),o.collapse(!0),e.removeAllRanges(),e.addRange(o)}static hasBoldParent(e){return e?e.nodeType===Node.ELEMENT_NODE&&B.isBoldTag(e)?!0:B.hasBoldParent(e.parentNode):!1}static findBoldElement(e){return e?e.nodeType===Node.ELEMENT_NODE&&B.isBoldTag(e)?B.ensureStrongElement(e):B.findBoldElement(e.parentNode):null}static isBoldTag(e){const t=e.tagName;return t==="B"||t==="STRONG"}static ensureStrongElement(e){if(e.tagName==="STRONG")return e;const t=document.createElement("strong");for(e.hasAttributes()&&Array.from(e.attributes).forEach(o=>{t.setAttribute(o.name,o.value)});e.firstChild;)t.appendChild(e.firstChild);return e.replaceWith(t),t}static mergeStrongNodes(e,t){const o=B.ensureStrongElement(e),i=B.ensureStrongElement(t);for(;i.firstChild;)o.appendChild(i.firstChild);return i.remove(),o}render(){return{icon:wx,name:"bold",onActivate:()=>{this.toggleBold()},isActive:()=>{const e=window.getSelection();return e?this.isSelectionVisuallyBold(e):!1}}}toggleBold(){const e=window.getSelection();if(!e||e.rangeCount===0)return;const t=e.getRangeAt(0);if(t.collapsed){this.toggleCollapsedSelection();return}this.isRangeBold(t,{ignoreWhitespace:!0})?this.unwrapBoldTags(t):this.wrapWithBold(t)}isSelectionVisuallyBold(e){if(!e||e.rangeCount===0)return!1;const t=e.getRangeAt(0);return this.isRangeBold(t,{ignoreWhitespace:!0})}wrapWithBold(e){const t=this.getRangeHtmlWithoutBold(e),o=this.replaceRangeWithHtml(e,`<strong>${t}</strong>`),i=window.getSelection();i&&o&&(i.removeAllRanges(),i.addRange(o)),B.normalizeAllBoldTags();const a=i?B.findBoldElement(i.focusNode):null;if(!a)return;const c=this.mergeAdjacentBold(a);this.normalizeWhitespaceAround(c),this.selectElementContents(c),B.normalizeBoldTagsWithinBlok(window.getSelection()),B.replaceNbspInBlock(window.getSelection()),this.notifySelectionChange()}unwrapBoldTags(e){const t=this.collectBoldAncestors(e),o=window.getSelection();if(!o)return;const i=document.createElement("span"),a=e.extractContents();i.setAttribute("data-blok-bold-marker",`unwrap-${B.markerSequence++}`),i.appendChild(a),this.removeNestedBold(i),e.insertNode(i);const c=document.createRange();for(c.selectNodeContents(i),o.removeAllRanges(),o.addRange(c);;){const v=B.findBoldElement(i);if(!v)break;this.moveMarkerOutOfBold(i,v)}const d=i.firstChild,h=i.lastChild;this.unwrapElement(i);const g=d&&h?(()=>{const v=document.createRange();return v.setStartBefore(d),v.setEndAfter(h),o.removeAllRanges(),o.addRange(v),v})():void 0;g||o.removeAllRanges(),this.replaceNbspWithinRange(g),B.normalizeBoldTagsWithinBlok(o),B.replaceNbspInBlock(o),B.removeEmptyBoldElements(o),t.forEach(v=>{B.isElementEmpty(v)&&v.remove()}),this.notifySelectionChange()}replaceRangeWithHtml(e,t){var d,h;const o=B.createFragmentFromHtml(t),i=(d=o.firstChild)!=null?d:null,a=(h=o.lastChild)!=null?h:null;if(e.deleteContents(),!i||!a)return;e.insertNode(o);const c=document.createRange();return c.setStartBefore(i),c.setEndAfter(a),c}moveMarkerOutOfBold(e,t){const o=t.parentNode;if(!o)return;if(Array.from(t.childNodes).forEach(h=>{var g;h.nodeType===Node.TEXT_NODE&&((g=h.textContent)!=null?g:"").length===0&&h.remove()}),t.childNodes.length===1&&t.firstChild===e){t.replaceWith(e);return}if(t.firstChild===e){o.insertBefore(e,t);return}if(t.lastChild===e){o.insertBefore(e,t.nextSibling);return}const d=t.cloneNode(!1);for(;e.nextSibling;)d.appendChild(e.nextSibling);o.insertBefore(d,t.nextSibling),o.insertBefore(e,d)}selectElementContents(e){const t=window.getSelection();if(!t)return;const o=document.createRange();o.selectNodeContents(e),t.removeAllRanges(),t.addRange(o)}get shortcut(){return"CMD+B"}isRangeBold(e,t){var a;if(e.collapsed)return!!B.findBoldElement(e.startContainer);const o=document.createTreeWalker(e.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode:c=>{try{return e.intersectsNode(c)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}catch(d){const h=document.createRange();h.selectNodeContents(c);const g=e.compareBoundaryPoints(Range.END_TO_START,h)>0,v=e.compareBoundaryPoints(Range.START_TO_END,h)<0;return g&&v?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}}),i=[];for(;o.nextNode();){const c=o.currentNode,d=(a=c.textContent)!=null?a:"";t.ignoreWhitespace&&d.trim().length===0||d.length!==0&&i.push(c)}return i.length===0?!!B.findBoldElement(e.startContainer):i.every(c=>B.hasBoldParent(c))}removeNestedBold(e){var o;const t=(o=e.querySelectorAll)==null?void 0:o.call(e,"b,strong");t&&t.forEach(i=>{this.unwrapElement(i)})}unwrapElement(e){const t=e.parentNode;if(!t){e.remove();return}for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}mergeAdjacentBold(e){const t=B.ensureStrongElement(e),o=t.previousSibling,i=o&&o.nodeType===Node.ELEMENT_NODE&&B.isBoldTag(o)?B.mergeStrongNodes(o,t):t,a=i.nextSibling;return a&&a.nodeType===Node.ELEMENT_NODE&&B.isBoldTag(a)?B.mergeStrongNodes(i,a):i}toggleCollapsedSelection(){const e=window.getSelection();if(!e||e.rangeCount===0)return;const t=e.getRangeAt(0),o=B.findBoldElement(t.startContainer),i=(()=>{if(o&&o.getAttribute(B.DATA_ATTR_COLLAPSED_ACTIVE)!=="true")return B.exitCollapsedBold(e,o);const a=o!=null?o:B.getBoundaryBold(t);return a?B.exitCollapsedBold(e,a):this.startCollapsedBold(t)})();document.dispatchEvent(new Event("selectionchange")),i&&(e.removeAllRanges(),e.addRange(i)),B.normalizeBoldTagsWithinBlok(e),B.replaceNbspInBlock(e),B.removeEmptyBoldElements(e),this.notifySelectionChange()}startCollapsedBold(e){if(!e.collapsed)return;const t=document.createElement("strong"),o=document.createTextNode("");t.appendChild(o),t.setAttribute(B.DATA_ATTR_COLLAPSED_ACTIVE,"true");const i=e.startContainer,a=e.startOffset;if(!(i.nodeType===Node.TEXT_NODE?this.insertCollapsedBoldIntoText(i,t,a):i.nodeType===Node.ELEMENT_NODE?(this.insertCollapsedBoldIntoElement(i,t,a),!0):!1))return;const d=window.getSelection(),h=document.createRange();h.setStart(o,0),h.collapse(!0);const g=this.mergeAdjacentBold(t);return B.normalizeBoldTagsWithinBlok(d),B.replaceNbspInBlock(d),B.removeEmptyBoldElements(d),d&&(d.removeAllRanges(),d.addRange(h)),this.notifySelectionChange(),g.firstChild instanceof Text?(()=>{var y,b;const v=document.createRange();return v.setStart(g.firstChild,(b=(y=g.firstChild.textContent)==null?void 0:y.length)!=null?b:0),v.collapse(!0),v})():h}insertCollapsedBoldIntoText(e,t,o){var v;const i=e,a=i.parentNode;if(!a)return!1;const c=(v=i.textContent)!=null?v:"",d=c.slice(0,o),h=c.slice(o);i.textContent=d;const g=h.length?document.createTextNode(h):null;return g&&a.insertBefore(g,i.nextSibling),a.insertBefore(t,g!=null?g:i.nextSibling),t.setAttribute(B.DATA_ATTR_PREV_LENGTH,d.length.toString()),!0}insertCollapsedBoldIntoElement(e,t,o){var a;const i=(a=e.childNodes[o])!=null?a:null;e.insertBefore(t,i),t.setAttribute(B.DATA_ATTR_PREV_LENGTH,"0")}static isElementEmpty(e){var t;return((t=e.textContent)!=null?t:"").length===0}notifySelectionChange(){B.enforceCollapsedBoldLengths(window.getSelection()),document.dispatchEvent(new Event("selectionchange")),this.updateToolbarButtonState()}updateToolbarButtonState(){const e=window.getSelection();if(!e)return;const t=e.anchorNode,o=(t==null?void 0:t.nodeType)===Node.ELEMENT_NODE?t:t==null?void 0:t.parentElement,i=o==null?void 0:o.closest(`.${X.CSS.blokWrapper}`);if(!i)return;const a=i.querySelector("[data-blok-testid=inline-toolbar]");if(!(a instanceof HTMLElement))return;const c=a.querySelector('[data-blok-item-name="bold"]');if(!(c instanceof HTMLElement))return;const d=this.isSelectionVisuallyBold(e);c.classList.toggle("is-active",d),d?c.setAttribute("data-blok-popover-item-active","true"):c.removeAttribute("data-blok-popover-item-active")}normalizeWhitespaceAround(e){B.replaceNbspWithSpace(e.previousSibling),B.replaceNbspWithSpace(e.nextSibling)}static replaceNbspWithSpace(e){var i;if(!e||e.nodeType!==Node.TEXT_NODE)return;const t=e,o=(i=t.textContent)!=null?i:"";o.includes(" ")&&(t.textContent=o.replace(/\u00A0/g," "))}restoreSelectionFromMarkers(e){const t=document.querySelector(`[data-blok-bold-marker="${e}-start"]`),o=document.querySelector(`[data-blok-bold-marker="${e}-end"]`);if(!t||!o){t==null||t.remove(),o==null||o.remove();return}const i=window.getSelection();if(!i){t.remove(),o.remove();return}const a=document.createRange();return a.setStartAfter(t),a.setEndBefore(o),i.removeAllRanges(),i.addRange(a),t.remove(),o.remove(),a}replaceNbspWithinRange(e){if(!e)return;const t=document.createTreeWalker(e.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode:o=>{try{return e.intersectsNode(o)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}catch(i){const a=document.createRange();a.selectNodeContents(o);const c=e.compareBoundaryPoints(Range.END_TO_START,a)>0,d=e.compareBoundaryPoints(Range.START_TO_END,a)<0;return c&&d?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}});for(;t.nextNode();)B.replaceNbspWithSpace(t.currentNode)}static normalizeBoldTagsWithinBlok(e){var a;const t=(a=e==null?void 0:e.anchorNode)!=null?a:e==null?void 0:e.focusNode;if(!t)return;const o=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement,i=o==null?void 0:o.closest(`.${X.CSS.blokWrapper}`);i&&i.querySelectorAll("b").forEach(c=>{B.ensureStrongElement(c)})}static replaceNbspInBlock(e){var c;const t=(c=e==null?void 0:e.anchorNode)!=null?c:e==null?void 0:e.focusNode;if(!t)return;const o=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement,i=o==null?void 0:o.closest('[data-blok-component="paragraph"]');if(!i)return;const a=document.createTreeWalker(i,NodeFilter.SHOW_TEXT);for(;a.nextNode();)B.replaceNbspWithSpace(a.currentNode);i.querySelectorAll("b").forEach(d=>{B.ensureStrongElement(d)})}static removeEmptyBoldElements(e){var c,d;const t=(c=e==null?void 0:e.anchorNode)!=null?c:e==null?void 0:e.focusNode;if(!t)return;const o=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement,i=o==null?void 0:o.closest('[data-blok-component="paragraph"]');if(!i)return;const a=(d=e==null?void 0:e.focusNode)!=null?d:null;i.querySelectorAll("strong").forEach(h=>{var y;const g=h.getAttribute(B.DATA_ATTR_COLLAPSED_ACTIVE)==="true",v=h.hasAttribute(B.DATA_ATTR_COLLAPSED_LENGTH);g||v||((y=h.textContent)!=null?y:"").length===0&&!B.isNodeWithin(a,h)&&h.remove()})}static synchronizeCollapsedBold(e){var c,d;const t=(c=e==null?void 0:e.anchorNode)!=null?c:e==null?void 0:e.focusNode,o=t&&t.nodeType===Node.ELEMENT_NODE?t:t==null?void 0:t.parentElement,i=(d=o==null?void 0:o.closest(`.${X.CSS.blokWrapper}`))!=null?d:o==null?void 0:o.ownerDocument;if(!i)return;const a=`strong[${B.DATA_ATTR_COLLAPSED_ACTIVE}="true"]`;i.querySelectorAll(a).forEach(h=>{var re,ce,Z,ye,J;const g=h.getAttribute(B.DATA_ATTR_PREV_LENGTH),v=h.previousSibling;if(!g||!v||v.nodeType!==Node.TEXT_NODE)return;const y=Number(g);if(!Number.isFinite(y))return;const b=v,x=(re=b.textContent)!=null?re:"";if(x.length<=y)return;const w=x.slice(0,y),T=x.slice(y);b.textContent=w;const C=T.match(/^[\u00A0\s]+/);if(C&&!h.hasAttribute(B.DATA_ATTR_LEADING_WHITESPACE)&&h.setAttribute(B.DATA_ATTR_LEADING_WHITESPACE,C[0]),T.length===0)return;const O=(ce=h.textContent)!=null?ce:"",L=O+T,U=(Z=h.getAttribute(B.DATA_ATTR_LEADING_WHITESPACE))!=null?Z:"",Y=U.length>0&&O.length===0&&!L.startsWith(U)?U+L:L,q=document.createTextNode(Y);for(;h.firstChild;)h.removeChild(h.firstChild);if(h.appendChild(q),!(e!=null&&e.isCollapsed)||!B.isNodeWithin(e.focusNode,b))return;const W=document.createRange(),F=(J=(ye=q.textContent)==null?void 0:ye.length)!=null?J:0;W.setStart(q,F),W.collapse(!0),e.removeAllRanges(),e.addRange(W)})}static moveCaretAfterBoundaryBold(e){if(!e.rangeCount)return;const t=e.getRangeAt(0);if(!t.collapsed)return;const o=B.findBoldElement(t.startContainer);(o==null?void 0:o.getAttribute(B.DATA_ATTR_COLLAPSED_ACTIVE))!=="true"&&(B.moveCaretFromElementContainer(e,t)||B.moveCaretFromTextContainer(e,t))}static getAdjacentBold(e){const t=e.startContainer;return t.nodeType===Node.TEXT_NODE?B.getBoldAdjacentToText(e,t):t.nodeType===Node.ELEMENT_NODE?B.getBoldAdjacentToElement(e,t):null}static getBoldAdjacentToText(e,t){var c,d;const o=(d=(c=t.textContent)==null?void 0:c.length)!=null?d:0,i=t.previousSibling;if(e.startOffset===0&&B.isBoldElement(i))return i;if(e.startOffset!==o)return null;const a=t.nextSibling;return B.isBoldElement(a)?a:null}static getBoldAdjacentToElement(e,t){var a,c;const o=e.startOffset>0&&(a=t.childNodes[e.startOffset-1])!=null?a:null;if(B.isBoldElement(o))return o;const i=(c=t.childNodes[e.startOffset])!=null?c:null;return B.isBoldElement(i)?i:null}static exitCollapsedIfNeeded(e,t){var c;if(!!B.findBoldElement(t.startContainer))return;const i=(c=B.getBoundaryBold(t))!=null?c:B.getAdjacentBold(t);if(!i)return;const a=B.exitCollapsedBold(e,i);a&&(e.removeAllRanges(),e.addRange(a))}static moveCaretFromElementContainer(e,t){if(t.startContainer.nodeType!==Node.ELEMENT_NODE)return!1;const o=t.startContainer;return B.moveCaretAfterPreviousBold(e,o,t.startOffset)?!0:B.moveCaretBeforeNextBold(e,o,t.startOffset)}static moveCaretAfterPreviousBold(e,t,o){var d,h,g;const i=o>0&&(d=t.childNodes[o-1])!=null?d:null;if(!B.isBoldElement(i))return!1;const a=B.ensureFollowingTextNode(i,i.nextSibling);if(!a)return!1;const c=(g=(h=a.textContent)==null?void 0:h.length)!=null?g:0;return B.setCaret(e,a,c),!0}static moveCaretBeforeNextBold(e,t,o){var c;const i=(c=t.childNodes[o])!=null?c:null;if(!B.isBoldElement(i))return!1;const a=B.ensureFollowingTextNode(i,i.nextSibling);return a?(B.setCaret(e,a,0),!0):(B.setCaretAfterNode(e,i),!0)}static moveCaretFromTextContainer(e,t){var g,v,y;if(t.startContainer.nodeType!==Node.TEXT_NODE)return;const o=t.startContainer,i=o.previousSibling,a=(g=o.textContent)!=null?g:"",c=/^\s/.test(a);if(t.startOffset===0&&B.isBoldElement(i)&&(a.length===0||c)){B.setCaret(e,o,a.length);return}const d=B.findBoldElement(o);if(!d||t.startOffset!==((y=(v=o.textContent)==null?void 0:v.length)!=null?y:0))return;const h=B.ensureFollowingTextNode(d,d.nextSibling);if(h){B.setCaret(e,h,0);return}B.setCaretAfterNode(e,d)}static guardCollapsedBoundaryKeydown(e){var h;if(e.defaultPrevented||e.metaKey||e.ctrlKey||e.altKey||e.key.length!==1)return;const o=window.getSelection();if(!o||!o.isCollapsed||o.rangeCount===0)return;const i=o.getRangeAt(0);if(i.startContainer.nodeType!==Node.TEXT_NODE)return;const a=i.startContainer,c=(h=a.textContent)!=null?h:"";if(c.length===0||i.startOffset!==0)return;const d=a.previousSibling;B.isBoldElement(d)&&/^\s/.test(c)&&B.setCaret(o,a,c.length)}static isBoldElement(e){return!!(e&&e.nodeType===Node.ELEMENT_NODE&&B.isBoldTag(e))}static setCaret(e,t,o){const i=document.createRange();i.setStart(t,o),i.collapse(!0),e.removeAllRanges(),e.addRange(i)}static setCaretAfterNode(e,t){if(!t)return;const o=document.createRange();o.setStartAfter(t),o.collapse(!0),e.removeAllRanges(),e.addRange(o)}static ensureFollowingTextNode(e,t){const o=e.parentNode;if(!o)return null;if(t&&t.nodeType===Node.TEXT_NODE)return t;const i=document.createTextNode("");return o.insertBefore(i,t),i}static enforceCollapsedBoldLengths(e){var c;const t=(c=e==null?void 0:e.anchorNode)!=null?c:e==null?void 0:e.focusNode;if(!t)return;const o=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement,i=o==null?void 0:o.closest(`.${X.CSS.blokWrapper}`);if(!i)return;i.querySelectorAll(`strong[${B.DATA_ATTR_COLLAPSED_LENGTH}]`).forEach(d=>{var H,Y,q,W,F;const h=d,g=h.getAttribute(B.DATA_ATTR_COLLAPSED_LENGTH);if(!g)return;const v=Number(g),y=(H=h.textContent)!=null?H:"";if(!Number.isFinite(v))return;const b=y.length>v,x=b?B.splitCollapsedBoldText(h,v,y):null,w=h.getAttribute(B.DATA_ATTR_PREV_LENGTH),T=w?Number(w):NaN,C=h.previousSibling,O=(C==null?void 0:C.nodeType)===Node.TEXT_NODE?C:null,L=(Y=O==null?void 0:O.textContent)!=null?Y:"",U=!!(w&&Number.isFinite(T)&&O&&L.length>T);if(U&&O){const re=L.slice(0,T),ce=L.slice(T);O.textContent=re;const Z=document.createTextNode(ce);(q=h.parentNode)==null||q.insertBefore(Z,h.nextSibling)}if(U&&h.removeAttribute(B.DATA_ATTR_PREV_LENGTH),e!=null&&e.isCollapsed&&x&&B.isNodeWithin(e.focusNode,h)){const re=document.createRange(),ce=(F=(W=x.textContent)==null?void 0:W.length)!=null?F:0;re.setStart(x,ce),re.collapse(!0),e.removeAllRanges(),e.addRange(re)}b&&h.removeAttribute(B.DATA_ATTR_COLLAPSED_LENGTH)})}static splitCollapsedBoldText(e,t,o){const i=e,a=i.parentNode;if(!a)return null;const c=o.slice(0,t),d=o.slice(t);i.textContent=c;const h=document.createTextNode(d);return a.insertBefore(h,i.nextSibling),h}static isNodeWithin(e,t){return e?e===t||t.contains(e):!1}static handleGlobalSelectionChange(){B.refreshSelectionState("selectionchange")}static handleGlobalInput(){B.refreshSelectionState("input")}static refreshSelectionState(e){const t=window.getSelection();B.enforceCollapsedBoldLengths(t),B.maintainCollapsedExitState(),B.synchronizeCollapsedBold(t),B.normalizeBoldTagsWithinBlok(t),B.removeEmptyBoldElements(t),e==="input"&&t&&B.moveCaretAfterBoundaryBold(t),B.normalizeAllBoldTags()}static ensureMutationObserver(){if(typeof MutationObserver=="undefined"||B.mutationObserver)return;const e=new MutationObserver(t=>{if(!B.isProcessingMutation){B.isProcessingMutation=!0;try{t.forEach(o=>{o.addedNodes.forEach(i=>{B.normalizeBoldInNode(i)}),o.type==="characterData"&&o.target&&B.normalizeBoldInNode(o.target)})}finally{B.isProcessingMutation=!1}}});e.observe(document.body,{subtree:!0,childList:!0,characterData:!0}),B.mutationObserver=e}static handleBeforeInput(e){if(e.inputType!=="formatBold")return;const t=window.getSelection(),o=!!(t&&B.isSelectionInsideBlok(t)),i=B.isEventTargetInsideBlok(e.target);!o&&!i||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),B.normalizeAllBoldTags())}static exitCollapsedBold(e,t){const o=B.ensureStrongElement(t),i=o.parentNode;if(i)return B.isElementEmpty(o)?B.removeEmptyBoldElement(e,o,i):B.exitCollapsedBoldWithContent(e,o,i)}static removeEmptyBoldElement(e,t,o){const i=document.createRange();return i.setStartBefore(t),i.collapse(!0),o.removeChild(t),e.removeAllRanges(),e.addRange(i),i}static exitCollapsedBoldWithContent(e,t,o){var b,x,w,T,C,O;t.setAttribute(B.DATA_ATTR_COLLAPSED_LENGTH,((x=(b=t.textContent)==null?void 0:b.length)!=null?x:0).toString()),t.removeAttribute(B.DATA_ATTR_PREV_LENGTH),t.removeAttribute(B.DATA_ATTR_COLLAPSED_ACTIVE),t.removeAttribute(B.DATA_ATTR_LEADING_WHITESPACE);const i=t.nextSibling,a=!i||i.nodeType!==Node.TEXT_NODE,c=a?document.createTextNode("​"):null;c&&o.insertBefore(c,i);const d=c!=null?c:i;!a&&((w=d.textContent)!=null?w:"").length===0&&(d.textContent="​");const h=document.createRange(),v=((T=d.textContent)!=null?T:"").startsWith("​")?1:0;h.setStart(d,v),h.collapse(!0),e.removeAllRanges(),e.addRange(h);const y=B.ensureStrongElement(t);return B.collapsedExitRecords.add({boundary:d,boldElement:y,allowedLength:(O=(C=y.textContent)==null?void 0:C.length)!=null?O:0,hasLeadingSpace:!1,hasTypedContent:!1,leadingWhitespace:""}),h}static getBoundaryBold(e){const t=e.startContainer;return t.nodeType===Node.TEXT_NODE?B.getBoundaryBoldForText(e,t):t.nodeType===Node.ELEMENT_NODE?B.getBoundaryBoldForElement(e,t):null}static getBoundaryBoldForText(e,t){var a,c;const o=(c=(a=t.textContent)==null?void 0:a.length)!=null?c:0;if(e.startOffset===o)return B.findBoldElement(t);if(e.startOffset!==0)return null;const i=t.previousSibling;return B.isBoldElement(i)?i:null}static getBoundaryBoldForElement(e,t){if(e.startOffset<=0)return null;const o=t.childNodes[e.startOffset-1];return B.isBoldElement(o)?o:null}static handleShortcut(e){var i;if(B.guardCollapsedBoundaryKeydown(e),!B.isBoldShortcut(e))return;const t=window.getSelection();if(!t||!t.rangeCount||!B.isSelectionInsideBlok(t))return;const o=(i=B.instances.values().next().value)!=null?i:new B;o&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),o.toggleBold())}static isBoldShortcut(e){return!((typeof navigator!="undefined"?navigator.userAgent.toLowerCase():"").includes("mac")?e.metaKey:e.ctrlKey)||e.altKey?!1:e.key.toLowerCase()==="b"}static isSelectionInsideBlok(e){const t=e.anchorNode;if(!t)return!1;const o=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement;return!!(o!=null&&o.closest(`.${X.CSS.blokWrapper}`))}static isEventTargetInsideBlok(e){var o;if(!e||typeof Node=="undefined")return!1;if(e instanceof Element)return!!e.closest(`.${X.CSS.blokWrapper}`);if(e instanceof Text)return!!((o=e.parentElement)!=null&&o.closest(`.${X.CSS.blokWrapper}`));if(typeof ShadowRoot!="undefined"&&e instanceof ShadowRoot)return B.isEventTargetInsideBlok(e.host);if(!(e instanceof Node))return!1;const t=e.parentNode;return t?t instanceof Element?!!t.closest(`.${X.CSS.blokWrapper}`):B.isEventTargetInsideBlok(t):!1}getRangeHtmlWithoutBold(e){const t=e.cloneContents();this.removeNestedBold(t);const o=document.createElement("div");return o.appendChild(t),o.innerHTML}static createFragmentFromHtml(e){const t=document.createElement("template");return t.innerHTML=e,t.content}collectBoldAncestors(e){const t=new Set,o=document.createTreeWalker(e.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode:i=>{try{return e.intersectsNode(i)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}catch(a){const c=document.createRange();c.selectNodeContents(i);const d=e.compareBoundaryPoints(Range.END_TO_START,c)>0,h=e.compareBoundaryPoints(Range.START_TO_END,c)<0;return d&&h?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}});for(;o.nextNode();){const i=B.findBoldElement(o.currentNode);i&&t.add(i)}return Array.from(t)}};B.isInline=!0,B.title="Bold",B.shortcutListenerRegistered=!1,B.selectionListenerRegistered=!1,B.inputListenerRegistered=!1,B.beforeInputListenerRegistered=!1,B.globalListenersInitialized=B.initializeGlobalListeners(),B.collapsedExitRecords=new Set,B.markerSequence=0,B.isProcessingMutation=!1,B.DATA_ATTR_COLLAPSED_LENGTH="data-blok-bold-collapsed-length",B.DATA_ATTR_COLLAPSED_ACTIVE="data-blok-bold-collapsed-active",B.DATA_ATTR_PREV_LENGTH="data-blok-bold-prev-length",B.DATA_ATTR_LEADING_WHITESPACE="data-blok-bold-leading-ws",B.instances=new Set,B.pendingBoundaryCaretAdjustments=new WeakSet;let Gd=B;const Ws=class Ws{static get sanitize(){return{i:{},em:{}}}render(){return{icon:Tx,name:"italic",onActivate:()=>{this.toggleItalic()},isActive:()=>{const e=window.getSelection();return e?this.isSelectionVisuallyItalic(e):!1}}}get shortcut(){return"CMD+I"}toggleItalic(){const e=window.getSelection();if(!e||e.rangeCount===0)return;const t=e.getRangeAt(0);if(t.collapsed){this.toggleCollapsedItalic(t,e);return}this.isRangeItalic(t,{ignoreWhitespace:!0})?this.unwrapItalicTags(t):this.wrapWithItalic(t)}toggleCollapsedItalic(e,t){if(this.isRangeItalic(e,{ignoreWhitespace:!0})){const i=document.createTextNode("​");e.insertNode(i),e.selectNode(i),this.unwrapItalicTags(e);const a=document.createRange();a.setStart(i,1),a.setEnd(i,1),t.removeAllRanges(),t.addRange(a)}else{const i=document.createElement("i"),a=document.createTextNode("​");i.appendChild(a),e.insertNode(i);const c=document.createRange();c.setStart(a,1),c.setEnd(a,1),t.removeAllRanges(),t.addRange(c)}}isSelectionVisuallyItalic(e){if(!e||e.rangeCount===0)return!1;const t=e.getRangeAt(0);return this.isRangeItalic(t,{ignoreWhitespace:!0})}isRangeItalic(e,t){var a;if(e.collapsed)return!!this.findItalicElement(e.startContainer);const o=document.createTreeWalker(e.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode:c=>{try{return e.intersectsNode(c)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}catch(d){const h=document.createRange();h.selectNodeContents(c);const g=e.compareBoundaryPoints(Range.END_TO_START,h)>0,v=e.compareBoundaryPoints(Range.START_TO_END,h)<0;return g&&v?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}}),i=[];for(;o.nextNode();){const c=o.currentNode,d=(a=c.textContent)!=null?a:"";t.ignoreWhitespace&&d.trim().length===0||d.length!==0&&i.push(c)}return i.length===0?!!this.findItalicElement(e.startContainer):i.every(c=>this.hasItalicParent(c))}wrapWithItalic(e){const t=this.getRangeHtmlWithoutItalic(e),o=this.replaceRangeWithHtml(e,`<i>${t}</i>`),i=window.getSelection();i&&o&&(i.removeAllRanges(),i.addRange(o))}unwrapItalicTags(e){const t=this.collectItalicAncestors(e),o=window.getSelection();if(!o)return;const i=document.createElement("span"),a=e.extractContents();i.appendChild(a),this.removeNestedItalic(i),e.insertNode(i);const c=document.createRange();for(c.selectNodeContents(i),o.removeAllRanges(),o.addRange(c);;){const v=this.findItalicElement(i);if(!v)break;this.moveMarkerOutOfItalic(i,v)}const d=i.firstChild,h=i.lastChild;this.unwrapElement(i),(d&&h?(()=>{const v=document.createRange();return v.setStartBefore(d),v.setEndAfter(h),o.removeAllRanges(),o.addRange(v),v})():void 0)||o.removeAllRanges(),t.forEach(v=>{var y;((y=v.textContent)!=null?y:"").length===0&&v.remove()})}hasItalicParent(e){return e?e.nodeType===Node.ELEMENT_NODE&&this.isItalicTag(e)?!0:this.hasItalicParent(e.parentNode):!1}findItalicElement(e){return e?e.nodeType===Node.ELEMENT_NODE&&this.isItalicTag(e)?e:this.findItalicElement(e.parentNode):null}isItalicTag(e){const t=e.tagName;return t==="I"||t==="EM"}collectItalicAncestors(e){const t=new Set,o=document.createTreeWalker(e.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode:i=>{try{return e.intersectsNode(i)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}catch(a){const c=document.createRange();c.selectNodeContents(i);const d=e.compareBoundaryPoints(Range.END_TO_START,c)>0,h=e.compareBoundaryPoints(Range.START_TO_END,c)<0;return d&&h?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}});for(;o.nextNode();){const i=this.findItalicElement(o.currentNode);i&&t.add(i)}return Array.from(t)}getRangeHtmlWithoutItalic(e){const t=e.cloneContents();this.removeNestedItalic(t);const o=document.createElement("div");return o.appendChild(t),o.innerHTML}removeNestedItalic(e){var o;const t=(o=e.querySelectorAll)==null?void 0:o.call(e,"i,em");t&&t.forEach(i=>{this.unwrapElement(i)})}unwrapElement(e){const t=e.parentNode;if(!t){e.remove();return}for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}replaceRangeWithHtml(e,t){var d,h;const o=this.createFragmentFromHtml(t),i=(d=o.firstChild)!=null?d:null,a=(h=o.lastChild)!=null?h:null;if(e.deleteContents(),!i||!a)return;e.insertNode(o);const c=document.createRange();return c.setStartBefore(i),c.setEndAfter(a),c}createFragmentFromHtml(e){const t=document.createElement("template");return t.innerHTML=e,t.content}moveMarkerOutOfItalic(e,t){const o=t.parentNode;if(!o)return;if(Array.from(t.childNodes).forEach(h=>{var g;h.nodeType===Node.TEXT_NODE&&((g=h.textContent)!=null?g:"").length===0&&h.remove()}),t.childNodes.length===1&&t.firstChild===e){t.replaceWith(e);return}if(t.firstChild===e){o.insertBefore(e,t);return}if(t.lastChild===e){o.insertBefore(e,t.nextSibling);return}const d=t.cloneNode(!1);for(;e.nextSibling;)d.appendChild(e.nextSibling);o.insertBefore(d,t.nextSibling),o.insertBefore(e,d)}};Ws.isInline=!0,Ws.title="Italic";let Xd=Ws;const qC=(Pr=class{constructor({api:e}){this.BUTTON_CLASSES="flex justify-center items-center border-0 rounded h-full p-0 w-7 bg-transparent cursor-pointer leading-normal text-text-primary can-hover:hover:bg-item-hover-bg mobile:w-icon-mobile mobile:h-icon-mobile [&_svg]:block [&_svg]:w-icon [&_svg]:h-icon mobile:[&_svg]:w-icon-mobile mobile:[&_svg]:h-icon-mobile",this.BUTTON_ACTIVE_CLASSES="bg-icon-active-bg text-icon-active-text",this.INPUT_BASE_CLASSES="hidden w-full m-0 px-2 py-1 text-sm leading-[22px] font-medium bg-item-hover-bg border border-[rgba(226,226,229,0.2)] rounded-md outline-none box-border appearance-none font-[inherit] placeholder:text-gray-text mobile:text-[15px] mobile:font-medium",this.CSS={buttonActive:"is-active",buttonModifier:"is-link",buttonUnlink:"is-unlink",inputShowed:"block"},this.DATA_ATTRIBUTES={buttonActive:"data-blok-link-tool-active",buttonUnlink:"data-blok-link-tool-unlink",inputOpened:"data-blok-link-tool-input-opened"},this.nodes={input:null,button:null},this.inputOpened=!1,this.unlinkAvailable=!1,this.handleButtonClick=t=>{!this.inputOpened||!this.unlinkAvailable||(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),this.restoreSelection(),this.unlink(),this.inlineToolbar.close())},this.toolbar=e.toolbar,this.inlineToolbar=e.inlineToolbar,this.notifier=e.notifier,this.i18n=e.i18n,this.selection=new X,this.nodes.input=this.createInput()}static get sanitize(){return{a:{href:!0,target:"_blank",rel:"nofollow"}}}render(){return{icon:Sx,isActive:()=>!!this.selection.findParentTag("A"),children:{hideChevron:!0,items:[{type:ot.Html,element:this.nodes.input}],onOpen:()=>{this.openActions(!0)},onClose:()=>{this.closeActions()}}}}createInput(){const e=document.createElement("input");return e.placeholder=this.i18n.t("Add a link"),e.enterKeyHint="done",e.className=this.INPUT_BASE_CLASSES,e.setAttribute("data-blok-testid","inline-tool-input"),this.setBooleanStateAttribute(e,this.DATA_ATTRIBUTES.inputOpened,!1),e.addEventListener("keydown",t=>{t.key==="Enter"&&this.enterPressed(t)}),e}get shortcut(){return"CMD+K"}openActions(e=!1){if(!this.nodes.input)return;const t=this.selection.findParentTag("A"),o=!!t;if(this.updateButtonStateAttributes(o),this.unlinkAvailable=o,t){const i=t.getAttribute("href");this.nodes.input.value=i!==null?i:""}else this.nodes.input.value="";this.nodes.input.className=Te(this.INPUT_BASE_CLASSES,this.CSS.inputShowed),this.setBooleanStateAttribute(this.nodes.input,this.DATA_ATTRIBUTES.inputOpened,!0),this.selection.save(),e&&this.focusInputWithRetry(),this.inputOpened=!0}focusInputWithRetry(){this.nodes.input&&(this.nodes.input.focus(),!(typeof window=="undefined"||typeof document=="undefined")&&window.setTimeout(()=>{var e;document.activeElement!==this.nodes.input&&((e=this.nodes.input)==null||e.focus())},0))}getButtonElement(){if(this.nodes.button&&document.contains(this.nodes.button))return this.nodes.button;const e=document.querySelector(`${$v} [data-blok-item-name="link"]`);return e&&e.addEventListener("click",this.handleButtonClick,!0),this.nodes.button=e!=null?e:null,this.nodes.button}updateButtonStateAttributes(e){const t=this.getButtonElement();if(!t)return;const o=typeof e=="boolean"?e:!!this.selection.findParentTag("A");this.setBooleanStateAttribute(t,this.DATA_ATTRIBUTES.buttonActive,o),this.setBooleanStateAttribute(t,this.DATA_ATTRIBUTES.buttonUnlink,o)}closeActions(e=!0){(this.selection.isFakeBackgroundEnabled||e&&this.selection.savedSelectionRange)&&this.restoreSelection(),this.nodes.input&&(this.nodes.input.className=this.INPUT_BASE_CLASSES,this.setBooleanStateAttribute(this.nodes.input,this.DATA_ATTRIBUTES.inputOpened,!1),this.nodes.input.value="",this.updateButtonStateAttributes(!1),this.unlinkAvailable=!1,e&&this.selection.clearSaved(),this.inputOpened=!1)}restoreSelection(){const e=new X,t=X.isAtBlok;if(t&&e.save(),this.selection.removeFakeBackground(),this.selection.restore(),!t&&this.selection.savedSelectionRange){const a=this.selection.savedSelectionRange.commonAncestorContainer,c=a.nodeType===Node.ELEMENT_NODE?a:a.parentElement;c==null||c.focus()}if(!t)return;e.restore();const o=e.savedSelectionRange;if(o){const i=o.commonAncestorContainer,a=i.nodeType===Node.ELEMENT_NODE?i:i.parentElement;a==null||a.focus()}}enterPressed(e){if(!this.nodes.input)return;const t=this.nodes.input.value||"";if(!t.trim()){this.selection.restore(),this.unlink(),e.preventDefault(),this.closeActions(),this.inlineToolbar.close();return}if(!this.validateURL(t)){this.notifier.show({message:"Pasted link is not valid.",style:"error"}),Be("Incorrect Link pasted","warn",t);return}const o=this.prepareLink(t);this.selection.removeFakeBackground(),this.selection.restore(),this.insertLink(o),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this.selection.collapseToEnd(),this.inlineToolbar.close()}validateURL(e){return!/\s/.test(e)}prepareLink(e){return this.addProtocol(e.trim())}addProtocol(e){if(/^(\w+):(\/\/)?/.test(e))return e;const t=/^\/[^/\s]/.test(e),o=e.substring(0,1)==="#",i=/^\/\/[^/\s]/.test(e);return!t&&!o&&!i?"http://"+e:e}insertLink(e){const t=this.selection.findParentTag("A");if(t){this.selection.expandToTag(t),t.href=e,t.target="_blank",t.rel="nofollow";return}const o=X.range;if(!o)return;const i=document.createElement("a");i.href=e,i.target="_blank",i.rel="nofollow",i.appendChild(o.extractContents()),o.insertNode(i),this.selection.expandToTag(i)}unlink(){const e=this.selection.findParentTag("A");e&&(this.unwrap(e),this.updateButtonStateAttributes(!1),this.unlinkAvailable=!1)}unwrap(e){var o;const t=document.createDocumentFragment();for(;e.firstChild;)t.appendChild(e.firstChild);(o=e.parentNode)==null||o.replaceChild(t,e)}setBooleanStateAttribute(e,t,o){e&&e.setAttribute(t,o?"true":"false")}},Pr.isInline=!0,Pr.title="Link",Pr),nf=class nf{constructor({api:e}){this.i18nAPI=e.i18n,this.blocksAPI=e.blocks,this.selectionAPI=e.selection,this.toolsAPI=e.tools,this.caretAPI=e.caret}async render(){var g;const e=X.get();if(e===null)return[];const t=this.blocksAPI.getBlockByElement(e.anchorNode);if(t===void 0)return[];const o=this.toolsAPI.getBlockTools(),i=await Hv(t,o);if(i.length===0)return[];const a=i.reduce((v,y)=>{var b;return(b=y.toolbox)==null||b.forEach(x=>{x.title!==void 0&&v.push({icon:x.icon,title:Ge.t(at.toolNames,x.title),name:y.name,closeOnActivate:!0,onActivate:async()=>{const w=await this.blocksAPI.convert(t.id,y.name,x.data);this.caretAPI.setToBlock(w,"end")}})}),v},[]),c=await t.getActiveToolboxEntry(),d=(g=c==null?void 0:c.title)!=null?g:t.name,h=!Xn();return{name:"convert-to",title:Ge.t(at.toolNames,d),hint:{title:Ge.ui(at.ui.inlineToolbar.converter,"Convert to")},children:{searchable:h,items:a,onOpen:()=>{h&&(this.selectionAPI.setFakeBackground(),this.selectionAPI.save())},onClose:()=>{h&&(this.selectionAPI.restore(),this.selectionAPI.removeFakeBackground())}}}}};nf.isInline=!0;let Yd=nf;const Mr=class Mr{constructor({data:e,api:t}){this.CSS={wrapper:"blok-stub flex items-center py-3 px-[18px] my-2.5 rounded-[10px] bg-bg-light border border-line-gray text-gray-text text-sm [&_svg]:size-icon",info:"blok-stub__info ml-3.5",title:"blok-stub__title font-medium capitalize",subtitle:"blok-stub__subtitle"},this.api=t,this.title=e.title||this.api.i18n.t("Error"),this.subtitle=this.api.i18n.t("The block can not be displayed correctly."),this.savedData=e.savedData,this.wrapper=this.make()}render(){return this.wrapper}save(){return this.savedData}make(){const e=R.make("div",this.CSS.wrapper),t=Fx,o=R.make("div",this.CSS.info),i=R.make("div",this.CSS.title,{textContent:this.title}),a=R.make("div",this.CSS.subtitle,{textContent:this.subtitle});return e.setAttribute(Mr.DATA_ATTR.wrapper,""),i.setAttribute(Mr.DATA_ATTR.title,""),a.setAttribute(Mr.DATA_ATTR.subtitle,""),e.innerHTML=t,o.appendChild(i),o.appendChild(a),e.appendChild(o),e}};Mr.isReadOnlySupported=!0,Mr.DATA_ATTR={wrapper:"data-blok-stub",title:"data-blok-stub-title",subtitle:"data-blok-stub-subtitle"};let Qd=Mr;class UC extends Sd{constructor(){super(...arguments),this.type=Ir.Inline}getMissingMethods(e){const t=this.constructable,o=t==null?void 0:t.prototype;return o?e.filter(i=>typeof o[i]!="function"):[...e]}create(){const e=this.constructable;return new e({api:this.api,config:this.settings})}get isReadOnlySupported(){var t;const e=this.constructable;return(t=e==null?void 0:e.isReadOnlySupported)!=null?t:!1}get title(){return this.constructable.title||""}}class WC extends Sd{constructor(){super(...arguments),this.type=Ir.Tune}create(e,t){const o=this.constructable;return new o({api:this.api,config:this.settings,block:t,data:e})}}class Ct extends Map{get blockTools(){const e=Array.from(this.entries()).filter(([,t])=>t.isBlock());return new Ct(e)}get inlineTools(){const e=Array.from(this.entries()).filter(([,t])=>t.isInline());return new Ct(e)}get blockTunes(){const e=Array.from(this.entries()).filter(([,t])=>t.isTune());return new Ct(e)}get internalTools(){const e=Array.from(this.entries()).filter(([,t])=>t.isInternal);return new Ct(e)}get externalTools(){const e=Array.from(this.entries()).filter(([,t])=>!t.isInternal);return new Ct(e)}}class KC extends Sd{constructor(){super(...arguments),this.type=Ir.Block,this.inlineTools=new Ct,this.tunes=new Ct}create(e,t,o){return new this.constructable({data:e,block:t,readOnly:o,api:this.api,config:this.settings})}get isReadOnlySupported(){return this.constructable[io.IsReadOnlySupported]===!0}get isLineBreaksEnabled(){var e;return(e=this.constructable[io.IsEnabledLineBreaks])!=null?e:!1}get toolbox(){const e=this.constructable[io.Toolbox],t=this.config[xs.Toolbox];if(!(!e||lt(e))&&t!==!1)return t==null?Array.isArray(e)?e:[e]:!Array.isArray(t)&&Array.isArray(e)?[t]:Array.isArray(t)?Array.isArray(e)?t.map((o,i)=>{const a=e[i];return a?be(be({},a),o):o}):t:[be(be({},e),t)]}get conversionConfig(){return this.constructable[io.ConversionConfig]}get enabledInlineTools(){return this.config[xs.EnabledInlineTools]||!1}get enabledBlockTunes(){return this.config[xs.EnabledBlockTunes]}get pasteConfig(){var e;return(e=this.constructable[io.PasteConfig])!=null?e:{}}get hasOnPasteHandler(){var t;const e=(t=this.constructable)==null?void 0:t.prototype;return typeof(e==null?void 0:e.onPaste)=="function"}get sanitizeConfig(){if(this._sanitizeConfig)return this._sanitizeConfig;const e=super.sanitizeConfig,t=this.baseSanitizeConfig;if(lt(e))return this._sanitizeConfig=t,t;const o={};for(const i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;const a=e[i];Ue(a)?o[i]=Object.assign({},t,a):o[i]=a}return this._sanitizeConfig=o,o}get baseSanitizeConfig(){if(this._baseSanitizeConfig)return this._baseSanitizeConfig;const e={};return Array.from(this.inlineTools.values()).forEach(t=>Object.assign(e,t.sanitizeConfig)),Array.from(this.tunes.values()).forEach(t=>Object.assign(e,t.sanitizeConfig)),this._baseSanitizeConfig=e,e}}class VC{constructor(e,t,o){this.api=o,this.config=e,this.blokConfig=t}get(e){const h=this.config[e],{class:t,isInternal:o=!1}=h,i=$w(h,["class","isInternal"]),a=t;if(a===void 0)throw new Error(`Tool "${e}" does not provide a class.`);const c=this.getConstructor(a),d=!!Reflect.get(a,Td.IsTune);return new c({name:e,constructable:a,config:i,api:this.api.getMethodsForTool(e,d),isDefault:e===this.blokConfig.defaultBlock,defaultPlaceholder:this.blokConfig.placeholder,isInternal:o})}getConstructor(e){switch(!0){case!!Reflect.get(e,py.IsInline):return UC;case!!Reflect.get(e,Td.IsTune):return WC;default:return KC}}}const rf=class rf{constructor({api:e}){this.api=e}render(){return{icon:kx,title:this.api.i18n.t("Delete"),name:"delete",confirmation:{title:this.api.i18n.t("Click to delete"),onActivate:()=>this.handleClick()}}}handleClick(){this.api.blocks.delete()}};rf.isTune=!0;let Zd=rf;const Or=l=>{if(!De(l))throw new Error("Tool constructable must be a function");return l};class $C extends Ae{constructor(){super(...arguments),this.stubTool="stub",this.factory=null,this.toolsAvailable=new Ct,this.toolsUnavailable=new Ct,this.inlineToolsSanitizeConfigCache=null}get available(){return this.toolsAvailable}get unavailable(){return this.toolsUnavailable}get inlineTools(){return this.available.inlineTools}get blockTools(){return this.available.blockTools}get blockTunes(){return this.available.blockTunes}get defaultTool(){const e=this.config.defaultBlock;if(!e)throw new Error("Default block tool name is not configured");const t=this.blockTools.get(e);if(!t)throw new Error(`Default block tool "${e}" not found in available block tools`);return t}get internal(){return this.available.internalTools}async prepare(){var h;const e=(h=this.config.tools)!=null?h:{};this.config.tools=Uo({},this.internalTools,e),this.validateTools();const t=this.config.tools;if(!t||Object.keys(t).length===0)throw Error("Can't start without tools");const o=this.prepareConfig(t);this.factory=new VC(o,this.config,this.Blok.API);const i=this.getListOfPrepareFunctions(o);if(i.length===0)return Promise.resolve();const a=g=>{this.isToolPrepareData(g)&&this.toolPrepareMethodSuccess({toolName:g.toolName})},c=g=>{this.isToolPrepareData(g)&&this.toolPrepareMethodFallback({toolName:g.toolName})},d=new Vy;i.forEach(g=>{d.add(async()=>{const v=kS(g.data)?{}:g.data;try{await g.function(g.data),a(v)}catch(y){c(v)}})}),await d.completed,this.prepareBlockTools()}getAllInlineToolsSanitizeConfig(){if(this.inlineToolsSanitizeConfigCache)return this.inlineToolsSanitizeConfigCache;const e={};return Array.from(this.inlineTools.values()).forEach(t=>{Object.assign(e,t.sanitizeConfig)}),this.inlineToolsSanitizeConfigCache=e,e}destroy(){for(const e of this.available.values()){const t=(()=>{try{return e.reset()}catch(o){Be(`Tool "${e.name}" reset failed`,"warn",o);return}})();t instanceof Promise&&t.catch(o=>{Be(`Tool "${e.name}" reset failed`,"warn",o)})}}get internalTools(){return{convertTo:{class:Or(Yd),isInternal:!0},link:{class:Or(qC),isInternal:!0},bold:{class:Or(Gd),isInternal:!0},italic:{class:Or(Xd),isInternal:!0},paragraph:{class:Or($d),inlineToolbar:!0,config:{preserveBlank:!0},isInternal:!0},stub:{class:Or(Qd),isInternal:!0},delete:{class:Or(Zd),isInternal:!0}}}toolPrepareMethodSuccess(e){const t=this.getFactory().get(e.toolName);if(!t.isInline()){this.toolsAvailable.set(t.name,t);return}const o=["render"],i=t.getMissingMethods(o);if(i.length){Be(`Incorrect Inline Tool: ${t.name}. Some of required methods is not implemented %o`,"warn",i),this.toolsUnavailable.set(t.name,t);return}this.toolsAvailable.set(t.name,t)}toolPrepareMethodFallback(e){const t=this.getFactory();this.toolsUnavailable.set(e.toolName,t.get(e.toolName))}getListOfPrepareFunctions(e){return Object.entries(e).map(([t,o])=>{var c;const i={toolName:t,config:(c=o.config)!=null?c:{}};return{function:async d=>{const h=o.class;if(!h||!De(h.prepare))return;const g=d!=null?d:i;return h.prepare.call(h,g)},data:i}})}prepareBlockTools(){Array.from(this.blockTools.values()).forEach(e=>{this.assignInlineToolsToBlockTool(e),this.assignBlockTunesToBlockTool(e)})}assignInlineToolsToBlockTool(e){const t=e;if(this.config.inlineToolbar!==!1){if(t.enabledInlineTools===!0){const o=Array.isArray(this.config.inlineToolbar)?this.createInlineToolsCollection(this.config.inlineToolbar):new Ct(Array.from(this.inlineTools.entries()));t.inlineTools=o;return}if(Array.isArray(t.enabledInlineTools)){const o=this.createInlineToolsCollection(["convertTo",...t.enabledInlineTools]);t.inlineTools=o}}}assignBlockTunesToBlockTool(e){const t=e;if(t.enabledBlockTunes!==!1){if(Array.isArray(t.enabledBlockTunes)){const o=this.createBlockTunesCollection(t.enabledBlockTunes),i=[...Array.from(o.entries()),...Array.from(this.blockTunes.internalTools.entries())];t.tunes=new Ct(i);return}if(Array.isArray(this.config.tunes)){const o=this.createBlockTunesCollection(this.config.tunes),i=[...Array.from(o.entries()),...Array.from(this.blockTunes.internalTools.entries())];t.tunes=new Ct(i);return}t.tunes=new Ct(Array.from(this.blockTunes.internalTools.entries()))}}validateTools(){const e=this.config.tools;if(!e)return;const t=this.internalTools;for(const o in e){if(!Object.prototype.hasOwnProperty.call(e,o)||o in t)continue;const i=e[o],a=De(i),d=De(i.class);if(!a&&!d)throw new Wo(`Tool «${o}» must be a constructor function or an object with function in the «class» property`)}}prepareConfig(e){const t={};for(const o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;const i=e[o];if(Ue(i)){t[o]=i;continue}t[o]={class:i}}return t}isToolPrepareData(e){const t=e;return typeof(t==null?void 0:t.toolName)=="string"}getFactory(){if(this.factory===null)throw new Error("Tools factory is not initialized");return this.factory}createInlineToolsCollection(e){const t=[];for(const o of e){const i=this.inlineTools.get(o);if(!i){Be(`Inline tool "${o}" is not available and will be skipped`,"warn");continue}t.push([o,i])}return new Ct(t)}createBlockTunesCollection(e){const t=[];for(const o of e){const i=this.blockTunes.get(o);if(!i){Be(`Block tune "${o}" is not available and will be skipped`,"warn");continue}t.push([o,i])}return new Ct(t)}}const GC=`*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:PT Mono,Menlo,Monaco,Consolas,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.\\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:651px){.\\!container{max-width:651px!important}.container{max-width:651px}}@media(min-width:768px){.\\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\\!container{max-width:1536px!important}.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-\\[auto_var\\(--offset\\)_calc\\(var\\(--offset\\)\\+env\\(safe-area-inset-bottom\\)\\)_var\\(--offset\\)\\]{inset:auto var(--offset) calc(var(--offset) + env(safe-area-inset-bottom)) var(--offset)}.bottom-0{bottom:0}.bottom-5{bottom:1.25rem}.left-0{left:0}.left-5{left:1.25rem}.left-\\[var\\(--popover-left\\)\\]{left:var(--popover-left)}.right-0{right:0}.right-\\[15px\\]{right:15px}.right-full{right:100%}.top-0{top:0}.top-\\[7px\\]{top:7px}.top-\\[var\\(--popover-top\\)\\]{top:var(--popover-top)}.z-0{z-index:0}.z-\\[1\\]{z-index:1}.z-\\[2\\]{z-index:2}.z-\\[3\\]{z-index:3}.z-\\[4\\]{z-index:4}.z-overlay{z-index:999}.m-0{margin:0}.mx-auto{margin-left:auto;margin-right:auto}.my-2\\.5{margin-top:.625rem;margin-bottom:.625rem}.my-4{margin-top:1rem;margin-bottom:1rem}.\\!mb-0{margin-bottom:0!important}.\\!mr-0{margin-right:0!important}.\\!mr-2{margin-right:.5rem!important}.mb-1\\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-\\[30px\\]{margin-bottom:30px}.mb-px{margin-bottom:1px}.ml-3\\.5{margin-left:.875rem}.ml-auto{margin-left:auto}.mr-2{margin-right:.5rem}.mr-auto{margin-right:auto}.mt-1{margin-top:.25rem}.mt-\\[15px\\]{margin-top:15px}.mt-\\[3px\\]{margin-top:3px}.mt-\\[5px\\]{margin-top:5px}.box-border{box-sizing:border-box}.\\!block{display:block!important}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.\\!hidden{display:none!important}.hidden{display:none}.h-2\\.5{height:.625rem}.h-9{height:2.25rem}.h-\\[26px\\]{height:26px}.h-\\[50px\\]{height:50px}.h-auto{height:auto}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-px{height:1px}.h-toolbox-btn{height:26px}.max-h-0{max-height:0px}.max-h-\\[var\\(--max-height\\)\\]{max-height:var(--max-height)}.min-h-toolbox-btn{min-height:26px}.w-2\\.5{width:.625rem}.w-7{width:1.75rem}.w-9{width:2.25rem}.w-\\[230px\\]{width:230px}.w-\\[26px\\]{width:26px}.w-\\[44px\\]{width:44px}.w-\\[var\\(--width\\)\\]{width:var(--width)}.w-auto{width:auto}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.w-px{width:1px}.w-toolbox-btn{width:26px}.min-w-\\[calc\\(100\\%-theme\\(\\'spacing\\.6\\'\\)-10px\\)\\]{min-width:calc(100% - 1.5rem - 10px)}.min-w-\\[calc\\(100\\%-var\\(--offset\\)\\*2\\)\\]{min-width:calc(100% - var(--offset) * 2)}.min-w-\\[var\\(--width\\)\\]{min-width:var(--width)}.min-w-max{min-width:-moz-max-content;min-width:max-content}.min-w-toolbox-btn{min-width:26px}.max-w-\\[1100px\\]{max-width:1100px}.max-w-\\[130px\\]{max-width:130px}.max-w-content{max-width:650px}.max-w-none{max-width:none}.shrink-0{flex-shrink:0}.-translate-x-\\[5px\\]{--tw-translate-x: -5px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-\\[5px\\]{--tw-translate-y: -5px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\\[5px\\]{--tw-translate-x: 5px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[5px\\]{--tw-translate-y: 5px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform-none{transform:none}@keyframes panelShowingMobile{0%{opacity:0;transform:translateY(14px) scale(.98)}70%{opacity:1;transform:translateY(-4px)}to{transform:translateY(0)}}.animate-\\[panelShowingMobile_250ms_ease\\]{animation:panelShowingMobile .25s ease}@keyframes panelShowing{0%{opacity:0;transform:translateY(-8px) scale(.9)}70%{opacity:1;transform:translateY(2px)}to{transform:translateY(0)}}.animate-\\[panelShowing_100ms_ease\\]{animation:panelShowing .1s ease}@keyframes buttonClicked{0%{transform:scale3d(.95,.95,.95)}60%{transform:scale3d(1.02,1.02,1.02)}80%,to{transform:scaleZ(1)}}.animate-button-clicked{animation:buttonClicked .75s cubic-bezier(.215,.61,.355,1) forwards}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.animate-fade-in{animation:fade-in .3s ease forwards}.animate-none{animation:none}@keyframes notifyBounceIn{0%{opacity:0;transform:scale(.3)}50%{opacity:1;transform:scale(1.05)}70%{transform:scale(.9)}to{transform:scale(1)}}.animate-notify-bounce-in{animation:notifyBounceIn .6s 1}@keyframes wobble{0%{transform:translateZ(0)}15%{transform:translate3d(-9%,0,0)}30%{transform:translate3d(9%,0,0)}45%{transform:translate3d(-4%,0,0)}60%{transform:translate3d(4%,0,0)}75%{transform:translate3d(-1%,0,0)}to{transform:translateZ(0)}}.animate-wobble{animation:wobble .4s}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-\\[auto_auto_1fr\\]{grid-template-columns:auto auto 1fr}.grid-rows-\\[auto\\]{grid-template-rows:auto}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.items-center{align-items:center}.justify-center{justify-content:center}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-\\[10px\\]{border-radius:10px}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[5px\\]{border-radius:5px}.rounded-\\[7px\\]{border-radius:7px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.border{border-width:1px}.border-0{border-width:0px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-none{border-style:none}.border-\\[\\#e8e8eb\\]{--tw-border-opacity: 1;border-color:rgb(232 232 235 / var(--tw-border-opacity, 1))}.border-\\[rgba\\(226\\,226\\,229\\,0\\.2\\)\\],.border-\\[rgba\\(226\\,226\\,229\\,0\\.20\\)\\]{border-color:#e2e2e533}.border-line-gray,.border-popover-border{--tw-border-opacity: 1;border-color:rgb(239 240 241 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.\\!bg-\\[\\#fafffe\\]{--tw-bg-opacity: 1 !important;background-color:rgb(250 255 254 / var(--tw-bg-opacity, 1))!important}.\\!bg-\\[\\#fffbfb\\]{--tw-bg-opacity: 1 !important;background-color:rgb(255 251 251 / var(--tw-bg-opacity, 1))!important}.\\!bg-item-confirm-bg{--tw-bg-opacity: 1 !important;background-color:rgb(226 74 74 / var(--tw-bg-opacity, 1))!important}.\\!bg-item-focus-bg{background-color:#22baff14!important}.bg-\\[\\#34c992\\]{--tw-bg-opacity: 1;background-color:rgb(52 201 146 / var(--tw-bg-opacity, 1))}.bg-\\[\\#7b8799\\]{--tw-bg-opacity: 1;background-color:rgb(123 135 153 / var(--tw-bg-opacity, 1))}.bg-\\[\\#F8F8F8\\]{--tw-bg-opacity: 1;background-color:rgb(248 248 248 / var(--tw-bg-opacity, 1))}.bg-\\[\\#eff1f4\\]{--tw-bg-opacity: 1;background-color:rgb(239 241 244 / var(--tw-bg-opacity, 1))}.bg-\\[\\#f2f5f7\\]{--tw-bg-opacity: 1;background-color:rgb(242 245 247 / var(--tw-bg-opacity, 1))}.bg-\\[\\#f7f7f7\\]{--tw-bg-opacity: 1;background-color:rgb(247 247 247 / var(--tw-bg-opacity, 1))}.bg-bg-light{--tw-bg-opacity: 1;background-color:rgb(239 242 245 / var(--tw-bg-opacity, 1))}.bg-dark{--tw-bg-opacity: 1;background-color:rgb(29 32 43 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-icon-active-bg{background-color:#388ae51a}.bg-item-confirm-hover-bg{--tw-bg-opacity: 1;background-color:rgb(206 67 67 / var(--tw-bg-opacity, 1))}.bg-item-focus-bg{background-color:#22baff14}.bg-item-hover-bg{--tw-bg-opacity: 1;background-color:rgb(248 248 248 / var(--tw-bg-opacity, 1))}.bg-popover-bg{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-popover-border{--tw-bg-opacity: 1;background-color:rgb(239 240 241 / var(--tw-bg-opacity, 1))}.bg-selection{--tw-bg-opacity: 1;background-color:rgb(225 242 255 / var(--tw-bg-opacity, 1))}.bg-selection-highlight{background-color:#2eaadc33}.bg-tooltip-bg{--tw-bg-opacity: 1;background-color:rgb(29 32 43 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-\\[13px\\]{padding:13px}.p-\\[2px\\]{padding:2px}.p-\\[3px\\]{padding:3px}.p-\\[5px\\]{padding:5px}.p-\\[var\\(--item-padding\\)\\]{padding:var(--item-padding)}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-\\[18px\\]{padding-left:18px;padding-right:18px}.px-\\[30px\\]{padding-left:30px;padding-right:30px}.px-\\[3px\\]{padding-left:3px;padding-right:3px}.py-0{padding-top:0;padding-bottom:0}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-\\[0\\.6em\\]{padding-top:.6em;padding-bottom:.6em}.py-\\[13px\\]{padding-top:13px;padding-bottom:13px}.py-\\[3px\\]{padding-top:3px;padding-bottom:3px}.py-\\[5px\\]{padding-top:5px;padding-bottom:5px}.py-\\[theme\\(spacing\\.block-padding-vertical\\)\\]{padding-top:.4em;padding-bottom:.4em}.pb-\\[3px\\]{padding-bottom:3px}.pr-1\\.5{padding-right:.375rem}.pr-\\[5px\\]{padding-right:5px}.text-center{text-align:center}.text-start{text-align:start}.align-bottom{vertical-align:bottom}.font-\\[-apple-system\\,BlinkMacSystemFont\\,\\"Segoe_UI\\"\\,\\"Roboto\\"\\,\\"Oxygen\\"\\,\\"Ubuntu\\"\\,\\"Cantarell\\"\\,\\"Fira_Sans\\"\\,\\"Droid_Sans\\"\\,\\"Helvetica_Neue\\"\\,sans-serif\\]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.font-\\[inherit\\]{font-family:inherit}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-\\[1\\.25em\\]{font-size:1.25em}.text-\\[1\\.5em\\]{font-size:1.5em}.text-\\[1\\.75em\\]{font-size:1.75em}.text-\\[13px\\]{font-size:13px}.text-\\[14\\.9px\\]{font-size:14.9px}.text-\\[2\\.5em\\]{font-size:2.5em}.text-\\[2em\\]{font-size:2em}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-5{line-height:1.25rem}.leading-\\[1\\.25em\\]{line-height:1.25em}.leading-\\[1\\.4em\\]{line-height:1.4em}.leading-\\[1\\.6em\\]{line-height:1.6em}.leading-\\[1em\\]{line-height:1em}.leading-\\[22px\\]{line-height:22px}.leading-\\[50px\\]{line-height:50px}.leading-normal{line-height:1.5}.leading-relaxed{line-height:1.625}.tracking-\\[-0\\.1em\\]{letter-spacing:-.1em}.tracking-\\[0\\.02em\\]{letter-spacing:.02em}.\\!text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity, 1))!important}.text-\\[\\#656b7c\\]{--tw-text-opacity: 1;color:rgb(101 107 124 / var(--tw-text-opacity, 1))}.text-active-icon{--tw-text-opacity: 1;color:rgb(56 138 229 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-dark{--tw-text-opacity: 1;color:rgb(29 32 43 / var(--tw-text-opacity, 1))}.text-gray-text{--tw-text-opacity: 1;color:rgb(112 118 132 / var(--tw-text-opacity, 1))}.text-icon-active-text{--tw-text-opacity: 1;color:rgb(56 138 229 / var(--tw-text-opacity, 1))}.text-inherit{color:inherit}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-text-primary{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-text-secondary{--tw-text-opacity: 1;color:rgb(112 118 132 / var(--tw-text-opacity, 1))}.text-tooltip-font{--tw-text-opacity: 1;color:rgb(205 209 224 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.no-underline{text-decoration-line:none}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-55{opacity:.55}.opacity-60{opacity:.6}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_11px_17px_0_rgba\\(23\\,32\\,61\\,0\\.13\\)\\]{--tw-shadow: 0 11px 17px 0 rgba(23,32,61,.13);--tw-shadow-colored: 0 11px 17px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_1px_1px_0_rgba\\(18\\,49\\,35\\,0\\.05\\)\\]{--tw-shadow: 0 1px 1px 0 rgba(18,49,35,.05);--tw-shadow-colored: 0 1px 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_2px_1px_0_rgba\\(16\\,19\\,29\\,0\\)\\]{--tw-shadow: 0 2px 1px 0 rgba(16,19,29,0);--tw-shadow-colored: 0 2px 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_3px_15px_-3px_theme\\(colors\\.popover-shadow\\)\\]{--tw-shadow: 0 3px 15px -3px rgba(13, 20, 33, .1);--tw-shadow-colored: 0 3px 15px -3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-button-base{--tw-shadow: 0 2px 2px 0 rgba(18, 30, 57, .04);--tw-shadow-colored: 0 2px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-button-focused{--tw-shadow: inset 0 0 0 1px rgba(7, 161, 227, .08);--tw-shadow-colored: inset 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-input{--tw-shadow: inset 0 1px 2px 0 rgba(35, 44, 72, .06);--tw-shadow-colored: inset 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-tooltip{--tw-shadow: 0 8px 12px 0 rgba(29, 32, 43, .17), 0 4px 5px -3px rgba(5, 6, 12, .49);--tw-shadow-colored: 0 8px 12px 0 var(--tw-shadow-color), 0 4px 5px -3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[opacity\\,transform\\]{transition-property:opacity,transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-\\[120ms\\]{transition-duration:.12s}.duration-\\[250ms\\]{transition-duration:.25s}.duration-\\[50ms\\,70ms\\]{transition-duration:50ms,70ms}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-linear{transition-timing-function:linear}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.will-change-\\[opacity\\,left\\,top\\]{will-change:opacity,left,top}.will-change-\\[opacity\\,top\\,left\\]{will-change:opacity,top,left}.will-change-\\[opacity\\,top\\]{will-change:opacity,top}.will-change-\\[opacity\\]{will-change:opacity}.\\[direction\\:rtl\\]{direction:rtl}.placeholder\\:font-medium::-moz-placeholder{font-weight:500}.placeholder\\:font-medium::placeholder{font-weight:500}.placeholder\\:text-\\[\\#656b7c\\]::-moz-placeholder{--tw-text-opacity: 1;color:rgb(101 107 124 / var(--tw-text-opacity, 1))}.placeholder\\:text-\\[\\#656b7c\\]::placeholder{--tw-text-opacity: 1;color:rgb(101 107 124 / var(--tw-text-opacity, 1))}.placeholder\\:text-gray-text::-moz-placeholder{--tw-text-opacity: 1;color:rgb(112 118 132 / var(--tw-text-opacity, 1))}.placeholder\\:text-gray-text::placeholder{--tw-text-opacity: 1;color:rgb(112 118 132 / var(--tw-text-opacity, 1))}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:inset-0:before{content:var(--tw-content);inset:0}.before\\:left-0:before{content:var(--tw-content);left:0}.before\\:left-1\\/2:before{content:var(--tw-content);left:50%}.before\\:left-\\[9px\\]:before{content:var(--tw-content);left:9px}.before\\:top-0:before{content:var(--tw-content);top:0}.before\\:top-1\\/2:before{content:var(--tw-content);top:50%}.before\\:top-\\[5px\\]:before{content:var(--tw-content);top:5px}.before\\:-z-10:before{content:var(--tw-content);z-index:-10}.before\\:m-\\[3px\\]:before{content:var(--tw-content);margin:3px}.before\\:-ml-\\[11px\\]:before{content:var(--tw-content);margin-left:-11px}.before\\:-mt-\\[11px\\]:before{content:var(--tw-content);margin-top:-11px}.before\\:block:before{content:var(--tw-content);display:block}.before\\:h-3:before{content:var(--tw-content);height:.75rem}.before\\:h-\\[18px\\]:before{content:var(--tw-content);height:18px}.before\\:h-\\[calc\\(100\\%-6px\\)\\]:before{content:var(--tw-content);height:calc(100% - 6px)}.before\\:w-0\\.5:before{content:var(--tw-content);width:.125rem}.before\\:w-\\[18px\\]:before{content:var(--tw-content);width:18px}.before\\:w-\\[3px\\]:before{content:var(--tw-content);width:3px}.before\\:rotate-\\[-45deg\\]:before{content:var(--tw-content);--tw-rotate: -45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes rotation{0%{content:var(--tw-content);transform:rotate(0)}to{content:var(--tw-content);transform:rotate(360deg)}}.before\\:animate-rotation:before{content:var(--tw-content);animation:rotation 1.2s infinite linear}.before\\:rounded-\\[5px\\]:before{content:var(--tw-content);border-radius:5px}.before\\:rounded-full:before{content:var(--tw-content);border-radius:9999px}.before\\:rounded-lg:before{content:var(--tw-content);border-radius:.5rem}.before\\:border-2:before{content:var(--tw-content);border-width:2px}.before\\:border-line-gray:before{content:var(--tw-content);--tw-border-opacity: 1;border-color:rgb(239 240 241 / var(--tw-border-opacity, 1))}.before\\:border-l-active-icon:before{content:var(--tw-content);--tw-border-opacity: 1;border-left-color:rgb(56 138 229 / var(--tw-border-opacity, 1))}.before\\:\\!bg-\\[\\#41ffb1\\]:before{content:var(--tw-content);--tw-bg-opacity: 1 !important;background-color:rgb(65 255 177 / var(--tw-bg-opacity, 1))!important}.before\\:\\!bg-\\[\\#fb5d5d\\]:before{content:var(--tw-content);--tw-bg-opacity: 1 !important;background-color:rgb(251 93 93 / var(--tw-bg-opacity, 1))!important}.before\\:bg-\\[\\#575d67\\]:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(87 93 103 / var(--tw-bg-opacity, 1))}.before\\:bg-tooltip-bg:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(29 32 43 / var(--tw-bg-opacity, 1))}.before\\:bg-transparent:before{content:var(--tw-content);background-color:transparent}.before\\:content-\\[\\"\\"\\]:before{--tw-content: "";content:var(--tw-content)}.before\\:content-\\[\\\\\\'\\\\\\'\\]:before{--tw-content: \\'\\';content:var(--tw-content)}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:left-\\[9px\\]:after{content:var(--tw-content);left:9px}.after\\:top-\\[5px\\]:after{content:var(--tw-content);top:5px}.after\\:mx-3:after{content:var(--tw-content);margin-left:.75rem;margin-right:.75rem}.after\\:h-3:after{content:var(--tw-content);height:.75rem}.after\\:w-0\\.5:after{content:var(--tw-content);width:.125rem}.after\\:rotate-45:after{content:var(--tw-content);--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.after\\:bg-\\[\\#575d67\\]:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(87 93 103 / var(--tw-bg-opacity, 1))}.after\\:text-\\[\\#ddd\\]:after{content:var(--tw-content);--tw-text-opacity: 1;color:rgb(221 221 221 / var(--tw-text-opacity, 1))}.after\\:content-\\[\\"\\"\\]:after{--tw-content: "";content:var(--tw-content)}.after\\:content-\\[\\'\\|\\'\\]:after{--tw-content: "|";content:var(--tw-content)}.first\\:mt-0:first-child{margin-top:0}.last\\:ml-2\\.5:last-child{margin-left:.625rem}.empty\\:before\\:pointer-events-none:empty:before{content:var(--tw-content);pointer-events:none}.empty\\:before\\:cursor-text:empty:before{content:var(--tw-content);cursor:text}.empty\\:before\\:text-gray-text:empty:before{content:var(--tw-content);--tw-text-opacity: 1;color:rgb(112 118 132 / var(--tw-text-opacity, 1))}.empty\\:before\\:content-\\[attr\\(data-blok-placeholder\\)\\]:empty:before{--tw-content: attr(data-blok-placeholder);content:var(--tw-content)}.empty\\:before\\:content-\\[attr\\(data-placeholder-active\\)\\]:empty:before{--tw-content: attr(data-placeholder-active);content:var(--tw-content)}.hover\\:bg-\\[\\#2db583\\]:hover{--tw-bg-opacity: 1;background-color:rgb(45 181 131 / var(--tw-bg-opacity, 1))}.hover\\:bg-\\[\\#e0e4eb\\]:hover{--tw-bg-opacity: 1;background-color:rgb(224 228 235 / var(--tw-bg-opacity, 1))}.hover\\:bg-\\[\\#e9ecee\\]:hover{--tw-bg-opacity: 1;background-color:rgb(233 236 238 / var(--tw-bg-opacity, 1))}.hover\\:bg-\\[\\#fbfcfe\\]:hover{--tw-bg-opacity: 1;background-color:rgb(251 252 254 / var(--tw-bg-opacity, 1))}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-button-base-hover:hover{--tw-shadow: 0 1px 3px 0 rgba(18, 30, 57, .08);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\\:placeholder\\:text-\\[rgba\\(101\\,107\\,124\\,0\\.3\\)\\]:focus::-moz-placeholder{color:#656b7c4d}.focus\\:placeholder\\:text-\\[rgba\\(101\\,107\\,124\\,0\\.3\\)\\]:focus::placeholder{color:#656b7c4d}.active\\:cursor-grabbing:active{cursor:grabbing}.group.is-dragging .group-\\[\\.is-dragging\\]\\:pointer-events-none{pointer-events:none}.group.blok-editor--rtl .group-\\[\\.blok-editor--rtl\\]\\:left-\\[calc\\(-1\\*theme\\(width\\.toolbox-btn\\)\\)\\]{left:-26px}.group.blok-editor--rtl .group-\\[\\.blok-editor--rtl\\]\\:left-auto{left:auto}.group.blok-editor--rtl .group-\\[\\.blok-editor--rtl\\]\\:right-\\[calc\\(-1\\*theme\\(width\\.toolbox-btn\\)\\)\\]{right:-26px}.group.blok-editor--rtl .group-\\[\\.blok-editor--rtl\\]\\:right-auto{right:auto}.group.is-dragging .group-\\[\\.is-dragging\\]\\:cursor-grabbing{cursor:grabbing}@media(max-width:650px){.mobile\\:absolute{position:absolute}.mobile\\:right-auto{right:auto}.mobile\\:z-\\[2\\]{z-index:2}.mobile\\:hidden{display:none}.mobile\\:h-icon-mobile{height:28px}.mobile\\:h-toolbox-btn-mobile{height:36px}.mobile\\:w-icon-mobile{width:28px}.mobile\\:w-toolbox-btn-mobile{width:36px}.mobile\\:rounded-\\[6px\\]{border-radius:6px}.mobile\\:rounded-lg{border-radius:.5rem}.mobile\\:border{border-width:1px}.mobile\\:border-\\[\\#e8e8eb\\]{--tw-border-opacity: 1;border-color:rgb(232 232 235 / var(--tw-border-opacity, 1))}.mobile\\:bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.mobile\\:p-1{padding:.25rem}.mobile\\:text-\\[15px\\]{font-size:15px}.mobile\\:font-medium{font-weight:500}.mobile\\:shadow-overlay-pane{--tw-shadow: 0 3px 15px -3px rgba(13, 20, 33, .13);--tw-shadow-colored: 0 3px 15px -3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group.blok-editor--rtl .mobile\\:group-\\[\\.blok-editor--rtl\\]\\:ml-0{margin-left:0}.group.blok-editor--rtl .mobile\\:group-\\[\\.blok-editor--rtl\\]\\:mr-auto{margin-right:auto}.group.blok-editor--rtl .mobile\\:group-\\[\\.blok-editor--rtl\\]\\:pl-\\[10px\\]{padding-left:10px}.group.blok-editor--rtl .mobile\\:group-\\[\\.blok-editor--rtl\\]\\:pr-0{padding-right:0}}@media(min-width:651px){.not-mobile\\:w-6{width:1.5rem}.group.blok-editor--narrow.blok-editor--rtl .not-mobile\\:group-\\[\\.blok-editor--narrow\\.blok-editor--rtl\\]\\:left-0{left:0}.group.blok-editor--narrow.blok-editor--rtl .not-mobile\\:group-\\[\\.blok-editor--narrow\\.blok-editor--rtl\\]\\:left-\\[-5px\\]{left:-5px}.group.blok-editor--narrow.blok-editor--rtl .not-mobile\\:group-\\[\\.blok-editor--narrow\\.blok-editor--rtl\\]\\:left-\\[calc\\(-1\\*theme\\(spacing\\.narrow-mode-right-padding\\)-5px\\)\\]{left:-55px}.group.blok-editor--narrow.blok-editor--rtl .not-mobile\\:group-\\[\\.blok-editor--narrow\\.blok-editor--rtl\\]\\:right-\\[5px\\]{right:5px}.group.blok-editor--narrow.blok-editor--rtl .not-mobile\\:group-\\[\\.blok-editor--narrow\\.blok-editor--rtl\\]\\:right-auto{right:auto}.group.blok-editor--narrow .not-mobile\\:group-\\[\\.blok-editor--narrow\\]\\:left-\\[5px\\]{left:5px}.group.blok-editor--narrow .not-mobile\\:group-\\[\\.blok-editor--narrow\\]\\:right-\\[calc\\(-1\\*theme\\(spacing\\.narrow-mode-right-padding\\)-5px\\)\\]{right:-55px}.group.blok-editor--narrow.blok-editor--rtl .not-mobile\\:group-\\[\\.blok-editor--narrow\\.blok-editor--rtl\\]\\:ml-\\[theme\\(spacing\\.narrow-mode-right-padding\\)\\]{margin-left:50px}.group.blok-editor--narrow.blok-editor--rtl .not-mobile\\:group-\\[\\.blok-editor--narrow\\.blok-editor--rtl\\]\\:mr-0{margin-right:0}.group.blok-editor--narrow .not-mobile\\:group-\\[\\.blok-editor--narrow\\]\\:mr-\\[theme\\(spacing\\.narrow-mode-right-padding\\)\\]{margin-right:50px}}@media(hover:hover){.can-hover\\:hover\\:cursor-grab:hover{cursor:grab}.can-hover\\:hover\\:cursor-pointer:hover{cursor:pointer}.can-hover\\:hover\\:bg-bg-light:hover{--tw-bg-opacity: 1;background-color:rgb(239 242 245 / var(--tw-bg-opacity, 1))}.can-hover\\:hover\\:bg-item-hover-bg:hover{--tw-bg-opacity: 1;background-color:rgb(248 248 248 / var(--tw-bg-opacity, 1))}.group.is-toolbox-opened .group-\\[\\.is-toolbox-opened\\]\\:can-hover\\:hover\\:cursor-pointer:hover{cursor:pointer}}.\\[\\&\\.is-dragging\\]\\:cursor-grabbing.is-dragging{cursor:grabbing}.\\[\\&\\.is-toolbox-opened_\\[contentEditable\\=true\\]\\[data-blok-placeholder\\]\\:focus\\]\\:before\\:\\!opacity-0.is-toolbox-opened [contentEditable=true][data-blok-placeholder]:focus:before{content:var(--tw-content);opacity:0!important}.\\[\\&\\:\\:-webkit-input-placeholder\\]\\:\\!leading-normal::-webkit-input-placeholder{line-height:1.5!important}.\\[\\&\\>p\\:first-of-type\\]\\:mt-0>p:first-of-type{margin-top:0}.\\[\\&\\>p\\:last-of-type\\]\\:mb-0>p:last-of-type{margin-bottom:0}.\\[\\&\\[data-blok-empty\\=true\\]\\]\\:before\\:pointer-events-none[data-blok-empty=true]:before{content:var(--tw-content);pointer-events:none}.\\[\\&\\[data-blok-empty\\=true\\]\\]\\:before\\:cursor-text[data-blok-empty=true]:before{content:var(--tw-content);cursor:text}.\\[\\&\\[data-blok-empty\\=true\\]\\]\\:before\\:text-gray-text[data-blok-empty=true]:before{content:var(--tw-content);--tw-text-opacity: 1;color:rgb(112 118 132 / var(--tw-text-opacity, 1))}.\\[\\&\\[data-blok-empty\\=true\\]\\]\\:before\\:content-\\[attr\\(data-blok-placeholder\\)\\][data-blok-empty=true]:before{--tw-content: attr(data-blok-placeholder);content:var(--tw-content)}.\\[\\&\\[data-blok-focused\\=\\"true\\"\\]\\]\\:bg-item-focus-bg[data-blok-focused=true]{background-color:#22baff14}.\\[\\&\\[data-blok-force-hover\\]\\]\\:cursor-pointer[data-blok-force-hover]{cursor:pointer}.\\[\\&\\[data-blok-force-hover\\]\\]\\:bg-item-hover-bg[data-blok-force-hover]{--tw-bg-opacity: 1;background-color:rgb(248 248 248 / var(--tw-bg-opacity, 1))}.\\[\\&\\[data-blok-placeholder\\]\\]\\:before\\:pointer-events-none[data-blok-placeholder]:before{content:var(--tw-content);pointer-events:none}.\\[\\&\\[data-blok-placeholder\\]\\]\\:before\\:\\!static[data-blok-placeholder]:before{content:var(--tw-content);position:static!important}.\\[\\&\\[data-blok-placeholder\\]\\]\\:before\\:inline-block[data-blok-placeholder]:before{content:var(--tw-content);display:inline-block}.\\[\\&\\[data-blok-placeholder\\]\\]\\:before\\:w-0[data-blok-placeholder]:before{content:var(--tw-content);width:0px}.\\[\\&\\[data-blok-placeholder\\]\\]\\:before\\:whitespace-nowrap[data-blok-placeholder]:before{content:var(--tw-content);white-space:nowrap}.\\[\\&\\[data-blok-popover-item-no-hover\\]\\]\\:cursor-default[data-blok-popover-item-no-hover]{cursor:default}.\\[\\&\\[data-blok-popover-item-no-hover\\]\\]\\:hover\\:bg-transparent:hover[data-blok-popover-item-no-hover]{background-color:transparent}.\\[\\&\\[data-empty\\=true\\]\\]\\:before\\:pointer-events-none[data-empty=true]:before{content:var(--tw-content);pointer-events:none}.\\[\\&\\[data-empty\\=true\\]\\]\\:before\\:cursor-text[data-empty=true]:before{content:var(--tw-content);cursor:text}.\\[\\&\\[data-empty\\=true\\]\\]\\:before\\:text-gray-text[data-empty=true]:before{content:var(--tw-content);--tw-text-opacity: 1;color:rgb(112 118 132 / var(--tw-text-opacity, 1))}.\\[\\&\\[data-empty\\=true\\]\\]\\:before\\:content-\\[attr\\(data-placeholder-active\\)\\][data-empty=true]:before{--tw-content: attr(data-placeholder-active);content:var(--tw-content)}.\\[\\&_\\.blok-stub\\]\\:opacity-55 .blok-stub{opacity:.55}.\\[\\&_\\:\\:selection\\]\\:bg-selection-inline ::-moz-selection{--tw-bg-opacity: 1;background-color:rgb(212 236 255 / var(--tw-bg-opacity, 1))}.\\[\\&_\\:\\:selection\\]\\:bg-selection-inline ::selection{--tw-bg-opacity: 1;background-color:rgb(212 236 255 / var(--tw-bg-opacity, 1))}.\\[\\&_\\[contenteditable\\]\\:empty\\]\\:after\\:content-\\[\\"\\\\\\\\feff_\\"\\] [contenteditable]:empty:after{--tw-content: "\\\\feff ";content:var(--tw-content)}.\\[\\&_\\[contenteditable\\]\\]\\:select-none [contenteditable]{-webkit-user-select:none;-moz-user-select:none;user-select:none}.\\[\\&_\\[hidden\\]\\]\\:\\!hidden [hidden]{display:none!important}.\\[\\&_a\\]\\:cursor-pointer a{cursor:pointer}.\\[\\&_a\\]\\:text-link a{--tw-text-opacity: 1;color:rgb(56 138 229 / var(--tw-text-opacity, 1))}.\\[\\&_a\\]\\:underline a{text-decoration-line:underline}.\\[\\&_b\\]\\:font-bold b{font-weight:700}.\\[\\&_div\\]\\:\\!m-0 div{margin:0!important}.\\[\\&_div\\]\\:\\!p-0 div{padding:0!important}.\\[\\&_i\\]\\:italic i{font-style:italic}.\\[\\&_img\\]\\:opacity-55 img{opacity:.55}.\\[\\&_p\\]\\:\\!m-0 p{margin:0!important}.\\[\\&_p\\]\\:\\!p-0 p{padding:0!important}.\\[\\&_path\\]\\:stroke-current path{stroke:currentColor}.\\[\\&_svg\\]\\:-mt-0\\.5 svg{margin-top:-.125rem}.\\[\\&_svg\\]\\:mr-\\[0\\.2em\\] svg{margin-right:.2em}.\\[\\&_svg\\]\\:block svg{display:block}.\\[\\&_svg\\]\\:size-icon svg{width:20px;height:20px}.\\[\\&_svg\\]\\:h-5 svg{height:1.25rem}.\\[\\&_svg\\]\\:h-6 svg{height:1.5rem}.\\[\\&_svg\\]\\:h-7 svg{height:1.75rem}.\\[\\&_svg\\]\\:h-auto svg{height:auto}.\\[\\&_svg\\]\\:h-icon svg{height:20px}.\\[\\&_svg\\]\\:max-h-full svg{max-height:100%}.\\[\\&_svg\\]\\:w-6 svg{width:1.5rem}.\\[\\&_svg\\]\\:w-7 svg{width:1.75rem}.\\[\\&_svg\\]\\:w-auto svg{width:auto}.\\[\\&_svg\\]\\:w-icon svg{width:20px}.\\[\\&_svg\\]\\:text-gray-text svg{--tw-text-opacity: 1;color:rgb(112 118 132 / var(--tw-text-opacity, 1))}@media(max-width:650px){.mobile\\:\\[\\&_svg\\]\\:h-icon-mobile svg{height:28px}.mobile\\:\\[\\&_svg\\]\\:w-icon-mobile svg{width:28px}}`;class XC extends Ae{constructor(){super(...arguments),this.isMobile=!1,this.contentRectCache=null,this.resizeDebouncer=fv(()=>{this.windowResize()},200),this.selectionChangeDebounced=fv(()=>{this.selectionChanged()},X1),this.documentTouchedListener=e=>{this.documentTouched(e)}}get CSS(){return{blokWrapper:"blok-editor",blokWrapperNarrow:"blok-editor--narrow",blokZone:"blok-editor__redactor",blokZoneHidden:"is-hidden",blokEmpty:"is-empty",blokRtlFix:"blok-editor--rtl",blokDragging:"is-dragging"}}get contentRect(){if(this.contentRectCache!==null)return this.contentRectCache;const e=this.nodes.wrapper.querySelector('[data-blok-testid="block-content"]');return e?(this.contentRectCache=e.getBoundingClientRect(),this.contentRectCache):{width:650,left:0,right:0}}async prepare(){this.setIsMobile(),this.make(),this.loadStyles()}toggleReadOnly(e){if(e){this.unbindReadOnlySensitiveListeners();return}const t=()=>{this.bindReadOnlySensitiveListeners()};t();const o=window.requestIdleCallback;typeof o=="function"&&o(t,{timeout:2e3})}checkEmptiness(){const{BlockManager:e}=this.Blok;this.nodes.wrapper.classList.toggle(this.CSS.blokEmpty,e.isBlokEmpty),this.nodes.wrapper.setAttribute("data-blok-empty",e.isBlokEmpty?"true":"false")}get someToolbarOpened(){const{Toolbar:e,BlockSettings:t,InlineToolbar:o}=this.Blok;return!!(t.opened||o.opened||e.toolbox.opened)}get someFlipperButtonFocused(){return this.Blok.Toolbar.toolbox.hasFocus()?!0:Object.entries(this.Blok).filter(([e,t])=>t.flipper instanceof Qn).some(([e,t])=>t.flipper.hasFocus())}destroy(){this.nodes.holder.innerHTML="",this.unbindReadOnlyInsensitiveListeners()}closeAllToolbars(){const{Toolbar:e,BlockSettings:t,InlineToolbar:o}=this.Blok;t.close(),o.close(),e.toolbox.close()}setIsMobile(){const e=window.innerWidth<gv;e!==this.isMobile&&this.eventsDispatcher.emit(Go,{isEnabled:this.isMobile}),this.isMobile=e}make(){const e=this.config.holder;if(!e)throw new Error("Blok holder is not specified in the configuration.");this.nodes.holder=R.getHolder(e),this.nodes.wrapper=R.make("div",[this.CSS.blokWrapper,"group","relative","box-border","z-[1]","[&.is-dragging]:cursor-grabbing","[&_svg]:max-h-full","[&_path]:stroke-current","[&_::selection]:bg-selection-inline","[&.is-toolbox-opened_[contentEditable=true][data-blok-placeholder]:focus]:before:!opacity-0",...this.isRtl?[this.CSS.blokRtlFix,"[direction:rtl]"]:[]]),this.nodes.wrapper.setAttribute(ro,Q1),this.nodes.wrapper.setAttribute("data-blok-testid","blok-editor"),this.nodes.redactor=R.make("div",[this.CSS.blokZone,"not-mobile:group-[.blok-editor--narrow]:mr-[theme(spacing.narrow-mode-right-padding)]","not-mobile:group-[.blok-editor--narrow.blok-editor--rtl]:ml-[theme(spacing.narrow-mode-right-padding)]","not-mobile:group-[.blok-editor--narrow.blok-editor--rtl]:mr-0",'[&_[contenteditable]:empty]:after:content-["\\feff_"]']),this.nodes.redactor.setAttribute("data-blok-testid","redactor"),this.nodes.holder.offsetWidth<this.contentRect.width&&(this.nodes.wrapper.classList.add(this.CSS.blokWrapperNarrow),this.nodes.wrapper.setAttribute("data-blok-narrow","true")),this.nodes.redactor.style.paddingBottom=this.config.minHeight+"px",this.nodes.wrapper.appendChild(this.nodes.redactor),this.nodes.holder.appendChild(this.nodes.wrapper),this.bindReadOnlyInsensitiveListeners()}loadStyles(){const e="blok-styles";if(R.get(e))return;const t=R.make("style",null,{id:e,textContent:GC.toString()});this.config.style&&!lt(this.config.style)&&this.config.style.nonce&&t.setAttribute("nonce",this.config.style.nonce),R.prepend(document.head,t)}bindReadOnlyInsensitiveListeners(){this.listeners.on(document,"selectionchange",this.selectionChangeDebounced),this.listeners.on(window,"resize",this.resizeDebouncer,{passive:!0}),this.listeners.on(this.nodes.redactor,"mousedown",this.documentTouchedListener,{capture:!0,passive:!0}),this.listeners.on(this.nodes.redactor,"touchstart",this.documentTouchedListener,{capture:!0,passive:!0})}unbindReadOnlyInsensitiveListeners(){this.listeners.off(document,"selectionchange",this.selectionChangeDebounced),this.listeners.off(window,"resize",this.resizeDebouncer),this.listeners.off(this.nodes.redactor,"mousedown",this.documentTouchedListener),this.listeners.off(this.nodes.redactor,"touchstart",this.documentTouchedListener)}bindReadOnlySensitiveListeners(){this.readOnlyMutableListeners.on(this.nodes.redactor,"click",e=>{e instanceof MouseEvent&&this.redactorClicked(e)},!1),this.readOnlyMutableListeners.on(document,"keydown",e=>{e instanceof KeyboardEvent&&this.documentKeydown(e)},!0),this.readOnlyMutableListeners.on(document,"mousedown",e=>{e instanceof MouseEvent&&this.documentClicked(e)},!0),this.watchBlockHoveredEvents(),this.enableInputsEmptyMark()}watchBlockHoveredEvents(){const e={lastHovered:null},o=ju(i=>{var g;const a=typeof MouseEvent!="undefined"&&i instanceof MouseEvent,c=typeof TouchEvent!="undefined"&&i instanceof TouchEvent;if(!a&&!c)return;const d=(g=i.target)==null?void 0:g.closest('[data-blok-testid="block-wrapper"]');if(this.Blok.BlockSelection.anyBlockSelected||!d||e.lastHovered===d)return;e.lastHovered=d;const h=this.Blok.BlockManager.getBlockByChildNode(d);h&&this.eventsDispatcher.emit(dy,{block:h})},20);this.readOnlyMutableListeners.on(this.nodes.redactor,"mousemove",i=>{o(i)},{passive:!0})}unbindReadOnlySensitiveListeners(){this.readOnlyMutableListeners.clearAll()}windowResize(){this.contentRectCache=null,this.setIsMobile()}documentKeydown(e){var o;switch((o=e.key)!=null?o:""){case"Enter":this.enterPressed(e);break;case"Backspace":case"Delete":this.backspacePressed(e);break;case"Escape":this.escapePressed(e);break;default:this.defaultBehaviour(e);break}}defaultBehaviour(e){const{currentBlock:t}=this.Blok.BlockManager,o=e.target.closest('[data-blok-testid="blok-editor"]'),i=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;if(!this.Blok.BlockSettings.contains(e.target)){if(t!==void 0&&o===null){this.Blok.BlockEvents.keydown(e);return}o||t&&i||(this.Blok.BlockManager.unsetCurrentBlock(),this.Blok.Toolbar.close())}}backspacePressed(e){if(this.Blok.BlockSettings.contains(e.target))return;const{BlockManager:t,BlockSelection:o,Caret:i}=this.Blok,a=X.isSelectionExists,c=X.isCollapsed;if(!(o.anyBlockSelected&&(!a||c===!0||this.Blok.CrossBlockSelection.isCrossBlockSelectionStarted)))return;const h=t.removeSelectedBlocks();if(h===void 0)return;const g=t.insertDefaultBlockAtIndex(h,!0);i.setToBlock(g,i.positions.START),o.clearSelection(e),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation()}escapePressed(e){if(this.Blok.BlockSelection.clearSelection(e),this.Blok.Toolbar.toolbox.opened){this.Blok.Toolbar.toolbox.close(),this.Blok.BlockManager.currentBlock&&this.Blok.Caret.setToBlock(this.Blok.BlockManager.currentBlock,this.Blok.Caret.positions.END);return}if(this.Blok.BlockSettings.opened){this.Blok.BlockSettings.close();return}if(this.Blok.InlineToolbar.opened){this.Blok.InlineToolbar.close();return}this.Blok.Toolbar.close()}enterPressed(e){const{BlockManager:t,BlockSelection:o}=this.Blok;if(this.someToolbarOpened)return;const i=t.currentBlockIndex>=0,a=X.isSelectionExists,c=X.isCollapsed;if(o.anyBlockSelected&&(!a||c===!0)){o.clearSelection(e),e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation();return}if(!this.someToolbarOpened&&i&&e.target.tagName==="BODY"){const d=this.Blok.BlockManager.insert();e.preventDefault(),this.Blok.Caret.setToBlock(d),this.Blok.Toolbar.moveAndOpen(d)}this.Blok.BlockSelection.clearSelection(e)}documentClicked(e){var x,w;if(!e.isTrusted)return;const t=e.target,o=this.nodes.holder.contains(t)||X.isAtBlok,i=this.nodes.redactor.contains(t),a=this.Blok.Toolbar.contains(t);(!(o||a)||!i&&!a)&&(this.Blok.BlockManager.unsetCurrentBlock(),this.Blok.Toolbar.close());const h=this.Blok.BlockSettings.contains(t),g=(x=this.Blok.Toolbar.nodes.settingsToggler)==null?void 0:x.contains(t),v=(w=this.Blok.Toolbar.nodes.plusButton)==null?void 0:w.contains(t),y=h||g||v,b=this.Blok.BlockSettings.opened&&!y;if(b&&this.Blok.BlockSettings.close(),b&&i){const T=this.Blok.BlockManager.getBlockByChildNode(t);this.Blok.Toolbar.moveAndOpen(T)}this.Blok.BlockSelection.clearSelection(e)}documentTouched(e){const t=e.target,o=(()=>{if(t!==this.nodes.redactor)return t;if(e instanceof MouseEvent){const i=document.elementFromPoint(e.clientX,e.clientY);return i!=null?i:t}if(e instanceof TouchEvent&&e.touches.length>0){const{clientX:i,clientY:a}=e.touches[0],c=document.elementFromPoint(i,a);return c!=null?c:t}return t})();try{this.Blok.BlockManager.setCurrentBlockByChildNode(o)}catch(i){this.Blok.RectangleSelection.isRectActivated()||this.Blok.Caret.setToTheLastBlock()}!this.Blok.ReadOnly.isEnabled&&!this.Blok.Toolbar.contains(t)&&this.Blok.Toolbar.moveAndOpen()}redactorClicked(e){if(!X.isCollapsed)return;const t=e.target,o=e.metaKey||e.ctrlKey;if(!(R.isAnchor(t)&&o)){this.processBottomZoneClick(e);return}e.stopImmediatePropagation(),e.stopPropagation();const a=t.getAttribute("href");if(!a)return;const c=xS(a);ES(c)}processBottomZoneClick(e){var v,y;const t=this.Blok.BlockManager.getBlockByIndex(-1),o=R.offset(t.holder).bottom,i=e.pageY,{BlockSelection:a}=this.Blok;if(!(e.target instanceof Element&&e.target.isEqualNode(this.nodes.redactor)&&!a.anyBlockSelected&&o<i))return;e.stopImmediatePropagation(),e.stopPropagation();const{BlockManager:d,Caret:h,Toolbar:g}=this.Blok;(!((v=d.lastBlock)!=null&&v.tool.isDefault)||!((y=d.lastBlock)!=null&&y.isEmpty))&&d.insertAtEnd(),h.setToTheLastBlock(),g.moveAndOpen(d.lastBlock)}selectionChanged(){var h;const{CrossBlockSelection:e,BlockSelection:t}=this.Blok,o=X.anchorElement;if(e.isCrossBlockSelectionStarted&&t.anyBlockSelected&&((h=X.get())==null||h.removeAllRanges()),!o&&!X.range&&this.Blok.InlineToolbar.close(),!o)return;const i=o.closest('[data-blok-testid="block-content"]'),a=i===null||i.closest('[data-blok-testid="blok-editor"]')!==this.nodes.wrapper,c=o.getAttribute("data-blok-inline-toolbar")==="true";a&&!this.Blok.InlineToolbar.containsNode(o)&&this.Blok.InlineToolbar.close(),!(a&&!c)&&(this.Blok.BlockManager.currentBlock||this.Blok.BlockManager.setCurrentBlockByChildNode(o),this.Blok.InlineToolbar.tryToShow(!0))}enableInputsEmptyMark(){const e=t=>{const o=t.target;mv(o)};this.readOnlyMutableListeners.on(this.nodes.wrapper,"input",e),this.readOnlyMutableListeners.on(this.nodes.wrapper,"focusin",e),this.readOnlyMutableListeners.on(this.nodes.wrapper,"focusout",e)}}const YC={BlocksAPI:v1,CaretAPI:b1,EventsAPI:k1,I18nAPI:Zu,API:w1,InlineToolbarAPI:T1,ListenersAPI:S1,NotifierAPI:C1,ReadOnlyAPI:E1,SanitizerAPI:U1,SaverAPI:W1,SelectionAPI:K1,ToolsAPI:V1,StylesAPI:$1,ToolbarAPI:G1,TooltipAPI:ax,UiAPI:cx,BlockSettings:$x,Toolbar:Zx,InlineToolbar:eC,BlockEvents:oC,BlockManager:RC,BlockSelection:OC,Caret:Kd,CrossBlockSelection:PC,ModificationsObserver:MC,Paste:Vd,ReadOnly:FC,RectangleSelection:di,Renderer:zC,Saver:HC,Tools:$C,UI:XC};class QC{constructor(e){this.moduleInstances={},this.eventsDispatcher=new Ko,this.config={},this.isReady=new Promise((t,o)=>{Promise.resolve().then(async()=>{this.configuration=e,this.validate(),this.init(),await this.start(),await this.render();const{BlockManager:i,Caret:a,UI:c,ModificationsObserver:d}=this.moduleInstances;c.checkEmptiness(),d.enable(),this.configuration.autofocus===!0&&this.configuration.readOnly!==!0&&a.setToBlock(i.blocks[0],a.positions.START),t()}).catch(i=>{Be(`Blok is not ready because of ${i}`,"error"),o(i)})})}set configuration(e){var h,g,v,y,b,x;Ue(e)?this.config=be({},e):this.config={holder:e},this.config.holder==null&&(this.config.holder="blok"),this.config.logLevel==null&&(this.config.logLevel=lv.VERBOSE),bS(this.config.logLevel),this.config.defaultBlock=(h=this.config.defaultBlock)!=null?h:"paragraph";const t=this.config.tools,o=this.config.defaultBlock,i=t!=null&&Object.prototype.hasOwnProperty.call(t,o!=null?o:""),a=(g=this.config.data)==null?void 0:g.blocks,c=Array.isArray(a)&&a.length>0;if(o&&o!=="paragraph"&&!i&&!c){Be(`Default block "${o}" is not configured. Falling back to "paragraph" tool.`,"warn"),this.config.defaultBlock="paragraph";const w=this.config.tools,T=be({},w!=null?w:{}),C=T.paragraph;T.paragraph=this.createParagraphToolConfig(C),this.config.tools=T}this.config.minHeight=this.config.minHeight!==void 0?this.config.minHeight:300;const d={type:this.config.defaultBlock,data:{}};this.config.placeholder===void 0&&(this.config.placeholder=!1),this.config.sanitizer=(v=this.config.sanitizer)!=null?v:{},this.config.hideToolbar=(y=this.config.hideToolbar)!=null?y:!1,this.config.tools=this.config.tools||{},this.config.i18n=this.config.i18n||{},this.config.data=this.config.data||{blocks:[]},this.config.onReady=this.config.onReady||(()=>{}),this.config.onChange=this.config.onChange||(()=>{}),this.config.inlineToolbar=this.config.inlineToolbar!==void 0?this.config.inlineToolbar:!0,(lt(this.config.data)||!this.config.data.blocks||this.config.data.blocks.length===0)&&(this.config.data={blocks:[d]}),this.config.readOnly=this.config.readOnly||!1,(b=this.config.i18n)!=null&&b.messages&&Ge.setDictionary(this.config.i18n.messages),this.config.i18n.direction=((x=this.config.i18n)==null?void 0:x.direction)||"ltr"}get configuration(){return this.config}validate(){const{holder:e}=this.config;if(dn(e)&&!R.get(e))throw Error(`element with ID «${e}» is missing. Pass correct holder's ID.`);if(e&&Ue(e)&&!R.isElement(e))throw Error("«holder» value must be an Element node")}init(){this.constructModules(),this.configureModules()}async start(){await["Tools","UI","BlockManager","Paste","BlockSelection","RectangleSelection","CrossBlockSelection","ReadOnly"].reduce((t,o)=>t.then(async()=>{try{await this.moduleInstances[o].prepare()}catch(i){if(i instanceof Wo)throw new Error(i.message);Be(`Module ${o} was skipped because of %o`,"warn",i)}}),Promise.resolve())}render(){const e=this.moduleInstances.Renderer;if(!e)throw new Wo("Renderer module is not initialized");if(!this.config.data)throw new Wo("Blok data is not initialized");return e.render(this.config.data.blocks)}constructModules(){Object.entries(YC).forEach(([e,t])=>{try{this.moduleInstances[e]=new t({config:this.configuration,eventsDispatcher:this.eventsDispatcher})}catch(o){Be(`[constructModules] Module ${e} skipped because`,"error",o)}})}configureModules(){for(const e in this.moduleInstances)Object.prototype.hasOwnProperty.call(this.moduleInstances,e)&&(this.moduleInstances[e].state=this.getModulesDiff(e))}createParagraphToolConfig(e){if(e===void 0)return{config:{preserveBlank:!0}};if(De(e))return{class:e,config:{preserveBlank:!0}};if(Ue(e)){const t=e,o=t.config;return _t(be({},t),{config:_t(be({},Ue(o)?o:{}),{preserveBlank:!0})})}return{config:{preserveBlank:!0}}}getModulesDiff(e){const t={};for(const o in this.moduleInstances)o!==e&&(t[o]=this.moduleInstances[o]);return t}}const Ks=class Ks{constructor({data:e,config:t,api:o,readOnly:i}){this.api=o,this.readOnly=i,this._settings=t||{},this._data=this.normalizeData(e),this._element=this.getTag()}get _CSS(){return{block:this.api.styles.block,wrapper:"blok-header"}}isHeaderData(e){return typeof e=="object"&&e!==null&&"text"in e}normalizeData(e){if(!this.isHeaderData(e))return{text:"",level:this.defaultLevel.number};const t=parseInt(String(e.level)),o=e.level!==void 0&&!isNaN(t);return{text:e.text||"",level:o?t:this.defaultLevel.number}}render(){return this._element}renderSettings(){return this.levels.map(e=>({icon:e.svg,label:this.api.i18n.t(`Heading ${e.number}`),onActivate:()=>this.setLevel(e.number),closeOnActivate:!0,isActive:this.currentLevel.number===e.number}))}setLevel(e){this.data={level:e,text:this.data.text}}merge(e){this._element.insertAdjacentHTML("beforeend",e.text)}validate(e){return e.text.trim()!==""}save(e){return{text:e.innerHTML,level:this.currentLevel.number}}static get conversionConfig(){return{export:"text",import:"text"}}static get sanitize(){return{level:!1,text:{}}}static get isReadOnlySupported(){return!0}get data(){return this._data.text=this._element.innerHTML,this._data.level=this.currentLevel.number,this._data}set data(e){if(this._data=this.normalizeData(e),e.level!==void 0&&this._element.parentNode){const t=this.getTag();t.innerHTML=this._element.innerHTML,this._element.parentNode.replaceChild(t,this._element),this._element=t}e.text!==void 0&&(this._element.innerHTML=this._data.text||"")}getTag(){const e=document.createElement(this.currentLevel.tag);return e.innerHTML=this._data.text||"",e.className=Te(this._CSS.wrapper,Ks.BASE_STYLES,this.currentLevel.styles),e.contentEditable=this.readOnly?"false":"true",e.setAttribute("data-placeholder",this.api.i18n.t(this._settings.placeholder||"")),e}get currentLevel(){const e=this.levels.find(t=>t.number===this._data.level);return e!=null?e:this.defaultLevel}get defaultLevel(){if(!this._settings.defaultLevel)return this.levels[1];const e=this.levels.find(t=>t.number===this._settings.defaultLevel);return e||(console.warn("(ง'̀-'́)ง Heading Tool: the default level specified was not found in available levels"),this.levels[1])}get levels(){const e=[{number:1,tag:"H1",svg:_x,styles:"text-[2.5em] font-bold"},{number:2,tag:"H2",svg:Nx,styles:"text-[2em] font-semibold"},{number:3,tag:"H3",svg:Rx,styles:"text-[1.75em] font-semibold"},{number:4,tag:"H4",svg:Ox,styles:"text-[1.5em] font-semibold"},{number:5,tag:"H5",svg:Lx,styles:"text-[1.25em] font-semibold"},{number:6,tag:"H6",svg:Dx,styles:"text-base font-semibold"}];return this._settings.levels?e.filter(t=>this._settings.levels.includes(t.number)):e}onPaste(e){var d;const t=e.detail;if(!("data"in t))return;const o=t.data,a=(d={H1:1,H2:2,H3:3,H4:4,H5:5,H6:6}[o.tagName])!=null?d:this.defaultLevel.number,c=this._settings.levels?this._settings.levels.reduce((h,g)=>Math.abs(g-a)<Math.abs(h-a)?g:h):a;this.data={level:c,text:o.innerHTML}}static get pasteConfig(){return{tags:["H1","H2","H3","H4","H5","H6"]}}static get toolbox(){return{icon:Px,title:"Heading"}}};Ks.BASE_STYLES="py-[0.6em] pb-[3px] px-0 m-0 leading-[1.25em] outline-none [&_p]:!p-0 [&_p]:!m-0 [&_div]:!p-0 [&_div]:!m-0";let Jd=Ks;const fi=class fi{static get version(){return as()}constructor(e){this.initialConfiguration=Ue(e)?be({},e):e;const t=Ue(e)&&De(e.onReady)?e.onReady:()=>{},o=new QC(e);this.destroy=()=>{},this.isReady=o.isReady.then(()=>{this.exportAPI(o),t()})}exportAPI(e){var w,T;const t=["configuration"],o=()=>{Object.values(e.moduleInstances).forEach(C=>{if(C==null)return;De(C.destroy)&&C.destroy();const O=C.listeners;O&&De(O.removeAll)&&O.removeAll()}),lx();for(const C in this)Object.prototype.hasOwnProperty.call(this,C)&&delete this[C];Object.setPrototypeOf(this,null)};t.forEach(C=>{if(C!=="configuration"){this[C]=e[C];return}const O=e.configuration,L=Ue(this.initialConfiguration)?this.initialConfiguration:O!=null?O:this.initialConfiguration;L!==void 0&&(this[C]=L)}),this.destroy=o;const i=e.moduleInstances.API.methods,a=(T=(w=e.moduleInstances.EventsAPI)==null?void 0:w.methods)!=null?T:i.events;if(a!==void 0){const C=O=>{Object.prototype.hasOwnProperty.call(O,"eventsDispatcher")||Object.defineProperty(O,"eventsDispatcher",{value:a,configurable:!0,enumerable:!0,writable:!1})};C(i),C(this)}Object.getPrototypeOf(i)!==fi.prototype&&Object.setPrototypeOf(i,fi.prototype),Object.setPrototypeOf(this,i);const c=Object.create(null),d=e.moduleInstances,h=d,g=C=>/^[A-Z]+$/.test(C)?C.toLowerCase():C.charAt(0).toLowerCase()+C.slice(1);Object.keys(h).forEach(C=>{const O=g(C);Object.defineProperty(c,O,{configurable:!0,enumerable:!0,get:()=>h[C]})});const v=d.Toolbar,y=d.BlockSettings;v!==void 0&&y!==void 0&&v.blockSettings===void 0&&(v.blockSettings=y);const b=d.InlineToolbar;v!==void 0&&b!==void 0&&v.inlineToolbar===void 0&&(v.inlineToolbar=b),Object.defineProperty(this,"module",{value:c,configurable:!0,enumerable:!1,writable:!1}),delete this.exportAPI,Object.entries({blocks:{clear:"clear",render:"render"},caret:{focus:"focus"},events:{on:"on",off:"off",emit:"emit"},saver:{save:"save"}}).forEach(([C,O])=>{Object.entries(O).forEach(([L,U])=>{const H=C,Y=e.moduleInstances.API.methods[H];this[U]=Y[L]})})}};fi.Header=Jd;let ef=fi;const Ot={wrapper:kt("fixed z-[2] bottom-5 left-5",'font-[-apple-system,BlinkMacSystemFont,"Segoe_UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira_Sans","Droid_Sans","Helvetica_Neue",sans-serif]'),notification:kt("relative w-[230px] mt-[15px] py-[13px] px-4","bg-white shadow-[0_11px_17px_0_rgba(23,32,61,0.13)] rounded-[5px]","text-sm leading-[1.4em] break-words",'before:content-[""] before:absolute before:block before:top-0 before:left-0',"before:w-[3px] before:h-[calc(100%-6px)] before:m-[3px] before:rounded-[5px] before:bg-transparent"),crossBtn:kt("absolute top-[7px] right-[15px] w-2.5 h-2.5 p-[5px] opacity-55 cursor-pointer",'before:content-[""] before:absolute before:left-[9px] before:top-[5px] before:h-3 before:w-0.5 before:bg-[#575d67] before:rotate-[-45deg]','after:content-[""] after:absolute after:left-[9px] after:top-[5px] after:h-3 after:w-0.5 after:bg-[#575d67] after:rotate-45',"hover:opacity-100"),btnsWrapper:"flex flex-row flex-nowrap mt-[5px]",btn:"border-none rounded-[3px] text-[13px] py-[5px] px-2.5 cursor-pointer last:ml-2.5",okBtn:"bg-[#34c992] shadow-[0_1px_1px_0_rgba(18,49,35,0.05)] text-white hover:bg-[#2db583]",cancelBtn:"bg-[#f2f5f7] shadow-[0_2px_1px_0_rgba(16,19,29,0)] text-[#656b7c] hover:bg-[#e9ecee]",input:kt("max-w-[130px] py-[5px] px-2.5 bg-[#f7f7f7] border-0 rounded-[3px]","text-[13px] text-[#656b7c] outline-none","placeholder:text-[#656b7c] focus:placeholder:text-[rgba(101,107,124,0.3)]"),successNotification:kt("!bg-[#fafffe]","before:!bg-[#41ffb1]"),errorNotification:kt("!bg-[#fffbfb]","before:!bg-[#fb5d5d]"),bounceIn:"animate-notify-bounce-in"},tf=l=>{const e=document.createElement("DIV"),t=document.createElement("DIV"),o=l.message,i=l.style,a=()=>i==="success"?Ot.successNotification:i==="error"?Ot.errorNotification:"";return e.className=Te(Ot.notification,a()),i?e.setAttribute("data-blok-testid",`notification-${i}`):e.setAttribute("data-blok-testid","notification"),e.innerHTML=o,t.className=Ot.crossBtn,t.setAttribute("data-blok-testid","notification-cross"),t.addEventListener("click",()=>e.remove()),e.appendChild(t),e},ZC=l=>{const e=tf(l),t=document.createElement("div"),o=document.createElement("button"),i=document.createElement("button"),a=e.querySelector('[data-blok-testid="notification-cross"]'),c=l.cancelHandler,d=l.okHandler;return t.className=Ot.btnsWrapper,t.setAttribute("data-blok-testid","notification-buttons-wrapper"),o.innerHTML=l.okText||"Confirm",i.innerHTML=l.cancelText||"Cancel",o.className=kt(Ot.btn,Ot.okBtn),i.className=kt(Ot.btn,Ot.cancelBtn),o.setAttribute("data-blok-testid","notification-confirm-button"),i.setAttribute("data-blok-testid","notification-cancel-button"),c&&typeof c=="function"&&i.addEventListener("click",c),c&&typeof c=="function"&&a&&a.addEventListener("click",c),d&&typeof d=="function"&&o.addEventListener("click",d),o.addEventListener("click",()=>e.remove()),i.addEventListener("click",()=>e.remove()),t.appendChild(o),t.appendChild(i),e.appendChild(t),e},JC=l=>{const e=tf(l),t=document.createElement("div"),o=document.createElement("button"),i=document.createElement("input"),a=e.querySelector('[data-blok-testid="notification-cross"]'),c=l.cancelHandler,d=l.okHandler;return t.className=Ot.btnsWrapper,o.innerHTML=l.okText||"Ok",o.className=kt(Ot.btn,Ot.okBtn),i.className=Ot.input,i.setAttribute("data-blok-testid","notification-input"),l.placeholder&&i.setAttribute("placeholder",l.placeholder),l.default&&(i.value=l.default),l.inputType&&(i.type=l.inputType),c&&typeof c=="function"&&a&&a.addEventListener("click",c),d&&typeof d=="function"&&o.addEventListener("click",()=>{d(i.value)}),o.addEventListener("click",()=>e.remove()),t.appendChild(i),t.appendChild(o),e.appendChild(t),e},eE=()=>{const l=document.createElement("DIV");return l.className=Ot.wrapper,l.setAttribute("data-blok-testid","notifier-container"),l},tE=8e3,nE=()=>{const l=document.querySelector('[data-blok-testid="notifier-container"]');if(l)return l;const e=eE();return document.body.appendChild(e),e},Yy=l=>{if(!l.message)return;const e=nE(),t=l.time||tE,o=(()=>{switch(l.type){case"confirm":return ZC(l);case"prompt":return JC(l);default:{const i=tf(l);return window.setTimeout(()=>{i.remove()},t),i}}})();e&&o&&(e.appendChild(o),o.className=`${o.className} ${Ot.bounceIn}`,o.setAttribute("data-blok-bounce-in","true"))},rE=Object.freeze(Object.defineProperty({__proto__:null,default:{show:Yy},show:Yy},Symbol.toStringTag,{value:"Module"}));return ef}));